mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
fix copy and paste in files for linux devices #7284
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
2
public/scripts/common-0.0.1-min.js
vendored
2
public/scripts/common-0.0.1-min.js
vendored
File diff suppressed because one or more lines are too long
@@ -43,22 +43,22 @@ function ArrayElementMove(arr, from, to) { arr.splice(to, 0, arr.splice(from, 1)
|
|||||||
|
|
||||||
// Print object for HTML
|
// Print object for HTML
|
||||||
function ObjectToStringEx(x, c) {
|
function ObjectToStringEx(x, c) {
|
||||||
var r = "";
|
var r = "";
|
||||||
if (x != 0 && (!x || x == null)) return '(Null)';
|
if (x != 0 && (!x || x == null)) return '(Null)';
|
||||||
if (x instanceof Array) { for (var i in x) { r += '<br />' + gap(c) + 'Item #' + i + ": " + ObjectToStringEx(x[i], c + 1); } }
|
if (x instanceof Array) { for (var i in x) { r += '<br />' + gap(c) + 'Item #' + i + ": " + ObjectToStringEx(x[i], c + 1); } }
|
||||||
else if (x instanceof Object) { for (var i in x) { r += '<br />' + gap(c) + i + ' = ' + ObjectToStringEx(x[i], c + 1); } }
|
else if (x instanceof Object) { for (var i in x) { r += '<br />' + gap(c) + i + ' = ' + ObjectToStringEx(x[i], c + 1); } }
|
||||||
else { r += EscapeHtml(x); }
|
else { r += EscapeHtml(x); }
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print object for console
|
// Print object for console
|
||||||
function ObjectToStringEx2(x, c) {
|
function ObjectToStringEx2(x, c) {
|
||||||
var r = '';
|
var r = '';
|
||||||
if (x != 0 && (!x || x == null)) return '(Null)';
|
if (x != 0 && (!x || x == null)) return '(Null)';
|
||||||
if (x instanceof Array) { for (var i in x) { r += '\r\n' + gap2(c) + 'Item #' + i + ': ' + ObjectToStringEx2(x[i], c + 1); } }
|
if (x instanceof Array) { for (var i in x) { r += '\r\n' + gap2(c) + 'Item #' + i + ': ' + ObjectToStringEx2(x[i], c + 1); } }
|
||||||
else if (x instanceof Object) { for (var i in x) { r += '\r\n' + gap2(c) + i + ' = ' + ObjectToStringEx2(x[i], c + 1); } }
|
else if (x instanceof Object) { for (var i in x) { r += '\r\n' + gap2(c) + i + ' = ' + ObjectToStringEx2(x[i], c + 1); } }
|
||||||
else { r += EscapeHtml(x); }
|
else { r += EscapeHtml(x); }
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an ident gap
|
// Create an ident gap
|
||||||
@@ -71,10 +71,10 @@ function ObjectToString2(x) { return ObjectToStringEx2(x, 0); }
|
|||||||
|
|
||||||
// Convert a hex string to a raw string
|
// Convert a hex string to a raw string
|
||||||
function hex2rstr(d) {
|
function hex2rstr(d) {
|
||||||
if (typeof d != 'string' || d.length == 0) return '';
|
if (typeof d != 'string' || d.length == 0) return '';
|
||||||
var r = '', m = ('' + d).match(/../g), t;
|
var r = '', m = ('' + d).match(/../g), t;
|
||||||
while (t = m.shift()) r += String.fromCharCode('0x' + t);
|
while (t = m.shift()) r += String.fromCharCode('0x' + t);
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert decimal to hex
|
// Convert decimal to hex
|
||||||
@@ -89,16 +89,16 @@ function decode_utf8(s) { return decodeURIComponent(escape(s)); }
|
|||||||
|
|
||||||
// Convert a string into a blob
|
// Convert a string into a blob
|
||||||
function data2blob(data) {
|
function data2blob(data) {
|
||||||
var bytes = new Array(data.length);
|
var bytes = new Array(data.length);
|
||||||
for (var i = 0; i < data.length; i++) bytes[i] = data.charCodeAt(i);
|
for (var i = 0; i < data.length; i++) bytes[i] = data.charCodeAt(i);
|
||||||
return new Blob([new Uint8Array(bytes)]);
|
return new Blob([new Uint8Array(bytes)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert a UTF8 string into a blob
|
// Convert a UTF8 string into a blob
|
||||||
function utf2blob(str) {
|
function utf2blob(str) {
|
||||||
var bytes = [], utf8 = unescape(encodeURIComponent(str));
|
var bytes = [], utf8 = unescape(encodeURIComponent(str));
|
||||||
for (var i = 0; i < utf8.length; i++) { bytes.push(utf8.charCodeAt(i)); }
|
for (var i = 0; i < utf8.length; i++) { bytes.push(utf8.charCodeAt(i)); }
|
||||||
return new Blob([new Uint8Array(bytes)]);
|
return new Blob([new Uint8Array(bytes)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate random numbers
|
// Generate random numbers
|
||||||
@@ -117,18 +117,18 @@ function isSafeString2(str) { return ((typeof str == 'string') && (str.indexOf('
|
|||||||
|
|
||||||
// Parse URL arguments, only keep safe values
|
// Parse URL arguments, only keep safe values
|
||||||
function parseUriArgs(decodeUrl) {
|
function parseUriArgs(decodeUrl) {
|
||||||
var href = window.document.location.href;
|
var href = window.document.location.href;
|
||||||
if (href.endsWith('#')) { href = href.substring(0, href.length - 1); }
|
if (href.endsWith('#')) { href = href.substring(0, href.length - 1); }
|
||||||
var name, r = {}, parsedUri = href.split(/[\?&|]/);
|
var name, r = {}, parsedUri = href.split(/[\?&|]/);
|
||||||
parsedUri.splice(0, 1);
|
parsedUri.splice(0, 1);
|
||||||
for (var j in parsedUri) {
|
for (var j in parsedUri) {
|
||||||
var arg = parsedUri[j], i = arg.indexOf('=');
|
var arg = parsedUri[j], i = arg.indexOf('=');
|
||||||
name = arg.substring(0, i);
|
name = arg.substring(0, i);
|
||||||
r[name] = arg.substring(i + 1);
|
r[name] = arg.substring(i + 1);
|
||||||
if (decodeUrl) { r[name] = decodeURIComponent(arg.substring(i + 1)); }
|
if (decodeUrl) { r[name] = decodeURIComponent(arg.substring(i + 1)); }
|
||||||
if (!isSafeString2(r[name])) { delete r[name]; } else { var x = parseInt(r[name]); if (x == r[name]) { r[name] = x; } }
|
if (!isSafeString2(r[name])) { delete r[name]; } else { var x = parseInt(r[name]); if (x == r[name]) { r[name] = x; } }
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check_webp_feature:
|
// check_webp_feature:
|
||||||
@@ -136,45 +136,59 @@ function parseUriArgs(decodeUrl) {
|
|||||||
// 'callback(feature, isSupported)' will be passed back the detection result (in an asynchronous way!)
|
// 'callback(feature, isSupported)' will be passed back the detection result (in an asynchronous way!)
|
||||||
// From: https://stackoverflow.com/questions/5573096/detecting-webp-support
|
// From: https://stackoverflow.com/questions/5573096/detecting-webp-support
|
||||||
function check_webp_feature(feature, callback) {
|
function check_webp_feature(feature, callback) {
|
||||||
var kTestImages = {
|
var kTestImages = {
|
||||||
lossy: 'UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'//,
|
lossy: 'UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'//,
|
||||||
//lossless: 'UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==',
|
//lossless: 'UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==',
|
||||||
//alpha: 'UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==',
|
//alpha: 'UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==',
|
||||||
//animation: 'UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA'
|
//animation: 'UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA'
|
||||||
};
|
};
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.onload = function () {
|
img.onload = function () {
|
||||||
var result = (img.width > 0) && (img.height > 0);
|
var result = (img.width > 0) && (img.height > 0);
|
||||||
callback(feature, result);
|
callback(feature, result);
|
||||||
};
|
};
|
||||||
img.onerror = function () {
|
img.onerror = function () {
|
||||||
callback(feature, false);
|
callback(feature, false);
|
||||||
};
|
};
|
||||||
img.src = 'data:image/webp;base64,' + kTestImages[feature];
|
img.src = 'data:image/webp;base64,' + kTestImages[feature];
|
||||||
}
|
}
|
||||||
|
|
||||||
// camelCase converter for JSON
|
// camelCase converter for JSON
|
||||||
function jsonToCamel(o) {
|
function jsonToCamel(o) {
|
||||||
var newO, origKey, newKey, value
|
var newO, origKey, newKey, value
|
||||||
if (o instanceof Array) {
|
if (o instanceof Array) {
|
||||||
return o.map(function(value) {
|
return o.map(function(value) {
|
||||||
if (typeof value === "object") {
|
if (typeof value === "object") {
|
||||||
value = jsonToCamel(value)
|
value = jsonToCamel(value)
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
newO = {}
|
newO = {}
|
||||||
for (origKey in o) {
|
for (origKey in o) {
|
||||||
if (o.hasOwnProperty(origKey)) {
|
if (o.hasOwnProperty(origKey)) {
|
||||||
newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString()
|
newKey = (origKey.charAt(0).toLowerCase() + origKey.slice(1) || origKey).toString()
|
||||||
value = o[origKey]
|
value = o[origKey]
|
||||||
if (value instanceof Array || (value !== null && value.constructor === Object)) {
|
if (value instanceof Array || (value !== null && value.constructor === Object)) {
|
||||||
value = jsonToCamel(value)
|
value = jsonToCamel(value)
|
||||||
}
|
|
||||||
newO[newKey] = value
|
|
||||||
}
|
}
|
||||||
|
newO[newKey] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newO
|
}
|
||||||
}
|
return newO
|
||||||
|
}
|
||||||
|
|
||||||
|
function joinPaths() {
|
||||||
|
var x = [];
|
||||||
|
for (var i in arguments) {
|
||||||
|
var w = arguments[i];
|
||||||
|
if ((w != null) && (w != '')) {
|
||||||
|
while (w.endsWith('/') || w.endsWith('\\')) {
|
||||||
|
w = w.substring(0, w.length - 1);
|
||||||
|
}
|
||||||
|
x.push(w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return x.join('/');
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -7688,7 +7688,6 @@
|
|||||||
function addKeyLinkConditional(x, t, c) { if (c) return '<span title=\'' + t + '\'>' + x + ' <img class=hoverButton src=images/key16.png></span>'; return x }
|
function addKeyLinkConditional(x, t, c) { if (c) return '<span title=\'' + t + '\'>' + x + ' <img class=hoverButton src=images/key16.png></span>'; return x }
|
||||||
function passwordcheck(p) { var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/; return re.test(p); }
|
function passwordcheck(p) { var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/; return re.test(p); }
|
||||||
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format('{0} bytes', size); }
|
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format('{0} bytes', size); }
|
||||||
function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
|
|
||||||
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
||||||
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
||||||
function printDate(d) { return d.toLocaleDateString(args.locale); }
|
function printDate(d) { return d.toLocaleDateString(args.locale); }
|
||||||
|
|||||||
@@ -19291,7 +19291,6 @@
|
|||||||
return outputArray;
|
return outputArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
|
|
||||||
function putstore(name, val) {
|
function putstore(name, val) {
|
||||||
try {
|
try {
|
||||||
if ((typeof (localStorage) === 'undefined') || (localStorage.getItem(name) == val)) return;
|
if ((typeof (localStorage) === 'undefined') || (localStorage.getItem(name) == val)) return;
|
||||||
|
|||||||
@@ -20664,7 +20664,6 @@
|
|||||||
return outputArray;
|
return outputArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
|
|
||||||
function putstore(name, val) {
|
function putstore(name, val) {
|
||||||
try {
|
try {
|
||||||
if ((typeof (localStorage) === 'undefined') || (localStorage.getItem(name) == val)) return;
|
if ((typeof (localStorage) === 'undefined') || (localStorage.getItem(name) == val)) return;
|
||||||
|
|||||||
@@ -2490,7 +2490,6 @@
|
|||||||
function addLinkConditional(x, f, c) { if (c) return addLink(x, f); return x; }
|
function addLinkConditional(x, f, c) { if (c) return addLink(x, f); return x; }
|
||||||
function passwordcheck(p) { var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/; return re.test(p); }
|
function passwordcheck(p) { var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/; return re.test(p); }
|
||||||
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format('{0} bytes', size); }
|
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format('{0} bytes', size); }
|
||||||
function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
|
|
||||||
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
||||||
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
||||||
function printDate(d) { return d.toLocaleDateString(args.locale); }
|
function printDate(d) { return d.toLocaleDateString(args.locale); }
|
||||||
|
|||||||
@@ -2346,7 +2346,6 @@
|
|||||||
function printFlexDateTime(d) { if (printDate(new Date()) == printDate(d)) { return format("Expires at {0}", printTime(d)); } else { return format("Expires {0}", printDateTime(d)); } }
|
function printFlexDateTime(d) { if (printDate(new Date()) == printDate(d)) { return format("Expires at {0}", printTime(d)); } else { return format("Expires {0}", printDateTime(d)); } }
|
||||||
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format("{0} bytes", size); }
|
function getFileSizeStr(size) { if (typeof size != 'number') { size = 0; } if (size == 1) return "1 byte"; return format("{0} bytes", size); }
|
||||||
function encodeURIComponentEx(txt) { return encodeURIComponent(txt).replace(/'/g, '%27'); };
|
function encodeURIComponentEx(txt) { return encodeURIComponent(txt).replace(/'/g, '%27'); };
|
||||||
function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
|
|
||||||
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
function focusTextBox(x) { setTimeout(function () { Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
|
||||||
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
var isFilenameValid = (function () { var x1 = /^[^\\/:\*\?"<>\|]+$/, x2 = /^\./, x3 = /^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i; return function isFilenameValid(fname) { return x1.test(fname) && !x2.test(fname) && !x3.test(fname) && (fname[0] != '.'); } })();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user