Freebitco - in V 4.5.2
Freebitco - in V 4.5.2
var f = timers.shift();
if (f) f();
};
window.asyncRun = function(f) {
timers.push(f);
window.postMessage({type: "asyncRun"}, "*");
};
window.addEventListener("message", onMessage);
}) ();
function __is_windows() {
return /^win(32)?/i.test(navigator.platform);
}
function __psep() {
return __is_windows() ? "\\" : "/";
}
function __is_full_path(path) {
if (__is_windows()) {
return /^[a-z]:/i.test(path);
} else {
return /^\//.test(path);
}
}
var imns = {
// var values_to_escape = {
// "\\": "\\\\",
// "\0": "\\0",
// "\b": "\\b",
// "\t": "\\t",
// "\n": "\\n",
// "\v": "\\v",
// "\f": "\\f",
// "\r": "\\r",
// "\"": "\\\"",
// "'": "\\'"};
return line;
},
var m = null;
if (m = line.match(line_re)) { // it is a quoted string
line = this.escapeLine(m[1]);
// add quotes
line = "\""+line+"\"";
} else {
line = line.replace(/\t/g, "<SP>");
line = line.replace(/\n/g, "<BR>");
line = line.replace(/\r/g, "<LF>");
line = line.replace(/\s/g, "<SP>");
}
return line;
},
// Unwraps a line
// If the line is a quoted string then the following escape sequences
// are translated:
// \0 The NUL character (\u0000).
// \b Backspace (\u0008).
// \t Horizontal tab (\u0009).
// \n Newline (\u000A).
// \v Vertical tab (\u000B).
// \f Form feed (\u000C).
// \r Carriage return (\u000D).
// \" Double quote (\u0022).
// \' Apostrophe or single quote (\u0027).
// \\ Backslash (\u005C).
// \xXX The Latin-1 character specified by the two hexadecimal digits XX.
// \uXXXX The Unicode character specified by four hexadecimal digits XXXX.
// Otherwise <BR>, <LF>, <SP> are replaced by \n, \r, \x31 resp.
unwrap: function(line) {
const line_re = new RegExp("^\"((?:\n|.)*)\"$");
var m = null;
return line;
},
return str;
},
return res;
},
escapeTextContent: function(str) {
// 1. remove all leading/trailing white spaces
str = this.trim(str);
// 2. remove all linebreaks
str = str.replace(/[\r\n]+/g, "");
// 3. all consequent white spaces inside text are replaced by one
str = str.replace(/\s+/g, " ");
return str;
},
trim: function(s) {
return s.replace(/^\s+/, "").replace(/\s+$/, "");
},
Clipboard: {
_check_area: function(str) {
var x;
if (!(x = document.getElementById("clipboard-area"))) {
x = document.createElement("textarea");
x.id = "clipboard-area";
x.setAttribute("contentEditable", "true");
document.body.appendChild(x);
}
return x;
},
putString: function(str) {
var x = this._check_area();
x.value = str;
x.focus();
x.select();
document.execCommand("Copy");
},
getString: function() {
var x = this._check_area();
x.focus();
document.execCommand("Paste");
return x.value;
}
}
};
// App exceptions
BadParameter.prototype = Error.prototype;
function UnsupportedCommand(msg) {
this.message = "command "+msg+" is not supported in the current version";
this.name = "UnsupportedCommand";
this.errnum = 712;
}
UnsupportedCommand.prototype = Error.prototype;
RuntimeError.prototype = Error.prototype;
SyntaxError.prototype.
__defineGetter__("errnum", function() { return 710; });
function normalize_error(e) {
return {name: e.name, message: e.message, errnum: e.errnum};
}
// preference storage
var Storage = {
isSet: function(key) {
return typeof(localStorage[key]) != "undefined";
},
getBool: function(key) {
var value = localStorage[key];
return value ? value.toString() != "false" : false;
},
getChar: function(key) {
var value = localStorage[key];
return value ? value.toString() : "";
},
setNumber: function(key, value) {
var val = Number(value);
if (!isNaN(val))
localStorage[key] = val;
},
getNumber: function(key) {
return localStorage[key];
},
getObject: function(key) {
var s = localStorage[key];
if (typeof s != "string")
return null;
try {
return JSON.parse(s);
} catch(e) {
return null;
}
}
};
// open a dialog and return promise which resolves on a message from the
// known popup window
var dialogUtils = (function () {
"use strict";
let dialogResolvers = new Map()
let dialogArgs = new Map()
return {
setDialogResult(win_id, response) {
if (!dialogResolvers.has(win_id))
throw new Error("dialogUtils error: bad dialog id")
dialogResolvers.get(win_id)(response)
dialogResolvers.delete(win_id)
dialogArgs.delete(win_id)
},
getDialogArgs(win_id) {
if (!dialogArgs.has(win_id))
throw new Error("dialogUtils error: bad dialog id")
return dialogArgs.get(win_id)
},