UNPKG

application-prototype

Version:
671 lines (612 loc) 145 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>constructors/extensions/prototype.js - Application Prototype - Framework</title> <meta name="description" content="Application Prototype Framework based on Module Pattern" /> <meta name="keywords" content="javascript, js, application-prototype, prototype" /> <meta name="keyword" content="javascript, js, application-prototype, prototype" /> <meta property="og:title" content="Application Prototype - Framework"/> <meta property="og:type" content="website"/> <meta property="og:image" content=""/> <meta property="og:url" content="https://labs.sgapps.io/open-source/application-prototype"/> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> <script src="scripts/nav.js" defer></script> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav class="wrap"> <input type="text" id="nav-search" placeholder="Search" /> <h2><a href="index.html">Home</a></h2><h2><a href="https://labs.sgapps.io/open-source/application-prototype" target="_blank" class="menu-item" id="website_link" >Project Page ( Git Lab )</a></h2><h2><a href="http://gordienco.net/" target="_blank" class="menu-item" id="website_link" >About Me</a></h2><h2><a href="https://github.com/sergiu-gordienco/application-prototype" target="_blank" class="menu-item" id="github_link" >GitHub</a></h2><h3>Modules</h3><ul><li><a href="module-uriLoad.html">uriLoad</a><ul class='methods'><li data-type='method' style='display: none;'><a href="module-uriLoad.html#.link">link</a></li><li data-type='method' style='display: none;'><a href="module-uriLoad.html#.script">script</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="ApplicationPrototype.Builder.html">Builder</a><ul class='methods'><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#bind">bind</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#consoleOptions">consoleOptions</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#crudEvents">crudEvents</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#debugEnabled">debugEnabled</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#emit">emit</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#isBrowser">isBrowser</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#isNode">isNode</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#modulePath">modulePath</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#moduleRegister">moduleRegister</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#off">off</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#on">on</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#once">once</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#property">property</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#require">require</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.html#runModulesInFiles">runModulesInFiles</a></li></ul></li><li class="level-hide"><a href="ApplicationPrototype.Builder.Promise.html">Promise</a><ul class='methods'><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.Promise.html#.all">all</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.Promise.html#.race">race</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.Promise.html#.reject">reject</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Builder.Promise.html#.resolve">resolve</a></li></ul></li><li><a href="ApplicationPrototype.Instance.html">Instance</a><ul class='methods'><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#bind">bind</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#crudEvents">crudEvents</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#emit">emit</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#off">off</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#on">on</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#once">once</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#property">property</a></li><li data-type='method' style='display: none;'><a href="ApplicationPrototype.Instance.html#property">property</a></li></ul></li><li><a href="async.Async.html">Async</a><ul class='methods'><li data-type='method' style='display: none;'><a href="async.Async.html#done">done</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#errors">errors</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#flush">flush</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#index">index</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#processing">processing</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#receive">receive</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#reserve">reserve</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#responses">responses</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#run">run</a></li><li data-type='method' style='display: none;'><a href="async.Async.html#wait">wait</a></li></ul></li><li><a href="ExtensionsPrototype.slDOMSet.html">slDOMSet</a><ul class='methods'><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#add">add</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#attr">attr</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#attr">attr</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#attr">attr</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#attr">attr</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#config">config</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#config">config</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#each">each</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#env">env</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#eq">eq</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#filter">filter</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#find">find</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#get">get</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#get">get</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#map">map</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#set">set</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#set">set</a></li><li data-type='method' style='display: none;'><a href="ExtensionsPrototype.slDOMSet.html#unique">unique</a></li></ul></li><li><a href="JSTemplateComponent.html">JSTemplateComponent</a></li><li><a href="RequestModule.html">RequestModule</a><ul class='members'><li data-type='member' style='display: none;'><a href="RequestModule.html#.READY_STATE_DONE">READY_STATE_DONE</a></li><li data-type='member' style='display: none;'><a href="RequestModule.html#.READY_STATE_HEADERS_RECEIVED">READY_STATE_HEADERS_RECEIVED</a></li><li data-type='member' style='display: none;'><a href="RequestModule.html#.READY_STATE_LOADING">READY_STATE_LOADING</a></li><li data-type='member' style='display: none;'><a href="RequestModule.html#.READY_STATE_OPENED">READY_STATE_OPENED</a></li><li data-type='member' style='display: none;'><a href="RequestModule.html#.READY_STATE_UNSENT">READY_STATE_UNSENT</a></li></ul><ul class='methods'><li data-type='method' style='display: none;'><a href="RequestModule.html#.ParamsParser">ParamsParser</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#async">async</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#async">async</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#basicAuth">basicAuth</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#basicAuth">basicAuth</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#config">config</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#configurator">configurator</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#headers">headers</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#headers">headers</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#method">method</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#method">method</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#open">open</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#readyState">readyState</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#request">request</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#response">response</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#send">send</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#status">status</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#statusText">statusText</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#timeout">timeout</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#timeout">timeout</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#url">url</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#url">url</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#withCredentials">withCredentials</a></li><li data-type='method' style='display: none;'><a href="RequestModule.html#withCredentials">withCredentials</a></li></ul></li></ul><h3>Events</h3><ul><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__afterGet">__afterGet</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__afterGet::propName">__afterGet::propName</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__afterSet">__afterSet</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__afterSet::propName">__afterSet::propName</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__onGet">__onGet</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__onGet::propName">__onGet::propName</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__onSet">__onSet</a></li><li class="level-hide"><a href="ApplicationPrototype.Instance.html#.event:__onSet::propName">__onSet::propName</a></li></ul><h3>Interfaces</h3><ul><li><a href="ApplicationPrototype.html">ApplicationPrototype</a></li><li><a href="Array.html">Array</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Array.html#__pointerFilter">__pointerFilter</a></li><li data-type='method' style='display: none;'><a href="Array.html#base64encode">base64encode</a></li><li data-type='method' style='display: none;'><a href="Array.html#bytesToHex">bytesToHex</a></li><li data-type='method' style='display: none;'><a href="Array.html#inArray">inArray</a></li><li data-type='method' style='display: none;'><a href="Array.html#indexOfSect">indexOfSect</a></li><li data-type='method' style='display: none;'><a href="Array.html#max">max</a></li><li data-type='method' style='display: none;'><a href="Array.html#min">min</a></li><li data-type='method' style='display: none;'><a href="Array.html#move">move</a></li><li data-type='method' style='display: none;'><a href="Array.html#resetArray">resetArray</a></li><li data-type='method' style='display: none;'><a href="Array.html#shuffle">shuffle</a></li><li data-type='method' style='display: none;'><a href="Array.html#split">split</a></li><li data-type='method' style='display: none;'><a href="Array.html#splitSect">splitSect</a></li><li data-type='method' style='display: none;'><a href="Array.html#toBinaryString">toBinaryString</a></li><li data-type='method' style='display: none;'><a href="Array.html#toBlob">toBlob</a></li><li data-type='method' style='display: none;'><a href="Array.html#toBytesBinary">toBytesBinary</a></li><li data-type='method' style='display: none;'><a href="Array.html#toBytesEscaped">toBytesEscaped</a></li><li data-type='method' style='display: none;'><a href="Array.html#toParamObj">toParamObj</a></li><li data-type='method' style='display: none;'><a href="Array.html#toStringUtf8">toStringUtf8</a></li><li data-type='method' style='display: none;'><a href="Array.html#unique">unique</a></li></ul></li><li><a href="ArrayBuffer.html">ArrayBuffer</a><ul class='methods'><li data-type='method' style='display: none;'><a href="ArrayBuffer.html#base64encode">base64encode</a></li><li data-type='method' style='display: none;'><a href="ArrayBuffer.html#toArray">toArray</a></li><li data-type='method' style='display: none;'><a href="ArrayBuffer.html#toBytes">toBytes</a></li><li data-type='method' style='display: none;'><a href="ArrayBuffer.html#toStringUtf8">toStringUtf8</a></li></ul></li><li><a href="async.html">async</a><ul class='methods'><li data-type='method' style='display: none;'><a href="async.html#.flow">flow</a></li><li data-type='method' style='display: none;'><a href="async.html#.flow_map">flow_map</a></li><li data-type='method' style='display: none;'><a href="async.html#.map">map</a></li><li data-type='method' style='display: none;'><a href="async.html#.waterfall">waterfall</a></li><li data-type='method' style='display: none;'><a href="async.html#.waterfall_map">waterfall_map</a></li></ul></li><li><a href="Blob.html">Blob</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Blob.html#toArrayBuffer">toArrayBuffer</a></li><li data-type='method' style='display: none;'><a href="Blob.html#toURL">toURL</a></li></ul></li><li><a href="BrowserSessionModule.html">BrowserSessionModule</a><ul class='methods'><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.clear">clear</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.findItems">findItems</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.getItem">getItem</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.getItems">getItems</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.removeItem">removeItem</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.removeItems">removeItems</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.setItem">setItem</a></li><li data-type='method' style='display: none;'><a href="BrowserSessionModule.html#.setItems">setItems</a></li></ul></li><li><a href="Buffer.html">Buffer</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Buffer.html#base64encode">base64encode</a></li><li data-type='method' style='display: none;'><a href="Buffer.html#toArray">toArray</a></li><li data-type='method' style='display: none;'><a href="Buffer.html#toBytes">toBytes</a></li><li data-type='method' style='display: none;'><a href="Buffer.html#toStringUtf8">toStringUtf8</a></li></ul></li><li><a href="ExtensionsPrototype.html">ExtensionsPrototype</a><ul class='members'><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#._">_</a></li><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#.__">__</a></li><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#.fn">fn</a></li><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#.object">object</a></li><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#.string">string</a></li><li data-type='member' style='display: none;'><a href="ExtensionsPrototype.html#.WindowExtend">WindowExtend</a></li></ul></li><li><a href="Function.html">Function</a><ul class='methods'><li data-type='method' style='display: none;'><a href="Function.html#runInWorker">runInWorker</a></li><li data-type='method' style='display: none;'><a href="Function.html#toWorker">toWorker</a></li><li data-type='method' style='display: none;'><a href="Function.html#toWorkerURL">toWorkerURL</a></li></ul></li><li><a href="HTMLElement.html">HTMLElement</a></li><li><a href="JSTemplate.html">JSTemplate</a><ul class='methods'><li data-type='method' style='display: none;'><a href="JSTemplate.html#.attrParser">attrParser</a></li><li data-type='method' style='display: none;'><a href="JSTemplate.html#.expressionBuilder">expressionBuilder</a></li><li data-type='method' style='display: none;'><a href="JSTemplate.html#.nodeParser">nodeParser</a></li><li data-type='method' style='display: none;'><a href="JSTemplate.html#.parseTextNodes">parseTextNodes</a></li><li data-type='method' style='display: none;'><a href="JSTemplate.html#.textParser">textParser</a></li></ul></li><li><a href="JSTemplateComponent.contextInstance.html">contextInstance</a><ul class='members'><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextInstance.html#.node">node</a></li><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextInstance.html#.references">references</a></li></ul><ul class='methods'><li data-type='method' style='display: none;'><a href="JSTemplateComponent.contextInstance.html#.redraw">redraw</a></li><li data-type='method' style='display: none;'><a href="JSTemplateComponent.contextInstance.html#.redrawForce">redrawForce</a></li></ul></li><li><a href="JSTemplateComponent.contextWithInstance.html">contextWithInstance</a><ul class='members'><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextWithInstance.html#.__instance">__instance</a></li><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextWithInstance.html#.__lifeCycle">__lifeCycle</a></li><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextWithInstance.html#.state">state</a></li></ul></li><li><a href="JSTemplateComponent.contextWithoutInstance.html">contextWithoutInstance</a><ul class='members'><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextWithoutInstance.html#.__lifeCycle">__lifeCycle</a></li><li data-type='member' style='display: none;'><a href="JSTemplateComponent.contextWithoutInstance.html#.state">state</a></li></ul></li><li><a href="String.html">String</a><ul class='methods'><li data-type='method' style='display: none;'><a href="String.html#add_Class">add_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#add_Class">add_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decode">base64decode</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decode">base64decode</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeBytes">base64decodeBytes</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeBytes">base64decodeBytes</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeBytesArray">base64decodeBytesArray</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeBytesArray">base64decodeBytesArray</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeClean">base64decodeClean</a></li><li data-type='method' style='display: none;'><a href="String.html#base64decodeClean">base64decodeClean</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encode">base64encode</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encode">base64encode</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeBytes">base64encodeBytes</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeBytes">base64encodeBytes</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeBytesArray">base64encodeBytesArray</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeBytesArray">base64encodeBytesArray</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeClean">base64encodeClean</a></li><li data-type='method' style='display: none;'><a href="String.html#base64encodeClean">base64encodeClean</a></li><li data-type='method' style='display: none;'><a href="String.html#buildQuery">buildQuery</a></li><li data-type='method' style='display: none;'><a href="String.html#buildQuery">buildQuery</a></li><li data-type='method' style='display: none;'><a href="String.html#buildSearchArray">buildSearchArray</a></li><li data-type='method' style='display: none;'><a href="String.html#buildSearchArray">buildSearchArray</a></li><li data-type='method' style='display: none;'><a href="String.html#cleanTags">cleanTags</a></li><li data-type='method' style='display: none;'><a href="String.html#cleanTags">cleanTags</a></li><li data-type='method' style='display: none;'><a href="String.html#decodeURI">decodeURI</a></li><li data-type='method' style='display: none;'><a href="String.html#decodeURI">decodeURI</a></li><li data-type='method' style='display: none;'><a href="String.html#decryptAes">decryptAes</a></li><li data-type='method' style='display: none;'><a href="String.html#decryptAes">decryptAes</a></li><li data-type='method' style='display: none;'><a href="String.html#decryptTea">decryptTea</a></li><li data-type='method' style='display: none;'><a href="String.html#decryptTea">decryptTea</a></li><li data-type='method' style='display: none;'><a href="String.html#del_Class">del_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#del_Class">del_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#encodeURI">encodeURI</a></li><li data-type='method' style='display: none;'><a href="String.html#encodeURI">encodeURI</a></li><li data-type='method' style='display: none;'><a href="String.html#encryptAes">encryptAes</a></li><li data-type='method' style='display: none;'><a href="String.html#encryptAes">encryptAes</a></li><li data-type='method' style='display: none;'><a href="String.html#encryptTea">encryptTea</a></li><li data-type='method' style='display: none;'><a href="String.html#encryptTea">encryptTea</a></li><li data-type='method' style='display: none;'><a href="String.html#escape">escape</a></li><li data-type='method' style='display: none;'><a href="String.html#escape">escape</a></li><li data-type='method' style='display: none;'><a href="String.html#escapeHex">escapeHex</a></li><li data-type='method' style='display: none;'><a href="String.html#escapeHex">escapeHex</a></li><li data-type='method' style='display: none;'><a href="String.html#fnd_Class">fnd_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#fnd_Class">fnd_Class</a></li><li data-type='method' style='display: none;'><a href="String.html#fromHex">fromHex</a></li><li data-type='method' style='display: none;'><a href="String.html#fromHex">fromHex</a></li><li data-type='method' style='display: none;'><a href="String.html#fromHtml">fromHtml</a></li><li data-type='method' style='display: none;'><a href="String.html#fromHtml">fromHtml</a></li><li data-type='method' style='display: none;'><a href="String.html#lcfirst">lcfirst</a></li><li data-type='method' style='display: none;'><a href="String.html#lcfirst">lcfirst</a></li><li data-type='method' style='display: none;'><a href="String.html#markdown">markdown</a></li><li data-type='method' style='display: none;'><a href="String.html#match_str">match_str</a></li><li data-type='method' style='display: none;'><a href="String.html#match_str">match_str</a></li><li data-type='method' style='display: none;'><a href="String.html#md5">md5</a></li><li data-type='method' style='display: none;'><a href="String.html#md5">md5</a></li><li data-type='method' style='display: none;'><a href="String.html#parseUrl">parseUrl</a></li><li data-type='method' style='display: none;'><a href="String.html#parseUrl">parseUrl</a></li><li data-type='method' style='display: none;'><a href="String.html#parseUrlVars">parseUrlVars</a></li><li data-type='method' style='display: none;'><a href="String.html#sha1">sha1</a></li><li data-type='method' style='display: none;'><a href="String.html#sha1">sha1</a></li><li data-type='method' style='display: none;'><a href="String.html#sha256">sha256</a></li><li data-type='method' style='display: none;'><a href="String.html#sha256">sha256</a></li><li data-type='method' style='display: none;'><a href="String.html#subs">subs</a></li><li data-type='method' style='display: none;'><a href="String.html#subs">subs</a></li><li data-type='method' style='display: none;'><a href="String.html#subs">subs</a></li><li data-type='method' style='display: none;'><a href="String.html#swp_case">swp_case</a></li><li data-type='method' style='display: none;'><a href="String.html#swp_case">swp_case</a></li><li data-type='method' style='display: none;'><a href="String.html#toArrayBufferFromUtf8">toArrayBufferFromUtf8</a></li><li data-type='method' style='display: none;'><a href="String.html#toArrayBufferFromUtf8">toArrayBufferFromUtf8</a></li><li data-type='method' style='display: none;'><a href="String.html#toHex">toHex</a></li><li data-type='method' style='display: none;'><a href="String.html#toHex">toHex</a></li><li data-type='method' style='display: none;'><a href="String.html#toHtml">toHtml</a></li><li data-type='method' style='display: none;'><a href="String.html#toHtml">toHtml</a></li><li data-type='method' style='display: none;'><a href="String.html#toHtmlSimple">toHtmlSimple</a></li><li data-type='method' style='display: none;'><a href="String.html#toHtmlSimple">toHtmlSimple</a></li><li data-type='method' style='display: none;'><a href="String.html#toRegexp">toRegexp</a></li><li data-type='method' style='display: none;'><a href="String.html#toRegexp">toRegexp</a></li><li data-type='method' style='display: none;'><a href="String.html#ucfirst">ucfirst</a></li><li data-type='method' style='display: none;'><a href="String.html#ucfirst">ucfirst</a></li><li data-type='method' style='display: none;'><a href="String.html#unescape">unescape</a></li><li data-type='method' style='display: none;'><a href="String.html#unescape">unescape</a></li><li data-type='method' style='display: none;'><a href="String.html#unicode">unicode</a></li><li data-type='method' style='display: none;'><a href="String.html#unicode">unicode</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8">utf8</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8">utf8</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8decode">utf8decode</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8decode">utf8decode</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8encode">utf8encode</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8encode">utf8encode</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8need">utf8need</a></li><li data-type='method' style='display: none;'><a href="String.html#utf8need">utf8need</a></li></ul></li><li></li></ul><h3>Global</h3><ul><li><a href="global.html#ApplicationBuilderConstructor">ApplicationBuilderConstructor</a></li><li><a href="global.html#ApplicationBuilderExports">ApplicationBuilderExports</a></li><li><a href="global.html#ApplicationPrototypeConstructor">ApplicationPrototypeConstructor</a></li><li><a href="global.html#NodeInterface">NodeInterface</a></li><li><a href="global.html#RequestModuleConstructor">RequestModuleConstructor</a></li></ul> </nav> <div id="main"> <h1 class="page-title">constructors/extensions/prototype.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/* jshint -W002 */ /* jshint -W032 */ /* jshint -W027 */ /* jshint -W086 */ var slDOMEvents_cache = {}; /** * @interface ExtensionsPrototype */ module.exports = ((function () { var _public = {}; /** * @var {object} fn * @memberof ExtensionsPrototype * @property {ExtensionsPrototype.WindowFunctions} window * @property {ExtensionsPrototype.MouseFunctions} mouse * @property {(ExtensionsPrototype.getRandId_1|ExtensionsPrototype.getRandId_2)} getRandId */ _public.fn = {}; /** * @typedef {object} WindowFunctions * @memberof ExtensionsPrototype * @property {object} sizeLimit * @property {ExtensionsPrototype.windowSizeCache} sizeLimit.min * @property {ExtensionsPrototype.windowSizeCache} sizeLimit.max * @property {number} [refreshRate=200] how often to recalculate window size * @property {ExtensionsPrototype.windowSizeActive} sizeActive * @property {ExtensionsPrototype.windowSize} size */ _public.fn.window = {}; /** * @typedef {object} MouseFunctions * @memberof ExtensionsPrototype * @property {MouseEvent} event * @property {ExtensionsPrototype.MousePosition} position * @property {object} config * @property {boolean} config.tracking */ _public.fn.mouse = {}; /** * @var {object} object * @property {(ExtensionsPrototype.ObjectExtend_1|ExtensionsPrototype.ObjectExtend_2)} extend * @memberof ExtensionsPrototype */ _public.object = {}; /** * @var {object} string * @memberof ExtensionsPrototype */ _public.string = {}; if (typeof(window) === "undefined") { //@ts-ignore window = {}; // console.warn("Not a Browser Space, window doesn't exist"); } if (typeof(document) === "undefined") { document = undefined; // console.warn("Not a Browser Space, document not found"); } if (typeof(navigator) === "undefined") { //@ts-ignore navigator = { userAgent: "Node Server" }; // console.warn("Not a Browser Space, navigator not found"); } ;((function (window) { //@ts-ignore window.URL = (window.URL || window.webkitURL || {}); //@ts-ignore window.createObjectURL = (window.URL || window.webkitURL || {}).createObjectURL || function(){}; //@ts-ignore window.MutationObserver = window.MutationObserver //@ts-ignore || window.WebKitMutationObserver //@ts-ignore || window.MozMutationObserver; //@ts-ignore window.RTCPeerConnection = window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection; })(window)); /** * addEventListener window document Element */ /* jshint -W033 */ /* jshint -W061 */ var er; try { //@ts-ignore if (document) eval(function(p,a,c,k,e,r){e=function(c){return(c&lt;a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5(){1(!8.3.6){2 g=[];2 h=5(a,b){2 c=4;2 d=5(e){e.A=e.q;e.B=c;1(b.r){b.r(e)}9{b.C(c,e)}};1(a=="s"){2 f=5(e){1(j.t=="u"){d(e)}};j.v("w",f);g.x({k:4,l:a,m:b,7:f});1(j.t=="u"){2 e=D E();e.q=F;f(e)}}9{4.v("y"+a,d);g.x({k:4,l:a,m:b,7:d})}};2 i=5(a,b){2 c=0;G(c&lt;g.H){2 d=g[c];1(d.k==4&amp;&amp;d.l==a&amp;&amp;d.m==b){1(a=="s"){4.z("w",d.7)}9{4.z("y"+a,d.7)}I}++c}};8.3.6=h;8.3.n=i;1(o){o.3.6=h;o.3.n=i}1(p){p.3.6=h;p.3.n=i}}})();',45,45,'|if|var|prototype|this|function|addEventListener|wrapper|Element|else||||||||||document|object|type|listener|removeEventListener|HTMLDocument|Window|srcElement|handleEvent|DOMContentLoaded|readyState|complete|attachEvent|onreadystatechange|push|on|detachEvent|target|currentTarget|call|new|Event|window|while|length|break'.split('|'),0,{})) } catch (er) { console.warn("[warn]", er) } /** * @var {any} WindowExtend * @memberof ExtensionsPrototype * @example * window.addEvent(elem, type, handler); * window.removeEvent(elem, type, handlerId); * * window.addEventListener(eventName, function (event) {}); */ try { //@ts-ignore if (document) eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(0(){4(h.i){5.7=0(a,b,c,d){a.i(b,c,!!d);3 c};5.8=0(a,b,c,d){a.o(b,c,!!d);3 9}}j 4(h.k){5.7=0(a,b,c){b="6"+b;f d=0(){3 c.l(a,m)};a.k(b,d);3 d};5.8=0(a,b,c){b="6"+b;a.p(b,c);3 9}}j{5.7=0(b,c,d){c="6"+c;b.2=b.2||{};4(!b.2[c]){b.2[c]={n:1};b[c]=0(){q(f a r e){4(e.s(a)){4(t e[a]=="0"){e[a].l(u,m)}}}}}f e=b.2[c],g=e.n++;e[g]=d;3 g};5.8=0(a,b,c){b="6"+b;4(a.2&amp;&amp;a.2[b]&amp;&amp;a.2[b][c])a.2[b][c]=v;3 9}}})();',32,32,'function||memoize|return|if|window|on|addEvent|removeEvent|true||||||var|id|document|addEventListener|else|attachEvent|apply|arguments|counter|removeEventListener|detachEvent|for|in|hasOwnProperty|typeof|this|undefined'.split('|'),0,{})); } catch (er) { console.warn("[warn]", er) } /* jshint +W033 */ /* jshint +W061 */ var getRandId = ((function() { var getRandId_k = 0; return function(x, b) { var r = (getRandId_k++) + '' + new Date().valueOf() + '' + Math.floor(Math.random() * 1000000000); if (x === true || b === true) r = parseInt(r).toString(36); return ((x &amp;&amp; x !== true) ? x : '') + r; }; })()); /** * @callback getRandId_1 * @memberof ExtensionsPrototype * @param {string} prefix * @param {boolean} minimize */ /** * @callback getRandId_2 * @memberof ExtensionsPrototype * @param {boolean} minimize */ _public.fn.getRandId = getRandId; /** window size detection */ ((function () { var getWindowSize_limit = { min : { w : false, h : false }, max : { w : false, h : false } }; var getWindowSize_fRaw = function(){ return {w:800,h:600}; }; if (document) ((function(){ if(typeof(window.innerWidth)=='number') { getWindowSize_fRaw = function(o){ if(typeof(o) == "object" &amp;&amp; ('window' in o)) return { w: o.window.innerWidth,h:o.window.innerHeight }; return { w: window.innerWidth,h:window.innerHeight }; }; } else if(document.documentElement &amp;&amp; (document.documentElement.clientWidth || document.documentElement.clientHeight)) { getWindowSize_fRaw = function(o){ if(typeof(o) == "object" &amp;&amp; ('document' in o)) return { w: o.document.documentElement.clientWidth,h: o.document.documentElement.clientHeight }; return { w: document.documentElement.clientWidth,h: document.documentElement.clientHeight }; }; } else if(document.body &amp;&amp; (document.body.clientWidth || document.body.clientHeight)){/*IE 4 compatible*/ getWindowSize_fRaw = function(o){ if(typeof(o) == "object" &amp;&amp; ('document' in o)) return { w: o.document.body.clientWidth, h: o.document.body.clientHeight }; return { w: document.body.clientWidth, h: document.body.clientHeight }; }; } else if(parseInt(navigator.appVersion)>3) { if(navigator.appName=="Netscape") { getWindowSize_fRaw = function(o){ if(typeof(o) == "object" || !('window' in o)) return { w: o.window.innerWidth, h: o.window.innerHeight}; return { w: window.innerWidth, h: window.innerHeight}; }; } if(navigator.appName.indexOf("Microsoft")!=-1) { getWindowSize_fRaw = function(o){ if(typeof(o) == "object" &amp;&amp; ('document' in o)) return { w: o.document.body.offsetWidth, h : o.document.body.offsetHeight }; return { w : document.body.offsetWidth, h : document.body.offsetHeight }; }; } } })()); var getWindowSize_f = function () { var size = getWindowSize_fRaw(); if (getWindowSize_limit.min.w !== false) { size.w = Math.max( size.w, getWindowSize_limit.min.w ); } if (getWindowSize_limit.min.h !== false) { size.h = Math.max( size.h, getWindowSize_limit.min.h ); } if (getWindowSize_limit.max.w !== false) { size.w = Math.min( size.w, getWindowSize_limit.max.w ); } if (getWindowSize_limit.max.h !== false) { size.h = Math.min( size.h, getWindowSize_limit.max.h ); } return size; }; _public.fn.window.sizeLimit = getWindowSize_limit; _public.fn.window.refreshRate = 200; var _timer_active = 0; var _cache_active = getWindowSize_f(); var _timer_raw = 0; var _cache_raw = getWindowSize_fRaw(); /** * @typedef {object} windowSizeCache * @memberof ExtensionsPrototype * @property {number} w * @property {number} h */ /** * @callback windowSizeActive * @memberof ExtensionsPrototype * @property {boolean} refreshed * @returns {ExtensionsPrototype.windowSizeCache} */ _public.fn.window.sizeActive = function (refreshed) { var t = new Date().valueOf(); if (refreshed || _timer_active &lt; (t - _public.fn.window.refreshRate)) { _timer_active = t; _cache_active = getWindowSize_f(); } return _cache_active; }; /** * @callback windowSize * @memberof ExtensionsPrototype * @property {boolean} refreshed * @returns {ExtensionsPrototype.windowSizeCache} */ _public.fn.window.size = function (refreshed) { var t = new Date().valueOf(); if (refreshed || _timer_raw &lt; (t - _public.fn.window.refreshRate)) { _timer_raw = t; _cache_raw = getWindowSize_fRaw(); } return _cache_raw; }; })()); /** window mousemove event and mouse position */ if (document) ((function () { var MouseMove = { config: {} }; MouseMove.config.tracking = true; MouseMove.event = { pageX : 0, pageY : 0 }; document.addEventListener("mousemove", function (e) { if (MouseMove.config.tracking) { MouseMove.event = e; } }); var getMousePosXY = false; ((function(){ if(document.layers) { getMousePosXY = function(e,o){ if(!e) e = MouseMove.event; if(!o) o = {};var doc = ('document' in o) ? o.document : window;var win = ('window' in o) ? o.window : window; return {x: e.pageX, y: e.pageY, xmax: win.innerWidth+win.pageXOffset, ymax: win.innerHeight+win.pageYOffset}; }; } if(document.all){ getMousePosXY = function(e,o){ if(!e) e = MouseMove.event; if(!o) o = {};var doc = ('document' in o) ? o.document : window;var win = ('window' in o) ? o.window : window; return {x: win.event.x+doc.body.scrollLeft, y: win.event.y+doc.body.scrollTop, xmax: doc.body.clientWidth+doc.body.scrollLeft, ymax: doc.body.clientHeight+doc.body.scrollTop}; }; } else if(document.getElementById){ getMousePosXY = function(e,o){ if(!e) e = MouseMove.event; if(!o) o = {};var doc = ('document' in o) ? o.document : window;var win = ('window' in o) ? o.window : window; return {x: e.pageX, y: e.pageY, xmax: win.innerWidth+win.pageXOffset, ymax: win.innerHeight+win.pageYOffset}; }; } })()); /** * @typedef {object} MousePositionCache * @memberof ExtensionsPrototype * @property {number} x * @property {number} y * @property {number} xmax * @property {number} ymax */ /** * @callback MousePosition * @memberof ExtensionsPrototype * @param {MouseEvent} [eventMouseMove] * @param {object} [context] * @param {object} [context.window] * @param {object} [context.document] * @returns {ExtensionsPrototype.MousePositionCache} */ MouseMove.position = function (eventMouseMove, windowOrDocumentObject) { return getMousePosXY(eventMouseMove, windowOrDocumentObject); }; _public.fn.mouse = MouseMove; })()); /** * @callback ObjectExtend_1 * @memberof ExtensionsPrototype * @param {object} object * @param {object} options * @param {any} options.value * @param {boolean} [options.readonly=false] * @param {boolean} [options.visible=false] * @param {boolean} [options.config=false] */ /** * @callback ObjectExtend_2 * @memberof ExtensionsPrototype * @param {object} object * @param {object} options * @param {function():void} [options.get] * @param {function(any):void} [options.set] * @param {boolean} [options.visible=false] * @param {boolean} [options.config=false] */ _public.object.extend = function(obj,o) { // key // get | set | value // visible : true // readonly : false // config : true if('value' in o) { Object.defineProperty(obj, o.key, {value : o.value, writable : ('readonly' in o ? ( !o.readonly ) : true), enumerable : ('visible' in o ? o.visible : true), configurable : ('config' in o ? o.config : true)}); } else { Object.defineProperty(obj, o.key, { get : ('get' in o ? o.get : function(){ return null; }), set : ('set' in o ? o.set : function(val){ }), // writable : ('readonly' in o ? ( !o.readonly ) : true), enumerable : ('visible' in o ? o.visible : true), configurable : ('config' in o ? o.config : true)}); } }; /** * Attr data object */ if (document) ((function () { /** * @interface HTMLElement */ /** * @memberof HTMLElement# * @var {object} attrdata object for storing custom variables */; /** * @memberof HTMLElement# * @var {object} attrdatastore */; _public.object.extend(HTMLElement.prototype, { key : "attrdata", get : /** * @private * @this {HTMLElement} */ function () { if (typeof(this.attrdatastore) === "undefined") { this.attrdatastore = {}; var attr = this.attributes; var i, er; for (i=0;i&lt;attr.length;i++) { if (attr[i].name.match(/^attr\-/)) { this.attrdatastore[attr[i].name.replace(/^attr\-/, '').replace(/-./g, function (m) { return m.charAt(1).toUpperCase(); })] = attr[i].value; } else if (attr[i].name.match(/^attrb\-/)) { try { this.attrdatastore[attr[i].name.replace(/^attrb\-/, '').replace(/-./g, function (m) { return m.charAt(1).toUpperCase(); })] = JSON.parse(attr[i].value); } catch (er) {} } else if (attr[i].name.match(/^attrf\-/)) { try { this.attrdatastore[attr[i].name.replace(/^attrf\-/, '').replace(/-./g, function (m) { return m.charAt(1).toUpperCase(); })] = new Function("return ( " + attr[i].value + " );").bind(this)(); } catch (er) {} } else if (attr[i].name.match(/^data\-/)) { if (typeof(this.attrdatastore.__dataset === "undefined")) { this.attrdatastore.__dataset = {}; } this.attrdatastore.__dataset[attr[i].name.replace(/^data\-/, '').replace(/-./g, function (m) { return m.charAt(1).toUpperCase(); })] = attr[i].value; } } } return this.attrdatastore; }, set : function (o) { if (o &amp;&amp; typeof(o) === "object") { var i; var store = this.attrdata; for (i in o) { store[i] = o[i]; } } }, visible : true, readonly: true, configurable : false }); })()); _public.object.merge = function() { if(typeof(arguments[0]) == "object") { var i,j,k;for(i=1;i&lt;arguments.length;i++) if(typeof(arguments[i]) == "object") for(j in arguments[i]) if( arguments[i][j] === null ) { if(j in arguments[0]) try { delete arguments[0][j]; } catch(k) {} } else { arguments[0][j] = arguments[i][j]; } return arguments[0]; } return arguments[0]; }; ((function () { var objEncodeURL = function(o,k, encodeURIKeys) { var r = [],i; if(!k) k = ""; if(Array.isArray(o) &amp;&amp; k) { for( i=0; i&lt;o.length; i++ ) r.push( objEncodeURL( o[i], ""+k+( encodeURIKeys ? encodeURIComponent("["+i+"]") : ("[" + i + "]") ) ), encodeURIKeys ); } else if( typeof(o) == "object" ) { for( i in o ) r.push( objEncodeURL( o[i], "" + k + ( encodeURIKeys ? encodeURIComponent( ( k ? "[" : "" )+i+( k ? "]" : "" ) ) : ( ( k ? "[" : "" )+i+( k ? "]" : "" ) ) ), encodeURIKeys ) ); } else if( k ) { return ""+k+"="+encodeURIComponent(o); } return r.join('&amp;'); }; _public.object.encodeURL = objEncodeURL; })()); // Return a boolean value telling whether // the first argument is an Array object. if(!Array.isArray) { Array.isArray = function (vArg) { return Object.prototype.toString.call(vArg) === "[object Array]"; }; } if (!String.isString) { String.isString = function () {if(arguments[0] === null) return false;if(typeof(arguments[0]) == 'string') return true;if(typeof(arguments[0])== 'object'){var criterion=arguments[0].constructor.toString().match(/string/i);return (criterion !== null);}return false;}; } var slDOMset=function(v){ var p = _(); var set = []; var config = { unique : true }; var methods = { config : function (k, v) { if (typeof(v) === "undefined") { if (typeof(k) !== "string") return null; return ( typeof(config[k]) === "undefined" ? null : config[k] ); } else { if (typeof(k) !== "string") return methods; if (typeof(config[k]) !== "undefined" &amp;&amp; typeof(config[k]) === typeof(v)) { config[k] = v; } return methods; } }, unique : function () { set = set.filter(function (v, k, arr) { return arr.indexOf(v) === k; }); return methods; }, set : function (v) { var config_unique = this.config("unique"); var i, arr; if (typeof(v) === "string") { v = document.querySelectorAll(v); arr = []; for (i=0;i&lt;v.length;i++) { if (!config_unique || arr.indexOf(v[i]) === -1) { arr.push(v[i]); } } set = arr; } else if (v &amp;&amp; typeof(v) === "object") { if (v.length) { arr = []; for (i=0;i&lt;v.length;i++) { if (!config_unique || arr.indexOf(v[i]) === -1) { arr.push(v[i]); } } set = arr; } } return methods; }, add : function () { var config_unique = this.config("unique"); var i; for (i=0;i&lt;arguments.length;i++) { if (Array.isArray(arguments[i])) { methods.add.apply(methods, arguments[i]); } else if (typeof(arguments[i]) === "object") { if (!config_unique || set.indexOf(arguments[i]) === -1) { set.push(arguments[i]); } } else if (typeof(arguments[i]) === "string") { methods.add.apply(methods, document.querySelectorAll(arguments[i])); } } return methods; }, env : function () { return p.env; }, get : function (k) { if (typeof(k) === "number") { return (set[k] || null); } return set; }, eq : function (k) { if (set.length > k) { set = [set[k]]; } else { set = []; } return methods; }, find : function (s) { var config_unique = this.config("unique"); var ret = []; set.forEach(function (node) { p.E(node).q(s).forEach(function (child) { if (!config_unique || ret.indexOf(child) === -1) { ret.push(child); } }); }); set = ret; return methods; }, filter : function (callback) { set = set.filter(function (node, k) { return (callback(node, k, set, p) || false); }); return methods; }, each : function (callback) { set.forEach(function (node, k) { return (callback(node, k, set, p) || false); }); return methods; }, map : function (callback) { set = set.map(function (node, k) { return (callback(node, k, set, p) || false); }).filter(function (node) { return ( node !== false ); }); return methods; }, attr : function (v) { var node; if (arguments.length === 0) { node = this.get(0); return ( node !== null ? (node.attributes || []) : [] ); } els