[Userscript] WaniKani Custom Immersive Dashboard

:warning: This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.

Current version - 1.5.2

Foreword

Hi everyone!

When I was somewhat new to WaniKani I found out about Userscripts. However, since I’m a web developer by trade and I hadn’t dabbled in Userscripts before I figured this was the perfect opportunity to get my hands dirty learning, so instead of looking for an immersive dashboard replacement I built my own.

I first thought I wasn’t really actively developing this, but looking at my version history, I actually tinker with this far more than I realised, and I always try to be prompt if anyone lets me know of bugs, so I’ll say I’m active, but not necessarily building to broader requirements. Though if anyone has suggestions please add them and I’ll see what I can do!

Prerequisites

Pretty straightforward here, you just need to have a script host plugin (I use Tampermonkey) and WaniKani Open Framework and set it to execute before my script.

Known deficiencies

I created this userscript purely for my own use, but I'm quite comfortable with what I've created that I felt it worth sharing, however I am well aware of a number of deficiencies with my script that I may or may not deal with in future. I've put this section near the top as a quick reference point, as such the details for some of these are in the Userscript details section.

Known deficiencies list
  • WaniKani has updated the lesson session HTML structure, so the skip lesson summary doesn’t work since the HTML is too generic to properly target at the moment
  • Sometimes if your browser has closed unexpectedly or (like me) you have your browser open up with the last open pages, then the navigation lesson/review shortcut values may not match the dashboard values, this is purely due to caching as the shortcut uses base WaniKani (I just modify the HTML) and the custom dashboard uses my code so reloads (almost) every time - also sometimes cached information won’t load before code execution, so just reload
  • The next reviews summary hover display will only show the next reviews over the next 24 hours rather than the next week, and it may extend passed the visible screen but you can’t scroll down to see
  • Since I am quite the novice when it comes to Japanese, I’ve had to rely on translators and such for many of the titles and sentences in the dashboard, so please bear that in mind if something reads strangely
  • I have not catered for accessibility like colour contrasting, screen readers and the like
  • The dashboard sizing and styling is based on my 24" HP monitor and my Surface Pro 4 screens so I hazard to guess that on smaller screens it may not look very nice, and I definitely have not catered for mobile at this stage purely because I can’t be bothered messing around with my phone to have it available and I won’t worry about mobile for now until I can actually use it on my mobile
  • I know the community feed is missing, but it was never very useful to me, I just use the “Community” link in the Profile menu if I need to go there

Basic troubleshooting

There really aren't many issues I've come across yet, but the fix is usually to refresh the browser a few times because of caching or settings not being loaded. I've added an actual wait function for the WKOF settings to load, but if the load takes longer than 10 seconds an error will display needing a page refresh or some other troubleshooting.

Userscript details

Installation

Assuming you have completed the prerequisites (if not, go back and do that) then install from GreasyFork. With Tampermonkey it automatically takes you to the installation screen so you just click Install. If you are using any compatible userscripts, please make sure to put this one at the top of the list under WKOF so that the custom dashboard wrapper is available before the other userscripts load. For example in Tampermonkey:

  1. WKOF
  2. WaniKani Custom Dashboard
  3. Other userscript
  4. Another userscript

After that, just refresh WaniKani! Or go to the website, whichever you need to at this point :smile:

Compatibility with other Userscripts and Userstyles

Based on feedback, I've endeavored to make my script somewhat compatible with a number of common dashboard related userscripts listed in section 7 of the My Journey of 368 days (+ The Ultimate Guide for WK) post, and currently one Userstyle as well.

Compatible userscripts
  • WaniKani Item Inspector - This should work like it normally does, I just catered for the insert selectors.
  • WaniKani Ultimate Timeline - This should work like it normally does, I just catered for the insert selectors.
  • WaniKani Lesson Hover Details - This worked out of the box, however with my custom dashboard it will only work on the navigation lesson shortcut button as I already break down the lessons by item type in the summary.
  • Level Duration 2.0 - This worked without any changes on my part, hooray!
  • Wanikani Heatmap - This should work like it normally does, I just catered for the insert selectors.
  • Progress Percentages - This already worked without any changes on my part, but hopefully the selector adjustments I’ve made will prevent this from disappearing in future.
  • WaniKani Leaderboard - This should work like it normally does, I just catered for the insert selectors.
  • Self Study Quiz - Works out of the box since it doesn’t really impact the dashboard itself
  • Leech Training - Not part of the recommended list in the guide, but this was a recommendation that I figured it worth adding
Excluded userscripts
Compatible userstyles

Note that something like the Stylus addon is required to install Userstyles.

  • WaniKani Breeze Dark - Another user (Erid) actually showed me a snapshot of my Custom Dashboard and this Userstyle together with a small local fix they made, and I greatly enjoy the extra theming to WaniKani overall, so I’ve added a second dropdown list to the Theme settings for compatibility with this Userstyle

Changelog

Please find the list of changes per version in descending order below as best I can describe:

Intended future updates (in no particular order)
  • Additional configurations - update shortcut nav on all pages, ???
  • Improve debugging so that individual sections can be debugged rather than the entire dashboard for each option
  • ???
  • Profit
Version history (was starting to get long)

/start-version-history

Version 1.5.2 - 15th January 2022 - Added a setting to disable lesson buttons based on Apprentice item total
  • Based on lots of advice on the forums and my own need to reduce the number of reviews with higher Apprentice items, an Optional Setting has been added where you enable it and set a value where the lesson buttons (main and shortcut) are disabled when the total count of Apprentice items is equal to or greater than the number set - i.e. Enable option and set to 100, lesson buttons are disabled until the Apprentice count is under 100, so 99 or less
Version 1.5.1 - 26th August 2021 - Fix difficult items data source
  • Fixed issue from new header count references for difficult items that was counting all items up to one level above the Safe Level set level
Version 1.5 - 14th August 2021 - Added difficult items header reference counters and fix mid-lesson Go to homepage reference
  • Added a reference total for difficult items that might disappear in the current or next review session - only shows if displaying difficult items and the “Highlight items that may move out of difficult items list” setting is enabled
  • Added a reference total for the number of additional difficult items to be added if level up is in the current or next review session - only shows if displaying difficult items and both the “Highlight items that may move out of difficult items list” and “Identify if you might level up” settings are enabled
  • Fixed the “Go to homepage” button reference for skipping lesson summaries if you’re only part way through your lessons but finished the current batch
Version 1.4.8 - 12th April 2021 - Added WKOF settings check and minor bug fixes
  • Added an actual WKOF and WK Custom Dashboard settings loaded check with a 10 second failure timeout
  • Moved dashboard page loader to separate component
  • Fix issue with next review times not working for browsers using 24 hour time
  • Code alteration to use arrow functions
Version 1.4.7 - 6th April 2021 - Might level up indicator, header hover translations, and minor bug fixes
  • Added a setting that when enabled it will check the current review kanji, and the kanji in the immediate next review time, and if a user has enough kanji ready that passing them all would level them up then the level progress circle will pulse
  • Added the ability to set “translate on hover” for headers, covers English, Japanese Hiragana Reading, and both
  • Minor bug fixes - Kanji locked background colour and radical tooltip text colour fixes for WaniKani Breeze Dark compatability theme, and added a check for compatibility themes so that an empty style HTML element isn’t added to the page when “None” is selected
Version 1.4.6 - 25th March 2021 - Userstyle theme compatibility support
  • Since being shown the WaniKani Breeze Dark theme, I’ve added a framework for making my dashboard compatible with Userstyles that I personally like, so I won’t be covering all of them that people suggest
  • Added dynamic function to set the text colour of each item based on whether the background is too dark or too light, mostly to accommodate the ability to change kanji/radical/vocabulary background colours in WaniKani Breeze Dark theme
Version 1.4.5 - 15th March 2021 - Identify difficult items that are up for review that may leave the list
  • I know I’m probably the only one using the difficult items section, but I added a setting to allow difficult items that are on the selected SRS Level cap to be subtly identified if they are in the outstanding reviews list, or the next review hour, but NOT in future reviews
Version 1.4.4 - 2nd March 2021 - WaniKani System Banner support
  • Finally got a system banner to work with, so refactored dashboard wrapper code to keep the old dashboard wrapper and just replace the existing with my dashboard parts
Version 1.4.3 - 28th Feb 2021 - Bug fix for skip session summary feature
  • Noticed and fixed display and functionality issue with skip summary feature on lesson sessions, and adjusted styling attachment
  • Added setTimeout to review session skip once finished, though this may cause the page to jump prematurely (though I don’t imagine this to be an issue overall)
Version 1.4.2 - 27th Feb 2021 - Add skip session summary option, debug toggle now in settings
  • Added an option that allows you to skip the session summary straight back to the dashboard if you like, please note that for reviews this may not always work because of the different way vanilla WaniKani ends the session compared to lessons
  • Skip session summary option also changes Home icon destination to the dashboard as well
  • Finally worked out how to make sure settings are available, so now debugging is togglable in settings between data and HTML
Version 1.4.1 - 24th Feb 2021 - Bug fix for next review time display
  • I happened to use a different computer to log in, and the browser was using 24hr time instead of the 12hr my main PC uses, so made a minor fix to accommodate browsers using 24hr time, so no 午後 or 午前 is displayed in those cases, and made sure the 時 would show as it was missing before
Version 1.4 - 23rd Feb 2021 - Dark theme update
  • Added a theme option to settings - default or dark
  • Force move to top since the header banner doesn’t disappear at this stage (I don’t mind it always showing)
Version 1.3.2 - 21st Feb 2021 - Bug fix for custom dashboard wkof dialog styles
  • Fixed issue with WKOF settings dialogs getting custom styling when it should be restricted to Custom Dashboard settings dialog
Version 1.3.1 - 21st Feb 2021 - Project restructure and level progress sort update
  • Updated Level Progress In-Progress and Passed sections to be sorted by SRS level
  • Restructured code base from common files into component structure (see github project) - still requires some cleanup and refactoring but everything works for now
Version 1.3 - 7th Feb 2021 - Translation update
  • Added headings for the Level Progress sections
  • Added a Translation section to the settings
Version 1.2.1 - 4th Feb 2021 - Bug fix for difficult items setting
  • Fixed issue where Difficult Items weren’t disappearing when settings checkbox unchecked
Version 1.2 - 3rd Feb 2021 - Critical Items > Difficult Items + settings update
  • Changed “Critical Items” into “Difficult Items” and made it opt in via added settings
  • Settings for Difficult Items allow for users to specify the “Safe Level” and “SRS Stage” thresholds
Version 1.1.3 - 24th Jan 2021 - Bug fix for removing hardcoded timezone
  • Removed hardcoded timezone locale from Next reviews data generation, should now use the browser default timezone
Version 1.1.2 - 24th Jan 2021 - Styling bug fix for summary button alignment
  • Fixed styling issue for summaries where buttons are not aligned, they are now anchored to the bottom of the summaries
Version 1.1.1 - 24th Jan 2021 - Bug fix for summary number thresholds and empty array next review list
  • Fixed issue with custom summary H2 styles and code not accommodating numbers above 999
    Next review summary now caters up to 9,999 and Enlightened summary caters up to 99,999 (without the commas) with both changing to (~XX千) and (~XXX千) respectively (replace X with number at time of display)
  • Fixed issue with the Next review display showing undefined when a user has no reviews (returns empty array)
    Code now caters for that empty array and displays “次の復習をなんでもない” (loose translation: There are no next reviews) with 0’s for each item type
  • Updated main post to include number limits and explain the new number display
Version 1.1 - 23rd Jan 2021 - Compatibility update
  • Added WKOF check
  • Refactored dashboard generation code to accommodate other dashboard related userscripts
    Includes separating dashboard wrapper from content generation because some userscripts run faster than mine
  • Updated main WaniKani Community post to include Changelog and Compatibility list, and put pictures under the GIF and Known deficiencies list both into separate “Hide details” sections to save room
Version 1 - 22nd Jan 2021 - Initial release
  • Initial release to WaniKani Community

/end-version-history

Additional options

I've started branching into some non-dashboard functions that I wanted to add but didn't see the need for creating a completely new Userscript to cover them.

At the moment I’ve only added the ability to skip the Review session summary page, because they annoy me and I don’t find them useful. They’re only smallish changes, but I do need to mention:

  • WaniKani Lesson session HTML has changed so this doesn’t work at the moment. For the Lesson summary I’ve replaced the existing button with a “Go to homepage” button that can be clicked on the overlay
  • For the Review session I’ve added an event listener to the submit button that checks if you’re at 0 items, then sends you to the homepage, however please note that this may not work 100% of the time due to the vanilla WaniKani implementation of finishing a Review session which uses a similar method so it’s kind of a competition until I can work out whether I can remove the vanilla one :sweat_smile:
  • For both I’ve updated the “Home” icon to go to the homepage instead of the session summary page as well, for completeness

I have also added a setting to disable the Lesson buttons (regular and shortcut) until the total count of Apprentice items is less than the number set. This is based on many recommendations in the forums where people have too many reviews to wait until they’re under a certain number of Apprentice items, which has helped me a lot, so I figured forcing a wait until under that limit was worthwhile.

Dashboard overview

I have some smaller GIFs and reduced the excess of images for people to look at that have been taken of mainly the 1.4.5 version with some new 1.4.7 version items so hopefully it's better viewing!

Open for images

Main dashboard

This is set at the end of a level. ![general-dashboard|690x251](upload://dmXhvkkmuMWHyK9Yueq3E9dXU2w.gif)

This as a snapshot of the start of a level.

Next and future reviews
generic-dashboard-future-reviews

“Might Level Up” pulse effect
Default theme - Dark theme
level-up-light level-up-dark

Hover translations
English
en-hover
Japanese Hiragana Reading
jp-hg-hover
Both
both-hover

Settings
These are the default settings when you first install.

These are the translations if you’re like me and aren’t at a decent fluency level :sweat_smile:

Difficult Items (optional setting)
For those that might use it here’s adding the Difficult Items.
turn-on-difficult-items

This is what an individual item would look like if you turn on the Difficult Items identifier setting.
identify-difficult-items-item
And this as a whole, not too easy to spot, which is the point :smile:
identify-difficult-items-full

Themes
Here’s a snapshot of the Dark theme.

In general I’ve completely overhauled the original dashboard to display information I find far more useful than what vanilla WaniKani provides, for example:

  • Each kanji/radical/vocabulary item now displays the level it is from on the bottom right, and what its current srs level is on the top right
    For those that don’t know the SRS level: 0 is Unlocked, 1-4 is Apprentice, 5-6 is Guru, 7 is Master, 8 is Enlightened, and 9 is Burned
  • Each of those items also now has a hover tooltip that displays the kunyomi, onyomi, nanori, and meaning(s) of the item, though it also indicates the both the accepted and unaccepted readings and meanings with colours: green is accepted readings, grey is accepted meanings, maroon is unaccepted readings, and if there are any unaccepted meanings they’ll be black
  • Any section may contain a simple thin green ring, this indicates that the section is empty of items at that point in time
  • The page will also automatically refresh at the next review hour if the page is open in a browser at that time
  • I adjusted the backgrounds to be more palatable for myself instead of blocks of the same bright colours everywhere

GOOD NEWS EVERYONE! Especially those not as well versed in Japanese (like me). There’s now a Translations section in the settings!!
This being said, as of version 1.4.7 you can now enable translations on hover in the settings!

Custom and Compatible theming

I've always been very partial to dark themes, but figured that since I recreated the dashboard then most other themes wouldn't work without tweaking, so I made some of my own. Not only that, but I now have one holistic third party theme I really like, so I figured it worthwhile to accommodate it and leave the foundation for any future ones I may like.

Custom themes
There are two custom themes at this stage:

  • Default - uses the default WaniKani colours but provides some alterations to background colours
  • Dark - my own version of a dark theme

Compatible themes
PLEASE NOTE: If you activate a compatible theme AFTER loading the page, you will either have to open the settings and save, or reload the page to trigger the text colour check again. This is important when a Userstyle script has the ability for the user to set their own colours.

  • WaniKani Breeze Dark - (see Compatible userstyles above for link) this is actually a really cool theme covering the rest of WaniKani, so I made some small adjustments to accommodate it

Console debugging

This used to be a boolean toggle available in the installed script, but is now split into two checkbox options in settings. The reason it was split is because with both data and generated HTML debugging IT WILL SPAM YOUR BROWSER CONSOLE!!

Once you check one or both options in the settings and save, it will reload the pages to generate the debug information and display it in the browser console. If you don’t know how to get to that, press F12 and click the “Console” tab.

Sample HTML debug output:

In the sample above, please take notice of how each debug entry starts with “==” followed by the Component and the function name it was called in. This is to help me know where you might be having an issue if you send me debug information. The data debugging will show objects which you’ll need to copy as is or expand and screenshot, however the HTML debugging is a little different. Spamming the console with whole lots of HTML was tedious even for me, so I added the long ones to objects, so to see and copy the detail please expand the object then double click on the text to highlight is for copy as shown in the sample image.

In the future I might look at further improving this so that individual sections of information can be gotten via debug but it’s a little bit too much to bit into right now.

Top summary section

I took the review and lesson buttons, and the next review section from WaniKani and combined them into a singular section, but also added an overall kanji/radical/vocabulary totals summary as well because I was curious as to how many of each I was actually working with. For all of these summary section I took the liberty of having a total, but also breaking that total down into how many kanji, radicals, and vocabulary go into it.

The original lessons and reviews buttons were converted to simple summaries and a separate “start” button was added to each. These “start” buttons are grey when there’s nothing to do, but will have the original colours applied with a pulse effect when there are items to review or learn. This styling also applies to the navigation shortcut lesson/review buttons for when you’ve scrolled down the page.

The overall total summary won’t display an actual total, it is purely for understanding the overall number of kanji, radicals and vocabulary the user is working on.

The next reviews summary is just the immediate next review time and information. However if you hover over it then the next reviews over the next 24 hours are displayed. As noted in the overview, if the page is open it will also refresh at the next review summary time.
If there are more than 9,999 items to review at the next review time then the visual display will change to something like (~10千), it is a rounded number so for example 10,001-10,499 items will display as (~10千) but 10,500-10,999 items will display as (~11千). This is done purely due to space constraints, but from what I understand this threshold is unlikely to be exceeded anyway.

Level progress section

This section is simple enough:

  • The top row holds the level progress indicator as a ring instead of a bar, and has the unlocked kanji for the current level that have NOT been passed yet - note: as of v1.4.7 if you enable the setting then the indicator ring will subtly pulse when you have enough kanji in your current and immediate next review time to possibly level up
  • The second row holds the unlocked radicals for the current level that have NOT been passed
  • The third and fourth rows hold the PASSED kanji and radicals respectively for the current level
  • And the fifth row holds the locked kanji for the current level

All the items display like every other section, except the locked kanji since they have no assignment data and subsequently no current SRS level, and they’re sorted based on SRS stage in ascending order.

SRS level summary section

Like the top summary section, I also took the WaniKani SRS level summary section and converted it to Japanese, added the item type breakdown, but also added a button that actually shows the items themselves in that particular SRS level.

This is really not needed, but for consistency sake I added the 10k total items display reduction here that is also in the Next review summary section, but only to the “Enlightened” ( 悟りを開いた) SRS summary section.
I.E. If it has more than 9,999 items it’ll change to (~10千), and again it is a rounded number so 10,001-10,499 items will display as (~10千) but 10,500-10,999 items will display as (~11千).

All the kanji, radical, and vocabulary items display like every other section.

Difficult items section

This was previously "critical items".

This section is opt-in only and does not show by default as of v1.2. The primary purpose of this section is nothing more than self-interest in any items that you might have “difficulty” with. This is not like leeches or anything, it’s nothing more than a list of items based on “Safe Level” and “SRS Stage” thresholds.

I would imagine that this section wouldn’t be very useful to many since there are plenty of other Userscripts out there that give heaps of much better and intuitive information and tracking on leeches and the like (like WaniKani Item Inspector). However I have always thought that if I have items that are 3 levels or more lower than my current one and they’re still in Apprentice that I’m not doing as well as I could be with them, especially if I notice some bouncing back and forth from Apprentice to Guru.

The “calculation” is nothing more than how many levels lower than your current one you want to be the maximum item level, and what the highest SRS stage you think is worth monitoring. Simply put: if your level is 10, and you set the “Safe Level” threshold to 4 and “SRS Stage” to Guru 1, then only items up to and including level 6 that are in SRS stages Apprentice 1 through to Guru 1 will be shown in this list.

These thresholds are all configurable from settings, with defaults being:

  • Show Difficult Items section: false
  • Safe Level: 3
  • SRS Stage: Apprentice 1

Sorting for this section is by item level first, then by SRS stage within that level.

I have also added a setting for this section that basically adds a somewhat subtle pulse identifier to the SRS level indicator on the items that are in the current review list, or the next review list, that could be removed from the Difficult Items list if the review is successfully completed. Items that are beyond the immediate next review hour shown in the summary (NOT the hover) will not be identified.
E.G. If the SRS Stage cap is set to Guru1, only items in Guru1 will be identified if they’re up/next up for review.
As of v1.5 the difficult items header now shows two total counts:

  • One that shows a count of the items that may be removed if successfully reviewed based on above criteria - only shows if you have enabled the settings to identify upcoming difficult items removal
  • The other that shows a count of the items coming in to the list on possible level up - only shows if you have enabled the settings to identify upcoming difficult items removal AND identify if levelling up

I find this to be useful in that I can keep some kind of track of items that could potentially leave this section, but I don’t use it to study ahead though it could be used that way especially with the hover information.

18 Likes

Holy crap. This looks so 格好いい! I’m testing this out after I sleep now for about 6 hours. I’ll let you know how I feel about it then.

Also, does coding any script require knowledge of a programming language? Where do you learn how to create scripts?

1 Like

ありがとうございます!! It’s definitely not perfect but it follows my vision of a useful dashboard very well :slight_smile:

Please do! I posted it cause I’m interested in other peoples thoughts on it and also to kinda show off what I’m proud of haha.

Yes it does, but not to the same degree that I have purely due to my work being all about coding. It’s not overly difficult to learn, just tedious sometimes with restrictions or parameters :smile:
For this kind of userscripting you pretty much need to have the basics down for:

  • Javascript (or JS) AND JQuery (JQuery is like an awesome addon and enhancement to Javascript)
  • An understanding of “GM” usage in JS for some parts (this one I’m not well versed in :sweat_smile:), I used this to be able to separate my code into a number of files rather than needing to have one MASSIVE file, or turning to a webpack project
  • CSS for styling the page
  • HTML for constructing what you see on the page

Most of the time you can find free tutorials online, and there are MULTITUDES of forums if you have questions or issues haha.

1 Like

Looks good!

4 Likes

Could you post any pictures? I’m currently on a work PC so I don’t want to download anything :sweat_smile:

2 Likes

@Pep95 I’ve updated the main post to include pictures :smile:

I’ll eventually redo the main GIF when I can get it down to less than 4MB, it’s currently 18MB >.<

2 Likes

Woah that looks great!

2 Likes

This looks really nice. I will say that one thing that should be fixed if it can be is to try to allow some other scripts (maybe like common ones that people have) to be able to work with this script.

1 Like

@Tomy56739 thanks! Can you please give me some examples of some common scripts? I only use this and Jitai, I’ve not had any need for any others so didn’t even think to include compatibility :frowning_face:

I’ll also add that to Known deficiencies.

You should take a look at @jprspereira 's guide. The scripts recommended in section 7 are hugely popular because of the recommendation.

As the author of Item Inspector I request you provide compatibility for my script.

1 Like

Thanks for that link @prouleau :smile: I’ll review the list and see what ones I’ll include. It’ll be impossible to include all of them of course, and really I’ll probably just focus on the dashboard specific userscripts.

It was frustrating enough just to learn how to incorporate multiple files without using a webpack project, so I think it’ll take some time to go through example scripts to reverse engineer how to make mine compatible, so it may take some time and not be done quickly, but I’ll do what I can :smile:

1 Like

I think many of the dashboard scripts just append or prepend themselves to some div or section in the dashboard. As long as you don’t change the id or class of the dashboard html elements they should work fine. Scripts like the heatmap or my Item Inspector would fall in this category.

There are also the scripts like Dashboard Progress Plus that actively modify WK dashboard elements. Then there may be conflicts between their modifications and yours.

1 Like

Ah, then there’s a major problem there because my userscript is a literal rewrite of the dashboard. I generate my own dashboard HTML, use JS to remove the existing dashboard, then add my custom HTML to the page instead.

I thought about just modifying the original but it was far more work than writing my own. I’ll look at the IDs and elements that they’re using, because that might be simple enough, but yeah that could be interesting haha :sweat_smile:

1 Like

The insertion code for Item Inspector is here.

        if (quiz.settings.position === undefined) {quiz.settings.position = 2};
        let position = [".progress-and-forecast", '.progress-and-forecast', '.srs-progress',  '.span12 .row', '.span12 .row:last-of-type',][quiz.settings.position];
        if (quiz.settings.position == 0){
            $(position).before(sectionContainer);
        } else {
            $(position).after(sectionContainer);
        };

The user selects a position via a setting like this:

Position

Then the script installs itself either after or before some HTML elements identified by classes. There is a pitfall. What happens if you support only the default position and the user changes for one you don’t support? Will he be stuck without being able to change back his position to the one that is supported? There may be one way out. The settings will be available from the dropdown menu even if the main script doesn’t inserts.

I know the heatmap also has the ability to let the user choose its position.

At least this code gives you positions that are likely to be used by scripts.

1 Like

@prouleau thanks for this, I’ve gotten a bit of energy to do some coding, so I’ve gone through the whole list in the link you gave, and I’m in the process of testing out what classes and such I need to add to accommodate almost all dashboard related userscripts :smile:

Simply put, I’m aiming to try and give all of those options IF possible without needing a massive overhaul of my code.

I’ll let you know when I’ve got an update to 1.1 for you to test if you have time today when it’s done?

1 Like

I am OK with doing a test. I don’t promise how fast it will be. It will depends on my availabilities.

Of course! No rush, I’ll be doing testing myself of course, but I figured it would help to have someone else run their eye over it at some point :slight_smile:

1 Like

Just adding some points to keep an eye on.

  • Some dashboard scripts install themselves in the top bar. The classes I provided don’t account for this.
  • Some scripts modify the reviews and lessons buttons to include popups to display information.
  • Also the dropdown menu when you click the round icon on the top right corner is where almost all scripts insert their settings.
1 Like

Yeah the top bar is the part giving me trouble at the moment.

Thanks, though I’m excluding those ones since those buttons will won’t exist in this dashboard and some of the information is already available elsewhere on the dashboard. The shortcut navigation buttons are different because I’m just modifying the colours and text in them, not recreating them so things like the Lesson Hover Details and Level Duration 2.0 work fine as is.

Thank you, that one I did know but it’s good to have for those that don’t :smile:

1 Like

@prouleau I’ve made the updates so this is now v1.1 so feel free to update and have a look when you’re able and let me know what you think :smile:

I’ve also updated the main post to include a changelog and compatibilities.

5 Likes