GreaseMonkey_SuperValues-minified

Extends the GM_setValue and GM_getValue functions for any javascript variable type.

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greatest.deepsurf.us/scripts/19190/122474/GreaseMonkey_SuperValues-minified.js

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

var GM_SuperValue=new function(){function ReportError(e){if(!console||!console.error)throw new Error(e);console.error(e)}var JSON_MarkerStr="json_val: ",FunctionMarker="function_code: ";"function"!=typeof GM_setValue&&ReportError("This library requires Greasemonkey! GM_setValue is missing."),"function"!=typeof GM_getValue&&ReportError("This library requires Greasemonkey! GM_getValue is missing."),this.set=function(e,r){if("string"!=typeof e)return void ReportError("Illegal varName sent to GM_SuperValue.set(). Name: "+e+" Value: "+r);switch(/[^\w _-]/.test(e)&&ReportError("Suspect, probably illegal, varName sent to GM_SuperValue.set().  Name: "+e+" Value: "+r),typeof r){case"undefined":ReportError("Illegal varValue sent to GM_SuperValue.set().  Name: "+e+" Value: "+r);break;case"boolean":case"string":GM_setValue(e,r);break;case"number":r===parseInt(r)&&Math.abs(r)<2147483647?GM_setValue(e,r):ReportError("Illegal varValue sent to GM_SuperValue.set().  Name: "+e+" Value: "+r);break;case"object":var a=JSON_MarkerStr+JSON.stringify(r);GM_setValue(e,a);break;case"function":var t=FunctionMarker+r.toString();GM_setValue(e,t);break;default:ReportError("Unknown type in GM_SuperValue.set()! Name: "+e+" DefaultValue: "+r)}},this.get=function(varName,defaultValue){if("string"!=typeof varName)return void ReportError("Illegal varName sent to GM_SuperValue.get(). Name: "+varName+" DefaultValue: "+defaultValue);/[^\w _-]/.test(varName)&&ReportError("Suspect, probably illegal, varName sent to GM_SuperValue.get(). Name: "+varName+" DefaultValue: "+defaultValue);var varValue=GM_getValue(varName);if("undefined"==typeof varValue)return defaultValue;if("string"==typeof varValue){var regxp=new RegExp("^"+JSON_MarkerStr+"(.+)$"),m=varValue.match(regxp);if(m&&m.length>1)return varValue=JSON.parse(m[1]);if(regxp=new RegExp("^"+FunctionMarker+"((?:.|\n|\r)+)$"),m=varValue.match(regxp),m&&m.length>1)return varValue=eval("("+m[1]+")")}return varValue}};