6 lines
2.1 KiB
JavaScript
6 lines
2.1 KiB
JavaScript
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var b,d=[];!(b=a.next()).done;)d.push(b.value);return d};
|
||
|
$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};
|
||
|
var DEF_SETTINGS_RELOADER={_settings:{_timeOffset:7776E6,_lastCheckedAtID:"last-updated-at"},_getLastCheckedAt:function(){var a=localStorage.getItem(DEF_SETTINGS_RELOADER._settings._lastCheckedAtID);return a?parseInt(a):0},_getTimeSinceLastCheck:function(){return(new Date).getTime()-DEF_SETTINGS_RELOADER._getLastCheckedAt()},_hasTimePassed:function(){var a=DEF_SETTINGS_RELOADER._getTimeSinceLastCheck(),b=DEF_SETTINGS_RELOADER._settings._timeOffset;return 0==DEF_SETTINGS_RELOADER._getLastCheckedAt()?
|
||
|
(DEF_SETTINGS_RELOADER._setLastUpdatedAt(),!1):a>b},_setLastUpdatedAt:function(){localStorage.setItem(DEF_SETTINGS_RELOADER._settings._lastCheckedAtID,(new Date).getTime()+"")},_setDefaultSettings:function(){localStorage.setItem("menu-items",JSON.stringify(defaultLinkMenu));DEF_SETTINGS_RELOADER._setLastUpdatedAt();buildMenu()},_init:function(){var a=["addLinkToMenu","removeLinkFromMenu"],b=setInterval(function(){if(!a.find(function(a){if("function"!==typeof window[a])return!0})){var d=window.addLinkToMenu;
|
||
|
window.addLinkToMenu=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];DEF_SETTINGS_RELOADER._setLastUpdatedAt();return d.apply(null,$jscomp.arrayFromIterable(b))};var e=window.removeLinkFromMenu;window.removeLinkFromMenu=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c-0]=arguments[c];DEF_SETTINGS_RELOADER._setLastUpdatedAt();return e.apply(null,$jscomp.arrayFromIterable(b))};DEF_SETTINGS_RELOADER._hasTimePassed()&&DEF_SETTINGS_RELOADER._setDefaultSettings();clearInterval(b)}},
|
||
|
50)}};DEF_SETTINGS_RELOADER._init();
|