It would be really neat with a feature that showed how long you
used on a session in the review summary. It would give you a better
sense of how much time you use, and would help you manage it more
realistically in everyday life. Setting an egg timer every time seems like a bother.
What’s your opinion?
this is actually in the realm of incredibly easy, ill probably make it if no one else has after i finish working today
edit: https://greasyfork.org/en/scripts/16316-wanikani-egg-timer
So like you’d basically know how long your reviews are taking?
mahum said... So like you'd basically know how long your reviews are taking?Yup. It differs from day to day, so an automatic indicator would be nice.
Frouzich said...That'd be cool. I'm sure it would help a lot of people because you see a bunch of threads on how long to spend on reviews. It would probably help people gauge how much time they have to do wk. :D Nice idea!mahum said... So like you'd basically know how long your reviews are taking?Yup. It differs from day to day, so an automatic indicator would be nice.
horusscope said... this is actually in the realm of incredibly easy, ill probably make it if no one else has after i finish working todayCan't wait @horusscope!
// ==UserScript==
// @name Wanikani Egg Timer
// @namespace wkeggtimer
// @description Adds a timer during reviews and displays the final time afterward
// @include WaniKani — Log in*
// @include WaniKani — Log in*
// @version 0.1
// @author Horus Scope
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @license GPL version 3 or later: The GNU General Public License v3.0 - GNU Project - Free Software Foundation
// ==/UserScript==
function timeStamp( inc = 0 ) {
var prev = GM_getValue(“eggtimer”);
prev += inc;
GM_setValue(“eggtimer”,prev);
// Yes, parseInt is prettier.
var hours = Math.floor(prev / 60 / 60);
var minutes = Math.floor( (prev - (hours6060)) / 60 );
var seconds = prev - hours6060 - minutes*60;
return “”
+ (hours? hours+"h " : “”)
+ (minutes? minutes+"m " : “”)
+ (seconds? seconds+“s” : “”);
}
var timeSpan; // referenced in go( )
function generate( ) {
var display = document.createElement(‘div’);
display.className = ‘timerSessionDisplay’; // no style actually defined
timeSpan = document.createElement(‘span’);
timeSpan.className = ‘timerSessionSpan’; // no style actually defined
timeSpan.textContent = "Last review: " + timeStamp( );
display.appendChild(timeSpan);
return display;
}
// start counting. [or, dont]
function go( )
{
// style
var styleStr = “”; // <div class=“timerSessionDisplay”><span class=“timerSessionSpan”>
GM_addStyle(styleStr);;
// change behavior depending on screen [summary, reviewing now]
if(/session$/.exec(window.location.href)) { // review/session [ reviewing now ]
GM_setValue(“eggtimer”,0); // time start
var header = document.getElementById(‘summary-button’); // because easy
var display = generate( ); // makes div object
header.appendChild( display );
setInterval(function() {timeSpan.textContent = "Elapsed: " + timeStamp( 1 );}, 1000);
} else { // review [ summary screen ]
var footer = document.getElementById(‘last-session-date’); // makes sense
var display = generate( );
footer.insertBefore(display, footer.childNodes[0]); // probably float:left btw
}
}
window.onload = go( );
horusscope said... // ==UserScript==What do you even do with this? ;A;
// @name Wanikani Egg Timer
// @namespace wkeggtimer
// @description Adds a timer during reviews and displays the final time afterward
// @include http://www.wanikani.com/review*
// @include https://www.wanikani.com/review*
// @version 0.1
// @author Horus Scope
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @license GPL version 3 or later: http://www.gnu.org/copyleft/gpl.html
// ==/UserScript==
function timeStamp( inc = 0 ) {
var prev = GM_getValue("eggtimer");
prev += inc;
GM_setValue("eggtimer",prev);
// Yes, parseInt is prettier.
var hours = Math.floor(prev / 60 / 60);
var minutes = Math.floor( (prev - (hours*60*60)) / 60 );
var seconds = prev - hours*60*60 - minutes*60;
return ""
+ (hours? hours+"h " : "")
+ (minutes? minutes+"m " : "")
+ (seconds? seconds+"s" : "");
}
var timeSpan; // referenced in go( )
function generate( ) {
var display = document.createElement('div');
display.className = 'timerSessionDisplay'; // no style actually defined
timeSpan = document.createElement('span');
timeSpan.className = 'timerSessionSpan'; // no style actually defined
timeSpan.textContent = "Last review: " + timeStamp( );
display.appendChild(timeSpan);
return display;
}
// start counting. [or, dont]
function go( )
{
// style
var styleStr = ""; // <div class="timerSessionDisplay"><span class="timerSessionSpan">
GM_addStyle(styleStr);;
// change behavior depending on screen [summary, reviewing now]
if(/session$/.exec(window.location.href)) { // review/session [ reviewing now ]
GM_setValue("eggtimer",0); // time start
var header = document.getElementById('summary-button'); // because easy
var display = generate( ); // makes div object
header.appendChild( display );
setInterval(function() {timeSpan.textContent = "Elapsed: " + timeStamp( 1 );}, 1000);
} else { // review [ summary screen ]
var footer = document.getElementById('last-session-date'); // makes sense
var display = generate( );
footer.insertBefore(display, footer.childNodes[0]); // probably float:left btw
}
}
window.onload = go( );
Works wonderfully. Thanks.
@mahum
Copy it. Open your add-ons tab on Firefox. Go to user scripts. New user script… Click “Use Script from Clipboard”.
@mahum
add it as a greasemonkey userscript
just paste it in there
mahum said...I'm guessing you don't have a greasyfork account @horusscope ?horusscope said... // ==UserScript==What do you even do with this? ;A;
https://greasyfork.org/en/scripts/16316-wanikani-egg-timer
added to greasyfork
never mind
horusscope said... https://greasyfork.org/en/scripts/16316-wanikani-egg-timerThanks horusscope, it didn't seem to work when I copied and pasted, but I will find out whether this will work in about an hour
added to greasyfork
Crunderwood said...If you're using Chrome, I'm pretty sure what the issue might be. (even without looking at the code)horusscope said... https://greasyfork.org/en/scripts/16316-wanikani-egg-timerThanks horusscope, it didn't seem to work when I copied and pasted, but I will find out whether this will work in about an hour
added to greasyfork
horusscope said... https://greasyfork.org/en/scripts/16316-wanikani-egg-timerThank you!
added to greasyfork
Yeah, doesn’t work on Chome. No duration displayed at the summary page.
Haha, yea, Chrome doesn’t like GM_* functions…
I use jStorage for local storage now. (very handy because Tofugu does so too)
Mempo said... Haha, yea, Chrome doesn't like GM_* functions...How do I use jStorage? (want to know before I go through downloading etc.)
I use jStorage for local storage now. (very handy because Tofugu does so too)
Crunderwood said...It's already on the website actually. WK uses it for reviews and lessons. But there's nothing you can do with it though, unless you want to rewrite horusscope's script. I merely meant I use it whenever I write a new script because it works on any modern browser.Mempo said... Haha, yea, Chrome doesn't like GM_* functions...How do I use jStorage? (want to know before I go through downloading etc.)
I use jStorage for local storage now. (very handy because Tofugu does so too)