Greasy Fork is available in English.

TSLibrary - Generic

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

Verze ze dne 27. 04. 2019. Zobrazit nejnovější verzi.

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/19968/693102/TSLibrary%20-%20Generic.js

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