Hi guys, I’ve been recently having a lot of issues on my sessions that go away when I disable the userscript, like heavy delay, or having to type symbols (`, .) and type an extra space at the end of the word if it’s in Chinese. It started happening some days ago.
Is this happening to someone else? If that’s the case it would be great if the script was fixed, memrise feels really slow without it.
Memrise Turbo is still working for me. However, it’s running more slowly now that it was a couple weeks ago, and there are delays when I’m using a Chrome-based browser that I haven’t noticed with Firefox.
I assume you had the script adaptations to account for ime input. There was a new issue I had with the script which was actually related to a chrome update, which slightly broke the correct checking behaviour… you can try the fix below. Note that this covers screwy ime input checking only, if the script works slow for you and you’re not using ime these changes probably won’t do you any good.
I swapped out the middle part (the entire ‘body’ section) with the code below, it includes a separate additional tweak whereby you can press ‘;’ instead of space to submit, which also acts to clear the box if your answer is wrong… you can take that part out if you like.
var isComposing = false;
var cachedEvent;
$('body').on('compositionstart', function() {
isComposing = true;
});
$('body').on('compositionend', function() {
isComposing = false;
processInput(cachedEvent);
});
$('body').on('input', function(e) {
cachedEvent = e;
if ($(e.target).is('input') && !(isComposing)) {
processInput(e);
}
});
function processInput(e)
{
try {
var g = MEMRISE.garden;
var b = g.box;
var v = b.$input.val();
var lastChar = v.slice(-1);
var clearBox = false;
if(lastChar === "·" || lastChar === ";" || lastChar === ";") {
clearBox = true;
b.$input.val(v.slice(0, -1));
}
var s = g.scoring.score_response(
b.$input.val(),b.thing,b.column_a,b.column_b);
if (s === 1) {
MEMRISE.garden.box.check();
} else {
if(clearBox) {
b.$input.val("");
}
}
} catch (err) {
console.log('error - falling back to default behavior', err);
}
}