Last active
April 12, 2016 06:54
-
-
Save vin-the-dev/975b278500ae086e984847fb792b9aac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name relaod | |
// @namespace reload | |
// @description relaod | |
// @include http://10.201.1.14:8094/* | |
// @version 1 | |
// @grant none | |
// @noframes | |
// ==/UserScript== | |
//To Reset | |
//localStorage.removeItem("cnt"); | |
//localStorage.removeItem("errorMenu"); | |
//localStorage.removeItem("allMenu"); | |
//To find error menu | |
//var errorMenu = JSON.parse(localStorage['errorMenu']); | |
window.addEventListener('load', function () { | |
var storedMenu = new Array(); | |
if (localStorage['allMenu'] == null) { | |
localStorage['allMenu'] = JSON.stringify(storedMenu); | |
} | |
storedMenu = JSON.parse(localStorage['allMenu']); | |
if (storedMenu.length == 0) { | |
var allMenu = new Array(); | |
$('a[id^="tree_node_"]').each(function () { | |
allMenu.push(this.href); | |
}); | |
localStorage['allMenu'] = JSON.stringify(allMenu); | |
} | |
storedMenu = JSON.parse(localStorage['allMenu']); | |
var intCnt = 0; | |
if (localStorage.getItem('cnt') != null) { | |
intCnt = Number(localStorage.getItem('cnt')); | |
} | |
else | |
{ | |
intCnt = - 1; | |
} | |
//localStorage['allMenu'] = JSON.stringify(allMenu); | |
//localStorage['errorMenu'] = JSON.stringify(allMenu); | |
var errorMenu = new Array(); | |
if (localStorage['errorMenu'] == null) { | |
localStorage['errorMenu'] = JSON.stringify(errorMenu); | |
} | |
errorMenu = JSON.parse(localStorage['errorMenu']); | |
//console.log("asdasd123ADS"); | |
var togglePane = document.getElementById("TougglePane"); | |
//console.log(togglePane); | |
//console.log("asdasd"); | |
if (togglePane == null) { | |
console.log("asdgwerw"); | |
errorMenu.push(storedMenu[intCnt]) | |
localStorage['errorMenu'] = JSON.stringify(errorMenu); | |
} | |
//if (storedMenu[intCnt]) { | |
intCnt = intCnt + 1; | |
if (intCnt < storedMenu.length) { | |
location.href = storedMenu[intCnt]; | |
localStorage['cnt'] = intCnt; | |
} | |
else { | |
alert('Completed check errorMenu for list of error menu') | |
} | |
// } | |
//console.log('q'); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment