Commit 8f9eded5 authored by tunisiano187's avatar tunisiano187

Merge branch '2-reset-editor-level-in-the-menu' into 'master'

Resolve "Reset editor level in the menu"

Closes #2

See merge request !2
parents 51e51eca 6a3a72a7
......@@ -19,7 +19,7 @@ Then use the following links to install.
To reset the language
----------------------
go to this url : <a href="https://wmebr.info/ur/purs_on_state.php#reset-WMEBR-editor-level">https://wmebr.info/ur/purs_on_state.php#reset-WMEBR-editor-level</a>
click on the link in the upper menu
If you find any issue
---------------------
......@@ -35,4 +35,5 @@ Todos/Issues
Changelog
---------
* 2018.08.04.01 - Add a link to reset the editor level
\ No newline at end of file
* 2018.08.04.01 - Add a link to reset the editor level
* 2018.08.04.02 - Adding a link ion the top menu
\ No newline at end of file
......@@ -3,7 +3,7 @@
// @namespace https://www.bowlman.org
// @description Filter the PURs results on the wmebr website to only show what we can handle
// @match https://wmebr.info/ur/purs_on_state.php*
// @version 2018.08.04.01
// @version 2018.08.04.02
// @author tunisiano187 '2018
// @license MIT/BSD/X11
// @compatible chrome firefox
......@@ -15,12 +15,23 @@
(function() {
'use strict';
var fullpath = "https://wmebr.info/ur/purs_on_state.php";
if(window.location.hash == ("#reset-WMEBR-editor-level")) {
localStorage.removeItem('WME-editor-level');
alert("Level resetted");
var fullpath = window.location.pathname+window.location.search;
if('WMEBR-last-page' in localStorage) {
fullpath = localStorage.getItem('WMEBR-last-page');
}
window.location.href = fullpath;
}
// Adding the link to the menu
$("#navbar ul.navbar-nav").append('<li><a href="purs_on_state.php#reset-WMEBR-editor-level">Reset editor level</a></li>');
// Getting the last query
fullpath = window.location.pathname+window.location.search;
localStorage.setItem('WMEBR-last-page',fullpath);
var WMEeditorlevel=2;
if('WME-editor-level' in localStorage && localStorage.getItem('WME-editor-level') !=='0') {
......@@ -36,4 +47,4 @@
$(this).parent().hide();
}
});
})();
\ No newline at end of file
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment