Greasy Fork is available in English.

TSLibrary - Generic (Archive)

A resource JS library file providing common useful functions to be used by other scripts

Ezt a szkriptet nem ajánlott közvetlenül telepíteni. Ez egy könyvtár más szkriptek számára, amik tartalmazzák a // @require https://update.greasyfork.org/scripts/439327/1013726/TSLibrary%20-%20Generic%20%28Archive%29.js hivatkozást.

  1. // ==UserScript==
  2. // @name TSLibrary - Generic (Archive)
  3. // @namespace TimidScript
  4. // @version 1.0.28
  5. // @description A resource JS library file providing common useful functions to be used by other scripts
  6. // @author TimidScript
  7. // @homepageURL https://github.com/TimidScript
  8. // @copyright © 2014+ TimidScript, Some Rights Reserved.
  9. // @license https://github.com/TimidScript/UserScripts/blob/master/license.txt
  10. // @exclude *
  11. // ==/UserScript==
  12.  
  13.  
  14. /* License + Copyright Notice
  15. ********************************************************************************************
  16. License can be found at: https://github.com/TimidScript/UserScripts/blob/master/license.txt
  17. Below is a copy of the license the may not be up-to-date.
  18.  
  19. Copyright © TimidScript, Some Rights Reserved.
  20.  
  21. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
  22. following conditions are met:
  23.  
  24. 1) GPL-3 License is met that does not conflict with the rest of the license (http://www.gnu.org/licenses/gpl-3.0.en.html)
  25. 2) This notice must be included
  26. 3) Due credits and link to original author's homepage (included in this notice).
  27. 4) Notify the original author of redistribution
  28. 5) Clear clarification of the License and Notice to the end user
  29. 6) Do not upload on OpenUserJS.org or any other site that infringes on this license
  30.  
  31. TimidScript's Homepages: GitHub: https://github.com/TimidScript
  32. GreasyFork: https://greasyfork.org/users/1455
  33. */
  34. /* Information
  35. ********************************************************************************************
  36. Version History
  37. ----------------------------------------------
  38. 1.0.28 (2019-04-30)
  39. - Added delimitedNumber
  40. 1.0.27 (2019-04-27)
  41. - Minified the declaration code
  42. - Bugfix: [doc.nodeName === "#document"] should be [doc.nodeName !== "#document"]
  43. 1.0.26 (2019-04-26)
  44. - TimidScriptLibrary.removeNode now only excepts ID or node
  45. - TimidScriptLibrary.removeNodes add that accepts CSS Selector
  46. - var replaced with let
  47. - cleaned the code a bit
  48. 1.0.25 (2019-04-23)
  49. - Bugfix in removeNode
  50. 1.0.24 (2019-04-23)
  51. - Removed tsXHR.timeout, because it does not work that way.
  52. - Added tsXHR.logged for logging
  53. - removeNode now accepts node object, ID or CSS Selector
  54. 1.0.23 (2017-03-09)
  55. - Added randomNumber generator
  56. 1.0.22 (2017-02-25)
  57. - CRC32 added
  58. 1.0.21 (2017-02-12)
  59. - BugFix: TSL.padNumber
  60. - Added simple checksum
  61. 1.0.20 (2017-02-02)
  62. - Added GM_xmlhttpRequest Library
  63. 1.0.19 (2016-10-29)
  64. - CSS Styles are places in same position if they exists, to not break the page's style precedence. Did the same for javascript.
  65. 1.0.18 (2016-05-27)
  66. - License altered
  67. 1.0.17 (2016-04-03)
  68. - Changed license to GPL-3
  69. 1.0.16 (2015-07-20)
  70. - addScript and addStyle return created nodes
  71. - Change location of addScript to head instead of body incase of dynamic pages that alter the body
  72. 1.0.15 (2015-06-18)
  73. - updateDocumentURL renamed to updateURL
  74. 1.0.14 (2015-06-18)
  75. - Using \b for regex in class functions
  76. - Better handling of spaces in the class functions
  77. 1.0.13 (2015-01-16)
  78. - updateDocumentURL added
  79. 1.0.12 (2014-12-12)
  80. - @exclude added
  81. 1.0.11 (2014-10-12)
  82. - innerHTML instead of textContent for scripts and CSS.
  83. 1.0.10 (2014-09-17)
  84. - Optimised - When adding or removing a class it now first checks
  85. it exists thus avoiding to make any extra changes.
  86. - Ability to add or remove more than one class. Separator is space.
  87. - hasClass also handles more than one class. Returns true only
  88. if all classes are present.
  89. - addClass, removeClass return true if class is added or removed
  90. 1.0.9 (2014-09-07)
  91. - Fixed bug in addScript and moved the script to the head instead of body.
  92. - CSS appended to textContent instead of innerHTML
  93. 1.0.8 (2014-09-05)
  94. - Improved removeClass
  95. - Added absolutePosition(element)
  96. 1.0.7 (2014-09-02)
  97. - Functions added: addClass removeClass hasClass
  98. - Removed makeStruct as it is useless
  99. 1.0.6 (2014-08-29)
  100. - Changed the NTFS chars http://unicode-search.net
  101. 1.0.5 (2014-08-24)
  102. - TSL part no longer commented out
  103. 1.0.4
  104. - Added new functions createElement, createElementHTML function
  105. - Partial support for non-main document
  106. 1.0.3
  107. - Added NTFS illegal character replacer
  108. - escape regular expression function
  109. 1.0.2
  110. - Added scroll bar thickness
  111. 1.0.1
  112. - Initial Release
  113. **********************************************************************************************/
  114.  
  115.  
  116. var TimidScriptLibrary =
  117. {
  118. //http://unicode-search.net
  119. altNTFSChars: [[">", ">"], ["<", "<"], [":", ":"], ['"', """], ["/", "/"], ["\\", "\"], ["?", "?"], ["*", "*"]],
  120.  
  121. removeNode: function (node, doc)
  122. {
  123. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  124. if (typeof doc.getElementById === "function" && typeof node === "string") node = doc.getElementById(node);
  125.  
  126. if (node && node.parentElement) node.parentElement.removeChild(node);
  127. },
  128.  
  129. removeNodes: function(selector, doc)
  130. {
  131. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  132. let nodes = doc.querySelectorAll(selector);
  133. for (let i = 0; i < nodes.length; i++) nodes[i].parentElement.removeChild(nodes[i]);
  134. },
  135.  
  136. addStyle: function (id, CSS, doc)
  137. {
  138. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  139. let el = doc.createElement("style");
  140.  
  141. if (doc.getElementById(id)) el = doc.getElementById(id);
  142. else doc.head.appendChild(el);
  143.  
  144. if (id) el.id = id;
  145. el.type = "text/css";
  146. el.innerHTML = CSS;
  147.  
  148. return el;
  149. },
  150.  
  151. addScript: function (id, text, doc)
  152. {
  153. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  154. let el = doc.createElement("script");
  155.  
  156. if (doc.getElementById(id)) el = doc.getElementById(id);
  157. else doc.head.appendChild(el);
  158.  
  159. if (id) el.id = id;
  160. el.innerHTML = text;
  161. return el;
  162. },
  163.  
  164. createElement: function (tag, attributes, doc)
  165. {
  166. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  167. let el = doc.createElement(tag);
  168.  
  169. for (let x in attributes) el.setAttribute(x, attributes[x]);
  170. return el;
  171. },
  172.  
  173. createElementHTML: function (html, doc)
  174. {
  175. if (typeof doc !== "object" || doc.nodeName !== "#document") doc = document;
  176. let el = doc.createElement("e");
  177.  
  178. el.innerHTML = html;
  179. return el.firstElementChild;
  180. },
  181.  
  182. paddingLeft: function (str, chr, length)
  183. {
  184. while (str.length < length)
  185. str = chr + str;
  186.  
  187. return str;
  188. },
  189.  
  190. paddingRight: function (str, chr, length)
  191. {
  192. while (str.length < length)
  193. str = str + chr;
  194.  
  195. return str;
  196. },
  197.  
  198. padNumber: function (number, length)
  199. {
  200. //return TimidScriptLibrary.paddingLeft(number, "0", length);
  201. let padding = Array(length + 1).join("0");
  202. return (padding + number).slice(0 - length);
  203. },
  204.  
  205. delimitedNumber: function(value)
  206. {
  207. return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  208. },
  209.  
  210. isMouseEventInClientArea: function (event, element)
  211. {
  212. let x, y, rect, minX, minY;
  213.  
  214. rect = element.getBoundingClientRect();
  215. minX = rect.left + element.clientLeft;
  216. x = event.clientX;
  217. y = event.clientY;
  218. minY = rect.top + element.clientTop;
  219.  
  220. if (x < minX || x >= minX + element.clientWidth) return false;
  221. if (y < minY || y >= minY + element.clientHeight) return false;
  222. return true;
  223. },
  224.  
  225.  
  226. getScrollBarThickness: function ()
  227. {
  228. let outer = document.createElement("div");
  229. outer.style.visibility = "hidden";
  230. outer.style.width = "100px";
  231. document.body.appendChild(outer);
  232.  
  233. let widthNoScroll = outer.offsetWidth;
  234. // force scrollbars
  235. outer.style.overflow = "scroll";
  236.  
  237. // add innerdiv
  238. let inner = document.createElement("div");
  239. inner.style.width = "100%";
  240. outer.appendChild(inner);
  241.  
  242. let widthWithScroll = inner.offsetWidth;
  243.  
  244. // remove divs
  245. outer.parentNode.removeChild(outer);
  246.  
  247. return widthNoScroll - widthWithScroll;
  248. },
  249.  
  250.  
  251. escapeRegExp: function (str)
  252. {
  253. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
  254. return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
  255. },
  256.  
  257. replaceNTFSIllegals: function (str)
  258. {
  259. for (let i = 0, rx; i < TimidScriptLibrary.altNTFSChars.length; i++)
  260. {
  261. rx = new RegExp(TimidScriptLibrary.escapeRegExp(TimidScriptLibrary.altNTFSChars[i][0]), "gi");
  262. str = str.replace(rx, TimidScriptLibrary.altNTFSChars[i][1]);
  263. }
  264.  
  265. return str;
  266. },
  267.  
  268. addClass: function (node, names)
  269. {
  270. let altered = false,
  271. newclass = node.className,
  272. classes = names.replace(/\s+/g, " ").trim().split(" ");
  273.  
  274. for (let i = 0, re; i < classes.length; i++)
  275. {
  276. //re = new RegExp("(^|\\s+)" + classes[i] + "(\\s+|$)");
  277. re = new RegExp("\\b" + classes[i] + "\\b");
  278. if (!newclass.match(re))
  279. {
  280. newclass += " " + classes[i];
  281. altered = true;
  282. }
  283. }
  284.  
  285. if (altered) node.className = newclass.replace(/\s+/g, " ").trim();
  286. return altered;
  287. },
  288.  
  289. removeClass: function (node, names)
  290. {
  291. let altered = false,
  292. newclass = node.className,
  293. classes = names.replace(/(\s)\s+/g, " ").trim().split(" ");
  294.  
  295. for (let i = 0, re; i < classes.length; i++)
  296. {
  297. //re = new RegExp("(^|\\s+)" + classes[i] + "(\\s+|$)");
  298. re = new RegExp("\\b" + classes[i] + "\\b");
  299. if (newclass.match(re))
  300. {
  301. newclass = newclass.replace(re, " ");
  302. altered = true;
  303. }
  304. }
  305.  
  306. if (altered) node.className = newclass.replace(/\s+/g, " ").trim();
  307. return altered;
  308. },
  309.  
  310. hasClass: function (node, names)
  311. {
  312. let classes = names.replace(/(\s)\s+/g, " ").trim().split(" ");
  313. for (let i = 0, re; i < classes.length; i++)
  314. {
  315. //re = new RegExp("(^|\\s+)" + classes[i] + "(\\s+|$)");
  316. re = new RegExp("\\b" + classes[i] + "\\b");
  317. if (!node.className.match(re)) return false;
  318. }
  319.  
  320. return true;
  321. },
  322.  
  323. getAbsolutePosition: function (element)
  324. {
  325. let x = 0, y = 0;
  326.  
  327. while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop))
  328. {
  329. x += element.offsetLeft;
  330. y += element.offsetTop;
  331. element = element.offsetParent;
  332. }
  333. return { top: y, left: x };
  334. },
  335.  
  336. updateURL: function (url)
  337. {
  338. window.history.pushState(null, "", url);
  339. },
  340.  
  341. makeCRCTable: function ()
  342. {
  343. //Code from http://stackoverflow.com/questions/18638900/javascript-crc32
  344. let crcTable = [];
  345. for (let n = 0, c; n < 256; n++)
  346. {
  347. c = n;
  348. for (let k = 0; k < 8; k++)
  349. {
  350. c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
  351. }
  352. crcTable[n] = c;
  353. }
  354. return crcTable;
  355. },
  356.  
  357. crc32: function (str)
  358. {
  359. //Code from http://stackoverflow.com/questions/18638900/javascript-crc32
  360. let crc = 0 ^ (-1), crcTable = unsafeWindow.crcTable || (unsafeWindow.crcTable = TimidScriptLibrary.makeCRCTable());
  361.  
  362. for (let i = 0; i < str.length; i++)
  363. {
  364. crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF];
  365. }
  366.  
  367. return ((crc ^ (-1)) >>> 0).toString(16);
  368. },
  369.  
  370. randomNumber: function(min, max)
  371. {
  372. min = parseInt(min);
  373. max = parseInt(max);
  374. return Math.floor(Math.random() * (max - min + 1) + min);
  375. }
  376. };
  377.  
  378.  
  379. var tsXHR =
  380. {
  381. logged: false,
  382.  
  383. /* callback(state, response)
  384. state = 0 ---> success
  385. state = 1 ---> Fail most likely a 404
  386. state = 2 ---> Timeout
  387. state = 3 ---> Error
  388. -------------------------------------------------------------------*/
  389. send: function (method, callback, url, headers, data, timeout)
  390. {
  391. //console.log(method, "\r\n", url, "\r\n", headers, "\r\n", data);
  392.  
  393. if (!headers) headers = {};
  394.  
  395. let obj = {
  396. url: url,
  397. method: method,
  398. headers: headers,
  399. onload: function (response)
  400. {
  401. if (response.status == 200)
  402. {
  403. if (tsXHR.logged) console.log("tsXHR: Success " + response.status + " (" + url + ")");
  404. callback(0, response);
  405. }
  406. else
  407. {
  408. console.error("tsXHR: Fail " + response.status + " (" + url + ")");
  409. console.info(response);
  410. callback(1, response);
  411. }
  412. },
  413. ontimeout: function (response)
  414. {
  415. console.error("tsXHR: Timeout" + response.status + " (" + url + ")");
  416. console.info(response);
  417. callback(2, response);
  418. },
  419. onerror: function (response)
  420. {
  421. console.error("tsXHR: ERROR " + response.status + " (" + url + ")");
  422. console.info(response);
  423. callback(3, response);
  424. }
  425. };
  426.  
  427. if (isNaN(timeout) === false) obj.timeout = timeout;
  428. if (data) obj.data = data;
  429.  
  430. GM_xmlhttpRequest(obj);
  431. },
  432.  
  433. /* callback(success, response) success true / false
  434. -------------------------------------------------------------------*/
  435. sendX: function (method, callback, url, headers, data, timeout)
  436. {
  437. tsXHR.send(method, cb, url, headers, data, timeout);
  438.  
  439. function cb(state, response)
  440. {
  441. callback(state == 0, response);
  442. }
  443. },
  444.  
  445. createHeaders: function (referer, accept, userAgent, contentType, authorization)
  446. {
  447. let headers = {};
  448. setHeader("User-Agent", userAgent);
  449. setHeader("Accept", accept);
  450. setHeader("Referer", referer);
  451. setHeader("Content-Type", contentType);
  452. setHeader("Authorization", authorization);
  453.  
  454. return headers;
  455. function setHeader(name, val)
  456. {
  457. if (val != null && val != undefined) headers[name] = referer;
  458. }
  459. },
  460.  
  461. /* callback(success, response)
  462. -------------------------------------------------------------------*/
  463. get: function (callback, url, headers, timeout)
  464. {
  465. tsXHR.sendX("GET", callback, url, headers, null, timeout);
  466. },
  467.  
  468. /* callback(success, response)
  469. -------------------------------------------------------------------*/
  470. head: function (callback, url, headers, timeout)
  471. {
  472. tsXHR.sendX("GET", callback, url, headers, null, timeout);
  473. },
  474.  
  475. /* callback(success, response)
  476. -------------------------------------------------------------------*/
  477. post: function (callback, url, headers, data, timeout)
  478. {
  479. tsXHR.sendX("POST", callback, url, headers, data, timeout);
  480. }
  481. };
  482.  
  483.  
  484. /*
  485. Copy and paste the code underneath into your script for quick reference
  486. and auto-complete feature if available.*/
  487. //*********************************************************************************
  488. //#region Declaration of JS Library Functions
  489. var TSL = new Object();
  490.  
  491. //Remove node from document. Accepts node object or node ID.
  492. TSL.removeNode = function (node, doc) { TimidScriptLibrary.removeNode(node, doc); };
  493. //Remove node from document. Accepts CSS Selector.
  494. TSL.removeNodes = function (selector, doc) { TimidScriptLibrary.removeNodes(selector, doc); };
  495. // Creates document element. Default doc value is the document.
  496. TSL.createElement = function (tag, attributes, doc) { return TimidScriptLibrary.createElement(tag, attributes, doc) };
  497. // Creates document element using html code. Default doc value is the document.
  498. TSL.createElementHTML = function (html, doc) { return TimidScriptLibrary.createElementHTML(html, doc) };
  499. //Returns the thickness of the scrollbar
  500. TSL.getScrollBarThickness = function () { return TimidScriptLibrary.getScrollBarThickness(); };
  501.  
  502. //Add CSS styles to document header. Document can be left empty.
  503. TSL.addStyle = function (id, CSS, doc) { return TimidScriptLibrary.addStyle(id, CSS, doc); };
  504. //Add JS script to document header. Document can be left empty.
  505. TSL.addScript = function (id, script, doc) { return TimidScriptLibrary.addScript(id, script, doc); };
  506.  
  507. // Checks if mouse event is within an elements client area
  508. TSL.isMouseEventInClientArea = function (event, element) { return TimidScriptLibrary.isMouseEventInClientArea(event, element); };
  509. // Gets the position of the element within the document
  510. TSL.getAbsolutePosition = function (element) { return TimidScriptLibrary.getAbsolutePosition(element); };
  511.  
  512. //Array containing NTFS illegal characters alternatives
  513. TSL.altNTFSChars = TimidScriptLibrary.altNTFSChars;
  514. TSL.replaceNTFSIllegals = function (str) { return TimidScriptLibrary.replaceNTFSIllegals(str); };
  515. //Escape Regular expression string
  516. TSL.escapeRegExp = function (str) { return TimidScriptLibrary.escapeRegExp(str); };
  517.  
  518. //Node className functions. All three functions can handle multiple classes separated by spaces
  519. TSL.addClass = function (node, names) { return TimidScriptLibrary.addClass(node, names); };
  520. TSL.removeClass = function (node, names) { return TimidScriptLibrary.removeClass(node, names); };
  521. TSL.hasClass = function (node, names) { return TimidScriptLibrary.hasClass(node, names); };
  522.  
  523. //Allows you to change the document URL, which is reflected in the URL bar.
  524. TSL.updateURL = function (url) { TimidScriptLibrary.updateURL(url); };
  525.  
  526. //Pad a number with zeros
  527. TSL.padNumber = function (number, length) { return TimidScriptLibrary.padNumber(number, length); };
  528. //Random Whole Number Generator
  529. TSL.randomNumber = function (min, max) { min = parseInt(min); max = parseInt(max); return Math.floor(Math.random() * (max - min + 1) + min); };
  530. TSL.delimitedNumber = function (value) {return TimidScriptLibrary.delimitedNumber(value); };
  531.  
  532. //Simple string hashing crc32
  533. TSL.crc32 = function (str) { return TimidScriptLibrary.crc32(str);}
  534.  
  535. var XHR = new Object();
  536. // callback(state, response) --- state: 0 = success | 1 = Fail | 2 = Timeout | 3 = Error
  537. XHR.send = function (method, callback, url, headers, data, timeout) { tsXHR.send(method, callback, url, headers, data, timeout); };
  538. // callback(success, response) --- state: 0 = success | 1 = Fail | 2 = Timeout | 3 = Error
  539. XHR.sendX = function (method, callback, url, headers, data, timeout) { tsXHR.sendX(method, callback, url, headers, data, timeout); };
  540. // callback(success, response)
  541. XHR.createHeaders = function (referer, accept, userAgent, contentType, authorization) { tsXHR.createHeaders(referer, accept, userAgent, contentType, authorization) };
  542. // callback(success, response)
  543. XHR.get = function (callback, url, headers, timeout) { tsXHR.get(callback, url, headers, timeout) };
  544. // callback(success, response)
  545. XHR.head = function (callback, url, headers, timeout) { tsXHR.head(callback, url, headers, timeout) };
  546. // callback(success, response)
  547. XHR.post = function (callback, url, headers, data, timeout) { tsXHR.post(callback, url, headers, data, timeout) };
  548.  
  549. //String Padding
  550. String.prototype.lPad = function (chr, length) { return TimidScriptLibrary.paddingLeft(this, chr[0], length); };
  551. String.prototype.rPad = function (chr, length) { return TimidScriptLibrary.paddingRight(this, chr[0], length); };
  552. //#endregion
  553. //*********************************************************************************
  554.  
  555. /*
  556. //Minified Declaration of Library Functions
  557. var TSL=new Object;TSL.removeNode=function(r,i){TimidScriptLibrary.removeNode(r,i)},TSL.removeNodes=function(r,i){TimidScriptLibrary.removeNodes(r,i)},TSL.createElement=function(r,i,e){return TimidScriptLibrary.createElement(r,i,e)},TSL.createElementHTML=function(r,i){return TimidScriptLibrary.createElementHTML(r,i)},TSL.getScrollBarThickness=function(){return TimidScriptLibrary.getScrollBarThickness()},TSL.addStyle=function(r,i,e){return TimidScriptLibrary.addStyle(r,i,e)},TSL.addScript=function(r,i,e){return TimidScriptLibrary.addScript(r,i,e)},TSL.isMouseEventInClientArea=function(r,i){return TimidScriptLibrary.isMouseEventInClientArea(r,i)},TSL.getAbsolutePosition=function(r){return TimidScriptLibrary.getAbsolutePosition(r)},TSL.altNTFSChars=TimidScriptLibrary.altNTFSChars,TSL.replaceNTFSIllegals=function(r){return TimidScriptLibrary.replaceNTFSIllegals(r)},TSL.escapeRegExp=function(r){return TimidScriptLibrary.escapeRegExp(r)},TSL.addClass=function(r,i){return TimidScriptLibrary.addClass(r,i)},TSL.removeClass=function(r,i){return TimidScriptLibrary.removeClass(r,i)},TSL.hasClass=function(r,i){return TimidScriptLibrary.hasClass(r,i)},TSL.updateURL=function(r){TimidScriptLibrary.updateURL(r)},TSL.padNumber=function(r,i){return TimidScriptLibrary.padNumber(r,i)},TSL.randomNumber=function(r,i){return r=parseInt(r),i=parseInt(i),Math.floor(Math.random()*(i-r+1)+r)},TSL.delimitedNumber=function(r){return TimidScriptLibrary.delimitedNumber(r)},TSL.crc32=function(r){return TimidScriptLibrary.crc32(r)};
  558. var XHR=new Object;XHR.send=function(r,i,t,e,n,a){tsXHR.send(r,i,t,e,n,a)},XHR.sendX=function(r,i,t,e,n,a){tsXHR.sendX(r,i,t,e,n,a)},XHR.createHeaders=function(r,i,t,e,n){tsXHR.createHeaders(r,i,t,e,n)},XHR.get=function(r,i,t,e){tsXHR.get(r,i,t,e)},XHR.head=function(r,i,t,e){tsXHR.head(r,i,t,e)},XHR.post=function(r,i,t,e,n){tsXHR.post(r,i,t,e,n)};
  559. String.prototype.lPad=function(r,i){return TimidScriptLibrary.paddingLeft(this,r[0],i)},String.prototype.rPad=function(r,i){return TimidScriptLibrary.paddingRight(this,r[0],i)};
  560. */