query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b2d4e737963154f55b42968781bdcc81
Fix IE bugs, see support tests
[ { "docid": "f252ee9d9e7807e646acfdce05bfe97f", "score": "0.0", "text": "function fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}", "title": "" } ]
[ { "docid": "442714d07a8d493f596e5315ef86807d", "score": "0.70940924", "text": "function fixIESelect() {\n return false;\n }", "title": "" }, { "docid": "442714d07a8d493f596e5315ef86807d", "score": "0.70940924", "text": "function fixIESelect() {\n return false;\n }", "title": "" }, { "docid": "f7da8f48117eedce79f2c436a2ab127c", "score": "0.6577498", "text": "function IEpngFix() {\n\t\tif ($.browser.msie) {\n\t\t\tvar transparentImage = \"i/tr.gif\";\n\t\t\t\n\t\t\toImg = $(\"img[src$=.png].png\");\n\t\t\tlImg = $(\"img[src$=.png].png\").length;\n\t\t\t\n\t\t\tfor (i = 0; i < lImg; i++) {\n\t\t\t\tsrcImg = $(oImg[i]).attr(\"src\");\n\t\t\t\t$(oImg[i]).attr({\n\t\t\t\t\tsrc: transparentImage\n\t\t\t\t});\n\t\t\t\toImg[i].runtimeStyle.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" + srcImg + \"',sizingMethod='scale')\";\n\t\t\t\toImg[i].style.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "76ca04456f672a61434fbc1fced3650f", "score": "0.64759374", "text": "function isIE()\r\n{\r\n var i=navigator.userAgent.toLowerCase().indexOf(\"msie\");\r\n return i>=0;\r\n}", "title": "" }, { "docid": "a3980597afc97de73e5cd668555713ce", "score": "0.6429259", "text": "get isMSIE()\n {\n return navigator.userAgent.toLowerCase().indexOf(\"trident\") > -1;\n }", "title": "" }, { "docid": "6d02ed54017e9ebd7a3f023529650b8a", "score": "0.64245456", "text": "function iecompattest(){\nreturn (document.compatMode && document.compatMode!=\"BackCompat\")? document.documentElement : document.body\n}", "title": "" }, { "docid": "2a4e8f32c1948f6ef771c6712e65e412", "score": "0.63378626", "text": "function detect_old_ie() {\n if (/MSIE (\\d+\\.\\d+);/.test(navigator.userAgent)) {\n var o = new Number(RegExp.$1);\n return !(9 <= o) && (8 <= o || 7 <= o || 6 <= o || 5 <= o || void 0);\n }\n\n return !1;\n}", "title": "" }, { "docid": "3ace1e407a62a75578cec4ec6212f5ee", "score": "0.6263015", "text": "function isIE() {\n return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);\n}", "title": "" }, { "docid": "b78c4ea564e97d5a386172d666e04b94", "score": "0.62370473", "text": "function ie() {\n\treturn (navigator.appVersion.indexOf(\"MSIE 6\") != -1 || navigator.appVersion.indexOf(\"MSIE 7\") != -1 || navigator.appVersion.indexOf(\"MSIE 8\") != -1);\n}", "title": "" }, { "docid": "312736cb07a46e2562665bde172f9dbd", "score": "0.6227955", "text": "function fixBrowserBugs() {\n /*\n BUG-FIX for Mozilla:\n Inputs of type \"number\" doesn't get the focus\n in the Mozilla browser if one\n of the up- or down-buttons of the number-inputs\n is clicked.\n\n Detected: Mozilla Firefox 55.0b3 (32-Bit)\n */\n $(function () {\n $(\"input[type='number']\").on(\"click\", function () {\n $(this).focus();\n });\n });\n }", "title": "" }, { "docid": "306c9fb8fd3d6433fb504f47cd9f8f10", "score": "0.6190383", "text": "function runBrowserHacks() {\r\n if($.browser.mozilla){\r\n $('.pagination select').css('position','relative');\r\n $('.pagination select').css('top','2px');\r\n }\r\n if($.browser.msie){\r\n \t$('#modal-add-roles .allRoles_id input').css('margin-bottom', '0px');\r\n $('#wrapper #main-container.admin .filter li.column .filter-search .checkbox').css('margin-top','6px');\r\n $('#wrapper #main-container.admin .filter li.column .filter-search .checkbox').css('margin-right','4px');\r\n $('#wrapper #main-container.admin .filter li.column .scroll li .checkbox').css('margin-top','0px');\r\n $('#wrapper #main-container.admin .filter li.column .scroll li .checkbox').css('margin-right','2px');\r\n $('#modal-create-user .form .row-role input, #modal-update-user .form .row-role input').css('margin-top','0px');\r\n $('.pagination select').css('margin-top','3px');\r\n $('.remember .checkbox').css('margin-top','-3px');\r\n $('.input-prices .radio').css('position','relative');\r\n $('.input-prices .radio').css('top','-3px');\r\n $('.input-prices .radio').css('margin-right','0px');\r\n // $('.data td .checkbox').css('margin','-4px');\r\n $('#wrapper #main-container.admin .result-section .result-table .data th div.checkboxHeader').removeClass('checkboxHeader');\r\n }\r\n if($.browser.msie&&($.browser.version == \"7.0\")){\r\n $('#wrapper #main-container.admin .filter li.column .filter-search .checkbox').css('margin-top','9px');\r\n $('#wrapper #main-container.admin .filter li.column .scroll li .checkbox').css('margin-top','1px');\r\n $('.data input:checkbox').css('margin-top','4px');\r\n $('.pagination select').css('margin-top','1px');\r\n $('.input-prices .radio').css('top','-1px');\r\n $('.remember .checkbox').css('margin-top','-1px');\r\n }\r\n if($.browser.msie&&($.browser.version == \"9.0\")){\r\n $('#wrapper #main-container.admin .result-section').css('height','339px');\r\n }\r\n}", "title": "" }, { "docid": "bfc856691f88c1235b291ee9274b63e2", "score": "0.61266464", "text": "function fixHistoryForIE() {\n\t\t//Add history entry\n\t\tgetIframe().open();\n\t\tgetIframe().close();\n\t\tgetIframe().location.hash = hash;\n\t}", "title": "" }, { "docid": "34d697b85d1e2d8ed19aabe9743ecfb1", "score": "0.6122366", "text": "function IsIE() { return ( is.ie && is.major >= 5 ); }", "title": "" }, { "docid": "e71d9b18fc1d7e4ea93b26e0806a6284", "score": "0.606645", "text": "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n console.log('IE 9 or below detected.');\n return true;\n } else {\n console.log('This browsers is not IE 9 or below. 001');\n return false;\n }\n }", "title": "" }, { "docid": "9a29a0d1df01c878c9d33e376b161778", "score": "0.6017773", "text": "function fixie_handler(element) { // 57\n if (!/^\\s*$/.test(element.innerHTML)){ // 58\n var childs = element.children; // 59\n if(childs.length){ // 60\n for(var fixie_i = 0; fixie_i < childs.length; fixie_i++){ // 61\n fixie_handler(childs[fixie_i]); // 62\n } // 63\n } // 64\n return; // 65\n } // 66\n switch (element.nodeName.toLowerCase()) { // 67\n case 'b': // 68\n case 'em': // 69\n case 'strong': // 70\n case 'button': // 71\n case 'th': // 72\n case 'td': // 73\n case 'title': // 74\n case 'tr': // 75\n element.innerHTML = fixie_fetchWord(); // 76\n break; // 77\n // 78\n case 'header': // 79\n case 'cite': // 80\n case 'caption': // 81\n case 'mark': // 82\n case 'q': // 83\n case 's': // 84\n case 'u': // 85\n case 'small': // 86\n case 'span': // 87\n case 'code': // 88\n case 'pre': // 89\n case 'li': // 90\n case 'dt': // 91\n case 'h1': // 92\n case 'h2': // 93\n case 'h3': // 94\n case 'h4': // 95\n case 'h5': // 96\n case 'h6': // 97\n element.innerHTML = fixie_fetchPhrase(); // 98\n break; // 99\n // 100\n case 'footer': // 101\n case 'aside': // 102\n case 'summary': // 103\n case 'blockquote': // 104\n case 'p': // 105\n element.innerHTML = fixie_fetchParagraph(); // 106\n break; // 107\n // 108\n case 'article': // 109\n case 'section': // 110\n element.innerHTML = fixie_fetchParagraphs(); // 111\n break; // 112\n // 113\n /* Special cases */ // 114\n case 'a': // 115\n element.href = 'http://ryhan.me/'; // 116\n element.innerHTML = 'www.' + fixie_fetchWord() + fixie_capitalize(fixie_fetchWord()) + '.com'; // 117\n break; // 118\n // 119\n case 'img': // 120\n var src = element.getAttribute('src') || element.src; // 121\n var temp = element.getAttribute('fixie-temp-img'); // 122\n if(src === '' || src === null || temp === true || temp === 'true'){ // 123\n var width = element.getAttribute('width') || element.width || (element.width = 250); // 124\n var height = element.getAttribute('height') || element.height || (element.height = 100); // 125\n var title = element.getAttribute('title') || ''; // 126\n element.src = imagePlaceHolder.replace('${w}', width).replace('${h}', height).replace('${text}', title);\n element.setAttribute('fixie-temp-img', true); // 128\n } // 129\n break; // 130\n // 131\n case 'ol': // 132\n case 'ul': // 133\n element.innerHTML = fixie_fetchList(); // 134\n break; // 135\n // 136\n case 'dl': // 137\n element.innerHTML = fixie_fetchDefinitionList(); // 138\n break; // 139\n // 140\n case 'hr': // 141\n break; // 142\n // 143\n default: // 144\n element.innerHTML = fixie_fetchSentence(); // 145\n } // 146\n } // 147", "title": "" }, { "docid": "598fddbc1a5ee08d77d813242f2e33a0", "score": "0.5993908", "text": "function checkie() {\n\t var ie = !jQuery.support.opacity;\n\n\t// CHECK THE jQUERY VERSION\n\tvar version = jQuery.fn.jquery.split('.'),\n\t\tversionTop = parseFloat(version[0]),\n\t\tversionMinor = parseFloat(version[1]),\n\t\tversionIncrement = parseFloat(version[2] || '0');\n\n\tif (versionTop>1) opt.ie=false;\n\n\treturn ie;\n\n}", "title": "" }, { "docid": "7279c3a1322b176d9d821f27300f3721", "score": "0.5984845", "text": "function hasLiDeletingProblem() {\n return isIE();\n }", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.59769297", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.59769297", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.59769297", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "c4c2b6da09f26341b3dfd075a86296d7", "score": "0.59769297", "text": "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "title": "" }, { "docid": "363c3eb749d38e0b4860390171f657df", "score": "0.5947188", "text": "function IE8Fixes() {\n\t\t// Object.keys\n\t\tObject.keys = Object.keys || (function () {\n\t\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\n\t\t\t\thasDontEnumBug = !{toString:null}.propertyIsEnumerable(\"toString\"),\n\t\t\t\tDontEnums = [\n\t\t\t\t\t'toString',\n\t\t\t\t\t'toLocaleString',\n\t\t\t\t\t'valueOf',\n\t\t\t\t\t'hasOwnProperty',\n\t\t\t\t\t'isPrototypeOf',\n\t\t\t\t\t'propertyIsEnumerable',\n\t\t\t\t\t'constructor'\n\t\t\t\t],\n\t\t\t\tDontEnumsLength = DontEnums.length;\n\t\t \n\t\t\treturn function (o) {\n\t\t\t\tif (typeof o != \"object\" && typeof o != \"function\" || o === null)\n\t\t\t\t\tthrow new TypeError(\"Object.keys called on a non-object\");\n\t\t\t \n\t\t\t\tvar result = [];\n\t\t\t\tfor (var name in o) {\n\t\t\t\t\tif (hasOwnProperty.call(o, name))\n\t\t\t\t\t\tresult.push(name);\n\t\t\t\t}\n\t\t\t \n\t\t\t\tif (hasDontEnumBug) {\n\t\t\t\t\tfor (var i = 0; i < DontEnumsLength; i++) {\n\t\t\t\t\t\tif (hasOwnProperty.call(o, DontEnums[i]))\n\t\t\t\t\t\t\tresult.push(DontEnums[i]);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t \n\t\t\t\treturn result;\n\t\t\t};\n\t\t})();\n\n\n\t\t// Canvas.\n\n\n\t} // end function IE8FIXES", "title": "" }, { "docid": "00e2cd9b21bbdb63fc7588413338acae", "score": "0.5902167", "text": "function isOldIE() {\n var oldIE = false,\n ua = window.navigator.userAgent.toLowerCase();\n\n if (ua && ua.indexOf('msie') !== -1) {\n var version = parseInt(ua.split('msie')[1]);\n if (version < 10) {\n oldIE = true;\n }\n }\n\n return oldIE;\n}", "title": "" }, { "docid": "06ed5c76a5c14b70d663949e9f98bb31", "score": "0.59009665", "text": "function hasIframeFocusIssue() {\n return isIE();\n }", "title": "" }, { "docid": "2635793ca2c5a6bf1a718134cadf50b5", "score": "0.5891624", "text": "function fixIeBug(string) {\n\t\t\t\tif ($.browser.msie) {\n\t\t\t\t\treturn string.length - string.replace(/\\r*/g, '').length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "title": "" }, { "docid": "7c34e296b778978a4465e7aacc483ab8", "score": "0.58835375", "text": "function _checkHistoryLegacyIE(){\n\t\tvar windowHash = _getWindowHash(),\n\t\t\tframeHash = _trimHash(_getFrameHash());\n\t\tif(frameHash != _hash && frameHash != windowHash){ //detect changes made pressing browser history buttons. Workaround since history.back() and history.forward() doesn't update hash value on IE6/7 but updates content of the iframe.\n\t\t\tHasher.setHash(frameHash);\n\t\t}else if(windowHash != _hash){ //detect if hash changed (manually or using setHash)\n\t\t\t_registerChange(windowHash);\n\t\t}\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "1f7327f0058987c3387dced049bbc545", "score": "0.5881813", "text": "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "title": "" }, { "docid": "6de5e3fd92613f9ed9b5ea5d53ec330a", "score": "0.5877154", "text": "function isIE(version,comparison){var $div=jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));$div.html('<!--[if ' + (comparison || '') + ' IE ' + (version || '') + ']><a>&nbsp;</a><![endif]-->');var ieTest=$div.find('a').length;$div.remove();return ieTest;}", "title": "" }, { "docid": "cd2108aba03b88c17c5aa6a04f7d6008", "score": "0.587091", "text": "function isIE () {\n\t\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t\t}", "title": "" }, { "docid": "dafe29dbd9edf9fb2217344607bf68d7", "score": "0.5863872", "text": "function browserIsIe6Or7(){\r\n\tvar bro=$.browser; \r\n if(bro.msie) {\r\n \tvar binfo=bro.version.charAt(0);\r\n \tif('6' == binfo || '7' == binfo){\r\n \t\treturn true;\r\n \t}\r\n }\r\n return false; \r\n}", "title": "" }, { "docid": "38a113f0e33a4815e15ffb43e88662fb", "score": "0.58622867", "text": "function fixIEMouseDown() {\n _ieSelectBack = doc.body.onselectstart;\n doc.body.onselectstart = fixIESelect;\n }", "title": "" }, { "docid": "38a113f0e33a4815e15ffb43e88662fb", "score": "0.58622867", "text": "function fixIEMouseDown() {\n _ieSelectBack = doc.body.onselectstart;\n doc.body.onselectstart = fixIESelect;\n }", "title": "" }, { "docid": "e5668908463061db807cce417a1f9f91", "score": "0.58358437", "text": "function isIE() {\n return (navigator.appName == \"Microsoft Internet Explorer\");\n}", "title": "" }, { "docid": "bd4958d00bfdd56c004124cf9580be4d", "score": "0.5826975", "text": "function isIE() {\n return _bowser.default.name === 'Internet Explorer';\n}", "title": "" }, { "docid": "cc857f92585a55780d86bef0b0b8ba34", "score": "0.58120674", "text": "function supportsModernPaste() {\n return !isIE();\n }", "title": "" }, { "docid": "537be5a47f165a8b6bfe7d0bbe74fd77", "score": "0.5808384", "text": "function isIE()\r\n\t{\r\n\t\tif(window.ActiveXObject || \"ActiveXObject\" in window)\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\t\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7547e91d0b60e8402406c3da4deaf4d6", "score": "0.5802634", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "fb91d60f1f1691651c7278366790e3c4", "score": "0.579363", "text": "function IEdetection() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older, alert to use modern browsers Google Chrome or FireFox\n alert('You are using '+'Internet Explorer ' + parseInt(ua.substring(\n msie + 5, ua.indexOf('.', msie)), 10)+\". Please use Google Chrome or FireFox for best functionality.\");\n console.log(\"IE < 10 test Pass\")\n }\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11, alert to use modern browsers Google Chrome or FireFox\n var rv = ua.indexOf('rv:');\n alert('You are using '+'Internet Explorer ' + parseInt(ua.substring(\n rv + 3, ua.indexOf('.', rv)), 10)+\". Please use Google Chrome or FireFox for best functionality.\");\n console.log(\"IE 11 test Pass\")\n }\n}", "title": "" }, { "docid": "41614a4d4bd06edf81bba522ca895daa", "score": "0.57913536", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = _globals.window.navigator || {};\n var userAgent = opts.userAgent || navigator.userAgent || ''; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "a986c06f1416d9580cca23c1206b1e00", "score": "0.5782508", "text": "function isOldIE() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var navigator = _globals.window.navigator || {};\n var userAgent = opts.userAgent || navigator.userAgent; // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n\n var isMSIE = userAgent.indexOf('MSIE ') !== -1;\n var isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}", "title": "" }, { "docid": "2d15e9e4a0a6189720c6444c7c1d7d46", "score": "0.5769625", "text": "function extra_pixel(){\n\treturn ($.browser.msie && ($.browser.version == 7.0 || $.browser.version == 8.0))?1:0;\t\n}", "title": "" }, { "docid": "4bd2d2640be23f22031646d3dc279cf0", "score": "0.57494634", "text": "function fixie_handle_elements(elements){ // 150\n for (var i = 0; i < elements.length; i++) { // 151\n fixie_handler(elements[i]); // 152\n } // 153\n } // 154", "title": "" }, { "docid": "600aa9a2e5dcd16ed7875eb69e732be6", "score": "0.57457364", "text": "function isedge(){\n var isEdge = !isIE && !!window.StyleMedia;\n return isEdge;\n}", "title": "" }, { "docid": "12c4b35a717325da0853e38a8138c4be", "score": "0.57254565", "text": "function detectIE()\n{\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n if(msie > 0)\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n var trident = ua.indexOf('Trident/');\n if(trident > 0)\n\t{\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n var edge = ua.indexOf('Edge/');\n if(edge > 0)\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n return false;\n}", "title": "" }, { "docid": "0c36a702f8ba541311cd0a055f1d6e41", "score": "0.5723554", "text": "function fixPNG(element) {\n\tif (/MSIE (5\\.5|6).+Win/.test(navigator.userAgent))\n\t{\n\t\tvar src;\n\t\t\n\t\tif (element.tagName=='IMG')\n\t\t{\n\t\t\tif (/\\.png(\\?[0-9]+)?$/.test(element.src))\n\t\t\t{\n\t\t\t\tsrc = element.src;\n\t\t\t\telement.src = asset_host + \"/images/blank.gif\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsrc = element.currentStyle.backgroundImage.match(/url\\(\"(.+\\.png(\\?[0-9]+)?)\"\\)/i)\n\t\t\tif (src)\n\t\t\t{\n\t\t\t\tsrc = src[1];\n\t\t\t\telement.runtimeStyle.backgroundImage=\"none\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (src) element.runtimeStyle.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" + src + \"',sizingMethod='scale')\";\n\t}\n}", "title": "" }, { "docid": "5a1ca975ff7848d18df41f0dd9458615", "score": "0.5715793", "text": "function msieversion() {\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf ( 'MSIE ' );\n\t\n\treturn ( msie > 0 ) ? parseInt (ua.substring (msie+5, ua.indexOf ('.', msie ))) : 9999;\n}", "title": "" }, { "docid": "70f9fdbd83803d3ff0ccb55205dbce0c", "score": "0.5691371", "text": "function getInternetExplorerVersion(){var i=-1,n,t;return\"Microsoft Internet Explorer\"==navigator.appName?(n=navigator.userAgent,t=new RegExp(\"MSIE ([0-9]{1,}[.0-9]{0,})\"),null!=t.exec(n)&&(i=parseFloat(RegExp.$1))):\"Netscape\"==navigator.appName&&(n=navigator.userAgent,t=new RegExp(\"Trident/.*rv:([0-9]{1,}[.0-9]{0,})\"),null!=t.exec(n)&&(i=parseFloat(RegExp.$1))),i}", "title": "" }, { "docid": "37328e1973f381608309b6a57dbf31e1", "score": "0.56839293", "text": "function checkIfIsMsie() {\n privateIsMsie = uaLowerCase.match(/(msie)/) !== null;\n }", "title": "" }, { "docid": "62314f2ce47167d15b71845aebf9eb55", "score": "0.56797856", "text": "function CSRemoveIEbox() {\n if (document.images && navigator.userAgent.indexOf(\"MSIE\") != -1) {\n for (i = 0; i < document.links.length; i++) {\n target = eval(\"document.links[i]\")\n target.onfocus = blurHandler\n }\n }\n }", "title": "" }, { "docid": "60d80786946ee77eaa151b1df093199a", "score": "0.564436", "text": "function ieimgposition(nextsh,opt){if(isIE(8)){var ie8img=nextsh.find('.ieeightfallbackimage');var ie8w=ie8img.width(),ie8h=ie8img.height();if(opt.startwidth / opt.startheight < nextsh.data('owidth') / nextsh.data('oheight'))ie8img.css({width:\"auto\",height:\"100%\"});else ie8img.css({width:\"100%\",height:\"auto\"});setTimeout(function(){var ie8w=ie8img.width(),ie8h=ie8img.height();if(nextsh.data('bgposition') == \"center center\")ie8img.css({position:\"absolute\",top:opt.height / 2 - ie8h / 2 + \"px\",left:opt.width / 2 - ie8w / 2 + \"px\"});if(nextsh.data('bgposition') == \"center top\" || nextsh.data('bgposition') == \"top center\")ie8img.css({position:\"absolute\",top:\"0px\",left:opt.width / 2 - ie8w / 2 + \"px\"});if(nextsh.data('bgposition') == \"center bottom\" || nextsh.data('bgposition') == \"bottom center\")ie8img.css({position:\"absolute\",bottom:\"0px\",left:opt.width / 2 - ie8w / 2 + \"px\"});if(nextsh.data('bgposition') == \"right top\" || nextsh.data('bgposition') == \"top right\")ie8img.css({position:\"absolute\",top:\"0px\",right:\"0px\"});if(nextsh.data('bgposition') == \"right bottom\" || nextsh.data('bgposition') == \"bottom right\")ie8img.css({position:\"absolute\",bottom:\"0px\",right:\"0px\"});if(nextsh.data('bgposition') == \"right center\" || nextsh.data('bgposition') == \"center right\")ie8img.css({position:\"absolute\",top:opt.height / 2 - ie8h / 2 + \"px\",right:\"0px\"});if(nextsh.data('bgposition') == \"left bottom\" || nextsh.data('bgposition') == \"bottom left\")ie8img.css({position:\"absolute\",bottom:\"0px\",left:\"0px\"});if(nextsh.data('bgposition') == \"left center\" || nextsh.data('bgposition') == \"center left\")ie8img.css({position:\"absolute\",top:opt.height / 2 - ie8h / 2 + \"px\",left:\"0px\"});},20);}} ///////////////////////", "title": "" }, { "docid": "784c10f776068bf73a616e3064185a4a", "score": "0.56432855", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n return true;\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n return true;\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n\treturn false;\n }\n\n // other browser\n return false;\n}", "title": "" }, { "docid": "fa7cfa6f239eb7efaff5254e53f41bd9", "score": "0.5629002", "text": "function hasProblemsSettingCaretAfterImg() {\n return isIE();\n }", "title": "" }, { "docid": "83d93e5c3350e5460957e7c0d7ca6adf", "score": "0.55709594", "text": "function checkBrowserCompatibility() {\n var isIE = navigator.userAgent.indexOf('MSIE') > -1;\n var isEdge = navigator.userAgent.indexOf('Edge/') > -1 || navigator.userAgent.indexOf('Edg/') > -1;\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n /* Check for\n <= IE11 (Trident 7)\n Edge <= 16\n Firefox <= 64\n Chrome <= 54\n */\n\n var isEdgeVersion = /Edge\\/([0-9.]+)/.exec(navigator.userAgent);\n\n if (isIE && parseFloat(/Trident\\/([0-9.]+)/.exec(navigator.userAgent)[1]) <= 7) {\n return false;\n } else if (isEdge && (isEdgeVersion && parseFloat(isEdgeVersion[1]) <= 16 || parseFloat(/Edg\\/([0-9.]+)/.exec(navigator.userAgent)[1]) <= 16)) {\n return false;\n } else if (isFirefox && parseFloat(/Firefox\\/([0-9.]+)/.exec(navigator.userAgent)[1]) <= 64) {\n return false;\n } else if (isChrome && parseFloat(/Chrome\\/([0-9.]+)/.exec(navigator.userAgent)[1]) <= 54) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "35106c8803957e00b6f9463fa731334c", "score": "0.5564144", "text": "function isIEExp() {\n\tvar isIntEx = null;\n\tisIntEx = (navigator.appName.indexOf(\"Microsoft\") != -1) ? true : false;\n\treturn isIntEx;\n}", "title": "" }, { "docid": "e458162c80a02070667c205fe01e7900", "score": "0.55564994", "text": "function setIEStyling() {\n\t$(\"#logoContainer\").removeClass(\"loginLogo\");\n\t$(\"#logoContainer\").addClass(\"loginLogoIE\");\n\t$(\"#incompatibleBrowseMsg\").css(\"font-size\", \"0.8em\");\n\t$(\"#fullLoginFooter\").css(\"font-size\", \"0.76em\");\n}", "title": "" }, { "docid": "59907a0bae011a75005f2b15b4158b2b", "score": "0.5524177", "text": "IsIEorEdge() {\n return (navigator.userAgent.includes(\"MSIE \") || navigator.userAgent.includes(\"Trident/\") || navigator.userAgent.includes(\"Edge/\"));\n }", "title": "" }, { "docid": "65267cc496a33ec41b3c6d4d901ec952", "score": "0.55232066", "text": "function isIE() {\n var ieLTE10 = isOldIE(),\n ie11 = !!window.navigator.userAgent.match(/Trident.*rv\\:11\\./);\n\n return ieLTE10 || ie11;\n}", "title": "" }, { "docid": "1bf3b6ef11c1864b7ee0629cee0b8ed6", "score": "0.552117", "text": "function hasTransparentBug(browser) {\n return ~['ie 8', 'ie 9'].indexOf(browser);\n}", "title": "" }, { "docid": "3fe453dbe003151542b3cd42ab76f8c7", "score": "0.5519012", "text": "function checkForDOMChange() {\nif (!$.browser.msie) {\n$(document).unbind(\"DOMSubtreeModified\");\n}\nstickyFooter();\n}", "title": "" }, { "docid": "c2ef8e4830b28f4a75d41d95e858fc12", "score": "0.5504441", "text": "function ie(){this.i=0,this.j=0,this.S=new Array}", "title": "" }, { "docid": "0fa1d1d2f7ec8dab67d69f330f7495c7", "score": "0.5483159", "text": "function oldIE() {\n\t onSuccess(JSON.parse(req.responseText));\n\t }", "title": "" }, { "docid": "ae04f7c7fdcf8a83d3cebf3e82a69061", "score": "0.5474742", "text": "function isIE() {\n let ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n return ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n}", "title": "" }, { "docid": "d5f633c890312cdf57da3c9f0d217d3b", "score": "0.5474519", "text": "function checkIE() {\n var regexp = /MSIE (\\d+\\.\\d+);/;\n return regexp.test(navigator.userAgent);\n \n /* pour aller plus loin dans la detection de navigateur\n if (regexp.test(navigator.userAgent)) {\n var ieversion=new Number(RegExp.$1);\n if (ieversion <= 9)\n {\n alert('ie < 9');\n }\n }\n else {\n alert('pas ie');\n }*/\n}", "title": "" }, { "docid": "24aab9255df1730bb0d7b45335cf4a5d", "score": "0.5473083", "text": "function ngxChartsPolyfills() {\n // IE11 fix\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\n if (typeof SVGElement !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\n }\n }", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.54689884", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "ee6d3913e9735540272a2ab053617422", "score": "0.54689884", "text": "function isIE( version, comparison ){\n\t\t var $div = jQuery('<div style=\"display:none;\"/>').appendTo(jQuery('body'));\n\t\t $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a>&nbsp;</a><![endif]-->');\n\t\t var ieTest = $div.find('a').length;\n\t\t $div.remove();\n\t\t return ieTest;\n\t\t}", "title": "" }, { "docid": "c55df3fa06b4c58cee7c65a447f35b0e", "score": "0.54575336", "text": "static isIE(returnVersion = false){\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',\n all[0]\n );\n\n return (returnVersion && v > 4) ? v\n : (v > 4) ? true\n : false;\n }", "title": "" }, { "docid": "4b7f875abb0ce38d04aa1f53f2345a4b", "score": "0.5452284", "text": "function FreezeDocument(win){\r\n\tif(bMSIE){\r\n\t\twin.document.body.onselectstart = Cancel;\r\n\t\twin.document.body.ondragstart = Cancel;\r\n\t\twin.document.body.oncontextmenu = Cancel;\r\n\t\tif(isMSIE6())\r\n\t\t\twin.document.body.style.cursor = \"default\";\r\n\t}else{\r\n\t\twin.oncontextmenu = Cancel;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "24e9546c8490e84f345230bc830d5cb0", "score": "0.5448556", "text": "function browserCheck()\n{\nvar check=navigator.appName;\n if (check==\"Microsoft Internet Explorer\")\n {\n browserInfo=\"bad\";\n }\n}", "title": "" }, { "docid": "c7df95f22a97c21e5f05f3fceb904def", "score": "0.54472286", "text": "function _disableIEMenuShortcut() {\n if (Ext.isIE) {\n var ch = 'abcdefghijklmnopqrstuvwxyz01234567890'.split('');\n var str = '<span style=\"position:absolute\">';\n var span, i, anchor;\n var lastElementWithFocus;\n\n for (i = 0; i < ch.length; i++) {\n str += '<a accessKey=\"' + ch[i] + '\" href=\"javascript:void(0)\" tabIndex=\"-1\"></a>';\n }\n str += '</span>';\n\n span = Ext.dom.Helper.insertFirst(Ext.getBody(), str);\n for (i = 0; i < span.children.length; i++) {\n anchor = span.children[i];\n anchor.onbeforeactivate = function() {\n lastElementWithFocus = document.activeElement;\n _ignoreIEFocusEvent = true;\n };\n anchor.onfocus = function() {\n var saveLastElementWithFocus = lastElementWithFocus;\n lastElementWithFocus = null;\n _ignoreIEFocusEvent = false;\n _restoreFocusToPreviousElement(saveLastElementWithFocus);\n }\n }\n }\n }", "title": "" }, { "docid": "790584fdb2c40cc3a823feb74efafcc8", "score": "0.54438555", "text": "function isIE() {\n ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n var is_ie = ua.indexOf('MSIE ') > -1 || ua.indexOf('Trident/') > -1;\n\n return is_ie;\n }", "title": "" }, { "docid": "4fcd58ab40b7384f1b053fedbfd3358d", "score": "0.54394746", "text": "function doResponsivescreenForltIE9(){\n windowWidth = document.documentElement.clientWidth || document.body.clientWidth;\n //Display patient list and image list as per screen height\n if(window.location.href.indexOf('patients') > -1) {\n var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;\n if(windowHeight >= 0 && windowHeight <= 791){\n $(\"#patientLists\").css({'margin-left': '-25px', 'max-height': '475px', 'overflow': 'auto', 'position': 'relative'});\n $(\".patient_image_gallery_view\").css({'max-height': '390px', 'overflow': 'auto', 'position': 'relative'});\n }else if(windowHeight >= 792 && windowHeight <= 1191){\n $(\"#patientLists\").css({'margin-left': '-25px', 'max-height': '750px', 'overflow': 'auto', 'position': 'relative'});\n $(\".patient_image_gallery_view\").css({'max-height': '670px', 'overflow': 'auto', 'position': 'relative'});\n }else{\n $(\"#patientLists\").css({'margin-left': '-25px', 'max-height': '1150px', 'overflow': 'auto', 'position': 'relative'});\n $(\".patient_image_gallery_view\").css({'max-height': '1070px', 'overflow': 'auto', 'position': 'relative'});\n }\n }\n }", "title": "" }, { "docid": "47554c81aa5739fd934bca8942e42568", "score": "0.54367006", "text": "function ieViewportFix() {\n\n\t\tvar msViewportStyle = document.createElement(\"style\");\n\n\t\tmsViewportStyle.appendChild(\n\t\t\tdocument.createTextNode(\n\t\t\t\t\"@-ms-viewport { width: device-width; }\"\n\t\t\t)\n\t\t);\n\n\t\tif (navigator.userAgent.match(/IEMobile\\/10\\.0/)) {\n\n\t\t\tmsViewportStyle.appendChild(\n\t\t\t\tdocument.createTextNode(\n\t\t\t\t\t\"@-ms-viewport { width: auto !important; }\"\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tdocument.getElementsByTagName(\"head\")[0].\n\t\t\t\tappendChild(msViewportStyle);\n\n\t}", "title": "" }, { "docid": "97a51c9b0c6dcac4d83dcc8aa994d4a7", "score": "0.54297805", "text": "function e(t){var e={},i={},n=t.match(/Firefox\\/([\\d.]+)/),a=t.match(/MSIE\\s([\\d.]+)/)||t.match(/Trident\\/.+?rv:(([\\d.]+))/),o=t.match(/Edge\\/([\\d.]+)/),r=/micromessenger/i.test(t);return n&&(i.firefox=!0,i.version=n[1]),a&&(i.ie=!0,i.version=a[1]),o&&(i.edge=!0,i.version=o[1]),r&&(i.weChat=!0),{browser:i,os:e,node:!1,canvasSupported:!!document.createElement(\"canvas\").getContext,svgSupported:\"undefined\"!=typeof SVGRect,touchEventsSupported:\"ontouchstart\"in window&&!i.ie&&!i.edge,pointerEventsSupported:\"onpointerdown\"in window&&(i.edge||i.ie&&i.version>=11),domSupported:\"undefined\"!=typeof document}}", "title": "" }, { "docid": "115bafd0b038fbf87cdccb50b3f24add", "score": "0.54261494", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var edge = ua.indexOf(\"Edge/\");\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(\n ua.substring(edge + 5, ua.indexOf(\".\", edge)),\n 10\n );\n }\n }", "title": "" }, { "docid": "49ee58172a785a30b6937a944e974311", "score": "0.5424676", "text": "function isEmulatingIE7() {\n var metaTags = document.getElementsByTagName(\"meta\"),\n content,\n i;\n for (i = 0; i < metaTags.length; i = i + 1) {\n content = metaTags[i].getAttribute(\"content\");\n if (content !== null && metaTags[i].getAttribute(\"http-equiv\") === \"X-UA-Compatible\" && (content.indexOf(\"IE=EmulateIE7\") > -1 || content.indexOf(\"IE=7\") > -1)) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2925c46b5427625832cbf53b99db3eab", "score": "0.5424093", "text": "function preventIEKeys(e) {\r\n // Check if a known key combo is pressed\r\n if (e.keyCode === Common.KeyCodes.F5 ||\r\n e.keyCode === Common.KeyCodes.F6 ||\r\n (e.keyCode === Common.KeyCodes.F10 && e.shiftKey) ||\r\n (e.keyCode === Common.KeyCodes.F && e.ctrlKey)) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "5ab996d3394828a434c77bf3ee4f1d0a", "score": "0.54079086", "text": "function ngxChartsPolyfills() {\n // IE11 fix\n // Ref: https://github.com/swimlane/ngx-charts/issues/386\n if (typeof SVGElement !== 'undefined' && typeof SVGElement.prototype.contains === 'undefined') {\n SVGElement.prototype.contains = HTMLDivElement.prototype.contains;\n }\n }", "title": "" }, { "docid": "d253b302eb23f49f156eba7613a361e5", "score": "0.53995574", "text": "function clickIE4()\r\n{\r\n if (event.button==2)\r\n { //alert(message);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "71c3bec5d622272b69d024a3eb31b5ab", "score": "0.5389019", "text": "function doesAutoLinkingInContentEditable() {\n return isIE();\n }", "title": "" }, { "docid": "0aedeabbc0e70ccdeec87261c10c2e11", "score": "0.5376497", "text": "is_edge_or_ie() {\n\t\t//ie11\n\t\tif( !(window.ActiveXObject) && \"ActiveXObject\" in window )\n\t\t\treturn true;\n\t\t//edge\n\t\tif( navigator.userAgent.indexOf('Edge/') != -1 )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "2c5a31320d4ffe0f8f592ca38ba7e6ea", "score": "0.53723156", "text": "function detectIE() {\n\t\tvar ua = window.navigator.userAgent;\n\t\tvar msie = ua.indexOf('MSIE ');\n\t\tif (msie > 0) {\n\t\t\t// IE 10 or older => return version number\n\t\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t\t}\n\t\tvar trident = ua.indexOf('Trident/');\n\t\tif (trident > 0) {\n\t\t\t// IE 11 => return version number\n\t\t\tvar rv = ua.indexOf('rv:');\n\t\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t\t}\n\t\tvar edge = ua.indexOf('Edge/');\n\t\tif (edge > 0) {\n\t\t // IE 12 => return version number\n\t\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t\t}\n\t\t// other browser\n\t\treturn false;\n\t}", "title": "" }, { "docid": "bba688519d6b1805af6d1ff9796fe8c2", "score": "0.5370387", "text": "function ConvertBKtoIE() {\n\tvar s = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Firefox Bookmarks</title><link rel=\"stylesheet\" href=\"../jquery.treeview.css\" /><link rel=\"stylesheet\" href=\"../red-treeview.css\" /><link rel=\"stylesheet\" href=\"screen.css\" /><script src=\"../lib/jquery.js\" type=\"text/javascript\"></script><script src=\"../lib/jquery.cookie.js\" type=\"text/javascript\"></script><script src=\"../jquery.treeview.js\" type=\"text/javascript\"></script><script src=\"myExtra.js\" type=\"text/javascript\"></script></head><body class=\"font1\"><div id=\"main\"> <div id=\"sidetree\"><div class=\"treeheader\">My Bookmarks</div><div id=\"sidetreecontrol\"> <a href=\"?#\">Collapse All</a> | <a href=\"?#\">Expand All</a> </div><ul class=\"treeview\" id=\"tree\">'\n\ts = s+getAllBookmarks(navBookmarksService.bookmarksMenuFolder);\n\ts = s + '</ul></div></div></body></html>'\n\t// save file\n\tsave(\"D:\\\\wwwroot\\\\Bookmarks\\\\demo\\\\main.htm\", s);\n\talert('Converting Bookmarks to html has done!')\n}", "title": "" }, { "docid": "3fa4e83837c1d4c3a1ad95399c288560", "score": "0.5363073", "text": "function ieFixImages(){\n if ( !msieversion() ) return\n var $images = $('.h100-bg img')\n if ( $images.length === 0 ) return\n\n $images.each(function(i, img){\n var $img = $(img);\n var $parent = $img.closest('.h100-bg');\n var bg = $img.attr('src');\n\n // find smaller picture\n if ( ($img.closest('picture').length > 0) && (getWindowWidth() <= 768) ){\n var $picture = $img.closest('picture')\n var pictureMedia = $picture.find('source').last().attr('srcset').split(\" \")[0]\n bg = pictureMedia\n }\n $parent.css({\n 'background-image': 'url(' + bg + ')'\n })\n\n $img.css({'visibility': 'hidden'})\n })\n }", "title": "" }, { "docid": "dcc75936f878e0db697fa4be539ec461", "score": "0.53607166", "text": "function isIE() {\n return '\\v' == 'v';\n}", "title": "" }, { "docid": "006d3e765039e37204dc1af0cd43e1fb", "score": "0.5355791", "text": "function fixGeckoHandles(ed) {\r\n ed.execCommand('mceRepaint', false);\r\n }", "title": "" }, { "docid": "132a12972c3aff15ea924c9316e510d7", "score": "0.5353387", "text": "function isInternetExplorerBefore(version) {\n var iematch = /MSIE ([0-9]+)/g.exec(window.navigator.userAgent);\n\n return iematch ? +iematch[1] < version : false;\n}", "title": "" }, { "docid": "0b4323a352e59caba7905791a8ba239a", "score": "0.53444844", "text": "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n\t // IE 10 or older => return version number\n\t return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t }\n\n\t var trident = ua.indexOf('Trident/');\n\t if (trident > 0) {\n\t // IE 11 => return version number\n\t var rv = ua.indexOf('rv:');\n\t return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t }\n\n\t var edge = ua.indexOf('Edge/');\n\t if (edge > 0) {\n\t // IE 12 => return version number\n\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n\t // other browser\n\t return false;\n\t}", "title": "" } ]
51f619191df41db0a846e9dca826e858
This function will loop through the listings and show only those that fit the search criteria from the input box
[ { "docid": "aaf586dd086c8eb402ee457bc49718f3", "score": "0.0", "text": "function searchRestaurants(){\n\n var searchRestaurant = document.getElementById(\"searchInput\").value\n if (searchRestaurant === '') {\n window.alert('You must enter a city or a country');\n }\n else{\n\n for (var i = 0; i < markers.length; i++) {\n var starter = markers[i].title + markers[i].description + markers[i].address + markers[i].specialtiesDeals\n\n var foundOrNot= starter.search(new RegExp(searchRestaurant, \"i\"));\n // alert(i + \" \" + starter + \" \" + result)\n\n if (foundOrNot<0){\n markers[i].setMap(null);\n }\n else{\n\n markers[i].setMap(map);\n markers[i].setAnimation(google.maps.Animation.BOUNCE);\n stopAnimations(markers[i]);\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "71bc1285aee8943c77f9e0a9ad4fd482", "score": "0.7473261", "text": "function jobSearch() {\r\n // Declare variables\r\n var input, filter, ul, li, a, i, txtValue;\r\n input = document.getElementById('jobInput');\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"jobAvailable\");\r\n li = ul.getElementsByTagName('li');\r\n\r\n if(input.value.length == 0) {\r\n ul.style.display = \"none\";\r\n return;\r\n }\r\n else {\r\n ul.style.display = \"block\";\r\n }\r\n\r\n // Loop through all list items, and hide those who don't match the search query\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n txtValue = a.textContent || a.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"block\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "01db6670e21c0bed8a5965e22c2f2adc", "score": "0.74655557", "text": "function filterResults(e){\n let text = e.target.value.toLowerCase();\n \n document.querySelectorAll(\".show-search-results__item\").forEach(li => {\n const item = li.textContent;\n if ( item.toLowerCase().indexOf(text) !== -1){\n li.style.display = \"inline-grid\";\n } else {\n li.style.display = \"none\";\n }\n })\n}", "title": "" }, { "docid": "75787187b2329f0ed0ab472dce154f56", "score": "0.73630184", "text": "function doSearchInList() {\n let input, filter, ul, li, span, txtValue;\n\n input = document.getElementById('searchBar');\n filter = input.value.toLowerCase();\n ul = document.getElementById(\"listContainer\");\n li = ul.getElementsByTagName('li');\n \n // Loop through all list items, and hide those who don't match the search query\n for (let i = 0; i < li.length; i++) {\n span = li[i].getElementsByTagName(\"span\")[0];\n txtValue = span.textContent || span.innerText;\n if (txtValue.toLowerCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "ee4fb30d2727870497d4fd4e897e90e5", "score": "0.7357143", "text": "function filterList() {\n var input = document.getElementById('filterInput');\n var filter = input.value.toUpperCase();\n var ul = document.getElementsByClassName('facet-values')[0];\n var li = ul.getElementsByTagName('li');\n\n // Loop through all list items, and hide those who don't match the search query\n for (var i = 0; i < li.length; i++) {\n var a = li[i].getElementsByTagName(\"a\")[0];\n var txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "17777c18e9d00de914066dbcf2a95ad6", "score": "0.7355941", "text": "function searchForListings(searchTerm) {\n \n}", "title": "" }, { "docid": "2b8b35da609b767d14e998b44d62ddd8", "score": "0.7336322", "text": "function search(input) {\n var filter, li, i, txtValue;\n filter = input.value.toUpperCase();\n // ul = document.getElementById(\"userListUp\");\n li = document.getElementsByClassName(\"searchable\");\n for (i = 0; i < li.length; i++) {\n txtValue = li[i].textContent || li[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "e4f3f507d36dbedb9f0e3f9617233f3b", "score": "0.7311612", "text": "function myFunction() {\n // Declare variables\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById('myInput');\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"myUL\");\n li = ul.getElementsByTagName('li');\n \n\n // Loop through all list items, and hide those who don't match the search query\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"div\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "57f688294c3a2d1ccbd2dacb9db35e18", "score": "0.7308178", "text": "function filterNames() {\n\t\tif (stateActiveWindow == 'comb') {\n\t\t\t$('.companyListing .setOne1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\t\t\t});\n\t\t} else if (stateActiveWindow == 'comp') { \n\t\t\t$('.companyListing[data-type=\"Comp\"] .setOne1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\n\t\t\t});\n\t\t} else {\n\t\t\t$('.indivListing .setTwo1').each(function() {\n\t\t\t\tvar alphaName = $(this).text().slice(0,searchLength).toLowerCase(); // query each listing to certain length\n\t\t\t\t\n\t\t\t\tif (alphaName != searchString) {\n\t\t\t\t\t$(this).parent().hide(); // hide if listing does not match search entered\n\t\t\t\t}\n\t\t\t\tif (alphaName == searchString) {\n\t\t\t\t\t$(this).parent().addClass('markedListing'); // mark matched listing\n\t\t\t\t\tnumberOfMatches += 1; // count total number of matched listings\n\t\t\t\t} \n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "2f3e3c68439306997c256f1d8a3639e2", "score": "0.72525334", "text": "function search(){\n const value = $('#searchInput').val();\n //($('.student-list li h3')[2].innerHTML);\n for(i=0;i<$('.student-list li').length;i++){\n //if statement checks for test\n if($('.student-list li h3')[i].innerHTML.toLowerCase().includes(value.toLowerCase())){\n $(`.student-item`).hide();\n $(`.pagination li:gt(0)`).hide();\n $(`.student-item`).eq(i).show();\n //if search is empty then show first 10 list items. \n //Show all pages as well\n if(value === \"\"){\n $(`.student-item:lt(10)`).show();\n $('.student-item:gt(9)').hide();\n $('.pagination li').show();\n }\n }\n }\n }", "title": "" }, { "docid": "d14871c6448c55cf7844b4f2fc893712", "score": "0.71851397", "text": "function searchParts(event) {\n //store the value of the text that is typed into the searchBar on each key up\n const text = event.target.value.toLowerCase()\n //select all the elements of class name .returnedParts created in the fetch above//\n document.querySelectorAll(\".returnedParts\").forEach(function(part) {\n //if the input form is empty, display nothing, if the input matches anything in .returnedParts display \"block\", else Display \"none\"\n const partName = part.innerText\n if(text === \"\") {\n part.style.display= \"none\"\n } else if(partName.toLowerCase().startsWith(text)) {\n part.style.display = \"block\"\n } else {\n part.style.display = \"none\"\n } \n })\n}", "title": "" }, { "docid": "1afb9c5847031ccea1abcec2a552265f", "score": "0.7173452", "text": "function filterIngredient() {\n let input, filter, li, textValue, i;\n input = document.getElementById(`${inputId}-selection`);\n filter = input.value.toUpperCase();\n li = document.getElementsByClassName(`${inputId}-list`);\n for (i = 0; i < li.length; i++) { \n textValue = li[i].innerText;\n if (textValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "7452f4bde70c94720e16e98b426e2d6e", "score": "0.7160592", "text": "function showFilteredList() {\n var input = document.querySelector(\"#searching-info\").value;\n var message = document.querySelector(\"#order-id\");\n var ordersToShow = this.filter(function(order) {\n return (\n (\n order.id +\n \"\" +\n order.summary.customer +\n \"\" +\n order.summary.shippedAt +\n \"\" +\n order.summary.createdAt +\n \"\" +\n order.summary.status\n )\n .toLowerCase()\n .indexOf(input.toLowerCase()) !== -1\n );\n });\n if (ordersToShow.length) {\n displayList(ordersToShow);\n } else {\n hideContent([\n \"tab-bar\",\n \"customer-information\",\n \"products-table-wrapper\",\n \"order-price\",\n \"total-price\",\n \"currency\",\n \"customer-details\",\n ]);\n var message = document.querySelector(\"#orders-list\");\n message.innerHTML = SORRY_MESSAGE;\n }\n displayOrsdersNum(ordersToShow);\n}", "title": "" }, { "docid": "59f92c132d92ffcbbbc3ac876087d2aa", "score": "0.71571296", "text": "function searchFunction() {\n // Declare variables\n var input, filter, ul, li, a, i;\n input = document.getElementById('search-name');\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"search-users\");\n li = ul.getElementsByTagName('li');\n\n // Loop through all list items, and hide those who don't match the search query\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"a\")[0];\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "357265480bc853573398ed744c7433b6", "score": "0.7128829", "text": "function myFunction() {\r\n // Declare variables\r\n var input, filter, ul, li, a, i;\r\n input = document.getElementById('myInput');\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"myUL\");\r\n li = ul.getElementsByTagName('li');\r\n\r\n // Loop through all list items, and hide those who don't match the search query\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6f747f5592b10684523c8e0064e95ddf", "score": "0.7126402", "text": "function search () {\n\n let counter = 0;\n for (let i = 0; i < originalListLength; i++) {\n if(originalList[i].textContent.indexOf(searchBar.value) !== -1) {\n originalList[i].style.display = '';\n counter += 1;\n } else {\n originalList[i].style.display = 'none';\n }\n noResults.textContent = 'There are ' + counter + ' students matching your search';\n}\nif( counter === 0){\n noResults.textContent = 'There are no students matching your search.';\n }\n}", "title": "" }, { "docid": "4a9d992ba85dfa5264242ba0d9336145", "score": "0.7106153", "text": "function myFunction() {\r\n // Declare variables\r\n var input, filter, ul, li, a, i;\r\n input = document.getElementById('myInput');\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"my_search\");\r\n li = ul.getElementsByTagName('li');\r\n\r\n // Loop through all list items, and hide those who don't match the search query\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "787971f4abe56e88c567b1b53039e71b", "score": "0.7097497", "text": "function searchBuildings() {\n\tvar query = searchField.value;\n\tvar queryResult = [];\n\n\tfor (i = 0; i < buildings.length; i++) {\n\t\tif (buildings[i].name.toLowerCase().includes(query.toLowerCase())) {\n\t\t\tqueryResult.push(buildings[i]);\n\t\t}\n\t}\n\n\t// Update the UI with the buidlings whos name\n\t// matches user query\n\tpopulateBuildings(queryResult);\n}", "title": "" }, { "docid": "9827d9a81f3cd059f4a9c45ea8a73646", "score": "0.7059694", "text": "function displaySearchResults() {\n // loop through STORE.data and toggle filtered unless a match is found\n STORE.data.forEach(item => {\n if (!item.name.includes(STORE.data.searchString)) {\n item.filtered = true; // if name doesn't include term filter it out\n } else {\n item.filtered = false; // if name does include term\n }\n });\n}", "title": "" }, { "docid": "76da31fdfaf500c5ed932fb61f1e17e2", "score": "0.702571", "text": "function searchStudent() {\n\n noResults.style.display = ('none');\n const filteredList = [];\n for (let x = 0; x < studentList.length; x++) {\n\n if (studentName[x].innerHTML.includes(input.value.toLowerCase())) {\n studentList[x].style.display = ('')\n filteredList.push(studentName[x].parentNode.parentNode);\n }\n else {\n studentList[x].style.display = ('none');\n }\n }\n\n//show \"no results\" message if there is no matched item\n if (filteredList.length == 0) {\n noResults.style.display = ('');\n }\n\n reset();\n showPage(filteredList, 1);\n appendPageLinks(filteredList);\n}", "title": "" }, { "docid": "4df1c0180e9ff2447c89febb9486f708", "score": "0.70159054", "text": "function List_Filter() {\n var search = document.getElementById(\"Enter_Search\").value;//Get value being searched\n\n //Get all p in #Challenge_List\n var range = document.querySelector(\"#Challenge_List\")\n var items = range.querySelectorAll(\"a\");\n\n if (search == \"\") {\n range.style.display = \"none\";//Nothing appears if nothing triggered\n }\n\n else {\n\n search = search.toUpperCase();//Make non case-sensitive\n let appear = 0;\n\n for (var counter = 0; counter < items.length; counter++) {\n var item = items[counter].innerText;//Get values in #Challenge_List, one at a time.\n\n check = item.toUpperCase();//Make non case-sensitive\n if (check.indexOf(search) == -1) {//Value is -1 when no index is available; which also means text is not found\n items[counter].style.display = \"none\";//Text is not displayed\n }\n else {\n items[counter].style.display = \"block\";//Text is displayed, row by row\n appear += 1;\n }\n\n if (appear > 0) {/*Suggestions appear if there's actually stuff to show; helps to ensure a blank rectange is not shown*/\n range.style.display = \"block\";\n }\n else {\n range.style.display = \"none\";\n }\n }\n }\n}", "title": "" }, { "docid": "63df71d2f88e53cb51a7d349cac2af1a", "score": "0.6994186", "text": "function myIngredientFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById('userIngredient');\n filter = input.value.toUpperCase();\n ul = document.getElementById('ingredients');\n li = ul.getElementsByTagName('li');\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName('a')[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none';\n }\n }\n }", "title": "" }, { "docid": "ba00a50514e68e81af7e9f901c244c39", "score": "0.69500566", "text": "function displayList() {\n var venue;\n var list = [];\n var keyword = self.keyword.toLowerCase();\n for (var i in self.topPicksList) {\n venue = self.topPicksList[i].venue;\n if (venue.name.toLowerCase().indexOf(keyword) != -1 ||\n venue.categories[0].name.toLowerCase().indexOf(keyword) != -1) {\n list.push(self.topPicksList[i]);\n }\n }\n self.filteredList = list;\n }", "title": "" }, { "docid": "973da9ffbdbfa39aecb684c5b0500ea8", "score": "0.69329655", "text": "function searchList() {\n var searchTerm = $('#search').val().toLowerCase().trim();\n\n var resultStudents = studentItems.filter(function(i) {\n \tvar studentEmails = $(this).find('.email').text();\n var studentNames = $(this).find('h3').text();\n if (studentNames.indexOf(searchTerm) > -1 || studentEmails.indexOf(searchTerm) > -1) {\n return true;\n }\n return false;\n });\n if (resultStudents.length === 0 ) {\n \t$('.page-header h2').text('Sorry, there are no matches.');\n } else {\n \t$('.page-header h2').text('STUDENTS');\n }\n var paginated_students = pages(resultStudents);\n $('.pagination').remove();\n if (resultStudents.length >= 10) {\n appendButtons(paginated_students);\n }\n showPages(0, paginated_students);\n}", "title": "" }, { "docid": "3307d209abda983cb52c4e50d60880a8", "score": "0.6929975", "text": "function search(el) {\n // e.target instead of input because in new function\n const filter = el.value.toUpperCase();\n for (let i = 0; i < studentList.length; i++) {\n const student = studentList[i].getElementsByTagName('h3')[0].innerText.toUpperCase();\n if (student.includes(filter)) {\n studentList[i].style.display = 'block'; \n } else {\n studentList[i].style.display = 'none'; \n }\n }\n}", "title": "" }, { "docid": "327522248c6eea1529903a9cb541c2bf", "score": "0.69253445", "text": "function searchInput() {\n\t\tvar i, item,\n\t\t\tsearchText = moduleSearch.value.toLowerCase(),\n\t\t\tlistItems = dropDownList.children;\n\n\t\tfor ( i = 0; i < listItems.length; i++ ) {\n\t\t\titem = listItems[ i ];\n\t\t\tif ( !searchText || item.textContent.toLowerCase().indexOf( searchText ) > -1 ) {\n\t\t\t\titem.style.display = \"\";\n\t\t\t} else {\n\t\t\t\titem.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c7233d20ec2f8f9166af101f7d2abbff", "score": "0.69110256", "text": "function filterList() {\n let filter = document.getElementById('location-filter').value.toUpperCase();\n let ul = document.getElementById('location-list');\n let list_items = document.getElementById(\n 'location-list').getElementsByTagName('div');\n let clearFilter = document.getElementById('clear-filter');\n // Loop through all list items, and hide those who don't match the search\n // query.\n for (let i = 0; i < list_items.length; ++i) {\n let label = list_items[i].getElementsByClassName('label')[0];\n if (!label) {\n continue;\n }\n let txtValue = label.textContent || label.innerText;\n // Show/hide the clear filter button.\n clearFilter.style.display = !!filter ? 'inline-block' : 'none';\n\n // Show/hide matching list items.\n const show = txtValue.toUpperCase().indexOf(filter) != -1;\n list_items[i].style.display = show ? 'block' : 'none';\n }\n}", "title": "" }, { "docid": "9708bf83795b61cbf03ff99878ffca03", "score": "0.69082505", "text": "function filterResults(){\n\n const searchInput = document.querySelector('.search-input');\n const value= searchInput.value;\n\n //for loop to iterate over all cards and search for the request\n for(let i=0; i<cards.length; i++){\n\n const fullname = cards[i].children[1].children[0].textContent;\n cards[i].style.display=(fullname.search(value)=== -1) ? \"none \" : \"value\";\n\n }\n}", "title": "" }, { "docid": "45259559b0bdd3911676184155cbe7df", "score": "0.6902983", "text": "function search(searchInput, emps) {\n for (let i = 0; i < emps.length; i++) {\n console.log(emps[i]);\n if ((searchInput.length !== 0) && (emps[i].textContent.toLowerCase().includes(searchInput.toLowerCase()))) {\n emps[i].parentNode.parentNode.style.display = '';\n } else if (searchInput.length == 0) {\n emps[i].parentNode.parentNode.style.display = '';\n } else {\n emps[i].parentNode.parentNode.style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "01859479beb527f5d0b006ae1b9c40cc", "score": "0.68910843", "text": "function studentSearch() {\r\n const searchString = search.value.toUpperCase();\r\n let filteredList = [];\r\n let altPageButtons; \r\n\r\n if(!searchString.length == 0){\r\n\r\n dataJS = filteredList;\r\n for (let i = 0; i < data.length; i ++) {\r\n \r\n if (data[i]['name']['first'].toUpperCase().includes(searchString) || data[i]['name']['last'].toUpperCase().includes(searchString) ) {\r\n filteredList.push(data[i]);\r\n //this variable stores the correct amount of student items to display and calculates the amount of buttons needed\r\n altPageButtons = Math.ceil(filteredList.length / 9);\r\n //\r\n showPage(1, filteredList);\r\n addPagination(1, altPageButtons, filteredList);\r\n \r\n } else if (filteredList.length === 0) {\r\n studentList.innerHTML = `No results found. Please Try again`;\r\n addPage.innerHTML = \"\";\r\n }\r\n }\r\n } else {\r\n location.reload();\r\n }\r\n}", "title": "" }, { "docid": "3f93a755eff3869ef2f9fb56fff74aa0", "score": "0.68889326", "text": "function searchEmployees() {\n let data, txtValue;\n const filter = searchInput.value.toLowerCase();\n const cards = document.querySelectorAll(\".card\");\n const name = document.querySelectorAll(\".card-name\");\n\n for (let i = 0; i < cards.length; i++) {\n data = cards[i];\n if (data) {\n txtValue = name[i].textContent.toLowerCase();\n if (txtValue.indexOf(filter) > -1) {\n data.style.display = \"\";\n } else {\n data.style.display = \"none\";\n }\n }\n }\n}", "title": "" }, { "docid": "3a3891c2905872b3ac9ff8706f8b3870", "score": "0.68750036", "text": "searchFilm() {\n const value = document.getElementById(\"search\").value;\n let res = [];\n let tmp;\n\n this.list.forEach((element) => {\n tmp = element.title.toUpperCase();\n if (tmp.search(value.toUpperCase()) >= 0) res.push(element);\n });\n\n this.showCards(res);\n this.updateFavorites();\n\n if (!value)\n document.getElementById(\"filmSelection\").innerHTML = \"Film selection\";\n else document.getElementById(\"filmSelection\").innerHTML = \"Results\";\n }", "title": "" }, { "docid": "d795895c9e42ec1a5affbbd3a7cae78f", "score": "0.68740064", "text": "function myLiquorFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById('userIngredient');\n filter = input.value.toUpperCase();\n ul = document.getElementById('liquor');\n li = ul.getElementsByTagName('li');\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName('a')[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none';\n }\n }\n }", "title": "" }, { "docid": "b9c0413228561b56516a40da965a83fd", "score": "0.6857947", "text": "myNameSearch() {\n var input, filter, li, i, h3, txtValue;\n input = document.getElementById(\"myNameInput\");\n filter = input.value.toUpperCase();\n\n li = document.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n h3 = li[i].getElementsByTagName(\"h3\")[0];\n txtValue = h3.textContent || h3.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "00e471fb7cfb48d28515968b2111f7f3", "score": "0.6840298", "text": "function displayResults() {\n var reg = new RegExp($(\"#search\").val(), \"ig\");\n for (var manga in userMangas) {\n if (\n reg.test(userMangas[manga].title) ||\n reg.test(userMangas[manga].altName) ||\n reg.test(userMangas[manga].categories) ||\n reg.test(userMangas[manga].author) ||\n reg.test(userMangas[manga].seriesStatus) ||\n reg.test(userMangas[manga].type)\n ) {\n $(\".panel-\" + window.s.slugify(userMangas[manga].title)).css(\n \"display\",\n \"block\"\n );\n }\n }\n}", "title": "" }, { "docid": "9323e160c206862f6363721c3f14549e", "score": "0.6836742", "text": "function renderResults(list, query) {\n // declare html, empty in the beginning\n var html = '';\n\n // declare variable for filtered results as the filtered list (filtered by the declared function)\n const filteredResults = list.filter(function(item) {\n // function filters after: Matching TextQuery, Matching Type Query, Matching Style Query\n // check if name of the listitem includes the entered text\n const isTextMatch = item.name.toLowerCase().includes(query.searchText.toLowerCase());\n // check if type of the listitem includes the entered type\n const isTypeMatch = item.type.includes(query.searchType);\n // check if style of the listitem includes the entered style\n const isStyleMatch = item.artStyle !== undefined ? item.artStyle.includes(query.searchStyle) : item ;\n // returns boolean value for each LI. \n return isTextMatch && isTypeMatch && isStyleMatch\n });\n\n if (filteredResults.length === 0) {\n // create error message\n function createError() {\n return '<li class=\"ListItem\">' \n + '<p>' + \"We are sorry, there are no search results matching your criteria... :(\"+ '</p>' \n + '</li>'\n }\n // set error message as output for respective list\n html = createError();\n document.getElementById(\"ExhibitionUL\").innerHTML = html;\n document.getElementById(\"VenueUL\").innerHTML = html; \n\n } else {\n // loop through list of filtered items and display them \n for (let i = 0; i < filteredResults.length; i++) {\n // update html variable for every result\n html += filteredResults[i].createHTML();\n // show list in exhibition tab if searched for exhibitions, Show list in venues tab if searched for venues\n if (filteredResults[i] instanceof Exhibition) {\n document.getElementById(\"ExhibitionUL\").innerHTML = html\n } else if (filteredResults[i] instanceof Venue) {\n document.getElementById(\"VenueUL\").innerHTML = html\n }\n }\n\n // adds functionality to button; taken from before pick()-function, adds eventlisteners to buttons again\n for (var i = 0; i < pickButtons.length; i++) {\n pickButtons[i].addEventListener(\"click\", pick);\n }\n\n // makes already selected buttons active; taken from init()-function, checks if button is already selected (i.e. element is already in myPicks)\n for (var i = 0; i < users.length; i++) {\n if (localStorage.getItem(\"currentUser\") !== null){\n if (users[i].email == currentUser[0].email) {\n for (var j = 0; j < pickButtons.length; j++) {\n for (var k = 0; k < users[i].myPicks.length; k++) {\n if (users[i].myPicks[k] == pickButtons[j].id) {\n pickButtons[j].className += \" active\";\n pickButtons[j].textContent = \"– My Picks\";\n }\n }\n }\n }\n }\n}\n // hides newly rendered buttons if no user is logged in; taken from currentUserFunctions\n if (localStorage.getItem(\"CurrentUser\") == null) {\n // if localStorage is empty the buttons under overview will be hidden from the user\n var hiddenButtons = document.getElementsByClassName(\"hiddenElement\")\n // loop to hide all buttons from user\n for (var i = 0; i < hiddenButtons.length; i++) {\n // hides the buttons from the user\n hiddenButtons[i].style.display = \"none\";\n }\n }\n }\n }", "title": "" }, { "docid": "0f0ce69c4142e1cda650ca5e355e9343", "score": "0.68305767", "text": "function filterInstitutions() {\n // Declare variables\n var input, inputValue, filterOn, institutionsList, institution;\n input = document.getElementById('discipline-search');\n inputValue = input.value;\n filterOn = inputValue.toUpperCase();\n institutionsList = document.getElementById('discipline-list');\n institution = institutionsList.getElementsByTagName('li');\n\n // Unmark previously marked items\n $(institutionsList).unmark(inputValue);\n\n // Loop through all list items, and hide those who don't match the search query\n for (i = 0; i < institution.length; i++) {\n a = institution[i];\n if (a.innerHTML.toUpperCase().indexOf(filterOn) > -1) {\n institution[i].style.display = '';\n } else {\n institution[i].style.display = \"none\";\n }\n }\n\n // Mark filtered items\n $(institutionsList).mark(inputValue);\n}", "title": "" }, { "docid": "357f9f642f57f69f95a6e9acb87d0ca8", "score": "0.68200284", "text": "function filter() {\n var input, filter, ul, li, p, i;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"list-of-users\");\n li = ul.getElementsByTagName(\"li\");\n for (i = 3; i < li.length; i++) {\n p = li[i].getElementsByTagName(\"p\")[0];\n if (p.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "508d96312cd88535c90102d42d599caa", "score": "0.6818238", "text": "search(e) {\n if(!!e.target) {\n const value = e.target.value.toLowerCase()\n this.posts.forEach(post => {\n const condition = post.toString().includes(value)\n ListItem.showElement(post.id, condition)\n })\n }\n ListItem.showEmptyResearch()\n }", "title": "" }, { "docid": "d4847d7e60af7350d88ef100b88a74ad", "score": "0.6810783", "text": "function filterItems(e) {\n const searchedItem = e.target.value.toLowerCase();\n document.querySelectorAll('.collection-item').forEach(function(item) {\n if (item.textContent.indexOf(searchedItem) != -1) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "3f5676406ef94ac7e7fb0459a2c132ba", "score": "0.67967355", "text": "function filterNames() {\n // Declare variables\n let input = document.getElementById('myInput');\n let allUpper = input.value.toUpperCase();// Al in uppercase to evaluate\n let ul = document.getElementById(\"myUL\");\n let li = ul.getElementsByTagName('li');\n \n // Loop through all list items, and hide those who don't match the search query \n for (let word of li) {\n let list = word.getElementsByTagName('a')[0]; // Catch the list of links\n let name = list.textContent || list.innerText; // Catch the names in the links\n if (name.toUpperCase().indexOf(allUpper) > -1) { \n word.style.display = \"\";\n } else {\n word.style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "4572f1eed43592a3d1f79cbc991fd63c", "score": "0.6793849", "text": "function addSearchFunctionality(list) {\r\n let search_bar_input = document.getElementById('search');\r\n search_bar_input.addEventListener('keyup', (event) => {\r\n let substring = event.target.value\r\n let search_results_list = [];\r\n \r\n for (let i = 0; i < list.length; i++) {\r\n substring = event.target.value.toLowerCase()\r\n let first_name = list[i]['name']['first'].toLowerCase();\r\n let last_name = list[i]['name']['last'].toLowerCase();\r\n if ( (first_name.includes(substring) || last_name.includes(substring)) ) {\r\n search_results_list.push(list[i]);\r\n }\r\n }\r\n \r\n showPage(search_results_list, 1);\r\n addPagination(search_results_list);\r\n })\r\n}", "title": "" }, { "docid": "a5b4b58bb767abfc316e1208347a3c15", "score": "0.67885107", "text": "function filterList(e) {\n const searchVal = e.target.value.toLowerCase();\n let filteredArr = parsedData.filter(listItem =>\n listItem.name.toLowerCase().includes(searchVal)\n );\n ui.showData(filteredArr);\n }", "title": "" }, { "docid": "65b1910692a98a554c6a04dbdf0be9f5", "score": "0.6786917", "text": "function searchEmployees(input) {\n personGallery.innerHTML = '';\n let filteredResults = [];\n dataArray.forEach(person => {\n let fullName = `${person.name.first} ${person.name.last}`\n if (fullName.toLowerCase().includes(input.toLowerCase())) {\n filteredResults.push(person);\n generateGallery(filteredResults);\n cardHandler(filteredResults);\n }\n });\n if (filteredResults.length === 0) {\n personGallery[0].innerHTML = '<h1>Sorry, no results found.</h1>';\n }\n}", "title": "" }, { "docid": "0002a4fb47c3f8b66568425094fdb9b4", "score": "0.67785585", "text": "function search() {\n\t\tconst search = document.querySelector('input').value;\n\t\tlet students = [];\n\t\tfor(let i=0; i<list.length; i++) {\n\t\t\tlet student = `${list[i].name.first} ${list[i].name.last}`;\n\t\t\tif(student.toLowerCase().includes(search.toLowerCase())) {\n\t\t\t\tstudents.push(list[i]);\n\t\t\t}\n\t\t}\n\t\tif(students.length === 0) {\n\t\t\tdocument.querySelector('.student-list').innerHTML = 'No results found';\n\t\t\taddPagination(students);\n\t\t} else {\n\t\t\tshowPage(students, 1);\n\t\t\taddPagination(students);\n\t\t}\n\t}", "title": "" }, { "docid": "9d18e7206ff41905c4202e3403ca7feb", "score": "0.67720896", "text": "function filterPatientList()\r\n{\r\n var searchString = removeLeadingZeros(removeSpecialCharacters(removeWhiteSpace($(\"#searchAllPatients\").val())));\r\n var regExp = new RegExp(searchString, \"i\");\r\n \r\n $(\"#patientList li\").each(function () {\r\n \tif ($(this).data(\"fullname\").search(regExp) < 0 && $(this).data(\"mrn\").search(regExp) < 0) {\r\n $(this).hide();\r\n } else {\r\n $(this).show()\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a7b255789b6082221bbcee4e71011344", "score": "0.67660624", "text": "function searchBar(list) {\n const searchValue = searchInput.value.toLowerCase();\n const searchResult = [];\n if (searchValue.length > 0) {\n p.style.display = 'none';\n for (let i = 0; i < list.length; i++) {\n if (searchValue.length !== 0 && list[i].textContent\n .toLowerCase().includes(searchValue.toLowerCase())) {\n list[i].style.display = '';\n searchResult.push(list[i]);\n showPage(searchResult, 1);\n removePagination();\n appendPageLinks(searchResult);\n } else {\n list[i].style.display = 'none';\n }\n }\n if (searchResult.length === 0) {\n p.style.display = '';\n appendPageLinks(searchResult);\n }\n } else {\n for (let i = 0; i < list.length; i++) {\n list[i].style.display = '';\n removePagination();\n appendPageLinks(list);\n showPage(list, 1);\n }\n }\n}", "title": "" }, { "docid": "2810efb60c7656c894b0570e4bb4e0d8", "score": "0.676085", "text": "function searchFunction() {\n let input, filter, li, text, txtValue;\n input = document.getElementById(\"searchInput\");\n filter = input.value.toUpperCase();\n li = toDoList.getElementsByTagName(\"li\");\n for (let i = 0; i < li.length; i++) {\n text = li[i].getElementsByClassName(\"todoText\")[0];\n txtValue = text.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "920fad0c527593876259f8337fe7a025", "score": "0.6753515", "text": "function searchNewsSources(e) {\n var searchValue = searchInput.value.toUpperCase();\n for (var i = 0 ; i < newsContainer.length; i++) {\n var c = newsContainer[i].lastChild.lastChild.innerHTML;\n if (c.toUpperCase().indexOf(searchValue) > -1 ) {\n newsContainer[i].style.display = '';\n } else {\n newsContainer[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "ce80d4307998feb2b98ec90de10eeb6c", "score": "0.6751647", "text": "function search() {\n\n let searchResult = document.getElementById(\"searchbox\").value;\n\n // Use the HTML DOM to search through the h3s and h4s for matches\n let commonName = document.getElementsByTagName(\"h3\");\n let scientificName = document.getElementsByTagName(\"h4\");\n let animalsList = document.getElementsByTagName(\"li\");\n let matchFound = false;\n\n for (let i = 0; i < commonName.length; i++) \n {\n if (commonName[i].innerText.toUpperCase() == searchResult.toUpperCase() || scientificName[i].innerText.toUpperCase() == searchResult.toUpperCase())\n {\n matchFound = true;\n // Clear all list items\n for (var j = 0; j < commonName.length + 1; j++)\n {\n animalsList[j].style.display = \"none\";\n }\n\n // Set searched animal to block\n for (var x = 0; x < commonName.length; x++) \n {\n if (commonName[x].innerText.toUpperCase() == searchResult.toUpperCase() || scientificName[x].innerText.toUpperCase() == searchResult.toUpperCase())\n {\n animalsList[x + 1].style.display = \"block\";\n }\n }\n }\n\n // If there is no match display no matches found message\n if (commonName[i].innerText.toUpperCase() != searchResult.toUpperCase() && scientificName[i].innerText.toUpperCase() != searchResult.toUpperCase() && !matchFound)\n {\n for (var j = 0; j < commonName.length + 1; j++) \n {\n animalsList[j].style.display = \"none\";\n }\n\n animalsList[0].style.display = \"block\";\n }\n }\n}", "title": "" }, { "docid": "b25805ff50f0731657396b459e7fc4d5", "score": "0.67453843", "text": "function filterData(j, filter) {\n // check if search keyword(filter) not provided in call\n if (!filter) {\n const input = document.querySelector('.searchbox');\n // then get search key from search input\n const filter = input.value;\n }\n const list = document.querySelector('.list');\n const items = list.children;\n // iterate throught each list item to locate search field\n for (let i = 0; i < items.length; i++) {\n // get search field\n const field = items[i].getElementsByTagName('span')[j];\n // leave item display as is if current input value in search field\n if (field.innerHTML.indexOf(filter) > -1) {\n items[i].style.display = '';\n } else {\n // do not show item if input value not in search field\n items[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "1defbfcb8eb312ebb6ce3844cfb8ebdc", "score": "0.67434925", "text": "function handleSearchInput(e) {\n let movielist = getListFromLS()\n let filtered_list = movielist.filter(movie => movie.title.toLowerCase().includes(this.value.toLowerCase()))\n\n clearMovieCards() //First Clear all cards\n\n // IF the filtered list is empty(=no searchresults found) display a span in moviewrapper\n if (filtered_list.length === 0) {\n let span = document.createElement('span')\n span.style.zIndex = 1;\n span.innerHTML = \"Sorry, nothing found...\"\n moviewrapper.appendChild(span)\n } else { //otherwise display the filtered results\n displayMovieCards(filtered_list)\n }\n}", "title": "" }, { "docid": "1384715123493540793877b9e6164247", "score": "0.6737269", "text": "function searchNewFriends() {\n var searchValue = newlistSearch.value;\n for (var prop in friendsSelect.children) {\n if (friendsSelect.children[prop].children[1].innerHTML.toLowerCase().indexOf(searchValue.toLowerCase()) == -1) {\n friendsSelect.children[prop].style.display = \"none\";\n } else {\n friendsSelect.children[prop].style.display = \"block\";\n }\n }\n }", "title": "" }, { "docid": "5a08fbb960d0c252bbcdc3ad55213311", "score": "0.6737203", "text": "function myFunction() {\r\n var input, filter, ul, li, a, i;\r\n input = document.getElementById(\"CourseClassList__mySearch\");\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"CourseClassList__myMenu\");\r\n li = ul.getElementsByTagName(\"li\");\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "2cadecacd7bf076badaf9d036901df29", "score": "0.6734322", "text": "function searchEventListener(event) {\n\n // convert the user-entered query to uppercase\n const userInput = event.target.value.toUpperCase();\n\n // start with a set of 0 results\n const studentList = [];\n\n // loop through the base set and look for matches\n for(let i = 0; i < list.length; i++) {\n const student = list[i];\n\n // create a string with first and last name & convert to uppercase\n const studentName = `${student.name.first} ${student.name.last}`.toUpperCase(); \n\n // add the student to the subset if we found a match\n if(studentName.includes(userInput)) {\n studentList.push(student);\n }\n }\n // show the first page of the subset of students\n activePage = 1;\n showPage(studentList, activePage);\n\n // only add pagination if needed\n if(studentList.length > studentsPerPage) {\n addPagination(studentList);\n } \n else {\n // hide pagination\n document.querySelector('ul.link-list').innerHTML = '';\n }\n }", "title": "" }, { "docid": "26d7bdb3eac734b75861268014dc0ff4", "score": "0.67307884", "text": "function filterBar() {\n let searchQuery = new RegExp(document.getElementById('search').value, 'i')\n let filteredData = data.filter(element => {\n if(searchQuery.test(element.name.first) || searchQuery.test(element.name.last)) {\n return element\n }\n })\n //If there is 1 or more results, page will display it/them\n if(filteredData.length > 0){\n showPage(filteredData)\n addPagination(filteredData)\n } else {\n //Page will clear itself of links if there are no results\n document.querySelector('ul.student-list').innerHTML = \"No results found\"\n document.querySelector('ul.link-list').innerHTML = \"\"\n }\n}", "title": "" }, { "docid": "266b5e0681b98d45b28be5578d79cd64", "score": "0.67275023", "text": "function searchFriend() {\n var searchValue = search.value;\n for (var prop in friendsList.children) {\n if (friendsList.children[prop].children[1].innerHTML.toLowerCase().indexOf(searchValue.toLowerCase()) == -1) {\n friendsList.children[prop].style.display = \"none\";\n } else {\n friendsList.children[prop].style.display = \"block\";\n }\n }\n }", "title": "" }, { "docid": "3713fec424f1759f39223c1b25701a7b", "score": "0.6717509", "text": "function myFunction() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n ul = document.getElementById(\"myUL\");\n li = ul.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"a\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "1e577898a5c1057dfa6c2c79f7739c06", "score": "0.6713986", "text": "function filterBySearchTerm(searchTerm, eventList,check) {\r\n if(check == 1){\r\n let userData = searchTerm; //user enetered data\r\n let suggestions=[];\r\n Array.from(eventList).forEach( eventItem => {\r\n let eventTitle = eventItem.querySelector('.event_title').innerText.toLowerCase();\r\n console.log(eventTitle);\r\n suggestions.push(eventTitle);\r\n });\r\n\r\n let emptyArray = [];\r\n if(userData){\r\n icon.onclick = ()=>{\r\n\r\n }\r\n emptyArray = suggestions.filter((data)=>{\r\n //filtering array value and user characters to lowercase and return only those words which are start with user enetered chars\r\n return data.toLocaleLowerCase().startsWith(userData.toLocaleLowerCase()); \r\n });\r\n emptyArray = emptyArray.map((data)=>{\r\n // passing return data inside li tag\r\n return data = '<li>'+ data +'</li>';\r\n });\r\n searchWrapper.classList.add(\"active\"); //show autocomplete box\r\n showSuggestions(emptyArray);\r\n let allList = suggBox.querySelectorAll(\"li\");\r\n for (let i = 0; i < allList.length; i++) {\r\n //adding onclick attribute in all li tag\r\n allList[i].setAttribute(\"onclick\", \"select(this)\");\r\n }\r\n }else{\r\n searchWrapper.classList.remove(\"active\"); //hide autocomplete box\r\n }\r\n }\r\n \r\n Array.from(eventList).forEach( eventItem => {\r\n\r\n let eventTitle = eventItem.querySelector('.event_title').innerText.toLowerCase()\r\n\r\n if (eventTitle.indexOf(searchTerm) == -1){\r\n eventItem.style.display = 'none';\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3e368e1dca522a9aa52c8df312e5d296", "score": "0.67096543", "text": "function searchList(studentList) {\r\n $('div.page-header').append('<div class=\"student-search\"><input id=search placeholder=\"Search for students...\"><button id=searchButton>Search</button>');\r\n $('#searchButton').on(\"click\", function() {\r\n //removal of DOM message to avoid duplication during multiple failed search attempts\r\n $('#noStudent').remove();\r\n //remove class to avoid previously matched students from appearing\r\n $('li').removeClass('match');\r\n let searchFilter = $(this).prev().val().toUpperCase();\r\n //conditional that takes input value and checks against h3(student name) or email class(student email)\r\n //then hides or shows names based on checks\r\n if (searchFilter != '') {\r\n //show or hide elements that are matched to searchFilter input\r\n $(studentList).find(\"h3:Contains(\" + searchFilter + \")\").parent().parent().show();\r\n $(studentList).find(\".email:Contains(\" + searchFilter + \")\").parent().parent().show();\r\n $(studentList).find(\"h3:not(:Contains(\" + searchFilter + \"))\").parent().parent().hide();\r\n $(studentList).find(\".email:not(:Contains(\" + searchFilter +\"))\").parent().parent().hide();\r\n //add class for matched students that are now visible\r\n $('.student-item:visible').addClass('match');\r\n //place matched students in variable\r\n $match = $('.match');\r\n //remove previous pagination div to avoid link duplication\r\n $('.pagination').remove();\r\n //call appendPageLinks on new student list: $match\r\n if ($match.length > 10){\r\n appendPageLinks($match);\r\n //call showPage to display 1st calculated page of list: $match\r\n showPage(1, $match);\r\n $('a').get(0).className = 'active';\r\n };\r\n //conditional for message to append to DOM if no students found\r\n if ($('.student-item').is(':visible') == false) {\r\n //remove class to avoid previously matched students from appearing\r\n $('li').removeClass('match');\r\n //conditional for alert to run if input box is blank\r\n $('.student-list').prepend('<div id=noStudent><h2>No Students Found with Name or Email: ' + $(this).prev().val() + ' </h2></div>');\r\n }\r\n } else if (searchFilter == '') {\r\n //remove class to avoid previously matched students from appearing\r\n $('li').removeClass('match');\r\n //Remove pagination div to avoid pageLink duplication between $match and original studentList\r\n $('.pagination').remove();\r\n //Remove previous div containing input/button to avoid duplication\r\n $('.student-search').remove();\r\n //call defaultLoad function\r\n defaultLoad();\r\n //empty search field alert message\r\n alert('Please enter a name or email address of the student you would like to find.');\r\n }\r\n });\r\n}", "title": "" }, { "docid": "297cef3f1172faef73ba6d8a4b6aa7fa", "score": "0.6698014", "text": "function search(e) {\n // @const inputValue : user input on search field\n var inputValue = e.target.value;\n // @const filteredArr : all the playlists that are goin to match to user input on search field\n var filteredArr = allPlaylists.filter(function (album) { return album.name.indexOf(inputValue) != -1; });\n // @const allPlContainter - playlists container in html\n var allPlContainter = $(\"#albums_list\");\n //search algoritm logic\n if (inputValue.length > 1) {\n if (filteredArr.length != 0) {\n tooltip.dispose();\n allPlContainter.children().remove();\n filteredArr.sort(function (a, b) {\n return a.name.indexOf(inputValue) - b.name.indexOf(inputValue);\n });\n filteredArr.forEach(function (album) {\n album.drawPlaylist();\n });\n }\n else {\n allPlContainter.children().remove();\n tooltip.editTitle(\"<u><b>Not Found 404!</b></u>\");\n }\n }\n else if (allPlContainter.children().length < allPlaylists.length &&\n inputValue.length < 1) {\n tooltip.editTitle(\"Please enter at least<br><u><b>2</b> Characters</u>\");\n allPlContainter.children().remove();\n allPlaylists.forEach(function (album) {\n album.drawPlaylist();\n });\n }\n else {\n tooltip.editTitle(\"Please enter at least<br><u><b>2</b> Characters</u>\");\n }\n}", "title": "" }, { "docid": "c5e13dc41d9871ab0a2de3a122388dde", "score": "0.66799366", "text": "function filterItemInList(object) {\n\tq = object.val().toLowerCase();\n\tobject.parent().next().find('li').show();\n\tif (q.length > 0) {\n\t\tobject.parent().next().find('li').each(function() {\n\t\t\tif ($(this).find('label').attr(\"data-filter\").indexOf(q) == -1)\n\t\t\t\t$(this).hide();\n\t\t})\n\t}\n}", "title": "" }, { "docid": "20b6b72cd6cffd43eea17c36810dd2c5", "score": "0.66774327", "text": "function filternames() {\n\n let search = document.getElementById('search').value;\n search = search.toLowerCase();\n showsearch()\n\n let list = document.getElementById('searchlist');\n list.innerHTML = '';\n\n for (let i = 0; i < friendsnames.length; i++) {\n let name = friendsnames[i];\n let element = posts[i];\n if (name.toLowerCase().includes(search)) {\n list.innerHTML += `<div class=\"searchitem\" id=\"searchitem${element['id']}\" onclick=\"\">${name}</div>`;\n }\n }\n\n}", "title": "" }, { "docid": "d457f2a56d26d6376866975a2997a8cf", "score": "0.66702646", "text": "function get_patient_search_results_list(e) {\n\t\t\tvar dynamicData = {};\n\t\t\tdynamicData['q'] = patient_search_box.val().trim();\n\t\t\t$.ajax({\n\t\t\t\turl : \"/fishfood/patients/search/\",\n\t\t\t\ttype : \"get\",\n\t\t\t\tdata : dynamicData,\n\t\t\t\tsuccess : function(data) {\n\t\t\t\t\tpatient_search_results.html(data);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "0678a188a0cca89213d69dcd02975879", "score": "0.66651034", "text": "function searchCoffee() {\n var i, filter, roastSelect;\n var filteredRoast = [];\n var filteredCoffees = [];\n filter = document.getElementById('mySearch').value.toLowerCase();\n roastSelect = document.getElementById('roast-selection').value;\n\n for (i = 0; i < coffees.length; i++) {\n var coffee = coffees[i];\n // console.log(i);\n // console.log(input);\n console.log(filter);\n // if (coffee.name.toLowerCase().indexOf(filter)> -1){\n if (coffee.roast === roastSelect ){\n console.log(coffee.name);\n filteredRoast.push(coffee);\n }\n\n }\n\n // input = document.getElementById('mySearch');\n\n for (i = 0; i < filteredRoast.length; i++) {\n var coffee = coffees[i];\n // console.log(i);\n // console.log(input);\n console.log(filter);\n // if (coffee.name.toLowerCase().indexOf(filter)> -1){\n if (coffee.name.toLowerCase().search(filter) != -1){\n console.log(coffee.name);\n filteredCoffees.push(coffee);\n }\n\n } tbody.innerHTML = renderCoffees(filteredCoffees);\n}", "title": "" }, { "docid": "f362d134d7ce63709bd895293faace24", "score": "0.6663218", "text": "function searchFunction() {\n\n // Declare variables\n let input = document.getElementById('search').value.toLowerCase();\n let anchor = document.getElementsByTagName('a');\n \n // Loop through all list items, and hide those who don't match the search query\n // indexOf() returns -1 if nothing found\n\n for (let i = 0; i < anchor.length; i++) {\n let description = anchor[i].getAttribute('data-caption').toLowerCase();\n let compare = description.indexOf(input);\n\n // personal reminder - check if target works\n // console.log(description);\n // console.log(compare);\n\n if (compare > -1) {\n anchor[i].style.display = \"\";\n } else {\n anchor[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "e19a5e89b07ac185176f19ab51f50d21", "score": "0.6659912", "text": "function searchItem(e){\n //convert the input on the search bar to lowercase\n const filterItem = e.target.value.toLowerCase();\n //grab the li from the item list global var by tagname into anew instanse\n const items = itemList.getElementsByTagName('li');\n //convert to an array from the new items\n Array.from(items).forEach(function(item) {\n //create new variable of the text content of the firstchild of the item\n const newItem = item.firstChild.textContent;\n // checkif the new item name when converted to lowecase and the indexof the filter item is not equal to -1\n if(newItem.toLowerCase().indexOf(filterItem) != -1){\n item.style.display = 'block';\n } else\n item.style.display = 'none';\n });\n}", "title": "" }, { "docid": "7b66c89b16bba903e02b9f7d8ca3ee43", "score": "0.66589487", "text": "function filterParkListDiv(parks) {\n document.getElementById(\"searchButton\").addEventListener(\"click\", () => {\n // when clicked shows filtered search below:\n let searchTerm = document.getElementById(\"searchInput\").value;\n let filteredList = [];\n\n parks.forEach(function (park) {\n if (\n searchTerm.toLowerCase() === park.name.toLowerCase() ||\n searchTerm.toLowerCase() === park.states.toLowerCase()\n ) {\n filteredList.push(park);\n document.getElementById(\"dropdownList\").style.visibility = \"visible\";\n } else if (!searchTerm) {\n document.getElementById(\"carouselID\").style.display = \"block\";\n document.getElementById(\"errorDiv\").style.visibility = \"hidden\";\n document.getElementById(\"dropdownList\").style.visibility = \"hidden\";\n }\n });\n buildParkListDiv(filteredList);\n });\n}", "title": "" }, { "docid": "54dfe192d8e82dbf8f7b72331d33fb51", "score": "0.66452414", "text": "function filteredDisplay(){\n console.log(this.value);\n // find current unordered list \n if (this.value){\n currentList = document.getElementById('foo');\n\n while (currentList.hasChildNodes()) { \n currentList.removeChild(currentList.firstChild);\n }\n const matchResult = findMatches(this.value, json);\n // Add the contents to #foo:\n document.getElementById('foo').appendChild(makeUL(matchResult));\n }\n\n}", "title": "" }, { "docid": "b983b9c3e4291126e3e6ac65827bfec9", "score": "0.6638812", "text": "myTagSearch() \n {\n var input, filter, li, i, h3, txtValue;\n input = document.getElementById(\"myNameInput\");\n filter = input.value.toUpperCase();\n\n li = document.getElementsByTagName(\"li\");\n for (i = 0; i < li.length; i++) {\n h3 = li[i].getElementsByTagName(\"label\")[0];\n txtValue = h3.textContent || h3.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n }", "title": "" }, { "docid": "70756efc337b16fdee2bcac355d36c18", "score": "0.6638569", "text": "function vacancySearch() {\n $(\"#vacancy-search\").on(\"keyup\", function() {\n var value = $(this).val().toLowerCase();\n $(\".js-filtering-grid .filtering-row\").filter(function() {\n $(this).toggle($(this).find(\"div:first-child\").text().toLowerCase().indexOf(value) > -1);\n });\n });\n }", "title": "" }, { "docid": "0b322566d3ebbe79cbc86bfe2ff13dbe", "score": "0.66385376", "text": "function filterListings(event) {\n // prevent link from firing\n event.preventDefault();\n\n businessListData.forEach(function (businessListing) {\n var enteredLocation = $('#filterListings input#filterLocation').val().toLowerCase().trim();\n var enteredType = $('#filterListings select#filterBusinessType').val().toLowerCase().trim();\n var enteredOwnerName = $('#filterListings input#filterOwnerName').val().toLowerCase().trim();\n var enteredGradYear = $('#filterListings input#filterGradYear').val().toString().toLowerCase().trim();\n var enteredBusinessName = $('#filterListings input#filterBusinessName').val().toLowerCase().trim();\n var enteredBusinessDescription = $('#filterListings input#filterBusinessDescription').val().toLowerCase().trim();\n var matchedType = (enteredType === \"unselected\") || (enteredType === businessListing.businessType.toLowerCase().trim());\n var matchedOwnerName = (enteredOwnerName === \"\") || (businessListing.ownerName.toLowerCase().indexOf(enteredOwnerName) >= 0);\n var matchedLocation = (enteredLocation === \"\") || (businessListing.location.toLowerCase().indexOf(enteredLocation) >= 0);\n var matchedGradYear = (enteredGradYear === \"\") || (businessListing.gradYear.toString().toLowerCase().indexOf(enteredGradYear) >= 0);\n var matchedBusinessName = (enteredBusinessName === \"\") || (businessListing.businessName.toLowerCase().indexOf(enteredBusinessName) >= 0);\n var matchedBusinessName = (enteredBusinessDescription === \"\") || (businessListing.description.toLowerCase().indexOf(enteredBusinessDescription) >= 0);\n\n if (matchedType == 1 && matchedLocation == 1 && matchedGradYear == 1 && matchedBusinessName == 1 && matchedOwnerName == 1)\n businessListing.matched = 1;\n else\n businessListing.matched = 0;\n });\n\n renderBusinessList(true);\n}", "title": "" }, { "docid": "b70d0298c602c113c36e5008454cd1b8", "score": "0.6633226", "text": "function _foodListUserInputSearch(evt) {\n var query = searchValue.value;\n var filteredFood = filter(query, state.food);\n\n foodList.innerHTML = '';\n _foodListDOMBuilder(filteredFood)\n}", "title": "" }, { "docid": "399049cb4a89bc169478fe53a3dabc5b", "score": "0.6631883", "text": "function search() {\n // Reset search results\n data.results = [];\n \n // Get results from search\n data.results = Calendar.search(data.searchTerm, Lists.data.lists);\n \n // Set hasSearched to true so if there are no results an error message will be shown\n data.hasSearched = true;\n }", "title": "" }, { "docid": "f57a50db3c7e444cf4780b4147e40b43", "score": "0.6631258", "text": "function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}", "title": "" }, { "docid": "9ce5e01258b7270a22df6c73c0286e04", "score": "0.66309905", "text": "function filter(e){\n //prevent page from reloading\n e.preventDefault();\n\n //grab search term\n searchTerm = document.getElementById('searchTerm').value.toLowerCase();\n updateDisplay(finalGroup);\n }", "title": "" }, { "docid": "679453f2b04f9f57d5ee47fb7bc0ea4a", "score": "0.6628141", "text": "function search(e) {\n const searched = e.target.value.toLowerCase()\n const filtered_packs = packs.filter(\n p => p.title.toLowerCase().includes(searched) || // by title\n (p.tags.map(t => t.includes(searched)).includes(true)) // by tags\n )\n document.getElementById(\"stickers_list\").innerHTML = \"\";\n filtered_packs.forEach(filetered_pack => displayPackThumbnail(filetered_pack))\n}", "title": "" }, { "docid": "b34f1bd7a8a7cb405ae6c3fdf1b0613a", "score": "0.6626429", "text": "function displayMatchedPeople() {\n // Clean previous matches\n $(\"#results\").empty();\n\n // Obtain the search query\n let query = $(\"#search\").val();\n\n // Obtain the matched names\n let matchedNames = [];\n if(query.length > 0){\n matchedNames = searchPeople(PEOPLE, query);\n }\n\n // Display results\n\tfor(let name of matchedNames) {\n \tlet nameItem = $('<li>' + name + '</li>');\n $(\"#results\").append(nameItem); \n }\n}", "title": "" }, { "docid": "3adf2863ae616d4d9c1ce5d601141ff2", "score": "0.66263545", "text": "function searchList() {\n var matched = []\n // Obtain the value of the search input\n input = $(\"#search\").val();\n // remove the previous page link section\n $('.pagination').hide();\n // Loop over the student list, and for each student…\n $.each($listStudents,(function(){\n // ...obtain the student’s name…\n var name = $(this).find(\"h3\").text();\n // ...and the student’s email…\n var email = $(this).find(\".email\").text();\n // ...if the search value is found inside either email or name…\n if (name.includes(input) || email.includes(input)) {\n // ...add this student to list of “matched” student\n matched.push($(this));\n// $(\".student-list\").hide();\n console.log(email);\n console.log(name);\n }\n }));\n // If there’s no “matched” students…\n if (matched.length === 0){\n // ...display a “no student’s found” message\n $(\".student-list li\").hide();\n $('.sorry').remove(); // Removes previous failed search, if present\n $('.page').append('<div class=\"sorry\"><p>Sorry, no results found!</p></div>');\n\n } else if (matched.length <= 10) {\n // ...call appendPageLinks with the matched students\n// $(\".student-list li\").hide();\n showPage(1, matched);\n } else {\n// $(\".student-list li\").hide();\n showPage(1, matched);\n appendPageLinks(matched.length, matched);\n }\n $('#search').val(\"\");// Clears search field\n}", "title": "" }, { "docid": "2db1dd4521ea8e93694b9a152e4d6090", "score": "0.6623941", "text": "function search(){\n //get the text value from search input box\n let inputBox = document.querySelector('.student-search input');\n let searchPhrase = inputBox.value;\n\n //use inputBox.value to search in name or email and display the matches\n for(let i=0;i<studentRecords.length;i++){\n let email = studentRecords[i].querySelector('.email').innerText;\n let name = studentRecords[i].querySelector('h3').innerText;\n if(email.includes(searchPhrase) || name.includes(searchPhrase)){\n studentRecords[i].classList.add('matched');\n studentRecords[i].style.display='block';\n }else{\n studentRecords[i].classList.remove('matched');\n\n studentRecords[i].style.display='none';\n }\n }\n appendPageLinks();\n}", "title": "" }, { "docid": "c37987d6d84d43b42d998af66ac266e5", "score": "0.6622809", "text": "function searchList(searchInput){\n var regex = new RegExp(searchInput.value, \"i\");\n var rows = document.getElementsByClassName('listRecord');\n for (var i = 0; i < rows.length; i++){\n var displayRow = false;\n for (var j = 0; j < rows[i].childNodes.length; j++){\n if(rows[i].childNodes[j].innerHTML != undefined){\n if (regex.test(rows[i].childNodes[j].innerHTML)){\n displayRow = true;\n //a match was found\n break;\n }\n }\n }\n if (displayRow){\n rows[i].style.display= \"table-row\";\n } else {\n rows[i].style.display= \"none\";\n }\n }\n}", "title": "" }, { "docid": "0c87a9f444426066002789920cbe6e10", "score": "0.6617118", "text": "function showResults() {\n isEmptySearch = true;\n $(\"#emptySearchMsg\").hide();\n $(\".viz\").hide();\n for (var i = 0; i < allViz.length; i++) {\n //for each visualisation\n var thisVizTags = allViz[i]; //array of the tags this visualisation has\n var foundAll = true;\n for (var j = 0; j < searchTerm.length; j++) {\n //for each search term\n foundAll = foundAll && findOneTag(searchTerm[j], thisVizTags);\n }\n if (foundAll) {\n $(\"#\" + thisVizTags[0]).show();\n isEmptySearch = false;\n }\n }\n if (isEmptySearch) {\n $(\"#emptySearchMsg\").show();\n }\n }", "title": "" }, { "docid": "74e5561a73b85a1ded78fda78b8f2a07", "score": "0.66096365", "text": "function searchLists(){\r\n\tlet inputElem = document.getElementById(\"searchable\");\t\t\t\t\t//grab the search bar\r\n\tlet input = inputElem.value.toUpperCase();\r\n\r\n\r\n\t//To-Do list search\r\n\tlet todoList = document.getElementById(\"toDoList\");\t\t\t\t\t//grab the todo list\r\n\tlet todoListLength = todoList.childNodes.length;\r\n\r\n\tfor (var i = 1; i < todoListLength; i++) {\r\n\t\t//console.log(todoList.childNodes[i]);\r\n\t\tlet todoListElem = todoList.childNodes[i];\t\t\t\t\t\t//grab <li> element\r\n\t\tlet todoListItemValue = todoListElem.childNodes[0].value;\t\t//grab the value of the <todo-item> within the <li> element\r\n\r\n\t\tif(todoListItemValue.toUpperCase().indexOf(input) > -1){\t\t//check if value = input\r\n\t\t\ttodoList.childNodes[i].style.display = \"\";\r\n\t\t}else{\r\n\t\t\ttodoList.childNodes[i].style.display = \"none\";\t\t\t\t//otherwise hide the <li>\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//Completed list search\r\n\tlet completedList = document.getElementById(\"completedList\");\r\n\tlet completedListLength = completedList.childNodes.length;\r\n\r\n\tfor (var i = 1; i < completedListLength; i++) {\r\n\t\t//console.log(completedList.childNodes[i]);\r\n\t\tlet completedListElem = completedList.childNodes[i];\t\t\t\t\t//grab <li> element\r\n\t\tlet completedListItemValue = completedListElem.childNodes[0].value;\t\t//grab value of the <todo-item> within the <li>\r\n\r\n\t\tif(completedListItemValue.toUpperCase().indexOf(input) > -1){\t\t\t//check if value = input\r\n\t\t\tcompletedList.childNodes[i].style.display = \"\";\r\n\t\t}else{\r\n\t\t\tcompletedList.childNodes[i].style.display = \"none\";\t\t\t\t\t//otherwise hide the <li>\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "a843cb559978dbcd971764fce8067d85", "score": "0.6607978", "text": "function filter(element,list) {\n var value = $(element).val().toLowerCase();\n var $li = $(list).children(\":visible\");\n\n $li.hide();\n $li.filter(function() {\n return $(this).text().toLowerCase().indexOf(value) > -1;\n }).show();\n }", "title": "" }, { "docid": "ca99df2721fb4496fd68377a075689d7", "score": "0.6604105", "text": "function search () {\n var me = $(\"#searchBar > input\");\n var content = me.val().toUpperCase();\n var userListName = $(\".user-information > p\")\n var userList = $(\".user-list\");\n for (var i = 0; i < userListName.length; i++) {\n var subject = userListName.eq(i);\n var userListSpecified = userList.eq(i);\n var subjectContent = subject.text().toUpperCase();\n if (!subjectContent.includes(content)) {\n // userListSpecified.addClass(\"red\");\n userListSpecified.hide();\n } else {\n // userListSpecified.removeClass(\"red\");\n userListSpecified.show();\n }\n }\n}", "title": "" }, { "docid": "ab0dcdd8e8c6877f40de75f9a409af73", "score": "0.65835637", "text": "function filterFunction() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"available_user_search\");\n filter = input.value.toUpperCase();\n div = document.getElementById(\"available_user_select\");\n a = div.getElementsByTagName(\"option\");\n for (i = 0; i < a.length; i++) {\n txtValue = a[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n a[i].style.display = \"\";\n } else {\n a[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "1a8cbe71c0db253a4d0743869211d22a", "score": "0.6550018", "text": "function filterItems (e) {\n // convert text to lowercase\n var text = e.target.value.toLowerCase();\n //Get List\n var items = itemList.getElementsByTagName('li');\n // Convert to an Array\n Array.from(items).forEach(function(item){\n var itemName = item.firstChild.textContent;\n if (itemName.toLowerCase().indexOf(text) != -1) {\n item.style.display = 'block';\n } else {\n item.style.display = ' none';\n }\n });\n}", "title": "" }, { "docid": "49baaf8f6776a3008a7a74cb534bd1e7", "score": "0.6548415", "text": "function SearchForItem() {\n var typed_input = $(\"Search_Bar_Field\").value;\n typed_input = typed_input.toLowerCase();\n if (typed_input != \"\") {\n\n //Now check which divs show and which get hidden\n\n //Check Top Selling Items\n var showTopSellingTitle = false; //needed to show/hide the 'No items found'\n var topSellingBiggestDiv = document.getElementsByClassName(\"topSellingTenItems\")[0];\n var tenDivs = topSellingBiggestDiv.getElementsByClassName(\"smallestDivOfItem\");\n\n for (let i = 0; i < tenDivs.length; i++) { //loop over the 10 divs\n var smallDiv = tenDivs[i];\n var smallDivTitle = smallDiv.getElementsByClassName(\"title\")[0].innerText.toLowerCase();\n if (smallDivTitle.includes(typed_input)) { //check if input text is included\n smallDiv.style.display = \"inline\"; //then keep it\n showTopSellingTitle = true;\n document.getElementsByClassName(\"nogamesFound\")[0].style.display = \"none\";\n }\n else {\n smallDiv.style.display = \"none\"; //hide it\n }\n }\n\n if (showTopSellingTitle == false) {\n //var bla = document.getElementsByClassName(\"nogamesFound\")[0].innerHTML;\n //alert(bla);\n document.getElementsByClassName(\"nogamesFound\")[0].style.display = \"block\";\n //document.getElementsByClassName(\"nogamesFound\")[1].style.display = \"none\";\n //document.getElementsByClassName(\"nogamesFound\")[2].style.display = \"none\"; \n }\n\n\n //Check New Releases items\n var showNewReleasesTitle = false;\n var newReleasesBiggestDiv = document.getElementsByClassName(\"newReleasesTenItems\")[0];\n var tenDivs = newReleasesBiggestDiv.getElementsByClassName(\"smallestDivOfItem\");\n\n for (let i = 0; i < tenDivs.length; i++) {\n var smallDiv = tenDivs[i];\n var smallDivTitle = smallDiv.getElementsByClassName(\"title\")[0].innerText.toLowerCase();\n if (smallDivTitle.includes(typed_input)) {\n smallDiv.style.display = \"inline\";//then keep it\n showNewReleasesTitle = true;\n document.getElementsByClassName(\"nogamesFound\")[1].style.display = \"none\";\n }\n else {\n smallDiv.style.display = \"none\";//hide it\n }\n }\n\n if (showNewReleasesTitle == false) {\n //document.getElementsByClassName(\"nogamesFound\")[0].style.display = \"none\";\n document.getElementsByClassName(\"nogamesFound\")[1].style.display = \"block\";\n //document.getElementsByClassName(\"nogamesFound\")[2].style.display = \"none\"; \n }\n\n\n //Check Recommendations items\n var showRecommendationsTitle = false;\n var recommendationsBiggestDiv = document.getElementsByClassName(\"recommendationsTenItems\")[0];\n var tenDivs = recommendationsBiggestDiv.getElementsByClassName(\"smallestDivOfItem\");\n\n for (let i = 0; i < tenDivs.length; i++) {\n var smallDiv = tenDivs[i];\n var smallDivTitle = smallDiv.getElementsByClassName(\"title\")[0].innerText.toLowerCase();\n if (smallDivTitle.includes(typed_input)) {\n smallDiv.style.display = \"inline\";//then keep it\n showRecommendationsTitle = true;\n document.getElementsByClassName(\"nogamesFound\")[2].style.display = \"none\";\n }\n else {\n smallDiv.style.display = \"none\";//hide it\n }\n }\n\n if (showRecommendationsTitle == false) {\n //document.getElementsByClassName(\"nogamesFound\")[0].style.display = \"none\";\n //document.getElementsByClassName(\"nogamesFound\")[1].style.display = \"none\";\n document.getElementsByClassName(\"nogamesFound\")[2].style.display = \"block\";\n }\n\n }\n else { //all categories are needed\n var allSmallDivs = document.getElementsByClassName(\"smallestDivOfItem\");\n\n for (let i = 0; i < allSmallDivs.length; i++) {\n allSmallDivs[i].style.display = \"inline\";\n }\n\n document.getElementsByClassName(\"nogamesFound\")[0].style.display = \"none\";\n document.getElementsByClassName(\"nogamesFound\")[1].style.display = \"none\";\n document.getElementsByClassName(\"nogamesFound\")[2].style.display = \"none\";\n }\n\n\n}", "title": "" }, { "docid": "1c9beee4e499d580bf91b0c9df5dfbeb", "score": "0.6537671", "text": "function filterResults() {\n const filterField = document.querySelector('.filter');\n const filterCompleteTask = document.querySelectorAll('li.strike');\n const filterCompleteTask2 = document.querySelectorAll('li.taskItem');\n if(filterField.value === 'complete') {\n filterCompleteTask2.forEach(field => {\n field.style.display = \"none\";\n });\n filterCompleteTask.forEach(field => {\n field.style.display = \"block\";\n });\n } else if(filterField.value === 'incomplete') {\n filterCompleteTask.forEach(field => {\n field.style.display = \"none\";\n });\n filterCompleteTask2.forEach(field => {\n field.style.display = \"block\";\n });\n } else {\n filterCompleteTask.forEach(field => {\n field.style.display = \"block\";\n });\n filterCompleteTask2.forEach(field => {\n field.style.display = \"block\";\n });\n };\n}", "title": "" }, { "docid": "45364ea002ba70db541e6e206a08796f", "score": "0.65356845", "text": "function filterSearch() {\n const searchInput = document.querySelector('input');\n // filters list of breweries by search input\n searchInput.addEventListener('keyup', () => {\n const input = searchInput.value;\n searchEntry(input);\n })\n}", "title": "" }, { "docid": "1c466fc59529aa8a4f771cd321fbcf13", "score": "0.6534964", "text": "function searchkey() {\r\n var input, filter, ul, li, a, i, txtValue;\r\n var words = [\"innit\"]\r\n input = document.getElementById(\"searchbar\");\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"applist\");\r\n li = ul.getElementsByTagName(\"li\");\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n txtValue = a.textContent || a.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n words.push(li[i].id);\r\n } else {\r\n\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n if (!words.includes(\"memmisc\")) {\r\n document.getElementById(\"secmisc\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"secmisc\").style.display = \"\";\r\n }\r\n if (!words.includes(\"memgeneral\")) {\r\n document.getElementById(\"secgeneral\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"secgeneral\").style.display = \"\";\r\n }\r\n if (!words.includes(\"memresources\")) {\r\n document.getElementById(\"secresources\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"secresources\").style.display = \"\";\r\n }\r\n if (!words.includes(\"memgoogle\")) {\r\n document.getElementById(\"secgoogle\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"secgoogle\").style.display = \"\";\r\n }\r\n if (!words.includes(\"memmath\")) {\r\n document.getElementById(\"secmath\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"secmath\").style.display = \"\";\r\n }\r\n}", "title": "" }, { "docid": "515d534035733dda01a87325865a73f8", "score": "0.6524926", "text": "function searchPosts(searchList, filterString) {\n for (let i = 0; i < searchList.length; i++) {\n let post = searchList[i];\n console.log(post);\n if (includesCaseInsensitive(post.name, filterString)) {\n $(\"#\" + post.feedID).show();\n } else {\n $(\"#\" + post.feedID).hide();\n }\n }\n}", "title": "" }, { "docid": "ae4fee2457a20fa2471f69befc4b163d", "score": "0.6519388", "text": "function search(input) {\n\tconst found = [];\n\temployees.forEach(employee => {\n\t\t// Concatenate full name\n\t\tconst name = employee.name.first + employee.name.last;\n\t\t// Check for user input value\n\t\tif (name.toLowerCase().includes(input.toLowerCase())) {\n\t\t\tfound.push(employee);\n\t\t}\n\t});\n\tgallery.innerHTML = ''; // Clear any rendered cards\n\trenderGalleryHTML(found);\n}", "title": "" }, { "docid": "df9e6095f8b67083a1b655fa67ece2d0", "score": "0.6518472", "text": "function filterFunction() {\n var input, filter, a, i;\n input = document.getElementById(\"nameSearch\");\n filter = input.value.toUpperCase();\n div = document.getElementById(\"post_table\");\n a = div.getElementsByTagName(\"li\");\n \n for (i = 0; i < a.length; i++) {\nif (a[i].innerHTML.toUpperCase().indexOf(filter) > -1 && ((dataPost[i].state == \"Pending contact\" && state1 == true) || (dataPost[i].state == \"Scheduled Assessment\" && state2 == true) || (dataPost[i].state == \"FinishedAssessment\" && state3 == true) || (dataPost[i].state == \"Pending Interview\" && state4 == true) || (dataPost[i].state == \"Finished Interview\" && state5 == true) || (dataPost[i].state == \"Approved\" && state6 == true) || (dataPost[i].state == \"Rejected\" && state7 == true) || state1 == false && state2 == false && state3 == false && state4 == false && state5 == false && state6 == false && state7 == false && (editionSelected == \"none\" || \"1\")))\n \n {\n a[i].style.display = \"\";\n }\n \n else {\n a[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "a0e056e8941365ad73777a3ad44e9f3b", "score": "0.6516737", "text": "function filterContacts() {\n // Get value of input\n var filterValue = filterInput.value.toUpperCase();\n\n // Loop through contact-item lis\n for (var i = 0; i < contacts.childNodes.length; i++) {\n var reqContact = contacts.childNodes[i];\n var reqContactValue = reqContact.innerHTML.toUpperCase().indexOf(filterValue);\n\n // If match\n if (reqContactValue > -1) {\n reqContact.style.display = '';\n // separateLetters();\n } else {\n reqContact.style.display = 'none';\n }\n\n if (reqContact.classList.contains('initial-letter') && filterInput.value !== '') {\n reqContact.style.display = 'none';\n }\n }\n }", "title": "" }, { "docid": "65f95ec398d769ce2b9415809aabf572", "score": "0.6513236", "text": "function search() {\r\n let searchInput = document.getElementById(\"textInput\").value;\r\n let inputText = searchInput.trim();\r\n\r\n if (!inputText) {\r\n return;\r\n }\r\n\r\n filterResults = [];\r\n\r\n filterResults = rentalClients.filter(customer => {\r\n return customer.last_name.toUpperCase().startsWith(inputText.toUpperCase());\r\n });\r\n\r\n displayResults();\r\n}", "title": "" }, { "docid": "049bbe902cd6f73b93d6d7a51e50d578", "score": "0.65131545", "text": "function searchEntries(val){\n val = filterStartWhitespace(val).toLowerCase();\n for(var streamer in streams){\n var name = streams[streamer].toLowerCase();\n var liID = \"#\" + name;\n if(val.length > 0 && name.substr(0, val.length) !== val) {\n $(liID).hide();\n }\n else{\n $(liID).show();\n }\n }\n }", "title": "" }, { "docid": "c45574a0136b97c3c9a0db8e87ae0a02", "score": "0.65082747", "text": "function processNameSearch() {\n const textField = document.getElementById(\"search\");\n \n if(textField != null) {\n const userText = textField.value.toLowerCase();\n //flag that we are searching\n isSearching = true;\n\n //lets make sure we have a valid string\n if(userText.length > 0) {\n const result = searchFor(userText);\n //finally, show the new list\n showPage(1);\n addPagination(searchStudentList);\n\n //if we have no results, show that as the only list item on the screen\n if(result === 0) { \n showNoSearchResults();\n }\n }\n else {\n\n //reset the search array\n searchStudentList = studentList;\n //set that we are not searching anymore\n isSearching = false;\n //reset pagination so we get the normal button list\n paginationOnce = false;\n //show the page \n showPage(1);\n addPagination(searchStudentList);\n\n console.log(\"No Names found!\");\n }\n }\n else {\n console.log(\"invalid text field!\");\n }\n}", "title": "" }, { "docid": "155df6a5cbfafd329ceaf77900a8e717", "score": "0.6504663", "text": "function searchFunction() {\n let searchValue = search.value.toLowerCase();\n let employeeCards = document.querySelectorAll('.card');\n let employeeInfo = document.querySelectorAll('.profile-text');\n for (i = 0; i < employeeCards.length; i++) {\n let h3 = employeeInfo[i].getElementsByTagName('h3')[0];\n let name = h3.textContent;\n if (name.toLowerCase().indexOf(searchValue) > -1) {\n employeeCards[i].style.display = \"\";\n } else {\n employeeCards[i].style.display= 'none';\n }\n }\n}", "title": "" }, { "docid": "5d1481ef54dcc362ab64c86528042028", "score": "0.65020037", "text": "function displaySearchList() {\n \n // Clears out the lists to put new list items in.\n $('#group-one li') .remove();\n $('#group-two li') .remove();\n \n // Adds a class to allow the list of items to appear after the search icon is clicked\n // or the enter button is pressed.\n $('.search-result-container-blank').addClass(\"search-result-container-active\");\n \n // Stores the value in the search box into another variable for saving. \n var searchItem = $('#search').val();\n \n // Clears out the search box to allow another entry to take place.\n $('#search').val(\"\");\n \n // Stores the wikipedia api call in a variable. \n var wikiSearch = \"https://en.wikipedia.org/w/api.php\";\n wikiSearch += \"?callback=?\";\n wikiSearch += \"&action=opensearch\";\n wikiSearch += \"&format=json\";\n wikiSearch += \"&profile=fuzzy\";\n wikiSearch += \"&limit=10\";\n wikiSearch += \"&prop=imageinfo&format=json&iiprop=urll\";\n wikiSearch += \"&search=\";\n wikiSearch += encodeURI(searchItem);\n \n // Using getJson the data is retrieved from wikipedia api. \n $.getJSON(wikiSearch, function(data) {\n \n for (var i = 0; i < data[1].length; i++) {\n \n // If the group switch is false then start putting items into the first column.\n if (!groupSwitch) {\n \n $('#group-one ul').append('<li><a href=\"' + data[3][i] + '\" target=\"_blank\"><span class=\"item-title\">' + data[1][i] + '</span><span class=\"item-description\">' + data[2][i].substring(0,100) + '...</span></a></li>'); \n \n // Once the value is greater than 4 switch to the next column\n if (i > 3) {\n groupSwitch = true;\n }\n \n } else {\n \n $('#group-two ul').append('<li><a href=\"' + data[3][i] + '\" target=\"_blank\"><span class=\"item-title\">' + data[1][i] + '</span><span class=\"item-description\">' + data[2][i].substring(0,100) + '...</span></a></li>');\n \n }\n }\n \n groupSwitch = false;\n \n });\n }", "title": "" }, { "docid": "dde1f3abec68ddb10e39cd4a9342f35c", "score": "0.6498017", "text": "function searchButtonTyped(){\n\t\t\n\t\tlet searchValueLocator = elementListHeaderParent.lastElementChild.firstElementChild;\n\t\tlet searchInputValue = searchValueLocator.value;\n\t\tlet searchResultChecker = \"no\";\n\t\tlet searchResultArray = [];\n\t\t\n\t\t\n\t\tif(searchInputValue !== \"\"){\n\t\t\t\n\t\t\tresetAndHideAllLists(list);\n\t\t\t\n\t\t\tfor(let i = 0; i < list.length ; i++){\n\t\t\n\t\t\t\tif(list[i]){\n\t\t\t\t\t\n\t\t\t\t\tlet currentListName = list[i].firstElementChild.children[1].textContent;\n\t\t\t\t\t\n\t\t\t\t\tif(currentListName.includes(searchInputValue)){\n\t\t\n\t\t\t\t\t\tlist[i].style.display = 'block';\n\t\t\t\t\t\tsearchResultArray.push(list[i]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(searchResultArray.length!=0){\n\t\t\t\t\n\t\t\t\tsearchResultChecker = \"yes\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\n\t\t\tdocument.querySelectorAll('.pagination').forEach(function(a){\n\t\t\ta.remove()\n\t\t\t})\n\t\t\thideDisplayNoResultsFromSearch(searchResultChecker);\n\t\t\tappendPageLinks(searchResultArray);\n\t\t\t\n\t\t}else if(searchInputValue == \"\"){\n\t\t\t\n\t\t\tshowPage(elementList,1);\n\t\t\tdocument.querySelectorAll('.pagination').forEach(function(a){\n\t\t\ta.remove()\n\t\t\t})\n\t\t\thideDisplayNoResultsFromSearch(\"yes\");\n\t\t\tappendPageLinks(elementList);\n\t\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "4507dbdb5f63f90fc12451391f78e224", "score": "0.6493554", "text": "function filter(){\n var items = $('#fb-files-container li').children('span.fb-file-name');\n var search = $(\"#txtDirSearch\").val().toLowerCase();\n for (var i = 0; i < items.length; i++) {\n if ($(items[i]).text().toLowerCase().indexOf(search) >= 0) {\n $(items[i]).parent().removeClass(\"hidden\");\n }\n else {\n $(items[i]).parent().addClass(\"hidden\");\n }\n }\n }", "title": "" } ]
c46217416408659233c61551babdf634
Function passed in to `connect` to subscribe to Redux store updates. Any time it updates, mapStateToProps is called.
[ { "docid": "d70a69b5bab4610aeba0ef2968cdb6b3", "score": "0.0", "text": "function mapStateToProps({user}) {\n return {\n user\n };\n}", "title": "" } ]
[ { "docid": "af5f52faffe977fbd5163f1cc8a2be0b", "score": "0.67427194", "text": "function connect(mapStateToProps, mapDispatchToProps) {\r\n return function (WrappedComponent) {\r\n // It returns a component\r\n return class extends React.Component {\r\n render() {\r\n return (\r\n // that renders your component\r\n <WrappedComponent\r\n \r\n {...this.props}\r\n {/* and additional props calculated from Redux store */}\r\n {...mapStateToProps(store.getState(), this.props)}\r\n {...mapDispatchToProps(store.dispatch, this.props)}\r\n />\r\n )\r\n }\r\n \r\n componentDidMount() {\r\n // it remembers to subscribe to the store so it doesn't miss updates\r\n this.unsubscribe = store.subscribe(this.handleChange.bind(this))\r\n }\r\n \r\n componentWillUnmount() {\r\n // and unsubscribe later\r\n this.unsubscribe()\r\n }\r\n \r\n handleChange() {\r\n // and whenever the store state changes, it re-renders.\r\n this.forceUpdate()\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "65233b3879d00a524031ac7ee098279b", "score": "0.66979957", "text": "function mapStateToProps(state) { // this will pass the state in?\n return {\n exchange: exchangeSelector(state)\n }\n}", "title": "" }, { "docid": "1bc84a6ac2387e5877307f90a1450f38", "score": "0.66151464", "text": "function connect(mapSteteToProps, mapDispatchToProps) {\n return function(WrappedComponent) {\n return class extends React.Component {\n render() {\n return (\n <WrappedComponent \n {...this.props}\n {/*and addtitonal props calculated from redux store */}\n {...mapStateToProps(store.getState(), this.props)}\n {...mapDispatchToProps(store.dispatch, this.props)}\n />\n )\n }\n\n componentDidMount() {\n // it remembers to subscribe to the store so it doesn't miss updates\n this.unsubscribe = store.subscribe(this.handleChange.bind(this));\n }\n\n componentWillUnmount() {\n this.unsubscribe();\n }\n\n handleChange() {\n // whenever the store state changes, it re-renders\n this.forceUpdate();\n }\n }\n }\n }", "title": "" }, { "docid": "eadc09d758dee9e64d2d1f95a6c2344e", "score": "0.6607724", "text": "function mapStateToProps(state) {\n return { dataReducer: state.dataReducer};\n\n}", "title": "" }, { "docid": "69e6e80dc6d3a53e0c2b1de528cc7688", "score": "0.6413845", "text": "function mapDispatchToProps(dispatch) {\n// // whenever <function below> is called result should be passed\n// // to all of our reducers\n return bindActionCreators({\n LayoutChange: LayoutChange,\n WeaponChange: WeaponChange,\n FireWeapon: FireWeapon\n }, dispatch);\n}", "title": "" }, { "docid": "f8f0e89170b452ebfaff7084ebfaf084", "score": "0.6408515", "text": "function mapDispatchToProps(dispatch) {\n // Whenever dispatch is called the result should be passed\n // to all of the reducers\n return bindActionCreators({}, dispatch)\n}", "title": "" }, { "docid": "e965e9f29e87b4b05f3e6537922a0583", "score": "0.63622403", "text": "function mapDispatchToProps(dispatch){\n\treturn bindActionCreators({\n\t\tupdateElapsedTime: updateElapsedTime, \n\t\tupdatePlayStatus: updatePlayStatus, \n\t\tselectTrack: selectTrack,\n\t\tupdateVolume: updateVolume\n\t}, dispatch);\n}", "title": "" }, { "docid": "48550cf62bffae484b29e0dfc77049aa", "score": "0.63535935", "text": "function mapStateToProps(state, ownProps) {\n return {\n movies: state.moviesReducer\n };\n}", "title": "" }, { "docid": "e689df6e7a35d0dd6d2c9cc1dedf2adb", "score": "0.63394964", "text": "function mapStateToProps(state) {\n return {\n store: state,\n };\n}", "title": "" }, { "docid": "8349928bc0f5797f6e9f8055d5dd0e11", "score": "0.63296926", "text": "function mapStateToProps(store) {\n return {\n SubscriptionInfo: getSubscriptionInfo(store)\n // initialValues: { evesEmailList: selector(store, 'evesEmailList') },\n };\n}", "title": "" }, { "docid": "08803d2cc67b0c3c25a7f00576a11e90", "score": "0.6319055", "text": "function mapStateToProps( state, props )\n{\n console.log( '****',state,'-', props );\n return state; //.LoginSignUpReducer;\n}", "title": "" }, { "docid": "02ad37d9179ed9ba0afbe7c3e6fb05b8", "score": "0.62948656", "text": "function mapStateToProps(state, props) {\n\n}", "title": "" }, { "docid": "f9ffe568af45e758c6af047ecceef2f4", "score": "0.6294485", "text": "function mapStateToProps(reduxState){\n //todos: = a new prop of this component; reduxState.todos = maps our array of todos in the redux store to this component under the prop \"todos\"\n return {\n todos: reduxState.todos\n };\n}", "title": "" }, { "docid": "7a64c89c1972ec899a507880f7bbba47", "score": "0.6287141", "text": "function mapStateToProps(state) {\n return {\n counter: state.counter\n };\n}", "title": "" }, { "docid": "7a64c89c1972ec899a507880f7bbba47", "score": "0.6287141", "text": "function mapStateToProps(state) {\n return {\n counter: state.counter\n };\n}", "title": "" }, { "docid": "7a64c89c1972ec899a507880f7bbba47", "score": "0.6287141", "text": "function mapStateToProps(state) {\n return {\n counter: state.counter\n };\n}", "title": "" }, { "docid": "7d1b8fdd6c73c87d3a24b2c6b5a9e96e", "score": "0.6277864", "text": "function mapDispatchToProps(dispatch) {\n return ({\n changeStateToReducer: (allChangeState) => {\n dispatch(changeState(allChangeState))\n }\n // changeUserName: ()=>{dispatch(changeUserName())}\n })\n}", "title": "" }, { "docid": "f5fa535655c367ce757dcb0e1d7ae984", "score": "0.62608033", "text": "function mapDispatchToProps(dispatch) {\n return {\n onIncreaseClick: () => {\n // console.log(\"current state\",this.context.store.getState())\n dispatch({ type: 'increase2',num:1 })\n }\n }\n}", "title": "" }, { "docid": "8cbc3ca4ba132c2e0c8f332ea0d1611b", "score": "0.6240914", "text": "subscribeToStore() {\n const selectHitPower = (state) => state.player.hitPower;\n\n connect(\n gameStore,\n selectHitPower,\n )(this.handleHitPowerChange);\n\n const selectWeapon = (state) => state.player.weapon;\n\n connect(\n gameStore,\n selectWeapon,\n )(this.handleWeaponChange);\n }", "title": "" }, { "docid": "f785e760eb7cc996eb00a843f965c137", "score": "0.62381655", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "afdcbe19add716c5ba5a6fec0daf3a4b", "score": "0.62362087", "text": "function mapStateToProps(state)\n{\n return {\n users: state.users\n };\n}", "title": "" }, { "docid": "215b68c94fcc4bfaad3613e652ac0eae", "score": "0.623213", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(\n { setFlats: setFlats }, // \"this.props.setFlats()\" is now connected\n dispatch\n );\n}", "title": "" }, { "docid": "252f2b2f5725749c657c42c12306e400", "score": "0.6228372", "text": "function mapStateToProps(state) {\n // take count from state and put it into a property called count\n console.log('mapstateToProps', state);\n return {\n count: state.count\n }\n}", "title": "" }, { "docid": "cc782ccc266a8de0a27a11c117f97c4d", "score": "0.6228169", "text": "function connect(states, actions) {\n states = (0, _index.mapState)(states || {});\n actions = (0, _index.mapActions)(actions || {});\n return function connectComponent(Component) {\n var unSubscribe = null;\n // 绑定\n var _onLoad = Component.prototype.onLoad;\n var _onUnload = Component.prototype.onUnload;\n\n var onStateChange = function onStateChange() {\n var _this = this;\n\n var store = (0, _store.getStore)();\n var hasChanged = false;\n Object.keys(states).forEach(function (k) {\n var newV = states[k]();\n if (_this.data[k] !== newV) {\n // 不相等\n _this.setData(_defineProperty({}, k, newV));\n hasChanged = true;\n }\n });\n };\n return function (_Component) {\n _inherits(_class, _Component);\n\n function _class() {\n _classCallCheck(this, _class);\n\n var _this2 = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this));\n\n _this2.computed = Object.assign(_this2.computed || {}, states, (0, _index.mapState)({\n $state: function $state(state) {\n return state;\n }\n }));\n var protoMethod = {};\n var proto = _this2.__proto__.__proto__.__proto__;\n if (proto) {\n Object.getOwnPropertyNames(proto || []).forEach(function (prop) {\n if (prop !== 'constructor') {\n protoMethod[prop] = proto[prop];\n }\n });\n }\n _this2.methods = Object.assign(_this2.methods || {}, actions, protoMethod);\n return _this2;\n }\n\n _createClass(_class, [{\n key: 'onLoad',\n value: function onLoad() {\n var store = (0, _store.getStore)();\n unSubscribe = store.subscribe(onStateChange.bind(this));\n onStateChange.call(this);\n _onLoad && _onLoad.apply(this, arguments);\n }\n }, {\n key: 'onUnload',\n value: function onUnload() {\n unSubscribe && unSubscribe();\n unSubscribe = null;\n _onUnload && _onUnload.apply(this, arguments);\n }\n }]);\n\n return _class;\n }(Component);\n };\n}", "title": "" }, { "docid": "16143ce3a7e363f6bdc31ca994aef1df", "score": "0.6222633", "text": "function mapStateToProps(reduxState) {\n return {\n todos: reduxState.todos\n }\n}", "title": "" }, { "docid": "1b8fcc29140a218ef4c0cee37f374434", "score": "0.6221393", "text": "function mapStateToProps(state){\n return {\n count: state.count\n }\n}", "title": "" }, { "docid": "21874bd1b81a83573d39d6602b401b83", "score": "0.6193013", "text": "function mapStateToProps(state) {\n // gives whatever is in our store\n return {\n posts: state.posts,\n comments: state.comments\n }\n}", "title": "" }, { "docid": "83893a5ac61e93a65b5d9ee7f46cad13", "score": "0.61779565", "text": "function mapStateToProps(state) {\n return {\n count: state.count\n };\n}", "title": "" }, { "docid": "259e1531d5c774fba2bf8576ba7e0347", "score": "0.6169828", "text": "function connect(mapStateToProps, mapDispatchToProps) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n return _reactRedux.connect.apply(undefined, [mapStateToProps ? function (state, props) {\n /**\n * If props.slice is set then call the underlying\n * mapStateToProps with the slice as the state argument,\n * extended with the current state as the root. If\n * there is no props.slice (typically the top level)\n * then use state directly.\n **/\n if (props.slice) return mapStateToProps(props.slice, props);\n return mapStateToProps(state, props);\n } : null, mapDispatchToProps ? function (dispatch, props) {\n /**\n * Call the underlying mapDispatchToProps passing the\n * slice as the second argument (with the same check\n * as above).\n **/\n if (props.slice) return mapDispatchToProps(dispatch, props.slice, props);\n return mapDispatchToProps(dispatch, props, props);\n } : null].concat(args));\n}", "title": "" }, { "docid": "5ccec1256d8077c7939a52c4a59400a6", "score": "0.61665064", "text": "function mapStateToProps(state) {\n console.log(\"mapStateToProps: \", state.counter);\n return {\n counter: state.counter,\n };\n}", "title": "" }, { "docid": "c4b8f6cd9b3946cad62d1ccf3d082244", "score": "0.61644626", "text": "function mapStateToProps(state) {\n return { count: state };\n}", "title": "" }, { "docid": "855d6e764ce286916974fb03da92e23f", "score": "0.6158038", "text": "function mapStateToProps() {\n return {\n };\n}", "title": "" }, { "docid": "69034ae6fc276c77f87fcd9d0007f754", "score": "0.6153353", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "69034ae6fc276c77f87fcd9d0007f754", "score": "0.6153353", "text": "function mapStateToProps(state) {\n return state;\n}", "title": "" }, { "docid": "bcca1548782e9bcc2aef46607c8eedf8", "score": "0.6150352", "text": "function mapStateToProps(state) {\n return {\n count: state.count\n }\n}", "title": "" }, { "docid": "7a051f1cbf10dbb5224672278744ea9e", "score": "0.61461335", "text": "function mapStateToProps(state) {\n return { users: state.users };\n}", "title": "" }, { "docid": "15adad476963e951b5ef075ab94b0c8f", "score": "0.6143559", "text": "function mapDispatchToProps (dispatch) {\n\treturn bindActionCreators(CounterActions,dispatch);\n}", "title": "" }, { "docid": "b25d6947d1f5d2f8ff2c2af183d082cf", "score": "0.6138727", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({ fetchUser, updateUser }, dispatch);\n}", "title": "" }, { "docid": "6405389db632c52f6255bce6ee146a9b", "score": "0.61384803", "text": "function mapStateToProps(state, ownProps){ //ownProps est les props du component de react\n return {\n courses: state.courses //ca c 'est le reducer courseReducer, qu on a renomé courses\n }\n}", "title": "" }, { "docid": "cb3175e155992ba3f48a2b418e8d20ac", "score": "0.6137378", "text": "function mapStateToProps(state) {\n return {shopping_list: state.shopping_list}; \n}", "title": "" }, { "docid": "5bf791922a3e7da8f23d54dca80113d4", "score": "0.61226034", "text": "function mapDispatchToProps(dispatch){\n return{\n increaseCount:function(){\n console.log(\"dispatch\")\n return dispatch(increaseAction)\n },\n decreaseCount:function(){\n return dispatch(decreaseAction)\n }\n };\n}", "title": "" }, { "docid": "2e5452e9b6670c4a40a8e226f69f5499", "score": "0.6121314", "text": "function mapStateToProps (state) {\n return state;\n}", "title": "" }, { "docid": "2d2877faac88db0482d887f7aa033061", "score": "0.6115839", "text": "function mapStateToProps(state) {\r\n return {visibleproducts : state.listProductReducer, getprd:state.editProductReducer};\r\n}", "title": "" }, { "docid": "8b200222d3a02eaef371f1dd7a9099e8", "score": "0.61091435", "text": "function mapStateToProps(state) {\n return {\n products: state.products\n };\n}", "title": "" }, { "docid": "2da90502fcdb4057ab8831db2d074db3", "score": "0.6105913", "text": "function mapStateToProps(state) {\n return {\n stateFromRedux: state.countryReducer,\n };\n}", "title": "" }, { "docid": "9ed82ff1ecba4dfe0aec8e19738a34a3", "score": "0.6100532", "text": "function mapDispatchToProps(dispatch) {\n\nreturn bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "12c78865a98e7ae0e6f51f44abb4d814", "score": "0.61003923", "text": "function mapStateToProps(state) {\n return {\n // TODO: add state\n };\n}", "title": "" }, { "docid": "38bed47fe0e6733a07521066fd243351", "score": "0.60926527", "text": "function mapStateToProps(state) {\n return {\n users: state.users\n };\n}", "title": "" }, { "docid": "c4d281965811bdca21cae423598cb47c", "score": "0.60821277", "text": "function mapDispatchToProps(dispatch) {\n //whenever select is call, the result should be passed to all reducers\n return bindActionCreators(\n {\n closeDuplConfigModal,\n updateDuplConfigReceiverId,\n updateDuplConfigUsage,\n updateDuplConfigPurpose,\n createDuplConfig\n },\n dispatch\n );\n}", "title": "" }, { "docid": "1df9cf64e9031908a0da52a14b7a0586", "score": "0.6080115", "text": "function mapStateToProps(state) {\n return { products: state.products }\n}", "title": "" }, { "docid": "3ebf52135b5cc87f6859d9a9d7644ab4", "score": "0.6079852", "text": "function mapStateToProps(state, ownProps) {\n return {\n redux: state.auth,\n //redirect : state.layout.redirect\n };\n}", "title": "" }, { "docid": "295426bceaf1fafd902cfd076bd0e6c3", "score": "0.6073649", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(ActionCreators, dispatch)\n}", "title": "" }, { "docid": "1cd906e365714537ca4b1f02b895d354", "score": "0.6069885", "text": "function matchDispatchToProps(dispatch) {\n return bindActionCreators({ UpdateInputState }, dispatch);\n}", "title": "" }, { "docid": "ef2f339917e435340f731b5d6601b738", "score": "0.60674185", "text": "function mapStateToProps( state ) {\n\treturn {\n\t\tcount: state.count\n\t};\n}", "title": "" }, { "docid": "91a619b3eed2d24a9da549a3e65a219c", "score": "0.6067084", "text": "function mapDispatchToProps(dispatch) {\n return {\n onIncreaseClick: () => dispatch(increaseAction)\n }\n}", "title": "" }, { "docid": "bb391cedc296849ebc483c8004be1152", "score": "0.6063796", "text": "function mapStateToProps(store) {\n return {\n users: getUsers(store),\n };\n}", "title": "" }, { "docid": "f503e02afbfbd9ed7f36e2440e8e8af9", "score": "0.60629976", "text": "function mapStateToProps (state) {\n\t\treturn {\n\t\t\tcounter:state.counter\n\t\t};\n}", "title": "" }, { "docid": "05093dbeb79215d7c6b9f307155688c7", "score": "0.60627615", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(ActionCreators, dispatch)\n}", "title": "" }, { "docid": "0f3abea72f684a2088c9f0e5e6269a83", "score": "0.6060382", "text": "function mapStateToProps(state) {\n return {\n\n };\n}", "title": "" }, { "docid": "5432f602f4d3d85853f02b80c034a5cf", "score": "0.60560834", "text": "connectControllers() {\n for (let c of this.controllers) {\n this.store.subscribe(c.onStateUpdated.bind(c));\n this.fastStore.subscribe(c.onFastStateUpdated.bind(c));\n }\n }", "title": "" }, { "docid": "51cf03972b2c0c04121476cd8da6bf24", "score": "0.6052112", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "51cf03972b2c0c04121476cd8da6bf24", "score": "0.6052112", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "51cf03972b2c0c04121476cd8da6bf24", "score": "0.6052112", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "51cf03972b2c0c04121476cd8da6bf24", "score": "0.6052112", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "66e466217d8ee46040e6837aa6418abd", "score": "0.6049164", "text": "function mapStateToProps(state) {\n return {\n cart: state.cart,\n products: state.products\n }\n}", "title": "" }, { "docid": "722aecbb867e4e1a79849c1d43a1ef90", "score": "0.6045729", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "67e3c969da9b7266ea5d640f1bd05b8a", "score": "0.6044169", "text": "function mapStateToProps(state){\n\t//So take state from store and pass to component as props\n return {\n \ttrainers:state.trainers\n }\n}", "title": "" }, { "docid": "8057774c1ddf72ea1254377557ffe55a", "score": "0.6042251", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({ \n updateCode: updateCode, \n goOnline: goOnline, \n closeDiffModal: closeDiffModal, \n startStreamingEditor: startStreamingEditor}, \n dispatch)\n}", "title": "" }, { "docid": "096ebdb4b9f26ff078c6a9fbbe250cb6", "score": "0.603686", "text": "function mapDispatchToProps(dispatch) {\n\treturn {\n\t\tcounterActions: bindActionCreators(counterActions, dispatch)\n\t}\n}", "title": "" }, { "docid": "31de6c32f9801149b6635f195ad138d5", "score": "0.6034919", "text": "function mapDispatchToProps(dispatch) {\r\n return {\r\n actions: bindActionCreators(actionsCreators, dispatch)\r\n };\r\n}", "title": "" }, { "docid": "b2d3024de3cf2d385f9ed7944c6e42c0", "score": "0.6033271", "text": "function mapDispatchToProps(dispatch) {\n\t// bindActionCreators takes 2 args:\n\t// 1. object: property of local prop name (this.props.whatever)\n\t// \tvalue: the callback or action\n\t// 2. dispatcher: \n\treturn bindActionCreators({ \n\t\tupdateHome: UpdateHome\n\t}, \n\tdispatch)\n}", "title": "" }, { "docid": "7ba12de77a3c86cd06299bf4bcf3593b", "score": "0.6028121", "text": "function mapStateToProps(state) {\n return {\n users: state.users,\n messages: state.messages,\n session: state.session\n };\n}", "title": "" }, { "docid": "1b1bda2edc6a9241d47410c7d393f420", "score": "0.6026052", "text": "function mapStateToProps(state) {\n return {\n count : state.count\n };\n}", "title": "" }, { "docid": "458a6bc662a9172d56cca61d02a56ac4", "score": "0.6025011", "text": "function mapDispatchToProps (dispatch) {\n return bindActionCreators( {\n UpdateSite: UpdateSite\n }, dispatch )\n }", "title": "" }, { "docid": "5b71f9f03d3bd5908eb3a3668bd1d532", "score": "0.60138285", "text": "function mapStateToProps(state) {\n // you have to return the state\n return { weatherData: state.weather }\n}", "title": "" }, { "docid": "a777611e1d4c2b69da09a9ffb2b5ff82", "score": "0.6012365", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "00d4a717577c583c8b63067fcc28fe58", "score": "0.6012184", "text": "function mapStateToProps(state){\n // console.log(state);\n return{\n cars: state.cars\n };\n}", "title": "" }, { "docid": "bd5f7bb4d5131a8ef42ea1fafd439bd2", "score": "0.60092187", "text": "function mapStateToProps(reduxState) {\n // console.log(\"redux state?\", reduxState);\n return {\n devs: reduxState.developers\n };\n}", "title": "" }, { "docid": "df9ce1975e454eea7735c5bc37016b95", "score": "0.6008249", "text": "function mapStateToProps(state) {\n return {\n products: state.products,\n category: state.category\n };\n}", "title": "" }, { "docid": "ae00a9846dad5963594ed6c9a0e6926c", "score": "0.6006985", "text": "function mapDispatchToProps(dispatch) {\n return {\n changeCity: (city) => dispatch(changeCity(city))\n };\n}", "title": "" }, { "docid": "961674ccb0787a7f7ccc203c16d48f35", "score": "0.60063267", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n }, dispatch)\n };\n}", "title": "" }, { "docid": "501b9b568892f892ac77ed91814a465e", "score": "0.600485", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators( actions, dispatch)\n}", "title": "" }, { "docid": "834d746c11f6295de37a9efa1ef5253a", "score": "0.60047823", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actions, dispatch);\n}", "title": "" }, { "docid": "45501fee07be8f7b628787f6b5ceb9fc", "score": "0.6004357", "text": "static mapStateToProps(store) {\n return {\n boardState: store.boardState\n }\n }", "title": "" }, { "docid": "4cff6a00f02663026a1e01b21de8c5e9", "score": "0.6002855", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "1aaefa4443509994fded9b245058703f", "score": "0.60024655", "text": "function mapStateToProps(state){\n return {\n ...state\n };\n}", "title": "" }, { "docid": "7bae28406e0af093f1e5ca7b6dc83d00", "score": "0.6002429", "text": "function mapStateToProps(reduxState) {\n // console.log(\"redux state?\", reduxState);\n return {\n devs: reduxState.developers,\n };\n}", "title": "" }, { "docid": "4c9f428cbb254614e34b437aeba5559f", "score": "0.60011667", "text": "function mapDispatchToProps(dispatch) {\n return { actions: bindActionCreators(actions, dispatch) };\n}", "title": "" }, { "docid": "4c9f428cbb254614e34b437aeba5559f", "score": "0.60011667", "text": "function mapDispatchToProps(dispatch) {\n return { actions: bindActionCreators(actions, dispatch) };\n}", "title": "" }, { "docid": "4c9f428cbb254614e34b437aeba5559f", "score": "0.60011667", "text": "function mapDispatchToProps(dispatch) {\n return { actions: bindActionCreators(actions, dispatch) };\n}", "title": "" }, { "docid": "7954bffc8e3fc0f697d29d43297bce9c", "score": "0.5999046", "text": "subscribeToChanges() {\n this.props.dataSource.subscribeToChanges(this.handleChange());\n }", "title": "" }, { "docid": "839114f265c1a05c3ce443be15ae9dff", "score": "0.59916997", "text": "subscribeToSync() {\n const {actions} = this.props;\n let prevAddresses;\n store.subscribe(function() {\n const newAddresses = store.getState().addresses;\n if (newAddresses !== prevAddresses) {\n if (prevAddresses) {\n actions.updateAddrs(newAddresses, prevAddresses);\n }\n prevAddresses = newAddresses;\n }\n });\n }", "title": "" }, { "docid": "bb4cf37fc593d0f631cecc4f9e313306", "score": "0.5990694", "text": "function mapStateToProps(store) {\n return {login: store.login};\n}", "title": "" }, { "docid": "abed46fd6b614e95e166da3650c3ea9a", "score": "0.59883124", "text": "function mapDispatchToProps(dispatch){\n\treturn bindActionCreators(actionCreators,dispatch);\n}", "title": "" }, { "docid": "f77d13475494cf6a5b2ded5a0e0ae3fb", "score": "0.59880596", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({\n // TODO: add actions\n }, dispatch);\n}", "title": "" }, { "docid": "f8f2a434eea34e4c281ddb90259b3cf2", "score": "0.5978386", "text": "function mapDispatchToProps(dispatch) {\n return {\n onIncreaseClick: () => dispatch(increaseAction)\n }\n }", "title": "" }, { "docid": "202f64cd5336c31851c39e7718d9e9c1", "score": "0.59726185", "text": "function mapStateToProps(state) {\n return {\n users: state.users\n };\n}", "title": "" }, { "docid": "b82a03c4f25519c4b173b9caf9a311c0", "score": "0.5971702", "text": "function mapStateToProps(state, ownProps) {\n return {\n courses: state.courses //state.courses refers to 'courses' in the rootReducer\n };\n}", "title": "" }, { "docid": "0d6f4ce9cad66d30104a39d6e9c1ce57", "score": "0.59702116", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators,dispatch);\n}", "title": "" }, { "docid": "ad97e326f07d6402aea8462103c9ba53", "score": "0.59694254", "text": "function mapDispatchToProps(dispatch) {\n\treturn bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "97c681eb3c0e426f753b47edeae55e3b", "score": "0.5966682", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" } ]
dbb8e31ee7c8be9239ebc3dfe8a8aa88
Prints Series to console as a grid of row and columns.
[ { "docid": "4432708ae02e3fd9ad40ae6533b27739", "score": "0.5272595", "text": "toString() {\n const maxRow = this.$config.getMaxRow;\n let indx;\n let values = [];\n\n if (this.shape[0] > maxRow) {\n //slice rows to show [max_rows] rows\n const sfSlice = this.iloc([`0:${maxRow}`]);\n\n indx = sfSlice.index;\n values = sfSlice.values;\n\n } else {\n indx = this.index;\n values = this.values;\n }\n\n const tabledata = values.map((x, i) => [indx[i], x]);\n return table(tabledata);\n }", "title": "" } ]
[ { "docid": "d60de3884bb26d186473c86ef6d1aaa2", "score": "0.6736376", "text": "show() {\r\n if (console.table) {\r\n console.table(this.data);\r\n } else {\r\n let row_string = \"\";\r\n this.data.forEach(row => {\r\n row_string = row_string.concat(\"[\");\r\n row.forEach(col => {\r\n row_string = row_string.concat(\" \" + col + \" \");\r\n });\r\n row_string = row_string.concat(\"]\\n\");\r\n });\r\n console.log(row_string);\r\n }\r\n }", "title": "" }, { "docid": "c1327cce88136c5ca89fd63d598669ce", "score": "0.6672071", "text": "print() {\n\t\tlet str = '\\n';\n\t\tthis._matrix.forEach((row) => {\n\t\t\tstr += '\\t';\n\t\t\trow.forEach((col) => {\n\t\t\t\tstr += `${col} `;\n\t\t\t});\n\t\t\tstr += '\\n';\n\t\t});\n\t\tconsole.log(str);\n\t\t\n\t}", "title": "" }, { "docid": "23f544c24b307b2399872d2540722f7f", "score": "0.6607964", "text": "show() {\n let x = -1; // to be sure (x + 1) * 2 will return 0 at the first iteration\n let row = \"\";\n let valuesLen = this.values.length;\n this.values.forEach((value, index) => {\n if(index% 2 !== 0 || index === 0) row += \"[\"\n row += `${value} `;\n if(index% 2 === 0) row += \"]\"\n // ensure that index is part of the serie: 0, 2, 6, 14, 30... 2(x(t-1) + 1)\n // to print a tree row in new line\n if(index === ((x + 1) * 2) || index === valuesLen - 1){\n if(index % 2 !== 0) row += \"]\"; // if bottom row length is not even\n let lastRowLen = row.length;\n console.log(\n this.gettingSpacesToShow(valuesLen, lastRowLen) + row)\n x = index;\n row = \"\";\n }\n })\n }", "title": "" }, { "docid": "73a07c553897474c0cbf2cd6ace89f74", "score": "0.6544919", "text": "print () {\n const row = 'X'.repeat(this.width);\n let col;\n for (col = 0; col < this.height; col++) {\n console.log(row);\n }\n }", "title": "" }, { "docid": "26039946f348325dfa75f6a2b1d6f6c3", "score": "0.6518523", "text": "function displayGrid () {\n for (var i = 0; i<spacedString.length; i+=9) {\n if (i%27 === 0) {\n console.log(\"+---------+---------+---------+\");\n }\n \n console.log(\"| \" + spacedString[i] + \" \" + spacedString[i+1] + \" \" + spacedString[i+2] + \" | \"\n + spacedString[i+3] + \" \" + spacedString[i+4] + \" \" + spacedString[i+5] + \" | \"\n + spacedString[i+6] + \" \" + spacedString[i+7] + \" \" + spacedString[i+8] + \" |\")\n }\n console.log(\"+---------+---------+---------+\")\n}", "title": "" }, { "docid": "54c76a959f5fbff4ab1a9cd78abd7d63", "score": "0.6445405", "text": "printGrid() {\n let row = 0\n let col = 0\n let str = \"\"\n\n console.log(\"Printing Grid...\")\n\n for (row; row <= 2; row++) {\n str = \"\"\n for (col; col <=2; col++) {\n \n }\n }\n }", "title": "" }, { "docid": "4ce2c09db0a6136884b84345e8949c08", "score": "0.6436652", "text": "function printGrid(grid)\n{\n process.stdout.write('\\n');\n\n for(row = 0; row < grid.length; row++)\n {\n for(col = 0; col < grid[row].length; col++)\n {\n process.stdout.write(grid[row][col] ? 'O' : '-');\n }\n process.stdout.write('\\n');\n }\n}", "title": "" }, { "docid": "7954e68f6bf0ea80e2fe6a0298c059c6", "score": "0.6372399", "text": "function mostrarSeries(){\n document.write(\"<br>\");\n for (let posicion = 0; posicion < series.legth; posicion++) {\n document.write(\"<br>serie: \" + series[posicion]);\n }\n \n}", "title": "" }, { "docid": "fb82b529ab705360d464421fa4f5642f", "score": "0.6345468", "text": "function printGrid() {\n for (var i = 0; i < config.get(\"ROWS\"); i++) {\n var temp = \"| \";\n for (var j = 0; j < config.get(\"COLS\"); j++) {\n temp += grid[i][j] + \" | \";\n }\n console.log(temp);\n }\n}", "title": "" }, { "docid": "045942a3172315ad21c4f1cdfb2ec735", "score": "0.6318028", "text": "function visualizacionMatriz() {\n for (var i = 0; i < filas; i++) {\n for (var j = 0; j < columnas; j++) {\n document.write(escenario[j][i]);\n }\n document.write(\"<br>\");\n }\n}", "title": "" }, { "docid": "a7466b8efc7e6a3c4bb572120c2175a2", "score": "0.625227", "text": "function printGrid() {\r\n\tfor (let i = 0; i < grid.length; i++) {\r\n\t\tconsole.log(grid[i].join(\" \"))\r\n\t}\r\n\tgridLayout(\"_\")\r\n}", "title": "" }, { "docid": "9756f4db8bd5ae92631962b3f9838029", "score": "0.61525667", "text": "function show2DArray() {\n\n // taking an empty string to print the column array for each row.\n var str = \"\";\n\n // loop running to print values for each row\n for (var i = 0; i < arr.length; i++) {\n\n // loop running to print value of each column \n for (var j = 0; j < arr[i].length; j++) {\n\n // concatenating the string with each value of the column\n str = str + arr[i][j] + \", \";\n }\n\n // printing the value of the string and initializing it again to empty string\n console.log(\"{ \" + str + \"}\");\n str = \"\";\n }\n\n // exiting the process & terminating the program\n process.exit();\n}", "title": "" }, { "docid": "c2cb934b4508a819e27ed85635c034f7", "score": "0.61318123", "text": "show() {\n for(let i = 0; i < 8; i++){\n for(let j = 0; j < 8; j++){\n this.showCell(this.createVector(i, j));\n }\n }\n }", "title": "" }, { "docid": "bb5b023d752bb16e054f8297ad2c91d4", "score": "0.60371476", "text": "print() {\r\n let simulationArea = this.area;\r\n for (let row of simulationArea) {\r\n console.log(row);\r\n }\r\n console.log('');\r\n console.log('---------------------------------------------------');\r\n console.log('');\r\n }", "title": "" }, { "docid": "abbc088416146cf431078c25bc9da078", "score": "0.6024346", "text": "showField () {\n this.data.forEach(function (row, y) {\n var rowToLog = '';\n row.forEach(function (cell, x) {\n rowToLog += cell + ' '\n });\n rowToLog += '\\n';\n console.log(rowToLog);\n })\n }", "title": "" }, { "docid": "74b052c8df589d3fa317f32fc485b9c7", "score": "0.59806764", "text": "print () {\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j < this.width; j++) {\n process.stdout.write('X');\n }\n process.stdout.write('\\n');\n }\n }", "title": "" }, { "docid": "378b9fbf17407e2feaad8266308c0b17", "score": "0.5972445", "text": "function printMatrix(m) {\n for (var r = 0; r < dim_max; r++) {\n for (var c = 0; c < dim_max; c++) {\n $(\"#div\").append(m[r][c] + \", \");\n }\n $(\"#div\").append(\"<br />\");\n }\n $(\"#div\").append(\"<br />\");\n}", "title": "" }, { "docid": "4da4bb47d5a4763874c9e95cd2170124", "score": "0.5962498", "text": "function displayMatrix($mat) \n{ \n for ($i = 0; $i < $N; $i++) \n { \n for ($j = 0; $j < $N; $j++) \n console.log ( $mat[$i][$j] + \" \"); \n \n console.log (\"\\n\"); \n } \n console.log (\"\\n\"); \n}", "title": "" }, { "docid": "bfcff00d248f0027a20c2ef28df7f2fb", "score": "0.59555686", "text": "function horizontalChart() {\r\n var row = '';\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var j = 0; j < arguments[i]; j++) {\r\n row += '*';\r\n }\r\n row += '\\n'\r\n }\r\n return row;\r\n}", "title": "" }, { "docid": "cb8f47b74708cb39cc44bcf35be2a609", "score": "0.5948856", "text": "print() {\n\n let output = \"\";\n\n let current_row = 0;\n\n this.for_each(function (elem, x, y) {\n\n if (y > current_row) output += \"\\n\";\n\n output += \" | \" + String(elem) + \" | \";\n\n current_row = y;\n\n });\n\n console.log(output);\n\n }", "title": "" }, { "docid": "eff0d2fc3e1460db2e644c1d6df260c7", "score": "0.5942726", "text": "function print() {\n let str = '';\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n str += getJewel(x, y) + ' ';\n }\n str += '\\r\\n';\n }\n console.log(str);\n }", "title": "" }, { "docid": "62a1e8ca20c3bbf633f702a31ce02d1f", "score": "0.5927187", "text": "function grid() {\r\n console.log(board.join('\\n'));\r\n}", "title": "" }, { "docid": "44fdf1135b827adc7d2ee512f850a45c", "score": "0.59056467", "text": "function printingArray(niz) {\n for (let i = 0; i < niz.length; i++) {\n console.log(`Row ${i}`);\n\n for (let y = 0; y < niz[i].length; y++) {\n console.log(niz[i][y]);\n }\n }\n}", "title": "" }, { "docid": "83d35f00f62f6fd85d7d33f2c8bec122", "score": "0.5898146", "text": "function print(){\nvar gridprint = \"\";\n\tfor (var y = 0; y < 9; y++) { \n\t\tfor (var x = 0; x < 15; x++) {\n\t\t\tif(x != 0 && x != 14 && y != 0 && y!=8)gridprint += '\"'+grid[y][x]+'\"'+\",\";\n\t\t}\n\t\tgridprint+= \"<br/>\";\n\t}\n\tgetEl(\"gridlabel\").innerHTML = gridprint;\n}", "title": "" }, { "docid": "a90c8da11076dd175eb406417782f5c2", "score": "0.588668", "text": "printConsole() {\n for (let layer = 0; layer < this.nodes.length; layer++) {\n for (let node = 0; node < this.nodes[layer].length; node++)\n this.nodes[layer][node].printConsole();\n }\n }", "title": "" }, { "docid": "3f20ee603dbf62b8f807ea42dc7e26d9", "score": "0.58863246", "text": "print () {\n for (let h = 0; h < this.height; h++) {\n console.log('X'.repeat(this.width));\n }\n }", "title": "" }, { "docid": "599ee4e686e0a1f4036737c86e31eff4", "score": "0.5844796", "text": "function printscreen(screen) {\r\n process.stdout.write(' ');\r\n for (var j = 0; j < xMax; j++) {\r\n process.stdout.write(util.format(\"%d \", j));\r\n }\r\n process.stdout.write('\\n');\r\n for (var i = 0; i < yMax; i++) {\r\n process.stdout.write(util.format(\"%d: \", i));\r\n for (var j = 0; j < xMax; j++) {\r\n process.stdout.write(util.format(\"%s \", screen[i][j]));\r\n }\r\n process.stdout.write(\"\\n\");\r\n }\r\n}", "title": "" }, { "docid": "17b202c29a58710aaa3bccab4cc41cfc", "score": "0.5808812", "text": "renderBoardRows() {\n var row = [];\n // Use j to control the row number\n for (var j=0;j<20;j++) {\n // Use i to control the index in each row\n for (var i=0;i<20;i++) {\n //console.log(j*10+i);\n row.push(this.renderSquare(j*20+i));\n }\n row.push(<br/>);\n }\n return row;\n }", "title": "" }, { "docid": "cf4aa049bad3b7454fa3601446d6d739", "score": "0.58087456", "text": "function printBoard() {\n var row;\n for (var i = boardHeight - 1; i >= 0; i--) {\n row = \"\";\n for (var j = 0; j < boardWidth; j++) {\n row += boardMatrix[j][i] + \" \";\n }\n console.log(row);\n logger.write(\"\\n\" + row);\n\n }\n console.log(\"-----------------\");\n logger.write(\"\\n-----------------\");\n}", "title": "" }, { "docid": "f9fbec82a7ecb7a0fcf4cd05bbbea8b3", "score": "0.57872784", "text": "printPosition() {\n\t\tfor (let row = 0; row < 8; row += 1) {\n\t\t\tconst rowArray = [];\n\t\t\tfor (let col = 0; col < 8; col += 1) {\n\t\t\t\tconst piece = this.tiles[row][col];\n\t\t\t\tif (piece !== null) {\n\t\t\t\t\trowArray.push(piece.color + piece.name);\n\t\t\t\t} else {\n\t\t\t\t\trowArray.push('...');\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log(rowArray);\n\t\t}\n\t}", "title": "" }, { "docid": "5be4aa6ddc804e1d43925aa75317893e", "score": "0.57826865", "text": "function printboard(board) {\n\tvar height = board.length;\n\tvar width = board[0].length;\n\tfor(var i = 0; i < height; i++) {\n\t\tvar line = \"\";\n\t\tfor(var j = 0; j < width; j++) {\n\t\t\tline += board[i][j];\n\t\t}\n\t\tconsole.log(line);\n\t}\n}", "title": "" }, { "docid": "a61f6857f390c5a80f7d466e582fc691", "score": "0.57822216", "text": "function dispArr(arr) {\n for (var i = 0; i < arr.length; ++i) {\n process.stdout.write(arr[i] + \" \");\n if (i % 10 == 9) {\n process.stdout.write(\"\\n\");\n }\n }\n\n if (i % 10 != 0) {\n process.stdout.write(\"\\n\");\n }\n}", "title": "" }, { "docid": "8f0be56c31637c8fe626cce32352c3be", "score": "0.57798344", "text": "function PrintGrid(grid) {\n\n\n //document.write(\"<div class='row'>\");\n\n for (var i = 0; i < grid.length; i++) {\n\n document.write(\"<div style=''>\");\n\n for (var j = 0; j < grid[i].length; j++) {\n\n var v1 = grid[i][j][0] + \"\";\n var v2 = grid[i][j][1] + \"\";\n\n if (v1.length == 1) {\n v1 = \"0\" + v1;\n }\n\n if (v2.length == 1) {\n v2 = \"0\" + v2;\n }\n\n\n var divid = grid[i][j][0] + \"\" + grid[i][j][1];\n //alert(divid);\n document.write(\"<div id = \" + divid + \" style='border:solid; border-color:black; display:inline'>\");\n document.write(\"[\" + v1 + \",\" + v2 + \"]\");\n document.write(\"</div>\");\n\n }\n\n document.write(\"</div>\");\n }\n\n //document.write(\"</div>\");\n\n}", "title": "" }, { "docid": "e1deaf502880e64976f55f44087a73f4", "score": "0.577607", "text": "display() {\n for (let i = 0; i < this.columns; i++) {\n for (let j = 0; j < this.rows; j++) {\n this.board[i][j].display();\n }\n }\n }", "title": "" }, { "docid": "fd5d21d1793d28b4113ebdaf0d9da06f", "score": "0.5772333", "text": "function printbox(width, height) {\n var endRow = \"*\".repeat(width);\n var innerRow = \"*\" + \" \".repeat(width - 2) + \"*\";\n\n for(var i=0; i < height; i++) {\n if(i === 0 || i === (height-1)) {\n console.log(endRow);\n }\n else {\n console.log(innerRow);\n }\n }\n }", "title": "" }, { "docid": "959aeeb2026ecf59286403885e8940de", "score": "0.57518464", "text": "print () {\n if (this.width && this.height) {\n for (let i = 0; i < this.height; i++) {\n console.log('X'.repeat(this.width));\n }\n }\n }", "title": "" }, { "docid": "d2d053564b242f5e2aca2145c6693c92", "score": "0.57452154", "text": "function displayGrid(grid){\n for(i=0;i<grid.length;i++){\n let gridRow = grid[i].join(\"\");\n console.log(gridRow);\n }\n}", "title": "" }, { "docid": "a7f0563af806f4fa2ffae5552f3ee42b", "score": "0.5737634", "text": "function printBoard() {\n var i;\n var boardSideLength = board.length;\n\n if (config.printBoard) {\n for (i = 0; i < boardSideLength; i += 1) {\n console.info(board[i].join(' '));\n }\n }\n}", "title": "" }, { "docid": "8c60e3da2178509b7020248174a18d1e", "score": "0.57256335", "text": "function printSquare(size) {\n\n\n var row = \"\";\n for (var i = 0; i < size; i++) {\n row += \"*\";\n }\n for(var j = 0; j < size; j++){\n console.log(row);\n }\n }", "title": "" }, { "docid": "228e82b0a46c54a40088a83a2587346b", "score": "0.57232046", "text": "function printTheShape(number, rows) {\n let line = ''\n for (j = 1; j <= rows; j++) {\n let i = 0\n n = number\n while (i < j) {\n line = line + String(n++)\n i++\n }\n line += `\\n`\n }\n return line\n}", "title": "" }, { "docid": "0f8d174f33dffe7c1a5c4fe8d9e7a729", "score": "0.5722508", "text": "function mostrarTableroConsola(){\r\n for(var f = 0 ; f < MAX_FILAS ; f++){\r\n for(var c = 0 ; c < MAX_COLUMNAS ; c++){\r\n console.log(\"[\" + (matriz[f][c]) +\"] \");\r\n }\r\n console.log(\"\\n\");\r\n }\r\n}", "title": "" }, { "docid": "38bb13e66f36b15174158b3197199f36", "score": "0.5700163", "text": "print() {\n let result = \"\";\n for (let i = 0; i < this.field2D.length; i++) {\n result += this.field2D[i].join(\" \");\n result += \"\\n\"; // next line\n }\n console.log(result);\n }", "title": "" }, { "docid": "7ffc1eda2bd100237cf9765c97977e04", "score": "0.56996554", "text": "function printBoard() {\n board.forEach(function (row) {\n var rowOutput = '|';\n\n row.forEach(function (columnValue) {\n if (!columnValue) {\n rowOutput += ' ';\n } else {\n rowOutput += columnValue;\n }\n\n rowOutput += '|';\n });\n console.log(rowOutput);\n });\n}", "title": "" }, { "docid": "edf789ea78b45ecdf2bae7e1e36208da", "score": "0.5645459", "text": "printBoard() {\r\n console.log(\"Score : \" + this.score + \"\\n\");\r\n for (let i = 0; i < this.gridSize; i++) {\r\n console.log(this.board[i].toString().replace(/,/g, \" \") + \"\\n\");\r\n }\r\n }", "title": "" }, { "docid": "fb134106d80e9c5d75fc67a07ca92e8a", "score": "0.5609485", "text": "inspect() {\n var matrix_rows = [];\n var n = this.elements.length,\n k = n,\n i;\n do {\n i = k - n;\n matrix_rows.push(new Vector(this.elements[i]).inspect());\n } while (--n);\n return matrix_rows.join(\"\\n\");\n }", "title": "" }, { "docid": "7dc849e53c5ffae2d2d333a51b2df1a4", "score": "0.5591971", "text": "print() {\n const displayString = this._field.map(row => row.join('')).join('\\n');\n console.log(displayString);\n }", "title": "" }, { "docid": "fd2bb68a52ceec66e854e98a3f161b73", "score": "0.5575942", "text": "displayBoard() {\n let visualBoard = \"```\";\n for (let i = 0; i < this.board.length; i++) {\n // add a pipe at every first line\n if (i % 3 === 0) {\n visualBoard += \"|\";\n }\n\n visualBoard += ` ${this.board[i]} |`;\n\n // add a line break at every end of line\n if (i % 3 === 2) {\n visualBoard += `\\n|---+---+---|\\n`;\n }\n }\n\n return visualBoard + \"```\";\n }", "title": "" }, { "docid": "b662fb00430c9189021ea199172f3d65", "score": "0.55694866", "text": "function drawConsoleBox(w, h) {\n\n for (let i = 0; i < 1; i++) {\n console.log(\"+\" + \"-\".repeat(w) + \"+\");\n }\n for (let j = 0; j < h; j++) {\n console.log(\"|\" + \" \".repeat(w) + \"|\");\n }\n for (let i = 0; i < 1; i++) {\n console.log(\"+\" + \"-\".repeat(w) + \"+\");\n }\n}", "title": "" }, { "docid": "e62c750db6c5f5a09060c6f1cb431fc4", "score": "0.5566445", "text": "printBoard() {\r\n let print = \"\";\r\n for (let x = 0; x < this.boardSize; ++x) {\r\n for (let y = 0; y < this.boardSize; ++y) {\r\n print += this.board[y][x] + \" \";\r\n }\r\n console.log(print);\r\n print = \"\";\r\n }\r\n }", "title": "" }, { "docid": "38b264d636f78c359e5bc293ac7e6c70", "score": "0.5538084", "text": "function displayBoard(board) {\n var buffer = '';\n for (var i = 0; i < 1; i++) {\n for (var x = 0; x < board[i].length; x++) {\n buffer += board[i][x];\n buffer += ','\n }\n buffer += '\\n \\n';\n }\n console.log(buffer);\n}", "title": "" }, { "docid": "b6808e00e170e012234d17d6731e1e87", "score": "0.553769", "text": "function printBox(width, height) {\n for (var row = 1; row <= height; row++) {\n var rowString = \"\";\n for (var column = 1; column <= width; column++) {\n if (row == 1 || row == height) {\n rowString += \"*\";\n } else {\n if (column == 1 || column == width) {\n rowString += \"*\";\n } else {\n rowString += \" \";\n }\n }\n }\n console.log(rowString);\n }\n}", "title": "" }, { "docid": "61200b17c6b0f259327f88292d1c9f61", "score": "0.5536859", "text": "function printBox(width, height) {\n\tlet s = \"\", spaces = \"\", count = 0;\n\tfor (let row = 0; row < height; row++) {\n\t\tif ((row == 0) || (row == height - 1)) {\n\t\t\tfor (let column = 0; column < width; column++) {\n\t\t\t\ts += \"*\";\n\t\t\t}\n\t\t\tconsole.log(count + \": \" + s);\n\t\t\ts = \"\";\n\t\t} else {\n\t\t\ts = \"*\";\n\t\t\tfor (let column = 1; column < width - 1; column++) {\n\t\t\t\tspaces += \" \";\n\t\t\t}\n\t\t\ts += spaces + \"*\";\n\t\t\tconsole.log(count + \": \" + s);\n\t\t\ts = \"\", spaces = \"\";\n\t\t}\n\tcount++;\n\t}\n}", "title": "" }, { "docid": "f0f3fbf254021d1da1da4679c4bd6f05", "score": "0.5528074", "text": "function printBoard(board) {\n function printRow(element, index, array) {\n console.log(element.join(''));\n }\n board.forEach(printRow);\n}", "title": "" }, { "docid": "e8c2bc159735352f7362b0e9301141cb", "score": "0.5512838", "text": "function dispArr(arr) {\r\n\tvar retstr = \"\";\r\n\tfor (var i = 0; i < arr.length; ++i) {\r\n\t\tretstr += arr[i] + \" \";\r\n\t\tif (i % 10 == 9) {\r\n\t\t\tretstr += \"\\n\";\r\n\t\t}\r\n\t}\r\n\tif(i % 10 != 0)retstr += \"\\n\";\r\n\tconsole.log(retstr);\r\n}", "title": "" }, { "docid": "bbd8b23030f15af8b008f75a50d869f3", "score": "0.55117685", "text": "function printBoard(board){\n // create string to store output\n var output ='';\n console.log(board);\n // Loop through each row\n for (row = 0; row < 3; row++){\n // Loop through each space\n for (space = 0; space < 3; space++){\n // Print X, O, or space\n console.log(row*3 + space]);\n // Print a | between\n if (space < 2) output += '|';\n }\n // Print a newline at the end\n output += '\\n';\n // Print a horizontal line between\n if (row < 2) output += '-----\\n';\n }\n return output;\n}", "title": "" }, { "docid": "1ffeeb6964106ac0f358098f79878589", "score": "0.55103505", "text": "pprint(){\n return [...(new Array(this.nrow))].map(\n (_,i) => [...(new Array(this.ncol))].map(\n (_,j) => this.get(i,j) ))\n }", "title": "" }, { "docid": "5cc9d7396c112f4fb8958f1ea3065609", "score": "0.5498403", "text": "function prettyPrint(datagrid) {\n var consoleOutput = \"<pre>\", copy = datagrid.split(\"\\r\\n\");\n for (let i = 0; i < copy.length; i++) {\n for (let j = 0; j < copy[i].length; j++) {\n consoleOutput += `<span style=\"color:${copy[i][j] === \"0\" ? \"black\" : \"white\"};`\n consoleOutput += `background-color:${copy[i][j] === \"0\" ? \"black\" : \"white\"}\">xx</span>`;\n }\n consoleOutput += \"<br />\";\n }\n consoleOutput += \"</pre>\";\n console.log(consoleOutput);\n return datagrid;\n }", "title": "" }, { "docid": "8249ce7211c66aa15a1a2dcb1f331711", "score": "0.5474145", "text": "printBoard(){\n\t\tprocess.stdout.write(' ');\n\t\tfor(let h=1; h <= this.width; ++h)\n\t\t\tprocess.stdout.write(h + ' ');\n\t\tprocess.stdout.write('\\n');\n\t\tfor(let i=0; i<this.height; ++i){\n\t\t\tlet j = i+1;\n\t\t\tprocess.stdout.write(j + ' ');\n\t\t\tfor(let j=0; j<this.width; ++j){\n\t\t\t\tif(this.board[i][j] == -1){\n\t\t\t\t\tprocess.stdout.write('- ')\n\t\t\t\t} else {\n\t\t\t\t\tprocess.stdout.write(this.board[i][j] + \" \")\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsole.log();\n\t\t\tconsole.log('\\n');\n\t\t}\n\t}", "title": "" }, { "docid": "28dfd85010b299a4410607f4a5303378", "score": "0.5459051", "text": "function multiTable() {\n var rez = 1;\n for (var i = 1; i <= 12; i++) {\n for (var j = 1; j <= 10; j++) {\n rez = i * j;\n console.log(i, 'x', j, '=', rez, '\\n');\n }\n }\n\n}", "title": "" }, { "docid": "0726455446801ce92229b60ca43f14ff", "score": "0.5456433", "text": "function horizontalChart() {\n var result = '';\n var numOfArgs = arguments.length;\n\n for (var i = 0; i < numOfArgs; i++) {\n for (var j = 0; j < arguments[i]; j++) {\n result += '*'\n }\n result += '\\n';\n }\n return result;\n}", "title": "" }, { "docid": "707a6928bfda915d6f1e36993b3227bb", "score": "0.5456367", "text": "function mostrarSeriesNetflix() {\n //recorrer a cada elemento de un arreglo.\n document.write(\"<br><h3>Arreglo de series</h3>\");\n for (let posicion = 0; posicion < series.length; posicion++) {\n document.write(\"<br>serie: \" + series[posicion]);\n }\n}", "title": "" }, { "docid": "f7c7d61cad3090e4b31ba1dd08bd1518", "score": "0.5451187", "text": "function printDims(){\n var ret = [];\n dataDims.forEach(function(e,i,a){\n ret.push( {'name' : e, 'value' : i} );\n });\n return ret;\n }", "title": "" }, { "docid": "f051a8a5e24d90cf3ea35e5cf4b181bd", "score": "0.5448666", "text": "PrintEdgeMatrix() {\n let mtrx = \"\";\n for (let y = 0; y < this._edges.length; y++) {\n for (let x = 0; x < this._edges[y].length; x++) {\n mtrx += this._edges[y][x] + \" \";\n }\n mtrx += '\\n';\n }\n console.log(mtrx);\n }", "title": "" }, { "docid": "4683df3c074242a6c3c4148d7a4d26ad", "score": "0.54389316", "text": "function steps(n){\r\n console.log('steps'+'('+n+')');\r\n //for the row\r\n for(i=0;i<n;i++){\r\n var str='';\r\n for(j=0;j<n;j++){\r\n if(j<=i){\r\n str = str + '#';\r\n }\r\n else{\r\n str = str + ' ';\r\n \r\n }\r\n \r\n }\r\n console.log(str);\r\n \r\n }\r\n}", "title": "" }, { "docid": "90b163c08599c5f946b794315f0303c4", "score": "0.5434766", "text": "print() {\n console.log(this._playerBoard.map(row => row.join(' | ')).join('\\n'));\n }", "title": "" }, { "docid": "da23e827b7b2f196740d6003037fa964", "score": "0.5415233", "text": "function displayArray(arr, horizontally, message)\n{\n\t// Display horizontally, convert array into a string\n\tif (horizontally)\n\t{\n\t\tconsole.log(message + arr.toString());\n\t}\n\n\t// Display vertically, line by line\n\telse\n\t{\n\t\tfor (var index = 0; index < arr.length; index += 1)\n\t\t{\n\t\t\tconsole.log(arr[index]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0514373b2ea40a8b0810d99857c0a61c", "score": "0.5410977", "text": "function squerPrint(side) {\n for (var outerIndex = 1; outerIndex <= side; outerIndex++) {\n for (var innerIndex = 1; innerIndex <= side; innerIndex++) {\n document.write(innerIndex + \" \");\n }\n document.write(\"<br/>\");\n }\n}", "title": "" }, { "docid": "f8bfd6320f049f6d4f673d06ffbd96a8", "score": "0.54104704", "text": "function consoleTable(results) {\n\tvar values = [];\n\tfor (var i = 0; i < results.length; i++) {\n\t\tvar resultObject = {\n\t\t\tID: results[i].item_id,\n\t\t\tItem: results[i].product_name,\n\t\t\tPrice: \"$\" + results[i].price,\n\t\t\tQuantity: results[i].stock_quantity\n\t\t};\n\t\tvalues.push(resultObject);\n\t}\n\tconsole.table(\"/nItems for Sale\", values);\n\twelcome();\n}", "title": "" }, { "docid": "a13d67faf961998982c84c00054708bf", "score": "0.53991824", "text": "function printBoard(boar) {\n let str = \"[\";\n\n for (let i = 0; i < rowCount - 1; i++) {\n str = str + \"[\" + boar[i].toString() + \"]\" + \",\" + \"\\n \"\n }\n str = str + \"[\" + boar[rowCount - 1].toString() + \"]\" + \"]\"\n\n print(str);\n}", "title": "" }, { "docid": "b1c0ac6639a8af83716d76c04865a366", "score": "0.5398913", "text": "print() {\n var output = \"\"\n this._rangeList.forEach(range => {\n output += '[' + range[0] + ', ' + range[1] + ') '\n });\n console.log(output)\n }", "title": "" }, { "docid": "5bcb7bc39d6a7a499da9d88086b834c5", "score": "0.5396171", "text": "function pyramid(n) {\n printRows(n, 0);\n}", "title": "" }, { "docid": "797717c532ce92f21140c72ecfa59705", "score": "0.5386879", "text": "print () {\n\n var that = this;\n\n console.log(this.__getRowHeader());\n this.board.forEach(function (row, index, board) {\n console.log(that.__getRowString(index));\n })\n }", "title": "" }, { "docid": "eb1e0c168d858c2a9e9cb690df9e2c1a", "score": "0.5375157", "text": "print () {\n let fragment = document.createDocumentFragment()\n\n let row\n let col\n\n for (let i = 0; i < this.y; i++) {\n row = document.createElement('div')\n row.classList.add('row')\n\n for (let x = 0; x < this.x; x++) {\n col = document.createElement('div')\n col.classList.add('card-' + i + x, 'card')\n\n row.appendChild(col)\n }\n\n fragment.appendChild(row)\n }\n this.element.appendChild(fragment)\n }", "title": "" }, { "docid": "6fe97bc2717550fea386c7e543918f47", "score": "0.53662384", "text": "function displaySep() {\n console.log(\"\\n\" + \"-\".repeat(80));\n}", "title": "" }, { "docid": "e84bb4252cc8fd608b57774b69dbc73c", "score": "0.53640753", "text": "function gridPrettyPrint (grid) {\n for ( var i = 0; i < grid.nodes.length; i++ ) {\n var text = \"\";\n for ( var j = 0; j < grid.nodes[i].length; j++ ) {\n text = grid.nodes[i][j].distance !== undefined ? text + grid.nodes[i][j].distance + \"\\t\" : text + \"###\" + \"\\t\";\n }\n console.log(text);\n }\n}", "title": "" }, { "docid": "d6ff7fab8cac4dd73fc724a1e8b254a9", "score": "0.5363084", "text": "function displayMat(m,colLab,rowLab,dp)\n\n{ startTable();\n\n if (colLab != null)\n\n { writeCell('');\n\n for(var j=0; j<colLab.length; j++) writeCell(colLab[j]);\n\n newRow();\n\n }\n\n if (dp == null) dp = 3;\n\n for(var i=0; i<m.length; i++)\n\n { if(rowLab != null) writeCell(rowLab[i]);\n\n for(var j=0; j<m[i].length; j++)\n\n { writeCell(m[i][j].toFixed(dp));\n\n }\n\n newRow();\n\n }\n\n endTable();\n\n}", "title": "" }, { "docid": "95b3d578435894e68d8bb41101e6be6e", "score": "0.5361342", "text": "function display_array()\n{\n var e = \"<hr/>\"; \n \n for (var y=1; y<array.length; y++)\n {\n e += \"Guest \" + y + \": \" + array[y] + \"<br/>\";\n }\n document.getElementById(\"Result\").innerHTML = e;\n}", "title": "" }, { "docid": "24086a5da053cb25cdaa53c28ffde652", "score": "0.53600216", "text": "function printBox(n, m) {\n var length = n;\n var width = m;\n for (i = 0; i < length; i++) {\n for (j = 0; j < width; j++) {\n } if (i == 0 || i == length || j == 0 || j == width) {\n console.log(\"*\".repeat(j));\n } else {\n console.log(\" \");\n }\n //console.log(\"*\".repeat(j));\n }\n}", "title": "" }, { "docid": "bfc5d4e5d08d858781e7218de4339ae7", "score": "0.5354989", "text": "function printBox(width, height) {\n // print the top row\n var rowOfStars = \"*\".repeat(width);\n var middleRow = \"*\" + \" \".repeat(width - 2) + \"*\\n\";\n var allTheMiddle = middleRow.repeat(height - 2);\n var theWholeBox = rowOfStars + '\\n' + allTheMiddle + rowOfStars;\n\n console.log(theWholeBox);\n}", "title": "" }, { "docid": "d57512806cbe677a30016eb8a55acc06", "score": "0.535072", "text": "dump() {\n console.table({\n 'center': this.center,\n 'range': this.range,\n 'bailout': this.bailout\n });\n }", "title": "" }, { "docid": "ef48674650b20a7e77ee8c9a1e0ac1a2", "score": "0.53463924", "text": "function printSquare(num) {\n let row = 1;\n while (row <= num) {\n console.log('*'.repeat(num));\n row++;\n }\n}", "title": "" }, { "docid": "a31877a88db760f9ee911a68aa32d354", "score": "0.5319942", "text": "printNodes() {\n for (let layer = 0; layer < this.nodes.length; layer++) {\n for (let node = 0; node < this.nodes[layer].length; node++) {\n document.writeln(this.nodes[layer][node].number + \" | \");\n }\n document.writeln(\"</br>\");\n }\n document.writeln(\n \"----------------------------------------------------------------</br>\"\n );\n }", "title": "" }, { "docid": "29a6abb9c1cfb44e2105f814cd3755f3", "score": "0.5316717", "text": "function printsArrayInFrame(array) {\n var rectangleWidth = array[0].length;\n var borderRow = '';\n var nthRow = '';\n\n for (var i = 1; i < array.length; i++) {\n if(array[i].length > rectangleWidth) {\n rectangleWidth = array[i].length;\n } \n }\n for ( var i = 0; i < rectangleWidth + 4; i++) {\n borderRow += '*';\n }\n for (var i = 0; i < array.length; i++) {\n var blank = ' ';\n for (var j = array[i].length; j < rectangleWidth; j++) {\n blank += ' ';\n }\n nthRow += '* ' + array[i] + blank + '*' + '\\n'\n }\n var arrayInFrame = borderRow + '\\n' + nthRow + borderRow;\n return arrayInFrame;\n}", "title": "" }, { "docid": "52aac08d74e839196160a453fb6e6744", "score": "0.5314797", "text": "function grid() {\n\n for (let j = 0; j < obj.numRows; j++) {\n for (let i = 0; i < obj.numCols; i++) {\n stroke(obj.gridLineColor, 50);\n strokeWeight(1);\n line(0, (rowHeight) * j, height, (rowHeight) * j); // draws the rows\n line((colWidth) * i, 0, (colWidth) * i, width); //draws the columns\n }\n }\n}", "title": "" }, { "docid": "66dad1151fe8c1250b02b83226266116", "score": "0.5301155", "text": "toString() {\n var widthOfGrid = this.grid.length;\n var output = '\\n #|';\n var border = '\\n --';\n var item;\n var i;\n var j;\n // var id;\n\n // Render the table header\n for (i = 0; i < widthOfGrid; i++) {\n output += ' ' + this._padNumber(i, ' ');\n border += '---';\n }\n output += border;\n\n // Render table contents row by row, as we go on the y axis\n for (i = 0; i < this._options.lanes; i++) {\n output += '\\n' + this._padNumber(i, ' ') + '|';\n for (j = 0; j < widthOfGrid; j++) {\n output += ' ';\n item = this.grid[j][i];\n // id = this.items.indexOf(item);\n // id = item.id;\n output += item ? this._padNumber(item.id, '0') : '--';\n }\n }\n output += '\\n';\n return output;\n }", "title": "" }, { "docid": "ce75a496284d02dd2cf11d8a0238f45a", "score": "0.5300056", "text": "function printMatrix(matrix)\n{\n for(let j = 0; j < matrix.length; ++j)\n {\n console.log(matrix[j]);\n }\n}", "title": "" }, { "docid": "0e9e6ca1436134689ab4bbeb0793cb9f", "score": "0.5296098", "text": "print() {\n \tvar text = \"\";\n \tvar range;\n for (range of this.ranges) {\n text += \"[\" + range[0] + \", \" + range[1] + \") \";\n }\n console.log(text);\n }", "title": "" }, { "docid": "d82695ac0f9a581776da92b01678caeb", "score": "0.5295159", "text": "function printArray(arr) {\n\tfor (let index = 0; index < arr.length; index++) {\n\t\tlet outputObject = '[' + (arr.length - index - 1) + ',' + JSON.stringify(arr[index]) + ']\\n';\n\t\tprocess.stdout.write(outputObject);\n\t}\n}", "title": "" }, { "docid": "fd61d43326c1e0b34c75d6c68118cb41", "score": "0.5280354", "text": "print() {\n var str = \"\";\n for (var i = 0; i < this.data.length; i++) {\n str += this.data[i] + \" \";\n }\n console.log(str);\n }", "title": "" }, { "docid": "b5cf4617db7212a7e5ec5dd2a159d882", "score": "0.52767366", "text": "function DisplayBoard() {\n console.clear ()\n console.log (\"Tic Tac Toe\")\n console.log (\"\")\n console.log(\"--- --- ---\")\n console.log(\" \" + BoardGame[0] + \" | \" + BoardGame[1] + \" | \" + BoardGame[2])\n console.log(\"--- --- ---\")\n console.log(\" \" + BoardGame[3] + \" | \" + BoardGame[4] + \" | \" + BoardGame[5])\n console.log(\"--- --- ---\")\n console.log(\" \" + BoardGame[6] + \" | \" + BoardGame[7] + \" | \" + BoardGame[8])\n console.log(\"--- --- ---\")\n console.log (\"\")\n}", "title": "" }, { "docid": "b140ef3a7c5a1878f948288cc3a9b495", "score": "0.5274964", "text": "function printMatrixFunctionally(matrixName) {\n matrixName.forEach(row => console.log(row.join(\"\")));\n }", "title": "" }, { "docid": "9d77bac8700a65f26da56797d38ba08b", "score": "0.5272631", "text": "function printTable(array) {\n\tfor (let i = 0; i < array.length; i++) {\n\t\tconsole.log(array[i]);\n\t}\n}", "title": "" }, { "docid": "8eebb36e3464e2d26b54bd328a2811d5", "score": "0.52702725", "text": "function multiplicationTable() {\n \n for(var i=1; i<=12; i++) {\n var arr1 = [];\n for(var j=1; j<=12; j++) {\n arr1 += j*i + ' ';\n }\n arr1 += '\\n';\n console.log(arr1);\n }\n}", "title": "" }, { "docid": "5a5986abcc5ac18df9ac903fd9035db6", "score": "0.5243416", "text": "function print() {\n let fkeys = [], fvalues = [], lkeys = [], lvalues = [];\n Object.entries(_features).forEach(entry => {\n const [key, value] = entry;\n fkeys.push(key);\n fvalues.push(value);\n });\n Object.entries(_labels).forEach(entry => {\n const [key, value] = entry;\n lkeys.push(key);\n lvalues.push(value);\n });\n let topSeparator = \"__________________________________________________\";\n let separator = \"==================================================\";\n let buf = \"\\n\" + topSeparator + \"\\nSuperalgos ML DataFrame:\\n\";\n let separator2 = \"||||||||||||||||||||||||||||||||||||||||||||||||||\";\n buf += separator;\n let fkLen = fkeys.length, fvLen = fvalues[0].length;\n let lkLen = lkeys.length;\n console.log(buf);\n\n // Features / Labels Hard Numbers:\n for (let i = 0; i < fvLen; i++) {\n buf = \"Sample[\" + i + \"]=>\\n\";\n for (let j = 0; j < fkLen; j++) {\n buf += \"\\t\" + fkeys[j] + \": [\" + fvalues[j][i].toFixed(5) + \"...]\\n\";\n }\n for (let k = 0; k < lkLen; k++) {\n buf += \"\\t\" + lkeys[k] + \": [\" + lvalues[k][i].toFixed(5) + \"...]\\n\";\n }\n buf += separator;\n if (i > 3 && fvLen > 9 && i < fvLen - 6) { // Fast-forward\n buf += \"\\n\\t\\t\" + \"...\" + \"\\n\\t\\t\" + \"...\" + \"\\n\\t\\t\" + \"...\\n\" + separator;\n i = fvLen - 6;\n }\n console.log(buf);\n }\n\n // Statistics:\n buf = separator2 + \"\\n\" + separator + \"\\n\\n\" + topSeparator + \"\\nSuperalgos ML DataFrame Statistics:\\n\" + separator;\n let statistics = stats.all();\n console.log(buf);\n\n for (let i = 0; i < fkLen; i++) {\n buf = fkeys[i] + \":\\n\\tCount:\\t[\" + statistics.count + \"]\\n\";\n buf += \"\\tMean:\\t[\" + statistics.mean.fMeans[i] + \"]\\n\";\n buf += \"\\tMedian:\\t[\" + statistics.minMaxMedRange.fMedian[i] + \"]\\n\";\n buf += \"\\tSTDev:\\t[\" + statistics.std.fStds[i] + \"]\\n\";\n buf += \"\\tVariance: [\" + statistics.variance.fVar[i] + \"]\\n\";\n buf += \"\\tMin: [\" + statistics.minMaxMedRange.fMin[i].toFixed(4) + \"...]\\n\" +\n \"\\tMax: [\" + statistics.minMaxMedRange.fMax[i].toFixed(4) + \"...]\\n\" +\n \"\\tRange: [\" + statistics.minMaxMedRange.fRange[i].toFixed(4) + \"...]\\n\";\n buf += topSeparator;\n console.log(buf);\n }\n\n for (let j = 0; j < lkLen; j++) {\n buf = lkeys[j] + \":\\n\\tCount:\\t[\" + statistics.count + \"]\\n\";\n buf += \"\\tMean:\\t[\" + statistics.mean.lMeans[j] + \"]\\n\";\n buf += \"\\tMedian:\\t[\" + statistics.minMaxMedRange.lMedian[j] + \"]\\n\";\n buf += \"\\tSTDev:\\t[\" + statistics.std.lStds[j] + \"]\\n\";\n buf += \"\\tVariance: [\" + statistics.variance.lVar[j] + \"]\\n\";\n buf += \"\\tMin: [\" + statistics.minMaxMedRange.lMin[j].toFixed(4) + \"...]\\n\" +\n \"\\tMax: [\" + statistics.minMaxMedRange.lMax[j].toFixed(4) + \"...]\\n\" +\n \"\\tRange: [\" + statistics.minMaxMedRange.lRange[j].toFixed(4) + \"...]\\n\";\n buf += topSeparator;\n console.log(buf);\n }\n console.log(separator + \"\\n\" + separator2 + \"\\n\" + separator);\n }", "title": "" }, { "docid": "457b53578a9dada968b6e21da943264c", "score": "0.5242784", "text": "function printArray(arr, size) {\n let i;\n for (i = 0; i < size; i++) document.write(arr[i] + \" \");\n document.write(\"\\n\");\n}", "title": "" }, { "docid": "e355f5faf2bdca35a54bdab9a1f930d9", "score": "0.52365255", "text": "rows() {\n return drawPyramid(this.height, this.symbol)\n }", "title": "" }, { "docid": "a42bd0a8ed7d904490acba0dfe2a12be", "score": "0.52292913", "text": "function draw_pyramid_console(pyramid,n){\n var pyramid_center = pyramid[(pyramid.length-1)/2];\n console.log(\"*** Pyramid build of\",n,\"blocks with center\",pyramid_center,\"blocks high***\");\n console.log(\"*** [\",pyramid.toString(),\"] =\",pyramid.reduce(function(a,b){return a+b;}),\"blocks ***\")\n for(var x = 0; x<= pyramid_center; x++){\n var string = '';\n pyramid.forEach(function(col){\n if(col > (pyramid_center - x)){\n string += '|=|';\n } else {\n string += ' ';\n }\n })\n console.log(string);\n }\n\n return true;\n}", "title": "" }, { "docid": "75d053f982fcc94a70e07222d74ce72d", "score": "0.52290666", "text": "function print_analysis_matrix(matrix){\r\n var circuit_out = \"\";\r\n var i = 0;\r\n var j = 0;\r\n var count = 1;\r\n for(i = 0; i < matrix.getSize().width; i++){\r\n for(j = 0; j < matrix.getSize().height; j++){\r\n if(count < 3){\r\n //alert(matrix.getValueAt(j,i));\r\n circuit_out = circuit_out + (matrix.getValueAt(j,i)).toFixed(5) + \", \";\r\n count++;\r\n }else{\r\n //matrix.getValueAt(j,i);\r\n circuit_out = circuit_out + (matrix.getValueAt(j,i)).toFixed(5) + \", \" + \"</BR>\";\r\n count = 1;\r\n }\r\n }\r\n }\r\n return circuit_out;\r\n}", "title": "" }, { "docid": "360872f230b9c291d6428b09ec7e2a69", "score": "0.522843", "text": "function showStars(rows){\n for(let row = 1; row <= rows; row++){\n let pattern = \"\";\n for(let i = 0; i < row; i ++){\n pattern += \"*\";\n }\n console.log(pattern);\n }\n}", "title": "" }, { "docid": "2cc83a4ccefa3d50727a3bb4cb17ade2", "score": "0.52256733", "text": "function displayGrid() {\n for (let x = 0; x < rows; x++) {\n for (let y = 0; y < cols; y++) {\n fill(255);\n strokeWeight(5);\n if (grid[x][y][2] === 0) {\n fill(102, 204, 255);\n }\n else if (grid[x][y][2] === 1) {\n fill(0, 255, 0);\n }\n rect(x * cellSize, y * cellSize, cellSize, cellSize);\n\n let textToDisplay = \"\";\n\n if (grid[x][y][1] === 1) {\n textToDisplay = displayElement(grid[x][y][0]);\n fill(0);\n textSize(30);\n text(textToDisplay, x * cellSize + (cellSize / 2), y * cellSize + (cellSize / 2) + 10);\n }\n }\n }\n}", "title": "" } ]
6eb4f3b0e392815ea99f6dc94cb53a3c
Renders nested values (eg. objects, arrays, lists, etc.)
[ { "docid": "57de316a09aeb27e8e423638aa2ec138", "score": "0.0", "text": "function renderChildNodes(props, from, to) {\n\t var nodeType = props.nodeType,\n\t data = props.data,\n\t collectionLimit = props.collectionLimit,\n\t circularCache = props.circularCache,\n\t keyPath = props.keyPath,\n\t postprocessValue = props.postprocessValue,\n\t sortObjectKeys = props.sortObjectKeys;\n\n\t var childNodes = [];\n\n\t (0, _getCollectionEntries2['default'])(nodeType, data, sortObjectKeys, collectionLimit, from, to).forEach(function (entry) {\n\t if (entry.to) {\n\t childNodes.push(_react2['default'].createElement(_ItemRange2['default'], (0, _extends3['default'])({}, props, {\n\t key: 'ItemRange--' + entry.from + '-' + entry.to,\n\t from: entry.from,\n\t to: entry.to,\n\t renderChildNodes: renderChildNodes\n\t })));\n\t } else {\n\t var key = entry.key,\n\t value = entry.value;\n\n\t var isCircular = circularCache.indexOf(value) !== -1;\n\n\t var node = _react2['default'].createElement(_JSONNode2['default'], (0, _extends3['default'])({}, props, { postprocessValue: postprocessValue, collectionLimit: collectionLimit }, {\n\t key: 'Node--' + key,\n\t keyPath: [key].concat(keyPath),\n\t value: postprocessValue(value),\n\t circularCache: [].concat(circularCache, [value]),\n\t isCircular: isCircular,\n\t hideRoot: false\n\t }));\n\n\t if (node !== false) {\n\t childNodes.push(node);\n\t }\n\t }\n\t });\n\n\t return childNodes;\n\t}", "title": "" } ]
[ { "docid": "99d5bd80e441c1ba8e13553d331596f9", "score": "0.60878783", "text": "function printComplexValue(\n val,\n config,\n indentation,\n depth,\n refs,\n hasCalledToJSON\n) {\n if (refs.indexOf(val) !== -1) {\n return '[Circular]';\n }\n\n refs = refs.slice();\n refs.push(val);\n const hitMaxDepth = ++depth > config.maxDepth;\n const min = config.min;\n\n if (\n config.callToJSON &&\n !hitMaxDepth &&\n val.toJSON &&\n typeof val.toJSON === 'function' &&\n !hasCalledToJSON\n ) {\n return printer(val.toJSON(), config, indentation, depth, refs, true);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object Arguments]') {\n return hitMaxDepth\n ? '[Arguments]'\n : (min ? '' : 'Arguments ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (isToStringedArrayType(toStringed)) {\n return hitMaxDepth\n ? '[' + val.constructor.name + ']'\n : (min ? '' : val.constructor.name + ' ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (toStringed === '[object Map]') {\n return hitMaxDepth\n ? '[Map]'\n : 'Map {' +\n (0, _collections.printIteratorEntries)(\n val.entries(),\n config,\n indentation,\n depth,\n refs,\n printer,\n ' => '\n ) +\n '}';\n }\n\n if (toStringed === '[object Set]') {\n return hitMaxDepth\n ? '[Set]'\n : 'Set {' +\n (0, _collections.printIteratorValues)(\n val.values(),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n } // Avoid failure to serialize global window object in jsdom test environment.\n // For example, not even relevant if window is prop of React element.\n\n return hitMaxDepth || isWindow(val)\n ? '[' + getConstructorName(val) + ']'\n : (min ? '' : getConstructorName(val) + ' ') +\n '{' +\n (0, _collections.printObjectProperties)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n}", "title": "" }, { "docid": "99d5bd80e441c1ba8e13553d331596f9", "score": "0.60878783", "text": "function printComplexValue(\n val,\n config,\n indentation,\n depth,\n refs,\n hasCalledToJSON\n) {\n if (refs.indexOf(val) !== -1) {\n return '[Circular]';\n }\n\n refs = refs.slice();\n refs.push(val);\n const hitMaxDepth = ++depth > config.maxDepth;\n const min = config.min;\n\n if (\n config.callToJSON &&\n !hitMaxDepth &&\n val.toJSON &&\n typeof val.toJSON === 'function' &&\n !hasCalledToJSON\n ) {\n return printer(val.toJSON(), config, indentation, depth, refs, true);\n }\n\n const toStringed = toString.call(val);\n\n if (toStringed === '[object Arguments]') {\n return hitMaxDepth\n ? '[Arguments]'\n : (min ? '' : 'Arguments ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (isToStringedArrayType(toStringed)) {\n return hitMaxDepth\n ? '[' + val.constructor.name + ']'\n : (min ? '' : val.constructor.name + ' ') +\n '[' +\n (0, _collections.printListItems)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n ']';\n }\n\n if (toStringed === '[object Map]') {\n return hitMaxDepth\n ? '[Map]'\n : 'Map {' +\n (0, _collections.printIteratorEntries)(\n val.entries(),\n config,\n indentation,\n depth,\n refs,\n printer,\n ' => '\n ) +\n '}';\n }\n\n if (toStringed === '[object Set]') {\n return hitMaxDepth\n ? '[Set]'\n : 'Set {' +\n (0, _collections.printIteratorValues)(\n val.values(),\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n } // Avoid failure to serialize global window object in jsdom test environment.\n // For example, not even relevant if window is prop of React element.\n\n return hitMaxDepth || isWindow(val)\n ? '[' + getConstructorName(val) + ']'\n : (min ? '' : getConstructorName(val) + ' ') +\n '{' +\n (0, _collections.printObjectProperties)(\n val,\n config,\n indentation,\n depth,\n refs,\n printer\n ) +\n '}';\n}", "title": "" }, { "docid": "b1933389ffde02f03a2e83befffdbdce", "score": "0.6064931", "text": "function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {\n if (refs.indexOf(val) !== -1) {\n return '[Circular]';\n }\n\n refs = refs.slice();\n refs.push(val);\n var hitMaxDepth = ++depth > config.maxDepth;\n var min = config.min;\n\n if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {\n return printer(val.toJSON(), config, indentation, depth, refs, true);\n }\n\n var toStringed = toString.call(val);\n\n if (toStringed === '[object Arguments]') {\n return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';\n }\n\n if (isToStringedArrayType(toStringed)) {\n return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + (0, _collections.printListItems)(val, config, indentation, depth, refs, printer) + ']';\n }\n\n if (toStringed === '[object Map]') {\n return hitMaxDepth ? '[Map]' : 'Map {' + (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';\n }\n\n if (toStringed === '[object Set]') {\n return hitMaxDepth ? '[Set]' : 'Set {' + (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) + '}';\n } // Avoid failure to serialize global window object in jsdom test environment.\n // For example, not even relevant if window is prop of React element.\n\n\n return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + (0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer) + '}';\n}", "title": "" }, { "docid": "137f4922cd0ac536bfacbf7327dcdaf1", "score": "0.59499276", "text": "function prerender(ids, list, value, name, seen) {\n if (seen.has(value)) {\n if (!this.jsonCyclicWarning) {\n console.warn('json-css: cyclic data structure detected, skipping some values');\n this.jsonCyclicWarning = true;\n }\n return;\n }\n var id = ids.length;\n if (value && typeof value == 'object') {\n seen.set(value, id);\n }\n ids.push(value);\n if (name === '' | name === null) {\n name = 'entry';\n }\n\t\tvar realName = name;\n\t\tif (!isSafeTagName(name)) {\n\t\t\tname = 'entry';\n\t\t}\n if ( Array.isArray(value) ) {\n list.push('<'+name+' name=\"'+htmlEntities(realName)+'\" index=\"'+id+'\">');\n for (var i=0, l=value.length; i<l; i++) {\n prerender.call(this, ids,list,value[i],''+i,seen);\n }\n list.push('</'+name+'>');\n\t\t} else if ( typeof value === 'object' && ( value instanceof String || value instanceof Number || value instanceof Boolean) ) {\n list.push('<'+name+' name=\"'+htmlEntities(realName)+'\" value=\"'+htmlEntities(value)+'\" index=\"'+id+'\"></'+name+'>');\n } else if ( typeof value === 'object') {\n if (!value) { // null\n list.push('<'+name+' name=\"'+htmlEntities(realName)+'\" value=\"\" index=\"'+id+'\"></'+name+'>');\n } else {\n list.push('<'+name+' name=\"'+htmlEntities(realName)+'\" index=\"'+id+'\">');\n for (var i in value) {\n prerender.call(this, ids,list, value[i], i, seen);\n }\n list.push('</'+name+'>');\n }\n } else { // string, int, boolean\n list.push('<'+name+' name=\"'+htmlEntities(realName)+'\" value=\"'+htmlEntities(value)+'\" index=\"'+id+'\"></'+name+'>');\n }\n }", "title": "" }, { "docid": "e1dcb4423ec76b6723cfebf90b8c6094", "score": "0.5882244", "text": "function formatValue(value, valueToHtml, maxDepth) {\n if (Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(value)) {\n return `[${value.map(v => valueToHtml(Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n if (Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(value)) {\n let content = '';\n const _a = value, { title } = _a, rest = __rest(_a, [\"title\"]);\n if (title) {\n content += `<h2>${valueToHtml(title)}</h2>`;\n }\n const keys = Object.keys(rest);\n if (keys.length > 0) {\n content += '<table>';\n for (const key of keys) {\n let val = rest[key];\n if (Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(val)) {\n val = stringify(val, maxDepth);\n }\n content += `<tr><td class=\"key\">${valueToHtml(key)}:</td><td class=\"value\">${valueToHtml(val)}</td></tr>`;\n }\n content += `</table>`;\n }\n return content || '{}'; // show empty object if there are no properties\n }\n return valueToHtml(value);\n}", "title": "" }, { "docid": "485bd8c831c440540df667838ea7aeb7", "score": "0.5863839", "text": "function print_r(theObj){\r\n if(theObj.constructor == Array ||\r\n theObj.constructor == Object){\r\n document.write(\"<ul>\")\r\n for(var p in theObj){\r\n if(theObj[p].constructor == Array||\r\n theObj[p].constructor == Object){\r\ndocument.write(\"<li>[\"+p+\"] => \"+typeof(theObj)+\"</li>\");\r\n document.write(\"<ul>\")\r\n print_r(theObj[p]);\r\n document.write(\"</ul>\")\r\n } else {\r\ndocument.write(\"<li>[\"+p+\"] => \"+theObj[p]+\"</li>\");\r\n }\r\n }\r\n document.write(\"</ul>\")\r\n }\r\n}", "title": "" }, { "docid": "f9d45aa60fdc931a6f2187db5af6a1e8", "score": "0.5804237", "text": "@readOnly\n @computed('lastValue', 'value')\n renderValue (lastValue, value) {\n if (typeOf(value) === 'object') {\n return JSON.stringify(value, null, 2) || lastValue\n }\n\n return value || lastValue\n }", "title": "" }, { "docid": "04ea77b55b6514905d5f60ea15bacd82", "score": "0.580254", "text": "render() {\n\t\treturn (\n\t\t\t<div className=\"Generic-Value\">\n\t\t\t\t{this.getFormattedValue()} <b>{this.getUnits()}</b>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "3a39a7c2e50ed7e1ad69e3a3b6ae7bef", "score": "0.5797831", "text": "function renderList(val,render){var ret,i,l,keys,key;if(Array.isArray(val)||typeof val==='string'){ret=new Array(val.length);for(i=0,l=val.length;i<l;i++){ret[i]=render(val[i],i);}}else if(typeof val==='number'){ret=new Array(val);for(i=0;i<val;i++){ret[i]=render(i+1,i);}}else if(isObject(val)){if(hasSymbol&&val[Symbol.iterator]){ret=[];var iterator=val[Symbol.iterator]();var result=iterator.next();while(!result.done){ret.push(render(result.value,ret.length));result=iterator.next();}}else{keys=Object.keys(val);ret=new Array(keys.length);for(i=0,l=keys.length;i<l;i++){key=keys[i];ret[i]=render(val[key],key,i);}}}if(!isDef(ret)){ret=[];}ret._isVList=true;return ret;}", "title": "" }, { "docid": "efa23883cdb5e888be3db698c0756aba", "score": "0.57761055", "text": "function renderList(val,render){var ret,i,l,keys,key;if(Array.isArray(val)||typeof val==='string'){ret=new Array(val.length);for(i=0,l=val.length;i<l;i++){ret[i]=render(val[i],i);}}else if(typeof val==='number'){ret=new Array(val);for(i=0;i<val;i++){ret[i]=render(i+1,i);}}else if(isObject(val)){keys=Object.keys(val);ret=new Array(keys.length);for(i=0,l=keys.length;i<l;i++){key=keys[i];ret[i]=render(val[key],key,i);}}if(isDef(ret)){ret._isVList=true;}return ret;}", "title": "" }, { "docid": "49fbeb0db6f3483a314079188aee115f", "score": "0.5735342", "text": "function renderList(\nval,\nrender)\n{\nvar ret,i,l,keys,key;\nif(Array.isArray(val)||typeof val==='string'){\nret=new Array(val.length);\nfor(i=0,l=val.length;i<l;i++){\nret[i]=render(val[i],i);\n}\n}else if(typeof val==='number'){\nret=new Array(val);\nfor(i=0;i<val;i++){\nret[i]=render(i+1,i);\n}\n}else if(isObject(val)){\nif(hasSymbol&&val[Symbol.iterator]){\nret=[];\nvar iterator=val[Symbol.iterator]();\nvar result=iterator.next();\nwhile(!result.done){\nret.push(render(result.value,ret.length));\nresult=iterator.next();\n}\n}else {\nkeys=Object.keys(val);\nret=new Array(keys.length);\nfor(i=0,l=keys.length;i<l;i++){\nkey=keys[i];\nret[i]=render(val[key],key,i);\n}\n}\n}\nif(!isDef(ret)){\nret=[];\n}\nret._isVList=true;\nreturn ret;\n}", "title": "" }, { "docid": "fcde07b7ce78eb398d1503bb4f1f2ceb", "score": "0.568732", "text": "render() {\n return (\n <div\n className=\"tree-component\"\n // data={() => this.getNestedObject()}\n > Hello\n {/* {console.log(getNestedObject)} */}\n {/* {treeData.map((treeDetail, i) => {\n return (\n <h1\n className={\"whatever\"}\n key={i}\n >\n {[treeDetail.action[0],\n <b\n className=\"other\"\n key={i}\n >\n {treeDetail.type}\n </b>,\n treeDetail.data\n ]}\n </h1>\n )\n })} */}\n\n </div>\n )\n }", "title": "" }, { "docid": "68019064a2f0933d5c65478489830d40", "score": "0.56753874", "text": "function printValues(obj) {\n for(var k in obj) {\n if(obj[k] instanceof Array) {\n printValues(obj[k]);\n } else {\n document.write(obj[k][\"id\"] + obj[k][\"name\"] + obj[k][\"rate\"] + obj[k][\"sellerId\"] + obj[k][\"sellerName\"] + \"<br>\");\n };\n }\n }", "title": "" }, { "docid": "e719ccec29572b86ed042b8f455f6248", "score": "0.56539524", "text": "function renderData(ids, node, value, seen) {\n var result = [];\n prerender.call(this, ids, result, value, null, seen);\n result.shift(result.pop()); // remove extra outer entry\n node.innerHTML = result.join('');\n }", "title": "" }, { "docid": "53e36b2109288f138db8346e4a0a9912", "score": "0.55698097", "text": "function displayValues(val){\n\t// Remove previous buttons and inspectors\n\t$(\".inspector, .inspector_img, .inspector_br, .inspector_lp\").remove(); \n\n\t// Display the inspector for each value to display\n\tfor(var key in val){\n\t\t// console.log($(\".ace_gutter-cell:eq(32)\").html());\n\t\t// Get the position\n\t\tvar xpos = $(\".ace_gutter-cell:eq(\"+key+\")\").position().top;\n\n\t\tif (val[key][2] == \"branch\") displayBranch(val[key], key, xpos);\n\t\telse if (val[key][2] == \"loop\") displayLoop(val[key], key, xpos);\n\t\telse displayVariableValues(val[key], key, xpos);\n\t\t\n }\n}", "title": "" }, { "docid": "54971ad9dc3d2190be7fc4e707a82496", "score": "0.55656224", "text": "function printElement(key, value, level, list, out){\n //insert space\n for(var i=0; i<level; ++i){\n out += \" \";\n }\n out += key + \" = \";\n var type = typeof(value);\n if( type == \"function\" || type == \"object\" ){//composite value\n //check the list\n for(var k in list){\n if( value === list[k] ){\n out += \"${\"+k+\"}\\n\";\n return;\n }\n }\n //register into list\n var keyName = key;\n var keyNumber = 1;\n var keyFinal = key;\n while(true){\n for(var k in list){\n if( k === keyFinal ){\n keyNumber++;\n keyFinal = keyName + keyNumber;\n continue;\n }\n }\n break;\n }\n list[keyFinal] = value;\n //print object\n for(var k in value){\n printElement(k, value[k], level+1, list, out);\n }\n }\n else{//scale value\n out += JSON.stringify(value)+\"\\n\";\n }\n}", "title": "" }, { "docid": "59391197cf9456c7516f701430175acc", "score": "0.5556952", "text": "function print(data, clear) {\r\n var container = document.getElementById(\"container\")\r\n if (!clear)\r\n container.innerHTML = \"\"\r\n for (key in data) {\r\n if (data[key] != null && typeof data[key] == \"object\") {\r\n var p = document.createElement(\"p\")\r\n if (!Array.isArray(data)) {\r\n p.innerHTML = \"<h3>\" + key + \"</h3>\"\r\n container.appendChild(p)\r\n }\r\n print(data[key], true)\r\n continue\r\n }\r\n\r\n var keyValue = document.createElement(\"div\")\r\n keyValue.innerHTML = \"<p>\" + \"<span class= \\\"key\\\">\" + key + \":</span>\" + \" \" + \"<span class= \\\"value\\\">\" + data[key] + \"</span>\" + \"</p>\"\r\n container.append(keyValue)\r\n\r\n }\r\n}", "title": "" }, { "docid": "efacd9e7658b1abb40792baa3c22cea1", "score": "0.5543276", "text": "function renderString(val){return val==null?'':(typeof val==='undefined'?'undefined':_typeof(val))==='object'?JSON.stringify(val,null,2):String(val);}", "title": "" }, { "docid": "0126e241a31973c4c3eef629242d7926", "score": "0.55391896", "text": "function renderList(val, render) {\n var ret, i, l, keys, key\n if (Array.isArray(val) || typeof val === \"string\") {\n ret = new Array(val.length)\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i)\n }\n } else if (typeof val === \"number\") {\n ret = new Array(val)\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i)\n }\n } else if (isObject(val)) {\n keys = Object.keys(val)\n ret = new Array(keys.length)\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i]\n ret[i] = render(val[key], key, i)\n }\n }\n if (isDef(ret)) {\n ret._isVList = true\n }\n return ret\n }", "title": "" }, { "docid": "0126e241a31973c4c3eef629242d7926", "score": "0.55391896", "text": "function renderList(val, render) {\n var ret, i, l, keys, key\n if (Array.isArray(val) || typeof val === \"string\") {\n ret = new Array(val.length)\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i)\n }\n } else if (typeof val === \"number\") {\n ret = new Array(val)\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i)\n }\n } else if (isObject(val)) {\n keys = Object.keys(val)\n ret = new Array(keys.length)\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i]\n ret[i] = render(val[key], key, i)\n }\n }\n if (isDef(ret)) {\n ret._isVList = true\n }\n return ret\n }", "title": "" }, { "docid": "0126e241a31973c4c3eef629242d7926", "score": "0.55391896", "text": "function renderList(val, render) {\n var ret, i, l, keys, key\n if (Array.isArray(val) || typeof val === \"string\") {\n ret = new Array(val.length)\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i)\n }\n } else if (typeof val === \"number\") {\n ret = new Array(val)\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i)\n }\n } else if (isObject(val)) {\n keys = Object.keys(val)\n ret = new Array(keys.length)\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i]\n ret[i] = render(val[key], key, i)\n }\n }\n if (isDef(ret)) {\n ret._isVList = true\n }\n return ret\n }", "title": "" }, { "docid": "4bf21cef3c50d90fda75dd51da1f7310", "score": "0.5535225", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n return ret\n}", "title": "" }, { "docid": "4bf21cef3c50d90fda75dd51da1f7310", "score": "0.5535225", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n return ret\n}", "title": "" }, { "docid": "4bf21cef3c50d90fda75dd51da1f7310", "score": "0.5535225", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n return ret\n}", "title": "" }, { "docid": "bccf118ad17ce2556c575661ad09e9b8", "score": "0.55283386", "text": "function printJSCode(isDupedVar, depth, value) {\n\t if (value == null || typeof value !== 'object') {\n\t return JSON.stringify(value);\n\t }\n\t // Only use variable references at depth beyond the top level.\n\t if (depth !== '') {\n\t var metadata = metadataForVal.get(value);\n\t if (metadata && metadata.isDuplicate) {\n\t if (!metadata.varName) {\n\t var refCode = printJSCode(true, '', value);\n\t metadata.varName = 'v' + varDefs.length;\n\t varDefs.push(metadata.varName + ' = ' + refCode);\n\t }\n\t return metadata.varName;\n\t }\n\t }\n\t var str = void 0;\n\t var isEmpty = true;\n\t var depth2 = depth + ' ';\n\t if (Array.isArray(value)) {\n\t // Empty arrays can only have one inferred flow type and then conflict if\n\t // used in different places, this is unsound if we would write to them but\n\t // this whole module is based on the idea of a read only JSON tree.\n\t if (isDupedVar && value.length === 0) {\n\t return '([]/*: any*/)';\n\t }\n\t str = '[';\n\t for (var i = 0; i < value.length; i++) {\n\t str += (isEmpty ? '\\n' : ',\\n') + depth2 + printJSCode(isDupedVar, depth2, value[i]);\n\t isEmpty = false;\n\t }\n\t str += isEmpty ? ']' : '\\n' + depth + ']';\n\t } else {\n\t str = '{';\n\t for (var k in value) {\n\t if (value.hasOwnProperty(k) && value[k] !== undefined) {\n\t str += (isEmpty ? '\\n' : ',\\n') + depth2 + JSON.stringify(k) + ': ' + printJSCode(isDupedVar, depth2, value[k]);\n\t isEmpty = false;\n\t }\n\t }\n\t str += isEmpty ? '}' : '\\n' + depth + '}';\n\t }\n\t return str;\n\t }", "title": "" }, { "docid": "d32280f2f6ee4691adb90c6e5e5c68b1", "score": "0.55215335", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "d32280f2f6ee4691adb90c6e5e5c68b1", "score": "0.55215335", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "d32280f2f6ee4691adb90c6e5e5c68b1", "score": "0.55215335", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "49d0f4ea0aa71e85c57e0a81e8ce4ac2", "score": "0.5521255", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "49d0f4ea0aa71e85c57e0a81e8ce4ac2", "score": "0.5521255", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "49d0f4ea0aa71e85c57e0a81e8ce4ac2", "score": "0.5521255", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "49d0f4ea0aa71e85c57e0a81e8ce4ac2", "score": "0.5521255", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "49d0f4ea0aa71e85c57e0a81e8ce4ac2", "score": "0.5521255", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i, i, i); // fixed by xxxxxx\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i, i); // fixed by xxxxxx\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "637a0dcceedbaa9fbf01631fb59935dc", "score": "0.55204564", "text": "function _markup_value( o ) {\n if ( u.isArray( o )) {\n let\n list = document.createElement('ul'),\n _;\n\n for ( let i = 0; i < o.length; i++ ) {\n const\n item = document.createElement('li'),\n text = document.createTextNode( o[i] );\n item.appendChild( text )\n list.appendChild( item )\n }\n return list\n }\n return document.createTextNode( o )\n }", "title": "" }, { "docid": "c2f30f4e1d19e0188b91ac5689b31a39", "score": "0.55087197", "text": "function renderList(val, render) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n if (isDef(ret)) {\n ret._isVList = true;\n }\n return ret;\n}", "title": "" }, { "docid": "c2f30f4e1d19e0188b91ac5689b31a39", "score": "0.55087197", "text": "function renderList(val, render) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n if (isDef(ret)) {\n ret._isVList = true;\n }\n return ret;\n}", "title": "" }, { "docid": "c2f30f4e1d19e0188b91ac5689b31a39", "score": "0.55087197", "text": "function renderList(val, render) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n if (isDef(ret)) {\n ret._isVList = true;\n }\n return ret;\n}", "title": "" }, { "docid": "e8df3d46432fa64ad739da3563a122f2", "score": "0.5496899", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject$2(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "08db782903005c07b9c7db1927d206f8", "score": "0.5489703", "text": "render() {\n\t\treturn html`\n\t\t\t<span>\n\t\t\t\t<span class=\"display-label\">${this.label}</span>:\n\t\t\t\t<span class=\"display-value\">${this.value}</span>\n\t\t\t</span>\n\t\t`;\n\t}", "title": "" }, { "docid": "2fed7e6590696dd842db43db1ed7b3a5", "score": "0.5485679", "text": "function renderList(val, render) {\n let ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (Object(core_util_index__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(val)) {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n if (Object(core_util_index__WEBPACK_IMPORTED_MODULE_0__[\"isDef\"])(ret)) {\n ret._isVList = true;\n }\n return ret;\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" }, { "docid": "4c7d52f634c660ae0a827b5372766680", "score": "0.5484722", "text": "function renderList (\n val,\n render\n) {\n var ret, i, l, keys, key;\n if (Array.isArray(val) || typeof val === 'string') {\n ret = new Array(val.length);\n for (i = 0, l = val.length; i < l; i++) {\n ret[i] = render(val[i], i);\n }\n } else if (typeof val === 'number') {\n ret = new Array(val);\n for (i = 0; i < val; i++) {\n ret[i] = render(i + 1, i);\n }\n } else if (isObject(val)) {\n if (hasSymbol && val[Symbol.iterator]) {\n ret = [];\n var iterator = val[Symbol.iterator]();\n var result = iterator.next();\n while (!result.done) {\n ret.push(render(result.value, ret.length));\n result = iterator.next();\n }\n } else {\n keys = Object.keys(val);\n ret = new Array(keys.length);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n ret[i] = render(val[key], key, i);\n }\n }\n }\n if (!isDef(ret)) {\n ret = [];\n }\n (ret)._isVList = true;\n return ret\n}", "title": "" } ]
bff0692476cddc68c607fa561419f8a1
A noop callback function.
[ { "docid": "f26856328ac5cd2b480a88e2fe15fcfb", "score": "0.0", "text": "function noOp() {\n /* no-op */\n }", "title": "" } ]
[ { "docid": "a30bde37b88cde2b621b55ae0fc7d871", "score": "0.86475617", "text": "function empty_callback() {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.86418766", "text": "function noop () {}", "title": "" }, { "docid": "a3ec9d9834c6f5df49029af8747d676b", "score": "0.86210865", "text": "function noop () { }", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.8588052", "text": "function noop(){}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.8569457", "text": "function noop() {}", "title": "" } ]
a31541110de41acd801650f7dbe0588b
Hyphenates a camelcased CSS property name, for example: > hyphenateStyleName('backgroundColor') hyphenateStyleName('MozTransition') hyphenateStyleName('msTransition') < "mstransition" As Modernizr suggests ( an `ms` prefix is converted to `ms`.
[ { "docid": "73668c6492c1ad6b299ea3cabc65a991", "score": "0.0", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n }", "title": "" } ]
[ { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "3ea3c415228c98de1b39809187bf1422", "score": "0.8186098", "text": "function hyphenateStyleName(name){return name.replace(uppercasePattern,'-$1').toLowerCase().replace(msPattern,'-ms-');}", "title": "" }, { "docid": "aaf76c6776e58c6018be98d39b7045cc", "score": "0.80245036", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n }", "title": "" }, { "docid": "93ee82f05aa5e4bea60dd08d0bf8ce55", "score": "0.79884285", "text": "function hyphenateStyleName(name) {\n\t return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n\t}", "title": "" }, { "docid": "93ee82f05aa5e4bea60dd08d0bf8ce55", "score": "0.79884285", "text": "function hyphenateStyleName(name) {\n\t return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n\t}", "title": "" }, { "docid": "93ee82f05aa5e4bea60dd08d0bf8ce55", "score": "0.79884285", "text": "function hyphenateStyleName(name) {\n\t return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n\t}", "title": "" }, { "docid": "a840ee27c867707a9a5b54c1265920ce", "score": "0.7977628", "text": "function hyphenateStyleName(name) {\r\n return name\r\n .replace(uppercasePattern, '-$1')\r\n .toLowerCase()\r\n .replace(msPattern, '-ms-')\r\n }", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" }, { "docid": "879667b8902f189627d99a55be7b876a", "score": "0.7949135", "text": "function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}", "title": "" } ]
bf5337e106f142f9835caaf4e1a404dd
Internal function to alignColumns align two columns by wrapping contents in divs and adjusting width of divs.
[ { "docid": "34dc0e6c40359c67eea469b146d3aa50", "score": "0.6565106", "text": "function alignTwoTableColumns (d1, d2)\r\n{ \r\n // convert to jQuery objects\r\n var titleCell = $(d1);\r\n var dataCell = $(d2);\r\n\t\r\n // widths including border and padding\r\n var titleOuterWidth = titleCell.outerWidth(); \r\n var dataOuterWidth = dataCell.outerWidth(); \t\r\n\t\r\n // get padding, border dynamically since it now varies from screen to screen\r\n var titleExtra = titleOuterWidth - titleCell.width(); \r\n var dataExtra = dataOuterWidth - dataCell.width(); \r\n \r\n if (!alignTwoTableColumns.isCalledOnResize) // wrap cell contents with div\r\n {\r\n\t\tvar divTitle = $('<div></div>');\r\n\t\tvar divData = $('<div></div>');\r\n\t \r\n\t\t/* In newer (newest?) version of IE8, the calendar icon and lookup icon are\r\n\t\t* dropping below the textbox in the same cell. The width calculated by\r\n\t\t* jQuery is 1 pixel too small, thus causing the drop.\r\n\t\t* Fix: Adding 1px to final width.\r\n\t\t*/\r\n\t\t if (titleOuterWidth > dataOuterWidth)\r\n\t\t\t{\r\n\t\t\t\tdivTitle.width( titleCell.width() + 1 );\r\n\t\t\t\tdivData.width( titleOuterWidth - dataExtra + 1 );\r\n\t\t\t}\r\n\t\t\telse if (dataOuterWidth > titleOuterWidth)\r\n\t\t\t{\r\n\t\t\t\tdivTitle.width( dataOuterWidth - titleExtra + 1 );\r\n\t\t\t\tdivData.width( dataCell.width() + 1 );\r\n\t\t\t}\r\n\t\t\telse // widths are the same. Need to explicitly set the widths so they aren't changed by divs.\r\n\t\t\t{\t // Example Screen where this happens: Docs & Cond. Model\r\n\t\t\t\tdivTitle.width(titleOuterWidth - titleExtra + 1);\r\n\t\t\tdivData.width(dataOuterWidth - dataExtra + 1);\r\n\t\t\t}\r\n\t \r\n\t\t// Wrap divs around contents of both cells\r\n\t\t\ttitleCell.wrapInner(divTitle);\r\n\t \tdataCell.wrapInner(divData);\r\n }\r\n \r\n}", "title": "" } ]
[ { "docid": "28d40516b1acba2d0a4e2b61cd7e9cc2", "score": "0.6629423", "text": "function alignColumns(col1, col2, table1, table2)\r\n{\r\n var i=0;\r\n\r\n var obj1 = getElemnt(col1+i);\r\n var obj2 = getElemnt(col2+i);\r\n var obj3 = getElemnt(table1);\r\n var obj4 = getElemnt(table2);\r\n \r\n // create jQuery objects of tables\r\n var tbl1 = $(obj3);\r\n var tbl2 = $(obj4);\r\n \r\n // set table widths to auto - having them set to fixed width changes width of cells\r\n // which throws off calculations\r\n tbl1.css('width','auto');\r\n tbl2.css('width','auto');\r\n \r\n \r\n if (obj1 && obj2) // objects exist in search screens, detail sections when no column freeze\r\n {\r\n\t while(obj1 && obj2)\r\n\t {\t\r\n\t i++;\r\n\t\t\r\n\t\t alignTwoTableColumns(obj1, obj2);\r\n\t\t\r\n\t obj1 = getElemnt(col1+i);\r\n\t obj2 = getElemnt(col2+i);\r\n\t }\r\n }\r\n else // column freeze - table cells have no ids\r\n {\r\n \t// dynamically get the table cells since they don't have ids.\r\n \t// Screens like fiteval have 2 title rows, so\r\n \t// need to take into account col spans.\r\n \tvar rows1 = tbl1.children('tbody').children('tr');\r\n \t\r\n \tvar rows1Length = rows1.length;\r\n \t// if one row...\r\n \tif (rows1Length == 1)\r\n \t{\r\n \t \tvar cells1 = rows1.children('td');\r\n\t var cells2 = tbl2.children('tbody').children('tr:first').children('td');\r\n\t \t\r\n\t var numberCells = cells1.length;\r\n\t \t\r\n\t for (; i<numberCells; i++) // i already declared\r\n\t {\r\n\t alignTwoTableColumns(cells1.get(i),cells2.get(i));\r\n \t }\r\n \t}\r\n \telse if (rows1Length == 2) // if two rows - col span possible...\r\n \t{\r\n\t var titleCells1 = rows1.eq(0).children('td');\r\n\t var titleCells2 = rows1.eq(1).children('td');\r\n\t var dataCells = tbl2.children('tbody').children('tr:first').children('td');\r\n\t \r\n\t var numberCells = dataCells.length;\r\n\t // keep track of number of cells aligned in 2nd title row\r\n\t var colSpanCells = 0;\r\n\t \r\n\t for (; i<numberCells; i++) // i already declared\r\n\t {\r\n\t \t\tvar topCell = titleCells1.eq(i);\r\n\t \t\t// check for colspan\r\n\t \t// if no colspan, use align based on first row cells\r\n\t \t\tvar colspan = topCell.attr('colspan')\r\n\t \tif (colspan == 1)\r\n\t \t{\r\n\t \t\talignTwoTableColumns(titleCells1.eq(i), dataCells.eq(i));\r\n\t \t}\r\n\t \telse // there is colspan\r\n\t \t{\r\n\t \t\t// loop through all cells in 2nd title row under col span\r\n\t \t\tfor (var j=0; j<colspan; j++)\r\n\t \t\t{\r\n\t \t\t\talignTwoTableColumns(titleCells2.eq(j+colSpanCells),dataCells.eq(i));\r\n\t \t\t\ti++;\r\n\t \t\t}\r\n\t \t\tcolSpanCells += colspan;\r\n\t \t}\r\n\t }\r\n \t}\r\n \tvar cells1 = tbl1.children().children('tr:last').children('td');\r\n \tvar cells2 = tbl2.children().children('tr:last').children('td');\r\n \t\r\n \tvar numberCells = cells1.length;\r\n \t\r\n \tfor (; i<numberCells; i++) // i already declared\r\n \t{\r\n \t\talignTwoTableColumns(cells1.get(i),cells2.get(i));\r\n \t}\r\n }\r\n}", "title": "" }, { "docid": "4d765ee273dd08743b9f0404d37a8f51", "score": "0.64545065", "text": "function alignDiv(d1, d2, table1, table2)\r\n{\r\n\t// convert to jQuery objects\r\n\tvar titleCell = $(d1);\r\n\tvar dataCell = $(d2);\r\n\t\r\n\t// widths including border and padding\r\n\tvar titleOuterWidth = titleCell.outerWidth();\r\n\tvar dataOuterWidth = dataCell.outerWidth();\r\n\t\r\n\t// get padding, border dynamically since it now varies from screen to screen\r\n\tvar titleExtra = titleOuterWidth - titleCell.width();\r\n\tvar dataExtra = dataOuterWidth - dataCell.width();\r\n\t\r\n\tif (titleOuterWidth > dataOuterWidth)\r\n\t{\r\n\t\tdataCell.width( titleOuterWidth - dataExtra );\r\n\t\ttitleCell.width( titleCell.width() );\r\n\t\treturn titleOuterWidth;\r\n\t}\r\n\telse if (dataOuterWidth > titleOuterWidth)\r\n\t{\r\n\t\ttitleCell.width( dataOuterWidth - titleExtra );\r\n\t\tdataCell.width( dataCell.width() );\r\n\t\treturn dataOuterWidth;\r\n\t}\r\n\telse // they are equal; can return either one\r\n\t{\r\n\t\treturn dataOuterWidth;\r\n\t}\r\n}", "title": "" }, { "docid": "0c5a26f4bce70b75b1fddadce53fd7aa", "score": "0.6426668", "text": "function align2TableCols(table1, table2)\r\n{\r\n var i=0;\r\n\r\n var obj1 = getElemnt(table1);\r\n var obj2 = getElemnt(table2);\r\n \r\n if (obj1 && obj2)\r\n {\r\n // set table widths to auto - having them set to fixed width changes width of cells\r\n // which throws off calculations\r\n obj1.style.width = 'auto';\r\n obj2.style.width = 'auto';\r\n\r\n //this is, incase of other than default row i.e 0 is used for heading\r\n //set the table attribute 'frzRw' value to 1 or more\r\n\t\tvar frzRw1 = (obj1.getAttribute(\"frzRw\"))?parseFloat(obj1.getAttribute(\"frzRw\")):0;\r\n\t\tvar frzRw2 = (obj2.getAttribute(\"frzRw\"))?parseFloat(obj2.getAttribute(\"frzRw\")):0;\r\n\r\n \t// create jQuery objects of tables\r\n\t var tbl1 = $(obj1);\r\n\t var tbl2 = $(obj2);\r\n\r\n\t\t// Get title cells based on freeze row number\r\n\t\tvar titleCells = tbl1.children('tbody').children('tr').eq(frzRw1).children('td');\r\n\r\n\t\t// Get data cells based on freeze row number\r\n\t\tvar dataCells = tbl2.children('tbody').children('tr').eq(frzRw2).children('td');\r\n\t\t\r\n\t\t// Get length of rows\r\n\t\tvar numberCells = titleCells.length;\r\n\t \r\n\t for (var i=0; i<numberCells; i++)\r\n {\r\n\t \talignTwoTableColumns(titleCells.eq(i), dataCells.eq(i));\r\n }\r\n\t\t \r\n\t\t// Fix table width so when div width is adjusted, table width will not change\r\n\t\ttbl1.width(tbl1.width());\r\n\t\ttbl2.width(tbl2.width());\r\n\t}\r\n}", "title": "" }, { "docid": "80e5f5de0084a18d83cebe44d9d517ac", "score": "0.5918323", "text": "function adjustColumnWidths(allColumns, expectedWidth) {\n var columnsWidth = column_1.columnsTotalWidth(allColumns);\n var totalFlexGrow = getTotalFlexGrow(allColumns);\n var colsByGroup = column_1.columnsByPin(allColumns);\n if (columnsWidth !== expectedWidth) {\n scaleColumns(colsByGroup, expectedWidth, totalFlexGrow);\n }\n}", "title": "" }, { "docid": "80e5f5de0084a18d83cebe44d9d517ac", "score": "0.5918323", "text": "function adjustColumnWidths(allColumns, expectedWidth) {\n var columnsWidth = column_1.columnsTotalWidth(allColumns);\n var totalFlexGrow = getTotalFlexGrow(allColumns);\n var colsByGroup = column_1.columnsByPin(allColumns);\n if (columnsWidth !== expectedWidth) {\n scaleColumns(colsByGroup, expectedWidth, totalFlexGrow);\n }\n}", "title": "" }, { "docid": "52e32beab793a459da59746208b70597", "score": "0.5910688", "text": "function rightLeftColSpacing() {\n $c = $('.environment-os-section-flex');\n // Collect the content div's as objects. There should only be one div in each column.\n var pad = $c.children('.center-col').css('paddingTop');\n $l = $c.children('.col.left-col');\n $r = $c.children('.col.right-col');\n\n var colArr = [$l,$r];\n\n // Find and collect the heights of the right & left column content divs\n var heightArr = new Array();\n\n $(colArr).each(function(i,e){\n heightArr.push($(this).children('div').outerHeight());\n });\n // New height is the max of the two outer col heights, with the same vertical padding of the center col\n var newHeight = (Math.max.apply(Math,heightArr)) + (parseInt(pad) * 2);\n\n // New Height is the larger of the two column height vals\n $(colArr).each(function(i,e){\n $(this).css({'height':newHeight + 'px'});\n });\n\n}", "title": "" }, { "docid": "29061cd0da5ddcde0b2cb4a382caf9f5", "score": "0.57542384", "text": "function adjustColumnWidths(allColumns, expectedWidth) {\n var columnsWidth = columnsTotalWidth(allColumns);\n var totalFlexGrow = getTotalFlexGrow(allColumns);\n var colsByGroup = columnsByPin(allColumns);\n\n if (columnsWidth !== expectedWidth) {\n scaleColumns(colsByGroup, expectedWidth, totalFlexGrow);\n }\n }", "title": "" }, { "docid": "de513902d4ff4299ef666d1e63fddefc", "score": "0.56404823", "text": "function sizeContributeSection() {\n\n // 1. Inner Columns\n\n // Inner Left/Right display divs\n $iLCol = $('.build-an-addon');\n $iRCol = $('.three-row-col-div');\n\n // To Start, get the height of the right box and set the padding on the left to result in a matching height\n\n // Determine difference in heights\n var iDiff = ($iRCol.height() - $iLCol.height()) / 2;\n\n // Now add iDiff to the top padding of first item and bottom padding of last item\n $iLCol.first().css({'paddingTop':iDiff+'px'});\n $iLCol.last().css({'paddingBottom':iDiff+'px'});\n\n\n // 2. Outer Columns\n\n // Far Left / Far Right Display divs\n $oLCol = $('.display-div.left-col'); // Far Left Col Display\n $oRCol = $('.display-div.right-col'); // Far Right Col Display\n\n\n // Match the heights of the outer right/left columns. This assumes the far-right col will always be shorter than far-left.\n // This only acts if the heights aren't already matched; otherwise it causes the heights to be applied incorrectly.\n\n // Pad outer-left column\n\n // Establish the placement of the outer-left div first, since it will be larger.\n $oLCol.css({'paddingTop':'10px','paddingBottom':'20px'});\n var lch = $oLCol.outerHeight();\n var lchPad = (lch - $oRCol.outerHeight()) / 2;\n // Now determine the difference between the right and left outer cols; apply difference in padding to right-outer col padding.\n\n if($oLCol.outerHeight() != $oRCol.outerHeight()) {\n $oRCol.css({'paddingTop':lchPad + 'px','paddingBottom':lchPad+'px'});\n }\n\n // Adjust Top Margin\n\n // Now apply a padding to the outer container to vertically center align with inner cols\n $outerContainer = $('.outer-container');\n // At this point the inner cols should be height-aligned so height can be taken from one.\n $innerContainer = $('.three-row-col-div');\n var outPad = ($innerContainer.outerHeight() - $outerContainer.outerHeight()) / 2;\n\n $outerContainer.css({'paddingTop':outPad+'px'})\n}", "title": "" }, { "docid": "de513902d4ff4299ef666d1e63fddefc", "score": "0.56404823", "text": "function sizeContributeSection() {\n\n // 1. Inner Columns\n\n // Inner Left/Right display divs\n $iLCol = $('.build-an-addon');\n $iRCol = $('.three-row-col-div');\n\n // To Start, get the height of the right box and set the padding on the left to result in a matching height\n\n // Determine difference in heights\n var iDiff = ($iRCol.height() - $iLCol.height()) / 2;\n\n // Now add iDiff to the top padding of first item and bottom padding of last item\n $iLCol.first().css({'paddingTop':iDiff+'px'});\n $iLCol.last().css({'paddingBottom':iDiff+'px'});\n\n\n // 2. Outer Columns\n\n // Far Left / Far Right Display divs\n $oLCol = $('.display-div.left-col'); // Far Left Col Display\n $oRCol = $('.display-div.right-col'); // Far Right Col Display\n\n\n // Match the heights of the outer right/left columns. This assumes the far-right col will always be shorter than far-left.\n // This only acts if the heights aren't already matched; otherwise it causes the heights to be applied incorrectly.\n\n // Pad outer-left column\n\n // Establish the placement of the outer-left div first, since it will be larger.\n $oLCol.css({'paddingTop':'10px','paddingBottom':'20px'});\n var lch = $oLCol.outerHeight();\n var lchPad = (lch - $oRCol.outerHeight()) / 2;\n // Now determine the difference between the right and left outer cols; apply difference in padding to right-outer col padding.\n\n if($oLCol.outerHeight() != $oRCol.outerHeight()) {\n $oRCol.css({'paddingTop':lchPad + 'px','paddingBottom':lchPad+'px'});\n }\n\n // Adjust Top Margin\n\n // Now apply a padding to the outer container to vertically center align with inner cols\n $outerContainer = $('.outer-container');\n // At this point the inner cols should be height-aligned so height can be taken from one.\n $innerContainer = $('.three-row-col-div');\n var outPad = ($innerContainer.outerHeight() - $outerContainer.outerHeight()) / 2;\n\n $outerContainer.css({'paddingTop':outPad+'px'})\n}", "title": "" }, { "docid": "42197adef3036da7b1995e898f2e2c23", "score": "0.5621623", "text": "function FixContextColumns() {\n var leftPos = $(\".left-column\").position();\n var rightPos = $(\".right-column\").position();\n\n // Fix the left column's width to be within 20 px of the right column. Set min-width = 300px\n var leftWidth = (rightPos.left - leftPos.left - 30);\n if (leftWidth < 300)\n {\n leftWidth = 300;\n }\n\n $(\".left-column\").css(\"width\", leftWidth + \"px\");\n\n leftPos = $(\".left-column\").position();\n rightPos = $(\".right-column\").position();\n\n if (leftPos.top > rightPos.top)\n {\n $(\".right-column\").css(\"float\", \"left\");\n $(\".right-column\").css(\"margin-right\", \"20px\");\n $(\".right-column\").css(\"margin-left\", \"0px\");\n }\n else\n {\n $(\".right-column\").css(\"float\", \"\");\n $(\".right-column\").css(\"margin-right\", \"\");\n $(\".right-column\").css(\"margin-left\", \"\");\n }\n\n}", "title": "" }, { "docid": "e8590cb3f5622e017ed3746e2578fbf5", "score": "0.55217403", "text": "function _inferColumnWidths(columns, string) {\n\n var i, nextColumn;\n var len = columns.length;\n var last = len - 1;\n\n //\n // Pass 1: Start with header positions\n //\n for (i = 0; i < len; i++) {\n columns[i].pos = {\n start: string.indexOf(columns[i].query),\n length: columns[i].query.length\n };\n }\n\n //\n // Pass 2: Fix alignments\n //\n for (i = 0; i < len; i++) {\n\n // First column\n if (i === 0) {\n\n if (columns[i].align === 'left') {\n nextColumn = columns[i + 1].pos;\n columns[i].pos.length = (nextColumn.start - columns[i].pos.start);\n }\n\n else if (columns[i].align === 'right') {\n columns[i].pos.length += columns[i].pos.start;\n }\n\n else {\n throw 'StringHelper.inferColumnWidths `align` has incorrect value, valid options: left, right';\n }\n\n columns[i].pos.start = 0;\n }\n\n // Middle column\n else if (i < last) {\n\n if (columns[i].align === 'left') {\n nextColumn = columns[i + 1].pos;\n columns[i].pos.length = (nextColumn.start - columns[i].pos.start);\n }\n\n else if (columns[i].align === 'right') {\n\n var previousColumn = columns[i - 1].pos;\n var currentEndPosition = (columns[i].pos.start + columns[i].pos.length);\n var previousEndPosition = (previousColumn.start + previousColumn.length);\n\n columns[i].pos.length = currentEndPosition - previousEndPosition;\n columns[i].pos.start = previousEndPosition;\n }\n\n else {\n throw 'StringHelper.inferColumnWidths `align` has incorrect value, valid options: left, right';\n }\n }\n\n // Last column\n if (i === last) {\n columns[i].pos.length = undefined;\n }\n }\n\n //\n // Pass 3: Create getValue() methods\n //\n for (i = 0; i < len; i++) {\n columns[i].getValue = (function(pos) {\n return function(str) {\n return String.prototype.substr.call(str, pos.start, pos.length).trim();\n };\n }(columns[i].pos));\n }\n\n return columns;\n}", "title": "" }, { "docid": "ee9ae444494919e04fa20a9d0a68946a", "score": "0.5444072", "text": "function fix_column_widths() {\n var agt = navigator.userAgent.toLowerCase();\n if ((agt.indexOf(\"msie\") != -1) && (agt.indexOf(\"opera\") == -1)) {\n fix_column_width('left-column');\n fix_column_width('right-column');\n }\n}", "title": "" }, { "docid": "76334f94c32167de141a4b22deb65f87", "score": "0.5437117", "text": "function wrapContent() {\n canvas.find('.column').each(function() {\n var col = $(this);\n var contents = $();\n col.children().each(function() {\n var child = $(this);\n if (child.is('.row, .ge-tools-drawer, .ge-content')) {\n doWrap(contents);\n } else {\n contents = contents.add(child);\n }\n });\n doWrap(contents);\n });\n }", "title": "" }, { "docid": "5eaa206a464d14d964cf018961a7585c", "score": "0.5390685", "text": "function change_columns(){\n if(options.images && options.translations){\n $(\"#texts > div\").css(\"flex-basis\", \"33%\");\n $(\"#texts > div\").css(\"width\", \"33%\");\n resizeAllMiradorViewers();\n } else {\n $(\"#texts > div\").css(\"flex-basis\", \"50%\");\n $(\"#texts > div\").css(\"width\", \"50%\");\n resizeAllMiradorViewers();\n }\n }", "title": "" }, { "docid": "3182abb552c01323cc517009d7542bfe", "score": "0.5367704", "text": "setColumnWidths() {\n /*\n * CSS gives prority to let name fields have full witdh initially and uses\n * the longest name field for future reference, so all fields keep the same\n * width.\n */\n const rowWidest = [].slice.call(this.content.querySelectorAll('.h5p-kewar-code-display-row-name'))\n .reduce((accu, field) => {\n return Math.max(accu, field.offsetWidth || 0);\n }, 0);\n\n if (rowWidest === 0) {\n return;\n }\n\n const rowMaxWidth = rowWidest + 5;\n const rowWidth = 100 * rowMaxWidth / this.content.offsetWidth;\n\n [].slice.call(this.content.querySelectorAll('.h5p-kewar-code-display-row-name'))\n .forEach((name) => {\n name.style.flexGrow = 1;\n name.style.flexShrink = 1;\n name.style.maxWidth = `${rowMaxWidth}px`;\n name.style.overflow = 'hidden';\n name.style.textOverflow = 'ellipsis';\n name.style.width = `${rowWidth}%`;\n });\n\n [].slice.call(this.content.querySelectorAll('.h5p-kewar-code-display-row-content'))\n .forEach((name) => {\n name.style.flexGrow = 1;\n name.style.width = `${100 - rowWidth}%`;\n });\n }", "title": "" }, { "docid": "b8561b5f70827910d70f57c35cb16ed8", "score": "0.5365828", "text": "function matchColumnHeights(){var f=$(\".columnLeft\"),c=$(\".columnRight\"),e=f.innerHeight(),b=c.innerHeight(),a=e-f.height(),d=b-c.height();(e>b)?c.height(e-d):f.height(b-a)}", "title": "" }, { "docid": "a5f6d2c342157d729353f8c2c8c2d9f9", "score": "0.5362313", "text": "layoutColumnPosition(allCells){\n\t\tvar leftParents = [];\n\t\t\n\t\tvar leftMargin = 0;\n\t\tvar rightMargin = 0;\n\t\t\n\t\tthis.leftColumns.forEach((column, i) => {\t\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin;\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\n\t\t\t\n\t\t\tif(column.visible){\n\t\t\t\tleftMargin += column.getWidth();\n\t\t\t}\n\t\t\t\n\t\t\tif(i == this.leftColumns.length - 1){\n\t\t\t\tcolumn.modules.frozen.edge = true;\n\t\t\t}else{\n\t\t\t\tcolumn.modules.frozen.edge = false;\n\t\t\t}\n\t\t\t\n\t\t\tif(column.parent.isGroup){\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\n\t\t\t\tif(!leftParents.includes(parentEl)){\n\t\t\t\t\tthis.layoutElement(parentEl, column);\n\t\t\t\t\tleftParents.push(parentEl);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(column.modules.frozen.edge){\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.layoutElement(column.getElement(), column);\n\t\t\t}\n\t\t\t\n\t\t\tif(allCells){\n\t\t\t\tcolumn.cells.forEach((cell) => {\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis.rightColumns.forEach((column, i) => {\n\t\t\t\n\t\t\tcolumn.modules.frozen.marginValue = rightMargin;\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\n\t\t\t\n\t\t\tif(column.visible){\n\t\t\t\trightMargin += column.getWidth();\n\t\t\t}\n\t\t\t\n\t\t\tif(i == this.rightColumns.length - 1){\n\t\t\t\tcolumn.modules.frozen.edge = true;\n\t\t\t}else{\n\t\t\t\tcolumn.modules.frozen.edge = false;\n\t\t\t}\n\t\t\t\n\t\t\tif(column.parent.isGroup){\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\n\t\t\t}else{\n\t\t\t\tthis.layoutElement(column.getElement(), column);\n\t\t\t}\n\t\t\t\n\t\t\tif(allCells){\n\t\t\t\tcolumn.cells.forEach((cell) => {\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "a3f17591fc25f1e2d9bc58be666e8c98", "score": "0.5358001", "text": "function FCT_checkColumnWidths(t1, t2) {\n var width1, width2;\n\n if (!this.debug) return;\n\n for (var j = 0; j < t1.rows.item(0).cells.length; j++) {\n if ((width1 = FCT_getWidth(t1.rows.item(0).cells.item(j))) != (width2 = FCT_getWidth(t2.rows.item(0).cells.item(j)))) {\n alert(\"t1[0][\" + j + \"].width = \" + width1 + \"\\nt2[0][\" + j + \"].width = \" + width2)\n return;\n }\n }\n }", "title": "" }, { "docid": "8815cdf235d9cebb9a262ca5d978bf5d", "score": "0.5315171", "text": "function padColumnWidth(fields, width) {\n if (fields.length < width) {\n for (var i = fields.length; i < width; i++) {\n fields.push({\n name: 'Field ' + (i + 1),\n });\n }\n }\n}", "title": "" }, { "docid": "ec853f5a25571e67293cc69f8e30fc62", "score": "0.52900875", "text": "function init_columns_and_calculate_header_column_width(columns, container_id){\n function init_column(column, key, value){\n if (!column[key])\n column[key] = value; // Default-Attribut der Spalte, braucht damit nicht angegeben werden\n }\n\n // DIVs für Test der resultierenden Breite von Zellen für slickGrid\n var test_header_outer = jQuery('<div class=\"slick_header_column ui-widget-header\" style=\"visibility:hidden; position: absolute; z-index: -1; padding: 0; margin: 0;\"><nobr><div id=\"test_header\" style=\"width: 1px; overflow: hidden;\"></div></nobr></div>');\n thiz.gridContainer.after(test_header_outer); // Einbinden in DOM-Baum\n var test_header = test_header_outer.find('#test_header'); // Objekt zum Test der realen string-Breite\n\n // Alte Variante mit TABLE für umgebrochene Zeichenbreite\n //var test_header_wrap_outer = jQuery('<table style=\"visibility:hidden; position:absolute; width:1px;\"><tr><td class=\"slick_header_column ui-widget-header\" style=\"font-size: 100%; padding: 0; margin: 0;\"><div id=\"test_header_wrap\"></div></td></tr></table>');\n //thiz.gridContainer.after(test_header_wrap_outer); // Nach Container unsichtbar einbinden\n //var test_header_wrap = test_header_wrap_outer.find('#test_header_wrap'); // Objekt zum Test der realen string-Breite für td\n\n var test_header_wrap_outer = jQuery('<div><div id=\"test_header_wrap\" style=\"visibility:hidden; position:absolute; width:1px; padding: 0; margin: 0;\" class=\"slick_header_column ui-widget-header\"></div></div>');\n thiz.gridContainer.after(test_header_wrap_outer); // Nach Container unsichtbar einbinden\n var test_header_wrap = test_header_wrap_outer.find('#test_header_wrap'); // Objekt zum Test der realen string-Breite für td\n\n var column; // aktuell betrachtete Spalte\n\n // Ermittlung max. Zeichenbreite ohne Umbrüche\n for (var col_index in columns){\n column = columns[col_index];\n\n init_column(column, 'formatter', HTMLFormatter); // Default-Formatter, braucht damit nicht angegeben werden\n init_column(column, 'sortable', true);\n init_column(column, 'sort_type', 'string'); // Sort-Type. TODO Ermittlung nach JavaScript verschieben\n init_column(column, 'field', column['id']); // Field-Referenz in data-Record muss nicht angegeben werden wenn identisch\n init_column(column, 'minWidth', 5); // Default von 30 reduzieren\n init_column(column, 'headerCssClass', 'slickgrid_header_'+container_id);\n init_column(column, 'slickgridExtended', thiz); // Referenz auf SlickGridExtended fuer Nutzung ausserhalb\n\n\n test_header.html(column['name']); // Test-Zelle mit zu messendem Inhalt belegen\n column['header_nowrap_width'] = test_header.prop(\"scrollWidth\"); // genutzt für Test auf Umbruch des Headers, dann muss Höhe der Header-Zeile angepasst werden\n\n test_header_wrap.html(column['name']);\n column['max_wrap_width'] = test_header_wrap.prop(\"scrollWidth\"); // + sort_pfeil_width; // min. Breite mit Umbruch muss trotzdem noch den Sort-Pfeil darstellen können\n\n column['max_nowrap_width'] = column['max_wrap_width']; // Normbreite der Spalte mit Mindestbreite des Headers initialisieren (lieber Header umbrechen als Zeilen einer anderen Spalte)\n }\n\n // Entfernen der DIVs fuer Breitenermittlung aus dem DOM-Baum\n test_header_outer.remove();\n test_header_wrap_outer.remove();\n }", "title": "" }, { "docid": "21bfa469c901db6d9cf0c899c5912c07", "score": "0.52851033", "text": "function columnSpanCmp(a, b) {\n var c1 = Private.cellConfigProperty.get(a.widget);\n var c2 = Private.cellConfigProperty.get(b.widget);\n return c1.columnSpan - c2.columnSpan;\n }", "title": "" }, { "docid": "fbaddc4647dc040511bf796671538059", "score": "0.5281408", "text": "function columnSpanCmp(a, b) {\r\n var c1 = Private.cellConfigProperty.get(a.widget);\r\n var c2 = Private.cellConfigProperty.get(b.widget);\r\n return c1.columnSpan - c2.columnSpan;\r\n }", "title": "" }, { "docid": "fbaddc4647dc040511bf796671538059", "score": "0.5281408", "text": "function columnSpanCmp(a, b) {\r\n var c1 = Private.cellConfigProperty.get(a.widget);\r\n var c2 = Private.cellConfigProperty.get(b.widget);\r\n return c1.columnSpan - c2.columnSpan;\r\n }", "title": "" }, { "docid": "33dfa50b8ed567dba951efd79de79331", "score": "0.52738273", "text": "function alignGrid(/*string*/ id, /*int*/ cols, /*int*/ cellWidth, /*int*/ cellHeight, /*int*/ padding) {\n \n var x = 0;\n var y = 0;\n var count = 1;\n \n jQuery(\"#\" + id).each(function() {\n jQuery(this).css(\"position\", \"relative\");\n \n jQuery(this).children(\"div\").each(function() {\n jQuery(this).css(\"width\", cellWidth + \"em\");\n jQuery(this).css(\"height\", cellHeight + \"em\");\n jQuery(this).css(\"position\", \"absolute\");\n \n jQuery(this).css(\"left\", x + \"em\");\n jQuery(this).css(\"top\", y + \"em\");\n \n if ((count % cols) == 0) {\n x = 0;\n y += cellHeight + padding;\n } else {\n x += cellWidth + padding;\n }\n \n count++;\n });\n });\n}", "title": "" }, { "docid": "f3eb5f029b26d3eb780ecb9c8a79b210", "score": "0.5248971", "text": "function setColumnPositions(columns, gutter) {\n for (let i = 0; i < columns.length; i++) {\n const gutters = i * gutter;\n\n columns[i].left = columns\n .slice(0, i)\n .reduce((a, b) => a + b.width, gutters);\n }\n}", "title": "" }, { "docid": "6766e2dc393f413fd730fa02cf7f764b", "score": "0.52330935", "text": "function cleanupJustifyDivFragments(blockContainer) {\n\t if (!blockContainer) {\n\t return;\n\t }\n\t\n\t var textAlign,\n\t childDivs = Array.prototype.slice.call(blockContainer.childNodes).filter(function (element) {\n\t var isDiv = element.nodeName.toLowerCase() === 'div';\n\t if (isDiv && !textAlign) {\n\t textAlign = element.style.textAlign;\n\t }\n\t return isDiv;\n\t });\n\t\n\t /* If we found child <div> elements with text-align style attributes\n\t * we should fix this by:\n\t *\n\t * 1) Unwrapping each <div> which has a text-align style\n\t * 2) Insert a <br> element after each set of 'unwrapped' div children\n\t * 3) Set the text-align style of the parent block element\n\t */\n\t if (childDivs.length) {\n\t // Since we're mucking with the HTML, preserve selection\n\t this.saveSelection();\n\t childDivs.forEach(function (div) {\n\t if (div.style.textAlign === textAlign) {\n\t var lastChild = div.lastChild;\n\t if (lastChild) {\n\t // Instead of a div, extract the child elements and add a <br>\n\t MediumEditor.util.unwrap(div, this.options.ownerDocument);\n\t var br = this.options.ownerDocument.createElement('BR');\n\t lastChild.parentNode.insertBefore(br, lastChild.nextSibling);\n\t }\n\t }\n\t }, this);\n\t blockContainer.style.textAlign = textAlign;\n\t // We're done, so restore selection\n\t this.restoreSelection();\n\t }\n\t }", "title": "" }, { "docid": "547249ece1f82bb5b3ddcc01ea5d0c29", "score": "0.52241427", "text": "function setColumnWidths(columns, width, gutter) {\n const count = columns.length;\n\n // Size of all gutters needed for the grid\n const gutters = Math.max(0, count - 1) * gutter;\n\n // Approximate the size for each column\n const guess = Math.floor((width - gutters) / count);\n\n // The number of pixels that couldn't be divided evenly\n const remainder = width - (guess * count) - gutters;\n\n // Set widths\n for (let i = 0; i < columns.length; i++) {\n columns[i].width = guess + (i < remainder ? 1 : 0);\n }\n}", "title": "" }, { "docid": "84626391b919a3f9eb2f4a92ead8e386", "score": "0.52153116", "text": "function cleanupJustifyDivFragments(blockContainer) {\n if (!blockContainer) {\n return;\n }\n\n var textAlign,\n childDivs = Array.prototype.slice.call(blockContainer.childNodes).filter(function (element) {\n var isDiv = element.nodeName.toLowerCase() === 'div';\n if (isDiv && !textAlign) {\n textAlign = element.style.textAlign;\n }\n return isDiv;\n });\n\n /* If we found child <div> elements with text-align style attributes\n * we should fix this by:\n *\n * 1) Unwrapping each <div> which has a text-align style\n * 2) Insert a <br> element after each set of 'unwrapped' div children\n * 3) Set the text-align style of the parent block element\n */\n if (childDivs.length) {\n // Since we're mucking with the HTML, preserve selection\n this.saveSelection();\n childDivs.forEach(function (div) {\n if (div.style.textAlign === textAlign) {\n var lastChild = div.lastChild;\n if (lastChild) {\n // Instead of a div, extract the child elements and add a <br>\n MediumEditor.util.unwrap(div, this.options.ownerDocument);\n var br = this.options.ownerDocument.createElement('BR');\n lastChild.parentNode.insertBefore(br, lastChild.nextSibling);\n }\n }\n }, this);\n blockContainer.style.textAlign = textAlign;\n // We're done, so restore selection\n this.restoreSelection();\n }\n }", "title": "" }, { "docid": "84626391b919a3f9eb2f4a92ead8e386", "score": "0.52153116", "text": "function cleanupJustifyDivFragments(blockContainer) {\n if (!blockContainer) {\n return;\n }\n\n var textAlign,\n childDivs = Array.prototype.slice.call(blockContainer.childNodes).filter(function (element) {\n var isDiv = element.nodeName.toLowerCase() === 'div';\n if (isDiv && !textAlign) {\n textAlign = element.style.textAlign;\n }\n return isDiv;\n });\n\n /* If we found child <div> elements with text-align style attributes\n * we should fix this by:\n *\n * 1) Unwrapping each <div> which has a text-align style\n * 2) Insert a <br> element after each set of 'unwrapped' div children\n * 3) Set the text-align style of the parent block element\n */\n if (childDivs.length) {\n // Since we're mucking with the HTML, preserve selection\n this.saveSelection();\n childDivs.forEach(function (div) {\n if (div.style.textAlign === textAlign) {\n var lastChild = div.lastChild;\n if (lastChild) {\n // Instead of a div, extract the child elements and add a <br>\n MediumEditor.util.unwrap(div, this.options.ownerDocument);\n var br = this.options.ownerDocument.createElement('BR');\n lastChild.parentNode.insertBefore(br, lastChild.nextSibling);\n }\n }\n }, this);\n blockContainer.style.textAlign = textAlign;\n // We're done, so restore selection\n this.restoreSelection();\n }\n }", "title": "" }, { "docid": "84626391b919a3f9eb2f4a92ead8e386", "score": "0.52153116", "text": "function cleanupJustifyDivFragments(blockContainer) {\n if (!blockContainer) {\n return;\n }\n\n var textAlign,\n childDivs = Array.prototype.slice.call(blockContainer.childNodes).filter(function (element) {\n var isDiv = element.nodeName.toLowerCase() === 'div';\n if (isDiv && !textAlign) {\n textAlign = element.style.textAlign;\n }\n return isDiv;\n });\n\n /* If we found child <div> elements with text-align style attributes\n * we should fix this by:\n *\n * 1) Unwrapping each <div> which has a text-align style\n * 2) Insert a <br> element after each set of 'unwrapped' div children\n * 3) Set the text-align style of the parent block element\n */\n if (childDivs.length) {\n // Since we're mucking with the HTML, preserve selection\n this.saveSelection();\n childDivs.forEach(function (div) {\n if (div.style.textAlign === textAlign) {\n var lastChild = div.lastChild;\n if (lastChild) {\n // Instead of a div, extract the child elements and add a <br>\n MediumEditor.util.unwrap(div, this.options.ownerDocument);\n var br = this.options.ownerDocument.createElement('BR');\n lastChild.parentNode.insertBefore(br, lastChild.nextSibling);\n }\n }\n }, this);\n blockContainer.style.textAlign = textAlign;\n // We're done, so restore selection\n this.restoreSelection();\n }\n }", "title": "" }, { "docid": "7074f6e96ada243d875ae9913f360b28", "score": "0.521094", "text": "_resizeByColumns (imgDimensions, parentDimensions, nColumns=2) {\n const { height, width } = parentDimensions;\n\n // The gutter is 1% of the available view width\n const gutterBase = width / 100;\n const gutterSize = gutterBase * 1;\n\n // Column gutters are shared between right and left image\n const columnWidth = (width / nColumns) - (gutterSize / 2);\n\n if (this.state.columnWidth !== columnWidth) {\n this.setState({\n columnWidth\n });\n }\n\n const divider = imgDimensions.width / columnWidth;\n\n const newWidth = imgDimensions.width / divider;\n const newHeight = imgDimensions.height / divider;\n\n return { width: newWidth, height: newHeight, gutter: gutterSize };\n }", "title": "" }, { "docid": "27fb1743c57a4b8ecf139a84e310a70d", "score": "0.5187357", "text": "function getContentWidth(allColumns) {\n var defaultColWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n var contentWidth = 0;\n\n var _iterator17 = _createForOfIteratorHelper(allColumns),\n _step17;\n\n try {\n for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {\n var column = _step17.value;\n contentWidth += column.width || defaultColWidth;\n }\n } catch (err) {\n _iterator17.e(err);\n } finally {\n _iterator17.f();\n }\n\n return contentWidth;\n }", "title": "" }, { "docid": "160d60710432bac681a954a44d931f31", "score": "0.5180156", "text": "setColumnProperties(gridColumns, pdfGrid, helper, gObj, allowHorizontalOverflow) {\n let startIndex = gObj.groupSettings.columns.length;\n for (let i = 0; i < startIndex; i++) {\n pdfGrid.columns.getColumn(i).width = 20;\n }\n for (let i = 0; i < gridColumns.length; i++) {\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(gridColumns[i].textAlign)) {\n pdfGrid.columns.getColumn(i + startIndex).format = this.getHorizontalAlignment(gridColumns[i].textAlign);\n }\n // Need to add width consideration with % value\n if (pdfGrid.style.allowHorizontalOverflow && !Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(gridColumns[i].width) && allowHorizontalOverflow) {\n pdfGrid.columns.getColumn(i + startIndex).width = typeof gridColumns[i].width === 'number' ?\n gridColumns[i].width * 0.75 : helper.getConvertedWidth(gridColumns[i].width) * 0.75;\n }\n }\n }", "title": "" }, { "docid": "ae33d6b44b3537f152252d431903e651", "score": "0.5172086", "text": "adjustAllContainerWidths() {\n if(this._NUM_EXCLUSIVE_LEFT != 0)\n $(\"#\" + this._UID + \" .left.container\").css(\"width\", (this._NUM_EXCLUSIVE_LEFT * this._EXCLUSIVE_TURN_ARROW_WIDTH) - ((this._NUM_EXCLUSIVE_LEFT - 1) * this._EXCLUSIVE_ARROW_INWARD_MARGIN) + 1);\n\n \n if((this._NUM_EXCLUSIVE_THROUGH + this._NUM_SHARED_THROUGH_LEFT + this._NUM_SHARED_THROUGH_RIGHT + this._NUM_SHARED_THROUGH_LEFT_RIGHT + this._NUM_SHARED_LEFT_RIGHT) != 0) {\n\n var through_width = (this._NUM_EXCLUSIVE_THROUGH * this._EXCLUSIVE_THROUGH_ARROW_WIDTH) +\n (this._NUM_SHARED_THROUGH_LEFT * this._SHARED_THROUGH_LEFT_ARROW_WIDTH) +\n (this._NUM_SHARED_THROUGH_RIGHT * this._SHARED_THROUGH_RIGHT_ARROW_WIDTH) +\n (this._NUM_SHARED_THROUGH_LEFT_RIGHT * this._SHARED_THROUGH_LEFT_RIGHT_ARROW_WIDTH) +\n (this._NUM_SHARED_LEFT_RIGHT * this._SHARED_LEFT_RIGHT_ARROW_WIDTH) +\n 1; //a little extra space\n\n $(\"#\" + this._UID + \" .through.container\").css(\"width\", through_width);\n }\n else\n $(\"#\" + this._UID + \" .through.container\").css(\"width\", this._EXCLUSIVE_THROUGH_ARROW_WIDTH);\n \n \n if(this._NUM_EXCLUSIVE_RIGHT + this._NUM_CHANNELIZED_RIGHT != 0) {\n \n var right_width = (this._NUM_EXCLUSIVE_RIGHT * this._EXCLUSIVE_TURN_ARROW_WIDTH) -\n ((this._NUM_EXCLUSIVE_RIGHT + this._NUM_CHANNELIZED_RIGHT - 1) * this._EXCLUSIVE_ARROW_INWARD_MARGIN) + // if exclusive rights are present, factor in margins\n (this._NUM_CHANNELIZED_RIGHT * this._CHANNELIZED_RIGHT_ARROW_WIDTH) +\n 1; //a little extra space\n\n \n $(\"#\" + this._UID + \" .right.container\").css(\"width\", right_width);\n }\n }", "title": "" }, { "docid": "7ab10beef160b764c23db3408d06f3b1", "score": "0.51682657", "text": "squeezeChildrenToLeftInLastRow() {\n const divWidth = this[$flexedDiv].prop('clientWidth');\n const childrenInOneRow = Math.floor(divWidth / this[childHorizontalSpace]);\n const missingChildrenInLastRow = childrenInOneRow - (this[childrenCount] % childrenInOneRow);\n let marginRestored = false;\n\n if (missingChildrenInLastRow < childrenInOneRow) {\n const gapsExtraSpacePerChild = (divWidth - (childrenInOneRow * this[childHorizontalSpace]))\n / childrenInOneRow;\n const freeSpaceLeft = missingChildrenInLastRow * (this[childHorizontalSpace]\n + gapsExtraSpacePerChild);\n\n this[lastChild].css('marginRight', freeSpaceLeft + this[childMarginRight]);\n\n console.log(dedent`FlexSpaceAroundHelper(run):\n divWidth = ${divWidth};\n childrenInOneRow = ${childrenInOneRow};\n gapsExtraSpacePerChild = ${gapsExtraSpacePerChild};\n missingChildrenInLastRow = ${missingChildrenInLastRow};\n freeSpaceLeft = ${freeSpaceLeft}`);\n } else if (!marginRestored) {\n restoreMargin(this);\n marginRestored = true;\n }\n }", "title": "" }, { "docid": "b0a7eafa90687d717cda9d3e07f9e2e2", "score": "0.51670253", "text": "calculateColumnWidths(columns, parentTableWidth) {\n\t\tlet tableWidth = parentTableWidth - 12; // subtract 12 for the left padding scss $spacing-04\n\t\tif (this.props.rowSelection !== ROW_SELECTION.SINGLE) {\n\t\t\ttableWidth -= 40;\n\t\t}\n\t\tlet remainingColumns = columns.length; // keep track of how many columns to calculate width for\n\t\tlet maxWeight = 0;\n\n\t\tfor (const columnDef of columns) {\n\t\t\t// if columns have specific width subtract from total width\n\t\t\tif (columnDef.width) {\n\t\t\t\tif (typeof columnDef.width === \"string\" && columnDef.width.includes(\"px\")) {\n\t\t\t\t\ttableWidth -= parseInt(columnDef.width, 10);\n\t\t\t\t\tremainingColumns--;\n\t\t\t\t} else {\n\t\t\t\t\tmaxWeight = Math.max(maxWeight, columnDef.width); // keep track of which column has highest width provided\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst widths = [];\n\t\tconst defaultWidth = Math.floor(tableWidth / remainingColumns); // use default width for columns without a weight\n\t\tconst weightedWidths = [];\n\t\tlet sumWeightedWidths = 0;\n\n\t\t// scale weight of columns with width provided\n\t\tfor (const columnDef of columns) {\n\t\t\tif (columnDef.width && !isNaN(columnDef.width)) {\n\t\t\t\tweightedWidths.push(columnDef.width / maxWeight);\n\t\t\t\tsumWeightedWidths += (columnDef.width / maxWeight);\n\t\t\t} else {\n\t\t\t\tweightedWidths.push(null);\n\t\t\t}\n\t\t}\n\n\t\tconst scaledWidth = tableWidth / sumWeightedWidths; // scaled width multiplier for each column with width provided\n\n\t\tlet sumColumnWidth = 0;\n\t\tfor (let idx = 0; idx < columns.length; idx++) {\n\t\t\tconst columnDef = columns[idx];\n\t\t\tif (columnDef.width) {\n\t\t\t\t// use the width provided with 'px' as is\n\t\t\t\tif (typeof columnDef.width === \"string\" && columnDef.width.includes(\"px\")) {\n\t\t\t\t\twidths.push(Math.floor(parseInt(columnDef.width, 10)) + \"px\");\n\t\t\t\t\tsumColumnWidth += parseInt(columnDef.width, 10);\n\t\t\t\t} else { // multiply the width provided by the scaled width\n\t\t\t\t\tconst calculatedWidth = Math.floor(weightedWidths[idx] * scaledWidth);\n\t\t\t\t\twidths.push(calculatedWidth + \"px\");\n\t\t\t\t\tsumColumnWidth += calculatedWidth;\n\t\t\t\t}\n\t\t\t} else { // if no width provided, use the defaultWidth\n\t\t\t\twidths.push(defaultWidth);\n\t\t\t\tsumColumnWidth += defaultWidth;\n\t\t\t}\n\t\t}\n\n\t\t// if any columns had decimals floored, allocate additional space to the first column\n\t\tlet compare = parentTableWidth;\n\t\tif (this.props.rowSelection !== ROW_SELECTION.SINGLE) {\n\t\t\tcompare -= 40;\n\t\t}\n\n\t\tif (sumColumnWidth < compare) {\n\t\t\tconst firstColWith = parseInt(widths[0], 10);\n\t\t\twidths[0] = firstColWith + compare - sumColumnWidth + \"px\";\n\t\t}\n\n\t\treturn widths;\n\t}", "title": "" }, { "docid": "ae5f0f63a7c57c34d0a5bd7bc822a272", "score": "0.51589304", "text": "layoutAlignment (computedView) {\n const { alignIndex, computedFontConfig } = this.props\n const { genericRowHeight, charFont } = computedFontConfig\n const alignChars = alignIndex.chars\n let charWidth = 0, charMetrics = {}\n alignChars.forEach ((c) => {\n let measureCanvas = this.create ('canvas', null, null, { width: genericRowHeight, height: genericRowHeight })\n let measureContext = measureCanvas.getContext('2d')\n measureContext.font = charFont\n charMetrics[c] = measureContext.measureText (c)\n charWidth = Math.max (charWidth, Math.ceil (charMetrics[c].width))\n })\n const charHeight = genericRowHeight\n\n let nextColX = 0, colX = [], colWidth = [], computedColScale = []\n // PERFORMANCE NOTE: the following is an O(L) scan in the number of alignment columns L, performed in every animation frame\n // As with the O(N) scan in layoutTree(), this could be optimized by taking hints from the view,\n // i.e. starting from a column that is known to be in the visible region, and exploring outwards from there.\n for (let col = 0; col < alignIndex.columns; ++col) {\n colX.push (nextColX)\n if (computedView.columnVisible[col]) {\n let scale = computedView.columnScale[col]\n if (typeof(scale) === 'undefined')\n scale = 1\n computedColScale.push (scale)\n const width = scale * charWidth\n colWidth.push (width)\n nextColX += width\n } else {\n computedColScale.push (0)\n colWidth.push (0)\n }\n }\n\n return { charMetrics, charWidth, charHeight, colX, colWidth, computedColScale, alignWidth: nextColX }\n }", "title": "" }, { "docid": "2912aff1f4d2eec385d5031ffcd4b1a7", "score": "0.5134751", "text": "wrapPDFColumns(docDefinition, mapping) {\r\n const that = this,\r\n styleInfo = this.styleInfo,\r\n maxPerPage = docDefinition.pageOrientation === 'portrait' ? 775 : 1155, // maximum of 775px (portrait) or 1155px (landscape) per A4 page\r\n tables = [];\r\n let currentPage = 0;\r\n\r\n for (let i = 0; i < styleInfo.widths.length; i++) {\r\n let currentWidth = styleInfo.widths[i],\r\n numericWidth = currentWidth;\r\n\r\n if (currentWidth === '*') {\r\n numericWidth = 150;\r\n }\r\n else if (currentWidth >= maxPerPage) {\r\n numericWidth = maxPerPage\r\n currentWidth = '*';\r\n }\r\n else {\r\n currentWidth /= 1.57;\r\n }\r\n\r\n if (tables[currentPage] === undefined) {\r\n const body = [];\r\n\r\n tables[currentPage] = {\r\n body: body,\r\n width: numericWidth,\r\n widths: [currentWidth],\r\n datafields: [that.datafields[i]]\r\n };\r\n mapping[i] = currentPage;\r\n continue;\r\n }\r\n\r\n const table = tables[currentPage];\r\n\r\n if (table.width + numericWidth > maxPerPage) {\r\n currentPage++;\r\n i--;\r\n continue;\r\n }\r\n\r\n mapping[i] = currentPage;\r\n table.width += numericWidth;\r\n table.widths.push(currentWidth);\r\n table.datafields.push(that.datafields[i]);\r\n }\r\n\r\n return tables;\r\n }", "title": "" }, { "docid": "26347bd40b08cd21d9dcff38b9a4f1b0", "score": "0.51333994", "text": "measureWidth() {\n // .. Calculate the cell text width.\n // .....Add border widths, cell spacings and paddings to the width.\n let width = 0;\n let layouter = new PdfStringLayouter();\n if (typeof this.objectValue === 'string') {\n /* tslint:disable */\n let slr = layouter.layout(this.objectValue, this.getTextFont(), this.stringFormat, new SizeF(Number.MAX_VALUE, Number.MAX_VALUE), false, new SizeF(0, 0));\n width += slr.actualSize.width;\n width += (this.style.borders.left.width + this.style.borders.right.width) * 2;\n }\n else if (this.objectValue instanceof PdfGrid) {\n width = this.objectValue.size.width;\n //width += this.objectValue.style.cellSpacing;\n }\n else if (this.objectValue instanceof PdfImage || this.objectValue instanceof PdfBitmap) {\n width += this.objectValue.width;\n }\n else if (this.objectValue instanceof PdfTextWebLink) {\n let webLink = this.objectValue;\n let result = layouter.layout(webLink.text, webLink.font, webLink.stringFormat, new SizeF(0, 0), false, new SizeF(0, 0));\n /* tslint:enable */\n width += result.actualSize.width;\n width += (this.style.borders.left.width + this.style.borders.right.width) * 2;\n }\n if (!(this.objectValue instanceof PdfGrid)) {\n if (this.style.cellPadding != null) {\n width += (this.style.cellPadding.left + this.style.cellPadding.right);\n }\n else {\n width += (this.row.grid.style.cellPadding.left + this.row.grid.style.cellPadding.right);\n }\n }\n else {\n if (this.style.cellPadding != null || typeof this.style.cellPadding !== 'undefined') {\n if (typeof this.style.cellPadding.left !== 'undefined' && this.style.cellPadding.hasLeftPad) {\n width += this.style.cellPadding.left;\n }\n if (typeof this.style.cellPadding.right !== 'undefined' && this.style.cellPadding.hasRightPad) {\n width += this.style.cellPadding.right;\n }\n }\n else {\n if (typeof this.row.grid.style.cellPadding.left !== 'undefined' && this.row.grid.style.cellPadding.hasLeftPad) {\n width += this.row.grid.style.cellPadding.left;\n }\n if (typeof this.row.grid.style.cellPadding.right !== 'undefined' && this.row.grid.style.cellPadding.hasRightPad) {\n width += this.row.grid.style.cellPadding.right;\n }\n }\n }\n width += this.row.grid.style.cellSpacing;\n return width;\n }", "title": "" }, { "docid": "92668afd05a6388b7b3464362b3ed73c", "score": "0.5122638", "text": "function processColumnsResized(grid){\n for (var col_index in grid.getColumns()){\n var column = grid.getColumns()[col_index];\n if (column['previousWidth'] != column['width']){ // Breite dieser Spalte wurde resized durch drag\n column['fixedWidth'] = column['width']; // Diese spalte von Kalkulation der Spalten ausnehmen\n }\n }\n // grid.getOptions()[\"rowHeight\"] = 1; //Neuberechnung der wirklich benötigten Höhe auslösen\n thiz.calculate_current_grid_column_widths(\"processColumnsResized\");\n //grid.render(); // Grid neu berechnen und zeichnen\n }", "title": "" }, { "docid": "26d2340dfb21446ee86dd8f45ce19be4", "score": "0.5107885", "text": "measureColumnsWidth() {\n let totalWidth = 0;\n this.grid.measureColumnsWidth();\n for (let i = 0, count = this.internalColumns.length; i < count; i++) {\n totalWidth += this.internalColumns[i].width;\n }\n return totalWidth;\n }", "title": "" }, { "docid": "931e682dfa5071dba99477e6e2ef0d35", "score": "0.5105195", "text": "function calculateWidths(doc, pageWidth) {\n var table = config_1.Config.tableInstance();\n // Column and table content width\n var fixedWidth = 0;\n var autoWidth = 0;\n var dynamicColumns = [];\n table.columns.forEach(function (column) {\n column.contentWidth = 0;\n table.rows.concat(table.headerRow).forEach(function (row) {\n var cell = row.cells[column.dataKey];\n cell.contentWidth = cell.padding('horizontal') + common_1.getStringWidth(cell.text, cell.styles);\n if (cell.contentWidth > column.contentWidth) {\n column.contentWidth = cell.contentWidth;\n }\n });\n table.contentWidth += column.contentWidth;\n if (typeof column.widthStyle === 'number') {\n column.preferredWidth = column.widthStyle;\n fixedWidth += column.preferredWidth;\n column.width = column.preferredWidth;\n }\n else if (column.widthStyle === 'wrap') {\n column.preferredWidth = column.contentWidth;\n fixedWidth += column.preferredWidth;\n column.width = column.preferredWidth;\n }\n else {\n column.preferredWidth = column.contentWidth;\n autoWidth += column.contentWidth;\n dynamicColumns.push(column);\n }\n table.preferredWidth += column.preferredWidth;\n });\n if (typeof table.settings.tableWidth === 'number') {\n table.width = table.settings.tableWidth;\n }\n else if (table.settings.tableWidth === 'wrap') {\n table.width = table.preferredWidth;\n }\n else {\n table.width = pageWidth - table.margin('left') - table.margin('right');\n }\n distributeWidth(dynamicColumns, fixedWidth, autoWidth, 0);\n // Row height, table height and text overflow\n var all = table.rows.concat(table.headerRow);\n all.forEach(function (row) {\n table.columns.forEach(function (col) {\n var cell = row.cells[col.dataKey];\n config_1.Config.applyStyles(cell.styles);\n var textSpace = col.width - cell.padding('horizontal');\n var k = config_1.Config.scaleFactor();\n if (cell.styles.overflow === 'linebreak') {\n // Add one pt to textSpace to fix rounding error\n try {\n cell.text = doc.splitTextToSize(cell.text, textSpace + 1 / k, { fontSize: cell.styles.fontSize });\n }\n catch (e) {\n if (e instanceof TypeError && Array.isArray(cell.text)) {\n cell.text = doc.splitTextToSize(cell.text.join(' '), textSpace + 1 / k, { fontSize: cell.styles.fontSize });\n }\n else {\n throw e;\n }\n }\n }\n else if (cell.styles.overflow === 'ellipsize') {\n cell.text = common_1.ellipsize(cell.text, textSpace, cell.styles);\n }\n else if (cell.styles.overflow === 'visible') {\n // Do nothing\n }\n else if (cell.styles.overflow === 'hidden') {\n cell.text = common_1.ellipsize(cell.text, textSpace, cell.styles, '');\n }\n else if (typeof cell.styles.overflow === 'function') {\n cell.text = cell.styles.overflow(cell.text, textSpace);\n }\n else {\n console.error(\"Unrecognized overflow type: \" + cell.styles.overflow);\n }\n var lineCount = Array.isArray(cell.text) ? cell.text.length : 1;\n var fontHeight = cell.styles.fontSize / k * config_1.FONT_ROW_RATIO;\n cell.contentHeight = lineCount * fontHeight + cell.padding('vertical');\n if (cell.contentHeight > row.height) {\n row.height = cell.contentHeight;\n row.maxLineCount = lineCount;\n }\n });\n table.height += row.height;\n });\n}", "title": "" }, { "docid": "818c111c382c4227339c199ed970ba40", "score": "0.510389", "text": "function columnWrap(value) {\r\n\t\tif (value){\r\n\t\t\treturn '<div style=\"white-space:normal !important;word-wrap: break-word;\">' + value + '</div>';\r\n\t\t}else{\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "22ad10410e64b16c72f540f923812db9", "score": "0.5091984", "text": "function docContentHeightFix() {\n // Columns' vars\n $leftCol = $('.doc-left-main-col');\n $rightCol = $('.doc-right-main-col');\n\n // Collect vars into an object\n var cols = [$leftCol,$rightCol];\n\n // Compare heights and use the larger number as the setting\n var useHeight = Math.max($leftCol.outerHeight(),$rightCol.outerHeight());\n\n $(cols).each(function(i,e) {\n $(this).css({'height':useHeight + 'px'});\n });\n\n\n}", "title": "" }, { "docid": "63481ab79e9e33ea1f29770d72c964a3", "score": "0.50900424", "text": "function scaleColumns(columns, freeSpace, colWidth, shrinkCols){\n\t\tvar oversizeCols = [],\n\t\toversizeSpace = 0,\n\t\tremainingSpace = 0,\n\t\tnextColWidth = 0,\n\t\tremainingFlexGrowUnits = flexGrowUnits,\n\t\tgap = 0,\n\t\tchangeUnits = 0,\n\t\tundersizeCols = [];\n\n\t\tfunction calcGrow(col){\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\n\t\t}\n\n\t\tfunction calcShrink(col){\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\n\t\t}\n\n\t\tcolumns.forEach(function(col, i){\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\n\t\t\tif(col.column.minWidth >= width){\n\t\t\t\toversizeCols.push(col);\n\t\t\t}else{\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\n\t\t\t\t\tcol.width = col.column.maxWidth;\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\n\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\n\n\t\t\t\t\tif(remainingFlexGrowUnits){\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tundersizeCols.push(col);\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif(oversizeCols.length){\n\t\t\toversizeCols.forEach(function(col){\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\n\t\t\t\tcol.width = col.column.minWidth;\n\t\t\t});\n\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\n\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\n\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\n\t\t}else{\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\n\n\t\t\tundersizeCols.forEach(function(column){\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\n\t\t\t});\n\t\t}\n\n\t\treturn gap;\n\t}", "title": "" }, { "docid": "def989c5cbac2ccbabdbc55cdfb17f9f", "score": "0.5071792", "text": "function wfalign (){\n var blocks = getBlocks()\n , stacks\n ;\n\n if (blocks) {\n stacks = stackRows(blocks);\n forceHeights(stacks);\n // Doing it twice because of a bug\n stacks = stackRows(blocks);\n forceHeights(stacks);\n }\n }", "title": "" }, { "docid": "f1c41cde7c7d29980000655ea88dae26", "score": "0.50700164", "text": "static formatGrid(grid, padLeft = true, columnWidth = null, individualWidths = false) {\n // double check that there's non string values\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n let val = grid[i][j];\n if (typeof val !== 'string') {\n if (val === null || val === undefined) {\n grid[i][j] = '';\n } else {\n grid[i][j] = '' + grid[i][j];\n }\n }\n }\n }\n if (!individualWidths) {\n if (columnWidth === null) {\n // get longest string that we'll use for data\n columnWidth = grid.reduce((l, row) => {\n let l2 = row.reduce((carry, d) => {\n return carry > d.length ? carry : d.length;\n }, 0);\n return l > l2 ? l : l2;\n }, 0);\n }\n return grid.map(row => {\n return row.map(str => {\n if (padLeft) {\n return str.padStart(columnWidth)\n } else {\n return str.padEnd(columnWidth);\n }\n });\n });\n } else {\n let widths = [];\n grid.forEach(row => {\n row.forEach((str, i) => {\n if (!widths[i]) {\n widths[i] = str.length || 0;\n return;\n }\n let prev = widths[i];\n if (str.length > prev) {\n widths[i] = str.length || 0;\n }\n })\n });\n return grid.map(row => {\n return row.map((str, i) => {\n if (padLeft) {\n return str.padStart(widths[i])\n } else {\n return str.padEnd(widths[i]);\n }\n });\n });\n }\n }", "title": "" }, { "docid": "2c73911303fdd4aead08ebc5c0413fe5", "score": "0.5044174", "text": "calculateColumnWidths() {\n var column, n, l;\n\n this.minimumWidth = 0;\n\n for (n = 0, l = this.columns.length; n < l; n++) {\n column = this.columns[n];\n\n if (column.width) {\n this.minimumWidth += column.width;\n } else {\n column.width = 100;\n this.minimumWidth += 100;\n }\n }\n }", "title": "" }, { "docid": "f974e5e494034bb124097b012ee2427e", "score": "0.50125164", "text": "function colfreeze(title_div, data_div, title_table, data_table, bSecond)\r\n{\r\n // This is just for testing purposes\r\n\t//if (getElemnt(title_div))\r\n\t//{\r\n\t//\tgetElemnt(title_div).style.visibility = 'visible';\r\n\t// getElemnt(data_div).style.visibility = 'visible';\r\n\t//}\r\n\t\r\n\t\t// align columns\r\n\t align2TableCols(title_table, data_table);\r\n\t\r\n\t //align tables\r\n\t //alignTables(title_table, data_table);\r\n\t\r\n\t // align divs which holds the tables\r\n\t if (bSecond)\r\n\t {\r\n\t \tadjustOuterDivs(title_div, data_div, data_table);\r\n\t }\r\n}", "title": "" }, { "docid": "8edcdec756344cd44ce7cdbdd0eac219", "score": "0.5004662", "text": "algoColumns() {\n let canvasWidth = this.canvasWidth -this.ml -this.mr;\n if (!this.columns && this.w) {\n /**\n * calculate columns if only width is known */\n this.columns = canvasWidth / this.w;\n }else if(this.columns && !this.w) {\n /**\n * calculate width if only columns are known */\n this.w = canvasWidth / this.columns;\n }\n let i = 0, dx;\n for (; i <= this.columns; i++) {\n dx = i * (this.w + this.horizgaps) + this.ml;\n this.columnCoords.push(dx);\n if (this.horizgaps) {\n dx += this.horizgaps;\n this.columnCoords.push(dx);\n }\n }\n }", "title": "" }, { "docid": "38b5715462ed2f22bff35ca9470eb22b", "score": "0.4998086", "text": "function setColumns() {\n var windowWidth = $(window).width(),\n columnNumber = splitColumns(),\n postWidth = Math.floor(windowWidth / columnNumber);\n\n // container.find('.portfolio-item').each(function() {\n // $(this).css({\n // width: postWidth + 'px'\n // });\n // });\n }", "title": "" }, { "docid": "ba5625bac233b939002adcf178f2b8d9", "score": "0.49892733", "text": "function arrangeItems(itemEls, columnsCount, containerEl, elHeight) {\n let $containerEl = $(containerEl);\n\n // Set height of elements\n let elWidth = $containerEl.width() / columnsCount;\n elHeight = elHeight || elWidth;\n\n for (let i = 0; i < itemEls.length; i++) {\n let $item = $(itemEls[i]);\n $item.data(\"index\", i);\n let pos = {\n x: i % columnsCount,\n y: Math.floor(i / columnsCount)\n };\n\n $item.css({\n top: pos.y * elHeight + \"px\",\n left: pos.x * elWidth + \"px\",\n width: \"calc(\" + 100 / columnsCount + \"% - 10px)\",\n height: \"calc(\" + elHeight + \"px - 10px)\",\n boxSizing: \"border-box\"\n });\n }\n }", "title": "" }, { "docid": "71134ff7ca1c3c81aaf9b9ad6cb47327", "score": "0.49526453", "text": "function populateColumnsLayoutWidth(el) {\n const column_rows = el.find('div[data-name=\"columns\"]').slice(1);\n\n const page_id = $(\"#post_ID\").val();\n let current_values = [];\n\n $.ajax({\n\n url: custom.ajax_url,\n type: \"post\",\n async: false,\n ContentType: \"application/json\",\n\n data: {\n action: \"get_width_values\",\n page_id: page_id,\n columns_count: column_rows.length,\n },\n\n success: function(html) {\n current_values = JSON.parse(html);\n },\n\n });\n\n $.each(column_rows, function(counter) {\n\n let node_length = $(this)\n .children(\".acf-input\")\n .children(\".acf-repeater\")\n .children(\".acf-table\")\n .children(\"tbody\")\n .children(\"tr\").length;\n\n node_length -= 1;\n\n let options = [];\n let thumb = [];\n\n switch (node_length) {\n\n case 1:\n\n options = [\"10\", \"8\"];\n\n thumb = [\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '10.png\" alt=\"10 thumb\"/>',\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '8.png\" alt=\"8 thumb\"/>',\n ];\n\n break;\n\n case 2:\n\n options = [\"7_5\", \"5_7\", \"6_6\"];\n\n thumb = [\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '7_5.png\" alt=\"7_5 thumb\"/>',\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '5_7.png\" alt=\"5_7 thumb\"/>',\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '6_6.png\" alt=\"6_6 thumb\"/>',\n ];\n\n break;\n\n case 3:\n\n options = [\"6_3_3\", \"3_3_6\", \"4_4_4\"];\n\n thumb = [\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '6_3_3.png\" alt=\"6_3_3 thumb\"/>',\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '3_3_6.png\" alt=\"3_3_6 thumb\"/>',\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '4_4_4.png\" alt=\"4_4_4 thumb\"/>',\n ];\n\n break;\n\n case 4:\n\n options = [\"3_3_3_3\"];\n\n thumb = [\n '<img class=\"thumbs\" src=\"' +\n thumbs_dir +\n '3_3_3_3.png\" alt=\"3_3_3_3 thumb\"/>',\n ];\n\n break;\n\n }\n\n const ul = $(this)\n .parents(\"div.acf-fields\")\n .children('div[data-name=\"option_columns_width\"]')\n .find(\"ul.acf-radio-list\");\n\n ul.empty();\n\n for (let i = 0; i < options.length; i++) {\n\n const value = current_values[counter];\n let li = '';\n\n if (value === options[i]) {\n\n li =\n '<li><label class=\"selected\"><input type=\"radio\" name=\"columns_width_' +\n counter +\n '\" value=\"' +\n options[i] +\n '\" checked=\"checked\">' +\n thumb[i] +\n \"</label></li>\";\n\n } else {\n\n li =\n '<li><label><input type=\"radio\" name=\"columns_width_' +\n counter +\n '\" value=\"' +\n options[i] +\n '\">' +\n thumb[i] +\n \"</label></li>\";\n }\n\n ul.prepend(li);\n\n }\n\n });\n }", "title": "" }, { "docid": "4af73c43c1e22a77b08fb4cc673a768d", "score": "0.49378654", "text": "rebuildColumns() {\n this.correctColumnsWidthArray();\n this._private.htmlCache.rowTemplate = null;\n this.cacheRowTemplate(null);\n this.rebuildGridHeaderHtml();\n this.fillDataInRows(true);\n this.correctRowAndScrollbodyWidth();\n this.updateSelectionOnAllRows();\n this.updateGridScrollbars();\n this.fixHeaderWithBody();\n }", "title": "" }, { "docid": "4fc81bedf0048990dd9588a0bac1a8de", "score": "0.4917028", "text": "function scaleColumns(columns, freeSpace, colWidth, shrinkCols) {\n\n\t\t\t\tvar oversizeCols = [],\n\t\t\t\t oversizeSpace = 0,\n\t\t\t\t remainingSpace = 0,\n\t\t\t\t nextColWidth = 0,\n\t\t\t\t gap = 0,\n\t\t\t\t changeUnits = 0,\n\t\t\t\t undersizeCols = [];\n\n\t\t\t\tfunction calcGrow(col) {\n\n\t\t\t\t\treturn colWidth * (col.column.definition.widthGrow || 1);\n\t\t\t\t}\n\n\t\t\t\tfunction calcShrink(col) {\n\n\t\t\t\t\treturn calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0);\n\t\t\t\t}\n\n\t\t\t\tcolumns.forEach(function (col, i) {\n\n\t\t\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\n\n\t\t\t\t\tif (col.column.minWidth >= width) {\n\n\t\t\t\t\t\toversizeCols.push(col);\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tundersizeCols.push(col);\n\n\t\t\t\t\t\tchangeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (oversizeCols.length) {\n\n\t\t\t\t\toversizeCols.forEach(function (col) {\n\n\t\t\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\n\n\t\t\t\t\t\tcol.width = col.column.minWidth;\n\t\t\t\t\t});\n\n\t\t\t\t\tremainingSpace = freeSpace - oversizeSpace;\n\n\t\t\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace;\n\n\t\t\t\t\tgap = remainingSpace - nextColWidth * changeUnits;\n\n\t\t\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\n\t\t\t\t} else {\n\n\t\t\t\t\tgap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace;\n\n\t\t\t\t\tundersizeCols.forEach(function (column) {\n\n\t\t\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn gap;\n\t\t\t}", "title": "" }, { "docid": "4fc81bedf0048990dd9588a0bac1a8de", "score": "0.4917028", "text": "function scaleColumns(columns, freeSpace, colWidth, shrinkCols) {\n\n\t\t\t\tvar oversizeCols = [],\n\t\t\t\t oversizeSpace = 0,\n\t\t\t\t remainingSpace = 0,\n\t\t\t\t nextColWidth = 0,\n\t\t\t\t gap = 0,\n\t\t\t\t changeUnits = 0,\n\t\t\t\t undersizeCols = [];\n\n\t\t\t\tfunction calcGrow(col) {\n\n\t\t\t\t\treturn colWidth * (col.column.definition.widthGrow || 1);\n\t\t\t\t}\n\n\t\t\t\tfunction calcShrink(col) {\n\n\t\t\t\t\treturn calcWidth(col.width) - colWidth * (col.column.definition.widthShrink || 0);\n\t\t\t\t}\n\n\t\t\t\tcolumns.forEach(function (col, i) {\n\n\t\t\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\n\n\t\t\t\t\tif (col.column.minWidth >= width) {\n\n\t\t\t\t\t\toversizeCols.push(col);\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tundersizeCols.push(col);\n\n\t\t\t\t\t\tchangeUnits += shrinkCols ? col.column.definition.widthShrink || 1 : col.column.definition.widthGrow || 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (oversizeCols.length) {\n\n\t\t\t\t\toversizeCols.forEach(function (col) {\n\n\t\t\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\n\n\t\t\t\t\t\tcol.width = col.column.minWidth;\n\t\t\t\t\t});\n\n\t\t\t\t\tremainingSpace = freeSpace - oversizeSpace;\n\n\t\t\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace;\n\n\t\t\t\t\tgap = remainingSpace - nextColWidth * changeUnits;\n\n\t\t\t\t\tgap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\n\t\t\t\t} else {\n\n\t\t\t\t\tgap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace;\n\n\t\t\t\t\tundersizeCols.forEach(function (column) {\n\n\t\t\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn gap;\n\t\t\t}", "title": "" }, { "docid": "7968dc2481dfa65ef516a1e028e0d4ad", "score": "0.4913268", "text": "function docContentHeightFix() {\n // Columns' vars\n $leftCol = $('.doc-left-main-col');\n $rightCol = $('.doc-right-main-col');\n\n // Collect vars into an object\n var cols = [$leftCol,$rightCol];\n\n // Compare heights and use the larger number as the setting\n var useHeight = Math.max($leftCol.outerHeight(),$rightCol.outerHeight());\n\n $(cols).each(function(i,e) {\n $(this).css({'height':useHeight + 'px'});\n });\n}", "title": "" }, { "docid": "c3f9d08e788117d9bad57bda0931ea0a", "score": "0.4904383", "text": "function redistributeColumnItems(columnInfo, columnWidth){\n\n var originalHeight = 0;\n var columnHeight = 0;\n var objTiles = [];\n var cordX = 0, cordY = 0;\n\n for(var i = 0; i<columnInfo[1].length; i++){\n var tileID = columnInfo[1][i];\n var currentTile = g_arrNestedItems[columnInfo[1][i]];\n columnHeight += currentTile.dimHeight;\n if(i==0){\n var sizes = resizeToNewWidth(tileID, columnWidth, true);\n originalHeight += sizes.dimHeight;\n objTiles.push([columnInfo[1][i], sizes.dimHeight]);\n continue;\n }\n originalHeight += currentTile.dimHeight;\n objTiles.push([tileID, currentTile.dimHeight]);\n }\n\n cordX = currentTile.left;\n cordY = currentTile.top;\n\n var tempHeight = columnHeight;\n var output = [];\n\n for(var i = objTiles.length-1; i>=0; i--){\n var tileID = objTiles[i][0];\n var newHeight;\n if(i != 0) {\n newHeight = Math.max(Math.round(columnHeight*1/3),Math.floor(objTiles[i][1] * (columnHeight / originalHeight)));\n tempHeight = tempHeight - newHeight;\n sizes = resizeToNewHeight(tileID, newHeight, true);\n sizes.left = cordX;\n sizes.top = cordY;\n output.push({\"tileID\": tileID, \"sizes\": sizes});\n cordY += sizes.dimHeight;\n } else {\n newHeight = tempHeight;\n sizes = resizeToNewHeight(tileID, newHeight, true);\n sizes.left = cordX;\n sizes.top = cordY;\n output.push({\"tileID\": tileID, \"sizes\": sizes});\n }\n }\n return output;\n }", "title": "" }, { "docid": "c3f9d08e788117d9bad57bda0931ea0a", "score": "0.4904383", "text": "function redistributeColumnItems(columnInfo, columnWidth){\n\n var originalHeight = 0;\n var columnHeight = 0;\n var objTiles = [];\n var cordX = 0, cordY = 0;\n\n for(var i = 0; i<columnInfo[1].length; i++){\n var tileID = columnInfo[1][i];\n var currentTile = g_arrNestedItems[columnInfo[1][i]];\n columnHeight += currentTile.dimHeight;\n if(i==0){\n var sizes = resizeToNewWidth(tileID, columnWidth, true);\n originalHeight += sizes.dimHeight;\n objTiles.push([columnInfo[1][i], sizes.dimHeight]);\n continue;\n }\n originalHeight += currentTile.dimHeight;\n objTiles.push([tileID, currentTile.dimHeight]);\n }\n\n cordX = currentTile.left;\n cordY = currentTile.top;\n\n var tempHeight = columnHeight;\n var output = [];\n\n for(var i = objTiles.length-1; i>=0; i--){\n var tileID = objTiles[i][0];\n var newHeight;\n if(i != 0) {\n newHeight = Math.max(Math.round(columnHeight*1/3),Math.floor(objTiles[i][1] * (columnHeight / originalHeight)));\n tempHeight = tempHeight - newHeight;\n sizes = resizeToNewHeight(tileID, newHeight, true);\n sizes.left = cordX;\n sizes.top = cordY;\n output.push({\"tileID\": tileID, \"sizes\": sizes});\n cordY += sizes.dimHeight;\n } else {\n newHeight = tempHeight;\n sizes = resizeToNewHeight(tileID, newHeight, true);\n sizes.left = cordX;\n sizes.top = cordY;\n output.push({\"tileID\": tileID, \"sizes\": sizes});\n }\n }\n return output;\n }", "title": "" }, { "docid": "c15dd0e2e42351f7f079b297da3caf32", "score": "0.48916602", "text": "function getContentWidth(allColumns, defaultColWidth) {\n if (defaultColWidth === void 0) { defaultColWidth = 300; }\n var contentWidth = 0;\n for (var _i = 0, allColumns_1 = allColumns; _i < allColumns_1.length; _i++) {\n var column = allColumns_1[_i];\n contentWidth += (column.width || defaultColWidth);\n }\n return contentWidth;\n}", "title": "" }, { "docid": "c15dd0e2e42351f7f079b297da3caf32", "score": "0.48916602", "text": "function getContentWidth(allColumns, defaultColWidth) {\n if (defaultColWidth === void 0) { defaultColWidth = 300; }\n var contentWidth = 0;\n for (var _i = 0, allColumns_1 = allColumns; _i < allColumns_1.length; _i++) {\n var column = allColumns_1[_i];\n contentWidth += (column.width || defaultColWidth);\n }\n return contentWidth;\n}", "title": "" }, { "docid": "bda71bdbc20af0229b5a7b506e946355", "score": "0.48855558", "text": "function resize_columns()\n{\n var $imgs = $(\"#items img\");\n\n $imgs.each(function() {\n var width = this.width;\n\n if(width > 180)\n this.width = 180\n\n if(width > 80) {\n var $ourDiv = $(this).parent( 'a' ).parent('div'),\n $next = $ourDiv.next('div');\n\n $ourDiv.removeClass('col-sm-1').addClass('col-sm-2');\n $next.removeClass('col-sm-9').addClass('col-sm-8');\n }\n });\n}", "title": "" }, { "docid": "657ae7f6a6947d5d4500b9dbb180d7a1", "score": "0.48837098", "text": "autoSize () {\n var viewWidth = _viewWidth.get(this)\n\n /* size */\n this.forEach(column => {\n column.generateWidth()\n column.generateMinWidth()\n })\n\n /* adjust if user set a min or maxWidth */\n this.forEach(column => {\n if (t.isDefined(column.maxWidth) && column.generatedWidth > column.maxWidth) {\n column.generatedWidth = column.maxWidth\n }\n\n if (t.isDefined(column.minWidth) && column.generatedWidth < column.minWidth) {\n column.generatedWidth = column.minWidth\n }\n })\n\n var width = {\n total: this.totalWidth(),\n view: viewWidth,\n diff: this.totalWidth() - viewWidth,\n totalFixed: this.totalFixedWidth(),\n totalResizable: Math.max(viewWidth - this.totalFixedWidth(), 0)\n }\n\n /* adjust if short of space */\n if (width.diff > 0) {\n /* share the available space between resizeable columns */\n let resizableColumns = this.getResizable()\n resizableColumns.forEach(column => {\n column.generatedWidth = Math.floor(width.totalResizable / resizableColumns.length)\n })\n\n /* at this point, the generatedWidth should never end up bigger than the contentWidth */\n var grownColumns = this.filter(column => column.generatedWidth > column.contentWidth)\n var shrunkenColumns = this.filter(column => column.generatedWidth < column.contentWidth)\n var salvagedSpace = 0\n grownColumns.forEach(column => {\n var currentGeneratedWidth = column.generatedWidth\n column.generateWidth()\n salvagedSpace += currentGeneratedWidth - column.generatedWidth\n })\n shrunkenColumns.forEach(column => {\n column.generatedWidth += Math.floor(salvagedSpace / shrunkenColumns.length)\n })\n\n /* if, after autosizing, we still don't fit within viewWidth then give up */\n }\n\n return this\n }", "title": "" }, { "docid": "358b29b5fd779b572f396c9358beed15", "score": "0.4883468", "text": "function Resize_Columns(cmdi, min_length, extra_length) {\n // th_td - usado no selector sera' igual a \"th\" ou \"td\" (td e' usado nos casos de tables sem headers)\n // sColumns - Nome das colunas (sem o no. da linha ou theader)\n // MinLengths - Qtde. de caracteres minimos p/ determinada coluna. \n // E' usado quando ha outras tbls, pois a(s) coluna(s) que estao no mesmo alinhamento tem um minimo de caracteres\n // maior que o minimo de caracteres da tbl 'master'. Obs: linhas contem: id;value\n // MinLengths - Qtde. de caracteres maximos p/ determinada coluna. \n // E' usado para limitar o tamanho da coluna como por exemplo na tabela de IBPTs que tem colunas somente c/ labels\n // c/ \"VarChar(1000)\" ou na tabela MST onde DataHora deve ser limitado somente p/ conter a largura da Data. Obs: linhas contem: id;value\n // min_length - E' usado p/ informar a quantidade minima de caracteres padrao.\n // quando aMinLengths nao especificar a quantidade minima de caracteres.\n //extra_length - E' usado quando ha' colunas dinamicas (podem ser exibidas ou ocultas), como por exemplo, Tamanhos de MPDs;\n // Ex. e' informado a quantidade de caracteres minimos que as demais colunas precisam ter (No. de colunas * quantidade minima de caracteres)\n\n if (cmdi.fitcontent) {\n var elements, selector, wlength, twidth, w, max_length, th_td, smin, smax, sColumns, ncols, vmin_length, id_first_tr, elength\n\n ncols = 0\n twidth = 0\n vmin_length = min_length\n th_td = (cmdi.header.show) ? \"th\" : \"td\"\n sColumns = split_csv(cmdi.columns)\n\n if (cmdi.drilldown) { sColumns.unshift(cmdi.start_name + \"_DrillDown\") }\n if (sColumns.indexOf(cmdi.start_name + \"_Img\") < 0) { sColumns.unshift(cmdi.start_name + \"_Selecao\") }\n\n for (var i = 0; i <= sColumns.length - 1; i++) {\n column_name = sColumns[i]\n elements = $(\"#\" + cmdi.table_name + \" td:not(:hidden)[id^='\" + column_name + \"']\").find('input, select, label, img, textarea, :checkbox')\n\n if (elements.length > 0) {\n id_first_tr = elements[0].closest(\"tr\").id\n\n if (id_first_tr.indexOf(\"_tr_\") >= 0 || id_first_tr.indexOf(\"_tr1_\") >= 0) // P/ computar somente os tds da primeira tr.\n {\n smin = $.grep(cmdi.itens.MinLengths, function (e) { return e.startsWith(column_name) });\n min_length = (smin.length) ? parseInt(split_csv(smin[0])[1]) : vmin_length\n\n smax = $.grep(cmdi.itens.MaxLengths, function (e) { return e.startsWith(column_name) });\n max_length = (smax.length) ? parseInt(split_csv(smax[0])[1]) : 250\n\n selector = \"#\" + cmdi.table_name + \" \" + th_td + \"[id^='\" + column_name + \"']\"\n wlength = (th_td == \"th\") ? $(selector).children().text().length : min_length\n\n if (elements.first().is(\"input, textarea\")) {\n for (var j = 0; j <= elements.length - 1; j++) {\n elength = $(elements[j]).val().length\n wlength = elength > wlength ? elength : wlength\n }\n w = textWidth(\"large\", wlength, min_length, max_length)\n }\n else if (elements.first().is(\"select\")) {\n for (var j = 0; j <= elements.length - 1; j++) {\n elength = $(elements[j]).find(\":selected\").text().length\n wlength = elength > wlength ? elength : wlength\n }\n w = textWidth(\"large\", wlength, min_length, max_length)\n }\n else if (elements.first().is(\"label\")) {\n for (var j = 0; j <= elements.length - 1; j++) {\n elength = $(elements[j]).text().length\n wlength = elength > wlength ? elength : wlength\n }\n w = textWidth(\"medium\", wlength, min_length, max_length)\n }\n else if (elements.first().is(\"img\")) {\n w = elements.first().height() // Como altura e largura sao iguais usa height como referencia, visto que, width esta' c/ 100%\n }\n else if (elements.first().is(\":checkbox\")) {\n w = textWidth(\"large\", 5, 0, max_length)\n }\n\n $(selector).css('width', w + \"px\")\n twidth += w\n ncols += 1\n }\n }\n }\n\n if (twidth > 0) {\n // (ncols * 2) e' usado p/ computar os 'pixels' das bordas das celulas.\n var table_width = twidth + (ncols * 2) + (extra_length > 0 ? textWidth(\"large\", extra_length, 0, 2000) : 0)\n $(\"#\" + cmdi.table_name).css('width', table_width + \"px\")\n }\n }\n else if (cmdi.resize && (cmdi.table_width)) {\n $(\"#\" + cmdi.table_name).css('width', cmdi.table_width)\n }\n}", "title": "" }, { "docid": "75a2f01535521c110e0de3ebd890c01b", "score": "0.48834282", "text": "function wrapLists() {\n $('table.awe-ajaxlist:not([wrapped])').each(function () {\n var columns = $(this).find('thead th').length;\n var mw = $(this).data('mw');\n if (columns || mw) {\n mw = mw || columns * 120;\n\n $(this).wrap('<div style=\"width:100%; overflow:auto;\"></div>')\n .wrap('<div style=\"min-width:' + mw + 'px;padding-bottom:2px;\"></div>')\n .attr('wrapped', 'wrapped');\n }\n });\n}", "title": "" }, { "docid": "eff92dbb6f0958ed959370428784f357", "score": "0.48666537", "text": "function updateMainColWidth(){\n \n if (OPTIONS.Layout.swMainOpt == false){\n colOpt = 0;\n $(\"#swMainOptions\").hide();\n } else{\n colOpt = OPTIONS.Layout.swMainOpt_Width;\n $(\"#swMainOptions\").show();\n }\n\n if (OPTIONS.Layout.swMainProject == false){\n colProj = 0;\n $(\"#swMainProject\").hide();\n }else {\n colProj = OPTIONS.Layout.swMainProject_Width;\n $(\"#swMainProject\").show();\n }\n \n if (OPTIONS.Layout.swMainNav == false ){\n colNav = 0;\n $(\"#swMainNav\").hide();\n }else {\n colNav = OPTIONS.Layout.swMainNav_Width;\n $(\"#swMainNav\").show();\n }\n\n if (OPTIONS.Layout.swMainEditor_2 == false ){\n colEditor_2 = 0;\n setActiveEditor(1);\n $(\"#swMainContent_2\").hide();\n }else {\n colEditor_2 = OPTIONS.Layout.swMainEditor_2_Width;\n $(\"#swMainContent_2\").show();\n }\n\n if (OPTIONS.Layout.MenuFont.enabled == false ){\n $(\"#swMenuFont\").hide();\n }else {\n $(\"#swMenuFont\").show();\n }\n\n //now remove class and set new\n $(\"#swMainProject\").removeClass($(\"#swMainProject\").attr('class'));\n $(\"#swMainProject\").addClass(\"colSW col-sm-\"+colProj);\n\n $(\"#swMainNav\").removeClass($(\"#swMainNav\").attr('class'));\n $(\"#swMainNav\").addClass(\"colSW col-sm-\"+colNav);\n\n $(\"#swMainOptions\").removeClass($(\"#swMainOptions\").attr('class'));\n $(\"#swMainOptions\").addClass(\"colSW col-sm-\"+colOpt);\n\n var colW = 12-(colOpt+colNav+colProj+colEditor_2);\n $(\"#swMainContent_1\").removeClass($(\"#swMainContent_1\").attr('class'));\n $(\"#swMainContent_1\").addClass(\"colSW col-sm-\"+colW);\n $(\"#swMainContent_2\").removeClass($(\"#swMainContent_2\").attr('class'));\n $(\"#swMainContent_2\").addClass(\"colSW col-sm-\"+colEditor_2);\n \n if ($(\"#swMainContent_2\").attr(\"value\") == \"off\" | OPTIONS.Layout.swMainEditor_2 == false){\n setActiveEditor(1);\n };\n}", "title": "" }, { "docid": "b44b16f930f4dfad33d36b7d26c4f3ed", "score": "0.48640603", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) {\n return;\n }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) {\n if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter) {\n view[i].gutter.style.left = left;\n }\n if (view[i].gutterBackground) {\n view[i].gutterBackground.style.left = left;\n }\n }\n var align = view[i].alignable;\n if (align) {\n for (var j = 0; j < align.length; j++) {\n align[j].style.left = left;\n }\n }\n }\n }\n if (cm.options.fixedGutter) {\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }\n }", "title": "" }, { "docid": "8b4210bdd29f149b246de5fb59f8fd90", "score": "0.48425722", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (display.alignWidgets || display.gutters.firstChild && cm.options.fixedGutter) {\n for (var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft, gutterW = display.gutters.offsetWidth, left = comp + \"px\", i = 0; i < view.length; i++) if (!view[i].hidden) {\n cm.options.fixedGutter && (view[i].gutter && (view[i].gutter.style.left = left), \n view[i].gutterBackground && (view[i].gutterBackground.style.left = left));\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++) align[j].style.left = left;\n }\n cm.options.fixedGutter && (display.gutters.style.left = comp + gutterW + \"px\");\n }\n }", "title": "" }, { "docid": "3885f4e11d7e4101bdfcb5c5f315664d", "score": "0.48394388", "text": "function alignHorizontally(cm) {\n var display = cm.display\n , view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter))\n return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth\n , left = comp + \"px\";\n for (var i = 0; i < view.length; i++)\n if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align)\n for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "13cd664406632328b9dffef8b726d6f3", "score": "0.48356974", "text": "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter && view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "7d7e615aadcf5f7849e1f486b5f5453f", "score": "0.48265958", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "title": "" }, { "docid": "89169712a7f9570f47f818d127b4da10", "score": "0.48241645", "text": "function getJustifiedData(){\n\t\t\n\t\tvar galleryWidth = getParentWidth();\n\t\t\n\t\tvar objTiles = g_thumbs.getThumbs();\n\t\tvar rowHeightOpt = g_options.tiles_justified_row_height;\n\t\tvar arrWidths = [];\n\t\tvar totalWidth = 0;\n\t\tvar gap = g_options.tiles_justified_space_between;\n\t\tvar numTiles = objTiles.length;\n\t\t\n\t\t//get arr widths and total width\n\t\tjQuery.each(objTiles, function(index, objTile){\n\t\t\tobjTile = jQuery(objTile);\n\t\t\t\n\t\t\tvar objItem = g_thumbs.getItemByThumb(objTile);\n\t\t\t\n\t\t\tvar tileWidth = objItem.thumbWidth;\n\t\t\tvar tileHeight = objItem.thumbHeight;\n\t\t\t\n\t\t\tif (tileHeight !== rowHeightOpt) \n\t\t\t\ttileWidth = Math.floor(objItem.thumbRatioByWidth * rowHeightOpt);\n\t\t\t\n\t\t\tarrWidths[index] = tileWidth;\n\t\t\t\n\t\t\ttotalWidth += tileWidth;\n\t\t});\n\n\t\t\n\t\tvar numRows = Math.ceil(totalWidth / galleryWidth);\n\t\t\n\t\tif(numRows > numTiles)\n\t\t\tnumRows = numTiles;\n\t\t\n\t\tvar finalRowWidth = totalWidth / numRows;\n\t\t\n\t\t//fill rows array, break tiles to rows\n\t\tvar arrRows = [], eachRowWidth = 0;\n\t\tvar rowsWidths = [], rowsTiles = [], row = [];\n\t\tvar progressWidth = 0, numRow = 0;\n\t\t\n\t\tjQuery.each(objTiles, function(index, objTile){\n\t\t\tvar tileWidth = arrWidths[index];\n\t\t\t\t\t\t\n\t\t\tif( (progressWidth + tileWidth / 2) > (numRow+1) * finalRowWidth){\n\t\t\t\t\n\t\t\t\trowsWidths[arrRows.length] = eachRowWidth;\t\t\t\t\n\t\t\t\tarrRows.push(row);\n\t\t\t\trow = [];\n\t\t\t\teachRowWidth = 0;\n\t\t\t\tnumRow++;\n\t\t\t}\n\t\t\t\n\t\t\tprogressWidth += tileWidth;\n\t\t\teachRowWidth += tileWidth;\n\t\t\t\n\t\t\trow.push(objTile);\n\t\t});\n\t\t\n\t\trowsWidths[arrRows.length] = eachRowWidth;\n\t\tarrRows.push(row);\n\t\t\t\t\n\t\t\n\t\t//set heights and position images:\t\n\t\tvar arrRowWidths = [];\n\t\tvar arrRowHeights = [];\n\t\tvar totalHeight = 0;\n\t\t\n\t\tjQuery.each(arrRows, function(index, row){\n\t\t\t\n\t\t\tvar numTiles = row.length;\n\t\t\tvar rowWidth = rowsWidths[index];\n\t\t\t\n\t\t\tvar gapWidth = (row.length-1) * gap;\n\n\t\t\tvar ratio = (galleryWidth - gapWidth) / rowWidth;\n\t\t\tvar rowHeight = Math.round(rowHeightOpt * ratio);\n\t\t\t\n\t\t\t//count total height\n\t\t\ttotalHeight += rowHeight;\n\t\t\tif(index > 0)\n\t\t\t\ttotalHeight += gap;\n\t\t\t\n\t\t\tarrRowHeights.push(rowHeight);\n\t\t\t\n\t\t\t//ratio between 2 heights for fixing image width:\n var ratioHeights = rowHeight / rowHeightOpt;\n\t\t\t\n //set tiles sizes:\n var arrRowTileWidths = [];\n var actualRowWidth = gapWidth;\n \n jQuery.each(row, function(indexInRow, tile){\n \tvar objTile = jQuery(tile);\n \tvar tileIndex = objTile.index();\n \tvar tileWidth = arrWidths[tileIndex];\n \tvar newWidth = Math.round(tileWidth * ratioHeights);\n \t\n \tarrRowTileWidths[indexInRow] = newWidth;\n \tactualRowWidth += newWidth; \t\n });\n \t\n //fix images widths by adding or reducing 1 pixel\n var diff = actualRowWidth - galleryWidth;\n \n var newTotal = 0;\n jQuery.each(arrRowTileWidths, function(indexInRow, width){\n \t\n \tif(diff == 0) \t\t\n \t\treturn(false);\n \t\n \tif(diff < 0){\n \t\tarrRowTileWidths[indexInRow] = width + 1;\n \t\tdiff++;\n \t}else{\n \t\tarrRowTileWidths[indexInRow] = width - 1;\n \t\tdiff--;\n \t}\n \t\n \t//if at last item diff stays, add all diff\n \tif(indexInRow == (arrRowTileWidths.length-1) && diff != 0)\n \t\tarrRowTileWidths[indexInRow] -= diff;\n });\n \n arrRowWidths[index] = arrRowTileWidths;\n\t\t});\n\t\t\n\t\t\n\t\tvar objData = {\n\t\t\t\tarrRows: arrRows,\n\t\t\t\tarrRowWidths: arrRowWidths,\n\t\t\t\tarrRowHeights: arrRowHeights,\n\t\t\t\tgap: gap,\n\t\t\t\ttotalHeight: totalHeight\n\t\t};\n\t\t\n\t\treturn(objData);\n\t}", "title": "" }, { "docid": "89169712a7f9570f47f818d127b4da10", "score": "0.48241645", "text": "function getJustifiedData(){\n\t\t\n\t\tvar galleryWidth = getParentWidth();\n\t\t\n\t\tvar objTiles = g_thumbs.getThumbs();\n\t\tvar rowHeightOpt = g_options.tiles_justified_row_height;\n\t\tvar arrWidths = [];\n\t\tvar totalWidth = 0;\n\t\tvar gap = g_options.tiles_justified_space_between;\n\t\tvar numTiles = objTiles.length;\n\t\t\n\t\t//get arr widths and total width\n\t\tjQuery.each(objTiles, function(index, objTile){\n\t\t\tobjTile = jQuery(objTile);\n\t\t\t\n\t\t\tvar objItem = g_thumbs.getItemByThumb(objTile);\n\t\t\t\n\t\t\tvar tileWidth = objItem.thumbWidth;\n\t\t\tvar tileHeight = objItem.thumbHeight;\n\t\t\t\n\t\t\tif (tileHeight !== rowHeightOpt) \n\t\t\t\ttileWidth = Math.floor(objItem.thumbRatioByWidth * rowHeightOpt);\n\t\t\t\n\t\t\tarrWidths[index] = tileWidth;\n\t\t\t\n\t\t\ttotalWidth += tileWidth;\n\t\t});\n\n\t\t\n\t\tvar numRows = Math.ceil(totalWidth / galleryWidth);\n\t\t\n\t\tif(numRows > numTiles)\n\t\t\tnumRows = numTiles;\n\t\t\n\t\tvar finalRowWidth = totalWidth / numRows;\n\t\t\n\t\t//fill rows array, break tiles to rows\n\t\tvar arrRows = [], eachRowWidth = 0;\n\t\tvar rowsWidths = [], rowsTiles = [], row = [];\n\t\tvar progressWidth = 0, numRow = 0;\n\t\t\n\t\tjQuery.each(objTiles, function(index, objTile){\n\t\t\tvar tileWidth = arrWidths[index];\n\t\t\t\t\t\t\n\t\t\tif( (progressWidth + tileWidth / 2) > (numRow+1) * finalRowWidth){\n\t\t\t\t\n\t\t\t\trowsWidths[arrRows.length] = eachRowWidth;\t\t\t\t\n\t\t\t\tarrRows.push(row);\n\t\t\t\trow = [];\n\t\t\t\teachRowWidth = 0;\n\t\t\t\tnumRow++;\n\t\t\t}\n\t\t\t\n\t\t\tprogressWidth += tileWidth;\n\t\t\teachRowWidth += tileWidth;\n\t\t\t\n\t\t\trow.push(objTile);\n\t\t});\n\t\t\n\t\trowsWidths[arrRows.length] = eachRowWidth;\n\t\tarrRows.push(row);\n\t\t\t\t\n\t\t\n\t\t//set heights and position images:\t\n\t\tvar arrRowWidths = [];\n\t\tvar arrRowHeights = [];\n\t\tvar totalHeight = 0;\n\t\t\n\t\tjQuery.each(arrRows, function(index, row){\n\t\t\t\n\t\t\tvar numTiles = row.length;\n\t\t\tvar rowWidth = rowsWidths[index];\n\t\t\t\n\t\t\tvar gapWidth = (row.length-1) * gap;\n\n\t\t\tvar ratio = (galleryWidth - gapWidth) / rowWidth;\n\t\t\tvar rowHeight = Math.round(rowHeightOpt * ratio);\n\t\t\t\n\t\t\t//count total height\n\t\t\ttotalHeight += rowHeight;\n\t\t\tif(index > 0)\n\t\t\t\ttotalHeight += gap;\n\t\t\t\n\t\t\tarrRowHeights.push(rowHeight);\n\t\t\t\n\t\t\t//ratio between 2 heights for fixing image width:\n var ratioHeights = rowHeight / rowHeightOpt;\n\t\t\t\n //set tiles sizes:\n var arrRowTileWidths = [];\n var actualRowWidth = gapWidth;\n \n jQuery.each(row, function(indexInRow, tile){\n \tvar objTile = jQuery(tile);\n \tvar tileIndex = objTile.index();\n \tvar tileWidth = arrWidths[tileIndex];\n \tvar newWidth = Math.round(tileWidth * ratioHeights);\n \t\n \tarrRowTileWidths[indexInRow] = newWidth;\n \tactualRowWidth += newWidth; \t\n });\n \t\n //fix images widths by adding or reducing 1 pixel\n var diff = actualRowWidth - galleryWidth;\n \n var newTotal = 0;\n jQuery.each(arrRowTileWidths, function(indexInRow, width){\n \t\n \tif(diff == 0) \t\t\n \t\treturn(false);\n \t\n \tif(diff < 0){\n \t\tarrRowTileWidths[indexInRow] = width + 1;\n \t\tdiff++;\n \t}else{\n \t\tarrRowTileWidths[indexInRow] = width - 1;\n \t\tdiff--;\n \t}\n \t\n \t//if at last item diff stays, add all diff\n \tif(indexInRow == (arrRowTileWidths.length-1) && diff != 0)\n \t\tarrRowTileWidths[indexInRow] -= diff;\n });\n \n arrRowWidths[index] = arrRowTileWidths;\n\t\t});\n\t\t\n\t\t\n\t\tvar objData = {\n\t\t\t\tarrRows: arrRows,\n\t\t\t\tarrRowWidths: arrRowWidths,\n\t\t\t\tarrRowHeights: arrRowHeights,\n\t\t\t\tgap: gap,\n\t\t\t\ttotalHeight: totalHeight\n\t\t};\n\t\t\n\t\treturn(objData);\n\t}", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" }, { "docid": "0e6104bec8cf3f40cdf1911c9484f6f4", "score": "0.48170865", "text": "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "title": "" } ]
205b3c72288579d0a5de0e6f85c95568
Creates a new React class that is idempotent and capable of containing other React components. It accepts event listeners and DOM properties that are valid according to `DOMProperty`. Event listeners: `onClick`, `onMouseDown`, etc. DOM properties: `className`, `name`, `title`, etc. The `style` property functions differently from the DOM API. It accepts an object mapping of style properties to values.
[ { "docid": "028651ad8d6cfde03bcf9265adf41c84", "score": "0.0", "text": "function ReactDOMComponent(element) {\n\t var tag = element.type;\n\t validateDangerousTag(tag);\n\t this._currentElement = element;\n\t this._tag = tag.toLowerCase();\n\t this._namespaceURI = null;\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._hostNode = null;\n\t this._hostParent = null;\n\t this._rootNodeID = 0;\n\t this._domID = 0;\n\t this._hostContainerInfo = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._flags = 0;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._ancestorInfo = null;\n\t setAndValidateContentChildDev.call(this, null);\n\t }\n\t}", "title": "" } ]
[ { "docid": "ea561c238a4c60379a3ab521505225ec", "score": "0.58603454", "text": "function componentFactory() {\n var store = {};\n var instanceStore = {};\n var ownerStyles = {}; \n var rootNamespace =\"\";\n var that;\n var requireConditionals = [];\n var conditionalsLength = 0;\n var node;\n\n this.style = style;\n this.style.define = define;\n this.style.log = logStyles;\n this.style._getChildContext = getChildContext; \n this.style._componentWillUnmount = componentWillUnmount;\n this.style._componentDidUpdateOrMount = componentDidUpdateOrMount;\n return null;\n\n\n ///////////////////////////////////////////////////////////////////////////////\n\n function componentDidUpdateOrMount(){\n setGlobalStyles();\n\n node = that.getDOMNode();\n\n // defines eventListener for requiredConditional (\"hover\", \"pressed\")(only if changed); \n if(conditionalsLength < requireConditionals.length) {\n for(var i=0; i<requireConditionals.length; i++) {\n switch(requireConditionals[i]) {\n case \"hover\":\n\n node.addEventListener(\"mouseenter\", onMouseEnter);\n node.addEventListener(\"mouseleave\", onMouseLeave);\n\n break;\n case \"pressed\":\n\n node.addEventListener(\"mousedown\", onMouseDown);\n node.addEventListener(\"mouseup\", onMouseUp); \n \n break;\n }\n }\n conditionalsLength = requireConditionals.length;\n }\n }\n\n /////////////////////////////////////////////////////////////////////////////// \n function componentWillUnmount(){\n node.removeEventListener(\"mouseenter\", onMouseEnter);\n node.removeEventListener(\"mouseleave\", onMouseLeave);\n node.removeEventListener(\"mousedown\", onMouseDown);\n node.removeEventListener(\"mouseup\", onMouseUp);\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // this.style.define()\n\n function define(namespace, styles){\n if(typeof styles === \"undefined\") {\n styles = namespace;\n namespace = \"\";\n }\n if(typeof namespace === \"string\") {\n namespace = namespace.split(\",\");\n }\n for(var i=0; i<namespace.length; i++) {\n saveStyles(namespace[i], styles, store);\n };\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // Handles \"inheritance\" of styles down the component tree\n\n function getChildContext(){\n that = this;\n\n // get react-inline-style context\n this.context.reactInlineStyle = this.context.reactInlineStyle || {};\n var context = this.context.reactInlineStyle;\n context[this._reactInternalInstance._mountOrder] = context[this._reactInternalInstance._mountOrder] || {};\n var thisContext = context[this._reactInternalInstance._mountOrder];\n \n // get parent styles\n var id, parent = this._reactInternalInstance;\n var parentStyles = false;\n\n while(parent._currentElement._owner) {\n parent = parent._currentElement._owner;\n id = parent._mountOrder;\n if(typeof context[id] === \"object\" && typeof context[id].ownerStyles === \"function\") {\n parentStyles=context[id];\n break;\n }\n }\n\n // define componentInstance styles\n if(parentStyles) {\n ownerStyles = parentStyles.ownerStyles();\n rootNamespace = parentStyles.rootNamespace || \"\";\n }\n\n // apply root namespace\n var namespace = \"\";\n if(typeof this.props.styleNamespace === \"string\") {\n namespace = getNamespace(this.props.styleNamespace);\n ownerStyles = getClassFromString(namespace, ownerStyles);\n }\n\n rootNamespace = getNamespace(rootNamespace, namespace);\n\n // copy styles from moduleInstance to componentInstance\n new objct.e.extend(store, objct.e.deep(moduleStore), objct.e.deep(instanceStore));\n\n // pass on component styles\n context[this._reactInternalInstance._mountOrder]={\n ownerStyles : objct.e(store, objct.e.deep(ownerStyles)),\n rootNamespace : rootNamespace\n }\n\n return {\n reactInlineStyle : context\n }\n } \n \n ///////////////////////////////////////////////////////////////////////////////\n // this.style.log(): Log current virtual stylesheet \n\n function logStyles(){\n if(typeof console !== \"object\" || typeof console.log !== \"function\") return;\n console.log(\"react-inline-style\", {\n \"rootNamespace\" : rootNamespace, \n \"stylesheet\" : new objct.e(store, objct.e.deep(ownerStyles))\n });\n }\n ///////////////////////////////////////////////////////////////////////////////\n // Add styles to store\n\n function saveStyles(namespace, styles, store) {\n namespace = getNamespace(namespace);\n var namespaced = addNamespace(namespace, styles);\n new objct.e.extend(store, objct.e.deep(namespaced));\n new objct.e.extend(instanceStore, objct.e.deep(namespaced));\n }\n\n ///////////////////////////////////////////////////////////////////////////////\n // this.style(): Merge requested component and return \"flattened\" styles object\n\n function style(){\n var styles = Array.prototype.slice.call(arguments);\n var stored = new objct.e(store, objct.e.deep(ownerStyles));\n var returnStyles = [], style, extend, k;\n \n styles = flattenArray(styles);\n\n // flatten css \"classes\" and mix everything together -> output styles {};\n for(var i = 0; i<styles.length; i++) {\n style = styles[i];\n if(typeof style === \"string\") {\n if(!testConditional(style)) continue;\n // add namespace\n style = getNamespace(moduleNamespace, styles[i]);\n // get class\n style = getClassFromString(style, stored);\n }\n if(typeof style === \"object\") {\n\n // EXTEND STYLE\n if(typeof style._extend !== \"undefined\") {\n style._extend = typeof style._extend === \"string\" ?\n [style._extend]:\n style._extend;\n\n for(k=0; k<style._extend.length; k++) {\n if(!testConditional(style._extend[k])) continue;\n // add namespace\n extend = getNamespace(moduleNamespace, style._extend[k]);\n // get class\n extend = getClassFromString(extend, stored);\n\n if(typeof extend === \"object\"){\n returnStyles.push(extend);\n }\n }\n }\n\n returnStyles.push(style);\n }\n }\n\n styles = new objct(returnStyles);\n \n //cleanup \n returnStyles = {};\n for(style in styles){\n if(style !== \"_extend\" && (typeof styles[style] === \"string\" || typeof styles[style] === \"number\")) {\n returnStyles[style]= styles[style];\n }\n }\n return returnStyles;\n }\n\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseEnter(e){\n if(node !== e.target) return;\n that.setState({\n hover:true\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseLeave(e){\n if(node !== e.target) return;\n that.setState({\n hover:false\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseDown(e){\n if(!nodeContains(node, e.target) && node !== e.target) return;\n that.setState({\n pressed:true\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n function onMouseUp(e){\n if(!nodeContains(node, e.target) && node !== e.target) return;\n that.setState({\n pressed:false\n });\n }\n /////////////////////////////////////////////////////////////////////////////// \n // transforms \"class:hover\" into \"this.state.hover && \"class\"\" then returns the result\n\n function testConditional(style){\n style = style.split(\":\");\n if(style.length < 2) return true;\n\n var condition = style[1];\n \n if(!that.state) {\n requireConditionals.push(condition);\n return false;\n }\n if(typeof that.state[condition] === \"undefined\") requireConditionals.push(condition);\n\n return that.state[condition];\n } \n\n }", "title": "" }, { "docid": "2349261afdfbb1c4ff699388afc22bf8", "score": "0.5647178", "text": "function createProperties() {\n var handlers = {};\n return {\n \"addEventListener\": {\n \"enumerable\": true\n , \"value\": addEventListener.bind(null, handlers)\n }\n , \"removeEventListener\": {\n \"enumerable\": true\n , \"value\": removeEventListener.bind(null, handlers)\n }\n , \"dispatchEvent\": {\n \"enumerable\": true\n , \"value\": dispatchEvent.bind(null, handlers)\n }\n };\n }", "title": "" }, { "docid": "a1adbd283e85a91f25687fe762b340ac", "score": "0.5639297", "text": "function getMyReact() {\n function render(element, parent) {\n // Get the props and type from element object\n var type = element.type,\n props = element.props; // Check if it is a text element\n\n var isTextElement = type === \"TEXT_ELEMENT\"; // Create a new dom element\n\n var dom = !isTextElement ? document.createElement(type) : document.createTextNode(props.nodeValue); // Filter for eventListeners in the props\n\n var isListener = function isListener(name) {\n return name.startsWith(\"on\");\n }; // Add eventListeners to the dom element\n\n\n Object.keys(props).filter(isListener).forEach(function (name) {\n var eventType = name.toLowerCase().substring(2);\n dom.addEventListener(eventType, props[name]);\n });\n\n var isAttribute = function isAttribute(name) {\n return !isAttribute && name !== \"children\";\n };\n\n Object.keys(props).filter(isAttribute).forEach(function (name) {\n dom[name] = props[name];\n }); // Check if there are any childrens of the given element\n\n var childElements = props.children || []; // render those childrens recursively first\n\n childElements.forEach(function (el) {\n return render(el, dom);\n }); // finally append the element to the parent element\n\n parent.appendChild(dom);\n }\n\n function createElement(type, config) {\n var _ref;\n\n var props = Object.assign({}, config);\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var hasChildren = args.length > 0;\n var allChildren = hasChildren ? (_ref = []).concat.apply(_ref, args) : [];\n props.children = allChildren.filter(function (child) {\n return child !== null && child !== false;\n }).map(function (child) {\n return child instanceof Object ? child : createTextElement(child);\n });\n return {\n type: type,\n props: props\n };\n }\n\n function createTextElement(value) {\n return {\n type: TEXT_ELEMENT,\n props: {\n nodeValue: value\n }\n };\n }\n\n return {\n render: render,\n createElement: createElement\n };\n}", "title": "" }, { "docid": "a99f4b3a7458f8dcdebaa21b460713f7", "score": "0.5593426", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style, options) {\n function StyledComponent(props) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"classes\", \"className\", \"clone\", \"component\"]);\n var className = (0, _classnames.default)(classes.root, classNameProp);\n\n if (clone) {\n return _react.default.cloneElement(children, {\n className: (0, _classnames.default)(children.props.className, className)\n });\n }\n\n var spread = other;\n\n if (style.filterProps) {\n var omittedProps = style.filterProps;\n spread = omit(spread, omittedProps);\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return _react.default.createElement(FinalComponent, (0, _extends2.default)({\n className: className\n }, spread), children);\n }\n\n \"development\" !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\r\n * A render function or node.\r\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n classes: _propTypes.default.object.isRequired,\n className: _propTypes.default.string,\n\n /**\r\n * If `true`, the component will recycle it's children DOM element.\r\n * It's using `React.cloneElement` internally.\r\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n throw new Error('You can not use the clone and component properties at the same time.');\n }\n }),\n\n /**\r\n * The component used for the root node.\r\n * Either a string to use a DOM element or a component.\r\n */\n component: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func, _propTypes.default.object]),\n theme: _propTypes.default.object\n }, style.propTypes || {}) : void 0;\n\n if (\"development\" !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat((0, _utils.getDisplayName)(Component), \")\");\n }\n\n var styles = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return (0, _withStyles.default)(styles, options)(StyledComponent);\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "aa0b1672dc7a6e4ac8290aefddc0c645", "score": "0.55678666", "text": "function mapReactProps(props) {\n var innerHTML = props.innerHTML,\n className = props.class,\n remainingProps = _objectWithoutPropertiesLoose(props, [\"innerHTML\", \"class\"]);\n\n var dangerouslySetInnerHTML = innerHTML ? {\n __html: innerHTML\n } : null;\n return _extends({\n dangerouslySetInnerHTML: dangerouslySetInnerHTML,\n className: className\n }, remainingProps);\n}", "title": "" }, { "docid": "e44dbcca8671226c504d8983199cfeaf", "score": "0.5431049", "text": "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "32ecd46f9d006e2dc0b8116274f4a746", "score": "0.5409568", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx_default()(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: clsx_default()(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "8ea25e3e6454c19fbd147a6d7edd36ad", "score": "0.53980637", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){if(typeof props.$$typeof==='undefined'||props.$$typeof!==REACT_ELEMENT_TYPE){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321382", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321382", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321382", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "d918f6e48cb9d954935c507699a72927", "score": "0.5321382", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8bf881c42a6c5ea5d1e05c5c8a5a9379", "score": "0.5305918", "text": "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "675f8adea20dc25d1ff98d28ac1d02e6", "score": "0.527669", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (false) {}\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272297", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272297", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272297", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "9f1171d208f5565c43cf12483625f77e", "score": "0.5272297", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "780988a4b14fdd15075453b0e92e585c", "score": "0.5261034", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "f6f0583c22e27f7f4f406c079c3c9aa1", "score": "0.5249975", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "a8ed8da7e2e2fdf3dbaf823ab77e14de", "score": "0.52349883", "text": "function createElement(type, config, children) {\n\t var propName = void 0;\n\n\t // Reserved names are extracted\n\t var props = {};\n\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t }", "title": "" }, { "docid": "b2d6ac5fd55a23502abfa0cec922d93e", "score": "0.5221539", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"a\" /* default */])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"a\" /* default */])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213237", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213237", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213237", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "f757810746c7780c0e0ed361e5f40335", "score": "0.5213237", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "cad887747e0a1ccaa163cd589a4bfd0b", "score": "0.52108127", "text": "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "title": "" }, { "docid": "8ab326b5e3e014034ff27423e555e40a", "score": "0.52042097", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (\"development\" !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (\"development\" !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n \"development\" !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children HTML element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (\"development\" !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "8c6beb1d502f298b3112192f276d79c6", "score": "0.51982385", "text": "function createElement(name) {\n let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n const element = document.createElement(name);\n\n for (const [name, value] of Object.entries(props)) {\n if (name === 'style') {\n Object.assign(element.style, props.style);\n } else {\n element.setAttribute(name, value);\n }\n }\n\n for (const child of Array.isArray(children) ? children : [children]) {\n element.append(child);\n }\n\n return element;\n}", "title": "" }, { "docid": "3334afc514231e9b40aef0f50379033e", "score": "0.5195208", "text": "function createAnimatedComponent(Component) {\n var refName = 'animatedNode';\n var AnimatedComponentGenerated = (function (_super) {\n __extends(AnimatedComponentGenerated, _super);\n function AnimatedComponentGenerated(props) {\n var _this = _super.call(this, props) || this;\n _this._updateStyles(props);\n return _this;\n }\n AnimatedComponentGenerated.prototype.setNativeProps = function (props) {\n throw 'Called setNativeProps on web AnimatedComponent';\n };\n AnimatedComponentGenerated.prototype.componentWillReceiveProps = function (props) {\n this._updateStyles(props);\n };\n AnimatedComponentGenerated.prototype._updateStyles = function (props) {\n var _this = this;\n this._propsWithoutStyle = _.omit(props, 'style');\n if (!props.style) {\n this._initialStyle = undefined;\n this._animatedValues = [];\n return;\n }\n // If a style is present, make sure we initialize all animations associated with\n // animated values on it.\n // The way this works is:\n // - Animated value can be associated with multiple animated styles.\n // - When the component is being created we will walk through all the styles\n // and initialize all the animations within the animated value (the animation\n // gets registered when the animation function (e.g. timing) gets called, where the\n // the reference to the animation is kept within the animated value.\n // - We will initialize the animated value with the list of css properties and html element\n // where the style transition/animation. Should be applied and the css properties\n // associated with it: key and from/to values.\n // - Then we will kick off the animation as soon as it's initialized or flag it to\n // start anytime later.\n // Attempt to get static initial styles for the first build. After the build,\n // initializeComponent will take over and apply styles dynamically.\n var styles = Styles_1.default.combine(props.style);\n // Initialize the tricky properties here (e.g. transform).\n this._animatedValues = AnimatedTransform.initialize(styles);\n // Initialize the simple ones here (e.g. opacity);\n for (var key in styles) {\n if (styles[key] instanceof Value) {\n styles[key].addCssProperty(key, '##' + animatedPropUnits[key]);\n this._animatedValues.push(styles[key]);\n }\n }\n this._initialStyle = {};\n // Build the simple static styles\n for (var styleKey in styles) {\n if (_.isObject(styles[styleKey])) {\n continue;\n }\n else if (styles.hasOwnProperty(styleKey)) {\n this._initialStyle[styleKey] = styles[styleKey];\n }\n }\n // Add the complicated styles\n _.each(this._animatedValues, function (value) {\n value.updateElementStylesOnto(_this._initialStyle);\n });\n };\n AnimatedComponentGenerated.prototype.initializeComponent = function (props) {\n // Conclude the initialization setting the element.\n var element = ReactDOM.findDOMNode(this.refs[refName]);\n if (element) {\n this._animatedValues.forEach(function (Value) {\n Value.setAsInitialized(element);\n });\n }\n };\n AnimatedComponentGenerated.prototype.componentDidMount = function () {\n this.initializeComponent(this.props);\n };\n AnimatedComponentGenerated.prototype.componentDidUpdate = function () {\n this.initializeComponent(this.props);\n };\n AnimatedComponentGenerated.prototype.componentWillUnmount = function () {\n _.each(this._animatedValues, function (value) {\n value.destroy();\n });\n this._animatedValues = [];\n };\n AnimatedComponentGenerated.prototype.focus = function () {\n var component = this.refs[refName];\n if (component.focus) {\n component.focus();\n }\n };\n AnimatedComponentGenerated.prototype.blur = function () {\n var component = this.refs[refName];\n if (component.blur) {\n component.blur();\n }\n };\n AnimatedComponentGenerated.prototype.setFocusRestricted = function (restricted) {\n var component = this.refs[refName];\n if (component.setFocusRestricted) {\n component.setFocusRestricted(restricted);\n }\n };\n AnimatedComponentGenerated.prototype.setFocusLimited = function (limited) {\n var component = this.refs[refName];\n if (component.setFocusLimited) {\n component.setFocusLimited(limited);\n }\n };\n AnimatedComponentGenerated.prototype.render = function () {\n return (React.createElement(Component, __assign({ style: this._initialStyle }, this._propsWithoutStyle, { ref: refName }), this.props.children));\n };\n // Update the component's display name for easy debugging in react devtools extension\n AnimatedComponentGenerated.displayName = \"Animated.\" + (Component.displayName || Component.name || 'Component');\n return AnimatedComponentGenerated;\n }(React.Component));\n return AnimatedComponentGenerated;\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "a9de78990e824aa1e2f910264a2774e6", "score": "0.51819843", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "fb30e38a5f86cd0cfd7d9932a39497dc", "score": "0.51791084", "text": "function createClass() {\n\tvar definition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n\tvar _definition$_isPrivat = definition._isPrivate,\n\t _isPrivate = _definition$_isPrivat === undefined ? false : _definition$_isPrivat,\n\t getDefaultProps = definition.getDefaultProps,\n\t _definition$statics = definition.statics,\n\t statics = _definition$statics === undefined ? {} : _definition$statics,\n\t _definition$component = definition.components,\n\t components = _definition$component === undefined ? {} : _definition$component,\n\t _definition$reducers = definition.reducers,\n\t reducers = _definition$reducers === undefined ? {} : _definition$reducers,\n\t _definition$selectors = definition.selectors,\n\t selectors = _definition$selectors === undefined ? {} : _definition$selectors,\n\t _definition$initialSt = definition.initialState,\n\t initialState = _definition$initialSt === undefined ? getDefaultProps && (0, _stateManagement.omitFunctionPropsDeep)(getDefaultProps.apply(definition)) : _definition$initialSt,\n\t _definition$propName = definition.propName,\n\t propName = _definition$propName === undefined ? null : _definition$propName,\n\t _definition$propTypes = definition.propTypes,\n\t propTypes = _definition$propTypes === undefined ? {} : _definition$propTypes,\n\t _definition$render = definition.render,\n\t render = _definition$render === undefined ? function () {\n\t\treturn null;\n\t} : _definition$render,\n\t restDefinition = _objectWithoutProperties(definition, ['_isPrivate', 'getDefaultProps', 'statics', 'components', 'reducers', 'selectors', 'initialState', 'propName', 'propTypes', 'render']);\n\n\tvar newDefinition = _extends({\n\t\tgetDefaultProps: getDefaultProps\n\t}, restDefinition, {\n\t\tstatics: _extends({}, statics, components, {\n\t\t\t_isPrivate: _isPrivate,\n\t\t\treducers: reducers,\n\t\t\tselectors: selectors,\n\t\t\tinitialState: initialState,\n\t\t\tpropName: propName\n\t\t}),\n\t\tpropTypes: (0, _assign3.default)({}, propTypes, (0, _mapValues3.default)(definition.components, function () {\n\t\t\treturn _propTypes2.default.any;\n\t\t})),\n\t\trender: render\n\t});\n\n\tnewDefinition.statics.definition = newDefinition;\n\n\treturn (0, _createReactClass2.default)(newDefinition);\n}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5171286", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "fd6dc2f863c2d94933e2600e7e10d439", "score": "0.5171286", "text": "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "title": "" }, { "docid": "2fb2859aa8c7cf66f052f0226c3da2e9", "score": "0.51659894", "text": "function createStyleAttribute(vnode) {\n const {\n elm,\n data: {\n styleMap\n }\n } = vnode;\n\n if (isUndefined(styleMap)) {\n return;\n }\n\n const {\n style\n } = elm;\n\n for (const name in styleMap) {\n style[name] = styleMap[name];\n }\n }", "title": "" }, { "docid": "f6f3154e4639da1006f5306d21279ee6", "score": "0.5130271", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__[\"a\" /* default */])(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = Object(__WEBPACK_IMPORTED_MODULE_5__material_ui_utils__[\"g\" /* getDisplayName */])(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(__WEBPACK_IMPORTED_MODULE_7__makeStyles__[\"a\" /* default */])(stylesOrCreator, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = __WEBPACK_IMPORTED_MODULE_2_react___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(__WEBPACK_IMPORTED_MODULE_3_clsx__[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.cloneElement(children, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n className: Object(__WEBPACK_IMPORTED_MODULE_3_clsx__[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(FinalComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])({\n /**\n * A render function or node.\n */\n children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func]),\n\n /**\n * @ignore\n */\n className: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,\n\n /**\n * If `true`, the component will recycle it's children HTML element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: Object(__WEBPACK_IMPORTED_MODULE_5__material_ui_utils__[\"b\" /* chainPropTypes */])(__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n __WEBPACK_IMPORTED_MODULE_6_hoist_non_react_statics___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "604bb2200e5856bd8dcfc3c9d4ab50b0", "score": "0.51293355", "text": "function DomStyleObj(styleName){\n\t\t\n\t\tthis.styleName = styleName;\n\t}", "title": "" }, { "docid": "88b864e3a97b9188f2c06c5a3a105d2c", "score": "0.512284", "text": "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = _react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return _react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes.default.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "72d21667c1636b7abafde858fa8f01ec", "score": "0.5107267", "text": "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"a\" /* default */])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = styled_omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"a\" /* default */])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react_default.a.createElement(FinalComponent, Object(esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "title": "" }, { "docid": "d763276ef4fb3f00a7e7dcc5cf30ca0f", "score": "0.5100748", "text": "setClass(element, tfStyle) {\n if (!element) {\n return null;\n }\n const Element = element.type;\n return (\n <div style={tfStyle}>\n <Element {...element.props} />\n </div>\n );\n }", "title": "" }, { "docid": "d4de4ac12cd301db33477789db9d3509", "score": "0.50979066", "text": "render() {\n // inline style\n const style = {\n backgroundColor: 'white',\n font: 'inherit',\n border: '1px solid pink',\n padding: '8px',\n cursor: 'pointer'\n };\n\n // It has to return elements that will be rendered to the screen\n return (\n // That code looks like HTML but it's not - it's JSX - it's JS synthetic sugar - it will be compiled to JS\n // JSX allow us to write HTML code in JS files (the X is for XML).\n // All the elements that we are using (as div..) are provided by the React library, they are not the real HTML tags, React is converting them behind the scenes.\n // But we have some restrictions:\n // 1. Usually we use class instead of className, but class can't be use because it's a reserved word in JS - className is rendered to be class.\n // 2. Our JSX expression must have one root element. It's a best practice to wrap everything in one root element.\n <div className=\"App\">\n <h1>Hi, I'm a React App!</h1>\n <p>This is really working</p>\n <button style={style} onClick={() => this.switchNameHandler('Maximilian')}>Switch Name</button>\n <Person name={this.state.persons[0].name} click={() => this.switchNameHandler('Max!!!')}/>\n <Person name={this.state.persons[1].name} changed={this.nameChangedHandler}>My Hobbies: Tennis</Person>\n <Person name=\"Stephanie\"/>\n </div>\n );\n // The code above is compiled to this code\n // createElement gets an infinite nums of args, but minimum of 3.\n // return React.createElement('div', { className: 'App' }, React.createElement('h1', null, 'I\\'m a React App!'));\n }", "title": "" }, { "docid": "3a64a217cbe8333c3ed31dda8ca5f533", "score": "0.50967354", "text": "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (\"development\" !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" }, { "docid": "ddfd1915bcb54b93f14128d9dcc53e96", "score": "0.5092556", "text": "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "title": "" } ]
ec2f17f74635a4d50d914b358cfef877
Alterar um registo na base de dados pelo seu id
[ { "docid": "d3a19fd4f5ba89c504e529336846ad79", "score": "0.0", "text": "async function update(id, req, res) {\n await Work.findByPk(id).then(work => {\n if (work === null)\n return res\n .status(jsonMessages.db.noRecords.status)\n .send(jsonMessages.db.noRecords);\n else {\n const name = req.body.name;\n const date = new Date()\n .toISOString()\n .replace(/T/, \" \")\n .replace(/\\..+/, \"\");\n try {\n const update = [name, date, id];\n const query = connect.con.query(\n \"UPDATE works SET name =?, updatedAt=? WHERE id=?\",\n update,\n async function(err, rows, fields) {\n console.log(query.sql);\n if (!err) {\n return res\n .status(jsonMessages.db.updateSucces.status)\n .send(jsonMessages.db.updateSucces);\n } else {\n console.log(err);\n if (err.code == \"ER_DUP_ENTRY\") {\n return res\n .status(jsonMessages.db.duplicateEmail.status)\n .send(jsonMessages.db.duplicateEmail);\n } else\n return res\n .status(jsonMessages.db.dbError.status)\n .send(jsonMessages.db.dbError);\n }\n }\n );\n } catch (error) {\n return res\n .status(jsonMessages.db.error.status)\n .send(jsonMessages.db.error);\n }\n }\n });\n}", "title": "" } ]
[ { "docid": "2b000baddc2c294b51552eae5220cc9d", "score": "0.63435733", "text": "function setMiembroId(id, orden) {\n info_ficha.miembros['miembro' + orden].id_miembro = id;\n}", "title": "" }, { "docid": "c62f28750dafeb2f3120263a49ecde3d", "score": "0.6008394", "text": "setORMId(id) {\n this.id = id;\n }", "title": "" }, { "docid": "af1385699ff3371c80c2be89ab893eaf", "score": "0.60051954", "text": "function setUser(id) {\n if (info_ficha.usr_insert === 0)\n info_ficha.usr_insert = id;\n else\n info_ficha.usr_upd = id;\n}", "title": "" }, { "docid": "f4eb7f789b16c8ed3a5a5399629a4cc5", "score": "0.596076", "text": "set(id, data){\n if(this.datas[id]){\n if(data.id){\n delete data.id;\n }\n this.datas[id] = data;\n }\n }", "title": "" }, { "docid": "22322dedecd7168d0836d3d5fda4c41d", "score": "0.5944103", "text": "function editarCarrera(id) {\n localStorage.setItem('IdCarrera', id);\n}", "title": "" }, { "docid": "f728ba2d6f484d7fff25b0687c80795c", "score": "0.5930062", "text": "function setId(newId) {\n id = newId;\n }", "title": "" }, { "docid": "7820aacb7f87534131a5bba4f618b276", "score": "0.59006894", "text": "actualizarNombre(id, nombre) {\n this.lista.forEach(usuario => {\n if (usuario.id === id) {\n usuario.nombre = nombre;\n }\n });\n }", "title": "" }, { "docid": "240c6ee05c3c5d24be6b174e9d6360bd", "score": "0.58641756", "text": "function actualizar(req, res, next) {\r\n let id = req.params.id;\r\n let data = {\r\n nombre: req.body.nombre\r\n }\r\n ModeloTema.findByIdAndUpdate(id, data, { new: true }, (err, item) => {\r\n if (err || !item) return errorHandler(err, next, item);\r\n res.json({\r\n result: true,\r\n data: item\r\n })\r\n });\r\n}", "title": "" }, { "docid": "2525de9c6c041e58cccb86fb8c9e8f06", "score": "0.5809531", "text": "function setDataObject(data, id) {\n if (dbPromise) {\n return dbPromise\n .then(function(db) {\n var objectStores = db.transaction(db.objectStoreNames);\n var selectId = objectStores.objectStore(MANIFEST_STORE_NAME);\n var oldData = selectId.getAll(IDBKeyRange.only(parseInt(id)));\n return oldData;\n })\n .then(function(oldData) {\n var objectToEdit = oldData[0];\n objectToEdit.name = data.name;\n objectToEdit.location = data.location;\n objectToEdit.data = data.date;\n return dbPromise.then(function(db) {\n var transaction = db.transaction(db.objectStoreNames, \"readwrite\");\n var objectstore = transaction.objectStore(MANIFEST_STORE_NAME);\n objectstore.put(objectToEdit);\n });\n });\n }\n}", "title": "" }, { "docid": "25e09d6a139f11609f15ce0928d2cb30", "score": "0.57677346", "text": "function addIdToData(id) {\n const thatBoobs = new ThatBoobs({id: id});\n thatBoobs.save(function(err){\n if(err) return console.log(err);\n });\n }", "title": "" }, { "docid": "008dfe286e6360b73dc7f7b6940f4477", "score": "0.57647216", "text": "async function modifierdemande(id) {\n const config = {\n headers: {\n \"Content-Type\": \"application/json\",\n },\n };\n await axios.put(\n \"http://192.168.43.100:8090/demande/modifierDemande/\" +id,\n {description:description,\n date_debut:modalldataa},\n config,\n {\n auth: {\n username: \"user\",\n password: \"0000\",\n },\n }\n );\n getconnecteduser();\n }", "title": "" }, { "docid": "eae483bc21fd405bb1dccab5a322ffe0", "score": "0.5750993", "text": "EditarTipo(id){\n window.location.replace(\"edit_tipo.html?id=\"+id)\n }", "title": "" }, { "docid": "c926b1d6ba6b3edc114eafed88333bc7", "score": "0.5742813", "text": "editItem(id, data, tipo) {\n this.urlApi = '';\n this.methodApi = 'put';\n if (tipo == 'schedule') this.urlApi = 'horario/put/' + id;\n if (tipo == 'restrictions') this.urlApi = 'restriccion/put/' + id;\n if (tipo == 'services') this.urlApi = 'servicio/put/' + id;\n\n Util.setDataForm(data, document.getElementById(this.idForm));\n window.M.updateTextFields();\n }", "title": "" }, { "docid": "a63596506671d924d7c4da64ba0295a2", "score": "0.5741162", "text": "function editar(id){\n\tajax(strings.endereco+id,'PUT')\n\tfecharFormulario();\n\tlimparCampos();\n\t$(\"#formularioEditar\").hide();\n\t$('#resultado').html(strings.mensagemSucessoEditar);\n}", "title": "" }, { "docid": "f72d74fce921af7603824f824b098c9c", "score": "0.5728964", "text": "SET_DOMAINE_BY_ID(state, domaineId = state.domaines[0].id) {\n state.domaine_by_id = state.domaines.find(dom => dom.id === domaineId);\n //console.info(\"SET_DOMAINE_BY_ID\", state.domaine_by_id)\n }", "title": "" }, { "docid": "c35cb042d71c6e04091e77fc2dd69457", "score": "0.57283896", "text": "function modificar(obj)\n{\n var str = obj.id.split('-');\n var id = str[2];\n var tipo = str[1];\n var DB = str[0];\n\n //Objeto que sirve para editar el valor en la pagina \n var input = null;\n\n input = document.createElement(\"input\");\n\n\n //Asignar en la caja el valor de la casilla\n if (obj.innerHTML)\n input.value = obj.innerHTML;\n else\n input.value = obj.textContent;\n input.value = trim(input.value);\n\n //a la caja INPUT se la asigna un tama�o un poco mayor que el texto a modificar\n input.style.width = getTextWidth(input.value) + 30 + \"px\";\n\n //Se remplaza el texto por el objeto INPUT\n obj.replaceChild(input, obj.firstChild);\n\n //Se selecciona el elemento y el texto a modificar\n input.focus();\n input.select();\n\n //Asignaci�n de los 2 eventos que provocar�n la escritura en la base de datos \n\n //Salida de la INPUT\n input.onblur = function salir()\n {\n salvarMod(obj, input.value, id, tipo, DB);\n delete input;\n };\n\n //La tecla Enter\n input.onkeydown = function keyDown(event)\n {\n if (event.keyCode == 13)\n {\n salvarMod(obj, input.value, id, tipo, DB);\n delete input;\n }\n };\n}", "title": "" }, { "docid": "36b711dec75d714bd41b45c07200a63f", "score": "0.57243943", "text": "async function modificarHabitacion(id,datos){\n\n return await HabitacionModelo.findByIdAndUpdate(id,datos)\n\n}", "title": "" }, { "docid": "0cafd7bfbb14ba8c136ed015b110d869", "score": "0.5719856", "text": "save(data,cb) {\n conn.query('SELECT * FROM team where id = ?', data.id, (err,rows) => {\n console.log(`Num de registros: ${rows.length}`);\n\n if(!err) {\n return (rows.length == 1) \n ? conn.query('UPDATE team SET ? WHERE id = ?', [data, data.id], cb)\n : conn.query('INSERT INTO team SET ?', data, cb);\n }\n });\n }", "title": "" }, { "docid": "7984faa87576231406281b57c104fa19", "score": "0.57012486", "text": "function eliminaRegistro(id) {\n borraArticulo(id);\n}", "title": "" }, { "docid": "87522c50921eb0cc15a19b9a3de883de", "score": "0.5689795", "text": "async updateUniversidadDatosGenerales(idDatos, data){\n return await axios.put(`${general.getServe()}universidad/universidadDatos/${idDatos}`, data);\n }", "title": "" }, { "docid": "77f10f872f6c6b15f441508d4fa5fcb0", "score": "0.56571364", "text": "resetPassord(id, success) {\n connection.query('update Ansatte set passord=\"default\" where ansatt_id=?', [id], (error, results) => {\n if (error) return console.error(error);\n\n success();\n })\n }", "title": "" }, { "docid": "ccef0531e72ecc4c5ede783476f5f840", "score": "0.5646489", "text": "function actualizarDatos(id){\r\n const request = net.request({ \r\n method: 'PUT', \r\n protocol: 'http:', \r\n hostname: ip, \r\n port: 8080,\r\n path: '/apiMongo/rutas/editIdListado/'+id,\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }, \r\n }); \r\n request.on('response', (response) => {\r\n response.on('data', (chunk) => {\r\n })\r\n })\r\n request.end(()=>{\r\n console.log(\"actualizacion request acabada\");\r\n });\r\n }", "title": "" }, { "docid": "9021b618edbf32242b33637f2cdd56d7", "score": "0.55967706", "text": "function ModificarTipoPista(IdTipoPista){\n\n var nombre = getId(\"nombre\").value;\n var descripcion = getId(\"descripcion\").value;\n var objResultado = {\n nombre: nombre,\n descripcion: descripcion,\n };\n var refResultados = database.ref(\"/Tipos/\" + IdTipoPista);\n refResultados.update(objResultado);\n location.href ='Tipospista.php';\n}", "title": "" }, { "docid": "8ccdb4976def61c42c580e11d88743ca", "score": "0.5585418", "text": "function editmmarketer(id){\n\t\t$.ajax({\n\t\t\turl:dir,\n\t\t\ttype:'get',\n\t\t\tdata:'aksi=ambiledit&id_mmarketer='+id,\n\t\t\tdataType:'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data.status=='gagal'){\n\t\t\t\t\talert('database error');\n\t\t\t\t}else{\n\t\t\t\t\tkosongkan();\n\t\t\t\t\t\n\t\t\t\t\t$('#idformTB').val(id); \n\t\t\t\t\t$('#id_mloginH').val(data.id_mlogin);\n\t\t\t\t\t$('#namaTB').val(data.nama);\n\t\t\t\t\t$('#no_telpTB').val(data.no_telp);\n\t\t\t\t\t$('#emailTB').val(data.email);\n\t\t\t\t\t\n\t\t\t\t\t$('#loadarea').html('<i class=\"icon-edit\"></i> UBAH MARKETER').fadeIn();\n\t\t\t\t\t$('#i_kegPN').toggle(1000);\n\t\t\t\t\t$('#v_kegPN').toggle();\n\t\t\t\t\t$('#viewBC').toggle();\n\t\t\t\t\t$('#addBC').toggle();\n\t\t\t\t\t// alert('asem');\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\t\tconsole.log('ERRORS: ' + errorThrown);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "acdc8b3c40d975a0aa67d4b53abc552e", "score": "0.5584563", "text": "actualizarEvento(id) {\n\n let datos = this.obtenerDatos(id);\n\n request.put('/eventos', datos)\n .then(res => {\n if (res.ok) {\n M.toast({\n html: 'Evento actualizado',\n classes: 'rounded'\n });\n } else {\n ui.mostrarAlert('Error al actualizar Administrador', 'error');\n }\n });\n }", "title": "" }, { "docid": "c88ed2e35596be06a1a796c1f404b5c0", "score": "0.5579912", "text": "setId(id) {\n\tthis.id = id;\n }", "title": "" }, { "docid": "a8ce9284d98e278f3f50f23f92b11d22", "score": "0.5571145", "text": "actualizarNombre(_id, user) {\n for (let usr of this.lista) {\n if (usr._id == _id) {\n usr.nombre = user.nombre;\n usr.color = user.color;\n usr.sala = user.sala;\n break;\n }\n }\n }", "title": "" }, { "docid": "3d426cd9ac88d9f20d11b0c5527edd61", "score": "0.5554336", "text": "set setElement(obj){\n // Obtengo el elemto de la BD segun el obj.id\n let element = this.getFind('id', obj.id)\n // Sobreescribo las props que existen en obj\n element = {...element, ...obj}\n \n // elimino el elemento viejo\n this.delete(element.id)\n\n // añado el nuevo\n this.add(element, obj.id);\n }", "title": "" }, { "docid": "9d9c2715e94dace4e01708b3bb7e58b1", "score": "0.55426663", "text": "function modifVisite(id,date,idC,choix,idBien,idAg,callback){\r\n\t\t$http({\r\n\t\t\tmethod:'PUT',\r\n\t\t\turl:urlWS+'update?idClient='+idC+'&date='+date+'&idAgent='+idAg+'&choix='+choix+'&idBien='+idBien+'&idVisite='+id\r\n\t\t}).then(function success(reponse) {\r\n\t\t\t//Stocker la reponse dans la callback afin de la transporter au controller\r\n\t\t\tcallback(reponse.statusText);\r\n\t\t},function error(reponse){\r\n\t\t\tconsole.log(\"-----Erreur du serveur pour modif :\" +reponse.status + \" \" +reponse.statusText );\r\n\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "87a9b49ea839926e391f0f0bebb2c4a4", "score": "0.5515503", "text": "updatereplaceid (state, replaceid) {\n state.replaceid = replaceid\n }", "title": "" }, { "docid": "edf0589ae02819bbcba2c4a26ca52995", "score": "0.54951155", "text": "function update(OID_PARTIDO,ABREVIACION){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_nombre_partido\").val($(\"#link\"+OID_PARTIDO).attr(\"partido\"));\n\t\n\t$(\"#txt_abreviatura_partido\").val(ABREVIACION);\n\t\n\t$(\"#txt_nombre_partido\").attr(\"PARTIDO\",OID_PARTIDO);\n\t\n\t$(\"#btn_enviar_partido\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "title": "" }, { "docid": "70b1d63781afdb731ab7e63294c77675", "score": "0.54798514", "text": "setID(value) {\n this.id = value;\n }", "title": "" }, { "docid": "1379eadc03fd30aa598bca24655bf0b1", "score": "0.5467199", "text": "update(id) {}", "title": "" }, { "docid": "d085b901bc19a351a7ed07439f345f2b", "score": "0.5466734", "text": "function alterar(dados){\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", BASE_URL_SERVICO + \"/grupoUsuario\");\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(dados);\n}", "title": "" }, { "docid": "13f88c2a1f203820df45701d6b925909", "score": "0.546388", "text": "handleDataEdit(payload) {\n let index = 0;\n let modifiedAccounts = [...this.accounts];\n let modifiedAccount = modifiedAccounts.find((account, idx) => {\n index = idx;\n return account.Id == payload.Id;\n })\n let modifiedRecord = JSON.parse(JSON.stringify(modifiedAccount))\n modifiedRecord.Name = payload.Name;\n modifiedRecord.Type = payload.Type;\n modifiedRecord.Industry = payload.Industry;\n modifiedAccounts.splice(index,1,modifiedRecord);\n this.accounts = [...modifiedAccounts];\n this.isEditMode = true;\n }", "title": "" }, { "docid": "01b4a18951bf3d5678d61a1138a974b6", "score": "0.5454552", "text": "actualizarIngresoInsumo(id, formData) {\n return axios.put(`${API_URL}/ingreso_insumo/${id}`, formData);\n }", "title": "" }, { "docid": "74e5a7675149727e7e1db3f89404c984", "score": "0.54109555", "text": "modifyEmpresaName(dbuid, euid, name){\n var obj = this.obj;\n var e = obj.dbs[dbuid].empresas[euid];\n e.name = name;\n e.slug = slugify(name, {lower: true});\n this.obj.dbs[dbuid].empresas[euid] = e;\n this.obj.dbs[dbuid].modified = moment.now();\n this.setModified();\n return e;\n }", "title": "" }, { "docid": "3bbb1851d3b83792cd6adb5f553adb10", "score": "0.540309", "text": "function modificar(cedula) {\n\n var active = dataBase.result;\n var data = active.transaction([\"clientes\"], \"readwrite\");\n var objectStore = data.objectStore(\"clientes\");\n var index = objectStore.index('cedula_cliente');\n \n index.openCursor(cedula).onsuccess = function (event) {\n var cursor = event.target.result;\n \n if (cursor) {\n var updateData = cursor.value;\n updateData.cedula = document.querySelector(\"#ci\").value;\n updateData.nombre = document.querySelector(\"#nombre\").value;\n updateData.apellido = document.querySelector(\"#apellido\").value;\n updateData.direccion = document.querySelector(\"#direccion\").value;\n updateData.telefono = document.querySelector(\"#telefono\").value;\n\n\n var request = cursor.update(updateData);\n request.onsuccess = function () {\n \n //$(\"#modifi\").fadeIn();\n //$(\"#modifi\").fadeOut(3000);\n $('#btnSubmit').attr(\"disabled\", false);\n //$('#ci').attr(\"readonly\", false);\n CargaDb();\n\n limpiarFormulario();\n \n \n\n };\n request.onerror = function () {\n alert('Error' + '/n/n' + request.error.name + '\\n\\n' + request.error.message);\n \n CargaDb();\n };\n }\n }\n ;\n}", "title": "" }, { "docid": "79fa6901514cb23fe34914f33fa23d9d", "score": "0.5382061", "text": "setId(id) {\n this.id = id;\n }", "title": "" }, { "docid": "79fa6901514cb23fe34914f33fa23d9d", "score": "0.5382061", "text": "setId(id) {\n this.id = id;\n }", "title": "" }, { "docid": "90547f832ca8d5bb931ad57d48abcd08", "score": "0.5378201", "text": "function identifierJoueur(idJoueur){\n\t\tconsole.log(\"identifierJoueur()\");\n\t\tdemanderJoueur().id = idJoueur;\n\t}", "title": "" }, { "docid": "6b86b8c6b331077a1b239c07366edc18", "score": "0.5372663", "text": "async function updateSpeciality(req, res) {\n let id = req.params.id;\n\n await Speciality.update(req.body, { where: { id: id } })\n .then(async data => {\n if (data == 1) {\n saveBitacora('Specialty', id, 'specialty udpate', 'update', req.user.id);\n res.status(200).json({\n ok: true,\n message: 'Especialidad actualizada con éxito',\n data\n });\n } else {\n res.status(200).json({\n ok: false,\n message: `No existe la especialidad con id = ${id}.`\n });\n }\n })\n .catch(err => {\n res.status(500).json({\n ok: false,\n message: `No se pudo actualizar la especialidad con id = ${id}.`,\n error: err.parent.detail\n });\n });\n}", "title": "" }, { "docid": "6382c797dd7d82eaf2369af999259488", "score": "0.53714114", "text": "setId(id) {\n this.id = id;\n }", "title": "" }, { "docid": "4f11890da92ba2170d255a56b531691d", "score": "0.53691614", "text": "function EditarItemMuestrasAlmacenados(idMuestraPuntoControlLaboratorio){\n \n // alert('es:'+idMuestraPuntoControlLaboratorio);\n \n \n $('cboTipoUnidadMedidaMuestraSeleccionada'+idMuestraPuntoControlLaboratorio.trim()).disabled=false;\n $('cboUnidadMedidaMuestraSeleccionada'+idMuestraPuntoControlLaboratorio.trim()).disabled=false;\n $('txtCantidadMaximaMuestraSeleccionada'+idMuestraPuntoControlLaboratorio.trim()).readOnly=false;\n $('txtCantidadMinimaMuestraSeleccionada'+idMuestraPuntoControlLaboratorio.trim()).readOnly=false;\n \n}", "title": "" }, { "docid": "e42b03a0ee53de6c34043bbc4e776bee", "score": "0.5354127", "text": "function editarEstudiante(cedula) {\n localStorage.setItem('IdEstudiante', cedula);\n}", "title": "" }, { "docid": "06aac0eba6fbc983231bc5f3c3dd9e4b", "score": "0.53376657", "text": "function editNorma(id,primary,field) {\n var fieldJs = field.split('##');\n var primJs = primary.split('##');\n \n param = \"proses=edit\";\n param += \"&primary=\"+primary;\n param += \"&primVal=\";\n for(i=1;i<primJs.length;i++) {\n tmp = document.getElementById(primJs[i]+\"_norma\");\n if(!tmp) {\n tmp = document.getElementById(primJs[i]+\"_\"+id);\n }\n param += \"##\"+tmp.value;\n }\n \n for(i=1;i<fieldJs.length;i++) {\n tmp = document.getElementById(fieldJs[i]+\"_\"+id);\n param += \"&\"+fieldJs[i]+\"=\";\n if(tmp.options) {\n param += tmp.options[tmp.options.selectedIndex].value;\n } else {\n param += tmp.value;\n }\n }\n \n function respon(){\n if (con.readyState == 4) {\n if (con.status == 200) {\n busy_off();\n if (!isSaveResponse(con.responseText)) {\n alert('ERROR TRANSACTION,\\n' + con.responseText);\n } else {\n // Success Response\n\t\t alert('Data Saved');\n }\n } else {\n busy_off();\n error_catch(con.status);\n }\n }\n }\n \n post_response_text('setup_slave_kegiatan_norma.php', param, respon);\n}", "title": "" }, { "docid": "1fc053eb63bc1cceb0e5eb9b7b548699", "score": "0.53325576", "text": "SET_FORMATION_BY_ID(state, formaId = state.formations[0].id) {\n state.formation_by_id = state.formations.find(\n forma => forma.id === formaId\n );\n //console.info(\"SET_FORMATION_BY_ID\", state.formation_by_id);\n }", "title": "" }, { "docid": "042d42a98902e7e971a44d2ac1de9dd8", "score": "0.531686", "text": "function editarNacionalidad(id, body) {\n var uri = __env.apiUrl + 'nacionalidad/editar/' + id;\n return $http({\n url: uri,\n method: \"PUT\",\n data: body,\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "title": "" }, { "docid": "ff4bf3af49129890b69cce7ba250cad8", "score": "0.52995545", "text": "function saveEditar (req, res) {\n\n\tlet dataTablaPersona = {\n\n\t\tnombre: req.body.nombre,\n\t\tapellido: req.body.apellido,\n\t\tsexo: req.body.sexo,\n\t\tnacionalidad: req.body.nacionalidad,\n\t\tocupacion: req.body.ocupacion,\n\t\tciudad: req.body.ciudad,\n\t\ttelefono: req.body.telefono,\n\t\tcorreo: req.body.correo,\n\t\tdireccion: req.body.direccion,\n\t\tfecha_nacimiento: req.body.fecha_nacimiento,\n\t\theredad: req.body.heredad\n\t}\n\t\n\tlet dataTablaFaseGanar = {\n\t\t\n\t\tfecha_contactado: req.body.fecha_contactado,\n\t\tlugar_contacto: req.body.lugar_contacto,\n\t\tinvitado_por: req.body.invitado_por,\n\t\tfecha_visitar: req.body.fecha_visitar,\n\t\tcelula_insertar: req.body.celula_insertar,\n\t\tpeticion_oracion: req.body.peticion_oracion,\n\t}\n\n\tPersona.update(dataTablaPersona, {\n\t\twhere:{\n\t\t\tid: idEditar\n\t\t}\n\n\t}).then(() => {\n\n\t\tFaseGanar.update(dataTablaFaseGanar, {\n\t\t\twhere:{\n\t\t\t\tpersona_id: idEditar\n\t\t\t}\n\t\t}).then(() => {\n\t\t\tres.redirect('/inicio')\n\n\t\t}).catch(err => {\n\t\t\tif (err) return console.log(`Ha ocurrido este error al guardar los datos de la fase ganar: ${err}`)\n\t\t})\n\t}).catch(err => {\n\t\tif (err) return console.log(`Ha ocurrido este error al editar la persona ${err}`)\n\t})\n}", "title": "" }, { "docid": "dacc17b77895952d3e87578f79132232", "score": "0.529799", "text": "function editar(id){\n //marcar as paginas definidas\n marcarPaginasAcesso(id);\n\n //captura a linha informada\n var linha = document.getElementById(\"linha\"+id);\n var colunas = linha.getElementsByTagName('td');\n\n $('#txtCodigo').val(id);\n $('#txtDescricao').val(colunas[0].innerHTML);\n if (colunas[1].innerHTML === 'Sim')\n $('#chbAtivo').prop('checked', true);\n else\n $('#chbAtivo').prop('checked', false);\n $('#mensagem').hide();\n\n $('#formulario').modal('show');\n}", "title": "" }, { "docid": "5e9ef284f0e1d0629f292e04a6206af3", "score": "0.5295928", "text": "function modificarPelicula(request, response){\n console.log(\"Modificar película (LC)\")\n\n //aqui hace falta la peli y el id\n let id = request.params.id\n let pelicula = request.body\n //Nos aseguramos de que la película que venía en el body tenga el id \n //que venía en la ruta\n pelicula._id = id\n \n negocioPeliculas\n .modificarPelicula(pelicula)\n .then(function(peliculaModificada){\n response.json(peliculaModificada)\n })\n .catch(function(err){\n response.statusCode = err.codigo\n response.json(err)\n }) \n}", "title": "" }, { "docid": "7ad4e799594dc0eb8d7a506ebf0cdc6c", "score": "0.529401", "text": "update(data, id, cb) {\n orm.updateOne(\"burgers\", data, \"id\", id, (res) => cb(res));\n }", "title": "" }, { "docid": "2a9b9a8f8963e5de5aa0c930779433d1", "score": "0.5290417", "text": "function editar() {\n let codigoCarrera = this.dataset.codigo;\n\n let carrera = buscarCarreraPorCodigo(codigoCarrera);\n\n setCarrera(carrera);\n location.href = \"../html/modificarCarrera.html\";\n\n\n}", "title": "" }, { "docid": "18cce7f638ec0e66aed8258cb63f0646", "score": "0.52815837", "text": "function editDemoData(id, changed) {\n let name = \"\",\n age = \"\",\n city = \"\",\n car = \"\";\n \n return new Promise(async (resolve, reject) => {\n let search = `SELECT * FROM Demo.DemoTable WHERE id=${id}`;\n const searchData = await mysql.getData(search).catch(e => reject(e));\n if (changed.name === undefined) {\n name = searchData[0].name;\n } else {\n name = changed.name;\n }\n\n if (changed.age === undefined) {\n age = searchData[0].age;\n } else {\n age = changed.age;\n }\n\n if (changed.city === undefined) {\n city = searchData[0].city;\n } else {\n city = changed.city;\n }\n\n if (changed.car === undefined) {\n car = searchData[0].car;\n } else {\n car = changed.car;\n }\n\n \n\n // console.log(customer, product, units)\n let insertNcr = `UPDATE Demo.DemoTable SET \tname='${name}',\tage='${age}',city='${city}',car='${car}' WHERE id='${id}'`;\n const data = await mysql.getData(insertNcr).catch(e => console.log(e));\n \n resolve({ status: true });\n });\n}", "title": "" }, { "docid": "665c91c32c516c47a5a75e5aacb84516", "score": "0.527882", "text": "function CargarIdEstudianteEliminar(id) {\n document.getElementById(\"IdItem\").value = id;\n}", "title": "" }, { "docid": "d67ad44c122d7fefeaf421ba6ebfb9fe", "score": "0.527692", "text": "function editRowInTable(nguonSanPham) {\n let oldnguonSanPhamRow = getRowInTable(nguonSanPham);\n tableQuanLynguonSanPham.row(oldnguonSanPhamRow).data([\n nguonSanPham.maNguonSanPham, nguonSanPham.ten, nguonSanPham.soDienThoai, nguonSanPham.diaChi, nguonSanPham\n ]).draw();\n\n //Change in nguonSanPhams\n let nguonSanPhamReference = nguonSanPhams.find(\n (item) => item.maNguonSanPham == nguonSanPham.maNguonSanPham\n );\n \n nguonSanPhamReference.maNguonSanPham = nguonSanPham.maNguonSanPham;\n nguonSanPhamReference.ten = nguonSanPham.ten;\n nguonSanPhamReference.soDienThoai = nguonSanPham.soDienThoai;\n nguonSanPhamReference.diaChi = nguonSanPham.diaChi;\n \n}", "title": "" }, { "docid": "b09ac60fdced5ddfd46764006fc6dc88", "score": "0.526689", "text": "save() {\n const fornecedor = this.state.fornecedor;\n const method = fornecedor.id ? 'put' : 'post';\n /*Se id for verdadeiro (existe um id, faça um put),\n senao um post */\n const url = fornecedor.id ? `${baseUrl}/${fornecedor.id}` : baseUrl;\n //Se existe um id atualiza a informação senão baseUrl cria mais um id\n axios[method](url, fornecedor).then(resp => {\n //getUpdateLIst será criada\n const list = this.getUpdateList(resp.data);\n this.setState({ vendas: inicialState.fornecedor, list });\n });\n }", "title": "" }, { "docid": "acce7cc5d8a1c602cd5df43d65dbe66b", "score": "0.52663106", "text": "function modificar(obj, idcarrito, upc)\n{ \n\t//Objeto que sirve para editar el valor en la pagina \n\tvar input = null;\n\n\tinput = document.createElement(\"input\");\n\n\n\t//Asignar en la caja el valor de la casilla\n\tif (obj.innerText)\n\t\tinput.value = obj.innerText;\n\telse\n\t\tinput.value = obj.textContent;\n\tinput.value = trim(input.value);\n\n\t//a la caja INPUT se la asigna un tama�o un poco mayor que el texto a modificar\n\tinput.style.width = getTextWidth(input.value) + 30 + \"px\";\n\n\t//Se remplaza el texto por el objeto INPUT\n\tobj.replaceChild(input, obj.firstChild);\n\n\t//Se selecciona el elemento y el texto a modificar\n\tinput.focus();\n\tinput.select();\n\n\t//Asignaci�n de los 2 eventos que provocar�n la escritura en la base de datos \n\n //Salida de la INPUT\n\tinput.onblur = function salir()\n\t{\n\t\tsalvarMod(obj, input.value, idcarrito, upc);\n\t\tdelete input;\n\t};\n\n\t//La tecla Enter\n\tinput.onkeydown = function keyDown(event)\n\t{\n\t\tif(event.keyCode == 13)\n {\n\t\t\tsalvarMod(obj, input.value, idcarrito, upc);\n\t\t\tdelete input;\n\t\t}\n\t};\n}", "title": "" }, { "docid": "1113dd41aedfaf76a963496ea06956e5", "score": "0.5263753", "text": "actualizarNombreYtipoCliente(id, nombre, tipo) {\n for (let cliente of this.lista) {\n if (cliente.idSocket === id) {\n cliente.nombre = nombre;\n cliente.tipo = tipo;\n break;\n }\n }\n ;\n //console.log('====== actualizando cliente =====');\n //console.log(this.lista);\n }", "title": "" }, { "docid": "a17d0ade5aa9e4587e2716eb998cfbf2", "score": "0.5262221", "text": "function editIdFunction(item, index){\n\t console.log(item, index);\n\t if(!$.isNumeric(item.id))\n\t\t item.id = null;\n\t console.log(item, index);\n }", "title": "" }, { "docid": "544f7632a9a19feaaba0c7eef0c83636", "score": "0.5261093", "text": "function update_capitulo_usuario_se(id_serie,temporada,capitulo_num,capitulo_name,id_capitulo) {\n db = window.openDatabase(shortName, version, displayName, maxSize);\n db.transaction(function(tx) {\n tx.executeSql('UPDATE usuario_se set temporada=?,capitulo_num=?,capitulo_name=?,id_capitulo=?,modificado=DateTime(\"now\") WHERE id_serie=?', [temporada,capitulo_num,capitulo_name,id_capitulo,id_serie], nullHandler(\"update ultimo epi\"), errorHandler);\n });\n}", "title": "" }, { "docid": "7833020b85e777b7eeb2e392b0f6e6d5", "score": "0.5255704", "text": "async updatePhone(id, data) {\n return await axios.put('http://localhost:8000/phone/' + id.toString(), data);\n }", "title": "" }, { "docid": "3a78fa7ecd154730c10975f88e138063", "score": "0.525553", "text": "function saveRegID(id, callback) {\n var p = new profile({\n regID: id,\n categories: [],\n offers: []\n });\n p.save(function (err, data) {\n if (err) {\n callback(err);\n } else {\n callback(null, data);\n }\n });\n}", "title": "" }, { "docid": "8dc6266996a140049bd7d2a410c07557", "score": "0.5254278", "text": "static update(id, data) {\n return Smellprofile.findById(id)\n .then((smell) => {\n smell.set(data);\n smell.save();\n return smell;\n })\n .catch((err) => {\n console.log(err);\n return err;\n });\n }", "title": "" }, { "docid": "b7c7654ce60c2ad65d8e625180bd675e", "score": "0.5245192", "text": "function editarUsuario(cedula) {\n localStorage.setItem('IdUsuarioEditar', cedula);\n}", "title": "" }, { "docid": "c92ed308cc74eec21c419837b26965c5", "score": "0.5236749", "text": "function reset(idx){\n //resetam campurile formularului\n document.querySelector(\"#add-form\").reset();\n //atribuim valoarea -1 la idxEditare\n window.idxEditare = idx;\n //console.log ptr a avea daca s-a resetat\n console.log('a fost resetat id la '+idxEditare);\n \n}", "title": "" }, { "docid": "a1a1d5238c43af4abcda097ecd93a73f", "score": "0.52331126", "text": "updateEquipment(id, name, type, price, description, status, location, success) {\n connection.query('update Utstyr set navn=?, type=?, pris=?, beskrivelse=?, status=?, sted=? where utstyr_id=?',\n [name, type, price, description, status, location, id], (error, results) => {\n if (error) return console.error(error);\n\n success();\n });\n }", "title": "" }, { "docid": "3f5cc901c7861b94d2bfdb8558d2571b", "score": "0.52285093", "text": "function editUser(id) {\n if (id) {\n tr_id = \"#user-\" + id;\n blood_bank_name = $(tr_id).find(\".userBlood_bank_name\").text();\n blood_group = $(tr_id).find(\".userBlood_group\").text();\n units = $(tr_id).find(\".userUnits\").text();\n phone_no = $(tr_id).find(\".userPhone\").text();\n address = $(tr_id).find(\".userAddress\").text();\n console.log(true)\n $('#form-id').val(id);\n $('#form-blood_bank_name').val(blood_bank_name);\n $('#form-blood_group').val(blood_group);\n $('#form-units').val(units);\n $('#form-phone_no').val(phone_no);\n $('#form-address').val(address);\n }\n}", "title": "" }, { "docid": "3f06519f6b2567bf99d4e8a4ee030a0f", "score": "0.52257097", "text": "setID(e, o) {\n e.setAttribute('id', this.formatID(o));\n }", "title": "" }, { "docid": "68a9e2496f23348884c0b66ba3ab9086", "score": "0.5214801", "text": "function editGol(id){\n\t\t//alert('id: '+id);\n\t\t$.ajax({\n\t\t\turl:dir,\n\t\t\ttype:'get',\n\t\t\tdata:'aksi=ambiledit&id_djabatan='+id,\n\t\t\tdataType:'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data.status=='gagal'){\n\t\t\t\t\talert('database error');\n\t\t\t\t}else{\n\t\t\t\t\tkosongkan();\n\t\t\t\t\t$('#idformTB').val(id); \n\t\t\t\t\t$('#nm_orgTB').val(data.nm_org);\n\t\t\t\t\t$('#nm_jabTB').val(data.nm_jab);\n\t\t\t\t\t$('#tgl_lantikTB').val(data.tgl_lantik);\n\t\t\t\t\t$('#tgl_purnaTB').val(data.tgl_purna);\n\t\t\t\t\t$('#ket_jabTB').val(data.ket_jab);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*combomkota(data.id_mpropinsi,data.id_mkota);\n\t\t\t\t\tcombomkec(data.id_mkota,data.id_mkec);*/\n\t\t\t\t\t\n\t\t\t\t\t$('#loadarea').html('<i class=\"icon-edit\"></i> UBAH RIWAYAT JABATAN DILUAR PRAMUKA').fadeIn();\n\t\t\t\t\t$('#i_kegPN').toggle(1000);\n\t\t\t\t\t$('#v_kegPN').toggle();\n\t\t\t\t\t$('#viewBC').toggle();\n\t\t\t\t\t$('#addBC').toggle();\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\t\tconsole.log('ERRORS: ' + errorThrown);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "957a5d69ed49d3c81b91342c395befe0", "score": "0.521434", "text": "function edit(id) {\r\n\r\n}", "title": "" }, { "docid": "acbd4850f02c140b3048678d3e0760c4", "score": "0.5210102", "text": "function form_set_edit(form_id, id, data=null) {\n $(\"#modal-label-\" + form_id).text(\"Edit element\");\n\n if ( data ) {\n var form_elements = $(\"[form=\"+ form_id + \"]\");\n\n form_elements.filter(\"[name=id]\").val(data[\"id\"]);\n form_elements.filter(\"[name=name]\").val(data[\"name\"]);\n } else {\n form_set_new(form_id);\n fetch_object(obj_type, id, function(obj) {\n form_set_edit(form_id, id, obj);\n });\n }\n}", "title": "" }, { "docid": "23405bc8f980561c72e45585fb1e4266", "score": "0.5200277", "text": "function datos_por_modificar(valor, valor1) {\n $('#id_caracter').val(valor);\n $('#caracter_modificar').val(valor1);\n}", "title": "" }, { "docid": "6b4e8f97a9931fa2c37935429d3ee3e9", "score": "0.5196492", "text": "function cambiarEstadoEspecialista(idEspecialista, estado, fn) {\n db.especialistas.update({\n $and: [{\n 'estado': {\n $ne: 'terminado'\n }\n }, {\n 'idEspecialista': idEspecialista\n }]\n }, {\n $set: {\n estado: estado\n }\n }, fn);\n}", "title": "" }, { "docid": "cc89aee0d6619e229a667040ca476d94", "score": "0.5193773", "text": "function detailEdit(id)\n{\n\t\tdocument.getElementById(\"saveDetail\").value = \"Modificar\";\n\t\tclearErrorMessages();\n\n\t\t// llamada Ajax...\n\t\tajaxCall(httpMethod=\"GET\", \n\t\t\t\t\t\turi=\"${def:actionroot}/detail/edit?id=\" + id , \n\t\t\t\t\t\tdivResponse=null, \n\t\t\t\t\t\tdivProgress=\"status\", \n\t\t\t\t\t\tformName=null, \n\t\t\t\t\t\tafterResponseFn=null, \n\t\t\t\t\t\tonErrorFn=null);\t\n}", "title": "" }, { "docid": "d2d322738251152f4ebdb4c94bcadda9", "score": "0.519283", "text": "function editarSeccionGrado(idSeccionGrado, grado, seccion,especialidad, personal, turno ){\n\n $(\"#frmSeccionGrado\").attr('action', 'editar/' + idSeccionGrado);\n $(\"#grado\").val(grado);\n $(\"#seccion\").val(seccion);\n $(\"#especialidad\").val(especialidad);\n $(\"#personal\").val(personal);\n $(\"#turno\").val(turno);\n\n}", "title": "" }, { "docid": "fc539a5b2bcb0438bf9c754f8d807b1a", "score": "0.5191315", "text": "async function cambiarFamilia(req, res){\n var id = req.params.id;\n var familia = req.params.familia\n var estudiante = await EstudianteMdl.findOne({_id:id});\n estudiante.familia = familia;\n if( await EstudianteMdl.findOneAndUpdate({_id:estudiante._id}, estudiante, {new:true})){\n res.status(200).send({message:\"Actualizacion Correcta\"});\n }\n else{\n res.status(500).send({message:\"Error en la actualizacion\"});\n };\n}", "title": "" }, { "docid": "086cd768d169951ea23f6591ca6809aa", "score": "0.5185534", "text": "function setReadOnlyField(id) {\n\tswitch (id) {\n\tcase 0:\n\t\tdocument.getElementById(\"bereitstellungsort\").value = \"Hauptstr.2, Offenburg\";\n\t\tbreak;\n\tcase 1:\n\t\tdocument.getElementById(\"bereitstellungsort\").value = \"Rheinstr.15, Offenburg\";\n\t\tbreak;\n\tdefault:\n\t\tdocument.getElementById(\"bereitstellungsort\").value = \"Winkelgasse 13, Offenburg\";\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "e6fb1b7e21ec730f5fefd06baf045ba2", "score": "0.51837265", "text": "static editRow(id) {\n\t\tconst clients = Store.getClients();\n //function to find client with matching id\n\t\tvar client = clients.find(c => c.id === id);\n\t\tclient.name = document.querySelector('#name').value;\n client.lastname = document.querySelector('#lastname').value;\n client.date = document.querySelector('#date').value;\n client.number = document.querySelector('#number').value;\n client.email = document.querySelector('#email').value;\n client.address = document.querySelector('#address').value;\n\t\tlocalStorage.setItem('clients', JSON.stringify(clients));\n\t\treturn client;\n\t}", "title": "" }, { "docid": "1fa87fe85d93119a7e130a14a92b14c7", "score": "0.517944", "text": "function guardarNota(idAlumnoJuegoDeCuestionario) {\n let url2 = server + '/api/AlumnosJuegoDeCuestionario/' + idAlumnoJuegoDeCuestionario;\n console.log('2 MY URL GUARDAR IS: ' + url2);\n request({url: url2, method: 'PUT', json: JSON.parse(alumnoJuegoDeCuestionario)}, function(error2, request2, body2) {\n console.log('2 MY BODU OF RESPONSE IS: ' + body2);\n });\n}", "title": "" }, { "docid": "b55b5195bcf2c3ed69b708224c35f60f", "score": "0.5178514", "text": "function excluir(id){\n //limpa os registros do controle de acesso\n limpaControleAcesso(id);\n //deleta o registro\n deletar(id);\n //captura a linha informada\n var linha = document.getElementById(\"linha\"+id);\n //remove a linha da tabela\n linha.remove();\n}", "title": "" }, { "docid": "4181151d54b88b3cd65736dc1c4b1917", "score": "0.51729447", "text": "function recuperar(id) {\n var active = dataBase.result;\n var data = active.transaction([\"clientes\"], \"readonly\");\n var object = data.objectStore(\"clientes\");\n var index = object.index(\"id_cliente\");\n var request = index.get(id);\n\n //$(\"#formu\").show();\n //$(\"#busquedaregistro\").hide();\n\n\n request.onsuccess = function () {\n var result = request.result;\n if (result !== undefined) {\n \n //document.querySelector('#id').value = result.id;\n document.querySelector('#ci').value = result.cedula;\n document.querySelector('#nombre').value = result.nombre;\n document.querySelector('#apellido').value = result.apellido;\n document.querySelector('#direccion').value = result.direccion;\n document.querySelector('#telefono').value = result.telefono;\n\n\n //$('#eliminar').attr(\"disabled\", false);\n $('#btnSubmit').attr(\"disabled\", true);\n $('#editar').attr(\"disabled\", false);\n //$('#ci').attr(\"readonly\", true);\n $(\"#nombre\").focus();\n \n }\n };\n}", "title": "" }, { "docid": "70c5a2fb2011c930233c093f40eec7c8", "score": "0.5170793", "text": "function editarSucursal(idSucursal,identificativoNit,nombre,telefono1,telefono2,celular,direccion,longitud,latitud,email,urlLogo,\n\t\t\t\t\t\tleyendaencabezado,estado,idPais,idCiudad,idBarrio,NombreCiudad,NombrePais,NombreBarrio){\n\t\n\t\n\tcancelarGuardadoSucursal();\n\t\n\t//se asignan los valores\n\t$(\"#editar_idSucursal\").val(idSucursal);\n\t\n\t$(\"#editar_idPais\").val(idPais);\n\t$(\"#editar_idCiudad\").val(idCiudad);\n\t$(\"#editar_idBarrio\").val(idBarrio);\n\t$(\"#editar_sucursal_nit\").val(identificativoNit);\n\t$(\"#editar_sucursal_nombre\").val(nombre);\n\t$(\"#editar_sucursal_leyendaEncabezado\").val(leyendaencabezado);\n\t$(\"#editar_sucursal_telefono1\").val(telefono1);\n\t$(\"#editar_sucursal_telefono2\").val(telefono2);\n\t$(\"#editar_sucursal_celular\").val(celular);\n\t$(\"#editar_sucursal_direccion\").val(direccion);\n\t$(\"#editar_sucursal_latitud\").val(latitud);\n\t$(\"#editar_sucursal_longitud\").val(longitud);\n\t$(\"#editar_sucursal_email\").val(email);\n\t$(\"#editar_pais\").val(NombrePais);\n\t$(\"#editar_ciudad\").val(NombreCiudad);\n\t$(\"#editar_barrio\").val(NombreBarrio);\n\t\n\t//se cambia la imagen\n\t$(\"#editar_sucursal_logo\").attr(\"src\",urlLogo);\n\t\n\tif(estado == 'A'){\n\t\t$('#editar_sucursal_estado').prop('checked', true);\t\n\t}else{\n\t\t$('#editar_sucursal_estado').prop('checked', false);\n\t}\n\t\n\t$(\"#label_editar_sucursal_nit\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_nombre\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_leyendaEncabezado\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_telefono1\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_telefono2\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_celular\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_latitud\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_longitud\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_direccion\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_email\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_pais\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_ciudad\").addClass( \"active\" );\n\t$(\"#label_editar_sucursal_barrio\").addClass( \"active\" );\n\t\n\t\n\t$(\"#tituloLi\").hide('slower');\n\t\n\t//se muestra el formulario\n\t$(\"#hidden_editar_Sucursal\").show('slower');\n\t\n}", "title": "" }, { "docid": "01f679d80e4df8523c350a5538956d3b", "score": "0.5164623", "text": "setIdCalendarToDelete(id){\n this.idCalendarToDelete = id; \n }", "title": "" }, { "docid": "1642926dbf8b31457a21e28d1d88f480", "score": "0.51641417", "text": "function editme(id, name) {\n\tMAIN_ACTIVE_GENELIST_ID = id;\n\tMAIN_ACTIVE_GENELIST_NAME = name;\n\t$(\"#formBarang\").show();\n\t$(\"#namebarangid\").val(name);\n\tcurrent_opration = \"edit\";\n}", "title": "" }, { "docid": "4f934c352ea95850906c8d0657325c7f", "score": "0.51563144", "text": "function onSave(e, id) {\r\n e.preventDefault()\r\n setEdit(false)\r\n let { name, email, password, role } = e.target.elements;\r\n name = name.value;\r\n email = email.value;\r\n role = role.value;\r\n password = password.value;\r\n e.target.elements.password.value = '';\r\n fetch('/api/users/editUser', {\r\n method: 'PUT',\r\n body: JSON.stringify({ id, name, email, role, password }),\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n }\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n if (data.success == true) {\r\n alert('update sucsses');\r\n }\r\n else if (data.success == false) {\r\n alert(data.error)\r\n }\r\n })\r\n }", "title": "" }, { "docid": "944d45bf436ad63a2c24cc73bfb92df9", "score": "0.51542276", "text": "function editarId(id) {\n $.ajax({\n type: 'POST',\n data: \"id=\" + id,\n url: '../controllers/libro/libroObtenerID.php',\n cache: false,\n success: function (r) {\n r = JSON.parse(r);\n $('#txtided').val(r['id_libro']);\n $('#txtnombrelibed').val(r['titulo']);\n $('#txtdescripcionlibed').val(r['descripcion']);\n $('#txtnumpaglibed').val(r['num_paginas']);\n $('#txtediccionlibed').val(r['edicion']);\n $(\"#imglibed\").attr(\"src\", \"data:image/jpg;base64,\" + r['portada']);\n $('#txtannlibed').val(r['ann']);\n $('#selectestadolibed').val(r['estado']);\n $('#urlimagened').val(r['portada']);\n $('#selecteditlibed').val(r['id_editorial']);\n }\n });\n}", "title": "" }, { "docid": "1a7228401092e53aadc6cebf512dc182", "score": "0.5147141", "text": "async save({ id = null, name }) {\n super.save({id, name})\n }", "title": "" }, { "docid": "6930ca271a1611fb43f58bf9490f356d", "score": "0.5145088", "text": "function modificarAnuncio(anuncio){\n for(i = 0; i < arrayAnuncios.length; i++)\n {\n if(arrayAnuncios[i].id == anuncio.id)\n {\n arrayAnuncios.splice(i, 2, anuncio);\n }\n }\n \n localStorage.setItem(\"Anuncios\", JSON.stringify(arrayAnuncios));\n limpiarForm();\n cargarTabla(arrayAnuncios);\n}", "title": "" }, { "docid": "467ecbae3dfddb46bb6c91e7ea889a41", "score": "0.51424724", "text": "set(id) {\n let tempParent;\n\n if (id === null) {\n tempParent = null;\n } else if (id !== undefined) {\n if (association.isPolymorphic) {\n assert(\n typeof id === \"object\",\n `You're setting an ID on the polymorphic association '${association.name}' but you didn't pass in an object. Polymorphic IDs need to be in the form { type, id }.`\n );\n tempParent = association.schema[\n association.schema.toCollectionName(id.type)\n ].find(id.id);\n } else {\n tempParent =\n association.schema[\n association.schema.toCollectionName(association.modelName)\n ].find(id);\n assert(\n tempParent,\n `Couldn't find ${association.modelName} with id = ${id}`\n );\n }\n }\n\n this[key] = tempParent;\n }", "title": "" }, { "docid": "44b543bc6c0c17278d7c9929672541fc", "score": "0.5136022", "text": "function NovoRegistro(){\r\n\t\r\n\t//Se houver linha sendo editada, cancela edição\r\n\tif(linhaEmEdicao){// Se linhas em edição for nulo...\r\n\t\talert(\"Você está com um registro aberto. Feche-o antes de prosseguir\");\r\n\t}else{\r\n\t\t//Insere uma nova linha na tabela\r\n\t\tproxIndice = document.getElementById('tabela').rows.length-1;//Armazena o índice a linha que será inserida\r\n\t\tvar novaLinha = document.getElementById('tabela').insertRow(proxIndice);//Insere uma nova linha na tabela\r\n\t\tnovaLinha.className = 'linhaSelecionada';//Define a classe de estilos que será usada na n ova linha\r\n\t\r\n\t\t//Define o id da nova linha (que será usado em caso de edição/exclusão\r\n\t\tnovoId = \"nova\"+linhasNovas;//Armazena o id da linha\r\n\t\tnovaLinha.setAttribute('id', novoId);//Define que o nome do id será o valor da variável novoId\r\n\t\tlinhasNovas++; //Incrementa o valor da variável\r\n\t\tlinhaEmEdicao = novoId;// Aramazena o valor da variável novoId\r\n\t\t\r\n\t\t//Insere as células na linha criada\r\n\t\tvar novasCelulas = new Array(3); //Cria um array\r\n\t\tfor(var i=0; i<4; i++){\r\n\t\t\tnovasCelulas[i] = novaLinha.insertCell(i); //Preenche o array\r\n\t\t}\r\n\t\t//Cria os campos dos formulários\r\n\t\t//novasCelulas[0].innerHTML = '*'; //código do produto\r\n\t\tnovasCelulas[0].innerHTML = '<input type=\"text\" name=\"codigo_categoria\" id=\"codigo_categoria\" onblur=\"isPreenchido(this);\" onkeyup=\"this.value = this.value.toString().toUpperCase();\" class=\"requerido, caixaAlta\" style=\"width:80px\">'; //insere o campo nome\r\n\t\tnovasCelulas[1].innerHTML = '<input type=\"text\" name=\"categoria\" id=\"categoria\" onblur=\"isPreenchido(this);\" onkeyup=\"this.value = this.value.toString().toUpperCase();\" class=\"requerido, caixaAlta\">'; //insere o campo nome\r\n\t\tnovasCelulas[2].innerHTML = '<div style=\"text-align: center;\"><a href=\"#\" onclick=\"Cadastrar(document.forms[0].codigo_categoria.value, document.forms[0].categoria.value);\" title=\"Cadastrar\">Cadastrar</a> &nbsp; <a href=\"#\" onclick=\"CancelarInclusao();\" title=\"Cancelar\">Cancelar</a></div>';\r\n\t}\r\n}", "title": "" }, { "docid": "fe0018a935cb8e3f338efd509de179de", "score": "0.5134922", "text": "onModify(id) {\n browserHistory.push(`/edit/${id}`);\n }", "title": "" }, { "docid": "2dd8526b3cdc3472e014cacf9d265344", "score": "0.5133613", "text": "updateStatus(field, id) {\n createToast(\"جاري التعديل\", '', \"info\", \"\");\n let user = null;\n user = this.usersPage[id];\n user[field] = document.getElementsByClassName(field)[id].value;\n this.db.dbCreateOrUpdate('/users', user, user._id).then(resp => {\n if (resp.ok) {\n user._rev = resp.rev;\n createToast(\"نجحت العملية\", 'تم تعديل الحالة', \"success\", \"check\");\n }\n });\n }", "title": "" }, { "docid": "445d2e5a46c4d424fe4198e60cc5571b", "score": "0.51306367", "text": "static async update(id, data) {\n const db = await getDB();\n const collection = db.collection('transactions');\n return collection.updateOne({'_id':id}, {$set: data});\n }", "title": "" }, { "docid": "ca4717f7a08a4d2bff97a24617ea961c", "score": "0.5123519", "text": "updateEmployee(id, name, email, number, username, success) {\n connection.query('update Ansatte set navn=?, epost=?, tlf=?, brukernavn=? where ansatt_id=?',\n [name, email, number, username, id], (error, results) => {\n if (error) return console.error(error);\n\n success();\n });\n }", "title": "" }, { "docid": "133a119c00fa4c9f86600cf0de8a7746", "score": "0.5120981", "text": "updateById(id, data) {\n let savedData = this.getAll();\n\n if (savedData === null || savedData.length === 0) {\n return false;\n }\n\n for (let i = 0; i < savedData.length; i++) {\n if (savedData[i].id === id) {\n for (let j = 0; j < this.fields.length; j++) {\n let field = this.fields[j];\n if (data.hasOwnProperty(field)) {\n savedData[i][field] = data[field];\n }\n }\n }\n }\n\n this.localStorageSet(savedData);\n\n return true;\n }", "title": "" }, { "docid": "dc0f2d2170279292e9300d0769fc73b0", "score": "0.51162505", "text": "async function actualizarContact(id, nuevoFirstname, nuevoLastname, nuevoEmail, nuevoId_company, nuevoId_role) {\n try {\n const resultado = await connection.query(\n \"UPDATE contacts SET firstname = :nuevoFirstname, lastname = :nuevoLastname, email = :nuevoEmail, id_company = :nuevoId_company, id_role = :nuevoId_role WHERE contacts.id_contacts = :id\",\n {\n type: sequelize.QueryTypes.PUT,\n replacements: {\n id: id,\n nuevoFirstname: nuevoFirstname,\n nuevoLastname: nuevoLastname,\n nuevoEmail: nuevoEmail,\n nuevoId_company: nuevoId_company,\n nuevoId_role: nuevoId_role,\n },\n }\n );\n console.log(resultado);\n } catch (err) {\n return err;\n }\n}", "title": "" }, { "docid": "e1e39a942ea9d8460ae92cb6c38b292d", "score": "0.5113976", "text": "function reset(id) {\n idToSeymour[id].editor.setValue(idToCode[id]);\n}", "title": "" }, { "docid": "03b8b66271635d018e82a63e86bbf77f", "score": "0.5112638", "text": "function cargardatos(id){\n $('#'+id+' td.id').each(function() {\n var id = $(this).text();\n $(\"#inputid\").val(id);\n });\n $('#'+id+' td.precio').each(function() {\n var precio = $(this).text();\n $(\"#inputprecio\").val(precio);\n });\n $('#'+id+' td.hora').each(function() {\n var hora = $(this).text();\n $(\"#inputhora\").val(hora);\n });\n $(\"#btninsert\").val(\"Modificar\");\n //$(\"#nuevoAlumno\").val(\"modificar\");\n}", "title": "" }, { "docid": "a9b2b22b6bb99ac2a55bc64785a360b8", "score": "0.51120615", "text": "function setStatutCommande(id, statut) {\n var url = '/set/statut/commande/' + id + '/' + statut;\n $.ajax({\n type: 'GET',\n url: url,\n success: function() {\n notify('Succès', 'Le statut de la commande a été modifié', {\n closeDelay: 3000\n });\n var commande = app.collections.commandeLive.get(id);\n if (commande != undefined) {\n commande.set({\n statut_id: statut\n });\n if (statut == 4) {\n //imprimerCommande(id);\n }\n }\n var commande = app.collections.commandeFullLive.get(id);\n if (commande != undefined) {\n commande.set({\n statut_id: statut\n });\n }\n }\n });\n\n}", "title": "" }, { "docid": "dbd6381c632fd4b74ae2dd626edeae49", "score": "0.5110572", "text": "function editarCurso(id, body) {\n var uri = __env.apiUrl + 'curso/editar/' + id;\n return $http({\n url: uri,\n method: \"PUT\",\n data: body,\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "title": "" } ]
86752e0ba5941ace33219fb678714662
creates a card which has a coin
[ { "docid": "63ba38978296c1108473758a2f93bcbb", "score": "0.67719865", "text": "function createCoinCard(coinObject, moreInfoCache, idArray) {\n let coinSymbol = removeDotFromCoinSymbol(coinObject.symbol)\n let toggleButton = createToggleButton(coinSymbol, idArray)\n let containerDiv = $(\"<div>\").addClass(\"col-lg-3 col-sm-6\")\n let cardDiv = $(\"<div>\").addClass(\"card\");\n let cardBodyDiv = $(\"<div>\").addClass(\"card-body\");\n let cardH5 = $(\"<h5>\").addClass(\"card-title\").text(coinSymbol);\n let cardP = $(\"<p>\").addClass(\"card-text\").text(coinObject.name);\n let moreInfoDiv = $(`<div id=collapse${coinObject.id}>`).addClass(\"collapse\");\n let loadingImage = createCardLoadingImage()\n let cardButton = createCardButton(coinObject).click\n (function () { onShowMoreInfoClicked(moreInfoDiv, moreInfoCache, coinObject.id, loadingImage) });\n\n addElementsToCoinsDiv(cardDiv, cardBodyDiv, cardH5, cardP, cardButton, loadingImage, containerDiv, toggleButton, moreInfoDiv)\n}", "title": "" } ]
[ { "docid": "2824afa48cf1724e04f7c1a7c547325b", "score": "0.72633654", "text": "function makeCoin() {\n\t\t// choose random locations to spawn the coins\n\t\tvar x = Math.round(Math.random() * board_size.width);\n\t\tvar y = Math.round(Math.random() * board_size.height);\n\n\t\t// choose a random coin value \n\t\tvar value = coins[Math.round(Math.random() * coins.length)];\n\n\n\t\t// add the coin object to current coins\n\t\tcurrent_coins.push({\n\t\t\tmyX: x,\n\t\t\tmyY: y,\n\t\t\tmyValue: value,\n\t\t\tmyId: \"\" + id\n\t\t});\n\n\t\tmakeElement(x, y, \"coin\", \"yellow\", SIZE, id);\n\t\tid+=1;\t\t\n\t}", "title": "" }, { "docid": "86da2190102a375dc8a4ad56d34c649f", "score": "0.7098079", "text": "async Createcard(ctx, owner, balance) {\n\tif (ctx.clientIdentity.getMSPID() != 'Org1MSP'){\n throw new Error(\"This POS cannot issue cards\");\n }\n\tvar id = this.getCardID();\n const card = {\n ID: id,\n Owner: owner,\n Balance: balance,\n };\n ctx.stub.putState(id, Buffer.from(JSON.stringify(card)));\n return JSON.stringify(card);\n }", "title": "" }, { "docid": "e7f2e8d700cf1d9742c1051a863a971e", "score": "0.70011836", "text": "createCard(){\n\n\t}", "title": "" }, { "docid": "321e7267c92baa87678607fabab307c7", "score": "0.69736767", "text": "function makeCopper(){\n\t\tvar copperDescription = \"1 coin\";\n\t\tvar copper = new Card(\"copper\", 0, copperDescription, \"img/copper.jpg\");\n\t\tcopper.numberPerGame = {\"1\": 53, \"2\": 46, \"3\": 39, \n\t\t\t\t\t\t\t \"4\": 32, \"5\": 85, \"6\": 78};\n\t\t//Add one to total number of coins during buy phase\n\t\tcopper.actions[\"onCoin\"] = function(player){\n\t\t\t\t\t\t\t\t\t \t\tplayer.incrementCoins(1);\n\t\t\t\t\t\t\t\t\t \t\treturn true;\n\t\t\t\t\t\t\t\t\t };\n\t\tcopper.hasCoin = true;\n\t\tcopper.isBasicCoin = true;\n\t\treturn copper;\n\t}", "title": "" }, { "docid": "34f457bc140d77f904ccd8148e86a922", "score": "0.68426555", "text": "function createCoin(_cost, _color){\r\n var place = getRandomEmptyTile();\r\n board[place[1]][place[0]] = 2;\r\n var coin = {x : place[0]*20+10 , y : place[1]*20+10, radius : 6, color : _color, cost: _cost};\r\n return coin;\r\n}", "title": "" }, { "docid": "e6c237ef79b8833b629b18ebda2b6bf4", "score": "0.6809845", "text": "function MakeCard(name, number, pin, experation){\n name:name,\n number:number,\n pin:pin,\n experation:experation\n }", "title": "" }, { "docid": "88e70cc8fe20429b555a4ceddd82813d", "score": "0.6805186", "text": "function createCoin(type) {\n const coin = document.createElement('div');\n coin.classList.add('coin', type);\n const coinPara = document.createElement('p');\n coinPara.innerText = type;\n coin.appendChild(coinPara);\n updateCoinTotal(type);\n return coin;\n}", "title": "" }, { "docid": "8cfbbcf308bd7a23921eb674a6b31299", "score": "0.6781922", "text": "function clozeCardCreate(full, answer){\n\t//console.log(full, answer);\n\tvar clozeCard = new Cloze(full, answer);\n\n\tclozeArray.push(clozeCard);\n\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: 'makeAnother',\n\t\t\tmessage: 'Make another cloze card?',\n\t\t\ttype: 'confirm'\n\t\t}\n\t]).then(function(answer){\n\t\tif(answer.makeAnother){\n\t\t\tcreateClozeSentence();\n\t\t} else {\n\t\t\tjsonfile.readFile('clozeCard.json', function(err, data){\n\t\t\t\tif(data.length>0){\n\t\t\t\t\tArray.prototype.push.apply(data, clozeArray);\n\t\t\t\t\tjsonfile.writeFile('clozeCard.json', data, function(err){\n\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclozeArray = [];\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tjsonfile.writeFile('clozeCard.json', clozeArray, function(err){\n\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclozeArray = [];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\tstart();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0d137390b01cce6b2fecdf4dbbe5b401", "score": "0.6726641", "text": "function createHand() {\n createCards(game.players[game.currentPlayer].hand.cards, \"hand\");\n}", "title": "" }, { "docid": "eb1165fc11ea2a59a52e5f93e33c020f", "score": "0.6611418", "text": "function dealingCard(){\n var cardSuit = Math.floor(Math.random() * 4) + 1;\n var cardNumber = Math.floor(Math.random() * 13) +1;\n return new Card(cardSuit, cardNumber);\n}", "title": "" }, { "docid": "5090ba4220842946ccfa46eb96d42c10", "score": "0.66044843", "text": "function newCard(){\n\n if (isAlive === true && hasBlackJack === false){\n let card = getRandomCard()\n sum += card;\n cards.push(card);\n renderGame()\n }\n}", "title": "" }, { "docid": "f6a29e7604cc42751b3a729ef6b91330", "score": "0.6581764", "text": "function drawCard(player) {\n let createCard = () => ({\n val: Math.floor(Math.random() * 12 + 1),\n suit: ['♠', '♦', '♣', '♥', '♡', '♢', '♤', '♧'][Math.floor(Math.random() * 8)]\n });\n\n player['card'] = createCard();\n}", "title": "" }, { "docid": "7ce63b4f0681852c3f79a66c726035fa", "score": "0.6571896", "text": "function MakeCard(holder, number, expiration) {\n var creditCard = {};\n creditCard.cardHolder = holder;\n creditCard.cardNum = number;\n creditCard.cardExp = expiration;\n\n return creditCard;\n}", "title": "" }, { "docid": "24bb3862a7b9f812f6be7f211d381d0c", "score": "0.6562464", "text": "function createCard() {\n inquirer.prompt({\n type: \"list\",\n message: \"Choose a card type:\",\n choices: [\"Basic Card\", \"Cloze Deletion Card\"],\n name: \"cardChoice\"\n })\n .then(function (response) {\n if (response.cardChoice === \"Basic Card\") {\n basicCard();\n } else {\n clozeCard();\n }\n })\n}", "title": "" }, { "docid": "727cd110d703e2c2cb8a4da4c5d81b8e", "score": "0.65608084", "text": "create(){\n console.log(\"Yall good\");\n const suits =['h','s','d','c'];\n suits.forEach((suit)=>{\n for(let c = 1; c<=13; c++){\n this.cards.push(c+suit);\n }\n })\n\n }", "title": "" }, { "docid": "e47a5dcd980eb19c7425ffd6ec9c7638", "score": "0.65233666", "text": "function newCard(player){\n const randomNum = Math.floor(Math.random() * 13);\n const card = Object.assign({}, GM.cards[randomNum]);\n \n if(card.name === 'ace'){\n if (player.total() + card.value[1] <= 21) {\n card.value = card.value[1];\n } else {\n card.value = card.value[0];\n }\n }\n\n return card;\n }", "title": "" }, { "docid": "16d6c09e48fd1af826254c9e03bb4974", "score": "0.6517338", "text": "function makeMarket(){\n\t\tvar marketDescription = \"+1 card\\n\"+\"+1 action\\n\"+\"+1 buy\"+\"+1 coin\\n\";\n\t\tvar market = new Card(\"market\", 5, marketDescription, \n\t\t\t\t\t\t\t \"img/market.jpg\");\n\t\tmarket.actions[\"onAction\"] = marketOnAction;\n\n\t\t//Input: player object\n\t\t//Description: player gains one action, one buy, and one coin\n\t\tfunction marketOnAction(player){\n\t\t\tvar numDraw = player.draw(1, true);\n\t\t\tif (numDraw === 1){writeToLog(\"... drawing 1 card\")};\n\t\t\tplayer.incrementActions(1);\n\t\t\twriteToLog(\"... gaining 1 action\");\n\t\t\tplayer.incrementBuys(1);\n\t\t\twriteToLog(\"... gaining 1 buy\");\n\t\t\tplayer.incrementCoins(1);\n\t\t\twriteToLog(\"... gaining 1 coin\");\n\t\t\tmarket.onObjectPlayEnd();\n\t\t\treturn true;\n\t\t}\n\n\t\tmarket.hasAction = true;\n\t\treturn market;\n\t}", "title": "" }, { "docid": "a8e8f886ac8d5078d1183953651246e9", "score": "0.64974725", "text": "function createSelectedCoinCard(coinObject, moreInfoCache) {\n $(\"#coinsDiv\").empty()\n let toggleButton = null\n let containerDiv = $(\"<div>\").addClass(\"col-lg-3 col-sm-6\")\n let cardDiv = $(\"<div>\").addClass(\"card\");\n let cardBodyDiv = $(\"<div>\").addClass(\"card-body\");\n let cardH5 = $(\"<h5>\").addClass(\"card-title\").text(coinObject.symbol);\n let cardP = $(\"<p>\").addClass(\"card-text\").text(coinObject.name);\n let moreInfoDiv = $(`<div id=collapse${coinObject.id}>`).addClass(\"collapse\");\n let loadingImage = createCardLoadingImage()\n let cardButton = createCardButton(coinObject).click(function () { onShowMoreInfoClicked(moreInfoDiv, moreInfoCache, coinObject.id, loadingImage) });\n addElementsToCoinsDiv(cardDiv, cardBodyDiv, cardH5, cardP, cardButton, loadingImage, containerDiv, toggleButton, moreInfoDiv)\n}", "title": "" }, { "docid": "e18fb8dea8209998ad6fa060745c1982", "score": "0.6491479", "text": "createCard(val, suit) {\n return {\n value: val,\n suit,\n trueValue: this.convertToValue(val),\n };\n }", "title": "" }, { "docid": "0037dc3b99eb6cfacfafce6cc844424f", "score": "0.6476116", "text": "create() {\n let suits = [\"Karo\", \"Herz\", \"Pik\", \"Kreuz\"];\n let rank = ['10', 'Q', 'K', 'A', 'B'];\n let values = [1, 2, 3, 4, 5];\n\n for (let i = 0; i < suits.length; i++) {\n for (let j = 0; j < rank.length; j++) {\n this.cards.push(new Card(suits[i], rank[j], values[j]));\n }\n }\n }", "title": "" }, { "docid": "87f4dc27759fef97a5e2759745c7e663", "score": "0.6469843", "text": "function createNewCard() {\n clear(); // Resets the canvas\n // Resets the properties of the card\n card.swipeable = false;\n card.swiped = false;\n card.swipeAmount = 0;\n avi.createRandomAvatar();\n card.name = random(names.names);\n card.quest = random(quests.quests);\n card.distance = random(distances);\n setTimeout(function () {\n card.swipeable = true;\n }, 100);\n displayCard();\n}", "title": "" }, { "docid": "fb039082fc62a42eb2eb2e77370835ef", "score": "0.6465248", "text": "function makeGold(){\n\t\tvar goldDescription = \"3 coins\";\n\t\tvar gold = new Card(\"gold\", 6, goldDescription, \"img/gold.jpg\");\n\t\tgold.numberPerGame = {\"1\": 30, \"2\": 30, \"3\": 30, \n\t\t\t\t\t\t\t \"4\": 30, \"5\": 60, \"6\": 60};\n\t\t//Adds 3 to the amount of coins during buy phase\n\t\tgold.actions[\"onCoin\"] = function(player){\n\t\t\t\t\t\t\t\t\t \t\tplayer.incrementCoins(3);\n\t\t\t\t\t\t\t\t\t \t\treturn true;\n\t\t\t\t\t\t\t\t\t };\n\t\tgold.hasCoin = true;\n\t\tgold.isBasicCoin = true;\n\t\treturn gold;\n\t}", "title": "" }, { "docid": "1cfbce8c934ba51cc17c9c9f3307bae3", "score": "0.64587885", "text": "function newCard(){\n if(isAlive ===true && hasBlackJack === false) {\n let card = getRandomCard()\n sum += card\n cards.push(card)\n renderGame()\n }\n \n}", "title": "" }, { "docid": "a0e3a980729266d5cb2e2af6d013136d", "score": "0.6420831", "text": "function makeMoneylender(){\n\t\tvar moneylenderDescription = \"Trash a copper from your hand. If you \"+\n\t\t\t\t\t\t\t\t\t \"do, +$3\";\n\t\tvar moneylender = new Card(\"moneylender\", 4, moneylenderDescription, \n\t\t\t\t\t\t\t\t \"img/moneylender.jpg\");\n\t\tmoneylender.actions[\"onAction\"] = moneylenderOnAction;\n\n\t\t//Input: player object, [card name, card id]\n\t\t//Description: Makes sure the card selected is a copper\n\t\tfunction isValidSolution(player, cardInfo){\n\t\t\tif (cardInfo[0] === \"copper\"){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//Input: player object, [card name, card id]\n\t\t//Description: Trash a card and gain $3\n\t\tfunction onCardClick(player, cardInfo){\n\t\t\tplayer.removeCardFromHand(cardInfo[0], cardInfo[1], board.trash);\n\t\t\tplayer.incrementCoins(3);\n\t\t\twriteToLog(\"... trashing a copper\");\n\t\t\twriteToLog(\"... gaining $3\");\n\t\t\tmoneylender.onObjectPlayEnd();\n\t\t}\n\n\t\t//Input: player\n\t\t//Description: Choose a card to trash and if it's a copper\n\t\t//get $3\n\t\tfunction moneylenderOnAction(player){\n\t\t\tvar question = \"Trash a copper from your hand\";\n\t\t\tplayer.selectSingleCard(question, isValidSolution,\n\t\t\t\t\t\t\t\t\t\t onCardClick, \"hand-card\");\n\t\t\treturn true;\n\t\t}\n\n\t\tmoneylender.hasAction = true;\n\t\treturn moneylender;\n\t}", "title": "" }, { "docid": "235fd976e0cb26bbecd7b4786d8f8565", "score": "0.6408406", "text": "function createCards(){\n\t\t\t// spades\n\t\t\tfor(var i=0;i<8;i++){ cardsArray[i]=new card(i+1+\".png\", i+7, 2, 0); }\n\t\t\t// hearts\n\t\t\tfor(var i=8;i<16;i++){ cardsArray[i]=new card(i+1+\".png\", i-1, 1, 0); }\n\t\t\t// diamonds\n\t\t\tfor(var i=16;i<24;i++){ cardsArray[i]=new card(i+1+\".png\", i-9, 0, 0); }\n\t\t\t// clubs\n\t\t\tfor(var i=24;i<32;i++){ cardsArray[i]=new card(i+1+\".png\", i-17, 3, 0); }\n\t\t}", "title": "" }, { "docid": "f1e146f96ac9ae8cc1b83404b6b8cab4", "score": "0.6382888", "text": "function createType (){\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname: 'cardType',\n\t\t\t\tmessage: 'Which type of card would you like to create?',\n\t\t\t\tchoices: ['Basic card', 'Cloze card'],\n\t\t\t\ttype: 'list'\n\t\t\t}\n\t\t]).then(function(answer){\n\t\t\tif(answer.cardType === 'Basic card'){\n\t\t\t\tcreateBasic();\n\t\t\t} else {\n\t\t\t\tcreateClozeSentence();\n\t\t\t}\n\t\t});\t\n}", "title": "" }, { "docid": "7663f1e3285a3ed54a91ed3493ec140f", "score": "0.63814074", "text": "function generateCoins(){\r\n if(frameCount%60 === 0){\r\n coins = createSprite(50,0,10,10);\r\n coins.addImage(coinsImg);\r\n var number = Math.round(random(1,3))\r\n switch(number){\r\n case 1:coins.x = displayWidth/2-150\r\n break;\r\n case 2:coins.x = displayWidth/2\r\n break;\r\n case 3:coins.x = displayWidth/2+150\r\n break;\r\n }\r\n coins.velocityY = 20+score/100;\r\n coins.lifetime = 350;\r\n coins.scale = 0.1;\r\n coinsGroup.add(coins)\r\n \r\n }\r\n}", "title": "" }, { "docid": "2bcbbf22b59bbc23754a520c40803cd5", "score": "0.6353916", "text": "function makeMine(){\n\t\tvar mineDescription = \"Trash a treasure card from your hand. Gain \"+\n\t\t\t\t\t\t\t \"a treasure card costing up to 3 coins more; \"+\n\t\t\t\t\t\t\t \"put it into your hand\";\n\t\tvar mine = new Card(\"mine\", 5, mineDescription, \"img/mine.jpg\");\n\t\treturn mine;\n\t}", "title": "" }, { "docid": "cc814454fc66e8c61dc164b0e83366dc", "score": "0.6340206", "text": "function MakeCard(number, fullname, expiration) {\n return {\n number: number,\n fullname: fullname,\n expiration: expiration\n };\n}", "title": "" }, { "docid": "7661bb1efd77781631dc355f7d7aac99", "score": "0.63271844", "text": "function Card(suit, num) {\n this.suit = suit;\n this.num = num;\n}", "title": "" }, { "docid": "6796ab27abc9d1808afca35c490fcabd", "score": "0.6310366", "text": "function createCard(style, shape, color, count){\n if(mode === \"easy\"){\n style = \"solid\";\n }\n let attribute = style + \"-\" + shape + \"-\" + color;\n let id = attribute + \"-\" + count;\n while(ifRepeat(id)){\n if(mode === \"standard\"){\n style = randomStyle();\n }\n shape = randomShape();\n color = randomColor();\n count = randomCount();\n attribute = style + \"-\" + shape + \"-\" + color;\n id = attribute + \"-\" + count;\n }\n let game = document.getElementById('game');\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n for(let i = 0; i < count; i++){\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", \"img/\" + attribute + \".png\");\n img.setAttribute(\"alt\", attribute);\n card.appendChild(img);\n card.setAttribute(\"id\", id);\n same.push(id);\n }\n card.addEventListener(\"click\", selectCard);\n game.appendChild(card);\n }", "title": "" }, { "docid": "78c6d182206b91b865c24aa729be689a", "score": "0.63058585", "text": "function createCard() {\n const cardText = document.querySelector('.text-input').value;\n\n if (cardText !== \"\" ) {\n const card = {\n id: Math.random().toString(16).slice(2, 8),\n cardText: cardText,\n position: 'todo'\n }\n\n createCards(card);\n saveCards();\n clearInput();\n }\n}", "title": "" }, { "docid": "b90fdc29c06c3626ee6d2da0195fa69f", "score": "0.6293724", "text": "function construct(game, msg) {\n\tvar winner = false;\n\tif( msg != null ) {\n\t\tvar cardDef = cards[msg];\n\t\t//can you afford that?\n\t\tif( cardDef.cost > game.currentPlayer.coins ) {\n\t\t\tconsole.log(\"Card error: player can't afford card\");\n\t\t} else {\n\t\t\tif (cardDef.class == \"landmark\") {\n\t\t\t\t//completing a landmark\n\t\t\t\t//eradicate this\n\t\t\t\tfor(var i = 0; i < game.currentPlayer.landmarks.length; i++) {\n\t\t\t\t\tif(game.currentPlayer.landmarks[i].name == msg ) {\n\t\t\t\t\t\tgame.currentPlayer.landmarks[i].active = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgame.currentPlayer[msg] = true;\n\t\t\t\tgame.currentPlayer.coins -= cardDef.cost;\n\t\t\t\tsendMessage(game, game.currentPlayer.name + \" completed construction on the \" + msg, \"game\");\n\t\t\t\t\t\t\n\t\t\t\t//check for win!\n\t\t\t\twinner = true;\n\t\t\t\tfor (var i = 0; i < game.currentPlayer.landmarks.length; i++)\n\t\t\t\t\tif(game.currentPlayer.landmarks[i].active == false)\n\t\t\t\t\t\twinner = false;\n\t\t\t} else {\n\t\t\t\t//constructing an establishment\n\t\t\t\tvar supplyIndex = null;\n\t\t\t\t//find card in back, check for count > 0\n\t\t\t\tfor(var i = 0; i < game.supply.length; i++)\n\t\t\t\t\tif (game.supply[i].name == msg)\n\t\t\t\t\t\tsupplyIndex = i;\n\t\t\t\t\n\t\t\t\t//card is not in supply, there are 0 of that card in the supply, or the player cannot afford card\n\t\t\t\tif( supplyIndex == null || game.supply[supplyIndex].count < 1 ) {\n\t\t\t\t\tconsole.log(\"Card error: supply is out of card\");\n\t\t\t\t} else {\n\t\t\t\t\t//decrement the count in the supply by one.\n\t\t\t\t\tgame.supply[supplyIndex].count -= 1;\n\t\t\t\t\t//if that was the last one, remove from list\n\t\t\t\t\tif( game.supply[supplyIndex].count == 0) {\n\t\t\t\t\t\tgame.supply.splice(supplyIndex, 1);\n\t\t\t\t\t}\n\t\t\t\t\t//Does the player have this card?\n\t\t\t\t\tvar playerCardIndex = null;\n\t\t\t\t\tfor(var i = 0; i < game.currentPlayer.cards.length; i++)\n\t\t\t\t\t\tif (game.currentPlayer.cards[i].name == msg)\n\t\t\t\t\t\t\tplayerCardIndex = i;\n\n\t\t\t\t\t//if the player has the card, increment the count. Else, add it to the player's card list.\n\t\t\t\t\tif( playerCardIndex == null)\n\t\t\t\t\t\tgame.currentPlayer.cards.push({\"name\" : msg, \"count\" : 1});\n\t\t\t\t\telse\n\t\t\t\t\t\tgame.currentPlayer.cards[playerCardIndex].count += 1;\n\t\t\t\t\t\n\t\t\t\t\t//pay the man.\n\t\t\t\t\tgame.currentPlayer.coins -= cardDef.cost;\n\t\t\t\t\t//sort by roll numbers\n\t\t\t\t\tgame.currentPlayer.cards = game.currentPlayer.cards.sort(compareCards);\n\t\t\t\t\t\n\t\t\t\t\tsendMessage(game, game.currentPlayer.name + \" constructed a \" + msg, \"game\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn winner;\n}", "title": "" }, { "docid": "a77ee63580ffc20d200a8e51c612e84e", "score": "0.62902755", "text": "function createCard(id) {\n var newCard = {};\n newCard.id = id;\n newCard.uid = uniqueID();\n return newCard;\n}", "title": "" }, { "docid": "6d05b4087cc9672acfdaa9441d4b4ef2", "score": "0.62771416", "text": "function card(value, suit) {\n this.value = value;\n this.suit = suit;\n}", "title": "" }, { "docid": "7412265ff8f18795133f0d1c3f0a76e2", "score": "0.6275662", "text": "function makeMilitia(){\n\t\tvar militiaDescription = \"+ 2 coins. Each other player discards down \"+\n\t\t\t\t\t\t\t\t \"to 3 cards in his hand\";\n\t\tvar militia = new Card(\"militia\", 4, militiaDescription, \n\t\t\t\t\t\t\t \"img/militia.jpg\");\n\t\treturn militia;\n\t}", "title": "" }, { "docid": "ed59d842d89ef8431b63b75a239f8b03", "score": "0.6265665", "text": "create(){\n console.log(`here's a new deck.`)\n const suits = ['h', 's','d','c']\n suits.forEach((suit)=>{\n //innner loop for the value. \n for(let c = 1; c <=13; c++){\n this.cards.push(c + suit)\n }\n })\n }", "title": "" }, { "docid": "92224952274df55794ae4c84b8e4c800", "score": "0.6254585", "text": "function createNewCard(n_card) {\n var newCard = document.querySelector(\"#card-data\");\n newCard.appendChild(n_card);\n}", "title": "" }, { "docid": "ab6cce490fa25f4f1937d3b36e767ec0", "score": "0.62437135", "text": "function createMoreInfoCoin(coin) {\n return {\n usd: coin.market_data.current_price.usd,\n eur: coin.market_data.current_price.eur,\n ils: coin.market_data.current_price.ils,\n logo: coin.image.thumb,\n id: coin.id\n };\n}", "title": "" }, { "docid": "1d06eebde14c1fd563d3889c56ad4702", "score": "0.62419206", "text": "function makeCard(card) {\n let c = Object.assign({}, card, {cardSet : card.set});\n c.id = c.dbfId; // only use the exchange string ID\n if (c.type.toLowerCase() === \"weapon\") c.health = c.durability;\n let cls = [card.cardClass];\n if (card.classes) {\n cls = card.classes;\n }\n c.classes = new Immutable.Set(cls);\n return new Card(c);\n}", "title": "" }, { "docid": "4ff07e9300fb870416b16f003ed9f47c", "score": "0.623613", "text": "function Card(suit, value) {\n this.suit = suit;\n this.value = value;\n}", "title": "" }, { "docid": "022216d501f2fd4d31ca22c7e33e1ddd", "score": "0.62216425", "text": "function getRandomCard() {\n function randomIntegerInRange(max, min = 0) {\n return Math.floor(Math.random()*max + min);\n }\n\n return new Card(randomIntegerInRange(cardMaxValue, 1), suits[randomIntegerInRange(suits.length)], colors[randomIntegerInRange(colors.length)]);\n }", "title": "" }, { "docid": "3d871c9cc501f0c59c593e64ce1b2f12", "score": "0.61997926", "text": "function createCoin(position) {\r\n\tcoinMaterial = new THREE.MeshBasicMaterial({color: 0xfffc00});\r\n\tcoin = new THREE.Mesh( \r\n\t\t\tnew THREE.CylinderGeometry(2, 2, 1, 12, 2), \r\n\t\t\tcoinMaterial);\r\n\tcoin.position.set(position.x, position.y, position.z);\r\n\tcoin.rotation.z = 67.5;\r\n\tcoin.rotation.y = Math.random() * 360;\r\n\tcoin.lifeTime = 30;\r\n\tcoins.push(coin);\r\n\tscene.add(coins[(coins.length-1)]);\r\n}", "title": "" }, { "docid": "09b518d0f54759c0fbea3519f25012af", "score": "0.6192401", "text": "addCard(){\n\n\t}", "title": "" }, { "docid": "ac6a7798b03b1c50409f42f4b0305224", "score": "0.6188583", "text": "function generate() {\n // Shuffle the cards\n cards = cards.concat(cards);\n cards = shuffle(cards);\n cards.forEach(create);\n}", "title": "" }, { "docid": "00ad80c2a9a04acd7104c2970a6b6c1a", "score": "0.6188179", "text": "function makeCard(cardNumber,expirationDate,securityCode){\n return {\n cardNumber:cardNumber,\n expirationDate:expirationDate,\n securityCode:securityCode\n };\n }", "title": "" }, { "docid": "21c06573afb34a4c3636142f6700cd06", "score": "0.61809635", "text": "function spawnCoins() {\n if (frameCount % 100 === 0){\n var coin = createSprite(800,random(200,350),10,40);\n coin.velocityX = -6;\n coin.addImage(coinImg)\n coin.scale=0.06;\n coin.lifetime=130;\n CoinsGroup.add(coin);\n coin.setCollider(\"circle\",0,0,1);\n }\n }", "title": "" }, { "docid": "530f3737c76d6256030b1ad4e5af647e", "score": "0.6177596", "text": "function createClozeCard(front, back) {\n var clozeOne = new Cloze(front, back);\n saveCard(clozeOne, \"cloze\");\n}", "title": "" }, { "docid": "8b7f9ed80069cfcf37624f4db60910e3", "score": "0.6176176", "text": "function generateCards() {\n for (let j = 0; j < 4; j++) {\n for (let i = 0; i < 13; i++) {\n cards.push({\n suit: j + 1,\n card: i + 1\n });\n }\n }\n console.log(\"Cards generated, length is: \" + cards.length);\n}", "title": "" }, { "docid": "e40beda68c5093ef48c15069fcc94060", "score": "0.6172369", "text": "function makeSilver(){\n\t\tvar silverDescription = \"2 coins\";\n\t\tvar silver = new Card(\"silver\", 3, silverDescription, \"img/silver.jpg\");\n\t\tsilver.numberPerGame = {\"1\": 40, \"2\": 40, \"3\": 40, \n\t\t\t\t\t\t\t\t\"4\": 40, \"5\": 80, \"6\": 80};\n\t\t//Adds 2 to the amount of coins during buy phase\n\t\tsilver.actions[\"onCoin\"] = function(player){\n\t\t\t\t\t\t\t\t\t \t\tplayer.incrementCoins(2);\n\t\t\t\t\t\t\t\t\t \t\treturn true;\n\t\t\t\t\t\t\t\t\t };\n\t\tsilver.hasCoin = true;\n\t\tsilver.isBasicCoin = true;\n\t\treturn silver;\n\t}", "title": "" }, { "docid": "e9b71f366c85fc82b06211dbd7f95cbd", "score": "0.61566913", "text": "function createCard (){\n\tcount++;\n\tlet newDiv = document.createElement(\"div\"); //create new card\n\tnewDiv.className = \"newcard\";\n\tlet newH2 = document.createElement(\"h2\"); //create new header\n\tlet newH2Text = document.createTextNode(\"Card\" + \" \" + count); //text for header\n\tlet fullH2 = newH2.appendChild(newH2Text); //full header\n\n\tlet btnAddBefore = document.createElement(\"button\"); //creating add before button and text\n\tbtnAddBefore.textContent = \"Add Before\";\n\tlet btnAddAfter = document.createElement(\"button\"); //creating add after button and text\n\tbtnAddAfter.textContent = \"Add After\";\n\tlet btnDelete = document.createElement(\"button\"); //create delete button and text\n\tbtnDelete.textContent = \"Delete\";\n\n\tnewDiv.appendChild(fullH2); \t\t\t\t\t\t//append full H2 to the new card\n\tnewDiv.appendChild(btnAddBefore); \t\t\t\t\t//append buttons to new card (newDiv)\n\tnewDiv.appendChild(btnAddAfter);\n\tnewDiv.appendChild(btnDelete);\n\n\tbtnAddBefore.addEventListener(\"click\", onAddBefore);\n\tbtnAddAfter.addEventListener(\"click\", onAddAfter);\n\tbtnDelete.addEventListener(\"click\", onDelete);\n\treturn newDiv;\n}", "title": "" }, { "docid": "0985fb7c22ae0d7d26f774cf5978eeb4", "score": "0.6156229", "text": "function card( name, suit, value ) {\n this.name = name;\n this.suit = suit;\n this.value = value;\n}", "title": "" }, { "docid": "8a71c9f0d7f927e42a23ff385cfe5745", "score": "0.61512536", "text": "function createCards () {\n\t\tvar valueCard = 1;\n\n\t\t// counts the number of cards defined by the user\n\t\tfor(var i = 1; i <= nCards; i++) {\n\t\t\t// use 3 variables to define card front and back\n\t\t\tvar newCard, frontCard, backCard;\n\n\t\t\t// create the element of the card\n\t\t\tnewCard = document.createElement('div');\n\t\t\tnewCard.className = 'card';\n\t\t\tnewCard.setAttribute('data-card', Math.floor(valueCard));\n\t\t\t// adds an event listener to the click of the card\n\t\t\tnewCard.addEventListener('click', cardClick);\n\n\t\t\t// create the element front of the card\n\t\t\tfrontCard = document.createElement('div');\n\t\t\tfrontCard.className = 'face front';\n\t\t\tfrontCard.innerHTML = Math.floor(valueCard);\n\n\t\t\t// create the element back of the card\n\t\t\tbackCard = document.createElement('div');\n\t\t\tbackCard.className = 'face back';\n\n\t\t\t// append the front and back of the card to the newCard variable\n\t\t\tnewCard.appendChild(frontCard);\n\t\t\tnewCard.appendChild(backCard);\n\n\t\t\t// adds the new card to the array of cards\n\t\t\tcards.push(newCard);\n\n\t\t\t// increase the value of card by half, os when using the Math.floor function it \n\t\t\t// will get always 2 cards of each\n\t\t\tvalueCard = valueCard + 0.5;\n\t\t}\n\n\t\tshuffle();\n\t}", "title": "" }, { "docid": "a6beb5004b6fab62538683fd6aa494d0", "score": "0.613704", "text": "function MakeCard(name, cardNum, securityCode) {\n var newCreditCard = {};\n newCreditCard.name = name;\n newCreditCard.cardNum = cardNum;\n newCreditCard.securityCode = securityCode;\n return newCreditCard;\n\n}", "title": "" }, { "docid": "2997a36a97fc6d9a3bd7411e1a15a228", "score": "0.61219007", "text": "function createStartingHand() {\n var startingHand = [];\n // add 7 coppers\n for (var i = 0; i < 7; i++) {\n startingHand.push(createCard(\"copper\"));\n }\n // add 3 estates\n for (i = 0; i < 3; i++) {\n startingHand.push(createCard(\"estate\"));\n }\n\n return startingHand;\n}", "title": "" }, { "docid": "9c8c94ac31ca6e941e32f38447d0f927", "score": "0.6113758", "text": "_spawnCoin(coin) {\n // NOTE: the following line would be enough. However, by creating a \"new Phaser.Sprite()\",\n // we enable autocomplete instead of using \"any\" objects. This can be done ONLY when we\n // are sure about the returned \"any\". In case of \"coins.create\", by documentation we know what it returns.\n //\n // let sprite = this.coins.create(coin.x, coin.y, 'coin');\n let sprite = new Phaser.Sprite();\n sprite = this.coins.create(coin.x, coin.y, 'coin');\n\n sprite.anchor.set(0.5,0.5);\n sprite.animations.add('rotate', [0,1,2,1], 6, true);\n sprite.animations.play('rotate');\n\n // enable physics of the engine on the sprite (coin),\n // but remove the gravity.\n this.game.physics.enable(sprite);\n sprite.body.allowGravity = false;\n }", "title": "" }, { "docid": "fb1698a7a4d48c34ef64f7b0c763dd68", "score": "0.6111454", "text": "function createNewCard(sketch, parentDiv, cardTemplate, minMaxVotes){\n let clone = cardTemplate.content.cloneNode(true);\n clone.querySelector(\".content-image\").src = sketch.path;\n clone.querySelector(\".card\").id = sketch.id;\n \n clone.querySelector(\".content-title\").innerHTML = sketch.name; \n setScore(clone, sketch.votes);\n parentDiv.appendChild(clone);\n\n clone = document.getElementById(sketch.id);\n \n //Setting card size depending on votes\n setCardSize(clone, sketch.votes, minMaxVotes);\n return clone;\n}", "title": "" }, { "docid": "c8a3c9174494bca9ab2ed363ce77aa54", "score": "0.60806936", "text": "dealCard(){\n\n\t}", "title": "" }, { "docid": "64c533bb8d1521d816b70926e547c0ea", "score": "0.60676664", "text": "function drawCoin(coin, numCoins){\n for(var i = 0; i < numCoins; i++){ \n var iClone = coin.image.cloneNode(true);\n document.getElementById(coin.name + \"s\").appendChild(iClone);\n } \n\n}", "title": "" }, { "docid": "ff0aae55bbe697f8c7b39e403e87d135", "score": "0.60525405", "text": "function createNewCard(){\n var newCard = Object.create(Card);\n currentCardSet.addCard(newCard);\n return newCard;\n}", "title": "" }, { "docid": "033f3a2c4ef7ef77e3407b172106f172", "score": "0.6049801", "text": "function createOpponentHand(cardNumber) {\n if (cardNumber === 1) {\n cardNumber = \"A\";\n }\n if (cardNumber === 11) {\n cardNumber = \"J\"\n }\n if (cardNumber === 12) {\n cardNumber = \"Q\";\n }\n if (cardNumber === 13) {\n cardNumber = \"K\";\n }\n const newOppCard = $([\"<div class='card back'>*</div>\"].join(\"\\n\"));\n $( \"#oppHand\" ).append( newOppCard );\n return;\n}", "title": "" }, { "docid": "37dd75018a0085670fe78d647acbcf7b", "score": "0.6046642", "text": "function renderCard(id, title, description, image, price) {\n let mytemplate = document.querySelector(\"#myTemplate\"),\n clone = mytemplate.content.cloneNode(true),\n titleNode = clone.querySelector(\"#title-node\"),\n descriptionNode = clone.querySelector(\"#description-node\"),\n imageNode = clone.querySelector(\"#image-node\"),\n priceNode = clone.querySelector(\"#price-node\"),\n buyButton = clone.querySelector(\"#buy-node\"),\n modalButton = clone.querySelector(\"#modal-button\")\n\n titleNode.innerText = title;\n descriptionNode.innerText = description.substr(0, 150) + \"...\";\n imageNode.src = image;\n priceNode.innerText = price + currency;\n buyButton.value = id;\n buyButton.dataset.title=title;\n modalButton.dataset.title = title;\n modalButton.dataset.description = description;\n modalButton.dataset.image=image;\n\n return clone;\n}", "title": "" }, { "docid": "3bcf95a1cea7ee1abee044c32989508e", "score": "0.60421336", "text": "function getRandomCard() {\n return Math.floor(Math.random() * 10) + 2;\n}", "title": "" }, { "docid": "8678fdfe4a18dc40bee27e1d6a382e78", "score": "0.6033427", "text": "function makeCurse(){\n\t\tvar curseDescription = \"-1 victory point\";\n\t\tvar curse = new Card(\"curse\", 0, curseDescription, \"img/curse.jpg\");\n\t\tcurse.numberPerGame = {\"1\": 10, \"2\": 10, \"3\": 20, \n\t\t\t\t\t\t\t \"4\": 30, \"5\": 40, \"6\": 50};\n\t\t//During the scoring phase, subtract one from player score\n\t\tcurse.actions[\"onScore\"] = function(player){\n\t\t\t\t\t\t\t\t\t\tplayer.incrementScore(-1);\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t};\n\t\tcurse.hasScore = true;\n\t\treturn curse;\n\t}", "title": "" }, { "docid": "2eb25620fb805bb07513382f4ce40de5", "score": "0.60230815", "text": "function makeCard(front, back) {\n //console.log(\"making card front=\" + front + \", back=\" + back);\n var card = {\n front: front,\n back: back,\n numRight: 0,\n numWrong: 0,\n bucket: 0,\n nextTime: futureRandomTime(intervalsInSeconds[0])\n };\n reloadCardFromLocalStorage(card);\n return card;\n}", "title": "" }, { "docid": "70fff7fafe2e4b593f31304dedc9ba65", "score": "0.60188955", "text": "function createBasicCard() {\n\n\tinquirer.prompt ([\n\t\t{\n\t\t\tname: \"front\",\n\t\t\tmessage: \"Enter a question for the front.\"\n\t\t},\n\t\t{\n\t\t\tname: \"back\",\n\t\t\tmessage: \"Enter the answer for the back.\"\n\t\t}\n\n\t]).then(function(answers) {\n\t\tvar newBasic = new BasicCard (answers.front, answers.back);\n\n\t\t//Push BasicCard that was created into an array.\n\t\tbasicArray.push(newBasic);\n\n\t\t//Ask if user wants to create another card. \n\t\tinquirer.prompt ([\n\t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tname: \"more\",\n\t\t\t\tmessage: \"Create another Basic Card?\",\n\t\t\t\tchoices: [ \"yes\", \"no\" ]\n\t\t\t}\n\t\t]).then(function(answers) {\n\n\t\t\t//If yes, run through function again. If no, console log array of Basic Cards.\n\t\t\tif (answers.more === \"yes\") {\n\t\t\t\tcreateBasicCard();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"-------- CARDS CREATED --------\");\n\n\t\t\t\tfor (var i = 0 ; i < basicArray.length ; i++) {\n\t\t\t\t\tconsole.log(\"Question: \" + basicArray[i].front);\n\t\t\t\t\tconsole.log(\"Answer: \" + basicArray[i].back);\n\t\t\t\t\tconsole.log(\"----------------------------------\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "19aa280f7352d52ad39f15b0f0ee80fd", "score": "0.6017124", "text": "function makeCard(canvasid = 'canvas',\n cardspec,\n symTrip = [0, 1, 2]\n) {\n\n // basic canvas stuff\n var canvas = document.getElementById(canvasid);\n ctx = canvas.getContext(\"2d\");\n ctx.strokeRect(0, 0, canvas.width, canvas.height);\n\n W = 300;\n H = 1.2 * W;\n canvas.width = W;\n canvas.height = H;\n\n if (cardspec[3] == 0) {\n x = W / 2\n y = H / 2\n betterText = 'Better picture?'\n ctx.font = \"46px serif\";\n ctx.fillStyle = \"black\";\n textDimensions = ctx.measureText(betterText);\n x = (x - (textDimensions.width / 2))\n ctx.fillText(betterText, x, y);\n } else {\n total = cardspec[3]\n sym1 = symTrip[0]\n sym2 = symTrip[1]\n sym3 = symTrip[2]\n\n // depending on trial type, reconfigure display symbols\n if (cardspec[1] == cardspec[3]) {\n sym1 = sym3 = sym2\n } else {\n if (cardspec[0] == 0) {\n sym1 = sym3\n }\n if (cardspec[0] == cardspec[3]) {\n sym2 = sym1\n }\n }\n\n var rows = (Math.ceil(total / 3));\n var cols = (total / rows);\n\n\n var drawlist = [];\n var strList = [];\n\n if (total == 1) {\n drawlist.push(sym1)\n } else {\n for (i = 1; i <= rows * (cols - 1); i++) {\n drawlist.push(sym1)\n }\n for (j = 1; j <= rows; j++) {\n strList.push(sym2)\n }\n }\n\n // randomise false placement\n if (Math.random() >= 0.5) {\n drawlist = drawlist.concat(strList)\n } else {\n drawlist = strList.concat(drawlist)\n }\n\n if (total == 9 && cardspec[0] == 8) { // special case for many example\n for (let i = 0; i < 9; i++) {\n drawlist[i] = sym1\n }\n drawlist[0] = sym2\n }\n if (total == 9 && cardspec[0] == 3) { // special case for many example\n for (let i = 0; i < 6; i++) {\n drawlist[i] = sym2\n }\n for (let j = 6; j < 9; j++) {\n drawlist[j] = sym1\n }\n }\n\n if (rows > 1) {\n [rows, cols] = [cols, rows]\n }\n\n var symbol = [];\n var Wc = W / cols,\n Hr = H / rows\n\n var symCount = 0;\n for (i = 1; i <= rows; i++) {\n for (j = 1; j <= cols; j++) {\n symbol[i] = {\n y: (Math.floor((i * Hr) - Hr / 2)),\n x: (Math.floor((j * Wc) - Wc / 2)),\n color: \"black\",\n unisym: drawlist[symCount],\n draw: symbols,\n };\n symCount++;\n var s = symbol[i];\n s.draw(s.x, s.y, s.color, s.unisym);\n }\n }\n }\n\n function symbols(x, y, color, unisym) {\n if (unisym == \"●\") {\n ctx.font = \"76px serif\"\n } else {\n ctx.font = \"46px serif\"\n }\n ctx.fillStyle = color;\n textDimensions = ctx.measureText(unisym);\n x = (x - (textDimensions.width / 2))\n if (unisym == \"●\") {\n y = (y - (-4 * (76 / 46)))\n }\n ctx.fillText(unisym, x, y);\n }\n}", "title": "" }, { "docid": "eb6d7059b538440f6f81ebbabd57fdca", "score": "0.6013077", "text": "function createVisualCards(){\n let computerBoard = document.querySelector('#computerCard');\n let computerCard = document.createElement('div')\n computerCard.innerText = `${computerHand[0].Value} ${computerHand[0].Suit}`\n computerBoard.appendChild(computerCard);\n}", "title": "" }, { "docid": "c2858ab97e9cfe3a2353581fd6e4a566", "score": "0.6011811", "text": "function Card(face, suit) {\n this.face = face;\n this.suit = suit;\n}", "title": "" }, { "docid": "a01f5e86a5b238c49b62d67e25e7f8a4", "score": "0.600787", "text": "function createCoinList2() {\n placedCoins = [\n placedCoin(1650, 50),\n placedCoin(1700, 50),\n placedCoin(1750, 50),\n placedCoin(1800, 50),\n placedCoin(1850, 50),\n placedCoin(1900, 50),\n\n placedCoin(2450, 100),\n placedCoin(2500, 100),\n placedCoin(2550, 100),\n placedCoin(2600, 100),\n\n placedCoin(3150, 100),\n placedCoin(3200, 100),\n placedCoin(3250, 100),\n placedCoin(3300, 100),\n\n placedCoin(4650, 0),\n placedCoin(4700, 0),\n placedCoin(4750, 0),\n placedCoin(4800, 0),\n placedCoin(4850, 0),\n placedCoin(4900, 0)\n ];\n}", "title": "" }, { "docid": "0656ea9703a4243286b915746e2b9122", "score": "0.5998266", "text": "function createCards() {\n inquirer.prompt([{\n type: 'list',\n name: 'cardType',\n message: 'What type of card would like to create?',\n choices: ['basic', 'cloze-deleted'],\n filter: function(val) {\n return val.toLowerCase();\n }\n },\n {\n name: \"text\",\n message: \"Please enter the question for your card\"\n }, {\n name: \"cloze\",\n message: \"Please enter the answear for your card\"\n }\n ]).then(function(answers) {\n if (answers.cardType == 'basic') {\n var firstPresident = basicCard(answers.text, answers.cloze);\n firstPresident.printFront();\n firstPresident.printBack();\n } else {\n var firstPresidentCloze = clozeCard(answers.text, answers.cloze);\n console.log(firstPresidentCloze.cloze);\n firstPresidentCloze.partial();\n firstPresidentCloze.fulltext();\n }\n });\n}", "title": "" }, { "docid": "7d93bc9274c224a53402c187ca0d08a8", "score": "0.5997421", "text": "createTicketCard(){\n return CardFactory.adaptiveCard(createTicketCard);\n }", "title": "" }, { "docid": "e8802e8fe07599bcf647e83fd1b62e98", "score": "0.5994072", "text": "generate_deck() {\n // creates card generator function\n let card = (suit, value) => {\n let name = value + \"_of_\" + suit;\n //returns key and values into each instance of the this.deck array\n return { name: name, suit: suit, value: value };\n };\n\n let values = [\n \"two\",\n \"three\",\n \"four\",\n \"five\",\n \"six\",\n \"seven\",\n \"eight\",\n \"nine\",\n \"ten\",\n \"jack\",\n \"queen\",\n \"king\",\n \"ace\"\n ];\n let suits = [\"clubs\", \"diamonds\", \"spades\", \"hearts\"];\n\n for (let s = 0; s < suits.length; s++) {\n for (let v = 0; v < values.length; v++) {\n this.deck.push(card(suits[s], values[v]));\n }\n }\n }", "title": "" }, { "docid": "ae075269a7dfa25f2214645fc1131d6f", "score": "0.59908646", "text": "function newCard(cardObj){\r\n \r\n let card = document.createElement(\"div\");\r\n\r\n card.setAttribute(\"id\",cardObj.id);\r\n card.classList.add(\"card\");\r\n card.style.position = \"absolute\"; \r\n\r\n card.innerHTML = `\r\n<div class=\"CARDheader ${cardObj.type}\" id='${cardObj.header}'>\r\n${cardObj.title}\r\n<div class=\"subtitle\">${cardObj.type}</div>\r\n<div id=\"close\" onclick=\"closeCard(\\'${cardObj.id}\\')\">[X]</div>\r\n</div>\r\n\r\n\r\n\r\n<div class=\"cardBody\" id=\"${cardObj.id}cardBody\"> \r\n${cardObj.description}\r\n </div>\r\n\r\n<input type=\"checkbox\" id=\"${cardObj.id}CHECKBOX\" onclick=groupCheckBox(\\'${cardObj.id}\\',1)>Group</input>\r\n<button onclick=zCard(\\'${cardObj.id}\\',1)>▲</button>\r\n<button onclick=zCard(\\'${cardObj.id}\\',-1)>▼</button>\r\n\r\n<div class=\"dropdown\">\r\n <button class=\"dropbtn\">More Options</button>\r\n <div class=\"dropdown-content\" id=\"${cardObj.idDROPDOWN}\">\r\n <a href=\"#\" onclick=\"changeColor(\\'${cardObj.id}\\')\">Change Color</a>\r\n<a href=\"#\" onclick=\"resetSize(\\'${cardObj.id}\\')\">Reset Size</a>\r\n </div>\r\n `\r\n ; \r\n card.style.top = cardDropLoc[0] + 50 + 'px';\r\n card.style.left = cardDropLoc[1] + 'px';\r\n card.style.zIndex = 10;\r\n \r\n return card; \r\n}", "title": "" }, { "docid": "5911045c41f7f55650eb11c68d5a336a", "score": "0.59907734", "text": "function createCards() {\r\n for (let i = 0; i < STARTING_CARDS; i++) {\r\n let card = new Card(i);\r\n cards.push(card);\r\n }\r\n}", "title": "" }, { "docid": "e78967e372ac18086aa28682ae828291", "score": "0.5968332", "text": "function createCardHTML (card) {\n\n const div = document.createElement('div');\n const spanrank = document.createElement('span');\n const spansuit = document.createElement('span');\n const spanmainsuit = document.createElement('span');\n\n spanrank.innerHTML = card.rank;\n spanrank.setAttribute('data-value', card.value); //custom attribute \n spansuit.innerHTML = card.suit;\n spanmainsuit.innerHTML = card.suit;\n if (card.suit == '&hearts;' || card.suit == '&diam;') {\n spansuit.style.color = '#C3073F';\n spanmainsuit.style.color = '#C3073F';\n }\n\n const spanrank2 = spanrank.cloneNode(true);\n const spansuit2 = spansuit.cloneNode(true);\n\n // div['className'] = 'card';\n div.className = 'card';\n div.appendChild(spanrank);\n div.appendChild(spansuit);\n div.appendChild(spanmainsuit);\n div.appendChild(spansuit2);\n div.appendChild(spanrank2);\n\n return div;\n}", "title": "" }, { "docid": "76d65b2193135fc1e22ad9237ce3a70e", "score": "0.59658283", "text": "function createCardText(card){\n var textBox = document.createElement('div'),\n text = card.value + \" of \" + card.suit;\n textBox.innerText =text;\n return textBox;\n}", "title": "" }, { "docid": "ffc487ce1d10d902b8b1f45212432d1b", "score": "0.5947865", "text": "function newGame() {\r\n cash = 100;\r\n deck = [];\r\n for (var i in suits) {\r\n for (var j in values) {\r\n deck.push(new Card(suits[i], values[j]));\r\n }\r\n }\r\n deck = shuffle(deck);\r\n output.innerHTML = 'Enter a bet, then press \"Deal Hand\" to deal the cards.';\r\n document.getElementById('btn-start').style.display = 'none';\r\n document.getElementById('bet').style.display = '';\r\n}", "title": "" }, { "docid": "37fb126e742c351244e28b0beeb68fd1", "score": "0.5938014", "text": "function generateCard() {\n for (var i = 0; i < cardColour.length; i++) {\n for (var k = 0; k < cardNumber.length; k++) {\n var newCard = {\n COLOUR: cardColour[i],\n VALUE: cardNumber[k]\n };\n drawP.push(newCard);\n shuffleCards(drawP);\n }\n }\n preDrawGenerateHTML();\n}", "title": "" }, { "docid": "8784d20508ec5cf69f69193699b54992", "score": "0.5937533", "text": "function generateCards(){\n cards=shuffle(cards);\n for(i=0;i<cards.length;i++)\n {\n createCards(cards[i]);\n }\n}", "title": "" }, { "docid": "8b6768bc3640a607bb8583414032e412", "score": "0.5923157", "text": "function createCards(character){\n return `<button class=\"card\">\\\n <img class=\"characterThumbnail\" src=\"${character.thumbnail.path}.${character.thumbnail.extension}\">\\\n <p>${character.name}</p>\\\n </button>`;\n}", "title": "" }, { "docid": "690c7b709dd714ea470f9a23e7062366", "score": "0.59155184", "text": "function basicCardCreate(front, back){\n\t//console.log(front, back);\n\tvar basicCard = new Basic(front, back);\n\n\tbasicArray.push(basicCard);\n\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname: 'makeAnother',\n\t\t\t\tmessage: 'Make another basic card?',\n\t\t\t\ttype: 'confirm'\n\t\t\t}\n\t\t]).then(function(answer){\n\t\t\tif(answer.makeAnother){\n\t\t\t\tcreateBasic();\n\t\t\t} else {\n\t\t\t\tjsonfile.readFile('basicCard.json', function(err, data){\n\t\t\t\t\tif(err){\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t}\n\t\t\t\t\tif(data.length>0){\n\t\t\t\t\t\tArray.prototype.push.apply(data, basicArray);\n\t\t\t\t\t\tjsonfile.writeFile('basicCard.json', data, function(err){\n\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbasicArray = [];\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjsonfile.writeFile('basicCard.json', basicArray, function(err){\n\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbasicArray = [];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstart();\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "c69c2ca310370b07e4be79a04d204afa", "score": "0.5912981", "text": "function getCard() {\n const value = [\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"J\",\n \"Q\",\n \"K\",\n \"A\"\n ];\n const suit = [\"Clubs\", \"Spades\", \"Diamonds\", \"Hearts\"];\n return {\n value: randomArray(value),\n suit: randomArray(suit)\n };\n}", "title": "" }, { "docid": "8835419c58e59ad5b70ade9b4c6d1f3b", "score": "0.5910898", "text": "function newCard(){\n // Check if game is in a legal state, call drawCard and renderAndCheckState\n if(game_state == -1) info_element.textContent = \"First start a game\";\n else if(game_state == 2 || game_state == 1) info_element.textContent = \"Start a new game\";\n else{\n drawCard();\n renderAndCheckState();\n }\n}", "title": "" }, { "docid": "fb0edcf0c603fc480434b57645df1924", "score": "0.5904783", "text": "function Card(number, suit) {\n this.number = number;\n this.suit = suit;\n this.card = 'cards/' + cardNumber + '_of_' + cardSuit + '.png';\n}", "title": "" }, { "docid": "53cabec730749e8b2657b822e6ba20a0", "score": "0.5904679", "text": "function money_to_crypto(qty, coin){\n \n let worth = qty * Portfolio[coin].value;\n \n console.log(`You need $${worth} to buy ${qty} ${Portfolio[coin].name}s`)\n \n }", "title": "" }, { "docid": "ec66f2ef883d928aa592e7c66e702bd4", "score": "0.59016854", "text": "function addCard(card){\n\tvar cardSet = \"<i class='ss ss-\"+card.set+\"'></i>\";\n\tvar baseColors = card.mana_cost.split(\"{\");\n\tvar manaCost = \"\";\n\tfor (x = 1; x < baseColors.length; x++){\n\t\tswitch (baseColors[x].charAt(0)) {\t\n\t\t case \"W\":\n\t\t\tmanaCost += \"<div class='white-cost'></div>\";\n\t\t\tbreak;\n\t\t case \"U\":\n\t\t\tmanaCost += \"<div class='blue-cost'></div>\";\n\t\t\tbreak;\n\t\t case \"B\":\n\t\t\tmanaCost += \"<div class='black-cost'></div>\";\n\t\t\tbreak;\n\t\t case \"R\":\n\t\t\tmanaCost += \"<div class='red-cost'></div>\";\n\t\t\tbreak;\n\t\t case \"G\":\n\t\t\tmanaCost += \"<div class='green-cost'></div>\";\n\t\t\tbreak;\t\t\t\n\t\t default:\n\t\t\tmanaCost += \"<div class='incolore-cost'>\"+baseColors[x].charAt(0)+\"</div>\";\n\t\t}\t\n\t}\n\t//color-type-other\n\t//card-image-other\n\tvar colorType = \"\";\n\tvar colorImage = \"\";\n\tif (card.color_identity.length > 1){\n\t\tcolorType += \"<div class='magic-card \"+\"color-type-other\"+\"'>\";\n\t\tcolorImage = \"<div class='card-image-other'></div>\";\n\t}\n\telse{\n\t\tswitch (card.color_identity[0]) {\t\n\t\t case \"W\":\n\t\t\tcolorType += \"<div class='magic-card \"+\"color-type-white\"+\"'>\";\n\t\t\tcolorImage = \"<div class='card-image-white'></div>\";\n\t\t\tbreak;\n\t\t case \"U\":\n\t\t\tcolorType += \"<div class='magic-card \"+\"color-type-blue\"+\"'>\";\n\t\t\tcolorImage = \"<div class='card-image-blue'></div>\";\n\t\t\tbreak;\n\t\t case \"B\":\n\t\t\tcolorType += \"<div class='magic-card \"+\"color-type-black\"+\"'>\";\n\t\t\tcolorImage = \"<div class='card-image-black'></div>\";\n\t\t\tbreak;\n\t\t case \"R\":\n\t\t\tcolorType += \"<div class='magic-card \"+\"color-type-red\"+\"'>\";\n\t\t\tcolorImage = \"<div class='card-image-red'></div>\";\n\t\t\tbreak;\n\t\t case \"G\":\n\t\t\tcolorType += \"<div class='magic-card \"+\"color-type-green\"+\"'>\";\n\t\t\tcolorImage = \"<div class='card-image-green'></div>\";\n\t\t\tbreak;\t\t\t\n\t\t default:\n\t\t\tcolorType += \"<div class='magic-card'>\";\n\t\t\tcolorImage = \"<div class='card-image'></div>\";\n\t\t}\n\t}\n\t\n\n\tvar htmlCard = colorType +\n\t\t\t`\n\t\t\t\t\t<div class=\"card-name-cost row\">\n\t\t\t\t\t\t<div class=\"card-name-cost-name\">\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tcard.name\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"card-name-cost-cost row\">\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tmanaCost\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\tcolorImage\n\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"card-type-set row\">\n\t\t\t\t\t\t<div class=\"card-type-set-type\">\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tcard.type_line\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"card-type-set-set\">GRN\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tcardSet\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"card-text\">\n\t\t\t\t\t`\n\t\t\t\t\t+\n\t\t\t\t\tcard.oracle_text\n\t\t\t\t\t+\t\n\t\t\t\t\t`\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"card-collector-force row\">\n\t\t\t\t\t\t<div class=\"card-collector-force-collector\">\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tcard.collector_number\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"card-collector-force-force\">\n\t\t\t\t\t\t`\n\t\t\t\t\t\t+\n\t\t\t\t\t\tcard.power\n\t\t\t\t\t\t+\"/\"+\t\t\n\t\t\t\t\t\tcard.toughness\t\n\t\t\t\t\t\t+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t`\n\t$(\"#cardCollectionSection\").append(htmlCard);\n}", "title": "" }, { "docid": "60b0bd24a19977bc89752a7dc6abcaab", "score": "0.5896801", "text": "createNode(suitName,nameValue) {\n let card = document.createElement(\"div\");\n let value = document.createElement(\"div\");\n let suit = document.createElement(\"div\");\n card.className = `card ${suitName}`;\n value.className = \"card__value\";\n suit.className = `card__suit card__suit-${suitName}`;\n value.innerHTML = nameValue;\n card.appendChild(value);\n card.appendChild(suit);\n return card;\n }", "title": "" }, { "docid": "5d8f9c7f3eafd3c1928f5d074337164b", "score": "0.58920145", "text": "function Card(suit, num) {\r\n this.suit = suit;\r\n this.num = num;\r\n this.bgcolor = (suit === 'spades' || suit === 'clubs' ? 'black' : 'red');\r\n this.output = '<span style=\"color: ' + this.bgcolor + '\">' + this.num + '&' + this.suit + ';</span>';\r\n this.outputhtml = function(left) {\r\n return '<div style=\"left: ' + left + 'px;\" class=\"card ' + this.suit + '\">' + \r\n '<div class=\"card-top suit\">' + this.num + '<br></div>' + \r\n '<div class=\"card-middle suit\"></div>' + \r\n '<div class=\"card-bottom suit\">' + this.num + '<br></div></div>';\r\n }\r\n}", "title": "" }, { "docid": "e926cfa6689ca3d2ff02b688f0a607b9", "score": "0.588847", "text": "function generateCard() {\n random();\n if (toggle < 0) {\n cardQuestion.textContent = \"There are no more questions left\";\n cardAnswer.textContent = \"There are no more questions left\";\n } else {\n cardQuestion.textContent = qChosen.question;\n cardAnswer.textContent = qChosen.answer;\n }\n}", "title": "" }, { "docid": "21a6590120bc3752d2e7d79633ff56eb", "score": "0.58873284", "text": "function dealCards(e,t){function n(){var e=Math.floor(Math.random()*4),t={0:{name:\"diamonds\",symbol:\"&diamondsuit;\",color:\"red\"},1:{name:\"hearts\",symbol:\"&heartsuit;\",color:\"red\"},2:{name:\"clubs\",symbol:\"&clubsuit;\",color:\"black\"},3:{name:\"spades\",symbol:\"&spadesuit;\",color:\"black\"}},n=Math.floor(Math.random()*14)+1,r={1:{name:\"ace\",face:\"A\",value:1},2:{name:\"two\",face:\"2\",value:2},3:{name:\"three\",face:3,value:3},4:{name:\"four\",face:\"4\",value:4},5:{name:\"five\",face:\"5\",value:5},6:{name:\"six\",face:\"6\",value:6},7:{name:\"seven\",face:\"7\",value:7},8:{name:\"eight\",face:\"8\",value:8},9:{name:\"nine\",face:\"9\",value:9},10:{name:\"ten\",face:\"10\",value:10},11:{name:\"jack\",face:\"J\",value:10},12:{name:\"queen\",face:\"Q\",value:10},13:{name:\"king\",face:\"K\",value:10},14:{name:\"ace\",face:\"A\",value:11}};return'<div class=\"number '+t[e].color+'\">'+r[n].face+\"</div>\"+'<div class=\"suit '+t[e].color+'\">'+t[e].symbol+\"</div>\"}for(var r=0;r<6;r++){var i=e.className,s=document.createElement(\"div\");s.className=\"card\";e.appendChild(s);document.querySelector(\".\"+i+\" .card\").innerHTML=n()}}", "title": "" }, { "docid": "a97f0390cdb92d9ee9e72ab10fe62157", "score": "0.58826816", "text": "function CardMaker(cardCover, cardSentence, cardLine){\n this.makeFrontMessage = `<h2>${cardCover}</h2>`,\n this.makeInsideMessages = `<p>${cardSentence}</p><p class=\"cardLine\">${cardLine}</p>`\n }", "title": "" }, { "docid": "96f2068e4aa6bbb20423c7c39624f7f2", "score": "0.5880973", "text": "function createBasic (){\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname: 'front',\n\t\t\t\tmessage: 'Front of card',\n\t\t\t\ttype: 'input'\n\t\t\t},{\n\t\t\t\tname: 'back',\n\t\t\t\tmessage: 'Back of card',\n\t\t\t\ttype: 'input'\n\t\t\t}\n\t\t]).then(function(answers){\n\t\t\tbasicCardCreate(answers.front.trim(), answers.back.trim());\n\t\t});\n}", "title": "" }, { "docid": "046a14b3bcac26e0c5f1b22e48c247b7", "score": "0.58743906", "text": "function newCard() {\n // Card drawn randomly from the array\n\n let extraCard = cards[Math.floor(Math.random() * cards.length)];\n let sumDiv = document.querySelector(\".sum\");\n\n // Making sure the correct interpretation of the Ace happens\n\n if (extraCard.altValue === 11 && extraCard.altValue + sum <= 21) {\n sum += 11;\n } else {\n sum += extraCard.value;\n }\n\n sumDiv.textContent = `Your hand: ${sum}`;\n\n let newCardImg = document.querySelector(\"#nextcardimg\");\n newCardImg.src = extraCard.src;\n\n checkCards();\n}", "title": "" }, { "docid": "2232ff195f6bb76e5defcc552eed8d3a", "score": "0.58741444", "text": "function createCard(card) {\n $('#deck').append(`<li class=\"card\"><i class=\"fa ${card}\"></i></li>`);\n}", "title": "" }, { "docid": "a0d374039a5d7c358ee1d508a6cd1860", "score": "0.587339", "text": "function createCard(name, image_src, data, id, description) {\n this.name = name;\n this.img = image_src;\n this.data = data;\n this.id = id;\n this.description = description;\n }", "title": "" }, { "docid": "a6acea61506e0d62baf4582f185599f2", "score": "0.5869739", "text": "function Hand() {\n this.cardOne = BlackJack.deal();\n this.cardTwo = BlackJack.deal();\n}", "title": "" }, { "docid": "7bac5fad3bd879c38084549967d5993e", "score": "0.5868707", "text": "function createCard() {\n cards.forEach((card, i) => {\n const positionFromLeft = i * 25;\n const cardElement = document.createElement('div');\n cardElement.setAttribute('data-value', card.value);\n cardElement.classList.add('card', `${card.suit}-${card.value}`);\n cardElement.style.left = `${positionFromLeft}px`;\n cardsWrapper.append(cardElement);\n });\n}", "title": "" }, { "docid": "7fb4df69c19493dc0edc5d42382dd262", "score": "0.58686864", "text": "function addCoin() {\n var geometry = new THREE.CylinderGeometry(40,40,10,64);\n var material = new THREE.MeshPhongMaterial( {\n color: 0xDAA520,\n ambient: 0xffffff,\n specular: 0x003344,\n shininess: 100,\n flatShading: false,\n side: THREE.DoubleSide // for drawing the inside of the tube\n } );\n var coin = new THREE.Mesh(geometry, material);\n coin.rotation.set(Math.PI/2,0,0);\n coin.castShadow = true;\n\tcoinMeshList.push(coin); // add coins to the list for collision\n\n return coin;\n}", "title": "" }, { "docid": "bcf88e392278b360d249e04b66b87c78", "score": "0.5864242", "text": "function createCard(div){\n const cardObject = addNewRandomCard(); // Nytt random kort\n const cardImage = document.createElement('img');\n cardImage.src = `images/${cardObject.file}`;\n cardImage.width = '200';\n cardImage.height = '290';\n document.querySelector(div).appendChild(cardImage);\n return cardObject;\n}", "title": "" } ]
506d12a5921cccebc2b2eca7360eafad
Scripts used by the Style Guide page. / NOTE: these load & execute on all pages. Consider whether / to include this only within the styleguide template. / ========================================================= / Get hex color from RGB. css('backgroundcolor') returns e.g. rgb(4, 52, 130) / See
[ { "docid": "c91cca01c9566328e3cae26e45f63def", "score": "0.0", "text": "function rgb2hex(rgb) {\n if (/^#[0-9A-F]{6}$/i.test(rgb)) return rgb;\n\n rgb = rgb.match(/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\n function hex(x) {\n return (\"0\" + parseInt(x).toString(16)).slice(-2);\n }\n return \"#\" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);\n}", "title": "" } ]
[ { "docid": "a812bfd2a671dc3e432a9850aea56989", "score": "0.62817335", "text": "function getBgColor() {\n return '#96E2FF';\n}", "title": "" }, { "docid": "78f4cf3140f735ac5d67e3c5c321d4a6", "score": "0.6162624", "text": "function TestHtmlResMgr() {\n $(\".TestBoxJs\").css(\"background-color\", \"green\");\n}", "title": "" }, { "docid": "3ebc2b798d7d09cff269d97a978f9a80", "score": "0.60829985", "text": "function retrieveColors () {\n showLoader();\n chrome.tabs.executeScript(null, {\n file: 'js/theme.js'\n },\n function(result, isException) {\n if (isException) {\n swatches.log(\"sigh, there were errors... :(\");\n hideLoader();\n } else if (result) {\n swatches.log(\"Here is the raw result from theme.js: \");\n swatches.log(result);\n swatches.inspectedWebsite = sanitizeWebsiteString(result[0].website);\n swatches.retrievedColors = result[0].colors;\n displayColors();\n displayMenuData();\n addEventBindersForColorChanges();\n hideLoader();\n hoverThemeColor();\n swatches.log(\"After loading, here is the swatches object:\");\n swatches.log(swatches);\n }\n });\n }", "title": "" }, { "docid": "1476df7c11ee802b42fdf9bd831d8e78", "score": "0.60299265", "text": "function getColor( c ){\r\n var tmp = $(\"<div>\", { class: c }).appendTo(\"body\");\r\n var color = tmp.css(\"background-color\");\r\n tmp.remove();\r\n\r\n return color;\r\n }", "title": "" }, { "docid": "f506a705da9c54bfbbbe08d59c9020b7", "score": "0.60205215", "text": "function getRandomBackgroundColor() {\n var colorInteger1 = Math.floor(Math.random() * 156); // this variable randomly generates a red number for the RGB color mode\n var colorInteger2 = Math.floor(Math.random() * 156); // this variable randomly generates a green number for the RGB color mode\n var colorInteger3 = Math.floor(Math.random() * 156); // this variable randomly generates a blue number for the RGB color mode\n var backgroundColor = \"rgb(\" + colorInteger1 + \",\" + colorInteger2 + \",\" + colorInteger3 + \")\"; //rgb written here is the \"color model\" I'm using and tells the CSS/HTML files which color model I'm using so that the files know what to do with the subsequent format and numbers in the parentheses. I've read there are other options, (name or hex value) but this is the most commonly used one.\n console.log(backgroundColor); // this line logs the color generated to the console. e.g. \"rgb(132,74,150)\"\n\n document.body.style.background = backgroundColor; // this sets the background color for the doument using the backgroundColor variable created previously in the function\n }", "title": "" }, { "docid": "9bb17dbe2c1d471597e2d1279811f9bb", "score": "0.5972426", "text": "function JSColor() {\n}", "title": "" }, { "docid": "3ae562f973794399fec56247d455c36e", "score": "0.59623206", "text": "function useColors(){if (typeof window !=='undefined' && window.process && window.process.type === 'renderer'){return true;}\n\n\n\n return (typeof document !=='undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\n (typeof window !=='undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\n\n (typeof navigator !=='undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1,10) >= 31) ||\n\n (typeof navigator !=='undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));}", "title": "" }, { "docid": "bea4027a39084b2a78cda2f66d193152", "score": "0.59441596", "text": "function backgroundColor() {\n\tbody.style.background = \"linear-gradient(to right, \" + color1.value\n\t\t+ \", \" + color2.value + \")\";\n\tcss.textContent = body.style.background;\n}", "title": "" }, { "docid": "d6437b7c5b0d3478e16b5f0d8c608d1c", "score": "0.593851", "text": "function main()\r\n{\tswitch(color)\r\n\t{\tcase 'blue': var color1='#096cd0';var color2='#0e559d';var color3='#f0f1ff';var color4='#005dd0';break;\r\n\t\tcase 'girls': var color1='#f62354';var color2='#df0739';var color3='#fbdee2';var color4='#eb8a98';break;\r\n\t\tcase 'red':\tvar color1='#f80023'; var color2='#c80c26';\tvar color3='#fbdee0';var color4='#d43843';break;\r\n\t\tcase 'infrared':\tvar color1='transparent'; var color2='transparent';\tvar color3='transparent';\r\n\t\t\t\t\t\t\tvar color4='transparent';break; //xD\r\n\t\tcase 'orange':\tvar color1='#e6b520'; var color2='#e7a800';\tvar color3='#fff3cd';var color4='#ffc105';break;\r\n\t\tcase 'dark':\tvar color1='#666460'; var color2='#33312b';\tvar color3='#d1cfc8';var color4='#403f3b';break;\r\n\t\tdefault: var color1='#096cd0';var color2='#0e559d';var color3='#f0f1ff';var color4='#005dd0';break;\r\n\t}\r\n\taddGlobalStyle('a { color: '+color1+' ! important; }');\t\t\t\t\t\t\t\t//alle links blau\r\n\taddGlobalStyle('a:hover { color: '+color2+' ! important; }');\t\t\t\t\t\t\t//blau hover\r\n\taddGlobalStyle('#side_navi a { color: #000 ! important; }');\t\t\t\t\t\t//linke seite (logout usw.)\r\n\taddGlobalStyle('#mfoot a { color: #666 ! important; }');\t\t\t\t\t\t\t//travian copyright unten\r\n\taddGlobalStyle('#vlist thead a { color: #000 ! important; }');\t\t\t\t\t\t//dörferlink über dorfliste\r\n\taddGlobalStyle('#llist thead a { color: #000 ! important; }');\t\t\t\t\t\t//direktlinks überschrift\r\n\taddGlobalStyle('th.sent a { color: #000 ! important; }');\t\t\t\t\t\t\t//gesendet link\r\n\taddGlobalStyle('tr.hl{ background-color: '+color3+'! important;');\t\t\t\t\t\t//bg stats\r\n\taddGlobalStyle('table tr.hl td{border-top:2px solid '+color4+' ! important; border-bottom:2px solid '+color4+'! important;}'); //rahmen\r\n\taddGlobalStyle('table tr.hl td.fc{border-left:2px solid '+color4+' ! important;}');\t//rahmen links\r\n\taddGlobalStyle('table tr.hl td.lc{border-right:2px solid '+color4+' ! important;}');\t//rahmen rechts\r\n\taddGlobalStyle('div.reports td.report_content table.defender td.role {color:'+color1+' ! important;}');\t//verteidiger txt\r\n}", "title": "" }, { "docid": "c80dcc32436c374811d916607c350bbb", "score": "0.59318715", "text": "function bgColor() {\n// Array to contain color names that the browser can recognize.\n\tvar colors = [ 'maroon','blue', 'orange', 'teal', 'gray', 'purple' ];\n// Get randon color from the array.\n\tvar getRandomColor = Math.floor( Math.random() * colors.length );\n// Assign a local variable to make color.\n\tvar makeColor = colors[getRandomColor];\n// Returns make color to body tag of the html.\n\treturn document.body.style.backgroundColor = makeColor;\n}", "title": "" }, { "docid": "26adf4f35e1e752fa1b91109fc7b3e7c", "score": "0.59083325", "text": "function getColor() {\r\n\t\treturn \t'#007913';\r\n\t}", "title": "" }, { "docid": "0a16bd579651e93dc9fa1ae28edc0e9b", "score": "0.5886512", "text": "getCssBgColor(css) {\n // we just take the first background-color find and assume it the bg color\n // for the entire editor. It just too hard to parse in the most general case.\n const regExp = /(.*background-color:\\s*)(#[0-9a-fA-F]{6})/m;\n const match = regExp.exec(css);\n\n if (match) {\n return match[2];\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "f41a31b1fba5a1b911b2cacec6b0878f", "score": "0.5874932", "text": "function intiCss() {\n\n chrome.storage.sync.get(['buttonColor'], function (result) {\n var style = document.createElement('style');\n style.type = 'text/css';\n style.innerHTML = `.ext-floating-button { \n margin: 20px 0 0 20px;\n background-color: ${result.buttonColor};\n color: white;\n height: 35px;\n border: none;\n border-radius: 10px;\n z-index: 1000;\n text-align: center;\n -webkit-box-shadow: 0px 3px 7px 1px rgba(5,5,5,0.75);\n -moz-box-shadow: 0px 3px 7px 1px rgba(5,5,5,0.75);\n box-shadow: 0px 3px 7px 1px rgba(5,5,5,0.75);\n z-index: 9999; \n }\n .ext-floating-div {\n left: 0;\n top: 0;\n width: 100%; \n min-height: 75px; \n overflow: auto;\n background-color: rgb(0,0,0); \n background-color: rgba(0,0,0,0.4); \n z-index: 9999; \n }\n .ext-svg-reload {\n background-image: url(\"images/svgs/autorenew.svg\")\n }`;\n document.getElementsByTagName('head')[0].appendChild(style);\n });\n }", "title": "" }, { "docid": "ac75acecf02b23aab0d6259308408b1c", "score": "0.5866341", "text": "function styleguideColors(context, colors) {\n\n}", "title": "" }, { "docid": "ac75acecf02b23aab0d6259308408b1c", "score": "0.5866341", "text": "function styleguideColors(context, colors) {\n\n}", "title": "" }, { "docid": "1be65da1b8e2b85242216df1908d07fc", "score": "0.58553666", "text": "function getRandomColor() {\nvar r = Math.floor(Math.random()*256); // Random between 0-255\nvar g = Math.floor(Math.random()*256); // Random between 0-255\nvar b = Math.floor(Math.random()*256); // Random between 0-255\nvar rgb = 'rgb(' + r + ',' + g + ',' + b + ')';\nreturn document.body.style.backgroundColor = rgb; // shortest way of direct referal to body coykd find\n}", "title": "" }, { "docid": "f9357f702bc8c911aac7babe48840690", "score": "0.58441615", "text": "function executeOnLoad() {\n create_standard_css_variables();\n}", "title": "" }, { "docid": "da26e0cd078c5793fe775414deb25c19", "score": "0.5837624", "text": "function GetCheerStyle(a){/* exported GetCheerStyle */if(CSSCheerStyles.hasOwnProperty(a))return CSSCheerStyles[a];return ColorNames.hasOwnProperty(a)?{cost:1,style:\"color: \"+ColorNames[a]}:null}", "title": "" }, { "docid": "58e39b4368058d83ef5265af0d93863e", "score": "0.5821378", "text": "function renderTypeColors(){\n var styleCSS = \"<style type='text/css'>\";\n for (var type in colors){\n if (colors.hasOwnProperty(type)) {\n styleCSS+=\".\"+encode(type)+\"{background-color:\"+colors[type]+\";}\";\n }\n }\n styleCSS += \"</style>\";\n $(styleCSS).appendTo(\"head\");\n}", "title": "" }, { "docid": "1c6f7065f4e73e46375142de6a82ddbf", "score": "0.5816124", "text": "injectCSS() {\n const cssColors = this.registry.getColorMap();\n const colorMap = cssColors.map(Color.Format.CSS.parseHex);\n // This is needed to ensure the minimap gets the right colors.\n TokenizationRegistry.setColorMap(colorMap);\n const css = generateTokensCSSForColorMap(colorMap);\n const style = createStyleElementForColorsCSS();\n style.innerHTML = css;\n }", "title": "" }, { "docid": "93b57eabff057875c02e3b5149c5bb21", "score": "0.5801832", "text": "function renderTypeColors() {\n var styleCSS = \"<style type='text/css'>\";\n for (var type in colors) {\n if (colors.hasOwnProperty(type)) {\n styleCSS += \".\" + encode(type) + \"{background-color:\" + colors[type] + \";}\";\n }\n }\n styleCSS += \"</style>\";\n $(styleCSS).appendTo(\"head\");\n }", "title": "" }, { "docid": "e258de5115828245bf62e755a04bf224", "score": "0.57838106", "text": "function setBodyColor() {\n hex = colorPicker.color.hexString;\n $(\"body\").css(\"background-color\",hex)\n}", "title": "" }, { "docid": "05d28caa70abab03636fe0704394eb8e", "score": "0.5783104", "text": "loadColors()\n {\n if (this.needColorInit)\n {\n /* The colors defined in the common CSS file are used to make it easier to \"re-skin\" the app later\n if desired. Aside from the central player indicator, the colors are pulled from the same set of\n custom colors used in the rest of the UI. */\n let computedStyle = getComputedStyle(document.documentElement);\n this.color_BG = computedStyle.getPropertyValue('--default-background');\n this.color_marker = computedStyle.getPropertyValue('--gps-marker');\n this.color_line = computedStyle.getPropertyValue('--default-color');\n this.color_text = computedStyle.getPropertyValue('--default-text');\n this.color_destination = computedStyle.getPropertyValue('--positive-color');\n this.color_ship = computedStyle.getPropertyValue('--anti-xeno-color');\n this.needColorInit = false;\n }\n }", "title": "" }, { "docid": "8e1d7cf2c465d4f1b3f2968da96e8b2a", "score": "0.578287", "text": "function red() {\n document.body.style.backgroundColor=\"#e5452e\"; \n }", "title": "" }, { "docid": "2ea989bba5f0c85316af4136a9244927", "score": "0.57768834", "text": "function generateCss() {\n //Stores CSS generated by various options\n var generatedCss = \"\";\n generatedCss += generateUsernameHighlightingCss();\n generatedCss += generateKeywordHighlightingCss();\n return generatedCss;\n}", "title": "" }, { "docid": "4f5e88ca67fb711eacd5b5bc9fa7888d", "score": "0.5775113", "text": "function colorOnPageLoad() {\r\n css.textContent =\r\n \"linear-graident(to right, \" + colorOnLoad1 + \", \" + colorOnLoad2 + \")\";\r\n}", "title": "" }, { "docid": "e233653fab935a267081ad8c480627d2", "score": "0.5769053", "text": "function DebugStyling() { }", "title": "" }, { "docid": "1e7de322250c5289cd6cb62b3ee4511e", "score": "0.5759337", "text": "function setupCss() {\n addGlobalStyle('.match_highlighted { background-color: rgba(253, 255, 0, 0.28); }');\n addGlobalStyle('.codenav_scroll_indicator { width: 10px; vertical-align: top; text-align: right; line-height: 1; float: right; \\\n margin-top: 3px; margin-bottom: 3px; top: 45px; right: 12px; position: absolute; z-index: 999999; }');\n addGlobalStyle('.codenav_scroll_indicator_mark { position: absolute; background-color: #ffa; border: 1px solid #909090; \\\n width: 10px; height: 8px; float: right; cursor: pointer;}');\n}", "title": "" }, { "docid": "1a2c33468f196fe45d21f521d447f865", "score": "0.57571244", "text": "function DebugStyling(){}", "title": "" }, { "docid": "6d4f6566cb17060f6a73e75fe6fea78e", "score": "0.5748063", "text": "function styleguideColors(context, colors) {}", "title": "" }, { "docid": "c716bd36f4b255695e4d8503225b9e97", "score": "0.57322264", "text": "function RGBColor(a){this.ok=!1;\"#\"==a.charAt(0)&&(a=a.substr(1,6));a=a.replace(/ /g,\"\");a=a.toLowerCase();var b={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",\ndarkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",\ngainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",\nlightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",\noldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",\nslategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"},d;for(d in b)a==d&&(a=b[d]);var c=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,\nexample:[\"#00ff00\",\"336699\"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(d=0;d<c.length;d++){var e=c[d].process,g=c[d].re.exec(a);g&&(channels=e(g),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=0>this.g||isNaN(this.g)?0:\n255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b;this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"};this.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);1==a.length&&(a=\"0\"+a);1==b.length&&(b=\"0\"+b);1==c.length&&(c=\"0\"+c);return\"#\"+a+b+c};this.getHelpXML=function(){for(var a=[],d=0;d<c.length;d++)for(var e=c[d].example,g=0;g<e.length;g++)a[a.length]=e[g];for(var p in b)a[a.length]=p;e=document.createElement(\"ul\");\ne.setAttribute(\"id\",\"rgbcolor-examples\");for(d=0;d<a.length;d++)try{var q=document.createElement(\"li\"),n=new RGBColor(a[d]),m=document.createElement(\"div\");m.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+n.toHex()+\"; color:\"+n.toHex();m.appendChild(document.createTextNode(\"test\"));var k=document.createTextNode(\" \"+a[d]+\" -> \"+n.toRGB()+\" -> \"+n.toHex());q.appendChild(m);q.appendChild(k);e.appendChild(q)}catch(u){}return e}}", "title": "" }, { "docid": "c9cdc056742f78f07758de0b1c3d0435", "score": "0.5730954", "text": "function useColors(){// is webkit? http://stackoverflow.com/a/16459606/376773\nreturn'WebkitAppearance'in document.documentElement.style||// is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console&&(console.firebug||console.exception&&console.table)||// is firefox >= v31?\n// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\nnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31;}", "title": "" }, { "docid": "9aac4cadf1827528b1bc0d8c0a01887c", "score": "0.57276946", "text": "function setRGBColor(r,g,b) {\n color = 'rgb(' + r + ', ' + g + ', ' + b + ')';\n document.body.style.backgroundColor = color;\n rgbToHEX(r,g,b,1);\n}", "title": "" }, { "docid": "e8929fd7dbcaef200b687956fc32c794", "score": "0.5708678", "text": "function colorPalette(){\n body.style.background =\n \"linear-gradient(to right, \"\n + color1.value +\n \", \"\n + color2.value + \")\";\n\n h3.textContent = body.style.background + \";\";\n}", "title": "" }, { "docid": "6224c563a18ac378536b9cf8441a290a", "score": "0.569786", "text": "function setupStylesheet()\r\n{\r\n\t// Perform IE hacks.\r\n\tvar inputCSS = getInputCSS(winampGetClassicColour(1), winampGetClassicColour(0), winampGetClassicColour(2),\r\n\t\twinampGetClassicColour(5), winampGetClassicColour(2), winampGetClassicColour(5));\r\n\tvar buttonCSS = getInputCSS(\"#000000\", \"#CBCBCB\", winampGetClassicColour(0),\r\n\t\twinampGetClassicColour(0), winampGetClassicColour(0), winampGetClassicColour(0));\r\n\t$('input[type=\"text\"]').css(inputCSS);\r\n\t$('input[type=\"button\"]').css(buttonCSS);\r\n\t$('input[type=\"submit\"]').css(buttonCSS);\r\n\t\r\n\tstylesheetLink = STYLESHEET_LINK.replace(/FONT/, winampGetFont());\r\n\tstylesheetLink = stylesheetLink.replace(/FONT_SIZE/, winampGetFontSize());\r\n\tstylesheetLink = stylesheetLink.replace(/ITEM_BACKGROUND/, winampGetClassicColour(0));\r\n\tstylesheetLink = stylesheetLink.replace(/ITEM_FOREGROUND/, winampGetClassicColour(1));\r\n\tstylesheetLink = stylesheetLink.replace(/WINDOW_BACKGROUND/, winampGetClassicColour(2));\r\n\tstylesheetLink = stylesheetLink.replace(/BUTTON_FOREGROUND/, winampGetClassicColour(3));\r\n\tstylesheetLink = stylesheetLink.replace(/HILITE/, winampGetClassicColour(5));\r\n\tstylesheetLink = stylesheetLink.replace(/LIST_HEADER_BACKGROUND/, winampGetClassicColour(7));\r\n\tstylesheetLink = stylesheetLink.replace(/LIST_HEADER_TEXT/, winampGetClassicColour(8));\r\n\tstylesheetLink = stylesheetLink.replace(/SELECTION_BAR_FOREGROUND/, winampGetClassicColour(18));\r\n\tstylesheetLink = stylesheetLink.replace(/SELECTION_BAR_BACKGROUND/, winampGetClassicColour(19));\r\n\tstylesheetLink = stylesheetLink.replace(/INACTIVE_SELECTION_BAR_BACKGROUND/, winampGetClassicColour(21));\r\n\tstylesheetLink = stylesheetLink.replace(/ALTERNATE_ITEM_BACKGROUND/, winampGetClassicColour(22));\r\n\tstylesheetLink = stylesheetLink.replace(/ALTERNATE_ITEM_FOREGROUND/, winampGetClassicColour(23));\r\n\tstylesheetLink = stylesheetLink.replace(/#/g, '%23');\r\n\t\r\n\tvar headID = document.getElementsByTagName(\"head\")[0]; \r\n\tvar cssNode = document.createElement('link');\r\n\tcssNode.type = 'text/css';\r\n\tcssNode.rel = 'stylesheet';\r\n\tcssNode.href = stylesheetLink;\r\n\tcssNode.media = 'screen';\r\n\theadID.appendChild(cssNode);\r\n}", "title": "" }, { "docid": "12f24b6379c478f3d24a6a44b81d3b92", "score": "0.56720793", "text": "function bgcolour() {\n background(bg.r, bg.g, bg.b);\n}", "title": "" }, { "docid": "91a4e2eedb15c5a92cf37b1b14c31d87", "score": "0.56635547", "text": "toCSSString() {\n const value = parseInt(this.toHex(), 16);\n return Object.keys(RGB.CSS).find(key => RGB.CSS[key] === value);\n }", "title": "" }, { "docid": "4bf96e6f4cb4977566982c070797fc6e", "score": "0.5642509", "text": "function window_frame_background_color(){\n return $(\"#body_id\").css(\"background-color\") // ie \"rgb(123, 45, 67))\n}", "title": "" }, { "docid": "b46df858689a729b43a39af4f407d6d9", "score": "0.5641326", "text": "function add_css$1() {\n\tvar style = element$1(\"style\");\n\tstyle.id = \"svelte-1b8yoo7-style\";\n\tstyle.textContent = \".warn-input.svelte-1b8yoo7{border-color:red\\n}.success-input.svelte-1b8yoo7{border-color:green\\n}.default-input.svelte-1b8yoo7{border-color:black\\n}\";\n\tappend$1(document.head, style);\n}", "title": "" }, { "docid": "2c186ea1587c79352f8366de5d04d197", "score": "0.56316745", "text": "function changeBackgroundColor() {\n var red = getRandomNumber(256);\n var green = getRandomNumber(256);\n var blue = getRandomNumber(256);\n var rgbColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n document.body.style.backgroundColor = rgbColor;\n}", "title": "" }, { "docid": "9d2aa89af09eee684464146f33c6bd7c", "score": "0.56151795", "text": "function init_document_ready() {\n\n create_colorSwatch();\n\n}", "title": "" }, { "docid": "2a9fdfedeaf6268db1b73df9bde76c7a", "score": "0.56130403", "text": "get styles () {return paths.globals.prod + '/css'}", "title": "" }, { "docid": "359110a8f98b319239a10d6b02dca7c0", "score": "0.56040835", "text": "function readColorPalette () {\r\n let docStyle = getComputedStyle(document.documentElement);\r\n let keys = Object.keys(game.uiColors);\r\n keys.forEach(key => {\r\n cssKey = `--vngine-color-${key}`;\r\n if (docStyle.getPropertyValue(cssKey)) {\r\n document.documentElement.style.setProperty(cssKey, game.uiColors[key]);\r\n }\r\n else {\r\n console.warn(`VNGINE_WARNING: root doesn't contain property ${cssKey}`);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "204d42d4133692c96910baf810d4eee5", "score": "0.55493677", "text": "function setPageStyle(theColor) {\r\n document.getElementById(\r\n \"resultValueWhite1\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n document.getElementById(\r\n \"resultValueWhite2\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n document.getElementById(\r\n \"resultValueWhite3\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n document.getElementById(\r\n \"resultValueBlack1\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n document.getElementById(\r\n \"resultValueBlack2\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n document.getElementById(\r\n \"resultValueBlack3\"\r\n ).innerHTML = `Color ${theColor} on white Background `;\r\n\r\n document.getElementById(\r\n \"resultValueWhite1\"\r\n ).style.backgroundColor = theColor;\r\n document.getElementById(\r\n \"resultValueBlack1\"\r\n ).style.backgroundColor = theColor;\r\n document.getElementById(\r\n \"resultValueWhite2\"\r\n ).style.border = `solid ${theColor} 1px`;\r\n document.getElementById(\r\n \"resultValueBlack2\"\r\n ).style.border = `solid ${theColor} 1px`;\r\n document.getElementById(\"resultValueWhite3\").style.color = theColor;\r\n document.getElementById(\"resultValueBlack3\").style.color = theColor;\r\n document.getElementById(\"convert\").style.backgroundColor = theColor;\r\n}", "title": "" }, { "docid": "e3d86887f5aefa6cbff35213a5e95b88", "score": "0.55473006", "text": "function customColorsCssLoaded(resp)\n\t{\n\t\tcustomColorsCss = '<style><![CDATA[ ' + resp + ']]></style>';\n\t}", "title": "" }, { "docid": "cb5ebd1e6de936efee7927c48ef44a57", "score": "0.553477", "text": "function _getStyle() {\r\n\t\tvar style = '\\\r\ndiv.altui-rule { margin-bottom: 6px; }\\\r\ndiv.altui-rule-body { padding: 0.25em; }\\\r\ndiv.altui-rule-icon { width: 60px; height: 60px; }\\\r\ndiv.altui-rule-disabled { cursor: auto; background: url(\"http://vosmont.github.io/icons/virtual_alarm_panel_disabled.png\")}\\\r\ndiv.altui-rule-ko { cursor: auto; background: url(\"http://vosmont.github.io/icons/virtual_alarm_panel_ko.png\")}\\\r\ndiv.altui-rule-inactive { cursor: auto; background: url(\"http://vosmont.github.io/icons/virtual_alarm_panel_off.png\")}\\\r\ndiv.altui-rule-active { cursor: pointer; background: url(\"http://vosmont.github.io/icons/virtual_alarm_panel_on.png\")}\\\r\ndiv.altui-rule-acknowledged { cursor: pointer; background: url(\"http://vosmont.github.io/icons/virtual_alarm_panel_on_acknoledge.png\")}\\\r\n.altui-rule-toolbar { margin:5px 15px; }\\\r\n.altui-rule-arm { padding-right: 3px; cursor: pointer; } \\\r\n.altui-rule-ack { padding-right: 3px; cursor: pointer; } \\\r\n.altui-rule-warning { color:orange; } \\\r\n.altui-rule-errors { cursor:pointer; } \\\r\n.altui-rule-title-name { margin-left:5px; }\\\r\n.altui-rule-body table { width:100%; }\\\r\n.altui-rule-body .altui-rule-summary { vertical-align:top; text-align:right; }\\\r\n.altui-rule-body .altui-rule-infos { margin-left:5px; }\\\r\n.altui-rule-body .altui-rule-errors { color:red; font-size:0.8em; }\\\r\n.altui-rule-xml .panel-body { padding: 0px; }\\\r\n.altui-rule-xml-content { width: 100%; height: 200px; }\\\r\n.altui-condition-info1 { text-decoration: underline overline; font-weight: bold; cursor: pointer !important; }\\\r\n.altui-condition-info2 { font-style: italic; font-size: 0.8em !important; }\\\r\n#rulesengine-blockly-panel { }\\\r\n#rulesengine-blockly-workspace { width: 100%; height: ' + _workspaceHeight + 'px; }\\\r\ndiv.blocklyToolboxDiv { /*height: auto!important;*/ /*position: fixed;*/ }\\\r\ndiv.blocklyWidgetDiv { z-index: 1050; }\\\r\n#blocklyArea { height: 100%; }\\\r\n#rulesengine-lua-editor { height: 200px; } \\\r\n\t\t';\r\n\t\treturn style;\r\n\t}", "title": "" }, { "docid": "1a6426688fcdb8483acf702e10e48164", "score": "0.55256945", "text": "function slidersRGB(){\n //get the slider bars values\n var r = $(\"#red\").val();\n var g = $(\"#green\").val();\n var b = $(\"#blue\").val();\n \n //return the color variable\n return(\"rgb(\" + r + \",\" + g + \",\" + b + \")\"); \n}", "title": "" }, { "docid": "c1cfc79a5d9f7bad9d84ffc1b53c0d1d", "score": "0.5522424", "text": "updateColorScheme() {\n let root = document.documentElement;\n root.style.setProperty('--color-main', this.main);\n root.style.setProperty('--color-accent', this.accent);\n root.style.setProperty('--color-font', this.font);\n root.style.setProperty('--color-bold', this.bold);\n }", "title": "" }, { "docid": "a78aa16783aa186dd19ffa69ec176703", "score": "0.5520878", "text": "function ColorSelector() { }", "title": "" }, { "docid": "fe3dbf336609cdbcf2e1da30aa162e5a", "score": "0.5503768", "text": "genColor(data) {\n var hash = ColorfulTabsPopup.sha256(data.toString());\n var iClr, clrConst = 5381; // var clrString = ;\n for (iClr = 0; iClr < hash.length; iClr++) {\n clrConst = ((clrConst << 5) + clrConst) + hash.charCodeAt(iClr);\n }\n\n return Math.abs(clrConst) % 360;\n }", "title": "" }, { "docid": "d3ff225dc67bea3c7c14207419c68773", "score": "0.5502065", "text": "function getHex() {\n var hexVal = document.getElementById(\"hex\").value;\n var colors = colorChange(hexVal);\n}", "title": "" }, { "docid": "3e5d842bf0a4fdc404b1e4deb2093c79", "score": "0.55017793", "text": "function getBackgroundColor() {\n return `rgb(\n ${getRandomNum()},\n ${getRandomNum()},\n ${getRandomNum()}\n )`;\n}", "title": "" }, { "docid": "a87b15362f2cfa2bfa59cb0714ac38c0", "score": "0.5492513", "text": "function headColor(color,code) {\n $('.cat__head, .cat__chest').css('background', '#' + color) //This changes the color of the cat\n $('#headcode').html('code: '+code) //This updates text of the badge next to the slider\n $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat\n}", "title": "" }, { "docid": "a87b15362f2cfa2bfa59cb0714ac38c0", "score": "0.5492513", "text": "function headColor(color,code) {\n $('.cat__head, .cat__chest').css('background', '#' + color) //This changes the color of the cat\n $('#headcode').html('code: '+code) //This updates text of the badge next to the slider\n $('#dnabody').html(code) //This updates the body color part of the DNA that is displayed below the cat\n}", "title": "" }, { "docid": "bea3f09f309d2198c5607958808506cd", "score": "0.54861367", "text": "function setRed() {pageTitle.style.background = \"tomato\";}", "title": "" }, { "docid": "09a535beefa900199a8729204a505f51", "score": "0.54757917", "text": "function getStyle(args) {\n\t\tlet x;\n\n\t\tswitch (args) {\n\t\t\tcase \"bC\":\n\t\t\t\tx = settings.background.alt;\n\n\t\t\t\tx = \"white\";\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn x;\n\t}", "title": "" }, { "docid": "f9eb61fbc9c048e9bdf8cd2adfdee6de", "score": "0.5473654", "text": "function parseColor(browserColor)\n{\n // if it doesn't start with a # it's not a Hex, treat as an RGB\n // should maybe add some sort of error handling here, although chances are slim\n if (browserColor.substring(0, 1) == \"r\")\n {\n\n // get the individual RGB values from the Firefox way of getting the browser values\n // which is to return a string with a value of rgb(xxx, xxx, xxx) always in the format\n // so we can just split the string up the same each time, thankfully\n var rrr = browserColor.substring(4, 7);\n var ggg = browserColor.substring(9, 12);\n var bbb = browserColor.substring(14, 17);\n \n // next three section basically do the R, G. B to Hex value conversion\n rrr=parseInt(rrr);\n ggg=parseInt(ggg);\n bbb=parseInt(bbb);\n \n rrrHex=rrr.toString(16).toUpperCase();\n gggHex=ggg.toString(16).toUpperCase();\n bbbHex=bbb.toString(16).toUpperCase();\n \n if (rrrHex.length == 1){ rrrHex='0'+rrrHex;}\n if (gggHex.length == 1){ gggHex='0'+gggHex;}\n if (bbbHex.length == 1){ bbbHex='0'+bbbHex;}\n \n // splice them together with the #\n rgbVal= rrrHex+gggHex+bbbHex;\n \n return rgbVal;\n \n // this could be tweaked, but for now if the background is transparent or not a valid hex\n // we'll assume it's going to end up white.\n }else if(browserColor.substring(0, 1) == \"#\"){\n \n \n //return \"FFFFFF\";\n \n return browserColor.substring(1, 7); \n \n }else{\n // OK, it starts with a # and it has 7 characters, it must be a hex, take the # off the front\n//alert(browserColor);\n return \"FFFFFF\";\n }\n\n}", "title": "" }, { "docid": "0f45f26a56103f43b84e26e66ab831e8", "score": "0.5472476", "text": "function changeBackgroundColor() {\n var red = getRandomNumber(255);\n var green = getRandomNumber(255);\n var blue = getRandomNumber(255);\n var newColor = \"rgb(\" + red + \", \" + green + \", \" + blue + \")\";\n document.body.style[\"background-color\"] = newColor;\n}", "title": "" }, { "docid": "9c37e5d648042eaa632e42a7d3d9267f", "score": "0.54703736", "text": "function getBgColors (tab) {\n injectedMethod(tab, 'getBgColors', function (response) {\n var colors = response.data;\n if (colors && colors.length) {\n var url = 'http://colorpeek.com/#' + colors.join(',');\n chrome.tabs.create({ url: url });\n } else {\n alert('No background colors were found! :(');\n }\n return true;\n })\n}", "title": "" }, { "docid": "4ff7712e8b938135e3a6207ab716dceb", "score": "0.54591835", "text": "function initialColoringOfFields(){\r\n var backgroundColors = localStorage.getItem(\"colors\");\r\n var backgroundColorsParsed = JSON.parse(backgroundColors);\r\n $('#standardStationColor').css({\"backgroundColor\":backgroundColorsParsed[\"ds\"]}); \r\n $('#standardConnectionColor').css({\"backgroundColor\":backgroundColorsParsed[\"uc\"]}); \r\n $('#disabledConnectionColor').css({\"backgroundColor\":backgroundColorsParsed[\"dc\"]});\r\n $('#backgroundGridnColor').css({\"backgroundColor\":backgroundColorsParsed[\"bg\"]}); \r\n }", "title": "" }, { "docid": "ccd7354941d4a165a32319f014f4aa55", "score": "0.54582924", "text": "function firstLoad(){\n\t// body.style.background = \"white\";\n\tbody.style.background = \n\t\"linear-gradient(to right, \" \n\t+ color1.value \n\t+ \", \" \n\t+ color2.value\n\t+ \", \" \n\t+ color3.value \n\t+ \")\";\n\tcss.textContent = body.style.background + \";\";\n\n}", "title": "" }, { "docid": "cc91f2dd835c42187b9037d8adb2f7e5", "score": "0.5456749", "text": "function getRandomColor(){\n\tvar x = random_hex();\n\tvar y = random_hex();\n\tvar z = random_hex();\n\n\tcolor1.value = x;\n\tcolor2.value = y;\n\tcolor3.value = z;\n\n\tbody.style.background = \n\t\"linear-gradient(to right, \" \n\t+ color1.value \n\t+ \", \" \n\t+ color2.value\n\t+ \", \" \n\t+ color3.value \n\t+ \")\";\n\n\tinfo.textContent = \"Random Css Background\";\n\tcss.textContent = body.style.background + \";\";\n\n\t// help me to debug the function\n\t// console.log(\"linear-gradient(to right, \" \n\t// + color1.value \n\t// + \", \" \n\t// + color2.value\n\t// + \", \" \n\t// + color3.value \n\t// + \")\");\n}", "title": "" }, { "docid": "75c8e808dea1a5875b43f0f9d4b89411", "score": "0.5450522", "text": "function changeColor() {\n\tvar red = getrRandomColor();\n\tvar green = getrRandomColor();\n\tvar blue = getrRandomColor();\n\tlet color = `rgb(${red},${green},${blue})`;\t\n document.body.style.background = color; \n }", "title": "" }, { "docid": "4046db82f08d0a5ff23f4737aa8f6289", "score": "0.54495203", "text": "function containerHex(self) {\n\t\tvar name = self.attr('name'),\n\t\t\tvalue = self.val();\n\t\t\n\t\tif(hexiRegex(self,value)) {\n\t\t\tswitch (name) {\n\t\t\t\tcase 'left-colour':\n\t\t\t\t\t$('div.white').css('background-color', value);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'right-colour':\n\t\t\t\t\t$('div.black').css('background-color', value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cfe670daae7b310348c53dabaa852cd9", "score": "0.5449197", "text": "function setBackground() {\n let hexColor = getHexNum();\n //get the background property on style that is on body property of document\n let hexElement = document.getElementById('hex');\n hexElement.textContent = hexColor;\n document.body.style.background = hexColor;\n}", "title": "" }, { "docid": "584ba915f49145ec64d7e4a6928c945c", "score": "0.5447697", "text": "function backgroundShift() {\r\n var color = $(\"html\").css(\"background-color\");\r\n // String cleaning for array parsing\r\n color = color.replace(/\\s+/g, '');\r\n color = color.replace('rgba(', '');\r\n color = color.replace(')', '');\r\n let array = color.split(\",\");\r\n console.log(array);\r\n console.log($('html').color);\r\n \r\n // For cases when background was not set\r\n for(let i = 0; i < 3; i++ ) {\r\n if (array[i] < 1) {\r\n array[i] = 255;\r\n }\r\n }\r\n console.log(array);\r\n array[1] = Math.floor(array[1]*0.72);\r\n array[2] = Math.floor(array[2]*0.23);\r\n console.log(array);\r\n let hexString = \"#\";\r\n // Deal with pages with NONSET backgrounds\r\n for(let i = 0; i < 3; i++ ) {\r\n hexPart = array[i].toString(16)\r\n if (hexPart.length % 2) {\r\n hexPart = '0' + hexPart;\r\n }\r\n hexString = hexString + hexPart;\r\n }\r\n console.log(hexString);\r\n $('html').css(\"background-color\", hexString);\r\n}", "title": "" }, { "docid": "53beaf11ae3b6adb22ff3f9b1266a1ce", "score": "0.5444177", "text": "function getRandomHEXColor() {\r\n const SEED = '0123456789abcdef';\r\n let output = '#';\r\n while (output.length < 7) {\r\n output += SEED[Math.floor(Math.random() * SEED.length)];\r\n }\r\n css.textContent = body.style.background + \";\";\r\n return output;\r\n}", "title": "" }, { "docid": "37cfab0a5ec4a9bcf8368f06a26f3bb7", "score": "0.5443844", "text": "function randomColorsSetter() {\n var colorString = \"rgb(\" + getColorNumber() + \", \" + getColorNumber() + \", \" + getColorNumber() + \")\";\n document.body.style.backgroundColor = colorString;\n document.getElementById(\"loadQuote\").style.backgroundColor = colorString;\n}", "title": "" }, { "docid": "87dde000902d8b91547baa503e06061d", "score": "0.5434198", "text": "function backgroundColour(){\n getRandomColourNumber();\n var myElement = document.querySelector(\"body\");\n myElement.style.backgroundColor = \"rgb(\" + colourPicker + \")\";\n return;\n}", "title": "" }, { "docid": "8a22e0845f1839dd073213850c98480f", "score": "0.54336816", "text": "function htmlColor(c) {\n return ('#' + ('000000' + c.toString(16)).substr(-6));\n }", "title": "" }, { "docid": "0b7fc1aa79d6aa356aef40f6039b37a7", "score": "0.54303277", "text": "function setBgColor(){\n body.style.background = \"linear-gradient(to right, \" + color1.value + \", \" + color2.value + \")\";\n printColorText();\n}", "title": "" }, { "docid": "420d10c1c4a73e77de544ac18d5d5981", "score": "0.54263115", "text": "_getHexColor(color) {\n // legacy support for materializeCSS names\n let name = color.replace(\"-text\", \"\");\n let colors = window.SimpleColorsStyles.colors;\n if (colors[name]) {\n return colors[name][6];\n }\n return \"#000000\";\n }", "title": "" }, { "docid": "b081389f379f1c39f2e5f875e9b11f7c", "score": "0.54229075", "text": "function setHexColor(hexArr, color){\n if (hexArr.length == 6) {\n var colorSet = \"#\" + color;\n document.body.style.backgroundColor = colorSet;\n }\n if (hexArr.length == 7 && hexArr[0] == '#') {\n hexArr.shift();\n document.body.style.backgroundColor = color;\n }\n HEXtoRGB(1, hexArr, color);\n}", "title": "" }, { "docid": "9c3760f9f7604df7aeaeb5058cb3b4d9", "score": "0.5422239", "text": "function getBgColors(tab) {\n injectedMethod(tab, \"getBgColors\", function (response) {\n var colors = response.data;\n if (colors && colors.length) {\n //alert('Colors on page: ' + colors);\n console.log(colors);\n //return colors;\n chrome.runtime.sendMessage({\n msg: \"completed\",\n data: {\n subject: \"colors\",\n content: colors,\n },\n });\n //sendResponse({colors: colors});\n } else {\n alert(\"No background colors were found! :(\");\n }\n //eturn true;\n });\n}", "title": "" }, { "docid": "50e8afd75b707d9b9c487b92d38a975d", "score": "0.5417868", "text": "function output_color(nat_clr, bright_clr){\r\n //Format dominant colors\r\n var nat_clr = tinycolor(nat_clr),\r\n bright_clr = tinycolor(bright_clr);\r\n // console.log(\"Computed Colors (Hue, Natural, Bright):\");\r\n console.log(\"Natural:\", nat_clr.toRgbString(), \", Bright:\", bright_clr.toRgbString());\r\n\r\n //Grab color overlay and alternative color (for links)\r\n var clr_overlay = nat_clr.saturate(10).toHsl(),\r\n alt_clr = bright_clr.saturate(10).toHsl(),\r\n bg_clr = nat_clr;\r\n\r\n //Make sure Color overlay is no more than 25% lightness.\r\n if(clr_overlay.l > .25){\r\n clr_overlay.l = .25;\r\n }\r\n //Make sure alternative color is no more less than 94% lightness.\r\n if(alt_clr.l < .94){\r\n alt_clr.l = .94;\r\n }\r\n\r\n //Convert colors to Hex strings (easier calculation).\r\n alt_clr = tinycolor(alt_clr).toHexString();\r\n clr_overlay = tinycolor(clr_overlay).toHexString();\r\n bg_clr = tinycolor(bg_clr).toHexString();\r\n\r\n //Add color rules to a new style tag in the head\r\n add_css(sheet, \".header_bar .list_tag a, .page_header a\", \"color:\"+alt_clr);\r\n add_css(sheet, \".color_overlay:after\", \"background-color:\"+clr_overlay);\r\n\r\n //Add the overlay\r\n $bg.addClass('color_overlay');\r\n\r\n //Animate the color background change\r\n $bg.velocity({\r\n backgroundColor: bg_clr\r\n },{\r\n duration: 200,\r\n easing: \"easeOutSine\"\r\n });\r\n }", "title": "" }, { "docid": "2a36f18edc0f2e24838b7f75702b4ad3", "score": "0.54178584", "text": "function randomRGB() {\n\tvar color = 'rgb('; // initialize color string\n \tcolor += Math.floor(Math.random() * 256 ) + ','; // red\n \tcolor += Math.floor(Math.random() * 256 ) + ','; // blue\n \tcolor += Math.floor(Math.random() * 256 ) + ')'; // green\n\tvar targetDiv = document.getElementById('page');\n\ttargetDiv.style.backgroundColor = color;\n}", "title": "" }, { "docid": "f57aa2800eadce99a480b42b60b72c20", "score": "0.54152614", "text": "function getCSS(css) {\n\tcss = (typeof css === \"undefined\") ? '' : css;\n\n\tinitSettings('theme');\n\tswitch(getHashParam('theme') || settings.theme.value) {\n\t\tcase 'blue':\n\t\t\tvar bg1 \t= '#060D1A';\n\t\t\tvar bg2 \t= '#03060D';\n\t\t\tvar fg1 \t= '#557799';\n\t\t\tvar fg2 \t= '#557799';\n\t\t\tvar links \t= '#AABBCC';\n\t\t\tvar accent1\t= '#6699CC';\n\t\t\tvar accent2\t= '#6699CC';\n\t\t\tbreak;\n\n\t\tcase 'classic':\n\t\t\tvar bg1\t\t= '#FFFFFF';\n\t\t\tvar bg2\t\t= '#3366CC';\n\t\t\tvar fg1 \t= '#666666';\n\t\t\tvar fg2 \t= '#AACCEE';\n\t\t\tvar links \t= '#AACCEE';\n\t\t\tvar accent1\t= '#3366CC';\n\t\t\tvar accent2\t= '#FFFFFF';\n\t\t\tbreak;\n\n\t\tcase 'green':\n\t\t\tvar bg1\t\t= '#FFFFFF';\n\t\t\tvar bg2\t\t= '#222222';\n\t\t\tvar fg1 \t= '#888888';\n\t\t\tvar fg2 \t= '#888888';\n\t\t\tvar links \t= '#AAAAAA';\n\t\t\tvar accent1\t= '#33AA00';\n\t\t\tvar accent2\t= '#66CC33';\n\t\t\tbreak;\n\n\t\tcase 'default':\n\t\tdefault:\n\t\t\tvar bg1\t\t= '#222222';\n\t\t\tvar bg2\t\t= '#111111';\n\t\t\tvar fg1 \t= '#888888';\n\t\t\tvar fg2 \t= '#888888';\n\t\t\tvar links \t= '#AAAAAA';\n\t\t\tvar accent1\t= '#3380CC';\n\t\t\tvar accent2\t= '#3380CC';\n\t\t\tbreak;\n\t}\n\n\t/**\n\t * Darkens a color by a specified amount\n\t * @param\tString\tThe RGB hex color code\n\t * @param\tInt\t\tThe amount (decimal-format pertentage) by which to darken the color\n\t * @return\tString\tThe color code for the darkened color\n\t */\n\tfunction darken(color, amount) {\n\t\tcolor = splitColor(color);\n\t\tvar ret = [];\n\t\tfor (var i = 0; i < color.length; i++) {\n\t\t\tret[i] = (color[i] - Math.ceil(255 * amount));\n\n\t\t\tif (ret[i] < 0)\n\t\t\t\tret[i] = 0;\n\t\t\tif (ret[i] > 255)\n\t\t\t\tret[i] = 255;\n\n\t\t\tret[i] = ret[i].toString(16);\n\t\t\tif (ret[i].length < 2)\n\t\t\t\tret[i] = '0' + ret[i];\n\t\t}\n\t\treturn '#' + ret.join('').toUpperCase();\n\t}\n\n\t/**\n\t * Lightens a color by a specified amount\n\t * @param\tString\tThe RGB hex color code\n\t * @param\tInt\t\tThe amount (decimal-format pertentage) by which to lighten the color\n\t * @return\tString\tThe color code for the lightened color\n\t */\n\tfunction lighten(color, amount) {\n\t\tcolor = splitColor(color);\n\t\tvar ret = [];\n\t\tfor (var i = 0; i < color.length; i++) {\n\t\t\tret[i] = (color[i] + Math.ceil(255 * amount));\n\n\t\t\tif (ret[i] < 0)\n\t\t\t\tret[i] = 0;\n\t\t\tif (ret[i] > 255)\n\t\t\t\tret[i] = 255;\n\n\t\t\tret[i] = ret[i].toString(16);\n\t\t\tif (ret[i].length < 2)\n\t\t\t\tret[i] = '0' + ret[i];\n\t\t}\n\t\treturn '#' + ret.join('').toUpperCase();\n\t}\n\n\t/**\n\t * Converts a color code into a usable array for math-based functions\n\t * @param\tString\tThe RGB hex color code\n\t * @return\tInt[]\tThe array containing the decimal values of each color\n\t */\n\tfunction splitColor(color) {\n\t\tcolor = color.replace('#', '');\n\n\t\tvar offset = Math.floor(color.length / 3);\n\t\tvar ret = [];\n\t\tfor (var i = 0; i < color.length; i+=offset) {\n\t\t\tret.push(parseInt(color.substring(i, (i + offset)), 16));\n\t\t}\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Returns the CSS for a vertical background gradient (with vendor-specific prefixes)\n\t * @param\tString\tThe RGB hex color code of the top color\n\t * @param\tString\tThe RGB hex color code of the bottom color\n\t * @return\tString\tThe CSS for the background gradient\n\t */\n\tfunction gradient(top, bottom) {\n\t\tvar ret = '';\n\t\tret += 'background: -moz-linear-gradient(top, ' + top + ' 0%, ' + bottom + ' 100%);';\n\t\tret += 'background: -webkit-linear-gradient(top, ' + top + ' 0%, ' + bottom + ' 100%);';\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Returns the CSS for rounded corners (with vendor-specific prefixes)\n\t * @param\tString\tThe radius value (syntax: '#px' or '#px #px #px #px')\n\t * @return\tString\tThe CSS for the rounded corners\n\t */\n\tfunction borderRadius(radius) {\n\t\tradius = 'border-radius: ' + radius;\n\t\t// returns: -moz-border-radius: <radius>; -webkit-border-radius: <radius>; border-radius: <radius>;\n\t\treturn '-moz-' + radius + '; ' + '-webkit-' + radius + '; ' + radius + ';';\n\t}\n\n\t/**\n\t * Returns the CSS for box shadows (with vendor-specific prefixes)\n\t * @param\tString\tThe shadow value (syntax: '#px #px [#px] [#px] color [inset]')\n\t * @return\tString\tThe CSS for the box shadows\n\t */\n\tfunction boxShadow(shadow) {\n\t\tshadow = 'box-shadow: ' + shadow;\n\t\t// returns: -moz-box-shadow: <shadow>; -webkit-box-shadow: <shadow>; box-shadow: <shadow>;\n\t\treturn '-moz-' + shadow + '; ' + '-webkit-' + shadow + '; ' + shadow + ';';\n\t}\n\n\t// basics\n\tcss += '* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0; }';\n\tcss += 'body { background-color: ' + bg1 + '; color: ' + fg1 + '; font: 13px Helvetica, Arial, sans-serif; }';\n\tcss += 'a { color: ' + links + '; cursor: pointer; text-decoration: underline; }';\n\tcss += 'a:hover, a:hover { color: ' + lighten(links, 0.133) + '; text-decoration: none; }';\n\tcss += 'p { margin: 0 0 10px; }';\n\tcss += 'table { font: 13px Helvetica, Arial, sans-serif; margin: auto; width: 100%; }';\n\n\t// layout\n\tcss += '#header { background-color: ' + bg2 + '; border-bottom: 1px solid ' + lighten(bg1, 0.066) + '; color: '+ fg2 + '; padding: 10px 0 0; text-align: center; }';\n\tcss += '.scrolling #header { margin-bottom: 10px; }';\n\tcss += '.slideshow #header { min-height: 60px; position: fixed; top: 0; width: 100%; z-index: 2; }';\n\tcss += '#header .title { color: ' + accent2 + '; }';\n\tcss += '#header small { font-variant: small-caps; }';\n\tcss += '#header p { margin: 10px 0; }';\n\tcss += '#header #description { margin: 10px auto; max-width: 60%; text-align: center; }';\n\tcss += '#search { position: absolute; right: 10px; top: 10px; }';\n\tcss += '#footer { background-color: ' + bg2 + '; border-top: 1px solid ' + lighten(bg1, 0.066) + '; color: '+ fg2 + '; min-height: 60px; padding: 10px 0; position: relative; text-align: center; }';\n\tcss += '.scrolling #footer { margin-top: 10px; position: fixed; bottom: 0; left: 0; right: 0; }';\n\tcss += '.slideshow #footer { bottom: 0; height: 60px; position: fixed; width: 100%; z-index: 2; }';\n\tcss += '#favorites_container { height: 40px; line-height: 40px; margin-bottom: 0 !important; position: absolute; left: 25px; bottom: 10px; }';\n\tcss += '#autoplay { height: 20px; line-height: 20px; position: absolute; right: 25px; bottom: 20px; }';\n\tcss += '#info { font-size: 11px; margin: 10px 0 0; }';\n\n\t// logo\n\tcss += '#logo { text-decoration: none; position: absolute; left: 10px; top: 10px; }';\n\tcss += '#logo span { font: 18px \"Comic Sans MS\"; padding: 0 2px; }';\n\tcss += '#logo .image { background-color: ' + bg1 + '; color: ' + accent1 + '; }';\n\tcss += '#logo:hover .image { background-color: ' + accent1 + '; color: ' + bg1 + '; }';\n\tcss += '#logo .fap { background-color: ' + accent1 + '; color: ' + bg1 + '; }';\n\tcss += '#logo:hover .fap { background-color: ' + bg1 + '; color: ' + accent1 + '; }';\n\n\t// forms\n\tcss += 'form { margin: 0 0 10px; }';\n\tcss += 'input[type=\"text\"], select { background: ' + bg1 + '; border: 1px solid ' + fg1 + '; color: ' + fg1 + '; margin-right: 5px; padding: 5px; }';\n\tcss += 'input[type=\"text\"]:focus, select:focus { border-color: ' + accent1 + '; color: ' + fg1 + '; }';\n\tcss += 'button, input[type=\"button\"], input[type=\"submit\"] { background: ' + lighten(bg2, 0.066) + '; ' + gradient(lighten(bg2, 0.133), lighten(bg2, 0.066)) + '; border: 1px solid ' + lighten(bg2, 0.200) + '; ' + borderRadius('5px') + ' color: ' + links + '; cursor: pointer; margin-left: 5px; padding: 5px; ' + boxShadow('0 0 0 1px ' + bg2) + '; }';\n\tcss += 'button:hover, input[type=\"button\"]:hover, input[type=\"submit\"]:hover { ' + gradient(lighten(bg2, 0.200), lighten(bg2, 0.066)) + '; border: 1px solid ' + lighten(bg2, 0.266) + '; color: ' + lighten(links, 0.066) + '; }';\n\tcss += 'button:focus, input[type=\"button\"]:focus, input[type=\"submit\"]:focus { ' + gradient(lighten(bg2, 0.266), lighten(bg2, 0.066)) + '; border: 2px solid ' + lighten(bg2, 0.333) + '; color: ' + lighten(links, 0.133) + '; padding: 4px; }';\n\n\tcss += '#favorites_container input[type=\"button\"], button.default, input[type=\"submit\"] { border: 1px solid ' + accent1 + '; color: ' + lighten(links, 0.133) + '; }';\n\tcss += '#favorites_container input[type=\"button\"]:hover, button.default:hover, input[type=\"submit\"]:hover { border: 1px solid ' + lighten(accent1, 0.066) + '; color: ' + lighten(links, 0.200) + '; }';\n\tcss += '#favorites_container input[type=\"button\"]:focus, button.default:focus, input[type=\"submit\"]:focus { border: 2px solid ' + lighten(accent1, 0.066) + '; color: ' + lighten(links, 0.266) + '; padding: 4px; }';\n\n\t// pagination\n\tcss += '.pagination { margin: 0; }';\n\tcss += '.pagination a { border: 1px solid ' + darken(links, 0.133) + '; color: ' + darken(links, 0.133) + '; display: inline-block; margin: 0 2px 10px; padding: 2px 6px; text-decoration: none; }';\n\tcss += '.pagination a:hover { border-color: ' + links + '; color: ' + links + '; display: inline-block; margin: 0 2px; padding: 2px 6px; text-decoration: none; }';\n\tcss += '.pagination a.current { border: 1px solid ' + accent2 + '; color: ' + accent2 + '; }';\n\tcss += '.pagination a.disabled { border: 1px solid ' + darken(fg2, 0.266) + '; color: ' + darken(fg2, 0.133) + '; cursor: default; display: inline-block; margin: 0 2px; padding: 2px 6px; }';\n\n\t// thumbnails\n\tcss += '#thumbnails { margin-bottom: 10px; text-align: center; z-index: 2; }';\n\tcss += '#thumbnails .thumbnail { border: 1px solid ' + darken(links, 0.133) + '; display: inline-block; margin: 2px; padding: 4px; vertical-align: middle; }';\n\tcss += '#thumbnails .thumbnail:hover { border-color: ' + links + '; }';\n\tcss += '#thumbnails .thumbnail.active { border: 2px solid ' + accent2 + '; padding: 3px; }';\n\tcss += '#thumbnails.small img { max-height: 100px; }';\n\tcss += '#thumbnails.medium img { max-height: 150px; }';\n\tcss += '#thumbnails.large img { max-height: 200px; }';\n\tcss += '.slideshow #thumbnails { background-color: ' + bg2 + '; padding-bottom: 10px; overflow-y: hidden; width: 100%; white-space: nowrap; }';\n\tcss += '.slideshow #thumbnails .thumbnail { margin: 0 5px; }';\n\n\t// gallery basics\n\tcss += '#gallery { position: relative; text-align: center; }';\n\tcss += '#gallery .image img { border: 1px solid ' + darken(links, 0.133) + '; padding: 4px; min-height: 100px; min-width: 100px; }';\n\tcss += '#gallery .image:hover img { border-color: ' + accent1 + '; }';\n\tcss += '#gallery .image .spinner { border: 10px solid ' + darken(fg2, 0.266) + '; border-left-color: ' + accent1 + '; position: absolute; left: calc(100% / 2 - 80px / 2); top: calc(100% / 2 - 80px / 2); -webkit-animation: spinning 1s infinite linear; animation: spinning 1s infinite linear; }';\n\tcss += '#gallery .image .spinner, #gallery .image .spinner:after { ' + borderRadius('50%') + '; width: 80px; height: 80px; z-index: -1; }';\n\tcss += '@-webkit-keyframes spinning { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }';\n\tcss += '@keyframes spinning { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }';\n\n\t// scrolling gallery\n\tcss += '.scrolling #gallery { max-width: 100%; }';\n\tcss += '.scrolling #gallery .image { clear: both; display: inline-block; max-width: 98%; position: relative; }';\n\tcss += '.scrolling #gallery .image img { display: inline-block; max-width: 100%; }';\n\n\tcss += '#loader { background: ' + lighten(bg2, 0.066) + '; ' + gradient(lighten(bg2, 0.133), lighten(bg2, 0.066)) + '; border: 1px solid ' + accent1 + '; border-radius: 5px; ' + boxShadow('0 0 0 1px ' + bg2) + '; color: ' + lighten(links, 0.133) + '; display: inline-block; margin-top: 10px; padding: 8px 16px; text-decoration: none; }';\n\tcss += '#loader:hover { ' + gradient(lighten(bg2, 0.200), lighten(bg2, 0.066)) + '; border-color: ' + lighten(accent1, 0.066) + '; color: ' + lighten(links, 0.200) + '; }';\n\n\t// slideshow gallery\n\tcss += '.slideshow #content { bottom: 81px; left: 0; padding: 10px; position: absolute; right: 0; top: 81px; }';\n\tcss += '.slideshow #gallery { height: 100%; width: 100%; overflow: hidden; }';\n\tcss += '.slideshow #gallery .image img { bottom: 0; left: 0; margin: auto; max-height: 100%; max-width: 100%; position: absolute; right: 0; top: 0; }';\n\tcss += '.slideshow #gallery .nav { color: #FFFFFF; display: block; text-decoration: none; opacity: 0.5; position: absolute; top: 5px; bottom: 5px; height: 100%; width: 160px; z-index: 1; }';\n\tcss += '.slideshow #gallery .nav.disabled { display: none; }';\n\tcss += '.slideshow #gallery #next { min-height: 60px; min-width: 60px; right: 5px; }';\n\tcss += '.slideshow #gallery #prev { min-height: 60px; min-width: 60px; left: 5px; }';\n\tcss += '.slideshow #gallery .arrow { display: block; font-size: 120px; height: 160px; line-height: 160px; margin-top: -80px; position: relative; text-align: center; text-shadow: 0 0 5px #000000, 0 0 20px #FFFFFF; top: 50%; }';\n\tcss += '.slideshow #gallery .nav:hover { background-color: rgba(0,0,0,0.5); opacity: 1.0; }';\n\tcss += '.slideshow #gallery #indicator { background-color: rgba(0,0,0,0.5); ' + borderRadius('40px') + '; display: block; position: absolute; top: 50%; left: 50%; height: 160px; margin-top: -80px; margin-left: -80px; width: 160px; z-index: 1; }';\n\tcss += '.slideshow #gallery #indicator .symbol { color: #FFFFFF; font-size: 120px; position: relative; text-align: center; text-shadow: 0 0 5px #000000, 0 0 20px #FFFFFF; }';\n\tcss += '.slideshow #gallery #indicator .symbol.pause { font-weight: bold; }';\n\tcss += '.slideshow #gallery #indicator .symbol.play { line-height: 160px; }';\n\n\t// full screen:: WebKit\n\tcss += ':-webkit-full-screen { background-color: #000000; }';\n\tcss += '#content:-webkit-full-screen { padding: 0; top: 0 !important; bottom: 0 !important; height: 100%; width: 100%; }';\n\tcss += '#content:-webkit-full-screen .nav { ' + borderRadius('40px') + '; height: 160px; margin-top: -80px; top: 50%; }';\n\tcss += '#content:-webkit-full-screen .image img { border: 0; padding: 0; }';\n\tcss += '#content:-webkit-full-screen #thumbnails { background-color: #000000; position: absolute; top: 0; }';\n\t// full screen:: Mozilla\n\tcss += '#content:-moz-full-screen { padding: 0; top: 0 !important; bottom: 0 !important; height: 100%; width: 100%; }';\n\tcss += '#content:-moz-full-screen .nav { ' + borderRadius('40px') + '; height: 160px; margin-top: -80px; top: 50%; }';\n\tcss += '#content:-moz-full-screen .image img { border: 0; padding: 0; }';\n\tcss += '#content:-moz-full-screen #thumbnails { background-color: #000000; position: absolute; top: 0; }';\n\n\t// add to favorites\n\tcss += '#favorites_container table { width: auto; }';\n\n\t// notification messages\n\tcss += '#notificationContainer { bottom: 70px; position: fixed; right: 10px; }';\n\tcss += '.notification { background: rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.2); ' + borderRadius('5px') + '; color: rgba(255, 255, 255, 0.5); display: block; font-size: 11px; margin-top: 10px; padding: 9px; }';\n\n\t// dialog box layout\n\tcss += '#dialogContainer { background: rgba(0,0,0,0.8); display: block; text-align: center; position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 3; overflow-y: auto; }';\n\tcss += '#dialogBox { background: ' + bg1 + '; border: 1px solid ' + lighten(bg2, 0.200) + '; ' + boxShadow('0 0 20px 0 #000000') + '; color: ' + fg1 + '; display: inline-block; margin: 20px auto; min-width: 300px; text-align: left; position: relative; z-index: 10; }';\n\tcss += '#dialogClose { border-left: 1px solid ' + lighten(bg2, 0.200) + '; color: ' + links + '; font-size: 14px; line-height: 28px; position: absolute; right: 0; text-align: center; text-decoration: none; top: 0; width: 30px; }';\n\tcss += '#dialogClose:hover { color: ' + lighten(links, 0.200) + '; }';\n\tcss += '#dialogTitle { background: ' + bg1 + '; ' + gradient(lighten(bg2, 0.066), bg2) + '; border-bottom: 1px solid ' + lighten(bg2, 0.200) + '; color: ' + links + '; display: block; margin: 0; padding: 5px 10px; }';\n\tcss += '#dialogTitle b { color: ' + accent2 + '; }';\n\tcss += '#dialogMessage { display: block; padding: 10px; }';\n\tcss += '#dialogButtons { clear: both; display: block; padding: 10px; text-align: right; }';\n\n\t// dialog box content\n\tcss += '#dialogMessage table { margin: 0; }';\n\tcss += '#dialogMessage table th { color: ' + accent1 + '; font-size: 14px; text-align: left; }';\n\tcss += '#dialogMessage table b { color: ' + lighten(accent1, 0.066) + '; }';\n\tcss += '#dialogMessage table td.name { padding-right: 5%; text-align: right; width: 20%; }';\n\tcss += '#dialogMessage table td.key { text-align: center; width: 25%; }';\n\n\t// dialog box form elements\n\tcss += '#dialogBox #settingsForm { width: 820px }';\n\tcss += '#dialogBox .error { color: #C43131; font-weight: bold; }';\n\tcss += '#dialogBox button { margin-right: 5px; }';\n\tcss += '#dialogBox fieldset { border: 0; border-bottom: 1px solid ' + lighten(bg2, 0.200) + '; margin: 0 0 15px; padding-bottom: 10px; min-width: 400px; }';\n\tcss += '#dialogBox fieldset:nth-child(1n) { float: left; }';\n\tcss += '#dialogBox fieldset:nth-child(2n) { float: right; }';\n\tcss += '#dialogBox legend { color: ' + accent1 + '; font-weight: bold; margin-bottom: 10px; }';\n\tcss += '#dialogBox label { float: left; line-height: 20px; }';\n\tcss += '#dialogBox label b { color: ' + accent1 + '; }';\n\tcss += '#dialogBox label span.default { font-size: 11px; font-variant: small-caps; }';\n\tcss += '#dialogBox input[type=\"text\"], #dialogBox select { float: right; }';\n\tcss += '#dialogBox input[type=\"checkbox\"] { float: left; margin: 4px 10px 0 ; }';\n\n\t// insert the line breaks automatically before returning\n\treturn css.replace(/}/g, \"}\\n\");\n}", "title": "" }, { "docid": "9f7b8abafac97985fbbe0e9ef36b2f20", "score": "0.5413607", "text": "loadTheme (theme) {\n\n // Load colors depending on theme selected\n switch (theme) {\n default:\n break;\n // Clean\n case 0:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"white\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#333333\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"black\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#cccccc\");\n document.documentElement.style.setProperty (\"--card-text\", \"black\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#cccccc\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"black\");\n break;\n // Orchid\n case 1:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"#f9b4ed\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#334139\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"black\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"#e574bc\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#c52184\");\n document.documentElement.style.setProperty (\"--card-text\", \"black\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#e574bc\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"black\");\n break;\n // Grey Alabaster\n case 2:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"#8a817C\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#463f3a\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"white\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"#bcb8b1\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#e0afa0\");\n document.documentElement.style.setProperty (\"--card-text\", \"black\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#e0afa0\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"black\");\n break;\n // Blue Orange\n case 3:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"#283845\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#f29559\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"white\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"black\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"#f29559\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#f2d492\");\n document.documentElement.style.setProperty (\"--card-text\", \"black\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#f2d492\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"black\");\n break;\n // Dodger\n case 4:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"#4bb3fd\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#00487c\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"white\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"#027bce\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#3e6680\");\n document.documentElement.style.setProperty (\"--card-text-color\", \"white\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#027bce\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"white\");\n break;\n // Rainy\n case 5:\n document.documentElement.style.setProperty (\"--bg-color-1\", \"#a5ccd1\");\n document.documentElement.style.setProperty (\"--bg-color-2\", \"#949ba0\");\n document.documentElement.style.setProperty (\"--text-color-1\", \"black\");\n document.documentElement.style.setProperty (\"--text-color-2\", \"white\");\n document.documentElement.style.setProperty (\"--card-bg-color-1\", \"#bcd4de\");\n document.documentElement.style.setProperty (\"--card-bg-color-2\", \"#9dacb2\");\n document.documentElement.style.setProperty (\"--card-text-color\", \"black\");\n document.documentElement.style.setProperty (\"--form-bg-color\", \"#bcd4de\");\n document.documentElement.style.setProperty (\"--form-text-color\", \"black\");\n break;\n }\n }", "title": "" }, { "docid": "db78d9eb7549d706321e6feabc6d8a7e", "score": "0.5409976", "text": "function bindCSS() {\n $('#csstextexample').on('mousedown mousemove', function() {\n $('#csswidth').text( `${$(this).width()}, ${$(this).height()}`);\n $('#cssinnerwidth').text( `${$(this).innerWidth()}, ${$(this).innerHeight()}`);\n $('#cssouterwidth').text( `${$(this).outerWidth()}, ${$(this).outerHeight()}`);\n $('#cssoffset').text( `left: ${$(this).offset().left}, top: ${$(this).offset().top}`);\n $('#csshasclass').text( `${$(this).hasClass('cooltextbox')}` );\n $('#cssaddclass').on('click', function() {\n $('#csstextexample').addClass('bluebackground');\n $('#csscss').text(`${$('#csstextexample').css('background-color')}`);\n });\n $('#cssremoveclass').on('click', function() {\n $('#csstextexample').removeClass('bluebackground');\n $('#csscss').text(`${$('#csstextexample').css('background-color')}`);\n });\n $('#csscss').text(`${$(this).css('background-color')}`);\n }) \n}", "title": "" }, { "docid": "50343b0df8f7c1a0742a19ee9d18507b", "score": "0.5408523", "text": "function randomRGB() {\n red = randomNumberGenerator();\n blue = randomNumberGenerator();\n green = randomNumberGenerator();\n\n document.body.style.backgroundColor = `rgb(${red}, ${blue}, ${green})`;\n }", "title": "" }, { "docid": "be9397109e36247cba102adb24fb6eba", "score": "0.5406171", "text": "function random_bg_color() {\n var red = Math.floor(Math.random() * 256);\n var green = Math.floor(Math.random() * 256);\n var blue = Math.floor(Math.random() * 256);\n var bgColor = \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\n console.log(bgColor);\n\n document.body.style.background = bgColor;\n}", "title": "" }, { "docid": "c33818572853132835c96a0bd0149c0a", "score": "0.5401587", "text": "function random_bg_color() {\n var red = Math.floor(Math.random() * 256);\n var blue = Math.floor(Math.random() * 256);\n var green = Math.floor(Math.random() * 256);\n var bgColor = \"rgb(\" + red + \",\" + blue + \",\" + green + \")\";\n console.log(bgColor);\n\n document.body.style.background = bgColor;\n}", "title": "" }, { "docid": "37cab1d32353d6bcb63bb100c7f8318d", "score": "0.5400367", "text": "function getStyles(){\n}", "title": "" }, { "docid": "d3efd7ac77fac7c1df6d82e8f18bd71d", "score": "0.53876257", "text": "get styles () {return paths.globals.dev + '/stylesheets'}", "title": "" }, { "docid": "070b9463227d622a2ec57ae34b2fc213", "score": "0.53858316", "text": "function colorHEX(){\n var color = \"\";\n //se corre 6 veces la funcion de generarvalor para completar el color hexadecimal\n\tfor(var i=0;i<6;i++){\n\t\tcolor = color + generarValor() ;\n\t}\n\treturn \"#\" + color;\n}", "title": "" }, { "docid": "a49dbb0e3707dc19bad9ad7264254d6b", "score": "0.5384184", "text": "function getcolor(colorString){switch(colorString){case\"themeprimary\":return themeprimary;case\"themesecondary\":return themesecondary;case\"themethirdcolor\":return themethirdcolor;case\"themefourthcolor\":return themefourthcolor;case\"themefifthcolor\":return themefifthcolor;default:return colorString;}}/*#endregion Get Colors*/ //Switch Classes Function", "title": "" }, { "docid": "d3b5a9d89e609b22b23b337f11f5f8de", "score": "0.53817046", "text": "function RGBColor(m){this.ok=!1;m.charAt(0)==\"#\"&&(m=m.substr(1,6));var m=m.replace(/ /g,\"\"),m=m.toLowerCase(),a={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"00ffff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000000\",blanchedalmond:\"ffebcd\",blue:\"0000ff\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"00ffff\",darkblue:\"00008b\",\ndarkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dodgerblue:\"1e90ff\",feldspar:\"d19275\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"ff00ff\",\ngainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgrey:\"d3d3d3\",lightgreen:\"90ee90\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",\nlightslateblue:\"8470ff\",lightslategray:\"778899\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"00ff00\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"ff00ff\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370d8\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",\noldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"d87093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",red:\"ff0000\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",\nslategray:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",violetred:\"d02090\",wheat:\"f5deb3\",white:\"ffffff\",whitesmoke:\"f5f5f5\",yellow:\"ffff00\",yellowgreen:\"9acd32\"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/,example:[\"rgb(123, 234, 45)\",\"rgb(255,234,245)\"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\\w{2})(\\w{2})(\\w{2})$/,\nexample:[\"#00ff00\",\"336699\"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\\w{1})(\\w{1})(\\w{1})$/,example:[\"#fb0\",\"f0f\"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c<d.length;c++){var b=d[c].process,k=d[c].re.exec(m);if(k)channels=b(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:\nthis.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return\"rgb(\"+this.r+\", \"+this.g+\", \"+this.b+\")\"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b=\"0\"+b);a.length==1&&(a=\"0\"+a);d.length==1&&(d=\"0\"+d);return\"#\"+b+a+d};this.getHelpXML=function(){for(var b=[],c=0;c<d.length;c++)for(var k=d[c].example,h=0;h<k.length;h++)b[b.length]=k[h];for(var j in a)b[b.length]=j;k=document.createElement(\"ul\");\nk.setAttribute(\"id\",\"rgbcolor-examples\");for(c=0;c<b.length;c++)try{var l=document.createElement(\"li\"),o=new RGBColor(b[c]),n=document.createElement(\"div\");n.style.cssText=\"margin: 3px; border: 1px solid black; background:\"+o.toHex()+\"; color:\"+o.toHex();n.appendChild(document.createTextNode(\"test\"));var q=document.createTextNode(\" \"+b[c]+\" -> \"+o.toRGB()+\" -> \"+o.toHex());l.appendChild(n);l.appendChild(q);k.appendChild(l)}catch(p){}return k}}", "title": "" }, { "docid": "2feb3049bc9bc803c2b5ed5f56c3983b", "score": "0.5377384", "text": "function changeColor(){\r\n\tdivBgColor.style.backgroundColor = \"rgb(\" + redColorValue + ',' + greenColorValue + ',' + blueColorValue + \")\";\r\n}", "title": "" }, { "docid": "31e2eaa359041a8ce5ca32a600a01691", "score": "0.53755665", "text": "function get_color(string_to_check) {\r\n\tstring_to_check_length = string_to_check.length;\r\n\t\r\n\t// Variable Check\r\n\tif (string_to_check_length<22 && string_to_check_length>0 && string_to_check_length!=19) {\r\n\t\tfor (get_color_i = (variables_lookup_table[string_to_check_length+1]+1); get_color_i<=variables_lookup_table[string_to_check_length]; get_color_i++) {\r\n\t\t\tif (string_to_check==variables[get_color_i]) {\r\n\t\t\t\treturn ('<span style=\"color:'+c_variables+';\">'+string_to_check+'</span>');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Constants Check\r\n\tif (string_to_check_length<25 && string_to_check_length>1 && string_to_check_length!=3 && string_to_check_length!=1) {\r\n\t\tfor (get_color_i = (constants_lookup_table[string_to_check_length+1]+1); get_color_i<=constants_lookup_table[string_to_check_length]; get_color_i++) {\r\n\t\t\tif (string_to_check==constants[get_color_i]) {\r\n\t\t\t\treturn ('<span style=\"color:'+c_constants+';\">'+string_to_check+'</span>');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Functions\r\n\tif (string_to_check_length<38 && string_to_check_length>1 && !(string_to_check_length>31 && string_to_check_length<36)) {\r\n\t\tfor (get_color_i = (functions_lookup_table[string_to_check_length+1]+1); get_color_i<=functions_lookup_table[string_to_check_length]; get_color_i++) {\r\n\t\t\tif (string_to_check==functions[get_color_i]) {\r\n\t\t\t\treturn ('<span style=\"color:'+c_functions+';\">'+string_to_check+'</span>');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Keywords (Logical)\r\n\tfor (get_color_i = 0; get_color_i<logical_length; get_color_i++) {\r\n\t\tif (string_to_check==logical[get_color_i]) {\r\n\t\t\treturn ('<span style=\"font-weight:bold;color:'+c_keywords+';\">'+string_to_check+'</span>');\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (guess_prefix === true) {\t\r\n\t\tfor (get_color_i = 0; get_color_i<prefix_length; get_color_i++) {\r\n\t\t\ttest_prefix = string_to_check.substring(0,string_to_check.indexOf(\"_\"));\r\n\t\t\tif (test_prefix == prefix[get_color_i]) {\r\n\t\t\t\tif (test_prefix === 'scr') {\r\n\t\t\t\t\treturn ('<span style=\"color:'+c_scripts+'\">'+string_to_check+'</span>');\r\n\t\t\t\t}\r\n\t\t\t\treturn ('<span style=\"color:'+c_resources+';\">'+string_to_check+'</span>');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn (string_to_check);\r\n}", "title": "" }, { "docid": "9886fe83b346eb44cbe92d80f7ddd0f7", "score": "0.5375287", "text": "function setColor() {\n\tbody.style.background = \"linear-gradient(to right, \" + color1.value + \", \" + color2.value + \")\";\n\tcss.textContent = body.style.background + \";\";\n}", "title": "" }, { "docid": "9d2abc5e0d0619960b4b9b709111652b", "score": "0.5372886", "text": "function bgColorUpdater(){\n let randomR, randomG, randomB, rGB;\n randomR = randomColor();\n randomG = randomColor();\n randomB = randomColor();\n\n rGB = 'rgb('+randomR+', ' + randomG + ', ' + randomB +')'; \n\n document.body.style.backgroundColor = rGB;\n}", "title": "" }, { "docid": "37b98ba539b1b524f169e2af8c6c72fe", "score": "0.5371524", "text": "function getHexColor(colorStr) {\n\t var a = document.createElement('div');\n\t a.style.color = colorStr;\n\t var colors = window.getComputedStyle( document.body.appendChild(a) ).color.match(/\\d+/g).map(function(a){ return parseInt(a,10); });\n\t document.body.removeChild(a);\n\t return (colors.length >= 3) ? '#' + (((1 << 24) + (colors[0] << 16) + (colors[1] << 8) + colors[2]).toString(16).substr(1)) : false;\n\t}//end getHexColor", "title": "" }, { "docid": "8dee80b8962e3148c1096a718a14e189", "score": "0.5371502", "text": "function useColors() {\r\n // is webkit? http://stackoverflow.com/a/16459606/376773\r\n return ('WebkitAppearance' in document.documentElement.style) ||\r\n // is firebug? http://stackoverflow.com/a/398120/376773\r\n (window.console && (console.firebug || (console.exception && console.table))) ||\r\n // is firefox >= v31?\r\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\r\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\r\n}", "title": "" }, { "docid": "3a0401439800a11585b4022f0d459e69", "score": "0.5369157", "text": "function calcGlobalColors() {\n gRED = proColor.colorFromRange(ColorRange.RED);\n gORANGE = proColor.colorFromRange(ColorRange.ORANGE);\n gYELLOW = proColor.colorFromRange(ColorRange.YELLOW);\n gGREEN = proColor.colorFromRange(ColorRange.GREEN);\n gBLUE = proColor.colorFromRange(ColorRange.BLUE);\n gINDIGO = proColor.colorFromRange(ColorRange.INDIGO);\n gVIOLET = proColor.colorFromRange(ColorRange.VIOLET);\n gPINK = proColor.colorFromRange(ColorRange.PINK);\n}", "title": "" }, { "docid": "ecc0554547dfd37fc0624b8c668ac0a8", "score": "0.53662986", "text": "get headerBackground() {\r\n return brushToString(this.i.a6);\r\n }", "title": "" }, { "docid": "579c550fd279a048fd3176ca2c681a78", "score": "0.53631765", "text": "function generateRandomColor() {\n\tvar r = Math.floor(Math.random() * 256);\n\tvar g = Math.floor(Math.random() * 256);\n\tvar b = Math.floor(Math.random() * 256);\n\tvar rgb = 'rgb(' + r + ',' + g + ',' + b + ')';\n\tconsole.log(rgb)\n\tdocument.body.style.backgroundColor = rgb;\n\tdocument.getElementById('loadQuote').style.backgroundColor = rgb;\n\t\n}", "title": "" }, { "docid": "a28936f866393125da361afdce958e80", "score": "0.5362611", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-hbdsxb-style\";\n \tstyle.textContent = \"button.svelte-hbdsxb.svelte-hbdsxb{position:absolute;left:0px;top:0px;margin:5px;z-index:10;background-color:Transparent;background-repeat:no-repeat;border:none;cursor:pointer;overflow:hidden;outline:none}svg.svelte-hbdsxb line.svelte-hbdsxb{stroke:currentColor;stroke-width:3}.open.svelte-hbdsxb #top.svelte-hbdsxb{transform:translate(10px, 0px) rotate(45deg)\\n }.open.svelte-hbdsxb #mid.svelte-hbdsxb{opacity:0\\n }.open.svelte-hbdsxb #bot.svelte-hbdsxb{transform:translate(-15px, 8px) rotate(-45deg)\\n }\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "3dc567529fc17662d08c5cad487791c5", "score": "0.53617215", "text": "function updateCSS(){\n\t\t$j('#portalheadertop').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Header_T_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_T_G_B__c')) + ' 15%)');\n\t\t$j('#portalheadertop').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Header_T_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_T_G_B__c')) + ' 15%)');\n\t\t$j('#portalheadertop').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Header_T_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_T_G_B__c')) + ' 15%)');\n\t\t$j('#portalheadermid').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Header_Mid_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_Mid_G_B__c')) + ' 100%)');\n\t\t$j('#portalheadermid').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Header_Mid_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_Mid_G_B__c')) + ' 100%)');\n\t\t$j('#portalheadermid').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Header_Mid_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_Mid_G_B__c')) + ' 100%)');\n\t\t$j('#portalheaderbot').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Header_B_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_B_G_B__c')) + ' 100%)');\n\t\t$j('#portalheaderbot').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Header_B_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_B_G_B__c')) + ' 100%)');\n\t\t$j('#portalheaderbot').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Header_B_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Header_B_G_B__c')) + ' 100%)');\n\t\t$j('#portalfooter').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Footer_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Footer_G_B__c')) + ' 100%)');\n\t\t$j('#portalfooter').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Footer_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Footer_G_B__c')) + ' 100%)');\n\t\t$j('#portalfooter').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Footer_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Footer_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebar').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebar').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebar').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarmodule').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Side_Module_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarmodule').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Side_Module_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarmodule').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Side_Module_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarheader').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Side_Module_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_Header_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarheader').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Side_Module_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_Header_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarheader').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Side_Module_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Module_Header_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidetabs').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidetabs').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidetabs').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Side_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_G_B__c')) + ' 100%)');\n\t\t$j('.odd').css('background', '' + convertToRgba($j('#Back_Page_Block_Table_Odd__c')));\n\t\t$j('.even').css('background', '' + convertToRgba($j('#Back_Page_Block_Table_Even__c')));\n\t\t$j('#portalsidebarbutton').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Side_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Button_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarbutton').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Side_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Button_G_B__c')) + ' 100%)');\n\t\t$j('#portalsidebarbutton').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Side_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Side_Button_G_B__c')) + ' 100%)');\n\t\t$j('.portallefttab').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.portallefttab').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.portallefttab').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.portalheadertab').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.portalheadertab').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.portalheadertab').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Tab_A_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_A_G_B__c')) + ' 100%)');\n\t\t$j('.inactive').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Tab_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_G_B__c')) + ' 100%)');\n\t\t$j('.inactive').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Tab_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_G_B__c')) + ' 100%)');\n\t\t$j('.inactive').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Tab_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Tab_G_B__c')) + ' 100%)');\n\t\t$j('.classicactive').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Body_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Body_G_B__c')) + ' 100%)');\n\t\t$j('.classicactive').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Body_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Body_G_B__c')) + ' 100%)');\n\t\t$j('.classicactive').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Body_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Body_G_B__c')) + ' 100%)');\n\t\t$j('#portalfooter').css('border-top', '5px solid ' + convertToRgba($j('#Back_Header_B_G_T__c')));\n\t\t$j('#portalheadertop').css('color', '' + convertToRgba($j('#Font_Colour_Navigation_Menu__c')));\n\t\t$j('#portalheadertop').css('font-size', '' + $j('#Font_Size_Navigation_Menu__c').val());\n\t\t$j('#portalheadertop').css('font-weight', '' + $j('#Font_Weight_Navigation_Menu__c').val());\n\t\t$j('#portalheadertop').css('text-transform', '' + $j('#Font_Transform_Navigation_Menu__c').val());\n\t\t$j('#portalheadertop').css('text-decoration', '' + $j('#Font_Decoration_Navigation_Menu__c').val());\n\t\t$j('#title').css('color', '' + convertToRgba($j('#Font_Colour_Page_Title__c')));\n\t\t$j('#title').css('font-size', '' + $j('#Font_Size_Page_Title__c').val());\n\t\t$j('#title').css('font-weight', '' + $j('#Font_Weight_Page_Title__c').val());\n\t\t$j('#title').css('text-transform', '' + $j('#Font_Transform_Page_Title__c').val());\n\t\t$j('#title').css('text-decoration', '' + $j('#Font_Decoration_Page_Title__c').val());\n\t\t$j('#info').css('color', '' + convertToRgba($j('#Font_Colour_Small_Information__c')));\n\t\t$j('#info').css('font-size', '' + $j('#Font_Size_Small_Information__c').val());\n\t\t$j('#info').css('font-weight', '' + $j('#Font_Weight_Small_Information__c').val());\n\t\t$j('#info').css('text-transform', '' + $j('#Font_Transform_Small_Information__c').val());\n\t\t$j('#info').css('text-decoration', '' + $j('#Font_Decoration_Small_Information__c').val());\n\t\t$j('#portalsidebar span').css('color', '' + convertToRgba($j('#Font_Colour_Side_Header__c')));\n\t\t$j('#portalsidebar span').css('font-size', '' + $j('#Font_Size_Side_Header__c').val());\n\t\t$j('#portalsidebar span').css('font-weight', '' + $j('#Font_Weight_Side_Header__c').val());\n\t\t$j('#portalsidebar span').css('text-transform', '' + $j('#Font_Transform_Side_Header__c').val());\n\t\t$j('#portalsidebar span').css('text-decoration', '' + $j('#Font_Decoration_Side_Header__c').val());\n\t\t$j('#portalpageblockheader span').css('color', '' + convertToRgba($j('#Font_Colour_Secondary_Title__c')));\n\t\t$j('#portalpageblockheader span').css('font-size', '' + $j('#Font_Size_Secondary_Title__c').val());\n\t\t$j('#portalpageblockheader span').css('font-weight', '' + $j('#Font_Weight_Secondary_Title__c').val());\n\t\t$j('#portalpageblockheader span').css('text-transform', '' + $j('#Font_Transform_Secondary_Title__c').val());\n\t\t$j('#portalpageblockheader span').css('text-decoration', '' + $j('#Font_Decoration_Secondary_Title__c').val());\n\t\t$j('.row').css('color', '' + convertToRgba($j('#Font_Colour_Main__c')));\n\t\t$j('.row').css('font-size', '' + $j('#Font_Size_Main__c').val());\n\t\t$j('.row').css('font-weight', '' + $j('#Font_Weight_Main__c').val());\n\t\t$j('.row').css('text-transform', '' + $j('#Font_Transform_Main__c').val());\n\t\t$j('.row').css('text-decoration', '' + $j('#Font_Decoration_Main__c').val());\n\t\t$j('#portalbutton').css('color', '' + convertToRgba($j('#Font_Colour_Button__c')));\n\t\t$j('#portalbutton').css('font-size', '' + $j('#Font_Size_Button__c').val());\n\t\t$j('#portalbutton').css('font-weight', '' + $j('#Font_Weight_Button__c').val());\n\t\t$j('#portalbutton').css('text-transform', '' + $j('#Font_Transform_Button__c').val());\n\t\t$j('#portalbutton').css('text-decoration', '' + $j('#Font_Decoration_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('color', '' + convertToRgba($j('#Font_Colour_Side_Button__c')));\n\t\t$j('#portalsidebarbutton').css('font-size', '' + $j('#Font_Size_Side_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('font-weight', '' + $j('#Font_Weight_Side_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('text-transform', '' + $j('#Font_Transform_Side_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('text-decoration', '' + $j('#Font_Decoration_Side_Button__c').val());\n\t\t$j('.portallefttab').css('color', '' + convertToRgba($j('#Font_Colour_Tab_A__c')));\n\t\t$j('.portallefttab').css('font-size', '' + $j('#Font_Size_Tab_A__c').val());\n\t\t$j('.portallefttab').css('font-weight', '' + $j('#Font_Weight_Tab_A__c').val());\n\t\t$j('.portallefttab').css('text-transform', '' + $j('#Font_Transform_Tab_A__c').val());\n\t\t$j('.portallefttab').css('text-decoration', '' + $j('#Font_Decoration_Tab_A__c').val());\n\t\t$j('.portalheadertab').css('color', '' + convertToRgba($j('#Font_Colour_Tab_A__c')));\n\t\t$j('.portalheadertab').css('font-size', '' + $j('#Font_Size_Tab_A__c').val());\n\t\t$j('.portalheadertab').css('font-weight', '' + $j('#Font_Weight_Tab_A__c').val());\n\t\t$j('.portalheadertab').css('text-transform', '' + $j('#Font_Transform_Tab_A__c').val());\n\t\t$j('.portalheadertab').css('text-decoration', '' + $j('#Font_Decoration_Tab_A__c').val());\n\t\t$j('.inactive').css('color', '' + convertToRgba($j('#Font_Colour_Tab__c')));\n\t\t$j('.inactive').css('font-size', '' + $j('#Font_Size_Tab__c').val());\n\t\t$j('.inactive').css('font-weight', '' + $j('#Font_Weight_Tab__c').val());\n\t\t$j('.inactive').css('text-transform', '' + $j('#Font_Transform_Tab__c').val());\n\t\t$j('.inactive').css('text-decoration', '' + $j('#Font_Decoration_Tab__c').val()); \n\t\t$j('#portalsidebar span').css('border-bottom', '1px solid ' + convertToRgba($j('#Font_Colour_Side_Header__c')));\n\t\t$j('.inactive').css('border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.inactive').css('-webkit-border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.inactive').css('-moz-border-radius', '' + $j('#Radius_Tab__c').val()); \n\t\t$j('.portalheadertab').css('border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.portalheadertab').css('-webkit-border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.portalheadertab').css('-moz-border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.portallefttab').css('border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.portallefttab').css('-webkit-border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('.portallefttab').css('-moz-border-radius', '' + $j('#Radius_Tab__c').val());\n\t\t$j('#portalbutton').css('border-radius', '' + $j('#Radius_Button__c').val());\n\t\t$j('#portalbutton').css('-webkit-border-radius', '' + $j('#Radius_Button__c').val());\n\t\t$j('#portalbutton').css('-moz-border-radius', '' + $j('#Radius_Button__c').val());\n\t\t$j('#portalsidetabs').css('border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidetabs').css('-webkit-border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidetabs').css('-moz-border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidebar').css('border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidebar').css('-webkit-border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidebar').css('-moz-border-radius', '' + $j('#Radius_Side__c').val());\n\t\t$j('#portalsidebarheader').css('border-top-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarheader').css('-webkit-border-top-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarheader').css('-moz-border-top-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarheader').css('border-top-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarheader').css('-webkit-border-top-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarheader').css('-moz-border-top-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('border-bottom-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('-webkit-border-bottom-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('-moz-border-bottom-right-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('border-bottom-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('-webkit-border-bottom-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarmodule').css('-moz-border-bottom-left-radius', '' + $j('#Radius_Side_Module__c').val());\n\t\t$j('#portalsidebarbutton').css('border-radius', '' + $j('#Radius_Side_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('-webkit-border-radius', '' + $j('#Radius_Side_Button__c').val());\n\t\t$j('#portalsidebarbutton').css('-moz-border-radius', '' + $j('#Radius_Side_Button__c').val());\n\t\t$j('#portalpageblockheader').css('border-top-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('#portalpageblockheader').css('-webkit-border-top-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('#portalpageblockheader').css('-moz-border-top-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('#portalpageblockheader').css('border-top-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('#portalpageblockheader').css('-webkit-border-top-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('#portalpageblockheader').css('-moz-border-top-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('border-bottom-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('-webkit-border-bottom-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('-moz-border-bottom-right-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('border-bottom-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('-webkit-border-bottom-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\t$j('.lastrow').css('-moz-border-bottom-left-radius', '' + $j('#Radius_Page_Block__c').val());\n\t\tif($j('#Image_Page_Block_Header__c').prop('checked') == true){\n\t\t\t$j('#portalpageblockheader').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), -moz-linear-gradient(top,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalpageblockheader').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), -webkit-linear-gradient(top,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalpageblockheader').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), linear-gradient(to bottom,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t}else{\n\t\t\t$j('#portalpageblockheader').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalpageblockheader').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalpageblockheader').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Page_Block_Header_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Page_Block_Header_G_B__c')) + ' 100%)');\n\t\t}\n\t\tif($j('#Image_Button__c').prop('checked') == true){\n\t\t\t$j('#portalbutton').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), -moz-linear-gradient(top,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalbutton').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), -webkit-linear-gradient(top,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalbutton').css('background', 'url(\"/resource/SSEPortalResources/images/SSEPortalBarBackground.png\"), linear-gradient(to bottom,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t}else{\n\t\t\t$j('#portalbutton').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalbutton').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalbutton').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Button_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Button_G_B__c')) + ' 100%)');\n\t\t}\n\t\tif($j('#Image_Background__c').prop('checked') == true){\n\t\t\t$j('#portalcontainer').css('background', 'url(\"' + Image_Background_Image__c + '\"), -moz-linear-gradient(top,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalcontainer').css('background', 'url(\"' + Image_Background_Image__c + '\"), -webkit-linear-gradient(top,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalcontainer').css('background', 'url(\"' + Image_Background_Image__c + '\"), linear-gradient(to bottom,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalcontainer').css('background-position', '' + $j('#Image_Background_Position__c').val());\n\t\t\t$j('#portalcontainer').css('background-repeat', '' + $j('#Image_Background_Repeat__c').val());\n\t\t\n\t\t}else{\n\t\t\t$j('#portalcontainer').css('background', '-moz-linear-gradient(top,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalcontainer').css('background', '-webkit-linear-gradient(top,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t\t$j('#portalcontainer').css('background', 'linear-gradient(to bottom,' + convertToRgba($j('#Back_Background_G_T__c')) + ' 0%, ' + convertToRgba($j('#Back_Background_G_B__c')) + ' 100%)');\n\t\t}\n\t\tif($j('.savebutton').html() != '<h1>Save</h1>'){\n\t\t\t$j('.savebutton').html('<h1>Save</h1>');\n\t\t}\n\t}", "title": "" }, { "docid": "eb4b21faa85f7bde2eee16188b7844fb", "score": "0.5349488", "text": "function getRandomColor () {\n var red = Math.floor(Math.random() * 256 );\n var green = Math.floor(Math.random() * 256 );\n var blue = Math.floor(Math.random() * 256 );\n var rgbColor = 'rgb(' + red + ',' + green + ',' + blue + ')'\n document.getElementsByTagName('body')[0].style.backgroundColor = rgbColor;\n document.getElementById('loadQuote').style.backgroundColor = rgbColor;\n}", "title": "" }, { "docid": "a0882653a8199405919ac7badab755bf", "score": "0.5346354", "text": "function randomBgColor() {\n var redValue = Math.floor(Math.random() * 256);\n var greenValue = Math.floor(Math.random() * 256);\n var blueValue = Math.floor(Math.random() * 256);\n var bgColor = \"rgb(\" + redValue + \",\" + greenValue + \",\" + blueValue + \")\";\n console.log(bgColor);\n\n document.body.style.background = bgColor;\n}", "title": "" }, { "docid": "6ddc0bd332cd58041d18b7cf91dfede3", "score": "0.5345276", "text": "function oneBlue() {\n $topLeftBlue.css('background-color', 'lightblue')\n}", "title": "" } ]
e4df2c27c9cf52b27b9fa6826d056f23
no distinction between float/time/double except for typespecs f, t, d
[ { "docid": "7952e385001c4b29c0bb403d1e758013", "score": "0.5581223", "text": "function o2ws_get_time() { return o2ws_get_float(); }", "title": "" } ]
[ { "docid": "5d953688631e0ea7c376fc2989a2a5f2", "score": "0.6251005", "text": "function Column_FLOAT() {}", "title": "" }, { "docid": "80b80972611fec34e46776987c520946", "score": "0.60565174", "text": "function _mkf( p ){\n\tif( typeof(p)==\"boolean\" ) return p?1.0:0.0;\n\tif( typeof(p)==\"number\" ) return p;\n\treturn 0.0;\n}", "title": "" }, { "docid": "928cd87df8ac176c0b712cf9217e5db4", "score": "0.6017531", "text": "function mt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "48b97f84105bca2a23e23d50dc775f89", "score": "0.60041106", "text": "function wt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "78c0dc9f46c2dc2dded566d604369c05", "score": "0.59118706", "text": "function parseFloat_(a){return\"string\"==typeof a?parseFloat(a):a}", "title": "" }, { "docid": "1db81e78929099c9b1820b458bc3b7b1", "score": "0.58973706", "text": "function yt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "ec494b1c5ae7d1ad4ae01179b35b268c", "score": "0.58171445", "text": "function St(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "bb542cb03457e933801efbab6385485f", "score": "0.5814193", "text": "function q(e,t){G(\"number\"==typeof e,\"cannot write a non-number as a number\"),G(e>=0,\"specified a negative value for writing an unsigned value\"),G(t>=e,\"value is larger than maximum value for type\"),G(Math.floor(e)===e,\"value has a fractional component\")}", "title": "" }, { "docid": "bd27d2fd0ced0f6b9ee691e4713c1408", "score": "0.5716698", "text": "function V(e,t){$(\"number\"==typeof e,\"cannot write a non-number as a number\"),$(e>=0,\"specified a negative value for writing an unsigned value\"),$(t>=e,\"value is larger than maximum value for type\"),$(Math.floor(e)===e,\"value has a fractional component\")}", "title": "" }, { "docid": "2bf42ac9c02f6a8dc3fd4a4fa0dfff56", "score": "0.5689212", "text": "function is_float(object)\n{\n return object != undefined && object.toFixed != undefined && parseInt(object) != object;\n}", "title": "" }, { "docid": "41bb00d0edbaae5a53f5fa172d79d08e", "score": "0.56891704", "text": "get floatValue() {}", "title": "" }, { "docid": "0e79386a596abda71cbb7f7971eddb80", "score": "0.56805784", "text": "function dt(t) {\n return \"number\" == typeof t && Number.isInteger(t) && !pt(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;\n}", "title": "" }, { "docid": "0cc4535eeb89b152bccf142d659c869f", "score": "0.56715417", "text": "function floatEq(a, b) {\n return a == round(b);\n }", "title": "" }, { "docid": "b17eed7961f4f18c741a4b648e0d46e3", "score": "0.5668971", "text": "static SetFloat() {}", "title": "" }, { "docid": "2d0a61b13e5085a5b6928165ff4e2fcb", "score": "0.5662315", "text": "supportsFloatValues() {\n return true;\n }", "title": "" }, { "docid": "3152cab9fea5983b32697774e783d6ba", "score": "0.5639692", "text": "function isMeasurementValue(value) {\n\t return typeof value === 'number' && isFinite(value);\n\t}", "title": "" }, { "docid": "ef5b3261b5e8855c9248f8ad3416bcd4", "score": "0.56303835", "text": "function Gt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "0c2d9a8f6e8bfe56e4855352b9f58d2b", "score": "0.56271154", "text": "function Dt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? Nt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : d();\n}", "title": "" }, { "docid": "2317401c342036e2f86f312499b8aa4d", "score": "0.5604795", "text": "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([1, 0x7FF00000]);\n } else {\n var bytes = new Uint32Array([0x7FF00000, 1]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "title": "" }, { "docid": "22c1ded582b504679e55c02106849b04", "score": "0.55950856", "text": "function isFloatTD4(valueOfStr, eLength){\r\n\tvar patrn1 = /^([+|-]?[0-9])+(.[0-9]{0,4})?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloatTD4(\"+valueOfStr+\",\"+eLength+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\t\t\r\n\t\t\tvar tlen = valueOfStr.length;\r\n\t\t\tvar dot = valueOfStr.indexOf('.');\r\n\t\t\tvar plus = valueOfStr.indexOf('+');\r\n\t\t\tvar neg = valueOfStr.indexOf('-');\r\n\t\t\tvar rlen = tlen;\r\n\t\t\tif(dot != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\tif(plus != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\tif(neg != -1)\r\n\t\t\t\trlen = rlen - 1;\r\n\t\t\t\t\r\n\t\t\tif(rlen==parseInt(eLength))\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "6ebe7d5ec2af447b594b9a38efe66980", "score": "0.5594866", "text": "function timeStringToFloat(time) {\n var hours = time.getHours();\n var minutes = time.getMinutes();\n return hours + minutes / 60;\n}", "title": "" }, { "docid": "5b6ac5511ff6ab2f626b30568cc26742", "score": "0.5565999", "text": "isFloat(val) {\n return !isNaN(Number(val)) && Number(val) % 1 !== 0;\n }", "title": "" }, { "docid": "664913cb74a0e18abed839c1d6ac44b2", "score": "0.5565148", "text": "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "title": "" }, { "docid": "664913cb74a0e18abed839c1d6ac44b2", "score": "0.5565148", "text": "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "title": "" }, { "docid": "c785a6b612115d27837f6f5be05d3b2a", "score": "0.5564689", "text": "function msg_float(value)\r{\r\tif(inlet == 0)\r\t\tfrequency = value;\r\telse if(inlet == 1)\r\t\tq = value;\r\telse if(inlet == 2)\r\t\tgain = value;\r\t\r\tif(type == \"bandpass\")\r\t\tcalculate_bandpass_coefficients();\r\telse if (type == \"peaknotch\")\r\t\tcalculate_peaknotch_coefficients();\r}", "title": "" }, { "docid": "24f659741112d8ed7f6d44a3345288da", "score": "0.5557345", "text": "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n }", "title": "" }, { "docid": "45d5dac28b578d3e1af72f5f6b7545a2", "score": "0.5530259", "text": "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([0, 0x7FF80000]);\n } else {\n var bytes = new Uint32Array([0x7FF80000, 0]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "title": "" }, { "docid": "6a55824103a2491c978aa6639f61fc80", "score": "0.5512769", "text": "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "title": "" }, { "docid": "2d8410eb0c227c196c473ef03a2a03e1", "score": "0.5504316", "text": "function isFloat(n){\n\t return parseFloat(n.match(/^-?\\d*(\\.\\d+)?$/))>0;\n\t}", "title": "" }, { "docid": "f176e4a8df7d7959ac2948ed0b617b11", "score": "0.54931253", "text": "function q(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return -0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "23cf767a4bf3cbb5fedf45602cc5820c", "score": "0.54917234", "text": "function pF(num) {\n num=parseFloat(num);\n if (typeof num=='number' && isFinite(num)) return num;\n return null;\n }", "title": "" }, { "docid": "c694186528f8415c7caaa4a38b0d00aa", "score": "0.54586667", "text": "function xt(t,e){return null===t||!1===t||void 0===t?S[e]:(\"number\"===typeof t&&(t=String(t)),t=i.format.from(t),t=T.toStepping(t),!1===t||isNaN(t)?S[e]:t)}", "title": "" }, { "docid": "e93e5a5e3f886962daef39a150d7255d", "score": "0.54447526", "text": "function U(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "3fc90df0ecdb5d32388d39e3ddaeeb07", "score": "0.5438014", "text": "function J(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "3350634e637b0cbde9f1825bfe3fa900", "score": "0.5436878", "text": "static GetFloat() {}", "title": "" }, { "docid": "3fa7710e242dd0569fe0ad2992350a15", "score": "0.5436294", "text": "function U(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return -0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "b9c18c12a90fddf8d0f191c5ab5e4b71", "score": "0.5426218", "text": "function isFloat(n) {\n\t\t\t\treturn n === +n && n !== (n | 0);\n\t\t\t}", "title": "" }, { "docid": "287f8af9577bbdc67bf0d8561399abb4", "score": "0.54191357", "text": "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "title": "" }, { "docid": "287f8af9577bbdc67bf0d8561399abb4", "score": "0.54191357", "text": "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "title": "" }, { "docid": "287f8af9577bbdc67bf0d8561399abb4", "score": "0.54191357", "text": "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "title": "" }, { "docid": "974287dadb90b0ebc4c434c237f46d62", "score": "0.5412229", "text": "function validFloat(k) {\n var regex = /^[0-9]*\\.?[0-9]*$/;\n return k.match(regex);\n}", "title": "" }, { "docid": "28da86898fa3d3942672aac5678c8cae", "score": "0.5395721", "text": "function PublicFunction_isFloat(sValue){\r\n if (sValue== null) return false;\r\n var vsValue= this.trim(sValue+ \"\");\r\n var vsResult= \"\";\r\n vsResult= vsValue.replace(this.RE_FLOAT01, \"\");\r\n if (vsResult.length== 0) return true;\r\n vsResult= vsValue.replace(this.RE_FLOAT02, \"\");\r\n if (vsResult.length== 0) return true;\r\n vsResult= vsValue.replace(this.RE_FLOAT03, \"\");\r\n if (vsResult.length== 0) return true;\r\n return false;\r\n}", "title": "" }, { "docid": "f45b14a332f7b1f9094e9f8d7bd6945d", "score": "0.538622", "text": "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "title": "" }, { "docid": "f45b14a332f7b1f9094e9f8d7bd6945d", "score": "0.538622", "text": "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "title": "" }, { "docid": "f45b14a332f7b1f9094e9f8d7bd6945d", "score": "0.538622", "text": "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "title": "" }, { "docid": "f45b14a332f7b1f9094e9f8d7bd6945d", "score": "0.538622", "text": "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "title": "" }, { "docid": "f45b14a332f7b1f9094e9f8d7bd6945d", "score": "0.538622", "text": "function h$isFloat (n) {\n return n===+n && n!==(n|0);\n}", "title": "" }, { "docid": "31a61f10b247548f1b6ec5bc2561d8d2", "score": "0.5372414", "text": "supportsDoubleValues() {\n return true;\n }", "title": "" }, { "docid": "75d5bbddd97ef99b9d88eff94498b95b", "score": "0.5371162", "text": "function enforceFloat() {\r\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d]*$/;\r\n var number = /\\-\\d+\\.\\d*|\\-[\\d]*|[\\d]+\\.[\\d]*|[\\d]+/;\r\n if (!valid.test(this.value)) {\r\n var n = this.value.match(number);\r\n this.value = n ? n[0] : '';\r\n }\r\n}", "title": "" }, { "docid": "b6bde7b91ace364e571eb35ff95f376d", "score": "0.5370597", "text": "function parseF(s) {\n // if (typeof(parseInt(s)) === \"number\"){\n // return parseFloat(s)\n \n // }else{\n // return null\n // }\n \n if ( isNaN(parseFloat(s) )) {\n return null\n } else{\n return parseFloat(s)\n }\n \n \n }", "title": "" }, { "docid": "26e6b70cab1f1ccc109a77a800022b3d", "score": "0.5360113", "text": "function vt(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "275de6df0f5510be45769fb160ec6fbf", "score": "0.5354666", "text": "function isFloat(n) {\n return n === +n && n !== (n | 0);\n}", "title": "" }, { "docid": "2bc82cbda610a2bb3cff592a4e5b7180", "score": "0.53510714", "text": "function ot(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "f0b972e62dc74740b8a10afac376b8e5", "score": "0.5338423", "text": "function isFloat(valueOfStr){\r\n\tvar patrn1 = /^([+|-]?\\d+)(\\.\\d+)?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloat(\"+valueOfStr+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "12031bfa3ba95a26ae9897a2de9113af", "score": "0.53364635", "text": "function t(\n /**\n * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\n */\n t, \n /**\n * The fractions of a second at nanosecond resolution.*\n */\n e) {\n if (this.seconds = t, this.nanoseconds = e, e < 0) throw new T(E.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (e >= 1e9) throw new T(E.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (t < -62135596800) throw new T(E.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n // This will break in the year 10,000.\n if (t >= 253402300800) throw new T(E.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n }", "title": "" }, { "docid": "2173a5a4fe2e715e31a95fbdd91c1cd2", "score": "0.5325022", "text": "function floatFn(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value!==undefined){_rule2[\"default\"].type(rule,value,source,errors,options);_rule2[\"default\"].range(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "2173a5a4fe2e715e31a95fbdd91c1cd2", "score": "0.5325022", "text": "function floatFn(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value!==undefined){_rule2[\"default\"].type(rule,value,source,errors,options);_rule2[\"default\"].range(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "2173a5a4fe2e715e31a95fbdd91c1cd2", "score": "0.5325022", "text": "function floatFn(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value!==undefined){_rule2[\"default\"].type(rule,value,source,errors,options);_rule2[\"default\"].range(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "bd2937aa39f365f65a3374bfc7d1ef1b", "score": "0.53223574", "text": "function le(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "21cebd3b752e695c4be56691c708269d", "score": "0.53212583", "text": "function double(x) {}", "title": "" }, { "docid": "55e7c608c13d89f44a314e66d84de42e", "score": "0.5316936", "text": "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "title": "" }, { "docid": "7b213446ba914385eea3c421409c3ce2", "score": "0.531615", "text": "__get_t(arr_val) {\n if (this.__is_1D_array(arr_val)) {\n const dtypes = []\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n let lim;\n\n //remove NaNs from array\n let arr = []\n arr_val.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n }\n })\n\n if (arr.length < config.get_dtype_test_lim) {\n lim = arr.length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n return dtypes\n\n } else {\n const dtypes = []\n let lim;\n if (arr_val[0].length < config.get_dtype_test_lim) {\n lim = arr_val[0].length - 1\n } else {\n lim = config.get_dtype_test_lim - 1\n }\n arr_val.forEach((ele) => {\n let int_tracker = []\n let float_tracker = []\n let string_tracker = []\n let bool_tracker = []\n\n //remove NaNs from array before checking dtype\n let arr = []\n ele.map(val => {\n if (!(isNaN(val) && typeof val != \"string\")) {\n arr.push(val)\n } else {\n arr.push(\"NaN\") //set NaN to string and return dtype \"\"string\". The caller should explicitly convert the dtype\n }\n })\n\n arr.forEach((ele, indx) => {\n let count = indx\n if (typeof ele == 'boolean') {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(true)\n\n } else if (!isNaN(Number(ele))) {\n\n if (ele.toString().includes(\".\")) {\n float_tracker.push(true)\n int_tracker.push(false)\n string_tracker.push(false)\n bool_tracker.push(false)\n } else {\n float_tracker.push(false)\n int_tracker.push(true)\n string_tracker.push(false)\n bool_tracker.push(false)\n\n }\n } else {\n float_tracker.push(false)\n int_tracker.push(false)\n string_tracker.push(true)\n bool_tracker.push(false)\n }\n\n if (count == lim) {\n //if atleast one string appears return string dtype\n const even = (element) => element == true;\n if (string_tracker.some(even)) {\n dtypes.push(\"string\")\n } else if (float_tracker.some(even)) {\n dtypes.push(\"float32\")\n } else if (int_tracker.some(even)) {\n dtypes.push(\"int32\")\n } else if (bool_tracker.some(even)) {\n dtypes.push(\"boolean\")\n } else {\n dtypes.push(\"undefined\")\n }\n }\n })\n\n });\n\n return dtypes\n }\n }", "title": "" }, { "docid": "b61a6d66f5af22e2b1d3b2f31991452d", "score": "0.5306491", "text": "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? O(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _e(\"Invalid value type: \" + JSON.stringify(t));\n}", "title": "" }, { "docid": "2d85e7d6420999d9ab151a6bb4b6aa99", "score": "0.5305635", "text": "function isFloat(n){ //fonction pour n'avoir que des chiffres.\n return n != \"\" && !isNaN(n) && n !==0;\n}//fin de la fonction", "title": "" }, { "docid": "3555420cb707112bd146592382170a4d", "score": "0.5276611", "text": "function t(t) {\n return \"date\" === t.type || \"esriFieldTypeDate\" === t.type;\n }", "title": "" }, { "docid": "313f81730c23b50c0e6445d43c07bb54", "score": "0.52746946", "text": "function t(\n /**\n * The number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.\n */\n t, \n /**\n * The fractions of a second at nanosecond resolution.*\n */\n e) {\n if (this.seconds = t, this.nanoseconds = e, e < 0) throw new S(_.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (e >= 1e9) throw new S(_.INVALID_ARGUMENT, \"Timestamp nanoseconds out of range: \" + e);\n if (t < -62135596800) throw new S(_.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n // This will break in the year 10,000.\n if (t >= 253402300800) throw new S(_.INVALID_ARGUMENT, \"Timestamp seconds out of range: \" + t);\n }", "title": "" }, { "docid": "6f9a92ad87829dc20aeb92e1a51eff75", "score": "0.5267098", "text": "floatPrecision() {\n return notYetImplemented('floatPrecision');\n }", "title": "" }, { "docid": "9cdd8d861cffe7d8cd90569b962cf65c", "score": "0.52576435", "text": "function isFloat(val) {\n var floatRegex = /^-?\\d+(?:[.,]\\d*?)?$/;\n if (!floatRegex.test(val))\n return false;\n\n val = parseFloat(val);\n if (isNaN(val))\n return false;\n return true;\n}", "title": "" }, { "docid": "636479bb58907a83991d0591238488bb", "score": "0.525712", "text": "function isFloat(n) {\n return n === +n && n !== (n|0);\n}", "title": "" }, { "docid": "1ce46f850f8e8865cb21d5192cc7bf62", "score": "0.52549595", "text": "static get floatingPointNumber() {\n return /([+-]?(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*))(?:[eE]([+-]?\\d+))?/;\n }", "title": "" }, { "docid": "2623fb86ccaa730f793b802fa62ab7ca", "score": "0.52312297", "text": "function pt(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return 0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "292e1d33a637659e8bc618d00c03a5c8", "score": "0.5227252", "text": "function isFloat(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.float.test(value);\n }\n return false;\n}", "title": "" }, { "docid": "1d38cd0f55f7d3742c0a4730449672da", "score": "0.5224762", "text": "function isFloat(str){\n \n if (str=='') {\n return true;\n }\n var reg = /^-?\\d+(\\.\\d{1,2})?$/;\n return reg.test(str);\n}", "title": "" }, { "docid": "43ffc53b38a730372fcbe036bf63629c", "score": "0.5222288", "text": "function nummy(x) { return !isNaN(parseFloat(x)) && isFinite(x) }", "title": "" }, { "docid": "486c7bd77e51c4224067fb9e7f03b594", "score": "0.5220831", "text": "function parseFloat_(s) {\n return validFloatRepr.test (s) ? Just (parseFloat (s)) : Nothing;\n }", "title": "" }, { "docid": "55c776bda2373ad443aeefe3bd9537a5", "score": "0.52176106", "text": "function yt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? ht(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : A();\n}", "title": "" }, { "docid": "609d2cb511969ceb64fc79f1b8377a80", "score": "0.52158386", "text": "function At(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" }, { "docid": "454290da0eb34e7bd7e7ef842468c3ba", "score": "0.5212988", "text": "function fe(t, e, n) {\n return t instanceof pe ? function(t, e) {\n var n = {\n fields: {\n __type__: {\n stringValue: \"server_timestamp\"\n },\n __local_write_time__: {\n timestampValue: {\n seconds: t.seconds,\n nanos: t.nanoseconds\n }\n }\n }\n };\n return e && (n.fields.__previous_value__ = e), {\n mapValue: n\n };\n }(n, e) : t instanceof ye ? ve(t, e) : t instanceof me ? ge(t, e) : function(t, e) {\n // PORTING NOTE: Since JavaScript's integer arithmetic is limited to 53 bit\n // precision and resolves overflows by reducing precision, we do not\n // manually cap overflows at 2^63.\n var n = de(t, e), r = be(n) + be(t.A);\n return vt(n) && vt(t.A) ? ae(r) : ue(t.R, r);\n }(t, e);\n}", "title": "" }, { "docid": "4d6806fe8014bfb839696a3544474b76", "score": "0.521215", "text": "set floatValue(value) {}", "title": "" }, { "docid": "4e6b07b454fce00111e4a5f709278b71", "score": "0.5209934", "text": "function isFloatD4(valueOfStr){\r\n\tvar patrn1 = /^([+|-]?[0-9])+(.[0-9]{0,4})?$/;\r\n\ttry{\r\n\t\t//alert(\"isFloatD4(\"+valueOfStr+\").patrn=\"+patrn1.exec(valueOfStr));\r\n\t\tif (patrn1.exec(valueOfStr)){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t}catch(e){\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "dde7df0d161e1cae6bf6571362d05547", "score": "0.52080745", "text": "function timeStringToFloat(time) {\n var hoursMinutes = time.split(/[.:]/);\n var hours = parseInt(hoursMinutes[0], 10);\n var minutes = hoursMinutes[1] ? parseInt(hoursMinutes[1], 10) : 0;\n return hours + minutes / 60;\n}", "title": "" }, { "docid": "5a2e138f48a12471cee9fcabf2bd40cb", "score": "0.5194599", "text": "function isFloat(val) {\n return (isNumber(val) &&\n Number(val) === val && val % 1 !== 0);\n}", "title": "" }, { "docid": "54227eaf0dabbc5f8473a0256aff4a06", "score": "0.5183052", "text": "function readFloat(){\n checkLen(4);\n var flt = buf.readFloatLE(pos);\n pos += 4;\n return formSinglePrecision(flt);\n }", "title": "" }, { "docid": "70488e2a78a94b01dd48d1d6c20ed34d", "score": "0.51816696", "text": "function u(t){return this.cast(t)}", "title": "" }, { "docid": "f368c29cbf1df078d815df87839aa37f", "score": "0.5179401", "text": "function Fie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}", "title": "" }, { "docid": "0ae370c559478c9f3a1b694ac5e69d84", "score": "0.51788", "text": "someTime (value, decimals) {\n\t\tvar howFast = \"milliseconds\";\n\t\tif (value > 1000) {\n\t\t\tvalue = value/1000;\n\t\t\thowFast = \"seconds\";\n\t\t}\n\t\treturn `${Number(Math.round(value+'e'+decimals)+'e-'+decimals)} ${howFast}.`;\t\n\t}", "title": "" }, { "docid": "250f40182e001378591a9b52c0b00007", "score": "0.5176365", "text": "function floatFn(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* isEmptyValue */])(value)&&!rule.required){return callback();}__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].required(rule,value,source,errors,options);if(value!==undefined){__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].type(rule,value,source,errors,options);__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].range(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "41577618712aab06f183284ed37c8f78", "score": "0.5173321", "text": "function float(num) {\n return num * 0.1 * 10;\n}", "title": "" }, { "docid": "355a070f2736e4536dddb8e9c87b3be9", "score": "0.51686394", "text": "async function d(i){const{attribute:e,features:s}=i,{normalizationType:r,normalizationField:m,minValue:f$1,maxValue:u,fieldType:d}=e,p=await j({field:e.field,valueExpression:e.valueExpression,normalizationType:r,normalizationField:m,normalizationTotal:e.normalizationTotal,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},s),v=m$1({normalizationType:r,normalizationField:m,minValue:f$1,maxValue:u}),c={value:.5,fieldType:d},z=\"esriFieldTypeString\"===d?f({values:p,supportsNullCount:v,percentileParams:c}):d$1({values:p,minValue:f$1,maxValue:u,useSampleStdDev:!r,supportsNullCount:v,percentileParams:c});return V(z,\"esriFieldTypeDate\"===d)}", "title": "" }, { "docid": "bfd19d14caf7dbcadeecdadb5fbed95e", "score": "0.5156175", "text": "function me(t, e) {\n if (t.Qe) {\n if (isNaN(e)) return {\n doubleValue: \"NaN\"\n };\n if (e === 1 / 0) return {\n doubleValue: \"Infinity\"\n };\n if (e === -1 / 0) return {\n doubleValue: \"-Infinity\"\n };\n }\n return {\n doubleValue: at(e) ? \"-0\" : e\n };\n}", "title": "" }, { "docid": "11f903c6defa49a0eebbb416e98bf2bf", "score": "0.51472616", "text": "function H(t) {\n // Detect if the value is -0.0. Based on polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n return -0 === t && 1 / t == -1 / 0;\n}", "title": "" }, { "docid": "93b23e34194e043e435f3716696c24d1", "score": "0.5147185", "text": "function Fmt(x) { \n var v\n if(x>0) { v=''+(x+0.00000001) } else { v=''+(x-0.00000000) };\n return v.substring(0,v.indexOf('.')+8)\n}", "title": "" }, { "docid": "4ef7fe0ba70ee27daaf8f5aad789580f", "score": "0.5145145", "text": "function sortFloat(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "60e985eee8963bc16e91f8513b7d4047", "score": "0.5139291", "text": "function isFloatNum(value) {\r\n if (typeof(value) !== \"string\") value = String(value);\r\n\r\n if (value.includes(\".\")) return true;\r\n return false;\r\n}", "title": "" }, { "docid": "e23ce71d11707879610497431f4c2273", "score": "0.5134391", "text": "function microtime(get_as_float) { \n var now = new Date().getTime() / 1000; \n var s = parseInt(now); \n return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + \" \" + s; \n}", "title": "" }, { "docid": "e1295dc4b6d9bb8e3daa4981fad0bc95", "score": "0.51299274", "text": "function SimpleFloat(significand, exponent) {\n this.significand = significand;\n this.exponent = exponent;\n}", "title": "" }, { "docid": "27f3b9d4d1fd66246cf5052ac9da8f81", "score": "0.5128006", "text": "function checkIfFloat(value) {\n return Number(value) === value && value % 1 !== 0;\n }", "title": "" }, { "docid": "790cf74da936b3fd5c43612df9613b19", "score": "0.51219386", "text": "function cT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}", "title": "" }, { "docid": "c9fb798147aa4082710a8eb268ca1660", "score": "0.51214695", "text": "convertValue(value) {\n if (this.dtype == null || this.dtype === 'float32') {\n return value;\n }\n return Math.round(value);\n }", "title": "" }, { "docid": "1ec2db43df742f813a0292e7d620a772", "score": "0.5094465", "text": "function gt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "title": "" } ]
b6723aaf733be36c0f3e6a9142e2fadc
:personaId/:field/:elementId delete persona array field element
[ { "docid": "36d2036b6e54d89501879f1868e0f97b", "score": "0.7964434", "text": "async function deleteArrayElement(personaId, field, elementId) {\n const Model = mongoose.model(type);\n let persona = await Model.findById(personaId);\n if (!Array.isArray(persona[field])) return Promise.reject(\n new InvalidRequestError('Trying to delete an array element of a non-array field'));\n persona[field].remove(elementId);\n\n persona = await persona.save();\n\n return persona;\n}", "title": "" } ]
[ { "docid": "655fd6381486c52886a4e759d506d692", "score": "0.7683975", "text": "async function deleteField(personaId, field) {\n const Model = mongoose.model(type);\n let persona = await Model.findById(personaId);\n //const oldValue = _.cloneDeep(persona[field]);\n\n if (Array.isArray(persona[field])) persona.set(field, []);\n else persona.set(field, undefined);\n persona = await persona.save();\n return persona;\n}", "title": "" }, { "docid": "af682938440a5020f87a72daeba0a858", "score": "0.74604535", "text": "async function reqDeleteArrayElement(req, res) {\n const persona = await deleteArrayElement(\n req.params.personaId,\n req.params.field,\n req.params.elementId,\n );\n return res.json(persona);\n}", "title": "" }, { "docid": "1c3bf6605797a247119e171bc39cf95e", "score": "0.70169157", "text": "function department_delete_field(field_obj)\n{\n\tvar oldarray = this.field_array;\n\n\tvar newarray = new Array();\n\n\tfor(var i=0; i<oldarray.length; i++)\n\t{\n\t\tvar arrfield = oldarray[i];\n\n\t\tif(arrfield.id!=field_obj.id)\n\t\t{\n\t\t\tnewarray[newarray.length] = arrfield;\n\t\t}\n\t}\n\n\tthis.field_array = newarray;\n}", "title": "" }, { "docid": "c57e4c605748317f6b367ce3b12b74da", "score": "0.6502643", "text": "function delPersona(event){\n\tlet inputName = event.target.name;\n\tidButtonEvent = inputName.split(\"-\")[1];\n\n\tajaxQuery('http://localhost:3000/personas/', idButtonEvent, 'updateTableBorrar', 'DELETE');\n}", "title": "" }, { "docid": "4f59b6bbac43fd763fff285f0b324ca3", "score": "0.63624454", "text": "async function reqDeleteField(req, res) {\n const persona = await deleteField(\n req.params.personaId,\n req.params.field,\n );\n return res.json(persona);\n}", "title": "" }, { "docid": "db3a9d1b9ce82699a23d1a69405c6f7f", "score": "0.63259494", "text": "function removeElement(field_array, child_index) {\n let arr = [...objectValues[field_array]];\n arr.splice(child_index, 1);\n dispatch({\n type: \"SET_FORM_OBJECT\",\n form_object: {\n ...objectValues,\n [field_array]: arr,\n },\n });\n }", "title": "" }, { "docid": "ba01395b11afc6ecdc7f9a5274b47591", "score": "0.62784725", "text": "function EliminarEspecialidadDeDocente(id) {\n especialidadesSeleccionadas.splice(id, 1);\n ListarSeleccionados();\n\n console.log(\"FUNC ELIMINAR ESP DOC\");\n console.log(especialidadesSeleccionadas);\n}", "title": "" }, { "docid": "a6673f47fd49556951553f1d749b8e4c", "score": "0.62190783", "text": "deleteField(fieldValueId) {\n //this.metadataSets[metadataSetId].Fields.$values.splice(fieldId, 1);\n //this.setOriginalFields();\n let indexToRemove = this.fieldData.ValueIds.indexOf(fieldValueId);\n this.fieldData.ValueIds.splice(indexToRemove, 1);\n\n delete this.fieldData.ValueGroups[fieldValueId]\n \n console.log(this.fieldData);\n }", "title": "" }, { "docid": "a8477251b99966f8da15eaca4b313f4c", "score": "0.61972785", "text": "function DeleteThis(){\n\tvar _id = datos.getAttribute(\"data-MemberId\");\n\tvar p = ent.persons.filter(x => x._id == _id)[0]\n\tp.task = \"delete_one\"\n trySaveData()\n}", "title": "" }, { "docid": "555be41bc425e9f8a4783df7618db8c8", "score": "0.61258835", "text": "function deleteEmployee (row) {\n\n //get the employees array index from the row id and remove the employee from the array\n let employeeIndex = Number(row.prop('id').slice(6)); //removes empRow and converts to a number\n employees.splice(employeeIndex, 1);\n\n //delete the row from the table on the DOM\n $(row).remove();\n}", "title": "" }, { "docid": "c2462d6ced340401e6cb6c7682e46a32", "score": "0.60573906", "text": "function deleteField(field, vraSetName) {\n //id of field\n var btnId = field.attr(\"id\");\n\n //button id prefix (without index)\n var btnIdPrefix = \"multiresimage_delete_\" + vraSetName + \"Set_display_\";\n\n //to get index number\n var beginIndex = btnId.lastIndexOf(\"_\") + 1;\n var fieldIndex = btnId.substring(beginIndex);\n\n //text field id prefix\n var txtIdPrefix = \"multiresimage_\" + vraSetName + \"Set_display_\";\n var txtId = txtIdPrefix + fieldIndex;\n\n //remove button\n $('input[id^=' + btnId + ']').remove();\n\n //remove text box\n $('input[id^=' + txtId + ']').remove();\n\n //update index numbers for each index after the deleted row (example value[2] becomes value[1] if value[1] was deleted)\n var numFields = $('input[id^=' + btnIdPrefix + ']').length;\n fieldIndex++;\n for(i=fieldIndex; i <= numFields; i++){\n updateBtnId = btnIdPrefix + (i);\n newBtnId = btnIdPrefix + (i-1);\n\n updateTxtId = txtIdPrefix + (i);\n newTxtId = txtIdPrefix + (i-1);\n\n $('input[id=' + updateBtnId + ']').attr(\"id\", newBtnId);\n\n $('input[id=' + updateTxtId + ']').attr(\"id\", newTxtId);\n }\n}", "title": "" }, { "docid": "01ab8e966df7020214b828ad7d327ef5", "score": "0.60497767", "text": "async function deletePersona(personaId) {\n const Model = mongoose.model(type);\n const mongooseEntity = await Model.findByIdAndRemove(personaId);\n\n const persona = mongooseEntity._doc;\n return persona;\n}", "title": "" }, { "docid": "ecb6edc8c55fbb68352e5836aba09f70", "score": "0.602175", "text": "function deletUserByID() {\n \n let id_no = document.getElementById('id_tobe_deleted').value\n personArr = personArr.filter(data => {\n return data.id !== id_no\n\n })\n\n}", "title": "" }, { "docid": "e4caa8150e63453fb6e1d4cd91f2480e", "score": "0.6018942", "text": "function deleteContact(element){\n\t\t\t\tvar test = element.getAttribute(\"data-key\");\n\t\t\t\tvar contNo = new contactNumber('output');\n\t\t\t\tcontNo.deleteContact(test);\n\t\t}", "title": "" }, { "docid": "657fe21bbddf04c77c826f4908bdb80d", "score": "0.60018915", "text": "function deleteRecord(id) {\r\n var elemIndex = id.split(\"-\")[1];\r\n objs.splice(elemIndex, 1);\r\n sortIfTableSorted();\r\n setTableRows();\r\n createDullDiv();\r\n}", "title": "" }, { "docid": "e7b2643c79151311d8ef07783038fcb0", "score": "0.59772605", "text": "function deleteQuestion(id, field) {\n\n let str = \"../api/RealTimeQuestion/put/?Qid=\" + id + \"&field=\" + field;\n ajaxCall(\"PUT\", str, \"\", render, error);\n\n}", "title": "" }, { "docid": "06348dd3d9240ddc8a9cde2b6fa29ee3", "score": "0.5941084", "text": "function delElement(a) {\n prodNames.splice(a, 1);\n qTyp.splice(a, 1);\n prodPrice.splice(a, 1);\n diplayCart();\n \n}", "title": "" }, { "docid": "343c4e39f3821473de87850737958665", "score": "0.5939131", "text": "function deleteData(element) {\n let id = getId(element);\n let updatedArray = dataArray.filter((data) => data.id !== id);\n reRender(updatedArray);\n dataArray = updatedArray;\n saveOnStorage(storageKey, dataArray);\n}", "title": "" }, { "docid": "809107338bac9800d378d3381e1448b0", "score": "0.587295", "text": "function eliminarElemento(element) {\n \t dataObj = jQuery(element).data();\n \tconst newEntities = eliminarDesdeTabla(dataObj.entity, dataObj.id);\n \trenderizarTablaRideEjemplo(dataObj.entity, newEntities);\n }", "title": "" }, { "docid": "1027486c1ac796e23f92fc8a216f2474", "score": "0.5869409", "text": "function remove(miruta, arrayjson){\n $.ajax({\n url : \"index.php\",\n method : \"POST\",\n data : {\n ruta : miruta,\n accion:'dodelete',\n id : arrayjson\n },\n dataType:'json'\n }).done(function(msg){\n createTable(msg);\n resetControles();\n });\n }", "title": "" }, { "docid": "37962b57fdd9fea37508ed7eef80dcd1", "score": "0.58563787", "text": "remove(array, element) {\n const index = array.findIndex(d => d.matchId === element.matchId);\n\n if (index === -1) return;\n\n array.splice(index, 1);\n }", "title": "" }, { "docid": "bd14aa3dae971ea16402fe25eea96c21", "score": "0.58467543", "text": "function dict2dictRemoveField (idfield)\n//удаляет поле формы dic2dict, сиречь удаляет у формы div с id=idfield\n//idfield - айди поля формы\n{\nvar element = document.getElementById(idfield);\nelement.parentNode.removeChild(element);\n}", "title": "" }, { "docid": "ec677887f25bdd8afbd6f9e7d83e7b38", "score": "0.5846372", "text": "function deleteActor(){\n var id_actor = document.getElementById(\"id_actor\").value;\n var actor = '{\"id\":'+id_actor+'}'; \n deleteData('api/actor/'+id_actor, actor, \"DELETE\");\n}", "title": "" }, { "docid": "b757d0588de0566f82d3dac2808ec098", "score": "0.58283436", "text": "function deleteRegistro(elementDel, elementAdd, BASE_URL) {\n\n var idPrograma;\n var json;\n var idPerfil;\n\n if (document.getElementById('perfil')) {\n idPerfil = document.getElementById('perfil').value;\n }\n\n idProgDel = document.getElementById(elementDel);\n descProgDel = document.getElementById(idProgDel.value);\n // Elemento pra Adicionar, ID e Valor do Option\n adicionaRegistro(elementAdd, idProgDel.value, descProgDel.innerHTML);\n\n idPrograma = idProgDel.value;\n\n if (document.getElementById('perfil')) {\n json = '{\"dados\": {\"indices\":[' + idPrograma + '], \"id_perfil\":' + idPerfil + '}}';\n\n saveAjax(BASE_URL + '/auth/programas-perfis/save', json);\n saveAjax(BASE_URL + '/auth/programas-perfis/delete', json);\n }\n\n //Remove o Registro da tabela em que esta\n descProgDel.parentNode.removeChild(descProgDel);\n}", "title": "" }, { "docid": "82abf3eb3ee47596a739257af81e0c60", "score": "0.58058536", "text": "function deletePartner() {\n const partnerField = document.getElementById(\"partner\");\n\n if (partnerField != null) {\n Form.removeChild(partnerField);\n }\n}", "title": "" }, { "docid": "7eec6b640d8c8774f4245e12911ff979", "score": "0.57895094", "text": "function removeContact(i) {\ndocument.getElementById('contacts').deleteRow(i);\n\n} // end delete Contact function", "title": "" }, { "docid": "f201e485decb434aedd5ddb81fe12123", "score": "0.5787001", "text": "function DeleteRowFunction(x) {\n console.log(x)\n personArr = personArr.filter(data => {\n console.log(data)\n console.log(typeof (data.ID), typeof (x))\n return parseInt(data.id) !== x;\n })\n // event.target will be the input element.\n var td = event.target.parentNode;\n var tr = td.parentNode; // the row to be removed\n tr.parentNode.removeChild(tr);\n}", "title": "" }, { "docid": "a891a72e5d509a6b404325afcc72914d", "score": "0.5785011", "text": "del(query) {\n\n let objects = this.get_by_query(query)\n\n for (var obj of objects) {\n\n // Find current index of the field (if not defined)\n let i = obj.i !== undefined ?\n obj.i : obj.p.indexOf(obj.v)\n\n if (i !== -1) {\n this.tv.$delete(obj.p, i)\n }\n\n }\n\n this.update_ids()\n }", "title": "" }, { "docid": "b5ccbb35d59028622943ac2352ed597f", "score": "0.57844126", "text": "function removeEmployed(id, fn) {\n docClient.delete({\n TableName: config.DDB_EMPLOYED_TABLE,\n Key: {\n employeeId: id\n },\n ConditionExpression: 'attribute_exists (employeeId)'\n }, fn);\n}", "title": "" }, { "docid": "563ef8a72398f93f89dfd5cfc91c3a03", "score": "0.57734865", "text": "function deleteSelectedPerson(id) {\n\tvar person = findPersonById(id);\n\tvar index = persons.indexOf(person);\n\tpersons.splice(index, 1);\n\tbindTable();\n}", "title": "" }, { "docid": "1b76559a79aca2bbc8b4a849e2ffa8c0", "score": "0.5743642", "text": "function deletePartOfCode(index)\n{\ndocument.forms['ModelAddClauseForm'].partOfCode[index-1].value=\"\";\ndocument.forms['ModelAddClauseForm'].partOfSeqNo[index-1].value=\"\";\ndocument.forms['ModelAddClauseForm'].partOfclaSeqNo[index-1].value=\"\";\n\n}", "title": "" }, { "docid": "171c230d0f5951c1cd461a2914389da9", "score": "0.5740123", "text": "function ogs_array_dropElement(arr, name, nameid)\r\n{\r\n\tfor (var i = 0; i < arr.length; i++)\r\n\t{\r\n\t\tif (arr[i][nameid] == name)\r\n\t\t{\r\n\t\t\tarr.splice(i,1);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "70b03781d96f6f199d626fc54cc434b7", "score": "0.57360685", "text": "delPerson(fname, lname){\n var ch = 0, flag=false ;\n for (let i = 0; i < this.addressbook.AddressBook.length; i++) {\n if (this.addressbook.AddressBook[i] == null) {\n continue;\n }\n if (fname == this.addressbook.AddressBook[i].FirstName && lname == this.addressbook.AddressBook[i].LastName) {\n ch = i;\n flag =true;\n break;\n }\n }\n\n if (flag) {\n delete this.addressbook.AddressBook[ch];\n this.saveData();\n return 'Entry Deleted from the file'\n }\n else{\n console.log('Entry not found in address book......'); \n return 'Entry not found in address book......'\n }\n }", "title": "" }, { "docid": "8f3e81e2c28692195b3d45fdc080fecf", "score": "0.5732225", "text": "function deleteById(host,port,db,collec,id,field,callback){\n\n var url = config.mongoURL+host+':'+port+'/'+db;\n\n var array = [],i=0;\n \n // Use connect method to connect to the Server\n MongoClient.connect(url, function (err, mongo) {\n if (err) {\n logger.error(err.message);\n callback(err);\n } \n else {\n var ObjectId = require('mongodb').ObjectID; \n var o_id = ObjectId(id);\n\n var collection = mongo.collection(collec);\n\n collection.remove({_id:o_id}, function (err, numUpdated) {\n if (err) {\n logger.error(err.message);\n callback(err);\n } \n else if (numUpdated) {\n callback(null,\"ok\");\n } \n else {\n logger.error(\"No collection updated\");\n callback(null,null);\n }\n //Close connection\n mongo.close();\n });\n }\n });\n}", "title": "" }, { "docid": "c92d7811b6d0f000b1f969e4390eab86", "score": "0.5730576", "text": "function click_delete(protAccess)\n{\n \n var table = document.getElementById('table_cazy');\n protAccess = protAccess.id.split('input_');\n delete_prot_access(protAccess[1]);\n var line = document.getElementById('line_' + protAccess[1]);\n table.deleteRow(line.rowIndex);\n}", "title": "" }, { "docid": "6c0a26d1889e2ebe3f7a3ab606d2963d", "score": "0.57303005", "text": "function deleteContact(arr){\n var idMatch = readlineSync.question('what id you are want to delete ?:');\n var id = parseInt(idMatch);\n var result = arr.find(function(contact){\n return contact.id === id;\n });\n arr.splice(result.id-1 ,1);\n fs.writeFileSync('./data.json',JSON.stringify(data));\n return result;\n}", "title": "" }, { "docid": "a11886dbb7da45215f75805f5a8d2357", "score": "0.570091", "text": "removeValidationRequest(array, key, value) {\n //find the array position of the object to be removed and use slice to remove\n array.splice(module.exports.findObjectByKey(array, key, value), 1);\n }", "title": "" }, { "docid": "7c10d385da0a11c5af9e2c3e6a1d0700", "score": "0.56725156", "text": "function DeleteInput(id_el) {\n var id_del_el = document.getElementById(\"dh4_zag_input_2\" + id_el);\n\n id_del_el.parentNode.removeChild(id_del_el);\n\n mas_input[mas_input.indexOf(id_el)] = -1;\n //ind_input--;\n }", "title": "" }, { "docid": "a4c79d95d640a21ae1cd38faf632fb66", "score": "0.5663829", "text": "function del()\r\n{\r\n var pno=document.getElementById(\"pno\").value;\r\n var zi=document.getElementById(\"zi\").value;\r\n for(var i=0;i<getData.personalData.length;i++)\r\n {\r\n if(getData.personalData[i].phoneNumber==pno)\r\n {\r\n if(getData.personalData[i].zip==zi)\r\n {\r\n delete getData.personalData[i];\r\n break;\r\n }\r\n }\r\n }\r\n print();\r\n}", "title": "" }, { "docid": "141b1d3f0bf766b9e1bb172019cc0c02", "score": "0.56499803", "text": "function deleteElement(element) {\n\tmanager.deleteElement(element);\n}", "title": "" }, { "docid": "7b54486158e3a605077a11dcc3ba73e0", "score": "0.5635469", "text": "function removeField(element, item) {\n element.up(item).remove();\n}", "title": "" }, { "docid": "f983fa40acad2d0c74cb18aef84c2e92", "score": "0.5628356", "text": "function deleteImageElement(req){\n deleteElement(dataTable_images,'#image_'+req.request.data);\n updateImageSelect();\n}", "title": "" }, { "docid": "75cc5be55a8d70082a10f4570919c339", "score": "0.5613407", "text": "function removeElementByIndex(value,arr){\r\n return arr.filter(function(val){\r\n return val.servicioId!=value;\r\n })\r\n}", "title": "" }, { "docid": "5478c18baef4aaa1701006a3ecf5c9b1", "score": "0.5609646", "text": "function deleteEmployee() { //This removes the employee from the array then repopulates the table\n let deleteID = $(this).attr('id').split(' ')[1]; //allows me to compare the unique employeeID being clicked for deletion to the employeeID numbers in the array\n for (let i = 0; i < employeeArray.length; i++) {\n if (employeeArray[i].employeeID === deleteID) {\n employeeArray.splice(i,1); //YESSSSS FINALLY GOT IT TO WORK!!!! Deleting array items should be easier like idk array.delete[i]...CMON!\n } \n }\n displayEmployees();\n}", "title": "" }, { "docid": "c6a929bd5fe80f1af6e2cb66059e46bd", "score": "0.55982363", "text": "function deleteElement(eid)\r\n{\r\n\tlet element = document.querySelector(\"#element-\" + eid);\r\n\telement.parentNode.removeChild(element);\r\n} // deleteElement()", "title": "" }, { "docid": "5db7d018df6c03ea77f5c39cddae0d91", "score": "0.55907565", "text": "function removeId(id, update, field, isArray) {\n if (isArray) {\n if (!update.pull) update.pull = {};\n if (!update.pull[field]) update.pull[field] = [];\n update.pull[field].push(id);\n return;\n }\n\n if (!update.replace) update.replace = {};\n update.replace[field] = null;\n}", "title": "" }, { "docid": "063056f297aaec35470fb7f9c161210f", "score": "0.5582262", "text": "deleteAgenda() {\n\t\t\t\tconst store = getStore();\n\t\t\t\tmyFetch(store.baseURL, \"/agenda/\" + store.agendaName, \"DELETE\", null).then(data => {\n\t\t\t\t\tlet arrayCopy = [...store.agendas];\n\t\t\t\t\tlet arrayPos = arrayCopy.findIndex(item => item === store.agendaName);\n\t\t\t\t\tarrayCopy.splice(arrayPos, 1);\n\t\t\t\t\tsetStore({ agendas: arrayCopy });\n\t\t\t\t\tlet blank = [];\n\t\t\t\t\tsetStore({ agendaName: \"\" });\n\t\t\t\t\tsetStore({ contacts: blank });\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "3dd21c7f1ea5d67641afc275bcb3feac", "score": "0.557736", "text": "function deleteSkill(a) {\t\n\trecordnumber = a\n}", "title": "" }, { "docid": "8dc4f2c15e470ddbd2c416c01daded24", "score": "0.5572344", "text": "function removeCustom(id) {\n event.preventDefault();\n console.log(id + \"removeed\")\n document.getElementById(\"Param\" + id).remove();\n customParamCount--;\n\n}", "title": "" }, { "docid": "ed86122cc82fccc04ae1cfcc445570eb", "score": "0.55712324", "text": "function modelDeleteVisitor(id) {\r\n console.log(id);\r\n for (i = 0; i < visitors.length; i++) {\r\n if (visitors[i].id == id) {\r\n visitors.splice(i, 1);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b27b60f9e3a0f2f846ea856bffbe6021", "score": "0.55673754", "text": "function deleteSubmissionbyName(array, name){\n \n let index = array.findIndex(namer => namer.name === name);\n return array.splice(index, 1);\n \n}", "title": "" }, { "docid": "9a7f12355b9a1a74709f0d2d99ed19a4", "score": "0.55447406", "text": "function ajaxDelete (idElement) {\n ajaxPost(urlRouterModel,'controller=' + controller + '&request=delete&value=' + idElement, ajaxList);\n}", "title": "" }, { "docid": "870c41ad88041862391df541f915eaf7", "score": "0.55411893", "text": "function removePatientIntoMongo(p) {\n connexionBD();\n console.log(\"Suppression d'un patient : \" + p.secuId);\n PatientModel.remove({ secuId: p.secuId });\n}", "title": "" }, { "docid": "426a8cd019fed6b516b2bdc63aa8726d", "score": "0.55379", "text": "function deleteFieldFromForm (formId, fieldId) {\n var deferred = $q.defer();\n $http\n .delete(\"/api/assignment/form/\" + formId + \"/field/\" + fieldId)\n .success(function (response) {\n deferred.resolve(response);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "eeeed658e9b7887233c73b483c6f70b8", "score": "0.55376905", "text": "delete(t) {\n const e = this.field(t.popLast());\n Mt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];\n }", "title": "" }, { "docid": "6e0ba9e8fc3720e1e6dc5679206b1ccd", "score": "0.5525308", "text": "delete() {\n apiCall.get(`/section/delete/${this.state.id}`, deleteOptions, (err, res, body) => {\n this.changeID({\n value: null\n });\n this.fetchAll();\n });\n }", "title": "" }, { "docid": "874c1242bc7d106fa93fcc8fcce42824", "score": "0.55194867", "text": "deleteRecord(row) {\r\n // const { id } = row;\r\n // const index = this.findRowIndexById(id);\r\n // if (index !== -1) {\r\n // this.records = this.records\r\n // .slice(0, index)\r\n // .concat(this.records.slice(index + 1));\r\n // }\r\n }", "title": "" }, { "docid": "3e5e5ce0565454c7740b5839bc82c5ea", "score": "0.5517862", "text": "function removeSourceData(dataLabelArray, sourcedataId){\n if (document.getElementById(sourcedataId).value != null && document.getElementById(sourcedataId).value != \"\") {\n jsonParams = JSON.parse(document.getElementById(sourcedataId).value)\n oriData=jsonParams.SOURCE_DATA\n //remove entries based on param_label\n console.log('ToDelete: '+ dataLabelArray.map(function(item){return item.split('@')[2]}))\n //console.log('oriData')\n //console.log(oriData)\n dataLabelArray.map(function(item){return item.split('@')[2]}).forEach(element => {\n delIndx=oriData.map(function(e) { return e.builder_label; }).indexOf(element,0) //index of element matching param_label\n if (delIndx>-1){\n console.log('Deleting:'+element +' at Index:' +delIndx)\n oriData.splice(delIndx,1)\n }else{\n console.log('Element: '+element +' not found')\n }\n });\n \n jsonParams.SOURCE_DATA = oriData//set to the unique values\n console.log(jsonParams.SOURCE_DATA)\n document.getElementById(sourcedataId).value = JSON.stringify(jsonParams) \n }\n}", "title": "" }, { "docid": "e55a8fce9026a591d667d8804380eb47", "score": "0.5517285", "text": "function deletePokemonFromTableAndDB(event) {\n const element = event.target;\n event.preventDefault();\n deletePokemon(element.attributes[\"data-id\"].value);\n const row = element.parentNode.parentNode;\n row\n .parentNode\n .removeChild(row);\n}", "title": "" }, { "docid": "d2c9325a12de5d7e27bf733eda9379a7", "score": "0.5515846", "text": "function DeletePerson(id){\n if(confirm(\"Are you sure you want to delete this person?\")){\n var item = search(id, ent.persons) // alert(JSON.stringify(item))\n item.task = \"delete_one\"\n trySaveData()\n reloadMarkers()\n }\n}", "title": "" }, { "docid": "e416654ea5199f848b0e949ee4eda2b9", "score": "0.5504922", "text": "delete(val){\n let location = this.members.indexOf(val);\n this.members.splice(location, 1);\n }", "title": "" }, { "docid": "072ee1dba9d0e45e285dc1b8a7f113c6", "score": "0.5501287", "text": "function deleteRow(rowid) \n{ \n\tconsole.log(rowid);\n var row = document.getElementById(rowid);\n var table = row.parentNode;\n while ( table && table.tagName != 'TABLE' )\n table = table.parentNode;\n if ( !table )\n return;\n table.deleteRow(row.rowIndex);\n axios.post('deletecontact',{cid: rowid});\n}", "title": "" }, { "docid": "ce86d6e266c6a18bb68fca1655c172f1", "score": "0.5493204", "text": "function deleteOreos(elem){\n for (var i = 0; i < elem.length; i++) {\n if (elem[i] === `oreos`) {\n elem.splice(i, 1);\n }\n }\n}", "title": "" }, { "docid": "fe3ef96de86f46b61a47568c53c7b841", "score": "0.5491145", "text": "function remove(btn) {\n console.log(btn);\n console.log(\"intram\");\n // e.preventDefault();\n var fieldNum;\n if (btn.id.length === 7) {\n fieldNum = btn.id.charAt(btn.id.length - 1);\n console.log(fieldNum);\n } else {\n var unitati = btn.id.charAt(btn.id.length - 1);\n var zecimala = btn.id.charAt(btn.id.length - 2);\n fieldNum = zecimala.concat(unitati);\n console.log(fieldNum);\n }\n\n var fieldID = \"#field\" + fieldNum;\n $(btn).remove();\n $(\"#value\" + fieldNum).remove();\n\n\n $(fieldID).remove();\n}", "title": "" }, { "docid": "7801bd2992c160a44de7856476d65235", "score": "0.54897344", "text": "function dac_deleteCuentaRelacionada(id, nextCadena){\n\t\"use strict\";\n\tvar elemento\t=\tdocument.getElementById('rutcuenta'+nextCadena);\n\telemento.parentNode.removeChild(elemento);\n}", "title": "" }, { "docid": "ee2060702ca7babd5a598a567df0f4c9", "score": "0.5479654", "text": "delete(element) {\n // implement\n }", "title": "" }, { "docid": "ad1cdab7d742c723c04c51f51f2f97f7", "score": "0.54762024", "text": "function deleteSubmissionByName(array, studentName) {\n const removeIt = \n array.findIndex(function(findIt){\n return findIt.name === studentName;\n });\n array.splice(removeIt,1);\n}", "title": "" }, { "docid": "73ea35da6e17201fadaf2cbd7a2412b8", "score": "0.5467821", "text": "removeName(index, fieldType) {\n fieldType.splice(index, 1);\n }", "title": "" }, { "docid": "cbe7f8176e4b8e5934e31429d3b023e1", "score": "0.546375", "text": "function hostrecords_deleteaddress(row)\n{\n id = row.id.split(\"_\");\n $(\"#hosttype_CT_\"+id[1]).remove();\n $(\"#hostname_CT_\"+id[1]).remove();\n $(\"#s2id_hosttype_CT_\"+id[1]).remove();\n $(\"#hostaddress_CT_\"+id[1]).remove();\n $(\"#CT_\"+id[1]+\"_hostdelete\").remove();\n $(\"#hostdivider_CT_\"+id[1]).remove();\n\n $('#CTT_'+id[1]).remove();\n $('span[for=\"CTT_'+id[1]+'\"]').remove();\n}", "title": "" }, { "docid": "f18e7ee5ebec3c46461248e200be565f", "score": "0.545717", "text": "function deleteProp(elem, propFunc, propIndex, indexInProp, preventDefault) {\n return changeProp(elem, propFunc, propIndex, null, remove(indexInProp), preventDefault, ['remove', indexInProp]);\n}", "title": "" }, { "docid": "a373e4be25ef57a5f2b6f177de8893ad", "score": "0.5455441", "text": "deleteElement(evt) {\n this.collection.remove(this._getId(evt));\n }", "title": "" }, { "docid": "5b86a4687be6794012f90a5d14314d71", "score": "0.5455331", "text": "function f(e,t){t.excludeId&&(\"function\"==typeof e.$__setValue?delete e._doc._id:delete e._id)}", "title": "" }, { "docid": "e4964c9bd98c2a9c2be4d36080e84dba", "score": "0.544034", "text": "function deleteElementInsumo(datos1){\n // console.log(datos1);\n // console.log(arregloInsumos);\n var a = 0;\n var tamano = arregloInsumos.length;\n while (tamano>a) {\n if (arregloInsumos[a][\"contadorIns\"]==datos1) {\n arregloInsumos.splice(a,1);\n }\n a++;\n \n }\n //console.log(arreglo1);\n dibujarTablaInsumo(arregloInsumos);\n}", "title": "" }, { "docid": "a4908b12776525daba921e3e78440a10", "score": "0.54316247", "text": "function h(e,t){t.excludeId&&(\"function\"==typeof e.$__setValue?delete e._doc._id:delete e._id)}", "title": "" }, { "docid": "a4908b12776525daba921e3e78440a10", "score": "0.54316247", "text": "function h(e,t){t.excludeId&&(\"function\"==typeof e.$__setValue?delete e._doc._id:delete e._id)}", "title": "" }, { "docid": "60b4e4a6d294882c70607bf27c3c12ec", "score": "0.54306835", "text": "function deleteEntry(elemId) {\n var filename = elemMap[elemId];\n delete elemMap[elemId];\n delete fileMap[filename];\n }", "title": "" }, { "docid": "b5f187fbf3ab474af6b19bf352a72886", "score": "0.5423363", "text": "removeAt(idx) {\n this.records.splice(idx, 1);\n\n // Change ref index of every subsquent doc\n for (let i = idx, len = this.size(); i < len; i += 1) {\n this.records[i].i -= 1;\n }\n }", "title": "" }, { "docid": "c74bc3c5a658addf656d65a943a35d9f", "score": "0.5418136", "text": "deletePerson(id) {\n const deletedPerson = this.getPerson(id);\n this.people = this.people.filter((person) => person.id !== id);\n return deletedPerson;\n }", "title": "" }, { "docid": "9b43eb74c7c340d6610bedbd9f134f6b", "score": "0.541705", "text": "function deleteEmployeeInfo( ){\n console.log( ' in delete function');\n \n for ( let person of employees ){\n if( parseInt( person.id ) === $( this ).data( 'id' ) ){\n employees.splice(employees.indexOf(person), 1);\n }// check if delete employee matches in array\n }// end for loop\n\n // this works as well. Which way is better attr or data...data is private I think\n // for( let person of employees ){\n // if( person.id === $( this ).attr( 'data-id' ) ){\n // employees.splice( employees.indexOf( person ), 1 );\n // }// check if delete employee matches in array\n // }// end for loop\n // recalculate costs\n calcCosts( );\n //update DOM after deletion\n displayInfo();\n}// end deleteEmployeeInfo function", "title": "" }, { "docid": "a2189408285fa6c42a683ec907d0bdc6", "score": "0.5412218", "text": "remove(element) {\n let i = this.items.findIndex(item => item.pid == element.pid);\n this.items.splice(i,1);\n }", "title": "" }, { "docid": "975c0911598223dbcf3786e10a32007a", "score": "0.5411641", "text": "removeEmployerItem(employerDataItem) {\n var index = Tools.arrGetIndexOf(this.modal.selectedEmployersHiddenInput.value, 'id', employerDataItem.id);\n this.modal.selectedEmployersHiddenInput.value.splice(index, 1);\n }", "title": "" }, { "docid": "9d5b86c8705b71967a98f20b2977bae3", "score": "0.5409066", "text": "function removeElement(id) {\n\tif (id.indexOf(\"o\") != -1) {\n \t\t//it is an old element ,so it should be record and used in save/update function when ajax request is post .\n\t\tdeleteElementArray.push(id);\n\t} else {\n\t}\n \t//remove it from page\n\t$j('#' + id).remove();\n\t\n\t//validate nums\n\tif(promoType == \"shoppingcartPromotion\" | promoType == \"couponPromotion\" ){\n\t\tvalidateEligibilityNums();\n\t\tvalidateConditionNums();\n\t\tvalidateActionNums();\n\t}else{\n\t\tvalidateConditionNums();\n\t\tvalidateActionNums();\n\t}\t\n}", "title": "" }, { "docid": "85f52bf96e9d538cb36e796a7cb16a44", "score": "0.54088527", "text": "function deleteElement(){\n value = document.getElementById('element').value;\n array = getArray();\n if(array.length) {\n index = array.indexOf(value);\n if (index != -1) {\n array.splice(index, 1);\n setArray(array);\n arrayStatus();\n }\n }\n else {\n alert('Array is empty..')\n }\n}", "title": "" }, { "docid": "8941de9fa0d234f73844e78d84ef6770", "score": "0.5405928", "text": "function deleteProperty(tableId, id) {\n $.ajax({\n url: '/deleteProperty/' + id,\n type: 'DELETE',\n success: function (result) {\n $(\"#\" + tableId).find(\"#row-\" + id).remove();\n },\n error: function (result) {\n showError();\n }\n })\n}", "title": "" }, { "docid": "2be759702ebaf7915ff23b64b259881d", "score": "0.540578", "text": "function deleteFunc () {\n var itemDelete = staff[$('#removeEmployee').val()];\n staff.splice($.inArray(itemDelete, staff), 1);\n deleteSelectList();\n computeSalary();\n}", "title": "" }, { "docid": "2100010c6bb72d892d4d6e84b69ae47e", "score": "0.53997284", "text": "function removeEmployee() {\n // declared variables equal to input values for legibility\n let employeeFirstName = $('#firstNameInput').val();\n let employeeLastName = $('#lastNameInput').val();\n let employeeId = $('#idInput').val();\n\n // for loop to find matching values and delete array item if found\n for (let i = 0; i < employeeInfo.length; i++) {\n let employee = employeeInfo[i];\n if (employeeFirstName === employee.firstName && employeeLastName === employee.lastName || employeeId === employee.id) {\n employeeInfo.splice(i, 1);\n addEmployeeToTable();\n monthlyCosts();\n }\n }\n // call addEmployeeToTable to refresh table info\n} // end ", "title": "" }, { "docid": "a297255a0eb88bac8399a1efbcee418a", "score": "0.53996485", "text": "function deleteMyRow(f)\n{\n\t\n\tdocument.getElementById('ranges').removeChild(document.getElementById(\"row\" + f));\n\tenableUpdateButton();\n}", "title": "" }, { "docid": "d5024e35b39ff77b79086c6254dbf1a6", "score": "0.53956556", "text": "function deleteFieldForForm(formId, fieldId) {\n var deferred = q.defer();\n FormModel.findById(formId, function (err, form) {\n if (err) {\n deferred.reject(err);\n } else {\n form.fields.splice(fieldId, 1);\n form.save(function (err, form) {\n deferred.resolve(form);\n })\n deferred.resolve(form);\n }\n })\n return deferred.promise;\n }", "title": "" }, { "docid": "4040b59a445f10f27a2672c19398ed8b", "score": "0.53939784", "text": "delete(id) {\n dbPouch.get(JSON.stringify(id)).then(function (doc) {\n dbPouch.remove(doc);\n db.loadAll();\n });\n\n\n }", "title": "" }, { "docid": "f6936afe6bf6b7c888603e0b1e1c33ff", "score": "0.5392784", "text": "function deleteElement(elementType) {\n //TODO: pop up to confirm the deletion.\n //communicate to backend to delete the correct entry\n //reload the table with the just-deleted entry gone.\n alert(\"You're about to delete!\");\n window.location.href = \"./edit-employee.html\";\n}", "title": "" }, { "docid": "66c83c7cc0def1398aac9267fc590966", "score": "0.5390079", "text": "function deleteMe(a){\n // TODO: Remove the erased elements from DOM\n // NOTE: we will access id vehicle and vehicle0 then we concat with the paramter and we hide\n $('#vehicle'+a).hide();\n $('#vehicle0'+a).hide();\n}", "title": "" }, { "docid": "4d444a63a31e5e9c873b2af248eeb2be", "score": "0.53898484", "text": "function deleteTag(element) {\n var interesse_ID = element.data('interesse_id');\n var gebruiker_id = [session.get('gebruiker_id')];\n\n databaseManager\n .query(\"DELETE FROM gebruiker_interesses WHERE ID_INTERESSES = (?) AND ID_GEBRUIKER = (?)\", [interesse_ID, gebruiker_id]);\n\n $('.tags').append(element);\n }", "title": "" }, { "docid": "5df5ba78c171f136a023569576628d8d", "score": "0.5385545", "text": "function handleDelete() {\r\n props.deleteArray(parseInt(inpRef2.current.value))\r\n }", "title": "" }, { "docid": "56e5b02eff9d30fed01f029be199ddfb", "score": "0.53839386", "text": "function deleteElement(someArr){\n console.log(someArr.length);\n \n delete someArr[2];\n \n console.log(someArr.length);\n}", "title": "" }, { "docid": "68a36301aee2d2a3c133d9bef972751d", "score": "0.5383108", "text": "function deletee() {\n try {\n var idn = parseInt(read.question(\"enter the id number\"));\n if (nameRestriction.test(String(idn)) === false) {\n console.log(\"invalid idno name\");\n throw Error;\n }\n var addressjson = readfile();\n var f = 0;\n for (var key in addressjson) {\n if (addressjson[key].idno == idn)\n var f = 1;\n var index = addressjson.indexOf(idn);\n addressjson.splice(index, 1);\n writefile(addressjson);\n }\n if (f == 0) {\n console.log(\"your id is not present\");\n deletee();\n }\n }\n catch (err) {\n console.log(err + \" re enter the idno \");\n deletee();\n }\n}", "title": "" }, { "docid": "61e6686921d322cad1671c78c2c99c1b", "score": "0.53747755", "text": "function deleteWithIdGiven(){\n for (i = 0; i < books.length; i++) {\n if (books[i].id == 133712){\n delete books[i]\n }\n }\n console.log(books);\n}", "title": "" }, { "docid": "ec1d115829beae0cb8ce61516d0b7908", "score": "0.5371922", "text": "deleteEmployee(id) {\n\t\tlet index = this.findIndexEmployee(id);\n\t\tthis.listEmployee.splice(index, 1);\n\t}", "title": "" }, { "docid": "e1afb9aef0ee0ac8ae89d1c1b048f922", "score": "0.5361825", "text": "function deleteProduct(array,i) {\n array.splice(i, 1);\n}", "title": "" }, { "docid": "e4b77911a5fcc03478e26a18ff7c54e3", "score": "0.5361264", "text": "delete(i)\n {\n this.arr.splice(i, 1);\n // delete this.arr[i];\n }", "title": "" }, { "docid": "c92e3d15cad15e2814dea494b1c2b9e4", "score": "0.53572476", "text": "function borrar(e) {\n console.log(\"borrando...\");\n var fila = e.target;\n var idx = fila.attributes[\"data-id\"].value;\n datos.splice(idx, 1);\n almacenar();\n imprimirFilas();\n}", "title": "" } ]
00e82610fb2a49b0d7f7dea8cee99478
MESSAGES INVITE Send a invite to user
[ { "docid": "83246831dc0ea8816570b231bf2508ea", "score": "0.63198686", "text": "function MESSAGE_Invite(To)\n{\n\t return \"<presence xml:lang='\"+UTILS_JabberLang(MainData.Lang)+\"' type='subscribe' to='\"+To+\"@\"+MainData.Host+\"' />\"; \n}", "title": "" } ]
[ { "docid": "596e6d9611637df2dda14c19e93e9aa6", "score": "0.7418855", "text": "function invite() {\n console.log('Sending Invite');\n if (window.socialmessage) {\n var message = {\n text: \"Checkout this app, FriendsETA. It let's you know how many minutes far away your Facebook friends are.\",\n url: \"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1076074655&mt=8\"\n };\n window.socialmessage.send(message);\n }\n }", "title": "" }, { "docid": "f75e6ca4bb16f506b0be612f509ba88b", "score": "0.6999688", "text": "function sendInvite(twiml, callback, body, event) {\n\n let url_members =\n CONTEXT.GOOGLE_SHEETS_URL +\n CONTEXT.MEMBERS_PID +\n CONTEXT.MEMBERS_QUERY;\n\n fetch(url_members)\n .then((resp) => resp.text())\n .then(function (data) {\n\n Papa.parse(data, {\n header: true,\n skipEmptyLines: true,\n complete: function (results, file) {\n console.log(\"Parsing complete: \" + JSON.stringify(results.data), file);\n let arr_members = [], arr_usernames = [], obj_results, phone, isCaptain;\n\n // Distinguish user and captains\n results.data.forEach((d) => {\n phone = decrypt(d.Phone);\n if (body.slice(1).includes(phone)) {\n username = decrypt(d.Name);\n obj_results = {};\n obj_results.Phone = phone;\n arr_usernames.push(username);\n arr_members.push(obj_results);\n }\n if (phone === event.From && d.IsCaptain === \"☑\") {\n isCaptain = true;\n }\n });\n\n if (isCaptain) {\n let body_msg = getInviteMsg();\n let body_feedback = 'Invite done: ' + arr_usernames;\n\n arr_members.forEach((o) => {\n CONTEXT.getTwilioClient().messages.create({\n from: event.To,\n to: o.Phone,\n body: body_msg\n }, function () {\n twiml.message(body_feedback);\n callback(null, twiml);\n });\n });\n }\n else {\n // Not allowed\n twiml.message(\"This command is only available for captains.\");\n callback(null, twiml);\n }\n }\n });\n });\n}", "title": "" }, { "docid": "43f8cacbba74cf701d544091b08f43d5", "score": "0.66027296", "text": "function invite(who){\n var payload = {};\n payload.requested_user = who;\n\n console.log('*** Client log message: \\'invite\\' payload: '+JSON.stringify(payload));\n socket.emit('invite',payload);\n}", "title": "" }, { "docid": "8ed19b016e9a0a0d81d7ab38587816fb", "score": "0.65873706", "text": "function invite(who){\n var payload = {};\n payload.requested_user = who;\n\n console.log('*** Client Log message: \\'invite\\' payload: '+JSON.stringify(payload));\n socket.emit('invite', payload);\n}", "title": "" }, { "docid": "ccf72fdc02c99ccdaa320f7a0caf61cf", "score": "0.6542899", "text": "userInviteAction(workspaceId, email) {\n let data = {params: {'WS':workspaceId, 'EMAIL': email}};\n return this.remoteAnalytisAPI.user_invite(data).$promise;\n }", "title": "" }, { "docid": "38acd185b1c8e84136ac4588788238a4", "score": "0.65301496", "text": "function invite(who) {\n\tvar payload = {};\n\tpayload.requested_user = who;\n\n\tconsole.log('*** Client Log Message: \\'invite\\' payload: '+JSON.stringify(payload));\n\tsocket.emit('invite',payload);\n}", "title": "" }, { "docid": "cd39d78d62549c5e88bfd70195c2c4f8", "score": "0.6527368", "text": "async inviteUser () {\n\t\tthis.userInviter = new UserInviter({\n\t\t\trequest: this,\n\t\t\tteam: this.team,\n\t\t\tsubscriptionCheat: this._subscriptionCheat, // allows unregistered users to subscribe to me-channel, needed for mock email testing\n\t\t\tinviteCodeExpiresIn: this._inviteCodeExpiresIn,\n\t\t\tdelayEmail: this._delayEmail,\n\t\t\tinviteInfo: this.inviteInfo,\n\t\t\tinviteType: this.inviteType,\n\t\t\tuser: this.user,\n\t\t\tdontSendEmail: this.dontSendEmail\n\t\t});\n\n\t\tconst userData = {\n\t\t\temail: this.request.body.email.trim()\n\t\t};\n\t\t['fullName', '_pubnubUuid'].forEach(attribute => {\n\t\t\tif (this.request.body[attribute]) {\n\t\t\t\tuserData[attribute] = this.request.body[attribute];\n\t\t\t}\n\t\t});\n\t\tthis.invitedUsers = await this.userInviter.inviteUsers([userData]);\n\t\tthis.invitedUserData = this.invitedUsers[0];\n\t\tthis.transforms.createdUser = this.invitedUserData.user;\n\t\tthis.inviteCode = this.invitedUserData.inviteCode;\n\t}", "title": "" }, { "docid": "75b50b52fb852c3e74ec03ada7e64df5", "score": "0.6514059", "text": "async function joinServer(invite, message) {\n console.log(invite);\n require(\"request\")(\n {\n method: \"POST\",\n url: `https://discordapp.com/api/v6/invites/${invite}`,\n json: true,\n headers: {\n authorization: message.client.token\n }\n },\n async (err, res, body) => {\n if (err) {\n console.log(err);\n await console.log(`[ERROR] - ${err}`);\n return;\n } else {\n if (body.message.includes(\"Unknown Invite\"))\n return console.log(\"[ERROR] - Unkown Invite.\");\n if (body.message.includes(\"banned\"))\n return console.log(\"[ERROR] - Banned from this server.\");\n await console.log(`[INFO] - Done.`);\n }\n }\n );\n}", "title": "" }, { "docid": "ea55c1c889c20cef05e8e9e2b76224a0", "score": "0.64682966", "text": "static async checkInvite (user) {\n let invite = await AMInvite.findInviteByEmailPhone(user.local.email);\n // console.log(\"invite\",invite);\n if (invite) {\n AMInvite.accept(invite, user);\n }\n }", "title": "" }, { "docid": "1a0bdec36a715526df9168e46ec0f7ac", "score": "0.64260286", "text": "function invite(email) {\n var options;\n var payload = getPayload();\n var result;\n var time = Math.ceil(new Date().getTime() / 1000);\n var url = 'https://phillydev.slack.com/api/users.admin.invite?t=' + time;\n\n if (payload === undefined || payload === null) {\n return;\n }\n\n payload.email = email;\n payload.channels = 'C03G04GL7,C03EC6Y8L';\n payload.set_active = 'true';\n payload._attempts = '1';\n\n options = {\n 'method' : 'POST',\n 'payload' : payload,\n 'followRedirects' : true,\n 'muteHttpExceptions': true\n };\n\n result = UrlFetchApp.fetch(url, options);\n\n if (result.getResponseCode() == 200) {\n sayInvited(email, JSON.parse(result));\n }\n\n return result;\n}", "title": "" }, { "docid": "537eaf32ffd5a96380712acb5a3580f8", "score": "0.6382861", "text": "function sendInvite() {\n\n FB.ui({method: 'apprequests',\n title: 'Come and play Phototo!',\n message: 'I just played Phototo! Check it out!',\n }, fbCallback);\n\n}", "title": "" }, { "docid": "cf9199457c44b90e928caa27e96af7cc", "score": "0.6326908", "text": "async send ({ commit, rootGetters }, email) {\n commit(types.REQUEST_SEND)\n let invited\n try {\n invited = await invitations.create({\n email,\n group: rootGetters['groups/activeGroupId'],\n })\n }\n catch (error) {\n onlyHandleAPIError(error, data => commit(types.RECEIVE_SEND_ERROR, data))\n return\n }\n commit(types.RECEIVE_SEND, { invited })\n }", "title": "" }, { "docid": "c8388788cbf7b65d83f72126189e732c", "score": "0.6310321", "text": "function MESSAGE_InviteAccept(To)\n{\n\treturn \"<presence xml:lang='\"+UTILS_JabberLang(MainData.Lang)+\"' type='subscribed' to='\"+To+\"@\"+MainData.Host+\"' />\";\n}", "title": "" }, { "docid": "fb316e9890b61d8a77f8eb032a8bbc5a", "score": "0.62588483", "text": "function inviteUser(email) {\n EventBus.dispatch(BV.Event.Net.InviteUser, { email: email });\n }", "title": "" }, { "docid": "acc9728a9ec59ceb8787fa3ed868b523", "score": "0.6249009", "text": "function acceptInvite(groupID, inviteId) \n {\n // accept GId, userId\n axios({\n method: 'post',\n url: 'http://localhost:3005/accept',\n data: {\n GId: groupID,\n id: userId,\n inviteId: inviteId\n }\n }).then((response) => {\n if (response.data.message) {\n }\n });\n\n window.location.reload();\n }", "title": "" }, { "docid": "914c055be03328acdb32a4390acf2f52", "score": "0.62455994", "text": "function sayInvited(email, inviteResponse) {\n var message;\n var options;\n var payload = getPayload();\n var result;\n var time = Math.ceil(new Date().getTime() / 1000);\n var url = 'https://phillydev.slack.com/api/chat.postMessage?t=' + time;\n\n if (!payload) {\n return;\n }\n\n if (inviteResponse.ok === true) {\n message = hideEmail(email) + ', Invited Successfully';\n } else {\n message = 'Error Inviting: ' +\n hideEmail(email) + ' Error:' + inviteResponse.error;\n }\n\n payload.channel = '#signupform';\n\n payload.text = message;\n payload.username = 'dherbstscriptbot';\n\n options = {\n 'method' : 'POST',\n 'payload' : payload,\n 'followRedirects' : true,\n 'muteHttpExceptions': true\n };\n\n result = UrlFetchApp.fetch(url, options);\n\n if (result.getResponseCode() == 200) {\n Logger.log(result);\n } else {\n Logger.log('exception');\n Logger.log(result);\n }\n\n return;\n}", "title": "" }, { "docid": "2b8effb771e106b246203d1cb98e965b", "score": "0.6156897", "text": "function sendChatroomInvite(recipient, room_name) {\n\tvar recipient_full = recipient + \"@localhost\";\n\tvar sender = my_user_name + '@localhost/princeton';\n\tvar reply = $msg( {to: recipient_full, from: sender, type: 'chat', chatroom_invite:'true', chatroom_name:room_name } ).c(\"body\").t(\"chatroom invite.\");\n\tconnection.send(reply.tree());\n}", "title": "" }, { "docid": "e7d3611e62ce06c6c886f73d7e77d08a", "score": "0.6145113", "text": "function onMessage(e)\n{\n\tif (e.originator === 'remote')\n\t{\n\t\tlet content = e.request.body;\n\n\t\t// Call invitation received. Open the given URL with the browser.\n\t\tif (content.match(/invite-/) !== null)\n\t\t{\n\t\t\topen(content.substring(7));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconsole.log(`${colors.magenta('[' + remotePeer + ']')} ${content}`);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dacec03d1ecba2e9f06b4007925079cb", "score": "0.6142864", "text": "function rtcinvite(remoteusername, callback, sdpcallback, icecallback) {\r\n\tnextcallback = callback; \r\n\tincomingicecallback = icecallback;\r\n\tincomingsdpcallback = sdpcallback;\r\n\tserver.send(\r\n\t\t\tJSON.stringify({ \r\n\t\t\t\ttoken:token,\r\n\t\t\t\ttype:\"invite\",\r\n\t\t\t\tusername:username,\r\n\t\t\t\tremoteusername:remoteusername\r\n\t\t\t})\r\n\t);\t\r\n}", "title": "" }, { "docid": "896923ea4b42320b99fba062f77666f0", "score": "0.6140701", "text": "function fbInviteFriends() {\r\n\t// make sure user is connected to Facebook\r\n\tif( user_connected ) {\r\n\t\t// they are, open the dialog\r\n\t\topenFBInviteDialog();\r\n\t} else {\r\n\r\n\t\tFB.login( onInviteLogin, { scope: 'email' } );\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "f14d6020db0ba11dff86824eadaa20a4", "score": "0.6089929", "text": "function handleInviteFriendsEmailSection(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\tvar emailDialog = Ti.UI.createEmailDialog();\n\temailDialog.setBarColor('black');\n\temailDialog.setHtml(true);\n\temailDialog.setSubject(INVITE_SUBJECT);\n\temailDialog.setMessageBody(INVITE_BODY_EMAIL);\n\temailDialog.open();\n}", "title": "" }, { "docid": "4db5d0244f514548f353c9d1d589790f", "score": "0.6071475", "text": "function inviteUser() {\n const reqBody = { message: message }\n axios\n .post(\n `/api/v1/groups/${selectedGroup._id}/invite/${otherUser._id}`,\n reqBody\n )\n .then((res) => {\n let newInviteGroups = inviteGroups\n newInviteGroups.splice(inviteGroups.indexOf(selectedGroup), 1)\n setInviteGroups(newInviteGroups)\n let newInvitedGroups = invitedGroups\n newInvitedGroups.push(selectedGroup)\n setInvitedGroups(newInvitedGroups)\n closeInviteGroupModal()\n })\n .catch((err) => {\n console.log(`err : ${err}`)\n })\n }", "title": "" }, { "docid": "99374dfe0f2253762b03ccc2e740da28", "score": "0.60494727", "text": "async invite() {\n\t\tawait this.initLock.peek();\n\n\t\tif(this.theyInvited && !this.wasTheirInviteHandled) {\n\t\t\t// If we were invited by the user, accept their invite instead of making ours\n\t\t\tawait this.acceptInvite();\n\t\t\treturn;\n\t\t}\n\n\t\tconst siteInfo = await zeroPage.getSiteInfo();\n\t\tconst authAddress = siteInfo.auth_address;\n\t\tconst content = JSON.parse(await zeroFS.readFile(`data/users/${authAddress}/content.json`));\n\n\t\tfor(const invite of content.invites || []) {\n\t\t\t// Try to decrypt the invite\n\t\t\ttry {\n\t\t\t\tconst inviteContent = await CryptMessage.decrypt(invite.for_self);\n\t\t\t\tif(inviteContent === this.name) {\n\t\t\t\t\t// Invited before\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t\t// fallthrough\n\t\t\t}\n\t\t}\n\n\t\tthis.weInvited = true;\n\n\t\t// Add the invite\n\t\tcontent.invites = content.invites || [];\n\t\tcontent.invites.push({\n\t\t\tfor_self: await CryptMessage.encrypt(this.name, await CryptMessage.getSelfPublicKey()),\n\t\t\tfor_invitee: await CryptMessage.encrypt(this.name, await this.getPublicKey())\n\t\t});\n\t\t// Remove dismiss\n\t\tif(content.handledInvites) {\n\t\t\tcontent.handledInvites = (\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tcontent.handledInvites.map(async invite => {\n\t\t\t\t\t\treturn (await CryptMessage.decrypt(invite.for_self)).endsWith(`!!${this.name}:dismiss`) ? null : invite;\n\t\t\t\t\t}).map(promise => promise.catch(() => null))\n\t\t\t\t)\n\t\t\t).filter(invite => invite);\n\t\t}\n\n\t\t// Publish\n\t\tawait zeroFS.writeFile(`data/users/${authAddress}/content.json`, JSON.stringify(content, null, 1));\n\t\tzeroPage.publish(`data/users/${authAddress}/content.json`);\n\t}", "title": "" }, { "docid": "fc2560621f2d1aa6d1573345d97ec1a7", "score": "0.6035938", "text": "async function handleInvite(req, res) {\n const callId = req.get('Call-ID');\n logger.info({callId}, `received incoming call: ${req.uri}`);\n\n // connect call to media server, producing media Endpoint and SipDialog objects\n const {endpoint, dialog} = await srf.locals.ms.connectCaller(req, res, { codecs: ['PCMU'] });\n\n /* set dialog event flow handlers. We will be notified of the following events:\n * (1) An Intent was detected.\n * (2) A Transcription was provided\n * (3) An audio clip has been provided that we can play\n * (4) The user just stopped speaking\n * (5) An error was detected.\n */\n\n endpoint.on('dialogflow::intent', handleIntent.bind(endpoint, dialog));\n endpoint.on('dialogflow::transcription', handleTranscription.bind(endpoint));\n endpoint.on('dialogflow::audio_provided', handleAudio.bind(endpoint, dialog));\n endpoint.on('dialogflow::end_of_utterance', handleEndOfUtterance.bind(endpoint));\n endpoint.on('dialogflow::error', handleError.bind(endpoint));\n\n // when the caller hangs up, destroy the media endpoint and terminate the dialogflow\n dialog.on('destroy', () => {\n logger.info('got BYE from caller, hangup');\n endpoint.destroy();\n });\n\n // kick things off by starting the dialog flow.\n // in this app we have hardcoded parameters that would normally be provided based on the DID\n // agent: rising-af044\n // language code: en-US\n // speech timeout: 20 secs (not yet implemented)\n // event: welcome (this is optional)\n endpoint.api('dialogflow_start', `${endpoint.uuid} rising-af044 en-US 20 welcome`);\n}", "title": "" }, { "docid": "d90975660b479db1ec8e69e551807bb7", "score": "0.6028144", "text": "function loc_send_invite_email(){\n\t\n\tfull_address = invite_location.address+', '+invite_location.city+' '+invite_location.state+', '+invite_location.zipcode;\n\ttrack_analytics_event('Invite-Email', invite_location.name+': '+full_address);\n\tinvite_location = loc_search_results[loc_invite_key];\n\t\n\tvar body = 'To [recipient],\\r\\n\\r\\n';\n\tbody += loc_invite_brand_message.replace('[location]', invite_location.name)+'\\r\\n\\r\\n';\n\tbody += invite_location.name+'\\r\\n';\n\tbody += invite_location.address+'\\r\\n';\n\tbody += invite_location.city+', '+invite_location.state+' '+invite_location.zipcode+'\\r\\n\\r\\n';\n\tbody += $loc('.locator_invite_custom_message').val()+'\\r\\n\\r\\n';\n\tbody += 'From,\\r\\n';\n\tbody += invite_values.sender_name;\n\t\n\tpost = new Object();\n\tpost = {\n\t\tsender_email: invite_values.sender_email, \n\t\tsender_name: invite_values.sender_name,\n\t\trecipients: invite_values.recipients,\n\t\tsubject: loc_invite_email_subject,\n\t\tbody: body\n\t}\n\n\turl = loc_mailer_url;\n\n\t$loc.ajax({\n\t url: url,\n\t\tasync: true,\n\t\tcache: 'false',\n\t\ttype: 'POST',\n\t\tdata: post,\n\t\terror: function(request, status, error){\n\t\t\tconsole.log(request);\n\t\t\tconsole.log('status: '+status);\n\t\t\tconsole.log('error: '+error);\n\t\t}\n\t}).done(function(data) {\n\t\tset_loading(false);\n\t\talert('Your invitations have been sent!');\n\t\tloc_screen_action('search');\n\t});\t\n}", "title": "" }, { "docid": "4c992c75a5459201b35fa538bbb339a0", "score": "0.58903444", "text": "function handleSendFBInvitation(){\n\tTi.API.warn('handleSendFBInvitation() called');\n\t\n\t//revert to 0 so we can select more users after the invitations are sent\n\tnumberOfSelectedCheckboxes = 0;\n\t\n\tif (Titanium.Network.online == true){\n\t\t\n\t\tfbAlertImage = Titanium.UI.createImageView({\n\t\t\timage:IMAGE_PATH+'alert/alert_zoafuta.png',\n\t\t\tzIndex:12\n\t\t});\n\t\t\n\t\t//act indicator for invite\n\t\tfbFriendsInvitationActIndicator = Ti.UI.createActivityIndicator({\n\t\t\tstyle:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG\n\t\t});\n\t\t\n\t\tfbAlertImage.add(fbFriendsInvitationActIndicator);\n\t\tfbFriendsInvitationActIndicator.show();\n\t\t\n\t\tviewTopCategory.add(fbAlertImage);\n\t\t\n\t\t//Send invitation to FB\n\t\t\n\t\t//Prepare json object\n\t\tvar batchRequests = [];\n\t\tfor(var ele in selectedFriendsForFBInvite){ \n\t\t\tTi.API.warn('adding '+ele+' to batch request');\n\t\t\tvar url = ele + \"/feed\";\n\t\t\tvar body = \"message=\"+INVITE_BODY_FB;\n\t\t\tvar obj = {\n\t\t\t\t\"method\":\"POST\",\n\t\t\t\t\"relative_url\":url,\n\t\t\t\t\"body\":body\n\t\t\t};\n\t\t\t\t\n\t\t\t//Ti.API.warn('adding '+obj.method+' object to batch request');\n\t\t\tbatchRequests.push(obj);\n\t\t\t//Ti.API.warn('added '+batchRequests[0].method+' object to batch request');\n\t\t}\n\t\t\n\t\t//send FB batch request\n\t\tvar fbResult = \"\";\n\t\tTitanium.Facebook.requestWithGraphPath('', {batch:batchRequests}, \"POST\", function(e) {\n\t \tif (e.success) {\n\t \tTi.API.warn('FACEBOOK - Success in posting multi-message! '+JSON.stringify(e));\n\t \tfbResult = MSG_FB_INVITE_SUCCESS;\n\t \t} else {\n\t \tif (e.error) {\n\t \t Ti.API.warn('FACEBOOK - ERROR in posting multi-message '+e.error);\n\t \t} else {\n\t \tTi.API.warn('FACEBOOK - UNKNOWN response in posting multi-message');\n\t \t}\n\t \tfbResult = MSG_FB_INVITE_FAILURE;\n\t \t}\n\t \t\n\t \t//Destroy activity indicator\n\t\t\tfbAlertImage.remove(fbFriendsInvitationActIndicator);\n\t\t\tfbFriendsInvitationActIndicator.hide();\n\t\t\tfbFriendsInvitationActIndicator = null;\n\t \t\n\t \tfbOKButton = Titanium.UI.createImageView({\n\t\t\t\timage:IMAGE_PATH+'alert/yes.png',\n\t\t\t\tzIndex:12,\n\t\t\t\tbottom:10,\n\t\t\t\tzIndex:12\n\t\t\t});\n\t\t\n\t\t\tfbAlertLabelText = Titanium.UI.createLabel({\n\t\t\t\ttext:fbResult,\n\t\t\t\tcolor:'white',\n\t\t\t\ttextAlign:'center',\n\t\t\t\ttop:31,\n\t\t\t\tleft:45,\n\t\t\t\tright:45,\n\t\t\t\tfont:{fontSize:16, fontWeight:'regular', fontFamily:'Myriad Pro'}\n\t\t\t});\n\t \t\n\t \tfbAlertImage.add(fbOKButton);\n\t\t\tfbAlertImage.add(fbAlertLabelText);\n\t\t\tfbOKButton.addEventListener('click', dismissAlert);\n\t \t\n\t\t});\n\t\t//End FB invitation\n\n\t} else {\n\t\tbuildAlert(MSG_NO_INTERNET_CONNECTION);\n\t}\n}", "title": "" }, { "docid": "850dc14f4f9763ac026c373cf8788318", "score": "0.58792317", "text": "function handleInviteLink(){\n let eventId = getQueryVariable('eventId')\n let event = getQueryVariable('name')\n\n //this makes the welcome page display slightly differently, with the event name\n CURRENT_SESSION.event_id = eventId;\n if(!event==false){\n let eventName = event.split('+').join(' ')\n $('.welcome-message').html(`You have been invited to join <p class='invite-name'>${eventName}</p>`)\n $('.js-not-invite').remove();\n $('.intro-content').addClass('intro-content-invite')}\n}", "title": "" }, { "docid": "0d573386c64799f44552b0bd53dd242c", "score": "0.5867762", "text": "function handleInviteFriendsSMSSelection(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\tvar smsModule = require(\"com.omorandi\");\n\tvar smsDialog = smsModule.createSMSDialog({ \n\t messageBody: INVITE_BODY_SMS,\n\t barColor: 'black'\n\t});\n\n smsDialog.open({animated: true});\n\tTitanium.UI.iPhone.hideStatusBar();\n}", "title": "" }, { "docid": "2f15f39f303d84e7c9b7122651095033", "score": "0.5846884", "text": "canSeeInvite ( req ) {\n return checks.canUseInvite( req, true );\n }", "title": "" }, { "docid": "88f2ac180c9e84b185efa92880520a38", "score": "0.5838221", "text": "function sendInvite() {\n let div= document.getElementById('invite_message');\n let mssg = \"Hey! Let's connect over a video chat. Here is the website link: https://boxing-poppy-43327.herokuapp.com/. When prompted, enter this roomId: \" +ROOM_ID;\n div.innerHTML= mssg; \n}", "title": "" }, { "docid": "b1da497dd7e9336320abfebc617d277a", "score": "0.5837223", "text": "async function invite(invites) {\r\n const [] = await db('invites').insert(invites)\r\n return invites;\r\n}", "title": "" }, { "docid": "4859516c3e32efaa2624e48d4ec861d9", "score": "0.5797701", "text": "function sendRequestInvite() {\r\n\tFB\r\n\t\t\t.ui(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmethod : 'apprequests',\r\n\t\t\t\t\t\tmessage : 'Try using Affinity to check compatibility between you & your facebook friends',\r\n\t\t\t\t\t}, function(response) {\r\n\t\t\t\t\t\tconsole\r\n\t\t\t\t\t\t\t\t.log('sendRequestInvite UI response: ',\r\n\t\t\t\t\t\t\t\t\t\tresponse);\r\n\t\t\t\t\t});\r\n}", "title": "" }, { "docid": "71a7dcb6c5a7ca8ed6211c53f4eaedce", "score": "0.57971144", "text": "send() {\n Spark.post(`/settings/${Spark.pluralTeamString}/${this.team.id}/invitations`, this.form)\n .then(() => {\n this.form.email = '';\n\n this.$dispatch('updateInvitations');\n });\n }", "title": "" }, { "docid": "0c8c8b4e8819f2148c3beac71cec440f", "score": "0.5795823", "text": "function sendInvite(user, eventId) {\n return new Promise((resolve, reject) => {\n try {\n //Event ID needs to be decoded first and get data as string\n const decode = Utilities.base64Decode(eventId, Utilities.Charset.UTF_8)\n const blobString = Utilities.newBlob(decode).getDataAsString();\n // split by space and first element will be the calUId\n const strSplit = blobString.split(\" \");\n // second element of strSplit will contain the calendarId\n const calendar = Calendar.CalendarList.get(strSplit[1]);\n// console.log(calendar.id);\n const event = Calendar.Events.get(calendar.id, strSplit[0]);\n// console.log(event)\n let attendees = event.attendees ? event.attendees : event.attendees = [];\n attendees.push({email: user});\n// console.log(attendees)\n const resource = { attendees: attendees };\n const args = { sendUpdates: \"all\" };\n // add user to event and return the promise \n // Patch will send a calendar invite to the newly added user\n Calendar.Events.patch(resource, calendar.id, event.id, args); \n resolve(\"Successfully added to event, please ensure to check your email for the notification\")\n } catch(err) {\n console.error(err)\n reject(`Failed to locate event`)\n }\n })\n}", "title": "" }, { "docid": "e7f5f4733e76f9c59864e5395aa5c1e4", "score": "0.5756761", "text": "function _onFormSubmit(e) {\n sendInvite(e.values);\n}", "title": "" }, { "docid": "a72ffb635671101ee46aec7f3af50858", "score": "0.5755718", "text": "function getInviteLink(inv) {\n return `https://discord.gg/${inv.code}`;\n}", "title": "" }, { "docid": "e5bddc61a5d69e3e084d9bcc888ce6d3", "score": "0.57107997", "text": "function invite(aMsg, aConv) {\n let params = splitInput(aMsg);\n if (!params.length) {\n return false;\n }\n\n // Check user's jid is valid.\n let account = getAccount(aConv);\n let jid = account._parseJID(params[0]);\n if (!jid) {\n aConv.writeMessage(\n aConv.name,\n _(\"conversation.error.invalidJID\", params[0]),\n { system: true }\n );\n return true;\n }\n\n aConv.invite(...params);\n return true;\n}", "title": "" }, { "docid": "8be21295422bb70685779cd127f135f8", "score": "0.57025343", "text": "async acceptInvite(code) {\r\n const json = ['action', 'invite', code];\r\n const response = await this.query({ json, expect200: true });\r\n return response;\r\n }", "title": "" }, { "docid": "258a785ebbf51ebdbf43d84523cd4824", "score": "0.5697351", "text": "function handleInviteRequest(req, res) {\n const domain = getDomain(req);\n if (domain == null) { parent.debug('web', 'handleInviteRequest: failed checks.'); res.sendStatus(404); return; }\n if ((domain.loginkey != null) && (domain.loginkey.indexOf(req.query.key) == -1)) { res.sendStatus(404); return; } // Check 3FA URL key\n if ((req.body == null) || (req.body.inviteCode == null) || (req.body.inviteCode == '')) { render(req, res, getRenderPage('invite', req, domain), getRenderArgs({ messageid: 0 }, req, domain)); return; } // No invitation code\n\n // Each for a device group that has this invite code.\n for (var i in obj.meshes) {\n if ((obj.meshes[i].domain == domain.id) && (obj.meshes[i].deleted == null) && (obj.meshes[i].invite != null) && (obj.meshes[i].invite.codes.indexOf(req.body.inviteCode) >= 0)) {\n // Send invitation link, valid for 1 minute.\n res.redirect(domain.url + 'agentinvite?c=' + parent.encodeCookie({ a: 4, mid: i, f: obj.meshes[i].invite.flags, ag: obj.meshes[i].invite.ag, expire: 1 }, parent.invitationLinkEncryptionKey) + (req.query.key ? ('&key=' + req.query.key) : '') + (req.query.hide ? ('&hide=' + req.query.hide) : ''));\n return;\n }\n }\n\n render(req, res, getRenderPage('invite', req, domain), getRenderArgs({ messageid: 100 }, req, domain)); // Bad invitation code\n }", "title": "" }, { "docid": "05d4339d8985fb27c432bf081ac3bf2b", "score": "0.56899977", "text": "function invite(invitation, callback){\n invitation.inviter = db.ObjectId(invitation.inviter);\n invitation.invited = db.ObjectId(invitation.invited);\n}", "title": "" }, { "docid": "48ada84e25c218c423831daae73c739d", "score": "0.56886363", "text": "async playerInvite(email) {\n const invited = await this.sql(\n path.join('player', 'create-invitation.sql'),\n {'$email': email}, 'all'\n );\n return invited;\n }", "title": "" }, { "docid": "38f5f2251e30eaae59c60e424a80ded0", "score": "0.5658538", "text": "function acceptDuelInvite(sender) {\n acceptDuel(sender);\n}", "title": "" }, { "docid": "00e8bbed4e30a0e626c429016363c6e4", "score": "0.56445456", "text": "function inviteNgo(data) {\r\n let postData = JSON.stringify(data);\r\n return $http.post(`${baseUrl}/onboard/ngo/invite`, postData);\r\n }", "title": "" }, { "docid": "0468fdfb8dccfa579387cb82586a24c2", "score": "0.55895984", "text": "function invite(){\n console.log('Inviting',$(this).text()); \n $(this).attr('src','/static/img/loading-ind.gif');\n $.ajax({\n type:'POST',\n url:'/invite/',\n data: {'csrfmiddlewaretoken':$('#csrf-token').val(),\n 'team_id':$('#team-id').val(),\n 'username':$(this).attr('data-username')},\n success: ()=>{\n $(this).off('click');\n $(this).attr('src','/static/img/tick.svg');\n members.push($(this).attr('data-username'));\n },\n error: (err)=>{\n $(this).attr('src','/static/img/add-member.svg');\n alert('Some error occured :(');\n console.log(err);\n }\n })\n }", "title": "" }, { "docid": "750115079678856aac8c0e0da1b7e312", "score": "0.55806404", "text": "function sendInvitation(owner_id,contact_id,message,callback) {\n var url = utils.prepare_url(apiconf.api.send_invitation.url,{});\n var data = {'app_name':local_config.app_name, 'owner_id':$rootScope.currentUserId,'contact_id':contact_id, 'message': message}\n return $http.post(url,data).success(callback);\n }", "title": "" }, { "docid": "1f9f9a39ec5fc3c577bdcbf010511fd9", "score": "0.5542194", "text": "function sendInvite(sender, recipient, email) {\n // First check if the recipient already exists\n database\n .ref(\"/players/\" + recipient)\n .once(\"value\")\n .then(function(player) {\n // If the\n if(player.val() === null) {\n console.log(\"Creating new player: \" + recipient);\n createPlayer(recipient, email);\n console.log(\"Successfuly created new player: \" + recipient);\n }\n });\n sendLog({\n type: \"invite\",\n email: email,\n sender: sender,\n recipient: recipient,\n });\n }", "title": "" }, { "docid": "6dc1440aca8469af0ed903740bbabad3", "score": "0.55323136", "text": "function inviteEntityToBePartner(form) {\r\n if ($('#invite-user-hidden').val() == '' || $('#invite-user-hidden').val() == null) {\r\n $('#btnSendInvite').removeClass('disabled').html('Convidar Ciranda');\r\n showAlertGeneral('danger', 'Informe um ciranda válida.');\r\n return false;\r\n }\r\n\r\n $.ajax({\r\n url: $(form).attr('action'),\r\n type: 'POST',\r\n data: $(form).serialize(),\r\n beforeSend: function() {\r\n $(\"#btnSendInvite\").addClass(\"disabled\").html(\"Convidando...\");\r\n },\r\n success: function(response) {\r\n if (response.status == 'success') {\r\n\r\n $(\"#invite_user option:selected\").remove();\r\n $(\"#invite_user\").val(\"\");\r\n $(\"#invite-user\").val(\"\");\r\n $(\"#invite-user-hidden\").val(\"\");\r\n $('#message-invite-user').hide();\r\n $(\"#invited-list\").append(response.html);\r\n if ($(\"#not-found-invite\").length) {\r\n $(\"#not-found-invite\").hide();\r\n }\r\n $(\"#invite_user\").focus();\r\n $(\"#solicitation-not-found\").fadeOut();\r\n showAlertGeneral('success', response.message);\r\n } else {\r\n showAlertGeneral('danger', response.message);\r\n }\r\n },\r\n error: function(response) {\r\n return showResponseError(response, null, {\r\n subject: 'Erro ao convidar Ciranda para ser parceira',\r\n rota: $(form).attr('action'),\r\n data: $(form).serialize()\r\n });\r\n },\r\n complete: function() {\r\n $(\"#btnSendInvite\").removeClass(\"disabled\").html(\"Convidar Ciranda\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "eabac5f6cb47209252f5243b32d2c4bf", "score": "0.5526217", "text": "function Invite(userId, username, mealId, date) {\n\tthis.userId = userId;\n\tthis.username = username;\n\tthis.mealId = mealId;\n\tthis.date = date;\n}", "title": "" }, { "docid": "70cead9736d41abd2d5190cb105cff9e", "score": "0.55194294", "text": "static inviteUser(req, res, next) {\n User.findOneAndUpdate({ email: req.query.email }, {\n $push: { invitation: req.params.projectId }\n })\n .then((user) => {\n if (!user) throw ({ status: 404, msg: 'User not found' })\n else res.status(200).json(user.name)\n }).catch(next);\n }", "title": "" }, { "docid": "3dde7eb3ae60603e56f10120d36c8f2a", "score": "0.550993", "text": "async sendWelcomeMessage(turnContext) {\r\n // If any new membmers added to the conversation\r\n if (turnContext.activity && turnContext.activity.membersAdded) {\r\n // Define a promise that will welcome the user\r\n async function welcomeUserFunc(conversationMember) {\r\n // Greet anyone that was not the target (recipient) of this message.\r\n // The bot is the recipient of all events from the channel, including all ConversationUpdate-type activities\r\n // turnContext.activity.membersAdded !== turnContext.activity.aecipient.id indicates \r\n // a user was added to the conversation \r\n if (conversationMember.id !== this.activity.recipient.id) {\r\n // Because the TurnContext was bound to this function, the bot can call\r\n // `TurnContext.sendActivity` via `this.sendActivity`;\r\n await this.sendActivity(`Welcome to the 'Welcome User' Bot. This bot will introduce you to welcoming and greeting users.`);\r\n await this.sendActivity(\"You are seeing great message this message because the bot recieved atleast one 'ConversationUpdate'\" + \r\n \"event,indicating you (and possibly others) joined the conversation. If you are using the emulator, \"+ \r\n \"pressing the 'Start Over' button to trigger this event again. The specifics of the 'ConversationUpdate' \"+\r\n \"event depends on the channel. You can read more information at https://aka.ms/about-botframewor-welcome-user\");\r\n await this.sendActivity(`It is a good pattern to use this event to send general greeting to user, explaining what your bot can do. `+ \r\n `In this example, the bot handles 'hello', 'hi', 'help' and 'intro. ` +\r\n `Try it now, type 'hi'`);\r\n }\r\n } \r\n \r\n // Prepare Promises to greet the user.\r\n // The current TurnContext is bound so `replyForReceivedAttachments` can also send replies.\r\n const replyPromises = turnContext.activity.membersAdded.map(welcomeUserFunc.bind(turnContext));\r\n await Promise.all(replyPromises);\r\n }\r\n }", "title": "" }, { "docid": "cde4968d32a9df5524f6cb9605c355a9", "score": "0.5497702", "text": "function myInvites(id) {\r\n return db('invites as i')\r\n .innerJoin('accounts as a', 'i.account_id', '=', 'a.id')\r\n .innerJoin('events as e', 'i.event_id', '=', 'e.id')\r\n .select('i.id as invite_id', 'i.event_id', 'e.name', 'e.date', 'e.time', 'e.location', 'e.host_id', 'e.host_name as host', 'i.account_id', 'a.username', 'a.firstname', 'a.lastname', 'i.food', 'i.notes', 'i.rsvp')\r\n .where( { account_id: id} )\r\n}", "title": "" }, { "docid": "bbfe9b4326c60eb5bf2fa3641556d2db", "score": "0.5494101", "text": "function inviteUser(username, permission, listId, cb) {\n userService.findById(username, (err, user, info) => {\n if (err) return cb(err)\n if (info) return cb(null, {message: info, status: 404})\n req(utils.optionsBuilder(listsUrl + listId), (err, res, data) => {\n if (err) return cb(err)\n if (res.statusCode === 404) return cb(null, {message: 'List not found!', status: res.statusCode})\n let newList = mapper.mapToUserList(data)\n const index = newList.guests.findIndex(guest => guest.username === username)\n if (index === -1) {\n newList.guests.push({username: username, permission: permission})\n }\n else if (newList.guests[index].permission !== permission) {\n newList.guests[index].permission = permission\n }\n req(utils.optionsBuilder(listsUrl + listId, 'PUT', newList), (err, res) => {\n if (err) return cb(err)\n if (res.statusCode > 400) return cb(null, {message: 'Error updating List!', status: res.statusCode})\n user.lists.push(listId)\n req(utils.optionsBuilder(usersUrl + username, 'PUT', user), (err, res) => {\n if (err) return cb(err)\n if (res.statusCode > 400) return cb(null, {\n message: 'Error updating User!',\n status: res.statusCode\n })\n cb()\n })\n })\n })\n })\n }", "title": "" }, { "docid": "67597cd93fc6c0640356efa8ce7d949c", "score": "0.5464924", "text": "function sendInvitation(organization,path) {\n e = this;\n\tnew Ajax.Request(path+'/'+$F(this)+'/invitations', {\n\t\t'method': 'post',\n\t\t'parameters': 'invite_organization['+organization+'][included]=1',\n\t\t'requestHeaders': {'Accept':'text/javascript'},\n\t\t'onSuccess': function(transport) {\n\t\t\tshowInvitationResults(transport.responseText,e,organization);\n\t\t}\n\t}); \n}", "title": "" }, { "docid": "de44f45aaa0c364ded3c3f55164d82dd", "score": "0.5444803", "text": "function sendMsg() {\n // Création de la requête\n var request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\n // Récupération du message entré dans l'input text\n var message = document.getElementById(\"message\").value;\n document.getElementById(\"message\").value = \"\";\n // Récupération des données utilisateur\n var user = sessionStorage.getItem(\"user\");\n var key = sessionStorage.getItem(\"key\");\n\n // Création de la requête en fonction de la présence de /to: en début de message\n var match = /^\\/to:*/g.exec(message);\n if (match != null) {\n var to = message.split(/:(.+)/);\n to = to[1].split(/ (.+)/);\n request.open(\"PUT\", \"/chat/\"+user+\"/\"+key+\"/\"+to[0], true);\n message = to[1];\n }\n\n // Création de la requête en fonction de la présence de /invite: en début de message\n var invite = /^\\/invite:*/g.exec(message);\n if (invite != null && !hasJoined && !hasCreated) {\n var to = message.split(/:(.+)/);\n to = to[1].split(/ (.+)/);\n if(to[0] == user){\n alert(\"Impossible de s'inviter soit même à une partie !\")\n return;\n }\n host = user;\n hasCreated = true;\n idGame = \"party_of_\"+user;\n request.open(\"PUT\", \"/invite/\"+user+\"/\"+key+\"/\"+to[0]+\"/\"+idGame, true);\n message = \"Invitation de \"+user+\" tapez /join:\"+user+\" pour rejoindre.\";\n }\n\n\n // Création de la requête en fonction de la présence de /join: en début de message\n var join = /^\\/join:*/g.exec(message);\n if (join != null && !hasJoined && !hasCreated) {\n var to = message.split(/:(.+)/);\n to = to[1].split(/ (.+)/);\n host = to[0];\n idGame = \"party_of_\"+host;\n request.open(\"PUT\", \"/join/\"+user+\"/\"+key+\"/\"+to[0], true);\n message = user+\" a accepté de rejoindre votre partie\";\n hasJoined = true;\n }\n\n if(match == null && invite == null && join == null){\n request.open(\"PUT\", \"/chat/\"+user+\"/\"+key, true);\n }\n\n\n // Envoi de la requête\n request.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n request.send(\"message=\"+message);\n if(hasJoined || hasCreated){\n setTimeout(display_game(), 3000);\n getGame();\n }\n}", "title": "" }, { "docid": "f0f8d986fd18b4b150804052b5b0be9a", "score": "0.54424405", "text": "function uninvite(who){\n var payload = {};\n payload.requested_user = who;\n\n console.log('*** Client log message: \\'uninvite\\' payload: '+JSON.stringify(payload));\n socket.emit('uninvite',payload);\n}", "title": "" }, { "docid": "112fc23a9750e8fa5cde347ec9caecb5", "score": "0.54423916", "text": "function checkIfInvited(user) { // 109\n //\n var invite = Invites.findOne({ invitedUserEmail: Users.getEmail(user) }); // 111\n //\n if (invite) { // 113\n //\n var invitedBy = Meteor.users.findOne({ _id: invite.invitingUserId }); // 115\n //\n Users.update(user._id, { $set: { // 117\n \"telescope.isInvited\": true, // 118\n \"telescope.invitedBy\": invitedBy._id, // 119\n \"telescope.invitedByName\": Users.getDisplayName(invitedBy) // 120\n } }); //\n //\n Invites.update(invite._id, { $set: { // 123\n accepted: true // 124\n } }); //\n } //\n} //", "title": "" }, { "docid": "070081d138d9ec725bfb8cce498bf8f8", "score": "0.5419706", "text": "function uninvite(who){\n var payload = {};\n payload.requested_user = who;\n\n console.log('*** Client Log message: \\'uninvite\\' payload: '+JSON.stringify(payload));\n socket.emit('uninvite', payload);\n}", "title": "" }, { "docid": "4fe9d92e0dd979a74dd544543232cd3d", "score": "0.54080635", "text": "function procMWInvites()\n{\n\tvar strSection = 'Family invite processing';\n\tlogThis(strSection, 10, 'Processing ' + objMWInviteTextResults.snapshotLength + ' mafia family invite notice(s).', false);\n\tfunction doTimeout(_intCurItem)\n\t{\n\t\tvar fnSendToTimeout = function()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar\tobjSnapshotItem = objMWInviteTextResults.snapshotItem(_intCurItem),\n\t\t\t\t\tstrConfURL_FB = objSnapshotItem.innerHTML.split(\"'\")[3].replace(/&amp;/g, '&'),\n\t\t\t\t\tstrConfURL_Zy = strConfURL_FB.replace(GM_getValue('strMWBaseURL'), GM_getValue('strZyngaBaseURL')),\n\t\t\t\t\telemClickThis = objMWInviteButtonResults.snapshotItem(_intCurItem);\n\t\t\t\t\n\t\t\t\t// this is temp until i get vanity URL's sorted out\n\t\t\t\tif(!/[^\\d]+/.test(strThisFBId))\n\t\t\t\t\tstrConfURL_Zy = strConfURL_Zy.concat('&fb_sig_added=1&fb_sig_user=', strThisFBId);\n\t\t\t\telse\n\t\t\t\t\tstrConfURL_Zy += '&fb_sig_added=0';\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(objErr)\n\t\t\t{\n\t\t\t\tlogError(strSection, 'The values needed to process a mafia family invite have an error.', objErr, true);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tlogThis(strSection, 20, 'Joining a mafia family...', true);\n\t\t\t// the url from the accept button (goes to FB)\n\t\t\tgetURL(strConfURL_FB);\n\t\t\t// next URL\n\t\t\tgetURL(strConfURL_Zy);\n\t\t\t// clicks the ignore button to remove it from the req's page\n\t\t\telemClickThis.click();\n\t\t}\n\t\tsetTimeout(fnSendToTimeout, addDelay(GM_getValue('intDefaultWait')));\n\t}\n\t\n\tfor(var i = 0; i < objMWInviteTextResults.snapshotLength; i++)\n\t{\n\t\tif(objMWInviteTextResults.snapshotItem(i) == null)\n\t\t\tcontinue;\n\t\telse\n\t\t\tdoTimeout(i);\n\t}\n\tsetTimeout(function(){ logThis(strSection, 20, 'Mafia Wars family invite processing complete.', false); }, addDelay(1));\n}", "title": "" }, { "docid": "135c04efcce4dbdbcfda88349a509573", "score": "0.54043174", "text": "generateMessage (callback) {\n\t\t// decline the invite, which will trigger the message\n\t\tthis.declineInvite(callback);\n\t}", "title": "" }, { "docid": "0c4e2173207932e3573e029bca3f4244", "score": "0.5399702", "text": "function send_invite()\n{\n\t$.ajax({\n\t\turl: 'studygroups/addMember',\n\t\tmethod: 'POST',\n\t\tdata:\n\t\t{\n\t\t\tid: get_group_id(),\n\t\t\tusername: jQuery(\"input[name='username']\").val().trim()\n\t\t},\n\t\tsuccess: function(response)\n\t\t{\n\t\t\talert(\"You have added \" + jQuery(\"input[name='username']\").val() + \" to your group.\");\n\t\t\twindow.location.reload();\n\t\t},\n\t\terror: function(xhr)\n\t\t{\n\t\t\talert(xhr.responseText);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d1e743fdbe7f3799dad35ea7e6db0e12", "score": "0.5387267", "text": "function createInviteLink(domain, meshid, flags, expirehours) {\n return '/agentinvite?c=' + parent.encodeCookie({ a: 4, mid: meshid, f: flags, expire: expirehours * 60 }, parent.invitationLinkEncryptionKey);\n }", "title": "" }, { "docid": "5c57a7a7a05425c90dd1b14cb40d6e97", "score": "0.53623354", "text": "function InviteUserToSteamGroup(group_id)\n{\n\treturn $.ajax({\n\t\turl: 'https://steamcommunity.com/groups/' + input_group_CustomURL + '/memberslistxml',\n\t\tdata: { xml:1 },\n\t\ttype: 'GET',\n\t\tdataType: 'xml'\n\t}).done(function(xml) {\n\t\t$(xml).find('steamID64').each(function(){\n\n\t\t\tvar params = {\n\t\t\t\tjson: 1,\n\t\t\t\ttype: 'groupInvite',\n\t\t\t\tgroup: group_id,\n\t\t\t\tsessionID: g_sessionID,\n\t\t\t\tinvitee: $(this).text()\n\t\t\t};\n\n\t\t\t$.ajax({\n\t\t\t\turl: 'https://steamcommunity.com/actions/GroupInvite',\n\t\t\t\tdata: params,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json'\n\t\t\t}).done(function(data) {\n\t\t\t\tif (data.duplicate) {\n\t\t\t\t\tconsole.log('[' + $(this).text() + '] already invited or currently joined');\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('[' + $(this).text() + '] invited to group');\n\t\t\t\t}\n\t\t\t}).fail(function() {\n\t\t\t\tconsole.log('Ya dun goofed. Try again.');\n\t\t\t});\n\t\t});\n\t}).fail(function() {\n\t\tconsole.log('Ya dun goofed.');\n\t});\n}", "title": "" }, { "docid": "53f44a0f7da6053683bcabe4f9ff25a4", "score": "0.5335969", "text": "function POST_createInvite() {\n it('it should create new invite',\n async () => {\n let response = await chai.request(server)\n .post('/api/v1/invites')\n .set('Authorization', `Bearer ${this.access_token}`)\n .set('content-type', 'application/json')\n .send({\n email: 'success@simulator.amazonses.com',\n name: 'Mr. Test',\n rules: {\n roles: [3]\n }\n });\n response.should.have.status(201);\n\n response.body.should.be.a('object');\n response.body.id.should.be.a('number');\n\n this.invite = response.body;\n return;\n });\n}", "title": "" }, { "docid": "4f55e15ed7cd121465b6cc02427fad9d", "score": "0.53275806", "text": "function sendMessage(textMessages, friendName, message){\n // Fill this in\n \n}", "title": "" }, { "docid": "4024cd21d7449da69f458f01cc190325", "score": "0.53271544", "text": "inviteUserByEmail(email, options = {}) {\n return __awaiter$2(this, void 0, void 0, function* () {\n try {\n return yield _request(this.fetch, 'POST', `${this.url}/invite`, {\n body: { email, data: options.data },\n headers: this.headers,\n redirectTo: options.redirectTo,\n xform: _userResponse,\n });\n }\n catch (error) {\n if (isAuthError(error)) {\n return { data: { user: null }, error };\n }\n throw error;\n }\n });\n }", "title": "" }, { "docid": "4e49ad044bf658fa38167036e04a03e7", "score": "0.532093", "text": "function sendSyncInvitation(syncID, users) {\n var usersJson = Array.from(users);\n $.ajax({\n url: url_to_send_sync_invitation,\n type: 'GET',\n data: {\n syncID: syncID,\n users: usersJson\n },\n success: function (response) {\n },\n error: function (xhr, errmsg, err) {\n }\n }\n )\n}", "title": "" }, { "docid": "25056f706f400aa1cda9af392cb9e361", "score": "0.53138393", "text": "function bindSyncInvitationEvent() {\n userChannel.bind('sync-invited', function (invitation) {\n var requestSyncID = invitation['syncID'];\n var inviter = invitation['username'];\n setToastr(\"toast-bottom-right\", false, \"0\");\n toastr.success(\n inviter + ' wants to sync with you.' +\n '<a class=\"btn btn-success\" style=\"padding-right: 20px; padding-left: 20px;\" onclick=\"replySyncInvitation(\\'' + \"accept\\',\" + '\\'' + requestSyncID + '\\')\">Accept</a>' +\n '<a class=\"btn btn-danger\" style=\"padding-right: 20px; padding-left: 20px;\" onclick=\"replySyncInvitation(\\'' + \"reject\\',\" + '\\'' + requestSyncID + '\\')\">Reject</a> '\n );\n });\n}", "title": "" }, { "docid": "e65580e53aef014a6ddc0dcd109d6dee", "score": "0.52969766", "text": "function invite(roomPK) {\n var invited_username = $('input#id_username').val();\n $('input#id_username').val(\"\");\n $.ajax({\n url: url_to_invite,\n type: 'POST',\n data: {\n room_pk: roomPK,\n username: invited_username,\n csrfmiddlewaretoken: getCSRFToken()\n },\n success: function (json) {\n setToastr(\"toast-bottom-right\", true, \"5000\");\n toastr.success('Invited ' + invited_username);\n },\n error: function (xhr, errmsg, err) {\n setToastr(\"toast-bottom-right\", true, \"5000\");\n toastr.error(\"Failed to invite \" + invited_username);\n }\n }\n )\n}", "title": "" }, { "docid": "695261808850abb77370acb77c05aa8e", "score": "0.5289249", "text": "function sendMessage() {\n /* The below functionality is only needed if the \"To\" field is editable (which it currently isn't\n var toName = trim(document.getElementById('to_field').value);\n if (toName == \"\") {\n msgBox.createDismissibleMessage('Please specify a recipient in the \"To\" field.');\n return;\n }\n */\n\n var subject = trim(document.getElementById('subject_field').value);\n\n var msg = trim(document.getElementById('message_field').value);\n if (msg == \"\") {\n msgBox.createDismissibleMessage('Please specify text in the \"Message\" field.');\n return;\n }\n\n var tempToId = \"\";\n if (toType == \"GROUP\") {\n tempToId = 'group_' + toId;\n } else {\n tempToId = 'person_' + toId;\n }\n var req = opensocial.newDataRequest();\n var message = opensocial.newMessage(msg);\n message.setField(opensocial.Message.Field.TYPE,\n opensocial.Message.Type.PRIVATE_MESSAGE);\n message.setField(opensocial.Message.Field.TITLE, subject);\n\n // not part of api, but in RPC proposal\n var recipients = [ tempToId ];\n message.setField(\"recipients\", recipients);\n\n req.add(socialsite.newPostMessageRequest(\n opensocial.IdSpec.PersonId.VIEWER, message),\n 'resp');\n req.send(handleResponse);\n}", "title": "" }, { "docid": "0edca4ab527dc763214cb60be2d4829d", "score": "0.52843964", "text": "function inviteToOrganization(_x) {\n return _inviteToOrganization.apply(this, arguments);\n}", "title": "" }, { "docid": "665651bf6ff4ae22f3fa14466207d2ba", "score": "0.5274924", "text": "function Send(call, callback){\n var username = call.request.getUsername();\n var channel = call.request.getChannel();\n var msg = call.request.getMsg();\n\n if ((userList.indexOf(username) == -1) || !(channel in channellList)){\n callback(null, {success: false});\n } else {\n var members = channellList[channel];\n for (var i = 0; i < members.length; i++){\n if (!(members[i] in inbox)){\n inbox[members[i]] = [];\n }\n inbox[members[i]].push(\"@\" + channel + \" \" + username + \" : \" + msg);\n }\n let reply = new messages.IsSuccess();\n reply.setSuccess(true);\n callback(null, reply);\n }\n}", "title": "" }, { "docid": "20a941b639fb5d2d6858f3388ddcb85d", "score": "0.5274377", "text": "function uninvite(who) {\n\tvar payload = {};\n\tpayload.requested_user = who;\n\n\tconsole.log('*** Client Log Message: \\'uninvite\\' payload: '+JSON.stringify(payload));\n\tsocket.emit('uninvite',payload);\n}", "title": "" }, { "docid": "f1dbd1b7f19298aaab900cdefa41becd", "score": "0.52718806", "text": "function sendDuelInvite(enemy) {\n (bootstrap.Modal.getInstance(document.getElementById('player-info-screen'))).hide();\n toggleLoadingState(true);\n if(getHealth().current <= 0) {\n toastr.warning(\"You can't start a duel while being unconscious. Regain health by paying a cleric.\", \"Hold up there...\");\n return toggleLoadingState(false);\n }\n else {\n db.collection('users').doc(enemy).update({\n duel_invite: getUserID()\n }).then(() => {\n toggleLoadingState(false);\n showAwaitingDuel(enemy);\n })\n }\n\n}", "title": "" }, { "docid": "5e2eb5fed2542b9f1d842c80b5de4cf4", "score": "0.52619624", "text": "async function sendMessageToParticipants(data) {\n let conversation = await Conversation.findOne({\n roomId: data.activeConversationId\n })\n\n let members = conversation.members;\n\n members = members.filter(function (member) {\n if (!data.fromMeet) return member != data.userId;\n else return member;\n })\n\n members.forEach(member => {\n\n\n let user = sessionManager.getUser(member)\n\n if (user) {\n\n io.to(user.socketId).emit('newMessage', data);\n }\n else\n console.log(\"message not sent\")\n });\n\n\n}", "title": "" }, { "docid": "d16f0540d5661041dbd701ba09645133", "score": "0.52529", "text": "function inviteFriendOpen() {\n\t\t\t\t// We display the invite containers\n\t\t\t\t$(\"#invite\").show();\n\t\t\t\t\n\t\t\t\t// We hide some stuffs\n\t\t\t\t$(\"#invite .mail-info\").hide();\n\t\t\t}", "title": "" }, { "docid": "55180c2225cf59872b15c932f246c976", "score": "0.524942", "text": "constructor() { \n \n InviteInvitable.initialize(this);\n }", "title": "" }, { "docid": "669bdae93e8685d9ac29bdd2a4435a14", "score": "0.5244772", "text": "function declineInvite(groupID, inviteId) \n {\n // decline GId, userId\n axios({\n method: 'post',\n url: 'http://localhost:3005/delete',\n data: {\n GId: groupID,\n id: userId,\n inviteId: inviteId\n }\n }).then((response) => {\n if (response.data.message) {\n }\n });\n\n window.location.reload();\n }", "title": "" }, { "docid": "6a7cb6282e5f863de0d4c6f82bafef37", "score": "0.52396774", "text": "sendActivities(context, activities) {\n return __awaiter(this, void 0, void 0, function* () {\n const responses = [];\n for (let a = 0; a < activities.length; a++) {\n const activity = activities[a];\n if (activity.type === botbuilder_1.ActivityTypes.Message) {\n debug('OUTGOING ACTIVITY', activity);\n // transform activity into the webex message format\n // https://developer.webex.com/docs/api/v1/messages/create-a-message\n const message = {};\n if (activity.channelData && activity.channelData.files) {\n message.files = activity.channelData.files;\n }\n if (activity.text) {\n message.text = activity.text;\n }\n if (activity.channelData && activity.channelData.markdown) {\n message.markdown = activity.channelData.markdown;\n }\n if (activity.conversation && activity.conversation.id) {\n message.roomId = activity.conversation.id;\n }\n else if (!activity.conversation && activity.recipient.id) {\n message.toPersonId = activity.recipient.id;\n }\n else if (activity.channelData && activity.channelData.toPersonEmail) {\n message.toPersonEmail = activity.channelData.toPersonEmail;\n }\n if (activity.attachments) {\n message.attachments = activity.attachments;\n }\n else if (activity.channelData && activity.channelData.attachments) {\n message.attachments = activity.channelData.attachments;\n }\n // @ts-ignore ignore this webex specific field\n if (activity.conversation && activity.conversation.parentId) {\n // @ts-ignore ignore this webex specific field\n message.parentId = activity.conversation.parentId;\n }\n else if (activity.channelData && activity.channelData.parentId) {\n message.parentId = activity.channelData.parentId;\n }\n const response = yield this._api.messages.create(message);\n responses.push(response);\n }\n else {\n // If there are ever any non-message type events that need to be sent, do it here.\n debug('Unknown message type encountered in sendActivities: ', activity.type);\n }\n }\n return responses;\n });\n }", "title": "" }, { "docid": "1b904a8dce62196a1e14da14d4cea700", "score": "0.5234618", "text": "function goDisB() {\r\n\twindow.open (\"https://discord.com/invite/pUzdDsp\" , \"_blank\");\r\n}", "title": "" }, { "docid": "1ee8616170f6d278a5cc202a77a4d6e0", "score": "0.5233756", "text": "function invite_auto() {\n\n\tfailCount = 0;\n\tsuccessCount = 0;\n\tlimitExceeded = false;\n\n\t$(document.createElement('div')).addClass('modal_loading').appendTo('body');\n\n\tif (!invite_verify()) {\n\t\treturn false;\n\t}\n\n\tvar codes = invite_code_list();\n\t$(\"body\").addClass(\"loading\");\n\n\tinvite_send(codes);\n\n\t$(\"body\").ajaxStop(function() {\n\t\tvar self = this;\n\t\tsetTimeout(function() {\n\t\t\t$(self).removeClass('loading');\n\t\t\t$('div.modal_loading').remove();\n\t\t\tvar exceededText = limitExceeded ? \"\\n\\nCould not continue. Invite limit exceeded.\" : '';\n\t\t\talert(\"Invites sent.\\n\\nInvited count: \" + successCount + \"\\nFail count: \" + failCount + exceededText);\n\t\t}, 500);\n\t});\n\n}", "title": "" }, { "docid": "f9efc95d7670ddeb7de9d36648eadfd8", "score": "0.5232676", "text": "function joinConference(sessionDescription) {\n changeStatus('creating call (ringing / waiting answer)');\n\n var request = {\n id : bfVP.lastReqId++,\n jsonrpc : '2.0',\n method : 'verto.invite',\n params : {\n sessid : bfVP.sessionId,\n sdp : sessionDescription.sdp,\n dialogParams : {\n callID : generateGUID(),\n caller_id_name : \"Joel Barba ADMIN\",\n caller_id_number : bfVP.callerNum,\n dedEnc : false,\n destination_number : \"3521-admin\",\n incomingBandwidth : \"default\",\n localTag : null,\n login : bfVP.callerNum + bfVP.login,\n mirrorInput : true,\n outgoingBandwidth : \"default\",\n remote_caller_id_name : \"Outbound Call\",\n remote_caller_id_number : \"1008\",\n screenShare : false,\n tag : \"video-container\",\n useCamera : \"any\",\n useMic : \"any\",\n useSpeak : \"any\",\n useStereo : true,\n useVideo : true,\n userVariables : { email: \"test@test.com\" },\n videoParams : {}\n }\n }\n };\n\n bfVP.WSSObj.send(JSON.stringify(request));\n }", "title": "" }, { "docid": "276e2b2db2d1cc7f3c78a69c19dbd9a6", "score": "0.5228558", "text": "function bindInvitationAcceptedEvent() {\n roomChannel.bind('user_accepted', function (user) {\n var visitorList = $(\".sidebar-nav\");\n var newUserItem =\n '<div class=\"sidebar-user-box\" id=\"' + user['pk'] + '\">' +\n '<img class=\"sidebar-user-photo\" src=\"/static/rooms/img/user.jpeg\"/>' +\n '<p class=\"sidebar-username\">' + user['name'] + '</p>' +\n '<p class=\"sidebar-userstatus online\">online</p>' +\n '</div>';\n visitorList.append(newUserItem);\n allVisitors.add(user['pk']);\n subscribeToVisitorChannel(user['pk']);\n })\n}", "title": "" }, { "docid": "cdc917b05344961752284e89a93dc1a4", "score": "0.5215136", "text": "function openChat() {\n\tdocument.getElementById(\"chatBox\").style.display = \"block\";\n\tdocument.getElementById(\"imgEVA\").style.display = \"none\";\n\n\t//parametri da passare al progetto in C#\n\tvar param = isDev + ' ' + botId + ' ' + lang;\n\t\n\tif (firstStart) {\n\t\t// attraverso la funzione postActivity passiamo il campo name e value al progetto in C#\n\t\tbotChat\n\t\t\t.postActivity({\n\t\t\t\t\tfrom: user,\n\t\t\t\t\tname: \"requestWelcomeMessage\",\n\t\t\t\t\ttype: \"event\",\n\t\t\t\t\tvalue: param\n\t\t\t}).subscribe(() => console.log(\"Evento inviato!\"));\n\n\t\tfirstStart = false;\n\t}\n}", "title": "" }, { "docid": "de87f0ad973cb7ba2abb47923e55a6c2", "score": "0.52128", "text": "function sendMessage(event) {\n var sender = event.sender.id;\n var text = event.message.text;\n\n var apiai = apiaiApp.textRequest(text, {\n sessionId: 'Niimble'\n });\n\n apiai.on('response', (response) => {\n console.log(response)\n var aiText = response.result.fulfillment.speech;\n\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: sender},\n message: z\n\n }\n }, (error, response) => {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n });\n\n apiai.on('error', (error) => {\n console.log(error);\n });\n\n apiai.end();\n}", "title": "" }, { "docid": "7c503176a068c1be8a26744910ae42e3", "score": "0.51997954", "text": "function startDirectMessage() {\n const checkboxes = document.querySelectorAll('input[name=\"dm_user\"]:checked')\n\n let invites = []\n checkboxes.forEach((checkbox) => {\n invites.push(checkbox.value)\n })\n\n fetch('/direct-messages/add', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({invites})\n })\n .then(res => res.json())\n .then(dm => {\n socket.emit('new dm', dm)\n window.location.href = `/direct-messages/${dm._id}`\n })\n}", "title": "" }, { "docid": "a6ac70d92a4864b177f8ec278ec0d476", "score": "0.5196689", "text": "async participate(id) {\n const json = await this.callAPI( 'POST', 'attend/'+id);\n return({ message: json.message });\n }", "title": "" }, { "docid": "ee09ffcdb815df3298ba987c6358f281", "score": "0.5191076", "text": "function send(event) {\n event.preventDefault();\n\n const recipients = document.querySelector(\"#compose-recipients\").value;\n const subject = document.querySelector(\"#compose-subject\").value;\n const body = document.querySelector(\"#compose-body\").value;\n\n\n fetch('/emails', {\n method: 'POST',\n body: JSON.stringify({\n recipients: recipients,\n subject: subject,\n body: body\n })\n })\n .then(response => response.json())\n .then((result) => {\n load_mailbox('sent', result);\n })\n .catch((error) => console.log(error));\n}", "title": "" }, { "docid": "8e6a9248cb7fcc2c91555e216ea48422", "score": "0.519002", "text": "function sendInvitationsToUsers(mailer, userType, moreHome) {\n if(userType == \"Tenant\") {\n var tenantEmails = getTenantEmails(moreHome);\n var homeId;\n if(\"_id\" in moreHome)\n homeId = moreHome._id;\n else\n homeId = moreHome.homeId;\n\n for (var i = 0; i < tenantEmails.length; i++) {\n mailHandler.sendInvitation(mailer, tenantEmails[i], \"Tenant\", homeId, moreHome.address);\n }\n mailHandler.sendInvitation(mailer, moreHome.landlordEmail, \"Landlord\", homeId, moreHome.address);\n //HomeHandler.deleteOldUsersFromHome(tenantEmails, homeId);\n //invitationHandler.deleteOldUsersInvitations(tenantEmails, homeId);\n }\n}", "title": "" }, { "docid": "6faabff5b9d3cadaa4dace13c2a0521c", "score": "0.51894456", "text": "function sendRemindertoLine(webhook, userId, message){\n var options = {\n uri: webhook,\n method: 'POST',\n json: true,\n body: {\n userID: userId,\n message: message\n }\n }; \n request(options, function (error, response, body) {\n if (!error) {\n console.log('Response from client - '+response.body);\n return \"OK\";\n }else {\n console.log('Error from the client - \\n' + error);\n return \"ERROR\";\n }\n });\n}", "title": "" }, { "docid": "f7f059981bd38ee23bda31e4745c9b35", "score": "0.51845497", "text": "function openLinkDialog () {\n let inviteAttributes;\n\n if (roomUrl === null) {\n inviteAttributes = 'data-i18n=\"[value]roomUrlDefaultMsg\" value=\"' +\n APP.translation.translateString(\"roomUrlDefaultMsg\") + '\"';\n } else {\n inviteAttributes = \"value=\\\"\" + encodeURI(roomUrl) + \"\\\"\";\n }\n APP.UI.messageHandler.openTwoButtonDialog(\n \"dialog.shareLink\", null, null,\n `<input id=\"inviteLinkRef\" type=\"text\" ${inviteAttributes} onclick=\"this.select();\" readonly>`,\n false, \"dialog.Invite\",\n function (e, v) {\n if (v && roomUrl) {\n JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');\n emitter.emit(UIEvents.USER_INVITED, roomUrl);\n }\n else {\n JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');\n }\n },\n function (event) {\n if (roomUrl) {\n document.getElementById('inviteLinkRef').select();\n } else {\n if (event && event.target) {\n $(event.target).find('button[value=true]').prop('disabled', true);\n }\n }\n },\n function (e, v, m, f) {\n if(!v && !m && !f)\n JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');\n }\n );\n}", "title": "" }, { "docid": "32474b191e425e8b6b29d6d82b701cf8", "score": "0.51803356", "text": "function findInvites(id) {\r\n return db('invites as i')\r\n .innerJoin('accounts as a', 'i.account_id', '=', 'a.id')\r\n .innerJoin('events as e', 'i.event_id', '=', 'e.id')\r\n .select('i.event_id', 'e.name', 'i.account_id', 'a.username', 'a.firstname', 'a.lastname', 'i.food', 'i.notes', 'i.rsvp')\r\n .where({ event_id: id })\r\n}", "title": "" }, { "docid": "4c70ec9a00954346e0ed4629e8d8d27e", "score": "0.517598", "text": "inviteUser(uid) {\n //ensure that oneMe is initialized\n var inviteUserCloudCallable = database\n .functions()\n .httpsCallable(\"inviteUser\");\n return inviteUserCloudCallable({buid: this.buid, uid: uid})\n .then((result) => {\n return result;\n })\n .catch((err) => {\n return err.message;\n });\n }", "title": "" }, { "docid": "b8544f64ee3456c75850c30e552b8c1f", "score": "0.51745236", "text": "function FriendInvitation(){\n var me = this;\n me.domId = 'invite-other-modal';\n me.validator = new Validator(me.domId);\n $('#invite-others').click(function(){\n $('#invite-other-modal').modal('show');\n $('#'+me.domId+' input[name=\"user-invite-email\"]').focus();\n });\n $('#'+me.domId+' .btn-primary').click(function(){\n me.invite();\n });\n /*\n $('#'+me.domId+' input').keypress(function(e){\n if(e.keyCode == 13){\n me.invite();\n }\n });\n */\n}", "title": "" }, { "docid": "46b549a824d61d453c868cba6a383cb9", "score": "0.51639193", "text": "function handleAgentInviteRequest(req, res) {\n const domain = getDomain(req);\n if ((domain == null) || ((req.query.m == null) && (req.query.c == null))) { parent.debug('web', 'handleAgentInviteRequest: failed checks.'); res.sendStatus(404); return; }\n if ((domain.loginkey != null) && (domain.loginkey.indexOf(req.query.key) == -1)) { res.sendStatus(404); return; } // Check 3FA URL key\n\n if (req.query.c != null) {\n // A cookie is specified in the query string, use that\n var cookie = obj.parent.decodeCookie(req.query.c, obj.parent.invitationLinkEncryptionKey);\n if (cookie == null) { res.sendStatus(404); return; }\n var mesh = obj.meshes[cookie.mid];\n if (mesh == null) { res.sendStatus(404); return; }\n var installflags = cookie.f;\n if (typeof installflags != 'number') { installflags = 0; }\n var showagents = cookie.ag;\n if (typeof showagents != 'number') { showagents = 0; }\n parent.debug('web', 'handleAgentInviteRequest using cookie.');\n\n // Build the mobile agent URL, this is used to connect mobile devices\n var agentServerName = obj.getWebServerName(domain, req);\n if (typeof obj.args.agentaliasdns == 'string') { agentServerName = obj.args.agentaliasdns; }\n var xdomain = (domain.dns == null) ? domain.id : '';\n var agentHttpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified\n if (obj.args.agentport != null) { agentHttpsPort = obj.args.agentport; } // If an agent only port is enabled, use that.\n if (obj.args.agentaliasport != null) { agentHttpsPort = obj.args.agentaliasport; } // If an agent alias port is specified, use that.\n var magenturl = 'mc://' + agentServerName + ((agentHttpsPort != 443) ? (':' + agentHttpsPort) : '') + ((xdomain != '') ? ('/' + xdomain) : '') + ',' + obj.agentCertificateHashBase64 + ',' + mesh._id.split('/')[2];\n\n var meshcookie = parent.encodeCookie({ m: mesh._id.split('/')[2] }, parent.invitationLinkEncryptionKey);\n render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl }, req, domain));\n } else if (req.query.m != null) {\n // The MeshId is specified in the query string, use that\n var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.m.toLowerCase()];\n if (mesh == null) { res.sendStatus(404); return; }\n var installflags = 0;\n if (req.query.f) { installflags = parseInt(req.query.f); }\n if (typeof installflags != 'number') { installflags = 0; }\n var showagents = 0;\n if (req.query.f) { showagents = parseInt(req.query.ag); }\n if (typeof showagents != 'number') { showagents = 0; }\n parent.debug('web', 'handleAgentInviteRequest using meshid.');\n\n // Build the mobile agent URL, this is used to connect mobile devices\n var agentServerName = obj.getWebServerName(domain, req);\n if (typeof obj.args.agentaliasdns == 'string') { agentServerName = obj.args.agentaliasdns; }\n var xdomain = (domain.dns == null) ? domain.id : '';\n var agentHttpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified\n if (obj.args.agentport != null) { agentHttpsPort = obj.args.agentport; } // If an agent only port is enabled, use that.\n if (obj.args.agentaliasport != null) { agentHttpsPort = obj.args.agentaliasport; } // If an agent alias port is specified, use that.\n var magenturl = 'mc://' + agentServerName + ((agentHttpsPort != 443) ? (':' + agentHttpsPort) : '') + ((xdomain != '') ? ('/' + xdomain) : '') + ',' + obj.agentCertificateHashBase64 + ',' + mesh._id.split('/')[2];\n\n var meshcookie = parent.encodeCookie({ m: mesh._id.split('/')[2] }, parent.invitationLinkEncryptionKey);\n render(req, res, getRenderPage('agentinvite', req, domain), getRenderArgs({ meshid: meshcookie, serverport: ((args.aliasport != null) ? args.aliasport : args.port), serverhttps: 1, servernoproxy: ((domain.agentnoproxy === true) ? '1' : '0'), meshname: encodeURIComponent(mesh.name).replace(/'/g, '%27'), installflags: installflags, showagents: showagents, magenturl: magenturl }, req, domain));\n }\n }", "title": "" }, { "docid": "15d92af1680cde15dd1a98f5e2f90bd3", "score": "0.51557773", "text": "function sendApiMessage(sender,event) {\n\tlet text = event.message.text \n\tlet apiai = apiaiApp.textRequest(text, {\n\t\tsessionId: vtoken // use any arbitrary id\n\t});\n apiai.on('response', (response) => {\n\tlet aiText = response.result.fulfillment.speech;\n\n request({\n\t\turl: 'https://graph.facebook.com/v2.6/me/messages',\n\t\tqs: {access_token: token},\n\t\tmethod: 'POST',\n\t\tjson: {\n recipient: {id: sender},\n message: {text: aiText}\n\t\t}\n }, (error, response) => {\n\t\tif (error) {\n\t\t\tconsole.log('Error sending message: ', error);\n\t\t} else if (response.body.error) {\n\t\t\tconsole.log('Error: ', response.body.error);\n\t\t}\n });\n\tconsole.log(aiText)\n\t});\n\n\tapiai.on('error', (error) => {\n console.log(error);\n });\n\n apiai.end();\n}", "title": "" }, { "docid": "d8550be4e2eed8389d073a4a7f1c846b", "score": "0.5153639", "text": "function startCall(target){\n\tvar token = sessionStorage.getItem(\"token\");\n\t\n\tconsole.log(\"Avvio chiamata verso:\", target);\n\t\n\ttargetUser = target;\n\t\n\t//creo una nuova offerta e la invio al signaling server\n\tyourConn.createOffer(function (offer) { \n send({ \n type: \"offer\", \n offer: offer,\n sender: username,\n sender_token: token\n }); \n //Setto la mia local peer description usando l'offerta che mando\n yourConn.setLocalDescription(offer); \n }, function (error) { \n \t \n alert(\"Errore nella creazione dell'offerta.\"); \n //var token = sessionStorage.getItem(\"token\");\n window.location.href = contact_page;\n //redirectWithToken(\"./index_chat.html\");\n \n }); \n\t\n\t\n}", "title": "" }, { "docid": "edd879699adef8b2e9698b31bb7c4c1c", "score": "0.5151921", "text": "sendMessage(newMessage) {\n const messageObject = {\n message: newMessage\n }\n ChatService.sendMessage(this.props.eventID, UserService.getCurrentUser()._id, messageObject)\n .catch((e) => window.confirm(e));\n }", "title": "" }, { "docid": "d17eca709ea3796fef1a6d58913fdd82", "score": "0.5140525", "text": "sendMessage(text) {\n this.currentUser.sendMessage({\n text,\n roomId: this.state.currentRoom.id,\n })\n }", "title": "" }, { "docid": "5f0ea7272f428093a7a963e4c5fe0baf", "score": "0.5126341", "text": "function sendinvite(){\n const conf = prompt(\"Copy Room ID\", window.location.pathname.substr(1));\n}", "title": "" }, { "docid": "3cfc682002de82b3304b319aab063a21", "score": "0.51126117", "text": "function changeInviteElement(inviteKey){\n var inviteData;\n for (var i = 0; i < userArr.length; i++){\n if(inviteKey == userArr[i].uid){\n inviteData = userArr[i];\n break;\n }\n }\n\n var userUid = inviteData.uid;\n var inviteName = inviteData.name;\n var inviteUserName = inviteData.userName;\n var inviteShareCode = inviteData.shareCode;\n var liItemUpdate = document.getElementById(\"user\" + inviteData.uid);\n liItemUpdate.innerHTML = inviteName;\n liItemUpdate.className = \"gift\";\n liItemUpdate.onclick = function (){\n var span = document.getElementsByClassName(\"close\")[0];\n var inviteAdd = document.getElementById('userAccept');\n var inviteDelete = document.getElementById('userDelete');\n var inviteNameField = document.getElementById('userName');\n var inviteUserNameField = document.getElementById('userUName');\n var inviteShareCodeField = document.getElementById('userShareCode');\n\n if(inviteShareCode == undefined) {\n inviteShareCode = \"This User Does Not Have A Share Code\";\n }\n\n inviteNameField.innerHTML = inviteName;\n inviteUserNameField.innerHTML = \"User Name: \" + inviteUserName;\n inviteShareCodeField.innerHTML = \"Share Code: \" + inviteShareCode;\n\n inviteAdd.onclick = function(){\n addInvite(inviteData);\n modal.style.display = \"none\";\n };\n\n inviteDelete.onclick = function(){\n deleteInvite(userUid);\n modal.style.display = \"none\";\n };\n\n //show modal\n modal.style.display = \"block\";\n\n //close on close\n span.onclick = function() {\n modal.style.display = \"none\";\n };\n\n //close on click\n window.onclick = function(event) {\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n };\n }", "title": "" } ]
2139ce77fa23d881bbb14c2acd8ec052
for details on configuring this project to bundle and minify static web assets. Write your JavaScript code.
[ { "docid": "ef9cdf1e8de7acd6a12b2f6f6606c4d8", "score": "0.0", "text": "function getDataById(id) {\n var parametros = { \"id\": id };\n $.ajax(\n {\n data: parametros,\r\n url: '/Curso/consultarById',\r\n type: 'post',\r\n beforeSend: function () { },\r\n success: function (response) {\r\n var curso = response.split('|');\r\n\r\n $('#id_curso').text(curso[0]);\r\n $('#siglas_curso').val(curso[1]);\r\n $('#nombre_curso').val(curso[2]);\r\n $('#creditos_curso').val(curso[3]);\r\n $('#cupos_curso').val(curso[4]);\r\n\r\n $('#modalEdit').modal(\"show\");\r\n }\r\n }\n );\n}", "title": "" } ]
[ { "docid": "fc0a0daa21db820124f53054777e271a", "score": "0.6915525", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['html2canvas.js', 'quill.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/scripts'));\n}", "title": "" }, { "docid": "acab1ea98d6fa20507141bf30f240433", "score": "0.6848662", "text": "function javascript() {\n return gulp.src('src/assets/js/*.js')\n //.pipe($.sourcemaps.init())\n //.pipe($.babel())\n //.pipe($.concat('appfou.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n //.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n }", "title": "" }, { "docid": "578c8873001880bef377536554f124dd", "score": "0.67323774", "text": "function javascript() {\n return gulp.src('./src/scripts/**/*.js')\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('./dist/js/'));\n}", "title": "" }, { "docid": "9a1f329eab396d82728575a8af5f449a", "score": "0.656251", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.distJS));\n}", "title": "" }, { "docid": "cdcb80ec32fa5c0133904a3b729db881", "score": "0.6523141", "text": "function javascript() {\n return gulp.src(PATHS.javascript.vendor.concat(PATHS.javascript.project))\n .pipe($.sourcemaps.init())\n .pipe($.if(!WATCHER, $.babel()))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify({\n \"output\": {\n ascii_only: true\n },\n \"mangle\": false,\n \"compress\": {\n dead_code: false,\n hoist_funs: false\n }\n })))\n .on('error', function (e) {\n console.log(e);\n })\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "title": "" }, { "docid": "58d040d1c919012468e51d14c16d19eb", "score": "0.6499541", "text": "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['vue.js','vue-resource.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/public/js'));\n}", "title": "" }, { "docid": "67dbbaf013b297dc08184205e726948c", "score": "0.64927965", "text": "function jsTask() {\n\treturn src([\n\t\t'node_modules/jquery/dist/jquery.js',\t\n\t\t'node_modules/foundation-sites/dist/js/foundation.js',\n\t\t'./js/**/*.js',\n\t])\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(concat('theme.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest('./assets/'));\n}", "title": "" }, { "docid": "5cdf3c32090c6eed745f190e7b958361", "score": "0.64870816", "text": "function mainJs() {\n notify('Building JS files...');\n return gulp.src('src/js/main/**/*.js')\n .pipe(sourcemaps.init())\n .pipe(uglify())\n .pipe(concat('scripts.min.js'))\n .pipe(plumber())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('_site/assets/js/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/js'));\n}", "title": "" }, { "docid": "c9bea6d4322fd063641677143cb77c33", "score": "0.6483991", "text": "function js() {\n return src(source + 'js/*.js')\n .pipe(concat('main.js'))\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest(destination + 'js'));\n}", "title": "" }, { "docid": "6349d0b792e6331c478387b3a866d417", "score": "0.6456017", "text": "function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }", "title": "" }, { "docid": "a4594829af500b432c0b97ae60500fc5", "score": "0.64070636", "text": "function scripts() {\n var jsFile = [\n \"src/js/jquery.js\",\n \"src/js/script.js\"\n ];\n return gulp\n .src(jsFile, { sourcemaps: true })\n .pipe(plumber())\n .pipe( concat( 'theme.js' ) )\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }))\n .pipe(rename({ suffix: \".min\" }))\n .pipe( uglify())\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }));\n}", "title": "" }, { "docid": "88b4add58e2596a829d24073e303a76f", "score": "0.63733095", "text": "function jsTask () {\n return src(['src/assets/js/**/*.js'])\n .pipe(concat('application.js'))\n .pipe(uglify())\n .pipe(dest('output/js'))\n}", "title": "" }, { "docid": "49b9c64228a8de3b14a759f25c60d7e2", "score": "0.63696456", "text": "function javascript() {\r\n\treturn gulp.src(CONF.PATHS.entries)\r\n\t\t.pipe(named())\r\n\t\t.pipe($.sourcemaps.init())\r\n\t\t.pipe(webpackStream(webpackConfig, webpack2))\r\n\t\t.pipe($.if(PRODUCTION, $.uglify()\r\n\t\t\t.on('error', e => { console.log(e); })\r\n\t\t))\r\n\t\t.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/js'));\r\n}", "title": "" }, { "docid": "faaa4ae7ab4171c568457cce3694853b", "score": "0.63490963", "text": "function minifyJs() {\n\n return gulp.src('./src/assets/js/**/*.js', { matchBase: './src/assets/js/' })\n .pipe(ugly({compress: true}))\n .pipe(gulp.dest('./src/assets/css/'))\n .pipe(browserSynnc.stream());\n}", "title": "" }, { "docid": "8adbbb715f6ae933d3065876b9d13c03", "score": "0.63288784", "text": "function jsFn(){\n\tgulp.src(jsDirectory + '*.js')\n\t.pipe( gulpif( !dev , uglify() ) )\n\t.pipe(plumber())\n\t.pipe(gulp.dest(doc+'assets'+'/js'));\n}", "title": "" }, { "docid": "9085280e01763345fec357592f5d365f", "score": "0.6327119", "text": "function js() {\n\twatch([paths.js + '/**/*.*', '!' + paths.js + '/**/*.min.js'], {ignoreInitial: false}, function () {\n\t\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\t\treturn scripts.forEach(function(obj){\n\t\t\treturn src(obj.src, { sourcemaps: true })\n\t\t\t\t.pipe(plumber({errorHandler: onError}))\n\t\t\t\t.pipe(concat(obj.name))\n\t\t\t\t.pipe(dest(paths.js, { sourcemaps: true }));\n\t\t});\n\t});\n}", "title": "" }, { "docid": "39aeab20448de6498d7564d8c681b821", "score": "0.632227", "text": "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "title": "" }, { "docid": "bd3534acedee90fe0a8586f2e8cd7b92", "score": "0.6311692", "text": "function make_bundle () {\n\t\tconsole.log( chalk.blue('Building Javascript') );\n\n\n\n\t\treturn bundler.bundle()\n\t\t .pipe(source('main.js'))\n\t\t .pipe(bufferify())\n\t\t .pipe(gulpif( args.prod, uglify() ))\n\t\t .pipe(gulp.dest(dir.compiled.js));\n\t}", "title": "" }, { "docid": "b2b65b428aa523770c650a4185bea633", "score": "0.627115", "text": "function optimizeJS() {\n console.log(chalk.yellow('\\n Optimizing files:\\n'));\n\n webpackManifest.assets.forEach((asset) => {\n if ( !asset.name.endsWith('.js') ) {\n return;\n }\n const filename = path.resolve(__dirname, `../public/js/${asset.name}`);\n fs.writeFileSync(\n filename,\n optimizeJs(fs.readFileSync(filename, {encoding: 'utf-8'}))\n );\n });\n\n console.log(' OK');\n}", "title": "" }, { "docid": "ecfd9d9a9e744d860065cfdeddb64655", "score": "0.6269822", "text": "function js()\n{\n var streams = pathConfig.js.map( function( folder )\n {\n return gulp.src(getGlob( folder ) )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint(): $.util.noop() )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint.reporter( 'default' ) : $.util.noop() )\n .pipe( $.util.env.production ? $.uglify() : $.util.noop() )\n .pipe( gulp.dest( folder.dist ) );\n } );\n\n return $.mergeStream( streams );\n}", "title": "" }, { "docid": "cc91fb0ecf860f8bab1f63f013f14b4f", "score": "0.6263955", "text": "function compileJs() {\n return merge(\n // config-theme.js\n src(['src/assets/js/*.js', '!src/assets/js/indonez/*.js'])\n .pipe(beautify({js: {file_types: ['.js']} })) \n .pipe(dest('dist/js')),\n\n // indonez.min.js\n src('src/assets/js/indonez/*.js')\n .pipe(concat('indonez.min.js', {newLine: '\\r\\n\\r\\n'}))\n //.pipe(babel({presets: ['babel-preset-env']}))\n .pipe(minify({minify: true, minifyJS: {sourceMap: false}}))\n .pipe(dest('dist/js/vendors')),\n\n // uikit.min.js\n src('node_modules/uikit/dist/js/uikit.min.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors')),\n\n // js vendors\n src('src/assets/js/vendors/*.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors'))\n )\n}", "title": "" }, { "docid": "ffb927426c25eb5b9d26cdb8d0ce7fda", "score": "0.62177634", "text": "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "title": "" }, { "docid": "c4fe6915d00e86b53b3bff11b0efe84b", "score": "0.6215467", "text": "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "title": "" }, { "docid": "c58a3c78bfbbab29b1a2fde40cfa338e", "score": "0.61572284", "text": "function js() {\n return gulp.src( 'src/assets/js/*' )\n .pipe( gulp.dest( './build/assets/js/' ) );\n}", "title": "" }, { "docid": "29c57474dedee20a2d9e42f2077c5da1", "score": "0.61564255", "text": "function jsTask(){\r\n return src([\r\n files.jsPath\r\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\r\n ])\r\n .pipe(concat('main.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js')\r\n );\r\n}", "title": "" }, { "docid": "5b02a26c1ad7f5910304dd234420a175", "score": "0.61216027", "text": "function minify_app_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/app.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "title": "" }, { "docid": "b4fc983cc749051c4f184f6ecec10a0f", "score": "0.611009", "text": "function jsProd() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest('dist'));\n}", "title": "" }, { "docid": "07af28e97048904efb35322652618202", "score": "0.6098345", "text": "function js() {\n\treturn src( folder.src + 'js/*.js' )\n\t\t.pipe( deporder() )\n\t\t.pipe( concat( 'app.js' ) )\n\t\t//.pipe( uglify() )\n\t\t.pipe( dest( folder.build + 'js' ) )\n}", "title": "" }, { "docid": "2c1df4e3072906e1dd93c726c45cf4b2", "score": "0.6090175", "text": "function js(){\r\n return src(paths.js)\r\n .pipe(concat('scripts.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js'))\r\n .pipe(browserSync.stream());\r\n}", "title": "" }, { "docid": "30f5370c2b8b7f5c699c00e8d42f705e", "score": "0.6078709", "text": "function js() {\n return src(paths.js.src)\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ extname: '.min.js' }))\n .pipe(dest(paths.js.dist))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "df815b742972f1101c28c44f3a5d00c6", "score": "0.60636216", "text": "function js() {\n return browserify(config.src + 'js/main.js', {\n debug: true\n })\n .transform(babelify, {\n presets: [es2015]\n })\n .bundle()\n .on(\n 'error',\n gulp_notify.onError(function(error) {\n return 'Message to the notifier: ' + error.message;\n })\n )\n .pipe(source('main.js'))\n .pipe(buffer())\n .pipe(gulp_sourcemaps.init())\n .pipe(gulp_uglify())\n .pipe(gulp_sourcemaps.write())\n .pipe(gulp_rename('main.min.js'))\n .pipe(gulp.dest(config.assets + 'js/'))\n .pipe(gulp_notify('JS compiled'));\n}", "title": "" }, { "docid": "e229316db8c54b7c0c200e0a30c56f68", "score": "0.60506254", "text": "function jsTask() {\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest(\"dist/js\"));\n}", "title": "" }, { "docid": "ca3980c1844753046d6b8c79cf212015", "score": "0.6049443", "text": "function grind(grunt) {\n\n // grunt.loadNpmTasks('grunt-closure-compiler');\n\n // Project configuration.\n var config = {\n pkg: '<json:../package.json>',\n meta: {\n banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %>\\n' +\n '<%= pkg.homepage ? \"* \" + pkg.homepage + \"\\n\" : \"\" %>' +\n '* Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %>;' +\n ' Licensed <%= _.pluck(pkg.licenses, \"type\").join(\", \") %> */',\n original: '/* View original: <%= pkg.name %>-<%= pkg.version %>.js */'\n },\n lint: {\n files: ['grunt.js', 'js/**/*.js']\n },\n concat: {\n dist: {\n // built dynamically\n // src: ['<banner:meta.banner>', 'public/js/intro.js', 'public/js/*.js', 'public/js/**/*.js', 'public/js/outro.js'],\n src: [],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.js'\n }\n },\n min: {\n dist: {\n src: ['<banner:meta.original>', '<banner:meta.banner>', '<config:concat.dist.dest>'],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.min.js'\n }\n },\n watch: {\n files: '<config:lint.files>',\n tasks: 'lint'\n },\n jshint: {\n options: {\n curly: true,\n eqeqeq: true,\n immed: true,\n latedef: true,\n newcap: true,\n noarg: true,\n sub: true,\n undef: true,\n boss: true,\n eqnull: true,\n browser: true\n },\n globals: {\n jQuery: true,\n jsbin: true\n }\n }\n ,\n 'closure-compiler': {\n frontend: {\n root: 'js/',\n js: '', // completed dynamically\n jsOutputFile: '<%= pkg.name %>-<%= pkg.version %>.min.js',\n sourcemap: '<%= pkg.name %>-<%= pkg.version %>.map',\n options: {\n create_source_map: '<%= pkg.name %>-<%= pkg.version %>.map',\n source_map_format: 'V3',\n compilation_level: 'ADVANCED_OPTIMIZATIONS',\n language_in: 'ECMASCRIPT5_STRICT'\n }\n }\n }\n };\n\n var scripts = require('../scripts.json'),\n scriptsRelative = scripts.map(function (script) {\n return script.substring(1);\n });\n\n config.lint.files = scriptsRelative;\n config.concat.dist.src = scriptsRelative;\n config['closure-compiler'].frontend.js = scripts.map(function (script) {\n return script.substring(4);\n });\n config.concat.dist.src.unshift('js/intro.js');\n config.concat.dist.src.unshift('<banner:meta.banner>');\n config.concat.dist.src.push('js/outro.js');\n\n grunt.initConfig(config);\n // Default task.\n grunt.registerTask('default', 'concat min');\n grunt.registerTask('sourcemap', 'closure-compiler');\n // grunt.registerTask('lint', 'lint');\n\n}", "title": "" }, { "docid": "642d8bd9b0952fefbb61e40eea541fbc", "score": "0.60355526", "text": "function scripts() {\n return (\n gulp\n .src(javascript_sources)\n .pipe(sourcemaps.init())\n .pipe(concat('concat.js'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(rename('package.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(browsersync.stream())\n );\n}", "title": "" }, { "docid": "27f005f68364ec98957877da60394633", "score": "0.6003325", "text": "function minifyJs() {\n return Elixir.Plugins.uglify(\n Elixir.config.js.uglify.options\n );\n}", "title": "" }, { "docid": "973348bb990b242bdced902ec173b10e", "score": "0.59810793", "text": "function js() {\n return gulp.src(path.src.js)\n .pipe(uglify())\n .pipe(concat('main.js'))\n .pipe(gulp.dest(path.build.js))\n .pipe(reload({stream:true}))\n}", "title": "" }, { "docid": "5a5d4a08b35164323604f39bc7170860", "score": "0.5958248", "text": "function js() {\n return gulp.src(jsFiles)\n .pipe(concat(\"main.js\"))\n .pipe(uglify({\n mangle: {\n toplevel: false\n }\n }))\n .pipe(gulp.dest(\"./dist/js\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "87bcb6b35b4f4af2b24516d2e51cfc43", "score": "0.59455234", "text": "function script(cb) {\n src(js.in)\n .pipe(sourcemaps.init())\n // .pipe(concat(\"app.js\")) //Will make all seperate file.\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(js.out))\n watch(js.watch, series(script, browsersync.reload))\n cb()\n}", "title": "" }, { "docid": "bd8b4443d0004197477ef53065dab1f1", "score": "0.59314704", "text": "function bundle(name){\n var path = 'client/' + name + '/index';\n var js = path + '.js';\n var css = path + '.css';\n var scss = path + '.scss';\n var dest = 'build/bundles/' + name;\n var assets_source = 'client/common/branding/assets';\n var assets_destination = dest + '/assets';\n\n function build(){\n // browserify\n browserifyFile(js, dest);\n // sass\n sassFile(scss, dest);\n //assets\n assets(assets_source, assets_destination);\n }\n\n function watch(){\n // browserify\n browserifyFile(js, dest, {watch:true});\n\n // sass\n sassFile(scss, dest)\n gulp.watch('client/' + name + '/**/*.scss', function(){\n return sassFile(scss, dest, {watch:true});\n });\n }\n\n return {\n build: build,\n watch: watch\n }\n}", "title": "" }, { "docid": "58e31ea024f454cf7ea9201c3d4a3158", "score": "0.59300417", "text": "cleanScript(jsfile) {// N/A in web\n }", "title": "" }, { "docid": "3add1517df0b8d51230acc1902c1ba26", "score": "0.5925926", "text": "function compressJS(callB) {\n pump([\n gulp.src(\"./js/*.js\", {\n sourcemaps: true\n }),\n uglify(),\n concat('main.min.js'),\n gulp.dest(\"./bundle\")\n ],\n callB\n );\n}", "title": "" }, { "docid": "d1e0db61d81e5db151fa93b0139cbe5a", "score": "0.5923297", "text": "function combineJs() {\r\n return gulp\r\n .src(configJs.src)\r\n .pipe(concat('site.min.js'))\r\n .pipe(uglify())\r\n .pipe(header(banner))\r\n .pipe(gulp.dest('./wwwroot/js/'))\r\n}", "title": "" }, { "docid": "7ae4b767dda559a8207602844d583aa6", "score": "0.5911481", "text": "function bundle_js(bundler) {\n\treturn b.bundle()\n\t\t.on('error', map_error)\n\t\t.pipe(source('app.js'))\n\t\t.pipe(buffer())\n\t\t.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n\t .pipe(sourcemaps.write('../js/maps')) // writes .map file\n\t .pipe(gulp.dest(project.theme.js_dist))\n\t .pipe(livereload());\n}", "title": "" }, { "docid": "732437c7b13d6e0b420d11fe42ae5084", "score": "0.5897469", "text": "function kia_promo_scripts_promo() {\n\treturn src(projects.kia_promo.scripts_promo.src)\n\t.pipe(concat(projects.kia_promo.scripts_promo.output))\n\t// .pipe(uglify()) // Minify js (opt.)\n\t.pipe(header(projects.kia_promo.forProd))\n\t.pipe(dest(projects.kia_promo.scripts_promo.dest))\n\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "86d4efefbf25172fdf335c1d8b23b9f8", "score": "0.58960074", "text": "function jsTask() {\n\n return src(files.jsPath)\n\n .pipe(concat('script.js'))\n\n .pipe(minify())\n\n .pipe(dest('src/js'));\n\n}", "title": "" }, { "docid": "b1dabf6dde61d1ff01b92d32db29e209", "score": "0.58904594", "text": "function jsTask(){\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest('./docs/**/*.js'))\n .pipe(browserSync.reload({stream:true}))\n}", "title": "" }, { "docid": "36027a1462e675afd8de167c005319b6", "score": "0.5890062", "text": "function jsTask() {\n return src(files.jsPath)\n .pipe(babel())\n .pipe(conCat('main.js'))\n //terser minifies the files after concat put them togheter\n .pipe(terser())\n .pipe(dest('pub/js'));\n}", "title": "" }, { "docid": "00187488d80cf016feb40d937cba1b5a", "score": "0.58839405", "text": "function scripts() {\n return (\n gulp\n .src([\"./assets/js/**/*\"])\n .pipe(newer(\"./docs/assets/js\"))\n .pipe(babel({presets: ['@babel/preset-env']}))\n .pipe(minify({noSource: true, ext: {min: '.min.js'}}))\n .pipe(gulp.dest(\"./docs/assets/js/\"))\n );\n}", "title": "" }, { "docid": "4244144cc41ac4d08028c5d61ad710bc", "score": "0.58736825", "text": "function javaScriptDevlopmentBuild(cb) {\r\n return src(javaScriptSource)\r\n .pipe(concat('app.js'))\r\n .pipe(rename({\r\n extname: '.min.js',\r\n }))\r\n .pipe(dest(javaScriptDestination));\r\n cb();\r\n}", "title": "" }, { "docid": "89ce93464031ff87d0d9493ef11bb273", "score": "0.5868685", "text": "function js() {\n return src(PATHS.src.js.files, {\n sourcemaps: true\n })\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(uglify())\n .pipe(dest(PATHS.public.js.folder))\n}", "title": "" }, { "docid": "d20845ed87779d7f74c3e4863e96a040", "score": "0.5835549", "text": "function buildJS(cb) {\n src([\"src/js/main.js\"]).pipe(concat(\"main.js\")).pipe(dest(destFolderJS));\n\n cb();\n}", "title": "" }, { "docid": "605f935bcb0b8ae7a7cd81002de0ab2d", "score": "0.5835282", "text": "function buildJS() {\n const bundler = browserify('src/assets/js/app.js').transform(\n 'babelify',\n { presets: ['@babel/preset-env'],\n plugins: [\"@babel/transform-runtime\"]\n }\n )\n return bundler.bundle()\n .on('error', handleError)\n .pipe(source('app.js'))\n .pipe(buffer())\n .pipe(terser({\n mangle: false,\n compress: true,\n }))\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest('dist/assets/js/'));\n}", "title": "" }, { "docid": "5fec08315c9dd6050d94c2131f6e4993", "score": "0.5831838", "text": "function process_js() {\n $.util.log($.util.colors.yellow(\"Combining, transpiling, and minifying JavaScript files\\n\"));\n // get js files and attach src to beginning\n var js_import = (function () {\n var js_src = settings.js.src,\n i, arr = [],\n src = settings.js.files;\n\n for (i = 0; i <= src.length - 1; i++) {\n arr.push(js_src + src[i]);\n }\n return arr;\n }());\n\n // compile Babel & combine all js files in folder, starting alphabetically\n var concat = gulp.src(js_import)\n .pipe($.sourcemaps.init())\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.concat(settings.js.name + '.js')).on('error', settings.error)\n .pipe($.babel({\n presets: [['env', {\n modules: false\n }]]\n })).on('error', settings.error);\n\n // minify javascript file\n var ugly = concat.pipe($.clone())\n .pipe($.uglify()).on('error', settings.error)\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.rename(settings.js.name + '.min.js'));\n\n // merge pipes and output separate files with sourcemaps.\n return merge(concat, ugly)\n .pipe($.sourcemaps.write('.'))\n .pipe(gulp.dest(settings.js.dest))\n .pipe(browser_sync.stream());\n}", "title": "" }, { "docid": "5a5dc131659c9e06eee58374ea9e5f9b", "score": "0.5821272", "text": "function JSFormat() {\n\treturn gulp.src(config.js)\n\t\t.pipe(concat('combined.js'))\n\t\t.pipe(gulpif(config.settings.isBuild, uglify()))\n\t\t.pipe(gulp.dest(config.distJS))\n}", "title": "" }, { "docid": "7784a5ec6b8000e7bc997b9f23b72619", "score": "0.58156383", "text": "function vendorJavascript() {\n gutil.log('updating vendor js');\n return gulp.src(PATHS.vendor)\n .pipe($.concat('vendor.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "title": "" }, { "docid": "91780ae8cf6705cfc7992ddf868bcee9", "score": "0.5813143", "text": "function scripts(watch) {\n\tif (watch) {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-watchify\"));\n\t}\n\telse {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-browserify\"));\n\t}\n\t\n\n\t$.glob(config.client.js.srcDir + '/**/*.js', {ignore: config.client.js.srcDir + '/assets/**/*.*'}, function (err, files) { \n\t if (err) {\n\t \tlet errmsg = err.msg || err.message;\n\t\t\t$.gutil.log(chalk.red(\"Error : \") + chalk.blue(errmsg));\n\t }\n\n\t $.gutil.log(chalk.magenta(\"files list : \") + chalk.green(files));\n\n\t let tasks = files.map(entry => {\n\t \t$.gutil.log(chalk.magenta(\"entry file : \") + chalk.green(entry));\n\n\t \tlet filePathFromSrc = $.path.relative(config.client.js.srcDir, entry);\n\t \tlet outputDir = $.path.resolve(config.client.js.outputDir, $.path.dirname(filePathFromSrc));\n\n\t \tlet browserifyOpts = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet browserifyOpts_w_watchify = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t cache: {},\n\t\t packageCache: {},\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet bundler;\n\t \t\n\t \tif(watch) {\n\t \t\tlet opts = $.assign({}, $.watchify.args, browserifyOpts_w_watchify);\n\t \t\t$.gutil.log(chalk.magenta(\"opts : \") + chalk.green(opts));\n\t \t\t\n\t \t\tbundler = $.browserify(opts);\n\t \t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\n\t \t\tbundler = $.watchify(bundler);\n\t \t\t$.gutil.log(chalk.magenta(\"watchify instance started\"));\n\t \t\t}\n\t \t\telse {\n\t \t\t\tbundler = $.browserify(browserifyOpts);\n\t \t\t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\t \t\t}\n\n\t \t\tbundler.transform($.babelify);\n\t \t\t$.gutil.log(chalk.magenta(\"babelify transform done..\"));\n\n\t \tlet bundle = function() {\n\n\t \t\t$.gutil.log(chalk.magenta(\"Inside bundle funtion\"));\n\n\t \t\tlet stream = bundler.bundle();\n\n\t \t\t$.gutil.log(chalk.magenta(\"stream bundle creted\"));\n\t\t\t\t\n\t\t\t\treturn stream.pipe($.source($.path.basename(entry)))\n\t\t\t\t.pipe($.buffer())\n\t\t\t\t.pipe($.plumber({\n\t\t\t\t\terrorHandler: mapError\n\t\t\t\t})) \n\t\t\t\t.pipe($.duration('browserify bundling')) \n\t\t\t\t.pipe($.cache('scripts')) \n\t\t\t\t// .pipe($.changed(config.client.js.outputDir, {extension: '.bundle.js', hasChanged: $.changed.compareSha1Digest}))\t\t\t\t\n\t\t\t\t.pipe($.rename({\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Rename output from to '.bundle.js'\n\t\t\t\t\textname: config.client.js.outputFileBundleExt\n\t\t\t\t})) \n\t\t\t\t.pipe(gulp.dest(outputDir))\t\t\t\t\t\t\t\t\t\t// Save 'bundle.js' to output directory\t\t\t\t\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.init({\t\t\t\t\t\t\t\t\t// loads map from browserify file\n\t\t\t // \tloadMaps: true\n\t\t\t // }), $.gutil.noop())) \t\t\t\t\n\t\t\t // Add transformation tasks to the pipeline here.\n\t\t \t// .pipe($.gulpif(isProduction, $.uglify(), $.gutil.noop()))\t\t\t\t\t\t\t// uglify only whene production environment\n\t\t \t// .pipe($.gulpif(isProduction, $.rename({ extname: config.client.js.outputFileMinExt}), $.gutil.noop()))\n\t\t \t.pipe($.uglify())\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// always uglify regardless of production or development environment\n\t\t \t.pipe($.rename({\n\t\t \t\textname: config.client.js.outputFileMinExt\n\t\t \t}))\n\t\t\t // Transformtions ended here\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.write({destPath: config.client.js.mapDir}), $.gutil.noop())) \t\t// writes .map file\t\t\t \t\n\t\t\t .pipe(gulp.dest(outputDir));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Save 'bundle.min.js' to output directory\n\t\t\t};\n\n\n\t \tif (watch) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add event handlers to watchify bundler\n\t\t \tbundler.on('update', bundle);\n\t\t \tbundler.on('log', $.gutil.log.bind($.gutil)); \t\t\t\t\t\t\t\t// output build logs to terminal\n\t\t \t\t\n\t\t } \t \t\t\t\t\t\n\t \t\n\t \t$.gutil.log(chalk.magenta(\"returning bundle\"));\n\t \treturn bundle();\n\t \n\t });\n\n\t // Call tasks as a merged array stream\n\t $.gutil.log(chalk.magenta(\"calling es.merge\"));\n\t \n\t $.es.merge(tasks).on('end', $.gutil.log.bind($.gutil));\n\t});\n}", "title": "" }, { "docid": "86dd91074f47642aaeb75f5f9a42f2d3", "score": "0.5810293", "text": "function publishJavaScript(done) {\n return gulp.src(\"src/js/**/*\").pipe(gulp.dest(\"dist/js\"));\n}", "title": "" }, { "docid": "dd7eb5533bdb99dd7bae6173a756ed78", "score": "0.57902324", "text": "function prodScripts(){\n return gulp\n .src(config.scripts.src)\n .pipe($.babel())\n .pipe($.concat(config.scripts.bundle))//after babel transpiling\n .pipe($.uglify())//now minify app.js\n .pipe(gulp.dest(config.scripts.dest)); \n}", "title": "" }, { "docid": "ba76f2ca2e7cc0e7d79b46f4b029102f", "score": "0.5790133", "text": "function headJavascript() {\n gutil.log('updating head js');\n return gulp.src(PATHS.head)\n .pipe($.concat('head.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "title": "" }, { "docid": "f6136f0bcd5841db296275d0104aa523", "score": "0.57830465", "text": "function compileFiles(appName) {\n\n let stream;\n\n const cssOnly = process.argv.indexOf('--css-only') !== -1;\n const jsOnly = process.argv.indexOf('--js-only') !== -1;\n\n let styles;\n let scripts;\n\n if (cssOnly) {\n\n styles = css();\n\n stream = styles;\n }\n\n if (jsOnly) {\n\n scripts = js();\n\n stream = scripts;\n }\n\n if (!cssOnly && !jsOnly) {\n\n styles = css();\n scripts = js();\n\n stream = merge(styles, scripts);\n }\n\n return stream;\n\n // realiza processos para gerar os arquivos js\n function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }\n\n // realiza processos para gerar os arquivos css\n function css() {\n\n // 1 - pegue o arquivo sass/scss referente ao app\n // 2 - compile o arquivo para css\n // 3 - aplique atributos compatíveis com a versão de browser especificada na propriedade \"browserslist\" do arquivo package.json\n // 4 - crie os arquivos e coloque o compilado css na pasta de destino\n // 5 - minifique o arquivo css\n // 6 - renomeie o arquivo minificado\n // 7 - coloque minificado css na pasta de destino\n let css = gulp.src(`${src.sass}/${appName}.{scss,sass}`)\n .pipe(sassCompiler().on('error', sassCompiler.logError))\n .pipe(autoprefixer())\n .pipe(csso())\n .pipe(rename({ extname: '.min.css' }))\n .pipe(gulp.dest(dest.css));\n\n if (uploadFiles) {\n\n // aplique a stream de upload de arquivos\n css = upload(css, dest.css);\n }\n\n return css;\n }\n}", "title": "" }, { "docid": "597dab66eab412a654c93b7902a66305", "score": "0.5777929", "text": "function scriptsCSSans() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js'])\n .pipe(concat('cssans.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./dist/'))\n );\n}", "title": "" }, { "docid": "9f2ad9132854bf876adc46ffde6b5dc2", "score": "0.5772717", "text": "function jsProd() {\n\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\n\tscripts.forEach(function(obj){\n\t\tsrc(obj.src)\n\t\t\t.pipe(concat(obj.name))\n\t\t\t.pipe(uglify())\n\t\t\t.pipe(dest(paths.js));\n\t});\n\n\treturn Promise.resolve('the value is ignored');\n}", "title": "" }, { "docid": "5ba07eeb4ea5164ddf4f875d06e92730", "score": "0.57726765", "text": "function bundler(options) {\n var allFiles = {};\n var bundles = {};\n var dir = options.src;\n var dest = options.dest;\n var resourcesFile = options.resourceJson;\n var indexBundles = options.indexBundles;\n var titleIndexBnudles = {};\n var traversed_bundles = {}, traversed_files = {}, excluded_bundles = {};\n var resourcesJs = {};\n for (var key in options) {\n resourcesJs[key] = options[key];\n }\n resourcesJs.bundles = bundles;\n\n function getFiles(packageName, files, bundledFile, includedBundles) {\n if (!traversed_bundles[packageName] && !excluded_bundles[packageName]) {\n traversed_bundles[packageName] = true;\n var bundle = resourcesJs.bundles[packageName];\n if (bundle) {\n bundle.bundled = bundle.bundled || [];\n bundle.bundled_html = bundle.bundled_html || [];\n bundle.in = bundle.in || [];\n for (var i in bundle.on) {\n files = getFiles(bundle.on[i], files, bundledFile, includedBundles);\n }\n for (var j in bundle.js) {\n var _file2 = cleanURL(dir + \"/\" + bundle.js[j]);\n if (!traversed_files[_file2]) {\n files.js.push(_file2);\n traversed_files[_file2] = packageName;\n }\n }\n if (files.js.length > 0) {\n bundle.bundled.push(bundledFile + \".js\");\n }\n\n for (var i in bundle.html) {\n var _file = cleanURL(dir + \"/\" + bundle.html[i]);\n if (!traversed_files[_file]) {\n files.html.push(_file);\n traversed_files[_file] = packageName;\n }\n }\n if (files.html.length > 0) {\n bundle.bundled_html.push(bundledFile + \".html\");\n }\n\n includedBundles.push(packageName);\n }\n }\n return files;\n }\n\n if (TASK_BUNDLIFY || TASK_SCAN) {\n grunt.file.recurse(dir, function(abspath, rootdir, subdir, filename) {\n if (filename === \"module.json\" && abspath.indexOf(dest) !== 0) {\n var packageInfo = {};\n if (grunt.file.exists(subdir + \"/.bower.json\")) {\n var bowerJson = grunt.file.readJSON(subdir + \"/.bower.json\");\n packageInfo.bowerName = bowerJson.name;\n packageInfo.bowerVersion = bowerJson.version;\n }\n if (grunt.file.exists(subdir + \"/composer.json\")) {\n var composerJson = grunt.file.readJSON(subdir + \"/composer.json\");\n packageInfo.composerName = composerJson.name;\n packageInfo.composerVersion = composerJson.version;\n }\n var _bundles = grunt.file.readJSON(abspath);\n var packageName = _bundles.name;\n if (_bundles.exclude) {\n for (var i in _bundles.exclude) {\n excluded_bundles[_bundles.exclude[i]] = true;\n }\n }\n if (packageName !== undefined) {\n titleIndexBnudles[packageName] = [];\n for (var bundleName in _bundles) {\n if ((bundleName === packageName || bundleName.indexOf(packageName + \"/\") === 0) && !excluded_bundles[bundleName]) {\n if (bundles[bundleName]) {\n console.log(\"====Duplicate Package\", bundleName);\n } else if (!toIgnore(bundleName)) {\n titleIndexBnudles[packageName].push(bundleName);\n }\n bundles[bundleName] = { js: [], on: [], css: [], html: [], packageInfo: packageInfo};\n for (var file_i in _bundles[bundleName].js) {\n var js_file = subdir + \"/\" + _bundles[bundleName].js[file_i];\n bundles[bundleName].js.push(js_file);\n if (!allFiles[js_file]) {\n allFiles[js_file] = js_file;\n } else {\n console.log(\"====Duplicate File\" + js_file);\n }\n }\n for (var file_j in _bundles[bundleName].css) {\n var css_file = subdir + \"/\" + _bundles[bundleName].css[file_j];\n bundles[bundleName].css.push(css_file);\n if (!allFiles[css_file]) {\n allFiles[css_file] = css_file;\n } else {\n console.log(\"====Duplicate File\" + css_file);\n }\n }\n for (var file_k in _bundles[bundleName].html) {\n var html_file = subdir + \"/\" + _bundles[bundleName].html[file_k];\n bundles[bundleName].html.push(html_file);\n if (!allFiles[html_file]) {\n allFiles[html_file] = html_file;\n } else {\n console.log(\"====Duplicate File\" + html_file);\n }\n }\n bundles[bundleName].on = _bundles[bundleName].on || [];\n console.log(\"╬═╬ Module.json\", abspath);\n //console.log(bundleName, _bundles[bundleName].on);\n }\n }\n }\n }\n });\n\n\n var titleIndexBnudlesNames = Object.keys(titleIndexBnudles);\n\n if (options.modulize) {\n titleIndexBnudlesNames.map(function(bundName) {\n if (!bundles[bundName] && !toIgnore(bundName)) {\n bundles[bundName] = { js: [], on: titleIndexBnudles[bundName], css: [], html: [], packageInfo: {}};\n console.log(\"New Package \", bundName, bundles[bundName]);\n }\n });\n }\n\n for (var packageKey in excluded_bundles) {\n delete bundles[packageKey];\n }\n\n var firstIndexBundled = null;\n\n if (!TASK_SKIP_INIT) {\n var myIndexBnudles = indexBundles;\n if (TASK_BUNDLIFY) {\n\n var moreBundles = Object.keys(bundles);\n\n if (options.sort) {\n moreBundles = moreBundles.sort();\n }\n\n if (options.projectPrefix !== undefined) {\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles).filter(function(bundleName) {\n return bundleName.indexOf(options.projectPrefix) === 0;\n })));\n }\n\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles))).filter(function(bundleName) {\n return !toIgnore(bundleName);\n });\n\n }\n console.log(\"Bundles in Order\", myIndexBnudles);\n\n var prevBundle = null;\n myIndexBnudles.forEach(function(bundleName) {\n var _bundleMap = {};\n var includedBundles = [];\n var bundledFile = dest + \"/bootloader_bundled/\" + bundleName.split(\"/\").join(\".\");\n var bundledFile_js = bundledFile + \".js\";\n var files = getFiles(bundleName, {js: [], html: []}, bundledFile, includedBundles);\n var js_files = uniqueArray(files.js.reverse()).reverse();\n if (js_files.length > 0) {\n if (!firstIndexBundled && options.resourcesInline) {\n firstIndexBundled = bundleName;\n js_files.unshift(resourcesFile + \".js\");\n }\n _bundleMap[bundledFile_js] = js_files;\n //console.log(\"files\",bundleName,files.length,files);\n setBundleConfig(bundleName, _bundleMap, includedBundles, bundledFile_js);\n\n if (prevBundle && options.order) {\n var bundle = resourcesJs.bundles[bundleName];\n if (bundle) {\n bundle.on = [prevBundle].concat(bundle.on);\n }\n }\n prevBundle = bundleName;\n\n } else console.log(\"╬═╬ No File in bundle to bundlify thus skipping \", bundleName);\n\n var html_files = uniqueArray(files.html.reverse()).reverse();\n if (html_files.length) {\n var html_file_content = \"\";\n for (var i in html_files) {\n html_file_content += '<script type=\"text/html\" src=\"' + html_files[i] + '\">' + grunt.file.read(html_files[i]).split(\"\\t\").join(\"\")\n .split(\"\\n\").join(\" \")\n .split(\">\").map(function(v) {\n return v.trim();\n }).join(\">\") + '</script>';\n }\n grunt.file.write(bundledFile + \".html\", html_file_content);\n }\n\n });\n\n resourcesJs.gitinfo = grunt.config().gitinfo;\n if (firstIndexBundled) {\n var resJsonString = JSON.stringify({\n RESOURCES_JSON: resourcesJs,\n RESOURCES_FILE: resourcesFile\n }).replace(/\\r?\\n|\\r|\\\\n/g, ' ');\n\n var packed = resJsonString;\n var unpack = \"\";\n if(options.jsonpack){\n var jsonpack = require('jsonpack/main');\n var fs = require(\"fs\");\n unpack = grunt.file.read('node_modules/jsonpack/main.js');\n packed =('(jsonpack.unpack(\\''+jsonpack.pack(resJsonString)+'\\'))');\n }\n\n grunt.file.write(resourcesFile + \".js\", unpack+\";var _BOOTLOADER_CONFIG_=\" + packed);\n resourcesJs.bundles[firstIndexBundled].js.unshift(resourcesFile + \".js\");\n }\n\n grunt.task.run(\"uglify\");\n }\n\n grunt.file.write(resourcesFile, JSON.stringify(resourcesJs));\n\n }\n }", "title": "" }, { "docid": "0ed5b98cfff878c8f0a0484c0ea64517", "score": "0.5771764", "text": "function uglifyScripts(){\n var uglified = uglify.minify(getScripts());\n fs.writeFile(path.join(__dirname, '../', 'preload/scripts.js'), uglified.code, function (err){\n if(err) {\n console.log(err);\n } else {\n console.log(\"Scripts combined, minified and saved in:\", 'scripts.js');\n }\n });\n}", "title": "" }, { "docid": "943c55fdb2ae5ea3629ee0fa7ef5e562", "score": "0.5747041", "text": "function jsComp(cb){\n return src(\"./src/js/**/*.js\")\n .pipe(gulpIf(buildEnv === 'prod', uglify()))\n .pipe(conCat('main.min.js'))\n .pipe(dest(buildDir+\"js/\"))\n cb();\n}", "title": "" }, { "docid": "0c758657b812e193a6ac427bfcb0aa4d", "score": "0.57360554", "text": "function buildScript() \n{\n var path = \"static/js/*.js\", // Path to scripts\n dist = \"static/dist/js\"; // Destiny\n\n // Building script\n return gulp.src(path) // Defning source of js scripts\n .pipe(concat(\"scripts.js\")) // Concating all scripts from path\n .pipe(rename({suffix: '.min'})) // Renaming scripts.js\n .pipe(uglify()) // Uglifying scripts.min.js\n .pipe(gulp.dest(dist)) // Destiny of scripts.min.js\n .pipe(notify({ message: \"Scripts task complete\" })); // Notify when done\n}", "title": "" }, { "docid": "c189edb96e67afbd4a10cca7defe4410", "score": "0.5732868", "text": "function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}", "title": "" }, { "docid": "04b643b2032ed9833573bdbac3768a9a", "score": "0.572466", "text": "function jsTask() {\n return src(files.jsPath)\n .pipe(browserSync.stream())\n // .pipe(uglify())\n .pipe(sourcemapsB.init())\n .pipe(babel())\n .pipe(concatB(\"main.js\"))\n .pipe(sourcemapsB.write(\".\"))\n .pipe(dest('pub/js')\n\n );\n}", "title": "" }, { "docid": "44f56f07c959bae0ddd9cab3773a35f1", "score": "0.5724426", "text": "function uglify() {\n\t\t\tvar settings = config.styles.uglify;\n\n\t\t\treturn gulp.src( settings.src )\n\t\t\t // Deal with errors.\n\t\t\t .pipe( plugins.plumber( {errorHandler: handleErrors} ) )\n\n\t\t\t .pipe( plugins.rename( {suffix: '.min'} ) )\n\t\t\t .pipe( plugins.uglify( {\n\t\t\t\t mangle: false\n\t\t\t } ) )\n\t\t\t .pipe( gulp.dest( settings.dest ) ).on( 'end', function () {\n\t\t\t\t\t\t\tplugins.util.log( plugins.util.colors.bgGreen( 'Scripts are now minified....[uglify()]' ) );\n\t\t\t\t\t\t} )\n\t\t\t .pipe( plugins.notify( {message: 'Scripts are built.'} ) );\n\t\t}", "title": "" }, { "docid": "10c27b60f428c30f522c84723f15130b", "score": "0.57229495", "text": "function scripts() {\n return gulp.src(paths.scripts.src)\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(gulp.dest(paths.scripts.dest));\n}", "title": "" }, { "docid": "36ffb8e43e031f3213db0a33e76caf02", "score": "0.5711866", "text": "function bundle() {\n return b.bundle()\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe(gutil.env.type === 'production' ? uglify() : gutil.noop())\n .pipe(gutil.env.type !== 'production' ? sourcemaps.write('.', {sourceRoot: '/assets/js'}): gutil.noop())\n .pipe(gutil.env.type === 'production' ? gutil.noop() : gulp.dest('./assets/js'))\n .pipe(gutil.env.type === 'production' ? rename({suffix: '.min'}) : gutil.noop())\n .pipe(gutil.env.type === 'production' ? gulp.dest('./assets/js') : gutil.noop())\n .pipe(gutil.env.type === 'production' ? stripDebug() : gutil.noop())\n .pipe(livereload({start: true}));\n}", "title": "" }, { "docid": "d836b20c5a33969afc37a3a528b178c2", "score": "0.56926334", "text": "function scripts() {\r\n return gulp\r\n .src('src/js/**/*.js')\r\n .pipe(plumber())\r\n .pipe(concat('main.js'))\r\n .pipe(terser())\r\n .pipe(gulp.dest('assets/js/'))\r\n .pipe(gulp.dest('_site/assets/js/'))\r\n .pipe(bsync.stream());\r\n}", "title": "" }, { "docid": "01c405c335fa214610663fa78955d305", "score": "0.5688788", "text": "function mainScript( cb ) {\n // A filter to only use scripts in projectScripts - take out vendor scripts\n if ( allScripts.length === 0 ) {\n cb();\n return; \n }\n const noVendorFilter = filter( negatedProjectVendorScripts.concat( config.projectScripts ), {restore: true});\n return checkSrc( allScripts )\n .pipe(sourcemaps.init())\n .pipe( noVendorFilter ) //no babel-ing of vendor files\n .pipe(babel())\n .pipe( noVendorFilter.restore ) //put the vendor files back\n .pipe( concat( config.projectScriptName )) //put all files into single file with projectScriptName\n // .pipe( dest( config.destFolder + '/js')) // copy unminized js to destination - gulp minify appears to keep unminified file in stream\n .pipe( minify({\n ext: {\n min: '.min.js'\n }\n }))\n .pipe(sourcemaps.write('./maps'))\n .pipe( dest( config.destFolder + '/js'));\n}", "title": "" }, { "docid": "3f3f018a18142c8d13bb2036007bb105", "score": "0.5673955", "text": "function jsBuild() {\n return gulp.src(paths.js.src)\n .pipe(uglify({\n mangle: false\n }))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(gulp.dest(paths.js.build))\n .pipe(gulp.dest('_site/javascripts/build'))\n .pipe(browserSync.reload({stream: true}));\n}", "title": "" }, { "docid": "5fa351b90b49371a20be18d9427dad49", "score": "0.56455517", "text": "function scripts (watch, dest) {\n watch = watch || false;\n dest = dest || paths.build;\n\n var options = _.assign({}, watchify.args, {\n entries: ['./src/index.js'],\n standalone: 'datalasso'\n });\n\n if (watch) {\n options.plugin = [watchify];\n options.debug = true;\n }\n\n var b = browserify(options);\n b.transform('jstify', { engine: 'lodash' })\n b.transform(sassr);\n\n bundle = function () {\n return b.bundle()\n .on('error', console.error.bind(console, 'Browserify Error'))\n .pipe(source('datalasso.js'))\n .pipe(buffer())\n .pipe(gulpif(watch, sourcemaps.init({loadMaps: true})))\n .pipe(gulpif(watch, sourcemaps.write('./')))\n .pipe(derequire())\n .pipe(gulp.dest(dest));\n }\n\n b.on('update', bundle);\n b.on('log', console.log);\n\n return bundle();\n}", "title": "" }, { "docid": "df81ff2844d2ae4c36e38a95a6be656d", "score": "0.56415665", "text": "function _generateScriptTags() {\n var root = path.join(__dirname, '../../dist/');\n var files = glob.sync([\n //vendors libraries\n root + \"js/vendors/jquery*.js\",\n root + \"js/vendors/angular.js*\",\n root + \"js/vendors/angular*.js\",\n root + \"js/vendors/*\",\n //application files\n root + \"js/app/**/module.js\",\n root + \"js/app/**/*.js\",\n root + \"js/app/bootstrap.js\",\n root + \"js/templates.js\"\n ]);\n\n return _.reduce(files, function(acc, it) {\n it = it.replace(root, \"\");\n acc.push('<script src=\"' + it + '\"></script>');\n return acc;\n }, []).join(\"\\n\");\n}", "title": "" }, { "docid": "e4861824e7174459bb01c5dfc1b49ad0", "score": "0.5639837", "text": "function scripts() {\n\treturn src([\n\t\t// 'node_modules/jquery/dist/jquery.min.js', // npm vendor example (npm i --save-dev jquery)\n\t\t'docs/js/common.js' // common.js. Always at the end\n\t])\n\t\t.pipe(concat('scripts.min.js'))\n\t\t.pipe(babel({\n\t\t\tpresets: ['@babel/env'],\n\t\t\tplugins: ['@babel/plugin-syntax-import-meta'],\n\t\t}))\n\t\t.pipe(uglify()) // Minify JS (opt.)\n\t\t.pipe(dest('docs/js'))\n\t\t.pipe(browserSync.stream())\n}", "title": "" }, { "docid": "19694b68ffec06f47da36f6aad03e261", "score": "0.56147295", "text": "async function javascript() {\n const bundle = await rollup(rollupConfig);\n\n await bundle.write(rollupConfig.output);\n}", "title": "" }, { "docid": "f01bcbc4c415b6abccdc5defbe529b2d", "score": "0.56106484", "text": "function packageJavascript() {\n return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript');\n}", "title": "" }, { "docid": "8b546e51f54667cee54f7f3801f49c82", "score": "0.5608396", "text": "function jsDev() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(sourcemaps.init())\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('dist'));\n}", "title": "" }, { "docid": "b5fe8c9a0684091481a3d3a0939b8f27", "score": "0.5605554", "text": "function minify_vendor_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/vendor.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "title": "" }, { "docid": "25920bb2b615c11eee67376fdacd77fc", "score": "0.5590238", "text": "function minifyJS(f) {\n console.log(\"Begin Minifying \" + f.name);\n src(f.buildDir + f.buildFileName)\n .pipe(uglify())\n .pipe(extReplace(\".min.js\"))\n .pipe(\n dest(f.buildDir));\n console.log(\"End Minifying \" + f.name);\n}", "title": "" }, { "docid": "8cfb54da9f6b297580c0772efc34bef7", "score": "0.55685174", "text": "function minifyJsTask(d){\r\n return src(files.jsPath)\r\n .pipe(uglify())\r\n .pipe(dest('./dist/js'));\r\n}", "title": "" }, { "docid": "2d5467753158bc11fd6f5d2371b739e8", "score": "0.55632156", "text": "function scriptsSite() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js', './_src/site/js/**/*.js'])\n .pipe(concat('main.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./_includes/assets/'))\n );\n}", "title": "" }, { "docid": "a05f6deea2ea933b4da326faaec1f815", "score": "0.5559857", "text": "function js() {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js'])\n .pipe(gulp.dest(\"./public/bin/js\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "2974b481bf72bce2245e47da5871d063", "score": "0.5552383", "text": "function buildAppJs() {\n\n //Create stream\n var stream = mergeStream(\n gulp.src(config.assets.client.js.app),\n templatesStream(),\n environmentStream()\n ).pipe(ngAnnotate())\n .pipe(wrapper(angularWrapper()));\n\n //Deploying? Don't create source maps\n if (isDeploying) {\n stream = stream\n .pipe(babel({\n //https://babeljs.io/docs/usage/options/\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(wrapper(bannerWrapper()));\n }\n\n //Minifying?\n else if (config.build.app.js.minify) {\n var mapFilter = filter(['!*.map']);\n stream = stream\n .pipe(sourcemaps.init())\n .pipe(babel({\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(mapFilter)\n .pipe(wrapper(bannerWrapper()))\n .pipe(mapFilter.restore());\n }\n\n //Write to public folder and return\n return stream.pipe(gulp.dest(destination + '/js'));\n}", "title": "" }, { "docid": "858d1525939abc9009cab8cc0e463824", "score": "0.5548106", "text": "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "title": "" }, { "docid": "3d4566fa2faf8c0f40ba118b0c3a3842", "score": "0.55446154", "text": "function jsHandler() {\n\treturn gulp.src(\"./app/js/mainscript.js\")\n\t.pipe(babel().on(\"error\", errorHandler))\n\t.pipe(gulp.dest(\"./dist/js/\"))\n\t.pipe(browserSync.stream());\n}", "title": "" }, { "docid": "3b217693fb62eaadc9b783faecfd823b", "score": "0.5541556", "text": "function processJs(jsFiles) {\n var mergedJs = mergeFiles(jsFiles).join(' ');\n var script = replaceDemoModuleWithCodepenModule(mergedJs);\n return script;\n}", "title": "" }, { "docid": "c72099f2f2fa2b419320bfd74cbb8f8b", "score": "0.55399585", "text": "function cons() {\n return src([\n 'src/js/jquery.custom.min.js',\n 'src/js/menu.min.js',\n 'src/js/swiper.custom.min.js',\n ], { sourcemaps: true })\n .pipe(concat('app.min.js'))\n .pipe(dest('dist/', { sourcemaps: true }))\n}", "title": "" }, { "docid": "35d619a51d448076e696d8be050763a4", "score": "0.55288756", "text": "function js() {\n return gulp\n .src(paths.jsSrc)\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(babel())\n .pipe(concat('index.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('./app/js/'))\n .pipe(gulp.dest('./dist/js/'))\n .pipe(browsersync.stream());\n}", "title": "" }, { "docid": "d598ee7afcea8fab1eddf1d8d7207b52", "score": "0.55256754", "text": "function bundle()\n{\n return bundler.bundle()\n // log errors if they happen\n .on( 'error', gutil.log.bind( gutil, 'Browserify Error' ) )\n .pipe( source( 'webplayer.js' ) )\n //\n .pipe( gulp.dest( './dist/js/' ) );\n}", "title": "" }, { "docid": "4d18b57700749d22e46e035060d021ef", "score": "0.5523286", "text": "function smoosher(){\n\n // Compress/concat files for deploy env...\n // Need to run this locally BEFORE deploying\n // to nodejitsu\n require('smoosh').make({\n \"VERSION\": app.locals.app_version,\n \"JSHINT_OPTS\": {\n \"browser\": true,\n \"evil\":true, \n \"boss\":true, \n \"asi\": true, \n \"laxcomma\": true, \n \"expr\": true, \n \"lastsemic\": true, \n \"laxbreak\":true,\n \"regexdash\": true\n },\n \"JAVASCRIPT\": {\n \"DIST_DIR\": \"./public/js\",\n \"dependencies\": [ { \"src\": \"./public/js/bootstrap.js\", \"jshint\": false}, \n { \"src\": \"./public/js/ace.js\", \"jshint\": false}, \n { \"src\": \"./public/js/keybinding-vim.js\", \"jshint\": false}, \n { \"src\": \"./public/js/mode-markdown.js\", \"jshint\": false}, \n { \"src\": \"./public/js/showdown.js\", \"jshint\": false},\n //对于highlight库,没有unpack的js文件\n { \"src\": \"./public/js/highlight.min.js\", \"jshint\": false},\n { \"src\": \"./public/js/socket.io.js\", \"jshint\": false},\n { \"src\": \"./public/js/filemanager.js\", \"jshint\": false},\n { \"src\": \"./public/js/keymaster.js\", \"jshint\": false}],\n \"dillinger\": [ \"./public/js/dillinger.js\" ]\n },\n \"CSS\": {\n \"DIST_DIR\": \"./public/css\",\n \"style\": [ \"./public/css/style.css\" ]\n }\n })\n .done(function(){\n console.log('\\nSmoosh all finished...\\n')\n })\n \n}", "title": "" }, { "docid": "92f58c708f54db3a803b29cfb3614e08", "score": "0.55201685", "text": "function bundle() {\n return w.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('./bundle.js'))\n .pipe(buffer())\n // .pipe(uglify())\n .pipe(gulp.dest('./src/js/'))\n .pipe(connect.reload());\n}", "title": "" }, { "docid": "153c3a3b234e5af1f73d158ae5550fca", "score": "0.550773", "text": "function taskScripts() {\n logSubtask('scripts');\n\n return gulp.src(`${SCRIPTS_SRC}/app.js`)\n .pipe(plumber())\n .pipe(babel(babelConfig))\n .pipe(uglify({ compress: { hoist_funs: false, hoist_vars: false } }))\n .pipe(rollup({\n format: 'cjs'\n }))\n .pipe(gulp.dest(SCRIPTS_DIST));\n}", "title": "" }, { "docid": "1989ff0ee7f776c23743054048d8ee6f", "score": "0.55028313", "text": "function buildJavascript() {\n return rollupStream({\n input: './src/components/App.js',\n output: {\n format: 'es'\n },\n plugins: [\n rollupResolve()\n ]\n })\n .pipe(source('bundle.js'))\n .pipe(gulp.dest('./dist/static'));\n}", "title": "" }, { "docid": "b98c1d79fa022d835a380fb9fd94a017", "score": "0.5500602", "text": "async function optimizeScripts() {\n await gulp\n .src(configProd.optimize.scripts.src)\n .pipe(plumber())\n .pipe(uglify(configProd.optimize.scripts.options))\n .pipe(gulp.dest(configProd.optimize.scripts.dest))\n .pipe(size(configProd.size));\n}", "title": "" }, { "docid": "60570908e0ccb4f8b5685c185bbaa935", "score": "0.54917926", "text": "function scripts() {\n\tvar stream = browserify({\n\t\t\tfullPaths: false,\n\t\t\tentries: paths.src.scripts + 'main.js',\n\t\t\tdebug: config.sourcemaps.scripts,\n\t\t\textensions: config.extensions\n\t\t});\n\n\t// references to the vendors' bundle\n\tconfig.vendors.forEach(function(vendor) {\n\t\tstream.external(vendor);\n\t});\n\n\treturn stream\n\t\t.transform(babelify, { presets: config.presets })\n\t\t.bundle().on('error', errorHandler.bind(this))\n\t\t.pipe(source('main.js'))\n\t\t.pipe(gulp.dest(paths.dist.scripts))\n\t\t.pipe(bsync.reload({stream: true, once: true}));\n}", "title": "" }, { "docid": "8bd2b2db1fc0c9df9f063bbbac19e816", "score": "0.5491406", "text": "async function scripts() {\n\tlet watch = (mode == 'production') ? false : true;\n\n\tconst config = {\n\t\twatch: watch,\n\t\tmode: mode,\n\t\tentry: {\n\t\t\t'main': './src/js/main.js',\n\t\t\t'app': './src/js/app.js',\n\t\t},\n\t\toutput: {\n\t\t\tpath: __dirname,\n\t\t\tfilename: '[name].js'\n\t\t},\n\t\tmodule: {\n\t\t\trules: [\n\t\t\t\t{\n\t\t\t\t\ttest: /\\.vue$/,\n\t\t\t\t\tloader: 'vue-loader'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttest: /\\.scss$/,\n\t\t\t\t\tuse: [\n\t\t\t\t\t\t'vue-style-loader',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tloader: 'css-loader',\n\t\t\t\t\t\t\toptions: { modules: true }\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'sass-loader'\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tplugins: [\n\t\t\tnew VueLoaderPlugin()\n\t\t]\n\t};\n\n\treturn src('./src/js/*.js')\n\t\t.pipe(webpack(config))\n\t\t.pipe(dest('build/js/'))\n\t\t.pipe(browserSync.stream());\n}", "title": "" }, { "docid": "9a3c07739b4fc354420a49539d5f8373", "score": "0.54900545", "text": "function minifyJs() {\r\n\treturn gulp\r\n\t\t.src( paths.js.src )\r\n\t\t.pipe( uglify() )\r\n\t\t.pipe( rename( { suffix: '.min' } ) )\r\n\t\t.pipe( gulp.dest( paths.js.dest ) )\r\n\t\t.on( 'error', notify.onError() );\r\n}", "title": "" }, { "docid": "d945e1494a85a4db980e97ac69077cf8", "score": "0.5489205", "text": "function compileJS() {\r\n var files = [], //eventually an array of all the js to combine\r\n stream,\r\n replacements = jsReplacements || {},\r\n tokens = Object.keys(replacements);\r\n\r\n //add 3rd party javascript to the list of files to be concatenated\r\n if (jsLibs.length > 0) {\r\n files = files.concat(jsLibs);\r\n }\r\n // add our own javascript to the list of files to be concatenated\r\n if (source.js) {\r\n if (source.js.length > 0) {\r\n files = files.concat(source.js);\r\n }\r\n }\r\n // add env properties file to the list\r\n if (source.properties) {\r\n files.push(source.properties);\r\n }\r\n\r\n stream = src(files);\r\n\r\n stream = stream.pipe(sourcemaps.init())\r\n .pipe(concat(jsMain))\r\n .pipe(sourcemaps.write());\r\n\r\n for (let i = 0; i < tokens.length; i++) {\r\n stream = stream.pipe(replace('<%' + tokens[i] + '%>', replacements[tokens[i]]));\r\n }\r\n\r\n return stream.pipe(dest(getJSPath()));\r\n}", "title": "" } ]
8e4ff4c916e06e4482a53dc8f448a718
This function will load locale and then set the global locale. If no arguments are passed in, it will simply return the current global locale key.
[ { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.7249536", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
[ { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.7306232", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.7297949", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "3b4cdc124b2b72fb9808aa324af761bc", "score": "0.7271403", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "f619fe7c32d9997fd0720a00170897bc", "score": "0.72443813", "text": "function getSetGlobalLocale(key,values){var data;\n// moment.duration._locale = moment._locale = data;\nreturn key&&(data=isUndefined(values)?getLocale(key):defineLocale(key,values))&&(globalLocale=data),globalLocale._abbr}", "title": "" }, { "docid": "451a60703e12e7d45cc8b1b425b505c6", "score": "0.7230461", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined$1(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "12e7de0dd8e0c4aff05fb2a9ae2cda85", "score": "0.721812", "text": "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "title": "" }, { "docid": "12e7de0dd8e0c4aff05fb2a9ae2cda85", "score": "0.721812", "text": "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "03a22c3595a9f2f696df1bef3838fabc", "score": "0.72104096", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "7a457012d11b3c6eb8e6ba703b2b0b7e", "score": "0.72068214", "text": "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "e005f5e164f32ba7b442b72f3314ac95", "score": "0.72061193", "text": "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "5bd518a91e533ee8b64c297d91cd436b", "score": "0.72010374", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" } ]
a17e06f3d1da72e396e21c3df22fbad7
Native Navigation Title item
[ { "docid": "1eb102042ea743059258fe8c5a157fea", "score": "0.7482288", "text": "Title(route, navigator, index, navState) {\n let scene = navState.routeStack[index].component;\n return (\n <View style={[hnative_styles.navItem, hnative_styles.navBarTitle]}>\n <Text style={hnative_styles.navBarText}>\n {scene.props.title}\n </Text>\n </View>\n );\n }", "title": "" } ]
[ { "docid": "476215a75a3771023fa71e27f28005e2", "score": "0.6714933", "text": "function getTitle() {\n\tvar html = \"<h2><a href=\\\"http://labs.rampinteractive.co.uk/touchSwipe/\\\">TouchSwipe</a> Demo</h2>\";\n html += \"<h3>to be viewed on touch based devices</h3>\";\n html += \"<h1>\"+getPageName()+\"<span class='navigation_menu pull-right'></span></h1>\";\n \n return html; \n}", "title": "" }, { "docid": "55281c81e6eaf2b3de0bf90c6be703f3", "score": "0.6680908", "text": "setTitle(title: string): void {\n this.title = title;\n\n if (this.isActive) {\n this.router.updateTitle();\n }\n }", "title": "" }, { "docid": "55281c81e6eaf2b3de0bf90c6be703f3", "score": "0.6680908", "text": "setTitle(title: string): void {\n this.title = title;\n\n if (this.isActive) {\n this.router.updateTitle();\n }\n }", "title": "" }, { "docid": "65558f86b784063b5bb4ad8679ba3770", "score": "0.66489005", "text": "function menuTitleClicked(event) {\n\tevent = getEvent(event);\n\tvar source = getSource(event);\n\tvar menu = source.item.parentMenu;\n\tvar pos = findObject(source);\n\tremoveMenus();\n\n\tvar x = pos.x - 15 - pos.scrollLeft;\n\tvar y = pos.y + pos.h + (document.all ? 3 : 4) - pos.scrollTop;\n\tmenu.display(x, y, false, menuZIndexMax);\n}", "title": "" }, { "docid": "6dae51391d024a1648e6b7a101788c81", "score": "0.6637432", "text": "static createInNavigationProfileUnderAppTitle(container) {\n internal.createInVersionCheck(container.model, Text.structureTypeName, { start: \"8.12.0\" });\n return internal.instancehelpers.createElement(container, Text, \"appTitle\", false);\n }", "title": "" }, { "docid": "82d1e47f8badc491e318ddde2e400983", "score": "0.65799546", "text": "function setTitle(h) {\n var t = siteName;\n var ht = NavigationMatrix.getCurrentPage().getAttribute(\"data-title\");\n if (ht == null) {\n var hs = h.split(\"/\");\n for (var i = 0; i < hs.length; i++) {\n t += \" | \" + hs[i];\n }\n } else {\n if (NavigationMatrix.getCurrentSection().getAttribute(\"data-title\") != null) {\n t += \" | \" + NavigationMatrix.getCurrentSection().getAttribute(\"data-title\");\n }\n t += \" | \" + ht\n }\n document.title = t;\n }", "title": "" }, { "docid": "d1483f7b577dedcd843018aac339880a", "score": "0.6532136", "text": "getTitle() {\n if (this.currentIdx >= 0) {\n return this.pages[this.currentIdx].title\n } else {\n return this.options.title\n }\n }", "title": "" }, { "docid": "1d53714b70e82fa4aa9f82312215b010", "score": "0.65151036", "text": "function getTitle() {\r\n\r\n}", "title": "" }, { "docid": "1716ccb1ac0f5836b9053d09586b0bd3", "score": "0.65013355", "text": "setTitle(title) {\n this.title = title;\n if (this.isActive) {\n this.router.updateTitle();\n }\n }", "title": "" }, { "docid": "2e012be89ca606a5b2a7035226fef82c", "score": "0.64976805", "text": "function getHeaderTitle(route){\n const routeName= route.state ? route.state.routes[route.state.index]\n .name :'Tabs'\n\n switch(routeName){\n case 'NewsFeed':\n return 'NewsFeed';\n case 'BucketList':\n return 'BucketList';\n case 'Profile':\n return 'Profile';\n }\n\n}", "title": "" }, { "docid": "9bc3375f4ac029e410490b7389a104a6", "score": "0.646992", "text": "function setTitle(index){\n\t$.title.text = menu[index]['title'];\n}", "title": "" }, { "docid": "94eaac1ab3c395757d09d034c5dc20a0", "score": "0.63670075", "text": "title() { return this }", "title": "" }, { "docid": "d7c56416cac179380b9bd83b128f4a84", "score": "0.63245815", "text": "function getTitle(){\r\n var result=defaultTitle;\r\n var routes=$route.routes;\r\n debugger;\r\n angular.forEach(routes,function(route){\r\n if(route.regexp&&route.regexp.test($location.path())){\r\n result=route.title||defaultTitle;\r\n $rootScope.inportal=route.portal;\r\n return false;\r\n }\r\n });\r\n return result;\r\n }", "title": "" }, { "docid": "5b18fc347c471f8e80f5ca1fad361d67", "score": "0.6311705", "text": "function renderTitle(info){ \n var $element = $(info.el); \n var view = info.view.type;\n var hasClassName = info.event.classNames.length > 0;\n\n if (hasClassName){\n removeTitle($element, view);\n }\n else {\n addDefaultTitle($element, view);\n }\n}", "title": "" }, { "docid": "164c49c9e95cc0e362082faf4979d26b", "score": "0.62994653", "text": "function titleText() {\n let routes = {};\n return {\n name: \"title\",\n register: route => {\n let { name, extra } = route;\n routes[name] = extra && extra.title;\n },\n get: (name, params) => {\n const titleFn = routes[name];\n return titleFn ? titleFn(params) : name;\n },\n reset: () => {\n routes = {};\n }\n };\n}", "title": "" }, { "docid": "0f4c23e03de1415dfd030841221b52d5", "score": "0.62548864", "text": "function getTitle(){\r\treturn aa.env.getValue('Title');\r}", "title": "" }, { "docid": "bb812b5690c4f8d8ec36633a382c4944", "score": "0.62413925", "text": "_getTitle(item) {\n if (item === undefined) {\n return '';\n }\n\n let key;\n if (this.state.isMap) {\n // Extract key/value\n key = item.key;\n item = item.value;\n }\n\n if (this.props.titleProperty) {\n if (this.props.titleProperty === Dropdown.titlePropMapKey) {\n // The map keys are our titles.\n return key;\n }\n\n if (this.props.titleProperty !== Dropdown.titlePropMapValue) {\n // If we have a title property (other than a map value as a title),\n // then dig into our array and retrieve the title from the\n // titleProperty.\n if (item.hasOwnProperty(this.props.titleProperty)) {\n return item[ this.props.titleProperty ];\n }\n }\n }\n\n return typeof item !== 'undefined' ? item : '';\n }", "title": "" }, { "docid": "77f9c29ba38cf921b1da1abaa4601e82", "score": "0.6208829", "text": "static get tag(){return\"site-title\"}", "title": "" }, { "docid": "6142289301dda678981ab319daa848dd", "score": "0.61951923", "text": "static get defaultTitle() { return 'Tools List'; }", "title": "" }, { "docid": "21accd5e27c5e95c7b7177ce79553225", "score": "0.6165896", "text": "function goBackToTitle(){\n\t\n\t\n\tif(currentSection != \"titleScreen\" && isEnabled==true) {\n\t\t\n\t\tcurrentSection = \"titleScreen\";\n\t\t\n\t\ttransition(\"Title\"); \n\t\t\n\t\tsetAllNavsGrey();\n\n\t}\n\t\n\t\n}", "title": "" }, { "docid": "3a078439de7dc78214866c97e7e3ab0c", "score": "0.61467206", "text": "loadTitle() {\n return 'Dashboard About View';\n }", "title": "" }, { "docid": "7617ba018f519d466f93b7724c79181b", "score": "0.61386377", "text": "function getTitle () {\n userdata.title = (document.title);\n}", "title": "" }, { "docid": "7a98ee691b752f1f113a79c06f83fa7f", "score": "0.6131045", "text": "title() {\n return this._data.title ? this._data.title : this._data.name;\n }", "title": "" }, { "docid": "e1734ae4b424e338129331ed07a922b2", "score": "0.6126477", "text": "function getTitle(item) {\n\t\treturn item && item.title._content || '';\t\t\n\t}", "title": "" }, { "docid": "a7fbf8620d4cbb3a71fcd9fd5ece149c", "score": "0.61150014", "text": "static getTitle() {\n if (! this.title) {\n this.title = '';\n }\n return this.title;\n }", "title": "" }, { "docid": "5750829e70e314337f16b12123d11f49", "score": "0.6113143", "text": "renderItemTitle(item) {\n var hasURL = !!item.url\n var title\n if (item.dead) {\n title = '[dead] ' + item.title\n }\n else {\n title = (hasURL ? <a href={item.url}>{item.title}</a>\n : <Link to={`/${item.type}/${item.id}`}>{item.title}</Link>)\n }\n return <div className=\"Item__title\" style={{fontSize: `${SettingsStore.titleFontSize}px`}}>\n {title}\n {hasURL && ' '}\n {hasURL && <span className=\"Item__host\">({parseHost(item.url)})</span>}\n </div>\n }", "title": "" }, { "docid": "4c8bd5e6c8469832c409b6c0c32fd76e", "score": "0.61067677", "text": "static getTitle() {\n return browser.getTitle();\n }", "title": "" }, { "docid": "ff196fb7c922d8cc2866c0ded5cf8bb1", "score": "0.61015123", "text": "updateWindowTitle() {\n let itemPath, itemTitle, projectPath, representedPath;\n const appName = atom.getAppName();\n const left = this.project.getPaths();\n const projectPaths = left != null ? left : [];\n const item = this.getActivePaneItem();\n if (item) {\n itemPath =\n typeof item.getPath === 'function' ? item.getPath() : undefined;\n const longTitle =\n typeof item.getLongTitle === 'function'\n ? item.getLongTitle()\n : undefined;\n itemTitle =\n longTitle == null\n ? typeof item.getTitle === 'function'\n ? item.getTitle()\n : undefined\n : longTitle;\n projectPath = _.find(\n projectPaths,\n projectPath =>\n itemPath === projectPath ||\n (itemPath != null\n ? itemPath.startsWith(projectPath + path.sep)\n : undefined)\n );\n }\n if (itemTitle == null) {\n itemTitle = 'untitled';\n }\n if (projectPath == null) {\n projectPath = itemPath ? path.dirname(itemPath) : projectPaths[0];\n }\n if (projectPath != null) {\n projectPath = fs.tildify(projectPath);\n }\n\n const titleParts = [];\n if (item != null && projectPath != null && this.config.get('core.addCurrentTabToWindowTitle')) {\n titleParts.push(itemTitle, projectPath);\n representedPath = itemPath != null ? itemPath : projectPath;\n } else if (item != null && projectPath != null && !this.config.get('core.addCurrentTabToWindowTitle')) {\n titleParts.push(projectPath);\n representedPath = itemPath != null ? itemPath : projectPath;\n } else if (projectPath != null) {\n titleParts.push(projectPath);\n representedPath = projectPath;\n } else {\n titleParts.push(itemTitle);\n representedPath = '';\n }\n\n if (process.platform !== 'darwin') {\n titleParts.push(appName);\n }\n\n document.title = titleParts.join(' \\u2014 ');\n this.applicationDelegate.setRepresentedFilename(representedPath);\n this.emitter.emit('did-change-window-title');\n }", "title": "" }, { "docid": "43a69003d4d6de3265a51ddd08ad8d8f", "score": "0.6096266", "text": "updatetitles(hashstruct) {\n //this.currentlink\n console.log('top nav hash:', hashstruct);\n if (window.markdownnav) {\n let currentlink = '#' + (hashstruct[0].length > 0 ? hashstruct[0] : this.index);\n let currentlinkindex = window.markdownnav.links.findIndex(x => x.url === currentlink);\n this.navtitle = (currentlinkindex > 0) && (currentlinkindex < window.markdownnav.links.length)\n ? window.markdownnav.links[currentlinkindex].title\n : '';\n //erase activenavitem class\n let activenavitems = window.document.getElementsByClassName('activenavitem');\n for (let item of activenavitems) { item.classList.remove('activenavitem'); }\n //make current link as class activenavitem\n let currentnavitem = window.document.getElementById(currentlink);\n if (currentnavitem) {\n //set class - so it will have different color\n currentnavitem.firstChild.classList.add('activenavitem');\n //show children ul if hidden\n if (currentnavitem.lastChild.className === 'w3-hide') {\n if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.lastChild.previousSibling);\n }\n //show parent ul if hidden\n if (currentnavitem.parentNode.className === 'w3-hide') {\n //do open parent as defined in markdownnav\n if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.previousSibling);\n } else {\n //do open parent of parent\n if (currentnavitem.parentNode.parentNode && currentnavitem.parentNode.parentNode.className === 'w3-hide') {\n if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.parentNode.previousSibling);\n } else {\n //do open parent of parent of parent\n if (currentnavitem.parentNode.parentNode && currentnavitem.parentNode.parentNode.parentNode && currentnavitem.parentNode.parentNode.parentNode.className === 'w3-hide')\n if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.parentNode.parentNode.previousSibling);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "fd4005ad3189c849e2b7d7ee030be918", "score": "0.6094361", "text": "generateBootstrapLink(title) {\n var main = document.createElement('li');\n main.className = 'nav-item';\n\n var a = document.createElement('a');\n a.className = 'nav-link';\n a.innerHTML = title;\n a.href = void(0);\n\n main.append(a);\n\n return main;\n }", "title": "" }, { "docid": "f732a4c0ff6fbeca8f6ad499a3a1264d", "score": "0.6047699", "text": "function titlePage() {\n title.globe();\n title.display();\n}", "title": "" }, { "docid": "a3ac760c78c0f291a329ad8db4865964", "score": "0.60320663", "text": "function renderTOCItem(title) {\n return `\n* [${title}](#${title.toLowerCase()})`\n}", "title": "" }, { "docid": "be75c6779ecef0ab2199b545ba2844c4", "score": "0.6001201", "text": "get title() {\r\n return this.i.fx;\r\n }", "title": "" }, { "docid": "5d918e2c083db2efeece84389fbe6c39", "score": "0.598213", "text": "getTitle(){\n return(this.title);\n }", "title": "" }, { "docid": "ffbc7ff9b5eb55cc64f022ffcbd0b0fa", "score": "0.5980733", "text": "function tabTitle(title) {\n\treturn title;\n}", "title": "" }, { "docid": "1e3c03aeea02b6fd895269058e5059cc", "score": "0.5968039", "text": "updateTitle() {\n let parentRouter = this.parent;\n if (parentRouter) {\n return parentRouter.updateTitle();\n }\n let currentInstruction = this.currentInstruction;\n if (currentInstruction) {\n currentInstruction._updateTitle();\n }\n return undefined;\n }", "title": "" }, { "docid": "3860fbada0660ddc2ede5f33ba2e929e", "score": "0.596365", "text": "function getTitle() {\n var text = $('.active').text();\n $('.panel-title').text(text);\n}", "title": "" }, { "docid": "cd70389cf67772a6c90afdc09de3211a", "score": "0.5957137", "text": "function updateNavButtonLabel() {\n\t\tvar navRecords = structure.navRecords;\n\t\t\n\t\tif (navRecords.length > 0) {\n\t\t\tvar record = navRecords[navRecords.length - 1];\n\t\t\tregistry.byId(\"navButton\").set(\"label\", record.navTitle);\n\t\t\tregistry.byId(\"header\").moveTo = record.from;\n\t\t}\n\t}", "title": "" }, { "docid": "232695c534861a7f5a2632c707a69914", "score": "0.5956696", "text": "get linkTitle() { return this._linkTitle; }", "title": "" }, { "docid": "24ba3a989d915d3c0836981205192382", "score": "0.59560937", "text": "function nameTitle(name)\n{\n if (name == 'URL')\n {\n name = 'All Sites';\n }\n return name;\n}", "title": "" }, { "docid": "279c4623305aae5b53362bd15a20d1e3", "score": "0.5952515", "text": "componentDidMount(props) {\n document.title = 'Jarred Sutton Photography';\n // Adding title page name for accessibility dynamically\n }", "title": "" }, { "docid": "5bde8179b00c0d1f6b0f0b0f5a836bc9", "score": "0.59489703", "text": "getTitle () {\n var entry = this.manEntry();\n return `${ entry.name }(${ entry.section })`;\n }", "title": "" }, { "docid": "0b1fdb69b301e68e0f414e6523de38c5", "score": "0.5947306", "text": "function ApexTitleSubtitle() {}", "title": "" }, { "docid": "fa2941acd5fdd65f367ff950670df969", "score": "0.59426016", "text": "function getTitle(){\t\r\n\treturn xpath(config[location.host].title,document).innerText;\r\n}", "title": "" }, { "docid": "971e6f6e47bd6a71f61c16a0c5c4d5fe", "score": "0.59393674", "text": "onDidChangeTitle() {}", "title": "" }, { "docid": "6b87663e4071bccb77774eb1186739c6", "score": "0.5936925", "text": "setTitle()\n {\n const fileName = this.pathInfo.name;\n const trimmedName = fileName.replace(/\\[.*\\]|\\(.*\\)/g, '').trim();\n\n this.title = trimmedName;\n }", "title": "" }, { "docid": "5a2b23fa57019717cdfeeeec4fdc73a6", "score": "0.5935414", "text": "function setTitle(event) {\n localStorage.setItem(\"mainTitle\", event.target.innerText);\n}", "title": "" }, { "docid": "7e7975e0c7b380725c546d18482f039c", "score": "0.5923858", "text": "_updateTitle () {\n const activeTints = appState.state.colors.blue.filter((tint) => tint.isChecked);\n this._view.title.textContent = generateTitleText(activeTints.length);\n }", "title": "" }, { "docid": "5db1a9b2d532c79f01d7a2576f948606", "score": "0.59076464", "text": "getTitle() {\n\t \treturn this.title;\n\t }", "title": "" }, { "docid": "17dc9859b214944d346875682eee9c89", "score": "0.59053946", "text": "function setHeaderTitle() \n{\n if (appConfiguration.title)\n {\n $(\"#appTitle\").find(\".app-menu-brand\").html(appConfiguration.title);\n $(\"#appTitlePrint\").find(\"p\").html(appConfiguration.title);\n }\n \n $(\"#appTitle\").show();\n}", "title": "" }, { "docid": "df16da70bbd7ba9b1f30fb2100843931", "score": "0.5905277", "text": "getTitle() {\n return this.title;\n }", "title": "" }, { "docid": "12ce28581b476a43ce67269e28fe9689", "score": "0.5897882", "text": "fullTitle () {\n if (this.parent.root) {\n return this.title\n }\n\n return `${this.parent.fullTitle()} ${this.title}`\n }", "title": "" }, { "docid": "08c573f50a00b999d3211fb28daca4f6", "score": "0.5897436", "text": "get title () {\n\t\treturn this._title;\n\t}", "title": "" }, { "docid": "08c573f50a00b999d3211fb28daca4f6", "score": "0.5897436", "text": "get title () {\n\t\treturn this._title;\n\t}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.58913153", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "0a75283b2e5fbb94f3800f92661d8ceb", "score": "0.58913153", "text": "get title() {\n\t\treturn this.__title;\n\t}", "title": "" }, { "docid": "b6b580ca96624c8e90e89d2ae0893312", "score": "0.58912754", "text": "static get title() {\n return title;\n }", "title": "" }, { "docid": "cd74076659dd2aeb142a8fdbe782cd8e", "score": "0.5888155", "text": "selectionHeader(noOfSelection) {\r\n let selectedTitle = 'Selected ' + noOfSelection + ' items';\r\n this.props.navigation.setOptions({\r\n headerTitle: () => {\r\n return (\r\n <View style={styles.selectionHeader}>\r\n <Text style={styles.heading}>{selectedTitle}</Text>\r\n <TouchableOpacity onPress={() => this.getHistoryItems()} >\r\n <MaterialCommunityIcons size={25} style={{ color: '#fff' }} name={'close'} />\r\n </TouchableOpacity>\r\n </View>)\r\n },\r\n headerRight: () => (\r\n <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>\r\n <Menu\r\n ref={this.setMenuRef}\r\n button={\r\n <TouchableOpacity style={styles.moreButton} onPress={this.showMenu} >\r\n <MaterialCommunityIcons size={30} style={{ color: '#fff' }} name={'dots-vertical'} />\r\n </TouchableOpacity>\r\n }\r\n >\r\n <MenuItem onPress={this.selectAll}>Select All</MenuItem>\r\n <MenuItem onPress={this.deleteItems}>Delete</MenuItem>\r\n </Menu>\r\n </View>\r\n )\r\n });\r\n }", "title": "" }, { "docid": "a178b53bdb79c2e361ff3b1fffd9cf43", "score": "0.5886891", "text": "createTitle() {\n if (this._titleTag != false) {\n const titleTag = document.createElement(this._titleTag);\n titleTag.innerHTML = this._titleText;\n this._titleClass.forEach(cssClass => {\n titleTag.classList.add(cssClass);\n });\n document.querySelector(this._parent).append(titleTag);\n }\n }", "title": "" }, { "docid": "9af93dc2b0ebade504f8046678fa8bd9", "score": "0.5877641", "text": "get title() {\n return this._title;\n }", "title": "" }, { "docid": "9af93dc2b0ebade504f8046678fa8bd9", "score": "0.5877641", "text": "get title() {\n return this._title;\n }", "title": "" }, { "docid": "8bd637a82e4ab8d0baf638aa113fb494", "score": "0.5877356", "text": "function setTitle(title) {\n document.getElementById(gs_title_id).innerHTML = title;\n document.getElementById(gs_nav_title_id).innerHTML = title;\n\n if (title == 'GitStrap') {\n document.getElementById(gs_ribbon_id).style.display = 'block';\n }\n}", "title": "" }, { "docid": "a2fedd493716bb2bc30ff2133021e609", "score": "0.5870376", "text": "static createInPageUnderTitle(container) {\n return internal.instancehelpers.createElement(container, Text, \"title\", false);\n }", "title": "" }, { "docid": "cec773f93b9538988d9e22fb187596d5", "score": "0.58620787", "text": "get title() {\n return this._l;\n }", "title": "" }, { "docid": "005bc56edc665043992e600ac5d24ec3", "score": "0.58589405", "text": "title() { return options.title }", "title": "" }, { "docid": "64fde554c79362f236095a92f67c61fa", "score": "0.5856598", "text": "function setTitlePage() {\n ons.getScriptPage().onInit = function () {\n this.querySelector('ons-toolbar div.center').textContent = this.data.title;\n };\n}", "title": "" }, { "docid": "c2f7f7a4c8b9b77315d45f113c0d5639", "score": "0.5849074", "text": "renderTitle() {\n if (this.opts.title) {\n return (\n <View style={[styles.controls.control, styles.controls.title]}>\n <Text\n style={[styles.controls.text, styles.controls.titleText]}\n numberOfLines={1}>\n {this.opts.title || ''}\n </Text>\n </View>\n );\n }\n\n return null;\n }", "title": "" }, { "docid": "747b3d5df85cef952744354aa2aa6fff", "score": "0.5840191", "text": "handleTitleUpdate(evt) {\n const { title: currentTitle, pageType, isCreator } = this.props;\n const { title: stateTitle } = this.state;\n const updatedTitle = stateTitle.replace(/^ +|[\\r\\n\\v\\t]+/g, '');\n\n if (pageType !== \"Home\" && isCreator) {\n if (!updatedTitle) {\n // If title is blank, reset with previous title\n this.setState({ title: currentTitle });\n } else if (updatedTitle !== currentTitle) {\n const { updateItem, item } = this.props;\n if (item.id !== undefined && item.id !== null) {\n updateItem({ id: item.id, name: updatedTitle });\n }\n } else {\n this.setState({ title: updatedTitle });\n }\n }\n }", "title": "" }, { "docid": "27a4d11628add37db358cbcdc22825f6", "score": "0.5834214", "text": "get title() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "4cd08936538afdbc470b9d2accce1a90", "score": "0.58306044", "text": "function setTitle(newTitle) {\n\tdocument.getElementsByTagName('title')[0].innerHTML = newTitle + \" | Eliza Moser's Virtual Gallery\";\n}", "title": "" }, { "docid": "2cad1bd31735ea7cdd576210da9b4bd1", "score": "0.5826517", "text": "function apiTitleHandler() {\n var apiTitle = $(this).text();\n if (apiTitle) {\n if (document.title) {\n document.title = apiTitle + ' - ' + document.title;\n }\n else {\n document.title = apiTitle;\n }\n }\n }", "title": "" }, { "docid": "0bbde652bc4a670514c5c0b1286bcb2e", "score": "0.58135784", "text": "onPagedidEnter(){\n this.toggleTitle(this.data.id);\n }", "title": "" }, { "docid": "8d8f46bf60771dd7b6ee6084cf7b98b6", "score": "0.58083993", "text": "function _title(){return Node();}", "title": "" }, { "docid": "f68e2174681b4ca5dd5566fb147d1304", "score": "0.58062077", "text": "function generateTitle(title) {\n var hasKey = this.$te('route.' + title);\n\n if (hasKey) {\n // $t :this method from vue-i18n, inject in @/lang/index.js\n var translatedTitle = this.$t('route.' + title);\n\n return translatedTitle;\n }\n return title;\n}", "title": "" }, { "docid": "33a199a491d45140f52f77a4a42bba55", "score": "0.57907766", "text": "setTitle(title) {\n this.$setState({ link: title.link, title: title.text });\n return this;\n }", "title": "" }, { "docid": "bc8e3379d2cc8b84818c18c2895d235c", "score": "0.57864153", "text": "title(arg1) {\n /** Create new element */\n const title = new strapped.Title();\n \n /** Add to last container of indicated type */\n if ( typeof arg1 == 'string' && arg1.length > 0 )\n this.last(arg1).append(title);\n else\n this.last('Head').append(title);\n \n /** Allow for call chaining */\n return title;\n }", "title": "" }, { "docid": "e39acdbf3ec99aacfa99f9f0a6ef00be", "score": "0.5778741", "text": "get title() {\r\n return this.getAttribute('title') || '';\r\n }", "title": "" }, { "docid": "95b0e6805c5bc0357dc873ffd1329092", "score": "0.57740635", "text": "function navigate(name){\n var titleDiv = document.getElementById(\"page-title\"),\n contentDiv = document.getElementById(\"content\");\n\n titleDiv.innerHTML = name;\n getPartial(name, function (partial) {\n contentDiv.innerHTML = partial;\n });\n\n setActiveLink(name);\n}", "title": "" }, { "docid": "a6b0177cfbfa0ef1f41ff74cbb840163", "score": "0.5761426", "text": "switchToLoading(title) {\n return title;\n }", "title": "" }, { "docid": "94acdfa2814ebe5226181bdae4e4137f", "score": "0.575887", "text": "function createNavItem(item) {\n let navItem = document.createElement(\"a\");\n navItem.href = item.url;\n let t = document.createTextNode(item.title);\n navItem.appendChild(t);\n navItem.className = \"navItem\";\n let navbar = document.getElementById(\"navItems\");\n navbar.appendChild(navItem);\n}", "title": "" }, { "docid": "d89a2b641dc8d7b1b95bd9c777bd7f2f", "score": "0.5755946", "text": "createPopoverTitle(argument) {\n let title = '<div>' + argument.name +\n '<span class=\"pull-right\" style=\"cursor:pointer\">' +\n '\\u00D7' +\n '</span></div>'\n return title\n }", "title": "" }, { "docid": "df4d64232cd866e30f7fd1783d96cc9c", "score": "0.57539135", "text": "get title()\n {\n return this._title;\n }", "title": "" }, { "docid": "1ee7dd75c1ef2651f74b7c6fb51ea1b9", "score": "0.5753067", "text": "NavLink(to,key,text) {\n return (<IndexLinkContainer to={to}>\n <NavItem eventKey={key}>{text}</NavItem>\n </IndexLinkContainer>)\n }", "title": "" }, { "docid": "899bc6df83bfb0efe17c8f04d9c95a1e", "score": "0.5753022", "text": "function changeTitle(name, page) {\r\n document.getElementById(\"title\").innerText = name + \", #\" + page;\r\n}", "title": "" }, { "docid": "bee1b66733c71b704b903dacaa056053", "score": "0.5752791", "text": "function updateTitle() {\n let strName;\n if (window.calendarItem.isEvent()) {\n strName = window.mode == \"new\" ? \"newEventDialog\" : \"editEventDialog\";\n } else if (window.calendarItem.isTodo()) {\n strName = window.mode == \"new\" ? \"newTaskDialog\" : \"editTaskDialog\";\n } else {\n throw Components.Exception(\"\", Cr.NS_ERROR_NOT_IMPLEMENTED);\n }\n sendMessage({\n command: \"updateTitle\",\n prefix: cal.l10n.getCalString(strName),\n title: document.getElementById(\"item-title\").value,\n });\n}", "title": "" }, { "docid": "8a92b985b7bc80568946717ce94dfcf6", "score": "0.57513577", "text": "function addTitle() {\n var parts = [];\n var offset = text.length;\n self.bookmark.getMatcher().addTitleDescription(0, offset, parts, regions,\n self.score, 0);\n text += parts.join(\"\");\n }", "title": "" }, { "docid": "e3db0e73ba73874d9b966c3d2f5b91d1", "score": "0.57486165", "text": "titleBarLeft() {\n if (this.state.isLoading) {\n return {\n content: <View />\n };\n }\n\n return {\n content: (\n <View>\n <TouchableOpacity\n transparent\n onPress={() => this.pushScreen('canvas.Welcome')}\n >\n <Icon\n type={'MaterialIcons'}\n name={'chevron-left'}\n style={{ color: '#fff', fontSize: platform === 'ios' ? 22 : 24 }}\n />\n </TouchableOpacity>\n </View>\n )\n };\n }", "title": "" }, { "docid": "fefe79480a15a46495747eabd9b78f8d", "score": "0.5739673", "text": "static createInMasterDetailDetailRegionUnderTitle(container) {\n internal.createInVersionCheck(container.model, Text.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Text, \"title\", false);\n }", "title": "" }, { "docid": "83056f880f3534acd1fb4a56b2dd9765", "score": "0.5733084", "text": "get title() {\n return this._title;\n }", "title": "" }, { "docid": "83056f880f3534acd1fb4a56b2dd9765", "score": "0.5733084", "text": "get title() {\n return this._title;\n }", "title": "" }, { "docid": "26a90dcfd179cfca946e17ed585f32c5", "score": "0.5728502", "text": "renderSectionTitle(sectionIndex) {\r\n const {t} = this.props;\r\n return (\r\n <h5 id={this.createNavId(this.state.navIndex, this.state.subNavIndex, sectionIndex)}>\r\n {t(routes.childRoutes[this.state.navIndex].childRoutes[this.state.subNavIndex].sections[sectionIndex].key)}\r\n <Waypoint onEnter={() => {\r\n this.handleSectionSelect(sectionIndex);\r\n }}/>\r\n </h5>\r\n );\r\n }", "title": "" }, { "docid": "4402e647d8f4b00dc2c182b2f049a3e6", "score": "0.5725463", "text": "LeftButton(route, navigator, index, navState) {\n let scene = navState.routeStack[index].component;\n \n if (typeof scene.leftNavigatorItem == 'function') {\n let customLeftItem = scene.leftNavigatorItem();\n if(customLeftItem != undefined) {\n return customLeftItem;\n }\n }\n\n let previousRoute = navState.routeStack[index - 1];\n if (previousRoute == undefined) {\n return null;\n }\n return (\n <TouchableOpacity onPress={()=>navigator.pop()} style={[hnative_styles.navBarButton, hnative_styles.navBarButtonLeft]}>\n <View style={[hnative_styles.navItem]}>\n <Icon name={\"ios-arrow-back\"} size={30} color={\"white\"} />\n </View>\n <View style={hnative_styles.navItem}>\n <Text style={hnative_styles.navBarText}>\n {previousRoute.viewController.props.title}\n </Text>\n </View>\n </TouchableOpacity>\n );\n }", "title": "" }, { "docid": "eca7ecb2b03d98159ae621851e3fa010", "score": "0.5724324", "text": "renderTitle() {\n const margin = this.margin;\n if (!this.title) {\n return null;\n }\n const alignment = this.titleStyle.textAlignment;\n const getAnchor = alignment === 'Near' ? 'start' : alignment === 'Far' ? 'end' : 'middle';\n const titleSize = Object(_syncfusion_ej2_svg_base__WEBPACK_IMPORTED_MODULE_1__[\"measureText\"])(this.title, this.titleStyle);\n const rect = new _syncfusion_ej2_svg_base__WEBPACK_IMPORTED_MODULE_1__[\"Rect\"](margin.left, 0, this.availableSize.width - margin.left - margin.right, 0);\n const options = new _syncfusion_ej2_svg_base__WEBPACK_IMPORTED_MODULE_1__[\"TextOption\"](this.element.id + '_title', titlePositionX(rect, this.titleStyle), this.margin.top + (titleSize.height * 3 / 4), getAnchor, this.titleCollection, '', 'auto');\n const element = textElement$1(this.renderer, options, this.titleStyle, this.titleStyle.color || this.themeStyle.chartTitle, this.svgObject, false, this.redraw);\n if (element) {\n element.setAttribute('aria-label', this.title);\n }\n if (this.subTitle) {\n this.renderSubTitle(options);\n }\n }", "title": "" }, { "docid": "4d583a32b67b74c2d9056d1862deae77", "score": "0.5718064", "text": "function level1(item) {\n if (item.url) {\n if (item.restricted && !isFullACOLUser(user)) {\n return item.prefix ? `${item.prefix} ${item.title}` : item.title;\n }\n\n /* Note regarding t(). Currently, we only need to translate content from the Get Acquainted book\n * for the main library. This doesn't relate to ACOL or prefixes so we don't add translations\n * for those paths.\n */\n return (\n <Link to={item.url} language={language}>\n {item.prefix ? `${item.prefix} ${item.title}` : t(item.title)}\n </Link>\n );\n }\n return <List.Header>{t(item.title)}</List.Header>;\n }", "title": "" }, { "docid": "549271a7e95786669921660f4b86c2d5", "score": "0.5716271", "text": "function eFapsSetTitle(_newTitle) {\n var obj = document.getElementById('eFapsFrameHeaderText');\n obj.firstChild.data=_newTitle;\n top.document.title = _newTitle;\n}", "title": "" }, { "docid": "3aef5fd5105142e08629259b60b3cd8b", "score": "0.57046723", "text": "function changeTheTitleNameWithARandomName() {\n\n}", "title": "" }, { "docid": "bd634e5115484ac468c955775f22edc3", "score": "0.570003", "text": "function getTitle(site) {\r\n\treturn extract(if2(site.titlePath, site.path)).match(site.titlePath ? site.titlePattern : site.pattern)[1].replace(/`/g,\"'\").replace(/\\?/g,\"\").replace(/\\s/g,\"+\");\r\n}", "title": "" }, { "docid": "378cfbe41e2a54c62911f6e7224d2ad0", "score": "0.56983095", "text": "function setHeaderTabItems(navigation) {\n let {routeName} = navigation.state.routes[navigation.state.index];\n let headerTitle = routeName;\n // Adjust header title if necessary\n if (routeName === \"ViewEmployer\") headerTitle = \"View\";\n // Show category menu icon if in home page (+ set route name)\n if (routeName === \"Home\") return {\n headerTitle,\n headerLeft: (\n <FontAwesome.Button\n name=\"navicon\"\n backgroundColor=\"transparent\"\n color=\"black\"\n onPress={() => navigation.push(\"SideMenu\")}\n />\n ),\n headerRight: (\n <MaterialCommunityIcons.Button\n name=\"account\"\n backgroundColor=\"transparent\"\n color=\"black\"\n onPress={() => navigation.push(\"AccountWrapper\")}/>\n ),\n headerTitleStyle: {flex: 1, textAlign: 'center'}\n };\n // For all other screens, do not show category menu icon\n else return {\n headerTitle,\n headerLeft: (\n <View>\n </View>\n ),\n headerRight: (\n <MaterialCommunityIcons.Button\n name=\"account\"\n backgroundColor=\"transparent\"\n color=\"black\"\n onPress={() => navigation.push(\"AccountWrapper\")}/>\n ),\n headerTitleStyle: {flex: 1, textAlign: 'center'}\n };\n}", "title": "" }, { "docid": "f8082d34cc13ba55a76993b1babf1c32", "score": "0.5694968", "text": "function getTitle(data) {\n\t\tvar whereToLook = [\"title\", \"headline\", \"name\", \"h1\", \"h2\", \"h3\", \"text\"]\n\t\tvar prec = whereToLook.length\n\t\tvar title = null;\n\t\tfor (var content in data) {\n\t\t if (data.hasOwnProperty(content)) {\n\t\t\t\tvar xtra_classes_arr = content.split(\".\")\n\t\t\t\tvar content_type = xtra_classes_arr.shift()\n\t\t\t\tvar pos = whereToLook.indexOf(content_type)\n\t\t\t\tif(pos > -1 && pos < prec && data[content]) {\n\t\t\t\t\ttitle = Array.isArray(data[content]) ? data[content].join('.') : data[content]\n\t\t\t\t\tif(xtra_classes_arr.indexOf('html') > -1) { // extra clean html\n\t\t\t\t\t\ttitle = sanitizeHtml(title, {allowedTags: [], allowedAttributes: {} })\n\t\t\t\t\t}\n\t\t\t\t\tprec = pos\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//console.log(\"Storyrevealer::getTitle\", data, title)\n\t\treturn title ? title : 'No title '+_slide_h+'/'+_slide_v+'.'\n\t}", "title": "" }, { "docid": "1a4f5ad775f36b231d9a7d9f7a5350f8", "score": "0.56945723", "text": "function changeRouteTitle(route) {\n if (route === \"PLAY\") {\n return (route = \"game\");\n } else {\n return route;\n }\n }", "title": "" } ]
30ec7c358fe54b5c906a33a5b9c0f880
this puts the experience section into edit mode
[ { "docid": "319f2a4a51168bf74aed4843522b82cc", "score": "0.0", "text": "function updateExperience() {\n document.getElementById(\"updateExp\").classList.add(\"hidden\");\n document.getElementById(\"saveExp\").classList.remove(\"hidden\");\n document.getElementById(\"addExp\").classList.remove(\"hidden\");\n let elements = document.getElementsByClassName(\"experienceFrom\");\n for (let i = 0, len = elements.length; i < len; i++) {\n elements[i].disabled = false;\n }\n let deleteBut = document.getElementsByClassName(\"deleteExp\");\n for (let i = 0, len = deleteBut.length; i < len; i++) {\n deleteBut[i].classList.remove(\"hidden\");\n }\n}", "title": "" } ]
[ { "docid": "98364d06d58b909e095a5b88488d788a", "score": "0.7273155", "text": "function edit_mode(_cb){\n // If we are not currently on 'edit' mode\n if (get_stored_entry(\"mode\") != \"edit\"){\n \tstore_entry(\"edit\",\"mode\");\n \tconsole.log(tool_metadata[\"tab_active\"]+\" : edit mode\");\n }\n _cb();\n}", "title": "" }, { "docid": "abfab9737d84d0677f3c13c9049a42d3", "score": "0.7202063", "text": "function handleEditPress() {\n // Turn on edit mode\n editMode = true;\n }", "title": "" }, { "docid": "cfbb381e54e12b5d244f70554e3286a0", "score": "0.7197233", "text": "enableEditMode() {\n this.currentAppMode = AppMode.EDIT;\n }", "title": "" }, { "docid": "8b2d2b99062d0b227120db0d160aa94c", "score": "0.71836495", "text": "function edit(canEdit = true) {\n document.designMode = canEdit ? 'on' : 'off'\n }", "title": "" }, { "docid": "459f5f07070e09f74482ca7ecec0416e", "score": "0.70441246", "text": "function edit() {\n\n }", "title": "" }, { "docid": "9f8a278a2707194b48d3e610995306cf", "score": "0.7009376", "text": "onInitEditMode() {\n this.addEditorTab('Options', 'public/plugins/gridprotectionalliance-phasormap-panel/partials/editor.html', 2);\n //console.log('init-edit-mode');\n }", "title": "" }, { "docid": "05250f6c0817938ed8f6d61af7bd457c", "score": "0.68964815", "text": "function initEditMode() {\n\n ExpandButton.hide();\n\n $(VideoContainer).css({\n opacity: 1\n });\n\n domElement.find('.infoAreaRight').css({\n opacity: 1\n });\n\n AreaTopContainer.hide();\n AreaTopDetails.hide();\n AreaBottomContainer.hide();\n AreaBottomDetails.hide();\n AreaLeftContainer.hide();\n AreaRightContainer.hide();\n\n domElement.find('.timeline').not('.codeSnippetTimeline, .annotationTimeline').show();\n\n EditingOptions.addClass('active');\n\n domElement.find('.infoAreaRight').show();\n EditPropertiesContainer.show();\n\n Controls.find('.rightControlPanel').hide();\n\n }", "title": "" }, { "docid": "dd19a7842099bae5b6776dd50fb56930", "score": "0.68862545", "text": "function activateEditMode() {\n\n // Close style editor\n closeStyleEditor();\n\n //hide skill percentage value in edit mode\n $('.skillper').hide();\n\n // Destroy the image resizable.\n $('.frameWrapper img').each(function() {\n if ($(this).hasClass('ui-resizable')) {\n $(this).resizable(\"destroy\");\n }\n });\n\n // Make the available items UN-draggable.\n $(\".drag\").each(function() {\n $(this).unbind('click').unbind('hover');\n $(this).hover(function(e) {\n $(this).css({'outline': '', 'cursor': '', 'outline-offset': ''});\n }, function(e) {\n $(this).css({'outline': '', 'cursor': '', 'outline-offset': ''});\n });\n\n if ($(this).hasClass('ui-draggable')) {\n $(this).draggable(\"destroy\");\n }\n });\n\n $('#pageList ul li section').each(function() {\n for (var key in editableItems) {\n $(this).find(key).unbind('mouseenter mouseleave');\n // Remove old click events\n $(this).find(key).unbind('click').unbind('hover');\n if ($(this).prop('tagName') == 'IMG' || $(this).prop('tagName') == 'img') {\n $(this).hover(function() {\n $(this).css({\n 'outline': '',\n 'cursor': ''\n });\n }).each(function() {\n $(this).attr('data-selector', key);\n });\n }\n }\n this.designMode = \"off\";\n $(this).mouseenter(function() {\n $(this).next().show();\n }).mouseleave(function() {\n $(this).next().hide();\n });\n $(this).next().mouseenter(function() {\n $(this).show();\n }).mouseleave(function() {\n $(this).hide();\n });\n });\n\n $('.wrap').on('click', function() {\n if (!((this).hasAttribute('contenteditable'))) {\n $('.frameCover').hide();\n $('ul.redactor-toolbar').remove();\n $('.wrap').removeAttr('contenteditable');\n $('.wrap').removeClass('redactor-editor');\n $('span.redactor-toolbar-tooltip').remove();\n\n $(this).redactor({\n buttons: ['formatting', 'bold', 'italic', 'deleted', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'image', 'file', 'link', 'alignment', 'horizontalrule'],\n imageUpload: siteUrl + 'assets/imageUploadEditor/' + siteID,\n clipboardUploadUrl: siteUrl + 'assets/imageUploadEditor' + siteID,\n focus: true,\n plugins: ['fontfamily', 'fontsize', 'fontcolor', 'table', 'bufferbuttons', 'video'],\n clickToEdit: true,\n replaceDivs: false,\n toolbar: true,\n toolbarFixed: true,\n toolbarFixedTarget: '#screen',\n toolbarFixedTopOffset: 0,\n /*keyupCallback: function(e)\n {\n setPendingChanges(true);\n },*/\n changeCallback: function() {\n setPendingChanges(true);\n },\n codeKeyupCallback: function(e) {\n setPendingChanges(true);\n }\n });\n $('.wrap + textarea').remove();\n $('.wrap').siblings('span').remove();\n $(this).unwrap();\n }\n });\n}", "title": "" }, { "docid": "72f75ce691c584c5353cd20e34c532a8", "score": "0.6875263", "text": "function editItem (object){\n object.showEdit = true;\n }", "title": "" }, { "docid": "04c54d1d24dcb131020025d9c093b9d3", "score": "0.68681854", "text": "onInitEditMode () {\n this.addEditorTab('Options', 'public/plugins/geomap-panel/editor.html', 2);\n }", "title": "" }, { "docid": "cbfe588fa6c63ae812c48f938122742c", "score": "0.6865446", "text": "function editPage() {\n\tvar editables = $$('.page-wide-editable');\n\tvar hidables = $$('.vtbe-output');\n\t\n\t\n\t\n\teditables.each(function(e){e.insert({\n\t\ttop: new Element('input', {type: 'text', value: '', 'class': 'edit-mode-input'})\n\t})});\n\t\n\n\n\n\thidables.each(function(g){\n\t\tg.hide();\n\t})\n\n\tvar inputs = $$('.edit-mode-input');\n\t\n\tvar list_inputs = $$('h3 > .edit-mode-input');\t\n\t\n\tinputs.each(function(f){\n\t\tf.value = f.next('span').childNodes[0].nodeValue;\n\t\tf.next('span').hide();\n\t\t$$('.control-bar')[0].hide();\n\t});\n\t\n\tlist_inputs.each(function(f){f.insert({\n\t\tbefore: new Element('input', {type: 'checkbox', 'class': 'pw-checkbox'})\n\t})});\n\t\n\t\n\t\t\t\n\t\n\t$('bb_payload').removeClassName('is-editable').addClassName('pw-edit-mode');\n\t$('pw_edit_mode_controls').show();\n\t\n\tvar list_controls = $$('.list-controls');\n\t\n\tlist_controls.each(function(g){\n\t\tg.show()\n\t});\n\t\n\t\t\n//\tinputs.each(function(e){});\n\n}", "title": "" }, { "docid": "186cc6e0b5fe6d6242aeeab835d6cc61", "score": "0.68503046", "text": "function toggleEditMode() {\n setEditModeState(!isInEditMode());\n }", "title": "" }, { "docid": "ebc72a99c2760e52fedaed594f26c1ff", "score": "0.68419594", "text": "set editMode(value) {\n throw new latte.Ex();\n }", "title": "" }, { "docid": "cdc36809c2715d9808cc5ab5196cdabe", "score": "0.6814821", "text": "function edit() {\n\t\t// Code here ...\n\t\t// View Edit\n\t\t// if(OK){update() };\n\t}", "title": "" }, { "docid": "26bf1e14ec83c36333acff8b8619dac2", "score": "0.67841816", "text": "function EditMode() {\r\n var r, c;\r\n\r\n editmode = true;\r\n updateGridItemAll();\r\n showTracker('mapdiv', {checked: false});\r\n document.getElementById('settings').style.display = 'none';\r\n document.getElementById('itemconfig').style.display = '';\r\n document.getElementById('rowButtons').style.display = 'flex';\r\n\r\n document.getElementById('settingsbutton').innerHTML = 'Exit Edit Mode';\r\n}", "title": "" }, { "docid": "3b9d56f516890c88cd764ec1ce2c75be", "score": "0.67731017", "text": "function enableEdit() {\n\t// Hide edit button\n\t$('body').find('[data-target=\"edit-row\"]').hide();\n\n\t// Enable seminar select\n\t$('body').find('#seminar-type').attr('disabled', false);\n\n\t// Show edit functionality\n\t$('body').find('[data-target=\"progress-row\"]').show();\n\t$('body').find('[data-target=\"cover-image-row\"]').show();\n\t$('body').find('[data-target=\"presentation-row\"]').show();\n\t$('body').find('[data-target=\"save-row\"]').show();\n\n\t// reset and show progress bar\n\tdefaultProgressBar();\n}", "title": "" }, { "docid": "410d2584aee633d3aa8f5d17c5b9bb10", "score": "0.6732433", "text": "function inEditMode() {\n return swimlane.domainObject.hasCapability('editor') &&\n swimlane.domainObject.getCapability('editor').inEditContext();\n }", "title": "" }, { "docid": "9048df13546573249d7ffac513bd30a6", "score": "0.66474444", "text": "set editModeItem(value) {\n throw new latte.Ex();\n }", "title": "" }, { "docid": "a57a00c4278136cda9725efeabfc1dd5", "score": "0.66254634", "text": "function onClickEdit(field) {\n\tif (editMode) {\n\t\teditMode = !editMode;\n\t\tdocument.getElementById('editlist').style.display = 'none';\n\t} else if (!editMode) {\n\t\teditMode = !editMode;\n\t\tdocument.getElementById('editlist').style.display = 'block';\n\t}\n}", "title": "" }, { "docid": "8a9c8f28af170a3db890955124abeb09", "score": "0.6573031", "text": "function HandleEdit(event){\n setEdit(true);\n }", "title": "" }, { "docid": "eb20581a33153e0cabf65b012a792b4c", "score": "0.65334594", "text": "function goToEditMode(){\n inputFields.removeAttr(\"disabled\");\n\n editLogoutContainer.removeClass(\"show\");\n editLogoutContainer.addClass(\"hide\");\n updateCancelContainer.addClass(\"show\");\n}", "title": "" }, { "docid": "b46b7b510adbad42757896a69d3eb802", "score": "0.65034807", "text": "_globalEditChanged(e) {\n this.editMode = e.detail;\n }", "title": "" }, { "docid": "3b0ea88632e02426a5b86da3a4f9bd06", "score": "0.64689374", "text": "function enableEdit(obj){\n historyId = '';\n\t var channel = (projectType == 'PMO') ? program : projectType;\n GanttProjectPriotizationListController.ValidateEdit(\n channel,\n function(result,event){\n if(event.status){\n // console.log('resut from cache session =>' + result);\n if(result.length != 18){\n $('div#infoModal').text(result);\n $('#info').modal('show');\n }else{\n buildGridData(program)\n historyId = result;\n editMode = true;\n callSortable(sortableGrid1);\n callSortable(sortableGrid2);\n $(obj).parent().css(\"display\", \"none\");\n $(\"a.unlockEditLink\").addClass(\"hideDisplay\");\n $(\"div#save\").removeClass(\"hideDisplay\");\n $(\"div#modalbackdrop\").removeClass(\"hideDisplay\");\n $(\"div.k-grid\").css(\"cursor\", \"move\");\n startTimeout();\n }\n }\n },{escape: false}\n );\n\n }", "title": "" }, { "docid": "5928105fcac6ce4fe55dbdefd3dfb069", "score": "0.64557034", "text": "edit() {\n this.isEditing = true;\n this.editData = this.copy(this.source);\n }", "title": "" }, { "docid": "a801b41b2f2b8910a2c24a689750f22a", "score": "0.6450529", "text": "function leaveEditMode() {\n EditingOptions.removeClass('active');\n HypervideoLayoutContainer.empty().removeClass('active');\n EditPropertiesContainer.removeAttr('data-editmode').hide();\n\n toggleConfig_areaTopVisible(FrameTrail.getState('hv_config_areaTopVisible'));\n toggleConfig_areaBottomVisible(FrameTrail.getState('hv_config_areaBottomVisible'));\n toggleConfig_areaLeftVisible(FrameTrail.getState('hv_config_areaLeftVisible'));\n toggleConfig_areaRightVisible(FrameTrail.getState('hv_config_areaRightVisible'));\n\n toggleConfig_overlaysVisible(FrameTrail.getState('hv_config_overlaysVisible'));\n\n toggleConfig_slidingMode(FrameTrail.getState('hv_config_slidingMode'));\n\n changeSlidePosition(FrameTrail.getState('slidePosition'));\n\n Controls.find('.rightControlPanel').show();\n }", "title": "" }, { "docid": "17afb7ccfa8651dcefdf8f53ac2a0535", "score": "0.64485556", "text": "function openEditForm() {\r\n seteditFormIsOpen(true);\r\n }", "title": "" }, { "docid": "506ac2f1e9d0255f9921fd421ee772b6", "score": "0.64131474", "text": "edit() {\n this.saveInterfaceParams();\n var event = new CustomEvent(\"codeeditevent\");\n document.dispatchEvent(event);\n this.deleteFaustInterface();\n this.moduleView.textArea.style.display = \"block\";\n this.moduleView.textArea.value = this.moduleFaust.fSource;\n Connector.redrawInputConnections(this, this.drag);\n Connector.redrawOutputConnections(this, this.drag);\n this.moduleView.fEditImg.style.backgroundImage = \"url(\" + Utilitary.baseImg + \"enter.png)\";\n this.moduleView.fEditImg.addEventListener(\"click\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.addEventListener(\"touchend\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"click\", this.eventOpenEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"touchend\", this.eventOpenEditHandler);\n }", "title": "" }, { "docid": "20aade6b23f3ecb85f3855398bdf684b", "score": "0.63996744", "text": "function enterEditMode(){\n $(\"ProjectControls\").css(\"display\", \"none\");\n $(\"#bottomLine\").css(\"display\",\"none\");\n $(\"#canvasPanel\").css(\"display\",\"block\");\n $(\"#showDesc\").css(\"display\",\"none\");\n $(\"#nodeDesc\").css(\"display\", \"inline-block\");\n}", "title": "" }, { "docid": "44d055427f3c2be73183433016397521", "score": "0.63681877", "text": "function edit(_enable){\n\t//post(\"set edit to : \" + _enable + \"\\n\");\n\tisInEditMode = _enable;\n\t//jump out of title editmode\n\tif(vpl_titleEdit != null){\n\t\tvpl_titleEdit.message(\"border\", (_enable == 1)? 1: 0);\n\t\tvpl_titleEdit.message(\"ignoreclick\", (_enable == 1)? 0: 1);\n\t\tvpl_titleEdit.message(\"hint\", (_enable == 1)? \"edit node name\": \"node name\");\n\t}\n\tif(vpl_edit != null){\n\t\tthis.patcher.message(\"script\", \"sendbox\", \"vpl_edit\", \"hidden\", (_enable == 1)? 1: 0);\n\t\t//vpl_edit.message(\"hidden\", (_enable == 1)? 1: 0);\n\t}\n}", "title": "" }, { "docid": "54f8933281df6cb1b627ef70e0ac8e4f", "score": "0.6358626", "text": "edit() {\n // Add 'editing' class to element.\n this.el.classList.add('editing');\n // Focus input field.\n this.$input.focus();\n }", "title": "" }, { "docid": "ff844fb011ffc9d609699d0fd4bae120", "score": "0.6354734", "text": "function edit(data) {\n if (!data.moreData.isStarted) {\n top.notification({\n type: 'error',\n message: 'No se permite editar el documento'\n });\n window.history.back();\n return;\n }\n addEdit(data);\n}", "title": "" }, { "docid": "eea6fec8b380b1c6ab40425c29c0f2c7", "score": "0.6352664", "text": "function enableEditMode() {\n richDoc.designMode = 'On';\n richDoc.getElementById('page')\n .innerHTML = hiddenPage.innerHTML;\n}", "title": "" }, { "docid": "84a9a59f033651953e672231afd6d59d", "score": "0.6340012", "text": "function editGame() {\n var article = this.parentNode;\n var btn = this;\n switchToEditMode(btn);\n var titleField = article.children[0];\n var descriptionField = article.children[1];\n var imageUrlField = article.children[4];\n var editableFields = [titleField, descriptionField];\n for (var field of editableFields) {\n field.setAttribute(\"contenteditable\", true);\n $(field).addClass(\"edit-mode\");\n }\n btn.addEventListener(\"click\", function() {\n // \"for loop\" is NOT optional(apparently) because PUT doesn't refresh the page automatically(apparently)\n for (var field of editableFields) {\n field.setAttribute(\"contenteditable\", false);\n $(field).removeClass(\"edit-mode\");\n }\n switchFromEditMode(btn);\n var title = titleField.textContent;\n var description = descriptionField.textContent;\n var imageUrl = imageUrlField.getAttribute(\"src\");\n var id = article.getAttribute(\"game-id\");\n var gameObj = new Game({\n _id: game._id,\n title: title,\n description: description,\n imageUrl: imageUrl\n });\n gameObj.updateGame();\n });\n }", "title": "" }, { "docid": "982f76091a5f1455cb5d37fc33d75dbd", "score": "0.63276553", "text": "function editEducation(obj){\n editModalContent(obj, 'education-block', 'EducationSelect');\n var $_num = $(obj).closest('.education-block').attr('block-number');\n $('#EducationSelect .modal-footer .btn-primary').attr('onclick', 'editEducationHistory(' + $_num + ');');\n $('#EducationSelect').modal('show');\n return false;\n}", "title": "" }, { "docid": "fa763bb4fa037321be259fd6211f2cfe", "score": "0.6315336", "text": "_editModeChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){this._itemsChanged(this.items);for(var i in this.items){if(this.items[i].metadata){this.items[i].metadata.canEdit=newValue;this.notifyPath(`items.${i}.metadata.canEdit`)}}}}", "title": "" }, { "docid": "1c49da35f8ee9c0d2c06be318c0711ba", "score": "0.631077", "text": "function edit()\n {\n return editable.edit\n }", "title": "" }, { "docid": "977718eca6b05d07430f62b1dfd3fcaa", "score": "0.63100296", "text": "function editButtonClicked(id) {\n started_flag = true;\n saveOfficeItemCanvasObject(currentOfficeIndex);\n loadOfficeItemCanvasObject(id);\n canvas.renderAll();\n edit_flag = true;\n\n officeAssets.map(((value, index1) => {\n if (Number(value.id) === Number(id)) {\n edit_flag = true;\n currentOfficeIndex = id;\n // officeAssets[index1].is_saved = false;\n rearrangeAssets();\n }\n }));\n }", "title": "" }, { "docid": "f80c496d6694f7c3370dacdacd657ccf", "score": "0.6299299", "text": "function edit() {\n $state.go('^.edit', {'id': vm.clientModelDoc._id});\n }", "title": "" }, { "docid": "90ec58bdd5916645531cb34ed48bfb4d", "score": "0.6298762", "text": "function btnEdit_Clicked() {\n\n //Set Boolean New to False;\n bNewRecord = false;\n bEditRecord = true;\n\n //Change All Text Boxes to Edit Mode.\n EditMode();\n\n}", "title": "" }, { "docid": "7c033c33c4c4bda6bcd37db6f0980f89", "score": "0.62888783", "text": "function resetEditMode() {\n domElement.find('.timeline').removeClass('editable').css('flex-basis', '');\n AnnotationTimeline.hide();\n domElement.find('.infoAreaRight').hide();\n HypervideoLayoutContainer.empty().removeClass('active');\n }", "title": "" }, { "docid": "879ad0ecc9a9bbd5b6ee42ba66f92219", "score": "0.62771416", "text": "edit(id){\n let i = this.itens.find(item => item.id === id)\n i.editMode = !i.editMode\n i.newName = i.value\n }", "title": "" }, { "docid": "25644ae27ffda1193826b1f6c1ef4f0c", "score": "0.62683153", "text": "function editSkill(skillId) {\n vm.editFlag = true;\n vm.title = 'Edit';\n getSkillsInfo(skillId);\n }", "title": "" }, { "docid": "06a68a18150ac1d3f2e5535ebb355ed3", "score": "0.6266497", "text": "edit() {\n set(this, 'newTitle', get(this, 'task.title'));\n set(this, 'isEditing', true);\n }", "title": "" }, { "docid": "29a3eb0ae359393b1073154801ee7c0d", "score": "0.62384737", "text": "function editPage(){\n\n //TODO add more edit functions\n editAboutMe();\n editEducation();\n editWorkExperience();\n editSkill();\n editVideos();\n\n //TODO add button to send changes\n\n //TODO replace the edit button with cancel button\n $(\"#edit-btn\").hide();\n $(\"#cancel-edit-btn\").show();\n $(\"#post-edit-opt-btn\").show();\n\n}", "title": "" }, { "docid": "5a5e9fde8f9e5c0572045c0d0e5de1a6", "score": "0.62337905", "text": "edit () {\n var viewer = this.htmlViewElement();\n var editor = this.htmlEditElement();\n if ( editor.parentElement != viewer.parentElement )\n $( viewer.parentElement ).append( editor );\n if ( !this.buttons ) {\n $( editor ).append(\n this.buttons = $(\n '<p><button class=\"ok-button\">OK</button>'\n + '<button class=\"cancel-button\">Cancel</button></p>'\n )\n );\n var that = this;\n $( editor ).find( '.ok-button' ).click( function () {\n that.saveEdits();\n that.showViewControls();\n } );\n $( editor ).find( '.cancel-button' ).click( () => that.showViewControls() );\n }\n this.loadEdits();\n this.showEditControls();\n }", "title": "" }, { "docid": "98ac7caf50ffbbffc3df912f2d5d74e4", "score": "0.62324923", "text": "function edit() {\n var card = DECKMGR.active().current();\n hotkeyDisable();\n resetDisplay();\n document.getElementById('phrase-1').value = card.phrase1;\n document.getElementById('phrase-2').value = card.phrase2;\n document.getElementById('key').value = card.key;\n show('phrase-form');\n document.getElementById('phrase-1').focus();\n}", "title": "" }, { "docid": "03d7c8a63367fb42644dece260266c42", "score": "0.62240374", "text": "editFunction(){\n this.props.updateEditFlowType(true);\n goToPage('AddAddress');\n }", "title": "" }, { "docid": "1f5e4ab77f3b90d3b11a94cbac1f4288", "score": "0.6219665", "text": "function handleExhibitEdit() {\n let currentExhibit = $(this)\n .parent()\n .parent()\n .data(\"Exhibit\");\n window.location.href = \"/addData?id=\" + currentExhibit.id;\n }", "title": "" }, { "docid": "534f2e855e57c8836fda2cfe7bdfc195", "score": "0.62159103", "text": "onInitEditMode() {\n let path = 'public/plugins/westc-vuehtml-panel/partials/';\n this.addEditorTab('Editor', `${path}editor.html`, 1);\n }", "title": "" }, { "docid": "3ce0564c73781c4436d8931ef09056fc", "score": "0.6214472", "text": "initEditModes(){\n\n // The first edit mode we define is a reference implementation of the Transform controller you\n // implemented in Assignment 1. You can look at the code in\n // `../interactions/ReferenceA1InteractionImplementations` to see the controller's implementation.\n this.addSelectionController('A1Transform', new ABoundingBox2DController({\n component: this,\n handleInteractionClasses: [AIDragToScaleAroundModelAnchorAssignment1],\n anchorInteractionClasses: [AIDragToMoveAnchorPointAssignment1],\n hostViewInteractionClasses: [AIDragToMovePositionAssignment1]\n }));\n\n // Once you reach the A2Model checkpoint, the `A1Transform` controller should let you\n // move objects around and safely transform direct children of our scene graph's root.\n // However, you will notice that, for example, if you make one leaf node the child of\n // another and attempt to scale each of them separately, strange things begin to happen.\n // This is because our controllers in A1 assumed that a model's matrix mapped object\n // coordinates to screen (world) corrdinates, which may no longer be the case.\n // You will write the interactions for a new version of the Transform controller from\n // A1 that works with hierarchies. The starter code for these interactions can be\n // found in [`../interactions/SceneGraphElementInteractions`](../interactions/SceneGraphElementInteractions)\n //\n this.addSelectionController('Transform', new ABoundingBox2DController({\n component: this,\n handleInteractionClasses: [AIDragToScaleAroundModelAnchor],\n anchorInteractionClasses: [AIDragToMoveAnchorPoint],\n hostViewInteractionClasses: [AIDragToMovePosition],\n groupBoxInteractionClasses: [AIDragToMovePosition]\n }));\n\n // Here you can set the default edit mode to whichever one you are currently working on\n this.switchToEditMode('A1Transform');\n // this.switchToEditMode('Transform');\n // this.switchToEditMode('Isolation Mode');\n\n this.setCurrentSelectionMode(\"Single\");\n }", "title": "" }, { "docid": "5e3fee8bdea84af83d60e7a99dc672fc", "score": "0.6207211", "text": "function showEdit(){\n\t$('#ce-side-title, #ce-side-speaker, #ce-side-bio, #ce-side-prelude, #ce-side-article, #ce-side-postlude, #ce-side-location, #ce-side-author, #ce-side-event, #ce-side-time').hide();\n\t$('.ce-side-label, #ce-title-edit, #ce-speaker-edit, #ce-bio-edit, #ce-prelude-edit, #ce-content-edit, #ce-postlude-edit, #ce-location-edit, #ce-author-edit, #ce-edate-edit, #ce-time-edit').show();\n}", "title": "" }, { "docid": "c0c2b6f17cd68aaf343d4b33a523c16f", "score": "0.61993426", "text": "function extendSideEdit(){\n\tif($('#ce-side').css('display') != 'none'){\n\t\t$('#ce-list').animate({\n\t\t\tleft: '-60%'\n\t\t},300);\n\t\t$('#ce-side').animate({\n\t\t\tleft: '5'\n\t\t},300);\n\t}\n\telse{\n\t\t$('#ce-side').show();\n\t\t$('#ce-list').animate({\n\t\t\topacity: '0'\n\t\t}, 500, function(){\n\t\t\t$('#ce-side').css('left', '5px');\n\t\t\t$('#ce-side').animate({\n\t\t\t\topacity: 1\n\t\t\t}, 500);\n\t\t});\n\t}\n\t$('#ce-options button').prop('disabled', true);\n\t$('#ce-edit-options').show();\n}", "title": "" }, { "docid": "23c6129e95ca9920d60f85ce48a50803", "score": "0.6198764", "text": "get editMode() {\n throw new latte.Ex();\n }", "title": "" }, { "docid": "fd7dad32963a04d23941fafc203bece5", "score": "0.6177732", "text": "function onEditModeOn() {\n store.set(keys.editingOn, '1');\n $(selectors.html).addClass(classes.editingOnClass);\n\n if (pageViewModel != null) {\n $.each(pageViewModel.contents, function () {\n if (this.isInvisible || !pageViewModel.isContentVisible(this)) {\n return;\n }\n\n this.overlay.show();\n\n if (this.hideEndingDiv) {\n this.contentEnd.show();\n }\n });\n }\n\n content.refreshOverlays();\n }", "title": "" }, { "docid": "c00835822a76b589c335a49c8d851cc1", "score": "0.6162964", "text": "editEducation(education) {\n\t\tthis.oldEducation = angular.copy(education);\n\t\tthis.actionEducationState = education;\n\t}", "title": "" }, { "docid": "2af43b341f359564da380f554cc0a834", "score": "0.6162223", "text": "function edit() {\n // Setting the editMode flag\n editMode = true;\n $(\"#restaurant_submit\").val(\"Save Edit\");\n // We change the currently displayed panel \n $(\"#confirmation_pane\").css(\"display\", \"none\");\n $(\"[name='new_restaurant_form']\").css(\"display\", \"\");\n}", "title": "" }, { "docid": "ab355162c4db2c5974efefc9fe6d3001", "score": "0.61436164", "text": "function editMode(index) {\n\n model.drawHtmlOptionsLower = '';\n model.drawHtmlOptionsUpper = '';\n model.savedOptions = [];\n\n\n console.log(model.polls[index].isOpen)\n model.tempIsOpen = model.polls[index].isOpen;\n model.saveState = model.polls[index].options.length;\n\n for (let i = 0; i < model.polls[index].options.length; i++) {\n model.savedOptions[i] = model.polls[index].options[i];\n }\n\n for (let i = 0; i < model.polls[index].options.length; i++) {\n model.oninputs[i] = '';\n model.drawHtmlOptionsLower += `<td><input size=\"5\" oninput=\"model.oninputs[${i}] = this.value\" value=\"${model.polls[index].options[i]}\"></input></td>`;\n model.drawHtmlOptionsUpper += `<th>Svaralternativ ${i + 1}</th>`\n }\n\n document.getElementById('app').innerHTML = `\n <table>\n <tr>\n <th>Fortsatt Åpen</th>\n <th>Spørsmål</th>\n ${model.drawHtmlOptionsUpper}\n <th>Lagre</th>\n </tr>\n \n <tr>\n <td class=\"center\"><input oninput=\"model.isOpenVarOninput = this.value\" size=\"2\" value=\"${model.polls[index].isOpen}\"></input></td>\n <td><textarea oninput=\"model.questionVarOnInput = this.value\" id=\"question\" placeholder=\"${model.polls[index].question}\"></textarea></td>\n ${model.drawHtmlOptionsLower}\n <td><button onclick=\"save(${index})\">Lagre</button></td>\n </tr>\n </table>\n\n `;\n}", "title": "" }, { "docid": "287430a8e1610b9e45b66e0fd218019c", "score": "0.6129774", "text": "function enableEditMode() {\n\tjsPlumb.draggable($('.moduleBox'),\n\t{\n\t\tdistance: 15,\n\t\tscroll: true,\n\t\tscrollSensitivity: 50,\n\t\tstack: \".moduleBox\",\n\t\tcontainment: \"parent\"\n\t});\n\t$(\"#skillTreeView\").addClass(\"editMode\");\n}", "title": "" }, { "docid": "10e68335f4e85824eef869888e9316cf", "score": "0.6128327", "text": "function manageEditMode() {\n btnEditMode = btnMembersEditMode\n invertInnerText(btnEditMode, \"Mode édition\", \"Mode lecture seule\") //invert text of the button\n invertHiddenState(inpDivPassword) //display or hide #inpDivPassword (with \"?\" and password input\")\n\n //change disabled state of .sltAccountState elements (actual disabled state is taken in the first .sltAccountState element\n $(\".sltAccountState\").attr(\"disabled\", btnEditMode.innerText == \"Mode édition\") //enable or disabled all select .sltAccountState\n $(\".sltAccountState\").each(function () {\n if (this.getAttribute(\"data-startstate\") != this.value) { //if it has been already modified (start state is not equal to current value of state)\n this.disabled = true //disable it again\n }\n })\n if (queryActionIncludes(\"option=5\", true)) {\n if (!isEditModeEnabled()) { //option is unapproved users and edit mode is enabled\n $(\".membersTrashIcons\").removeClass(\"cursorpointer\") //remove the pointer cursor\n $(\".membersTrashIcons\").addClass(\"cursorforbidden\") //add the forbidden cursor\n } else {\n $(\".membersTrashIcons\").removeClass(\"cursorforbidden\") //remove the forbidden cursor\n $(\".membersTrashIcons\").addClass(\"cursorpointer\") //add the pointer cursor\n }\n }\n}", "title": "" }, { "docid": "27b4edf8d20e9c2bbf44ab53c8aa6274", "score": "0.6123898", "text": "function editStart() {\n hideCurrentAttenuationBorder();\n vm.editing = true;\n }", "title": "" }, { "docid": "4ebdffb438cf16b0998388692f16fc2a", "score": "0.6116295", "text": "editSection() {\n this.setState({\n edit: true,\n });\n }", "title": "" }, { "docid": "72c6de8f09013b14dc697237b4d74ff8", "score": "0.61154294", "text": "function edit() {\r\n\t\tconsole.log('function EDIT from dialog.js')\r\n\t\tconsole.log(addEditBtn)\r\n\t\tshow()\r\n\t\tdialogTitle.innerHTML = 'Редактировать пользователя'\r\n\t\taddEditBtn.value = 'Редактировать'\r\n\r\n\t}", "title": "" }, { "docid": "ec9901cec3ed6512d128b2cc9b8c4ef3", "score": "0.61079687", "text": "function edit() {\n\t$row = $(this).closest(\"li\"); // List item that contains the experiment data\n\t$(\"#descr\").val($(\"input:eq(2)\", $row).val());\n\t$(\"#expid\").val($(\"input:eq(0)\", $row).val()); // Experiment id \n\t$(\"#videourl\").val($(\"input:eq(1)\", $row).val());\n\t$(\"#controls\").val($(\"input:eq(3)\", $row).val());\n\t$(\"#pheight\").val($(\"input:eq(4)\", $row).val());\n\t$(\"#pwidth\").val($(\"input:eq(5)\", $row).val());\n\t$(\"#action\").val(\"1\"); // Action code for an update\n\t$.mobile.changePage($(\"#videoinfo\")); // Open form as a dialog\n\t$(\"#submit\").val(\"Update\").button('refresh'); // Submit button label\n\ttoControls($(\"#controls\").val()); // Fill form controls\n}", "title": "" }, { "docid": "9320b714f8298a4bfab9d4675b8be21d", "score": "0.6106129", "text": "function updatePlace() {\r\n editing = true\r\n showNewPlaceModal()\r\n}", "title": "" }, { "docid": "c1edd02e2c24576e402c70e625d0230d", "score": "0.61008316", "text": "handleEditButtonClick() {\n this.getCurrentTeam();\n this.open();\n }", "title": "" }, { "docid": "fb17525077380078f934f836afdcd9e5", "score": "0.60977274", "text": "handleEdit() {\n this.setState({ editMode: true });\n }", "title": "" }, { "docid": "140cfc728ab5cae6cac67c191975bb3e", "score": "0.6086562", "text": "function editBtnClick(e){\n\t//enable or disable edit mode\n\tif (e.source.title == \"Edit\") {\n\t\t$.modalWin.editing = true;\n\t\te.source.title = \"Done\";\n\t\t\n\t\t//Enable editing\n\t\t$.transectName.editable = true;\n\t\t$.surveyor.editable = true;\n\t\t$.otherSurveyors.editable = true;\n\t\t$.plotDistance.editable = true;\n\t\tstakeBarLabels[0].enabled = true;\n\t\tstakeBarLabels[1].enabled = true;\n\t\t$.stakeBar.labels = stakeBarLabels;\n\t\t$.comments.editable = true;\n\t\t\n\t\t//disable the button button during edit mode\n\t\t$.backBtn.enabled = false;\n\t\t$.photoBtn.enabled = true;\n\t\t\n\t} else { //title is \"Done\"\n\t\t//fire error-checking listeners\n\t\t$.transectName.blur();\n\t\t$.surveyor.blur();\n\t\t$.plotDistance.blur();\n\t\tif (($.transectError.visible == true)||($.surveyorError.visible == true)||($.plotDistanceError.visible == true)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$.modalWin.editing = false;\n\t\te.source.title = \"Edit\";\n\t\t//enable the back button\n\t\t$.backBtn.enabled = true;\n\t\t\n\t\t//disable editing\n\t\t$.transectName.editable = false;\n\t\t$.surveyor.editable = false;\n\t\t$.otherSurveyors.editable = false;\n\t\t$.plotDistance.editable = false;\n\t\tstakeBarLabels[0].enabled = false;\n\t\tstakeBarLabels[1].enabled = false;\n\t\t$.stakeBar.labels = stakeBarLabels;\n\t\t$.comments.editable = false;\n\t\t\n\t\t$.photoBtn.enabled = false;\n\t\t\t\t\n\t\tsaveEdit(e);\n\t}\n}", "title": "" }, { "docid": "aee5620b3320111c96b40bdcb9b9e99d", "score": "0.6069849", "text": "function toggleEdit(player) {\n player.edit = !player.edit;\n}", "title": "" }, { "docid": "3b0ed31aa02da038c50911f7c8c406da", "score": "0.6069713", "text": "function editCurrentTask() {\n openEditTask(index);\n }", "title": "" }, { "docid": "729ee3acd54e177d96b0787c5a493fd4", "score": "0.6062745", "text": "toggleEdit() {\n this.setState({\n editMode: !this.state.editMode\n })\n }", "title": "" }, { "docid": "2607cf52d2735db85c548da3c8c53e7c", "score": "0.6060566", "text": "function EditManager() {}", "title": "" }, { "docid": "f66ecee066d03fb9a32e9deef3e6d706", "score": "0.6056935", "text": "function controlEditAvailability(){\n if($editBtn.text() === 'Edit' ){ \n if (myItemList.hasOnlyOneSelected()){\n $editBtn.prop('disabled', false);\n } else {\n $editBtn.prop('disabled', true);\n }\n }\n }", "title": "" }, { "docid": "51fc10121e9171fe2b4ebec36b2dcc81", "score": "0.6042291", "text": "function openModalEdit() {\n modalEdit.style.display = \"block\"\n }", "title": "" }, { "docid": "e9d4743cc3d62e19f9b8846dbc89423a", "score": "0.6042216", "text": "function enterCodeSnippetMode() {\n initEditMode();\n CodeSnippetTimeline.addClass('editable');\n\n EditPropertiesContainer\n .html('<span class=\"icon-code\"></span><div class=\"message active\">Add custom code by dragging Code Snippets into the active timeline, add \"Custom CSS\" rules, or react to events by editing the \"onReady\", \"onPlay\", \"onPause\" and \"onEnded\" tabs.</div>')\n .attr('data-editmode', 'codesnippets');\n }", "title": "" }, { "docid": "46a733ca9b3aa925e1c6172464fbe609", "score": "0.60406256", "text": "function extra_edit(table, uid, pz_uid, is_concrete_article) {\r\n/// \\todo: add be_mode\r\n\t\t\tsubModalExtraEdit(table, uid, pz_uid, is_concrete_article);\r\n\t}", "title": "" }, { "docid": "3931fc4a50125866b630d2090f2e8fdc", "score": "0.6038993", "text": "function edit()\n{\n content.contentEditable = \"true\";\n title.contentEditable = \"true\";\n content.style.border = \"2px solid purple\";\n title.style.border = \"2px solid pink\";\n button_edit.style.display = \"none\";\n button_save.style.display = \"block\";\n content.focus();\n}", "title": "" }, { "docid": "68579956a3019ba7eefb52850569f356", "score": "0.6026357", "text": "function enableEdit(){if(_enabled){return;}_enabled=true;(0,_event.addEventListener)('annotation:click',handleAnnotationClick);}", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.60251844", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.60251844", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.60251844", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.60251844", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "cf03963d6cbb872c12c41f9c9ef9cc78", "score": "0.6022197", "text": "function edit() {\n $state.go('account-edit');\n }", "title": "" }, { "docid": "d6cd975987b72cd9913cbc2df725da1b", "score": "0.602011", "text": "function wpv_archive_view_edit() {\n jQuery('#wpv-archive-view-mode-summary').hide();\n jQuery('#wpv-archive-view-mode-edit').show();\n}", "title": "" }, { "docid": "d6910ac398121cdb276697758fc50bd5", "score": "0.6019658", "text": "function onload_new()\n{\n onload_original();\n //alert(\"setEdit here\");\n oUtil.setEdit();\n}", "title": "" }, { "docid": "aba1fd1ee173aa1fa7790c53462d46e1", "score": "0.60183793", "text": "function setPartInEdit(el,inEdit){\n if (inEdit){\n $(el).addClass('in-edit');\n }else{\n $(el).removeClass('in-edit');\n }\n}", "title": "" }, { "docid": "86923d0d5d6bda4e17b423673561fbc4", "score": "0.6007418", "text": "function editClick() {\n vm.shouldShowDelete = !vm.shouldShowDelete;\n if(vm.editToggle === \"Edit\"){\n vm.editToggle = \"Done\";\n } else {\n vm.editToggle = \"Edit\";\n }\n }", "title": "" }, { "docid": "112270818a5582d5cc0727ace44ec022", "score": "0.6004181", "text": "function toggleEdit() {\n setIsEditing(edit => !edit);\n }", "title": "" }, { "docid": "262ab1f1c9b9867cb029c0261f14807f", "score": "0.59922653", "text": "function editable(el) {\n\n if( $(el).hasClass('editable') ) {\n // back to readonly\n $(el).parent('.editability').removeClass('editing')\n $(el).parent('.editability').find(\"input\").attr(\"readonly\", true); \n $(el).removeClass('editable');\n } else {\n // modify\n $(el).parent('.editability').addClass('editing')\n $(el).parent('.editability').find(\"input\").focus();\n $(el).parent('.editability').find(\"input\").attr(\"readonly\", false); \n $(el).addClass('editable');\n }\n}", "title": "" }, { "docid": "cd3924c9a7b01e1a21b3afe4eea41caa", "score": "0.59884304", "text": "function handleEdit(e) {\n e.preventDefault();\n setShowButton(false);\n props.setDisplayMode('');\n }", "title": "" }, { "docid": "440e2851df6b2f8c31f518bd9ac62479", "score": "0.59853804", "text": "function onOpenEditDialog(button, event) {\n controller.windowsProxy.editSync(GLib.Variant.new('i', [fact.id]));\n menu.close();\n }", "title": "" }, { "docid": "b046ae7995465b117410c5616b77eab5", "score": "0.5983361", "text": "loadEdits () { }", "title": "" }, { "docid": "f55e79a8aa48013d09174f2492573078", "score": "0.59810627", "text": "function loadEdit()\n{\n // get parameters from URL search string\n var\teditPref\t= null;\n var\tidmrNotSet\t= true;\n\n if (typeof(args.idmr) == \"string\")\n {\t\t\t// idmr parameter passed\n\t\teditPref\t= document.indForm.elements['Edit' + args.idmr];\n\t\tif (editPref)\n\t\t{\n\t\t idmrNotSet\t = false;\n\t\t}\n }\t\t\t// idmr parameter passed\n \n // handle keystrokes that apply to the entire dialog\n document.body.onkeydown\t = epKeyDown;\n\n // activate handling of key strokes in text input fields\n // including support for context specific help\n for (var fi = 0; fi < document.forms.length; fi++)\n {\t\t // loop through all forms\n\t\tvar form\t = document.forms[fi];\n\t\tif (form.name == 'indForm')\n\t\t{\t // list of marriages form\n\t\t // set action methods for form\n\t\t form.onsubmit\t = validateForm;\n\t\t form.onreset \t = resetForm;\n\t\t}\t // list of marriages form\n\t\telse\n\t\tif (form.name == 'famForm')\n\t\t{\t // individual marriage form\n\t\t // set action methods for form\n\t\t form.onsubmit\t = validateForm;\n\t\t form.onreset \t = resetForm;\n\n\t\t // callback from editEvent.php\n\t\t form.eventFeedback\t= eventFeedback;\n\t\t}\t // individual marriage form\n\n\t\tvar formElts\t = form.elements;\n\t\tfor (var i = 0; i < formElts.length; ++i)\n\t\t{\t // loop through all elements\n\t\t var element\t = formElts[i];\n\n\t\t if (element.nodeName.toUpperCase() == 'FIELDSET')\n\t\t\t\tcontinue;\n\n\t\t var\tname;\n\t\t if (element.name && element.name.length > 0)\n\t\t\t\tname\t = element.name;\n\t\t else\n\t\t\t\tname\t = element.id;\n if (name.length == 0)\n continue;\n\n\t\t // default handling of <input> elements\n\t\t element.onkeydown\t= keyDown;\n\t\t element.onchange\t= change;\t// default handler\n\n\t\t // do element specific initialization\n\t\t var namePattern\t = /^([a-zA-Z$_]+)([0-9]*)$/;\n\t\t var pieces\t\t = namePattern.exec(name);\n\t\t if (pieces === null)\n\t\t {\n\t\t\t\talert(\"editMarriages.js: onLoad: unable to parse name='\" +\n\t\t\t\t\tname + \"'\");\n\t\t\t\tpieces\t = [name, name, ''];\n\t\t }\n\t\t var\tcolName\t\t = pieces[1];\n\t\t var rowId\t\t = pieces[2];\n\n\t\t switch(colName)\n\t\t {\n\t\t\t\tcase 'Add':\n\t\t\t\t{\t // add a marriage\n\t\t\t\t element.onclick\t= addFamily;\n\t\t\t\t break;\n\t\t\t\t}\t // Add\n \n\t\t\t\tcase 'Finish':\n\t\t\t\t{\t // close button\n\t\t\t\t element.onclick\t= finish;\n\t\t\t\t // put the initial keyboard focus on the \"Close\" button so\n\t\t\t\t // pressing Enter closes the dialog\n\t\t\t\t element.focus();\n\t\t\t\t break;\n\t\t\t\t}\t // Finish\n \n\t\t\t\tcase 'Reorder':\n\t\t\t\t{\t // reorder marriages by date\n\t\t\t\t element.onclick\t= marrReorder;\n\t\t\t\t break;\n\t\t\t\t}\t // Reorder\n\n\t\t\t\tcase 'HusbSurname':\n\t\t\t\t{\t // surname fields\n\t\t\t\t element.checkfunc\t\t= checkName;\n\t\t\t\t element.onchange\t\t= changeHusbSurname;\n\t\t\t\t break;\n\t\t\t\t}\t // surname fields\n\n\t\t\t\tcase 'WifeSurname':\n\t\t\t\t{\t // surname fields\n\t\t\t\t element.checkfunc\t\t= checkName;\n\t\t\t\t element.onchange\t\t= change;\n\t\t\t\t break;\n\t\t\t\t}\t // surname fields\n\n\t\t\t\tcase 'HusbGivenName':\n\t\t\t\tcase 'WifeGivenName':\n\t\t\t\t{\t // name fields\n\t\t\t\t element.checkfunc\t\t= checkName;\n\t\t\t\t element.onchange\t\t= change;\n\t\t\t\t break;\n\t\t\t\t}\t // name fields\n\n\t\t\t\tcase 'MarD':\n\t\t\t\t{\t\t// marriage date\n\t\t\t\t element.abbrTbl\t\t= MonthAbbrs;\n\t\t\t\t element.onchange\t\t= dateChanged;\n\t\t\t\t element.checkfunc\t\t= checkDate;\n\t\t\t\t break;\n\t\t\t\t}\t\t// marriage date\n\n\t\t\t\tcase 'MarLoc':\n\t\t\t\t{\t\t// marriage location\n\t\t\t\t element.abbrTbl\t\t= evtLocAbbrs;\n\t\t\t\t element.onchange\t\t= locationChanged;\n\t\t\t\t break;\n\t\t\t\t}\t\t// marriage location\n\n\t\t\t\tcase 'editHusb':\n\t\t\t\t{\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t element.onclick\t\t= editFather;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'chooseHusb':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= chooseFather;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'createHusb':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= createFather;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'detachHusb':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= detachHusb;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'editWife':\n\t\t\t\t{\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t element.onclick\t\t= editMother;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'chooseWife':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= chooseMother;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'createWife':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= createMother;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'detachWife':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= detachWife;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'sealingDetails':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= sealingDetails;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'noteDetails':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= noteDetails;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'noChildren':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= noChildren;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'noChildDetails':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= noChildDetails;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'eventList':\n\t\t\t\t{\n\t\t\t\t element.onchange\t= changeEventList;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'OrderEvents':\n\t\t\t\t{\t\t// order events by date\n\t\t\t\t element.onclick\t\t= orderEvents;\n\t\t\t\t break;\n\t\t\t\t}\t\t// order events by date\n\n\t\t\t\tcase 'addChild':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= addExistingChild;\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'addNewChild':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= addNewChild;\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'update':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= updateMarr;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'orderChildren':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= orderChildren;\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'Pictures':\n\t\t\t\t{\n\t\t\t\t element.onclick\t\t= editPictures;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'MarriedNameRule':\n\t\t\t\t{\n\t\t\t\t element.onchange\t= changeNameRule;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'EditIEvent':\n\t\t\t\t{\n\t\t\t\t // rowId is STYPE\n\t\t\t\t element.onclick\t\t= editIEvent;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'DelIEvent':\n\t\t\t\t{\n\t\t\t\t // rowId is STYPE\n\t\t\t\t element.onclick\t\t= delIEvent;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'EditEvent':\n\t\t\t\t{\n\t\t\t\t // rowId is IDER\n\t\t\t\t element.onclick\t\t= editEvent;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'DelEvent':\n\t\t\t\t{\n\t\t\t\t // rowId is IDER\n\t\t\t\t element.onclick\t\t= delEvent;\n\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\tcase 'CGiven':\n\t\t\t\t{\t\t// given names of a child\n\t\t\t\t element.onkeydown\t\t= childKeyDown;\n\t\t\t\t break;\n\t\t\t\t}\t\t// given names of a child\n\n\t\t\t\tcase 'CSurname':\n\t\t\t\t{\t\t// surname of a child\n\t\t\t\t element.onkeydown\t\t= childKeyDown;\n\t\t\t\t break;\n\t\t\t\t}\t\t// surname of a child\n\n\t\t\t\tcase 'Cbirth':\n\t\t\t\t{\t\t// birth date of a child\n\t\t\t\t element.onkeydown\t\t= childKeyDown;\n\t\t\t\t element.onchange\t\t= changeCBirth;\n\t\t\t\t element.checkfunc\t\t= checkDate;\n\t\t\t\t element.checkfunc();\n\t\t\t\t break;\n\t\t\t\t}\t\t// birth date of a child\n\n\t\t\t\tcase 'Cdeath':\n\t\t\t\t{\t\t// death date of a child\n\t\t\t\t element.onkeydown\t\t= childKeyDown;\n\t\t\t\t element.onchange\t\t= changeCDeath;\n\t\t\t\t element.checkfunc\t\t= checkDate;\n\t\t\t\t element.checkfunc();\n\t\t\t\t break;\n\t\t\t\t}\t\t// death date of a child\n\n\t\t\t\tcase 'editChild':\n\t\t\t\t{\t\t// edit details of a child\n\t\t\t\t editChildButtons.push(element);\n\t\t\t\t element.onclick\t\t= editChild;\n\t\t\t\t break;\n\t\t\t\t}\t\t// edit details of a child\n\n\t\t\t\tcase 'detChild':\n\t\t\t\t{\t\t// detach Child\n\t\t\t\t element.onclick\t\t= detChild;\n\t\t\t\t break;\n\t\t\t\t}\t\t// detach Child\n\n\t\t\t\tcase 'Pref':\n\t\t\t\t{\t\t// set preferred family\n\t\t\t\t // rowId is IDMR\n\t\t\t\t element.onclick\t\t= clickPref;\n\t\t\t\t break;\n\t\t\t\t}\t\t// set preferred family\n\n\t\t\t\tcase 'Edit':\n\t\t\t\t{\t\t// edit family\n\t\t\t\t // rowId is IDMR\n\t\t\t\t element.onclick\t\t= editFamily;\n\t\t\t\t var prefName\t\t= 'Pref' + rowId;\n\t\t\t\t var prefbox\t\t\t= form.elements[prefName];\n\t\t\t\t if (editPref === null ||\n\t\t\t\t\t(idmrNotSet && prefbox.checked))\n\t\t\t\t\teditPref\t\t= element;\n\t\t\t\t break;\n\t\t\t\t}\t\t// edit family\n\n\t\t\t\tcase 'Delete':\n\t\t\t\t{\t\t// delete family\n\t\t\t\t // rowId is IDMR\n\t\t\t\t element.onclick\t\t= marrDel;\n\t\t\t\t break;\n\t\t\t\t}\t\t// Delete family\n\n\t\t }\t // switch on element name\n\t\t}\t // loop through all elements in the form\n }\t\t // loop through all forms\n\n // provide methods for other pages to modify information on husband\n // and wife\n var\thusbRow\t\t\t= document.getElementById('Husb');\n husbRow.changePerson\t= changeHusb;\n var\twifeRow\t\t\t= document.getElementById('Wife');\n wifeRow.changePerson\t= changeWife;\n\n // provide methods for other pages to add a child onto this page\n // and to change an existing child\n var\tchildTable\t\t= document.getElementById('children');\n childTable.addChildToPage\t= addChildToPage;\n\n // process the nodes immediately under the table of children\n // define the changePerson feedback method for each node which\n // contains information about a child\n for(var subElement = childTable.firstChild;\n\t\tsubElement;\n\t\tsubElement = subElement.nextSibling)\n {\n\t\tif (subElement.nodeName)\n\t\t{\t\t// a node element\n\t\t switch(subElement.nodeName.toLowerCase())\n\t\t {\t\t// act on node name\n\t\t\t\tcase 'tr':\n\t\t\t\tcase 'div':\n\t\t\t\t{\t// logical row\n\t\t\t\t subElement.changePerson\t= changeChild;\n\t\t\t\t break;\n\t\t\t\t}\t// logical row\n\n\t\t\t\tcase 'tbody':\n\t\t\t\t{\t// using table for layout\n\t\t\t\t for(var ir = 0; ir < subElement.rows.length; ir++)\n\t\t\t\t\tsubElement.rows[ir].changePerson\t= changeChild;\n\t\t\t\t break;\n\t\t\t\t}\t// using table for layout\n\t\t }\t\t// act on node name\n\t\t}\t\t// element has a nodeName attribute\n }\t\t\t// loop through all immediate children\n\n hideRightColumn();\n}", "title": "" }, { "docid": "9138f4b4c8c3d0f7e2b9472d3d7f341d", "score": "0.5978062", "text": "function OnEnable()\n {\n \teditModeActive = false;\n \tRepaint();\n }", "title": "" }, { "docid": "f5ba59c9517a933515dfd8904b3c2a9c", "score": "0.5974175", "text": "function edit($index) {\n\n var item = $scope.model.value[$index];\n var elementType = config.elementTypeLookup[item.elementType];\n\n editorService.open({\n config: {\n elementType: elementType,\n currentPageId: config.currentPageId,\n },\n size: elementType.overlaySize,\n value: item,\n view: config.overlayView,\n submit: function (model) {\n\n $scope.model.value[$index] = model;\n\n preview($index);\n\n setDirty();\n\n editorService.close();\n },\n close: function () {\n editorService.close();\n }\n });\n }", "title": "" }, { "docid": "06c69d2e5a3ad49276385c2961e765e9", "score": "0.5973491", "text": "function handlerecipeEdit() {\n var currentrecipe = $(this).parents(\".recipe-panel\").data(\"id\");\n editrecipe(currentrecipe);\n }", "title": "" }, { "docid": "ca210f552c39ec4361211af97b2a826c", "score": "0.5971633", "text": "edit()\n {\n this.$el.addClass('editing');\n this.input.focus();\n }", "title": "" }, { "docid": "f454f23ca5c48b248f47f854bb5fefe1", "score": "0.5971561", "text": "edit() {\n\t\tTableData.toggleEditable()\n\t\tthis.forceUpdate()\n\t}", "title": "" }, { "docid": "b11c7c65352f64a4a3a9d0b6cee25b7d", "score": "0.59700876", "text": "edit( {setAttributes, attributes}){\r\n\r\n function updateTitle(title) { {\r\n setAttributes( {title} );\r\n }}\r\n function updateBlockValue(content) { {\r\n setAttributes( {content} );\r\n }}\r\n \r\n // return function\r\n return( \r\n <div className='block-panel'>\r\n <h2 className=\"block-label\">Education Details</h2>\r\n <RichText\r\n tagName=\"h3\"\r\n onChange={ updateTitle }\r\n value={ attributes.title }\r\n />\r\n <RichText\r\n tagName=\"ul\"\r\n multiline=\"li\"\r\n onChange={ updateBlockValue }\r\n value={attributes.content}\r\n />\r\n </div>\r\n )\r\n }", "title": "" }, { "docid": "52ca65c9a7cb051de2f2f28722d49970", "score": "0.59681195", "text": "function disableEdit() {\n\t// Hide edit button\n\t$('body').find('[data-target=\"progress-row\"]').hide();\n\t$('body').find('[data-target=\"cover-image-row\"]').hide();\n\t$('body').find('[data-target=\"presentation-row\"]').hide();\n\t$('body').find('[data-target=\"save-row\"]').hide();\n\n\t// Disable seminar select\n\t$('body').find('#seminar-type').attr('disabled', true);\n\n\t// Show edit button\n\t$('body').find('[data-target=\"edit-row\"]').show();\n}", "title": "" }, { "docid": "0c006cd03c8754afa263160116f694b8", "score": "0.59647083", "text": "function showEdit() {\n document.querySelectorAll(\".alimentsList\").forEach((item) => {\n item.parentNode.parentNode.parentNode.querySelector('.edit-day').classList.add('none');\n item.parentNode.parentNode.parentNode.querySelector('.edit-alim-actions').classList.remove('none');\n\n const arrayValues = ['.delete-aliment', '.add-item', 'input'];\n arrayValues.map(el => {\n item.querySelectorAll(el).forEach(item => {\n el === 'input'\n ? item.removeAttribute('disabled')\n : el === '.add-item'\n ? item.classList.remove('desactived')\n : item.classList.remove('none')\n })\n })\n })\n }", "title": "" }, { "docid": "a13b1a4d5ad587e71ee4910da5f07e59", "score": "0.5963504", "text": "function openEdit(index) {\n indexEdit = index\n modal.style.display = \"block\";\n}", "title": "" } ]
194ae8351da69ee4913cde1c2bdad7df
lock core view reload (reload blocked)
[ { "docid": "58a04de5672f2fb6798da1da7db156fb", "score": "0.8151427", "text": "function lock_core_view_reload(id){\n\tlast_loaded_core_view = id;\n}", "title": "" } ]
[ { "docid": "a0f17e287085fb9f4bd1d47ea3feafed", "score": "0.77854925", "text": "function unlock_core_view_reload(){\n\tlast_loaded_core_view = undefined;\n}", "title": "" }, { "docid": "5d91a6947c1985a760de74ba2442646d", "score": "0.6306735", "text": "function _lockFunctionality() {\n lockUserActions = true;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "title": "" }, { "docid": "f70fe00c8989df2e7422c943150f7334", "score": "0.6070936", "text": "async reload() {}", "title": "" }, { "docid": "0bce0fb5a28d11a20605d1f0f1b4166f", "score": "0.58510256", "text": "reloadAndUnblock() {\n this.loadCategories().then(() => {\n this.isLoading = false;\n });\n }", "title": "" }, { "docid": "3e9dec918674d1b6f8a99118d5973045", "score": "0.5791926", "text": "reload() {\r\n this.native.reload();\r\n }", "title": "" }, { "docid": "bcfc0800e4f1e8b7fee7ad49a4cbc632", "score": "0.5788817", "text": "requestRefresh() {\n if (this.refresh) {\n let refresh = this.refresh;\n this.refresh = undefined;\n requestAnimationFrame(() => {\n this.refresh = refresh;\n this.refresh();\n });\n } else {\n // TODO(P2) figure out why these happen with taskView...\n console.log(\"Double refresh: \" + this.id());\n }\n }", "title": "" }, { "docid": "13c57619ce59d3328c8eeaca7372227b", "score": "0.5784201", "text": "function reload() {\n\twindow.location.reload();\n\tif (sync.online) {\n\t\t//window.applicationCache.update();\n\t}\n}", "title": "" }, { "docid": "f91f899378a8b471f9e469ef26bfe3b4", "score": "0.57305855", "text": "lockEditor() {\n this.lock = true;\n }", "title": "" }, { "docid": "fbe143984431dc449dd3c79a8a804f7a", "score": "0.5704389", "text": "function lockForm(){\n\t\t\t$scope.isLoading = true;\n\t\t}", "title": "" }, { "docid": "ae0794de1331cad905587dd0c7dd9de0", "score": "0.5681007", "text": "synchronizeViewFromModel() {\n }", "title": "" }, { "docid": "512043c1c4aa1387b528c1e35862995e", "score": "0.5652919", "text": "function softReload() {\n Turbolinks.enableTransitionCache(true);\n Turbolinks.visit(location.toString());\n Turbolinks.enableTransitionCache(false);\n}", "title": "" }, { "docid": "80ad7e6b00ec094ee523cf2106e2033a", "score": "0.5631936", "text": "reload() {\n\n }", "title": "" }, { "docid": "5527e92e3ca981177bbec480560f26c0", "score": "0.5629761", "text": "function onSecReloadClick(){\r\n\r\nAKS74u.secondaryReload();\r\n\r\n\r\n}", "title": "" }, { "docid": "44029440af1a767ac9c9a264934bc7a0", "score": "0.5596907", "text": "function refresh() {\n location.reload();\n bx.disabled = false;\n}", "title": "" }, { "docid": "a3b2eb367c1a73061b8d01ecb8979b8c", "score": "0.55788887", "text": "forceRefreshView() \n {\n this.dispatchEvent(new CustomEvent(\"forceRefreshView\", { detail: null }));\n }", "title": "" }, { "docid": "509ebb1be98e678a87e261ee3e3b93b0", "score": "0.5562835", "text": "refresh()\n\t{\n\t}", "title": "" }, { "docid": "e498573351dd7a77dbe7e8ffe1613408", "score": "0.5561069", "text": "async onReloadDefaultView () {\n if (this.pvc.formatter) {\n this.pvc.formatter.resetOptions()\n }\n this.dispatchMicrodataViewDelete(this.routeKey) // clean current view\n await this.restoreDefaultView()\n await this.setPageView()\n this.doRefreshDataPage()\n }", "title": "" }, { "docid": "96e8029ccec56734be966a6a56e9d91e", "score": "0.55512995", "text": "lock() {\n this.close();\n this.isLocked = true;\n this.refreshState();\n }", "title": "" }, { "docid": "855eda0e63db147a4db280fa1587c960", "score": "0.55283314", "text": "set refreshMode(value) {}", "title": "" }, { "docid": "fef69afcd33b37ee3dbf5228ca27dd62", "score": "0.55259454", "text": "function reloadMain() {\r\n\tif (busy_ajaxing) {\r\n\t\talert(\"Ein kleiner Moment bitte! Die Seite wird gerade neu konfiguriert...\");\r\n\t} else {\r\n\t\tbusy_ajaxing = true;\r\n\t\tscrollPosBeforeLoad = getScrollPos();\r\n\t\tsendRequest(\"maintable.php?directInclude=do\", \"\", 2, \"processResponseMain\");\r\n\t}\r\n}", "title": "" }, { "docid": "d9f0da6bda0ff1bb12962a27040c020e", "score": "0.5521874", "text": "function reload() {\n initialize();\n }", "title": "" }, { "docid": "19f89f98d284c114b08f6047cdfddfd9", "score": "0.5516806", "text": "function syncSelectionIndicator() {\n _.forEach(_views, function (view) {\n view.$openFilesContainer.triggerHandler(\"scroll\");\n });\n }", "title": "" }, { "docid": "6cd00e7a6d8f534c1053a1c527a36745", "score": "0.5516686", "text": "lock() {\n this.$.hypervisor.locked = true;\n }", "title": "" }, { "docid": "e2c0bc9e6d0665991c8650d07dfdc30d", "score": "0.5514186", "text": "refresh() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "720e9b2803221b363464e6a5450e0c70", "score": "0.54997015", "text": "function markViewDirty(lView){while(lView&&!(lView[FLAGS]&128/* IsRoot */)){lView[FLAGS]|=8/* Dirty */;lView=lView[PARENT];}lView[FLAGS]|=8/* Dirty */;ngDevMode&&assertDefined(lView[CONTEXT],'rootContext should be defined');var rootContext=lView[CONTEXT];scheduleTick(rootContext,1/* DetectChanges */);}", "title": "" }, { "docid": "b7992c7068580270796adb7ef7774d1e", "score": "0.5492857", "text": "function reload() {\n JX.$U().go();\n }", "title": "" }, { "docid": "f1630e4f5e603c3f4dc467f7994689c6", "score": "0.5483216", "text": "function refreshView() {\n\tchangeView(currentView[0], currentView[1], true);\n}", "title": "" }, { "docid": "964ea7e203956a2f8a110e42b98dc016", "score": "0.54743034", "text": "function reloadMechanics(){\n reload = 10;\n}", "title": "" }, { "docid": "a644ab41259360cb973499c16aa51245", "score": "0.54530317", "text": "shouldReloadAll () { return true; }", "title": "" }, { "docid": "5b91a985432537bc7bfb03a1dfb524ab", "score": "0.545232", "text": "function refresh(){\n setUpdate(!update)\n }", "title": "" }, { "docid": "43433bac7effb6ac6518f7b11fdf88a7", "score": "0.54389966", "text": "function forceLoad() {}", "title": "" }, { "docid": "2c73e9fa9e36456d329feda95e9056a9", "score": "0.5425132", "text": "reload() {\n\t\tthis.clearNetwork();\n\t\tthis.render();\n\t}", "title": "" }, { "docid": "339f8698f478e17b71ae464f1cd3f39d", "score": "0.542096", "text": "lock() {\n this._locked = true;\n }", "title": "" }, { "docid": "d641e92db42a81e5b15b7dd29a1e8e70", "score": "0.5418555", "text": "_initializeLock() {\n if(config.get(\"window.locked\")) {\n this.toggleLock();\n }\n }", "title": "" }, { "docid": "e3d263d40e8f25fe7209653e5e7992b2", "score": "0.5417039", "text": "reloadInstance() {\n let base_qs = this.getQuerySet(this.view, this.qs_url);\n\n if(!(base_qs && base_qs.cache && base_qs.cache.data)) {\n return;\n }\n\n this.$store.commit('setViewInstanceData', {\n url: this.qs_url.replace(/^\\/|\\/$/g, \"\"),\n data: base_qs.cache.data,\n store: 'sandbox',\n });\n\n setTimeout(() => {\n this.$store.commit('setViewInstanceData', {\n url: this.qs_url.replace(/^\\/|\\/$/g, \"\"),\n data: base_qs.cache.data,\n store: 'sandbox',\n });\n }, 10);\n }", "title": "" }, { "docid": "b983291d58da6c33982de72667cd4c22", "score": "0.54140943", "text": "relaunch() {}", "title": "" }, { "docid": "e7562aed9dd36203413b7efc1225a508", "score": "0.5409761", "text": "_onRefresh() {\n this.loadData(false);\n }", "title": "" }, { "docid": "e7562aed9dd36203413b7efc1225a508", "score": "0.5409761", "text": "_onRefresh() {\n this.loadData(false);\n }", "title": "" }, { "docid": "cbdcbe544536782493d1d00614938115", "score": "0.5402657", "text": "function updateView() {\n var isTokenOk = loader.TokenNotNull();\n\n if (isTokenOk) {\n chrome.browserAction.setIcon({ 'path' : '../images/icon-16.gif'});\n\n //loader.Load(false);\n }\n else {\n chrome.browserAction.setIcon({ 'path' : '../images/icon-16gray.gif'});\n //chrome.browserAction.setPopup({popup : \"\"});\n //loader.Clear();\n }\n}", "title": "" }, { "docid": "17dd96c3bb00909bdc5aefc018fe949b", "score": "0.53782946", "text": "blockRedraw(){\n\t\tthis.initGuard();\n\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\n\t\t\n\t\tthis.rowManager.blockRedraw();\n\t\tthis.columnManager.blockRedraw();\n\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\n\t}", "title": "" }, { "docid": "c87f6f6a15da1da9ba8c882bd8c19e19", "score": "0.5362278", "text": "async function lock()\n {\n if (bookmarks.is_locked()) { return; }\n\n await bookmarks.lock();\n notification.locked();\n }", "title": "" }, { "docid": "8ca999f2d559a3f441af4d6c57c4b185", "score": "0.53603745", "text": "function force_reload()\n {\n window.location.reload();\n }", "title": "" }, { "docid": "db7dcf55cb640f2f18877eb40f69b8ba", "score": "0.53571934", "text": "function doRefreshHooks(space, rec) {\n doEnterOptHooks(space, rec, false);\n}", "title": "" }, { "docid": "ab5fb90aabc5a250b4342731a44a50d0", "score": "0.5348994", "text": "_onRefresh(){\n this.loadData(false);\n }", "title": "" }, { "docid": "0f78b9e42b5bb6fc547877ef8bc95265", "score": "0.53462636", "text": "_reload() {\n const { uiKey, rootNodes } = this.props;\n //\n this.context.store.dispatch(this.dataManager.receiveData(uiKey, new Immutable.Map({})));\n if (!rootNodes || rootNodes.length === 0) {\n return;\n }\n rootNodes.forEach(rootNode => {\n if (!rootNode.isMoreLink && !this._isLeaf(rootNode) && rootNode.toggled) {\n this._onToggle(rootNode, rootNode.toggled);\n }\n });\n }", "title": "" }, { "docid": "dcd9d5e0491cfd70473c84290415952d", "score": "0.53323406", "text": "performRefresh() {\n this.props.dispatch(caseActions.refreshCase(this.props.caseID));\n this.props\n .dispatch(\n assignmentActions.refreshAssignment(\n this.props.caseID,\n this.props.assignment.ID,\n this.state.currAssignmentAction\n )\n )\n .then(() => this.setState({ forceRefresh: true }));\n }", "title": "" }, { "docid": "5f4dd31a6f2538ad676ad528616eaa0f", "score": "0.5305874", "text": "function reload(tabid, full_reload) {\n if (!full_reload)\n bgpage.navigate(tabid, tab_url);\n else\n bgpage.reload(tabid);\n\n viewupdate({ is_loading:true, error:\"\" });\n}", "title": "" }, { "docid": "69c0c44d2a3eedfada8d35ea21d217fa", "score": "0.5296898", "text": "enableReloadHotkey() {\n window.addEventListener(\"keydown\", function (e) {\n if (e.keyCode === 82 && e.altKey && e.ctrlKey) {\n system_1.System.clearCache({\n cache: true,\n cookies: false,\n localStorage: false,\n appcache: true,\n userData: false\n });\n window.location.reload();\n }\n });\n }", "title": "" }, { "docid": "e1660d37bd97838644574f66ebdfc8cc", "score": "0.5295083", "text": "function refresh() {\n }", "title": "" }, { "docid": "076bcda0f6e0a5dccf2bde76818f91aa", "score": "0.52834404", "text": "function forceLoad() {\n\t // Noop\n\t}", "title": "" }, { "docid": "cfb73315e2189309760bb316ffb03b8d", "score": "0.5280773", "text": "function lockdoor() {\n\t\t\t\tref.update({\n\t\t\t\tunlocked: false,\n\t\t\t})\t\t\t\n\t\t\t}", "title": "" }, { "docid": "2ffb05690754b46a7f8ded9b3360e22a", "score": "0.52785444", "text": "function hardReload() {\n location.reload();\n}", "title": "" }, { "docid": "e12b8bf3d888dc49039598fb684e459b", "score": "0.5271547", "text": "@api\n async refresh() {\n this.notifyLoading(true);\n this.isLoading = true;\n this.notifyLoading(this.isLoading);\n await refreshApex(this.boats);\n this.isLoading = false;\n this.notifyLoading(this.isLoading);\n \n }", "title": "" }, { "docid": "ab1fee453baa0add43f4cf585a06e1c1", "score": "0.526812", "text": "function refreshWorklistPage() {\r\n\t\ttry {\r\n\t\t\tWorklistStorage.set(\"StoredDebugMode\", gblDebugMode);\r\n\t\t\twindow.location.reload(true);\r\n\t\t} catch (error) {\r\n\t\t\tshowErrorMessage(error.message, \"refreshWorklistPage\", \"\", \"\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "36eb9656943c60cc04df61eab0330a6f", "score": "0.5260251", "text": "function reloadData() {\n if (typeof (CPData) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataSoon) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataDownloaded) != \"undefined\") { CPData.regenerate(); }\n loadInfo();\n }", "title": "" }, { "docid": "7cc4a3ca6d0318345019a5bd98b8a9d3", "score": "0.52587444", "text": "willRender() {\n this.startReloading();\n }", "title": "" }, { "docid": "a8dc2547d44b2011ac180d8f6732ae97", "score": "0.52562845", "text": "static reload(){\n\t\tPage.load(Page.currentPage);\n\t}", "title": "" }, { "docid": "1bcf1f67bcc2dd02138eb3de8bde891b", "score": "0.52508855", "text": "preFetch() {\n this.busy = true;\n this.refresh_btn_text = 'Refreshing';\n // console.log('Refreshing');\n }", "title": "" }, { "docid": "3d4ce1cb83fe5241179224c04e508c85", "score": "0.5250877", "text": "scheduleRefresh() {}", "title": "" }, { "docid": "3d4ce1cb83fe5241179224c04e508c85", "score": "0.5250877", "text": "scheduleRefresh() {}", "title": "" }, { "docid": "dc1f6dd6a1ab2f9c27653595183986ac", "score": "0.52437776", "text": "function StateManager_Reload()\n{\n\t//is the wait manager in heavy mode?\n\tif (__WAIT_MANAGER.AssynchWait)\n\t{\n\t\tvar stateId = this.CurrentState.UniqueId;\n\t\t//add the load callback\n\t\t__WAIT_MANAGER.Listeners.push([function (strStateId) { __SIMULATOR.StateManager.LoadState(strStateId); }, stateId]);\n\t}\n\telse\n\t{\n\t\t//load the current state\n\t\tthis.LoadState(this.CurrentState.UniqueId);\n\t}\n}", "title": "" }, { "docid": "221a171935eca10746fb330c12a48207", "score": "0.5238759", "text": "async function reloadViewer() {\n viewer.sceneManager.removeAllObjects()\n await viewer.loadObject(\n objUrl(streamId, mainBranch.commits.items[0].referencedObject)\n )\n console.log(`Loaded latest commit from branch \"${mainBranch.name}\"`)\n\n // Load beam if selected\n if (selectedBeam) {\n console.log(\"alternative is selected, should load\", selectedBeam)\n await viewer.loadObject(objUrl(streamId, selectedBeam))\n console.log(\"loaded alternative\")\n }\n\n // Load column if selected\n if (selectedColumn) {\n console.log(\"alternative is selected, should load\", selectedColumn)\n await viewer.loadObject(objUrl(streamId, selectedColumn))\n console.log(\"loaded alternative\")\n }\n \n viewer.interactions.zoomExtents(0.95, true)\n}", "title": "" }, { "docid": "1ba314586b7f3854913fae8ca8cb01c7", "score": "0.5236993", "text": "function refresh() {\n // Block the UI while we load the certificates\n $.blockUI();\n // Invoke the loading of the certificates\n loadCertificates();\n }", "title": "" }, { "docid": "55dac4676ba5b2658cd9d58fd517dbe1", "score": "0.523535", "text": "KeepAlive()\n {\n this.activeFrame = resMan.activeFrame;\n if (this._isPurged) this.Reload();\n }", "title": "" }, { "docid": "1558a50f1d3e68cc3f5e44c63a9f5c45", "score": "0.5224818", "text": "function refreshView() {\n var d = new Date();\n var diff = d.getTime() - lastUpdate;\n diff = diff / 1000;\n\n if (shipsToLoad == 0 && diff >= 60) {\n lastUpdate = d.getTime();\n\n if(ionic.Platform.isIOS())\n {\n ProgressIndicator.showSimple();\n }\n else\n {\n ProgressIndicator.show(\"Scherm Verversen\");\n }\n\n shipsToLoad=-1;\n myShip = UserProfile.getShip();\n $scope.ship = myShip;\n $scope.shipsFromBehind = [];\n $scope.shipsFromFront = [];\n Ships.getInRadius(myShip.location, 5000).then(retrieveShipsDetails);\n }\n }", "title": "" }, { "docid": "0fbee4e9c9d8b465a4e9b8c578f3c428", "score": "0.5223385", "text": "function onReloadClick(){\r\n\r\nAKS74u.reload();\r\n\r\n\r\n}", "title": "" }, { "docid": "fc7782dd7b995658b9a1d8fdf1c7e9dd", "score": "0.5223346", "text": "function reloadlok() {\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: site_url + \"/admin/reloadlok\",\n\t\t\tcache: false,\n\t\t\tsuccess: function(html) {\n\t\t\t\t$(\"#divtabellok\").html(html);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f99140e285472e481d287339c8ac483e", "score": "0.52166283", "text": "function entirePageReload() {\n // We invalidate some kind of JS cache thing so that when we reload we\n // re-eval all the global JS.\n var obs = Cc[\"@mozilla.org/observer-service;1\"]\n .getService(Ci.nsIObserverService);\n obs.notifyObservers(null, \"startupcache-invalidate\", null);\n\n var xulMainWindow = window\n .QueryInterface(Ci.nsIInterfaceRequestor)\n .getInterface(Ci.nsIWebNavigation)\n .QueryInterface(Ci.nsIDocShellTreeItem)\n .rootTreeItem\n .QueryInterface(Ci.nsIInterfaceRequestor)\n .getInterface(Ci.nsIDOMWindow);\n var browserElem =\n xulMainWindow.document.getElementById(XUL_MAIN_CONTENT_ID);\n browserElem.goHome();\n}", "title": "" }, { "docid": "b9dafd6670bbf58644be6d57ffcdfdf3", "score": "0.52117926", "text": "function reloadHandler() {\n isLoadingContacts.value = true;\n fetchData();\n}", "title": "" }, { "docid": "44b73998a2014fe38f14117c20e983dc", "score": "0.5206879", "text": "function refresh() {\n // Block the UI while we load the certificates.\n $.blockUI();\n // Invoke the loading of the certificates.\n loadCertificates();\n }", "title": "" }, { "docid": "b69e4ad219c3e6e5fde6e0029e574cde", "score": "0.52032995", "text": "function useReload() {\n return ledgerContext.useReload();\n}", "title": "" }, { "docid": "ec9754e07fd3f16e94c70a615e902906", "score": "0.5201482", "text": "function appletRefresh(){\r\n\tif ((typeof hatsForm.beensubmitted == \"undefined\") && (typeof hatsForm.notRefreshSafe == \"undefined\")){\r\n\t\thatsForm.beensubmitted = true;\r\n\t} else {\r\n\t\treturn -1;\r\n\t}\r\n\tif (gobject != null) checkInput(gobject);\r\n\tsetExtraInfo();\r\n\thatsForm.COMMAND.value = \"refresh\";\r\n}", "title": "" }, { "docid": "acf6c73e4938017d17c9734ea9eeacd1", "score": "0.5199757", "text": "async function reloadEverything() {\n reloadDebounced();\n}", "title": "" }, { "docid": "f87fb5a1b4f7c9f252416234a51aaf99", "score": "0.5190278", "text": "function loadView() {\t\t\n\t\tvar srv1 = comc.requestLiteList('MENUPERF', $scope.cntx);\n\t\tvar srv2 = comc.requestLiteList('BOOL' , $scope.cntx);\n\t\t\n\t\t$q.all([srv.stResp(false, srv1)]).then(function(){\n\t\t\t$scope.cntx.form.get('perf').data = $scope.cntx.data.get('ltLMenuperf')[0].clav;\n\t\t\tvar srv3 = comc.request('ctmn/list', $scope.cntx);\n\t\t\t\n\t\t\t$q.all([srv.stResp(true, srv3)]).then(function(){\n\t\t\t\tview();\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "bc93498c3eb2ea4ca454ba669902623b", "score": "0.5178779", "text": "lock() {\n document.getElementById('instructions').style.display = 'none';\n document.getElementById('blocker').style.display = 'none';\n document.getElementById('draw-canvas').requestPointerLock();\n }", "title": "" }, { "docid": "78ae4973577cdd589e164cc3458fd17b", "score": "0.51780707", "text": "function refreshView(){\n\t\t/*\n\t\t * we will rebuild the tree\n\t\t */\n\t\t\n\t\t//TODO need to check this method\n\t\t\n\t\t// Update pagesize\n\t\tvar pagesize = dojo.byId(\"com.ibm.ws.console.probdetermination.pageSize\");\n\t\tvar xhrArgs = {\n\t\t\turl: \"/ibm/console/logViewerInstanceServlet\",\n\t\t\tcontent: {\n\t\t\t\tpageaction: \"same\",\n\t\t\t\tpagesize: pagesize.value\n\t\t\t},\n\t\t\thandleAs: \"json\"\n\t\t};\n\t\tdojo.xhrPost(xhrArgs);\n\n\t\tcreateServerStartupTree();\n\t\n\t\ttreeStore.fetch({\n\t\t\tonComplete: function(data,response) {\n\t\t\t\n\t\t\t\t// Check if selection can stay the same.\n\t\t\t var toCheck = currentInstanceSelection;\n\t\t\t \n\t\t\t var instanceTree = dijit.byId(\"probdetermination.instanceChoice\");\n\t\t\t \n\t\t\t // check wheather parent is avail\n\t\t\t var selectionAvail = dojo.some(data, function(item) { \n\t\t\t var siStore = instanceTree.model.store;\n\t\t\t if (item && siStore.isItem(item)) {\n\t\t\t return siStore.getValue(item, \"starttime\") === toCheck;\n\t\t\t } \n\t\t\t \n\t\t\t return false; \n\t\t\t });\n\t\t\t \n\t\t\t /*\n\t\t\t\t * if selection available just update the grid\n\t\t\t\t */\n\t\t\t\tif ( currentInstanceSelection !== null && data.length === 0 || selectionAvail) {\n\t\t\t\t\t/*\n\t\t\t\t\t * reload the grid\n\t\t\t\t\t */\n\t\t\t\t\t//appInstallWaitShowProbDeter();\n\t\t\t\t\tgrid3 = dijit.byId(\"grid\");\n\t\t\t\t\tgrid3.selection.deselectAll();\n\t\t\t\t\tvar store = new probdeter.ItemFileReadStore({url:'/ibm/console/logViewerServlet', urlPreventCache:true});\n\t\t\t\t\tgrid3.setStore(store);\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t * give a warning\n\t\t\t\t\t */\n\t\t\t\t\tconsole.log(nlsArray.hpel_logviewer_instanceselected_notavail);\n\t\t\t var dlg = dijit.byId('errorDialog');\n\t\t\t dlg.clearAll();\n\t\t\t dlg.addWarning(nlsArray.hpel_logviewer_instanceselected_notavail, null);\n\t\t\t dlg.show();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: function(error,response) {\n\t\t\t\tconsole.log(\"Error: failed to featch new data, with error message = \" + error);\n\t\t var dlg = dijit.byId('errorDialog');\n\t\t dlg.clearAll();\n\t\t dlg.addError(\"Error: failed to featch new data, with error message = \", error);\n\t\t dlg.show();\n\t\t return;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "96bf904d7e3712dbc3ae3d89bf3e0cd1", "score": "0.5174989", "text": "function noRefresh () {\n return false;\n}", "title": "" }, { "docid": "51f7d638efa3cfa9b3fcc88934c44e33", "score": "0.51721454", "text": "function updateViews(){\r\n\treloadBall();\r\n\treloadCalendar();\r\n\treloadWordle();\r\n}", "title": "" }, { "docid": "51fe65e7f6b8a949f3e8086782403edc", "score": "0.5166001", "text": "function lock(el) {\n\tel.on('click.locked', function() {\n\t\treturn false;\n\t})\n}", "title": "" }, { "docid": "d87ff591e50d149ac4f2fbb0f4c86e87", "score": "0.5165371", "text": "function markViewDirty(view) {\n var currentView = view;\n while (currentView && !(currentView[FLAGS] & 64 /* IsRoot */)) {\n currentView[FLAGS] |= 4 /* Dirty */;\n currentView = currentView[PARENT];\n }\n currentView[FLAGS] |= 4 /* Dirty */;\n ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext should be defined');\n var rootContext = currentView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "a7911714a33014fed1fcf53c5f916cea", "score": "0.5161238", "text": "blockUpdate() {\n this.updateManuallyBlocked = true;\n }", "title": "" }, { "docid": "0fd6d0966708db1f9bb829273d4c7410", "score": "0.515825", "text": "function reload() {\n vm.isAbnormal = false;\n vm.items = [];\n vm.canLoad = true;\n pageIndex = 1;\n }", "title": "" }, { "docid": "0403228fe8db82f5e381a4b4b9c09fb0", "score": "0.5157212", "text": "function SplitModeRefreshFrame() {\r\n if ((parent !== this) && parent.SplitModeRefreshFrame) {\r\n parent.SplitModeRefreshFrame();\r\n }\r\n}", "title": "" }, { "docid": "4dc9bd357f72257a9027f0734cce4917", "score": "0.5156835", "text": "function forceLoad() {\n // Noop\n}", "title": "" }, { "docid": "28f6f448424c7d19c43a0ba382ff94a4", "score": "0.5153939", "text": "_triggerUpdated() {\n\t if (!this.updating) {\n\t this.updating = true;\n\t const update = () => {\n\t this.updating = false;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-updated', this);\n\t };\n\t if (this._checkSync()) {\n\t update();\n\t }\n\t else {\n\t setTimeout(update);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "a394814e6bed116901b8f4cb863e91f4", "score": "0.5141542", "text": "function refreshContainsDirtyView(lView) {\n for (var lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var embeddedLView = lContainer[i];\n\n if (embeddedLView[FLAGS] & 1024\n /* RefreshTransplantedView */\n ) {\n var embeddedTView = embeddedLView[TVIEW];\n ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');\n refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);\n } else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n refreshContainsDirtyView(embeddedLView);\n }\n }\n }\n\n var tView = lView[TVIEW]; // Refresh child component views.\n\n var components = tView.components;\n\n if (components !== null) {\n for (var _i12 = 0; _i12 < components.length; _i12++) {\n var componentView = getComponentLViewByIndex(components[_i12], lView); // Only attached components that are CheckAlways or OnPush and dirty should be refreshed\n\n if (viewAttachedToChangeDetector(componentView) && componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {\n refreshContainsDirtyView(componentView);\n }\n }\n }\n }", "title": "" }, { "docid": "fd50b701f358f6417fa7bf8babccd89e", "score": "0.51412094", "text": "function reload() {\n calipso.log(\"Template module reloaded\");\n}", "title": "" }, { "docid": "fd50b701f358f6417fa7bf8babccd89e", "score": "0.51412094", "text": "function reload() {\n calipso.log(\"Template module reloaded\");\n}", "title": "" }, { "docid": "6bdb8686fba61f55503ecaa8551ec7d8", "score": "0.51321584", "text": "function markDirtyIfOnPush(lView,viewIndex){var childComponentLView=getComponentViewByIndex(viewIndex,lView);if(!(childComponentLView[FLAGS]&4/* CheckAlways */)){childComponentLView[FLAGS]|=8/* Dirty */;}}", "title": "" }, { "docid": "ee714ef212a1204f9b5f69eefb304061", "score": "0.5125797", "text": "function refresh() {\n $element.addClass('mos-refreshing');\n move(options.distanceToRefresh);\n\n var promise = dispatch('onRefresh');\n if (promise && promise.then) {\n promise.then(function() {\n reset();\n });\n }\n\n }", "title": "" }, { "docid": "64e82c9879d8f9ba7ac3b7bd9f04430f", "score": "0.5123416", "text": "lock() {\n const that = this;\n\n that.locked = true;\n }", "title": "" }, { "docid": "53d83f2b5c70b832430b3f141c382461", "score": "0.5121285", "text": "function ReloadContent( show )\r\n {\r\n if(!show || _data.numbertimeson === 1 || _settings.cache) //-- if cache is disabled _data.numbertimeson should prevent reload of initial content\r\n {\r\n ShowHide.call(this, show);\r\n return;\r\n }\r\n\r\n _data.deferred = new $.Deferred();\r\n _data.promise = _data.deferred.promise();\r\n\r\n GetContent();\r\n\r\n _data.promise.done(function()\r\n {\r\n ShowHide.call(this, 1);\r\n });\r\n }", "title": "" }, { "docid": "ff250805f6a0c8322d35b5772f5cca32", "score": "0.51178956", "text": "function forceLoad() {\n // Noop\n}", "title": "" }, { "docid": "ff250805f6a0c8322d35b5772f5cca32", "score": "0.51178956", "text": "function forceLoad() {\n // Noop\n}", "title": "" }, { "docid": "3ce104233ddea588f6a556774f7d3a41", "score": "0.51119816", "text": "function _unlockFunctionality() {\n lockUserActions = false;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "title": "" }, { "docid": "b9b8ed51855c344f273eb35b6db2cdc5", "score": "0.5105114", "text": "function lockModal() {\n locked = true;\n }", "title": "" }, { "docid": "b9b8ed51855c344f273eb35b6db2cdc5", "score": "0.5105114", "text": "function lockModal() {\n locked = true;\n }", "title": "" }, { "docid": "ceb2b330c1787b144b8f2995758ce9de", "score": "0.5104715", "text": "function markViewDirty(lView) {\n while (lView && !(lView[FLAGS] & 128 /* IsRoot */)) {\n lView[FLAGS] |= 8 /* Dirty */;\n lView = lView[PARENT];\n }\n lView[FLAGS] |= 8 /* Dirty */;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n var rootContext = lView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "ceb2b330c1787b144b8f2995758ce9de", "score": "0.5104715", "text": "function markViewDirty(lView) {\n while (lView && !(lView[FLAGS] & 128 /* IsRoot */)) {\n lView[FLAGS] |= 8 /* Dirty */;\n lView = lView[PARENT];\n }\n lView[FLAGS] |= 8 /* Dirty */;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n var rootContext = lView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "87821a228498e41e826f82f9836e12f6", "score": "0.5100027", "text": "function startRefreshing(){\n var objThis = this;\n\n if (strModeRefresh == \"on\"){\n intIntervalId = setInterval(checkDoneChallenges.bind(objThis), intRefreshRate);\n }\n }", "title": "" } ]
e65a9e077c637a310c48e5de315ae6c4
Grabs products from the database and updates the view
[ { "docid": "8108cab185f76b2a21f62f49383c67de", "score": "0.63844424", "text": "function getProducts() {\n $.get(\"/api/9products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" } ]
[ { "docid": "5ba4d14de8999808e84e4e7b2428807d", "score": "0.721018", "text": "function viewProducts() {\n // Fetch all available products from the database and handle the response with a callback\n database.fetchProducts(products => {\n // Generate a table and console.log it\n generateFullTable(products);\n // Show the main menu\n mainMenu();\n });\n}", "title": "" }, { "docid": "81d5d55709e52b992d437c9c0bbdd1f2", "score": "0.6981029", "text": "viewProducts() {\n\t\tconnection.query('SELECT * FROM products', (err, res) => {\n\t\t\tif (err) throw err;\n\t\t\tconsole.table(res);\n\t\t\tpromptObj.continuePrompt();\n\t\t});\t\n\t}", "title": "" }, { "docid": "216dcdf1a74cc43db64dc9cf87ee3ec6", "score": "0.692557", "text": "function viewProducts() {\n\n \tconnection.query(\"SELECT * FROM `products`\", function (err, results, fields) {\n\n \t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\");\n\t\tconsole.log(\" ID Product Name Quantity Price \".yellow);\n\t\tconsole.log(\"----------------------------------------------------------\");\n\t\t\n\t\t// loop through the results from the select query on the products table\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tconsole.log(formatTableData(results[i].item_id, results[i].product_name, results[i].stock_quantity, results[i].price));\n\t\t}\n\n\t\tconsole.log(\"----------------------------------------------------------\");\n\t\tconsole.log(\"\");\n\t\tmainMenuPrompt();\n\n\t});\n\n }", "title": "" }, { "docid": "d10e4d8b11dc1d06c0e088064d4fb74d", "score": "0.6888325", "text": "function viewProducts() {\n console.log('\\n # ALL PRODUCTS FOR SALE #\\n');\n // query all products in the database and show results to user\n bamazonDb.query('SELECT * FROM products;', (err, result) => {\n if(err) throw err;\n console.table(result);\n showMenu(); // return user to selection menu\n });\n}", "title": "" }, { "docid": "557afdaebdd95e4aa74fdadd3c95b4ba", "score": "0.6877149", "text": "function getUpdatedProductList() {\n dataService.getProductsFromApi()\n .then(function(data) {\n $scope.productList = data;\n });\n }", "title": "" }, { "docid": "33041da53cf28ddd3b9491d3b08e8c29", "score": "0.6844872", "text": "function changeProducts() {\n showProducts(cacheHandler.getPageFromProductCache());\n updatePageVisuals();\n}", "title": "" }, { "docid": "e55d11b27183d7d56213033b835c8c21", "score": "0.68005496", "text": "function display() {\n\t\t\tvm.dataLoading = true;\n\t\t\tQueryService.Display().then(function(response, $routeParams) {\n\t\t\t\tproduct = response;\n\t\t\t\tif (product.length > 1) {\n\t\t\t\t\t$scope.products = product;\n\t\t\t\t} else {\n\t\t\t\t\tvm.dataLoading = false;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "6829f8c4a2ae318a83dbc42e52375543", "score": "0.6797741", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n console.table(res);\n selectActivity();\n });\n}", "title": "" }, { "docid": "f9818b2b424e6689b23e2de834b79937", "score": "0.6790185", "text": "getProducts(products) {\n\t\tthis.renderProducts(products);\n\t\t// SAVE PRODUCTS TO STORAGE\n\t\tStorage.SetItem(\"products\", products);\n\t}", "title": "" }, { "docid": "27885fa7766e0dfc84d4a20b2799a803", "score": "0.6754668", "text": "function _refreshProductData() {\n $http({\n method: 'GET',\n url: '/api/products'\n }).then(\n function(res) { // success\n $scope.products = res.data;\n },\n function(res) { // error\n console.log(\"Error: \" + res.status + \" : \" + res.data);\n }\n );\n }", "title": "" }, { "docid": "93eb0afacbd5eb7f4ee90458bdc4baba", "score": "0.67507917", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (error, results1) {\n if (error) throw error;\n // console.log(results1);\n // Display the available products with their ID #s\n for (let i = 0; i < results1.length; i++) {\n console.log(results1[i].item_id + \" - \" + results1[i].product_name + \" - \" + results1[i].department_name + \" - \" + results1[i].price + \" - \" + results1[i].stock_quantity)\n };\n promptManager();\n })\n}", "title": "" }, { "docid": "f8e11de78ba4fc45c506faad959fb586", "score": "0.66975516", "text": "function viewProduct(){\n\tconnection.query(\"SELECT * FROM products\", function (err, res){\n\t\tif (err) console.log(err);\n\t\telse{\n\t\t//iterates through each row in db printing pertinent info\n\t\t\tfor (var i = 0; i < res.length; i++){\n\t\t\t\tconsole.log(\"Item ID = \" + res[i].item_id + \" | \" + res[i].product_name + \" | \" \n\t\t\t \t\t\t+ \"Department - \" + res[i].department_name + \" | \" + \"In Stock:\" + res[i].stock_quantity);\n\t\t\t}\n\n\t\t\ttaskList();\n\t\t}\n\t})\n\t\t\n}", "title": "" }, { "docid": "612b50a56ff0d54dc7bb8ba99dfc9f76", "score": "0.663418", "text": "function viewProducts () {\n\n // Create a SQL select query to grab all the rows from the products table\n connection.query(\n 'SELECT * FROM products',\n function (err, res) {\n if (err) throw err;\n\n // Display the products in a nice table format\n console.table(res);\n\n // Display the main menu\n mainMenu();\n }\n );\n}", "title": "" }, { "docid": "4cf0c3d48f7a8a77bc630e657357d70e", "score": "0.66296774", "text": "function getproducts() {\n $.get(\"/api/products\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createproductRow(data[i]));\n }\n renderproductList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "title": "" }, { "docid": "dcfbe06751c13b2922330c0511eb4a61", "score": "0.6564134", "text": "OnClick(products){\n console.log(\"product selected\")\n BuySdkManager.presentProductwithId(String(products.product_id));\n console.log(\"product view displayed succesfully\");\n }", "title": "" }, { "docid": "fce847c159992d2a6237c037d711b6ca", "score": "0.65531135", "text": "function viewProducts() {\n console.log(\"**************************************************\")\n availableProducts();\n}", "title": "" }, { "docid": "3b6386587adb6819cdd37085ad2390f0", "score": "0.655187", "text": "renderProducts() {\n this.products.forEach( ( product ) => {\n product.render();\n } );\n }", "title": "" }, { "docid": "c9b714c5a9ba6a94512623c63a8b7129", "score": "0.6549368", "text": "renderProducts(products) {\n\t\t// FOR EVERY SINGLE PRODUCT\n\t\tproducts.forEach((product, index) => {\n\t\t\t// DEFINE A SINGLE PRODUCT (using the products data)\n\t\t\tconst element = Product(product, index);\n\t\t\t// PRODUCTS \"DOM\" APPENDS \"ELEMENT\"\n\t\t\tPRODUCTS.innerHTML += element;\n\t\t});\n\t\t// GET PRODUCTS FROM STORAGE\n\t\tproducts = Storage.GetItem(\"products\") || products;\n\t\t// GET ALL ADD TO CART BUTTONS\n\t\tthis.getAddToCartButtons(products);\n\t\t// FUNCTIONALITIES FOR REMOVING CART ITEMS\n\t\tthis.cartLogic();\n\t}", "title": "" }, { "docid": "b92dd1a9f41e525f0c3491fa06a7afbe", "score": "0.6522645", "text": "function viewProductsForSale() {\n\t\n\t\tprintProductsReportHeader();\n\t\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(err, res) {\n\t\t\tif (err) throw err;\n\t\n\t\t\tfor (const product of res) {\n\t\t\t\tconsole.log(\n\t\t\t\t\tproduct.item_id.toString().padStart(PAD_ITEM_ID) + \" | \" + product.product_name.toUpperCase().padStart(PAD_PRODUCT_NAME) + \" | \" +\t\t\t\t\tproduct.price.toFixed(PRICE_DECIMAL).toString().replace(/^/,\"$\").padStart(PAD_PRICE) + \" | \" +\n\t\t\t\t\tproduct.stock_quantity.toString().padStart(PAD_QTY)\n\t\t\t\t);\n\t\t\t}\n\t\t\tconsole.log(\"================================================================\".bold.blue);\n\t\t\tstartBamMgr();\n\t\t});\n\t}", "title": "" }, { "docid": "433bca6c67250018c78a1f237d856839", "score": "0.6507636", "text": "viewInventoryandSelect() {\n\t\tconnection.query(\"SELECT * FROM products\", (err, res) => {\n\t\t\tif (err) throw err;\n\t\t\tconsole.table(res);\n\t\t\tthis.addInventory();\n\t\t});\n\t}", "title": "" }, { "docid": "264fcd9359cd48951fc4560e541741cb", "score": "0.64925104", "text": "queryProduct() {\n let productId = this.getAndClearInput('queryProductId');\n this.getDataAndRefresh('Product', productId);\n this.setEvents();\n }", "title": "" }, { "docid": "a6292b0005d7df95eee310a4ec013513", "score": "0.6492129", "text": "function viewProducts() {\n // query the database for all items being listed\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, results) {\n if (err) throw err;\n\n //console.log(results);\n console.log('----------------------------------------------------------------------');\n console.log('___________.~\"~._.~\"~._.~Welcome to BAMazon~._.~\"~._.~\"~._____________');\n console.log('----------------------------------------------------------------------');\n console.table(results);\n start();\n });\n}", "title": "" }, { "docid": "b2fa304b0d6f9b4748761c2cf6cacb5a", "score": "0.6477561", "text": "loadFromStorage() {\n\n let products = this.all();\n products.forEach(product => this.products.set(product.id, product))\n }", "title": "" }, { "docid": "052cfe00789995ea40f23cb5561eba5d", "score": "0.6460793", "text": "function loadProducts() {\n API.getProducts()\n .then(products => {\n setId(window.location.href.split(\"/\").pop());\n setProducts(products);\n getProduct();\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "2ce2c43aefe38ab9b965a9c5d82d932a", "score": "0.6457866", "text": "function getProductsOnSale(){\n IndexService.getProductsOnSale().then(function (data) {\n vm.productOnSale = data;\n });\n }", "title": "" }, { "docid": "40d835a557017dd2092f8a3e0eb28593", "score": "0.64396876", "text": "function getProducts() {\n $.get(\"/api/4products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "2ae42e15c559e2b96e5434aa3fdc668d", "score": "0.64375705", "text": "function setProductsView(items) {\n const container = $('.products').css('display', 'none').fadeIn('slow');\n container.empty();\n\n items.map( (item, i) => container.append(clothingView(item, i)) );\n // Re-wrting quickview handler is necessary\n // because previous quickviews are unregistered when the container is empty.\n registerQuickView();\n}", "title": "" }, { "docid": "cd1f32f810bc78756644d5e7f0427492", "score": "0.6436451", "text": "function loadProducts() {\n $http.get(url).success(function (products) {\n $scope.products = products;\n })\n }", "title": "" }, { "docid": "9dc8e06a62a14e1294a87ce9b53d0809", "score": "0.6414479", "text": "async function populateProductData() {\n // npm install --save axios\n const response = await axios.get('Inventory/GetInventory');\n setProducts(response.data);\n setLoading(false);\n }", "title": "" }, { "docid": "44aaf6c45df7c9ac0572ecef01776146", "score": "0.640726", "text": "function viewProducts() {\n\tconnection.query('SELECT * FROM Products', function(err, result) {\n\t\tfor (var i = 0; i < result.length; i++) {\n\n\t\t\ttable.push(\n\t \t\t[result[i].itemId, result[i].productName, result[i].Price, result[i].stockQuantity]\n\t\t\t);\n\t\t}\t\n\t\tconsole.log(table.toString());\t\n\t\tmakePurchase();\n\t})\n\n}", "title": "" }, { "docid": "8cbb4b7380e9e29d41a3efe140808b6b", "score": "0.6401148", "text": "async function getProducts() {\n\t\ttry {\n\t\t\t// Store all tags in : tags\n\t\t\tconst tags = await Tag.find()\n\t\t\t\t.then()\n\t\t\t\t.catch((dbError) => next(dbError));\n\t\t\t// Store all sneakers from the database in : sneakers\n\t\t\tconst sneakers = await Sneaker.find()\n\t\t\t\t.then()\n\t\t\t\t.catch((dbError) => next(dbError));\n\n\t\t\t// Render the products page with all sneakers !\n\t\t\tres.render('products', {\n\t\t\t\ttags,\n\t\t\t\tsneakers,\n\t\t\t\tscripts: ['filter.js'],\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tnext(error);\n\t\t}\n\t}", "title": "" }, { "docid": "d5defac7712eda788210e4c6872afa9e", "score": "0.6400218", "text": "function loadProducts() {\n sendRequest(\"/products/allProducts\", \"GET\", null, null, setProducts);\n}", "title": "" }, { "docid": "f70bcd2faefe39e9dc13d76e0695dcf2", "score": "0.63734984", "text": "function retrieveProducts(results) {\n // Store the \n cacheHandler.storeProductCache(results);\n\n pageResult = cacheHandler.getPageFromProductCache();\n \n\n showProducts(pageResult);\n\n updatePageVisuals();\n}", "title": "" }, { "docid": "f6910fa0af5aab481e7ee478a015b2a0", "score": "0.63683075", "text": "function getProducts() {\n $.get(\"/api/5products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "ad055716f4f4afa26d30ddfcce4dca7f", "score": "0.63665867", "text": "function createHtmlForProducts(){\t\t\t\n\t\t\t$('.preLoader').show();\t\t\n\t\t\t\t\t\t\t\tvar query = ProductTable.where({}).take(1000);\n\t\t\t\t\t\t\t\tquery.read().then(function(todoItems) {\n\t\t\t\t\t\t\t\t\tproductList = todoItems;\n\t\t\t\t\t\t\t\t\t//console.log($.param( productList ));\n\t\t\t\t\t\t\t\t\tcreateProdMatch(1);\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}, handleError).done(function(){\n\t\t\t\t\t\t\t\t\t$('.preLoader').hide();\n\t\t\t\t\t\t\t\t\t\tvar locations = window.location.href;\n\t\t\t\t\t\t\t\t\t\tlocations = locations.split('?id=');\n\t\t\t\t\t\t\t\t\t\tif(locations[1]){\n\t\t\t\t\t\t\t\t\t\t\tvar prodId = locations[1];\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tvar prodId = '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(prodId != ''){\n\t\t\t\t\t\t\t\t\t\tproductDetail(prodId,2);\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$('.screen-7').css('height','auto');\n\t\t\t\t\t\t\t\t\t\t$('.screen-7').css('overflow','auto');\n\t\t\t\t\t\t\t\t\t\ttranslate('.screen-7','0%');\n\t\t\t\t\t\t\t\t\t\t$(\"html, body\").animate({ scrollTop: \"0\" });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//buttonClicks();\n\t\t\t\t\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "c7843a841270368deb5595c337a6a4cc", "score": "0.63524425", "text": "function getProducts() {\n $.get(\"/api/15products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "ddbdcf8e3c10e8ee88fdc37b07232e40", "score": "0.63028437", "text": "function getProducts(data){\n $scope.products = data;\n $scope.product = {};\n }", "title": "" }, { "docid": "ddbdcf8e3c10e8ee88fdc37b07232e40", "score": "0.63028437", "text": "function getProducts(data){\n $scope.products = data;\n $scope.product = {};\n }", "title": "" }, { "docid": "8ea3c789c5c5c341f5e41c7ddc80eb92", "score": "0.6274626", "text": "function startDisplayProducts() {\n connection.query(\"SELECT * FROM products\", function (error, body) {\n if (error) throw error;\n\n table(body);\n purchaseItem(body);\n \n\n \n });\n}", "title": "" }, { "docid": "34b5386277318fbcdc703c7f64b32f83", "score": "0.6272421", "text": "function loadProductPage() {\n var productId = getProductId();\n var productDetails = allProducts.filter(product => product.id == productId);\n\n /*\n * filter creates array - grab only item (should always only be 1 - \n * no two items should have the same product id)\n */\n productDetails = productDetails[0];\n\n buildImageContainer(productDetails.img, productDetails.thumbnails);\n buildDetailsContainer(productDetails.name, productDetails.rating,\n productDetails.price, productDetails.details);\n}", "title": "" }, { "docid": "c4e1a1b5e73fe8b4e2eb0c4446e6953f", "score": "0.62724", "text": "function getSetItem() {\n var currentVariationModel;\n var Product = training_app.getModel('Product');\n var product = Product.get(params.pid.stringValue);\n product = getSelectedProduct(product);\n currentVariationModel = product.updateVariationSelection(params);\n\n if (product.isVisible()) {\n app.getView('Product', {\n product: product,\n CurrentVariationModel: currentVariationModel,\n isSet: true\n }).render('product/components/productsetproduct');\n } else {\n // @FIXME Correct would be to set a 404 status code but that breaks the page as it utilizes\n // remote includes which the WA won't resolve\n response.setStatus(410);\n app.getView().render('error/notfound');\n }\n\n}", "title": "" }, { "docid": "f8e49471d4c72b762820ee5dc42ee62b", "score": "0.62690127", "text": "function getAllProducts() {\n productService.getAll()\n .then(function(products){\n vm.products = products;\n })\n .catch(function(message){\n vm.errorMessage = message;\n });\n }", "title": "" }, { "docid": "eee75a4b1f04203db670bf92d7efec26", "score": "0.6268076", "text": "function loadProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tconsole.table(res);\n\t\tpromptCustomerForItem(res);\n\t});\n}", "title": "" }, { "docid": "8188dad6fee791a70d7f1135d85c0ad1", "score": "0.6267475", "text": "getProducts() {\n let products = store.get('products');\n // boostrap products with books if they don't exist\n if(!products) {\n store.save('products', books);\n products = books;\n } \n return products;\n }", "title": "" }, { "docid": "ea5e49ccd1e0d4524d7b527875f4cb95", "score": "0.6260012", "text": "displayProduct(e) {\n if (this.state.isViewAll) {\n this.setState({\n existingProducts: this.props.products.filter(\n product => product.id === e.target.value,\n )[0],\n isViewAll: false, // view a particular product only\n });\n } else {\n this.setState({\n existingProducts: this.props.products,\n isViewAll: true,\n });\n }\n }", "title": "" }, { "docid": "7605410138e63cfece9cfb5a433d9508", "score": "0.6251778", "text": "function viewProducts() {\n // query database and return back the list of products available for the customer to purchase \n connection.query(\"SELECT * FROM bamazon_db.products\", function (err, res) {\n if (err) throw err;\n\n // display all of the items available for sale - include ids, names, and prices of products for sale\n console.log(\"\\n==============================< COMPLETE PRODUCT LISTING >==============================\");\n console.log(\"-------------------< Includes all products with quantity of 0 or more >-------------------\");\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product-ID: \" + res[i].item_id + \" --- \" + res[i].product_name + \" --- Price --- \" + res[i].price + \" --- Qty --- \" + res[i].stock_quantity);\n } // end for loop\n console.log(\"============================< END COMPLETE PRODUCT LISTING >==============================\\n\");\n managerFunctions();\n }); // end display query\n} // end viewProducts()", "title": "" }, { "docid": "164d2aefc119f3311ad6ffef510ebbd0", "score": "0.623643", "text": "function viewAllProducts() {\n connection.query(\n \"SELECT * FROM products\",\n function(err, res) {\n if (err) throw err;\n console.table(res);\n mainMenu();\n }\n )\n}", "title": "" }, { "docid": "358984a73eff78b0b63dfc209aaca4aa", "score": "0.6221745", "text": "function getProduct() {\n const item = products.filter(result =>\n result._id === id);\n prodID = item[0].productID;\n setProduct(item);\n\n }", "title": "" }, { "docid": "a149294da75de7d257870d6331ab2da0", "score": "0.62198865", "text": "function get_products(e) {\n\t\tloading();\n\t\tvar retailer_name = e.dataPoint.name;\n\t\t$.ajax({\n\t\t\turl : 'get_products_view/'+retailer_name,\n\n\t\t\tmethod : 'POST',\n\t\t\tdataType: 'json',\n\t\t\tsuccess : function(data)\n\t\t\t{\n\t\t\t\tunloading();\n\t\t\t\tif(typeof rev_store_tb_obj == 'object'){\n\t\t\t\t\trev_store_tb_obj.fnDestroy();\n\t\t\t\t}\n\t\t\t\t$(\"#products_listing tbody\").html(data);\n\t\t\t\trev_store_tb_obj = $(\"#products_listing\").dataTable({\n\t\t\t\t\t\"iDisplayLength\":100,\n\t\t\t\t\t\"lengthMenu\": [ 25, 50, 75, 100 ],\n\t\t\t\t\tfnDrawCallback: function( oSettings ) {\n\t\t\t\t\t\tvar elm = $('select[name=products_listing_length]').parent().parent();\n\t\t\t\t\t\t$('select[name=products_listing_length]').parent().remove();\n\t\t\t\t\t\telm.html('<div class=\"form-group\" style=\"margin-bottom: 5px;\"><label>Search</label><input type=\"text\" id=\"retailer_product_search\" class=\"form-control\"></div>');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//\t\t\t\t$(\"#products_listing tbody\").html(data);\n\t\t\t\t$('#retailer_name').text(retailer_name);\n\n\t\t\t\t$('html, body').animate({\n\t\t\t\t\tscrollTop:$('#products_details').position().top\n\t\t\t\t}, 'slow');\n\t\t\t\t$(\"#products_details\").removeClass('hide');\n\t\t\t\t$('html, body').animate({\n\t\t\t\t\tscrollTop: $(\"#products_details\").offset().top\n\t\t\t\t}, 100);\n\t\t\t},\n\t\t\terror: function(){\n\t\t\t\tunloading();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "cc6212788d08cf8bf918c4254729b1ad", "score": "0.6209775", "text": "function viewProducts(){\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", \n\t\tfunction(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tfor (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n\t});//end of query\n}//end viewProducts", "title": "" }, { "docid": "9a2799721c6683aaffa05375de9c9581", "score": "0.6209104", "text": "function getAllProducts() {\n $.get('http://127.0.0.1:8000/api/product', function (result) {\n var rows = '';\n result.map(function (product) {\n var productDom = '<tr>' +\n '<td>' + product.id + '</td>' +\n '<td>' + product.name + '</td>' +\n '<td>' + product.category.name + '</td>' +\n '<td>' + '<button class=\"btn btn-info btnEdit\" data-product=\"' + product.id + '\">Edit</button>' + '</td>' +\n '<td>' + '<button class=\"btn btn-danger btnDelete\" data-product=\"' + product.id + '\">Delete</button>' + '</td>' +\n '</tr>'\n\n rows = rows + productDom\n });\n $('table').html('')\n $('table').append(rows)\n registerListener()\n\n })\n\n }", "title": "" }, { "docid": "a006bfb8782df6f4b849c6bbd612a0ac", "score": "0.6208974", "text": "function runRender() {\n shoppingCart.addProduct(productList[0]);\n shoppingCart.addProduct(productList[1]);\n shoppingCart.addProduct(productList[2]);\n shoppingCart.renderProducts();\n}", "title": "" }, { "docid": "e2ce186f9278963a982b7e99ab98cd74", "score": "0.6203853", "text": "function getProducts() {\n $.get(\"/api/products\", function (data) {\n products = data;\n $(\".card-row\").empty()\n createCard(products)\n })\n }", "title": "" }, { "docid": "95fa334ba65bf0f76063d100d661fa66", "score": "0.6201593", "text": "function viewProducts() {\n\n var query = connection.query('SELECT * FROM products ORDER BY dept', function (err, res) {\n\n if (err) throw (err);\n\n console.log(\"\\nAll Products: (By Department)\");\n console.log(\"------------------------------------------------------------------------\");\n constructTable(res);\n });\n}", "title": "" }, { "docid": "08511f5033844120c816c36f9a4fff52", "score": "0.6199619", "text": "function addProductDetailsInListView(product) {\n var $productListTemplate = $(\"#productviewtemplate\").clone();\n $productListTemplate.attr('id', \"row\" + product.id);\n var isOdd = $(\"#productgridcontent\").find(\".j_viewproduct:first\").hasClass('odd');\n if (isOdd == true) {\n $productListTemplate.addClass('even');\n } else {\n $productListTemplate.addClass('odd');\n }\n $productListTemplate.addClass('selected');\n $productListTemplate.addClass('active');\n $productListTemplate.find(\".widget_navtitlebox\").find('.title').text(product.name);\n $productListTemplate.find(\".widget_navtitlebox\").find('.subtitle').text(product.category.name);\n $productListTemplate.find(\".widget_info_popover\").find('.raw_contents').find(\"#info_bubble_displayname\").find(\n '.raw_contents_value').find(\"#value\").text(product.uom);\n $productListTemplate.find(\".widget_info_popover\").find('.raw_contents').find(\"#info_bubble_code\").find(\n '.raw_contents_value').find(\"#value\").text(product.code);\n\n $productListTemplate.show();\n $(\"#productgridcontent\").prepend($productListTemplate);\n var productsCount = $(\"#productgridcontent\").find(\".j_viewproduct\").size();\n // remove last element if count grater than pagination value\n if (productsCount > perPageValue) {\n $(\"#productgridcontent\").find(\".j_viewproduct:last\").remove();\n }\n // reset styling\n resetGridRowStyle();\n $(\"#productgridcontent\").find(\".j_viewproduct:first\").click();\n $(\"#productgridcontent\").find(\"#non_list\").remove();\n}", "title": "" }, { "docid": "21922b494eac0f33acc97d77da4ea0da", "score": "0.6196188", "text": "function displayProducts(){\n\tvar spacer = \"===================================================\";\n\tvar query = \"SELECT * FROM products ORDER BY department_name\";\n\tconnection.query(query, function(error,data){\n\t\tdata.forEach(function(product){\n\t\t\tconsole.log(\"\\nProduct ID : \"+ product.item_id+\"\\nProduct Name : \"+product.product_name+\"\\nDepartment : \"+product.department_name+\"\\nPrice : \"+product.price+\"\\n\"+spacer);\n\t\t})\n\tplaceOrder();\n\t})\t\n}", "title": "" }, { "docid": "f7d170a1685f7a3360bccc7f6a50cd16", "score": "0.61956114", "text": "function updateProduct(){\n var productString = JSON.stringify(Products.all);\n localStorage.setItem('productChoose', productString);\n}", "title": "" }, { "docid": "f32400f31c508fb78d7c0ff989179a45", "score": "0.61896914", "text": "function loadProducts() {\n \n productAPI\n .getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "bfc2dc8be6d4ab075b0d648805c252a2", "score": "0.61597997", "text": "function getProduct() {\n var productData = localStorage.getItem(\"data\");\n if (productData) {\n Item.all = JSON.parse(productData);\n renderResult();\n addChartJs();\n }\n}", "title": "" }, { "docid": "a356f379deeec7ded0e54767d8bae71c", "score": "0.6131565", "text": "function viewProducts() {\r\n connection.query(\"SELECT * FROM products\", function (err, res) {\r\n if (err) throw err;\r\n console.log(\"connected\")\r\n\r\n //Products displayed using easy-table npm\r\n var t = new Table\r\n\r\n res.forEach(function(product) {\r\n t.cell('Product Id', product.item_id)\r\n t.cell('Description', product.product_name)\r\n t.cell('Department Name, USD', product.department_name)\r\n t.cell('Price', product.price.toFixed(2))\r\n t.cell('Stock Quantity', product.stock_quantity)\r\n t.newRow()\r\n })\r\n console.log(t.toString())\r\n });\r\n}", "title": "" }, { "docid": "6cec091993679a9b913f6aa43e302a41", "score": "0.61279684", "text": "function updateProducts() {\n var productStorage = JSON.stringify(Product.productArray);\n localStorage.setItem('products', productStorage);\n}", "title": "" }, { "docid": "d491aa04009af4469cccb2eb221b488a", "score": "0.6125119", "text": "function viewProducts(bool) {\n\tvar query = \"SELECT * FROM Bamazon.products;\"\n\t//query the database\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i <res.length; i++) {\n\t\t\tconsole.log(\"Item #\" + res[i].item_id + \" || \" + res[i].product_name + \" || \" + res[i].department_name + \" || \" + res[i].price + \" || \" + res[i].stock_quantity + \" units in stock.\");\n\t\t}\n\t\tif (bool) {\n\t\t\trunManagerConsole();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d07a0a868a91b4c7ad4f6a5bc0fc91e6", "score": "0.6111298", "text": "function updateProducts(){\n $('.cart-products > li').each(function(){\n var $transformed = $(this);\n var $original = $('#' + $transformed.attr('data-id')).closest('tr');\n if ($original.length) {\n\n // Update quantity, price\n $transformed.find('.qty-stepper input').val($original.find('[id^=\"qty_\"]').val());\n $transformed.find('.price').text($original.find('.each .price').first().text());\n\n // Update promo information\n var promo = $original.next('tr');\n if (promo.length) {\n promo = parsePromo(promo);\n }\n if (promo.discount) {\n $transformed.find('.promo').addClass('active');\n $transformed.find('.promo .discount').text(promo.discount);\n $transformed.find('.promo .value').text(promo.value);\n } else {\n $transformed.find('.promo').removeClass('active');\n }\n\n } else {\n $transformed.remove();\n }\n });\n }", "title": "" }, { "docid": "a51fc738baa9212861936a1a5cb29116", "score": "0.61075157", "text": "function displayProducts() {\n\t// a) display the products (names, IDs, and prices)\n\tcon.query('SELECT * FROM `products`', function(err, results) {\n\t\t// errors\n\t\tif (err) throw err;\n\n\t\t// tell users they're looking at the product list\n\t\tconsole.log(\"Welcome to Bamazon!\\nHere's our selection!\");\n\n\t\t// loop through results array, log apropos results\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tconsole.log(results[i].itemID + \". \" +\n\t\t\t\t\t\t\t\t\tresults[i].ProductName + \" ($\" +\n\t\t\t\t\t\t\t\t\tresults[i].Price + \")\");\n\t\t}\n\t\t// run Purchase Item\n\t\tpurchaseItem(true); \n\t});\n}", "title": "" }, { "docid": "4127da6289a600fc21a79fadfd82dd0f", "score": "0.6099929", "text": "function updateProduct(){\n\t\t\t//TODO #2\n\t\t\t\n\t\t\t//create product object, pass to product service\n\t\t\tvar updateProduct = {\n\t\t\t\tname: productVm.name,\n\t\t\t\timage: productVm.image,\n\t\t\t\tdescription: productVm.description,\n\t\t\t\tcategory: productVm.category, \n\t\t\t\tprice: productVm.price, \n\t\t\t\tquantity: productVm.quantity\n\t\t\t}\n\t\t\t\n\n\t\t\tconsole.log(productVm.name)\n\t\t\tconsole.log(productVm.image)\n\t\t\tvar productIdEdit = location.hash.split('/')[3];\n\t\t\tconsole.log(productIdEdit)\n\t\t\tproductSrv.updateProduct(updateProduct, productIdEdit);\n\t\t\tconsole.log(updateProduct)\n\t\t\t// productSrv.updateProductList();\n\t\t\t//Update text in button\n\t\t\talert(\"You edited \" + updateProduct.name);\n\t\t\tproductVm.product_update_btn = \"You edit was successful\";\n\t\t\t$state.go('admin.dash')\n\t\t\t.then(function() {\n\t\t\t\t\t$state.reload();\n\t\t\t})\n\n\t\t}", "title": "" }, { "docid": "7bb6eedb3ba9835e9b85452b4cbe7b5f", "score": "0.60986996", "text": "function populateProducts(productList) {\n $(\"#home-product-container\").empty();\n for(var i = 0; i < productList.length; i++) {\n $(\"#home-product-container\").append(\n '<div class=\"productItem col-3\">' +\n '<div>' +\n '<a>' + productList[i].name + '</a>' +\n '</div>' +\n '<img src=' + productList[i].img + '>' +\n '<div class=\"product-item-content\">' +\n '<div class=\"product-description\">' +\n productList[i].details +\n '</div>' +\n '<div class=\"product-view-btn\">' +\n '<button type=\"button\" class=\"btn btn-primary btn-lg\" onclick=\"viewProduct()\">View</button>' +\n '</div>' +\n '</div>' +\n '</div>'\n );\n }\n}", "title": "" }, { "docid": "21900c58e51532f0b9f5a09650924f01", "score": "0.6085156", "text": "function displayProducts() {\n\n\t//connect to the mysql database and pull the information from the Products database to display to the user\n\n\tvar sql = 'SELECT * FROM products'\n\tconnection.query(sql, function(err, result){\n\t\tif(err) console.log(err)\n\n\t\t//creates a table for the information from the mysql database to be placed\n\t\tconsole.log('>>>>>>Products Available<<<<<<'.blue)\n\t\tvar table = new Table({\n\t\t\thead: ['Product Id#', 'Product Name', 'Price', 'Stock Quantity', 'Sales'],\n\t\t\tchars: chars,\n\t\t\tcolAligns: [null, null, 'right', 'right', 'right'],\n\t\t\tstyle: {\n\t\t\t\thead: ['blue'],\n\t\t\t\tcompact: false\n\t\t\t}\n\t\t})\n\n\t\t//loops through each item in the mysql database and pushes that information into a new row in the table\n\t\tfor(var i = 0; i < result.length; i++){\n\t\t\ttable.push(\n\t\t\t\t[result[i].item, result[i].product_name, result[i].price, result[i].stock_qty, result[i].product_sales]\n\t\t\t)\n\t\t}\n\t\t//show the product info in tabular form\n\t\tconsole.log(table.toString())\n\n\t\t//recursive call to determine next action \n\t\tdetermineAction()\n\t});\n}", "title": "" }, { "docid": "5beb69b53c3b053bd6fae67d08fb18d5", "score": "0.60816765", "text": "function loadProducts() {\n $http.get(\"http://localhost:3000\").success(function (offerings) {\n app.offerings = offerings;\n });\n }", "title": "" }, { "docid": "b3a5877e785b6c28db72b40d9657b3a7", "score": "0.60742754", "text": "function showProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n console.table(res);\n managerPrompt();\n })\n}", "title": "" }, { "docid": "cb196f657404d8d63ae6b334be4d043a", "score": "0.60725915", "text": "function viewProductsForSale() {\n console.log('Selecting all products...\\n');\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n var t = new Table;\n res.forEach(function (product) {\n t.cell('item_id', product.item_id);\n t.cell('product_name', product.product_name);\n t.cell('department_name', product.department_name);\n t.cell('price', product.price);\n t.cell('stock_quantity', product.stock_quantity);\n t.cell('product_sales', product.product_sales);\n t.newRow();\n });\n\n console.log(t.toString());\n console.log('\\n \\n');\n getUserInputAsync();\n\n });\n}", "title": "" }, { "docid": "8463b55a30294cba7c0ab0a850303303", "score": "0.606686", "text": "async displayAllItems() {\n const rows = await db.getAllItems(this.connection);\n return this.logProductRows(rows);\n }", "title": "" }, { "docid": "1db2a4b42eabd360252e5601461bd99a", "score": "0.60557497", "text": "async function loadProducts() {\n const response = await api.get('products');\n const data = response.data.map(product => ({\n ...product,\n priceFormatted: formatPrice(product.price),\n }));\n // and instead of setState, we use setProducts now\n setProducts(data);\n }", "title": "" }, { "docid": "be7b982e284cc55dbe2e0f2a9563f192", "score": "0.60523295", "text": "function viewProducts(){\n // Query Made To Database\n connection.query(\"SELECT * FROM products\", function(err, res) {\n console.log(\"\\n-----------------------------------\");\n // All Products Are Listed\n for (var i = 0; i < res.length; i++) {\n console.log(\"Product_ID: \" + res[i].item_id + \" | Product_Name: \" + res[i].product_name + \" | Price: \" + res[i].price.toFixed(2) + \" | Quantity: \" + res[i].stock_quantity + \" | \" );\n }\n console.log(\"\\n-----------------------------------\");\n // Prompted To Choose Another Function\n managing();\n });\n}", "title": "" }, { "docid": "fabd7ec392955b79b615ebe1b210979a", "score": "0.6049125", "text": "function updateVotes() {\n for (var i = 0; i < Product.allProducts.length; i++) {\n Product.allVotes.push(Product.allProducts[i].votes);\n Product.allNames.push(Product.allProducts[i].name);\n }\n localStorage.setItem('allProducts', JSON.stringify(Product.allProducts)); //Save Array of products to local storage\n}", "title": "" }, { "docid": "4defdaff59fcb3d20bd6a7e3662cb492", "score": "0.6043891", "text": "function feed_products(data){\r\n\r\n console.log('feed start')\r\n\r\n productos = JSON.parse(data);\r\n\r\n $(screens_data).each(function(){\r\n\r\n var targetProds = []\r\n\r\n var codigo = $(this)[0].codigo;\r\n var index = 0;\r\n\r\n //Grep each screen products\r\n\r\n var screen_prods = $.grep(productos, function(e){\r\n\r\n if(e.idImpresora == codigo){\r\n\r\n // We add an index for later manipulation\r\n // Doing that we avoid to populate the DOM\r\n // with a lot of data.\r\n\r\n e.index = index;\r\n index++;\r\n\r\n // Push the product to the screen's array of products;\r\n targetProds.push(e);\r\n\r\n\r\n\r\n }\r\n })\r\n\r\n // Finaly add the array of products to the screen\r\n $(this)[0].productos = targetProds;\r\n\r\n // Begin templating;\r\n template = $('#products').html();\r\n\r\n\r\n\r\n Mustache.parse(template);\r\n\r\n var template_data = {\r\n \"productos\": $(this)[0].productos\r\n }\r\n\r\n var rendered = Mustache.render(template, template_data);\r\n $('#codigo'+codigo).children('.screen-content').html(rendered);\r\n\r\n\r\n })\r\n\r\n // Allow refresh\r\n refresh_perm = true;\r\n\r\n //Init actions\r\n actions();\r\n\r\n // Checkout\r\n //console.log('sync ok')\r\n\r\n}", "title": "" }, { "docid": "ae893e3ebae7eb26c19c6bdb870cea85", "score": "0.60436684", "text": "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function (error, results) {\n if (error) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(\"\\r\\n\" + \"ID: \" + results[i].item_id);\n console.log(\"Product: \" + results[i].product_name);\n console.log(\"Price: \" + \"$\" + results[i].price);\n }\n buyProducts();\n })\n}", "title": "" }, { "docid": "9aecdc613f25c6fae98db593ba09b56e", "score": "0.60130453", "text": "function showProduct(){\n let productId = commonService.getFromStorage('productId');\n if(productId){\n let promise = httpService.getProductbyId(productId)\n promise\n .then(product => {\n let formatedProduct = productService.getFormatedProduct(product);\n document.getElementById('productDetailId').innerHTML = formatedProduct;\n })\n .catch(error => {\n commonService.showInfoMessage(error);\n });\n }\n}", "title": "" }, { "docid": "ff6661ec6b9cee958323626b4e79b12b", "score": "0.6012062", "text": "async function fetchProducts() {\n const response = await fetch(`${BASE_URI}/products`)\n const products = await response.json()\n populateProducts(products)\n}", "title": "" }, { "docid": "bbd5bea894694d052e09f2c5041fcab9", "score": "0.600655", "text": "function getProducts() {\n var dataP = localStorage.getItem('Products');\n //console.log(' dataP' , dataP);\n\n var ProductData = JSON.parse(dataP);\n //console.log('Product data' , ProductData);\n\n if (ProductData) {\n //console.log('ProductData.length' , ProductData.length );\n //console.log(' products length 2 ' , AllProductsCont.all.length );\n\n for (let i = 0; i < ProductData.length; i++) {\n var rawProductObject = ProductData[i];\n var chgProductCtrs = AllProductsCont.all[i];\n\n chgProductCtrs.seenCounter = rawProductObject.seenCounter;\n chgProductCtrs.clickCounter = rawProductObject.clickCounter;\n }\n //console.log(' products length 2 ' , AllProductsCont.all.length );\n\n renderNewProducts();\n } else {\n\n alert(' nothing here ');\n }\n //console.log('local Storage Data', ProductData);\n} //// Ending Of get Products Function ", "title": "" }, { "docid": "864e7a76373fc0559ea33ee1dfb104e2", "score": "0.60019773", "text": "function loadProductToCart() {\n let vProduct = JSON.parse(localStorage.getItem('products'));\n let vOrderDetail = JSON.parse(localStorage.getItem('orderDetail'));\n if (vProduct) {\n vProduct.forEach((productId, index) => {\n $.ajax({\n url: `${G_BASE_URL}/products/${productId}`,\n method: 'get',\n dataType: 'json',\n success: (product) => {\n renderProductToCart(product, index, vOrderDetail[index]);\n },\n error: (e) => alert(e.responseText),\n });\n });\n }\n }", "title": "" }, { "docid": "864e7a76373fc0559ea33ee1dfb104e2", "score": "0.60019773", "text": "function loadProductToCart() {\n let vProduct = JSON.parse(localStorage.getItem('products'));\n let vOrderDetail = JSON.parse(localStorage.getItem('orderDetail'));\n if (vProduct) {\n vProduct.forEach((productId, index) => {\n $.ajax({\n url: `${G_BASE_URL}/products/${productId}`,\n method: 'get',\n dataType: 'json',\n success: (product) => {\n renderProductToCart(product, index, vOrderDetail[index]);\n },\n error: (e) => alert(e.responseText),\n });\n });\n }\n }", "title": "" }, { "docid": "2e462f19a62d01c300055fcfeed5d267", "score": "0.59976035", "text": "function loadProducts() {\n // Query database to return all entries\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if(err) throw err;\n\n // Display all items in console\n console.table(res);\n\n // Call function to prompt user to purchase an item\n promptToPurchase();\n });\n}", "title": "" }, { "docid": "bfe3ed561e769b4a0b23fc9cbcc596ee", "score": "0.59945244", "text": "function displayAdminView(id){\r\n let product = getProductById(id)\r\n document.getElementById(\"product-name\").innerHTML = product.name\r\n let layout = '<li>Marca: '+product.brand+'</li>'\r\n layout+='<li>Tamanho: '+product.size+'</li>'\r\n layout+='<li>Cor: '+product.color+'</li>'\r\n layout+='<li>'+product.description+'</li>'\r\n layout+='<li>Quantidade em Estoque: '+product.stock+'</li>'\r\n layout+='<li>Quantidade Vendida: '+product.sold+'</li>'\r\n document.getElementById('product-details-list').innerHTML = layout\r\n document.getElementById('product-price').innerHTML = '$'+ product.price\r\n document.getElementById('actions-product-details').innerHTML = '<a href=\"product_form.html?product_id='+product.id+'\" class=\"central-link\">Editar</a><a href=\"example_product.html\" class=\"central-link\">Excluir Produto</a>'\r\n\r\n document.getElementById('product-img').innerHTML = '<img src=\"'+product.img_path+'\" width=\"400\">'\r\n\r\n}", "title": "" }, { "docid": "0dc2935ff1a76d2ef5486623121d7463", "score": "0.5991975", "text": "function upsertproduct(productData) {\n $.post(\"/api/products\", productData)\n .then(getproducts);\n }", "title": "" }, { "docid": "a40d8701dda39a6d566ef1e354d11c3d", "score": "0.59887", "text": "function getAndDisplayProduct(id) {\n Product.one(id).then(product => {\n // a function to render the product\n renderProductDetails(product);\n // navigate to product show page\n navigateTo(\"product-show\");\n });\n}", "title": "" }, { "docid": "036b2a1515e5c6751024261c0def35a8", "score": "0.59882724", "text": "async function getProducts() {\r\n let rawData = await fetch('/api/products');\r\n let products = await rawData.json();\r\n let html = '';\r\n for (let { id, productName, productDescription, productImage, price } of products) {\r\n html += `\r\n <div class=\"product\">\r\n <h3>${productName}</h3>\r\n <p><b>Product Description:</b> ${productDescription}</p>\r\n <p><img src=\"${productImage}\" class=\"thumbnail\" width=200 ></p>\r\n <p><b>Price:</b> ${price} kr</p>\r\n <p><button class=\"delete-button\" id=\"delete-${id}\">Delete</button></p>\r\n <p><button class=\"change-button\" id=\"change-${id}\">Change</button></p>\r\n <hr>\r\n </div>\r\n `;\r\n }\r\n let productList = document.querySelector('.list-of-products')\r\n productList.innerHTML = html;\r\n // when we have fetched a list scroll to the top of th screen\r\n window.scrollTo(0, 0,);\r\n}", "title": "" }, { "docid": "373d8608eec094886f23e8be5276950d", "score": "0.5986326", "text": "function readProducts() {\n // Display all products in the store\n console.log(\"\\nSelecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n // Sell function\n sellToUser();\n });\n\n }", "title": "" }, { "docid": "08fcbbf502315faefcd1288bc206ef66", "score": "0.59831774", "text": "function viewProd() {\n\n console.log(\"=============================================\");\n console.log(\"\\nThese Items are available for sale:\\n\".warn);\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // style table headings and loop through inventory\n var displayTable = new Table({\n head: [\"Item ID\", \"Product Name\", \"Department Name\", \"Price ($)\", \"Stock Quantity\"],\n colWidths: [15, 30, 30, 15, 30]\n });\n for (var i = 0; i < res.length; i++) {\n displayTable.push(\n [res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(displayTable.toString().info);\n displayMenu();\n })\n}", "title": "" }, { "docid": "c697c4b05fc9cb212caec28a090fac73", "score": "0.5975898", "text": "function getProducts() {\n\treturn (dispatch) => {\n\t\tclient.product.fetchAll().then((resp) => {\n\t\t\tdispatch({\n\t\t\t\ttype: PRODUCTS_FOUND,\n\t\t\t\tpayload: resp,\n\t\t\t})\n\t\t})\n\t}\n}", "title": "" }, { "docid": "5c824dac160cc6157ea58c50b934f55e", "score": "0.5969694", "text": "function display(){\n var counter =0;\n var pr=productOperations.searchAll();\n pr.then(data=>{\n document.querySelector(\"#product\").innerHTML=\"\";\n var h6=document.createElement(\"h6\");\n document.querySelector(\"#product\").appendChild(h6);\n for(let key in data){\n counter++;\n var obj=data[key];\n var div =document.createElement(\"div\");\n var button=document.createElement(\"button\");\n div.className=\"alert alert-info\";\n\n button.className=\"btn btn-success float-right\";\n button.innerHTML=\"Delete\";\n\n button.setAttribute(\"productid\",key);\n button.addEventListener('click',productDelete);\n\n var updatebtn=document.createElement(\"button\");\n updatebtn.className=\"btn btn-secondary float-right margin-right\";\n updatebtn.innerHTML=\"Update\";\n updatebtn.setAttribute(\"prodid\",key);\n updatebtn.addEventListener('click',update);\n\n\n document.querySelector(\"#product\").appendChild(div);\n div.appendChild(button);\n div.appendChild(updatebtn);\n for(let key in obj){\n if(key==\"pid\"){\n var p1=document.createElement(\"p\");\n div.appendChild(p1);\n p1.innerHTML=\"Id : \"+obj[key];\n }\n else if(key==\"name\"){\n var p2=document.createElement(\"p\");\n div.appendChild(p2);\n p2.innerHTML=\"Product-Name : \"+obj[key];\n }\n else if(key==\"price\"){\n var p3=document.createElement(\"p\");\n div.appendChild(p3);\n p3.innerHTML=\"Price : \"+obj[key]+\" ₹\";\n }\n else if(key==\"url\"){\n var img=document.createElement(\"img\");\n img.src=obj[key];\n div.appendChild(img);\n }\n \n }\n \n }\n h6.innerHTML=\"Total no of products : \"+counter;\n }).catch(err=>console.log(err));\n \n }", "title": "" }, { "docid": "49b6807ee05c0618e23a4f676723d060", "score": "0.59533274", "text": "async products(req, res) {\n const result = await UserModel.getAllProducts();\n const category_filter_result = await UserModel.getUniqueCategory(req, res);\n\n res.render(\"../views/user/index\", { products: result, category: '', filter: category_filter_result });\n }", "title": "" }, { "docid": "6ce3e387853f644085c8a303ba8f5266", "score": "0.59460664", "text": "async getProducts() {\n this.loading = true;\n try {\n const { search, sort: sort_direction, sort_field, page} = this.productOptions;\n const {data: items , ...pagination} = await productService.list({\n search, \n sort_direction, \n sort_field,\n page,\n });\n\n this.pagination.props = pagination;\n this.products.props = {\n ...this.products.props,\n items,\n };\n } catch (e) {\n if (e.response && e.response.status === 404) {\n this.products.error = e.response.data;\n this.pagination.props = this.freshPagination().props;\n }\n } finally {\n this.loading = false;\n }\n }", "title": "" }, { "docid": "220906cce288f2711c73c23927c09be4", "score": "0.5942408", "text": "function editProductDetailsInListView(product) {\n var $productListTemplate = $(\"#productgridcontent\").find(\"#row\" + product.id);\n // $productListTemplate.find(\"#nav_icon\").addClass(product.productType.name);\n $productListTemplate.find(\".widget_navtitlebox\").find('.title').text(product.name);\n $productListTemplate.find(\".widget_navtitlebox\").find('.subtitle').text(product.category.name);\n $productListTemplate.find(\".widget_info_popover\").find('.raw_contents').find(\"#info_bubble_displayname\").find(\n '.raw_contents_value').find(\"#value\").text(product.uom);\n $productListTemplate.find(\".widget_info_popover\").find('.raw_contents').find(\"#info_bubble_code\").find(\n '.raw_contents_value').find(\"#value\").text(product.code);\n $(\"#productgridcontent\").find(\"#row\" + product.id).click();\n}", "title": "" }, { "docid": "00e063f36e3fd054e9a26d35b73c4907", "score": "0.5939676", "text": "function displayProducts(products) {\n\t_.each(products, function(product) {\n\t\tvar tpl = '<li class=\"list-group-item\">' +\n\t\t \t'<div class=\"container-fluid\">' + \n\t\t \t\t'<div class=\"row\">' + \n\t\t \t\t\t'<div class=\"col-md-4 productName\">' + \n\t\t \t\t\tproduct.name +\n\t\t \t\t\t'</div>' + \n\t\t \t\t\t'<div class=\"col-md-5\">' + \n\t\t \t\t\taccounting.formatMoney(product.price) + ' per ' + product.per +\n\t\t \t\t\t'</div>' + \n\t\t \t\t\t'<div class=\"col-md-3\">' + \n\t\t \t\t\t\t'<div class=\"form-group\">' + \n\t\t\t\t\t\t\t'<input type=\"text\" onkeypress=\"return event.charCode >= 48 && event.charCode <= 57\" class=\"form-control quantities\" placeholder=\"Qty.\" data-id='+product.name+'>' + \n\t\t\t\t\t\t'</div>' + \n\t\t \t\t\t'</div>' + \n\t\t \t\t'</div>' + \n\t\t \t'</div>' + \n\t\t '</li>';\n\n\t\t$('#productsList').append(tpl);\n\n\t});\n}", "title": "" }, { "docid": "e19cdbb1fda680316611bb8e85b0928d", "score": "0.5932701", "text": "displayProducts(products) {\n\t\t// console.log('products', products)\n\n\t\t// for (const product of products) {\n\t\t// console.log(product)\n\t\t// }\n\n\t\tlet result = '';\n\t\tproducts.forEach((product) => {\n\t\t\tresult += `\n <!--Product-->\n <div class=\"col-sm-6 col-md-3 mb-3\">\n <div class=\"card product\">\n <img src=${product.image} class=\"card-img-top product-img\" alt=\"...\">\n <div class=\"card-body text-center\">\n <h5 class=\"card-title\">${product.title}</h5>\n <p class=\"card-text mb-0\">Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium, velit dolor totam facilis <a href=\"product.html?id=${product.id}\"> Read More ...</a></p>\n <p class=\" mt-3\">Price : <span class=\"card-price\"> ${product.price} </span> EGP</p>\n </div>\n <button class=\"btn btn-warning bag-btn\" data-id=\"${product.id}\">Add To Cart <i class=\"fa fa-cart-plus\" aria-hidden=\"true\"></i></button>\n </div>\n </div>\n <!-- End of Product -->\n `;\n\t\t});\n\t\tproductsDOM.innerHTML = result;\n\t}", "title": "" }, { "docid": "f4bf95f01a42c94df0700aa20d115145", "score": "0.5932449", "text": "function retrieveProducts() {\n if(localStorage.getItem('products')) {\n var storedProducts = localStorage.getItem('products');\n var parsedProducts = JSON.parse(storedProducts);\n Product.productArray = parsedProducts;\n } else {\n instantiateProducts();\n }\n}", "title": "" }, { "docid": "9bda956014611db716aee70cf7c231e4", "score": "0.59314454", "text": "renderList(products) {\n this._cleanProductsList();\n\n if (products.length === 0) {\n this._hideProductsList();\n\n return;\n }\n\n for (const key in products) {\n const product = products[key];\n\n const $template = this.cloneProductTemplate(product);\n\n let customizationId = 0;\n\n if (product.customization) {\n customizationId = product.customization.customizationId;\n this._renderListedProductCustomization(product.customization, $template);\n }\n\n $template.find(createOrderMap.listedProductImageField).prop('src', product.imageLink);\n $template.find(createOrderMap.listedProductNameField).text(product.name);\n $template.find(createOrderMap.listedProductAttrField).text(product.attribute);\n $template.find(createOrderMap.listedProductReferenceField).text(product.reference);\n\n if (product.gift !== true) {\n $template.find(createOrderMap.listedProductUnitPriceInput).val(product.unitPrice);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('product-id', product.productId);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.listedProductUnitPriceInput).data('customization-id', customizationId);\n $template.find(createOrderMap.listedProductQtyInput).val(product.quantity);\n $template.find(createOrderMap.listedProductQtyInput).data('product-id', product.productId);\n $template.find(createOrderMap.listedProductQtyInput).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.listedProductQtyInput).data('customization-id', customizationId);\n $template.find(createOrderMap.listedProductQtyInput).data('prev-qty', product.quantity);\n $template.find(createOrderMap.productTotalPriceField).text(product.price);\n $template.find(createOrderMap.productRemoveBtn).data('product-id', product.productId);\n $template.find(createOrderMap.productRemoveBtn).data('attribute-id', product.attributeId);\n $template.find(createOrderMap.productRemoveBtn).data('customization-id', customizationId);\n } else {\n $template.find(createOrderMap.listedProductGiftQty).text(product.quantity);\n }\n\n this.$productsTable.find('tbody').append($template);\n }\n\n this._showTaxWarning();\n this._showProductsList();\n }", "title": "" }, { "docid": "2adc65a4c6945597b87b442cb794c908", "score": "0.5921932", "text": "function fetchProduct(id) {\n \n}", "title": "" }, { "docid": "bc271c62cfbd4a0d915240e8bb7601b7", "score": "0.5920328", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n\n //Empty array that will be used by console.table\n var displayArr = [];\n res.forEach(function (obj) {\n var product = {};\n product.ID = obj.item_id;\n product.Name = obj.product_name;\n product.Department = obj.dept_name;\n product.Price = obj.price;\n product.Quantity = obj.stock_quantity;\n displayArr.push(product);\n })\n console.log(\"\\n\");\n console.table(displayArr);\n\n whatAction();\n })\n}", "title": "" }, { "docid": "bf1b60f2607ebd9f05d73d18bb2c4b12", "score": "0.5918809", "text": "function viewInventoryForSale() {\n\t// Get all the entries from the table and pretty print the values\n\tvar query = connection.query(\"SELECT * from products\", function(error, response) {\n\t\tif (error) throw error;\n\t\t// Prints the table format for the responses\n\t\tprettyPrintAllProducts(response);\n\n\t\t// Go back to the menu\n\t\tbamazonManager();\n\t});\n}", "title": "" } ]
8ca3dec4252b1fb14ab6c309ede8fcea
Zero scores and so display "0" on scoreBox__display
[ { "docid": "3787f2be4360e33e4f10458b98bd7966", "score": "0.67718035", "text": "function zeroScores() {\n playerActualScore = 0;\n computerActualScore = 0;\n setTimeout ( () => {document.getElementById(\"score--you--0\").scrollIntoView()}, 10);\n setTimeout ( () => {document.getElementById(\"score--cpu--0\").scrollIntoView()}, 600);\n}", "title": "" } ]
[ { "docid": "c95f2876abde56f4870be424496644d7", "score": "0.80970854", "text": "function zeroOutScoreDisplay()\n{\n // Zero-out the question number\n $('.questionNumber').text(0);\n \n // Set the total number of questions\n $('.numQuestions').text(STORE.length);\n \n // Zero-out the user's score\n $('.score').text(0);\n}", "title": "" }, { "docid": "902afd876d0ba737f881e774d55b3a39", "score": "0.74867207", "text": "function resetScore() {\n gScore.curr = 0;\n renderScore(gScore.curr);\n}", "title": "" }, { "docid": "09e893121190a3e254c17b602608d3cd", "score": "0.7434758", "text": "function Update ()\n{\nNoUnderZero(); \n\nShowScore.text=Score.ToString();\n\n\n\n}", "title": "" }, { "docid": "ff2f975afdc42df46d5fb490ef76c9a3", "score": "0.7411943", "text": "function resetScore() {\n score = 0;\n // The score is updated\n showScore();\n}", "title": "" }, { "docid": "0c7d73dca3faa6eac97ae3d4f3304028", "score": "0.74003434", "text": "function displayScore() {\n scoreBox.innerText = `Score: ${score}`\n }", "title": "" }, { "docid": "ac348b4ece1fa6b5ff1331b18abe8873", "score": "0.7241401", "text": "function resetScore() {\n\n//zero out score\t\n\ttotalScore = 0;\n\n//update the score displayed on page\n\t$(\"#totalScore\").html(totalScore);\n}", "title": "" }, { "docid": "d22f369aeb03a5ba180a75f43547b47a", "score": "0.71903706", "text": "function updateUserScore() {\n scoreDisp.html(\"0\")\n}", "title": "" }, { "docid": "67e0a8fc552549c72c3ac1fbb73c0a5a", "score": "0.71812767", "text": "function startScore() {\n score = 0\n $scorePanel.text(score)\n }", "title": "" }, { "docid": "8bdd4b71e903581770ccc199d87306a2", "score": "0.716594", "text": "updateScore(score){\n\t\tconsole.log(score);\n\t\tif(score =! null)\n\t\t\tthis.score.setText(score+0);\n\t\telse{\n\t\t\tthis.score.setText(\"0\");\n\t\t}\n\t}", "title": "" }, { "docid": "8c965f4e0caa53e1f03460f3c8212830", "score": "0.71263593", "text": "function Display(){\n el.querySelector(\".counter\").innerHTML = scoreCounter.addZeros(scoreCounter.getScore(), range);\n }", "title": "" }, { "docid": "3cb0fd82aef77a4b0006e32ff6688cab", "score": "0.71102476", "text": "function totalScoreReset(){\n totalScore = 0;\n }", "title": "" }, { "docid": "2544a849875c6265234e5ab9238fac9b", "score": "0.70425624", "text": "function resetPlayerScore() {\n document.getElementById('score').innerHTML = 0;\n}", "title": "" }, { "docid": "3b0bac758513a33a05555763e3d5c28e", "score": "0.7037023", "text": "function resetScore(){\n scoreCounter = 0;\n $('.points').text(`Your current score is: ${scoreCounter}`)\n}", "title": "" }, { "docid": "89b2c1050db84cc846d7391d871e9de2", "score": "0.6989421", "text": "function reset () {\n\t\tplayerScore = 0;\n\t\t$(\"#playerScore\").text(0)\n\t\tgame ();\n\t}", "title": "" }, { "docid": "d971964e5b4968f3968a58cce55b4d5b", "score": "0.69836956", "text": "function resetStats() {\n score = 0;\n questionNumber = 0;\n $('.score').text(0);\n $('.questionNumber').text(0);\n}", "title": "" }, { "docid": "15d6011d205e69fd61fb2631d324d758", "score": "0.697707", "text": "function displayFinalScore(){\n welcomeEl.style.display = \"none\";\n questionEl.style.display = \"none\";\n scoreEl.style.display = \"block\";\n leaderBoardEl.style.display = \"none\";\n finalScore.textContent = userScore;\n\n}", "title": "" }, { "docid": "e5148f2e50056af5fe1a1161450f3399", "score": "0.6972921", "text": "function resetStats() {\n score = 0;\n questionNumber = 0;\n $(\".score\").text(0);\n $(\".questionNumber\").text(0);\n}", "title": "" }, { "docid": "41589d93b72ae473c22f95b0b84f15a8", "score": "0.69704187", "text": "function reset() {\n\tscore = 0;\n\tdocument.getElementById('result').innerHTML = score;\n}", "title": "" }, { "docid": "f46fd33cd21a2fcda5e1b5782be3e355", "score": "0.6970399", "text": "function resetStats() {\n score = 0;\n currentQuestion = 0;\n $('.score').text(0);\n $('.currentQuestion').text(0);\n }", "title": "" }, { "docid": "09f71a149452369c3bf0dedc9e304754", "score": "0.69373524", "text": "function reset() {\n currentScore = 0;\n $(\"#currentScore\").text(\"Current Score: \" + currentScore);\n bluePoints = 0;\n greenPoints = 0;\n redPoints = 0;\n orangePoints = 0;\n }", "title": "" }, { "docid": "2c1c49cde866cd1c0c91236be868949d", "score": "0.6935521", "text": "function callScore(){\n score = 0;\n $('#score').html('Score: ' + score);\n}", "title": "" }, { "docid": "9973110e08aa215afd21727aa7066ec9", "score": "0.6925534", "text": "function reset() {\n setUpGame();\n userTotal = 0;\n $(\"#displayScore\").text(userTotal);\n }", "title": "" }, { "docid": "eb44960e56a33eb4eb1e2e099046e8ef", "score": "0.68556577", "text": "function displayScores() {\n player.deck.length === 26 ? (player.score = 0, computer.score = 0) : displayRoundWin();\n document.querySelector('#player-score').textContent = player.score;\n document.querySelector('#computer-score').textContent = computer.score;\n}", "title": "" }, { "docid": "74519185fe25ee498589ce18ec9b816b", "score": "0.6855415", "text": "function Score()\n {\n $(\"#timeRemaining\").empty();\n $(\"#message\").empty();\n $(\"#gif\").empty();\n $(\"#correctedAnswer\").empty();\n $(\"#finalMessage\").text(\"Game Over\");\n $(\"#correctAnswers\").text(\"Total Correct Answers:\"+correctAnswers);\n $(\"#incorrectAnswers\").text(\"Total InCorrect Answers:\"+incorrectAnswers);\n $(\"#unanswered\").text(\"Total Unaswerd:\"+unanswered);\n $(\"#startOverBtn\").show();\n }", "title": "" }, { "docid": "a5e41fa73b6649e464bbb3fb8e4ea08a", "score": "0.68470615", "text": "function showScore(score) {\n\t\t// Clear the current results\n\t\tvar itemList = $('message');\n\t\titemList.innerHTML = 'Your score is: ' + score.demo_profile_id + ' / 5.';\n\t}", "title": "" }, { "docid": "b830b066957e202bb86aa38513e1e07b", "score": "0.681561", "text": "function clearScores() {\n playerScore = 0;\n computerScore = 0;\n}", "title": "" }, { "docid": "7e9a6c1fb741b60dee6e5691011370f6", "score": "0.6811147", "text": "function resetStats() {\n console.log('resetStats');\n score = 0;\n questionNum = 0;\n $('.score').text(0);\n $('.questionNum').text(0);\n}", "title": "" }, { "docid": "27317859bcabb188a7d45176ba6b92bd", "score": "0.67988616", "text": "function gameScore (){\n\t\t\t\tif (typeof game.score === 'undefined'){\n\t\t\t\t\tgame.score = 0;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "0fd44fe48d9cba20b7c3b0f0773145a4", "score": "0.6788396", "text": "function score(){\n\t$('#timeRemaining').empty();\n\t$('#message').empty();\n\t$('#correctedAnswer').empty();\n\t$('#gif').empty();\n\n\t$('#finalMessage').html(messages.finished);\n\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n\t$('#unanswered').html(\"Unanswered: \" + unanswered);\n\t$('#startOverBtn').addClass('reset');\n\t$('#startOverBtn').show();\n\t$('#startOverBtn').html('Start Over?');\n}", "title": "" }, { "docid": "fdb0d8c635dc39d44a9f6859490d3b39", "score": "0.6737601", "text": "function renderScore () {\n if (localStorage.getItem(\"userScore\") !== null) {\n showScore.textContent = localStorage.getItem(\"userScore\");\n } else {\n showScore.textContent = \"0\"\n }\n}", "title": "" }, { "docid": "f886a5b0c012f208f131bc997fff880e", "score": "0.6727673", "text": "function zeroGame(){\n updateTopScore();\n $scope.gameScore = {\n 'instawhacks':0,\n 'belowTwenty':0,\n 'gotTwenty':0,\n 'maxbreach':0,\n 'captionless':0\n };\n searches = [];\n }", "title": "" }, { "docid": "3556af004a7e219e012594f02ef9d382", "score": "0.67186147", "text": "function updateScoreboard () {\n scoreDisplay.innerHTML = score\n }", "title": "" }, { "docid": "230a91cebb55f4763e68ff47da35975f", "score": "0.66742015", "text": "function displayScore() {\n push();\n fill(255);\n textSize(64);\n textAlign(LEFT,BOTTOM);\n text(\"SCORE:\" + tiger.preyEaten, 0, height);\n pop();\n}", "title": "" }, { "docid": "66542a4cec9b60801b6284f3830aa8df", "score": "0.6672653", "text": "function reset(){\n yourPoints = 0;\n $(\"#myScore\").text(yourPoints);\n computerNumber = 0;\n $(\"#dragonpiccontainer\").css('visibility', 'hidden');\n \n}", "title": "" }, { "docid": "93075ffe2678fd19d58583c2694b11e5", "score": "0.6652768", "text": "function resetStats() {\n scoreCounter = 0;\n questionCounter = 0;\n $('.scoreCounter').text(0);\n $('.questionCounter').text(0);\n }", "title": "" }, { "docid": "a8184d15d4b33d805369e39b2c08400a", "score": "0.66256726", "text": "function generateScore(){\n let text = \" point\";\n text += (score > 1)? \"s\":\"\";\n\n $(defaults.scoreZone).each(function(){\n $(this).text(score + text);\n });\n }", "title": "" }, { "docid": "558da83ccd7d12df5ac8112a602ae48a", "score": "0.6599516", "text": "update_score()\n {//DVDVDVDVDVDV\n this.score_display_el.innerHTML = \"<div>SCORE: \" + this.score + \"</div> <div> TOTAL SCORE: \"\n + this.total_score + \"</div>\" + \"<div>Player Bits: \" + this.player_num_bits\n + \"</div><div>Computer Bits: \" + this.computer_num_bits + \"</div>\";\n }", "title": "" }, { "docid": "eaa043d3861bf31916771477168873c2", "score": "0.65937066", "text": "function startNewGame() {\n score = 0;\n boxes.forEach(function (square) {\n square.innerHTML = EMPTY;\n });\n}", "title": "" }, { "docid": "bb4df0af87b98236a8b89ef0a9bf6d92", "score": "0.6591817", "text": "function scoreReset(){\n xWinner = xWinner = 0;\n document.getElementById(\"xWinner\").innerHTML = \"X Score: \" + xWinner;\n\n oWinner = oWinner = 0;\n document.getElementById(\"oWinner\").innerHTML = \"O Score: \" + oWinner;\n}", "title": "" }, { "docid": "d39ed8b34d6a12fa75d1d9272539cfd3", "score": "0.6586456", "text": "function reset () {\n score = 0;\n $(\"#score\").html(score);\n randomGenerator();\n}", "title": "" }, { "docid": "53ae9c2fe1544547a118263639a1e762", "score": "0.6557792", "text": "function displayScore() {\n console.log(\"Entering displayScore function\");\n $(\".score-info\").show();\n $(\".score\").html(score);\n $(\".question-counter\").html(questionCounter + 1);\n $(\".number-of-questions\").html(STORE.length);\n}", "title": "" }, { "docid": "c65e59946694c829c0a9f9d2065ae5e6", "score": "0.65539104", "text": "function init(){\n score0.textContent = 0;\n score1.textContent = 0;\n dice.classList.add('hidden');\n\n scores = [0,0];\n currentScore = 0;\n activePlayer = 0;\n playing = true;\n\n player0.classList.remove('player--winner')\n player0.classList.add('player--active')\n player1.classList.remove('player--winner')\n player1.classList.remove('player--active')\n current0.textContent = 0\n current1.textContent = 0\n}", "title": "" }, { "docid": "f83829d395a09ebf527f8744597ad18a", "score": "0.65492654", "text": "displayScore(){\n this.ctx.font = '18px sans-serif';\n this.ctx.fillStyle = 'black';\n this.ctx.fillText(\"Score: \" + this.score, 8, 20);\n }", "title": "" }, { "docid": "a1e7048d09f270f40249b23d84802db0", "score": "0.6538981", "text": "function showScore(){\n quizBody.style.display = \"none\";\n gameOverDiv.styl.display = \"flex\";\n clearInterval(timeInterval);\n highScoreInputName.value = \"\";\n finalScoreEl.innerHTML = (\"You have + score + correct answer\" + quizQuestionLength\");\n }", "title": "" }, { "docid": "12c664e226e83264756fc67ea4116b31", "score": "0.6538761", "text": "function playfieldRefreshScore() {\n\tdisplayNumber(this.leftScore, this.leftBar.score);\n\tdisplayNumber(this.rightScore, this.rightBar.score);\n}", "title": "" }, { "docid": "0f975868c348402e94ef62076aba87a3", "score": "0.6538708", "text": "function setScoreboard() {\n\n document.querySelector(\"#correct\").textContent = \"Correct: \" + results.correct;\n document.querySelector(\"#wrong\").textContent = \"Wrong: \" + results.wrong;\n\n if (results.initials.length > 0) {\n document.querySelector(\"#high-score\").textContent = \"High Score: \" + results.highScore + \" : \" + results.initials;\n } else {\n document.querySelector(\"#high-score\").textContent = \"High Score: \";\n }\n \n}", "title": "" }, { "docid": "25ddcad667d3af1d34e0365c40f3d409", "score": "0.6534862", "text": "function showScore() {\n scoreContainer.classList.remove('hide');\n console.log('Un-hiding score');\n playerScore.innerText = score;\n totalScore.innerText = possibleScore;\n}", "title": "" }, { "docid": "d76f6beb2a2ae70cfb6b5c7ee5abb261", "score": "0.65164614", "text": "drawFinalScore(){\n myGame.ctx.font = settings.FINAL_SCORE_FONT;\n myGame.ctx.fillText(settings.SCORE_CORRECT_TEXT + this.correctCounter, 200 , 50);\n myGame.ctx.fillText(settings.SCORE_INCORRECT_TEXT + this.incorrectCounter, 200, 100);\n }", "title": "" }, { "docid": "39cafea31377adef2a8b4dea3a29a8c5", "score": "0.6503589", "text": "function initialValues(){\n\tp1Score = 0;\n\tp2Score = 0;\n\tp1Display.textContent = p1Score;\n\tp2Display.textContent = p2Score;\n\twinningScore = 5;\n\tgameOver = false;\n\twinningScoreDisplay.textContent = winningScore;\n\tp1Display.classList.remove(\"winner\");\n\tp2Display.classList.remove(\"winner\");\n}", "title": "" }, { "docid": "ee71582cb211c0c60028eb9f326fe33b", "score": "0.64892775", "text": "function updateScore() {\n\tif (players[0]) {\n\t\tctx.fillStlye = foregroundColor;\n\t\tctx.font = '16px' + defaultFont;\n\t\tctx.textAlign = \"left\";\n\t\tctx.textBaseline = \"top\";\n\t\tctx.fillText(\"Score: \" + players[0].points, 20, 20);\n\t}\n}", "title": "" }, { "docid": "385f3ad6e5fac932d0b942e5da7957e8", "score": "0.64891696", "text": "function resetScores() {\n let playerScore = document.querySelector('#playerScoreDisplay');\n let computerScore = document.querySelector('#computerScoreDisplay');\n let number = 0;\n playerScore.innerHTML = number;\n computerScore.innerHTML = number;\n}", "title": "" }, { "docid": "486dade75ee31ec104053355d5b2d450", "score": "0.6486043", "text": "function reset() {\n p1Score = 0;\n p2Score = 0;\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n gameOver = false;\n}", "title": "" }, { "docid": "2a08d2b8cf7080dd281e757ac1bb2e6e", "score": "0.64832604", "text": "function wrongScore() {\n $('.currentScore').text(score);\n}", "title": "" }, { "docid": "6ad1e3d8defdb104975d28d5a8675806", "score": "0.64750016", "text": "function displayScore() {\n $(\"#playAgain\").hide();\n $(\"#gameOver\").hide();\n $(\"#resetScore\").hide();\n\n if (isGameOver()) {\n $(\"#playAgain\").show();\n $(\"#gameOver\").show();\n $(\"#resetScore\").show();\n\n if (isBestScore()) {\n changeBestScore();\n }\n\n } else {\n $(\"#bestScore\").text(bestScore);\n $(\"#score\").text(score);\n $(\"#name\").text(name);\n }\n}", "title": "" }, { "docid": "933ac16d6dcd95425b57f4febd2ed951", "score": "0.64707386", "text": "function updateScore () {\n changeScore ();\n $('.score').text(score);\n }", "title": "" }, { "docid": "04af91815ed5c0a6e4158ebe45a51ee6", "score": "0.6456192", "text": "function checkScore() {\n if (bestScore > score || bestScore === 0) {\n bestScore = score.toString();\n bestScoreHTML.textContent = `${bestScore}`;\n hiddenScoreText.textContent = `best score: ${bestScore}`;\n }\n}", "title": "" }, { "docid": "5e20ad59dafe726c951e66f22b466fe0", "score": "0.6451527", "text": "function clearScore() \r\n{\r\n playerWins.innerHTML = 0;\r\n playerLosses.innerHTML = 0;\r\n clearDeck();\r\n pLoss = 0;\r\n pWins = 0;\r\n playerAceCount = 0;\r\n dealerAceCount = 0;\r\n gameState = 1;\r\n}", "title": "" }, { "docid": "039f5f8e894bda9fa61ffb89dfaaac9f", "score": "0.64502203", "text": "function scoreVis(){\n qcontainerEl.style.display=\"none\";\n gameEnd.style.display=\"flex\";\n delInterval(time);\n document.getElementById(\"initials\").value = \"\";\n document.getElementById(\"finalScore\").innerHTML = \n \"You got \" + score + \" out of \" + questions.length + \" CORRECT!\";\n}", "title": "" }, { "docid": "9011335bec880be56889cc4bcce60165", "score": "0.64496696", "text": "function getScore(){\n var timeTotal = timeLeft - timeElapsed;\n scoreTotal = points + timeLeft - timeElapsed;\n scoreEl.textContent = \"Total Score: \" + scoreTotal;\n timeEl.style.display = \"none\";\n scoreBtn.style.display = \"block\";\n}", "title": "" }, { "docid": "1c47da25d117d0bf5e19182727c62486", "score": "0.6446353", "text": "displayOScore(currentOScore) {\n document.getElementById(\"o-score\").textContent = currentOScore\n }", "title": "" }, { "docid": "7a6be5efe80e7e6d06e3eb26c4883cb8", "score": "0.6445889", "text": "function scoreboard(){\n\t$('#remainingTime').empty();\n\t$('#message').empty();\n\t$('#correctedAnswer').empty();\n\t$('#gif').empty();\n\n\t$('#finalMessage').html(messages.finished);\n\t$('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n\t$('#incorrectAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n\t$('#unanswered').html(\"Unanswered: \" + unanswered);\n\t$('#startOverBtn').addClass('reset');\n\t$('#startOverBtn').show();\n\t$('#startOverBtn').html('Start Over?');\n}", "title": "" }, { "docid": "5bd51335a1d27074cb9f2a41395fc4f9", "score": "0.6445634", "text": "function initialize() {\n var scores = [0, 0];//score[0]=> player1 score , score[1]=>player2 score\n var currentScore = 0;\n var activeplayer = 0;\n GameIsActive = true;\n document.getElementById('diceGame').style.display = 'none';//hide the img\n document.getElementById('score-0').innerText = '0';\n document.getElementById('score-1').innerText = '0';\n document.getElementById('current-0').innerText = '0';\n document.getElementById('current-1').innerText = '0';\n\n\n\n}", "title": "" }, { "docid": "400fc3d2a1587c6c908d47d6e02d1602", "score": "0.644436", "text": "function finalScore(){\n\n\t\t// none so that users will not accidentally 'answer', would add to their tally\n\t\tdocument.getElementById(\"answers\").style.display = \"none\";\n\n\t\t// display score\n\t\tscore = \"<p class='finalScore'>Here's how you did!<br>Correct Answers: \" + answersRight \n\t\t+ \"<br>Incorrect Answers: \" + answersWrong + \"<br>Unanswered: \" + unanswered + \"</p>\";\n\t\t$(\"#startStop\").html(score);\n\t\t$(\".color\").removeAttr('style');\n\t\t$(\"#timer\").html(\"\");\n\t\t$(\"#question\").empty();\n\n\t\t// create reset button\n\t\tresetButton = \"<p class='resetClickEvent'><a href='#'>Reset Quiz</a></p>\";\n\t\t$(\"#startStop\").append(resetButton);\n\t}", "title": "" }, { "docid": "e5fa77e9b714b85c398fd92ec41cf3a9", "score": "0.64406776", "text": "function displayScore () {\n //setup font\n textAlign(LEFT,TOP);\n textSize(25);\n fill(255);\n noStroke();\n //display text\n text(\"Eaten jellyfish: \"+ preyEaten,35,20);\n}", "title": "" }, { "docid": "39214d7cacdd1069bc1875a3caee1205", "score": "0.64382094", "text": "function renderScore() {\n\n scoreEl.textContent = quizScore.get();\n\n}", "title": "" }, { "docid": "307384e42c828eab5f7967d1ce82fa2b", "score": "0.6433852", "text": "function score() {\n fill(255);\n textSize(30);\n textAlign(CENTER);\n text(\"Score: \" + asteroids.score, width / 2, height - 20);\n}", "title": "" }, { "docid": "a79165e886f5799ce7a3afc6978749c4", "score": "0.6427349", "text": "onHighScoreReset() {\n ScoreManager.resetHighScore(0);\n this.ui.highScorePanel.setScore(0);\n }", "title": "" }, { "docid": "837c3abbfbd2cab56b610064a48609fd", "score": "0.6426414", "text": "function updateScore(){\n document.getElementById(\"score\").textContent = \"Score: \" + game.score;\n }", "title": "" }, { "docid": "7f5e17b69eddd0ee2d62090de5013588", "score": "0.6411669", "text": "function updateScore() {\n this.text = \"Score: \" + score;\n}", "title": "" }, { "docid": "528966a83f282d0f81a955e9f7c9f7bd", "score": "0.6405245", "text": "function reset() {\n params.userScore = 0;\n params.computerScore = 0;\n params.progress = [];\n params.roundNumber = 1;\n params.userScore_span.innerHTML = params.userScore;\n params.computerScore_span.innerHTML = params.computerScore;\n params.result_p.innerHTML = ('Lets start the game!');\n params.gameScore.innerHTML = ('');\n clearTable();\n}", "title": "" }, { "docid": "2ef5e95981a891c3cefed150e2069c64", "score": "0.6396543", "text": "function resetScores(){\n p1Button.classList.add(\"unclickable\");\n p2Button.classList.add(\"unclickable\");\n p1Score = 0;\n p2Score = 0;\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n gameOver = true;\n numInput.value = \"\";\n}", "title": "" }, { "docid": "3a736af243c2f35b23040f144e5e325f", "score": "0.6387749", "text": "function updateScoreDisplay(score) {\n //converts score to string and prepend 0 if the score is in single digit\n var scoreString = (score.toString().length > 1) ? score.toString() : '0' + score.toString();\n\n //spilts the score string to store the digits in a array\n var scoreArr = scoreString.split('');\n\n //gets the score wrapper div and empties it\n var scoreDiv = document.getElementById('score-wrapper');\n scoreDiv.innerHTML = '';\n\n //iterates through the array of the digits of the score and displays each digit\n for (var i = 0; i < scoreArr.length; i++) {\n var spanClass = 'digit-' + scoreArr[i];\n var spanDiv = createElement('span', scoreArr[i], '', spanClass);\n scoreDiv.appendChild(spanDiv);\n }\n}", "title": "" }, { "docid": "8866084a2f1c0f6d8661031ed2e67cab", "score": "0.6387339", "text": "function showScoreUI()\r\n\t{\r\n\t\ttimeElement.text = timeInSeconds + \" seconds left\";\r\n\t\ttimeElement.update();\r\n\t\tscoreElement.text = score + \" worm smears\";\r\n\t\tscoreElement.update();\r\n\r\n\t\trenderMsg(messages);\r\n\t}", "title": "" }, { "docid": "044db5c3dbdf4a4d18f7cb82ed78d7ac", "score": "0.6384322", "text": "function drawScore() {\n\t\tctx.font = \"18px Arial\";\n\t\tctx.fillStyle = \"black\";\n\t\tctx.fillText(\"Score: \"+score, 8, 20);\n\t}", "title": "" }, { "docid": "a32987831df7361c89fb56c3b5868280", "score": "0.6382763", "text": "function renderScore() {\n if (hiScore !== null) {\n if (scoreBoard > hiScore) {\n localStorage.setItem('hiScore', scoreBoard);\n }\n }\n hiScore = +localStorage.getItem('hiScore');\n $('.scoreBoard').text('HiScore:' + hiScore + \" Score:\" + scoreBoard);\n }", "title": "" }, { "docid": "0d962b96ebf2075ca5231322ad9d338b", "score": "0.6374108", "text": "function displayScore() {\n if (currentPlayer == playerX) {\n scoreX++;\n } else {\n scoreO++;\n }\n scoreboardO.innerText = `${scoreO}`;\n scoreboardX.innerText = `${scoreX}`;\n}", "title": "" }, { "docid": "090002c015b3acc25597a5c8b55a8014", "score": "0.6364703", "text": "function reset(){\n p1Score = 0;\n p2Score = 0;\n p1Display.textContent = p1Score;\n p2Display.textContent = p2Score;\n p1Display.classList.remove(\"winner\")\n p2Display.classList.remove(\"winner\")\n gameOver = false;\n}", "title": "" }, { "docid": "fbd209662a14f69fa799c8488b3c1042", "score": "0.6363302", "text": "function scoreKeeper() {\n $(\"#score\").text(score);\n}", "title": "" }, { "docid": "2623834bd4696d5bc600072b636cc8bd", "score": "0.6361757", "text": "function scoreManagement () {\n\tscoringTd[playerRound].textContent = point;\n\tif (playerRound%2 == 0) {\n\t\ttotal1Score += point;\n\t\ttotal1Span.textContent = total1Score;\n\t} else if (playerRound%2 == 1) {\n\t\ttotal2Score += point;\n\t\ttotal2Span.textContent = total2Score;\n\t}\n}", "title": "" }, { "docid": "4080cacdf45ea8492ce55a74a5fe03e7", "score": "0.6358354", "text": "function reset(){\n animeScore(scoreSpans);\n setTimeout(() => {\n scoreSpans[0].textContent = '0';\n scoreSpans[1].textContent = '0';\n }, 300);\n clearTimeout();\n boardClear();\n}", "title": "" }, { "docid": "51d8a7f0b187aaf5b8e526ad1888500d", "score": "0.6355841", "text": "function resetGame() {\n userScore = 0;\n $(\"#total-score\").text(userScore);\n redValue = Math.floor(Math.random() * (20 - 1 + 1) + 1);\n greenValue = Math.floor(Math.random() * (20 - 1 + 1) + 1);\n blueValue = Math.floor(Math.random() * (20 - 1 + 1) + 1);\n yellowValue = Math.floor(Math.random() * (20 - 1 + 1) + 1);\n randomize();\n\n //clear display\n}", "title": "" }, { "docid": "63f9527b15354adcd4f44d5b42124a77", "score": "0.63536924", "text": "function showScore(){\n return score\n}", "title": "" }, { "docid": "9e6c69aefc363606351fb7d50161154a", "score": "0.63464963", "text": "function reset(){\n \t \t//every declared and manipulated variable set back to 0.\n \t \tp1Score = 0;\n \tp2Score = 0;\n \tp1Display.textContent = 0;\n \tp2Display.textContent = 0;\n \tgameOver = false;\n \t//removing the css class back to normal.\n \tp1Display.classList.remove(\"winner\");\n \tp2Display.classList.remove(\"winner\");\n \toverDisplay.classList.remove(\"winner\");\n \toverDisplay.textContent = \"Playing to: \" + Number(numInput.value);\n \t }", "title": "" }, { "docid": "e34c65f0edc87b34681a3821d38231b9", "score": "0.63419294", "text": "function reset(){\n\tp1Score = 0;\n\tp2Score = 0;\n\tp1Display.textContent = 0;\n\tp2Display.textContent = 0;\n\tp1Display.classList.remove(\"winner\");\n\tp2Display.classList.remove(\"winner\");\n\tgameOver = false;\n}", "title": "" }, { "docid": "cd2972c2d30a731b133c172e6524df48", "score": "0.63418776", "text": "function resetScore(e) {\n e.preventDefault()\n correctTally = 0\n incorrectTally = 0\n correctScore.innerHTML = 0;\n incorrectScore.innerHTML = 0;\n}", "title": "" }, { "docid": "06deccf04b29e1e3a273dc0a5a457442", "score": "0.63397187", "text": "function score() {\n\t$('.main').html('GAME OVER! You answered ' + scoreNum + ' out of 5 questions correctly!!');\n\tstop();\n\tresetButton();\n}", "title": "" }, { "docid": "08be8cc9f5bc5c399041fe805a9e1d39", "score": "0.6338414", "text": "function updateScore(){\n blueScore=0;\n redScore=0;\n for(var i = 0;i<8;i++){\n for(var j = 0;j<8;j++){\n if(grid[i][j]==1){\n blueScore++;\n }\n if(grid[i][j]==2){\n redScore++;\n }\n }\n }\n setText(\"blueScoreBox\",\"\"+blueScore);\n setText(\"redScoreBox\",\"\"+redScore);\n}", "title": "" }, { "docid": "51a3a539bd4c3b4c2c9b9ff0cb116a15", "score": "0.6338297", "text": "function updateScore(score){\n scoreCount.innerHTML=\"Score:\"+score;\n}", "title": "" }, { "docid": "7819ee44d9f670060020cb02021f7ae4", "score": "0.63376534", "text": "function display_zero() {\r\n document.getElementById(\"calc_result\").textContent = \"0\";\r\n}", "title": "" }, { "docid": "8d7883f3bddafc7ef9ade9dbea6d1ac4", "score": "0.6337563", "text": "function startgame() {\n Score[\"correct\"] = 0;\n Score[\"incorrect\"] = 0;\n Score[\"unanswered\"] = 0;\n counter = 0;\n displayQandA();\n}", "title": "" }, { "docid": "695c51d7bb7e541318c163fb1f07a554", "score": "0.6331319", "text": "function stopScore(){\n if(score<0){\n score = 0;\n }\n}", "title": "" }, { "docid": "ddd3b53381100dfd4d22a40927ae42f0", "score": "0.6330252", "text": "function displayScore(scoreAdjust) {\n\tif(score + scoreAdjust <= 0){\n\t\tscore = 0;\n\t}\n\telse\n\t{\n\t\tscore += scoreAdjust;\n\t}\n\tstatusMessageText.innerText = \"Score: \" + score;\n}", "title": "" }, { "docid": "27933f877ba9f15e2daac0e521b3507a", "score": "0.6328287", "text": "function renderScore(num) {\n moves.innerText = num + ' ';\n\t}", "title": "" }, { "docid": "19da1c4bd6c76ce5ff18e13e1d5dd18c", "score": "0.63242275", "text": "function reset() {\r\n\tdisplay.textContent = '0';\r\n}", "title": "" }, { "docid": "811dcd3174668e032fb30d414b5f51e7", "score": "0.6324059", "text": "function displayScore(){\n document.getElementById('score').innerHTML = score;\n document.getElementById('life').innerHTML = life;\n }", "title": "" }, { "docid": "acc9e7e43d9816089be0a5dc42632698", "score": "0.6322512", "text": "function score(a) {\n\t\tdocument.querySelector(\".score\").style.display = 'block';\n\t\tgravity = false;\n\t\tdocument.querySelector(\"#message\").innerHTML = a;\n\t}", "title": "" }, { "docid": "778e77b4d45cc1da9e4e4ca5aa826aac", "score": "0.6316453", "text": "function displayScore(score) {\r\n const scoreboard = document.getElementById(\"score\")\r\n scoreboard.innerHTML = `${score}`\r\n}", "title": "" }, { "docid": "54abd81c8c79e264728b18746f33db25", "score": "0.631266", "text": "function scoreboard() {\n $(\"#timeLeftCounter\").empty();\n $(\"#message\").empty();\n $(\"#correctedAnswer\").empty();\n $(\"#picture\").empty();\n\n $(\"#finalMessage\").html(messages.finished);\n $(\"#correctAnswers\").html(\"Correct Dog Breeds: \" + correctAnswer);\n $(\"#incorrectAnswers\").html(\"Incorrect Dog Breeds: \" + incorrectAnswer);\n $(\"#unanswered\").html(\"Why didn't you answer? countS: \" + unanswered);\n $(\"#startOverBtn\").addClass(\"reset\");\n $(\"#startOverBtn\").show();\n $(\"#startOverBtn\").html(\"Start Over?\");\n}", "title": "" }, { "docid": "7abdc3cefd301eed8c3d479ee046bc28", "score": "0.63092655", "text": "function resetScoreBoard() {\n $(\"#targetDivaScore\").html(\"Target Diva Score\");\n $(\"#yourDivaScore\").html(\"Your Diva Score\");\n $(\"#theDivas\").html(\"~ T h e D i v a s ~ \");\n }", "title": "" }, { "docid": "874ee68aac4bfc7ae28b0a7183d724ea", "score": "0.63044375", "text": "function scoreRender(){\n scoreDiv.style.display = \"block\";\n \n // calculate the amount of question percent answered by the user\n var scorePerCent = Math.round(100 * score/questions.length);\n scoreDiv.innerHTML += (\"<p class='end'>You Scored a : \" + scorePerCent +\"%</p>\")\n if(scorePerCent <= 100) {\n return quiz.style.display =\"none\";\n \n };\n if(quiz.style.display =\"none\") {\n \n return scoreDiv.style.display = \"block\";\n \n \n }\n \n\n }", "title": "" } ]
ae8af0d03d5b479b814b41009e329cd1
() => console.log(this.state.content, event.target.textLength, this.props.maxChars) () => console.log(140 event.target.textLength)
[ { "docid": "9a78370fcdf1543d18e3a69fc88770b2", "score": "0.67550486", "text": "render() {\n return (\n <div>\n <strong>Your message:</strong>\n <form onSubmit={event => this.handleSubmit(event)}>\n <input type=\"text\" value={this.state.content} onChange={this.handleContent} />\n <p> {this.props.maxChars - this.state.content.length} characters remaining </p>\n </form>\n </div>\n );\n }", "title": "" } ]
[ { "docid": "ddf40c583ff734085737398875230d2b", "score": "0.6975309", "text": "handleMessageChange(event){\n this.setState({\n message: event.target.value,\n messageCount: 500 - event.target.value.length\n });\n }", "title": "" }, { "docid": "8ef7eba3bcbf6871d91587ccf92e8a14", "score": "0.69380885", "text": "handleDescription(description) {\n this.setState({ description });\n let descriptionError = maxChars(description, 250)\n this.setState({ descriptionError })\n }", "title": "" }, { "docid": "e1849cc04fad1cc1b0448df52db45075", "score": "0.6910967", "text": "wordCount(event) {\n this.prepareTextBody();\n this.setState({ wordCount: this.state.textBody.length });\n this.forceUpdate();\n }", "title": "" }, { "docid": "1220f3407417153cc9e2ba82c01df537", "score": "0.6827888", "text": "handleChange(event) {\n var input = event.target.value;\n this.setState({ chars_left: 800 - input.length, experience: input });\n }", "title": "" }, { "docid": "a3020f63101a38662607c89c75d809fe", "score": "0.6503562", "text": "function updateCharCount(target) {\n var length = target.value.length;\n displayMessage(length + \" characters\");\n}", "title": "" }, { "docid": "3e785412bbf3a831415fb753725aa9c9", "score": "0.6454872", "text": "handleChange(event) {\n if (event.target.name !== 'message' && event.target.value.length <= 255) {\n this.setState({ [event.target.name]: event.target.value });\n } else if (event.target.name === 'message' && event.target.value.length <= 500) {\n this.setState({ [event.target.name]: event.target.value });\n }\n }", "title": "" }, { "docid": "47ac83a2c9d1e7d48fa2aed0a6f3b8c7", "score": "0.64520645", "text": "handleTitle(title) {\n this.setState({ title });\n let titleError = maxChars(title, 120)\n this.setState({ titleError })\n }", "title": "" }, { "docid": "27b7951dc03d2cf96a4368843a8ad139", "score": "0.6416789", "text": "handleInputChange(event) {\n event.preventDefault();\n let key = event.target.name;\n let value = event.target.value;\n if (key === \"title\") {\n if (value.length > 150) {\n alert(\"This title is too long\");\n }\n }\n this.setState({\n [key]: value\n });\n }", "title": "" }, { "docid": "53bb535b164bacf455601ef831dee6f2", "score": "0.63973933", "text": "getTextLength() {\n return this.getText().length;\n }", "title": "" }, { "docid": "df93751379aa1b4a537224ccef1484b3", "score": "0.6225896", "text": "handleUsernameChange(event){\n this.setState({ \n userCount: 35 - event.target.value.length\n });\n }", "title": "" }, { "docid": "893706898b8a13ef42ff4f69ed5ea885", "score": "0.6174026", "text": "handleTextChange(e) {\n const text = e.target.value;\n if (text.length <= 1) {\n this.setState({ text: e.target.value });\n }\n }", "title": "" }, { "docid": "3d74c6b2778359ee04ed5814da4c8668", "score": "0.60953087", "text": "function inputLength() { // creates a function for the input length to be used in the event listener function\n return input.value.length;\n}", "title": "" }, { "docid": "fed2d52f7cb353713d03ea43a8576178", "score": "0.6088905", "text": "componentDidUpdate() {\n const length = this.state.input.length;\n\n if (length > 11 && length <= 15) {\n document.querySelector('.display').style.fontSize = '16px';\n } else if (this.state.input.length > 15) {\n document.querySelector('.display').style.fontSize = '14px';\n } else {\n document.querySelector('.display').style.fontSize = '20px';\n }\n\n }", "title": "" }, { "docid": "bd181a7de5a5ce6cc136399b881add5d", "score": "0.59890765", "text": "get length() {\n // Assume that every newline is a keystroke, and that whitespace is stripped.\n const lines = this.code.split('\\n');\n const total_characters = lines.map(line => line.trim().length).reduce((a, b) => a + b);\n return total_characters + lines.length - 1;\n }", "title": "" }, { "docid": "296de027b8a082bffdb370b8b38989d3", "score": "0.5979217", "text": "static get MAX_LENGTH() { return 5; }", "title": "" }, { "docid": "114273d7956cec32c04e1aa543c216de", "score": "0.5970308", "text": "function clickEventChar() {\n var charValue = textValue().trim();\n var charLength = charValue.length;\n //return length of string for chars\n return charLength;\n}", "title": "" }, { "docid": "e7438baf2401006d250de5e4168a419b", "score": "0.59651434", "text": "function numberofCharacters(input) {\n const num = input.length\n console.log( input + \" \" + \"has\" + \" \" + num + \" \" + \"characters\");\n}", "title": "" }, { "docid": "790d7e8bdfe6985c2c9c3705a3f7746e", "score": "0.59547", "text": "render() {\n\n\t{/*use the state - will use the initial state of the length and value the first time*/ }\n\t\tlet { value } = this.state;\n\t\tlet { length } = this.props;\n\n\t\t{/*a ternary operation: if the input length is less than the length prop (defined in App) than show the message too short*/}\n\t\treturn (\n\t\t\t<div className=\"form-group\">\n\t\t\t\t<input \n\t\t\t\t\tclassName=\"form-control\"\n\t\t\t\t\tonChange={this.handleChange}\n\t\t\t\t\tvalue ={value}\n\t\t\t\t/>\n\t\t\t\t{ value.length < length ? <p className=\"text-danger\">Too short!</p> : <p className=\"text-success\">Okay</p> }\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "dafa362e02b7ea1c64098df80acb47fa", "score": "0.59546524", "text": "constructor(props) {\n super(props);\n\n this.state = {\n text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem Loremlorem Lorem '\n };\n }", "title": "" }, { "docid": "ed67fd764e3a5c45de7cb05d1d68f49d", "score": "0.5891935", "text": "function getLength() {\n return input.value.length;\n}", "title": "" }, { "docid": "1699bbb9d0555ef569eb10cc379662ed", "score": "0.58889014", "text": "get remainingCharCount() {\n\t\treturn (this.state.sourceEnd - this.state.sourcePosition);\n\t}", "title": "" }, { "docid": "fc40201cace55c6d96b8940984e88fe6", "score": "0.58864695", "text": "function charCount(charCount) {\n // let length = charCount.length;\n // console.log(length);\n console.log(\"charCount is \" + charCount.length);\n}", "title": "" }, { "docid": "ccedb88275edfaf1e08859689f581175", "score": "0.5868531", "text": "function charCount() {\n\n\tif (this.about_me.value.length <= 140) {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p>' + this.about_me.value.length + '</p>';\n\t} else {\n\t\tvar x = document.getElementById(\"characters\");\n\t\tx.innerHTML = '<p style=\"color:red;\">' + (140 - this.about_me.value.length) + '</p>';\n\t}\n\n\n}", "title": "" }, { "docid": "ea8dbeefa757fe0a1e8b2eea53720ca6", "score": "0.58527726", "text": "function lengthInput()\r\n{\r\n return inputLength;\r\n}", "title": "" }, { "docid": "af9b8246d13fb381781bd1f44686f4b6", "score": "0.58373064", "text": "onCharSizeChanged() {\n this._renderer.onCharSizeChanged();\n }", "title": "" }, { "docid": "b95a8b64bd5ec28bcb3ed12faa069195", "score": "0.5836053", "text": "handleOutputTextSize() {\n\n if(this.state.output.length > this.RESIZE_OUTPUT_LENGTH) {\n if(Object.keys(this.state.outputStyle).length < 1) {\n this.setState({\n outputStyle: this.OUTPUT_SMALL_TEXT_STYLE\n });\n }\n }\n\n else {\n if(Object.keys(this.state.outputStyle).length > 0) {\n this.setState({\n outputStyle: {}\n });\n }\n }\n\n }", "title": "" }, { "docid": "795752db15ba21ec88d1b0e2cced3ada", "score": "0.5834155", "text": "handleContentChange(event) {\n this.setState({\n content: event.target.value,\n });\n }", "title": "" }, { "docid": "71c492692d3b31da2636f6376706d110", "score": "0.58276725", "text": "function countCharMsg(val){\n\t\tvar len = val.value.length;\n\t\tif (len >= 300) {\n\t\t\tval.value = val.value.substring(0, 300);\n\t\t}else {\n\t\t\t$('#left_chars').text(300 - len);\n\t\t}\n\t}", "title": "" }, { "docid": "4debbed6d0d5b1d729e8e4a1307828a7", "score": "0.5827218", "text": "onTextContent(event) {\n this.setState({\n text: event.target.value\n });\n }", "title": "" }, { "docid": "0c3952521048432be0e1cd338fbd536e", "score": "0.58140683", "text": "updateSearch(e){\n this.setState( { \n search: e.target.value.substr(0, 50)\n } )\n }", "title": "" }, { "docid": "0c15c6bbf2e6938642f6273bcd2df95b", "score": "0.5807647", "text": "componentWillMount() {\r\n this.handleLongText(this.props.children);\r\n }", "title": "" }, { "docid": "bd8242d9fdce1b0689595cf0b2e8c591", "score": "0.5806745", "text": "handleChange(event) {\r\n this.setState({\r\n content: event.target.value\r\n });\r\n }", "title": "" }, { "docid": "204cbb31f5069c5e6431db4b92c03409", "score": "0.58038163", "text": "handleChange(event) {\n this.setState({\n content: event.target.value,\n });\n }", "title": "" }, { "docid": "5aaff9fbb5c9f4d74e99ec6ffd9ae666", "score": "0.5799348", "text": "onChangeMessage(event) {\n this.setState({\n content: event.target.value\n });\n }", "title": "" }, { "docid": "93177abb2ebb95b9837e093c604333d7", "score": "0.579729", "text": "handleBottomTextChange(event) {\n const { value } = event.target;\n this.setState({ bottomText: value });\n }", "title": "" }, { "docid": "86b6d3d25a3bee0b74336eb7e066a70b", "score": "0.57837516", "text": "handleChangeTextArea(event) {\n this.setState({content: event.target.value});\n }", "title": "" }, { "docid": "0f193459fd8baec5eb1030c8fcf97c25", "score": "0.57767606", "text": "handleInput(e){\n //this allows the input to display the data \n console.log(e.target.value); \n this.setState({\n content: e.target.value\n })\n }", "title": "" }, { "docid": "af042d2996e258ee9006459e37414d53", "score": "0.57745004", "text": "function inputLength(){\n \t return input.value.length;\n }", "title": "" }, { "docid": "1b4d3b54be11fd8da03812c6544ba4a4", "score": "0.5773015", "text": "function CharTextarea(){\n\t\t\tvar maxChar = 350;\n\t\t\tvar textAreaDesc = $('.description_textarea');\n\t\t\tvar lengthLeft = $('.length-left');\n\n\t\t\tlengthLeft.html( textAreaDesc.val().length );\n\t\t\t\n\t\t\ttextAreaDesc.on('keyup', function(){\n\t\t\t\tif( $(this).val().length > maxChar ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlengthLeft.html( $(this).val().length );\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "9f2da02a69ea71259ed4d0ba6ba4ff7d", "score": "0.57625914", "text": "handleUpperLimit(event) {\n this.setState({upperLimit: event.target.value});\n console.log(this.state);\n }", "title": "" }, { "docid": "7ec3961682ceeda72b60ab7aa4f4898a", "score": "0.57584953", "text": "function counttext()\n{\n consoletext.innerHTML=textarea.textLength;\n}", "title": "" }, { "docid": "9492bf2f3e242bd0405ef3a31e7a1bb9", "score": "0.5749842", "text": "onChangePassword(event) {\n if (event.target.value.length > 7) {\n this.setState({\n helperTextpassword: \"\",\n error: false,\n password: event.target.value,\n });\n } else {\n this.setState({\n helperTextpassword: \"Password should be 7 letters\",\n error: true,\n password: event.target.value,\n });\n }\n }", "title": "" }, { "docid": "b6d3a9ea4663f3803a3eaaca3619ad6d", "score": "0.574518", "text": "componentWillReceiveProps(nextProps) {\n if (nextProps.p.length > 400) {\n let i = 400;\n while (nextProps.p[i] !== ' ') {\n i -= 1;\n }\n this.setState({ short: `${nextProps.p.slice(0, i)} . . . ` });\n }\n }", "title": "" }, { "docid": "d6cf066a0e9c8c0b8ef7ba55d7ce3cb7", "score": "0.57403", "text": "handleChange(event) {\n const text = event.target.value;\n\n this.setState({\n previewText: text,\n editorText: text\n });\n }", "title": "" }, { "docid": "b82250ef2d4591a8c48c4986c966d01c", "score": "0.574012", "text": "calWidth () {\n let len = 0\n this.queue.forEach(message => {\n len += message.content.length * config.default_font_size\n })\n return len\n }", "title": "" }, { "docid": "31ef0530b9bf14b917ffebf79184a5b6", "score": "0.57284164", "text": "handleContentChange(e) {\n this.setState({content: e.target.value});\n }", "title": "" }, { "docid": "8a5b726f7968514dd74c5a5e6026d320", "score": "0.57262427", "text": "function TextLengthEdit(_text) {\n if (_text.length >= 52) {\n return _text.slice(0, 49) + \"...\";\n } else {\n return _text;\n }\n}", "title": "" }, { "docid": "12c6c141c4bb02426bb38abbf5aef07a", "score": "0.5722374", "text": "render() {\n const input = <input type=\"text\" className=\"input\" placeholder={this.props.placeholder} onChange={this.handleChange} />\n const textarea = <textarea className=\"textarea\" placeholder={this.props.placeholder} onChange={this.handleChange}></textarea>\n const max = (this.props.max)\n ? <><span className=\"inputCount__chars\">{this.state.value.length}</span> / <span className=\"inputCount__maxChars\">{this.props.max}</span></>\n : ``\n const min = (this.props.min)\n ? <>(mín. {<span className=\"inputCount__minChars\">{this.props.min}</span>})</>\n : ``\n return (\n <div className={`inputCount--${this.props.type} inputCount`}>\n {(this.props.type === 'textarea') ? textarea : input}\n <div className={(this.state.value.length >= this.props.min && this.state.value.length <= this.props.max) ? 'inputCount__check ok' : (this.state.value.length === 0) ? 'inputCount__check' : 'inputCount__check ko'}>{max} {min}</div>\n </div>\n )\n }", "title": "" }, { "docid": "ed841c873b03d2d65f99a110af632e80", "score": "0.5716983", "text": "onHandleChange(e) {\n this.setState({ body: e });\n console.log(this.state.body);\n }", "title": "" }, { "docid": "d89431f08b0b8c7f10a020784fd41e96", "score": "0.5706612", "text": "checkLength (password) {\n if (password.length < 7) {\n this.setState({ length: { level: 'error', message: 'Very short password' } });\n } else if (password.length < 12) {\n this.setState({ length: { level: 'error', message: 'Short password' } });\n } else if (password.length > 15) {\n this.setState({ length: { level: 'good', message: 'Your password is nice and long' } });\n } else {\n this.setState({ length: {} });\n }\n }", "title": "" }, { "docid": "1a97a20ca0b8b49a66521274a2317300", "score": "0.569028", "text": "function inputLength() {\n return input.value.length;\n}", "title": "" }, { "docid": "3d97cd56d25a0a3c4f5ce891e98504ba", "score": "0.5676809", "text": "function inputLength() {\n return userInput.value.length;\n}", "title": "" }, { "docid": "3936f32e30cc527add6fe4151780add5", "score": "0.56690717", "text": "get characterSize() {}", "title": "" }, { "docid": "f92d51416da3cc7e237bcf6d148edbc1", "score": "0.5667521", "text": "captureInputField(myEvent)\n {\n //target is the input text box and target.value gives the val of the text\n console.log(myEvent.target.value)\n this.setState({textValue : myEvent.target.value})\n\n }", "title": "" }, { "docid": "0abfbb7663c9329385b57156b81e0657", "score": "0.5660993", "text": "function inputLength (){\n\treturn input.value.length\n}", "title": "" }, { "docid": "fbcabce3e1320afa2b98a959158e4020", "score": "0.5656142", "text": "function handleQuoteStatus(event)\n {\n var {name,value} = event.target;\n switch(name)\n {\n case \"QuoteContent\" : let tempVal = value ;\n console.log(tempVal.split('\\n').length) ; \n console.log(tempVal.length);\n if (tempVal.length > 735) value = \"\" ; \n if(tempVal.split('\\n').length-1 > 14) { value=\"\" ;} \n }\n setQuoteStatus(preprops =>{\n return {\n ...preprops , \n [name]:value \n }\n })\n\n \n }", "title": "" }, { "docid": "c8695d91899af357c32bf37d05e44c93", "score": "0.56493527", "text": "getCharacterCount() {\n console.warn('[tiptap warn]: \"editor.getCharacterCount()\" is deprecated. Please use \"editor.storage.characterCount.characters()\" instead.');\n return this.state.doc.content.size - 2;\n }", "title": "" }, { "docid": "71ce996d90ccbc8d38882109f5eefc88", "score": "0.5641713", "text": "counter(){\n let numChars = this.$el.find(\"textarea\").val().length;\n this.$el.find(\".chars-left\").html(140 - numChars);\n }", "title": "" }, { "docid": "6660603143c663167a2ba1287fe79f91", "score": "0.5639208", "text": "function getLength(input){\n return input.length;\n}", "title": "" }, { "docid": "0cb2ab563cf437731ed9336f0bab4480", "score": "0.5632793", "text": "toggleCharLimit() {\n this.setState((prevState) => ({ overCharLimit: !prevState.overCharLimit }));\n }", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "69e4f3619d51036fb78820f1a268b1c3", "score": "0.5619555", "text": "function inputLength() {\n\treturn input.value.length;\n}", "title": "" }, { "docid": "3c60e30e7a117da058e2309d0169e4fc", "score": "0.56074184", "text": "function getTapeLength() {\n\tvar tape;\n\tvar msg = document.getElementById(\"clientText\").value;\n\tmsg = msg.replace(/\\s+/g, \"\").replace(/\\r?\\n|\\r/g, \"\");\n\ttape = (msg.length * fontSize).toFixed(2)\n\tconsole.log(\"total number of characters: \" + msg.length + \"\\n\")\n\treturn tape;\n}", "title": "" }, { "docid": "e3c8e52a451cc0129b4f770c8e93f1e7", "score": "0.5594639", "text": "function updateCounter(e) {\n e.preventDefault();\n\n var text_length = e.currentTarget.value.length;\n var text_max, id_to_update;\n\n id_to_update = this.dataset.feedbackBox;\n text_max = this.dataset.maxLength;\n\n var text_remaining = text_max - text_length;\n var counter = document.getElementById(id_to_update)\n counter.textContent = text_remaining;\n return counter;\n}", "title": "" }, { "docid": "619d6bbb470bd6802f2622fe72276581", "score": "0.5583777", "text": "handleText(event) {\n this.message = event.target.value;\n }", "title": "" }, { "docid": "5602403e263f7fb5c4dcb4d9e0fb5a71", "score": "0.55829746", "text": "updateSearch(event) {\n this.setState({ search: event.target.value.substr(0, 20) });\n }", "title": "" }, { "docid": "5602403e263f7fb5c4dcb4d9e0fb5a71", "score": "0.55829746", "text": "updateSearch(event) {\n this.setState({ search: event.target.value.substr(0, 20) });\n }", "title": "" }, { "docid": "279efb5dbadc4c7375530a5b419d50b1", "score": "0.55761117", "text": "function inputLength() {\n return input.value.length;\n}", "title": "" }, { "docid": "279efb5dbadc4c7375530a5b419d50b1", "score": "0.55761117", "text": "function inputLength() {\n return input.value.length;\n}", "title": "" }, { "docid": "a20cb116d2b9e3737e134ddde0d38cc5", "score": "0.5575569", "text": "drawTextArea() {\n return (\n <TextField\n className=\"tyyli1\"\n onChange={event => {\n // this.state.fieldvalue = event.target.value;\n this.setState({ fieldvalue: event.target.value });\n }}\n >\n {' '}\n </TextField>\n );\n }", "title": "" }, { "docid": "70ff35891e15a612f6a99a0f9f5bc7e0", "score": "0.55726683", "text": "function countchars(textarea){\n textarea.addEventListener(\"keyup\", () => {\n let value = textarea.value;\n let count = value.length;\n if (count >= 270){\n textarea.parentElement.parentElement.lastElementChild.innerHTML = ` ${280 - count} characters left`;\n }\n else {\n textarea.parentElement.parentElement.lastElementChild.innerHTML = \"\";\n }\n });\n}", "title": "" }, { "docid": "44cfdb1f566a4355a4081011909d51d7", "score": "0.5569161", "text": "function updateLength() {\n let tweetString = inputField.value.length;\n document.getElementById(\"tweetLength\").innerHTML = 140 - tweetString;\n}", "title": "" }, { "docid": "690b70460565f8fb2d3ee8ed35e34e39", "score": "0.5565746", "text": "onMessageTextChange(event) {\n this.setState({messageText: event.target.value});\n }", "title": "" }, { "docid": "978a4f1610faaeb7c60e4c49cb071477", "score": "0.5552138", "text": "handlechangesize(evt) {\n const valuesize = (evt.target.validity.valid) ? evt.target.value : this.state.valuesize;\n\n this.setState({ valuesize });\n }", "title": "" }, { "docid": "abba7f9acd9d24723f8f33c43ec46799", "score": "0.5551209", "text": "handleSubmit() {\n if (this.state.text.length > 0) {\n this.props.sendChat(this.state.text);\n this.setState({\n text: '',\n charsLeft: 140,\n });\n }\n }", "title": "" }, { "docid": "09794e911da6201942e8b89c90812cc9", "score": "0.55493355", "text": "_getMaxLength(): number {\n const maxLength =\n this.props.system.get('nameMax') -\n '.md'.length -\n '.000'.length; // room to disambiguate up to 1,000 duplicate titles\n\n return Math.max(\n 0, // sanity: never return a negative number\n maxLength\n );\n }", "title": "" }, { "docid": "9a6c4953e2d4941bd001f7d84c2341c4", "score": "0.5548424", "text": "function countChars(){\n\n}", "title": "" }, { "docid": "7779d4955a79c4a1084fa90234c683ec", "score": "0.5531794", "text": "onChange(e){\n this.setState({text: e.target.value})\n }", "title": "" }, { "docid": "58ef63d74ebf226f6378e1fb1a3f4377", "score": "0.5518291", "text": "onTextChange(event) {\n //update state text with entered text\n this.setState({text: event.target.value});\n }", "title": "" }, { "docid": "1e4f74a26535c798de39f61ad78173c2", "score": "0.55182356", "text": "handleEmailFormChange(event) {\n\n //used to identify change val, target state and component changes came from\n const { value } = event.target\n\n console.log('entered handle email form change');\n\n if (value.length >= 320) {\n this.setState({\n emailErrorBool: true,\n emailError: 'The email you have entered is too long.',\n recipientEmail: value.replace(/(\\n\\n?)\\n+/g, '$1').slice(0, 319),\n });\n }\n else if (value.indexOf('@') === -1)\n this.setState({\n emailErrorBool: true,\n emailError: 'The email you have entered is invalid.',\n recipientEmail: value.replace(/(\\n\\n?)\\n+/g, '$1')\n });\n\n else {\n this.setState({\n emailErrorBool: false,\n emailError: '',\n recipientEmail: value.replace(/(\\n\\n?)\\n+/g, '$1')\n });\n }\n }", "title": "" }, { "docid": "074dddd62a558e336135859ea7a63c21", "score": "0.55143046", "text": "onEnterMessage(event) {\n this.setState({\n content: event.target.value\n })\n }", "title": "" }, { "docid": "82ab9ccddafba625797a49a7b77a6b33", "score": "0.5504919", "text": "handleTopTextChange(event) {\n const { value } = event.target;\n this.setState({ topText: value });\n }", "title": "" }, { "docid": "d8a162ceba45dd9829ec876de1f4b326", "score": "0.5499962", "text": "doSearch() {\n this.setState(\n (prevState, props) => {\n var count = this.state.seacrchText.length * 3;\n return {\n seacrchCount: prevState.seacrchCount + 1,\n resultCount: count\n };\n }\n );\n }", "title": "" }, { "docid": "15af89bcef34aa474a47171e0f2222f5", "score": "0.5499358", "text": "componentDidMount() {\n this.setInputSize(this.state.titleText.length);\n this.setPageTitle();\n this.setState({\n inputText: this.props.board.title || \"\",\n titleText: this.props.board.title || \"\"\n });\n }", "title": "" }, { "docid": "a993b0e2eb0b2425feaf6e1057bc902d", "score": "0.5496732", "text": "size(){return this.content.length;}", "title": "" }, { "docid": "a993b0e2eb0b2425feaf6e1057bc902d", "score": "0.5496732", "text": "size(){return this.content.length;}", "title": "" }, { "docid": "71e14f574a695babb82f78e1f86c4682", "score": "0.5484327", "text": "_changeHandler(e) {\n this.setState({ text : e.target.value });\n }", "title": "" }, { "docid": "0dd33897f2ad2290f8a7b269c332e132", "score": "0.54842067", "text": "get maxLength() {\n\t\treturn this.nativeElement ? this.nativeElement.maxLength : undefined;\n\t}", "title": "" }, { "docid": "3b6ec675b04b27542beb97e297049b79", "score": "0.548239", "text": "handleChange(e) {\n this.setState({ text: e.target.value });\n }", "title": "" }, { "docid": "8f96dd2c60c77d8b2b3f17036f448d40", "score": "0.5477616", "text": "function update_count(field, char_limit, msg_span, msg_start, msg_end) {\n var rem = char_limit - field.value.length;\n if (rem < 0) rem = 0;\n msg_span.innerHTML = msg_start + rem + msg_end;\n}", "title": "" }, { "docid": "e126cde7ca11c08fdf4ea6aa7b08fdc0", "score": "0.54771245", "text": "handleChange(input) {\n const newValueLength = input.length;\n let valueText = input;\n let value = Number(input);\n if (isNaN(value)) {\n console.warn(`Error: ${valueText} is not a valid number.`);\n return;\n }\n if (value <= this.props.properties.min) {\n value = this.props.properties.min;\n valueText = value;\n } else if (value >= this.props.properties.max) {\n value = this.props.properties.max;\n valueText = value;\n }\n\n if (newValueLength === 0) {\n valueText = '';\n } else {\n this.props.onChange(value);\n }\n this.setState({\n valueText: String(valueText),\n value: value,\n });\n }", "title": "" }, { "docid": "cc11d42a3f580718d073335b26a2c747", "score": "0.5471825", "text": "handleChange(e){\n this.setState({\n body: e.target.value\n \n })\n \n }", "title": "" }, { "docid": "0c59a914234551ce91a3d9857b517cc6", "score": "0.5469346", "text": "function inputLength(){\t\n\treturn input.value.length;\n}", "title": "" } ]
741b69135e31935be7b591f95e9b1aca
Delete any old caches to respect user's disk space.
[ { "docid": "c23818f0bd524503db9b480ccd9f471c", "score": "0.6762252", "text": "async function deleteOldCaches(currentCache) {\n const keys = await caches.keys();\n\n for (const key of keys) {\n const isOurCache = 'myapp-' === key.substr(0, 6);\n\n if (currentCache === key || !isOurCache) {\n continue;\n }\n\n caches.delete(key);\n }\n}", "title": "" } ]
[ { "docid": "5a69d7f71c74c8e5b843f6d3e9fcced6", "score": "0.7406624", "text": "cleanCache () {\n this.cleanDB();\n this.cleanFolders();\n }", "title": "" }, { "docid": "d659463688f8ef51df1c6209efe3f094", "score": "0.71303684", "text": "function clearOldCaches() {\n return caches.keys()\n .then( keys => {\n return Promise.all(keys.filter(key => key.indexOf(version) !== 0)\n .map(key => caches.delete(key))\n );\n });\n}", "title": "" }, { "docid": "da3f44e562d84265f1fb56b489194606", "score": "0.7059887", "text": "function clearOldCaches() {\n return caches.keys()\n .then( keys => {\n return Promise.all(keys\n .filter(key => key.indexOf(version) !== 0)\n .map(key => caches.delete(key))\n );\n });\n}", "title": "" }, { "docid": "b28a18efcbb81fe3e235d52c330ec37d", "score": "0.7052283", "text": "async cleanup() {\n // Remove both the cache and the database entries which track LRU stats.\n await Promise.all([\n this.scope.caches.delete(`${this.prefix}:dynamic:${this.config.name}:cache`),\n this.db.delete(`${this.prefix}:dynamic:${this.config.name}:age`),\n this.db.delete(`${this.prefix}:dynamic:${this.config.name}:lru`),\n ]);\n }", "title": "" }, { "docid": "52ceafdd3a394e5b3431891c16efcd5d", "score": "0.692114", "text": "static removeCachedKeystore() {\n localforage.removeItem(STORAGE_KEY);\n }", "title": "" }, { "docid": "797be3a6f7340609358a8f2ed1446990", "score": "0.69172174", "text": "function clearCaches(){\r\n localStorage.clear();\r\n}", "title": "" }, { "docid": "0adf1ec76b60ea60afcbda7d9f5e467f", "score": "0.68248665", "text": "clearCacheStorage(version){\n _logger.info(_script+\" v.\"+_version,\"clearCacheStorage(\"+version+\")\");\n caches.open(version).then(function(cache) {\n cache.keys().then(function(keys) {\n keys.forEach(function(request, index, array) {\n cache.delete(request);\n });\n });\n });\n }", "title": "" }, { "docid": "f852fa9db29575ccbde872eec60124bf", "score": "0.6752061", "text": "async cleanup() {\n await this.scope.caches.delete(`${this.prefix}:${this.config.name}:cache`);\n await this.db.delete(`${this.prefix}:${this.config.name}:meta`);\n }", "title": "" }, { "docid": "6dfdaeb5d0662ca5277c69014b5cd3b7", "score": "0.6721152", "text": "function clearCaches(e) {\n e.waitUntil(\n caches.keys().then(cacheNames => {\n cacheNames.forEach(cacheName => {\n if (\n cacheName !== CACHE_NAME_STATIC\n && cacheName !== CACHE_NAME_DYNAMIC\n ) return caches.delete(cacheName)\n })\n })\n ) \n}", "title": "" }, { "docid": "12790a21400f69f6bc5e60fd3d51f033", "score": "0.6678423", "text": "function cleanMemory() {\n memory.allocated.forEach(function (vTree) {\n return memory.free.add(vTree);\n });\n memory.allocated.clear();\n\n // Clean out unused elements, if we have any elements cached that no longer\n // have a backing VTree, we can safely remove them from the cache.\n _caches.NodeCache.forEach(function (node, descriptor) {\n if (!memory.protected.has(descriptor)) {\n _caches.NodeCache.delete(descriptor);\n }\n });\n }", "title": "" }, { "docid": "07d3f9a2315637aff9fcda27c8c00030", "score": "0.6651415", "text": "async _cleanUpOldEntries() {\n const requestsCachedOnInstall = Object.values(this._installCacheList)\n .map((fileEntry) => fileEntry.request.url);\n\n let openCache = await this._getCache();\n const allCachedRequests = await openCache.keys();\n\n const cachedRequestsToDelete = allCachedRequests.filter((cachedRequest) => {\n if (requestsCachedOnInstall.includes(cachedRequest.url)) {\n return false;\n }\n return true;\n });\n\n await Promise.all(\n cachedRequestsToDelete.map((cachedRequest) => {\n return openCache.delete(cachedRequest);\n })\n );\n }", "title": "" }, { "docid": "f8c1d2097fbb62c16f281b8aa68acd30", "score": "0.6586401", "text": "function clearCache() {\n apps.clear();\n users.clear();\n}", "title": "" }, { "docid": "077d61a7e5d8316b09415d578cd11a89", "score": "0.6582586", "text": "function clearCache() {\n cache.cacheClear();\n }", "title": "" }, { "docid": "5c376a246e0dedde9f0ad0fd09bc7d2c", "score": "0.6555976", "text": "function purge() {\n\n\t\tutil.deleteFolderRecursive(dbRoot);\n\t\tutil.deleteFolderRecursive(loadersDir);\n\n\t\t// recreate the folders\n\t\tfs.mkdirSync(dbRoot);\n\n\t\tinstalledFiles = {};\n\t}", "title": "" }, { "docid": "528cd6300dc16481f65a3964287f54fd", "score": "0.6529598", "text": "function clearCaches(e) {\n // if (e.origin !== \"http://example.org\") return // check and reject if not correct origin\n console.log('SW clearCaches')\n e.waitUntil(\n caches.keys()\n .then((cacheNames) => {\n // return Promise.all(\n // cacheNames.filter((cacheName) =>\n // !(cacheName === CACHE_NAME_STATIC || cacheName === CACHE_NAME_DYNAMIC)\n // ).map((cacheName) => {\n // return caches.delete(cacheName)\n // })\n // )\n cacheNames.forEach((cacheName) => {\n if (!(cacheName === CACHE_NAME_STATIC || cacheName === CACHE_NAME_DYNAMIC)) {\n console.log('sw delete cache = ', cacheName)\n return caches.delete(cacheName)\n }\n })\n })\n .catch((err) => console.log('SW clearCaches Error', err))\n )\n}", "title": "" }, { "docid": "4add22e169880743ec400ee6d424213b", "score": "0.64613754", "text": "async deleteCacheAndMetadata() {\n // Do this one at a time instead of all at once via `Promise.all()` to\n // reduce the chance of inconsistency if a promise rejects.\n for (const [cacheName, cacheExpiration] of this._cacheExpirations) {\n await caches.delete(cacheName);\n await cacheExpiration.delete();\n }\n\n // Reset this._cacheExpirations to its initial state.\n this._cacheExpirations = new Map();\n }", "title": "" }, { "docid": "855f4e53f115d46c334b93cf88596914", "score": "0.64329064", "text": "async clearCache() {\n try {\n await databaseManager.dropAllTables();\n await databaseManager.initialize();\n canteenManager.clearLastPrefetchPosition();\n alert(Locale.LOCALE.SETTINGS[\"cache-cleared\"]);\n } catch(e) {\n console.error(\"Could not clear the cache:\", e);\n alert(Locale.LOCALE.SETTINGS[\"cache-clear-error\"]);\n }\n }", "title": "" }, { "docid": "7e6f69ee63d3e8c2c377c3b679139304", "score": "0.6396", "text": "function removeLeastUsedCacheEntries() {\n return caches.open(config.cacheVersion).then((cache) => {\n for (const url in lastUsedTime) {\n if (lastUsedTime.hasOwnProperty(url)) {\n let timeDiff = (Date.now() - lastUsedTime[url]) / 1000 / 60; // in minutes\n if (timeDiff >= MAX_CACHE_TIME) {\n console.log(`${TAG} Deleting cache entry for URL: ${url}`);\n delete lastUsedTime[url];\n cache.delete(url);\n }\n }\n }\n return storeLastUsedTimeInCache(cache);\n });\n}", "title": "" }, { "docid": "f122cdf0d3fe109e1524eed30bd2f092", "score": "0.63780683", "text": "function pruneCache(usedCacheKeys, allCacheKeys, cacheDir) {\n if (cacheDir) {\n const unusedKeys = allCacheKeys.filter((key) => usedCacheKeys.indexOf(key) === -1);\n unusedKeys.forEach((key) => {\n fs.unlinkSync(path.join(cacheDir, `${key}.js`));\n });\n }\n}", "title": "" }, { "docid": "6e667044f12e96dccfdcb065ef669722", "score": "0.63570327", "text": "reset() {\n fs_extra_1.removeSync(this._options.cacheFilePath);\n }", "title": "" }, { "docid": "41829037906696440a1de1951c5976d8", "score": "0.6338207", "text": "static ClearDiskCache() {}", "title": "" }, { "docid": "f431903c2a212d8cbb620349f6ecf278", "score": "0.6315429", "text": "function cleanAllLocalCache(){\n\tvar storage = window.localStorage;\n\tlen = storage.length;\n\tfor (var i=storage.length; i >=0; i--){\n\t\tvar key = storage.key(i);\n\t\tif(key!=null && key!= undefined && key.substring(0,5) == 'order'){\n\t\t\tstorage.removeItem(key);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a6271cc14ac4ede505922a2dc03b6734", "score": "0.6263524", "text": "function cleanMemory() {\n var elementCache = _pools.pools.elementObject.cache;\n var attributeCache = _pools.pools.attributeObject.cache;\n\n // Empty all element allocations.\n elementCache.allocated.forEach(function (v) {\n if (elementCache.free.length < _pools.count) {\n elementCache.free.push(v);\n }\n });\n\n elementCache.allocated.clear();\n\n // Clean out unused elements.\n _cache.NodeCache.forEach(function (node, descriptor) {\n if (!elementCache.protected.has(descriptor)) {\n _cache.NodeCache.delete(descriptor);\n }\n });\n\n // Empty all attribute allocations.\n attributeCache.allocated.forEach(function (v) {\n if (attributeCache.free.length < _pools.count) {\n attributeCache.free.push(v);\n }\n });\n\n attributeCache.allocated.clear();\n}", "title": "" }, { "docid": "843fc1b61d052f5fb962cf1941162cfa", "score": "0.625727", "text": "function clearCache() {\n _cache = {};\n }", "title": "" }, { "docid": "843fc1b61d052f5fb962cf1941162cfa", "score": "0.625727", "text": "function clearCache() {\n _cache = {};\n }", "title": "" }, { "docid": "d038d540285f25e3c623b34b6f870af6", "score": "0.6251683", "text": "removeAll() {\n this.cache.flushAll();\n }", "title": "" }, { "docid": "5391d96cc104ad42bfe2fb16d616947a", "score": "0.62441736", "text": "function clearCache() {\n // Call the clear function to remove all content\n cache.clear().then(\n // Success function\n function(content) {\n out(\"Cache cleared\");\n },\n // Error function\n function(err) {\n out(\"Unable to clear cache: \" + err);\n });\n}", "title": "" }, { "docid": "3e034d93559b6f7bb6fa85ca361bab87", "score": "0.621232", "text": "function clearCache() {\r\n _cache = {};\r\n }", "title": "" }, { "docid": "e84db41e0b9b8b31c7842d7b23a050fa", "score": "0.6186726", "text": "function delCache(key) {\n\tdelete cache[key];\n}", "title": "" }, { "docid": "5b40d2d8452e9592ac3419137a80b7a7", "score": "0.6179246", "text": "async function removeAllCache() {\n await caches.keys().then((keys) => {\n // Goes through each cache present and deletes it\n keys.forEach(async (key) => {\n await caches.delete(key).then(() => {\n if (showDeveloperConsoleLog) {\n key === cacheVersion\n ? // If the cache is the same as the current cache version\n console.log(`%cCurrent cache cleared: \"${key}\"`, statusLog)\n : // If the cache is not the same as the current cache version\n console.log(`%cPrevious cache has been removed: \"${key}\"`, statusLog);\n }\n });\n });\n });\n}", "title": "" }, { "docid": "39ee3f43f37c14fdc24d8c444a508606", "score": "0.6153336", "text": "async function clearLocalCache() {\n const cachedFiles = await caches.keys();\n\n await cachedFiles.map(async (file) => {\n await caches.delete(file);\n });\n\n window.location.reload();\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6142398", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "0cafb82198cda5e29826ba55ad67e705", "score": "0.6120453", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "0cafb82198cda5e29826ba55ad67e705", "score": "0.6120453", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "0822685dc660f18d412a547381a8e9bd", "score": "0.61024356", "text": "function trimCache(cacheName, maxItems) {\n caches.open(cacheName).then( cache => {\n cache.keys().then(keys => {\n if (keys.length > maxItems) {\n cache.delete(keys[0])\n .then(trimCache(cacheName, maxItems));\n }\n });\n });\n}", "title": "" }, { "docid": "bc43841577e8c0b4d85fae4932e3b90d", "score": "0.60668695", "text": "function clearCaches() {\n\t\tsplitByNumbers.cache = {};\n\n\t\tcalculateSortKey.cache = {};\n\n\t\tdetermineContentType.cache = {};\n\n\t\t(extractTextContent.cachedElements || []).forEach(element => delete element.xxxJanTextContent);\n\t\textractTextContent.cachedElements = [];\n\n\t\t(determineLocale.cachedElements || []).forEach(element => delete element.xxxJanLocale);\n\t\tdetermineLocale.cachedElements = [];\n\t}", "title": "" }, { "docid": "d1795c75868b88dc7c5ff57291927e0f", "score": "0.60553205", "text": "function clearCaches() {\n socketConnectionQueue = [];\n downloadCompleteQueue = {};\n }", "title": "" }, { "docid": "af7294887e90d5acb1eb41581606b55e", "score": "0.6047682", "text": "function clearDirtyFilesCache() {\n _dirtyFilesCache = {};\n}", "title": "" }, { "docid": "14e2fd74cfb4707cec16e5821a81f05c", "score": "0.60417473", "text": "function clear() {\n cache = {};\n }", "title": "" }, { "docid": "4528b830bf3b40ffd14a05b9cdb969da", "score": "0.6025967", "text": "onShutdown() {\r\n let cacheDir, cacheRead, dir, directories, filename;\r\n directories = [];\r\n for (let dir in this.cacheFiles) {\r\n if (typeof this.cacheFiles[dir] != 'string') {\r\n continue;\r\n }\r\n filename = this.convertDirToFilename(dir);\r\n if (this.fs.existsSync(this.cacheFiles[dir] + '/' +\r\n filename)) {\r\n this.fs.unlinkSync(this.cacheFiles[dir] + '/' +\r\n filename);\r\n }\r\n directories.push([this.cacheFiles[dir], dir]);\r\n }\r\n for (dir of directories) {\r\n cacheDir = dir[0];\r\n dir = dir[1];\r\n if (this.fs.existsSync(cacheDir)) {\r\n cacheRead = SpiritRScandir.walkSync(cacheDir, null, true);\r\n } else {\r\n continue;\r\n }\r\n if (cacheRead &&\r\n SpiritRScandir.walkSync(cacheDir, null, true)[0].length == 0) {\r\n this.rimraf.sync(cacheDir);\r\n }\r\n delete this.cacheFiles[dir];\r\n }\r\n }", "title": "" }, { "docid": "490aff8cf7e9629147b612e5c967be8a", "score": "0.60119474", "text": "function clearCache(){\n\tvar cacheService = CacheService.getScriptCache();\n\tcacheService.removeAll([CACHE_KEY]);\n}", "title": "" }, { "docid": "6bbcde9f73379fec44a44b366ecfe034", "score": "0.60097504", "text": "function cleanupOutdatedCaches() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('activate', ((event) => {\n const cacheName = workbox_core_private_cacheNames_js__WEBPACK_IMPORTED_MODULE_0__.cacheNames.getPrecacheName();\n event.waitUntil((0,_utils_deleteOutdatedCaches_js__WEBPACK_IMPORTED_MODULE_2__.deleteOutdatedCaches)(cacheName).then((cachesDeleted) => {\n if (true) {\n if (cachesDeleted.length > 0) {\n workbox_core_private_logger_js__WEBPACK_IMPORTED_MODULE_1__.logger.log(`The following out-of-date precaches were cleaned up ` +\n `automatically:`, cachesDeleted);\n }\n }\n }));\n }));\n}", "title": "" }, { "docid": "6f713176fb79ecb1f589bdbdd4814466", "score": "0.60071427", "text": "async clearImageCache () {\n\t\tconst files = await FsUtil.readDirectory (App.DATA_DIRECTORY);\n\t\tfor (const file of files) {\n\t\t\tif (file.indexOf (ImageFilenamePrefix) == 0) {\n\t\t\t\tconst path = Path.join (App.DATA_DIRECTORY, file);\n\t\t\t\ttry {\n\t\t\t\t\tawait FsUtil.removeFile (path);\n\t\t\t\t}\n\t\t\t\tcatch (err) {\n\t\t\t\t\tLog.debug (`${this.name} failed to delete image cache file; path=${path} err=${err}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ae67cdb23ce31092d02bcbaf7dca17cf", "score": "0.59828836", "text": "function cleanupOutdatedCaches() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('activate', ((event) => {\n const cacheName = workbox_core_private_cacheNames_js__WEBPACK_IMPORTED_MODULE_0__[\"cacheNames\"].getPrecacheName();\n event.waitUntil(Object(_utils_deleteOutdatedCaches_js__WEBPACK_IMPORTED_MODULE_2__[\"deleteOutdatedCaches\"])(cacheName).then((cachesDeleted) => {\n if (true) {\n if (cachesDeleted.length > 0) {\n workbox_core_private_logger_js__WEBPACK_IMPORTED_MODULE_1__[\"logger\"].log(`The following out-of-date precaches were cleaned up ` +\n `automatically:`, cachesDeleted);\n }\n }\n }));\n }));\n}", "title": "" }, { "docid": "c3bdd4b0abd8616ef780b0fb568fd083", "score": "0.5980332", "text": "clear() {\n let directory = this.options.modsdir;\n let files = fs.readdirSync(directory);\n for (const file of files) {\n try {\n fs.unlinkSync(path.join(directory, file));\n }\n catch(e) {\n console.log(e);\n }\n }\n this.cache.clear();\n }", "title": "" }, { "docid": "4bdb5ec03a5ee598f81dd28e29f21774", "score": "0.5975345", "text": "function purge() {\n loadedDataSets = {};\n promises = {};\n }", "title": "" }, { "docid": "1956e0dcb78bdf617f9efdd2ce04c0fe", "score": "0.59706205", "text": "static clear() {\n\t\t_.forEach(CACHES, cache => {\n\t\t\ttry {\n\t\t\t\tcache.unwrap()\n\t\t\t} catch (e) {\n\t\t\t\t// Pass. We'll carp about it later.\n\t\t\t}\n\t\t});\n\t\tconst remaining = Object.keys(CACHES);\n\t\tif (remaining.length) {\n\t\t\tremaining.forEach(k => delete CACHES[k]);\n\t\t\tthrow new Error(\"A non-cache snuck in!\");\n\t\t}\n\t}", "title": "" }, { "docid": "53e4b40c6085fe490d4e849cb677a364", "score": "0.5948015", "text": "function cacheClear() {\n cacheUser = [];\n cachePhoto = [];\n cacheFriend = [];\n cacheChat = [];\n cacheMessage = [];\n cacheGroup = [];\n}", "title": "" }, { "docid": "2593d3c42f7343a76dadfc5dbe64beab", "score": "0.5924553", "text": "clear() {\n this.cache.reset();\n }", "title": "" }, { "docid": "515b3ff1de31f91e2aeb0233fa4db6a6", "score": "0.591801", "text": "function clearCache() {\n CacheService.clear().then(function(){\n $log.debug(\"Cache cleared!\");\n }).catch(handleError(err));//clears the cache\n }", "title": "" }, { "docid": "486ab36daf4c11f9b5fd552764345915", "score": "0.58775854", "text": "_purge() {\n localStorage.clear();\n }", "title": "" }, { "docid": "959c640993e8144f0cc4e635ca279b5d", "score": "0.5865502", "text": "cleanFolders () {\n cleaner.runClearCache(() => {\n console.log(\"Cache was cleaned\");\n });\n }", "title": "" }, { "docid": "0a65c1814d9789bcb9d773928f8c5e42", "score": "0.5858838", "text": "function clearCache() {\n appMeta = null;\n didFailRetrievingAppMeta = false;\n}", "title": "" }, { "docid": "d8f8a3ad384d33801a4ca9562933f25f", "score": "0.58564806", "text": "function trimCache(cacheName, maxItems) {\r\n caches.open(cacheName)\r\n .then(function (cache) {\r\n return cache.keys()\r\n .then(function (keys) {\r\n if (keys.length > maxItems) {\r\n cache.delete(keys[0])\r\n .then(trimCache(cacheName, maxItems));\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "7140cd533a39b0fa25242f0e77f5e9e8", "score": "0.58438045", "text": "function cleanUp() {\n\n\t// before version 1.0.12, datacache was in {posttype}.data.cache.json\n\tfor ( var index in posts ) {\n\t\tStorage.deleteSync( index + '.data.cache.json' );\n\t}\n\n}", "title": "" }, { "docid": "853de732065e5c66864f94ca9599cb97", "score": "0.5838878", "text": "clearExpiredCache() {\n let now = Date.now();\n this.storage\n .keys()\n .filter((key) => key.match(/^list/))\n .forEach((key) => {\n if (now - this.storage.getItem(key).updatedAt > THIRTY_DAYS_FROM_NOW) {\n this.storage.removeItem(key);\n }\n });\n }", "title": "" }, { "docid": "7fa4138803fe89f0b01229a3ae8f4a8d", "score": "0.58014286", "text": "static clearCache() {\n Object.keys(this._instance).forEach(key =>\n this._instance[key].clearCache()\n );\n }", "title": "" }, { "docid": "3cbfbb0596d819748d3fb1c699915216", "score": "0.5790067", "text": "function clearCache() {\n store.clearCache(\"api\");\n}", "title": "" }, { "docid": "5041e0b8b3f45cb17d4b388d3b7f41ee", "score": "0.5783394", "text": "async function delKeys() {\n\t\t\tconst key = await cache.keys('course:list:*');\n\t\t\tawait cache.del(key);\n\t\t}", "title": "" }, { "docid": "82f931008e4ec54fcf7b5ccf30ddd5b4", "score": "0.5780382", "text": "function trimCache(cacheName , maxItems){\n cache.open(cacheName)\n .then(function(cache){\n return cache.keys()\n .then(function(keys){\n if(keys.length > maxItems){\n cache.delete(keys[0])\n .then(trimCache(cacheName ,maxItems))\n }\n })\n })\n \n}", "title": "" }, { "docid": "cfb641f027a003c4e3cd0f8b9931856f", "score": "0.57722414", "text": "expire() {\n if (this.cacheSize_ > this.maxCacheSize_) {\n let i = 0;\n for (const key in this.cache_) {\n const iconImage = this.cache_[key];\n if ((i++ & 3) === 0 && !iconImage.hasListener()) {\n delete this.cache_[key];\n --this.cacheSize_;\n }\n }\n }\n }", "title": "" }, { "docid": "bc9c1c7a78949428d7744e08e3d30302", "score": "0.5720601", "text": "function trimCache(cacheName, maxItems) {\n //open cache and delete the oldest item\n caches.open(cacheName)\n .then(function(cache) {\n return cache.keys()\n .then(function(keys) {\n if (keys.length > maxItems) {\n //delete item and call function again (recursively)\n cache.delete(keys[0])\n .then(trimCache(cacheName, maxItems));\n }\n });\n });\n}", "title": "" }, { "docid": "aa6280566d5d806f4c7fdb3d543142a0", "score": "0.5715313", "text": "function trimCache(cacheName, maxItems) {\n caches.open(cacheName).then(function(cache) {\n // Get all the requests from the cache\n return cache.keys().then(function(keys) {\n if (keys.length > maxItems) {\n // Remove oldest item from cache and continue trimming until the cache\n // has less items than the maxItems set.\n cache.delete(keys[0]).then(trimCache(cacheName, maxItems))\n }\n })\n })\n}", "title": "" }, { "docid": "88feef3c94a4b425f951e2447974c33d", "score": "0.57019854", "text": "function clearRequireCache() {\n delete require.cache[require.resolve('../../../../config.js')];\n delete require.cache[require.resolve('../../../../express')];\n delete require.cache[require\n .resolve('../../../../api/v1/controllers/subjects')];\n delete require.cache[require\n .resolve('../../../../api/v1/helpers/nouns/subjects')];\n delete require.cache[require.resolve('supertest')];\n}", "title": "" }, { "docid": "faf211c98c475795d2bd9b9c8ecb093b", "score": "0.570083", "text": "function reset() {\n cache.reset();\n AJS.debug('server-users-supplier: Cache reset');\n }", "title": "" }, { "docid": "e83dea32fa59ad83d6e906f0249acd95", "score": "0.5698966", "text": "function clearStorage() {\n clear();\n clearCachedCommitments();\n resetVars();\n resetSpendVars();\n // Update icons\n updateIcon(0);\n UpdateCallback();\n}", "title": "" }, { "docid": "2b006d8eb490180e9bf15b51372f9d65", "score": "0.56942767", "text": "clear(path) {\n if (path != null) {\n this.cache.delete(path);\n } else {\n this.cache.clear(path);\n }\n }", "title": "" }, { "docid": "6a26b39f93e2f51a2238dc398ede71d4", "score": "0.5675107", "text": "wipe () {\n require('../..')._pluginManager.destroy()\n\n delete require.cache[require.resolve('../..')]\n delete global._ddtrace\n\n const basedir = path.join(__dirname, '..', '..', '..', '..', 'versions')\n const exceptions = ['/libpq/', '/grpc/', '/sqlite3/', '/couchbase/'] // wiping native modules results in errors\n .map(exception => new RegExp(exception))\n\n Object.keys(require.cache)\n .filter(name => name.indexOf(basedir) !== -1)\n .filter(name => !exceptions.some(exception => exception.test(name)))\n .forEach(name => {\n delete require.cache[name]\n })\n }", "title": "" }, { "docid": "034790a602fe4bc2a2785b532dc447c3", "score": "0.5650329", "text": "function clearCache() {\n cachedClients = {};\n}", "title": "" }, { "docid": "290cebea4a82b7521cee3245887edf00", "score": "0.5646936", "text": "static flushCache(){\n catalogueCache.flushAll();\n }", "title": "" }, { "docid": "7af6fcbd1cad322a393d24942d827d7d", "score": "0.56166214", "text": "function purgeCache(moduleName) {\n // Traverse the cache looking for the files\n // loaded by the specified module name\n searchCache(moduleName, function (mod) {\n delete require.cache[mod.id];\n });\n\n // Remove cached paths to the module.\n // Thanks to @bentael for pointing this out.\n Object.keys(module.constructor._pathCache).forEach(function (cacheKey) {\n if (cacheKey.indexOf(moduleName) > 0) {\n delete module.constructor._pathCache[cacheKey];\n }\n });\n}", "title": "" }, { "docid": "11c36b372fe15022250550c20f468e8d", "score": "0.5615164", "text": "function clear() {\r\n\t\tif (this.cacheMap) this.cacheMap = {};\r\n\t\telse $.sessionStorage.removeAll(this.name);\r\n\t}", "title": "" }, { "docid": "01f14e5ba43e1db64a16f3878f880e20", "score": "0.56056917", "text": "function resetLocalStorage() {\n // Clear IndexedDB.\n var indexedDB =\n window.indexedDB ||\n window.mozIndexedDB ||\n window.webkitIndexedDB ||\n window.msIndexedDB;\n if (indexedDB) {\n // Always hardcoded.\n indexedDB.deleteDatabase('/maps/map01/');\n }\n\n // Clear filesystem.\n function resetFS(fs) {\n var reader = fs.root.createReader();\n function removeMore(entries) {\n for (var n = 0; n < entries.length; n++) {\n var entry = entries[n];\n if (entry.isDirectory) {\n entry.removeRecursively(function() {});\n }\n }\n if (entries.length) {\n reader.readEntries(removeMore);\n } else {\n alert('Done!');\n }\n };\n reader.readEntries(removeMore);\n };\n var requestFileSystem =\n window.requestFileSystem || window.webkitRequestFileSystem;\n if (requestFileSystem) {\n requestFileSystem.call(\n window, window.PERSISTENT, 1, resetFS);\n }\n}", "title": "" }, { "docid": "b094f4cf3983ee1bc0a313c8d06cffab", "score": "0.55971384", "text": "evict_() {\n if (this.size_ <= this.capacity_) {\n return;\n }\n\n // dev().warn(TAG, 'Trimming LRU cache');\n const cache = this.cache_;\n let oldest = this.access_ + 1;\n let oldestKey;\n\n for (const key in cache) {\n const { access } = cache[key];\n\n if (access < oldest) {\n oldest = access;\n oldestKey = key;\n }\n }\n\n if (oldestKey !== undefined) {\n delete cache[oldestKey];\n this.size_--;\n }\n }", "title": "" }, { "docid": "2a54c75af488bc2866a9b53b80cfb2e9", "score": "0.55925274", "text": "static clearAllStore () {\n window.localStorage.clear()\n }", "title": "" }, { "docid": "8f017c3adb19e861dfffd90325e2041b", "score": "0.5575028", "text": "async clearCache (cmdInv, request, response) {\n\t\tApp.systemAgent.removeIntentGroup (this.name);\n\t\tawait this.clear ();\n\t\ttry {\n\t\t\tawait FsUtil.removeDirectory (this.cacheDataPath);\n\t\t\tawait FsUtil.createDirectory (this.cacheDataPath);\n\t\t\tthis.streamCount = 0;\n\t\t\tthis.getDiskSpaceTask.setNextRepeat (0);\n\t\t}\n\t\tcatch (err) {\n\t\t\tLog.warn (`Failed to clear cache data directory; path=${this.cacheDataPath} err=${err}`);\n\t\t}\n\t\tApp.systemAgent.writeCommandResponse (request, response, App.systemAgent.createCommand (SystemInterface.CommandId.CommandResult, {\n\t\t\tsuccess: true\n\t\t}));\n\t}", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.5572535", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" } ]
f66b6de12da6494fdc41fde922d9bcea
TODO: remove 'name' arg after deprecation is removed
[ { "docid": "a1f0d8efd441f418c7f457a88669620a", "score": "0.0", "text": "function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }", "title": "" } ]
[ { "docid": "4f712df920704a9ad2dfa612599b2c95", "score": "0.68679005", "text": "constructor (name) {\n this.name = name;\n }", "title": "" }, { "docid": "4f712df920704a9ad2dfa612599b2c95", "score": "0.68679005", "text": "constructor (name) {\n this.name = name;\n }", "title": "" }, { "docid": "5d27470bf474e8a674fd0b58e88744f4", "score": "0.6782454", "text": "constructor(name) {\n this.name = name;\n }", "title": "" }, { "docid": "5d27470bf474e8a674fd0b58e88744f4", "score": "0.6782454", "text": "constructor(name) {\n this.name = name;\n }", "title": "" }, { "docid": "c884643f371c7c269ddc9af766a1db6e", "score": "0.67381084", "text": "constructor(name) {\n this.name = name;\n }", "title": "" }, { "docid": "c884643f371c7c269ddc9af766a1db6e", "score": "0.67381084", "text": "constructor(name) {\n this.name = name;\n }", "title": "" }, { "docid": "c884643f371c7c269ddc9af766a1db6e", "score": "0.67381084", "text": "constructor(name) {\n this.name = name;\n }", "title": "" }, { "docid": "f7cf1973b37e602522564cce5a9b9095", "score": "0.67004764", "text": "function name(name) {\n return this.name = name;\n \n\n}", "title": "" }, { "docid": "6e81d245c6cf7bf66c5c39cec8ff182c", "score": "0.6678481", "text": "constructor(name){\n this._name = name\n }", "title": "" }, { "docid": "5aadec32a61a76283ccc16c2b009b55b", "score": "0.6597762", "text": "constructor(name) {\n super(name);\n }", "title": "" }, { "docid": "eee836513f1a5d895f13a6ad7d46c20b", "score": "0.65202653", "text": "setName(name) {\n\t\tthis.name = name;\n\t}", "title": "" }, { "docid": "9ebd2ac79ab11c7d0dc057c5084d19f2", "score": "0.6489472", "text": "constructor(name){\n this.name = name;\n }", "title": "" }, { "docid": "70926a8a292ca723670891159b2e45da", "score": "0.648337", "text": "constructor(name) {\n super(name, true);\n }", "title": "" }, { "docid": "90f2464ac389144ce0a5a86e15d97f25", "score": "0.6480113", "text": "constructor(name){ \r\n\r\n this._name=name; \r\n \r\n }", "title": "" }, { "docid": "61f2cfeb598fd06d413ce4a32820b04c", "score": "0.6465985", "text": "setName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "61f2cfeb598fd06d413ce4a32820b04c", "score": "0.6465985", "text": "setName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "61f2cfeb598fd06d413ce4a32820b04c", "score": "0.6465985", "text": "setName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "61f2cfeb598fd06d413ce4a32820b04c", "score": "0.6465985", "text": "setName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "7707c0ebde0d241c2470ccb273a3fe19", "score": "0.6352198", "text": "setName(nameArg) {\n this.name = nameArg;\n }", "title": "" }, { "docid": "ebaaf39d8b017860a49549579d802e94", "score": "0.6308744", "text": "name(params) {\n \n }", "title": "" }, { "docid": "dee8b9998d3083ace528ea4adb344316", "score": "0.6297654", "text": "get name() {return this._name;}", "title": "" }, { "docid": "6d7e1b30dc725dd6a466f9b8a03aced9", "score": "0.62868893", "text": "get name() { return this._name;}", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.6276111", "text": "get name() { return this._name; }", "title": "" }, { "docid": "36a9b9747970162926132e31f8339865", "score": "0.623416", "text": "setName(name){\n this.name = name;\n }", "title": "" }, { "docid": "d5c34e7fe222e1d06b95cdf2b78769b8", "score": "0.6215538", "text": "set name(name){\n this._name=name;\n }", "title": "" }, { "docid": "fa5f079edb747b1a3da9a18321a59f00", "score": "0.6187254", "text": "set name(name) {\n if (typeof name === 'string') {\n this._name = name\n }\n }", "title": "" }, { "docid": "0bcefe3405822cfb12c14b0fae5dea58", "score": "0.6168009", "text": "get name(){return this._name; }", "title": "" }, { "docid": "28f8877931c952692086ba86e8b1c3fa", "score": "0.61355734", "text": "setName(newName) {\n\t\tthis.name = newName\n\t}", "title": "" }, { "docid": "677aa1a2c8303d3afea21befa44c6e8d", "score": "0.61180395", "text": "constructor(name){\n super(name);\n }", "title": "" }, { "docid": "ac54f9983f241b6f8e17b986e9be05a3", "score": "0.60830826", "text": "function Userr(name) {\n this.name = name;\n}", "title": "" }, { "docid": "88a0d06ee16d6f2af5c08fffb77f6893", "score": "0.60552776", "text": "getName() {}", "title": "" }, { "docid": "88a0d06ee16d6f2af5c08fffb77f6893", "score": "0.60552776", "text": "getName() {}", "title": "" }, { "docid": "1a6d019043739b79f135e5a13b63b0b6", "score": "0.6050006", "text": "function getName() { return name; }", "title": "" }, { "docid": "0e38b826947d091f57d49c735521f2bd", "score": "0.60364205", "text": "setName(name) {\n this.name = name;\n return this;\n }", "title": "" }, { "docid": "35900dde0c8d71ca65dfdc78e104577c", "score": "0.60181516", "text": "get Name() { return this.name }", "title": "" }, { "docid": "522263c0b8136914c670c7d91031e1cf", "score": "0.60153997", "text": "constructor(myName){\n this.name = myName\n }", "title": "" }, { "docid": "c51b125fae8557d371e65d3c4536aa76", "score": "0.60083526", "text": "function getName() {\n return this.name;\n}", "title": "" }, { "docid": "bc9fdb910ccd1f48463c902f40e2f9d8", "score": "0.6007631", "text": "get name() { return this.name_; }", "title": "" }, { "docid": "8a930e945909000a89603fb719d3db49", "score": "0.5998996", "text": "@api get name() {\n return this._name;\n }", "title": "" }, { "docid": "044369a7a528cf60e63cb60521bd85f9", "score": "0.5987064", "text": "name(name) {\n this.assert('.name()', '[string]', arguments);\n if (!name)\n return this.$0;\n this.$0 = name;\n }", "title": "" }, { "docid": "8d12c57a018fe4ce1d1ea748efe11b33", "score": "0.5967859", "text": "constructor(name) { //constructor\n if (name == null){\n this.name = \"default\"\n }\n else {\n this.name = name;\n }\n }", "title": "" }, { "docid": "99c36b388b67123914c7ff33595e4d48", "score": "0.5938503", "text": "['@name']() {\n super['@name']();\n if (this._value.name) return;\n this._value.name = this._pathResolver.filePath;\n }", "title": "" }, { "docid": "124cde9c222a3999cbe1e4cc19fa76a7", "score": "0.59239507", "text": "getName () {\r\n return this.name\r\n }", "title": "" }, { "docid": "370924d13f9f1198e80506ce168ae9c6", "score": "0.59110755", "text": "get name () {\r\n\t\treturn this._name;\r\n\t}", "title": "" }, { "docid": "5d59f63adaff8f290c863ac942e2529d", "score": "0.589782", "text": "['@name']() {\n super['@name']();\n if (this._value.name) return;\n\n this._value.name = this._node.declarations[0].id.name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.5888179", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.5888179", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.5888179", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.5888179", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "98d66acdea1aa122142776f7da4c0aaa", "score": "0.5863146", "text": "set name(value){\n this.#name = value;\n }", "title": "" }, { "docid": "98d66acdea1aa122142776f7da4c0aaa", "score": "0.5863146", "text": "set name(value){\n this.#name = value;\n }", "title": "" }, { "docid": "98d66acdea1aa122142776f7da4c0aaa", "score": "0.5863146", "text": "set name(value){\n this.#name = value;\n }", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.5862183", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "550a2f6f8bebb67f2a60edba1848d461", "score": "0.5843587", "text": "static Describe(name) {\n return (type) => {\n return type;\n };\n }", "title": "" }, { "docid": "626297c50dd76f8e8149d6ca66b577b1", "score": "0.5841451", "text": "function addName(name) {\n return {\n type: 'ADD_NAME',\n name\n }\n}", "title": "" }, { "docid": "2336485090ccf1a9d49077938df169a5", "score": "0.58338785", "text": "get Name() {\n return this._name;\n }", "title": "" }, { "docid": "2924ef29df0ba67cff3403529724ef13", "score": "0.58330476", "text": "static get _name() {\r\n return name;\r\n }", "title": "" }, { "docid": "2924ef29df0ba67cff3403529724ef13", "score": "0.58330476", "text": "static get _name() {\r\n return name;\r\n }", "title": "" }, { "docid": "ae20800ef85916e0d95dfda8bc2d1dd9", "score": "0.58185077", "text": "get name() {\n return this._name\n }", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.5809684", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.5809684", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.5809684", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.5809684", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.5809684", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "05790e2a7af7eb8188ad4ae45519bd40", "score": "0.57958853", "text": "set Name(value) {}", "title": "" }, { "docid": "2590fd9ebaf2d1b89131695f7fc1480b", "score": "0.57911277", "text": "setName(name){\n This.name = name;\n }", "title": "" }, { "docid": "ae024ada45eb1bb529ce4235c84c128f", "score": "0.5790215", "text": "get name(){ return this._name; }", "title": "" }, { "docid": "8795e434c1e6ea2355718e727b07abe9", "score": "0.57881635", "text": "get Name() { return this.internal.Name; }", "title": "" }, { "docid": "40dd43d430e231386060da62e6685ecb", "score": "0.5788069", "text": "static get name() {\n\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.5778703", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.57724303", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "a986c1f014aa674218896628d5136dfd", "score": "0.5768734", "text": "constructor(name, desc, sear) {\n this.name = name;\n this.desc = desc;\n }", "title": "" }, { "docid": "2eb2adf2d0de97e5e677c243a2040e17", "score": "0.5755886", "text": "name() {\n return this.name;\n }", "title": "" }, { "docid": "0af80ecb18cd912f2a3032e10bb5448a", "score": "0.5749147", "text": "getName(): string {\n return this.name;\n }", "title": "" }, { "docid": "eeb32e7d33757125789a90815e53a4e5", "score": "0.57486695", "text": "name():void {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.5716756", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.5716756", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.5716756", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.5716756", "text": "get name() {}", "title": "" } ]
027d52bdd428c8ef91f86d0cbabf45cb
Function to copy click board
[ { "docid": "3009a2a94889d0573ac322cb9a4fa957", "score": "0.0", "text": "function copyToClipboard(elementId) {\n var aux = document.createElement(\"input\");\n aux.setAttribute(\"value\", document.getElementById(elementId).href);\n document.body.appendChild(aux);\n aux.select();\n document.execCommand(\"copy\");\n document.body.removeChild(aux);\n $.notify(\"Download link has been copied to clipboard!\", \"success\",{showDuration: 400});\n} //End function", "title": "" } ]
[ { "docid": "59e6e51daab076f0237bb614b66be864", "score": "0.67959106", "text": "function onClipboardBtnClick() {\n\n}", "title": "" }, { "docid": "ead6f501fb6eb90b1c43f979f86de321", "score": "0.67659384", "text": "function copy_to_clipboard() {\n $(elem_opts.url_pasteboard).get(0).select();\n document.execCommand(\"copy\", false, null); \n }", "title": "" }, { "docid": "f8d0219f5bc29b5576474d1042dc1e0c", "score": "0.6696969", "text": "function copy_board(from,to)\n{ \n for(let x=0;x<9;x++)\n {\n for(let y=0;y<9;y++)\n {\n to[x][y]=from[x][y]\n }\n }\n}", "title": "" }, { "docid": "eca44abe10b476d148af16b5ef263399", "score": "0.6691064", "text": "function copy_board(from,to)\n{\n for(let x=0;x<9;x++)\n {\n for(let y=0;y<9;y++)\n {\n to[x][y]=from[x][y]\n }\n }\n}", "title": "" }, { "docid": "3448d4585c0a6b913420b14c5de7ed1c", "score": "0.66425425", "text": "copyToClipboard(cut) {\n }", "title": "" }, { "docid": "0c4602aa775abae47b6fa775b2210867", "score": "0.66264546", "text": "async function onCopyClick() {\n // if nothing selected return\n if (!selected.includes(true) || loading) {\n return\n }\n // create new clipboard sub directory\n // destination folder based on current project folder and next sub-directory\n const dstFolder = path.join(clipboardDirectory, clipboardNextSub.toString())\n await mkdirAsync(dstFolder)\n const items = []\n\n const copyImages = images.filter((el, i) => selected.get(i))\n\n for (const [i, img] of copyImages.entries()) {\n const srcPath = img.path\n const dstPath = path.join(dstFolder, path.basename(img.path))\n await copyFileAsync(srcPath, dstPath)\n items.push({\n ...img,\n path: dstPath\n })\n }\n // create new clip item\n const clipItem = { time: format(new Date(), 'hh:mm:ss'), items }\n // update state\n setClipboardItems(clipboardItems.push(clipItem))\n setClipboardIndex(clipboardItems.size)\n setClipboardNextSub(clipboardNextSub + 1)\n setMessageTemp(`${items.length} frame(s) copied`)\n onOpenDrawer('clipboard')\n }", "title": "" }, { "docid": "5249442816dccec5267882261d647d56", "score": "0.65681547", "text": "function copyClick(props) {\n props.hideMenu();\n const tableInstance = props.getHotInstance();\n if (tableInstance) {\n const plugin = tableInstance.hotInstance.getPlugin(\"copyPaste\");\n if (plugin) {\n plugin.copy();\n }\n }\n}", "title": "" }, { "docid": "00d535817a195acb495155f0cc8ca7b2", "score": "0.6549767", "text": "ClipboardCopy(IInkStrokes, InkClipboardFormats, InkClipboardModes) {\n\n }", "title": "" }, { "docid": "fe95864fece613ecae90cf62bb4ae346", "score": "0.65274423", "text": "function copyToClipBoard () {\n const quote = qod[0];\n const elem = document.createElement('textarea');\n document.body.appendChild(elem);\n elem.value = quote;\n elem.select();\n document.execCommand(\"copy\");\n document.body.removeChild(elem);\n \n // Displaying how many times you smashed that copy button\n callTimes++;\n console.log(callTimes);\n // ALERT TEXT\n if(callTimes < 2) {\n alert.innerHTML = 'Copied to clipboard!';\n } else {\n alert.innerHTML = `Copied to clipboard ${callTimes} times!`;\n }\n}", "title": "" }, { "docid": "20ee0d9498a4977a13413cb04c3392f3", "score": "0.6400261", "text": "function copyToClipboard() {\n\t\tvar copyText = document.querySelector(\"#blendBlocks\");\n\t\tcopyText.select();\n\t\tdocument.execCommand(\"copy\");\n\t}", "title": "" }, { "docid": "48f2a5daa92d22c2251ba6e963d5827d", "score": "0.6389058", "text": "function copyToClipboard() {\n document.execCommand(\"copy\", false, null);\n }", "title": "" }, { "docid": "eee8b57980a6b802aff5969d97f77b37", "score": "0.6383521", "text": "function copyGameCode() {\n navigator.clipboard.writeText(myGameRoomCode);\n let copyButton = document.getElementById(\"copy-button\");\n copyButton.style.backgroundColor = \"white\";\n copyButton.style.color = \"black\";\n copyButton.style.border = \"2px solid black\";\n copyButton.innerHTML = \"Copied!\";\n}", "title": "" }, { "docid": "0a1a79012344ef0cafb413c15b1ef1f2", "score": "0.63751984", "text": "pasteFromClipboard() {\n }", "title": "" }, { "docid": "177932e61da0ec19cc2084854d31427d", "score": "0.6372909", "text": "function onMouseClick(event) {\n\t\tif (!event.target.closest('.copy')) return;\n\t\tlet target = event.target.closest('#rgb') || event.target.closest('#hex');\n\n\t\tlet temp = document.createElement('textarea');\n\n\t\tdocument.body.append(temp);\n\n\t\tlet value = colorCodeElement[target.getAttribute('id')]\n\t\t\t.reduce((res, current) => res + current.value + \" \", \"\")\n\t\t\t.trim();\n\t\tvalue = (target.getAttribute('id') === 'hex') ?\n\t\t\t`#${value.split(' ').join('')}` :\n\t\t\t`rgb(${value.split(' ').join(', ')})`;\n\n\t\ttemp.value = value;\n\n\t\ttemp.select();\n\t\ttemp.setSelectionRange(0, 99999); /*For mobile devices*/\n\n\t\tdocument.execCommand('copy');\n\t\ttemp.remove();\n\n\t\tcreateNotification(target, 'copied');\n\t}", "title": "" }, { "docid": "ea4c1473f4e48816e9fc7bcee06a2b4c", "score": "0.6363274", "text": "function save_board(){\n var S = \"\";\n for( var i = 0; i < cards.length; ++i ){\n S += lib[cards[i].libID][0] + base64_encode( floor(cards[i].x), 2 ) + base64_encode( floor(cards[i].y), 2 ) + base64_encode( floor(cards[i].w), 2 ) + base64_encode( floor(cards[i].h), 2 );\n if( i < cards.length-1 ) S += \"|\";\n }\n S += \"%\";\n for( var i = 0; i < labels.length; ++i ){\n S += labels[i].label + \"•\" + base64_encode( floor(labels[i].x), 2 ) + base64_encode( floor(labels[i].y), 2 ) + base64_encode( floor(labels[i].w), 2 ) + base64_encode( floor(labels[i].h), 2 );\n if( i < labels.length-1 ) S += \"|\";\n }\n var db = document.getElementById(\"databox\");\n db.value = S;\n db.select();\n db.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n //alert(\"Copied to clipboard\");\n}", "title": "" }, { "docid": "02255288227d138bb18ddc4457511bab", "score": "0.63275856", "text": "function copyToClipBoard(x){\n var copyValue = document.getElementsByClassName('copyValue')[x];\n copyValue.select();\n copyValue.setSelectionRange(0, 99999)\n document.execCommand(\"copy\");\n document.getElementsByClassName('copy-output')[x].innerHTML = \"Copied!\";\n document.getElementsByClassName('copy-button')[x].disabled = true;\n setTimeout(function(){\n document.getElementsByClassName('copy-output')[x].innerHTML = \"\";\n document.getElementsByClassName('copy-button')[x].disabled = false;\n },2000);\n}", "title": "" }, { "docid": "9c053ba28731b5c2257bcce20e5bf08d", "score": "0.62988335", "text": "_onCopyClicked(e) {\n e.preventDefault();\n e.stopPropagation();\n\n this._$input\n .focus()\n .select();\n\n document.execCommand('copy');\n }", "title": "" }, { "docid": "85b4526b80da98c1cca32779fb338051", "score": "0.6278494", "text": "function create_boardCopy(board) {\n let arr = new Array(64);\n for (let i = 0; i < 64; i++) {\n let dot = document.createElement(\"div\");\n if (board[i].className == \"dotp1\") {\n dot.className = \"dotp1\";\n } else if (board[i].className == \"dotp2\") {\n dot.className = \"dotp2\";\n } else if (board[i].className == \"dotplace\") {\n dot.className = \"dotplace\";\n }\n arr[i] = dot;\n }\n return arr;\n}", "title": "" }, { "docid": "afb32677420735878804e3566330a6a5", "score": "0.6229202", "text": "function Copy(_ref3) {\n var lines = _ref3.lines,\n event = _ref3.event,\n options = _ref3.options;\n\n if (options.copy) {\n var copyOptions = assign({}, DEFAULT_OPTIONS$1, isObject(options.copy) ? options.copy : {});\n var buttonClass = PROJECT_CODE_SHORT + \"__copy\";\n var labelClass = PROJECT_CODE_SHORT + \"__button__label\";\n options.tools = copyOptions.position;\n event.on(\"tools:\" + copyOptions.position, function (append) {\n append(\"<button type=\\\"button\\\" class=\\\"rl__button \" + buttonClass + \"\\\" aria-label=\\\"\" + copyOptions.ariaLabel + \"\\\">\");\n append(\"<span class=\\\"\" + labelClass + \" \" + labelClass + \"--inactive\\\">\" + copyOptions.html + \"</span>\");\n append(\"<span class=\\\"\" + labelClass + \" \" + labelClass + \"--active\\\">\" + copyOptions.activeHtml + \"</span>\");\n append(\"</button>\");\n });\n event.on('applied', function (root) {\n var button = query(\".\" + buttonClass, root);\n var code = lines.map(function (line) {\n return line.map(function (token) {\n return token[1];\n }).join('');\n }).join(LINE_BREAK);\n\n if (button) {\n var onClick = function onClick() {\n copy(code, button, copyOptions.duration);\n };\n\n button.addEventListener('click', onClick);\n event.on('destroy', function () {\n button.removeEventListener('click', onClick);\n });\n }\n });\n }\n}", "title": "" }, { "docid": "169b9452035ab3aa2aa3c687b92cc61b", "score": "0.6179827", "text": "function copyBoard({ board }) {\n const newBoard = JSON.parse(JSON.stringify(board)).map((row) => {\n return row.map((sq) => {\n if (sq.color === squareSelected) {\n sq.color = squareColorDarker;\n }\n return sq;\n });\n });\n return newBoard;\n}", "title": "" }, { "docid": "00d0d84da1f8e2f2d8259b6b60d9d93f", "score": "0.6178036", "text": "copyToClipBoard() {\n let input = document.createElement('input');\n input.value = this.displayCalc;\n document.body.appendChild(input);\n input.select();\n document.execCommand(\"Copy\");\n input.remove();\n }", "title": "" }, { "docid": "c930a074929551a5dfe52ba32c029735", "score": "0.6177122", "text": "onCopyClick(){\n this.setState({ copy : true });\n }", "title": "" }, { "docid": "cf81d509968517fd0d92bdd99d25d09f", "score": "0.61646366", "text": "function copyToClipboard() {\n var colors = document.querySelectorAll(\".color\");\n colors.forEach(function (color) {\n color.addEventListener(\"click\", function (event) {\n var selectedColor = event.target.innerText;\n var aux = document.createElement(\"input\");\n aux.setAttribute(\"value\", selectedColor);\n document.body.appendChild(aux);\n aux.select();\n document.execCommand(\"copy\");\n document.body.removeChild(aux);\n document.querySelector(\".toast-text\").textContent =\n selectedColor + \" is copied to your clipboard\";\n var toastTrigger = document.querySelector(\".toast\");\n var toast = new bootstrap.Toast(toastTrigger);\n toast.show();\n });\n });\n}", "title": "" }, { "docid": "ee4d1597ddf021e1e82c40dcea5a5cdf", "score": "0.614858", "text": "function copyLink(element, click) {\r\n\t var $temp = $(\"<input>\");\r\n\t $(\"body\").append($temp);\r\n\t $temp.val($('#'+element).val()).select();\r\n\t document.execCommand(\"copy\");\r\n\t $temp.remove();\r\n\t $('#'+element).val('');\r\n\t $('#'+click).attr('id', 'shrtBtn')\r\n\t .attr('onclick', \r\n\t \t\"request('process.php', 'POST', 'linkInput', 'shrtBtn')\")\r\n\t .html('<i class=\"fas fa-link\"></i> Less');\r\n\t}", "title": "" }, { "docid": "9669fbc2883ffe76e91c5ca0ecea23aa", "score": "0.61470133", "text": "function copyBoards(board) {\r\n let count = 0;\r\n board.forEach((row, i) => {\r\n row.forEach((cell, j) => {\r\n // Copy initial values to checkingBoard\r\n checkingBoard[i][j] = cell;\r\n // Copy Cell inputs to correctly formatted array\r\n cellBoard[i][j] = cells[count];\r\n count++;\r\n });\r\n });\r\n}", "title": "" }, { "docid": "c2a81da3c29e6d731a9f5e42cd3d076d", "score": "0.6144589", "text": "function copyBoard(board) {\n\n let result = []\n\n for (row of board) {\n\n result.push(row.slice())\n\n }\n\n return result;\n\n } // end of copyBoard", "title": "" }, { "docid": "cfdc4f2aa9479e714a4e14bd55ce2134", "score": "0.61051327", "text": "function hoverandcopy(el) {\n el.hover(function () {\n el.addClass(\"hover\");\n }, function () {\n el.removeClass(\"hover\");\n });\n el.click(function (e) {\n var el = $(this);\n e.clipboardData.setData(\"text/plain\", el.text());\n });\n}", "title": "" }, { "docid": "4c92c2a79f7cf257423d99d873ff347c", "score": "0.60693336", "text": "function zeroclipboard() {\n var client = new ZeroClipboard($(\".clipboardbutton\"));\n client.on(\"copy\", function (event) {\n var clipboard = event.clipboardData;\n clipboard.setData(\"text/plain\", $(\".urlinfo\").html());\n });\n}", "title": "" }, { "docid": "b73ff1a730d7862149b9084a8b39af28", "score": "0.604964", "text": "function actionClickBoard(e) {\n const currentClass = state.currentTurn === \"1\" ? \"xCross\" : \"oCircle\";\n const currentTurn = state.currentTurn;\n const newCurrentTurn = state.currentTurn === \"1\" ? \"2\" : \"1\";\n const indexBoardClicked = e.target.dataset.index;\n let valueBoardClicked;\n this.classList.add(currentClass); // set 'X' or 'O'\n this.classList.remove(`${currentClass}-hover`); // remove hover if already selected\n this.style.cursor = \"not-allowed\";\n updateBoardValue(currentTurn, indexBoardClicked);\n valueBoardClicked = state.board[indexBoardClicked];\n if (isWinner(valueBoardClicked)) {\n // check win condition\n updateMessageTurn(`Player 0${currentTurn} Won !!!`);\n showHighLight(state.wonArr, false);\n removeActionListener();\n showOverlay();\n return;\n } else {\n const isTie = state.board.every((el) => el != \"\");\n if (isTie) {\n // if tie\n updateMessageTurn(`It is a Tie !!!`);\n showHighLight(cells, true);\n removeActionListener();\n showOverlay();\n return;\n }\n updateCurrentTurn(newCurrentTurn);\n }\n}", "title": "" }, { "docid": "2e04d0608ccab4f4d436e4a8340b5abb", "score": "0.6044019", "text": "function switchBoardClick(event){ \n setActiveBoard(\"board\" + event.target.id.slice(-1));\n displayBoardName(\"boardName\" + event.target.id.slice(-1));\n}", "title": "" }, { "docid": "c92e66d34a8df57a6f1c462cb51f3c9f", "score": "0.60374314", "text": "function copied() {\n const el = jQuery(\".code-block\");\n el.select();\n document.execCommand('copy');\n}", "title": "" }, { "docid": "c92e66d34a8df57a6f1c462cb51f3c9f", "score": "0.60374314", "text": "function copied() {\n const el = jQuery(\".code-block\");\n el.select();\n document.execCommand('copy');\n}", "title": "" }, { "docid": "ee78880afb8b656082af6f2131257275", "score": "0.60363823", "text": "function copyBoard(board){\n\tlet newBoard = {};\n\tnewBoard[\"white\"] = [];\n\tnewBoard[\"black\"] = [];\n\tfor(let i=0; i<board.white.length; i++){\n\t\tnewBoard[\"white\"].push({\"name\": board.white[i].name, \"x\": board.white[i].x, \"y\": board.white[i].y});\n\t}\n\n\tfor(let i=0; i<board.black.length; i++){\n\t\tnewBoard[\"black\"].push({\"name\": board.black[i].name, \"x\": board.black[i].x, \"y\": board.black[i].y});\n\t}\n\n\tnewBoard.turn = board.turn;\n\treturn newBoard;\n}", "title": "" }, { "docid": "aada6a46a4b8d40d178eaf06e6b1d55a", "score": "0.6035243", "text": "function onClick(event){\n\t// var newRect = canvasRect;\n\t// boardDisplay.onMouseDrag(event, newRect);\n}", "title": "" }, { "docid": "c82f57e11d509f1c2220d7c9ec6f8b06", "score": "0.6017477", "text": "function createBoardCopy(board) {\n var boardCpy = createArray(DIMENSION, DIMENSION);\n for (var i=0; i<DIMENSION; i++) {\n for (var j=0; j<DIMENSION; j++) {\n boardCpy[i][j] = new Cell().initCopy(board[i][j]);\n }\n }\n return boardCpy;\n}", "title": "" }, { "docid": "2ea36d684ed8cbef6ea38d5dff7db658", "score": "0.5992869", "text": "function Copy() {\n \"use strict\";\n\n var btn = document.querySelector(\".js-copy-trigger\");\n var output = document.querySelector(\".js-copy-target\");\n var messageBox = document.querySelector(\".js-copy-message\");\n\n this._copy = function() {\n\n output.focus();\n\n output.select();\n\n document.execCommand(\"Copy\");\n };\n\n this._showMessage = function() {\n messageBox.classList.add(\"is-active\");\n };\n\n this.listen = function() {\n\n btn.addEventListener(\"click\", function() {\n\n this._copy();\n\n this._showMessage();\n\n }.bind(this) );\n };\n}", "title": "" }, { "docid": "6eaec120d4d8b47716b23e780d065853", "score": "0.5975321", "text": "function removeBoardEvent(){\n // get all the elements and set the blank block\n let list = __r.el('.cell');\n\n // iterate over elements and output their HTML content\n for (let i = 0; i < list.length; i++) {\n __r.emove(list[i],'click',pick);\n }\n}", "title": "" }, { "docid": "aabd508cffbe3c314668845b96c17db7", "score": "0.59670156", "text": "function copy_board(board) {\n\tlet new_board = [];\n\tfor (row of board) {\n\t\tlet new_row = [];\n\t\tnew_board.push(new_row);\n\t\tfor (cell of row) {\n\t\t\tif (typeof(cell) == \"number\") {\n\t\t\t\tnew_row.push(cell);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnew_row.push({\n\t\t\t\tteam: cell.team,\n\t\t\t\tdirection: cell.direction,\n\t\t\t\tstate: cell.state,\n\t\t\t\ttype: cell.type\n\t\t\t});\n\t\t}\n\t}\n\treturn new_board;\n}", "title": "" }, { "docid": "7f2fa0511b843ae64b2dd7be996f0b45", "score": "0.59625983", "text": "function btnCopy_OnTouch()\n{\n\tapp.SetClipboardText( capture.GetText() );\n\t\n\tif(usb==null)\n\t app.ShowPopup('Usb not connected');\n\telse\n\t usb.Write(\"move 50 50\");\n\t\n}", "title": "" }, { "docid": "de854d0e640ef7aec8af7a14eed77735", "score": "0.59608066", "text": "function COPY_portapapeles(texto, mensaje, time) {\n canvas = document.getElementById(\"mesge-tooltip\")\n document.getElementById(\"MesageCopy-text\").innerText = mensaje\n canvas.className = \"MesageCopy\"\n\n\tvar copy = function (e) {\n\t e.preventDefault();\n canvas.style.display = \"block\";\n\n setTimeout(function() {\n canvas.className = \"MesageCopy_hide\"\n }, time)\n\n if (e.clipboardData) {\n e.clipboardData.setData('text/plain', texto);\n } else if (window.clipboardData) {\n window.clipboardData.setData('Text', texto);\n }\n }\n window.addEventListener('copy', copy);\n document.execCommand('copy');\n window.removeEventListener('copy', copy);\n}", "title": "" }, { "docid": "95809bdaaa94967b9b5ebe529360739b", "score": "0.5952013", "text": "function selectionBoards(){\n\tfor (c = 0; c < 5; c++){\n\t\tlet $selections = $('<div>'); \n\t\t$selections.addClass('selections');\n\t\t$selections.append(keys[c]);\n\t\t$('#selectionscreen').append($selections);\n\t\t$selections.click(function(){\n\t\t\t// for each of the ojects assign to one selection board\n\t\t\t// append image, on click push to the colorMatrix as an argument\n\t\t\t// **change parameter for color matrix insert it instead of colors.length\n\t\t\tcolorMatrix(keys[c]);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "068faf4b5095a3456112d21613798a65", "score": "0.59372616", "text": "function copyImageToCanvas() {\r\n \r\n }", "title": "" }, { "docid": "8baabf2c03cae5725169c3202356b8f5", "score": "0.59299546", "text": "function cutClick(props) {\n props.hideMenu();\n const tableInstance = props.getHotInstance();\n if (tableInstance) {\n const plugin = tableInstance.hotInstance.getPlugin(\"copyPaste\");\n if (plugin) {\n plugin.cut();\n }\n }\n}", "title": "" }, { "docid": "ef95573cc63cb508837cea42d5f38569", "score": "0.5925017", "text": "function generateBoard() {\n var size = 16;\n\n /*\n * click, mouseout, mouseover -> track mouse\n * contextmenu -> need to return false to disable default right click pop up\n */\n board.addEventListener(\"click\", leftClickSquare); \n board.addEventListener(\"mouseout\", mouseOut); \n board.addEventListener(\"mouseover\", mouseOver);\n board.addEventListener(\"contextmenu\", rightClickSquare); \n \n var i;\n var j;\n for (i = 0; i < size; i++) {\n for (j = 0; j < size; j++) {\n board.innerHTML = board.innerHTML + \n \"<div id=\\\"\" + i + \"-\" + j + \"\\\" class=\\\"squareblank\\\"></div>\";\n }\n }\n}", "title": "" }, { "docid": "f80f55c1cddd157a72d89f5a5f688a7c", "score": "0.5922491", "text": "function clickHandler(element) {\n\tlet copyText = element.toElement.innerHTML;\n\tcopyTextToClipboard(copyText);\n}", "title": "" }, { "docid": "fa1463084efdd012ad302efefa47a925", "score": "0.5922398", "text": "function editOnCopy(e) {\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t // No selection, so there's nothing to copy.\n\t if (selection.isCollapsed()) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t this.setClipboard(getFragmentFromSelection(this.props.editorState));\n\t}", "title": "" }, { "docid": "bcf95e2a565d87fdbfe0317f2c66ff24", "score": "0.5908156", "text": "function copyClicked(p_output_element) {\n\tconst el = document.createElement('textarea');\n\tel.value = p_output_element.innerText;\n\tdocument.body.appendChild(el);\n\tel.select();\n\tdocument.execCommand('copy');\n\tdocument.body.removeChild(el);\n}", "title": "" }, { "docid": "819023ff90315e41dcfd8bc656fee691", "score": "0.5907925", "text": "function copyClipboard(elem){\n\tvar e = elem || $(\"[data-clipboard]\");\n\tZeroClipboard.setDefaults({\n\t\tmoviePath: \"./js/lib/ZeroClipboard.swf\"\n\t});\n\tvar clip = new ZeroClipboard(e);\t\n}", "title": "" }, { "docid": "ccd22ff1459e4aaf029bcbb2f269fe90", "score": "0.590419", "text": "function copyToClipboard (hex) {\n const el = document.createElement('textarea')\n el.value = hex.innerText;\n document.body.appendChild(el)\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el)\n\n //Deal with the pop up once copied, grab the first child (the entire div)\n const popupBox = popup.children[0]\n popup.classList.add('active')\n popupBox.classList.add('active')\n}", "title": "" }, { "docid": "4747be0fd5beedf2dbdf67cf520f9395", "score": "0.59015167", "text": "copyBoard() {\n const boardCopy = [];\n this.current.forEach(rank => {\n //make copy of each rank\n const rankCopy = [];\n rank.forEach(square => {\n // make copy of each square\n const squareCopy = { ...square }\n // make copy of each piece (if there is one)\n let pieceCopy = square.currentPiece ? { ...square.currentPiece } : null;\n squareCopy.currentPiece = pieceCopy;\n rankCopy.push(squareCopy)\n })\n boardCopy.push(rankCopy);\n })\n return boardCopy;\n }", "title": "" }, { "docid": "c58360d0bc8d793a0e46f8123b313fab", "score": "0.590024", "text": "function gameBoardOnClick(e) {\n var cell = getCursorPosition(e);\n for (var i = 0; i < gWhitePieces.length; i++) {\n\t\tif ((gWhitePieces[i].row == cell.row) && \n\t (gWhitePieces[i].column == cell.column)) {\n\t\t\tclickOnPiece(gWhitePieces[i]);\n\t\t\treturn;\n\t\t}\n\tfor (var j=0; j<gBlackPieces.length; j++){\t\n\t\tif ((gBlackPieces[j].row == cell.row) && \n\t (gBlackPieces[j].column == cell.column)) {\n\t\t\tclickOnPiece(gBlackPieces[j]);\n\t\t\treturn;\n\t\t}\n\t}\n }\n clickOnEmptyCell(cell);\n}", "title": "" }, { "docid": "91784c097c5b221597cea06274be9e3e", "score": "0.5898811", "text": "function tabsToBoard() {\n\tvar box = document.getElementById('urls');\n\tvar filter = document.getElementById('filter'); // TODO\n\n\tbox.value = filterURLs().join('\\n');\n\n\tif(document.getElementById('clipboard').checked) {\n\t\t// select text\n\t\tbox.select();\n\t\t// cut it\n\t\tdocument.execCommand('cut');\n\t}\n}", "title": "" }, { "docid": "542fb0ce391a26befda37be72f775e3a", "score": "0.58893734", "text": "copyToClipBoard(code) {\n navigator.clipboard.writeText(code);\n Swal.fire({\n position: \"center\",\n icon: \"success\",\n title: \"Copied\",\n showConfirmButton: false,\n timer: 700\n });\n }", "title": "" }, { "docid": "d3d63967787c66b1e102970eb735e787", "score": "0.5872482", "text": "function boardClick(div){\n\tvar divId = div.id;\n\tvar row = parseInt(divId.split(\":\")[0]);\n\tvar col = parseInt(divId.split(\":\")[1]);\n\tvar el = board.getElement(row,col);\n\tdisplayOptions(el);\n\tdrawTileData(el);\n}", "title": "" }, { "docid": "3c14ea84453ef5d3cfa06b005561f750", "score": "0.58715945", "text": "copyFocusedBlocksToClipboard() {\n // we don't currently allow copying from frozen / fixed constructs since that would allow copy ( and then pasting )\n // of list blocks from temlates.\n let blockIds = [...this.props.focus.blockIds];\n if (blockIds.length && !this.focusedConstruct().isFixed() && !this.focusedConstruct().isFrozen()) {\n if (blockIds.length > 1) {\n blockIds = blockIds.filter((blockId) => {\n const block = this.props.blocks[blockId];\n return block.rules.role !== 'backbone';\n });\n }\n\n // sort selected blocks so they are pasted in the same order as they exist now.\n // NOTE: we don't copy the children of any selected parents since they will\n // be cloned along with their parent\n const sorted = sortBlocksByIndexAndDepthExclude(blockIds);\n // sorted is an array of array, flatten while retaining order\n const currentProjectVersion = this.props.projectGetVersion(this.props.currentProjectId);\n const clones = sorted.map(info => this.props.blockClone(info.blockId, {\n projectId: this.props.currentProjectId,\n version: currentProjectVersion,\n }));\n // put clones on the clipboard\n this.props.clipboardSetData([clipboardFormats.blocks], [clones]);\n }\n }", "title": "" }, { "docid": "6da877228418e742ff9888c2a918692e", "score": "0.58517504", "text": "function cutToClipboard() {\n document.execCommand('cut');\n }", "title": "" }, { "docid": "26e5c9386764b9b00a8cfb74037f1ea5", "score": "0.5851232", "text": "copyMessage(val) {\n this.copy = 'copied!'; // change button text if clicked on it\n this.ifcopy = 'changeBack'; // change background of button if clicked on it\n const selBox = document.createElement('textarea');\n selBox.style.position = 'fixed';\n selBox.style.left = '0';\n selBox.style.top = '0';\n selBox.style.opacity = '0';\n selBox.value = val;\n document.body.appendChild(selBox);\n selBox.focus();\n selBox.select();\n document.execCommand('copy');\n document.body.removeChild(selBox);\n // console.log('done'); // just ensure message\n }", "title": "" }, { "docid": "f749f44e79f9aa9b0401687116343e41", "score": "0.5848184", "text": "function copyAll() {\n alert(\"Not implemented yet!\");\n}", "title": "" }, { "docid": "1426a604b7b8cea922a41331b821d378", "score": "0.5838096", "text": "ClipboardCopyWithRectangle(IInkRectangle, InkClipboardFormats, InkClipboardModes) {\n\n }", "title": "" }, { "docid": "4707eb93ab91e2e3523e938866b68c7b", "score": "0.58321667", "text": "onCopyButtonClick() {\n this._dom.fireEventOn('lh-analytics', this._dom.document(), {\n cmd: 'send',\n fields: {hitType: 'event', eventCategory: 'report', eventAction: 'copy'},\n });\n\n try {\n if (this._dom.document().queryCommandSupported('copy')) {\n this._copyAttempt = true;\n\n // Note: In Safari 10.0.1, execCommand('copy') returns true if there's\n // a valid text selection on the page. See http://caniuse.com/#feat=clipboard.\n if (!this._dom.document().execCommand('copy')) {\n this._copyAttempt = false; // Prevent event handler from seeing this as a copy attempt.\n\n this._dom.fireEventOn('lh-log', this._dom.document(), {\n cmd: 'warn', msg: 'Your browser does not support copy to clipboard.',\n });\n }\n }\n } catch (e) {\n this._copyAttempt = false;\n this._dom.fireEventOn('lh-log', this._dom.document(), {cmd: 'log', msg: e.message});\n }\n }", "title": "" }, { "docid": "6aaf07c027838b0d5393230b054134b2", "score": "0.5822747", "text": "function detectBoardShiftClick(event) {\r\n if (event.shiftKey) {\r\n let elemLeft = canvas.offsetLeft,\r\n elemTop = canvas.offsetTop,\r\n x = event.pageX - elemLeft,\r\n y = event.pageY - elemTop;\r\n board.flag(x, y);\r\n }\r\n}", "title": "" }, { "docid": "0134ddae152164814f1372b2502aa2f6", "score": "0.58204865", "text": "function copyToClipboard(e) {\n navigator.clipboard.writeText(\n user ? `http://bs-frontend.herokuapp.com/public/${clickedPortfolio.id}/0` : ''\n )\n\n enqueueSnackbar(intl.formatMessage({ id: 'copiedURLToClipboard' }), {\n variant: 'info'\n })\n\n setOpen(false)\n }", "title": "" }, { "docid": "bd1a29d978a831477744fcdbbc4b7d77", "score": "0.5811482", "text": "function copyCodePanel(id) {\n var temp = document.getElementById(id);\n temp.select();\n document.execCommand('copy');\n clearSelection();\n}", "title": "" }, { "docid": "0da71ba7c1eec2ea190871b3da130c7b", "score": "0.58067703", "text": "function copyToClipBoard() {\n var copy = document.getElementById(\"pass\");\n copy.select();\n document.execCommand(\"copy\");\n alert(\"Here's the text you copied\" + copy.value);\n}", "title": "" }, { "docid": "bf93386db72c0ae2ff7deb7e77642d28", "score": "0.5786354", "text": "function handleBoardClick(e) {\n const idx = parseInt(e.target.id.slice(4));\n if (e.target.textContent) return;\n e.target.textContent = playerLookup[turn]\n board[idx] = turn;\n turn *= -1;\n render();\n }", "title": "" }, { "docid": "17f21bed2e88e296aa93910740929bb3", "score": "0.57508904", "text": "function ctcForm_cbCopy_OnClick(Sender)\r\n{\r\n\tSys.Clipboard = UserForms.ctcForm.cmScriptText.Lines.Text;\r\n}", "title": "" }, { "docid": "1f522f81b122235120f03a1651af7122", "score": "0.57290494", "text": "function newBoard() {\n \t// console.log(\"here\");\n \tvar output = '', j;\n \ttile_flipped = 0;\n\n \tdocument.getElementById(\"Verify_Test\").disabled = true;\n \t// document.getElementById(\"submit_db\").disabled = true;\n\n \tfor(var i=0; i<grid_size; i++) {\n // NOTE: do not flip here\n \toutput += '<div id=\"tile_'+i+'\" class=\"tile\"></div>';\n \t}\n \tdocument.getElementById('board').innerHTML = output;\n // document.getElementById (\"tile_1\").addEventListener(\"click\", flip(this), false);\n }", "title": "" }, { "docid": "a74e5cd6a47a21363f45fbb1941fa334", "score": "0.5727947", "text": "function copyToClipboard(text) {\n // Add an element to the dom, make it editable so we can select it.\n var copyDiv = document.createElement('div');\n copyDiv.contentEditable = true;\n document.body.appendChild(copyDiv);\n // Set the new element's text to the text we want to copy.\n copyDiv.innerHTML = text;\n copyDiv.unselectable = \"off\";\n // Focus on the element and use the execCommands to select and copy.\n copyDiv.focus();\n document.execCommand('SelectAll');\n document.execCommand(\"Copy\", false, null);\n // Remove the element from the dom now that we have the text copied.\n document.body.removeChild(copyDiv);\n // alert('Copied!');\n }", "title": "" }, { "docid": "5d689cee70b7d65944e25b3f202ad1e5", "score": "0.5726676", "text": "function menuMoveOrCopyAction() {\n var cmd,\n grid = null,\n row = null,\n column = null,\n selection$ = glv$.gridlayout( \"getSelection\" );\n\n if ( selection$.length !== 1 ) {\n return;\n }\n\n if ( this.col >= 0 ) {\n grid = 0; // todo handle case where there are multiple grids\n row = this.row;\n column = this.col;\n }\n if ( this.copy ) {\n cmd = makeGridCopyCommand( glv$, null, selection$, this.container, grid, row, column, this.index, this.alignment );\n } else {\n // move\n cmd = makeGridMoveCommand( glv$, null, selection$, this.container, grid, row, column, this.index, this.alignment );\n }\n apex.commandHistory.execute(cmd);\n }", "title": "" }, { "docid": "e226d19e0e8d4794d99c606d0a6f893b", "score": "0.5708154", "text": "function copyToClipboard() {\n\n //Create a textarea in which the text will be put then copied to the system clipboard\n let textArea = document.createElement('textarea');\n\n //Create an empty array where the wey points to be copied will be put\n let path = \"\";\n\n //Loop through all the way points\n for (let point of wayPoints) {\n\n //Add each point to the path string\n path += \"[\" + point.x + \", \" + point.y + \"], \";\n }\n\n\n if (path.length > 0) {\n //If the path has points remove the extra comma and space from the last point\n path = path.trim().substring(0, path.length - 2);\n }\n\n //Add the extra brackets to make the way points into a yaml array\n path = \"[\" + path + \"]\";\n\n //Make the textarea read only to prevent the user from editing the array on accident\n textArea.setAttribute('readonly', '');\n\n //Set the value of the textarea to the yaml way point array\n textArea.value = path;\n\n //Set the textarea display to none so when it is added to the html page it will not be dipslayed\n textArea.display = 'none';\n\n //Add the textarea to the html page\n document.body.appendChild(textArea);\n\n //Select all the text in the textarea automatically\n textArea.select();\n\n //Execute the copy command copying the entire array onto the clipboard\n document.execCommand('copy');\n\n //Remove the textarea from the document now that the copy is complete\n document.body.removeChild(textArea);\n}", "title": "" }, { "docid": "ea799ee2ac9f03761177023702b82b56", "score": "0.5692835", "text": "function detectBoardLeftClick(event) {\r\n if (event.shiftKey) {\r\n return;\r\n }\r\n\r\n let elemLeft = canvas.offsetLeft,\r\n elemTop = canvas.offsetTop,\r\n x = event.pageX - elemLeft,\r\n y = event.pageY - elemTop;\r\n board.select(x, y);\r\n}", "title": "" }, { "docid": "ee14e8e7f41f6fac004c073f3ab415bf", "score": "0.56911224", "text": "function copyIcon() {\n let copyText = document.querySelector(\"#password\");\n copyText.select();\n copyText.setSelectionRange(0, 99999); \n document.execCommand(\"copy\");\n}", "title": "" }, { "docid": "dfb87964cc788032434792a2c9385a72", "score": "0.56893706", "text": "onCopyButtonClick() {\n this._fireEventOn('lh-analytics', this._document, {\n cmd: 'send',\n fields: {hitType: 'event', eventCategory: 'report', eventAction: 'copy'},\n });\n\n try {\n if (this._document.queryCommandSupported('copy')) {\n this._copyAttempt = true;\n\n // Note: In Safari 10.0.1, execCommand('copy') returns true if there's\n // a valid text selection on the page. See http://caniuse.com/#feat=clipboard.\n if (!this._document.execCommand('copy')) {\n this._copyAttempt = false; // Prevent event handler from seeing this as a copy attempt.\n\n this._fireEventOn('lh-log', this._document, {\n cmd: 'warn', msg: 'Your browser does not support copy to clipboard.',\n });\n }\n }\n } catch (/** @type {Error} */ e) {\n this._copyAttempt = false;\n this._fireEventOn('lh-log', this._document, {cmd: 'log', msg: e.message});\n }\n }", "title": "" }, { "docid": "8e6b41f93752eb465c42b9987e6b5af5", "score": "0.5675475", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection(); // No selection, so there's nothing to copy.\n\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "c35d4aad10465deff9dc985c33f69ecf", "score": "0.5675409", "text": "function link() {\n let copy = document.createElement(\"input\");\n copy.setAttribute(\"Value\", document.getElementById(\"copy\").innerHTML);\n document.body.appendChild(copy);\n copy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(copy);\n\n $(\".facebook\").toggleClass(\"show\");\n $(\".twitter\").toggleClass(\"show\");\n $(\".link\").toggleClass(\"show\");\n $(\"#arrow\").toggleClass(\"show\");\n $(\"#arrow_2\").toggleClass(\"show\");\n $(\".small_lines\").toggleClass(\"show\");\n $(\"#cross\").toggleClass(\"show\");\n $(\"#cross_2\").toggleClass(\"show\");\n $(\"#vertical_line\").toggleClass(\"show\");\n $(\"#horizontal_line\").toggleClass(\"show\");\n $(\".hover_text_link.show\").removeClass(\"plus\");\n\n $(\".plink\").toggleClass(\"show\");\n $(\".ptwitter\").toggleClass(\"show\");\n $(\".pfb\").toggleClass(\"show\");\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "dd2612f429db71642fa98a4541bfc613", "score": "0.5663189", "text": "function editOnCopy(editor, e) {\n var editorState = editor._latestEditorState;\n var selection = editorState.getSelection();\n\n // No selection, so there's nothing to copy.\n if (selection.isCollapsed()) {\n e.preventDefault();\n return;\n }\n\n editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}", "title": "" }, { "docid": "f5ea6a202193243b61033c90df23702b", "score": "0.565514", "text": "function copyToClipboard(id){\n var input = document.getElementById(id);\n input.select();\n input.setSelectionRange(0, 99999); /*For mobile devices*/\n document.execCommand(\"copy\");\n}", "title": "" }, { "docid": "4e2c59418816b466f26a43c941ae66ef", "score": "0.56490403", "text": "function copy() {\n let textarea = document.createElement('textarea');\n textarea.id = 'temp_element';\n textarea.style.height = 0;\n document.body.appendChild(textarea);\n textarea.value = document.getElementById('src').innerText;\n let selector = document.querySelector('#temp_element');\n selector.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n}", "title": "" }, { "docid": "d6cb9fc7971579b1387de98b1ff938b0", "score": "0.56475055", "text": "function makeBoard() {\n var html = '';\n var counter = 0;\n for (var i = 0; i < 4; i++) {\n html += '<tr>';\n for (var j = 0; j < 4; j++) {\n html += '<td onclick=\"checkboard(' + counter + ')\"></td>';\n counter++;\n }\n html += '</tr>';\n }\n $('#board').html(html);\n loadColors();\n}", "title": "" }, { "docid": "0883dfdb24e161c2b427de7e6c350d82", "score": "0.56437564", "text": "function copyBoard(boardID, sheetName) {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName(sheetName);\n var numColumns= sheet.getLastColumn();\n var headerRange = sheet.getRange(1, 1, 1, numColumns).getValues();\n \n var query = \"query{boards (ids: \" + boardID + \") {items { name column_values { title value } } } }\";\n var data = JSON.parse(makeAPICall(mondayAPIkey, query, {}));\n var mondayData = data.data.boards[0].items;\n sheet.getRange(2, 1, sheet.getLastRow(), sheet.getLastColumn()).clearContent();\n var newData = [];\n for (var i = 0; i < mondayData.length; i++) {\n newData.push(newRow(sheetName, mondayData[i], i));\n }\n sheet.getRange(2, 1, newData.length, newData[0].length).setValues(newData);\n}", "title": "" }, { "docid": "e21cdd4ad40039d544c5771f94e301c5", "score": "0.564189", "text": "makeHtmlBoard() {\n const board = document.getElementById('board');\n board.innerHTML = '';\n // make column tops (clickable area for adding a piece to that column)\n const top = document.createElement('tr');\n top.setAttribute('id', 'column-top');\n \n this.handleGameClick = this.handleClick.bind(this);\n top.addEventListener('click', this.handleGameClick);\n\n for (let x = 0; x < this.width; x++) {\n const headCell = document.createElement('td');\n headCell.setAttribute('id', x);\n const previewPiece = document.createElement('div');\n previewPiece.id = \"previewPiece\";\n headCell.append(previewPiece);\n top.append(headCell);\n }\n board.append(top);\n\n\n this.makeMainBoard();\n }", "title": "" }, { "docid": "fab0fe565c5f3b1903962fd595b2c2e2", "score": "0.5639036", "text": "function addCopyListener(){\n $(\"#copy_style\").click(function(){\n var string = $(\"#boxClassBody\").html();\n string = string.replace(/<br>/g,\"\\n\");\n signalCopy(string);\n });\n}", "title": "" }, { "docid": "9edbb25ebc2e338830b40fc9dfc70ac4", "score": "0.56346965", "text": "async function onCutClick() {\n if (!selected.includes(true) || loading) {\n return\n }\n\n const items = []\n\n async function update() {\n return new Promise(async resolve => {\n const keepImages = images.filter((el, i) => !selected.get(i))\n const cutImages = images.filter((el, i) => selected.get(i))\n\n const dstFolder = path.join(clipboardDirectory, clipboardNextSub.toString())\n await mkdirAsync(dstFolder)\n\n for (const [i, img] of cutImages.entries()) {\n const srcPath = img.path\n const dstPath = path.join(dstFolder, path.basename(img.path))\n await copyFileAsync(srcPath, dstPath)\n items.push({\n ...img,\n path: dstPath\n })\n }\n\n const clipItem = { time: format(new Date(), 'hh:mm:ss'), items }\n setClipboardItems(clipboardItems.push(clipItem))\n setClipboardIndex(clipboardItems.size)\n setClipboardNextSub(clipboardNextSub + 1)\n\n const newProject = { ...gifData, frames: keepImages }\n await writeFileAsync(projectJsonPath, JSON.stringify(newProject))\n resolve()\n })\n }\n\n setLoading(true)\n await update()\n setLoading(false)\n initialize(imageIndex)\n setMessageTemp(`${items.length} frame(s) cut`)\n onOpenDrawer('clipboard')\n }", "title": "" }, { "docid": "589ed22d0144d961a58d266dcf064562", "score": "0.56336653", "text": "function onCopy(event){\n event.preventDefault();\n console.log('copyButton pressed')\n inputTextArea.value = outputTextArea.value;\n sendData(event)\n}", "title": "" }, { "docid": "1f4d4a00d1482dd4e32017e0073035fe", "score": "0.5627868", "text": "function bindCopyToClipboard() {\n\n $(\"i.fa-copy\").click(function () {\n\n var input = $(this).prev();\n var input_text = input.val();\n input.select();\n document.execCommand(\"copy\");\n input.val(\"Copied to clipboard!\").css(\"color\", \"#b33913\");\n\n setTimeout(function () {\n input.val(input_text).css(\"color\", \"#000\").trigger(\"input\");\n }, 700);\n });\n\n}", "title": "" }, { "docid": "4dd075cc4534c15baea2479bb7f9752b", "score": "0.5626545", "text": "function copydrop(ev) {\n ev.preventDefault();\n var data=ev.dataTransfer.getData(\"text\");\n var nodeCopy = document.getElementById(data).cloneNode(true);\n nodeCopy.id = data +\"clone\";\n ev.target.appendChild(nodeCopy);\n}", "title": "" }, { "docid": "f25b11b18c3ac38ffdf9aa50d0fa537f", "score": "0.5616661", "text": "function copyUrlToClipboard() {\n const el = document.getElementById('copiedUrl');\n el.select();\n document.execCommand('copy');\n el.setSelectionRange(0, 0);\n el.blur();\n alert('Copied url to clipboard!');\n }", "title": "" }, { "docid": "88c901db0ffe2bb8b21ec14421f6a4d1", "score": "0.56130916", "text": "function frameElementButton(){\n\t// Guarda en la variable el elemento relacionado del boton seleccionado\n\tvar elementAryta = identificationOfTheElement($(this), \"clone\");\n\n\tborderElement($(elementAryta));\n}", "title": "" }, { "docid": "7bd1858fbbc2aec8f852675527767d0c", "score": "0.56103486", "text": "function createDrawBoard() {\n\n }", "title": "" }, { "docid": "78c3bf14ab9a84ea6bc9f345838f4d1e", "score": "0.5608879", "text": "function copyToClipboard(array, delimiter, data_name, powertip_object=false) {\n var link = array;\n// console.log(link);\n var out = \"\";\n link.each(function() {\n var ele = $(this).attr(\"href\").split(\"/\");\n out+=ele[ele.length-1]+delimiter;\n });\n if (out.length===0) {\n window.alert(\"No entries selected for copying\");\n return 0;\n }\n var textArea = document.createElement(\"textarea\");\n textArea.value = out;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n try {\n var successful = document.execCommand(\"copy\");\n var msg = successful ? \"Successful\" : \"Unsuccessful\";\n if (powertip_object!==false) {\n $.powerTip.hide();\n powertip_object.data(\"powertipjq\", $([\n \"<p>\"+array.length+\" ID's copied to clipboard!</p>\"\n ].join(\"\\n\")));\n powertip_object.powerTip(\"show\");\n setTimeout(function() {\n powertip_object.data(\"powertipjq\", $([\n \"<p>Export \"+data_name+\"</p>\"\n ].join(\"\\n\")));\n },1000);\n }\n } catch (err) {\n window.alert(\"Oops, unable to copy\");\n }\n document.body.removeChild(textArea);\n }", "title": "" }, { "docid": "3cee6b0bad8ff4627052138267cda342", "score": "0.560785", "text": "function copybutton() {\n /* Get the text field */\n var copyText = document.getElementById(\"ref_code\");\n /* Select the text field */\n copyText.select();\n copyText.setSelectionRange(0, 99999); /*For mobile devices*/\n /* Copy the text inside the text field */\n document.execCommand(\"copy\");\n}", "title": "" }, { "docid": "111577897427a85a60f2515dc88c68d1", "score": "0.56071115", "text": "function addClickdetectPad() {\n var temp;\n var temp2;\n for (var i = 0; i < argsObject.coordCenterSquare.length; i++) { // loop once for each game board square.\n temp = i;\n temp2 = argsObject.paper.rect(argsObject.coordCenterSquare[i][0] - 50, argsObject.coordCenterSquare[i][1] - 50, 120, 120).attr({\n 'stroke': '#ffa500',\n 'fill': '#ffa500'\n });\n temp2.node.setAttribute('class', 'clickPad'); // add class \"clickPad\" to each.\n temp2.node.setAttribute('id', temp); // add an id to each.\n }\n }", "title": "" }, { "docid": "1b237e61c5cdf821f014e756139ea0cb", "score": "0.5605632", "text": "function makeHtmlBoard() {\n\n const htmlBoard = document.querySelector(\"#board\");\n\n // Create the row above the board where player selects which column to place piece in\n // create row as tr element, Add event listener to entire row\n const top = document.createElement(\"tr\");\n top.setAttribute(\"id\", \"column-top\");\n // top.addEventListener(\"click\", handleClick);\n\n // create cell for each row as td element, add each cell to row\n // once every cell is added, add row to the dom as a child of the board\n for (let x = 0; x < WIDTH; x++) {\n const headCell = document.createElement(\"td\");\n headCell.setAttribute(\"id\", x);\n top.append(headCell);\n }\n htmlBoard.append(top);\n\n // Create the actual board, by looping through and creating \n // each row as tr, then looping through each tr and adding \n // each cell as td, assigning a standardized id to reference\n // adding each tr to the board div as completed\n for (let y = 0; y < HEIGHT; y++) {\n const row = document.createElement(\"tr\");\n for (let x = 0; x < WIDTH; x++) {\n const cell = document.createElement(\"td\");\n cell.setAttribute(\"id\", `${y}-${x}`);\n row.append(cell);\n }\n htmlBoard.append(row);\n }\n}", "title": "" }, { "docid": "7dd131aabaa099298d5f7e8c459be21e", "score": "0.56046605", "text": "function connectionsClick(e) {\n var x = e.clientX-canvas.offsetLeft;\n\tvar y = e.clientY-canvas.offsetTop + document.body.scrollTop + document.documentElement.scrollTop;\n\tconsole.log(\"x, y: \", x, y);\n\t//Now we need to convert x and y into board coordinates\n\tif (x >= 0){\n\t\tx = parseInt(x / canvasWidth * divFactor);\n\t\t}\n\telse{x = -1;}\n\tif (y >= 0){\n\t\ty = parseInt(y / canvasHeight * divFactor);\n\t\t}\n\telse{y = -1;}\n\tconsole.log(\"Converted x, y: \", x, y);\n\tif (x > 0 && y > 0 && x < divFactor - 1 && y < divFactor - 1) {\n\t\tboardString = changeBoard(boardString, x, y);\n\t\tdrawBoard(boardSize, boardString);\n\t\t}\n}", "title": "" } ]
6cee421645e13c915dbc162706d95613
function to update the progress bar
[ { "docid": "7dbd8a280cfdb5ea02874c0e93baed6b", "score": "0.0", "text": "function updateAnswerIndicator(markType) {\n answersIndicatorContainer.children[questionCounter - 1].classList.add(markType);\n}", "title": "" } ]
[ { "docid": "db9e4abf2cb401c61aea20a82bea0d67", "score": "0.8518175", "text": "function updateProgressBar() {\n if (progress < 100) {\n progress = progress += updateVal; //13 calls\n $rootScope.$broadcast('loading-bar-updated', progress, map);\n }\n }", "title": "" }, { "docid": "24f029f0cfe10e491e0136604b3afb2f", "score": "0.8499392", "text": "function updateProgress() {\n\n // Update progress if enabled\n if( config.progress && dom.progressbar ) {\n\n dom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n }\n }", "title": "" }, { "docid": "3480e91d9b148c0bea11d48e1b49d76c", "score": "0.84920067", "text": "#updateProgress() {\n const prog = parseFloat(this.progress) || DEFAULT_PROGRESS;\n const tot = parseFloat(this.total) || DEFAULT_TOTAL;\n // make sure that prog / tot doesn't exceed 1 -- will happen if prog > tot\n const percentage = Math.floor((prog / tot > 1 ? 1 : prog / tot) * 100);\n this.percentage = percentage;\n this.container.querySelector('.bar-progress').style.width = `${percentage}%`;\n }", "title": "" }, { "docid": "c2a7897ecde48899b9a441245bcfda90", "score": "0.84651005", "text": "function updateProgress() {\n\n\t\t// Update progress if enabled\n\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "c2a7897ecde48899b9a441245bcfda90", "score": "0.84651005", "text": "function updateProgress() {\n\n\t\t// Update progress if enabled\n\t\tif( config.progress && dom.progressbar ) {\n\n\t\t\tdom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "157a7d1744264ae4476b049b53fbd596", "score": "0.8436805", "text": "function updateProgressBar(){\n\t\tif(progress < 100){\n\t\t\tprogress = progress + 5.9; //17 calls\n \t\t$rootScope.$broadcast('loading-bar-updated', progress, map);\n\t\t}\n }", "title": "" }, { "docid": "0db61a764679034b5ed4ac5369b8a55e", "score": "0.8398725", "text": "function updateProgressBar() {\n\t$('#szliderbar').css('width', pbValue+'%');\n\tpbValue++;\n\tif (pbValue > 100) pbValue = 0;\n}", "title": "" }, { "docid": "be0ea06529b8302b30866e456a79e09b", "score": "0.837636", "text": "function updateProgressbar(){\n\t\tvar percentage = 100*ytplayer.getCurrentTime()/ytplayer.getDuration();\n\t\t$(\"#progressbar_filler\").css(\"width\", percentage+\"%\");\n\t}", "title": "" }, { "docid": "2557cfa30c3608e6192e3100fbda42a8", "score": "0.83086795", "text": "function updateProgressbar() {\n var percentage = 100 * ytplayer.getCurrentTime() / ytplayer.getDuration();\n $('#progressbar_filler').css('width', percentage + '%');\n }", "title": "" }, { "docid": "08802dbbcea3a498f5a289c05b3a35da", "score": "0.8127832", "text": "function ProgressUpdate() {\n\tvar n = (_progressWidth / _progressEnd) * _progressAt;\n\tif (document.all) {\t// Internet Explorer\n\t\tvar bar = dialog.bar;\n \t} else if (document.layers) {\t// Netscape\n\t\tvar bar = document.layers[\"progress\"].document.forms[\"dialog\"].bar;\n\t\tn = n * 0.55;\t// characters are larger\n\t} else if (document.getElementById){\n var bar=document.getElementById(\"bar\")\n }\n\tvar temp = _progressBar.substring(0, n);\n\tbar.value = temp;\n}", "title": "" }, { "docid": "28ebdeb5c6bfd55c17230677b91fff57", "score": "0.81167847", "text": "function updateProgressBar() {\n percentageViewed = 100 * ((productsLoaded + pagStepSize)/collectionTotalProducts);\n pagProgress.css('width', percentageViewed + '%');\n }", "title": "" }, { "docid": "95a0da06f0960246424ac468a4eef410", "score": "0.81151265", "text": "function updateProgress()\n {\n if (queueLength === 0)\n {\n progress = 0;\n }\n else\n {\n progress = Math.ceil(((queuePosition + 1) / queueLength) * 100);\n }\n }", "title": "" }, { "docid": "06e2311f9b560f9a1fe304b0ba43a84b", "score": "0.8060459", "text": "function updateProgressbar() {\n let percent = calcPercent();\n document.getElementById('progress-bar').style = `width:${percent}%`;\n document.getElementById('progress-bar').innerHTML = `${percent}%`;\n}", "title": "" }, { "docid": "98e8fda8ff943b791b4305e6e4e34095", "score": "0.80082774", "text": "function ProgressUpdate() {\n\t//alert('in ProgressUpdate');\n\tvar n = (_progressWidth / _progressEnd) * _progressAt;\n\tif (document.all) {\t// Internet Explorer\n\t\tvar bar = dialog.bar;\n \t} else if (document.layers) {\t// Netscape\n\t\tvar bar = document.layers[\"progress\"].document.forms[\"dialog\"].bar;\n\t\tn = n * 0.55;\t// characters are larger\n\t} else if (document.getElementById){\n var bar=document.dialog.bar\n }\n\tvar temp = _progressBar.substring(0, n);\n\tbar.value = temp;\n}", "title": "" }, { "docid": "ce5c162e963b5e8da94d0ae6eaa20d54", "score": "0.7995635", "text": "function progressUpdate()\n\t{\n\t\t//the percentage loaded based on the tween's progress\n\t\tloadingProgress = Math.round(progressTl.progress() * 100);\n\t\t//we put the percentage in the screen\n\t\t$(\".txt-perc\").text(loadingProgress + '%');\n\n\t}", "title": "" }, { "docid": "1975d64adceaf7dc5eefeb1bd799fcb1", "score": "0.7989765", "text": "function update_progress_bar(pb_id, progress)\n{\n $(\"#pb_\" + pb_id).stop().css(\"width\", $(\"#pb_\" + pb_id).width()).animate(\n {\n width: (progress * 100) + '%',\n easing: 'linear'\n },\n {\n duration: progress_bar_animation_duration,\n start: function(promise)\n {\n // Set text\n if (progress * $(\"#pb_\" + pb_id + \"_container\").width() != 0)\n {\n $(this).text(Math.round(progress * 100) + '%');\n }\n }\n });\n}", "title": "" }, { "docid": "96daaf752bd70029199eef28b42dcaa5", "score": "0.7972931", "text": "function onProgressUpdate() {}", "title": "" }, { "docid": "4f416686f37d61d34d04f321f83858b0", "score": "0.7965746", "text": "_updateProgressBarValue() {\n const percent = this.progressNow * 100 / this.progressTotal;\n this.progressBar.setValue(percent);\n\n const indicator =\n this.shadowRoot.querySelector('#progress-bar-indicator');\n const roundToTwoDecimal = (x) => parseFloat(x.toFixed(2));\n\n indicator.innerText =\n `${percent.toFixed(1)}% (${roundToTwoDecimal(this.progressNow)}/${\n roundToTwoDecimal(this.progressTotal)})`;\n }", "title": "" }, { "docid": "9ba694ea3fd6fe6f47981a695d2691b3", "score": "0.7930496", "text": "function updateProgressBar(time) {\n $pBar.attr('value', time);\n }", "title": "" }, { "docid": "e505ba1dca33f4691205e900077191c6", "score": "0.79286057", "text": "function updateProgress (counter, total) {\n\tpercentage = Math.round(counter * 100 / total);\n\t$(\".progress-bar\").css(\"width\", percentage + \"%\");\n}", "title": "" }, { "docid": "64881a25000c58e6907e00e8c519adeb", "score": "0.79266876", "text": "function updateProgressBar(){\n ctrl.currentDuration = audioStream.currentTime;\n progress.style.width = ( progressBar.offsetWidth / audioStream.duration * audioStream.currentTime ) + 'px'\n }", "title": "" }, { "docid": "f67129760bb799276b85f8bad804372d", "score": "0.7918642", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "d7c6ee82ea8d45f58eab7bff43a71bea", "score": "0.7908522", "text": "function progress(update) {\n handleProgress(update);\n }", "title": "" }, { "docid": "2a86aef5ece79d272fcbab3e4bf068c6", "score": "0.7841008", "text": "function updateProgress(perc) {\n progress.style.width = perc + '%';\n}", "title": "" }, { "docid": "bac90c158fee8ddcbd6415f394414c6c", "score": "0.77951634", "text": "function updateProgressBar() {\n var progressBar = $(\"#progress-bar\");\n var parentWidth = +$(\".progress\").width();\n var newWidth = Math.min(+progressBar.width() + Math.ceil(parentWidth / totalFiles), parentWidth);\n var percentage = newWidth / parentWidth * 100;\n\n progressBar.width(newWidth);\n progressBar.attr(\"aria-valuenow\", percentage);\n $(\"#progress-bar-span\").html(percentage + \"% Complete\");\n if (newWidth == parentWidth)\n progressBar.removeClass(\"active\");\n}", "title": "" }, { "docid": "8706d800e4f2fb56c2a6a555425cf180", "score": "0.77935505", "text": "function updateProgressIndicator(progress) {\n // Update/animate progress bar\n $('#generator-progress-value').animate({value: progress}, 800);\n //$('.ccg-progress-indicator').animate({width: progress * 100 + '%'});\n // Update progress width for older browsers\n $('.ccg-generator-progress-wrap .progress-bar > span').animate({width: progress * 100 + '%'}, 800);\n // Update/animate number display(s)\n $('.generator-progress-value-print').each(function (index, element) {\n $({countNum: $(element).text()}).animate({countNum: Math.floor(progress * 100)}, {\n duration: 800,\n easing: 'linear',\n step: function () {\n $(element).text(Math.floor(this.countNum));\n },\n complete: function () {\n $(element).text(this.countNum);\n }\n });\n });\n}", "title": "" }, { "docid": "eebc1ee527989c336141e3bd01b01536", "score": "0.77722436", "text": "function updateProgressBar() {\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "883be3fe24cc9d3e931e195e6d652413", "score": "0.77677053", "text": "function updateProgressBar(){\n var el = document.querySelector('progress');\n el.value++;\n}", "title": "" }, { "docid": "51bf8f7c6ba072b5d067b884e40a9c10", "score": "0.7764376", "text": "function changeProgressBar(val) {\n progressBar += val;\n $(\".quote-quote-progress .prog-bar\").css('width', `${progressBar}%`);\n }", "title": "" }, { "docid": "a97cbc853195bffcb6d7a8fd5a9e7e05", "score": "0.7762003", "text": "_updateProgressBar(loadingPercentage) {\n loadingPercentage = parseInt(((this.nbLoadedFiles - this.oldNbLoadedFiles) * 100) / this.nbFileToLoad, 10) + \"%\"\n $(\"#currProgress\")[0].style.width = loadingPercentage\n $(\"#progressValue\").text(loadingPercentage)\n }", "title": "" }, { "docid": "95ec892be8dee8795cca1c77688bba19", "score": "0.7725055", "text": "function wpvq_update_progress()\n\t\t{\n\t\t\t// Percentage for computing\n\t\t\tvar wpvq_percent_progress = parseInt( ( wpvq_currentPage * 100 ) / wpvq_totalPages );\n\t\t\t\n\t\t\t// Public content\n\t\t\tvar content;\n\t\t\tif (wpvq_progressbar_content == 'none') {\n\t\t\t\tcontent = '';\n\t\t\t} else if (wpvq_progressbar_content == 'percentage') {\n\t\t\t\tcontent = wpvq_percent_progress + '%';\n\t\t\t} else /*if (wpvq_progressbar_content == 'page')*/ {\n\t\t\t\tcontent = parseInt(wpvq_currentPage) + ' / ' + wpvq_totalPages;\n\t\t\t}\n\t\t\t\n\t\t\t// Display\n\t\t\tif (wpvq_percent_progress == 0) {\n\t\t\t\t$('.wpvq-page-progress .wpvq-progress-value').css('width', wpvq_percent_progress + '%');\n\t\t\t\t$('.wpvq-page-progress .wpvq-progress-value').text(content);\n\t\t\t} \n\t\t\telse {\n\t\t\t\t$('.wpvq-progress-zero').html('');\n\t\t\t\t$('.wpvq-page-progress .wpvq-progress-value').animate({width:wpvq_percent_progress + '%'}, 800);\n\t\t\t\t$('.wpvq-page-progress .wpvq-progress-value').text(content);\n\t\t\t}\n\n\t\t\t// Scroll to top auto for the page > 0\n\t\t\tvar isNextPageEmpty = ($.trim($('#wpvq-page-' + wpvq_currentPage).html()).length == 0) ;\n\t\t\tif (!wpvq_refresh_page && wpvq_autoscroll_next_var && wpvq_currentPage > 0 && wpvq_percent_progress != 100 && !isNextPageEmpty) {\n\t\t\t\t$('html, body').animate( { scrollTop: $('#wpvq-page-' + wpvq_currentPage).offset().top - 70 - wpvq_scroll_top_offset }, wpvq_scroll_speed );\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "da3a716656150a057f4d79b16d45cef2", "score": "0.77219385", "text": "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n}", "title": "" }, { "docid": "5ee4239abb016491f8a614ec5c1de877", "score": "0.7714861", "text": "function updateProgress() {\n\tseek.value = video.currentTime;\n\tprogressBar.value = video.currentTime;\n}", "title": "" }, { "docid": "ee638624b3169cf9acd3439b4a2274d6", "score": "0.76932603", "text": "function updateProgressBar(win) {\r win.center();\r win.show();\r win.progress.value++;\r //update the window\r win.layout.layout(true);\r }\r\r////////////////////\r// END FUNCTIONS //\r////////////////////", "title": "" }, { "docid": "d876cc585eb103a51b2a5371f0cc3132", "score": "0.7689949", "text": "function updateProgressBar(){\r\n // Update the value of our progress bar accordingly.\r\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\r\n}", "title": "" }, { "docid": "4248ac0e4682c7c34d89d2ac1f1acfcd", "score": "0.7686342", "text": "updateProgress () {\n this.progressBar.setAttribute(\"max\", this.totalSlides);\n this.progressBar.setAttribute(\"value\", this.currentSlide + 1);\n this.progressBar.innerHTML = `${this.currentSlide + 1}/${this.totalSlides}`;\n }", "title": "" }, { "docid": "068305b2ec98a113191cd9b2f5aecd17", "score": "0.7666157", "text": "function updateProgress() {\n const ratio = (video.currentTime / video.duration) * 100\n // update fill-bar\n fillBar.style.flexBasis = `${ratio}%`\n}", "title": "" }, { "docid": "f1c8208d71c2eedccd4a99cb752d42e1", "score": "0.7662516", "text": "function updateProgressBar() {\n progress.style.width = audio.currentTime / audio.duration * 100 + \"%\";\n requestAnimationFrame(updateProgressBar);\n}", "title": "" }, { "docid": "6c3190f7e31da0dcbac9fd0bf6959e41", "score": "0.76236606", "text": "function manipulateProgressbar() {\n\n var progressBarValues = 100 / parseInt(totalCunt) * updateProgressBar();\n var roundOffValue = Math.floor(progressBarValues);\n\n progressbar.css('width', roundOffValue + '%');\n progressbar.text(roundOffValue + '%');\n}", "title": "" }, { "docid": "30bc8baddbde6e09dd5fd3163edc86ae", "score": "0.761426", "text": "function updateProgressBar() {\n const remainingPercent = totalSpent / totalBudget * 100;\n document.getElementById(\"myBar\").style.width = `${remainingPercent}%`;\n if (totalBudget < totalSpent) {\n document.getElementById(\"myBar\").style.width = '100%';\n }\n}", "title": "" }, { "docid": "6b1a2d71581437657c03298cc3d222cb", "score": "0.75932825", "text": "function progressBarUpdater() {\n document.querySelector('.indicator-current').innerHTML = `Page ${currentSlide + 1}`;\n // const allRequiredQuestions = document.querySelectorAll('.is-required').length;\n const percentageCompleted = `${`${(currentSlide + 1) * 100}` / slideItems.length}%`;\n progressIndicator.style.transform = `translateX(${percentageCompleted})`;\n }", "title": "" }, { "docid": "a6ebbdedfa08edf68bceb377630a339a", "score": "0.7572014", "text": "function updateProgress(percent) {\n const progressBarElement = document.getElementById(\"progressBar\");\n if (!progressBarElement || percent < 0) return;\n\n if (percent >= 100) {\n hideProgressView();\n } else if (!modalBodyElement.classList.contains(\"hidden\")) {\n showProgressView();\n }\n\n if (percent > 100) return;\n\n const radius = 2 * Math.PI * progressBarElement.getAttribute(\"r\");\n\n // updates the progress\n progressBarElement.style.strokeDashoffset = radius - (percent / 100) * radius;\n document.getElementById(\"percent\").innerHTML = Math.floor(percent) + \"%\";\n}", "title": "" }, { "docid": "a8865af0895bf3685992e044940fc3d3", "score": "0.75578755", "text": "function UpdateProgress() {\n let filesLoaded = Math.max(0, totalFiles - neededFiles);\n let progress = (totalFiles > 0) ? (filesLoaded / totalFiles) : 1;\n progress *= 100;\n progress = Math.round(progress);\n document.getElementById(\"file\").innerText = currentFile;\n document.getElementById(\"percentage\").innerText = `${progress}%`;\n document.getElementById(\"filesloaded\").innerText = `${filesLoaded}`;\n document.getElementById(\"totalfiles\").innerText = `${totalFiles}`;\n}", "title": "" }, { "docid": "2250961ae8a0ef2068b44bcdc11ae00b", "score": "0.7537225", "text": "updateProgress(...args) {\n return this.bar && this.bar.updateProgress(...args);\n }", "title": "" }, { "docid": "e594ddfbc9648e98a06dc8876deb90d0", "score": "0.75345516", "text": "function updateProgressBar() {\n game.canvas.id = 'game';\n var elem = document.getElementById(\"myBar\");\n if (game.load.progress <= 100) {\n elem.style.width = game.load.progress + '%';\n document.getElementById(\"label\").innerHTML = game.load.progress * 1 + '%';\n }\n if (game.load.progress == 100) {\n $(\"myBar\").css('height', 0);\n $(\"#game\").css({\n 'position': 'fixed',\n 'top': '0px'\n });\n $(\"#myBar\").height = 0;\n }\n}", "title": "" }, { "docid": "939656eaf97991ef3361c2a4a20c5b6a", "score": "0.75307715", "text": "function updateProgressBar() {\n var progressPercent = (timeLeft) / (quizzes[quizID].length * 6) * 100;\n var percent = progressPercent.toFixed(2);\n multiplierEl.innerHTML = `Multiplier: <b>x${points}</b>`\n progressBarEl.setAttribute(\"style\", `width: ${percent}%`);\n progressBarEl.setAttribute(\"aria-valuenow\", `${timeLeft}`);\n progressBarEl.setAttribute(\"aria-valuemin\", \"0\");\n progressBarEl.setAttribute(\"aria-valuemax\", `${quizzes[quizID].length * 5}`);\n\n if (percent < 66) {\n progressBarEl.setAttribute(\"class\", \"progress-bar bg-warning progress-bar-striped progress-bar-animated\");\n }\n\n if (percent < 33) {\n progressBarEl.setAttribute(\"class\", \"progress-bar bg-danger progress-bar-striped progress-bar-animated\");\n }\n\n}", "title": "" }, { "docid": "c644ab8b99e445e9e05386defb73502c", "score": "0.75292426", "text": "function update_progress_bar(progress, colour) {\n\t\t/**\n\t\t * First run\n\t\t */\n\t\tif (0 === progress) {\n\t\t\tprogressbar.progressbar({\n\t\t\t\tvalue: 0\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Subsequent runs\n\t\t */\n\t\tif ('' === colour) {\n\t\t\tcolour = 'blue';\n\t\t}\n\t\tlet current_value = progressbar.progressbar('value');\n\t\tif (current_value < 100) {\n\t\t\tprogressbar.progressbar({\n\t\t\t\tvalue: progress\n\t\t\t});\n\t\t\tchange_progress_colour(colour);\n\t\t}\n\t}", "title": "" }, { "docid": "f943481b509cb8e5edb4a7261a0be4d9", "score": "0.7523916", "text": "function update_progress() {\n //console.log(video.currentTime,\" \",video.duration,\" \",(video.currentTime/video.duration),\" \",(video.currentTime/video.duration)*100,\"%\");\n progress_bar.style.width = `${(video.currentTime/video.duration)*100}%`;\n current_time.textContent = `${display_time(video.currentTime)} /`;\n duration.textContent = `${display_time(video.duration)} `;\n}", "title": "" }, { "docid": "2a84709855a0f8056a509cfb6b07a124", "score": "0.75033116", "text": "function updateProgress(perc){\n var elm = document.getElementById(\"myBar\");\n var width = perc;\n if(width <= 100){\n elm.style.width = width + '%';\n elm.innerText = width + '%';\n }\n}", "title": "" }, { "docid": "4448e0c0b11b8b58933303e96a65787c", "score": "0.75005114", "text": "function updateProgress() {\n\t\t\t\tvar value = 0;\n\t\t\t\tif (video.currentTime > 0) {\n\t\t\t\t\tvalue = Math.floor((100 / video.duration) * video.currentTime);\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(\"played\").style.width = value + \"%\";\n\t\t\t}", "title": "" }, { "docid": "83e3ea346153602e08f32ecf37164602", "score": "0.7487305", "text": "function updateProgressInfo() {\n var progress_url = \"/upload/progress/\"; // ajax view serving progress info\n var uuid = $('#X-Progress-ID').val();\n// $.getJSON(progress_url, {'X-Progress-ID': uuid}, function(data, status){\n// if (data) {\n// uncomment to check in firebug\n// console.log(\"uploaded: \" + data.uploaded);\n// var progress = parseInt(data.uploaded) * 100 / parseInt(data.length);\n// $(\"#upload-progress-bar\").progressBar(progress);\n// trigger the next one after 1s\n// $(\"#upload-progress-bar\").oneTime(1000, function() {\n// updateProgressInfo();\n// });\n// }\n// });\n}", "title": "" }, { "docid": "6fed8f69f00330fcdda70b8cff94f3ef", "score": "0.74862826", "text": "function updateProgressBar(percentDone)\r\n\t{\r\n\t\tvar rowProgress = document.getElementById(\"rowProgress\");\r\n\t\tif(percentDone>=1)\r\n\t\t\trowProgress.width = percentDone + \"%\";\r\n\t\telse\r\n\t\t\trowProgress.width = \"1\";\r\n\t}", "title": "" }, { "docid": "4f35f88e0711a9e1c6a78d11abe10102", "score": "0.7482852", "text": "updateProgressBar() {\n // Do not update progress bar in fixed nodes mode\n if (!this.fixedNodesMode) {\n const ratio = (1 - (this.force.alpha() - this.force.alphaMin()) / FHConfig.MAX_ALPHA);\n this.progressBar.attr('x2', (ratio === 1) ? 0 : ratio * FHConfig.INNER_SVG_WIDTH);\n }\n }", "title": "" }, { "docid": "b48ac00660ea9be813af90b19a4a22e8", "score": "0.74620414", "text": "function updateProgress() {\n if (!fail_loading) {\n if (howler_loading_progress === SOUND_EFFECT_FILES.length && pixi_loaded && loading_complete === false) {\n loading_complete = true;\n updateProgressBar(100);\n onAssetsLoaded();\n } else {\n var value = pixi_loading_progress * 0.9 + howler_loading_progress / (SOUND_EFFECT_FILES.length) * 100 * 0.1;\n updateProgressBar(value);\n }\n }\n }", "title": "" }, { "docid": "97f65fcf730c235c45c79ecae7a5319e", "score": "0.74515676", "text": "function progressUpdate(uploaded,size){\n let progressFill = document.getElementById(\"progressFill\");\n let progressBar = document.querySelector(\".progressBar\");\n let percentage = document.getElementById(\"percentage\");\n let percent = Math.round((uploaded*100)/size);\n\n percentage.innerText = percent+\" %\";\n progressFill.style.width = percent+\"%\";\n\n return;\n}", "title": "" }, { "docid": "40db103e5aea9626b6de7ef60d505e06", "score": "0.7435677", "text": "function progress_update_bar(progress) {\n let total = 0;\n let error = 0;\n let running = 0;\n let complete = 0;\n let pending = 0;\n\n // Calculating the overall percentage\n for (const tag in progress) {\n for (const detid in progress[tag]) {\n total++;\n if (progress[tag][detid] == CMD_PENDING) {\n pending++;\n } else if (progress[tag][detid] == CMD_RUNNING) {\n running++;\n } else if (progress[tag][detid] == CMD_COMPLETE) {\n complete++;\n } else {\n error++;\n }\n }\n }\n if (total == 0) {\n return;\n }\n\n // Updating the overall session progress progress bar.\n const complete_percent = (100.0 * complete) / total;\n const error_percent = (100.0 * error) / total;\n const running_percent = (100 * running) / total;\n\n var bar_elem = $('#session-progress');\n bar_elem.children('.progress-complete').css('width', `${complete_percent}%`);\n bar_elem.children('.progress-running').css('width', `${running_percent}%`);\n bar_elem.children('.progress-error').css('width', `${error_percent}%`);\n}", "title": "" }, { "docid": "22cb5113387434034447661d3477664d", "score": "0.7422883", "text": "function alterProgBar() \n{\n\t//http://html5doctor.com/the-progress-element/\n\t//http://stackoverflow.com/questions/7803784/using-jquery-with-html5-progress-bar\n\t//W3Schools.com\n\t\n\t// calculate how far complete\n\tvalue = Number(localStorage.value);\n\tpercent = Math.floor((value / max) * 100);\n\t\n\t// update the html accordingly\n\t$(\"#progPC\").html(percent);\n\t$(\"#progress\").val(value);\n}", "title": "" }, { "docid": "22d771d15a7fbc3ca47a70ce17b94ec5", "score": "0.7422843", "text": "function updateProgress(event) {\n if (event.lengthComputable) {\n // Add to the current bytes\n currentBytes = event.loaded;\n\n // Now calculate the percent finished\n var percentComplete = (currentBytes / totalBytes) * 100;\n\n //console.log(\"Downloaded: \" + parseInt(percentComplete) + \"%\");\n document.getElementById(\n 'modal_GDrivePicker-prgrsbar'\n ).style.width =\n parseInt(percentComplete) + '%';\n //TODO: Add multiple download bars.\n\n document.getElementById('modal_GDrivePicker-size').innerHTML =\n 'Size: ' +\n parseInt(currentBytes / 10000) / 100 +\n ' of ' +\n parseInt(totalBytes / 10000) / 100 +\n ' Mb';\n document.getElementById('modal_GDrivePicker-name').innerHTML =\n 'Downloading Files '; // + file.name;\n } else {\n // Unable to compute progress information since the total size is unknown\n }\n }", "title": "" }, { "docid": "2761e2a839cd4f9f98662d4c61355647", "score": "0.741063", "text": "function updateProgress() {\n const { duration, currentTime } = video;\n\n // Update Progress Bar width in CSS\n const progressPercent = (currentTime / duration) * 100;\n progressBar.style.width = `${progressPercent}%`;\n\n // Get duration and currentTime in minutes to 2 decimal places, convert to String, replace . with :, check for NaN, and update DOM \n const durationMinutes = (duration / 60).toFixed(2);\n const currentTimeMinutes = (currentTime / 60).toFixed(2);\n durationElement.textContent = isNaN(durationMinutes) ? '00:00' : durationMinutes.toString().replace('.', ':');\n currentTimeElement.textContent = currentTimeMinutes.toString().replace('.', ':') + \" / \";\n}", "title": "" }, { "docid": "eb45fd1866e393e258b9337529ada8a7", "score": "0.7410563", "text": "function setProgress(currstep) {\n var percent = parseFloat(100 / widget.length) * currstep;\n percent = percent.toFixed();\n $(\".progress-bar\").css(\"width\", percent + \"%\").html(percent + \"%\");\n }", "title": "" }, { "docid": "e6181fbcd74c3923fd384a6c4498bfe3", "score": "0.74097353", "text": "function updateProgressBar(event){\n if (isPlaying){\n const {duration, currentTime} = event.srcElement;\n // Update progress bar width\n const progressPercent = (currentTime/duration) * 100;\n progress.style.width = progressPercent + '%';\n // Update time UI for duration\n correntTimeAndAppend(durationEl, duration);\n // // Update time UI for current time\n correntTimeAndAppend(currentTimeEl, currentTime);\n }\n}", "title": "" }, { "docid": "1c2ba57338bcbb844edbccd8deae8398", "score": "0.73947376", "text": "function updateProgressBarGUI(bytesTransferred) {\n // if (bytesTransferred > lastUploadedSize) {\n var now = new Date().getTime() / 1000.0; // seconds\n var uploadTransferRate = bytesTransferred / (now - uploadStartTime);\n var timeRemaining = (totalFileSize - lastUploadedSize)\n / uploadTransferRate;\n\n // if (totalFileSize > 5242880) //if greater than 5 megabytes - slow\n // down checks to every 5 seconds\n // currentRate = 500;\n\n lastUploadedSize = bytesTransferred;\n lastProgressUpdate = now;\n var progress = (0.0 + lastUploadedSize) / totalFileSize;\n var percentComplete = Math.round(100 * progress);\n\n var timeLeft = timeRemaining;\n\n /*\n * This modifies the server connection frequency based on the progress\n * rate of the upload So for large files it will slow down progress\n * update checks - or for network glitches which slow and speed up\n * transfer, it will adjust the rate accordingly.\n */\n var rateModifier = 3;\n if (previousPercentComplete > 0) {\n if ((percentComplete - previousPercentComplete) < rateModifier) {\n // If less than 3% change - slow down the checks\n updateRate += 500;\n } else if (((percentComplete - previousPercentComplete) > rateModifier)\n && (updateRate > 1000)) {\n updateRate -= 500;\n }\n }\n previousPercentComplete = percentComplete;\n\n var totalStr = Math.round(totalFileSize / 1024); // changed to kilobytes\n if (progress && progress > 0) {\n progressBarGraphic.width(barwidth * progress);\n }\n var ptext = percentComplete + '% completed (' + formatSize(lastUploadedSize) + ' of ' + formatSize(totalFileSize) + ')';\n ptext += '&nbsp; &nbsp; Time remaining: ' + formatTime(timeLeft);\n ptext += '&nbsp; &nbsp; Transfer rate: ' + formatSize(uploadTransferRate) + \" / sec\";\n progressBarTextDiv.html(ptext);\n }", "title": "" }, { "docid": "eeb80f08c43176c410344e3d5cc595d0", "score": "0.73875797", "text": "function progress(){\n\tvar barwidth = bar.style.width;\n\tbarwidth = barwidth.substr(0, barwidth.length -1);\n\tif(Number(barwidth) < 100){\n\t\tpercent += 1/reqelements.length * 100;\n\t\tbar.style.width = percent+\"%\";\n\t}\n}", "title": "" }, { "docid": "a845f1afd339101b1730676bf2b35fa8", "score": "0.73853165", "text": "advanceProgress() {\n this.setProgress(this.progressNow + 1);\n }", "title": "" }, { "docid": "aded6f343dbfaf0484b36db3da976740", "score": "0.7367849", "text": "function update_progress_bar() {\n let total_points = document.querySelector(\"#total-points\").textContent\n total_points = parseInt(total_points)\n fetch('/api/tiers')\n .then(response => response.json())\n .then((tiers) => {\n let upper = tiers.find(tier => tier.points > total_points)\n let rev = tiers.slice(0).reverse()\n let lower = rev.find(tier => tier.points <= total_points)\n\n let percent = 0\n if (lower == null) {\n percent = total_points / upper.points * 100;\n } else if (upper == null) {\n percent = 100\n } else {\n percent = (total_points - lower.points) / (upper.points - lower.points) * 100;\n }\n\n document.querySelector(\"#progress-bar\").style.width = \"\" + percent + \"%\"\n display_msg(total_points, upper, lower)\n })\n}", "title": "" }, { "docid": "3eb7b1bb9527065dd08b288c93443cdc", "score": "0.7365891", "text": "function addProgress() {\n\t// increase myBarWidth\n\tmyBarWidth += 100 / numberQuestions;\n\n\tif (myBarWidth > 100) {\n\t\tmyBarWidth = 100;\n\t}\n\t// update the width of #myBar\n\tdocument.getElementById('myBar').style.width = myBarWidth + '%';\n}", "title": "" }, { "docid": "016d4ef95bf136c4b1244af256dd1e4c", "score": "0.73601973", "text": "function updateProgressValue() {\n progressBar.max = song.duration;\n progressBar.value = song.currentTime;\n document.querySelector('.currentTime').innerHTML = (formatTime(Math.floor(song.currentTime)));\n if (document.querySelector('.durationTime').innerHTML === \"NaN:NaN\") {\n document.querySelector('.durationTime').innerHTML = \"0:00\";\n } else {\n document.querySelector('.durationTime').innerHTML = (formatTime(Math.floor(song.duration)));\n }\n}", "title": "" }, { "docid": "016d4ef95bf136c4b1244af256dd1e4c", "score": "0.73601973", "text": "function updateProgressValue() {\n progressBar.max = song.duration;\n progressBar.value = song.currentTime;\n document.querySelector('.currentTime').innerHTML = (formatTime(Math.floor(song.currentTime)));\n if (document.querySelector('.durationTime').innerHTML === \"NaN:NaN\") {\n document.querySelector('.durationTime').innerHTML = \"0:00\";\n } else {\n document.querySelector('.durationTime').innerHTML = (formatTime(Math.floor(song.duration)));\n }\n}", "title": "" }, { "docid": "9e35fff013b41cb0c7b4ac9f00488720", "score": "0.73585707", "text": "function updateBar(_pageX) {\n var _player = _draggingPlayer,\n \t_playerJS = _player[0],\n \t_progressBar = _draggingBar;\n\n var _totalW = _progressBar.parent().width(),\n _maxTime = _playerJS.duration,\n _position = _pageX - _progressBar.offset().left,\n _propPosition = _position * 100 / _totalW ,\n _propPosition = Math.max(0, _propPosition),\n _propPosition = Math.min(_propPosition, 100);\n\n _progressBar.css('width', _propPosition +'%');\n _playerJS.currentTime = _maxTime * _propPosition / 100;\n }", "title": "" }, { "docid": "a79d3a7dd0a2169517314fdd11ae79e5", "score": "0.73542124", "text": "updateWindowProgressBar () {\n const all = Object.keys(this.downloadsInProgress).reduce((acc, id) => {\n acc.received += this.downloadsInProgress[id].received\n acc.total += this.downloadsInProgress[id].total\n return acc\n }, { received: 0, total: 0 })\n\n if (all.received === 0 && all.total === 0) {\n this.mailboxWindow.setProgressBar(-1)\n } else {\n this.mailboxWindow.setProgressBar(all.received / all.total)\n }\n }", "title": "" }, { "docid": "8444bb0a83b5687379ba7e1ed0bba3af", "score": "0.7347476", "text": "updateUI() {\n if (this.currentScore > this.totalScore) {\n this.currentScore = this.totalScore;\n }\n\n const k = Math.ceil((this.currentScore / this.totalScore) * 100) * 1.8;\n\n this.$fullAndFill.css('transform', `rotate(${k}deg)`);\n this.$fillFix.css('transform', `rotate(${k * 2}deg)`);\n\n const textualProgress = (this.showTotal) ?\n `${this.currentScore}<span class=\"h5p-progress-circle-textual-progress-divider\">/</span>${this.totalScore}` :\n this.currentScore;\n\n this.$textualProgress.html(textualProgress);\n\n //this.$text.attr('aria-valuenow', currentScore);\n }", "title": "" }, { "docid": "f3d8d7fb2fcc329a50b1a3c1f3c1bd66", "score": "0.7336257", "text": "function setBarProgress(){\r\n var progress = (this.currentAudio.currentTime/this.currentAudio.duration)*100;\r\n document.getElementById(\"myBar\").style.width = progress + \"%\";\r\n }", "title": "" }, { "docid": "a9123b41cb527636173afc81421e67a0", "score": "0.73310363", "text": "function updatePanelProgress (name, percentage)\n{\n\tvar panel = document.getElementById(name);\n\tpanel.getElementsByClassName(\"barIndicator\")[0].style.width = percentage+\"px\"; // max width is 100.\n}", "title": "" }, { "docid": "8d4330b7652c4e71363da11836e900a7", "score": "0.72972727", "text": "function updateProgressBar(totalCount) {\n console.log(\"updateProgressBar is running\");\n console.log(\"Units Remaining: \" + ctx.getRemainingUsage());\n if (parseInt(ctx.getRemainingUsage()) > 100) {\n nb_emailed = lengthSentList();\n\n console.log(\"Nb records moves : \", nb_emailed);\n if (nb_emailed == totalCount) {\n clearInterval(progressBar);\n $('#progress-records').attr('class', 'progress-bar progress-bar-success');\n setTimeout(redirect, 15000); // Redirect after 60 Seconds\n }\n\n var width = parseInt((nb_emailed / totalCount) * 100);\n\n $('#progress-records').attr('aria-valuenow', nb_emailed);\n $('#progress-records').attr('style', 'width:' + width + '%');\n $('#progress-records').text('Total Number of Invoices Emailed : ' + nb_emailed + ' / ' + totalCount);\n console.log(\"width : \", width);\n } else {\n // if (e.name == 'SSS_USAGE_LIMIT_EXCEEDED') {\n var params_progress = {\n custpage_mass_inv_email_tot_num_inv: totalCount,\n custpage_mass_inv_email_zee_set: null,\n };\n params_progress = JSON.stringify(params_progress);\n var reload_url = baseURL + url.resolveScript({\n deploymentId: \"customdeploy_sl_mass_inv_email\",\n scriptId: \"customscript_sl_mass_inv_email\",\n }) + '&custparam_params=' + params_progress;\n window.open(reload_url, \"_self\");\n // }\n }\n }", "title": "" }, { "docid": "e9182cd60c6c7577cd883b12fa5252ad", "score": "0.729478", "text": "function updateProgress() {\n progressBar.style.width = `${(video.currentTime/video.duration) * 100}%`;\n currentTime.textContent = displayTime(video.currentTime) + ' / ';\n}", "title": "" }, { "docid": "7a77783510fc82597e265404babb5666", "score": "0.72830045", "text": "function updateProgress (oEvent) {\r\n\t\tvar percentComplete = oEvent.loaded / 44462127;\r\n\t\t$( \"#progressbar\" ).progressbar({\r\n\t\t\t value: percentComplete*100\r\n\t\t\t});\r\n\t\tconsole.log(percentComplete);\r\n\t}", "title": "" }, { "docid": "43048fbad5f074c9d540f833454f03f3", "score": "0.72734654", "text": "function changeProgressBar() {\n song.currentTime = progressBar.value;\n console.log(\"ChangedPB\");\n}", "title": "" }, { "docid": "56d231efda199af62910732e30a848e3", "score": "0.7273008", "text": "updateProgressBar(section_id) {\n var percentage = Math.round(section_id / (this.sections.length) * 100);\n $('.progress-bar').attr('aria-valuenow', percentage);\n $('.progress-bar').css('aria-valuenow', percentage);\n $('.progress-bar').css({\n 'width': percentage + '%'\n });\n $('.progress-bar').text(percentage + '% Completato');\n }", "title": "" }, { "docid": "45279f3d7a38cc5c5344834d5ae4978d", "score": "0.7271275", "text": "function RadiantProgressUpdate() {\n\tvar progress = CustomNetTables.GetTableValue(\"arena_capture\", \"radiant_progress\");\n\tif (progress[1] >= 0) {\n\t\t$('#RadiantProgressBar').value = progress[1];\n\t\t$('#RadiantTakenProgressBar').value = progress[1];\n\t} else {\n\t\t$('#RadiantProgressBar').value = (-1) * progress[1];\n\t\t$('#RadiantTakenProgressBar').value = (-1) * progress[1];\n\t}\n}", "title": "" }, { "docid": "682167978b5a9feb48a561643c5064e8", "score": "0.7267155", "text": "function updateProgress() {\n\t//subtracts 1 from the current stress level and stores the value\n stressLevel = sessionStorage.stress - 1;\n sessionStorage.setItem(\"stress\", stressLevel);\n\n var elem = document.getElementById(\"myBar\"); \n\n var width = (stressLevel + 1)*10;\t//current width of the bar\n var end = width - 10;\t//ending width of the bar\n var id = setInterval(frame, 10);\n function frame() {\n if (width <= end) {\n clearInterval(id);\n } else {\n width--; \n elem.style.width = width + '%'; \n }\n }\n //changes metus image\n pickImg();\n}", "title": "" }, { "docid": "732f470c1c05048520f67a1ca0c6f880", "score": "0.72620845", "text": "function updateProgress (oEvent) {\n\t\tif (oEvent.lengthComputable) {\n\t\t\tlistener.progressMeter.setAttribute('max', oEvent.total);\n\t\t\tlistener.progressMeter.setAttribute('value', oEvent.loaded);\n\t\t\t//var percentComplete = oEvent.loaded / oEvent.total;\n\t\t} else {\n\t\t\t// Unable to compute progress information since the total size is unknown\n\t\t\tlistener.progressMeter.setAttribute(\"mode\",\"undetermined\");\n\t\t}\n\t}", "title": "" }, { "docid": "63712509c4368751bb0be2a395d5645d", "score": "0.72618437", "text": "function update_progress(idx){\n\t\t$('.step_nb').text(idx +'/'+list_elem_count);\n\t}", "title": "" }, { "docid": "2e9ab3d44437f22b1685db0d005f7491", "score": "0.7253361", "text": "function setProgressStatus(barElem, percent) { // console.log(\"setProgress to %s\\%\", percent)\n var status = percent.toString() + '%' + statusMsgDict[percent];\n barElem.value = percent;\n ein.ui.setStatus(status);\n }", "title": "" }, { "docid": "5dda240a06fcddc4beb994ab798dadff", "score": "0.7247558", "text": "function refreshProgressElement(progressPercents) {\n let progressBar = document.getElementById(ids.bar);\n if (progressBar) {\n progressBar.style.width = progressPercents + '%';\n };\n }", "title": "" }, { "docid": "91ceb5e10a1211176a64992d181c0283", "score": "0.7246763", "text": "function updateProgress(value) {\n\n console.log(imageCount)\n // tween progress bar tween to the right value\n gsap.to(progressTween, {\n progress: value / imageCount,\n duration: 0.3,\n ease: 'power1.out',\n\n // onUpdate: progressUpdate,\n // onComplete: loadComplete,\n });\n }", "title": "" }, { "docid": "e44ccef1f01e3a87d466c1fa9a181c8c", "score": "0.7230725", "text": "function updateProgress(percent,file){\n\tvar a = file.rowid,\n\t\tb = Math.round(percent);\n\tif (b == 100){\n\t\t$('#' + a + ' .process').html('Processing file on server');\n\t\t$('#' + a + ' .bar').css('width',b + '%');\n\t}else{\n\t\t$('#' + a + ' .process').html(b + '% uploaded');\n\t\t$('#' + a + ' .bar').css('width',b + '%');\n\t}\n}", "title": "" }, { "docid": "b74a1f91b06e1061ca4f256549eb6122", "score": "0.72181267", "text": "function updateProgressBarPercent(percent)\n\t{\n\t // progressBar.style.width = Math.ceil((containerWidth * percent) / 100) + \"px\";\n\t\tprogressBar.style.width = percent + \"%\"; // this works as well.\n\t}//---------------------------------------------------;", "title": "" }, { "docid": "98e11e00226533963e369a43218875d9", "score": "0.7215771", "text": "function changeProgressBar(i, stat) {\n document.getElementById(`baseStatsPb${i}`).style.width = stat + '%';\n document.getElementById(`baseStatsPb${i}`).style.backgroundColor = colorProgressBar(stat);\n}", "title": "" }, { "docid": "0197346f0dbea64858d9f073e8236036", "score": "0.7203673", "text": "function updateProgress (strProgressMsg) {\r\n\t\t\t\tdocument.getElementById(\"divProgress\").innerHTML = document.getElementById(\"divProgress\").innerHTML + strProgressMsg;\r\n\t\t\t}", "title": "" }, { "docid": "5cd8c2676752e06ed88ffac56c8e17cb", "score": "0.7200974", "text": "function updateProgress(loaded, total) {\n curUploadDiv.innerHTML = (loaded + \"/\" + total);\n}", "title": "" }, { "docid": "87e0b0d2e1418b4919796c50038a5c4b", "score": "0.72006315", "text": "function DireProgressUpdate() {\n\tvar progress = CustomNetTables.GetTableValue(\"arena_capture\", \"dire_progress\");\n\tif (progress[1] >= 0) {\n\t\t$('#DireProgressBar').value = progress[1];\n\t\t$('#DireTakenProgressBar').value = progress[1];\n\t} else {\n\t\t$('#DireProgressBar').value = (-1) * progress[1];\n\t\t$('#DireTakenProgressBar').value = (-1) * progress[1];\n\t}\n}", "title": "" }, { "docid": "d15094edf7664e5266ff206eba7c4b5c", "score": "0.72004557", "text": "function changeProgressValue() {\n $progressValue += 11;\n if ($progressValue >= 100) {\n\n } else {\n if ($progressValue == 99) $progressValue = 100;\n $('.my-progress')\n .find('.my-progress-indicator.active')\n .next('.my-progress-indicator')\n .addClass('active');\n $('progress').val($progressValue);\n }\n $('.js-my-progress-completion').html($('progress').val() + '% complete');\n}", "title": "" }, { "docid": "4e4f11685b84c5898d390fbb87d45104", "score": "0.7188023", "text": "function timeUpdate() {\n\t\t$vProgBar.css('width', ((vPlayer.currentTime / vPlayer.duration) * 100) + '%');\n\t}", "title": "" }, { "docid": "4e4f11685b84c5898d390fbb87d45104", "score": "0.7188023", "text": "function timeUpdate() {\n\t\t$vProgBar.css('width', ((vPlayer.currentTime / vPlayer.duration) * 100) + '%');\n\t}", "title": "" }, { "docid": "76806845561710776ebffeed4ec3b224", "score": "0.71678567", "text": "function refreshProgressBar(key){\n $(\"#sound\").on(\"timeupdate\", function() {\n var progress = (this.currentTime / this.duration)*100; \n //console.log(progress);\n $(\"#song\"+key).find(\"#progressBar\").css(\"width\", progress+\"%\");\n $(\"#song\"+key).find(\"#progressBar\").attr(\"aria-valuenow\", progress+\"%\");\n // for case when song ended without pressing stop\n if(progress==100){\n disableProgressBar(key)\n }\n });\n}", "title": "" }, { "docid": "2aa349fd4f2b76c4374ee75bfe1df9bd", "score": "0.71675557", "text": "function updateProgressValue() {\n if (playing) {\n progressBar.max = song.duration;\n progressBar.value = song.currentTime;\n curTime.innerHTML = (formatTime(Math.floor(song.currentTime)));\n if (durTime.innerHTML === \"NaN:NaN\") {\n durTime.innerHTML = \"0:00\";\n } else {\n durTime.innerHTML = (formatTime(Math.floor(song.duration)));\n }\n }\n}", "title": "" }, { "docid": "40bf2760830230df1078845427a335e6", "score": "0.71609366", "text": "function _setProgressBar(nProgress) {\r\n\t\tnProgress = nProgress * 1;\r\n//\t\thtElements.welTarget.css(\"opacity\", (nProgress === 0) ? 0 : 1);\r\n\t\thtElements.welProgressBar.css(\"width\", nProgress + \"%\");\r\n\t\thtElements.welProgressNum.text(nProgress + \"%\");\r\n\t}", "title": "" }, { "docid": "662294a18654761de2577d58b94c9c5d", "score": "0.7157432", "text": "function updateProgress (oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total * 100;\n elem.style.width = percentComplete + '%' ;\n } else {\n console.log('Unable to compute progress information since the total size is unknown');\n }\n}", "title": "" }, { "docid": "618747b103f96fade3649c0cabe24502", "score": "0.71557176", "text": "function updateTrackProgressBar(audio){\n return Math.round(audio.currentTime/audio.duration*2*100)/2 + '%'\n}", "title": "" }, { "docid": "1d5057d9e5cc98c1dec4f2d7ff168626", "score": "0.71465683", "text": "function updateProgressBar(minNumQ, answeredNumQ) {\n // TODO save some energy on calculate the exact progress for future\n // for now just roughly update\n var progress = \"0\";\n var percent = answeredNumQ / minNumQ;\n\n if (percent > 0 && percent < 0.3) progress = \"5\";\n else if (percent >= 0.3 && percent < 0.6) progress = \"33\";\n else if (percent >= 0.6 && percent <= 0.9) progress = \"66\";\n else if (percent > 0.9) progress = \"99\";\n\n $(\".progress-bar\").css(\"width\", progress + \"%\").attr(\"aria-valuenow\", progress);\n $(\"#progress-container p\").html(progress + \"% Complete\");\n}", "title": "" }, { "docid": "cac0559e0d647a463b90326f64a606df", "score": "0.71458", "text": "function changeProgressBar() {\n song.currentTime = progressBar.value;\n}", "title": "" } ]
f4b1aac982891227d0a46025284e8a1c
[] ALPHA_CUSTOMIZE, Add by Ben fish+
[ { "docid": "89d4a03f19a94a004095b4389a72e6f6", "score": "0.0", "text": "function chg_path(t,form_obj,text_obj)\n\t\t\t\t{\n\t\t\t\t\tvar hdd_num=HDD_INFO_ARRAY.length;\n\t\t\t\t\n\t\t\t\t\t\tvar new_path = translate_path_to_display(t);\n\t\t\t\t\t\t/* Modify by Ben, 2013/12/10\n\t\t\t\t\tfor(i=0;i<hdd_num;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hdd_info=HDD_INFO_ARRAY[i].split(\":\");\n\t\t\t\t\t\tif(t.indexOf(hdd_info[1])!=-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar str=t;\n\t\t\t\t\t\t\tstr=str.split(hdd_info[1]);\n\t\t\t\t\t\t\tvar new_path=hdd_info[0] + str[1];\n\t\t\t\t\t\t\tvar last_char = new_path.substr(new_path.length-1,1)\n\t\t\t\t\t\t\tif (last_char == \"/\")\n\t\t\t\t\t\t\t\tnew_path=new_path.substr(0,new_path.length-1);\t//remove end of '/' ;folder\n\t\t\t\t\t\t\telse\t\n\t\t\t\t\t\t\t\tnew_path=new_path.substr(0,new_path.length);\t//remove end of '/' ;file\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\n\t\t\t\t\tif ( ( t != \"/mnt/HD\") && ( t !=\"/mnt/USB\") )\n\t\t\t\t\t{\n\t\t\t\t\t\t//for iso create image\n\t\t\t\t\t\tif (o.function_id == \"iso_create\")\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar len = _upIsoRootPath.length;\t\n\t\t\t\t\t\t\tvar show_text = t.substr(len+1,t.length-len+1);\n\t\t\t\t\t\t\tif (text_obj != null && show_text != \"\")\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tdocument.getElementById(\"settings_utilitiesIsoSelectPath_text\").value=unescape(show_text);\n\t\t\t\t\t\t\t\tdocument.getElementById(text_obj).value=unescape(t);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSEL_PATH=unescape(new_path);\n\t\t\t\t\t\tif((typeof(new_path) != \"undefined\" || new_path != null) && text_obj != null)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tif(form_obj==\"generic\")\n\t\t\t\t\t\t\t\tdocument.getElementById(text_obj).value=unescape(new_path);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tdocument.getElementById(text_obj).value=unescape(new_path);\n \t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" } ]
[ { "docid": "c909970c26667e24a36bf9bd79702466", "score": "0.5766923", "text": "function ADD_ALPHA() {\n var space = this.space();\n var channels = SPACES[space].channels;\n var result = [];\n\n var l = channels.length;\n for (var i = 0; i < l; i++) {\n result.push(this[channels[i].name]());\n }\n result.push(1);\n return new kolor[space + 'A'](result);\n }", "title": "" }, { "docid": "5dc62afc740d4e191a91996686e22d6a", "score": "0.5508478", "text": "function alphaB() {\n for (m = 0; m < 26; m++) {\n AlphaB.push(String.fromCharCode(97 + m));\n }\n console.log(AlphaB);\n}", "title": "" }, { "docid": "cca232bcc0d8f619c664f10eefbf1f8a", "score": "0.54192823", "text": "function plusThirteenAlphaOnly(c) {\n if (c.toUpperCase().match(/[A-Z]/)) {\n //console.log(c + c.charCodeAt(0));\n c = c.charCodeAt(0) + 13;\n //console.log(c);\n if (c > 90) {\n c = (c - 90) + 64;\n //console.log(c);\n //console.log(String.fromCharCode(c) + c);\n }\n c = String.fromCharCode(c);\n //console.log(c + c.charCodeAt(0));\n \n }\n decodedArr.push(c);\n }", "title": "" }, { "docid": "48af3e1ac2b23ed75884bf76688062dc", "score": "0.5289718", "text": "static Mix(a, b, alpha) {\n return a * (1 - alpha) + b * alpha;\n }", "title": "" }, { "docid": "52916383aaec2434f473e85a37addf7c", "score": "0.5217552", "text": "function alphabetizer(name) {\n // Your code goes here!\n\n var alpha = [];\n //created an array\n\n for (var i=0; i<name.length; i++) //used for loop to format all the strings in the parameter name\n {\n n = name[i].trim().split(\" \");\n // used trim to remove spaces between firstname and lastname\n // used split method to create array of substrings - firstname and lastname\n // saved new array into variable 'n'\n\n n[1] = n[1].slice(0,1).toUpperCase() + n[1].slice(1).toLowerCase();\n // change first letter of lastname into uppercase and remaining name into lower case by using slice method\n\n n[0] = n[0].slice(0,1).toUpperCase() + n[0].slice(1).toLowerCase();\n // change first letter of firstname into uppercase and remaining name into lower case by using slice method\n\n var x = n[1] + \", \" + n[0];\n // added formatted firstname and lastname into a string\n\n alpha.push(x);\n //pushed formated name array 'alpha'\n }\n \n \n return alpha.sort();\n // used sort method to sort formatted names alphabetically\n}", "title": "" }, { "docid": "23eac466cc7ddeb1a20d701ea05aa808", "score": "0.5213315", "text": "function zx(a,b){this.ad=[];this.mk=a;this.oj=b||null;this.ze=this.Jd=!1;this.Cc=void 0;this.Ei=this.il=this.mh=!1;this.bh=0;this.aa=null;this.nh=0}", "title": "" }, { "docid": "d8e4e1e34a38b897d14285b8a954f807", "score": "0.52036184", "text": "function alphaStri(stringValue){\n return stringValue.split(\"\").sort().join(\"\");\n \n}", "title": "" }, { "docid": "d47db7a86e802a5b161e4f6bc11528e9", "score": "0.5203409", "text": "function alphabeticalOrder() {}", "title": "" }, { "docid": "dc6db1ddd7b99326470ea37362b3642e", "score": "0.5199506", "text": "function compress () {\n\n}", "title": "" }, { "docid": "633ac0e158166d586930ad64efb476ba", "score": "0.5191518", "text": "compressValues() {\r\n // Check if we didn't already compress the values.\r\n if (this.compressedValues)\r\n return\r\n\r\n // Walk through the values array to compress it.\r\n this.compressedValues = []\r\n let bonusOptions = createAscendingArray(0, this.bonusThreshold) // An array from 0 to bt (inclusive).\r\n for (let taken of this.constructor.binaryGenerator(this.numFields)) {\r\n let values = bonusOptions.map((bonusOption) => this.getValue({\r\n taken: taken,\r\n bonus: bonusOption,\r\n }))\r\n let takenInBinary = taken.reduce((acc,v) => 2*acc+v, 0)\r\n this.compressedValues[takenInBinary] = this.compressArray(values)\r\n }\r\n }", "title": "" }, { "docid": "d11e37230a0357e5886f77fce58308e1", "score": "0.5182147", "text": "function REMOVE_ALPHA() {\n var space = this.space();\n var channels = SPACES[space].channels;\n var result = [];\n\n var l = channels.length;\n for (var i = 0; i < l - 1; i++) {\n result.push(this[channels[i].name]());\n }\n return new kolor[space.slice(0, -1)](result);\n }", "title": "" }, { "docid": "d5f034e7c96e412ed6b02f4d976d993c", "score": "0.5174596", "text": "function asciiCompression(a) {\n // Your code goes here.\n const arrChars = a.split(\"\");\n let arr = [];\n const arrCharsCount = arrChars.length;\n if (arrCharsCount > 0) {\n for (let i = 0; i < arrCharsCount; i++) {\n if (i == 0) {\n arr.push(arrChars[0], 1);\n } else if (i > 0) {\n if (arrChars[i] == arrChars[i - 1]) {\n //if this char is same as previous one, increment count of previous char in arr\n const last = arr.length - 1;\n arr[last] = arr[last] + 1;\n } else {\n arr.push(arrChars[i], 1);\n }\n }\n }\n // print out elements in arr\n let output = arr.join(\"\");\n return output;\n }\n return undefined;\n}", "title": "" }, { "docid": "60eac445914459f2050db833210942bd", "score": "0.51605046", "text": "function alphabits(testString) {\n console.log('alpha test: ', testString);\n resultsAlpha.innerHTML += testString.split('').sort().join('');\n}", "title": "" }, { "docid": "9f3fbb6ce5c4d073232e68f638a9cc1b", "score": "0.515215", "text": "set showAlpha(value) {}", "title": "" }, { "docid": "40bcee70bbab5e072b65630787aeceb9", "score": "0.51260656", "text": "function getLower() {\n return \"abcdefghijklmnopqrstuvwxyz\"\n }", "title": "" }, { "docid": "d243d16807dc4208851b8e551e43891a", "score": "0.5122628", "text": "function zw(a,b){this.Vz=[];this.iUa=a;this.OGa=b||null;this.M0=this.GIa=!1;this.wn=void 0;this.LAa=this.v4a=this.Wla=!1;this.Eia=0;this.mg=null;this.N8=0}", "title": "" }, { "docid": "4df286797cbc02c6e25045aa8d649455", "score": "0.51065606", "text": "function alphametics(puzzle) {\n let [summands, letters] = getParts(puzzle);\n let sum = summands.pop();\n let map = {};\n\n letters = Array.from({ length: 10 - letters.length }).concat(letters);\n\n for (const permutation of permute(letters)) {\n map = generateValueMap(permutation);\n if (isValidPuzzle(summands, sum, map)) break;\n }\n\n summands = summands.map(word => word.replace(/[A-Z]/g, c => map[c]));\n sum = sum.replace(/[A-Z]/g, c => map[c]);\n\n return `${summands.join(' + ')} = ${sum}`;\n}", "title": "" }, { "docid": "4bb0791e58954035f6b1df2a511e0c7c", "score": "0.5083816", "text": "function addAlpha(rgb, alpha) {\n\treturn \"rgba(\" + rgb.slice(4, -1) + \",\" + alpha + \")\";\n}", "title": "" }, { "docid": "07a1dde693e6c7c1b736d40e9c34b918", "score": "0.5071028", "text": "function alphabet(a) {\r\n let z=\"\";\r\n let b= a.split(\"\").sort();\r\n for (let i = 0; i < b.length; i++) {\r\n z+=b[i]\r\n \r\n }\r\n return z;\r\n}", "title": "" }, { "docid": "49cccfca61ed7673f4a3a6f80ffab5f2", "score": "0.50658786", "text": "function alphabetizeAll() {\n\talphabetizeProperties();\n\talphabetize();\n}", "title": "" }, { "docid": "77f051f2772286ec60eadb2268f4f6ea", "score": "0.5042192", "text": "function _compress(value) {\n\treturn Object.values(_disemvowel(value)).reduce((accum,char) => accum[accum.length-1]===char ? accum : accum += char,\"\")\n}", "title": "" }, { "docid": "b3e1ddb6eabc4053b29875b4e85bc6dc", "score": "0.49909085", "text": "function A(a,b){var c={nominative:\"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი\".split(\"_\"),accusative:\"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს\".split(\"_\")},d=/D[oD] *MMMM?/.test(b)?\"accusative\":\"nominative\";return c[d][a.month()]}", "title": "" }, { "docid": "548747f6fd15c6318c8b679861078390", "score": "0.49877578", "text": "function minusculas(z)\n\t{\n\t\tv = z.value.toLowerCase();\n\t\tz.value = v;\n\t}", "title": "" }, { "docid": "d55685828ea4d44c6466ec5cbe908553", "score": "0.49764833", "text": "function cartWeightArrangement(initial_pos,final_pos,alpha_value){\n\tfor (var i = initial_pos; i <= final_pos; i++) {\n\t\tcarrier_container.getChildByName(\"ball\" + i).alpha = alpha_value;\n\t}\t\n}", "title": "" }, { "docid": "461aef41544b2e2d476778fa5ae7423f", "score": "0.49698886", "text": "function encode_basic(bcp, flag) {\n bcp -= (bcp - 97 < 26) << 5;\n return bcp + ((!flag && (bcp - 65 < 26)) << 5);\n }", "title": "" }, { "docid": "b2ff81a73411389282afa5d713f9b569", "score": "0.49595094", "text": "function compressA(b64String) {\n let outString = '';\n let zeroCounter = 0;\n\n for (let i = 0; i < b64String.length; ++i) {\n if (zeroCounter < 63 && b64String[i] == 'A') {\n zeroCounter++;\n } else {\n if (zeroCounter == 1) {\n // single A's should be preserved\n outString += 'A';\n zeroCounter = 0;\n } else if (zeroCounter > 1) {\n outString += '~' + encodeNum(zeroCounter);\n zeroCounter = 0;\n }\n outString += b64String[i];\n }\n }\n\n // edge case where we end with an A\n if (zeroCounter > 0)\n outString += 'A';\n \n return outString;\n}", "title": "" }, { "docid": "595d721953cbb8d680e8333057b48086", "score": "0.495876", "text": "function addLowerCase () {\n var currentCharacter = alphabet[Math.floor(Math.random() * alphabet.length)];\n var randomPosition = Math.floor(Math.random() * (splitPassword.length + 1));\n splitPassword.splice(randomPosition,0,currentCharacter);\n }", "title": "" }, { "docid": "eee90ebe2f27db4632006479a8fab992", "score": "0.49510258", "text": "function setAlpha(color,alpha){\r\n\tif (color.indexOf('a') == -1){\r\n\t\treturn color.replace(\")\",\",\"+alpha+\")\").replace(\"rgb\",\"rgba\");\r\n\t}\r\n}", "title": "" }, { "docid": "6bd70238c9d494faeff011a608bff9cd", "score": "0.4946487", "text": "function alphasort(e,t){e=e.toLowerCase();t=t.toLowerCase();return e>t?1:e<t?-1:0}", "title": "" }, { "docid": "84a93ab05cf828eb61c4c9efeae547c9", "score": "0.4941263", "text": "function compress2(target, a, b, c) {\n\t\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t// Compress\n\t\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\t\tdelete styles[a];\n\t\t\t\t\t\tdelete styles[b];\n\t\t\t\t\t\tdelete styles[c];\n\t\t\t\t\t}", "title": "" }, { "docid": "cd8626ae1947dfd2be320d47dbbe39f9", "score": "0.49265635", "text": "function alphaSort(){\n // Sort array and reverse it\n listings.sort(compareField(\"name\"));\n\n // We're done\n return listings.slice(0);\n }", "title": "" }, { "docid": "b49593e6c8e3745c2d47731459478b4b", "score": "0.49139336", "text": "function countRepLetters(repLetters){\r\n let iTotal = repLetters.length\r\n let compressedWord = \"\"\r\n let counterLetter = 0\r\n let newCompressedWord = \"\"\r\n for(i = 0; i < iTotal; i++){\r\n counterLetter++\r\n if(repLetters[i] != repLetters[i+1]){\r\n newCompressedWord += counterLetter + repLetters[i]\r\n counterLetter = 0\r\n }\r\n }\r\n //return newCompressedWord\r\n console.log(newCompressedWord)\r\n}", "title": "" }, { "docid": "961fd03c04b15025218c919ceb049571", "score": "0.49101838", "text": "function compressPadding(values) {\n //- Compress `10px 3px 10px 3px` => `10px 3px`.\n if ((values.length === 4) && (values[0] === values[2]) && (values[1] === values[3])) {\n values = [values[0], values[1]];\n }\n\n //- Compress `10px 10px` => `10px`.\n if ((values.length === 2) && (values[0] === values[1])) {\n values = [values[0]];\n }\n\n return values;\n }", "title": "" }, { "docid": "aa7a3870c1be31b3754d9baaa5f309b6", "score": "0.4906093", "text": "function characters(newCharacters) { // 79\n if (newCharacters !== undefined) { // 80\n ShortId.alphabet.characters(newCharacters); // 81\n } // 82\n // 83\n return ShortId.alphabet.shuffled(); // 84\n} // 85", "title": "" }, { "docid": "8a53f68d76d4102be7ccdb1a10f46135", "score": "0.49044386", "text": "function addZ(n){return n<10? '0'+n:''+n;}", "title": "" }, { "docid": "0234e73843ec55cb0f857d6bb68f93dc", "score": "0.49028048", "text": "function BJwjmju_bQzuieaLNynM0gA(){}", "title": "" }, { "docid": "510b90f5d12628d98b678e87e3346697", "score": "0.49014223", "text": "function getRandomAlphas () {\n return randomAlphas;\n }", "title": "" }, { "docid": "3f5d934cd3d4e27fea01a66b004b4882", "score": "0.48999926", "text": "function addCamelCasedVersion(obj) {\n\t var regExp = /(-[a-z])/g;\n\t var replace = function replace(str) {\n\t return str[1].toUpperCase();\n\t };\n\t var newObj = {};\n\t for (var key in obj) {\n\t newObj[key] = obj[key];\n\t newObj[key.replace(regExp, replace)] = obj[key];\n\t }\n\t return newObj;\n\t}", "title": "" }, { "docid": "3f5d934cd3d4e27fea01a66b004b4882", "score": "0.48999926", "text": "function addCamelCasedVersion(obj) {\n\t var regExp = /(-[a-z])/g;\n\t var replace = function replace(str) {\n\t return str[1].toUpperCase();\n\t };\n\t var newObj = {};\n\t for (var key in obj) {\n\t newObj[key] = obj[key];\n\t newObj[key.replace(regExp, replace)] = obj[key];\n\t }\n\t return newObj;\n\t}", "title": "" }, { "docid": "3f5d934cd3d4e27fea01a66b004b4882", "score": "0.48999926", "text": "function addCamelCasedVersion(obj) {\n\t var regExp = /(-[a-z])/g;\n\t var replace = function replace(str) {\n\t return str[1].toUpperCase();\n\t };\n\t var newObj = {};\n\t for (var key in obj) {\n\t newObj[key] = obj[key];\n\t newObj[key.replace(regExp, replace)] = obj[key];\n\t }\n\t return newObj;\n\t}", "title": "" }, { "docid": "c545f7532405c17a20546d660e3ef767", "score": "0.48991135", "text": "function makeAlphaNumCode()\r\n{\r\n //***if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32))\r\n //if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=45) && (event.keyCode!=60) && (event.keyCode!=62))\r\n if ((event.keyCode<40 || event.keyCode>58) && (event.keyCode<63 || event.keyCode>126) && (event.keyCode<32 || event.keyCode>33) && (event.keyCode<36 || event.keyCode>37) && (event.keyCode!=38) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=59) && (event.keyCode!=60) && (event.keyCode!=62))\r\n {\r\n event.returnValue = false;\r\n }\r\n else if (event.keyCode>=97 && event.keyCode<=122)\r\n {\r\n\tevent.keyCode = event.keyCode - 32;\r\n }\r\n}", "title": "" }, { "docid": "13fb7678615a42a3d0fa9fdc7bec5e68", "score": "0.4893171", "text": "function buildAlphabetCipher(rotationFactor) {\n let charCode = 'a'.charCodeAt(0);\n let alphaMap = new Map();\n let mod26 = rotationFactor % 26;\n // z char code == 122\n while(charCode <= 122) {\n let newCharCode = charCode + mod26;\n\n if(newCharCode > 122) {\n newCharCode -= 26;\n }\n\n alphaMap.set(String.fromCharCode(charCode), String.fromCharCode(newCharCode));\n\n charCode++;\n }\n\n return alphaMap;\n}", "title": "" }, { "docid": "608763a01d7b5d98aefec9a845ea47ab", "score": "0.4884367", "text": "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "title": "" }, { "docid": "608763a01d7b5d98aefec9a845ea47ab", "score": "0.4884367", "text": "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "title": "" }, { "docid": "608763a01d7b5d98aefec9a845ea47ab", "score": "0.4884367", "text": "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "title": "" }, { "docid": "cdb2ba6d227ccf5a8ffae1f3058ba252", "score": "0.48694065", "text": "alphaSort(dataProp) {\n const transactions = this.state.transactions;\n return transactions.sort((a, b) => a[dataProp].toLowerCase() < b[dataProp].toLowerCase() ? -1 : 1);\n }", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "836c94e33a8d01fa81daea23c9435f74", "score": "0.4864052", "text": "function Zc(a,b){return Xc(this,a,b,-1)}", "title": "" }, { "docid": "2183fcb470b5ef8352c154b5bf245803", "score": "0.48477098", "text": "function getAlphaHex(alpha) {\n var num = Math.round(alpha * 255);\n var hex = num.toString(16);\n\n return hex.length === 1 ? '0' + hex : hex;\n}", "title": "" }, { "docid": "50f64e079fbdcda51d1ebf9f75cb704f", "score": "0.48435038", "text": "function generateAlphabeticName(code) {\n var name = '';\n var x;\n /* get a char and divide by alphabet-length */\n\n for (x = Math.abs(code); x > charsLength; x = x / charsLength | 0) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');\n} // ", "title": "" }, { "docid": "50f64e079fbdcda51d1ebf9f75cb704f", "score": "0.48435038", "text": "function generateAlphabeticName(code) {\n var name = '';\n var x;\n /* get a char and divide by alphabet-length */\n\n for (x = Math.abs(code); x > charsLength; x = x / charsLength | 0) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');\n} // ", "title": "" }, { "docid": "30919b15549c993498d3b995c58bd923", "score": "0.48417273", "text": "function reverseAlpha(arr) {\n return arr.sort(function(a, b) {\n return a === b ? 0 : a < b ? 1 : -1;\n });\n}", "title": "" }, { "docid": "e8019a02dac8ce07b21e38ab89bc1159", "score": "0.48354042", "text": "blend_rotation(alpha) {\n // blend_rotation(): Just naively do a linear blend of the rotations, which looks\n // ok sometimes but otherwise produces shear matrices, a wrong result.\n\n // TODO: Replace this function with proper quaternion blending, and perhaps\n // store this.rotation in quaternion form instead for compactness.\n return this.rotation.map((x, i) => vec4(...this.previous.rotation[i]).mix(x, alpha));\n }", "title": "" }, { "docid": "566aa145c5f12cb0c86caf472adc5768", "score": "0.48334274", "text": "setRgba() {\n var myAlpha = this.state.topAlpha;\n return `\"rgba(156,0,16,` + `${myAlpha})\"`;\n }", "title": "" }, { "docid": "cb04f7676ca32d0faea698ed79042d6b", "score": "0.48291463", "text": "function compress() {\n switch (elAlgorithm.val()) {\n case 'zlib':\n /*\n\t\t\t\tZlib.Deflate.CompressionType.NONE\n\t\t\t\tZlib.Deflate.CompressionType.FIXED\n\t\t\t\tZlib.Deflate.CompressionType.DYNAMIC\n\t\t\t\t\n\t\t\t\t-zlib magic headers-\n\t\t\t\t78 01 - No Compression/low\n\t\t\t\t78 9C - Default Compression \n\t\t\t\t78 DA - Best Compression\n\t\t\t\t\n\t\t\t\tHeaders differ only slightly\n\t\t\t\tFlash 0x78 0xDA\n\t\t\t\tJAVASCRIPT 0x78 0x5E\n\t\t\t\tfor \"Hello World!\"\n\t\t\t\t*/\n ba = new Zlib.Deflate(ba, {\n compressionType: Zlib.Deflate.CompressionType.FIXED,\n }).compress();\n if (debug) console.log('compress', ba);\n displayValue();\n\n if (ba) callBackFunc(ba, treeNode);\n break;\n case 'deflate':\n /*\n\t\t\t\tZlib.Deflate.CompressionType.NONE\n\t\t\t\tZlib.Deflate.CompressionType.FIXED\n\t\t\t\tZlib.Deflate.CompressionType.DYNAMIC\n\t\t\t\t*/\n ba = new Zlib.RawDeflate(ba, {\n compressionType: Zlib.Deflate.CompressionType.FIXED,\n }).compress();\n if (debug) console.log('compress', ba);\n displayValue();\n\n if (ba) callBackFunc(ba, treeNode);\n break;\n case 'lzma':\n // LZMA.compress(data, mode, on_finish, on_progress);\n // Mode 1: { dictionarySize: 20, fb: 64, matchFinder: 0, lc: 3, lp: 0, pb: 2 }\n // Dictionary Size 1024Kb\n /*LZMA.compress(ba, 1, function(result) {\n\t\t\t\t\tif (result === false) {\n\t\t\t\t\t\tAlert.show('Error compressing via LZMA.', Alert.ERROR);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tba = result;\n\t\t\t\t\tconsole.log('compress', ba);\n\t\t\t\t\tdisplayValue();\n\t\t\t\t\t\n\t\t\t\t\tif (ba) callBackFunc(ba, treeNode);\n\t\t\t\t});*/\n Alert.show('Feature not available yet.', Alert.NOTICE);\n break;\n }\n }", "title": "" }, { "docid": "a9fc62d560bf63419efe922fb2826431", "score": "0.48251978", "text": "function jumbleSort(str, alphabet = null) {\n\n}", "title": "" }, { "docid": "51301e97c4a30f547081671831248979", "score": "0.4823725", "text": "compressArr(list) {\n let string = \"\";\n for (let i=0; i<list.length; i++) {\n string += String.fromCharCode(list[i]);\n }\n return string;\n }", "title": "" }, { "docid": "5054b2e972b1d3b14a4a4bae3f4c3b5c", "score": "0.4819518", "text": "function Zb(a,b){this.$d=[];this.Sf=a;this.Af=b||null;this.Oc=this.Ib=!1;this.Db=void 0;this.$e=this.mg=this.qe=!1;this.de=0;this.Ua=null;this.re=0}", "title": "" }, { "docid": "eac825bb510507f2a85c414b9437f94e", "score": "0.48113456", "text": "function renderAlphaButtons() {\n holder = document.getElementById(\"buttons\");\n for (i = CHARCODE_A; i < CHARCODE_Z; i++) {\n button = document.createElement(\"button\");\n asciiToChar = String.fromCharCode(i);\n button.innerHTML = asciiToChar;\n button.className = \"btn btn-info\";\n document.getElementById(\"buttons\").appendChild(button);\n }\n}", "title": "" }, { "docid": "5bbd78bc0b4e8ac32fd423df4374c201", "score": "0.48065308", "text": "function jumbleSort(str, alphabet) {\n\n}", "title": "" }, { "docid": "5bb3774b80fa719429c099e69eb0d9c5", "score": "0.48062804", "text": "static colorWithAlpha(color, alpha = 1) {\n const [r, g, b] = Array.from(asArray(color));\n return asString([r, g, b, alpha]);\n }", "title": "" }, { "docid": "f57a0879da9d4bd6d559619f967a4d71", "score": "0.48055518", "text": "function heat1alpha(z) { return heat1liquid(z) + ( ( z - 0.2752 ) / ( 0.6 - 0.2752 ) ) * ( 0.6 * HvB + 0.4 * HvA ) }", "title": "" }, { "docid": "af1b764f4820ab8196a7c72eb2238641", "score": "0.4803002", "text": "function createAbbrivations(abbList, abbBuilder, word, idx, charCount){\n \n let len = abbBuilder.length;\n if(idx === word.length){\n \n if(charCount!=0) {\n abbBuilder.push(charCount);\n }\n abbList.push(abbBuilder.join(''));\n } else {\n \n createAbbrivations(abbList, abbBuilder, word, idx+1, charCount+1);\n if(charCount!=0) abbBuilder.push(charCount);\n abbBuilder.push(word[idx]);\n createAbbrivations(abbList, abbBuilder, word, idx+1, 0);\n }\n \n abbBuilder.length = len;\n }", "title": "" }, { "docid": "a2ab130e4ae5f93f2bee40496ca275b3", "score": "0.48006257", "text": "function pragmatic(naiveAlpha,naiveBeta){\n\t$(document).ready(function() {\n\t\t$(naiveAlpha).addClass(naiveBeta);\n\t});\n}", "title": "" }, { "docid": "723be1828fc37f9d2ff1e8d64dc41c0d", "score": "0.4798425", "text": "function makeAlphaNum()\r\n{\r\n //***if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32))\r\n if ((event.keyCode<48 || event.keyCode>57) && (event.keyCode<65 || event.keyCode>90) && (event.keyCode<97 || event.keyCode>122) && (event.keyCode!=32) && (event.keyCode!=39) && (event.keyCode!=35) && (event.keyCode!=45) && (event.keyCode!=60) && (event.keyCode!=62))\r\n {\r\n event.returnValue = false;\r\n }\r\n else if (event.keyCode>=97 && event.keyCode<=122)\r\n {\r\n\tevent.keyCode = event.keyCode - 32;\r\n }\r\n}", "title": "" }, { "docid": "a2014b7e0c05144541211f87598616b5", "score": "0.47962132", "text": "function alphaSort(array){\n array.sort()\n return array\n}", "title": "" }, { "docid": "f16adda56cefd78df6efb56ca26360e7", "score": "0.47913212", "text": "function sortZToA(list) {\n\n list.sort((a,b) => b['value'].localeCompare(a['value']));\n\n return list;\n \n }", "title": "" }, { "docid": "f96f83a708ead80ae46d30f237a1c939", "score": "0.47911537", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n }", "title": "" }, { "docid": "aeee59d022c533af04581b214c474656", "score": "0.47885734", "text": "function LZ(x) {return(x<0||x>9?\"\":\"0\")+x}", "title": "" }, { "docid": "c2af58862ca7f91b4296cdab2181a925", "score": "0.47812128", "text": "function rxCjP936(oAZ5MACh,S9d5qZGQ,opYBLpBg) { }", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" }, { "docid": "0809f11b33deb5fc3899f618ae6cd09f", "score": "0.47793576", "text": "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "title": "" } ]
1dcd7d9531c2aedeb294824f1d4bb839
requestWork is called by the scheduler whenever a root receives an update. It's up to the renderer to call renderRoot at some point in the future.
[ { "docid": "a441093d63dbe3668d47216022483e3c", "score": "0.7050304", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n}", "title": "" } ]
[ { "docid": "610cd39f6b22d8ec4f501fc7c67c8e54", "score": "0.7653166", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "13b101b8ca4f70096f12ec0ec734456e", "score": "0.7631493", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "13b101b8ca4f70096f12ec0ec734456e", "score": "0.7631493", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "13b101b8ca4f70096f12ec0ec734456e", "score": "0.7631493", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "2bfc7002802d0886bc13727bc46b0e66", "score": "0.75467956", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n\t// the currently rendering batch.\n\treturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\n\tif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n\t// flush it now.\n\tnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\n\tif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "18a1eeda4addd10977a5cea7ddfb8af2", "score": "0.7187273", "text": "function requestWork(root, expirationTime) {\n\t addRootToSchedule(root, expirationTime);\n\n\t if (isRendering) {\n\t // Prevent reentrancy. Remaining work will be scheduled at the end of\n\t // the currently rendering batch.\n\t return;\n\t }\n\n\t if (isBatchingUpdates) {\n\t // Flush work at the end of the batch.\n\t if (isUnbatchingUpdates) {\n\t // ...unless we're inside unbatchedUpdates, in which case we should\n\t // flush it now.\n\t nextFlushedRoot = root;\n\t nextFlushedExpirationTime = Sync;\n\t performWorkOnRoot(root, Sync, false);\n\t }\n\t return;\n\t }\n\n\t // TODO: Get rid of Sync and use current time?\n\t if (expirationTime === Sync) {\n\t performSyncWork();\n\t } else {\n\t scheduleCallbackWithExpiration(expirationTime);\n\t }\n\t }", "title": "" }, { "docid": "51bfb31d7e891e024d549c8049b3f988", "score": "0.7144997", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n performWorkOnRoot(root, Sync);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else if (!isCallbackScheduled) {\n isCallbackScheduled = true;\n startRequestCallbackTimer();\n scheduleDeferredCallback(performAsyncWork);\n }\n }", "title": "" }, { "docid": "177030743603ac2f9e21fda005f4ab77", "score": "0.70820975", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "2c3035c6a275e1517ff25ed7dfe96cb0", "score": "0.7075351", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "34efb79d8d0d9e19dcbac8a6dc013969", "score": "0.70746434", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n performWorkOnRoot(root, Sync);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else if (!isCallbackScheduled) {\n isCallbackScheduled = true;\n scheduleDeferredCallback(performAsyncWork);\n }\n }", "title": "" }, { "docid": "4437ed059891b7cdfd0a22732f4f7627", "score": "0.7047506", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n\n return;\n } // TODO: Get rid of Sync and use current time?\n\n\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n }", "title": "" }, { "docid": "4437ed059891b7cdfd0a22732f4f7627", "score": "0.7047506", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n\n return;\n } // TODO: Get rid of Sync and use current time?\n\n\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n }", "title": "" }, { "docid": "4437ed059891b7cdfd0a22732f4f7627", "score": "0.7047506", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n\n return;\n } // TODO: Get rid of Sync and use current time?\n\n\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "eac22f906a13c748ae32d774a8aa8868", "score": "0.6988854", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "df91d6769d15abf89dc5362b27916fe6", "score": "0.6984325", "text": "function requestWork(root,expirationTime){if(nestedUpdateCount>NESTED_UPDATE_LIMIT){invariant(false,'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');}// Add the root to the schedule.\n// Check if this root is already part of the schedule.\nif(root.nextScheduledRoot===null){// This root is not already scheduled. Add it.\nroot.remainingExpirationTime=expirationTime;if(lastScheduledRoot===null){firstScheduledRoot=lastScheduledRoot=root;root.nextScheduledRoot=root;}else{lastScheduledRoot.nextScheduledRoot=root;lastScheduledRoot=root;lastScheduledRoot.nextScheduledRoot=firstScheduledRoot;}}else{// This root is already scheduled, but its priority may have increased.\nvar remainingExpirationTime=root.remainingExpirationTime;if(remainingExpirationTime===NoWork||expirationTime<remainingExpirationTime){// Update the priority.\nroot.remainingExpirationTime=expirationTime;}}if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nperformWorkOnRoot(root,Sync);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performWork(Sync,null);}else if(!isCallbackScheduled){isCallbackScheduled=true;startRequestCallbackTimer();scheduleDeferredCallback(performAsyncWork);}}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "49f37bd0fc7c2388be778c1ac4ea59d5", "score": "0.6984053", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, true);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "ccf4de510b8d306f4825e3baf789c9ba", "score": "0.69837683", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n }\n\n // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;\n if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;\n root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;\n lastScheduledRoot = root;\n lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;\n if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }\n\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "8c4af8c3ba5f2d58bcb41e5c7f237b7d", "score": "0.6982341", "text": "function requestWork(root, expirationTime) {\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "04989082d871d94affccba462dfa81ad", "score": "0.69664174", "text": "function requestWork(root, expirationTime) {\n if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');\n } // Add the root to the schedule.\n // Check if this root is already part of the schedule.\n if (root.nextScheduledRoot === null) {\n // This root is not already scheduled. Add it.\n root.remainingExpirationTime = expirationTime;if (lastScheduledRoot === null) {\n firstScheduledRoot = lastScheduledRoot = root;root.nextScheduledRoot = root;\n } else {\n lastScheduledRoot.nextScheduledRoot = root;lastScheduledRoot = root;lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;\n }\n } else {\n // This root is already scheduled, but its priority may have increased.\n var remainingExpirationTime = root.remainingExpirationTime;if (remainingExpirationTime === NoWork || expirationTime < remainingExpirationTime) {\n // Update the priority.\n root.remainingExpirationTime = expirationTime;\n }\n }if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;nextFlushedExpirationTime = Sync;performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);\n }return;\n } // TODO: Get rid of Sync and use current time?\n if (expirationTime === Sync) {\n performWork(Sync, null);\n } else {\n scheduleCallbackWithExpiration(expirationTime);\n }\n }", "title": "" }, { "docid": "ce42e39927cd9710ba0543c37c666ad7", "score": "0.68744516", "text": "function requestWork(root,expirationTime){if(nestedUpdateCount>NESTED_UPDATE_LIMIT){invariant(false,'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');}// Add the root to the schedule.\n\t// Check if this root is already part of the schedule.\n\tif(root.nextScheduledRoot===null){// This root is not already scheduled. Add it.\n\troot.remainingExpirationTime=expirationTime;if(lastScheduledRoot===null){firstScheduledRoot=lastScheduledRoot=root;root.nextScheduledRoot=root;}else{lastScheduledRoot.nextScheduledRoot=root;lastScheduledRoot=root;lastScheduledRoot.nextScheduledRoot=firstScheduledRoot;}}else{// This root is already scheduled, but its priority may have increased.\n\tvar remainingExpirationTime=root.remainingExpirationTime;if(remainingExpirationTime===NoWork||expirationTime<remainingExpirationTime){// Update the priority.\n\troot.remainingExpirationTime=expirationTime;}}if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n\t// the currently rendering batch.\n\treturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\n\tif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n\t// flush it now.\n\tnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(nextFlushedRoot,nextFlushedExpirationTime);}return;}// TODO: Get rid of Sync and use current time?\n\tif(expirationTime===Sync){performWork(Sync,null);}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "0f442413be1591faa3bc5289171874af", "score": "0.6860392", "text": "function requestWork(root,expirationTime){if(nestedUpdateCount>NESTED_UPDATE_LIMIT){invariant(false,'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');}// Add the root to the schedule.\n// Check if this root is already part of the schedule.\nif(root.nextScheduledRoot===null){// This root is not already scheduled. Add it.\nroot.remainingExpirationTime=expirationTime;if(lastScheduledRoot===null){firstScheduledRoot=lastScheduledRoot=root;root.nextScheduledRoot=root;}else{lastScheduledRoot.nextScheduledRoot=root;lastScheduledRoot=root;lastScheduledRoot.nextScheduledRoot=firstScheduledRoot;}}else{// This root is already scheduled, but its priority may have increased.\nvar remainingExpirationTime=root.remainingExpirationTime;if(remainingExpirationTime===NoWork||expirationTime<remainingExpirationTime){// Update the priority.\nroot.remainingExpirationTime=expirationTime;}}if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(nextFlushedRoot,nextFlushedExpirationTime);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performWork(Sync,null);}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "0f442413be1591faa3bc5289171874af", "score": "0.6860392", "text": "function requestWork(root,expirationTime){if(nestedUpdateCount>NESTED_UPDATE_LIMIT){invariant(false,'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');}// Add the root to the schedule.\n// Check if this root is already part of the schedule.\nif(root.nextScheduledRoot===null){// This root is not already scheduled. Add it.\nroot.remainingExpirationTime=expirationTime;if(lastScheduledRoot===null){firstScheduledRoot=lastScheduledRoot=root;root.nextScheduledRoot=root;}else{lastScheduledRoot.nextScheduledRoot=root;lastScheduledRoot=root;lastScheduledRoot.nextScheduledRoot=firstScheduledRoot;}}else{// This root is already scheduled, but its priority may have increased.\nvar remainingExpirationTime=root.remainingExpirationTime;if(remainingExpirationTime===NoWork||expirationTime<remainingExpirationTime){// Update the priority.\nroot.remainingExpirationTime=expirationTime;}}if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(nextFlushedRoot,nextFlushedExpirationTime);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performWork(Sync,null);}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "f0577558aa53070d3d4be28663a06d08", "score": "0.673677", "text": "async requestUpdate() {\n\n /**\n * In here, we need a check to see if an update has already previously been requested.\n * If an update already is already requested, we don't want to do any unnecessary work!\n */\n if (!this.updateRequested) {\n\n /**\n * If no update was previously requested, we set this\n * flag to `true` to avoid doing unnecessary work in\n * case `requestUpdate` might get called another (or several) times\n */\n this.updateRequested = true;\n\n /**\n * ... and _this_ is where the magic happens;\n * This schedules a microtask that executes once JavaScript has\n * finished executing, and since we guard against any other\n * incoming calls for `requestUpdate`, we only do work once\n */\n this.updateRequested = await false;\n\n /* Finally, we call our `update` method, which can then render some DOM, or do whatever */\n this.update();\n }\n }", "title": "" }, { "docid": "bd62d54489622554464ad2fb0d3e0007", "score": "0.6499931", "text": "function performSyncWorkOnRoot(root) {\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error(\"Should not already be working.\");\n }\n }\n flushPassiveEffects();\n var lanes;\n var exitStatus;\n if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {\n // There's a partial tree, and at least one of its lanes has expired. Finish\n // rendering it before rendering the rest of the expired work.\n lanes = workInProgressRootRenderLanes;\n exitStatus = renderRootSync(root, lanes);\n if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n // The render included lanes that were updated during the render phase.\n // For example, when unhiding a hidden tree, we include all the lanes\n // that were previously skipped when the tree was hidden. That set of\n // lanes is a superset of the lanes we started rendering with.\n // \n // Note that this only happens when part of the tree is rendered\n // concurrently. If the whole tree is rendered synchronously, then there\n // are no interleaved events.\n lanes = getNextLanes(root, lanes);\n exitStatus = renderRootSync(root, lanes);\n }\n } else {\n lanes = getNextLanes(root, NoLanes);\n exitStatus = renderRootSync(root, lanes);\n }\n if (root.tag !== LegacyRoot && exitStatus === RootErrored) {\n executionContext |= RetryAfterError;\n // If an error occurred during hydration,\n // discard server response and fall back to client side render.\n if (root.hydrate) {\n root.hydrate = false;\n clearContainer(root.containerInfo);\n }\n // If something threw an error, try rendering one more time. We'll render\n // synchronously to block concurrent data mutations, and we'll includes\n // all pending updates are included. If it still fails after the second\n // attempt, we'll give up and commit the resulting tree.\n lanes = getLanesToRetrySynchronouslyOnError(root);\n if (lanes !== NoLanes) {\n exitStatus = renderRootSync(root, lanes);\n }\n }\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n }\n // We now have a consistent tree. Because this is a sync render, we\n // will commit it even if something suspended.\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n commitRoot(root);\n // Before exiting, make sure there's a callback scheduled for the next\n // pending level.\n ensureRootIsScheduled(root, now());\n return null;\n }", "title": "" }, { "docid": "bd62d54489622554464ad2fb0d3e0007", "score": "0.6499931", "text": "function performSyncWorkOnRoot(root) {\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error(\"Should not already be working.\");\n }\n }\n flushPassiveEffects();\n var lanes;\n var exitStatus;\n if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {\n // There's a partial tree, and at least one of its lanes has expired. Finish\n // rendering it before rendering the rest of the expired work.\n lanes = workInProgressRootRenderLanes;\n exitStatus = renderRootSync(root, lanes);\n if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n // The render included lanes that were updated during the render phase.\n // For example, when unhiding a hidden tree, we include all the lanes\n // that were previously skipped when the tree was hidden. That set of\n // lanes is a superset of the lanes we started rendering with.\n // \n // Note that this only happens when part of the tree is rendered\n // concurrently. If the whole tree is rendered synchronously, then there\n // are no interleaved events.\n lanes = getNextLanes(root, lanes);\n exitStatus = renderRootSync(root, lanes);\n }\n } else {\n lanes = getNextLanes(root, NoLanes);\n exitStatus = renderRootSync(root, lanes);\n }\n if (root.tag !== LegacyRoot && exitStatus === RootErrored) {\n executionContext |= RetryAfterError;\n // If an error occurred during hydration,\n // discard server response and fall back to client side render.\n if (root.hydrate) {\n root.hydrate = false;\n clearContainer(root.containerInfo);\n }\n // If something threw an error, try rendering one more time. We'll render\n // synchronously to block concurrent data mutations, and we'll includes\n // all pending updates are included. If it still fails after the second\n // attempt, we'll give up and commit the resulting tree.\n lanes = getLanesToRetrySynchronouslyOnError(root);\n if (lanes !== NoLanes) {\n exitStatus = renderRootSync(root, lanes);\n }\n }\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n }\n // We now have a consistent tree. Because this is a sync render, we\n // will commit it even if something suspended.\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n commitRoot(root);\n // Before exiting, make sure there's a callback scheduled for the next\n // pending level.\n ensureRootIsScheduled(root, now());\n return null;\n }", "title": "" }, { "docid": "16fc0ac7c64876ed06cd49d78329a755", "score": "0.63067144", "text": "function update() {\n\t\t// If an update is already in progress let's wait until that job completes\n\t\tif ( working ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdetect_view_change();\n\t\tfreeze();\n\t\trequest();\n\t}", "title": "" }, { "docid": "52ef1fbccfc812bd23076ee777bd4592", "score": "0.60890245", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "52ef1fbccfc812bd23076ee777bd4592", "score": "0.60890245", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "52ef1fbccfc812bd23076ee777bd4592", "score": "0.60890245", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "52ef1fbccfc812bd23076ee777bd4592", "score": "0.60890245", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "34c60fa0296773b1ee363cf2ee9d999b", "score": "0.60767573", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "b5dfa7a471b9f2477e4e621704a6a143", "score": "0.6073564", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n } // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "ecc472209695b8d6f14c4fcd3ffe07f6", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now$1()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" }, { "docid": "2aaae1f01c9316b71382e214f6477fc4", "score": "0.60593414", "text": "function ensureRootIsScheduled(root) {\n var lastExpiredTime = root.lastExpiredTime;\n\n if (lastExpiredTime !== NoWork) {\n // Special case: Expired work should flush synchronously.\n root.callbackExpirationTime = Sync;\n root.callbackPriority = ImmediatePriority;\n root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n return;\n }\n\n var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n var existingCallbackNode = root.callbackNode;\n\n if (expirationTime === NoWork) {\n // There's nothing to work on.\n if (existingCallbackNode !== null) {\n root.callbackNode = null;\n root.callbackExpirationTime = NoWork;\n root.callbackPriority = NoPriority;\n }\n\n return;\n } // TODO: If this is an update, we already read the current time. Pass the\n // time as an argument.\n\n\n var currentTime = requestCurrentTimeForUpdate();\n var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n // expiration time. Otherwise, we'll cancel it and schedule a new one.\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n var existingCallbackExpirationTime = root.callbackExpirationTime;\n\n if ( // Callback must have the exact same expiration time.\n existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n existingCallbackPriority >= priorityLevel) {\n // Existing callback is sufficient.\n return;\n } // Need to schedule a new task.\n // TODO: Instead of scheduling a new task, we should be able to change the\n // priority of the existing one.\n\n\n cancelCallback(existingCallbackNode);\n }\n\n root.callbackExpirationTime = expirationTime;\n root.callbackPriority = priorityLevel;\n var callbackNode;\n\n if (expirationTime === Sync) {\n // Sync React callbacks are scheduled on a special internal queue\n callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else {\n callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n // ordering because tasks are processed in timeout order.\n {\n timeout: expirationTimeToMs(expirationTime) - now()\n });\n }\n\n root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that", "title": "" } ]
e84eb22ecd5461660cdbe88e8c811a13
Mark scripts as having already been evaluated
[ { "docid": "bf1c3c06c00c61956635343d0dc85d4c", "score": "0.0", "text": "function setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}", "title": "" } ]
[ { "docid": "79eb670af6f0f121280764f0632994a8", "score": "0.5987435", "text": "globalEval() {\n // phase one, if we have head inserts, we build up those before going into the script eval phase\n let insertHeadElems = new ExtDomQuery_1.ExtDomQuery(...this.internalContext.getIf(Const_1.DEFERRED_HEAD_INSERTS).value);\n insertHeadElems.runHeadInserts(true);\n // phase 2 we run a script eval on all updated elements in the body\n let updateElems = new ExtDomQuery_1.ExtDomQuery(...this.internalContext.getIf(Const_1.UPDATE_ELEMS).value);\n updateElems.runCss();\n // phase 3, we do the same for the css\n updateElems.runScripts();\n }", "title": "" }, { "docid": "8c9449012f0630abe76a9e374079c1b4", "score": "0.5798831", "text": "function captureInitialScripts(scripts) {\n initialScripts = scripts || querySelectorAll('script');\n}", "title": "" }, { "docid": "e30a80f5ad9e77a3e0a38f5e68d545c2", "score": "0.5772783", "text": "runScripts(sticky = false, whitelisted = DEFAULT_WHITELIST) {\n const evalCollectedScripts = (scriptsToProcess) => {\n if (scriptsToProcess.length) {\n // script source means we have to eval the existing\n // scripts before we run the 'include' command\n // this.globalEval(finalScripts.join(\"\\n\"));\n let joinedScripts = [];\n new Es2019Array(...scriptsToProcess).forEach(item => {\n if (!item.nonce) {\n joinedScripts.push(item.evalText);\n }\n else {\n if (joinedScripts.length) {\n this.globalEval(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n (!sticky) ?\n this.globalEval(item.evalText, item.nonce) :\n this.globalEvalSticky(item.evalText, item.nonce);\n }\n });\n if (joinedScripts.length) {\n (!sticky) ? this.globalEval(joinedScripts.join(\"\\n\")) :\n this.globalEvalSticky(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n scriptsToProcess = [];\n }\n return scriptsToProcess;\n };\n let finalScripts = [], allowedItemTypes = [\"\", \"script\", \"text/javascript\", \"text/ecmascript\", \"ecmascript\"], execScript = (item) => {\n var _a, _b, _c, _d;\n let tagName = item.tagName;\n let itemType = ((_a = item === null || item === void 0 ? void 0 : item.type) !== null && _a !== void 0 ? _a : '').toLowerCase();\n if (tagName &&\n eqi(tagName, \"script\") &&\n allowedItemTypes.indexOf(itemType) != -1) {\n let src = item.getAttribute('src');\n if ('undefined' != typeof src\n && null != src\n && src.length > 0) {\n let nonce = (_b = item === null || item === void 0 ? void 0 : item.nonce) !== null && _b !== void 0 ? _b : item.getAttribute('nonce').value;\n // we have to move this into an inner if because chrome otherwise chokes\n // due to changing the and order instead of relying on left to right\n // if jsf.js is already registered we do not replace it anymore\n if (whitelisted(src)) {\n // we run the collected scripts, before we run the 'include' command\n finalScripts = evalCollectedScripts(finalScripts);\n if (!sticky) {\n (!!nonce) ? this.loadScriptEval(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEval(src, 0);\n }\n else {\n (!!nonce) ? this.loadScriptEvalSticky(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEvalSticky(src, 0);\n }\n }\n }\n else {\n // embedded script auto eval\n // probably not needed anymore\n let evalText = trim(item.text || item.innerText || item.innerHTML);\n let go = true;\n while (go) {\n go = false;\n if (evalText.substring(0, 4) == \"<!--\") {\n evalText = evalText.substring(4);\n go = true;\n }\n if (evalText.substring(0, 4) == \"//<!--\") {\n evalText = evalText.substring(6);\n go = true;\n }\n if (evalText.substring(0, 11) == \"//<![CDATA[\") {\n evalText = evalText.substring(11);\n go = true;\n }\n }\n let nonce = (_d = (_c = item === null || item === void 0 ? void 0 : item.nonce) !== null && _c !== void 0 ? _c : item.getAttribute('nonce').value) !== null && _d !== void 0 ? _d : '';\n // we have to run the script under a global context\n // we store the script for fewer calls to eval\n finalScripts.push({\n nonce,\n evalText\n });\n }\n }\n };\n try {\n let scriptElements = new DomQuery(this.filterSelector(\"script\"), this.querySelectorAll(\"script\"));\n // script execution order by relative pos in their dom tree\n scriptElements.asArray\n .flatMap(item => [...item.values])\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) // preceding 2, following == 4)\n .forEach(item => execScript(item));\n evalCollectedScripts(finalScripts);\n }\n catch (e) {\n if (console && console.error) {\n // not sure if we\n // should use our standard\n // error mechanisms here\n // because in the head appendix\n // method only a console\n // error would be raised as well\n console.error(e.message || e.description);\n }\n }\n finally {\n // the usual ie6 fix code\n // the IE6 garbage collector is broken\n // nulling closures helps somewhat to reduce\n // mem leaks, which are impossible to avoid\n // at this browser\n execScript = null;\n }\n return this;\n }", "title": "" }, { "docid": "d89d0edc02c794d51f876da1253f815d", "score": "0.57142234", "text": "clearScripts() {\n this.scripts = {};\n }", "title": "" }, { "docid": "02263d1a48d186f7a6b398776fc52c74", "score": "0.5673525", "text": "runScripts(sticky = false, whitelisted = DEFAULT_WHITELIST) {\n const evalCollectedScripts = (scriptsToProcess) => {\n if (scriptsToProcess.length) {\n // script source means we have to eval the existing\n // scripts before we run the 'include' command\n // this.globalEval(finalScripts.join(\"\\n\"));\n let joinedScripts = [];\n new Es2019Array_1.Es2019Array(...scriptsToProcess).forEach(item => {\n if (!item.nonce) {\n joinedScripts.push(item.evalText);\n }\n else {\n if (joinedScripts.length) {\n this.globalEval(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n (!sticky) ?\n this.globalEval(item.evalText, item.nonce) :\n this.globalEvalSticky(item.evalText, item.nonce);\n }\n });\n if (joinedScripts.length) {\n (!sticky) ? this.globalEval(joinedScripts.join(\"\\n\")) :\n this.globalEvalSticky(joinedScripts.join(\"\\n\"));\n joinedScripts.length = 0;\n }\n scriptsToProcess = [];\n }\n return scriptsToProcess;\n };\n let finalScripts = [], allowedItemTypes = [\"\", \"script\", \"text/javascript\", \"text/ecmascript\", \"ecmascript\"], execScript = (item) => {\n var _a, _b, _c, _d;\n let tagName = item.tagName;\n let itemType = ((_a = item === null || item === void 0 ? void 0 : item.type) !== null && _a !== void 0 ? _a : '').toLowerCase();\n if (tagName &&\n eqi(tagName, \"script\") &&\n allowedItemTypes.indexOf(itemType) != -1) {\n let src = item.getAttribute('src');\n if ('undefined' != typeof src\n && null != src\n && src.length > 0) {\n let nonce = (_b = item === null || item === void 0 ? void 0 : item.nonce) !== null && _b !== void 0 ? _b : item.getAttribute('nonce').value;\n // we have to move this into an inner if because chrome otherwise chokes\n // due to changing the and order instead of relying on left to right\n // if jsf.js is already registered we do not replace it anymore\n if (whitelisted(src)) {\n // we run the collected scripts, before we run the 'include' command\n finalScripts = evalCollectedScripts(finalScripts);\n if (!sticky) {\n (!!nonce) ? this.loadScriptEval(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEval(src, 0);\n }\n else {\n (!!nonce) ? this.loadScriptEvalSticky(src, 0, nonce) :\n // if no nonce is set we do not pass any once\n this.loadScriptEvalSticky(src, 0);\n }\n }\n }\n else {\n // embedded script auto eval\n // probably not needed anymore\n let evalText = trim(item.text || item.innerText || item.innerHTML);\n let go = true;\n while (go) {\n go = false;\n if (evalText.substring(0, 4) == \"<!--\") {\n evalText = evalText.substring(4);\n go = true;\n }\n if (evalText.substring(0, 4) == \"//<!--\") {\n evalText = evalText.substring(6);\n go = true;\n }\n if (evalText.substring(0, 11) == \"//<![CDATA[\") {\n evalText = evalText.substring(11);\n go = true;\n }\n }\n let nonce = (_d = (_c = item === null || item === void 0 ? void 0 : item.nonce) !== null && _c !== void 0 ? _c : item.getAttribute('nonce').value) !== null && _d !== void 0 ? _d : '';\n // we have to run the script under a global context\n // we store the script for fewer calls to eval\n finalScripts.push({\n nonce,\n evalText\n });\n }\n }\n };\n try {\n let scriptElements = new DomQuery(this.filterSelector(\"script\"), this.querySelectorAll(\"script\"));\n // script execution order by relative pos in their dom tree\n scriptElements.asArray\n .flatMap(item => [...item.values])\n .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) // preceding 2, following == 4)\n .forEach(item => execScript(item));\n evalCollectedScripts(finalScripts);\n }\n catch (e) {\n if (console && console.error) {\n // not sure if we\n // should use our standard\n // error mechanisms here\n // because in the head appendix\n // method only a console\n // error would be raised as well\n console.error(e.message || e.description);\n }\n }\n finally {\n // the usual ie6 fix code\n // the IE6 garbage collector is broken\n // nulling closures helps somewhat to reduce\n // mem leaks, which are impossible to avoid\n // at this browser\n execScript = null;\n }\n return this;\n }", "title": "" }, { "docid": "72b1d9c65d0b61bf2f824ea518d94c65", "score": "0.56659687", "text": "removeAllScripts() {\n this.scripts = {};\n }", "title": "" }, { "docid": "19c67832ab7bfd506c9637fe3939903c", "score": "0.5592892", "text": "function visit(script) {\n script = resolveScriptInfo(script);\n var currentState = state(script);\n if (currentState < loading && !getComposite(script)) {\n // unloaded script, eligible for composite selection\n scriptSet[script.name] = script;\n foundAny = true;\n foreach(script[\"dependencies\"], visit);\n }\n if (currentState < loaded) {\n // this scripts executionDependencies may not be loaded,\n // also check them for composite candidates\n foreach(script[\"executionDependencies\"], visit);\n }\n }", "title": "" }, { "docid": "eef3835e39c99e45c651ac4ad1decaf3", "score": "0.5492997", "text": "removeAllScriptNames() {\n this.scriptNames = [];\n }", "title": "" }, { "docid": "569579d84c639e05d97dc33b95ddd088", "score": "0.5467838", "text": "evalFound() {\n this._evalFound = true;\n this._closedOver = true;\n this._vars.forEach(closeOver);\n this.parent.evalFound();\n }", "title": "" }, { "docid": "04279d431c82d3061315efe72f59f5d3", "score": "0.53731847", "text": "loadAllScripts() {\n\t\tthis._scripts.forEach( function( scriptPlugin ) {\n\t\t\tif ( false === scriptPlugin._ranInline ) {\n\t\t\t\tscriptPlugin.theScript();\n\t\t\t}\n\t\t\tscriptPlugin.createScript();\n\t\t});\n\t}", "title": "" }, { "docid": "2ecbc7cc116c337c6608299291ccb81d", "score": "0.5336245", "text": "function setEvil(otherEval) {\n evil = otherEval;\n}", "title": "" }, { "docid": "2f520d704b5bb54866feef942ee485f1", "score": "0.5309647", "text": "function b(e,t){for(var n=0,o=e.length;n<o;n++)Fe.set(e[n],\"globalEval\",!t||Fe.get(t[n],\"globalEval\"))}", "title": "" }, { "docid": "ebdf232675fd77ab41fe918442ef74e5", "score": "0.5303123", "text": "runScripts(sticky = false, whiteListed) {\n const whitelistFunc = (src) => {\n var _a;\n return ((_a = whiteListed === null || whiteListed === void 0 ? void 0 : whiteListed(src)) !== null && _a !== void 0 ? _a : true) && !IS_FACES_SOURCE(src) && !IS_INTERNAL_SOURCE(src);\n };\n return super.runScripts(sticky, whitelistFunc);\n }", "title": "" }, { "docid": "86c34f6bc908f001332d57914f2bf30e", "score": "0.52803385", "text": "function setGlobalEval( elems, refElements ) {\n var elem,\n i = 0;\n for ( ; (elem = elems[i]) != null; i++ ) {\n jQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n }\n }", "title": "" }, { "docid": "1740fb52a8c6d3568cffbd08e47a55ee", "score": "0.52720535", "text": "function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n data_priv.set(\n elems[i], \"globalEval\", !refElements || data_priv.get(refElements[i], \"globalEval\")\n );\n }\n }", "title": "" }, { "docid": "c5fd52a90514a4fcc437662ad9bcafb6", "score": "0.52717704", "text": "updatedContentsFor(file) {\n this.activeImports.forEach((item) => item.resetCompiled())\n }", "title": "" }, { "docid": "24057596ae1b97205a1f044a981190ca", "score": "0.52695596", "text": "function setGlobalEval( elems, refElements ) {\n var elem,\n i = 0;\n for ( ; ( elem = elems[ i ] ) != null; i++ ) {\n jQuery._data(\n elem,\n \"globalEval\",\n !refElements || jQuery._data( refElements[ i ], \"globalEval\" )\n );\n }\n }", "title": "" }, { "docid": "5bd488e03ad5d5232b74a84cfbc97758", "score": "0.52677536", "text": "resetCompiled() {\n this.resetState(\"scope\", \"compiled\")\n }", "title": "" }, { "docid": "cba757d6fdbd74d9053e47bfff0aaa6f", "score": "0.52672625", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar elem,\n\t\t\ti = 0;\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t\t}\n\t}", "title": "" }, { "docid": "cba757d6fdbd74d9053e47bfff0aaa6f", "score": "0.52672625", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar elem,\n\t\t\ti = 0;\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t\t}\n\t}", "title": "" }, { "docid": "a84c2bd8af78dd39d298c5da64fd07c7", "score": "0.52531016", "text": "function setGlobalEval(elems, refElements) {\n var l = elems.length,\n i = 0;\n\n for (; i < l; i++) {\n data_priv.set(\n elems[i], \"globalEval\", !refElements || data_priv.get(refElements[i], \"globalEval\"));\n }\n }", "title": "" }, { "docid": "e45984aa617ffb6f77abc8b992386abc", "score": "0.5244555", "text": "function setGlobalEval( elems, refElements ) {\r\n\tvar elem,\r\n\t\ti = 0;\r\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\r\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\r\n\t}\r\n}", "title": "" }, { "docid": "9d30759f629dd5ff0aae59d63afe3a68", "score": "0.5241059", "text": "function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n dataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n }\n }", "title": "" }, { "docid": "39d253c0ab034ad1ca82007a66df8ba3", "score": "0.5237981", "text": "function finish_load(){\n\twindow.ubm_loadedids = {};\n\twindow.ubm_incompScripts = new Set([]);\n\t//Get current url\n\tvar thisurl = new URL(window.location.href);\n\tvar hostname = thisurl.hostname;\n\tvar s = ubm_db[hostname];\n\tif (s) {\n\t\tvar keys = s.getKeys();\n\t\tfor (let baseurl of keys) {\n\t\t\tloadScript(baseurl + hostname + \".js\", `scriptfail(this, function(){console.log('Could not load script from site: ` + baseurl + `!')})`, `exeScript(\\`` + baseurl + `\\`, function(){loadAlwaysCheck(0, \"` + baseurl + `\");})`);\n\t\t}\n\t} else {\n\t\tloadAlwaysCheck(0, hostname);\n\t}\n}", "title": "" }, { "docid": "30d441a4ecc2ff7a8ab6a02973b6d8fa", "score": "0.52378947", "text": "function setNumScripts(){\n $jQ('body').attr(vars.nscript,$jQ('script[src]').length);\n $jQ('body').attr(vars.ncss,$jQ('link[href]').length);\n}", "title": "" }, { "docid": "523583285b51f8ee635621eba94fc4a0", "score": "0.52315265", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar i = 0,\n\t\t\tl = elems.length;\n\t\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tdata_priv.set(\n\t\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "523583285b51f8ee635621eba94fc4a0", "score": "0.52315265", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar i = 0,\n\t\t\tl = elems.length;\n\t\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tdata_priv.set(\n\t\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "ca9d48df28794b787dec90a8a2c579f8", "score": "0.52314526", "text": "function setGlobalEval( elems, refElements ) {\n var elem,\n i = 0;\n for ( ; (elem = elems[i]) != null; i++ ) {\n jQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n }\n}", "title": "" }, { "docid": "ca9d48df28794b787dec90a8a2c579f8", "score": "0.52314526", "text": "function setGlobalEval( elems, refElements ) {\n var elem,\n i = 0;\n for ( ; (elem = elems[i]) != null; i++ ) {\n jQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n }\n}", "title": "" }, { "docid": "ca9d48df28794b787dec90a8a2c579f8", "score": "0.52314526", "text": "function setGlobalEval( elems, refElements ) {\n var elem,\n i = 0;\n for ( ; (elem = elems[i]) != null; i++ ) {\n jQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n }\n}", "title": "" }, { "docid": "6cadd404b54b359c09075f05b3e9caa2", "score": "0.5228619", "text": "function setGlobalEval(elems, refElements) {\n var elem,\n i = 0;\n for (; (elem = elems[i]) != null; i++) {\n jQuery._data(elem, \"globalEval\", !refElements || jQuery._data(refElements[i], \"globalEval\"));\n }\n }", "title": "" }, { "docid": "a5aa0641b24cab99b5cbaf52d3f50d83", "score": "0.52208585", "text": "function setGlobalEval(elems, refElements) {\n var elem,\n i = 0;\n for (; ( elem = elems[i] ) != null; i++) {\n jQuery._data(\n elem,\n \"globalEval\",\n !refElements || jQuery._data(refElements[i], \"globalEval\")\n );\n }\n }", "title": "" }, { "docid": "ae71898b42a100eb4d3f992e08cb04ed", "score": "0.5215757", "text": "function scriptLoaded(scriptSource, scriptSources, callWhenAllLoaded) {\n\tscriptSources.remove(scriptSource);\n\tif (scriptSources.empty()) {\n\t\tcallWhenAllLoaded();\n\t}\n}", "title": "" }, { "docid": "f869850b548042d63d28830da030f504", "score": "0.52150893", "text": "function stateChange() {\n // Execute as many scripts in order as we can\n\n var pendingScript;\n\n while (pendingScripts[0] && pendingScripts[0].readyState == 'loaded') {\n pendingScript = pendingScripts.shift();\n // avoid future loading events from this script (eg, if src changes)\n pendingScript.onreadystatechange = null;\n // can't just appendChild, old IE bug if element isn't closed\n firstScript.parentNode.insertBefore(pendingScript, firstScript);\n }\n\n }", "title": "" }, { "docid": "de20db9f45a255c46a7bfaf926b23574", "score": "0.5212857", "text": "function setGlobalEval(elems, refElements) {\n\t\tvar i = 0,\n\t\t l = elems.length;\n\n\t\tfor (; i < l; i++) {\n\t\t\tdataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n\t\t}\n\t}", "title": "" }, { "docid": "de20db9f45a255c46a7bfaf926b23574", "score": "0.5212857", "text": "function setGlobalEval(elems, refElements) {\n\t\tvar i = 0,\n\t\t l = elems.length;\n\n\t\tfor (; i < l; i++) {\n\t\t\tdataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n\t\t}\n\t}", "title": "" }, { "docid": "de20db9f45a255c46a7bfaf926b23574", "score": "0.5212857", "text": "function setGlobalEval(elems, refElements) {\n\t\tvar i = 0,\n\t\t l = elems.length;\n\n\t\tfor (; i < l; i++) {\n\t\t\tdataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n\t\t}\n\t}", "title": "" }, { "docid": "de20db9f45a255c46a7bfaf926b23574", "score": "0.5212857", "text": "function setGlobalEval(elems, refElements) {\n\t\tvar i = 0,\n\t\t l = elems.length;\n\n\t\tfor (; i < l; i++) {\n\t\t\tdataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n\t\t}\n\t}", "title": "" }, { "docid": "f10e50648cfda7a5e041c2acfdc947cd", "score": "0.5212799", "text": "function setGlobalEval(elems, refElements) {\n\t\tvar elem,\n\t\t i = 0;\n\t\tfor (; (elem = elems[i]) != null; i++) {\n\t\t\tjQuery._data(elem, \"globalEval\", !refElements || jQuery._data(refElements[i], \"globalEval\"));\n\t\t}\n\t}", "title": "" }, { "docid": "5a067ff9236641d1cb8f26806d94f14c", "score": "0.5207373", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar i = 0,\n\t\t\tl = elems.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tdata_priv.set(\n\t\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "5a067ff9236641d1cb8f26806d94f14c", "score": "0.5207373", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar i = 0,\n\t\t\tl = elems.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tdata_priv.set(\n\t\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "5a067ff9236641d1cb8f26806d94f14c", "score": "0.5207373", "text": "function setGlobalEval( elems, refElements ) {\n\t\tvar i = 0,\n\t\t\tl = elems.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tdata_priv.set(\n\t\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "858d1525939abc9009cab8cc0e463824", "score": "0.5205576", "text": "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "title": "" }, { "docid": "8a7372ec5bb5b7dcb4b4bf838b6ce640", "score": "0.52044195", "text": "function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n\n for (; i < l; i++) {\n data_priv.set(\n elems[i], \"globalEval\", !refElements || data_priv.get(refElements[i], \"globalEval\")\n );\n }\n }", "title": "" }, { "docid": "33d9699de7a02806a07b9e3ab9ffd9e6", "score": "0.52012235", "text": "function setGlobalEval(elems, refElements) {\n var elem,\n i = 0;\n for (;\n (elem = elems[i]) != null; i++) {\n jQuery._data(\n elem,\n \"globalEval\", !refElements || jQuery._data(refElements[i], \"globalEval\")\n );\n }\n }", "title": "" }, { "docid": "ffc810a12ff9e51ad63ea42ad96a78ed", "score": "0.51982325", "text": "function setGlobalEval( elems, refElements ) {\n var i = 0,\n l = elems.length;\n\n for ( ; i < l; i++ ) {\n dataPriv.set(\n elems[ i ],\n \"globalEval\",\n !refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n );\n }\n }", "title": "" }, { "docid": "6d2029c0d7c68adf21fedd363c3de00e", "score": "0.51979375", "text": "function triggerCompiled(){\n return `\n if(curNode.$compiled != true){\n if(curNode.compiledCallback)\n curNode.compiledCallback();\n \n curNode.$compiled = true;\n }\n `;\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" }, { "docid": "15fd536ade98c3af78acdb56b7e225d7", "score": "0.5192963", "text": "function setGlobalEval( elems, refElements ) {\n\tvar elem,\n\t\ti = 0;\n\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\tjQuery._data( elem, \"globalEval\", !refElements || jQuery._data( refElements[i], \"globalEval\" ) );\n\t}\n}", "title": "" } ]
43a522e8fcd53a07f56c91e2e83e9e27
Pause before starting new download, we don't want people at RTVE to pull the plug... ;)
[ { "docid": "bfa0227000fd76fe236ba4cf4fb654f7", "score": "0.6169826", "text": "function timeoutDownload() {\n\tconsole.log(\"Waiting \" + options.downloadWaitTime + \" seconds...\");\n\tsetTimeout(downloadNextPod, options.downloadWaitTime * 1000);\n}", "title": "" } ]
[ { "docid": "0144574ee9e3e2e62e1e4b8aa05f4759", "score": "0.6974537", "text": "stopDownload() {\n\t}", "title": "" }, { "docid": "2916ec5113c6b26cde66ea3087a0ae73", "score": "0.6714704", "text": "stopDownloadingNewFilesRegularly() {\n this.automaticDownloadingActive = false;\n }", "title": "" }, { "docid": "5c92a25621014ed1d214b9f119150751", "score": "0.64269155", "text": "function start_download(freesound_sample_id) {\n console.log (\"Download called on \" + freesound_sample_id);\n var ajax = new XMLHttpRequest();\n\n // Just start the download and begin pinging the counter file.\n //\n ajax.onreadystatechange = function () {\n if (ajax.readyState == 4) {\n }\n };\n ajax.open(\"GET\", \"/cgi-bin/elementski/download.cgi?id=\" + freesound_sample_id, true);\n ajax.send(null);\n\n // Ping the CGI for status.\n //\n setTimeout(ping(freesound_sample_id), 100);\n}", "title": "" }, { "docid": "6279f1fa1f4cd80691f1f4e61800eebf", "score": "0.6400404", "text": "pause () {}", "title": "" }, { "docid": "6279f1fa1f4cd80691f1f4e61800eebf", "score": "0.6400404", "text": "pause () {}", "title": "" }, { "docid": "6279f1fa1f4cd80691f1f4e61800eebf", "score": "0.6400404", "text": "pause () {}", "title": "" }, { "docid": "6279f1fa1f4cd80691f1f4e61800eebf", "score": "0.6400404", "text": "pause () {}", "title": "" }, { "docid": "2b97dd9144e3356488cdfdf6854e9e65", "score": "0.6399077", "text": "function resume() {\n loaded++;\n \n if (loaded >= urls.length) {\n success();\n }\n }", "title": "" }, { "docid": "01df26d9917f558a81b5e2c8c4e12b97", "score": "0.6383352", "text": "downloadIncrement(){\n if(this.downloadIndex < this.downloadQueue.length){//was <= len +1\n \t//pause video when downloading\n this.playback(\"pause\");\n\n this.downloadFiles(this.downloadQueue[this.downloadIndex]);\n\n this.downloading = true;\n } else {\n /*if all files have been downloaded restart the listener\n to detect remote updates*/\n this.readyToDownload = false;\n \n if(this.downloading == true){\n \tthis.downloadLog(\"All downloads completed\");\n \tthis.getAllFileSizes();\n \tthis.downloading = false;\n }\n \n this.getLocalFiles(this.downloadProcess());\n }\n this.downloadIndex++;\n }", "title": "" }, { "docid": "dac4a4fe11888120e9212c482726da4a", "score": "0.6335519", "text": "function start_download_ref(){\n\tpaper_list=new Set();\n\ttotal=0;\n\tstate=\"ref\"\n\trequest_counter=0;\n\treceived_req=0;\n\terror_counter=0;\n\t$(\"#ref_button\").hide();\n\t//need to disable citation button\n\t$(\"#citation_button\").prop(\"disabled\",true);\n\t$(\"#myProgress\").show();\n\tstart_pre_download_ref();\n\t//set a timeer after 10seconds to check is the request_counter==0\n\tsetTimeout(() => { check_progress(); }, 10000);\n\t\n}", "title": "" }, { "docid": "b615a0607b37a203e723bd8e96b2b797", "score": "0.62237495", "text": "function initiateSongDownload()\n{\n\t// Get current tab, retrieve its title as the default file name\n\tchrome.tabs.query({currentWindow: true, active: true}, function(tab) \n\t{\n\t\tvar tabId = tab[0].id;\n\t\tvar title = tab[0].title+'.mp3';\n\t\tvar url = tabs_urls.tabId;\n\t\tgetSongDownloadURL(title, url);\n\t});\n}", "title": "" }, { "docid": "2c1fe7e3334df63ca70c55167470a9d0", "score": "0.62139964", "text": "function _pause(){\n\t\t\t_running = false;\n\t\t}", "title": "" }, { "docid": "3eda8fa195dad25c8044bf8b2230f682", "score": "0.6180802", "text": "function start_download_citation(){\n\tpaper_list=new Set();\n\tstate= \"citation\"\n\ttotal=0;\n\trequest_counter=0;\n\treceived_req=0;\n\terror_counter=0;\n\t$(\"#citation_button\").hide();\n\t//need to hide ref button\n\t$(\"#ref_button\").prop(\"disabled\",true);\n\t\n\t$(\"#myProgress\").show();\n\tstart_pre_download_citation();\n\t//set a timeer after 10seconds to check is the request_counter==0\n\tsetTimeout(() => { check_progress(); }, 10000);\n\t\n}", "title": "" }, { "docid": "2640b814bfa187544dd01faaa72eda2f", "score": "0.6177358", "text": "resume() {\n this.start(true);\n }", "title": "" }, { "docid": "125ffa34b7a81281c95c789233fa5f43", "score": "0.61191916", "text": "function stopDownload( ){\n if( XHR ){\n XHR.abort();\n }\n }", "title": "" }, { "docid": "4a05366cef522d08bf4a7570a3e5466e", "score": "0.6114756", "text": "function downloadStart(){\n for (var g = 0; g < config.podcastList.length; g++) {\n\t\t// Full path for the subfolder\n\t\tif (config.useSubFolders) {\n\t\t\tsubFolder = config.masterFolder + config.podcastList[g].folderName + \"/\";\n\t\t}\n\t\telse {\n\t\t\tsubFolder = config.masterFolder\n\t\t}\n\n\t\t// Start downloading the current podcast\n downloadPodcast(\n config.podcastList[g].url,\n\t\t\tconfig.podcastList[g].extension,\n subFolder\n );\n }\n}", "title": "" }, { "docid": "282dfd3e8f3f502f7b7f236026c96b5c", "score": "0.6082709", "text": "function urlUpdate() {\n if(currentUrl && currentKeyCode == triggerKeyCode && keyDown){\n console.log('requesting: ' + currentUrl);\n\n chrome.runtime.sendMessage({url: currentUrl}, function(response) {\n if(response.success && response.success == 'downloading') {\n console.log('download succesfully started');\n }\n });\n }\n}", "title": "" }, { "docid": "59194b3f2fa25cf6f5792939a970faa2", "score": "0.60796756", "text": "function pause() {\n return new Promise((resolve, reject) => {\n if (!progress || paused) return resolve();\n // pause now\n paused = true;\n // resolve now if not downloading\n if (!busy) return resolve();\n // wait till download settles before resolving\n let task = setInterval(() => {\n if (!busy) {\n clearInterval(task);\n resolve();\n if (downloadHandlers.paused) {\n downloadHandlers.paused();\n }\n }\n }, 1000);\n });\n}", "title": "" }, { "docid": "b3a34c7fdac571fd9b4749e95448968a", "score": "0.6062141", "text": "function download() {\r\n $(\"#download_resume\").fadeIn(750);\r\n $(\"#download_resume\").fadeOut(750);\r\n }", "title": "" }, { "docid": "d9db831bb3513b8ba1cf214a6aa21d89", "score": "0.6056111", "text": "function buttonPlayPress() {\n client.torrents.forEach(function(torrent){\n console.log(\"Resuming torrent: \" +torrent.infoHash);\n torrent.resume();\n });\n $('.seeding').show();\n state = 'play';\n}", "title": "" }, { "docid": "7ee1119d163c0d545fc1ee947f2a4cfd", "score": "0.6021883", "text": "pause () { this.pause = true }", "title": "" }, { "docid": "9cf5c4cc53f633f386dfd3118e33dfd0", "score": "0.59755576", "text": "function onDownloadComplete()\n{\n console.log(\"onDownloadComplete\");\n\n main();\n}", "title": "" }, { "docid": "916ae4182bc112c3cd483a7bc3dd33e2", "score": "0.59741014", "text": "startDownloadingNewFilesRegularly() {\n this.automaticDownloadingActive = true;\n\n // Schedule the next automatic download\n const automaticDownload = () => {\n if (this.automaticDownloadingActive) {\n this.downloadNewFtpFiles(err => {\n if (err) {\n console.log(err);\n }\n\n // Schedule the next automatic download\n setTimeout(automaticDownload, configuration.ftpServiceAutomaticDownloadingPeriodMs);\n });\n }\n };\n setTimeout(automaticDownload, configuration.ftpServiceAutomaticDownloadingPeriodMs);\n }", "title": "" }, { "docid": "7aec94a13a288b8f72f15c51d19714e2", "score": "0.593312", "text": "resume() {\n this.stopped = false;\n }", "title": "" }, { "docid": "27c6d60ce18d7e4059ee38f98a62b772", "score": "0.59306836", "text": "function onDownloadStart(ev) {\n if (started) {\n createDownloadNotificationAndIcon(ev.download);\n } else {\n LazyLoader.load(['shared/js/download/download_formatter.js',\n 'shared/js/download/download_ui.js',\n 'shared/js/download/download_store.js',\n 'shared/js/download/download_helper.js',\n 'js/download/download_notification.js']).then(\n function() {\n started = true;\n createDownloadNotificationAndIcon(ev.download);\n window.addEventListener('notification-clicked', handleEvent);\n\n // Bug 1102810 - After this bug gets fixed, this listener won't be\n // needed anymore. The API itself should handle startTime when killing\n // the process.\n window.addEventListener('will-shutdown', function onShutdown() {\n ev.download.pause();\n });\n })['catch'](function(err) { // XXX: workaround gjslint\n console.error(err);\n });\n }\n }", "title": "" }, { "docid": "e4b4d47b4bdb1646a8ecd478f4036bc1", "score": "0.5868496", "text": "function waitForIt(){\n if (isPaused) {\n setTimeout(function(){waitForIt()},100);\n }\n }", "title": "" }, { "docid": "f2b9d42376fb833b25cf89abe00cf4a0", "score": "0.58033365", "text": "function ProQ_Quick_download() {\n var download_button = document.getElementById(\"downloadPDFLink\");\n if (download_button == null) {\n if (document.getElementById(\"toolDownload\") == null) {\n ProQ_ebook_download();\n } else {\n document.getElementById(\"toolDownload\").click();\n setTimeout(\"Readbook_online()\", 3000);\n\n }\n } else {\n download_button.click();\n alert(\"The article is downloading, Please wait a second\");\n }\n}", "title": "" }, { "docid": "370be90725be777fcf691ebb8c653eff", "score": "0.5793007", "text": "function GoLaunch() {\r\n\r\n if (myLaunchVideo.ended) {\r\n // video ended. so reset play indicator\r\n bLaunchPlaying = false;\r\n }\r\n\r\n\r\n if (!bLaunchPlaying) {\r\n // start video\r\n myLaunchVideo.play();\r\n bLaunchPlaying = true;\r\n }\r\n else {\r\n myLaunchVideo.pause();\r\n bLaunchPlaying = false;\r\n }\r\n \r\n \r\n\r\n}// end GoLaunch", "title": "" }, { "docid": "126b16764755a9ae77d33da80376cbc2", "score": "0.5762886", "text": "offlineDown() {\n //console.log('offline clicked');\n this.offlineButtonDown.setVisible(true);\n this.startSFX.play();\n }", "title": "" }, { "docid": "3b37ec7632b7a45bfef2dd5e7e9df856", "score": "0.5749706", "text": "pause() {\n this._pause$.next(true);\n }", "title": "" }, { "docid": "6590cc702de9529d454b230588a8b993", "score": "0.5734079", "text": "function startTransfer() {\n if (state == 2) {\n state = 3;\n timerDelayer = setTimeout(runTransfer, 50);\n }\n }", "title": "" }, { "docid": "812cb680861583133969c20c7569f02c", "score": "0.57256305", "text": "function PlayFromURLNow() {\n\tvar paramSubtune = GetParam(\"subtune\"),\n\t\tparamWait = GetParam(\"wait\");\n\n\tif (paramSubtune == \"\")\n\t\t$trAutoPlay.children(\"td.sid\").trigger(\"click\", [undefined, undefined, undefined, paramWait]);\n\telse\n\t\t$trAutoPlay.children(\"td.sid\").trigger(\"click\", [(paramSubtune == 0 ? 0 : paramSubtune - 1), undefined, undefined, paramWait]);\n}", "title": "" }, { "docid": "56be04c08bf10a5d33f554ed3cfe9735", "score": "0.57251954", "text": "resume() {\n this._resume();\n }", "title": "" }, { "docid": "ae662ac23d6ba2307d43c4705d29df4c", "score": "0.5709128", "text": "function downloadfile(url,download)\n{\n console.log(\"file is downloading...\")\n let newdwnldpath=url+\"newpath\";\n\n setTimeout(()=>{\n console.log(\"file is downloaded to\"+newdwnldpath);\n download(newdwnldpath);\n },4000);\n}", "title": "" }, { "docid": "78076200f5efbe614feaa9dd0863b181", "score": "0.5702933", "text": "function downloadFile_2() {\n\t\t\tdownload(\"resources/videos/test_video.mp4\");\n\t\t}", "title": "" }, { "docid": "1b4b31a2661746d77de00c1826111906", "score": "0.5692574", "text": "function continuePausedAlgorithm() {\n\n hdxAV.currentAV.nextStep();\n}", "title": "" }, { "docid": "3c4ff187186bfb0d763520e7ccdc02be", "score": "0.5679792", "text": "resume() {\n this.paused = false;\n }", "title": "" }, { "docid": "8d50f41fc9104af0d8b81eb2553909c3", "score": "0.5655343", "text": "function onPause() {\n pauseStartTime = new Date() / 1000;\n}", "title": "" }, { "docid": "86255c640404e6e015b2f1f52ee34e15", "score": "0.5641828", "text": "function skip() {\n // Check if there is a currently playing track\n if (current_track_progress > 0) {\n console.log(\"skip button clicked\");\n allowNewTrigger = !allowNewTrigger;\n triggerNextTrack();\n }\n}", "title": "" }, { "docid": "8fc4b7643cb07454f167d2fd0fb7962c", "score": "0.5610956", "text": "pause () {\n this.isLooping = false;\n }", "title": "" }, { "docid": "f5ed2f7a25725e08d9e1754aabe7651e", "score": "0.5603147", "text": "delayLoad() {\n }", "title": "" }, { "docid": "c0f4a0b7e928935a2fc71f08a28007c8", "score": "0.56028444", "text": "start()\n {\n if (this._started)\n return;\n\n Prefs.on(\"blocked_total\", this._onBlockedTotal);\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "title": "" }, { "docid": "3ac75dc7198b6464c208c5da5d7d6c93", "score": "0.5590761", "text": "function startExecutingRequestProgress() {\n main.executingRequestProgress = true;\n }", "title": "" }, { "docid": "072f6a8db22058abccbacc3f87a820c6", "score": "0.55884033", "text": "function onPause() {\r\n \r\n }", "title": "" }, { "docid": "932e97a9501d3f6d9d217d38eb5a27ca", "score": "0.5580262", "text": "function pauseAndResume() {\r\n if (createjs.Ticker.getPaused()) {\r\n createjs.Ticker.setPaused(false);\r\n }\r\n else {\r\n createjs.Ticker.setPaused(true);\r\n }\r\n }", "title": "" }, { "docid": "e595260d143913f9e43134042a389bdc", "score": "0.55760306", "text": "function startUpload() {\n\n\ttotalUploaded = filesUploaded = 0;\n\tuploadNext();\n\n}", "title": "" }, { "docid": "67b48911c61fd3fb162d130bf20c02e5", "score": "0.5572708", "text": "function resume() {\n return new Promise((resolve, reject) => {\n if (!allowProcessing) {\n return reject(\"Processing has been disabled. Possible plan expiry\");\n }\n if (!isUploadsPaused()) {\n waiting = true;\n return reject(\"Resume blocked. Upload-service still busy\");\n }\n waiting = false;\n if (!progress || !paused) return resolve();\n paused = false;\n console.log(\"download resuming\");\n if (downloadHandlers.resume) {\n downloadHandlers.resume(progress);\n }\n\n // download next file with 3 second interval\n // NOTE slow down first-time downloads so MongoDB\n // index sizes remain stable (implicit with throttles??)\n let task = setInterval(() => {\n // cancel task if progressr is paused or empty\n if (paused) return clearInterval(task);\n if (progress.toCapture.length == 0 && progress.toDecrypt.length == 0) {\n console.log(\"download [no tasks]!\");\n clearInterval(task);\n if (progress.failed.length == 0) {\n console.log(\"download [all completed]!\");\n if (downloadHandlers.allDownloaded) {\n downloadHandlers.allDownloaded(progress);\n }\n Download.updateOne(\n { _id: progress.downloadId },\n {\n active: false,\n complete: true,\n \"log.completedDate\": Date.now()\n },\n err => {\n if (err) {\n console.log(\n \"\\nCouldn't notify MongoDB of download completion!\\n\",\n err\n );\n } else {\n // doesn't matter if it's deleted, at next init\n // the file will be rejected cuz there's no\n // matching document in MongoDB\n fs.unlink(PROGRESS_PATH, err => {\n console.log(err);\n });\n // same thing goes for this\n clearCapturesAndPackage().catch(err => {\n console.log(err);\n });\n }\n progress = null;\n paused = true;\n resolve();\n }\n );\n } else {\n console.log(\"download [all failed]!\");\n paused = true;\n if (downloadHandlers.allFailed) {\n downloadHandlers.allFailed(progress);\n }\n }\n // verify the user's plan hasn't epired\n // if it has block future processing\n return verifyPlanActive()\n .catch(err => console.error(err)) // errors aren't a worry here\n .then(resolve);\n }\n // only begin downloading if not currently working\n if (!busy) {\n // check if throttling is necessary\n // 'now' is measured in seconds\n let now = Math.floor(Date.now() / 1000);\n if (throttler.periodStart < 0 || throttler.periodStart + 3600 < now) {\n // reset throttler if the period is over\n throttler.periodStart = now;\n throttler.periodGbs = 0;\n } else {\n if (throttler.periodGbs >= userTier.retrieveSpeed) {\n // if downloads have reached the max threshold\n // block future downloads until the period has passed\n console.log(\"throttler blocked\", throttler);\n return;\n }\n }\n busy = true;\n setImmediate(() => {\n console.log(\"download starting\");\n let nextCapture = progress.toCapture[0];\n let nextDecrypt = progress.toDecrypt[0];\n let actions = [];\n if (nextCapture) {\n actions.push({\n a: \"capture\",\n p: capture(nextCapture)\n });\n }\n if (nextDecrypt) {\n actions.push({\n a: \"decrypt\",\n p: decrypt(nextDecrypt)\n });\n }\n actions.forEach(action => {\n action.p\n .finally(() => (action.settled = true))\n .then(() => {\n if (action.a == \"capture\") {\n nextCapture.captured = true;\n //queue successful captures for decryption\n progress.toDecrypt.push(progress.toCapture.shift());\n console.log(\"capture successful\");\n // increment throttler after the successful capture\n throttler.periodGbs += nextCapture.size / 1073741824;\n if (downloadHandlers.captured) {\n downloadHandlers.captured(progress);\n }\n } else {\n nextDecrypt.decrypted = true;\n //remove successful downloads from progress\n progress.toDecrypt.shift();\n progress.filesLeft--;\n progress.bytesLeft -= nextDecrypt.size;\n console.log(\"decrypt successful\");\n if (downloadHandlers.decrypted) {\n downloadHandlers.decrypted(progress);\n }\n }\n })\n .catch(err => {\n // NOTE uncomment this to stop when an error occurs\n // paused = true;\n // this ^\n try {\n console.error(err.response.data);\n } catch (error) {\n console.log(err.toString());\n }\n let failedObj =\n action.a == \"capture\" ? nextCapture : nextDecrypt;\n failedObj.failedTwice = !!failedObj.failedOnce || true; //NOTE should we retry?\n failedObj.failedOnce = true;\n if (!failedObj.failedTwice) {\n if (action.a == \"capture\") {\n progress.toCapture.push(progress.toCapture.shift());\n } else {\n progress.toDecrypt.push(progress.toDecrypt.shift());\n }\n } else {\n delete failedObj.failedOnce;\n delete failedObj.failedTwice;\n if (action.a == \"capture\") {\n failedObj = progress.toCapture.shift();\n } else {\n failedObj = progress.toDecrypt.shift();\n }\n progress.failed.push(failedObj);\n progress.filesLeft--;\n progress.bytesLeft -= failedObj.size;\n }\n })\n .finally(() => {\n // look for an unsettled promise\n // if none found, we know we are done\n if (!actions.find(a => !a.settled)) {\n console.log(\"download(s) [settled]\");\n }\n // save progress after each operation\n saveProgress(progress)\n .catch(err => console.error(err))\n .finally(() => (busy = false));\n });\n });\n });\n }\n }, 3000);\n }).then(() => {\n if (isUploadsWaiting()) {\n console.log(\"Upload-service was waiting\\nresuming uploads\");\n uploadsResume().catch(err => {\n console.log(\"resume was blocked!\\n\", err);\n });\n }\n });\n}", "title": "" }, { "docid": "75fd099339a8692b1d14415189c5a64a", "score": "0.5569478", "text": "resume() {\n const now = performance.now();\n this.startTime = now - this.progressMs;\n this.endTime = this.startTime + this.duration;\n this.paused = false;\n this.tick(now);\n }", "title": "" }, { "docid": "3c40bd67d0047918792f9c9056231e0d", "score": "0.55554914", "text": "sleep() {\n // Useless for this viztool\n }", "title": "" }, { "docid": "5120e327437e3e2f59c3fb8d3f0b6ae0", "score": "0.55553985", "text": "function start() {\n \tprogressIndicator.innerHTML = '\"March of the All-Time GMF Coders Battallion 101\" by DAME VERA LYNN of tha SENIOR DADS!!!!';\n \tmusic_GMF.play();\n \tmusic_GMF.waitUntilEnd(end);\n \t\n function end() {\n //demoWindow.FlushWaitVbl();\n testDemo.next();\n }\n }", "title": "" }, { "docid": "5b2bea4bf31e9003e3ec76665e4ce391", "score": "0.5551255", "text": "pause() {\n this.stopped = true;\n }", "title": "" }, { "docid": "ce10a863f05fd4743c99805272239518", "score": "0.5547913", "text": "function globalDl(){\n\t\t//global download wont be available if audio not inited (button appears on COUNTER_READY)\n\t\tif(_downloadOn)return false;\n\t\tvar type = media_type;\n\t\t//console.log(type);\n\t\t\n\t\tif(!media_type){\n\t\t\tif(useAlertMessaging) alert(\"Invalid data-type for file download function! Quitting.\"); \n\t\t\t_downloadOn = false;\n\t\t\treturn false;\t\n\t\t}\n\t\tvar c = playlistManager.getCounter(), path = playlistDataArr[c].download, name = getTitle(c, false);\n\t\tvar dwn = getDownloadPath(type, name, path);\n\t\t//console.log(dwn.name, dwn.path);\n\t\t//return;\n\t\tcheckDownload(dwn.name, dwn.path);\t\n\t}", "title": "" }, { "docid": "5880719cc9d346fa705d5b7dcbc67ce2", "score": "0.5547129", "text": "function StartLoading(chosenFile) {\n\tfileName = chosenFile;\n\n\t//Loading up chosenFile from location on the server.\n\tmaxiAudio.loadSample(location.protocol + '//' + location.host+'/uploads/'+fileName, soundTrack);\n\n\t//Loading up progress bar to show the percentage of status\n\t//[referenced at the top of the document]\n\tvar width = 1;\n\tvar id = setInterval(frame, 50);\n\n\tfunction frame() {\n\t\tif (width>= 100) {\n\t\t\tclearInterval(id);\n\t\t\t$(\".next-btn\").toggle(\"slow\");\n\t\t} else {\n\t\t\twidth++; \n\t\t\t$('.progress-bar').text('Processing sound ' +width+'%');\n\t\t\t$('.progress-bar').width(width + '%'); \n\t\t}\n\t}\n}", "title": "" }, { "docid": "4ec4fd5a1d53d49ec8aa0db3ec36b404", "score": "0.5545453", "text": "function ProvidedSoundTrack(){\n\t$('#prog').html('File chosen: '+fileName);\n\tStartLoading(fileName);\n}", "title": "" }, { "docid": "dbc2e9bbbb3ca6d4ecbc3ded05f617ec", "score": "0.55399907", "text": "function monitoringOnPause() {\r\n $(\"#idMonitoringPageMain\").css({opacity: 0.5});\r\n $(\"#pauseTxt\").show();\r\n status = 'off';\r\n stopSavingDataInDB();\r\n}", "title": "" }, { "docid": "f7c89aafe630312bea59b0deab490b41", "score": "0.5538967", "text": "function pauseCountDown(){\n\tpausa = 1;\n}", "title": "" }, { "docid": "0d485f9d5e4ef6e64f31c4f3e98b4a8b", "score": "0.5502299", "text": "function downVideo() {\n let name = view.getTitle();\n const url = view.getURL();\n\n const output = path.resolve(\n `${app.getPath(\"home\")}/Downloads/`,\n `${name}` + \".mp4\"\n );\n const video = ytdl(url);\n let starttime;\n status1.value = msgvdownloading;\n\n video.pipe(fs.createWriteStream(output));\n video.once(\"response\", () => {\n starttime = Date.now();\n });\n\n video.on(\"progress\", (chunkLength, downloaded, total) => {\n status.value = msgstart;\n\n const floatDownloaded = downloaded / total;\n const downloadedMinutes = (Date.now() - starttime) / 1000 / 60;\n\n var progress1v = \"Progress : \" + (floatDownloaded * 100).toFixed(2) + \"%\";\n progress1.value = progress1v;\n\n var progress2v =\n \"Downloaded : \" +\n (downloaded / 1024 / 1024).toFixed(2) +\n \"MB of \" +\n (total / 1024 / 1024).toFixed(2) +\n \"MB\";\n progress2.value = progress2v;\n\n var progress3v =\n \"Running for : \" + downloadedMinutes.toFixed(2) + \"minutes\";\n progress3.value = progress3v;\n\n var progress4v =\n \"Estimated time left : \" +\n (downloadedMinutes / floatDownloaded - downloadedMinutes).toFixed(2) +\n \"minutes\";\n progress4.value = progress4v;\n });\n video.on(\"end\", () => {\n status.value = msgfinished;\n status1.value =\n \"Video saved to \" + `${app.getPath(\"home\")}/Downloads/${name}.mp4`;\n });\n}", "title": "" }, { "docid": "83ab02d945fa827f60998846358ecf82", "score": "0.5501573", "text": "function monitoringOnPlay() {\r\n $(\"#idMonitoringPageMain\").css({opacity: 1});\r\n $(\"#pauseTxt\").hide();\r\n status = 'on';\r\n startSavingDataInDB();\r\n}", "title": "" }, { "docid": "73e3a703b8271969075053d761eb3d6d", "score": "0.5500906", "text": "function online_status() {\r\n LED1_PIN.digitalWrite(1);\r\n\r\n startup_song();\r\n}", "title": "" }, { "docid": "a227b5bb1d8121bc35c0d017954ef1a0", "score": "0.54997283", "text": "function start() {\r\n\tstatus = -1;\r\n\taction(1, 0, 0);\r\n}", "title": "" }, { "docid": "7b726d9510acfe34282ff73d1032cb6a", "score": "0.549208", "text": "function nxt(){\r\n progress.style.width=0+\"%\";\r\n j=0;\r\n if(i==-1)\r\n {\r\n music.src=\"2.mp3\";\r\n i=1;\r\n }else\r\n i++;\r\n if(i==74){\r\n music.src=\"1.mp3\";\r\n i=0;\r\n }\r\n else\r\n music.src=(i+1)+\".mp3\";\r\n music.load(); \r\n strt(); \r\n }", "title": "" }, { "docid": "acc4ce8134ec6e00a098c1f8d2c7f4f6", "score": "0.54910713", "text": "function goToNext (){\n\tsetTimeout(pause, 3000); \n}", "title": "" }, { "docid": "97d963101d124ac0dad22440b1c61e3d", "score": "0.5485461", "text": "function start_pre_download_ref(){\n\t\n\t\n\tconsole.log(\"current downloading:\"+id_)\n\t//remove download button,and add prograss bar\n\t//send the first request to get the year_list\n\t$.ajax({\n\t\ttype: 'GET',\n contentType: \"application/json; charset=utf-8\",\n url: \"https://academic.microsoft.com/api/entity/\" + id_ + \"?entityType=2\",\n\t\tsuccess: function (response) {\n\t\t\tpaperReferencesExpression = response[\"paperReferencesExpression\"]\n\t\t\t//collect paper\n\t\t\tcollect_ref_papers(paperReferencesExpression)\n\t\t\t\n\t\t},\n\t\t\t\n\t\terror: function(response){\n\t\t\t\n\t\t\tconsole.log(\"ref request failed\");\n\t\t}\n\t\t\n\t}) \n}", "title": "" }, { "docid": "5a76007b2d04629ed541d633290c73df", "score": "0.5481717", "text": "function resume()\n{\n Groupie.connection.resume();\n}", "title": "" }, { "docid": "3efbbd0d366dada1cb89ccd027b30752", "score": "0.54791605", "text": "function start() {\n\tif(paused) playPauseClicked();\n}", "title": "" }, { "docid": "e96a766d2f9ef0bb4cc06c0169f2c40e", "score": "0.54755926", "text": "function playPause(){\r\n sendCommand(\"playPause\");\r\n UpdateIconFromPageState();\r\n}", "title": "" }, { "docid": "d50f3d7da8fe9d8feaece18e4dc57fa4", "score": "0.54748946", "text": "pause() {\n return this.newMeta(function(){\n this._pause();\n this.done();\n });\n }", "title": "" }, { "docid": "f2ee6eed2bc8dc345dd4f1d6b65d3b85", "score": "0.5474632", "text": "cycle() {\n this._pause$.next(false);\n }", "title": "" }, { "docid": "5a68688ae6a96a044a6a8ff610982591", "score": "0.5470428", "text": "resume() {\n if (!this.paused) {\n return;\n }\n\n this.paused = false;\n\n if (this.connection) {\n this.connection.resumeRequest(this);\n }\n }", "title": "" }, { "docid": "8bdc0bf2599f095227527b689cf0cf70", "score": "0.54700065", "text": "function waterLoad() {\n vid.loop();\n}", "title": "" }, { "docid": "592e4139f0ee8e1590973abc1cd5a9ec", "score": "0.5465246", "text": "async play() { return false;}", "title": "" }, { "docid": "474330059c56da3f39f31d3c4d2919ab", "score": "0.5462328", "text": "function startXTApp(){\r\n if($(\"#flash_holder embed\").length){\r\n sneakyXHR(\"http://video2.xtube.com/find_video.php?\"+$(\"#flash_holder embed\").attr(\"flashvars\"), function(d){\r\n videoLink(\"http://cdn1.publicvideo.xtube.com\"+decodeURIComponent(d.substring(\"&filename=\".length)));\r\n });\r\n }\r\n}", "title": "" }, { "docid": "448074a730736d21d77dada2a4793d65", "score": "0.545238", "text": "function runPause() {\r\n var state = 'pause'; //use to change the button\r\n \r\n if( status == PLAYING || status == RESUME ) {\r\n PlayerPlugin.Pause();\r\n status = PAUSED;\r\n } else if (status == PAUSED) {\r\n PlayerPlugin.Resume();\r\n status = PLAYING;\r\n state = 'play';\r\n }\r\n\r\n //send state for Progressbar component to update the button displayed\r\n //the values of changeButton accept are: stop, pause, play\r\n if(objVideo2_controller != undefined) {\r\n objVideo2_controller.changeButton(state);\r\n }\r\n }", "title": "" }, { "docid": "7610f61bfad0fc2205cc5f813b4e9256", "score": "0.54501903", "text": "pause() {\n this._isPaused = true;\n }", "title": "" }, { "docid": "7610f61bfad0fc2205cc5f813b4e9256", "score": "0.54501903", "text": "pause() {\n this._isPaused = true;\n }", "title": "" }, { "docid": "3f36a72ff83f9cfd917a4d4d99054e44", "score": "0.5449918", "text": "function Download_set(){\n\tconsole.log(\"make a file with \" + paper_list.size)\n\tif (state ==\"ref\"){\n\t\tlink_=getCSVLinkElement(\"Ready to Download References\",\"References\");\n\t\t$(\"#ref_button\").hide();\n\t\t$(\"#ref_div\").append(link_);\n\t\t//enable the download citattion button\n\t\t$(\"#citation_button\").prop(\"disabled\",false);\n\t\t}\n\t\t\n\tif(state == \"citation\"){\n\t\tlink_=getCSVLinkElement(\"Ready to Download Citations\",\"Citations\");\n\t\t$(\"#citation_button\").hide();\n\t\t$(\"#citations_div\").append(link_);\n\t\t//enable the download ref button\n\t\t$(\"#ref_button\").prop(\"disabled\",false);\n\t\t}\n\treset_progressbar();\n\t\n}", "title": "" }, { "docid": "e78ce74204b4c4b3baacc46cbf50e51d", "score": "0.5444982", "text": "start()\n {\n if (this._started)\n return;\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "title": "" }, { "docid": "6d5134bc4df8a2aba6b088090e073081", "score": "0.5443425", "text": "function resume_ticker() {\n document.getElementById(\"resume\").style.display = \"none\";\n document.getElementById(\"pause\").style.display = \"block\";\n ticker.pause() ;\n ticker.resume() ;\n cur_music.play() ;\n}", "title": "" }, { "docid": "52ce69c53b572deb377f29c62471d2b1", "score": "0.5443331", "text": "function _start(){\r\n\tsilenceCount = 0;\r\n\tspeechCount = 0;\r\n\tlastInput = 0;\r\n\trecording = true;\r\n\t_sendMessage(STARTED);\r\n\tblobNumber = 0;\r\n}", "title": "" }, { "docid": "0d396cc30f9c12155f84f1cd70da2d46", "score": "0.5442412", "text": "prePlay() {}", "title": "" }, { "docid": "d9a994f8c56afee8d70386afa3e4edd1", "score": "0.54400784", "text": "function debuggy() {\n\tdebugg.downpercent += random(5, 10)\n\tif (debugg.downpercent > 100) debugg.downpercent = 0\n\tif (random(1, 20) == 1) {\n\t\tupdateProgress(debugg.url, \"ERROR: DEBUG\", 1)\n\t\treturn\n\t}\n\tlog(debugg.url, debugg.downpercent + \"%\\n\")\n\tupdateProgress(debugg.url, \"[download] \" + debugg.downpercent + \"% of 123MiB at \" + random(9, 12) + \"MiB/s ETA 01:48:52\")\n\tif (debugg.downpercent == 100) {\n\t\tdebugg.nextpercent = 0\n\t}\n\tsetTimeout(debuggy, random(50, 200))\n}", "title": "" }, { "docid": "afc1b3c2b0168d5edb1e0b286f2c95e1", "score": "0.54400516", "text": "function webPlug_OnProgess( progress )\n{\n\tif( progress != 100 ) return;\n\tapp.HideProgress();\n}", "title": "" }, { "docid": "0e2ea4fcc48d660f0f3b2ecd144aad4e", "score": "0.54390216", "text": "function downloadNextPod() {\n\n\t// Done?\n\tif (downloadId >= podcasts.length || downloadCount >= options.maxDownloadItems) {\n\t\tconsole.log(\"FINISHED DOWNLOADING \" + downloadCount + \" FILES, exiting...\");\n\t\treturn;\n\t}\n\n\t// Retrieve the podcast object\n\tvar podObj = podcasts[downloadOrder[downloadId++]];\n\n\t// Dating\n\tvar date = new Date(podObj.timestamp);\n\tif (podObj.timestamp < options.startTimestamp || podObj.timestamp > options.endTimestamp) {\n\t\tconsole.log(\"Skipping podcast '\" + podObj.title + \"':\");\n\t\tconsole.log(\" --> Date is out of range: \" + new Date(podObj.timestamp));\n\t\tdownloadNextPod();\n\t\treturn;\n\t}\n\n\t// Skip if not valid format\n\tif (!options.filetypes[podObj.file.type]) {\n\t\tconsole.log(\"Skipping podcast '\" + podObj.title + \"':\");\n\t\tconsole.log(\" --> Invalid file format: \" + podObj.file.type);\n\t\tdownloadNextPod();\n\t\treturn;\n\t}\n\n\t// File mngmt\n\t// var fileName = sanitize(podObj.dateStr + \" - \" + podObj.title + (podObj.mp3url ? \".mp3\" : \".mp4\"));\n\tvar fileName = sanitize(dateToString(podObj.timestamp, \"-\") + \" - \" + podObj.title + \".\" + podObj.file.type);\n\tvar downloadDir = options.downloadPath + \"/\" + date.getUTCFullYear();\n\tvar dest = downloadDir + \"/\" + fileName;\n\n\t// Check if download path exists\n\tif (!fs.existsSync(downloadDir)) {\n\t\tconsole.log(\"Creating directory \" + downloadDir);\n\t\tfs.mkdirSync(downloadDir);\n\t}\n\n\t// Timers\n\tvar startTime = Date.now();\n\tconsole.log(\" \");\n\tconsole.log((new Date()).toString());\n\n\tvar downloadUrl = podObj.file.url;\n\n\t// Download if valid link\n\tif (downloadUrl != null) {\n\t\tconsole.log(\"Starting download #\" + downloadCount + \": \" + fileName);\n\n\t\tvar fileWriter = fs.createWriteStream(dest);\n\t\t\n\t\t// The main request\n\t\tvar req = http.get(downloadUrl, function(res) {\n\n\t\t\t//http://stackoverflow.com/a/20203043/1934487\n\t\t\tvar resLen = parseInt(res.headers['content-length'], 10);\n\t\t\tvar cur = 0;\n\t\t\tvar total = (resLen / 1048576).toFixed(3); //1048576 - bytes in 1Megabyte\n\t\t\tpodObj.fileSize = total;\n\t\t\tvar perc = 0;\n\n\t\t\tres.pipe(fileWriter);\n\t\t\t\n\t\t\t// Download progress on the console\n\t\t\tres.on('data', function(chunk) {\n\t\t\t\tcur += chunk.length;\n\t\t\t\tperc = (100 * cur / 1048576 / total).toFixed(2);\n\t\t\t\tprocess.stdout.write(\"Downloaded \" + perc + \"% of \" + total + \" MB\\r\");\n\t\t\t})\n\n\t\t\t// Close the file, add id3 tags and timeout next download\n\t\t\tfileWriter.on('finish', function() {\n\t\t\t\tvar duration = millisToMins(Date.now() - startTime);\n\t\t\t\tconsole.log(\"Download complete: \" + podObj.fileSize + \" MB in \" + duration + \" mins\");\n\t\t\t\tdownloadCount++;\n\t\t\t\tfileWriter.close(timeoutDownload);\n\n\t\t\t\t// Write id3 tags\n\t\t\t\tif (options.writeID3Tags && podObj.file.type == \"mp3\") {\n\t\t\t\t\tvar tags = {\n\t\t\t\t\t\ttitle: podObj.title,\n\t\t\t\t\t\tartist: podObj.author,\n\t\t\t\t\t\tyear: date.getUTCFullYear(), \n\t\t\t\t\t\tcomment: { \n\t\t\t\t\t\t\tlanguage: \"eng\", \n\t\t\t\t\t\t\ttext: podObj.detail + \" - \" + podObj.url\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tvar success = nodeID3.write(tags, dest);\n\t\t\t\t\tif (success) console.log(\"Successfuly written tags\");\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t}).on('error', function(err) {\n\t\t\tfs.unlink(dest);\n\n\t\t\tconsole.log(\"ERROR DOWNLOADING \" + fileName);\n\t\t\tconsole.log(err.message);\n\n\t\t\ttimeoutDownload(); // continue with next\n\t\t});\n\n\n\t} else {\n\t\tconsole.log(\"Skipping \" + fileName + \" --> no valid download file\");\n\t\tdownloadNextPod(); // continue with next\n\n\t}\n}", "title": "" }, { "docid": "5bd7e8b84cbe836a162a2727b64bd410", "score": "0.5437228", "text": "function downThemAll() {\n console.log(program.username, program.password, program.download, program.mode);\n let run = new LyndaDownloader(program.username, program.password, program.download, program.mode);\n run.setUrl(program.url)\n .then(() => {\n run.start();\n })\n .catch(error => {\n console.log(error);\n process.exit(1);\n });\n}", "title": "" }, { "docid": "16ab922744503e0671ecc27495c0199d", "score": "0.543084", "text": "function startStop() {\n var currentSRC = $(this).attr(\"src\");\n var active = $(this).attr(\"active\");\n var still = $(this).attr(\"still\");\n if (currentSRC == still) {\n $(this).attr(\"src\", active);\n } else {\n $(this).attr(\"src\", still);\n }\n }", "title": "" }, { "docid": "f32ef30a435bc942213d4ec799c43a33", "score": "0.54270333", "text": "function next() {\n btn = true;\n delay = 10000;\n clearTimeout(delayImage);\n nextImage();\n}", "title": "" }, { "docid": "8255640cf6337183f11d85dec3a58cdc", "score": "0.5425194", "text": "function Program() {\n\t// Make sure it is of the correct URL\n\tvar url = window.location.href;\n\tif (!url.match(/watch|embed/)) return;\n\n\tunsafe.getVariable(\"ytplayer\", function(ytp) {\n\t\t// If the old thing is still there, wait a while\n\t\tytplayer = ytp || {};\n\t\tif ($(\"#downloadBtn\").length > 0 || !ytplayer.config) {\n\t\t\tsetTimeout(Program, 2000);\n\t\t\treturn;\n\t\t}\n\n\t\t// Verify that the potential is LOADED, by comparing the\n\t\t// number of SIGNATURES to the number of URLs\n\t\tvar potential = qualities.getPotential();\n\t\tif (!qualities.checkPotential(potential)) {\n\t\t\tsetTimeout(Program, 2000);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the signature (required for decrypting)\n\t\tsignature.fetchSignatureScript(function() {\n\t\t\t// Reset the audio size\n\t\t\tglobalProperties.audioSize = false;\n\n\t\t\t// Initialise the available qualities\n\t\t\tqualities.initialise(function() {\n\t\t\t\tqualities.sortItems();\n\t\t\t\t// Update the download button, set it to be ENABLED\n\t\t\t\t// with text \"Download\"\n\t\t\t\tdisplay.updateDownloadButton(\"Download\");\n\n\t\t\t\t// Initialise the options & add it to the frame\n\t\t\t\tdisplay.initOptions(qualities, $(\"#downloadBtnInfo\"));\n\n\t\t\t\t// Update the display (fetch sizes as well)\n\t\t\t\tdisplay.update();\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "529bbbca47714360d19244754308aaf0", "score": "0.5424408", "text": "function check_progress(){\n\t//no request in queue\n\tif(request_counter==0){\n\t\tDownload_set()\n\t\t$(\"#myProgress\").hide();\n\t}\n}", "title": "" }, { "docid": "80d8202807e4735f8e2cee3bc61b8fdc", "score": "0.5422286", "text": "pause() {\n this._pause();\n }", "title": "" }, { "docid": "f9e28f5c09d5d48b20e06f8f3e11e51b", "score": "0.5415255", "text": "async function Dvideo(link)\n{ \n await cTab.goto(DownloaderLink);\n await cTab.waitForSelector(\"#sf_url\");\n await cTab.type(\"#sf_url\",link,{delay:200});//putting link in search Box\n await cTab.keyboard.press(\"Enter\");\n await cTab.waitForSelector(\".link-box .def-btn-box\");\n // await cTab.waitForTimeout(5000);\n await cTab.click(\".link-box .def-btn-box\");//click on Download Buttton\n \n}", "title": "" }, { "docid": "31e016407988b5750e41582542f94ff7", "score": "0.54143363", "text": "paused() {\n\n }", "title": "" }, { "docid": "8433cf751e7aa35a6ce7eb925a18bdf0", "score": "0.5413811", "text": "function pause() {\n\t\t\tif(! paused && can_pause) {\n \tsettings.beforePause();\n\t\t\t\t\n\t\t\t\tvar progress_bar = SLIDER.find(AIR).find('.air-progress-bar');\n\t\t\t\tprogress_bar.stop(true);\n\t\t\t\tcurrent_slide_time_timer.pause();\n\t\t\t\t\n\t\t\t\tpaused = true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1a0442c55e0e8f2cf705948ffc4a54ec", "score": "0.5403322", "text": "resume() {\n this[_pause] = false;\n this[_threadsManager]();\n this[_eventEmitter].emit(_event.queue.resumed);\n }", "title": "" }, { "docid": "ecb908ff12eed87d3bb1222533a1bc3e", "score": "0.5401451", "text": "function playPause() {\n $(\".gif\").on(\"click\", function() {\n var status = $(this).attr(\"status\");\n\n if (status === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"src-animated\"));\n $(this).attr(\"status\", \"animated\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"src-still\"));\n $(this).attr(\"status\", \"still\");\n }\n });\n }", "title": "" }, { "docid": "c3165a0c73f68f98032e82f393b1d349", "score": "0.53968346", "text": "function suspend(source) {\n document.getElementById(\"start\").onclick = function() {\n source.close();\n if(isRunning) {\n updateState(\"killed\");\n }\n enable();\n stopTime();\n }\n }", "title": "" }, { "docid": "483fe014a14b16bdff68ebf183df4ada", "score": "0.53945094", "text": "function waitOnPendingImport(url) {\nconsole.log(`\\x1B[0;33m`, `>>>> ACTUAL waitOnPendingImport ENTER`, url , `\\x1B[0m` );\n return octokitRequest(`GET ${url}`)\n .then((res) => {\n if (res.data.status === 'pending') {\nconsole.log(`\\x1B[0;36m`, `>>>> ACTUAL waitOnPendingImport PENDING`, url , `\\x1B[0m` );\n return\n waitOnPendingImport(res.data.url)\n .delay(1000);\n }\nconsole.log(`\\x1B[0;34m`, `>>>> ACTUAL waitOnPendingImport IMPORTED`, url , `\\x1B[0m` );\n return res;\n })\n .catch(err => {\n console.log(`\\x1B[0;31m`, `>>>> ACTUAL waitOnPendingImport WTF `, err , `\\x1B[0m` );\n });\n}", "title": "" }, { "docid": "6464e89b27d47c10fcf81d2e7f66c1cc", "score": "0.5390442", "text": "static watchDownloadEvent() {\n\t\tif( __download_watcher )\n\t\t\treturn;\n\n\t\t__download_watcher = true;\n\n\t\t// data.{tabId, url, filename, success}\n\t\tExtension.onMessage(\n\t\t\t'onFileDownload',\n\t\t\tfunction(result){\n\t\t\t\t// result.id = task.id\n\t\t\t\tDOWNLOAD_DISPATCHER.dispatchOnce(result && result.id, result);\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "2dadf72f401365dedee48d700ac74fe3", "score": "0.53852826", "text": "_pause() {\n\t\tthis.paused++;\n\t}", "title": "" }, { "docid": "47b7e24cf56f5e19f657bf183cd96ef2", "score": "0.53827584", "text": "function displayDownload(){\r\n //uses same process as above typed.js to create downloading message\r\n var downloadingmessage = new Typed('#txtDownload', {\r\n strings: [\"Downloading...\"],\r\n typeSpeed: typePace,\r\n showCursor: false,\r\n });\r\n //shows loading bar after 1 second\r\n setTimeout(showBar, 1000);\r\n \r\n }", "title": "" }, { "docid": "1cb504ca207b8de4d21b0caf00826ea9", "score": "0.5376238", "text": "function waiting_for_file_publish (request_filename) {\n if (status.restoring) return ; // restoring backup\n z_publish({publish: true, reason: (request_filename ? request_filename : 'waiting_for_file')}) ;\n }", "title": "" } ]
d32156fa602aadcdc02b8f36c1fef2e1
const randomColor = (opacity) => "hsla(" + Math.round(randomNumber(0, 360), 2) + "," + Math.round(randomNumber(0, 100), 2) + "%," + Math.round(randomNumber(0, 100), 2) + "%, " + opacity + ")";
[ { "docid": "1518c93af2989006ebdd2e621654c4aa", "score": "0.0", "text": "function HSLAToHexA(hsla) {\n let sep = hsla.indexOf(\",\") > -1 ? \",\" : \" \";\n hsla = hsla.substr(5).split(\")\")[0].split(sep);\n\n // Strip the slash\n if (hsla.indexOf(\"/\") > -1) hsla.splice(3, 1);\n\n let h = hsla[0],\n s = hsla[1].substr(0, hsla[1].length - 1) / 100,\n l = hsla[2].substr(0, hsla[2].length - 1) / 100,\n a = hsla[3];\n\n if (h.indexOf(\"deg\") > -1) h = h.substr(0, h.length - 3);\n else if (h.indexOf(\"rad\") > -1) h = Math.round(h.substr(0, h.length - 3) * (180 / Math.PI));\n else if (h.indexOf(\"turn\") > -1) h = Math.round(h.substr(0, h.length - 4) * 360);\n if (h >= 360) h %= 360;\n\n // s /= 100;\n // l /= 100;\n\n let c = (1 - Math.abs(2 * l - 1)) * s,\n x = c * (1 - Math.abs(((h / 60) % 2) - 1)),\n m = l - c / 2,\n r = 0,\n g = 0,\n b = 0;\n\n if (0 <= h && h < 60) {\n r = c;\n g = x;\n b = 0;\n } else if (60 <= h && h < 120) {\n r = x;\n g = c;\n b = 0;\n } else if (120 <= h && h < 180) {\n r = 0;\n g = c;\n b = x;\n } else if (180 <= h && h < 240) {\n r = 0;\n g = x;\n b = c;\n } else if (240 <= h && h < 300) {\n r = x;\n g = 0;\n b = c;\n } else if (300 <= h && h < 360) {\n r = c;\n g = 0;\n b = x;\n }\n\n // Having obtained RGB, convert channels to hex\n r = Math.round((r + m) * 255).toString(16);\n g = Math.round((g + m) * 255).toString(16);\n b = Math.round((b + m) * 255).toString(16);\n\n a = Math.round(a * 255).toString(16);\n\n if (r.length == 1) r = \"0\" + r;\n if (g.length == 1) g = \"0\" + g;\n if (b.length == 1) b = \"0\" + b;\n if (a.length == 1) a = \"0\" + a;\n\n if (a === \"ff\") return r + g + b;\n else return r + g + b + a;\n}", "title": "" } ]
[ { "docid": "31d2ce8ca274088220c88a8d63edf62f", "score": "0.88770473", "text": "function getRandColor(opacity) { //insert number between 0-1 to adjust opacity\n let rgb = [Math.random() * 256, Math.random() * 256, Math.random() * 256];\n let rgba = \"rgba(\" + rgb.join(\",\") + \",\" + opacity + \")\";\n return rgba;\n}", "title": "" }, { "docid": "3f1f7e4baecb0056f0b11e3f00dbbfb3", "score": "0.8581091", "text": "function randomColor(alpha){\n var r = Math.random()*225+30;\n var g = Math.random()*225+30;\n var b = Math.random()*225+30;\n return \"rgba(\" + Math.ceil(r) +\",\" + Math.ceil(g) + \",\" + Math.ceil(b) + \",\" + alpha +\" )\";\n}", "title": "" }, { "docid": "22404ee8fd13733ed49de693afff19da", "score": "0.85755545", "text": "function randomColor() {\n return `hsl(${Math.random() * 360}, 100%, 50%)`;\n}", "title": "" }, { "docid": "36748668981656deaab79b0bf5a751f9", "score": "0.84066767", "text": "function random_color() {\n const r = Math.floor(Math.random() * 300)\n const g = Math.floor(Math.random() * 300)\n const b = Math.floor(Math.random() * 300)\n return `rgba(${r},${g},${b})`\n}", "title": "" }, { "docid": "e2331e6b5dbe4171364561f34a487d70", "score": "0.83310753", "text": "function getRandomColor() {\n //do not be complete completely transparent\n var opacity = getRandom(3, 10) / 10;\n return \"rgba(\" + getRandom(0, 255) + \",\" + getRandom(0, 255) + \",\" + getRandom(0, 255) + \",\" + opacity + \")\";\n }", "title": "" }, { "docid": "3de514a5aaf92785ccfeee84be14e270", "score": "0.8265339", "text": "randomColor(){\n //return '#'+Math.floor(Math.random()*16777215).toString(16);\n var h = 1 + Math.random()*(1, 360);\n var s = 100;\n var l = 50;\n return 'hsl(' + h + ',' + s + '%,' + l + '%)';\n }", "title": "" }, { "docid": "f2028a5bf73c0dd29428c666bfe1b628", "score": "0.82320184", "text": "static niceColor(){\n return 'hsl(' + 360 * Math.random() + ', 50%, 25%)';\n }", "title": "" }, { "docid": "cd481cb018de2d0e35f0bc7200a787f4", "score": "0.81404346", "text": "function getRandomColor() {\n color = \"hsl(\" + Math.random() * 360 + \", 70%, 55%)\";\n return color;\n}", "title": "" }, { "docid": "3bdbd8bb55dd62dc77a28402b67fd2f6", "score": "0.8134768", "text": "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n}", "title": "" }, { "docid": "556e28565d48cf7d7582fda91278cc55", "score": "0.81233615", "text": "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n}", "title": "" }, { "docid": "b85f2bf0e9ab59a92f3121e13d2b6e69", "score": "0.8109024", "text": "function randomColor() {\n const deg = Math.random() * 360;\n return `hsl(${deg}, 60%, 50%)`;\n }", "title": "" }, { "docid": "e2f0b752ba84283385c80ff2ff8902e0", "score": "0.8019623", "text": "function random_rgba() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgba(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n }", "title": "" }, { "docid": "5afe590b3ddf247619901375e1378d72", "score": "0.8011784", "text": "function randColor() {\r\n var r = Math.floor(Math.random() * (255 - 0 + 1) ) + 0;\r\n var g = Math.floor(Math.random() * (255 - 0 + 1) ) + 0;\r\n var b = Math.floor(Math.random() * (255 - 0 + 1) ) + 0;\r\n return `rgba(${r},${g},${b},0.2)`;\r\n}", "title": "" }, { "docid": "5eb1c87e294802a34d6fe1a7ea92675f", "score": "0.79621685", "text": "function randomBg(){\r\n // It returns random hsl property of CSS.\r\n return `hsl(${Math.floor(Math.random()*360)}, 100%, 50%)`;\r\n}", "title": "" }, { "docid": "3715440c5ac3debf55259da56fe2b6e4", "score": "0.7950183", "text": "function randomColor() {\n return \"rgb(\" + Math.floor(Math.random() * 255) + \", \" + Math.floor(Math.random() * 255) + \", \" + Math.floor(Math.random() * 255) + \")\";\n}", "title": "" }, { "docid": "cf30461890d5583395492b57218f4a80", "score": "0.79403156", "text": "function randomColor() {\n\tvar ret=\"rgb(\";\n\tret += Math.round(100*Math.random()) + \"%,\";\n\tret += Math.round(100*Math.random()) + \"%,\";\n\tret += Math.round(100*Math.random()) + \"%)\";\n\treturn ret;\n}", "title": "" }, { "docid": "2016d0a10f808d93c65eb322b64394f3", "score": "0.7912088", "text": "function RandomColor(){\n return \"rgb(\"+getRandomInt(220)+\", \"+getRandomInt(220)+\", \"+getRandomInt(220)+\")\";\n}", "title": "" }, { "docid": "5d85fbeeec021c96ed54d1ae13e22e91", "score": "0.7904639", "text": "function randomColor(){\r\n function c(){\r\n let randomHexNumber=Math.floor(Math.random()*256).toString(16);\r\n return (\"0\"+randomHexNumber).substr(-2);\r\n }\r\n return \"#\"+c()+c()+c();\r\n}", "title": "" }, { "docid": "3005b6a21193e2bd90b11a9b470f4bc2", "score": "0.78657407", "text": "function randomColor(){\n \n red = Math.round(Math.random() * 257) ;\n green = Math.round(Math.random() * 257) ;\n blue = Math.round(Math.random() * 257) ; \n return \"rgb(\"+red+\", \"+green+\", \"+blue+\")\";\n \n}", "title": "" }, { "docid": "4932bc6860260c86f2ccc9654fa39a25", "score": "0.78565943", "text": "function generateRandomColorHex(){\n let hexColor = 'rgba(';\n hexColor += random(255) + ',' + random(255) + ',' + random(255) + ', 1)';\n return hexColor;\n}", "title": "" }, { "docid": "ea783da4ef65e3894d953c85d06a4aa0", "score": "0.78485924", "text": "randomColor() {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n return 'rgb(' + r + ' , ' + g + ' , ' + b + ')';\n }", "title": "" }, { "docid": "f95447bf83e14dd4a21b5a5395d03bd2", "score": "0.78426087", "text": "function randomColor(){\n\treturn \"rgb(\" + Math.floor(Math.random()*256) + \", \" + Math.floor(Math.random()*256) + \", \" + Math.floor(Math.random()*256) + \")\";\n}", "title": "" }, { "docid": "1cee0ed2b58f104b0e897856c51f1252", "score": "0.7836153", "text": "function randomColor() {\n\tconst f = 0;\n\tlet red = Math.floor(Math.random()*256);\n\tlet green = Math.floor(Math.random()*256);\n\tlet blue = Math.floor(Math.random()*256);\n\treturn \"rgb(\" + red + \", \" + green + \", \" + blue + \")\";\n}", "title": "" }, { "docid": "5912a916e66545edd52f608064fbed9c", "score": "0.782402", "text": "function randomColour() {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "e243b430893c0e8a0f5d8b5948bb343a", "score": "0.78129363", "text": "function randomColor() {\n \n return {\n hue: Math.random() * 360,\n saturation: 0.8,\n brightness: 0.8,\n alpha: 0.5\n };\n\n}", "title": "" }, { "docid": "4783c682a7e7d0186050a2e32e1edfc0", "score": "0.7792921", "text": "function randomColor() {\n // pick a \"red\" from 0-255\n let r = Math.floor(Math.random() * 256);\n // pick a \"red\" from 0-255\n let g = Math.floor(Math.random() * 256);\n\n // pick a \"red\" from 0-255\n let b = Math.floor(Math.random() * 256);\n // return rgb like rgb(223,123,22)\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n\n}", "title": "" }, { "docid": "48e03c02d26f55c820a7ba3a647b01ff", "score": "0.7777256", "text": "generateRandomColour() {\n var goldenConjugate = 0.618033988749895;\n var min = Math.ceil(0);\n var max = Math.floor(9999999);\n var number = Math.random() * (max - min + 1) + min;\n number += goldenConjugate;\n number %= 1;\n\n let colour = this.hsv_to_rgb(number,0.5,0.99);\n return \"rgb(\"+colour[0]+\",\"+colour[1]+\",\"+colour[2]+\")\";\n }", "title": "" }, { "docid": "fe756830f23adea3d08d43bd5b42112a", "score": "0.7766598", "text": "function randomColor(){\r\n\tlet r = rand255();\r\n\tlet g = rand255();\r\n\tlet b = rand255();\r\n\r\n\t//make the colour:\r\n\tvar color = \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n\r\n\treturn color;\r\n}", "title": "" }, { "docid": "700121a2945c1be231762e9fb05951d8", "score": "0.7762364", "text": "function getRandomColor() {\n const randomBetween = (min, max) => min + Math.floor(Math.random() * (max - min + 1));\n const r = randomBetween(0, 255);\n const g = randomBetween(0, 255);\n const b = randomBetween(0, 255);\n const rgba = `rgba(${r},${g},${b},100)`; \n return rgba;\n}", "title": "" }, { "docid": "d162a948208b214cacef23ebd9f195ce", "score": "0.7761782", "text": "function randomColor() {\n\tlet r = Math.floor(Math.random() * 256);\n\tlet g = Math.floor(Math.random() * 256);\n\tlet b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\"+ r+\", \"+g+\", \"+ b+\")\";\n}", "title": "" }, { "docid": "8ff909755067a94371712c47252347a2", "score": "0.775696", "text": "function randomColor(){\r\n\tvar r = Math.floor(Math.random()*256);\r\n\tvar g = Math.floor(Math.random()*256);\r\n\tvar b = Math.floor(Math.random()*256);\r\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "title": "" }, { "docid": "2d7065649782fc3953affa2cdfae226b", "score": "0.77558565", "text": "function randomColor(){\n\n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "c5dc81d4a60c1b1d97b2070206aaaaf2", "score": "0.77384084", "text": "function randomColor() {\n // pick a 'red' from 0-255\n let r = Math.floor(Math.random() * 256);\n // pick a 'green from 0-255\n let g = Math.floor(Math.random() * 256);\n // pick a 'blue' from 0-255\n let b = Math.floor(Math.random() * 256);\n // create a return string\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "a075807e2a8c621a296940c14112e539", "score": "0.7736892", "text": "function randomColor() {\n \n return {\n red: 0,\n green: Math.random(),\n blue: Math.random(),\n alpha: ( Math.random() * 0.25 ) + 0.05\n };\n\n}", "title": "" }, { "docid": "3742fce84b031ee34918232a6e802b29", "score": "0.7723279", "text": "function randomColour() {\n return 'rgb(' + randomNumber() + ',' + randomNumber() + ',' + randomNumber() + ')';\n }", "title": "" }, { "docid": "91ed672294073b0f988674594ed7ef01", "score": "0.77199894", "text": "function randomColour(){\n let color = Math.floor(0x1000000 * Math.random()).toString(16);\n return '#' + ('000000' + color).slice(-6);\n}", "title": "" }, { "docid": "6aa4fe3eeb146291094a8f7e4220e93e", "score": "0.7711701", "text": "function RandomColor() {\n return '#' + Math.random().toString(16).substr(2, 6).toUpperCase();\n}", "title": "" }, { "docid": "27d0f09b5c8fe9c9cf304f56d161ed90", "score": "0.770546", "text": "function randColor() {\r\n let x = Math.floor(Math.random() * 256);\r\n let y = Math.floor(Math.random() * 256);\r\n let z = Math.floor(Math.random() * 256);\r\n return \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\r\n }", "title": "" }, { "docid": "ca779f3afdd43e4a9b3f1ddd4eecbc16", "score": "0.7702255", "text": "function randColor() {\n var r = (Math.floor(Math.random()*256) + 80) / 2;\n var g = (Math.floor(Math.random()*256) + 80) / 2;\n var b = (Math.floor(Math.random()*256) + 80) / 2;\n return \"rgb(\" + [r,g,b].join() + \")\";\n}", "title": "" }, { "docid": "3c09fb710aa1589c06c3118b325ecac7", "score": "0.7678017", "text": "function getRandomColorString(){\n \n return \"rgb(\" + getRandomNumber(255) + \",\" + getRandomNumber(255) + \",\" + getRandomNumber(255) + \")\";\n}", "title": "" }, { "docid": "cbe920b22c7faf13fa7e15b00c78949c", "score": "0.76723963", "text": "function randomColorGenerator() {\n let rgb1 = Math.floor(256*Math.random()-1);\n let rgb2 = Math.floor(256*Math.random()-1);\n let rgb3 = Math.floor(256*Math.random()-1);\n let alpha = Math.random().toFixed(1);\n let randomColor = `rgba(${rgb1}, ${rgb2}, ${rgb3}, ${alpha})`;\n document.getElementById(\"color-circle\").style.backgroundColor = randomColor;\n document.getElementById(\"color-circle-2\").style.backgroundColor = randomColor;\n document.getElementById(\"color-circle-3\").style.backgroundColor = randomColor;\n}", "title": "" }, { "docid": "b3e03872964964ea6c6d287a624a400d", "score": "0.76680297", "text": "function randomColor(){\r\n //pick \"red\" from 0-255\r\n var red = Math.floor(Math.random() * 256);\r\n //pick \"green\" from 0-255\r\n var green = Math.floor(Math.random() * 256);\r\n //pick \"blue\" from 0-255\r\n var blue = Math.floor(Math.random() * 256);\r\n //return the string in the format rgb(255, 255, 255);\r\n return(\"rgb(\" + red + \", \" + green + \", \" + blue + \")\");\r\n\r\n}", "title": "" }, { "docid": "fa155a687080fb749a84a02d8fe7b12f", "score": "0.76565903", "text": "function randomColor(){\n var r = Math.floor(Math.random() * 256) ;\n var g = Math.floor(Math.random() * 256) ;\n var b = Math.floor(Math.random() * 256) ;\n return \"rgb(\" + r + \", \" + g +\", \" + b + \")\";\n}", "title": "" }, { "docid": "6c8cd5c83ed69d1a0ce89688d4ec9ba2", "score": "0.76545215", "text": "function randomColor(){\n var r = Math.floor(Math.random()*256);\n var g = Math.floor(Math.random()*256);\n var b = Math.floor(Math.random()*256);\n return \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n}", "title": "" }, { "docid": "99300a74c3336bb89c6f6285de1e2893", "score": "0.7637098", "text": "function randomColor () {\n return Math.floor(Math.random() * (255 - 0 + 1) + 0);\n}", "title": "" }, { "docid": "2b919edcbd4baf30e0ff8034f722c28f", "score": "0.7635911", "text": "function randomColor () {\n //pick a \"red\" 0 - 255\n var r = Math.floor(Math.random() * 256)\n //pick a \"green\" 0 - 255\n var g = Math.floor(Math.random() * 256)\n //pick a \"blue\" 0 - 255\n var b = Math.floor(Math.random() * 256)\n return `rgb(${r}, ${g}, ${b})`; \n //return \"rgb(\" + r + \",\" + g + \",\" + b + \")\"; \n}", "title": "" }, { "docid": "d65cc95870e5ad4e9ed0554c62f2af45", "score": "0.76344484", "text": "function randomColor() {\n return '#' + (Math.random().toString(16) + '0000000').slice(2, 8);\n}", "title": "" }, { "docid": "0a9d7df71b365ea939ddd5fdf5814992", "score": "0.76330763", "text": "function randomColor() {\n var randomNumber1 = Math.floor(Math.random() * 256);\n var randomNumber2 = Math.floor(Math.random() * 256);\n var randomNumber3 = Math.floor(Math.random() * 256);\n return 'rgb(' + randomNumber1 + ', ' + randomNumber2 + ', ' + randomNumber3 + ')';\n}", "title": "" }, { "docid": "fb7575ccb98cd8ba98b8e0f9cb063f8e", "score": "0.76312417", "text": "function randomColor() {\n\tvar red = Math.floor(Math.random() * 256);\n\tvar green = Math.floor(Math.random() * 256);\n\tvar blue = Math.floor(Math.random() * 256);\n return 'rgb(' + red + ',' + green + ',' + blue + ')';\n}", "title": "" }, { "docid": "405dca7282b42c592696c6e9b1a033cb", "score": "0.76252574", "text": "function randomColor(){\n for(var i=0; i<3; i++){\n var r = Math.floor(Math.random() * 255);\n var g = Math.floor(Math.random() * 255);\n var b = Math.floor(Math.random() * 255);\n }\n return \"rgb(\" + r +\", \"+ g +\", \"+ b +\")\";\n}", "title": "" }, { "docid": "59bf517a6118a9d4591e793efde4c35d", "score": "0.76137644", "text": "function color() {\n return Math.floor(Math.random()*256);\n}", "title": "" }, { "docid": "eb53fbcaad2b96c504d5af81033dca9d", "score": "0.7609979", "text": "function getRandomColor() {\n let red = Math.floor(Math.random() * 256);\n\tlet green = Math.floor(Math.random() * 256);\n\tlet blue = Math.floor(Math.random() * 256);\n\treturn `rgb(${red}, ${green}, ${blue})`;\n}", "title": "" }, { "docid": "a7bb02379d2488f715742d03f6467cad", "score": "0.76027995", "text": "function randomColor() {\r\n var r = Math.floor(Math.random() * 256);\r\n var g = Math.floor(Math.random() * 256);\r\n var b = Math.floor(Math.random() * 256);\r\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\"; \r\n}", "title": "" }, { "docid": "8197d7fdb38a70adb5dea94dc804110a", "score": "0.7597177", "text": "function randomColor() {\n return '#'+Math.floor(Math.random()*16777215).toString(16);\n}", "title": "" }, { "docid": "5696a694fbf06933ebd0fa2c5145133b", "score": "0.7589626", "text": "function randomColor(){\n var color = `rgb( ${randomRGB()}, ${randomRGB()}, ${randomRGB()})`;\n return color;\n}", "title": "" }, { "docid": "4f50ac852d68f22b0fe40c95ad44c30c", "score": "0.7583669", "text": "function randomColor(){\n // color red \n var r = Math.floor(Math.random() * 256);\n var g = Math.floor(Math.random() * 256);\n var b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b +\")\";\n}", "title": "" }, { "docid": "1db7bc4e6d9d823a91d284586a31248e", "score": "0.7578014", "text": "function colorChooser(){\n\n var red=Math.floor(Math.random()*256);\n var green=Math.floor(Math.random()*256);\n var yellow=Math.floor(Math.random()*256);\n\n return \"rgb(\" + red + \", \" + green + \", \" + yellow + \")\";\n\n}", "title": "" }, { "docid": "fd2cad3eaa488131d5de79ae2651fb41", "score": "0.7569238", "text": "function randomColor() {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n let random = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n return random;\n}", "title": "" }, { "docid": "99151d1dc14813db0a1250b97907a14a", "score": "0.7564133", "text": "getRandomColor() {\n const letters = '0123456789ABCDEF';\n let color = '#';\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n }", "title": "" }, { "docid": "2474ae1a3c30f24fce2681249a789bad", "score": "0.7559338", "text": "function randomColor() {\n let R = Math.floor(Math.random() * 245);\n let G = Math.floor(Math.random() * 250);\n let B = Math.floor(Math.random() * 255);\n return 'rgb(' + R + ',' + G + ',' + B + ')';\n }", "title": "" }, { "docid": "cbed8eee82ed71a8075d4d024870fb68", "score": "0.7558741", "text": "function randomColor(){\n //random number from 0-255\n //red\n //green\n //blue\n var red = randomNumber(0, 255);\n var green = randomNumber(0, 255);\n var blue = randomNumber(0, 255);\n //build css value to return: \"rgb(##, ##, ##)\"\n return \"rgb(\"+red+\", \"+green+\", \"+blue+\")\";\n}", "title": "" }, { "docid": "901818be436ad402fbc5eecf79f1a10e", "score": "0.75557345", "text": "function randomColor() {\n //red\n var r = Math.floor(Math.random() * 256);\n //green\n var g = Math.floor(Math.random() * 256);\n //blue\n var b = Math.floor(Math.random() * 256);\n //return the random color\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "cd158b614660ccf54a47103267616a5c", "score": "0.7551554", "text": "function randomColor(){\n\t//Picking random colours using math.random and rounding down\n\tvar r = Math.floor(Math.random() * 255);\n\tvar g = Math.floor(Math.random() * 255);\n\tvar b = Math.floor(Math.random() * 255);\n\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "9ee778b930e24ed0f2d508ceb4686bfc", "score": "0.7550959", "text": "function randomColor() {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n return randColor = `rgb(${r},${g},${b})`;\n}", "title": "" }, { "docid": "699844d3f6275e48745a5ff54832662b", "score": "0.7547338", "text": "function generateRandomColor() {\nvar r = Math.floor(Math.random() * 256);\nvar g = Math.floor(Math.random() * 256);\nvar b = Math.floor(Math.random() * 256);\n\nreturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "b36afe7b495e7d5cb036db04cc3027ab", "score": "0.7542808", "text": "function randomColor(){\n\t\t\treturn 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';\n\t\t}", "title": "" }, { "docid": "3be21dbd97c02c49bb27c69e733c2958", "score": "0.75388366", "text": "function randomColor() {\n //get random red color from 0 to 255\n var r = Math.floor(Math.random() * 256);\n //get random green color from 0 to 255\n var g = Math.floor(Math.random() * 256);\n //get random blue color from 0 to 255\n var b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "80daf1b8fde1b787feda400be1babe4b", "score": "0.75296265", "text": "function randomColor(){\n\t // pick red\n\t var r = Math.floor(Math.random()*256);\n\t // pick green\n\t var g = Math.floor(Math.random()*256);\n\t // pick blue\n\t var b = Math.floor(Math.random()*256);\n\n\t return \"rgb(\"+r+\", \"+g+\", \"+b+\")\"\n\n}", "title": "" }, { "docid": "e0621bf9cfca59dbcc69cf0340398aef", "score": "0.7528053", "text": "function randomColour() {\n let red = randomRGB();\n let green = randomRGB();\n let blue = randomRGB();\n const rgbColour = 'rgb(' + red + ',' + green + ',' + blue + ')';\n return rgbColour;\n}", "title": "" }, { "docid": "2a4646d41eb2710096072dbab4426b2f", "score": "0.7523564", "text": "function randomColor() {\n // R from 0-255, times 256 to make 255 possible\n var r = Math.floor(Math.random() * 256);\n // G from 0-255\n var g = Math.floor(Math.random() * 256);\n // B from 0-255\n var b = Math.floor(Math.random() * 256);\n // \"rgb(r, g, b)\"\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "e958a154f94aa444b93d477bdcfa1e4c", "score": "0.7522173", "text": "function make_random_color(){\n //pick a red blue and yellow from 0 - 255\n var red = Math.floor(Math.random() * 256);\n var blue = Math.floor(Math.random() * 256);\n var green = Math.floor(Math.random() * 256);\n //now we going to return the random numbers as a string representing rgb\n var rgb = \"rgb(\"+red+\", \"+green+\", \"+blue+\")\";\n return rgb;\n\n}", "title": "" }, { "docid": "55e4f793cd3a1747b1796957d46ac152", "score": "0.75162536", "text": "function randomRGB() {\n return `rgb(${random(0, 255)},${random(0, 255)},${random(0, 255)})`;\n}", "title": "" }, { "docid": "c95c1aeb1dbd7b755e13bf759400fb7e", "score": "0.75009793", "text": "function randomColor() {\n\n return color(random(255), random(255), random(255));\n}", "title": "" }, { "docid": "ed3a1caccff8c177cc9caec1e83d36ae", "score": "0.7494281", "text": "function colorGenerator() {\n\treturn 'hsl(' + randInt(0, 360) + ',' + randInt(20, 80) + '%,' + randInt(20, 80) + '%)';\n}", "title": "" }, { "docid": "c8987668c1248c51fa92d102d28a798b", "score": "0.74923354", "text": "function randomColor() {\n // pick a \"red\" from 0 - 255\n var r = Math.floor(Math.random() * (255 + 1));\n // pick a \"green\" from 0 - 255\n var g = Math.floor(Math.random() * (255 + 1));\n // pick a \"blue\" from 0 - 255\n var b = Math.floor(Math.random() * (255 + 1));\n\n // NB make sure rgb(0, 0, 0) have space after the comma,\n // and rgb is lowercase\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "fc3a5862a6b20eafedd268cc76ea53f7", "score": "0.74921274", "text": "function alphaChange(opacity){\n opacity = 0.99;\n var randomOpacity = 0;\n var randomNumber = 0;\n for(var i = 0; i < 10; i++){\n // 0.01 or 0\n randomOpacity = (Math.round(Math.random() * 1)/1)/100;\n randomNumber = Math.floor(Math.random() * 10) + 1;\n console.log(\"randomNumber:\" + randomOpacity);\n }\n \n if (randomNumber > 5){\n opacity = opacity + randomOpacity;\n }\n \n if (randomNumber <= 5){\n opacity = opacity - randomOpacity;\n }\n \n return opacity;\n }", "title": "" }, { "docid": "74eb8ae035dccb06a366600b49653e4e", "score": "0.7490862", "text": "function randColor(){ \r\n var number = Math.floor(Math.random() * 256);\r\n return number;\r\n}", "title": "" }, { "docid": "dde2cba0a493f5ecc68594af9fc5077f", "score": "0.74821407", "text": "function randomColor() {\n var red = Math.floor(Math.random() * 256 ) ;\n var green = Math.floor(Math.random() * 256 ) ;\n var blue = Math.floor(Math.random() * 256 ) ;\n var color = 'rgb(' + red + ',' + green + ',' + blue + ')' ;\n return color ;\n}", "title": "" }, { "docid": "36478cf0322f509e5b105eb5c242ffce", "score": "0.74726015", "text": "function randomColor(){\n\t//pick a \"red\" from 0 - 255\n\tvar r = Math.floor(Math.random() * 256);\n\t//pick a \"green\" from 0 - 255\n\tvar g = Math.floor(Math.random() * 256);\n\t//pick a \"blue\" from 0 - 255\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "111b0c47551ffa77e96cc895c1d14fb1", "score": "0.7465381", "text": "function getRandomColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (let i = 0; i < 6; i += 1) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return h2r(color);\n}", "title": "" }, { "docid": "7cca980086de04d62ec9d91cf8b474cc", "score": "0.74650407", "text": "function randomColor(){\n // pick a red, green, and blue\n // will be (0,256)\n var red = Math.floor(Math.random() * 256);\n var green = Math.floor(Math.random() * 256);\n var blue = Math.floor(Math.random() * 256);\n //create string\n var color = \"rgb(\" + red +\", \" + green +\", \" + blue +\")\";\n \n return color\n}", "title": "" }, { "docid": "4a45de8c3b7fd53366adf4cad61a5961", "score": "0.7462395", "text": "function random_color()\n{\n let choices = [\n // {r: 1, g: 1, b: 1},\n {r: 0.92, g: 0, b: 0.54},\n {r: 0.149, g: 0.66, b: 0.878},\n {r: 0.254, g: 1, b: 0.956},\n {r: 1, g: 0.945, b: 0}\n ]\n return choices[Math.floor(Math.random() * choices.length)];\n}", "title": "" }, { "docid": "e92a32039b3b1eef488e34d22c057695", "score": "0.74606466", "text": "function getRandomColor() {\r\n var rand = function() {\r\n return Math.floor(Math.random() * 256);\r\n };\r\n return `rgb(${rand()}, ${rand()}, ${rand()})`;\r\n }", "title": "" }, { "docid": "61d93baced42937ca7f30c679e979db8", "score": "0.7458719", "text": "randomColor() {\n return '#' + Math.floor(Math.random()*16777215).toString(16); /* sunt 16777215 de posibilitati de culori (255*255*255) si transformam acest numar in baza 16, adica in Hexa */\n }", "title": "" }, { "docid": "df0c02bee0d7530efe7039ad7b8010d2", "score": "0.7452492", "text": "function generateRandomColor() {\r\n let red = Math.floor(Math.random() * 255);\r\n let green = Math.floor(Math.random() * 255);\r\n let blue = Math.floor(Math.random() * 255);\r\n return `rgb(${red}, ${green}, ${blue})`;\r\n}", "title": "" }, { "docid": "0a74b08bef5050248e1a5d5c685f29e9", "score": "0.74478763", "text": "function randomColor() {\n\t//pick a \"red\" from 0 - 255\n\t// * 256 because Math.floor rounds\n\t//down and want 255 to be max number\n\tvar r = Math.floor(Math.random() * 256);\n\t//pick a \"green\" from 0 - 255\n\tvar g = Math.floor(Math.random() * 256);\n\t//pick a \"blue\" from 0 - 255\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "31ddc3af34d7a6d695fe681eb77a97a1", "score": "0.7447344", "text": "function random_color() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \", \" + y + \", \" + z + \")\";\n return color;\n }", "title": "" }, { "docid": "91e5bef33cac57b1b13827f312646372", "score": "0.7441293", "text": "function randomRed() {\t\n\treturn color(random(100, 235), random(50), random(50));\n}", "title": "" }, { "docid": "55973b4d7df3c7cd70c81faa35f7f1c8", "score": "0.743936", "text": "function randomColor() {\n //pick a \"red\" from 0 - 255\n let r = Math.floor(Math.random() * 256);\n //pick a \"green\" from 0 - 255\n let g = Math.floor(Math.random() * 256);\n //pick a \"blue\" from 0 - 255\n let b = Math.floor(Math.random() * 256);\n return `rgb(${r}, ${g}, ${b})`;\n }", "title": "" }, { "docid": "52404bc697076cd2766574a87f52c516", "score": "0.74363655", "text": "function createColor() {\n //pick a \"red\" from 0 - 255\n var r = Math.floor(Math.random() * 255);\n //pick a \"green\" from 0 - 255\n var g = Math.floor(Math.random() * 255);\n //pick a \"blue\" from 0 - 255\n var b = Math.floor(Math.random() * 255);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" }, { "docid": "4f448929539481be44b78a463fe00cc2", "score": "0.74359065", "text": "function getRndColor() {\n var r = 255*Math.random()|0,\n g = 255*Math.random()|0,\n b = 255*Math.random()|0,\n a = Math.random();\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}", "title": "" }, { "docid": "10e0b5afff1f90629694b2cc4670b86f", "score": "0.7432885", "text": "function generate_random_color() {\n var o = Math.round, r = Math.random, s = 255;\n return 'rgb(' + o(r()*s) + ',' + o(r()*s) + ',' + o(r()*s) + ',' + r().toFixed(1) + ')';\n}", "title": "" }, { "docid": "d41589e29ba8e26396e3aacd79411042", "score": "0.7426836", "text": "function randomColour () {\n return '#' + Math.random().toString(16).slice(2, 8);\n }", "title": "" }, { "docid": "bbf670eb75b6690b59fd2ce1c622d59f", "score": "0.742576", "text": "function randomColor() {\n const randomR = Math.floor(Math.random() * 256);\n const randomG = Math.floor(Math.random() * 256);\n const randomB = Math.floor(Math.random() * 256);\n return `rgb(${randomR}, ${randomG}, ${randomB})`;\n}", "title": "" }, { "docid": "63de61bed6aee9ac61dc0dfa430bec24", "score": "0.7424437", "text": "function generateRandomColor() {\r\n let colorString = \"#\"\r\n let RGB = [0,0,0];\r\n for (color of RGB) {\r\n color = Math.floor(Math.random()*200)+56;\r\n color = color.toString(16);\r\n if (color.length == 1) {\r\n color = \"0\" + color;\r\n }\r\n colorString = colorString + color;\r\n }\r\n return colorString;\r\n\r\n}", "title": "" }, { "docid": "514234dd498a4861aaabff9069f73d4b", "score": "0.74212986", "text": "function randomColor() {\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n return `rgb(${r}, ${g}, ${b})`;\n}", "title": "" }, { "docid": "f713569de21e30918cf92c7d3f3b9a9f", "score": "0.7409462", "text": "function randomColor() {\r\n return '#' + Math.random().toString(16).substr(-6);\r\n }", "title": "" }, { "docid": "7c784b9220be5f7571944882f1a3cd02", "score": "0.7407961", "text": "function generateRandomColor() {\n\n var red = Math.floor(Math.random() * 256);\n var green = Math.floor(Math.random() * 256);\n var blue = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + red + \", \" + green + \", \" + blue + \")\";\n}", "title": "" }, { "docid": "3af864a154cbca15c213b614000e2a69", "score": "0.7405882", "text": "function randomColor(){\r\n\t//make random number for R\r\n\tvar r = Math.floor(Math.random() * 256);\r\n\t//make random number for G\r\n\tvar g = Math.floor(Math.random() * 256);\r\n\t//make random number for B\r\n\tvar b = Math.floor(Math.random() * 256);\r\n\t\r\n\t//return the colors in RGB format\r\n\t return \"rgb(\" + r + \", \" + g + \", \" + b + \")\"\r\n}", "title": "" }, { "docid": "db22f0bda24bea2085a0084a11db3b3a", "score": "0.7405679", "text": "function GetRandomColor() {\n var r = 0, g = 0, b = 0;\n while (r < 100 && g < 100 && b < 100)\n {\n r = Math.floor(Math.random() * 128);\n g = Math.floor(Math.random() * 128);\n b = Math.floor(128 + Math.random() * 128);\n }\n\n return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "title": "" }, { "docid": "b50495dad40aef5ebf215fcf13470e7c", "score": "0.7405554", "text": "function randomColor() {\n\t//pick a \"red\" from 0 - 255\n\tvar r = Math.floor(Math.random() * 256);\n\t//pick a \"green\" from 0 - 255\n\tvar g = Math.floor(Math.random() * 256);\n\t//pick a \"blue\" from 0 - 255\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "title": "" } ]
5723240a39124d79f30613c95308e362
You can think of these components as "pages" in your app.
[ { "docid": "c43e50490209130c23e61f13b782a2de", "score": "0.5581834", "text": "function Home() {\n \n return (\n <div>\n <h1>Home</h1>\n \n </div>\n \n \n );\n }", "title": "" } ]
[ { "docid": "1543b3d6c2ccf855cbdafc1cea02d8f0", "score": "0.6293703", "text": "function HomeComponent(page, apollo) {\n this.page = page;\n this.apollo = apollo;\n this.show = false;\n this.outofView = false;\n }", "title": "" }, { "docid": "01aa59faad9514e26d880b2c2dda28de", "score": "0.6217895", "text": "function AppPage() {\n Page.apply(this, arguments);\n }", "title": "" }, { "docid": "735f3332641e6805e01965444e9743b7", "score": "0.6132882", "text": "pages() {\n return [this.add(), this.edit(), this.list()];\n }", "title": "" }, { "docid": "18fda032aedbf3ab937fc7ee23136468", "score": "0.61214215", "text": "function pages() {\n\t\t/* returns an array of the objects with the class name */\n\t\tvar extButtons = document.getElementsByClassName(\"external-page\");\n\n\t\t/* link the buttons to the appropriate pages */\n\t\tfor(var i = 0; i < extButtons.length; i++) {\n\t\t\textButtons[i].onclick = inject;\n\t\t}\n\t}", "title": "" }, { "docid": "3e1175d873c445d8f26051bb078f1651", "score": "0.6120879", "text": "renderPages(pages) {\n pages.forEach(({module, options}) => {\n this.renderPage(module, Object.assign({}, options, this.options));\n });\n }", "title": "" }, { "docid": "f899e46292dadf8e1ca21974ec3dcb90", "score": "0.60923004", "text": "function PageManager() {\n /**\n * Show page\n */\n this.showView = function(view) {\n // Close the current view.\n if (this.currentView){\n this.currentView.close();\n }\n // Set new view as current view.\n this.currentView = view;\n // Add view to page. \n $('#content').html(this.currentView.el);\n };\n /**\n * Get current uri\n */\n this.getCurrentPageUri = function() {\n return this.currentUri;\n };\n /**\n * Set current uri\n */\n this.setCurrentPageUri = function(uri) {\n this.currentUri = uri;\n };\n }", "title": "" }, { "docid": "8fc45106962bae83ae326a6d0ee2f5d8", "score": "0.6041311", "text": "function route_logic(){\n\n //you will get page,cont,panel and params for you to route to.\n let natives = engine.params.native.get();\n\n if(engine.router.active.page == null){\n //when there is no page you have to init one then you will have to use router to go to a new page.\n //you can only init a page once and only here.\n startPage.init(/*pass conts and further data to the page*/);\n }\n\n}", "title": "" }, { "docid": "6dbf2ec8c48d1ca81817cf1b51e5a067", "score": "0.6034682", "text": "static get template() {\n return html`\n <style>\n :host {\n display: block;\n }\n\n \n </style>\n <app-location route={{route}}></app-location>\n <app-route data=\"{{routeData}}\" route=\"{{route}}\" pattern=\"[[rootPath]]:page\"></app-route>\n\n <iron-pages selected={{page}} attr-for-selected=\"name\" role=\"main\">\n \n <registration-page name=\"registration-page\"></registration-page>\n <login-page name=\"login-page\"></login-page>\n <dashboard-page name=\"dashboard-page\"></dashboard-page>\n <admin-page name=\"admin-page\"></admin-page>\n <order-page name=\"order-page\"></order-page>\n\n </iron-pages>\n `;\n }", "title": "" }, { "docid": "e60401eb1207a503d65f5ed28778f505", "score": "0.60130525", "text": "_determinePage() {\n let pageComponent;\n switch (this.state.page) {\n case 'home':\n pageComponent = <HomePage />;\n break;\n default:\n pageComponent = <HomePage />;\n }\n return pageComponent;\n }", "title": "" }, { "docid": "ed3c9d92da5efe93960fe0110af23903", "score": "0.6007386", "text": "function App() {\n return (\n <div> \n <NavBar></NavBar>\n <JoinUsButtonCount></JoinUsButtonCount>\n <HeaderBox></HeaderBox>\n <NextMeetUp></NextMeetUp>\n <AwesomeMeet></AwesomeMeet>\n <AboutMeetUp></AboutMeetUp>\n <ComeMeet></ComeMeet>\n <Members></Members>\n <Organizers></Organizers>\n <PastMeetUps></PastMeetUps>\n <Dates></Dates>\n <Copyright></Copyright>\n </div>\n );\n }", "title": "" }, { "docid": "5b0475bbc0a073ae48518a7a79079943", "score": "0.5982801", "text": "function PageController(pages) {\n this.allPages = pages.children;\n}", "title": "" }, { "docid": "8cf2b03832ce14c73dfd68ff772a0df2", "score": "0.5955685", "text": "function navMyStories() {\n hidePageComponents();\n putOwnStoriesOnPage();\n}", "title": "" }, { "docid": "1aeeb7b2a9aaa02ec4733286c03b558b", "score": "0.59537894", "text": "function MemeFolio() {\n return(\n <div>\n This is the MemeFolio Page\n </div>\n )\n}", "title": "" }, { "docid": "de12274ae0f12c36c8d4ebd41863e7eb", "score": "0.5934733", "text": "function developingPage() {\n return [{\n type: 'h1',\n text: 'DWST Development'\n }, '', ['- Run the ', {\n type: 'dwstgg',\n text: '#development',\n section: '#development'\n }, ' server'], ['- User interface ', {\n type: 'dwstgg',\n text: '#styleguide',\n section: '#styleguide'\n }], ['- WebSocket server ', {\n type: 'dwstgg',\n text: '#simulator',\n section: '#simulator'\n }]];\n}", "title": "" }, { "docid": "33bd5b84b92d93085c5e3a732631c422", "score": "0.59342676", "text": "function renderPage(){\n let activePage\n let pageList = pageState\n \n \n pageList.forEach(page=>{\n if(page.isActive){\n activePage = page\n }\n })\n let pagesObj ={\n \"Overview\":<OverviewPage pageInfo = {activePage} pages = {pageState} API = {API} dataAccess = {dataAccess}/>,\n \"Pump\":<PumpPage pageInfo = {activePage} API = {API}/>,\n \"Admin\":<AdminPage API = {API} userPermissions = {userPermissions}/>,\n \"Account\":<MyAccountPage API = {API} userPermissions = {userPermissions} resetPassword = {resetPassword}/>\n }\n return pagesObj[activePage.pageType]\n }", "title": "" }, { "docid": "9d69d1044f80d22d5176c2e3a6fa2741", "score": "0.59061474", "text": "function MainPage(app, data){\n Page.call(this, app, $('#mainPage')[0], MainCtrl, MainView, {\n menu: new MenuComponent(app, {\n element: '.menu-button-container'\n })\n });\n}", "title": "" }, { "docid": "0db8ac664de10e4fcb16bb4b7e774c5b", "score": "0.5902902", "text": "function App() {\n\treturn (\n\t\t<div className=\"App\">\n\t\t\t{/* 组件 */}\n\t\t\t{/* <ClassComponent /> */}\n\t\t\t{/* <FunctionComponent /> */}\n\n\t\t\t{/* setState */}\n\t\t\t{/* <SetStatePage /> */}\n\n\t\t\t{/* 生命周期 */}\n\t\t\t{/* <LifeCyclePage /> */}\n\n\t\t\t{/* 组件复合 */}\n\t\t\t{/* <HomePage /> */}\n\t\t\t{/* <UserPage /> */}\n\n\t\t\t{/* Redux */}\n\t\t\t{/* <ReduxPage /> */}\n\n\t\t\t{/* ReactRedux */}\n\t\t\t{/* <ReactReduxPage /> */}\n\n\t\t\t{/* ReactRouter */}\n\t\t\t{/* <RouterPage /> */}\n\n\t\t\t{/* PureComponent */}\n\t\t\t{/* <PureComponentPage /> */}\n\n\t\t\t{/* Hook */}\n\t\t\t{/* <HookPage /> */}\n\t\t\t{/* <CustomHookPage /> */}\n\n\t\t\t{/* HookApi (优化)*/}\n\t\t\t{/* 函数组件内 */}\n\t\t\t{/* <UseMemoPage /> */}\n\t\t\t{/* 父子组件间 */}\n\t\t\t{/* <UseCallbackPage /> */}\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "e7bcf0c27f160879b4308e26858159a1", "score": "0.58705485", "text": "function pageContent() {\n \n // if loading is true, show loader\n if (props.loading) {\n return <div>\n <Loader/>\n </div>;\n }\n \n // Page content\n return <div>\n <Breadcrumb>\n <Breadcrumb.Item>Dashboard</Breadcrumb.Item>\n <Breadcrumb.Item>Home</Breadcrumb.Item>\n </Breadcrumb>\n <Title>Welcome to Colleges Info Dashboard</Title>\n <Paragraph>\n This application is developed to check colleges details with features such as:\n </Paragraph>\n <Paragraph>\n <ul>\n <li>\n List of all colleges\n </li>\n <li>\n Colleges details by ID/name\n </li>\n <li>\n Similar colleges based on location, no of students and courses offered\n </li>\n <li>\n List of students in a college\n </li>\n <li>\n State-based distribution graph\n </li>\n <li>\n Course-based distribution graph\n </li>\n <li>\n State-specific colleges details in a country\n </li>\n <li>\n Course-specific colleges details in a country\n </li>\n </ul>\n </Paragraph>\n <Paragraph>\n This application is developed using <a href=\"https://expressjs.com/\">Express.js</a> as backend, <a href=\"https://reactjs.org/\">React</a> as frontend along with <a href=\"https://ant.design/\">Ant Design</a>\n </Paragraph>\n </div>\n }", "title": "" }, { "docid": "fa1cc4a13e5ede77bd723df4e480872f", "score": "0.5853287", "text": "function renderLandingPage() {\n rHelpers.renderHeading();\n // rHelpers.renderAuthBtns();\n forms.renderLoginForm();\n forms.renderRegisterLink();\n}", "title": "" }, { "docid": "24a8c86599ceb561623a69687c4b46cd", "score": "0.5842833", "text": "function routePage() {\n var pageViewName = document.body.getAttribute('data-pageViewName') || 'PageView';\n var ReactView = ReactViews[pageViewName];\n\n try {\n // Render modals we need on each page\n var loginEl = React.createElement(Login, { socialLogin: (JanesWalk.stacks || { \"Social Logins\": \"\" })['Social Logins'] });\n\n // FIXME: once site's all-react, move this out of the JanesWalk object. Don't follow this approach\n // or we'll end up with massive spaghetti.\n window.JanesWalk.react = { login: loginEl };\n\n React.render(loginEl, document.getElementById('modals'));\n\n // Load our translations upfront\n I18nUtils.getTranslations(JanesWalk.locale);\n\n // Hybrid-routing. First check if there's a React view (which will render\n // nearly all the DOM), or a POJO view (which manipulates PHP-built HTML)\n if (ReactView) {\n switch (pageViewName) {\n case 'CreateWalkView':\n React.render(React.createElement(ReactView, {\n data: JanesWalk.walk.data,\n city: JanesWalk.city,\n user: JanesWalk.user,\n url: JanesWalk.walk.url,\n valt: JanesWalk.form.valt\n }), document.getElementById('createwalk'));\n break;\n }\n } else {\n // FIXME: I'm not in-love with such a heavy jQuery reliance\n new PageViews[pageViewName]($(document.body));\n }\n } catch (e) {\n console.error('Error instantiating page view ' + pageViewName + ': ' + e.stack);\n }\n}", "title": "" }, { "docid": "e0322915bdc4a74a47341cfdb34f64eb", "score": "0.5839917", "text": "function App() {\n return (\n <div className=\"App\">\n <PageNav />\n <MainNewsNav />\n <LocalNewsNav />\n <MainBodyNewsOne />\n </div>\n );\n}", "title": "" }, { "docid": "05e08f99d8203117554b35d60c1e69da", "score": "0.5827942", "text": "function mainPage() {\n\n return [{\n type: 'h1',\n text: 'DWST Guide to Galaxy'\n }, '', 'DWSTGG is here to help you get the most out of Dark WebSocket Terminal', '', {\n type: 'h2',\n text: 'Topics'\n }, '', ['- ', {\n type: 'dwstgg',\n text: '#introduction',\n section: '#introduction'\n }, ' for beginners'], ['- Working with ', {\n type: 'dwstgg',\n text: '#unprotected',\n section: '#unprotected'\n }, ' sockets'], ['- ', {\n type: 'dwstgg',\n text: '#privacy',\n section: '#privacy'\n }, ' and tracking information'], ['- Alphabetical list of ', {\n type: 'dwstgg',\n text: '#commands',\n section: '#commands'\n }], ['- Alphabetical list of ', {\n type: 'dwstgg',\n text: '#functions',\n section: '#functions'\n }], ['- ', {\n type: 'dwstgg',\n text: '#developing',\n section: '#developing'\n }, ' DWST itself'], '', ['Open with ', {\n type: 'syntax',\n text: '/help #<keyword>'\n }], ''];\n}", "title": "" }, { "docid": "eb60dab9fa4f0e21445e5fde1c1773d2", "score": "0.5805061", "text": "function Index() {\n return (\n <React.Fragment>\n {/* <AppAppBar /> */}\n <Header screen={\"Website\"} />\n <div className=\"container\"></div>\n <ProductHero />\n <SchoolIntro />\n <ProductCategories />\n <Testimonials />\n <MailSubscriptions />\n <ProductValues />\n <ProductSmokingHero />\n <AppFooter />\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "05cf441c314d9a962ec6b9917f6f5f5d", "score": "0.5798825", "text": "function ManagePages() {\n\t}", "title": "" }, { "docid": "f38b852665215643ace604d03aabc8bf", "score": "0.5788933", "text": "function getPages()\n{\n\t//add each page to view in app\n\t//Examples:\n\t//for adding a header:\n\t////\"header\":{\n\t////\t\"url\":\"pages/general/header.html\",\n\t////\t\"left\":\"<a></a>\",\n\t////\t\"center\":\"<a></a>\",\n\t////\t\"right\":\"<a></a>\"\n\t////}\n\t//for adding a panel:\n\t////\"leftPanel\":{\n\t////\t\"id\":\"nav-panel\",\n\t////\t\"url\":\"pages/general/left_panel.html\"\n\t////}\n\t//for adding dialogs, you can add more then one\n\t////\"popup\":[\n\t//// {\n\t//// \t \"url\":\"pages/general/popup.html\",\n\t//// \t \"id\":\"dialog\", \n\t//// \t \"header\":\"myHeader\", \n\t//// \t \"title\":\"Hi Dialog!\", \n\t//// \t \"content\":\"You have to insert your own content here\", \n\t//// \t \"okButton\":{\"action\":\"alert('ok button action');\",\"location\":\"#login\",\"text\":\"OK\"}, \n\t//// \t \"cancelButton\":{\"action\":\"alert('cancel button action');\",\"location\":\"\",\"text\":\"Cancel\"}\n\t//// }\n\t//// ]\n\treturn [\n\t\t\t{\"id\":\"initial\", \"url\":\"pages/initial.html\"},\n\t\t\t{\"id\":\"mma\", \"url\":\"pages/MMASelect.html\",\n\t\t\t\t\"header\":{\n\t\t\t\t\"url\":\"pages/general/header.html\",\n\t\t\t\t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Tipo</a>\",\n\t\t\t\t\"center\":\"<h1>Marca - Modelo - Año</h1>\",\n\t\t\t\t\"right\":\"\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\"id\":\"familias\", \"url\":\"pages/familias.html\",\n\t\t\t\t\"header\":{\n\t\t\t\t\t\"url\":\"pages/general/header.html\",\n\t\t\t\t\t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Auto</a>\",\n\t\t\t\t\t\"center\":\"<h1>Familias</h1>\",\n\t\t\t\t\t\"right\":\"\"\n\t\t\t\t\t}\n\t\t\t},\n\t\t\t{\"id\":\"productos\", \"url\":\"pages/productos.html\",\n\t\t\t\t\"header\":{\n\t\t\t\t\t\"url\":\"pages/general/header.html\",\n\t\t\t\t\t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Familias</a>\",\n\t\t\t\t\t\"center\":\"<h1>Productos</h1>\",\n\t\t\t\t\t\"right\":\"\"\n\t\t\t\t\t}\n\t\t\t},\n\t\t\t{\"id\":\"pge_details\", \"url\":\"pages/detalles.html\",\n\t\t\t\t\"header\":{\n\t\t\t\t\t\"url\":\"pages/general/header.html\",\n\t\t\t\t\t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Productos</a>\",\n\t\t\t\t\t\"center\":\"<h1>Detalles</h1>\",\n\t\t\t\t\t\"right\":\"\"\n\t\t\t\t\t}\n\t\t\t}\n\t ];\n\t\n}", "title": "" }, { "docid": "9ced8e87aa835a04891e01c5b65ff739", "score": "0.5788168", "text": "function main(data) {\r\n // Render initial page\r\n showPage(data, 1);\r\n // Add pagination for other pages\r\n addPagination(data);\r\n}", "title": "" }, { "docid": "fc830650fed685e1037d2bf8ab004c77", "score": "0.57870066", "text": "onPageChange() { }", "title": "" }, { "docid": "1d34ce9ceebb3f35b987c798d28df5bb", "score": "0.5779013", "text": "function renderApp(state, elements) {\n // default to hiding all routes, then show the current route\n Object.keys(elements).forEach(function(route) {\n elements[route].hide();\n });\n elements[state.route].show();\n\n if (state.route === 'start') {\n console.log('render Start Page');\n //renderStartPage(state, elements[state.route]);\n }\n else if (state.route === 'question') {\n console.log('render Question Page');\n renderQuestionPage(state, elements[state.route]);\n }\n else if (state.route === 'answer-feedback') {\n console.log('render Feedback Page');\n renderAnswerFeedbackPage(state, elements[state.route]);\n }\n else if (state.route === 'final-feedback') {\n console.log('render Final Page');\n renderFinalFeedbackPage(state, elements[state.route]);\n }\n}", "title": "" }, { "docid": "329458874deda97eead479e5ec6816e8", "score": "0.5769847", "text": "constructor()\r\n {\r\n this.pages = [];\r\n this.currentPage = 1;\r\n this.title = \"Menu Collection\";\r\n this.color = \"#000000\";\r\n this.description = \"Default Menu Collection item, can be send with the 'CustomMenuCollection' action\";\r\n this.footer = \"Default Footer\"\r\n this.invalidPageMessage = \"_*Sorry, that page doesn't exist*_\";\r\n }", "title": "" }, { "docid": "d0357991053106121061a723a5a83fc8", "score": "0.57565916", "text": "function showPage() {\n switch (currentPage) {\n case 1:\n return (\n <NameEmailBiz handleChange={handleChange} handleBlur={handleBlur} values={values} errors={errors} nextPage={nextPage}/>\n \n )\n case 2:\n return (\n <WithPlaid history={props.history} values={values} nextPage={nextPage} handleChange={handleChange}/>\n )\n case 3:\n return (\n <SelectAccount loading={loading} history={props.history} values={values} nextPage={nextPage} handleAgreeToTerms={handleAgreeToTerms} handleChange={handleChange} uploadPlaid={uploadPlaid}/>\n )\n \n default:\n return (<div>success<br/> your account and funding source has been linked. now you can use Trevi!</div>);\n\n }\n }", "title": "" }, { "docid": "1fc762b47eed79e0529b2702f04c18c1", "score": "0.5755171", "text": "function initComponents_() {\n var header = new UI.widget.Header();\n header.render(dom_.getElementsByTagName('header')[0]);\n\n var navigation = new UI.widget.Navigation();\n navigation.render(dom_.getElementsByTagName('aside')[0]);\n\n navigation.on('change', function(data) {\n UI.common.Router.set({\n page: data.id\n });\n });\n\n document.body.appendChild(dom_);\n }", "title": "" }, { "docid": "78537a8ad972918d64d16c7d0729f2f4", "score": "0.5753037", "text": "function App() {\n return (\n <div>\n <Header />\n <Content>\n {/* Tiny router for demo */}\n {{\n '/': <Controls />\n }[window.location.pathname] || <div>404 - not found</div>}\n </Content>\n </div>\n )\n}", "title": "" }, { "docid": "3c671a917d464c879777166231f6756e", "score": "0.57277584", "text": "function App() {\n return (\n <div>\n <Navbar />\n < Routing />\n\n \n {/* < Homepage /> */}\n {/* <Connect4 /> */}\n {/* <Chess /> */}\n </div>\n );\n}", "title": "" }, { "docid": "9f833575b4cb41eeb53668f8c5c54739", "score": "0.57256114", "text": "function step_0_guide_home() {\n return (\n <div>\n <h1>Guide start page</h1>\n </div>\n )\n}", "title": "" }, { "docid": "03954df67b78b5d1de7967be02e6577d", "score": "0.5720426", "text": "function MainContent() {\n render(\n // <div>\n // <h1>My name is Selina</h1>\n // <p>\n // I'm a current radiographer, seeking to improve my programming skills.\n // </p>\n // </div>\n );\n}", "title": "" }, { "docid": "c9c0d382d427574ce3872ed1f5d3093c", "score": "0.5711657", "text": "_pageChanged(page) {\r\n switch (page) {\r\n\r\n\r\n case 'login':\r\n import('./login-page.js');\r\n break;\r\n\r\n case 'admin-page':\r\n import('./admin-Page.js');\r\n break;\r\n case 'salesperson-page':\r\n import('./salesPerson-page.js');\r\n break;\r\n case 'my-bookings':\r\n import('./my-bookings.js');\r\n break;\r\n\r\n }\r\n }", "title": "" }, { "docid": "43909df7d768c978d04f848e12900c63", "score": "0.57087165", "text": "function TabsPage() {\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_2__home_home__[\"a\" /* HomePage */];\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_1__contact_contact__[\"a\" /* ContactPage */];\n this.tab3Root = __WEBPACK_IMPORTED_MODULE_2__home_home__[\"a\" /* HomePage */];\n }", "title": "" }, { "docid": "8c784f1d0361fbae924b0a28304b6675", "score": "0.5707386", "text": "DisplayComponents() {\n\n console.log(\"Display component page type\", this.state.pageType)\n switch(this.state.pageType) {\n\n case(0) : return <Microsoft/>\n\n \n case(1) : return <MutipleQuiz/>\n\n case(2) : return <TrueFalseQuiz/>\n\n default : return this.reset()\n\n \n } \n\n\n \n }", "title": "" }, { "docid": "98396907beddb0941b724e3643b2cd32", "score": "0.5698556", "text": "function renderHome() {\n \n // Render the page\n Dom.div(function () {\n \n // display current time\n Obs.observe(function () {\n // get the game time from the db (using ref for the observer)\n var time = Db.shared.ref('time', 'gameTime').get();\n \n renderInfoBar(time);\n \n // show the recent events\n EventViews.recent(time);\n \n // show the lynching voting section\n VotingViews.lynching(time);\n \n // button to go to the overview of the citizens\n Ui.bigButton(function () {\n Dom.text('List of citizens');\n Dom.on('click', function () {\n // go to citizen overview\n Page.nav(['citizens']);\n });\n });\n \n // display the role\n RoleViews.description(Db.personal.get('role'), time);\n });\n \n \n });\n }", "title": "" }, { "docid": "451f7b946b7ad038567d3b1904cc6216", "score": "0.5684489", "text": "function loadPage() {\n // configure subscription page\n divSubscriptionPage.appendChild(createCurrencyDropDown());\n divSubscriptionPage.appendChild(createProductButton());\n divSubscriptionPage.appendChild(createPlan(chosenProduct));\n divSubscriptionPage.appendChild(createUpdateBtn());\n setDefault();\n\n // configure summary page\n divSummaryPage.appendChild(createCard('old', 'Previous Subscription'));\n divSummaryPage.appendChild(createCard('new', 'Updated Subscription'));\n divSummaryPage.appendChild(createBackBtn());\n}", "title": "" }, { "docid": "6cb86ff160f17c2889f43c942fb12487", "score": "0.56814003", "text": "function hidePageComponents() {\n const components = [$allStoriesList, $loginForm, $signupForm];\n components.forEach((c) => c.hide());\n}", "title": "" }, { "docid": "aee1a19e830cc266bea9d6830f8a5a31", "score": "0.5673172", "text": "function Home() {\n return (\n <div>\n <Firstpage />\n </div>\n );\n}", "title": "" }, { "docid": "964e24a04981776c4d83de459b4ee7e4", "score": "0.5671134", "text": "function Users() {\n // Um componente que na realidade eh uma PAGINA.\n return (\n <div>\n <h2>Users</h2>\n </div>\n );\n}", "title": "" }, { "docid": "9eee8dcfa4b23a3e130cdb91f16baded", "score": "0.5668321", "text": "function YourVehicleComponent(router) {\n this.router = router;\n this.pages = [\n '/your-trip',\n '/your-driver',\n '/your-vehicle',\n '/your-destination'\n ];\n }", "title": "" }, { "docid": "89ff78b35ead8ca706b4efcd5d56ae5f", "score": "0.5665128", "text": "function create(eventBus, pageLoader, layoutLoader, widgetLoader, localeManager, visibilityManager, pagesCollector) {\n\t\n\t (0, _assert2.default)(eventBus).isNotNull();\n\t (0, _assert2.default)(pageLoader).isNotNull();\n\t (0, _assert2.default)(layoutLoader).isNotNull();\n\t (0, _assert2.default)(widgetLoader).isNotNull();\n\t (0, _assert2.default)(localeManager).isNotNull();\n\t (0, _assert2.default)(visibilityManager).isNotNull();\n\t (0, _assert2.default)(pagesCollector).isNotNull();\n\t\n\t var pageController = void 0;\n\t\n\t var pageServiceApi = {\n\t createControllerFor: function createControllerFor(pageElement) {\n\t _assert2.default.state(!pageController, 'Cannot create a page controller more than once.');\n\t _assert2.default.state(pageElement instanceof HTMLElement, 'A page controller can only be created for a valid DOM element.');\n\t\n\t pageController = createPageController(pageElement);\n\t return pageController;\n\t },\n\t controller: function controller() {\n\t return pageController;\n\t }\n\t };\n\t\n\t ///////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function createPageController(pageElement) {\n\t\n\t var _areaHelper = null;\n\t var api = {\n\t setupPage: setupPage,\n\t tearDownPage: tearDownPage,\n\t areaHelper: function areaHelper() {\n\t return _areaHelper;\n\t }\n\t };\n\t\n\t /** Delay between sending didLifeCycle and attaching widget templates. */\n\t var WIDGET_ATTACH_DELAY_MS = 5;\n\t var COLLABORATOR_ID = 'AxPageController';\n\t var LIFECYCLE_EVENT = { lifecycleId: 'default' };\n\t var EVENT_OPTIONS = { sender: COLLABORATOR_ID };\n\t var DEFAULT_AREAS = [{ name: 'activities', hidden: true }, { name: 'popups' }, { name: 'popovers' }];\n\t\n\t var activeWidgetAdapterWrappers = [];\n\t var cleanUpLayout = function cleanUpLayout() {};\n\t\n\t pageElement.innerHTML = '';\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function setupPage(pageName) {\n\t (0, _assert2.default)(pageName).hasType(String).isNotNull();\n\t\n\t return pageLoader.load(pageName).then(function (page) {\n\t _areaHelper = (0, _area_helper.create)(page);\n\t visibilityManager.setAreaHelper(_areaHelper);\n\t\n\t var layoutPromise = layoutLoader.load(page.layout).then(function (layoutInfo) {\n\t cleanUpLayout = renderLayout(pageElement, _areaHelper, layoutInfo);\n\t });\n\t\n\t localeManager.subscribe();\n\t var layoutWidget = function layoutWidget(widget) {\n\t return layoutWidgetAdapterFor(_areaHelper, widget);\n\t };\n\t\n\t // instantiate controllers wrapped by widget adapters\n\t var widgetPromises = widgetsForPage(page).map(function (widget) {\n\t return 'layout' in widget ? layoutWidget(widget) : widgetLoader.load(widget);\n\t });\n\t\n\t return Promise.all([].concat(_toConsumableArray(widgetPromises), [layoutPromise])).then(function (results) {\n\t return results.slice(0, -1);\n\t });\n\t }).then(function (widgetAdapterWrappers) {\n\t pagesCollector.collectCurrentPage(pageName);\n\t activeWidgetAdapterWrappers = widgetAdapterWrappers;\n\t }).then(localeManager.initialize).then(function () {\n\t return eventBus.publishAndGatherReplies('beginLifecycleRequest.default', LIFECYCLE_EVENT, EVENT_OPTIONS);\n\t }).then(visibilityManager.initialize)\n\t // Give the widgets (a little) time to settle on the event bus before $digesting and painting:\n\t .then(function () {\n\t return delay(WIDGET_ATTACH_DELAY_MS);\n\t }).then(function () {\n\t return _areaHelper.attachWidgets(activeWidgetAdapterWrappers);\n\t });\n\t }\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function tearDownPage() {\n\t visibilityManager.unsubscribe();\n\t localeManager.unsubscribe();\n\t\n\t return eventBus.publishAndGatherReplies('endLifecycleRequest.default', LIFECYCLE_EVENT, EVENT_OPTIONS).then(function () {\n\t activeWidgetAdapterWrappers.forEach(function (wrapper) {\n\t return wrapper.destroy();\n\t });\n\t activeWidgetAdapterWrappers = [];\n\t cleanUpLayout();\n\t cleanUpLayout = function cleanUpLayout() {};\n\t });\n\t }\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function widgetsForPage(page) {\n\t return Object.keys(page.areas).reduce(function (widgets, areaName) {\n\t var areaWidgets = page.areas[areaName];\n\t return areaWidgets.reduce(function (widgets, widget) {\n\t widget.area = areaName;\n\t return [].concat(_toConsumableArray(widgets), [widget]);\n\t }, widgets);\n\t }, []);\n\t }\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function layoutWidgetAdapterFor(areaHelper, widget) {\n\t return layoutLoader.load(widget.layout).then(function (_ref) {\n\t var className = _ref.className,\n\t html = _ref.html;\n\t\n\t var adapter = (0, _layout_widget_adapter.create)(areaHelper, className, {\n\t area: widget.area,\n\t id: widget.id,\n\t path: widget.layout\n\t });\n\t\n\t return {\n\t id: widget.id,\n\t adapter: adapter,\n\t destroy: adapter.destroy,\n\t templatePromise: Promise.resolve(html)\n\t };\n\t });\n\t }\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t function renderLayout(pageElement, areaHelper, layoutInfo) {\n\t addClass(pageElement, layoutInfo.className);\n\t pageElement.innerHTML = layoutInfo.html;\n\t\n\t var areas = (0, _area_helper.findWidgetAreas)(pageElement);\n\t var deregisterFuncs = Object.keys(areas).map(function (areaName) {\n\t return areaHelper.register(areaName, areas[areaName]);\n\t });\n\t\n\t DEFAULT_AREAS.forEach(function (area) {\n\t if (areaHelper.exists(area.name)) {\n\t return;\n\t }\n\t\n\t var node = document.createElement('div');\n\t // We only set the attribute here for debugging purposes\n\t node.setAttribute('ax-widget-area', area.name);\n\t if (area.hidden) {\n\t node.style.display = 'none';\n\t }\n\t deregisterFuncs.push(areaHelper.register(area.name, node));\n\t pageElement.appendChild(node);\n\t });\n\t\n\t return function () {\n\t deregisterFuncs.forEach(function (func) {\n\t return func();\n\t });\n\t removeClass(pageElement, layoutInfo.className);\n\t };\n\t }\n\t\n\t ////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t return api;\n\t }\n\t\n\t ///////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\n\t return pageServiceApi;\n\t}", "title": "" }, { "docid": "8e7366711ceee7e0a4cc4db577a144ce", "score": "0.5662771", "text": "function insertComponentInPage(component) {\n\n if (component.type === \"static\") {\n document.querySelector(\"#template-content\").innerHTML += component.content;\n\n\n } else {\n if (component === nav) {\n const navComponentElement = document.querySelector(\"#nav-menu\");\n if (navComponentElement == null) {\n //insert nav into the DOM (only 1 nav)\n document.querySelector(\"#template-header\").innerHTML += component.content;\n component.init();\n } else {\n console.log('there already is 1 nav');\n }\n } else if (component === slider) {\n document.querySelector(\"#template-content\").innerHTML += component.content;\n component.init();\n console.log('adding slider...');\n } else if (component === gallery) {\n document.querySelector(\"#template-content\").innerHTML += component.content;\n component.init();\n console.log('adding gallery...');\n }\n\n\n }\n\n reinitDynamic();\n\n }", "title": "" }, { "docid": "5acdf6066a9243796348f1ba2664fc04", "score": "0.5657062", "text": "constructor() {\n this.userSettings = new UserSettings();\n\n this.navigation = new Navigation();\n this.speedtest = new SpeedView();\n\n this.historyView = new HistoryPage();\n this.settingsView = new SettingsView();\n this.shareView = new ShareView();\n\n this.routes = [\n {\n url: \"/about\",\n handler: this.aboutPageHandler\n },\n {\n url: \"/results\",\n handler: this.resultsPageHandler\n },\n {\n url: \"/run\",\n handler: this.runPageHandler\n },\n {\n url: \"/settings\",\n handler: this.settingsPageHandler\n },\n {\n pattern: /result(\\/[0-9a-f-]+)?/,\n handler: this.resultPageHandler\n },\n {\n pattern: /share(\\/[0-9a-f-]+)?/,\n handler: this.sharePageHandler\n }\n ];\n this.attachStateHandler();\n }", "title": "" }, { "docid": "92acfc8701defbdc8d171eb8e5ceb743", "score": "0.56555593", "text": "function InfoPage() {\n return (\n <div className=\"container\">\n <h2>Thanks for learning more about Pack Me Up!</h2>\n <h3>Technologies Used:</h3>\n <p>\n Material UI\n -\tAxios\n -\tExpress\n -\tPassport\n -\tReact\n -\tRedux\n -\tRedux Saga\n -\tReact Router\n -\tSweet Alert\n -\tPostgreSQL\n -\tNode\n </p>\n <h3>Toughest Challenge Overcame:</h3>\n <p>Being able to re-use components and customize them with conditional rendering depending on which view we’re looking at, while keeping that data synchronous.</p>\n <h3>Coming Soon:</h3>\n <p>Ability to add friends and invite them to your events, to more easily coordinate group activities.</p>\n <h3>Special Thanks To:</h3>\n <p>All of my classmates in the Genocchi cohort for helping me out over these last few weeks, and a huge thanks to our instructor Dane Smith, the Geppetto to us Genocchios, for giving us the tools to get where we are today.</p>\n\n\n </div>\n );\n}", "title": "" }, { "docid": "275b0b34568a69b828a3d771d211974b", "score": "0.5649255", "text": "function EmergencyPage() {\n return <div className=\"emergency-page\">\n <CommentDetail />\n <Navbar />\n <Services title=\"\" content=\"\" srcPath={ lighting }><h1>Light Fitting & Repairing Services</h1></Services>\n <Heading first=\"Light Fitting & Repairing\" second=\"\"/>\n <Text>\n If you’re in need of any light fitting or repairing, be that in your home, business or outdoors, speak to Emergency Electrician Camden. Our light fitting service covers west, north west, north and central London area and no job is too big or too small for us. If you’re in need of our light fitting services give us a call on 02078 460294. We’ll be more than happy to help. Our electricians have years of experience between them as well as all being NICEIC approved.\n </Text>\n\n {/* <Atom /> */}\n \n <FooterContainer />\n\n </div>;\n}", "title": "" }, { "docid": "6059ebb05ac636c5c2a0d42996a207d3", "score": "0.56488985", "text": "function App() {\n return (\n <Page title=\"Loopui 2021\">\n <GlobalStyles />\n <AnchorDemo />\n <BoxDemo />\n <ButtonDemo />\n <ColorDemo />\n <HeadingDemo />\n <IconDemo />\n <SelectDemo />\n <TextInputDemo />\n </Page>\n );\n}", "title": "" }, { "docid": "87ff088002724bcb996e5cb43d6ee5d5", "score": "0.5645923", "text": "currentPage(page) {\n const { posts } = this.state;\n const { selectedPost } = this.state;\n const { user } = this.state;\n switch(page) {\n case 'sign-up':\n return(\n <SignUpView changeUser={this.changeUser} />\n );\n case 'login':\n return(\n <LoginView changeUser={this.changeUser} />\n );\n case 'create-post':\n return(\n <CreatePost changeView={this.changeView} getNearbyPosts={this.getNearbyPosts} currUser={user}/>\n );\n case 'post-view':\n return(\n <PostView post={selectedPost.postInfo} user={selectedPost.userInfo} changeView={this.changeView} />\n );\n case 'user-profile':\n // Not being used currently -> was gonna put active posts for users\n return(\n <UserProfileView user={user} />\n );\n default :\n return (\n <PostCard posts={posts} changePostView={this.changePostView} searchByTag={this.searchByTag} />\n );\n }\n }", "title": "" }, { "docid": "3df5092d10816a85c9f904d069bc085c", "score": "0.5636758", "text": "function displayServicesPage() {\n\n }", "title": "" }, { "docid": "0e608a075deb539eb7c318844da8443b", "score": "0.56321806", "text": "function App(){\n return(\n <div>\n <Header/>\n <Forms/>\n <Footer/>\n </div>\n )\n}", "title": "" }, { "docid": "f6b02aa0b1f456dc75230bb7c327eb17", "score": "0.5623431", "text": "product() {\n return (<p>This is a product page.</p>)\n }", "title": "" }, { "docid": "dbde744d9e9e939606fdcd3e16878bd9", "score": "0.56140494", "text": "function switchPage(index) {\n switch (index) {\n case 0:\n return <News news={news} index={indexNews}/>;\n case 1:\n return <Weather forecast={forecast}/>;\n case 2:\n return <Messages />;\n case 3:\n return <Reminders reminders={reminders}/>;\n case 4:\n return <Photos />;\n default:\n return null;\n }\n\n }", "title": "" }, { "docid": "fc157c8e0409e9dc49a0e17c35e0a9bb", "score": "0.5613238", "text": "function Template(Component) {\n return (\n <>\n <h1>Poker Champ App</h1>\n <NavigationMenu/>\n <Component/>\n </>\n );\n}", "title": "" }, { "docid": "c4d7d7fdc6d2f6fb959a71085852bb6f", "score": "0.5609901", "text": "function App() {\n return (\n <div className=\"App\">\n {/* <SearchPage/> */}\n <Homepage />\n {/* <Demo/> */}\n <PostList />\n\n <Table />\n\n {/* <GetDemo/> */}\n </div>\n );\n}", "title": "" }, { "docid": "d8adf84a274806e8e1ad1b2571f2cf9d", "score": "0.560981", "text": "render() {\n if (this.state.page === 0) {\n return (\n <Login \n newRegistration = {this.newRegistration}\n page={this.state.page}\n userVerify = {this.userVerify}\n usernameChange = {this.usernameChange}\n passwordChange = {this.passwordChange}\n message = {this.state.message}\n />\n )\n };\n\n if (this.state.page === 1) {\n return ( \n <Signup \n newRegistration = {this.newRegistration}\n usernameChange = {this.usernameChange}\n nameChange = {this.nameChange}\n passwordChange = {this.passwordChange}\n username = {this.state.username}\n password = {this.state.password}\n name = {this.state.name}\n signUpPost = {this.signUpPost}\n message = {this.state.message}\n />\n )\n } \n\n if (this.state.page === 2) {\n return ( \n <Dashboard changeView = {this.changeView}/>\n )\n }\n\n if (this.state.page === 3) {\n return (\n <AddProj\n projChange = {this.projChange}\n createProject = {this.createProject}\n changeView = {this.changeView}\n />\n )\n }\n }", "title": "" }, { "docid": "26881e9d4a23438d7b9c665e2d5062d0", "score": "0.5607391", "text": "render(){\n return <MainLayout pageTitle={this.pageTitle} content={this.content}/>;\n }", "title": "" }, { "docid": "fc0a2ab2ab1098aafd142c5747c184c3", "score": "0.5604419", "text": "actionIndex() {\n const data = {\n 'Menu': {\n menuItems: [\n { link:'/lobby', text:'PLAY' },\n { link:'/scores/show', text:'SCORES' },\n { link:'/rules', text:'RULES' },\n { link:'/about', text:'DEVELOPERS' }\n ]\n },\n 'Header': this.getHeaderData()\n };\n this.MenuView.constructPage(data);\n }", "title": "" }, { "docid": "1d08e7fa3ee17eb54300565b46f3b602", "score": "0.55896944", "text": "function Page(){\n this.pathURL = \"/\";\n this.screenElement = null;\n }", "title": "" }, { "docid": "9c9c673e75fdaa42cb3a004a9fb3f07b", "score": "0.558751", "text": "function EmergencyPage() {\n return <div className=\"emergency-page\">\n <CommentDetail />\n <Navbar />\n <Services title=\"\" content=\"\" srcPath={ emergencyElectrician }><h1>Emergency Electrical Services</h1></Services>\n <Heading first=\"Emergency\" second=\"Services\"/>\n <Text> <br />\n <p>At Sparky Ltd we provide a 24 hour emergency electrician service in Peterborough.</p>\n <br />\n<p>\nWe specialise in all aspects of emergency electrical work such as emergency lighting installation, emergency electrical repair work and maintenance for domestic and commercial customers.\n</p>\n<br />\n<p>\nWe offer a fast and rapid response time and operate 365 days a year. Estimates are totally free of charge with no obligation</p>\n<br /></Text>\n\n {/* <Atom /> */}\n \n <FooterContainer />\n\n </div>;\n}", "title": "" }, { "docid": "1ef78e774914885c677f77332962a988", "score": "0.55826056", "text": "static pagesWrapper() {\n this.quizPagesWrapperElement = Base.createElement(\n 'div',\n this.quizElement,\n ['quiz__pages']\n );\n }", "title": "" }, { "docid": "5cf9a686e392b19428f0af2d9beb3454", "score": "0.55779266", "text": "constructor(...appConnectedComponents) {\n let onlyMainPageContains = appConnectedComponents.filter(\n (c) => { return c.urlRule === '/' }\n );\n\n if (onlyMainPageContains.length === 0) {\n throw new Error('Main page component was not found')\n }\n\n if (onlyMainPageContains.length > 1) {\n throw new Error('Main page component can be only one')\n }\n\n this.mainComponent = onlyMainPageContains[0];\n this.appConnectedComponents = appConnectedComponents.filter(\n (c) => { return c.urlRule !== '/' }\n );\n\n this.notFoundPage = null;\n this.internalErrorPage = null;\n }", "title": "" }, { "docid": "0fc913f7f0d87529e1082d2dcd3f61ef", "score": "0.5574639", "text": "function setupComponents(Vue){\n\n //Obs aqui o registro é global, se o uso é pontual melhor registrar só na página que usa\n\n //Do nosso framework\n Vue.component('breadcrumbs', Breadcrumbs);\n Vue.component('q-header', Header);\n Vue.component('q-sidebar', Sidebar);\n \n //Modelos\n Vue.component('widget', Widget);\n /*Vue.component('social-widget', SocialWidget);\n Vue.component('data-table', DataTable);\n Vue.component('time-line', TimeLine);\n Vue.component('user-tree-view', UserTreeView);\n Vue.component('stepper', Stepper);\n\n Vue.component('location-statistic', LocationStatistic);\n Vue.component('site-view-statistic', SiteViewStatistic);\n Vue.component('total-earnings-statistic', TotalEarningsStatistic);\n*/\n \n\n //Outros - Não usado ainda\n //Vue.component('full-calendar', fullCalendar);\n //Vue.component('swatches', swatches);\n\n \n\n}", "title": "" }, { "docid": "6543e1bb5a359e246c63ff2aef52bb7f", "score": "0.5570408", "text": "function Landing() {\n return(\n <div>\n <h1>This is landing page.</h1>\n </div>\n );\n}", "title": "" }, { "docid": "6882bb5ab20131f61746c85be2035b7d", "score": "0.55624616", "text": "renderContent(page) {\n\t\tswitch(page){\n\t\t\tcase \"home\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={homeImage} title={defaultTitle} />,\n\t\t\t\t\tcontent: <HomePage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"aboutSplunk\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <div />,\n\t\t\t\t\tcontent: <AboutSplunkPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"dataOnboarding\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={dataOnboardingImage} title={formTitle} />,\n\t\t\t\t\tcontent: <DataOnboardingPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"serviceMapping\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <GradientBanner\n\t\t\t\t\t\t\tcolors={[\"#FFCC00\", \"#FF6200\"]}\n\t\t\t\t\t\t\ttitle={<SearchBar />}\n\t\t\t\t\t\t/>,\n\t\t\t\t\tcontent: <ServiceMappingPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"news\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={newsImage} title={newsTitle} />,\n\t\t\t\t\tcontent: <NewsPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"projects\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={projectsImage} title={projectsTitle} />,\n\t\t\t\t\tcontent: <ProjectsPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"team\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={teamImage} title={teamTitle} />,\n\t\t\t\t\tcontent: <TeamPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"contact\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={contactImage} title={contactTitle} />,\n\t\t\t\t\tcontent: <ContactPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"appProgress\":\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <div />,\n\t\t\t\t\tcontent: <AppProgressPage store={this.props.store} />\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.setState({\n\t\t\t\t\tbanner: <LargeBanner image={homeImage} title={defaultTitle} />,\n\t\t\t\t\tcontent: <HomePage store={this.props.store} />\n\t\t\t\t});\n\t\t}\n \t}", "title": "" }, { "docid": "d76f1609091a125cc2d89bb31134d39f", "score": "0.55565906", "text": "function App() {\n return (\n <div className=\"App\">\n <NavigationBar></NavigationBar>\n <Isa></Isa>\n <About></About>\n <Skills></Skills>\n <Work></Work>\n </div>\n );\n}", "title": "" }, { "docid": "ffa202da6187aa4e9f809fc4f03f1d66", "score": "0.5555416", "text": "function Homepage({ movies, series, loadingMovies, loadingShows }) {\n return (\n <div id=\"homepage\" className=\"container\">\n <h1>Home</h1>\n <section>\n <h2>Now playing movies</h2>\n {loadingMovies && <LoadingGrid />}\n {!loadingMovies && <PosterGrid movies={movies} type=\"movie\" />}\n </section>\n <section>\n <h2>Now airing TV shows</h2>\n {loadingShows && <LoadingGrid />}\n {!loadingShows && <PosterGrid movies={series} type=\"tv\" />}\n </section>\n </div>\n );\n}", "title": "" }, { "docid": "3ea151c5b0c8306a0e003bf39b117e16", "score": "0.55548805", "text": "static getClassName() {\n return 'PageContainer';\n }", "title": "" }, { "docid": "922b91e7b8fb2d0e3e394039dc034f08", "score": "0.5547511", "text": "function startApp(state) {\n root.innerHTML = `\n ${Navigation(state)}\n ${Header(state)}\n ${Content(state)}\n ${Footer(state)}\n `;\n router.updatePageLinks()\n \n }", "title": "" }, { "docid": "8b727b1df4e79e933fddf00228dc883b", "score": "0.55467147", "text": "function PageView(params) {\n var that = this;\n View.apply(this, arguments);\n this.params = params;\n\n // create the layout\n this.layout = new HeaderFooterLayout({\n headerSize: App.Defaults.Header.size,\n footerSize: App.Defaults.Footer.size\n });\n this.createHeader();\n this.createContent();\n\n // // temp surface\n // this.contentView = new View();\n // this.contentView.OriginMod = new StateModifier({\n // origin: [0, 0.5]\n // });\n // this.contentView.Surface = new Surface({\n // content: '<i class=\"icon ion-android-note\"></i><div>Coming Soon!</div>',\n // size: [undefined, 80],\n // classes: ['explore-surface-temp'],\n // properties: {\n // fontSize: '42px',\n // textAlign: 'center'\n // }\n // });\n // this.contentView.add(this.contentView.OriginMod).add(this.contentView.Surface);\n\n // this.layout.content.add(this.contentView);\n this.add(this.layout);\n\n\n // Listen for 'showing' events\n this._eventOutput.on('inOutTransition', function(args){\n // 0 = direction\n if(args[0] == 'showing'){\n that.YouView.collection.fetch();\n App.Data.ActionCollection.fetch();\n }\n });\n\n }", "title": "" }, { "docid": "1e88f69081b0fb6559143eb2965868a0", "score": "0.5545969", "text": "routing(page) {\n \n this.$.drawer.style.display = 'block';\n this.$.myheader.style.display = 'block';\n switch (page) {\n case 'loginpage':\n import('./login-page.js');\n this.$.drawer.style.display = 'none';\n this.$.myheader.style.display = 'none';\n break;\n case 'renewalspage':\n import('./renewals-page.js');\n break;\n case 'policy':\n import('./my-policy.js');\n break;\n case 'new-policy':\n import('./new-policy.js');\n break;\n case 'sucesspage':\n import('./sucess-page.js');\n break;\n case 'newform':\n import('./new-form.js');\n break;\n case 'payment':\n import('./payment-page.js');\n break;\n \n }\n }", "title": "" }, { "docid": "2836f8685478dbb32e08905187e6ae1c", "score": "0.5543467", "text": "render(){\nreturn(\n <h1> This is a Register Page </h1>\n);\n }", "title": "" }, { "docid": "87bdaf56920f758d44494d28174f0990", "score": "0.5533955", "text": "function renderApp(state, elements) {\n\tObject.keys(elements).forEach(function(route) {\n\t\telements[route].hide();\n\t});\n\telements[state.route].show();\n\n\tif(state.route === \"start\") {\n\t\trenderStartPage(state, elements[state.route]);\n\t}\n\telse if (state.route === \"question\") {\n\t\trenderQuestionsPage(state, elements[state.route]);\n\t}\n\telse if (state.route === \"answer_feedback\") {\n\t\trenderAnswerFeedbackPage(state, elements[state.route]);\n\t}\n\telse if (state.route === \"feedbackComplete\") {\n\t\trenderFinalFeedbackPage(state, elements[state.route]);\n\t}\n}", "title": "" }, { "docid": "7e414add997484db497eedeb89e6cae1", "score": "0.55292255", "text": "render() {\n return (\n <div>\n <HomePage />\n </div>\n );\n }", "title": "" }, { "docid": "edbaf7dd1f5e1925c3a95b5f1ddf51f2", "score": "0.55271554", "text": "function Home() {\n return (\n <div className='MasterHomeDiv'>\n <div>\n <Header />\n <LandingPage />\n <ProductPage />\n <Story />\n <Solution />\n <Developers />\n <ContinetPage />\n <Ready />\n <Footer />\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "4e55b684da3f6bdf40bf091cb6c1fca6", "score": "0.55242294", "text": "function App() {\n return (\n <div className=\"App\">\n <Welcome />\n <About />\n <Frameworks />\n <Experience />\n <Education />\n <Awards />\n <Contact/>\n </div>\n );\n}", "title": "" }, { "docid": "082de01ca6222ad50827b59853b80c86", "score": "0.55219674", "text": "function App(){\n return (\n <div>\n <Splash />\n <NewHome />\n <NavBar />\n <About />\n <Portfolio />\n {/* <Cv /> */}\n <Contact />\n </div>\n );\n}", "title": "" }, { "docid": "e4fcf37041a84b6d52872c21dedc91c7", "score": "0.552114", "text": "render() {\n //tells the render function what to return to the DOM (HTML Page)\n return ( \n <div id=\"content\" className={this.context.topContent}>\n <HamburgerToggle />\n <div id=\"menu\" className={this.context.topBar}>\n <TestBar />\n </div>\n <div id=\"page-content\">\n {/*PAGE CONTENT GOES HERE*/}\n <h2>Required Training Page Content Goes Here</h2>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "70220c719e346348fdc566b588416055", "score": "0.5518125", "text": "function HomePage(navCtrl) {\r\n this.navCtrl = navCtrl;\r\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_2__map_map__[\"a\" /* MapPage */];\r\n this.tab2Root = __WEBPACK_IMPORTED_MODULE_3__list_list__[\"a\" /* ListPage */];\r\n }", "title": "" }, { "docid": "d1e1b9a6b82100c1ad09e6ea44935eb5", "score": "0.5515281", "text": "function EpisodePage(props) {\n return (\n <div>\n Marvel Page\n </div>\n )\n}", "title": "" }, { "docid": "4684744cc2129c7bbe408b7008c7584f", "score": "0.55114263", "text": "function Home() {\n return (\n <Layout type=\"home\">\n <Hero />\n {/* <AboutMe /> */}\n {/* <Portfolio /> */}\n {/* <ContactSection /> */}\n </Layout>\n );\n}", "title": "" }, { "docid": "ddd15fe96c9feb911b7bf4dc4541048e", "score": "0.550933", "text": "function App() {\r\n return (\r\n <div>\r\n <Welcome name=\"Sara\" />\r\n <Welcome name=\"Cahal\" />\r\n <Welcome name=\"Edite\" />\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "51809559c706151dc195d6797befac2c", "score": "0.550543", "text": "function StaticPage() {\n\tArticle.call(this);\n}", "title": "" }, { "docid": "5cd1f339cfcd6893cb0d063a1b467aee", "score": "0.5505032", "text": "function FrontPage({ className }) {\n\tconst cards = [\n\t\t{\n\t\t\ttitle: 'Sports',\n\t\t\tdesc: 'Create a new workout plan to keep your body fit and in shape!',\n\t\t\ttarget: '/area',\n\t\t\timg: Sport\n\t\t},\n\t\t{\n\t\t\ttitle: 'Groups',\n\t\t\tdesc: 'Everything is more fun together. Workout together with your friends and share your progress!',\n\t\t\ttarget: '/groups',\n\t\t\timg: Group\n\t\t},\n\t\t{\n\t\t\ttitle: 'Shopping',\n\t\t\tdesc: 'Shop new equipment to discover new training methods!',\n\t\t\ttarget: '/shop',\n\t\t\timg: Shopping\n\t\t}\n\t];\n\n\treturn (\n\t\t<div className={`${className}`}>\n\t\t\t<Greeting className='mt-2' />\n\t\t\t<CurrentPlans className='my-5' />\n\t\t\t<div className='d-flex flex-wrap justify-content-around align-items-center' >\n\t\t\t\t{cards.map(({ target, img, title, desc }, i) => { return (\n\t\t\t\t\t<Card className='shadow-lg m-3' key={i} onClick={() => window.location.href = target} img={img}>\n\t\t\t\t\t\t<h5 className='card-title'>{title}</h5>\n\t\t\t\t\t\t<p className='card-text'>{desc}</p>\n\t\t\t\t\t</Card>\n\t\t\t\t)})}\n\t\t\t</div>\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "c779ff37cfbe38935e41ae03fd659b73", "score": "0.5496114", "text": "function MyApp({ Component, pageProps }) {\n \n switch (Component.name) {\n case \"Home\":\n return (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <MainPage /> \n </ThemeProvider>\n </Provider>\n )\n default: \n return (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <Layout>\n <Component {...pageProps} />\n </Layout>\n </ThemeProvider>\n </Provider>\n \n );\n }\n}", "title": "" }, { "docid": "5bcea5d4a818601c48e1c46e5eab53f2", "score": "0.5494654", "text": "loadView() {\n switch(this.state.page) {\n \n // Home view\n case 'home':\n return <Title onclick={this.handleClick}/>;\n \n // Projects view\n case 'projects':\n return <Projects onclick={this.handleClick}/>;\n\n // Nested pages\n case 'project-1':\n return <StackRecette />;\n case 'project-2':\n return <MaterialPokedex/>;\n case 'project-3':\n return <ProjectPrototype/>;\n case 'project-4':\n return <Transposer/>;\n\n // Education view\n case 'education':\n return <Education/>;\n\n // Skills view\n case 'skills':\n return <Skills onclick={this.handleClick}/>;\n\n // Resume view\n case 'resume':\n return <Resume/>;\n\n // If no view is found\n default:\n console.warn(\"view not found!\");\n return null;\n }\n }", "title": "" }, { "docid": "926e5bb6533757284084da3145b83c97", "score": "0.548883", "text": "mobileView() {\n return (\n <div>\n <div className=\"homepage-mobile-buttons\">\n <Button className=\"homepage-mobile-button\" onClick={() => this.gotoLoginPage()}>\n Log In\n </Button>\n\n <Button className=\"homepage-mobile-button\" onClick={() => this.gotoSignUpPage()}>\n Sign Up\n </Button>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "5df7d1896158e559dcf93051e1ad951d", "score": "0.5481911", "text": "function Next(){\r\n mainapp.Render();\r\n}", "title": "" }, { "docid": "fe85f543a0d30d5ec93f1a7750a88c9e", "score": "0.5480556", "text": "function Home() {\n\n return (\n <div>\n <h1>This is going to be home Screen</h1>\n </div>\n );\n}", "title": "" }, { "docid": "3298dbc28f0ed7002a127cb956c32f57", "score": "0.5474261", "text": "function MyApp({ Component, pageProps }) {\n return (\n <>\n <UserProvider>\n <NavBar />\n <div className=\"py-6 px-6\">\n <Component {...pageProps} />\n </div>\n </UserProvider>\n </>\n );\n}", "title": "" }, { "docid": "360b4b9562b76af2aae4b3fde1ae3496", "score": "0.5474187", "text": "render() {\n return (\n <div>\n <Header />\n <PageContainer />\n <Footer />\n </div>\n );\n }", "title": "" }, { "docid": "24650c2e84ac6cbc590b94838233354c", "score": "0.5468277", "text": "function App() {\n\n \n return (\n <div>\n {/* <Props name = \"john\" company = \"EverestDX\"/>\n <Props name = \"kane\" company = \"EverestDX\"/>\n <Props name = \"williamson\" company = \"EverestDX\"/>\n\n\n <ClassProps n = \"classcomponent\"/>\n <ClassProps n = \"another one\"/> \n <CC2/>\n \n <UseE/>\n <Increment/> \n <CC3/> \n <CLC/> */}\n <Router>\n <Switch>\n <Route exact path = \"/\" component = {NN}/>\n <Route exact path = \"/login\" component = {Login}/>\n <Route exact path = \"/profile\" component = {Profile}/>\n <Route exact path = \"/nn\" component = {NN}/>\n <Route exact path = \"/dashboard\" component = {Dashboard}/>\n <Route exact path = \"/itsm\" component = {Itsm}/>\n <Route exact path = \"/optix\" component = {Optix}/>\n <Route exact path = \"/hybridit\" component = {Hybridit}/>\n <Route exact path = \"/security\" component = {Security}/>\n <Route exact path = \"/visibility\" component = {Visibility}/>\n <Route exact path = \"/collaboration\" component = {Collaboration}/>\n <Route exact path = \"/project\" component = {Project}/>\n <Route exact path = \"/alarm\" component = {Alarm}/>\n <Route exact path = \"/settings\" component = {Settings}/>\n </Switch>\n </Router>\n {/* <Login/> */}\n {/* <Content/> */}\n </div>\n );\n}", "title": "" }, { "docid": "5bcbca68d243351eab7aed2653bea61a", "score": "0.5466521", "text": "function PageObject() {\n}", "title": "" }, { "docid": "7fd1d225129a989a779ec33becac5f62", "score": "0.5466264", "text": "function display_add_tag_page({ req, res, type, page }) {\n const args = set_render_args({ req, type, page });\n redirect_page({ res, type, args });\n}", "title": "" }, { "docid": "372b8a9d4d4b665ea95a6733989e3f9b", "score": "0.5465116", "text": "render() {\n if (this.state.onMainPage) {\n return (\n <MainPage handleTogglePage={this.handleTogglePage} />\n );\n }\n else {\n return (<AlternativePage handleTogglePage={this.handleTogglePage} />);\n }\n }", "title": "" }, { "docid": "bd5b71c84a6f8d576c0bb77963f1ac31", "score": "0.5462895", "text": "function App() {\n return (\n <div className=\"App\">\n <Header />\n <PageSwitcher className=\"pageSwitcherComponent\" />\n </div>\n );\n}", "title": "" }, { "docid": "1604c1dd9525543d89d6f489366a43fc", "score": "0.54568774", "text": "render() {\n\t\treturn <h1>Hello World Component From Seperate file</h1>;\n\t}", "title": "" }, { "docid": "853c7ea13b64b2bc2208e72ae86dd107", "score": "0.5456643", "text": "function StartPage() { \n return (\n <Start/>\n )\n}", "title": "" } ]
c783530a42e00d5eda3c018014fed42c
Get its client rect and package into given `DOMRect` .
[ { "docid": "8155dbc06fc314f7df239540aa4259b4", "score": "0.64058554", "text": "_getClientRect(target) {\n\t if (!this._domElement)\n\t return;\n\t const rect = this._domElement.getBoundingClientRect();\n\t target.x = rect.left;\n\t target.y = rect.top;\n\t if (this._viewport) {\n\t target.x += this._viewport.x;\n\t target.y += rect.height - this._viewport.w - this._viewport.y;\n\t target.width = this._viewport.z;\n\t target.height = this._viewport.w;\n\t }\n\t else {\n\t target.width = rect.width;\n\t target.height = rect.height;\n\t }\n\t return target;\n\t }", "title": "" } ]
[ { "docid": "f9301ed5345ebc9582d9ba10aa347df7", "score": "0.6488178", "text": "function getContentRect(el,origin){var offset=el.offset();// just outside of border, margin not included\nvar left=offset.left+getCssFloat(el,'border-left-width')+getCssFloat(el,'padding-left')-(origin?origin.left:0);var top=offset.top+getCssFloat(el,'border-top-width')+getCssFloat(el,'padding-top')-(origin?origin.top:0);return{left:left,right:left+el.width(),top:top,bottom:top+el.height()};}", "title": "" }, { "docid": "eadd4793feb8345724669724403fa46b", "score": "0.6467801", "text": "function getClientRect(el,origin){var offset=el.offset();var scrollbarWidths=getScrollbarWidths(el);var left=offset.left+getCssFloat(el,'border-left-width')+scrollbarWidths.left-(origin?origin.left:0);var top=offset.top+getCssFloat(el,'border-top-width')+scrollbarWidths.top-(origin?origin.top:0);return{left:left,right:left+el[0].clientWidth,top:top,bottom:top+el[0].clientHeight// clientHeight includes padding but NOT scrollbars\n};}", "title": "" }, { "docid": "cce4330c96a5ea9576cfaf79acbc6d2f", "score": "0.6445759", "text": "getRectForOid(oid) {\n const element = this.getElementForOid(oid);\n return elements.clientRect(element);\n }", "title": "" }, { "docid": "b0a18aae2b37b7ea2b18d38466ac9e0c", "score": "0.6424317", "text": "function pageRelativeRectOfClientRect(rect) {\n return {\n left: rect.left % window.innerWidth,\n right: rect.right % window.innerWidth,\n top: rect.top,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height\n };\n }", "title": "" }, { "docid": "e75fb639074dd5f24235490719e242cc", "score": "0.6407963", "text": "function getRoundedBoundingClientRect(clientRect) {\n return {\n top: Math.floor(clientRect.top),\n right: Math.floor(clientRect.right),\n bottom: Math.floor(clientRect.bottom),\n left: Math.floor(clientRect.left),\n width: Math.floor(clientRect.width),\n height: Math.floor(clientRect.height)\n };\n}", "title": "" }, { "docid": "0b3755af149b67d52bac31897fba40f8", "score": "0.6379792", "text": "function getRect(element) {\n var graphicInfo = getChildByName(element, 'NodeGraphicsInfos');\n graphicInfo = getChildByName(graphicInfo, 'NodeGraphicsInfo'); // if it can be confusing, why not ?\n var width = parseFloat(graphicInfo.attributes.Width);\n var height = parseFloat(graphicInfo.attributes.Height);\n var coords = getChildByName(graphicInfo, \"Coordinates\");\n var x = parseFloat(coords.attributes.XCoordinate);\n var y = parseFloat(coords.attributes.YCoordinate);\n return [x, x + width, y, y + height];\n }", "title": "" }, { "docid": "684dd1f15d7c910628b3b69903e77b80", "score": "0.6372451", "text": "function getContentRect(el) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "684dd1f15d7c910628b3b69903e77b80", "score": "0.6372451", "text": "function getContentRect(el) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "684dd1f15d7c910628b3b69903e77b80", "score": "0.6372451", "text": "function getContentRect(el) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "1f28bd95980a6e8288357c0b5ecbb077", "score": "0.63000256", "text": "function getOuterRect(el,origin){var offset=el.offset();var left=offset.left-(origin?origin.left:0);var top=offset.top-(origin?origin.top:0);return{left:left,right:left+el.outerWidth(),top:top,bottom:top+el.outerHeight()};}", "title": "" }, { "docid": "a19dd7fc416f397429c14c064f98abb4", "score": "0.6293779", "text": "function getRect(e){\n return e.getBoundingClientRect();\n}", "title": "" }, { "docid": "a19dd7fc416f397429c14c064f98abb4", "score": "0.6293779", "text": "function getRect(e){\n return e.getBoundingClientRect();\n}", "title": "" }, { "docid": "95c0e6051f07742c5d940c0ab24ca1b7", "score": "0.6286671", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n} // ==============================", "title": "" }, { "docid": "90f898eba0c2cde9397e435cb560e003", "score": "0.62854147", "text": "function rect(node) {\n \t\tfunction update() {\n \t\t\t$$invalidate(8, from = node.firstChild.getBoundingClientRect());\n \t\t}\n\n \t\tupdate();\n \t\treturn { update };\n \t}", "title": "" }, { "docid": "7c0f05076fb80b6f43273cf4ae3bb81e", "score": "0.6263346", "text": "function getRect(e){\n\n\tvar i;\n\tvar j = {\n\t\twidth:parseInt(jQuery(e.id).css('width'),10),\n\t\theight:parseInt(jQuery(e.id).css('height'),10),\n\t\tleft:jQuery(e.id).css('left'),\n\t\ttop:jQuery(e.id).css('top')\n\t};\n\n\tfor(i in j){\n\t\tif(j[i] === 'auto'){\n\t\t\tj[i] = 0;\n\t\t}\n\t}\n\n\treturn j;\n}", "title": "" }, { "docid": "69d0a2f617a96ce14accd1ffd06b0e9b", "score": "0.62358284", "text": "function selectedRect(state) {\n var sel = state.selection, $pos = selectionCell(state);\n var table = $pos.node(-1), tableStart = $pos.start(-1), map = TableMap.get(table);\n var rect;\n if (sel instanceof CellSelection)\n { rect = map.rectBetween(sel.$anchorCell.pos - tableStart, sel.$headCell.pos - tableStart); }\n else\n { rect = map.findCell($pos.pos - tableStart); }\n rect.tableStart = tableStart;\n rect.map = map;\n rect.table = table;\n return rect\n }", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "4b9722e84c0bca8cad08a42e138653ed", "score": "0.61768305", "text": "function getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n}", "title": "" }, { "docid": "7f6db9f1c1ec7d96b23e9fc301000e32", "score": "0.6174686", "text": "function currentBounds(){var cntr=element?element.parent():null;var parent=cntr?cntr.parent():null;return parent?self.clientRect(parent):null;}", "title": "" }, { "docid": "fd0d427fe4d22a374c03854a26d80e19", "score": "0.6174307", "text": "function getBoundingClientObj(element) {\n\t var rect = element.getBoundingClientRect();\n\t return {\n\t bottom: rect.bottom,\n\t height: rect.height,\n\t left: rect.left,\n\t right: rect.right,\n\t top: rect.top,\n\t width: rect.width\n\t };\n\t}", "title": "" }, { "docid": "b219ae5bb2071b575bc61a6d45cf070c", "score": "0.6172172", "text": "function selectedRect(state) {\n var sel = state.selection, $pos = selectionCell(state);\n var table = $pos.node(-1), tableStart = $pos.start(-1), map = TableMap.get(table);\n var rect;\n if (sel instanceof CellSelection)\n { rect = map.rectBetween(sel.$anchorCell.pos - tableStart, sel.$headCell.pos - tableStart); }\n else\n { rect = map.findCell($pos.pos - tableStart); }\n rect.tableStart = tableStart;\n rect.map = map;\n rect.table = table;\n return rect\n}", "title": "" }, { "docid": "2e6d5d99515d196f827849869e6c68c1", "score": "0.6162286", "text": "function intoCoordSystem(cm,lineObj,rect,context){if(lineObj.widgets){for(var i=0;i<lineObj.widgets.length;++i){if(lineObj.widgets[i].above){var size=widgetHeight(lineObj.widgets[i]);rect.top+=size;rect.bottom+=size;}}}if(context==\"line\"){return rect;}if(!context){context=\"local\";}var yOff=_heightAtLine(lineObj);if(context==\"local\"){yOff+=paddingTop(cm.display);}else{yOff-=cm.display.viewOffset;}if(context==\"page\"||context==\"window\"){var lOff=cm.display.lineSpace.getBoundingClientRect();yOff+=lOff.top+(context==\"window\"?0:pageScrollY());var xOff=lOff.left+(context==\"window\"?0:pageScrollX());rect.left+=xOff;rect.right+=xOff;}rect.top+=yOff;rect.bottom+=yOff;return rect;}// Coverts a box from \"div\" coords to another coordinate system.", "title": "" }, { "docid": "8c065c3e06d7627b492d5e8030e7bffa", "score": "0.61578685", "text": "function buildRect(item) {\n\t\t\t\t\tvar rect = item.position();\n\t\t\t\t\trect.width = item.width();\n\t\t\t\t\trect.height = item.height();\n\n\t\t\t\t\treturn rect;\n\t\t\t\t}", "title": "" }, { "docid": "2b6fafc983ef5f67f160004d86a3829f", "score": "0.6137415", "text": "function rect(target) {\n return target.getBoundingClientRect();\n}", "title": "" }, { "docid": "4ef9228af313cf785b3d3fab4e430f1f", "score": "0.61352724", "text": "function rectOrWindowRect(rect)\n{\n return rect || {\n left : 0, right : window.innerWidth, top : 0, bottom : window.innerHeight\n };\n}", "title": "" }, { "docid": "8f24ebd47d5bd4ca5bdb515814a36efe", "score": "0.61143166", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\r\n if (isFixed === void 0) {\r\n isFixed = false;\r\n }\r\n\r\n var documentElement;\r\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement);\r\n var scroll = {\r\n scrollLeft: 0,\r\n scrollTop: 0\r\n };\r\n var offsets = {\r\n x: 0,\r\n y: 0\r\n };\r\n\r\n if (!isFixed) {\r\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body') {\r\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\r\n }\r\n\r\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\r\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent);\r\n offsets.x += offsetParent.clientLeft;\r\n offsets.y += offsetParent.clientTop;\r\n } else if (documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent)) {\r\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\r\n }\r\n }\r\n\r\n return {\r\n x: rect.left + scroll.scrollLeft - offsets.x,\r\n y: rect.top + scroll.scrollTop - offsets.y,\r\n width: rect.width,\r\n height: rect.height\r\n };\r\n}", "title": "" }, { "docid": "eb76786fdfc0a22888049a6f8882ab9a", "score": "0.6113291", "text": "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "title": "" }, { "docid": "5cc76659352bd2b53583f3223b3522bc", "score": "0.60950696", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement;\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (!isFixed) {\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body') {\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\n }\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent)) {\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5cc76659352bd2b53583f3223b3522bc", "score": "0.60950696", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement;\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (!isFixed) {\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body') {\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\n }\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent)) {\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5cc76659352bd2b53583f3223b3522bc", "score": "0.60950696", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement;\n var rect = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elementOrVirtualElement);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (!isFixed) {\n if (Object(_getNodeName_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(offsetParent) !== 'body') {\n scroll = Object(_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(offsetParent);\n }\n\n if (Object(_instanceOf_js__WEBPACK_IMPORTED_MODULE_3__[\"isHTMLElement\"])(offsetParent)) {\n offsets = Object(_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(offsetParent)) {\n offsets.x = Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "ab6810ea4279e436eca471e33891e4f7", "score": "0.60837847", "text": "function elmtRect(node, elmt) {\n var rect = elmt.getBoundingClientRect();\n var containerRect = $(elmt).parents(\"foreignObject\")[0].getBoundingClientRect();\n var left = node.cX + deltaX(containerRect, rect);\n var top = node.cY + deltaY(containerRect, rect);\n return {\n \"left\": left, \"right\": left + rect.width, \"width\": rect.width,\n \"top\": top, \"bottom\": top + rect.height, \"height\": rect.height,\n };\n}", "title": "" }, { "docid": "3a265eddd51a4344cec83fe5f4f34209", "score": "0.60486144", "text": "function getClientRect(el,origin){var offset=el.offset();var scrollbarWidths=_getScrollbarWidths(el);var left=offset.left + getCssFloat(el,'border-left-width') + scrollbarWidths.left - (origin?origin.left:0);var top=offset.top + getCssFloat(el,'border-top-width') + scrollbarWidths.top - (origin?origin.top:0);return {left:left,right:left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\ntop:top,bottom:top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n};} // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars.", "title": "" }, { "docid": "0aaf6e9b700182aad28113298d1500ed", "score": "0.604586", "text": "static rect(ctx, pts) {\n if (!this._checkSize(pts))\n return;\n let elem = SVGSpace.svgElement(ctx.group, \"rect\", SVGForm.getID(ctx));\n let bound = Pt_1.Group.fromArray(pts).boundingBox();\n let size = Op_1.Rectangle.size(bound);\n Dom_1.DOMSpace.setAttr(elem, {\n x: bound[0][0],\n y: bound[0][1],\n width: size[0],\n height: size[1],\n 'class': `pts-svgform pts-rect ${ctx.currentClass}`,\n });\n SVGForm.style(elem, ctx.style);\n return elem;\n }", "title": "" }, { "docid": "156f575eee739662e74cede1500430f0", "score": "0.60399175", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n }", "title": "" }, { "docid": "23d0db3aa0a374a0c8829fbfe3846d10", "score": "0.6037291", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = (0, _getDocumentElement.default)(element);\n var winScroll = (0, _getWindowScroll.default)(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = (0, _math.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = (0, _math.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0, _getWindowScrollBarX.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0, _getComputedStyle.default)(body || html).direction === 'rtl') {\n x += (0, _math.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "0e312b76ca29b9aaa7090014aa82ef5a", "score": "0.60255843", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle$1(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n }", "title": "" }, { "docid": "c3082dae7a9db3c09795662a7ab58456", "score": "0.60249376", "text": "function rect(e) {\n var w = window,\n o = e.getBoundingClientRect(),\n b = document.documentElement || document.body.parentNode || document.body,\n d = (void 0 !== w.pageXOffset) ? w.pageXOffset : b.scrollLeft,\n n = (void 0 !== w.pageYOffset) ? w.pageYOffset : b.scrollTop;\n return {\n x1: o.left + d,\n x2: o.left + o.width + d,\n y1: o.top + n,\n y2: o.top + o.height + n,\n height: o.height,\n width: o.width\n };\n }", "title": "" }, { "docid": "5f6b86a257550fa71a026c6f6230bc42", "score": "0.6022187", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "f16806cd49d754c9515d11424bc206f0", "score": "0.6020308", "text": "function clientRectUnion(a, b) {\n const left = Math.min(a.left, a.right, b.left, b.right);\n const right = Math.max(a.left, a.right, b.left, b.right);\n const top = Math.min(a.top, a.bottom, b.top, b.bottom);\n const bottom = Math.max(a.top, a.bottom, b.top, b.bottom);\n return {\n left: left,\n right: right,\n top: top,\n bottom: bottom,\n width: right - left,\n height: bottom - top\n };\n }", "title": "" }, { "docid": "15e28df917a4afe65a2bb4bfd3d5e5e3", "score": "0.60195756", "text": "get rect() {\r\n\t\treturn this.rect$.slice(0, 4);\r\n\t}", "title": "" }, { "docid": "fff1fa6059e03744805c74c183221493", "score": "0.6015029", "text": "function getContentRect(el, origin) {\n var offset = el.offset(); // just outside of border, margin not included\n var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el.width(),\n top: top,\n bottom: top + el.height()\n };\n}", "title": "" }, { "docid": "fff1fa6059e03744805c74c183221493", "score": "0.6015029", "text": "function getContentRect(el, origin) {\n var offset = el.offset(); // just outside of border, margin not included\n var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el.width(),\n top: top,\n bottom: top + el.height()\n };\n}", "title": "" }, { "docid": "cc1e66be88cc13a771ab45762575ef30", "score": "0.6005842", "text": "function getContentRect(el, origin) {\r\n\tvar offset = el.offset(); // just outside of border, margin not included\r\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\r\n\t\t(origin ? origin.left : 0);\r\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\r\n\t\t(origin ? origin.top : 0);\r\n\r\n\treturn {\r\n\t\tleft: left,\r\n\t\tright: left + el.width(),\r\n\t\ttop: top,\r\n\t\tbottom: top + el.height()\r\n\t};\r\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "17a3976a0ec91226c4b7cd1951c21b98", "score": "0.6001296", "text": "function getContentRect(el, origin) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\n\t\t(origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\n\t\t(origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "title": "" }, { "docid": "ccca863663310a4f2797a107b9d3ce82", "score": "0.5985489", "text": "function getClientRect(el) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "title": "" }, { "docid": "ccca863663310a4f2797a107b9d3ce82", "score": "0.5985489", "text": "function getClientRect(el) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "title": "" }, { "docid": "ccca863663310a4f2797a107b9d3ce82", "score": "0.5985489", "text": "function getClientRect(el) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "title": "" }, { "docid": "d1ca2825bdbed3d1a83c1077f750cf7b", "score": "0.5980484", "text": "function getContentRect(el, origin) {\r\n var offset = el.offset(); // just outside of border, margin not included\r\n var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') -\r\n (origin ? origin.left : 0);\r\n var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') -\r\n (origin ? origin.top : 0);\r\n return {\r\n left: left,\r\n right: left + el.width(),\r\n top: top,\r\n bottom: top + el.height()\r\n };\r\n}", "title": "" }, { "docid": "95149246ac829a87e21fa1710b16279a", "score": "0.5976101", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "95149246ac829a87e21fa1710b16279a", "score": "0.5976101", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "95149246ac829a87e21fa1710b16279a", "score": "0.5976101", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "97f6b4bec0cb10be83b16794247a3405", "score": "0.5975872", "text": "function getDocumentRect(element) {\n var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(element);\n var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__.default)(element);\n var body = element.ownerDocument.body;\n var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_2__.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_3__.default)(body || html).direction === 'rtl') {\n x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "36085874dba32b88a831d4ffdf0793c2", "score": "0.59705555", "text": "function getDocumentRect(element) {\n\t var _element$ownerDocumen;\n\t\n\t var html = getDocumentElement(element);\n\t var winScroll = getWindowScroll(element);\n\t var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n\t var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n\t var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n\t var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n\t var y = -winScroll.scrollTop;\n\t\n\t if (getComputedStyle(body || html).direction === 'rtl') {\n\t x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n\t }\n\t\n\t return {\n\t width: width,\n\t height: height,\n\t x: x,\n\t y: y\n\t };\n\t}", "title": "" }, { "docid": "92219748da3cbf74b00f0324a9a88398", "score": "0.5962793", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle$1(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "38353ff0f439e480ff013b9b750d4737", "score": "0.596111", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = Object(__WEBPACK_IMPORTED_MODULE_0__getDocumentElement_js__[\"a\" /* default */])(element);\n var winScroll = Object(__WEBPACK_IMPORTED_MODULE_3__getWindowScroll_js__[\"a\" /* default */])(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = Object(__WEBPACK_IMPORTED_MODULE_4__utils_math_js__[\"a\" /* max */])(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Object(__WEBPACK_IMPORTED_MODULE_4__utils_math_js__[\"a\" /* max */])(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + Object(__WEBPACK_IMPORTED_MODULE_2__getWindowScrollBarX_js__[\"a\" /* default */])(element);\n var y = -winScroll.scrollTop;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__getComputedStyle_js__[\"a\" /* default */])(body || html).direction === 'rtl') {\n x += Object(__WEBPACK_IMPORTED_MODULE_4__utils_math_js__[\"a\" /* max */])(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "3eb09752494d172d817fc266b36aa163", "score": "0.5955061", "text": "getRect(){\r\n return([this.minX, this.minY, this.maxX-this.minX, this.maxY-this.minY]);\r\n}", "title": "" }, { "docid": "a488ab17ba342556a34bad23233f8fa3", "score": "0.5954613", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "a488ab17ba342556a34bad23233f8fa3", "score": "0.5954613", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "a488ab17ba342556a34bad23233f8fa3", "score": "0.5954613", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "a488ab17ba342556a34bad23233f8fa3", "score": "0.5954613", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "a488ab17ba342556a34bad23233f8fa3", "score": "0.5954613", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ElementRef\"]) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "4860fc5a567cd49972869c91098e81b3", "score": "0.59371763", "text": "_getOriginRect() {\n const origin = this._origin;\n if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_3__.ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width\n };\n }", "title": "" }, { "docid": "d5a3e1326e051497acacdf4f73fee5f9", "score": "0.59344435", "text": "get bounds() {\n let win = this.document.defaultView;\n let utils = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);\n return utils.getBoundsWithoutFlushing(this._containerNode);\n }", "title": "" }, { "docid": "b26786eed2be9b2269217559d4bdaeb7", "score": "0.59296536", "text": "function getContentRect(el,origin){var offset=el.offset(); // just outside of border, margin not included\nvar left=offset.left + getCssFloat(el,'border-left-width') + getCssFloat(el,'padding-left') - (origin?origin.left:0);var top=offset.top + getCssFloat(el,'border-top-width') + getCssFloat(el,'padding-top') - (origin?origin.top:0);return {left:left,right:left + el.width(),top:top,bottom:top + el.height()};} // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element.", "title": "" }, { "docid": "fb793b8606d5fae6291080b01bc10629", "score": "0.59255546", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var winScroll = Object(_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element);\n var y = -winScroll.scrollTop;\n\n if (Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(body || html).direction === 'rtl') {\n x += Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "fb793b8606d5fae6291080b01bc10629", "score": "0.59255546", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var winScroll = Object(_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element);\n var y = -winScroll.scrollTop;\n\n if (Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(body || html).direction === 'rtl') {\n x += Object(_utils_math_js__WEBPACK_IMPORTED_MODULE_4__[\"max\"])(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "593409385ed376b08a99ffd3974b7739", "score": "0.59242535", "text": "function clipRectByRect(targetRect, rect) {\r\n var x = graphic_mathMax(targetRect.x, rect.x)\r\n var x2 = graphic_mathMin(targetRect.x + targetRect.width, rect.x + rect.width)\r\n var y = graphic_mathMax(targetRect.y, rect.y)\r\n var y2 = graphic_mathMin(targetRect.y + targetRect.height, rect.y + rect.height) // If the total rect is cliped, nothing, including the border,\r\n // should be painted. So return undefined.\r\n\r\n if (x2 >= x && y2 >= y) {\r\n return {\r\n x: x,\r\n y: y,\r\n width: x2 - x,\r\n height: y2 - y\r\n }\r\n }\r\n }", "title": "" }, { "docid": "7ecdde4ed31bd5e05beae3c6c16d35d9", "score": "0.5923138", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(element);\n var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__.default)(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__.default)(body || html).direction === 'rtl') {\n x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "7ecdde4ed31bd5e05beae3c6c16d35d9", "score": "0.5923138", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(element);\n var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__.default)(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__.default)(body || html).direction === 'rtl') {\n x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "7ecdde4ed31bd5e05beae3c6c16d35d9", "score": "0.5923138", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(element);\n var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__.default)(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__.default)(body || html).direction === 'rtl') {\n x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "7ecdde4ed31bd5e05beae3c6c16d35d9", "score": "0.5923138", "text": "function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(element);\n var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__.default)(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__.default)(element);\n var y = -winScroll.scrollTop;\n\n if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__.default)(body || html).direction === 'rtl') {\n x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "15a5a12e1ecfec84a97f073002b8bdc3", "score": "0.5918609", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n }", "title": "" }, { "docid": "7c5a88271f9220cab1f6f7e14f3122d2", "score": "0.591754", "text": "function getDocumentRect(element) {\n var html = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var winScroll = Object(_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n var body = element.ownerDocument.body;\n var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element);\n var y = -winScroll.scrollTop;\n\n if (Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(body || html).direction === 'rtl') {\n x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "7c5a88271f9220cab1f6f7e14f3122d2", "score": "0.591754", "text": "function getDocumentRect(element) {\n var html = Object(_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element);\n var winScroll = Object(_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(element);\n var body = element.ownerDocument.body;\n var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + Object(_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element);\n var y = -winScroll.scrollTop;\n\n if (Object(_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(body || html).direction === 'rtl') {\n x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "title": "" }, { "docid": "8fbcf047dd0d680a543661a2135e210c", "score": "0.5915491", "text": "function myFunction() {\n\t\tvar testDiv = document.getElementById(\"test\").getClientRects()[0]\n\t\tx.set(testDiv.left)\n\t\ty.set(testDiv.top)\n\t\tsetOffset({ top: testDiv.top, left: testDiv.left })\n\t}", "title": "" }, { "docid": "b2920e2347674bda119d6a054de0b5c4", "score": "0.59138215", "text": "_getSelectionRect() {\n let appState = this.context.editorState;\n let sel = appState.selection;\n let selectionRect;\n if (platform.inBrowser && sel && !sel.isNull()) {\n let contentEl = this.getContentElement();\n let contentRect = contentEl.getNativeElement().getBoundingClientRect();\n if (sel.isNodeSelection()) {\n let nodeId = sel.nodeId;\n let nodeEl = contentEl.find(`*[data-id=\"${nodeId}\"]`);\n if (nodeEl) {\n let nodeRect = nodeEl.getNativeElement().getBoundingClientRect();\n selectionRect = getRelativeRect(contentRect, nodeRect);\n } else {\n console.error(`FIXME: could not find a node with data-id=${nodeId}`);\n }\n } else {\n selectionRect = getSelectionRect(contentRect);\n }\n }\n return selectionRect;\n }", "title": "" }, { "docid": "71963db3cd8f201b182bbac3faf00b67", "score": "0.59026307", "text": "function pageIndexOfClientRect(rect) {\n return Math.floor((rect.left + window.pageXOffset) / window.innerWidth);\n }", "title": "" }, { "docid": "35313e5170e56bd5fca111700b5cce79", "score": "0.5902383", "text": "function getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}", "title": "" }, { "docid": "5591614241aa4b075bfd7cd478642329", "score": "0.5900603", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(offsetParent);\n var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(elementOrVirtualElement);\n var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_3__.default)(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_4__.default)(documentElement)) {\n scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_5__.default)(offsetParent);\n }\n\n if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent)) {\n offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_6__.default)(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5591614241aa4b075bfd7cd478642329", "score": "0.5900603", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(offsetParent);\n var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(elementOrVirtualElement);\n var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_3__.default)(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_4__.default)(documentElement)) {\n scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_5__.default)(offsetParent);\n }\n\n if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent)) {\n offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_6__.default)(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5591614241aa4b075bfd7cd478642329", "score": "0.5900603", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(offsetParent);\n var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(elementOrVirtualElement);\n var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_3__.default)(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_4__.default)(documentElement)) {\n scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_5__.default)(offsetParent);\n }\n\n if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent)) {\n offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_6__.default)(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5591614241aa4b075bfd7cd478642329", "score": "0.5900603", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__.default)(offsetParent);\n var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(elementOrVirtualElement);\n var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_3__.default)(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_4__.default)(documentElement)) {\n scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_5__.default)(offsetParent);\n }\n\n if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_2__.isHTMLElement)(offsetParent)) {\n offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_1__.default)(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_6__.default)(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "5deb14be4521bc4bc95afd60fa569ee8", "score": "0.589902", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n\t if (isFixed === void 0) {\n\t isFixed = false;\n\t }\n\t\n\t var isOffsetParentAnElement = isHTMLElement(offsetParent);\n\t isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n\t var documentElement = getDocumentElement(offsetParent);\n\t var rect = getBoundingClientRect(elementOrVirtualElement);\n\t var scroll = {\n\t scrollLeft: 0,\n\t scrollTop: 0\n\t };\n\t var offsets = {\n\t x: 0,\n\t y: 0\n\t };\n\t\n\t if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n\t if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n\t isScrollParent(documentElement)) {\n\t scroll = getNodeScroll(offsetParent);\n\t }\n\t\n\t if (isHTMLElement(offsetParent)) {\n\t offsets = getBoundingClientRect(offsetParent);\n\t offsets.x += offsetParent.clientLeft;\n\t offsets.y += offsetParent.clientTop;\n\t } else if (documentElement) {\n\t offsets.x = getWindowScrollBarX(documentElement);\n\t }\n\t }\n\t\n\t return {\n\t x: rect.left + scroll.scrollLeft - offsets.x,\n\t y: rect.top + scroll.scrollTop - offsets.y,\n\t width: rect.width,\n\t height: rect.height\n\t };\n\t}", "title": "" }, { "docid": "780f52b7672e6fdfc3ffe1577f92094f", "score": "0.58980876", "text": "function getRectCenter(rect) {\r\n\treturn {\r\n\t\tleft: (rect.left + rect.right) / 2,\r\n\t\ttop: (rect.top + rect.bottom) / 2\r\n\t};\r\n}", "title": "" }, { "docid": "7d3bc80e38f79c7b277192a9eaa5cfac", "score": "0.58963656", "text": "function getRect(elt) {\n // TODO: Should I use getClientRects or getBoundingClientRect?\n var rc = getPos(elt);\n var ptSize = getSize(elt);\n rc.push(rc[ix] + ptSize[ix], rc[iy] + ptSize[iy]);\n return rc;\n }", "title": "" }, { "docid": "3e720820c9b9d3547718453b11aaab3d", "score": "0.589296", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "3e720820c9b9d3547718453b11aaab3d", "score": "0.589296", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "3e720820c9b9d3547718453b11aaab3d", "score": "0.589296", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" }, { "docid": "3e720820c9b9d3547718453b11aaab3d", "score": "0.589296", "text": "function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "title": "" } ]
25d5ecd48167b6f4774293812cb5343b
Bearbeite eine eingehende Anfrage
[ { "docid": "ee5d11670d8f8c488e141a406f0db916", "score": "0.0", "text": "async function handleRequest(_request, _response) {\n console.log(\"What's up?\");\n // Setze Header Daten der Antwort, also Informationen die dem zu Antwortenden mitteilen, was in der Antwort steht\n _response.setHeader(\"content-type\", \"text/html; charset=utf-8\");\n _response.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n if (_request.url) {\n // Hole Anweisungen aus Request\n let url = Url.parse(_request.url, true);\n // Bereite einen String vor, in dem später JSON-Daten gelagert werden sollen\n let jsonString;\n // Wenn die Anfrage an den Endpunkt /get gesendet wurde, sende alle Rakten aus der Datenbank als JSON zurück\n if (url.pathname == \"/get\") {\n // Hole alle Raketen aus Datenbank als JSON\n jsonString = JSON.stringify(await rockets.find().toArray());\n // Füge JSON mit allen Raketen der Antwort hinzu\n _response.write(jsonString);\n // Wenn die Anfrage an den Endpunkt /add gesendet wurde, wandle Anfrage in JSON um und füge Daten aus Anfrage in Datenbank ein\n }\n else if (url.pathname == \"/add\") {\n console.log(_request.url);\n // Wandle Anfrage in JSON um\n jsonString = JSON.stringify(url.query);\n // Füge Anfrage als JSON zu Antwort hinzu\n _response.write(jsonString);\n // Speichere die gesendete Rakete (die query der Anfrage) in die MongoDB Collection\n addRocketToDatabase(url.query);\n }\n }\n // Schließe Antwort ab\n _response.end();\n }", "title": "" } ]
[ { "docid": "043fef9d9c239225c76e01af53645374", "score": "0.573308", "text": "revert(){\n\n\t}", "title": "" }, { "docid": "df4b0eb5c2a1b2a129b3fc24bf1903f6", "score": "0.5615291", "text": "function onEdit() {\n setNav(0);\n }", "title": "" }, { "docid": "35ce40dcb1470ad84ff3e75f6b219b16", "score": "0.5581847", "text": "function editBurg() {\n var curBurg = $(this).data(\"burg\");\n $(this).children().hide();\n $(this).children(\"input.edit\").val(curBurg.burger);\n $(this).children(\"input.edit\").show();\n $(this).children(\"input.edit\").focus();\n }", "title": "" }, { "docid": "48475af2312e860f99599edaf52d0d7d", "score": "0.557231", "text": "function remodis(){\n this.remove();\n}", "title": "" }, { "docid": "3e40684e4313bb17c01708eed625a911", "score": "0.5500377", "text": "function enleverVieArmee () {\n\n\tif (armee>0) {}\n\tarmee=armee-ennemi;\n\n\tif (armee<1) {\n\t\n\tarmee=0;\n\t}\n\n\tAffichage();\n}", "title": "" }, { "docid": "5b96650eac42adcf68d9ace4af233de3", "score": "0.5493416", "text": "function IncBearbeitungAnzeige(Inc, IncTitle, IncFaelligkeit, IncBearbeitungsstand){\n IncTitle.textContent = \"#\" + Inc.incID + \" \" + Inc.title;\n IncFaelligkeit.textContent = \"<in Bearbeitung> fällig in \" + Inc.faelligkeit + \" Std.\";\n IncBearbeitungsstand.textContent = \"Bearbeitungsstand: 0%\";\n }", "title": "" }, { "docid": "ab0999321bc353fa7e0a50ef30b105c4", "score": "0.5475981", "text": "function ResEdit() {\n\tResEdit.history = [];\n\tResEdit.historySize = 0;\n\tResEdit.makeFromTextSometime();\n\tResEdit.makeSignMenu();\n}", "title": "" }, { "docid": "3d728b4022206664fd2f51915836865f", "score": "0.5460938", "text": "function restaDineroACuenta(valorAExtraer){\n\tsaldoCuenta -= valorAExtraer;\n}", "title": "" }, { "docid": "d7bd64389a99f5ff4b7994a4c15048f1", "score": "0.54574704", "text": "function Reed() { }", "title": "" }, { "docid": "38fd03c66875ae3111105c66131b9248", "score": "0.5429075", "text": "function Edit() {}", "title": "" }, { "docid": "4f1c398d68ecd67d5966319ed2df38d3", "score": "0.54030675", "text": "function setGuardaRedes(e) {\n redes = e;\n}", "title": "" }, { "docid": "393d4207898af72d3ab295d308c5aadc", "score": "0.53968984", "text": "undo() {}", "title": "" }, { "docid": "99a6f5dad92a9776677cd553a20e6465", "score": "0.5391745", "text": "function setTiendaModificado(e, flag) {\r\n var removedItems = e.dataItems;\r\n for (var i = 0; i < removedItems.length; i++) {\r\n var item = dataSource_cbxDisponibleAsignado.get(removedItems[i].CODIGO);\r\n item.ESTADO = flag;\r\n item.dirty = !item.dirty;\r\n }\r\n }", "title": "" }, { "docid": "296ff0e37f7acb269125e045ea271216", "score": "0.5376918", "text": "function aktualisiereLadebalken_Bilder(){\n//\talert(gBilder.geladen+\" von \"+gBilder.anzahl+\" geladen\");\n}", "title": "" }, { "docid": "c1715f674daea10361fe63f8cbfc2ed0", "score": "0.53684723", "text": "function resetTijdTotHerinnering(){\n tijdTotHerinnering = uitstelTijd;\n }", "title": "" }, { "docid": "c433162a4aead9caeb9a6626e221e15e", "score": "0.53675306", "text": "function undoEdit() {\n\t\tprops.value.editing = false;\n\t\tprops.changeValue(props.value.ID, props.value, undefined);\n\t}", "title": "" }, { "docid": "93d5aaf4c34c4fe9f36112ffacf1bbd2", "score": "0.5367511", "text": "function borrar(){\n\tmemoria = 0;\n}", "title": "" }, { "docid": "83ae148ae7a71ab8d073c4241444cb5c", "score": "0.53377044", "text": "ResetFieldOfView() {}", "title": "" }, { "docid": "65a74545f083b11b50ef7d3cf9932cf4", "score": "0.5305546", "text": "function gerer_changement() {\n console.log('Une valeur a changé pour cet élément :', this);\n}", "title": "" }, { "docid": "7db8bc900e4e7cc250356feb00e4fea7", "score": "0.5303714", "text": "function changedFamiliaValue(item) {\n $scope.EditedSubFamilia.IdFamilia = item.IdFamilia;\n }", "title": "" }, { "docid": "391847671df7e0d1ca6c5dc7a887dfee", "score": "0.5278697", "text": "function restablecer(){\n actualizar();\n $(\"#nombre\").val(\"\");\n $(\"#nota\").val(\"\");\n }", "title": "" }, { "docid": "9e4ac310eff23576070ac4613746bad5", "score": "0.5259219", "text": "function cambiar(invitado, edit, indice){\r\n\r\n if(invitado.getaceptar()){\r\n /*funcion que borra el invitado, en este momento el boton edit mostrara \"yes\" para confirmar el borrado del elemento*/\r\n borrar(invitado);\r\n\r\n }else{\r\n\r\n invitado.cambiarEditable();\r\n\r\n if(invitado.geteditable()){\r\n editar(edit,indice);\r\n }else{\r\n guardar(edit,invitado, indice);\r\n }\r\n\r\n }\r\n \r\n}", "title": "" }, { "docid": "20c8ab7eae18db88cfd9fbc260e901ea", "score": "0.52546304", "text": "function IncBearbeitungSetzen(f){\n if(f==0){\n IncFirstBearbeitung00 = 1;\n }else if (f==1){\n IncSecBearbeitung01 = 1;\n }else if(f==2){\n IncSecBearbeitung02 = 1;\n }else if(f==3){\n IncSecBearbeitung03 = 1;\n }\n }", "title": "" }, { "docid": "78e1b2f009389e9acd7cef5b59e4c77d", "score": "0.5242918", "text": "function finishEdit(event) {\n var updatedBurg = $(this).data(\"burg\");\n if (event.which === 13) {\n updatedBurg.burger = $(this).children(\"input\").val().trim();\n $(this).blur();\n updateBurg(updatedBurg);\n }\n }", "title": "" }, { "docid": "0df0174173adaab4a68f67e3445a4517", "score": "0.52155256", "text": "function refreshDataInModelSuaban() {\n}", "title": "" }, { "docid": "d67ad44c122d7fefeaf421ba6ebfb9fe", "score": "0.52018476", "text": "function editRowInTable(nguonSanPham) {\n let oldnguonSanPhamRow = getRowInTable(nguonSanPham);\n tableQuanLynguonSanPham.row(oldnguonSanPhamRow).data([\n nguonSanPham.maNguonSanPham, nguonSanPham.ten, nguonSanPham.soDienThoai, nguonSanPham.diaChi, nguonSanPham\n ]).draw();\n\n //Change in nguonSanPhams\n let nguonSanPhamReference = nguonSanPhams.find(\n (item) => item.maNguonSanPham == nguonSanPham.maNguonSanPham\n );\n \n nguonSanPhamReference.maNguonSanPham = nguonSanPham.maNguonSanPham;\n nguonSanPhamReference.ten = nguonSanPham.ten;\n nguonSanPhamReference.soDienThoai = nguonSanPham.soDienThoai;\n nguonSanPhamReference.diaChi = nguonSanPham.diaChi;\n \n}", "title": "" }, { "docid": "7a64cf264663ce93c6d6ffc2155061bf", "score": "0.5198109", "text": "undoTransaction() {\r\n this.moveUp(this.index+1);\r\n }", "title": "" }, { "docid": "69b8b6b1fcfa16c5c0c1593b4931d50f", "score": "0.51974046", "text": "edited(title,author,total,readed,rate){\n this.title = title\n this.author = author\n this.total = total\n this.readed = readed\n this.rate = rate\n }", "title": "" }, { "docid": "3240549ce4ada102b8dcdde0a9bb6823", "score": "0.51966655", "text": "backupValue() {\n this.originalValue = this.value;\n }", "title": "" }, { "docid": "7a39e1e6bb34d9e77d3f00b13a186106", "score": "0.5193839", "text": "function editRowInTable(sanPham) {\n let oldsanPhamRow = getRowInTable(sanPham);\n tableQuanLysanPham.row(oldsanPhamRow).data([\n sanPham.maSanPham, sanPham.ten, sanPham.linkAnh, sanPham.loai, sanPham.gia, sanPham\n ]).draw();\n\n //Change in sanPhams\n let sanPhamReference = sanPhams.find(\n (item) => item.maSanPham == sanPham.maSanPham\n );\n \n sanPhamReference.maSanPham = sanPham.maSanPham;\n sanPhamReference.ten = sanPham.ten;\n sanPhamReference.linkAnh = sanPham.linkAnh;\n sanPhamReference.loai = sanPham.loai;\n sanPhamReference.gia = sanPham.gia;\n \n}", "title": "" }, { "docid": "2a9b9a8f8963e5de5aa0c930779433d1", "score": "0.51907235", "text": "function editar() {\n let codigoCarrera = this.dataset.codigo;\n\n let carrera = buscarCarreraPorCodigo(codigoCarrera);\n\n setCarrera(carrera);\n location.href = \"../html/modificarCarrera.html\";\n\n\n}", "title": "" }, { "docid": "269d06a2826ecb5328514260f55cd786", "score": "0.51771045", "text": "function entra() {\r\n tituloreverse;\r\n}", "title": "" }, { "docid": "fd7965a87d20be0467f51c3b083ff4cd", "score": "0.5175282", "text": "backupOriginal() {\n this.backup = JSON.parse(JSON.stringify(this.modifier));\n }", "title": "" }, { "docid": "88c18e2dd94c62a15e8a7511dd153d79", "score": "0.5172751", "text": "function editMode(index) {\n model.temporaryBirthday = model.people[index].birthday;\n model.people[index].editMode = true;\n updateView();\n}", "title": "" }, { "docid": "81aae78f7c3b45d3f9e70c34dee7791e", "score": "0.5171651", "text": "undo() {\n this.history.undo(this.setContent.bind(this));\n }", "title": "" }, { "docid": "2531e8cdefdce70c997f663f51eafc26", "score": "0.51605606", "text": "function eAusbreitung(_t){\n if(_t.additionalText.search(textAusbreitung)==-1)return _t;\n for(let i=0; i<einsatzleitungen.length; i++){\n if(einsatzleitungen[i][0] == _t.mission_id){\n _t.caption=einsatzleitungen[i][3];\n _t.id=einsatzleitungen[i][2];\n }\n }\n return _t;\n }", "title": "" }, { "docid": "1c06ae5a4688f067c65d21866b4ed52e", "score": "0.5158767", "text": "undoTransaction() {\n this.num.setNum(this.intNum);\n }", "title": "" }, { "docid": "db5d255627864efd0260268e0edf6371", "score": "0.5153006", "text": "function a (e){ // e ma wartosc zmiennej d\n\te = 4;\n\t//zmienna d jest tworzona na potrzeby funkcji a\n}", "title": "" }, { "docid": "1b4586493ed51c35b4aa2bdfe90a5f08", "score": "0.51453775", "text": "function recogerTipo(_tipoFirma){\r\n\t_tipo=_tipoFirma;\r\n}", "title": "" }, { "docid": "bdb732c27ea3e3496e80ca18a459a24f", "score": "0.5141419", "text": "function reemplazar( e ){\n\t\t// guardar el numero de la imagen actual \n\n\t\t// generar numero aleatorio \n\n\t\t// quito el numero original de la lista de activos\n\n\t\t// revisar si numero aleatorio generado esta activo \n\n\t\t// si no esta\n\t\t$(e).attr(\"src\", \"img/fotos/\" + getRandomArbitrary( 1, 165 ) + \".jpg\");\n\n\t\t// de lo contrario generar otro y volver a comparar\n\t}", "title": "" }, { "docid": "6d6fa2032772e0ac57724240cb176c2b", "score": "0.5140072", "text": "reset() {\n this.update(0);\n this.acheivement = false;\n }", "title": "" }, { "docid": "bd1e85fcf3f0cba423de5a6e2e68b2cf", "score": "0.5136086", "text": "nuevoGasto(gasto){\r\n this.gastos = [...this.gastos, gasto]; // Hago una copia de arreglo original y agrego el nuevo gasto\r\n\r\n this.calcularRestante();\r\n }", "title": "" }, { "docid": "40b6d2171108e24af9a18820634466ed", "score": "0.5134115", "text": "function editButtonHandler() {\n\t\t// Viene modificato il valore all'interno dell'oggetto che indica se si sta modificando il valore\n\t\tprops.value.editing = true;\n\t\t// Viene utilizzata la funzione del parent che permette di applicare le modifiche\n\t\tprops.changeValue(props.value.ID, props.value, undefined);\n\t\tconsole.log(props.value); //!Log di debug\n\t}", "title": "" }, { "docid": "ef1085dc19eb1c1476fa547ec1c0a9d4", "score": "0.5133818", "text": "function func_edit()\r\n\t{\r\n\t\tvar self = this;\r\n\t\tedit_helper({self: self, clone: null});\r\n\t}", "title": "" }, { "docid": "6930ca271a1611fb43f58bf9490f356d", "score": "0.512803", "text": "function modificarAnuncio(anuncio){\n for(i = 0; i < arrayAnuncios.length; i++)\n {\n if(arrayAnuncios[i].id == anuncio.id)\n {\n arrayAnuncios.splice(i, 2, anuncio);\n }\n }\n \n localStorage.setItem(\"Anuncios\", JSON.stringify(arrayAnuncios));\n limpiarForm();\n cargarTabla(arrayAnuncios);\n}", "title": "" }, { "docid": "e35ce60958c17b77ca491f0de87077a6", "score": "0.51269686", "text": "function editInventory(){\n\t\t\t \n\t\t }", "title": "" }, { "docid": "96a2218cc3d5c7cb1230d20072b8c0fe", "score": "0.512351", "text": "function cancelEdit() {\n var currentBurg = $(this).data(\"burg\");\n if (currentBurg) {\n $(this).children().hide();\n $(this).children(\"input.edit\").val(currentBurg.burger);\n $(this).children(\"span\").show();\n $(this).children(\"button\").show();\n }\n }", "title": "" }, { "docid": "c19b79ee9b9397935bb73997b60cb264", "score": "0.5118884", "text": "revert(){\n\n // load the data inside \n this.historyJmarcOriginal.fields=[]\n this.historyJmarcOriginal.parse(this.historyJmarcHistory.compile())\n // save the record to keep changes\n this.saveRecord(this.historyJmarcOriginal)\n \n // change the mode\n this.historyMode=false\n\n // clean\n let recup=this.historyJmarcHistory\n this.historyJmarcHistory=\"\"\n this.historyJmarcOriginal=\"\"\n this.removeRecordFromEditor(recup)\n\n this.callChangeStyling(\"Record reverted!!!\", \"d-flex w-100 alert-success\")\n \n }", "title": "" }, { "docid": "91b086e818ef3b9979770078c328f4e8", "score": "0.51043314", "text": "modifyData(addch, ch, name) {\n var arr = ['FirstName', 'LastName', 'City', 'State', 'ZipCode'];\n arr[ch - 1] = readline.question(`Change ${name} ${this.addressbook.AddressBook[addch][name]} to ::`);\n this.addressbook.AddressBook[addch][name] = arr[ch - 1];\n obj.printAddressBook();\n obj.saveData();\n }", "title": "" }, { "docid": "757e05e52e1cb9c334bbefb4888f815a", "score": "0.5100487", "text": "function ClickManuelBois() {\n\tressourceBois = ressourceBois + clickBois;\n\tAffichage();\n\t\n}", "title": "" }, { "docid": "57f4574ca78af64d129cd69a4d588633", "score": "0.5097528", "text": "_enterEditMode() {\r\n this.saveDisabled = true;\r\n this.editMode = true;\r\n }", "title": "" }, { "docid": "b540c5bc4c7705765def5df727449a6f", "score": "0.50930756", "text": "function setFormatoModificado(e, flag) {\r\n var removedItems = e.dataItems;\r\n for (var i = 0; i < removedItems.length; i++) {\r\n var item = dataSource_cbxFormatoDisponibleAsignado.get(removedItems[i].CODIGO);\r\n item.ESTADO = flag;\r\n item.dirty = !item.dirty;\r\n }\r\n }", "title": "" }, { "docid": "5fe146851f957c0f0571b4bfecce334e", "score": "0.50914776", "text": "restoreValue() {\n if (this.updated) {\n this.setValue(this.originalValue);\n this.updated = false;\n }\n }", "title": "" }, { "docid": "9dd6222d04bbf2eb683a7f534e4346e7", "score": "0.50809026", "text": "function cumplir(persona)\n{\n persona.edad+=1\n}", "title": "" }, { "docid": "af26d0257c8f115fe1532067c87ec33e", "score": "0.5080846", "text": "function actualizar_planes(){\n\t\tenviarFormulario(\"#form_planes_editar\", 'Planes/actualizar_planes', '#cuadro4');\n\t}", "title": "" }, { "docid": "ab73339156c571fe05d13535cccdbc1a", "score": "0.50674707", "text": "_applyDirtyAttributesAsOrigin() {\n this.saveDataToOriginal();\n }", "title": "" }, { "docid": "9de6ffbe0fd6336ea03e09b33e392f39", "score": "0.50673264", "text": "resetEstado() {\n \n //let historialPedidosAux=[...this.state.historialPedidos]\n //personas[id].nombre = 'Borrado';\n\n //console.log(historialPedidosAux)\n }", "title": "" }, { "docid": "16332d3f393d4516b86ccde77bb53504", "score": "0.5064157", "text": "function voltarNormal() {\n var val = $(\"#inputEdit\").val();\n $(\"#inputEdit\").parent().text(val);\n $(\"#inputEdit\").remove();\n $(document).one('dblclick', 'tbody ', clicar);\n}", "title": "" }, { "docid": "2641e5e7aec59b23160d7611317f6dbc", "score": "0.50570685", "text": "revertEdit(todo) {\n angular.extend(todo, this.originalTodo);\n this.editedTodo = null;\n }", "title": "" }, { "docid": "1709171443758a252c9a21d75691a418", "score": "0.5055763", "text": "function subtraiUmMovimento( peca ){\n\t\t\tvar novaContagem = parseInt(peca.attr('movimentos')) - 1;\n\t\t\tpeca.attr('movimentos', novaContagem );\n\t\t}", "title": "" }, { "docid": "a35691c09034dbfcab5c1805d4837faf", "score": "0.50511456", "text": "function aumentarEdad(persona) {\n persona.edad += 1;\n}", "title": "" }, { "docid": "0726884f36cdb0c6ec2262b28f48ce73", "score": "0.50506955", "text": "add () {\n this.ages.unshift(0)\n }", "title": "" }, { "docid": "2941286adbf6818689e58f8df10098d7", "score": "0.5043123", "text": "rollbackAttributes() {\n this.setObjects(get(this, '_originalState'));\n }", "title": "" }, { "docid": "36edf17fb3623d62582f8459dc285e58", "score": "0.5040354", "text": "pula() {\n console.log(\"Devo pular\");\n \n flappyBird.velocidade = -flappyBird.pulo;\n \n }", "title": "" }, { "docid": "e56fae2b19b33752d0f5fae7b68451fb", "score": "0.5040339", "text": "function reintentar() {\n nroNivel = 0;\n partidaIniciada = false;\n patronDeJuego = [];\n patronUsuario = [];\n}", "title": "" }, { "docid": "e1029620ae26bf0f85784d2ca47b1a24", "score": "0.5037226", "text": "resetStamina() {\n this.stamina += 2;\n if (this.stamina > 3)\n this.stamina = 3;\n }", "title": "" }, { "docid": "49018c889b52943e14f6e4a1882a6ddb", "score": "0.50360554", "text": "function changementJoueur() {\r\n if (joueur == true) {\r\n joueurActif = 1;\r\n joueur = false;\r\n } else {\r\n joueurActif = 2;\r\n //exit\r\n // ia();\r\n joueur = true;\r\n }\r\n}", "title": "" }, { "docid": "5d2a298713c03c1a4d05f602138f4ba7", "score": "0.50322646", "text": "undo() {\n this.oldOwner.insertChild(this.treeItem, this.oldOwnerIndex, true)\n }", "title": "" }, { "docid": "e3b84de6415489bf763bbe1da7b99187", "score": "0.50307006", "text": "function setHauteurBateau(hautBat){\n hauteurBateau = hautBat;\n }", "title": "" }, { "docid": "0f5ae5c89dcdd6d1cccb6e7908955995", "score": "0.5027003", "text": "function marcarComoReprovado (aluno){\n aluno.reprovado = false\n if (aluno.nota < 5){\n aluno.reprovado = true\n }\n}", "title": "" }, { "docid": "e0c475a7262c78d8bdbfad6706da5b18", "score": "0.5024372", "text": "function cancleEdit(row) {\n $(`#${row}`).html(lastrow);\n}", "title": "" }, { "docid": "e97e80904013426d66bf15623839485f", "score": "0.5024051", "text": "function editItemVolunteer(obj) {\n\t\tobj.parents(\".row\").children(\".col-5\").attr(\"contentEditable\", true).css({\"border\": \"1px solid #ccc\"});\n\t\tobj.unbind(\"click\");\n\t\tobj.text(\"保存\").removeClass(\"edit\").addClass(\"save\").bind(\"click\", function() {\n\t\t\tsaveItemVolunteer($(this));\n\t\t});\n\t}", "title": "" }, { "docid": "d8fc2f737c7e528f41bc570a7df66b51", "score": "0.50233966", "text": "function editTableRegAhorro() {\n\n var nameTable = \"RegistroAhorros\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "title": "" }, { "docid": "bb84c1b338d5e84469fc874b11d4856a", "score": "0.50222576", "text": "function saveAankoop(){\n\t\n}", "title": "" }, { "docid": "6f9f4d907860c9f0c58265a502fe79ee", "score": "0.5016455", "text": "function tiraHifen(telefone) {\r\n const actualText = tlefone.value;\r\n const valueAjusted = actualText.replace(/\\-/g,'');\r\n \r\n telefone.value = valueAjusted;\r\n}", "title": "" }, { "docid": "68dea8108802b5213d34a0c3dca98e68", "score": "0.50123304", "text": "function azuriraj(){\n srba.azuriraj();\n zemlja.azuriraj();\n stubovi.azuriraj();\n}", "title": "" }, { "docid": "41edf271252073866cbbc6b1b98c39b7", "score": "0.5011161", "text": "dummy() {\n this.changeVy();\n this.showRecord();\n }", "title": "" }, { "docid": "d48cf82dfc6e26c413479e6407728908", "score": "0.50101376", "text": "actualizar() {\r\n let ahora = Date.now();\r\n this.dt = ahora - this.ultimo;\r\n this.ultimo = ahora;\r\n }", "title": "" }, { "docid": "2720374eb8b519e6faf468a875ffc111", "score": "0.5006281", "text": "function almacenar(){\n\tmemoria = getResult();\n\tguardar();\n}", "title": "" }, { "docid": "736787f3852bf68169f1a8298a06769b", "score": "0.50049645", "text": "function EditLogItemOverwrite () {}", "title": "" }, { "docid": "d4f5f6e526270bcb07538a3586cf95c1", "score": "0.49908414", "text": "function atualizarFabricante() {\n apiService.post('/api/fabricante/atualizar', $scope.novoFabricante,\n atualizarFabricanteSucesso,\n atualizarFabricanteFalha);\n }", "title": "" }, { "docid": "979d7d3455fc89fb718d773c3a65cf6f", "score": "0.49888656", "text": "saveBombe() {\n this.bombeEl = document.getElementById(\"bombe\");\n this.bombeEl.parentNode.removeChild(this.bombeEl);\n }", "title": "" }, { "docid": "c5962e10e28f9b4237ae38724c990ac5", "score": "0.49884078", "text": "commit() {\n this.account.balance -= this.amount; // balance = balance - this.amount\n }", "title": "" }, { "docid": "14545773c7f89dcb3dee9040d18665d1", "score": "0.49878722", "text": "function switchEditAdd(id,primary,field,theme) {\n var idField = document.getElementById('addNorma_'+id);\n var delImg = document.getElementById('deleteNorma_'+id);\n var invBtn = document.getElementById('getInvBtn_'+id);\n var primaryJs = primary.split('##');\n primaryJs.push('namabarang');\n \n if(idField) {\n idField.removeAttribute('id');\n idField.removeAttribute('name');\n idField.removeAttribute('onclick');\n idField.removeAttribute('src');\n idField.removeAttribute('title');\n \n\t// Set Edit Image Attr\n\tidField.setAttribute('title','Edit');\n\tidField.setAttribute('id','editNorma_'+id);\n\tidField.setAttribute('name','editNorma_'+id);\n\tidField.setAttribute('onclick','editNorma(\\''+id+'\\',\\''+primary+'\\',\\''+field+'\\')');\n idField.setAttribute('src','images/'+theme+'/save.png');\n\t\n\t// Set Delete Image Attr\n\tdelImg.setAttribute('class','zImgBtn');\n delImg.setAttribute('title','Hapus');\n\tdelImg.setAttribute('name','deleteNorma_'+id);\n\tdelImg.setAttribute('onclick','deleteNorma(\\''+id+'\\',\\''+primary+'\\',\\''+field+'\\')');\n delImg.setAttribute('src','images/'+theme+'/delete.png');\n\t\n\t// Disabled various field\n\tfor(i=1;i<primaryJs.length;i++) {\n\t tmp = document.getElementById(primaryJs[i]+'_'+id);\n\t if(tmp) {\n\t\ttmp.setAttribute('disabled','disabled');\n\t }\n\t}\n\tinvBtn.setAttribute('disabled','disabled');\n } else {\n alert('DOM Definition Error');\n }\n}", "title": "" }, { "docid": "50db3eb971854443954ba94d3149b177", "score": "0.4986088", "text": "function up(obj){//obj with id\n\tdel(obj.id,'up');\n\tadd(obj,'up');\n}", "title": "" }, { "docid": "13f88c2a1f203820df45701d6b925909", "score": "0.49777666", "text": "handleDataEdit(payload) {\n let index = 0;\n let modifiedAccounts = [...this.accounts];\n let modifiedAccount = modifiedAccounts.find((account, idx) => {\n index = idx;\n return account.Id == payload.Id;\n })\n let modifiedRecord = JSON.parse(JSON.stringify(modifiedAccount))\n modifiedRecord.Name = payload.Name;\n modifiedRecord.Type = payload.Type;\n modifiedRecord.Industry = payload.Industry;\n modifiedAccounts.splice(index,1,modifiedRecord);\n this.accounts = [...modifiedAccounts];\n this.isEditMode = true;\n }", "title": "" }, { "docid": "bc7b2119024aa9a0d947df6b86cbb49f", "score": "0.4975303", "text": "retype () {\n this.setValue(this.value)\n }", "title": "" }, { "docid": "e0fe7684e3d3022ad5f2d565af6163c6", "score": "0.49747476", "text": "function odswiezSume(){//na koncu definiuje zmienna ktora bedzie wrzucac aktualne dane, tzn bez wartosci z przekreslenia\n overallSum.children[1].innerHTML=suma;\n }", "title": "" }, { "docid": "6d0ad8034e5c8e559bb3093147fe2b7d", "score": "0.4968878", "text": "function editNode() {\n copyNode();\n deleteNode();\n}", "title": "" }, { "docid": "c16741fa9c51158c022d99b800e0e6a0", "score": "0.4968505", "text": "function putBackOriginalValue(prevision, fieldName) {\n\n\t\t$scope.origPrevisions.map(function(origPrevision) {\n\n\t\t\tif (origPrevision.id === prevision.id) {\n\t\t\t\tprevision[fieldName] = origPrevision[fieldName];\n\t\t\t\tprevision.errorFields = prevision.errorFields ? prevision.errorFields.concat(fieldName) : [fieldName];\n\n\t\t\t\t$scope.$broadcast('$$rebind::refreshLinkValue');\n\t\t\t\t$scope.$broadcast('$$rebind::refreshErrorBackground');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "667566ccd578b6b480ecbc153a1b9c5d", "score": "0.49636918", "text": "function affraz(){ choix_humain = 0 ; choix_IA = 0 ; affichermonchoix() ;afficherchoixIA() ; afficherScore() ; }", "title": "" }, { "docid": "6d5ac21397f97238c169402ab462f9fb", "score": "0.4963", "text": "function espada() {\n\theroe.ataque = heroe.ataque + 50;\n\talert('El Heroe ' + heroe.nombre +' se ha equipado con Espada / ' + 'Ataque ' + heroe.ataque);\n\talert('Ya Puedes Combatir!!');\n}", "title": "" }, { "docid": "bf68abf064171aa2176acab40877c1a8", "score": "0.49589086", "text": "function editBurger() {\n var currentBurger = $(this).data(\"burger\");\n $(this)\n .children()\n .hide();\n $(this)\n .children(\"input.edit\")\n .val(currentBurger.name);\n $(this)\n .children(\"input.edit\")\n .show();\n $(this)\n .children(\"input.edit\")\n .focus();\n }", "title": "" }, { "docid": "719bcfe97605f48846d9b01a6f63bd57", "score": "0.4958589", "text": "restore(){}", "title": "" }, { "docid": "fb9795b0159d137697d1b537cdd5f6fa", "score": "0.4957606", "text": "function feed() {\n if (myTamagotchi.hunger >= 2) {\n myTamagotchi.hunger -= 2;\n $(\"#hunger\").replaceWith(`<p id='hunger'>Hunger: ${myTamagotchi.hunger}</p>`);\n } else {\n myTamagotchi.hunger = 0;\n $(\"#hunger\").replaceWith(`<p id='hunger'>Hunger: ${myTamagotchi.hunger}</p>`);\n }\n}", "title": "" }, { "docid": "c92ed308cc74eec21c419837b26965c5", "score": "0.495658", "text": "function reset(idx){\n //resetam campurile formularului\n document.querySelector(\"#add-form\").reset();\n //atribuim valoarea -1 la idxEditare\n window.idxEditare = idx;\n //console.log ptr a avea daca s-a resetat\n console.log('a fost resetat id la '+idxEditare);\n \n}", "title": "" }, { "docid": "d351288e8f7fd9d11cc297f18d5d8b52", "score": "0.49561015", "text": "actualizarHistoriaActual(){\n this.setState( { historiaActual: this.obtenerHistoriaPorId( this.state.numeroHistoria + this.state.ultimaEleccion )})\n }", "title": "" }, { "docid": "8299109f197178671b509c8b447c9adf", "score": "0.49524134", "text": "beber_agua(power_up){\n power_up.scene.alcohol.reducir_ebriedad(60);\n power_up.destroy();\n }", "title": "" }, { "docid": "bab9896cfd5fc36da8561a7733d18b8d", "score": "0.49481973", "text": "function undoChange() {\n this.quill.history.undo();\n}", "title": "" }, { "docid": "48013ee17310a10b5c34c954b1208976", "score": "0.49477708", "text": "update() {\n an(this);\n }", "title": "" }, { "docid": "7d5b7c31051637cecb5659767a4aa29f", "score": "0.49401367", "text": "function Edit() {\n\n \n\n\n}", "title": "" } ]
9d92c6ff737f36e501d98ec022068c5d
UTILITY FUNCTION: state updating function that we pass to our components so that they are able to update our global state object
[ { "docid": "92c6555aeae37c22342a2c972b15180b", "score": "0.6065947", "text": "function setGlobalState(nextState) {\n state = { ...state, ...nextState };\n console.log(\"new state\", state);\n draw();\n}", "title": "" } ]
[ { "docid": "779a6c534758e860981f8e40e7f42e6d", "score": "0.7126269", "text": "refreshState() {\r\n }", "title": "" }, { "docid": "f43afcbed8da8e902f6b94988ef36cab", "score": "0.7062587", "text": "setState(fn) {\n\t\tconst newStateObj = fn()\n\t\tconst properties = Object.getOwnPropertyNames(newStateObj)\n\t\tproperties.forEach(prop => {\n\t\t\tthis.state[prop] = newStateObj[prop]\n\t\t})\n\t\tthis.update()\n\t}", "title": "" }, { "docid": "cd2a06f779014256cd049013cea078c7", "score": "0.70077544", "text": "setState(updates){\n this.state = Object.assign(this.state, updates);\n this.refresh();\n }", "title": "" }, { "docid": "e98429c39f8d087664ecea46dcfac6e3", "score": "0.692061", "text": "function C2D_updateState(state)\n{\n // TODO: should I check what is inside the state? \n // - What if heaterOn has changed? How should I detect to take action?\n // - What if the cloud service wants to set the temperature? It makes no sense e.g. for a sensor.\n // - Do we get all the properties on update or just the ones changed? \n console.log(\"in C2D_updateState; new state:\");\n console.dir(state)\n my_state = state;\n}", "title": "" }, { "docid": "7f91a2f974ef16796f1f74e217f4e9e2", "score": "0.6885157", "text": "function _State() {\n}", "title": "" }, { "docid": "5ff72852465eb373d15cf580b168b92f", "score": "0.68003666", "text": "updateState(stateChange){\n this.setState(stateChange);\n }", "title": "" }, { "docid": "526a41b74d584d1b518aed505d12d438", "score": "0.6734381", "text": "async updateState({props, oldProps, changeFlags}) {\n await this._updateToken(props, oldProps, changeFlags);\n this._updateEEObject(props, oldProps, changeFlags);\n await this._updateEEVisParams(props, oldProps, changeFlags);\n this._animate();\n }", "title": "" }, { "docid": "ee4e9cd9eba14c6024d54f54b18943af", "score": "0.6730512", "text": "function state_update(st) {\n console.log(\"New state\", st);\n state = st;\n if (callback) {\n callback(st);\n }\n}", "title": "" }, { "docid": "657ffbd156358c4a0259b816ede6b3f5", "score": "0.66752803", "text": "handleState(){\r\n\r\n }", "title": "" }, { "docid": "d343e38ce641677d5aa432fb8e30e378", "score": "0.66396433", "text": "update(newState) {\n this.state = Object.assign({}, this.state, newState);\n return this.state;\n }", "title": "" }, { "docid": "32ba8f103e7eb856233afda16b90867b", "score": "0.66363794", "text": "setState(stateIn) {\n this.state = Object.assign(this.state, stateIn);\n this.emit(\"stateUpdated\", this.state);\n }", "title": "" }, { "docid": "876f1d17d56118c86bdea0b7dea0fa27", "score": "0.65876293", "text": "updatePrice(data){\r\n this.props.updateState(data)\r\n }", "title": "" }, { "docid": "3773c9b9c591aea466c9491c18416224", "score": "0.65859747", "text": "update() {\n\t\tthis.setState({ctrl: this.ctrl});\n\t}", "title": "" }, { "docid": "54ff9d488ab8cc70f064e781c64c5991", "score": "0.65434396", "text": "function stateUpdate(newState) {\n loadingPage(false);\n doorStatusLabel.innerText = newState.doorPowered\n faultStatusLabel.innerText = newState.haveFault\n autoCloseTimeSlider.value = newState.doorAutoCloseTime\n lightBrightnessSlider.value = newState.lightBrightness\n lightOffTimeSlider.value = newState.lightAutoOffTime\n\n if (newState.lightPowered) {\n lightStatusLabel.innerText = \"On\"\n } else {\n lightStatusLabel.innerText = \"Off\"\n }\n\n if (newState.autoCloseEnabled) {\n autoCloseStatusLabel.innerText = \"On\"\n } else {\n autoCloseStatusLabel.innerText = \"Off\"\n }\n autoCloseTime.innerText = autoCloseTimeSlider.value + \"s\"\n lightBrightness.innerText = lightBrightnessSlider.value + \"%\"\n lightOffTime.innerText = lightOffTimeSlider.value + \"s\"\n}", "title": "" }, { "docid": "9127286e43106bb4f802b976d58fe61a", "score": "0.6526756", "text": "updateState(state, val) {\n if (this.state[ state ] !== val) {\n const temp = {};\n temp[ state ] = val;\n this.setState(temp);\n }\n }", "title": "" }, { "docid": "7e46a3402a73b81612b0784cef7e4068", "score": "0.6498835", "text": "function State() {}", "title": "" }, { "docid": "579f211543a1cd95285bc92c0dcb534a", "score": "0.6488019", "text": "updateState(options) {\n if (options && options.debug) {\n console.log('Updating state:', this.currentState);\n }\n this.setState(update(this.state, {$set: this.currentState}));\n }", "title": "" }, { "docid": "a6ce4ef1e9b4f2184d7f21d1a8f77e3f", "score": "0.6483922", "text": "function statefulUpdate () {\n // Stateful Lessons Page\n if (/^\\/lesson\\/[0-9]{2}\\/$/.test(window.location.pathname)) {\n answer.updateState()\n initScripture()\n initCommentary()\n song.updateState()\n video.updateState()\n initPrayer()\n }\n\n // Stateful Home Page\n if (/^\\/$/.test(window.location.pathname)) {\n welcome.updateState()\n }\n\n // If the documentation has been visited and no lessons have been visited, recommend the first lesson.\n if (/^\\/documentation\\//.test(window.location.pathname)) {\n if (convertToNumber(state.currentLesson) === 0) {\n state.currentLesson = 1\n return window.localStorage.setItem('currentLesson', state.currentLesson)\n }\n }\n\n // Stateful Global.\n settings.updateState()\n search.updateState()\n footer.updateState()\n }", "title": "" }, { "docid": "c4fd5f286ad4f5b253497a2e3ea9787a", "score": "0.64685357", "text": "function updateState() {\n const oldHemisphere = STATE.hemi;\n const oldTemporality = STATE.temporality;\n const oldYearLoop = STATE.yearLoop;\n\n\n readPageConfiguration();\n if (oldHemisphere != STATE.hemi) {\n mapUtil.resetMap();\n mapUtil.updateMap();\n }\n\n if (oldTemporality != STATE.temporality || oldYearLoop != STATE.yearLoop) {\n STATE.currentDate = moment(STATE.startDate);\n }\n\n if (STATE.currentDate.isBefore(STATE.startDate)) {\n STATE.currentDate = moment(STATE.startDate);\n }\n\n if (STATE.currentDate.isAfter(STATE.endDate)) {\n STATE.currentDate = moment(STATE.endDate);\n }\n\n if (STATE.yearLoop) {\n const dayLoop = document.querySelector('input[name=\"dayLoop\"]').value;\n const monthLoop = document.querySelector('select[name=\"monthLoop\"]').value;\n updateCurrentDate({'date': dayLoop, 'month': monthLoop});\n }\n\n page.updateCSS();\n\n timeline.generateTimelineScale();\n}", "title": "" }, { "docid": "ebcb2475f6b68026f69ef7592ff6d5e0", "score": "0.64627886", "text": "update() {\n if (this.currentState != null) {\n this.currentState.update(this);\n }\n }", "title": "" }, { "docid": "ea9d6eea9fedea54d6982f8d6de64344", "score": "0.64563835", "text": "updateUI(state) {\n this.emit(\"uiUpdate\", state);\n }", "title": "" }, { "docid": "64763f2dae67eaed290daacd6343ace5", "score": "0.64505446", "text": "onUpdate(updateArgs) {\n // TODO: States do not have any processing, instead they are containers for systems. We should be\n // invoking 'onUpdate' on the systems marked for update.\n if ( this.activeState ) {\n // TODO: Record performance here\n this.activeState.onUpdate(updateArgs);\n }\n\n // If a new game state has been requested, switch to the new state. We use a 'while' loop to allow a state\n // to request another state within its onActivate method.\n while ( this.pendingState ) {\n let newState = this.pendingState;\n let oldState = this.activeState;\n\n this.pendingState = null;\n\n if (newState != oldState) {\n // At the moment, the first state change will have the oldState as null, however it may be\n // we change it so the old state can never be null.\n if (oldState) {\n oldState.onDeactivate();\n }\n\n this.activeState = newState;\n\n this.pendingState.onActivate();\n }\n }\n }", "title": "" }, { "docid": "bbdb2737b586452f343e2a80536cf299", "score": "0.64489174", "text": "set state(state){\n }", "title": "" }, { "docid": "deeb6508964eb986abca13c5f848611b", "score": "0.6426351", "text": "function updateState(state) {\n gameState = state;\n //the rendering of the state is now done in the draw function, at 60 fps\n}", "title": "" }, { "docid": "635ed845fb9c4062aebe761ac7022736", "score": "0.641938", "text": "setAllStateData(state,value){\n Object.assign(state,value);\n }", "title": "" }, { "docid": "1a69de072c888b441138cdb0183b002d", "score": "0.6408165", "text": "update() {\n if(changed) this.props.updateFunction();\n }", "title": "" }, { "docid": "97c24408fc6a49ea434ea1e50de28ef3", "score": "0.640776", "text": "function updateState (state) {\n return Object.assign({}, state, update(settings, state))\n }", "title": "" }, { "docid": "f9e3c73a016a38bda5a49715870ac60f", "score": "0.6390568", "text": "updateState(day, meal, newHistory) {\n // This works by calling letting setState() know that the call\n // to updateGraph() depends on the state values, so it will ensure\n // the values are synched before the function call\n this.setState({\n day: day,\n meal: meal,\n history: newHistory\n }, () => this.updateGraph());\n }", "title": "" }, { "docid": "84af867044b2110b57101563d7d1f577", "score": "0.6388823", "text": "function actionOnChangeState(state) {\n\n}", "title": "" }, { "docid": "4cd7d27614be43145c13cf8362789da8", "score": "0.6372737", "text": "function state(args) {\n //code\n}", "title": "" }, { "docid": "c5c72bf0230a0cc0e78aef2fb12625b3", "score": "0.6367444", "text": "setAppState(name, value, update=true, setReactState=true){\n this.getAppStateObject().setState(name, value, update);\n if(setReactState) {\n if(!this.hasMounted){\n this.state[name]=value;\n }else {\n const stateDict = {};\n stateDict[name] = value;\n this.setState(stateDict);\n }\n }\n }", "title": "" }, { "docid": "d3c660b6b1b4e9fc859171125d8494e5", "score": "0.63581735", "text": "_onChange() {\n this.setState(getState());\n }", "title": "" }, { "docid": "d3c660b6b1b4e9fc859171125d8494e5", "score": "0.63581735", "text": "_onChange() {\n this.setState(getState());\n }", "title": "" }, { "docid": "cde4eac96adaf5845b441cf1f6894788", "score": "0.6335048", "text": "function ManagerState(bState)\n{\n\twindow.external.ManagerState(bState)\n}", "title": "" }, { "docid": "cd984036293db0d9d59242ad9dcda778", "score": "0.6322777", "text": "_onCurrentStatusChange(value){\n\n this.setState({\n currentStatusValue: value\n })\n\n }", "title": "" }, { "docid": "35c8060581582bdfb10cbf46fcb2ad9c", "score": "0.6320635", "text": "function state_update() {\n state.uptime = Sys.uptime();\n print(\"state update:\", JSON.stringify(state));\n AWS.Shadow.update(0, {desired: state}); \n}", "title": "" }, { "docid": "07b8610d345075dfc1567f11286fa445", "score": "0.6297098", "text": "function stateUpdate(newState) {\n\n console.log(firstLoad + \"this is first log or not \")\n\n console.log(\"StateUpdate function in garageapp\")\n console.dir(newState);\n // loadingPage(false)\n printDoorStat(newState.doorStats)\n\n\n lightStatus.innerHTML = newState.lightStats ? \"on\" : \"off\"\n garageAutoCloseCheckbox.checked = newState.autoClose\n garageShutTimeSlider.value = newState.autoCloseTime\n garageTimeDetailedText.innerHTML = newState.autoCloseTime\n\n\n lightAutoCheckbox.checked = newState.lightAutoOff\n lightShutTimeSlider.value= newState.lightAutoOffTime\n lightTimeText.innerHTML = newState.lightAutoOffTime\n brightnessRange.value=newState.lightBrightness\n\n // if (firstLoad){\n mainPg.hidden = false\n // firstLoad = false\n // }\n\n}", "title": "" }, { "docid": "25c77e187883c8456a622bc6bed31a42", "score": "0.6293628", "text": "_onChange() {\n this.setState(getStateFromStores());\n }", "title": "" }, { "docid": "f48c7af147184789020a52508da4fe8e", "score": "0.6284739", "text": "componentDidUpdate(prevProps, prevState){\n this.currentState = objectAssign({}, this.state);\n if (this.isAnimating()) {\n this.updateAnimationState();\n }\n }", "title": "" }, { "docid": "43e327efc5395042857472a16acb594d", "score": "0.6283401", "text": "function updateState() {\n\n /** State Handling */\n if(state.connectionMode){\n svg2.selectAll(\"use.selected-connection-point\").classed(\"selected-connection-point\", false);\n state.nodeLinkingSet = [];\n state.connectionMode = false;\n }\n if(state.fwView){\n state.fwView = false;\n }\n }", "title": "" }, { "docid": "d39185d876a77895c62aeaa814e98ea7", "score": "0.6281353", "text": "setState(newState = this.state, fn) {\n this.stateWillUpdate();\n const propsToUpdate = [];\n /* START.DEV */\n try {\n /* END.DEV */\n for (let stateKey in newState) {\n if (newState[stateKey] !== this.state[stateKey]) {\n propsToUpdate.push(stateKey);\n if (this.$watchers[stateKey]) {\n if (this.$watchers[stateKey].pre) {\n this.$watchers[stateKey].pre.call(\n this,\n newState[stateKey],\n this.state[stateKey]\n );\n }\n }\n this.state[stateKey] = newState[stateKey];\n\n if (this.$s) {\n if (this.$s[stateKey]) {\n this.$s[stateKey].forEach(stateObj => {\n updateDOM(stateObj.el, newState[stateKey]);\n });\n }\n }\n\n if (this.$watchers[stateKey]) {\n if (this.$watchers[stateKey].post) {\n this.$watchers[stateKey].post.call(this, this.state[stateKey]);\n }\n }\n }\n }\n /* START.DEV */\n } catch (err) {\n console.error(\n `🤓 -- \"Whoops, pal! You ran into this error while updating state: \n `,\n err,\n ` within this root element `,\n this.$root\n );\n }\n /* END.DEV */\n if (this.$d.size > 0) {\n updateDependents.call(this, propsToUpdate);\n }\n hasCallback(fn);\n this.stateDidUpdate();\n }", "title": "" }, { "docid": "d95f2ebe622a2042afc5a9715feb4424", "score": "0.627824", "text": "_update_state() {\n\t\t// Same values as `parent.X.characters`\n\t\tthis.state.character = {\n\t\t\tname: character.name,\n\t\t\ttype: character.ctype,\n\t\t\tlevel: character.level,\n\t\t\tin: character.in,\n\t\t\tmap: character.map,\n\t\t\tx: character.real_x,\n\t\t\ty: character.real_y,\n\t\t\tonline: true, // TODO: Find out how to get online time\n\t\t\tserver: window.server.region + window.server.id,\n\t\t}\n\t\tthis.state.last_update = Date.now();\n\t}", "title": "" }, { "docid": "e6676c505c14d8a40707905e9fd2686c", "score": "0.62768334", "text": "_updateState(dataKey, field, value) {\n if (IsDefined(dataKey) && IsObject(this.dom.state)) {\n if (!IsObject(this.dom.state[dataKey])) {\n this.dom.state[dataKey] = {\n open: false,\n template: this.field.state,\n footer_adjust: this.field.state,\n customLabel: false\n };\n }\n this.dom.state[dataKey][field] = value;\n }\n }", "title": "" }, { "docid": "2fd8f7313992ed1fe2deb12c32b5bfe7", "score": "0.6272299", "text": "changeState(state) {\n\t\tthis.state = state;\n\t}", "title": "" }, { "docid": "ff5e60537dfa3f410c55a12222c2920e", "score": "0.62707317", "text": "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "title": "" }, { "docid": "ff5e60537dfa3f410c55a12222c2920e", "score": "0.62707317", "text": "function OnStateUpdate(self, state)\n {\n self.state = state.state;\n set_view(self, self.state)\n }", "title": "" }, { "docid": "d4e73d42030caf41ef44d74589435685", "score": "0.62705237", "text": "setState(newState) {\n this.state = { ...this.state, ...newState };\n\n this._rerenderComponent();\n }", "title": "" }, { "docid": "11b5dcd31a4c03c44122e258fef8aab8", "score": "0.625812", "text": "changeState(newState) {\n this.appState = newState;\n this.updateView();\n }", "title": "" }, { "docid": "c3c045a88a8e094304265c44bd800f9e", "score": "0.6256707", "text": "updateName() {\n// #3 BUILD THIS.SETSTATE METHOD WITH AN OBJECT PASSED AS THE ARGUMENT\n this.setState({\n// #4 INSIDE THE OBJECT CREATE YOUR NEW STATE PROPERTY'S & VALUES\n firstName: 'Kingston',\n lastName: 'Thouchalanh (changed state).'\n })\n }", "title": "" }, { "docid": "35ad8daaae9009c2f640b8ce085ac842", "score": "0.62549394", "text": "function stateUpdater(stateVal, sesh, count, msg) {\n state = stateVal;\n count = sesh * seconds;\n resetCircle(stateVal);\n circleSetup(count, stateVal);\n timer(sesh, seconds, count);\n $('.message').text(msg);\n}", "title": "" }, { "docid": "5c95dfed7793a6857cdf76f47c0748e2", "score": "0.62490326", "text": "_onChange() {\n\t\tthis.setState(getStateFromStores());\n\t}", "title": "" }, { "docid": "17fe764abd0fec2d4703cbea8be90fe4", "score": "0.6248525", "text": "freezeState() {\r\n \r\n }", "title": "" }, { "docid": "1e7082ab1007122db12c71f0adc48fd1", "score": "0.623702", "text": "hotRefresh() {\n this.setState({currentlyViewing: store.getState().currentlyViewing});\n }", "title": "" }, { "docid": "2ed0040593a7c14d2bafb6977af1e81c", "score": "0.62368935", "text": "set state(arg){ \r\n if(arg.constructor == Object){\r\n newState = Object.assign({}, this['[[state]]'].current); // change to deepAssign\r\n this['[[state]]'].history.push(this['[[state]]'].current);\r\n Object.assign(newState, arg); // change to deepAssign\r\n this['[[state]]'].current = newState;\r\n this.__onStateChange__.map((fn)=>{\r\n fn(this['[[state]]'].current);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "d590c1dad40f86e90f14229cbafe345c", "score": "0.6235544", "text": "updateReduxState() {\n this.props.updateName(this.state.name);\n this.props.updateCity(this.state.city);\n this.props.updateAddress(this.state.address);\n this.props.updateState(this.state.state);\n this.props.updateZipcode(this.state.zipcode);\n }", "title": "" }, { "docid": "0828e580cf1c07aa13665a5ccbb399d8", "score": "0.62202954", "text": "setState(newState) {\n let s = { ...this.state, ...newState };\n this.state = s;\n this.render();\n }", "title": "" }, { "docid": "f7a6b9696717a4f4e855f3ce3900397f", "score": "0.62181604", "text": "function updateState() {\n doApi('get_stats')\n .then(\n function(Data) {\n $rootScope.stats_object = Data;\n\n if ($rootScope.currentState!='RUNNING') {\n stopTimer();\n };\n\n if ($rootScope.currentState=='RUNNING') {\n if (!isTimerRunning()) {\n startTimer();\n };\n }\n },\n function() {\n stopTimer();\n });\n }", "title": "" }, { "docid": "cb1a5fbe7ad9bb869e19c82cbd405d11", "score": "0.6207745", "text": "onUpdate(event) {\n\t\tvar input = event.target\n\t\tthis.state.onUpdate(event)\n\t}", "title": "" }, { "docid": "03eafbbeede4daaa6d901075fd8fbb1a", "score": "0.62069035", "text": "function updateState(name,value){\n setSolution(prevState => { return {...prevState, [name]: value }});\n }", "title": "" }, { "docid": "2baa8c19a6feff2943d54133442f52d3", "score": "0.6202646", "text": "function State()\n\t{\n\n\t}", "title": "" }, { "docid": "56a7d3166a5ae3d7b6db510973299472", "score": "0.6201747", "text": "changeState(field, event, textValue){\n if(process.env.NODE_ENV === \"test\") console.log(\" \");\n if(process.env.NODE_ENV === \"test\") console.log(\"ImmunizationDetail.changeState\", field, textValue);\n if(process.env.NODE_ENV === \"test\") console.log(\"this.state\", this.state);\n\n let formData = Object.assign({}, this.state.form);\n let immunizationData = Object.assign({}, this.state.immunization);\n\n formData = this.updateFormData(formData, field, textValue);\n immunizationData = this.updateImmunization(immunizationData, field, textValue);\n\n if(process.env.NODE_ENV === \"test\") console.log(\"immunizationData\", immunizationData);\n if(process.env.NODE_ENV === \"test\") console.log(\"formData\", formData);\n\n this.setState({immunization: immunizationData})\n this.setState({form: formData})\n }", "title": "" }, { "docid": "12c50cec743e54a52ff5c5bba92ac2ff", "score": "0.61859417", "text": "update() {\n this.bird.update(this.state);\n this.fg.update(this.state);\n this.pipe.update();\n }", "title": "" }, { "docid": "45b224d659b765ee82834a16f7c6d0e0", "score": "0.617321", "text": "componentVisibilityChanged() {\n const update = {};\n update[this.props.visibilityId] = this.state.visible;\n this.props.visibilityUpdate(update);\n }", "title": "" }, { "docid": "b2b1ffe34306d430d079c801fb7e0bbd", "score": "0.6170807", "text": "handleChange() {\n if (this.props.onUpdate) {\n let update = {};\n update[this.props.name] = this.state.tempValue;\n this.props.onUpdate(update);\n }\n }", "title": "" }, { "docid": "c52c1a911ad91fc6d75174928226e74c", "score": "0.61625427", "text": "handleStateChange(value) {\n this.setState({state: value});\n }", "title": "" }, { "docid": "1b5e3eb22633d669faeb89637ab64b63", "score": "0.61516476", "text": "update() {\n // ...\n }", "title": "" }, { "docid": "68e2853bb4143ce15f34f409feedb2a4", "score": "0.61471474", "text": "getUpdatedState(props = {}, state = {}) {\n return {\n ...state,\n ...props,\n };\n }", "title": "" }, { "docid": "a8f0812f4b41fc5f301a107a0e8572f0", "score": "0.61469465", "text": "_onChange(){\n\t\tthis.setState(getCartState());\n\t}", "title": "" }, { "docid": "dad33cc44ef23279c32e534c7be4843c", "score": "0.61433494", "text": "stateTransition() {\n\n }", "title": "" }, { "docid": "bcfc2cdc7b872bec19b1cbd60403e51a", "score": "0.61327577", "text": "stateChanged(state) {\n this._items = cartItemsSelector(state);\n this._total = cartTotalSelector(state);\n}", "title": "" }, { "docid": "6fcdd881ab40c7f379b0f15098221997", "score": "0.6131612", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getSelectedDishes(),\n })\n }", "title": "" }, { "docid": "9e08f49724f8ce5f16bede47bb0be443", "score": "0.6125666", "text": "update() {\n\t\t\n\t\tconsole.log(\"We are in the update!\");\n\t\t\n this.setState({\n\t\t\tnumberOfGuests: this.props.model.getNumberOfGuests(),\n\t\t\ttotalPrice: this.props.model.getTotalMenuPrice()\n })\n }", "title": "" }, { "docid": "ee0475d83e776fbd63dc065867ecfc9a", "score": "0.6125165", "text": "setState(currentState) {\n this.oldState = Object.assign({}, this.state);\n this.state = Object.assign({}, this.state, currentState);\n this.display(this.props)\n }", "title": "" }, { "docid": "4058f1d4e1ffeb49957a84a0b7da141d", "score": "0.6122211", "text": "function setState() {\n // determine the source of our data and bind to model\n vm.fireCalcDataSource = obtainDataSource();\n \n // loadState returns our array of values\n var arr = loadState();\n \n // bind array values to model\n vm.state = {\n birthDate: new Date(arr[0]),\n retirementAge: arr[1],\n annualExpenses: arr[2],\n withdrawalRate: arr[3],\n FVpv: loadExistingSavings(),\n FVrate: loadRoR(),\n FVpmt: arr[5],\n requiredSavings: 0,\n FVnper: 10\n };\n }", "title": "" }, { "docid": "0ca1b9e095e2ffe0c34966a6b9e4de67", "score": "0.61016095", "text": "function updateInternalState()\n{\n switch (currentMode)\n {\n case modeEnum.off:\n if (prg === true && is_temp <= (sp_temp - 4))\n {\n currentMode = modeEnum.start;\n }\n else if (prg === false && is_temp >= (sp_temp - 8))\n {\n is_temp -= temp_step;\n }\n break;\n case modeEnum.start:\n currentMode = modeEnum.heating;\n break;\n case modeEnum.heating:\n if (is_temp < sp_temp)\n {\n is_temp += temp_step;\n }\n else\n {\n currentMode = modeEnum.off;\n prg = false;\n }\n break;\n default:\n currentMode = modeEnum.off;\n }\n\n if (prg === false)\n {\n currentMode = modeEnum.off;\n prg = false;\n }\n\n logger.debug('Updated internal state: mode is ' + currentMode + ', zone is ' + currentZone);\n}", "title": "" }, { "docid": "0ea00906bd46771213f36871cf119d76", "score": "0.60926825", "text": "static inventoryStatusChange(val) {\n\tconst {inventory} = obj.props\n obj.setState({ inventoryStatus: val.value})\n}", "title": "" }, { "docid": "1c26094667f0199f37e38aaadded6fe0", "score": "0.6091551", "text": "function stateChange(newState) {\n\n buildStateCharts(newState);\n \n}", "title": "" }, { "docid": "5fca71d95a47ebc954156ac31f602b16", "score": "0.60882336", "text": "function _updateUiState () {_this._updateUiState ()}", "title": "" }, { "docid": "4c54e7f1d4cb48c0dfd4916119685545", "score": "0.6083948", "text": "onStateChange() {\n // this.selectorProps = this.selector(store.state, nextProps)\n // line above replaced\n this.selector.run(this.props);\n if (!this.selector.shouldComponentUpdate) {\n // if it does not get a re-render, we still need to notify the nested subscription\n this.subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate.this.notifyNestedSubsOnComponentDidUpdate;\n this.setState({})\n\n\n // setState should be used over forceUpdate as it checks shouldComponentUpdate\n // which prevents unnesccesary re-render\n //setState moved into if else\n }\n }", "title": "" }, { "docid": "1efedf14372b55e6f545105719569960", "score": "0.6081724", "text": "stateStartup(_updatedGaugeData) {\n this.layoutManager.renderables.updateAll();\n setTimeout(() => {\n this.state = this.stateRunning;\n }, 1000);\n }", "title": "" }, { "docid": "d5d8fb9e8c61c174bd16890cbf0bc416", "score": "0.60766035", "text": "update_c(state, c) {\n state.c = c;\n }", "title": "" }, { "docid": "b262562d9446d418d623e49e002d86a5", "score": "0.60576856", "text": "function setState (stateObj) {\n _category = stateObj.category;\n _products = stateObj.products;\n}", "title": "" }, { "docid": "9363acdaeba0fc34951f21289713f15a", "score": "0.605736", "text": "setState (newState) {\n this.state = Object.assign({}, this.state, newState)\n }", "title": "" }, { "docid": "2a39a5d1ba7e36a567d8e963c6db31e0", "score": "0.60554236", "text": "thawState() {\r\n \r\n }", "title": "" }, { "docid": "f4d35a0413438ab23558be6a6c276331", "score": "0.605032", "text": "function handleChange(evt) { //updating form elements, nested function\n const name = evt.target.name //defined in render\n const value = evt.target.value //defined in render\n\t //because we are using a single state object above to hold multiple properties, we must save off the current state first (b/c we are only updating part of the object). To do this, we \"spread\" state via ...state and add it to the new copy of state that updateState is creating, followed by any updates we want:\n\t updateState({\n ...state,\n [name]: value\n })\n }", "title": "" }, { "docid": "9124b6e59b847b40065265b75e9ec3c0", "score": "0.604955", "text": "update() {\n if (!this.state.connected) return;\n\n if (this.nextUpdate) return this.nextUpdate.bind(this)();\n\n if (this.updateNumber == 0) this.updateMeasuredCurrent(this.update.bind(this));\n else if (this.updateNumber == 1) this.updateMeasuredVoltage(this.update.bind(this));\n else if (this.updateNumber == 2) this.updateOutputState(this.update.bind(this));\n if (++this.updateNumber >= 3) this.updateNumber = 0;\n }", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "68fe5354a9e700454f645d1bc3611a47", "score": "0.60487604", "text": "update() {}", "title": "" }, { "docid": "503d713437bc6aee91c3d998cd7983e8", "score": "0.6046195", "text": "getUpdatedState(props, state) {\n return {\n ...state,\n ...props,\n };\n }", "title": "" }, { "docid": "e1d931b4dd507366b377ade94b521731", "score": "0.6042063", "text": "setState(state) {\n\n }", "title": "" }, { "docid": "5791baa165682d7fefc6eba40da4f61e", "score": "0.60376585", "text": "setMainState(stateObject) {\n this.setState(stateObject)\n }", "title": "" }, { "docid": "d96b83178008c920c8613eee76da1387", "score": "0.603683", "text": "_stateChanged(state) {\n this._clicks = state.Counter.clicks;\n this._value = state.Counter.value;\n }", "title": "" } ]
7e3d2ec654070b63fa9f72cccd355ad9
Each block has a direction and a position
[ { "docid": "d30f9b44b9c74bb430c52f7c3dd6edd3", "score": "0.5639178", "text": "constructor (x_position, y_position, direction) {\n this.x_position = x_position;\n this.y_position = y_position;\n this.direction = direction;\n }", "title": "" } ]
[ { "docid": "bf9aedbb24c6414990903dc310019780", "score": "0.7220728", "text": "move() {\n var new_directions = [];\n for (var index = 0; index < this.blocks.length; index++) {\n if (index != 0) {\n new_directions.push(this.blocks[index - 1].direction);\n } else {\n new_directions.push(this.blocks[index].direction);\n }\n }\n // Iterates over all blocks\n for (var index = 0; index < this.blocks.length; index++) {\n // Grabs the current block for clarity reasons\n block = this.blocks[index];\n // Holds new coordinates\n var new_x, new_y;\n // Switch over each direction to move in the correct direction\n switch(block.direction) {\n case(directions.UP):\n new_x = block.x_position, new_y = block.y_position - move_distance;\n break;\n case(directions.RIGHT):\n new_x = block.x_position + move_distance, new_y = block.y_position;\n break;\n case(directions.DOWN):\n new_x = block.x_position, new_y = block.y_position + move_distance;\n break;\n case(directions.LEFT):\n new_x = block.x_position - move_distance, new_y = block.y_position;\n break;\n }\n // Call the set_position method to update the position\n block.set_position(new_x, new_y);\n // Set new direction\n block.direction = new_directions[index];\n \n }\n }", "title": "" }, { "docid": "0349023fe57189bd0351d3fececd5695", "score": "0.68026984", "text": "function Block(type, x, y) {\n this.rots = [];\n this.type = type;\n this.cells = [];\n this.r = 0; //rotation \n this.x = x;\n this.y = y;\n\n /*Block Type Case Statement.\n Type === 0 = \"LINE\" Block. Drawn from LOWEST BLOCK.\n Type === 1 = \"SQUARE\" Block. Drawn from LOWER LEFT CORNER.\n Type === 2 = \"Z\" Block. Drawn from LOWER MIDDLE BLOCK.\n Type === 3 = \"S\" Block. Drawn from LOWER MIDDLE BLOCK.\n Type === 4 = \"T\" Block. Drawn from STEM OF T. LOWER MIDDLE.\n Type === 5 = \"L\" Block. Drawn from LOWER LEFT CORNER.\n Type === 6 = \"J\" Block. Drawn from LOWER RIGHT CORNER.\n\n LL = lower left, UL = upper left, LR = lower right, UR = upper right, UM = upper middle, LM = lower middle\n */\n if (this.type === 0) {\n this.rots = [\n\t\t [[0,0],[0,-1],[0,1], [0,2]],\n\t\t [[0,0],[-1,0],[-2,0], [1,0]],\n \t\t [[0,0],[0,-1],[0,1], [0,2]],\n \t\t [[0,0],[-1,0],[-2,0], [1,0]]\n\t ];\n }\n if (this.type === 1) {\n this.rots = [\n \t\t [[0,0],[0,-1],[1,0], [1,-1]],\n \t\t [[0,0],[0,-1],[1,0], [1,-1]],\n \t\t [[0,0],[0,-1],[1,0], [1,-1]],\n \t\t [[0,0],[0,-1],[1,0], [1,-1]]\n\t];\n }\n if (this.type === 2) {\n this.rots = [\n \t \t[[0,0],[-1,0],[0,1], [1,1]],\n \t\t [[0,0],[-1,0],[0,-1], [-1,1]],\n \t\t [[0,0],[-1,0],[0,1], [1,1]],\n \t\t [[0,0],[-1,0],[0,-1], [-1,1]]\n\t ];\n }\n if (this.type === 3) {\n this.rots = [\n \t \t[[0,0],[0,1],[-1,1], [1,0]],\n \t\t [[0,0],[0,-1],[1,0], [1,1]],\n \t\t [[0,0],[0,1],[-1,1], [1,0]],\n \t\t [[0,0],[0,-1],[1,0], [1,1]]\n\t ];\n }\n if (this.type === 4) {\n this.rots = [\n \t \t[[0,0],[-1,0],[1,0], [0,1]],\n \t\t [[0,0],[-1,0],[0,-1], [0,1]],\n \t\t [[0,0],[-1,0],[1,0], [0,-1]],\n \t\t [[0,0],[1,0],[0,-1], [0,1]]\n\t ];\n }\n if (this.type === 5) {\n this.rots = [\n \t \t[[0,0],[0,-1],[0,1], [1,1]],\n \t\t [[0,0],[-1,0],[1,0], [-1,1]],\n \t\t [[0,0],[0,-1],[0,1], [-1,-1]],\n \t\t [[0,0],[-1,0],[1,0], [1,-1]]\n\t ];\n }\n if (this.type === 6) {\n this.rots = [\n \t \t[[0,0],[0,-1],[0,1], [-1,1]],\n \t\t [[0,0],[1,0],[-1,0], [-1,-1]],\n \t\t [[0,0],[0,-1],[0,1], [1,-1]],\n \t\t [[0,0],[-1,0],[1,0], [1,1]]\n\t ];\n }\n \n for(var i = 0; i < 4; ++i) {\n\t\tthis.cells.push(new Cell(this.type, this.rots[this.r][i][0] + this.x, this.rots[this.r][i][1] + this.y));\n }\n}", "title": "" }, { "docid": "64aead37a6bd3897d9cbaca945035333", "score": "0.6768897", "text": "moveBlock(){\n if (this.direction == \"right\"){\n this.x = this.x+ this.speed;\n } else if(this.direction == \"left\"){\n this.x = this.x - this.speed;\n }\n // this.x = this.x+ this.speed;\n // this.y = this.y+.5;\n }", "title": "" }, { "docid": "ad73cfb4108ee5a387539070da8aa9e9", "score": "0.67023844", "text": "add_block() {\n // Grabs the last block in the array, new block needs to be behind the last block\n var last_block = this.blocks.slice(-1)[0];\n // TODO: use variables and not an array\n var new_block_positions;\n // Switches over the last block's direction, sets the new block pos to behind the last block\n switch(last_block.direction) {\n case(directions.UP):\n new_block_positions = [last_block.x_position, last_block.y_position + block_to_block];\n break;\n case(directions.RIGHT):\n new_block_positions = [last_block.x_position + block_to_block, last_block.y_position];\n break;\n case(directions.DOWN):\n new_block_positions = [last_block.x_position, last_block.y_position - block_to_block];\n break;\n case(directions.LEFT):\n new_block_positions = [last_block.x_position - block_to_block, last_block.y_position];\n break;\n }\n // Adds the new block to the blocks array\n this.blocks.push(new block(new_block_positions[0], new_block_positions[1], last_block.direction));\n }", "title": "" }, { "docid": "24c51c4bb2788462da1398176b55aef3", "score": "0.6526417", "text": "function iterateBlock(type, xPosition, yPosition, dir, fn) {\n var hex, row = 0, col = 0, blocks = type.blocks[dir];\n for (hex = 0x8000; hex > 0; hex = hex >> 1) {\n if (blocks & hex) {\n fn(xPosition + col, yPosition + row);\n }\n if (++col === 4) {\n col = 0;\n ++row;\n }\n }\n}", "title": "" }, { "docid": "fb2a414a358e41a130a708a529ef0ed5", "score": "0.6462093", "text": "getLocations() {\n switch (this.rotation) {\n // returns the location of blocks according to rotation\n case 0:\n return [{x:this.x - 1, y:this.y}, {x:this.x, y:this.y},\n {x:this.x + 1, y:this.y}, {x:this.x, y:this.y - 1}];\n case 1:\n return [{x:this.x, y:this.y + 1}, {x:this.x, y:this.y},\n {x:this.x + 1, y:this.y}, {x:this.x, y:this.y - 1}];\n case 2:\n return [{x:this.x, y:this.y + 1}, {x:this.x - 1, y:this.y},\n {x:this.x, y:this.y}, {x:this.x + 1, y:this.y}];\n case 3:\n return [{x:this.x, y:this.y + 1}, {x:this.x - 1, y:this.y},\n {x:this.x, y:this.y}, {x:this.x, y:this.y - 1}];\n }\n }", "title": "" }, { "docid": "407ee2b147ec00b00bfb35f02ad10938", "score": "0.64485854", "text": "getLocations() {\n switch (this.rotation) {\n // returns the location of blocks according to rotation\n case 0:\n case 2:\n return [{x: this.x - 1, y: this.y}, {x: this.x, y: this.y},\n {x: this.x, y: this.y - 1}, {x: this.x + 1, y: this.y - 1}];\n case 1:\n case 3:\n return [{x: this.x + 1, y: this.y + 1}, {x: this.x, y: this.y},\n {x: this.x + 1, y: this.y}, {x: this.x, y: this.y - 1}];\n }\n }", "title": "" }, { "docid": "6b85b10ccd6c105c61af18cbfb71c26e", "score": "0.6436558", "text": "getLocations() {\n switch (this.rotation) {\n // returns the location of blocks according to rotation\n case 0:\n case 2:\n return [{x: this.x, y: this.y}, {x: this.x + 1, y: this.y},\n {x: this.x - 1, y: this.y - 1}, {x: this.x, y: this.y - 1}];\n case 1:\n case 3:\n return [{x: this.x, y: this.y + 1}, {x: this.x, y: this.y},\n {x: this.x + 1, y: this.y}, {x: this.x + 1, y: this.y - 1}];\n }\n }", "title": "" }, { "docid": "3b24c0c17e6df8187b2714bd9836c447", "score": "0.6422732", "text": "moveTo(x, y) {\n this.x = x;\n this.y = y;\n\n // move each block according to state\n let state = this.getState();\n\n state.offsets.forEach((offset, index) => {\n this.blocks[index].x = this.x + offset.x;\n this.blocks[index].y = this.y + offset.y;\n });\n }", "title": "" }, { "docid": "9797ac2991c5a3a11879dcc86b33bf54", "score": "0.64116895", "text": "getLocations() {\n switch (this.rotation) {\n // returns the location of blocks according to rotation\n case 0:\n case 2:\n return [{x: this.x - 2, y: this.y}, {x: this.x - 1, y: this.y},\n {x: this.x, y: this.y}, {x: this.x + 1, y: this.y}];\n case 1:\n case 3:\n return [{x: this.x, y: this.y + 2}, {x: this.x, y: this.y + 1},\n {x: this.x, y: this.y}, {x: this.x, y: this.y - 1}];\n }\n }", "title": "" }, { "docid": "a654986d52b8c04ece664513689dd192", "score": "0.63480705", "text": "function moveBlock(dir){\n\t\tvar blockCoords = Tetris.Model.getCurrentBlock().coords;\n\t\tif(dir == 'left' && _validMoveLeft(blockCoords)){\n\t\t\tfor(var i=0;i<blockCoords.length;i++){\n\t\t\t\tblockCoords[i].x--;\n\t\t\t}\n\t\t}else if(dir == 'right' && _validMoveRight(blockCoords)){\n\t\t\tfor(var i=0;i<blockCoords.length;i++){\n\t\t\t\tblockCoords[i].x++;\n\t\t\t}\n\t\t}else if(dir == 'down' && _validMoveDown(blockCoords)){\n\t\t\tfor(var i=0;i<blockCoords.length;i++){\n\t\t\t\tblockCoords[i].y--;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a4b5cd9c88c229f24c20303c82a7aee2", "score": "0.62893647", "text": "function relocateBlock(){\n const minx = 0;\n const maxx = 600;\n const xvalue = Math.random() * (maxx - minx) + minx;\n \n const miny = 0;\n const maxy = 300;\n const yvalue = Math.random() * (maxy - miny) + miny;\n \n block1.x = xvalue;\n block1.y = yvalue;\n }", "title": "" }, { "docid": "aaa4d1f630bb203111f9741758839b11", "score": "0.626357", "text": "function positionBlocks() {\n\t\t$(\".block\").each(function() {\n\t\t\tvar min = Array.min(blocks);\n\t\t\tvar index = $.inArray(min, blocks);\n\t\t\tvar leftPos = margin+(index*(colWidth+margin));\n\t\t\t$(this).css({\n\t\t\t\t\"left\":leftPos+\"px\",\n\t\t\t\t\"top\":min+\"px\"\n\t\t\t});\n\t\t\tblocks[index] = min+$(this).outerHeight()+margin;\n\t\t});\n\t}", "title": "" }, { "docid": "10fec003e494c39f1f54743419d74c1a", "score": "0.62328005", "text": "function Block(game){\n this.id = index ++\n this.getLeftPixels = ()=> {return this.horizontalPercent/100 * game.screenWidthPixels;}\n this.getTopPixels = ()=> {return this.verticalPercent/100 * game.screenHeightPixels;}\n this.width = GameSettings.blockWidth;\n this.height = GameSettings.blockHeight;\n\n this.verticalPercent = 2;\n this.horizontalPercent = 0;\n this.interval = null;\n this.isPlaced = false;\n this.moveDirection = Direction.none;\n this.layersOffset = 0; // this will be set by stacker.js \n\n\n this.getIntervalSeconds = ()=>{\n let positionChange = GameSettings.percentToIncrementBlockPosition/100;\n let time = game.getSecondsForBlockToCrossScreen();\n let result = time*positionChange\n return time*positionChange;\n }\n\n\n\n this.beginAnimation = () => {\n this.moveDirection = Direction.right;\n this.interval = setInterval(this.animation,this.getIntervalSeconds()*1000);\n } \n\n this.setBlockDown= ()=> {\n clearInterval(this.interval);\n this.moveDirection = Direction.down;\n this.interval = setInterval(this.animation, 10);\n }\n\n\n this.animation = ()=>{\n this.setMoveDirection();\n if(this.moveDirection === Direction.none)\n {\n this.placedBlock(); \n return;\n }\n if(this.moveDirection === Direction.left || this.moveDirection === Direction.right)\n {\n this.changeHorizontalPosition();\n }\n else{\n this.changeVerticalPosition();\n }\n\n this.onPositionChangedCallback();\n \n }\n\n\n\n this.changeHorizontalPosition = ()=>{\n let quality = 1;\n if(this.moveDirection === Direction.left){quality = -1;}\n this.horizontalPercent = this.horizontalPercent + GameSettings.percentToIncrementBlockPosition * quality;\n }\n\n this.changeVerticalPosition = ()=>{\n let quality = 1;\n if(this.moveDirection === Direction.up){quality = -1;}\n this.verticalPercent = this.verticalPercent + 1 * quality;\n }\n\n this.snapToGrid=(horizontalPercent)=>{\n this.horizontalPercent = horizontalPercent*100;\n this.onPositionChangedCallback();\n \n }\n\n\n\n this.setMoveDirection = ()=>{\n if(this.moveDirection === Direction.left && this.horizontalPercent<=0){\n this.moveDirection = Direction.right;\n }\n else if(this.moveDirection === Direction.right && this.horizontalPercent >= 100 - (this.width/GameSettings.screenWidthPixels)*100){\n this.moveDirection = Direction.left;\n }\n else if(this.moveDirection === Direction.up && this.verticalPercent <= 0){\n this.moveDirection = Direction.down;\n }\n else if(this.moveDirection === Direction.down\n && this.verticalPercent >= 100 - ((this.height + this.layersOffset)/GameSettings.screenHeightPixels)*100) {\n this.moveDirection = Direction.none; \n }\n }\n\n this.placedBlock = ()=>{\n this.isPlaced = true; \n clearInterval(this.interval);\n game.blockWasPlaced(this);\n this.snapToBottom();\n \n }\n\n\n this.snapToBottom=()=>{\n this.verticalPercent = 100 - ((this.height + this.layersOffset)/GameSettings.screenHeightPixels)*100;\n this.onPositionChangedCallback();\n }\n\n}", "title": "" }, { "docid": "e9be353a6e7ad411c0867048b745e6ef", "score": "0.62251866", "text": "function Block(x, y, z) {\n\n //Settings for block rendering\n\n /* WARNING: disabling linesEnabled will break chunk Loading\n * in current version\n */\n var linesEnabled = true;\n\n this.x = x;\n this.y = y;\n this.z = z;\n this.mesh;\n this.line;\n\n //Checks if there is a block in the given x/y/z co-ord\n this.getVoxel = function (x, y, z) {\n //Loop over every block\n for(var i = 0; i < chunks.length; i++) {\n for(var j = 0; j < chunks[i].length; i++) {\n //If the co-ords match\n if(chunks[i][j].x == x &&\n chunks[i][j].y == y &&\n chunks[i][j].z == z) {\n //Return true\n return true;\n\n }\n //Else false\n return false;\n }\n }\n }\n\n //Array to contain directions of covering blocks\n this.directions = [];\n //Function for filling the directions array\n this.adjustFaces = function() {\n //For each face of the block\n for(const {dir} of faces) {\n //Check if there is a block covering that face\n const neighbour = this.getVoxel(\n this.x + dir[0],\n this.y + dir[1],\n this.z + dir[2],\n );\n\n //If there is a block covering that face\n if(neighbour) {\n //Add the direction of the face to the directions array\n switch(dir[3]) {\n case \"right\":\n this.directions.push(\"right\");\n break;\n case \"left\":\n this.directions.push(\"left\");\n break;\n case \"top\":\n this.directions.push(\"top\");\n break;\n case \"bottom\":\n this.directions.push(\"bottm\");\n break;\n case \"front\":\n this.directions.push(\"front\");\n break;\n case \"back\":\n this.directions.push(\"back\");\n break;\n }\n }\n }\n }\n\n\n\n }", "title": "" }, { "docid": "c6d35ab518cceba42c41df3648d474cf", "score": "0.62179315", "text": "spawnBlocks() {\n let id = 0;\n for (let x = 0; x < 3; x++) {\n for (let y = 0; y < 3; y++) {\n const blockPosition = {\n x: (x * 48 + (x * 8)),\n y: (y * 48 + (y * 8))\n };\n const newBlock = new Block_1.default(this.canvas, id, blockPosition);\n this._blocks.push(newBlock);\n id++;\n }\n }\n }", "title": "" }, { "docid": "54b07b65304e03c3d10914818e9e86cd", "score": "0.6203774", "text": "function moveBlock() {\r\n var offset2 = $(\".blocks\").offset().top + $(\".blocks\").height();\r\n idInterv = setInterval(function() {\r\n sounddown.play();\r\n console.log($(\".blocks\").position())\r\n offset2 = $(\".blocks\").offset().top + $(\".blocks\").height();\r\n var pos = parseInt($(\".blocks\").css(\"top\")) + $(\".row:last-child\").height() + 10;\r\n if (offset2 >= $(\".fly\").offset().top - 68) {\r\n pos = parseInt($(\".fly\").offset().top) - parseInt($(\".blocks\").height()) - parseInt($(\".game\").offset().top) - 5;\r\n console.log(pos);\r\n\r\n flag = 0;\r\n clearInterval(idInterv);\r\n clearTimeout(idtime);\r\n loser();\r\n }\r\n $(\".blocks\").css(\"top\", pos + \"px\");\r\n if (flagDisplay == 1) {\r\n console.log(\"aaa\", flagDisplay);\r\n $(\".row:nth-child(1)\").removeClass(\"row-hidden\");\r\n }\r\n if (flagDisplay == 0) {\r\n console.log(\"www\", flagDisplay);\r\n $(\".row:nth-child(2)\").removeClass(\"row-hidden\");\r\n }\r\n flagDisplay++;\r\n //===============================================================\r\n }, levelmover);\r\n }", "title": "" }, { "docid": "eab9bdf668e26c83492fc8717d57547e", "score": "0.6169742", "text": "function Blocks() {\n this.x = 0; //позиция текущего блока по Х\n this.y = 0; //позиция текущего блока по У\n this.width = Core.Config.tileWidth; //ширина спрайта блока\n this.height = Core.Config.tileHeight; //высота спрайта блока\n this.centerX = this.width / 2; //центр блока по Х = ширина блока \\ 2\n this.centerY = this.height / 2; //центр блока по У = высота блока \\ 2\n this.brick = null; //спрайт с кирпичем\n this.forest = null; //спрайт с лесом\n this.steel = null; //спрайт со сталью\n this.water = null; //спрайт с водой\n return this;\n}", "title": "" }, { "docid": "2447f2de0df7e201abfbd38b9574f5be", "score": "0.61599284", "text": "function Block(left, top, right, bottom){\n this.left = left;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n //use parameters to calculate height and width\n this.width = right - left;\n this.height = bottom - top;\n}", "title": "" }, { "docid": "dc075a34efe55696b07d43c0998a0b80", "score": "0.61104745", "text": "function Block(type, x, y) {\n this.x = x;\n this.y = y;\n this.type = type;\n}", "title": "" }, { "docid": "7d94e0686917cd6103dbd4258aa6e23b", "score": "0.61059743", "text": "function Block() {\n this.width = 196;\n this.height = 30;\n this.padding = 2;\n this.position = {\n x: 0,\n y: 0\n };\n this.color = 'white'\n} // end Block object", "title": "" }, { "docid": "130873adfc873fe3a2b9c78135f4ee8f", "score": "0.6077102", "text": "function eachblock(type, x, y, dir, fn) {\n var bit, result, row = 0,\n col = 0,\n blocks = type.blocks[dir];\n for (bit = 0x8000; bit > 0; bit = bit >> 1) {\n if (blocks & bit) {\n fn(x + col, y + row);\n }\n if (++col === 4) {\n col = 0;\n ++row;\n }\n }\n }", "title": "" }, { "docid": "db3044439fd61e5a194969c2dc31e35c", "score": "0.6076703", "text": "function horisontalBlockMovement(blockPosition){ \n\twhichMap.mapGrid[player.row][blockPosition]= \"B\";\n\twhichMap.mapGrid[player.row][player.newcol]=\"P\";\n\twhichMap.mapGrid[player.row][player.col]=\" \";\n\tplayer.row=player.newrow;\n\tprintMap();\n}", "title": "" }, { "docid": "f4e39b4009ce26ce5837cfa1ddaa2909", "score": "0.6071477", "text": "function eachblock(type, x, y, dir, fn) {\n var bit, result, row = 0, col = 0, blocks = type.blocks[dir];\n for(bit = 0x8000 ; bit > 0 ; bit = bit >> 1) {\n if (blocks & bit) {\n fn(x + col, y + row);\n }\n if (++col === 4) {\n col = 0;\n ++row;\n }\n }\n}", "title": "" }, { "docid": "c64a0386d1856054ee13ae4773534df8", "score": "0.6051789", "text": "function BlockLine(startPos, direction, numOfBlocks, color){\n\n\tthis.numOfBlocks = numOfBlocks;\n\tthis.startPos= startPos;\n\n\t//Offset start position by block size as this is a cartesian coordinate.\n\tthis.startPos.x *= blockSize;\n\tthis.startPos.y *= blockSize;\n\n\tvar differX = false;\n\t\n\n\tif(direction.toLowerCase().includes(\"x\")){\n\n\t\tdifferX = true;\n\n\t}\n\n\t//Negative direction specified, correct.\n\tif(this.numOfBlocks < 0){\n\n\t\tconsole.log(\"BlockLine error: Negative number of blocks specified.\");\n\n\t}\n\n\tthis.blocks = new Array();\n\n\tfor(var i = 0; i < this.numOfBlocks; i++){\n\n\t\tthis.blocks.push(new Block(color));\n\n\n\t\tif(differX){\n\n\t\t\tthis.blocks[i].setPos(startPos.x + (i * this.blocks[i].width), startPos.y);\n\n\t\t}\n\t\telse{\n\n\t\t\tthis.blocks[i].setPos(startPos.x, startPos.y + (i * this.blocks[i].height));\n\n\n\t\t}\n\n\n\n\t}\n\n}", "title": "" }, { "docid": "4b382cfdc62483183ddd423612cd2c5e", "score": "0.6045918", "text": "function moveBlock(block) {\r\n\t\tif(changable(block)) { // if the tile is changable \r\n\t\t\tvar id = document.getElementById(block);\r\n\t\t\tvar newR = parseInt(id.style.top);\r\n\t\t\tvar newC = parseInt(id.style.left);\r\n\t\t\tid.id = \"tiles_\" + emptyC + \"_\" + emptyR;\r\n\t\t\tid.style.left = emptyC * pixel + \"px\"; // swap box cord with empty cord\r\n\t\t\tid.style.top = emptyR * pixel + \"px\";\r\n\t\t\temptyC = newC / 100; // update the empty coordinates\r\n\t\t\temptyR = newR / 100;\r\n\t\t\tnumOfMoves += 1;\r\n\t\t}\r\n \t}", "title": "" }, { "docid": "5a4c1b64cec0d456d9253c935d1af3cf", "score": "0.6030722", "text": "function verticalBlockMovement(blockPosition){\n\twhichMap.mapGrid[blockPosition][player.col]= \"B\";\n\twhichMap.mapGrid[player.newrow][player.col]=\"P\";\n\twhichMap.mapGrid[player.row][player.col]=\" \";\n\tplayer.row=player.newrow;\n\tprintMap();\n}", "title": "" }, { "docid": "b721e0cfd3ffc80598f2e3428aa01af3", "score": "0.6018304", "text": "function Block(parent, pos, w, h){\n this.pos = pos;\n this.w = w;\n this.h = h;\n this.lots = [];\n\n // outline the block\n var geo = new THREE.Geometry();\n geo.vertices.push(\n new THREE.Vector3(-w/2, 0, -h/2),\n new THREE.Vector3(w/2, 0, -h/2),\n new THREE.Vector3(w/2, 0, h/2),\n new THREE.Vector3(-w/2, 0, h/2),\n new THREE.Vector3(-w/2, 0, -h/2)\n );\n var mat = new THREE.LineBasicMaterial({color:0x0099ff});\n this.obj = new THREE.Line(geo, mat);\n this.obj.position.copy(pos);\n parent.add(this.obj);\n\n // TODO: come up with a recursive algorithm for splitting plots logically.\n // create lots\n var newW = w;\n var newH = h;\n if(Math.random() > 0.5){\n // split block vertically\n newW = w/2;\n this.lots.push(new Lot(this.obj, new THREE.Vector3(-newW/2, 5, 0), newW, newH, false));\n this.lots.push(new Lot(this.obj, new THREE.Vector3(newW/2, 5, 0), newW, newH, false));\n } else {\n // split block horizontally\n newH = h/2;\n this.lots.push(new Lot(this.obj, new THREE.Vector3(0, 5, -newH/2), newW, newH, true));\n this.lots.push(new Lot(this.obj, new THREE.Vector3(0, 5, newH/2), newW, newH, true));\n }\n\n this.update = function(){\n\n };\n}", "title": "" }, { "docid": "f9b845f8312bcd4b2cd27717eb6d732a", "score": "0.60024446", "text": "constructor(head_x, head_y, color, head_direction) {\n this.blocks = [new block(head_x, head_y, head_direction)];\n this.color = color;\n }", "title": "" }, { "docid": "f727f5a55a111025b260cdaac91c9ff1", "score": "0.5997985", "text": "addBlock(block, x, y){\n block.setPosition(x, y);\n this.blocks.push(block);\n return this;\n }", "title": "" }, { "docid": "92a447a3155fe027b2dadc259ba82c25", "score": "0.5975884", "text": "setPosition(direction,position){\n \n // this.body\n // position.row, position.column\n\n\n\n }", "title": "" }, { "docid": "73049f7788bdd2a479e41da735051ace", "score": "0.59557873", "text": "createBlock( x, y, type ) {\n // create the sprite\n var block = this.blocks.create( x, y, type );\n \n // enable physics\n game.physics.arcade.enable( block );\n block.anchor.setTo( 0.5, 0.5 );\n block.body.collideWorldBounds = true;\n block.body.immovable = true;\n block.body.allowGravity = false;\n \n return block;\n }", "title": "" }, { "docid": "bc1cfa7545805a5b5ebf4f94b254ddec", "score": "0.5920164", "text": "function block(width, height, depth) {\n \n //repeat settings for texture used for sides of blocks\n textures[5].wrapS = THREE.MirroredRepeatWrapping; \n textures[5].wrapT = THREE.MirroredRepeatWrapping; \n textures[5].repeat.set(2, 2);\n textures[5].needsUpdate = true;\n \n //setting up the array of textures used for creating a block\n var textureMaterial = [];\n \n textureMaterial[0] = new THREE.MeshToonMaterial({\n color: 0xce9777, side: THREE.DoubleSide, map: textures[4]});\n \n textureMaterial[1] = new THREE.MeshToonMaterial({\n color: 0xE2AB8C, side: THREE.DoubleSide, map: textures[5]});\n \n var stepGeom = new THREE.BoxGeometry(width,height,depth); \n \n //set side faces to be dirt/soil material \n TW.setMaterialForFaces(stepGeom, 0, 0,1,2,3, 8, 9, 10, 11); \n //set top and bottom faces to be terrain\n TW.setMaterialForFaces(stepGeom, 1, 4,5,6,7); \n \n var step = new THREE.Mesh(stepGeom, textureMaterial); \n \n return step;\n }", "title": "" }, { "docid": "425d448eeb8d201cec3d69782c981b39", "score": "0.5919742", "text": "function placeBlock(block) {\n var row = 0, col = 1;\n // Look at our rows array ~ find a place for our new block\n var blockSize = \"\";\n // Get the blocks size and pay attention to that\n if ($(block).data('size') != undefined) {\n blockSize = $(block).data('size').split('x');\n }\n if (blockSize == \"\") { blockSize = [1,1]; }\n var width = parseInt(blockSize[row]), height = parseInt(blockSize[col]);\n // if our width is wider than our number of columns then you must pair it down or it will go forever\n if (width > columnCount) { width = columnCount; }\n // Find a spot in the array\n var rowColumn = findPosition(width,height);\n if (rowColumn) {\n // Claim the spots if not false\n if (claimPosition(rowColumn[row],rowColumn[col],width,height)) {\n // Move the block to this location\n $(block).css('top', rowColumn[row] * actualBlockWidthHeight);\n $(block).css('left', rowColumn[col] * actualBlockWidthHeight);\n // Show the block\n $(block).css('display', 'block');\n }\n }\n}", "title": "" }, { "docid": "58b3c91fb7fdb7860c36067079fe89c0", "score": "0.59184146", "text": "function accessBlock() {\n\n if (debug) { console.log(\"accessBlock called from ID \" + this.id); }\n\n // this.id should have the form blockid###\n // so get chars from position 7 to end to simulate \"decrypting\" it\n var bID = Number(this.id.substring(7));\n if ( bID < 0 || bID >= numBlocks) { return; }\n var oldPosMapIndex = posMap[bID];\n\n highlightPath(oldPosMapIndex);\n readPath(oldPosMapIndex);\n updatePosMap(bID);\n writePath(oldPosMapIndex);\n\n setTimeout(clearHighlightedPaths, 1010);\n}", "title": "" }, { "docid": "355384a41bb8a7f56277e5486ca5376b", "score": "0.59146625", "text": "function placeBlock(block) {\n // ctx.drawImage(Resources.get(sprite), sx, sy, sw, sh, x, y, dw, dh);\n ctx.drawImage(Resources.get(`images/${selectedLevel}/level-sheet.png`), block[0] * 24, block[1] * 24, 24, 24 ,col * 24, row * 24, 24, 24);\n }", "title": "" }, { "docid": "96bf28924f62cab95fd62f3ad07e1394", "score": "0.5874604", "text": "function rotateBlock(obj, direction) {\r\n\t\tvar curClass = getCurBlockClass(obj);\r\n\t\tvar newClass = getNewBlockClass(direction, curClass);\r\n\t\tobj.attr(\"class\", \"active-block \" + newClass);\r\n\t}", "title": "" }, { "docid": "6c93e164de6e349c6d911c38497dae9e", "score": "0.58675355", "text": "function slide(tetro, block, dir){\n var new_x = tetro.cells[block][0] + move_offsets[dir][0];\n var new_y = tetro.cells[block][1] + move_offsets[dir][1];\n return [new_x,new_y];\n}", "title": "" }, { "docid": "bb7edb97d5c8354f7a4940f531a7528d", "score": "0.58658046", "text": "constructor(elem, startX, startY){\n\tthis.elem = elem;\n\tthis.x = startX;\n\tthis.y = startY;\n\n\t//a list of all the blocks on the screen\n\tthis.blocks = []\n\tfor (var i = 0; i < document.getElementsByClassName(\"block\").length; i++){\n\t this.blocks[i] = document.getElementsByClassName(\"block\")[i];\n\t}\n\n\n\t//0=right, 1=left\n\tthis.xDirection = 0;\n\n\t//0=down, 1=up\n\tthis.yDirection = 1;\n }", "title": "" }, { "docid": "eaeb734e148b3df16ad36c7aeff0ebad", "score": "0.5841497", "text": "handleBlock(e) {\n\t\t// Storing the coordinates of clicks within the canvas, relative to the canvas; not the whole DOM.\n\t\tlet clickCoordinates = {\n\t\t\tx: e.offsetX,\n\t\t\ty: e.offsetY\n\t\t};\n\n\t\t// Calculates which column and row of the clicked block.\n\t\tlet column = Math.floor(\n\t\t\tclickCoordinates.x /\n\t\t\t\t(this.display.ctx.canvas.width / this.display.block.width)\n\t\t);\n\t\tlet row = Math.floor(\n\t\t\tclickCoordinates.y /\n\t\t\t\t(this.display.ctx.canvas.height / this.display.block.height)\n\t\t);\n\n\t\t// -- Manipulation\n\n\t\t// 1. Copy of level data\n\t\tlet cloneMap = this.levelData.slice();\n\n\t\t// 2. Toggle between empty space and block\n\t\tif (cloneMap[row][column] === \"#\") {\n\t\t\tcloneMap[row][column] = \".\";\n\t\t} else if (cloneMap[row][column] === \".\") {\n\t\t\tcloneMap[row][column] = \"#\";\n\t\t}\n\n\t\t// 3. Set level data to updated level, and redraw.\n\t\tthis.levelData = cloneMap;\n\t}", "title": "" }, { "docid": "372065e04712117ce5cd0d9a23f16ff7", "score": "0.5813944", "text": "blocksTravelled(){\n let horizontalDistance = this.avenueToInteger(this.endingLocation.horizontal) - this.avenueToInteger(this.beginningLocation.horizontal)\n let verticalDistance = this.endingLocation.vertical - this.beginningLocation.vertical\n return (Math.abs(horizontalDistance) + Math.abs(verticalDistance))\n}", "title": "" }, { "docid": "9fddfb0696dea893f7fa70aed9860126", "score": "0.58102655", "text": "function arrangeBlocks(type, layout) {\n Blockly.Events.setGroup(true); // group these movements together\n // start arrangement\n var workspaceId = Blockly.mainWorkspace.id;\n Blockly.Events.fire(new AI.Events.StartArrangeBlocks(workspaceId));\n Blockly.workspace_arranged_type = type;\n Blockly.workspace_arranged_position = layout;\n Blockly.workspace_arranged_latest_position = layout;\n var event = new AI.Events.EndArrangeBlocks(workspaceId, type, layout);\n var SPACER = 25;\n var topblocks = Blockly.mainWorkspace.getTopBlocks(/* ordered */ false);\n // If the blocks are arranged by Category, sort the array\n if (Blockly.workspace_arranged_type === Blockly.BLKS_CATEGORY){\n topblocks.sort(sortByCategory);\n }\n var metrics = Blockly.mainWorkspace.getMetrics();\n var spacing = Blockly.mainWorkspace.options.gridOptions.spacing;\n var spacingInv = 1 / spacing;\n var snap = Blockly.mainWorkspace.options.gridOptions.snap ?\n function(x) { return (Math.ceil(x * spacingInv) - .5) * spacing; } : function(x) { return x; };\n var viewLeft = snap(metrics.viewLeft + 5);\n var viewTop = snap(metrics.viewTop + 5);\n var x = viewLeft;\n var y = viewTop;\n var wsRight = viewLeft + metrics.viewWidth / Blockly.mainWorkspace.scale;\n var wsBottom = viewTop + metrics.viewHeight / Blockly.mainWorkspace.scale;\n var maxHgt = 0;\n var maxWidth = 0;\n for (var i = 0, len = topblocks.length; i < len; i++) {\n var blk = topblocks[i];\n var blkXY = blk.getRelativeToSurfaceXY();\n var blockHW = blk.getHeightWidth();\n var blkHgt = blockHW.height;\n var blkWidth = blockHW.width;\n switch (layout) {\n case Blockly.BLKS_HORIZONTAL:\n if (x < wsRight) {\n blk.moveBy(x - blkXY.x, y - blkXY.y);\n blk.select();\n x = snap(x + blkWidth + SPACER);\n if (blkHgt > maxHgt) // Remember highest block\n maxHgt = blkHgt;\n } else {\n y = snap(y + maxHgt + SPACER);\n maxHgt = blkHgt;\n x = viewLeft;\n blk.moveBy(x - blkXY.x, y - blkXY.y);\n blk.select();\n x = snap(x + blkWidth + SPACER);\n }\n break;\n case Blockly.BLKS_VERTICAL:\n if (y < wsBottom) {\n blk.moveBy(x - blkXY.x, y - blkXY.y);\n blk.select();\n y = snap(y + blkHgt + SPACER);\n if (blkWidth > maxWidth) // Remember widest block\n maxWidth = blkWidth;\n } else {\n x = snap(x + maxWidth + SPACER);\n maxWidth = blkWidth;\n y = viewTop;\n blk.moveBy(x - blkXY.x, y - blkXY.y);\n blk.select();\n y = snap(y + blkHgt + SPACER);\n }\n break;\n }\n }\n Blockly.Events.fire(event); // end arrangement\n Blockly.Events.setGroup(false);\n setTimeout(function() {\n Blockly.workspace_arranged_type = type;\n Blockly.workspace_arranged_position = layout;\n Blockly.workspace_arranged_latest_position = layout;\n }); // need to run after all events have run\n }", "title": "" }, { "docid": "30a1ed06f4a590878bf7fa36620462c8", "score": "0.5809552", "text": "function calculateBlocks(box, step, blocksize, escape, depth){\n\tsize = box[3];\n\tstartx = box[0] - size/2;\n\tstarty = box[1] - size/2;\n\tstartz = box[2] - size/2;\n\tendx = box[0] + size/2\n\tendy = box[1] + size/2\n\tendz = box[2] + size/2\n\n\tvar drop = 0;\n\tvar blocks = [];\n\tvar point = new THREE.Vector3(0, 0, 0);\n\tfor(var x = startx; x <= endx; x+=step){\n\t for(var y = starty; y <= endy; y+=step){\n\t for(var z = startz; z <= endz; z+=step){\n\t point.set(x,y,z);\n\t if( test(point, escape, depth) ){\n\t blocks.push({x: x, y: y, z: z, vx:point.x,vy:point.y,vz:point.z});\n\t }\n\t }\n\t }\n\t}\n\n\treturn blocks;\n}", "title": "" }, { "docid": "a65377d98fdb6166508acc08dac9f97a", "score": "0.57928383", "text": "draw_blocks() {\n for (block in this.blocks) {\n this.blocks[block].draw_block(this.color);\n }\n }", "title": "" }, { "docid": "781ef0e248f943d1f3b8650a7e251507", "score": "0.57789135", "text": "placeBlocks() {\n\t\tlet current = this.array[0];\n\n\t\tcurrent.visited = true;\n\t\tthis.stack.push(current);\n\n\t\twhile (this.stack.length > 0) {\n\t\t\tconst next = current.checkNeighbors();\n\t\t\tif (next !== undefined) {\n\t\t\t\tcurrent.removeBlock();\n\t\t\t\tnext.visited = true;\n\t\t\t\tthis.stack.push(next);\n\t\t\t\tcurrent = next;\n\t\t\t} else {\n\t\t\t\tcurrent = this.stack.pop();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "512456c1ee4ab83604fc8cc72ec7d1e4", "score": "0.57724935", "text": "initBlocks() {\n const blockSize = this.level.getBlockSize();\n const gridSize = this.level.getGridSize();\n const blockScale = this.level.getBlockScale();\n\n this.blocks = this.game.add.group();\n\n for (let row = 0; row < gridSize; row += 1) {\n for (let col = 0; col < gridSize; col += 1) {\n const blockX = (col * (blockSize + this.PADDING));\n const blockY = (row * (blockSize + this.PADDING));\n\n const newBlock = this.game.add.sprite(blockX, blockY, 'blocks');\n newBlock.alpha = 0;\n\n // Fades in block randomly when added\n const fadeRandom = (1200 * Math.random()) + 400;\n setTimeout(() => {\n this.game.add.tween(newBlock).to({\n alpha: 1,\n }, 400, Phaser.Easing.Linear.None, true);\n const newRandPos = Math.floor(Math.random() * 6);\n newBlock.frame = newRandPos;\n\n // Will be level.getBlockSize / newBlock.width\n newBlock.scale.setTo(blockScale, blockScale);\n\n // Allows the block to listen to events\n newBlock.inputEnabled = true;\n newBlock.events.onInputDown.add(this.blockDown, this);\n this.blocks.add(newBlock);\n }, fadeRandom);\n }\n }\n }", "title": "" }, { "docid": "4e42212b223c052b095ebbb9c600da2b", "score": "0.57660097", "text": "function blockDraw() {\n for(var col=0; col<blockColumn; col++) {\n for(var row=0; row<blockRow; row++) \n { if(blocks[col][row].status == 1 ) //if status is 1 draw blocks if 0 then the block has collided with an object\n {\n var blockX = (col*(blockW + blockPadding)) + offsetLeft;\n var blockY = (row*(blockH + blockPadding)) + offsetTop;\n blocks[col][row].xPos = blockX;\n blocks[col][row].yPos = blockY;\n ctx.beginPath();\n ctx.rect(blockX, blockY, blockW, blockH);\n ctx.fillStyle = 'hsl(' + 360 * Math.random() + ', 70%, 50%)'; \n ctx.fill()\n ctx.stroke();\n ctx.closePath();\n }\n }\n }\n}", "title": "" }, { "docid": "c2af29652a0563efbe3cf67ec21e88b4", "score": "0.575775", "text": "function slide(tetro, block,dir){\n var new_x = tetro.cells[block][0] + move_offsets[dir][0];\n var new_y = tetro.cells[block][1] + move_offsets[dir][1];\n return [new_x,new_y];\n}", "title": "" }, { "docid": "249e41688304b6bd88d21e8c23da7260", "score": "0.57496196", "text": "function createBlocks(){\n\tif (roomNum == 1){\n//top row of blocks\n\t\tfor (i = 0; i < canvas.width; i += spriteSizes){\n\t\t\tblocks.push({\n\t\t\tx: i,\n\t\t\ty: spriteSizes,\n\t\t\twidth: spriteSizes,\n\t\t\theight: spriteSizes\n\t\t\t},\n//bottom row of blocks\n\t\t\t{\n\t\t\tx: i,\n\t\t\ty: canvas.height - (spriteSizes - 1),\n\t\t\twidth: spriteSizes,\n\t\t\theight: spriteSizes\n\t\t\t});\n\t\t}\n//left row of blocks\n\t\tfor (i = spriteSizes; i < canvas.height; i += spriteSizes){\n\t\t\tblocks.push({\n\t\t\tx: 0,\n\t\t\ty: i,\n\t\t\twidth: spriteSizes,\n\t\t\theight: spriteSizes\n\t\t\t},\n//right row of blocks\n\t\t\t{\n\t\t\tx: canvas.width - spriteSizes,\n\t\t\ty: i,\n\t\t\twidth: spriteSizes,\n\t\t\theight: spriteSizes\n\t\t\t});\n\t\t}\t\t\n//random blocks\n\t\tfor (i = 0; i < canvas.width / spriteSizes; i++){\n\t\t\tif (i > 2 && (i < 11 || i > 15) && i < 24){\n\t\t\t\tblocks.push({\n\t\t\t\t\tx: spriteSizes * i,\n\t\t\t\t\ty: spriteSizes * 5,\n\t\t\t\t\twidth: spriteSizes,\n\t\t\t\t\theight: spriteSizes\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (i > 6 && i < 22){\n\t\t\t\tblocks.push({\n\t\t\t\t\tx: spriteSizes * i,\n\t\t\t\t\ty: spriteSizes * 9,\n\t\t\t\t\twidth: spriteSizes,\n\t\t\t\t\theight: spriteSizes\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bbbc414bef8e2427239dc72fc745c948", "score": "0.57438827", "text": "reorderPositionMember(pos) {\n let orderObject = 0;\n let hBeforeElements = 42;\n const marginTop = 3;\n\n // Get child of boundary\n if (!pos) {\n pos = { x: this.x, y: this.y };\n }\n\n this.member.forEach(mem => {\n if (mem.show) {\n const { height } = this.objectUtils.getBBoxObject(`#${mem.id}`);\n\n // Vertex position center of boundary\n let position = { x: pos.x + 5, y: pos.y + hBeforeElements + marginTop * orderObject };\n let memObj = {};\n if (mem.type === OBJECT_TYPE.VERTEX) {\n memObj = _.find(this.dataContainer.vertex, { \"id\": mem.id });\n } else {\n memObj = _.find(this.dataContainer.boundary, { \"id\": mem.id });\n }\n memObj.setPosition(position);\n\n orderObject++;\n hBeforeElements += height;\n }\n });\n }", "title": "" }, { "docid": "87e8008d0e8f157e8cc6031db3bb2bad", "score": "0.5721693", "text": "constructor() {\n /**\n * An array of block ids for blocks that are not deletable. Or undefined\n * if there are no not-deletable blocks.\n * @type {(!Array<string>|undefined)}\n */\n this.notDeletable;\n\n /**\n * An array of block ids for blocks that are not movable. Or undefined\n * if there are no not-movable blocks.\n * @type {(!Array<string>|undefined)}\n */\n this.notMovable;\n\n /**\n * An array of block ids for blocks that are not editable. Or undefined\n * if there are no not-editable blocks.\n * @type {(!Array<string>|undefined)}\n */\n this.notEditable;\n }", "title": "" }, { "docid": "4dada40581f67c43e7eedb501705f896", "score": "0.5720716", "text": "constructor(generator /*: groupElement */, direction /*: direction */, nesting_level /*: number */) {\n super(generator, direction, nesting_level);\n\n // calculate position transform as a function of angle theta for every direction\n const positions = [\n (r, theta) => new THREE.Vector3(0, 0.5 - r*Math.cos(theta), 0.5 - r*Math.sin(theta)), // YZ\n (r, theta) => new THREE.Vector3(0.5 + r*Math.sin(theta), 0, 0.5 - r*Math.cos(theta)), // XZ\n (r, theta) => new THREE.Vector3(0.5 + r*Math.sin(theta), 0.5 - r*Math.cos(theta), 0), // XY\n ];\n this.position = (r, theta) => positions[direction](r, theta);\n }", "title": "" }, { "docid": "4fb28d39f82d6eb095da2225b803a938", "score": "0.5708925", "text": "checkDirection(){\n this.group.getChildren().forEach(function (child){\n if (child.body.blocked.left){\n child.setVelocity(100, 0);\n }\n if (child.body.blocked.right){\n child.setVelocity(-100, 0);\n }\n });\n }", "title": "" }, { "docid": "ee89fa5fa861e52b47d7baab05cabb3f", "score": "0.57063824", "text": "_blockEdges() {\n let i=0, j=0;\n // horizontal edges; top and bottom\n for(i; i<this.height; i++) {\n this.maze[0][i].top = false;\n this.maze[this.width-1][i].bottom = false;\n }\n // vertical edges; left and right\n for(j=0; j<this.width; j++) {\n this.maze[j][0].left = false;\n this.maze[j][this.height-1].right = false;\n }\n }", "title": "" }, { "docid": "124a491dce985ed74141496905470d94", "score": "0.57044905", "text": "function _createLevelBlock(){\n var index = 1;\n // cycle through each row and column\n for (var j=0; j<this.options.column; j++){\n for (var i=0; i < this.options.row; i++){\n // placement of the square is determined by \n var modifier = new Modifier({\n size: [this.options.boxSize, this.options.boxSize],\n origin: [(1/(this.options.row+1))*(i+1), (1/(this.options.column+2))*(j+2)],\n align: [ 0.5, 0.5]\n });\n \n var surface = new Surface({\n content: index,\n properties: {\n border: '3px solid #738F99',\n borderRadius: '7px',\n textAlign: 'center',\n lineHeight: this.options.lineHeight,\n fontFamily: 'HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif',\n fontSize: this.options.boxFontSize,\n backgroundColor: '#34A4CC',\n color: 'white',\n cursor: 'pointer'\n }\n });\n\n this.levelSurfaces.push(surface);\n // if local storage for the level is set to 1, use black font\n if (this.localStorage && this.localStorage[index-1] === '1') surface.setProperties({color: 'black'});\n \n // on set listners on surface and bind with index, which represent the level\n surface.on('click', function(index){\n var levelPackage = {level: Levels.levels[index-1], levelNum: index-1};\n this.emit('startGameToL', levelPackage);\n }.bind(surface, index));\n \n // pipe surface to the view\n surface.pipe(this);\n\n this.node.add(modifier).add(surface);\n index ++;\n }\n }\n }", "title": "" }, { "docid": "53dcf302f3991a76626f075c2dfa4550", "score": "0.569938", "text": "function rotate3Times(blockStyle, block)\t//\trota 3 veces e inserta en estilos de bloque\n{\n\tfor(var i = 0 ; i < 3; i++) {\n\t\t//rotate 90 degree clockwise, (X, Y) ==> (-Y, X) \n\t\tfor(var j = 0 ; j < block.length; j++) {\n\t\t\tvar tmpX = block[j].x;\n\t\t\tblock[j].x = -block[j].y;\n\t\t\tblock[j].y = tmpX;\n\t\t}\n\t\tblockNormalization(block);\n\t\tif(!addBlock2BlockStyle(blockStyle,block)) break;\n\t}\n}", "title": "" }, { "docid": "c4af718351f198f3c22dacaac9680715", "score": "0.5687761", "text": "function push_ladder(block, vertices, world, lightmap, x, y, z) {\n\n if(typeof block == 'undefined') {\n return;\n }\n\n const cardinal_direction = BLOCK.getCardinalDirection(block.rotate).z;\n\n var texture = BLOCK[block.name].texture;\n var blockLit = true; // z >= lightmap[x][y];\n var bH = 1.0;\n var width = block.width ? block.width : 1;\n var lm = MULTIPLY.COLOR.WHITE;\n var c = calcTexture(texture(world, lightmap, blockLit, x, y, z, DIRECTION.FORWARD));\n\n switch(cardinal_direction) {\n case ROTATE.S: {\n // Front\n var n = NORMALS.FORWARD;\n pushQuad(\n vertices,\n [x, z + 1 - width, y, c[0], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1, z + 1 - width, y, c[2], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1, z + 1 - width, y + bH, c[2], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x, z + 1 - width, y + bH, c[0], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z]\n );\n break;\n }\n case ROTATE.W: {\n // Left\n var n = NORMALS.LEFT;\n pushQuad(\n vertices,\n [x + 1 - width, z, y + bH, c[2], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1 - width, z + 1.0, y + bH, c[0], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1 - width, z + 1.0, y, c[0], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1 - width, z, y, c[2], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z]\n );\n break;\n }\n case ROTATE.N: {\n // Back\n var n = NORMALS.BACK;\n pushQuad(\n vertices,\n [x, z + width, y + bH, c[2], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1.0, z + width, y + bH, c[0], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1.0, z + width, y, c[0], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x, z + width, y, c[2], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z]\n );\n break;\n }\n case ROTATE.E: {\n // Right\n var n = NORMALS.RIGHT;\n pushQuad(\n vertices,\n [x + 1.0 - 1 + width, z, y, c[0], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1.0 - 1 + width, z + 1.0, y, c[2], c[3], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1.0 - 1 + width, z + 1.0, y + bH, c[2], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z],\n [x + 1.0 - 1 + width, z, y + bH, c[0], c[1], lm.r, lm.g, lm.b, lm.a, n.x, n.y, n.z]\n );\n break;\n }\n }\n\n}", "title": "" }, { "docid": "ccb87bb5a40edb88c684472a22f57a60", "score": "0.56752795", "text": "function check_block () {\n //deletes the element but not the object on screen\n current_block.del();\n if (current_block.x > 0) {\n let object = null, place = null;\n //finds objects it can connect to\n items.forEach((a, i) => {\n if (a != null && object == null) {\n if (current_block.y < a.get_top_y() && current_block.y > a.get_top_y() - 10) {\n object = a;\n place = \"top\";\n console.log(\"add top\");\n } else if (current_block.y > a.get_bottom_y() && current_block.y < a.get_bottom_y() + 10) {\n object = a;\n place = \"bottom\";\n console.log(\"add bottom\");\n } else if (current_block.y >= a.get_top_y() && current_block.y <= a.get_bottom_y()) {\n object = a;\n place = \"bottom\";\n console.log(\"add below\")\n }\n }\n });\n\n if (object == null) {\n //didn't find a place to connect then add to the last position\n if (items.length == 0) {\n //make the first element of page\n console.log(\"make new\");\n counter += 1;\n arr[counter] = page_item(0, counter, current_block.type, 10);\n items[0] = arr[counter];\n arr[counter].set_dom();\n } else {\n //add the new element to the last position\n console.log(\"add last\");\n counter += 1;\n arr[counter] = page_item(items.length, counter, current_block.type, items[items.length - 1].get_bottom_y() + 10);\n items[items.length] = arr[counter];\n arr[counter].set_dom();\n }\n } else {\n //found an object to connect to\n counter += 1;\n if (place == \"top\") {\n //insert into current object position and move down all the blocks below it\n console.log(\"add above \" + object);\n arr[counter] = page_item(object.index, counter, current_block.type, object.get_top_y());\n arr[counter].set_dom();\n items.splice(object.index, 0, arr[counter]);\n console.log(items);\n for (let i = object.index + 1; i < items.length; i++) {\n items[i].index += 1;\n items[i].y += object.get_height() + 10;\n items[i].render();\n }\n } else {\n //insert below current object and move all elements below it down\n console.log(\"add below \"+ object);\n arr[counter] = page_item(object.index + 1, counter, current_block.type, object.get_bottom_y() + 10);\n arr[counter].set_dom();\n items.splice(object.index + 1, 0, arr[counter]);\n for (let i = object.index + 2; i < items.length; i++) {\n items[i].index += 1;\n items[i].y += arr[counter].get_height() + 10;\n items[i].render();\n }\n }\n }\n }\n current_block = null;\n}", "title": "" }, { "docid": "de8fba5cb0e1f90be9bfb656b862bc97", "score": "0.5669362", "text": "function MorphTargetsBlock(name) {\n var _this = _super.call(this, name, NodeMaterialBlockTargets.Vertex) || this;\n _this.registerInput(\"position\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerInput(\"tangent\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerInput(\"uv\", NodeMaterialBlockConnectionPointTypes.Vector2);\n _this.registerOutput(\"positionOutput\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerOutput(\"normalOutput\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerOutput(\"tangentOutput\", NodeMaterialBlockConnectionPointTypes.Vector3);\n _this.registerOutput(\"uvOutput\", NodeMaterialBlockConnectionPointTypes.Vector2);\n return _this;\n }", "title": "" }, { "docid": "6279b262352921ada044d0275f74a5e5", "score": "0.5659619", "text": "sortAllBlocks() {\n this.allBlocks.sort((a, b) => {\n return b.surface - a.surface\n })\n }", "title": "" }, { "docid": "accad368caebd6abf13e455f7ad0966f", "score": "0.56497324", "text": "function Block(type, state){\n var countdownFactor = 6;\n\n //string describing the content of the block\n this.type = type;\n //number of drills until the block is destroyed\n //if the block is a durable block\n this.health= 3;\n\n if (state === undefined) {\n state = \"stationary\";\n }\n this.state = state;\n this.countdown = countdownFactor;\n\n // Pixel offsets used for animations\n this.xOffset = 0;\n this.yOffset = 0;\n\n this.changeState = function (newState) {\n if (newState === \"shaking\") {\n this.countdown = countdownFactor + 2;\n } else {\n this.countdown = countdownFactor;\n }\n this.state = newState;\n }\n}", "title": "" }, { "docid": "8f12756ae613ed4bebabec420970ea4a", "score": "0.56378233", "text": "function collideBlock(rect) {\n rect.hittingGround = 0\n for (i = 0; i < blocks.length; i++) {\n var cx = blocks[i].x + blocks[i].width * 0.5;\n var cy = blocks[i].y + blocks[i].height * 0.5;\n var rectCx = rect.x + rect.width * 0.5;\n var rectCy = rect.y + rect.height * 0.5;\n\n var dx = rectCx - cx;// x difference between centers\n var dy = rectCy - cy;// y difference between centers\n var aw = (rect.width + blocks[i].width) * 0.5;// average width\n var ah = (rect.height + blocks[i].height) * 0.5;// average height\n\n\n if (Math.abs(dx) > aw || Math.abs(dy) > ah) {\n continue\n }\n\n if (Math.abs(dx / blocks[i].width) > Math.abs(dy / blocks[i].height)) {\n\n if (dx < 0) {\n rect.x = blocks[i].x - rect.width;// left\n continue\n }\n else {\n rect.x = blocks[i].x + blocks[i].width; // right\n continue\n }\n\n } else {\n\n if (dy < 0) {\n rect.y = blocks[i].y - rect.height; // top\n if (rect.velY > 0) {\n rect.velY = 0;\n }\n rect.hittingGround = 1;\n continue\n }\n else {\n rect.y = blocks[i].y + blocks[i].height; // bottom\n if (rect.velY < -0.5) {\n rect.velY = -0.5;\n }\n continue\n }\n\n }\n }\n}", "title": "" }, { "docid": "8f2c75fbc711e96151ec41e5b2eac76c", "score": "0.56351584", "text": "function createBlock() {\n var sylArray = drawSyl().sylBlocks;\n var OccupiedArray = drawSyl().sylOccupied;\n for (var i = 0; i < column; i++) {\n blocks[i] = [];\n for (var j = 0; j < row; j++) {\n if (OccupiedArray[i][j]) {\n blocks[i][j] = createDiv(sylArray[i][j]);\n blocks[i][j].style('height', blockSize + 'px');\n blocks[i][j].style('width', blockSize + 'px');\n blockPos.x = blockSize * i + (windowWidth - blockSize * column) / 2;\n blockPos.y = blockSize * j + 100;\n blocks[i][j].position(blockPos.x, blockPos.y);\n blocks[i][j].style('background', 'pink');\n blocks[i][j].style('font-family', 'Monospace');\n blocks[i][j].style('font-size', '4em');\n blocks[i][j].style('text-align', 'center');\n }\n }\n }\n}", "title": "" }, { "docid": "f4143d7f1efcb819ad9209ab3b18ee8e", "score": "0.5631055", "text": "function addPipeBlock(x, y) {\n // make a new pipe block\n var block = game.add.sprite(x,y,\"pipe\");\n // insert it in the pipe array\n pipes.push(block);\n // enable physics engine for the block\n game.physics.arcade.enable(block);\n // set the block's horizontal velocity to a negative value\n // (negative x value for velocity means movement will be towards left)\n block.body.velocity.x = -800;\n}", "title": "" }, { "docid": "5da313e3dd202100c29054f2882b0669", "score": "0.56273735", "text": "renderFrom(childIndex) {\n //console.log(`DEBUG::: Render {${this.blockInfo.name}} from index ${childIndex}`);\n\n let blockWidth = this.getChildAt(0).width;\n let blockHeight = this.getChildAt(0).height;\n let lineStartPosition = new PIXI.Point(blockWidth, blockHeight/2 - (LINE_STYLE.width + LINE_STYLE.spacing)*this.childBlocks.length/2 + childIndex*(LINE_STYLE.width + LINE_STYLE.spacing));\n let childBlockPosition = new PIXI.Point(blockWidth + BLOCK_MARGIN.width, 0);\n\n if (childIndex != 0) {\n let previousHeight = this.childBlocks[childIndex-1].y + this.childBlocks[childIndex-1].height + BLOCK_MARGIN.height;\n childBlockPosition.y = previousHeight;\n }\n\n if (childIndex < this.lines.length) {\n for (let i=childIndex;i<this.lines.length;i++) {\n this.removeChild(this.lines[i]);\n }\n }\n\n // for each parameter/branch, draw line and place block\n for (let i=childIndex;i < this.parameterBlocks.length; i++) {\n // set line end position and draw line\n let lineEndPosition = new PIXI.Point(childBlockPosition.x, childBlockPosition.y + blockHeight/2);\n if (i==0) { // for case 0, make line straight\n lineEndPosition.y = lineStartPosition.y;\n }\n let curve = drawBezierCurve(lineStartPosition,lineEndPosition);\n this.addChild(curve);\n this.lines[i] = curve;\n\n // parameter block: set position\n this.parameterBlocks[i].visible = true;\n this.parameterBlocks[i].position = childBlockPosition.clone();\n let lastChildHeight = this.parameterBlocks[i].height;\n\n // child block: set position, make corresponding parameterBlock invisible\n if (this.childBlocks[i] != null) {\n this.childBlocks[i].visible = true;\n this.childBlocks[i].position = childBlockPosition.clone();\n lastChildHeight = this.childBlocks[i].height;\n this.parameterBlocks[i].visible = false;\n }\n\n // increment height of lineStartPositon and childBlockPosition\n lineStartPosition.y += LINE_STYLE.width + LINE_STYLE.spacing;\n childBlockPosition.y += BLOCK_MARGIN.height + lastChildHeight;\n }\n\n function drawBezierCurve(startPosition,endPosition) {\n let curve = new PIXI.Graphics().lineStyle(LINE_STYLE.width,LINE_STYLE.color);\n\n let lineWidth = endPosition.x - startPosition.x;\n let lineHeight = endPosition.y - startPosition.y;\n let midPosition = new PIXI.Point(startPosition.x + lineWidth/2, startPosition.y + lineHeight/2);\n\n curve.moveTo(startPosition.x, startPosition.y);\n curve.bezierCurveTo(\n startPosition.x + LINE_STYLE.bezierHScale*lineWidth,\n startPosition.y,\n midPosition.x,\n midPosition.y - LINE_STYLE.bezierVScale*lineHeight,\n midPosition.x,\n midPosition.y);\n curve.bezierCurveTo(\n midPosition.x,\n midPosition.y + LINE_STYLE.bezierVScale*lineHeight,\n endPosition.x - LINE_STYLE.bezierHScale*lineWidth,\n endPosition.y,\n endPosition.x,\n endPosition.y);\n return curve;\n }\n }", "title": "" }, { "docid": "7e85186077e36002f218793743590691", "score": "0.5626396", "text": "function MoveRight (){\r\n\tvar move = 0;\r\n\tBlockArr.sort(function(a, b){return a.XLoc - b.XLoc});\r\n\tClosestBlock(\"right\");\r\n\r\n\tfor (var i = 0; i < EdgeCheck.length; i++){\r\n\t\tif ((EdgeCheck[i].YLoc + 1) < width){\r\n\t\t\tif(document.getElementById(cellId(EdgeCheck[i].XLoc, EdgeCheck[i].YLoc + 1)).innerHTML != ''){\r\n\t\t\t\tmove = 1;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmove = 1;\r\n\t\t\tbreak;\r\n\t\t} \r\n\t}\r\n\r\n\tif(move == 0){\r\n\t\tBlockArr.sort(function(a, b){return b.YLoc - a.YLoc});\r\n\t\tfor (var i = 0; i < BlockArr.length; i++){\r\n\t\t\tBlockArr[i].Prev = BlockArr[i].XLoc + \":\" + BlockArr[i].YLoc;\r\n\t\t\tBlockArr[i].YLoc += 1;\r\n\t\t\tBlockArr[i].update();\r\n\t\t}\r\n\t\tBlockOrginY += 1;\r\n\t}\r\n}", "title": "" }, { "docid": "b889e9ab50ba41c65bd002ff59edfdad", "score": "0.5625521", "text": "getBlock(x = this.currentPosition.x, y = this.currentPosition.y) {\n for (let i in this.groups) {\n let group = this.groups[i];\n for (let j in group.blocks) {\n let block = group.blocks[j];\n if (block.x == x && block.y == y)\n return block;\n }\n }\n }", "title": "" }, { "docid": "2ea45dd9fcdec3c4a90adcf303be1cf9", "score": "0.56253064", "text": "function moveBlocks() {\n let partitionBlocks = document.querySelectorAll('.partition-block');\n partitionBlocks.forEach((e) => {\n if(e.y> 615 ){\n e.y -= 700;\n }\n // console.log(e.style.top)\n e.y += BACKGROUNDSPEED;\n e.style.top = e.y+\"px\"\n // console.log(5+ parseInt(e.style.top))\n // console.log(parseInt(e.style.top))\n })\n\n}", "title": "" }, { "docid": "4c7983efe314a0fc9913b5c2a8ef5faf", "score": "0.56230396", "text": "function GameBlock(xSize, ySize, xLoc, yLoc, color) {\n this.xSize = xSize;\n this.ySize = ySize,\n this.xLoc = xLoc;\n this.yLoc = yLoc;\n this.color = color;\n this.isValid\n\n this.updateLocation = function (xChange, yChange) {\n this.xLoc = this.xLoc + xChange;\n this.yLoc = this.yLoc + yChange;\n }\n\n this.checkCollision = function (block) {\n if (this.checkAxisCollision(this.xLoc, block.xLoc) && this.checkAxisCollision(this.yLoc, block.yLoc)) {\n return true;\n }\n else {\n return false;\n }\n }\n\n this.checkAxisCollision = function (point1, point2) {\n if (point1 - point2 > (-blockWidth * .25) && point1 - point2 < (blockWidth * .25)) {\n return true;\n }\n }\n}", "title": "" }, { "docid": "6693a870af0adc1689ebe6877b081607", "score": "0.561075", "text": "function moveBlock(elem, blockparent, type){\n elem.detach();\n if (blockparent) {\n elem.appendTo(blockparent);\n elem.removeClass('hidden');\n\n // add a moved-block style to your debug.css to see which blocks are moved.\n // ex, .moved-block { border:solid 1px red; }\n elem.addClass('moved-block')\n }\n }", "title": "" }, { "docid": "500b5341262f8a0f08b36f1d86a44f80", "score": "0.560612", "text": "function MoveLeft (){\r\n\tvar move = 0;\r\n\tBlockArr.sort(function(a, b){return a.XLoc - b.XLoc});\r\n\tClosestBlock(\"left\");\r\n\r\n\tfor (var i = 0; i < EdgeCheck.length; i++){\r\n\t\tif ((EdgeCheck[i].YLoc - 1) > 0){\r\n\t\t\tif(document.getElementById(cellId(EdgeCheck[i].XLoc, EdgeCheck[i].YLoc - 1)).innerHTML != ''){\r\n\t\t\t\tmove = 1;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmove = 1;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(move == 0){\r\n\t\tBlockArr.sort(function(a, b){return a.YLoc - b.YLoc});\r\n\t\tfor (var i = 0; i < BlockArr.length; i++){\r\n\t\t\tBlockArr[i].Prev = BlockArr[i].XLoc + \":\" + BlockArr[i].YLoc;\r\n\t\t\tBlockArr[i].YLoc -= 1;\r\n\t\t\tBlockArr[i].update();\r\n\t\t}\r\n\t\tBlockOrginY -= 1;\r\n\t}\r\n}", "title": "" }, { "docid": "a411015ce781147f62a947071a9676dc", "score": "0.56018", "text": "function Block(column, row, color) {\n\tthis.color = color;\n\tthis.x = column * blockDimension.width;\n\tthis.y = row * blockDimension.height;\n\tthis.isInside = blockCheckInside;\n\tblockList[blockList.length] = this;\n}", "title": "" }, { "docid": "9b9792cfc53661aad034d74693d374f9", "score": "0.56016415", "text": "function newBlock() {\r\n\tif (block1 == -1 && block2 == -1 && color == -1) {\r\n\t\tvar rng = Math.floor((Math.random() * 7) + 1);\r\n\t\tcolor = rng;\r\n\t\tblock1 = rng;\r\n\t\trng = Math.floor((Math.random() * 7) + 1);\r\n\t\tblock2 = rng;\r\n\t}\r\n\tvar bool = true;\r\n\tfor (var y = 0; y < 23; y++) {\t\r\n\t\tfor (var x = 0; x < 10; x++) {\r\n\t\t\tif (grid[x][y] == 1) {\r\n\t\t\t\tbool = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (bool) {\r\n\t\tblockInfo(block1, 0, -1, 0, 0);\r\n\t\tvar rng = Math.floor((Math.random() * 7) + 1);\r\n\t\tblock1 = block2\r\n\t\tblock2 = rng;\r\n\t}\r\n}", "title": "" }, { "docid": "6fae12c1eeca5c8d0dadebc045776a97", "score": "0.5586911", "text": "function moveMe(direction){\n\tdeleteFigure(a);\n\t\t\n\tswitch(direction){\n\t\tcase 'l':\t\t\t// move block left\n\t\t\tif(collisionDetectionOnMove(a, -1, 0)){\n\t\t\t\tfigurePosX--;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'r':\t\t\t// move block right\n\t\t\tif(collisionDetectionOnMove(a, 1, 0)){\n\t\t\t\tfigurePosX++;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'd':\t\t\t// move block down\n\t\t\tif(collisionDetectionOnMove(a, 0, 1)){\n\t\t\t\tfigurePosY++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// TESTING\n\t\t\t\tif (firstCollision) {\n\t\t\t\t\tnewFigure = true;\n\t\t\t\t\tcheckRows = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tfirstCollision = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'x':\t\t\t// makes block fall basically\n\t\t\tif(collisionDetectionOnMove(a, 0, 1)){\n\t\t\t\tfigurePosY++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnewFigure = true;\n\t\t\t\tcheckRows = true;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'z':\t\t\t// rotate left\n\t\t\tif (figureType == 1)\n\t\t\t\tbreak;\n\t\t\tfigureRotateLeft();\n\t\t\tif (collisionDetectionOnRotate(a)){\n\t\t\t\tcopyFigure();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'c':\t\t\t// rotate right\n\t\t\tif (figureType == 1)\n\t\t\t\tbreak;\n\t\t\tfigureRotateRight();\n\t\t\tif (collisionDetectionOnRotate(a)){\n\t\t\t\tcopyFigure();\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\twriteFigure(a);\n\tdraw();\n}", "title": "" }, { "docid": "1a63fa27985bc13867b1e284a579eba2", "score": "0.5581794", "text": "function verifCurrentBlock(c_posX, c_posY){\n\tblockNumX = -1;\n\tblockNumY = -1;\n\thit = false;\n\n\tif (c_posY > 30 && c_posY < 61 + c_radius){\n \tblockNumY = 1;\n \thit = true;\n \tif(speedChanged == 3){\n \t\tsetSpeed(1.4);\n \t\tspeedChanged++;\n \t\tsetSpeedboard(c_speed++);\n \t\tp_width = p_width - 7;\n \t} \t\n } else if (c_posY > 60 && c_posY < 91 + c_radius){\n \tblockNumY = 2;\n \thit = true; \n \tif(speedChanged == 2){\n \t\tsetSpeed(1.3);\n \t\tspeedChanged++;\t\n \t\tsetSpeedboard(c_speed++);\n \t\tp_width = p_width - 7;\n \t} \t\n } else if (c_posY > 90 && c_posY < 121 + c_radius){\n \tblockNumY = 3;\n \thit = true;\n \tif(speedChanged == 1){\n \t\tsetSpeed(1.2);\n \t\tspeedChanged++;\t\n \t\tsetSpeedboard(c_speed++);\n \t\tp_width = p_width - 5;\n \t} \t\n }else if (c_posY > 120 && c_posY < 151 + c_radius){\n \tblockNumY = 4;\n \thit = true;\n \tif(speedChanged == 0){\n \t\tsetSpeed(1.1);\n \t\tspeedChanged++;\t\n \t\tsetSpeedboard(c_speed++);\n \t\tp_width = p_width - 5;\n \t} \n \t \t\n }else if (c_posY > 150 && c_posY < 181 + c_radius){\n \tblockNumY = 5;\n \thit = true; \t \t\n }\n\n\t \n\n if (c_posX < 101){\n \tblockNumX = 0;\n \t//alert(blockNumX);\n } else if (c_posX > 101 && c_posX < 201){\n \tblockNumX = 1;\n \t//alert(blockNumX);\n \t\n } else if (c_posX > 200 && c_posX < 301){\n \t\tblockNumX = 2;\n \t//alert(blockNumX);\n } else if (c_posX > 300 && c_posX < 401){\n \t\tblockNumX = 3;\n \t//alert(blockNumX);\n } else if (c_posX > 400 && c_posX < 501){\n \t\tblockNumX = 4;\n \t//alert(blockNumX);\n }else if (c_posX > 500 && c_posX < 601){\n \t\tblockNumX = 5;\n \t//alert(blockNumX);\n }else if (c_posX > 600 && c_posX < 701){\n \t\tblockNumX = 6;\n \t//alert(blockNumX);\n }else if (c_posX > 700){\n \t\tblockNumX = 7;\n \t//alert(blockNumX);\n }//===================================================\n\n \n \t\t\n\treturn [blockNumX, blockNumY, hit];\n}", "title": "" }, { "docid": "2cc37aa47ab70a685d8807bc44e17c91", "score": "0.5579563", "text": "function move_block(b, x, y, offset) {\r\n set_bead(b.x + offset, b.y, \" \");\r\n set_bead(x, y, b);\r\n if (offset === 0) {\r\n b.x = x;\r\n b.y = y;\r\n }\r\n /*if (b === PLAYER && b.dy === 0) {\r\n PS.AudioPlay(\"fx_tick\");\r\n }*/\r\n }", "title": "" }, { "docid": "b56800833c9f37367ed7a8e4eb130739", "score": "0.55724436", "text": "function eachBlocksFromPiece(x, y, piece, fn, direction){\n if( typeof(direction) == 'undefined' ){\n direction = piece.direction;\n }\n var bin, nbBlock = 0;\n for (var a=0; a < piece.blocks[direction].length; a++){\n bin = decToBin( parseInt( piece.blocks[direction][a], 16 ),longueurPiece);\n for (var e=0; e < bin.length; e++){\n if ( bin[e] != '0' ) {\n nbBlock++;\n fn(x + (a * hauteurBlock), y + (e * hauteurBlock));\n if (nbBlock == longueurPiece){\n return;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "4f21f4d5cbdc969adccad53f3333bdf1", "score": "0.5568701", "text": "function Block(i, j){\n this.x = i;this.y = j;\n this.g = 0 ; this.h = 0; this.f = 0; \n this.isStart = false\n if(this.x === sourcerow){\n if(this.y === sourcecol){\n this.isStart = true\n }\n }\n\n this.isEnd = false\n if(this.x === destinationrow){\n if(this.y === destinationcol){\n this.isEnd = true\n }\n }\n \n //Creating a wall in the grid where it's val is 99 as stored above\n this.isWall = false;\n if(wallgrid[i][j] === 99){\n this.isWall = true;\n }\n\n this.prev = undefined; //stores the parent of the visited node to compute path\n\n //Stores adjacent cells\n this.adjacency = [];\n this.adjacentcells = function(grid){\n if(this.x > 0) this.adjacency.push(grid[this.x-1][this.y]);\n if(this.x < rows-1) this.adjacency.push(grid[this.x+1][this.y]);\n if(this.y > 0) this.adjacency.push(grid[this.x][this.y-1]);\n if(this.y < cols-1) this.adjacency.push(grid[this.x][this.y+1]);\n }\n }", "title": "" }, { "docid": "87bdb01e9a4e9b2a16d9e63577bdb484", "score": "0.55680054", "text": "function Block(start, end) {\n this.start = start;\n this.end = end;\n}", "title": "" }, { "docid": "f44974ede27e7d1d065421c225f39a89", "score": "0.5562171", "text": "constructor(xpos, ypos, maptile) {\n super(xpos,ypos, maptile);\n this.counter = 0;\n this.countertarget = 120;\n this.buildstate = 0;\n this.name = 'Lean-To';\n this.img = \"img/leanto.png\"; // This field must be set by all blocks\n chunklist[0][0].map[this.y][this.x].structure = this; // We need to add this part last, so that the ActiveBlock's image can be set before\n // the map gets re-rendered\n }", "title": "" }, { "docid": "680c36cfa804788772c55a70367f6630", "score": "0.5556496", "text": "function beginBlock(block){if(!blocks){blocks=[];blockActions=[];blockOffsets=[];blockStack=[];}var index=blockActions.length;blockActions[index]=0/* Open */;blockOffsets[index]=operations?operations.length:0;blocks[index]=block;blockStack.push(block);return index;}", "title": "" }, { "docid": "85ab9422b5a4284b246af84046f0b49f", "score": "0.5556215", "text": "function Block(tempX, tempY, tempW, tempH) {\n this.dragging = false; \n this.over = false; \n \n this.x = tempX;\n this.y = tempY;\n this.w = tempW;\n this.h = tempH;\n this.offsetX = 0;\n this.offsetY = 0; \n\n // Display the block\n Block.prototype.display = function() {\n noStroke();\n \n if (this.dragging) fill (50);\n else if (this.over) fill(100);\n else fill(175,200);\n noStroke();\n rect(this.x,this.y,this.w,this.h);\n fill(255);\n textAlign(CENTER);\n textSize(13);\n text(\"Drag me\", this.x + this.w / 2, this.y + this.h / 2);\n }\n\n // Check mouse click is inside rectange\n Block.prototype.clicked = function(mx, my) {\n if (mx > this.x && mx < this.x + this.w && my > this.y && my < this.y + this.h) {\n this.dragging = true;\n // Relate click to corner of rect\n this.offsetX = this.x-mx;\n this.offsetY = this.y-my;\n }\n }\n \n // Check rollover is inside rectangle for shading\n Block.prototype.rollover = function(mx, my) {\n if (mx > this.x && mx < this.x + this.w && my > this.y && my < this.y + this.h) {\n this.over = true;\n } else {\n this.over = false;\n }\n }\n\n // Mouse is released - therefore do not drag\n Block.prototype.stopDragging = function() {\n this.dragging = false;\n }\n \n // Mouse is clicked - therefore drag\n Block.prototype.drag = function(mx, my) {\n if (this.dragging) {\n this.x = mx + this.offsetX;\n this.y = my + this.offsetY;\n }\n }\n\n}", "title": "" }, { "docid": "d496c900595692d46d439987fc8522a5", "score": "0.5546422", "text": "function addMovingBlocks() {\r\n\r\n\tfor( var i = 0; i <= 4; i++ ) {\r\n\t\tvar sprite = this.game.add.sprite( this.game.world.randomX, this.game.world.randomY, this.game.cache.getBitmapData( 'blueShade' ) );\r\n\r\n\t\tthis.game.physics.arcade.enable( sprite );\r\n\r\n\t\tsprite.body.collideWorldBounds = true;\r\n\t\tsprite.body.bounce.set( 1 );\r\n\r\n\t\tsprite.body.velocity.x = this.game.rnd.realInRange( -200, 200 );\r\n\t\tsprite.body.velocity.y = this.game.rnd.realInRange( -200, 200 );\r\n\t}\r\n\t\t\r\n\r\n}", "title": "" }, { "docid": "58159971fac88c966ce38889c28bf887", "score": "0.55295694", "text": "renderBlocks() {\n return this.props.blocks.map(block => (\n <Block key={block.id} block={block} />\n ));\n }", "title": "" }, { "docid": "e60613e52ff6e5facc5c3385f569c3f4", "score": "0.5502974", "text": "function createBlock(data, x, y, ev)\n {\n // create new node of class \"block\"\n var returnNode = document.createElement(\"div\");\n returnNode.className = \"block\";\n returnNode.id = data + \"_\" + parseInt(counter); /* We cannot use the same ID */\n ev.target.appendChild(returnNode);\n placeDiv(x,y,returnNode);\n\n // get the \"parent\" blockFactory\n var current = document.getElementById(data);\n \n // get the contents of the blockfactory\n for(var child = current.firstChild; child; child = child.nextSibling)\n {\n // copy each content\n var copy = child.cloneNode(true);\n copy.id = returnNode.id + \"_\" + child.id;\n returnNode.appendChild(copy);\n var close = document.createElement(\"a\");\n close.setAttribute(\"href\", \"#\");\n close.onclick = function() { instance.remove(returnNode.id); };\n close.className = \"closeButton\";\n close.innerHTML = \"X\";\n close.id = returnNode.id + \"_close\";\n returnNode.appendChild(close);\n \n if(copy.nodeName == \"HEADER\")\n {\n var sourceUUID = copy.id + \"connector\";\n var targetEndpoint = {\n endpoint: \"Rectangle\",\n isSource: false,\n isTarget: true,\n maxConnections: 1,\n anchor: \"Left\",\n endpointStyle:{ fillStyle:\"red\", outlineColor:\"black\", outlineWidth:2 }\n }\n instance.addEndpoint(copy, targetEndpoint);\n \n var targetUUID = copy.id + \"connector\";\n var sourceEndpoint = {\n endpoint: \"Dot\",\n isSource: true,\n isTarget: false,\n maxConnections: 1,\n anchor: \"Right\",\n endpointStyle:{ fillStyle:\"red\", outlineColor:\"black\", outlineWidth:2 }\n }\n instance.addEndpoint(copy, sourceEndpoint);\n }\n \n \n // if the current child is the table...\n if(copy.nodeName == \"TABLE\")\n {\n // ... loop through the rows ...\n for(var tableChild = copy.firstChild; tableChild; tableChild = tableChild.nextSibling)\n { \n // add jsplumb endpoint\n // target endpoint\n if(tableChild.className == \"input\")\n {\n tableChild.firstChild.id = returnNode.id + \"-\" + tableChild.firstChild.id;\n var sourceUUID = copy.id + \"connector\";\n var targetEndpoint = {\n endpoint: \"Rectangle\",\n isSource: false,\n isTarget: true,\n maxConnections: 1,\n anchor: \"Left\",\n endpointStyle:{ fillStyle:\"white\", outlineColor:\"black\", outlineWidth:2 }\n }\n instance.addEndpoint(tableChild.firstChild, targetEndpoint);\n }\n // source endpoint\n else if(tableChild.className == \"output\")\n {\n tableChild.firstChild.id = returnNode.id + \"-\" + tableChild.firstChild.id;\n var targetUUID = copy.id + \"connector\";\n var sourceEndpoint = {\n endpoint: \"Dot\",\n isSource: true,\n isTarget: false,\n maxConnections: 1,\n anchor: \"Right\",\n endpointStyle:{ fillStyle:\"white\", outlineColor:\"black\", outlineWidth:2 }\n }\n instance.addEndpoint(tableChild.firstChild, sourceEndpoint);\t\t\n }\n }\n }\n }\n // make draggable\n instance.draggable(returnNode);\n return returnNode;\n }", "title": "" }, { "docid": "7a5c45739541b2ec760a58571967c557", "score": "0.5500222", "text": "land() {\n this.landed = true;\n\n this.blocks.forEach(block => {\n block.setLanded(true);\n });\n }", "title": "" }, { "docid": "f5441a3c266779f119f41996b8ee6c7f", "score": "0.54945815", "text": "function init(blockNum, degree) {\r\n\tarr = $(blockNum == 9?\"#bl-9\":\"#bl-16\").children().children();\r\n\tarr = blockNumber(blockNum, degree, arr);\r\n\tarr = changeimages(arr,blockNum);\r\n move(arr, blockNum);\r\n}", "title": "" }, { "docid": "b451b203f749bd3a6f34f5d37c35f3de", "score": "0.54839814", "text": "updatePossibleMoves() {\n var x = this.selectedPlayer.position.x;\n var y = this.selectedPlayer.position.y;\n\n var isLeft = true;\n var isRight = true;\n var isUp = true;\n var isDown = true;\n\n for (var i = 0; i < this.currentPossibleMoves.length; i++) {\n var block = this.getBlock(\n this.currentPossibleMoves[i].coordinate.x,\n this.currentPossibleMoves[i].coordinate.y\n );\n block.type = TypesEnum.EMPTY;\n }\n\n this.currentPossibleMoves = [];\n\n var playerBlock = this.getBlock(x, y);\n playerBlock.type = TypesEnum.POSSIBLE;\n\n this.currentPossibleMoves.push(playerBlock);\n\n for (var i = 1; i <= 3; i++) {\n var down = y + i;\n var up = y - i;\n var left = x - i;\n var right = x + i;\n\n if (down < 10) {\n var block = this.getBlock(x, y + i);\n\n if (\n block.type == TypesEnum.EMPTY &&\n block.itemType != ItemEnum.PLAYER &&\n isDown\n ) {\n this.currentPossibleMoves.push(block);\n block.type = TypesEnum.POSSIBLE;\n } else {\n isDown = false;\n }\n }\n\n if (up >= 0) {\n var block = this.getBlock(x, y - i);\n\n if (\n block.type == TypesEnum.EMPTY &&\n block.itemType != ItemEnum.PLAYER &&\n isUp\n ) {\n this.currentPossibleMoves.push(block);\n block.type = TypesEnum.POSSIBLE;\n } else {\n isUp = false;\n }\n }\n\n if (left >= 0) {\n var block = this.getBlock(x - i, y);\n\n if (\n block.type == TypesEnum.EMPTY &&\n block.itemType != ItemEnum.PLAYER &&\n isLeft\n ) {\n this.currentPossibleMoves.push(block);\n block.type = TypesEnum.POSSIBLE;\n } else {\n isLeft = false;\n }\n }\n\n if (right < 10) {\n var block = this.getBlock(x + i, y);\n\n if (\n block.type == TypesEnum.EMPTY &&\n block.itemType != ItemEnum.PLAYER &&\n isRight\n ) {\n this.currentPossibleMoves.push(block);\n block.type = TypesEnum.POSSIBLE;\n } else {\n isRight = false;\n }\n }\n }\n }", "title": "" }, { "docid": "683e5897b094d2ccfd219c6be3573a47", "score": "0.54831064", "text": "constructor(pos,dir)\r\n {\r\n this.pos=pos;\r\n this.dir=dir;\r\n }", "title": "" }, { "docid": "b302d99708f0d3bb30027a407d594be4", "score": "0.54829973", "text": "placeBlock(map) {\n const tileSize = 64;\n const currentTile = Prefab.convertPixelsToTile(\n { x: this.x, y: this.y },\n tileSize,\n );\n\n map.terrain.putTileAt(\n 204,\n currentTile.x + this.direction.x,\n currentTile.y + this.direction.y,\n );\n }", "title": "" }, { "docid": "a65b015727af78e16b569e7801680ed1", "score": "0.5480207", "text": "function Block({ element, onChangePosition }) {\n const { id, width, height, backgroundColor, x, y } = element;\n\n const style = {\n width,\n height,\n backgroundColor,\n position: 'absolute',\n };\n\n const handleDragStop = (e, position) => onChangePosition(id, position);\n\n return (\n <ReactDraggable\n bounds={{ top: 0, left: 0, right: 1000, bottom: 5000 }}\n position={{ x, y }}\n onStop={handleDragStop}\n >\n <div id={id} style={style} />\n </ReactDraggable>\n );\n}", "title": "" }, { "docid": "9f5557a3b5f1363c7097df8942a8bbbe", "score": "0.5475489", "text": "function blockGravityMove(blocks, checkedGrid) {\n for (y=1; y<blocks[0].length; y++) {\n for(x=0; x<blocks.length; x++) {\n // Empty blocks only fall downwards if they are falling into a space\n // that will become empty.\n // TODO There might be a cleaner way to do this.\n if (checkedGrid[x][y] === \"falls\") {\n if (blocks[x][y].type === \"empty\") {\n if (checkedGrid[x][y-1] === \"falls\") {\n// blocks[x][y-1] = blocks[x][y];\n }\n }\n // The block is not an empty block\n else {\n if (blocks[x][y].state === \"stationary\") {\n blocks[x][y].changeState(\"shaking\");\n }\n else if (blocks[x][y].state === \"shaking\") {\n if (blocks[x][y].countdown === 0) {\n blocks[x][y].changeState(\"falling\");\n } else {\n blocks[x][y].countdown -= 1;\n }\n }\n else if (blocks[x][y].state === \"falling\") {\n if (blocks[x][y].countdown === 0) {\n // call this to reset countdown\n blocks[x][y].changeState(\"falling\");\n blocks[x][y-1] = blocks[x][y];\n blocks[x][y] = new Block(\"empty\");\n } else {\n blocks[x][y].countdown -= 1;\n }\n }\n // If something would fall into the top row, just make it\n // empty. This way we don't have a forever falling column\n if (y === blocks[x].length - 1\n || checkedGrid[x][y+1] === \"stays\") {\n// blocks[x][y] = new Block(\"empty\");\n }\n }\n }\n // The block does not fall, set its state to stationary\n else {\n // If the block was falling, it has the potential to fall into a\n // group causing that group to become of size >= to 4\n if (blocks[x][y].state === \"falling\") {\n var group = getBlockGroup(blocks, x, y, blocks[x][y].type);\n // If the group size is >= 4, delete the group\n // TODO increase player score?\n if (group.length >= 4) {\n group.forEach(function (point) {\n blocks[point.x][point.y] = new Block(\"empty\");\n });\n }\n // Otherwise, the block just becomes stationary\n else {\n blocks[x][y].changeState(\"stationary\");\n }\n }\n // Redundant possibly, but block becomes stationary\n else {\n blocks[x][y].changeState(\"stationary\");\n }\n }\n }\n }\n\n return blocks;\n}", "title": "" }, { "docid": "3fb306ab175fd38f054922f3b417a544", "score": "0.5462566", "text": "function animateBlock() {\r\n\t\r\n\tsetTimeout(() => {\r\n\t\tanime ({\r\n\t\t\ttargets: '#block1',\r\n\t\t\ttranslateX: 0,\r\n\t\t\tscale: 1,\r\n\t\t\trotate: '1turn'\r\n\t\t\t });\r\n\t}, 1000);\t\r\n\tanime ({\r\n\t\ttargets: '#block1',\r\n\t\ttranslateX: 500,\r\n\t\tscale: 1,\r\n\t\trotate: '4turn'\r\n\t\t });\r\n }", "title": "" }, { "docid": "7f34099e48caa2938c30fd62537bd048", "score": "0.5461779", "text": "function createCurrentObjectAtCursor(){\n\tswitch (blockType){\n\t\tcase 0: basicBlocks.push(new THREE.Mesh(basicBlockGeometry,basicBlockMaterial)); \n\t\tbreak;\n\t\tdefault : basicBlocks.push(new THREE.Mesh(basicBlockGeometry,basicBlockMaterial));\n\t}\n\tscene.add(basicBlocks[basicBlocks.length-1]);\n\tbasicBlocks[basicBlocks.length-1].position.copy(currentCursorPosition);\n\t//Rotate the block to match the orientation of the axis\n\trotateAroundObjectAxis(basicBlocks[basicBlocks.length-1],cursorAxisX,currentRotationRoll*Math.PI/180);\n\trotateAroundObjectAxis(basicBlocks[basicBlocks.length-1],cursorAxisY,currentRotationPitch*Math.PI/180);\n\trotateAroundObjectAxis(basicBlocks[basicBlocks.length-1],cursorAxisZ,currentRotationYaw*Math.PI/180);\n\trender();\n}", "title": "" }, { "docid": "4891a053ac11657500329c5f6fc0319b", "score": "0.54574066", "text": "function check_item () {\n //check to see where it should go\n let object = null, place = null;\n items.forEach((a, i) => {\n if (object == null) {\n if (current_item.get_top_y() < a.get_top_y() && current_item.get_top_y() > a.get_top_y() - 10) {\n object = a;\n place = \"top\";\n console.log(\"add top\");\n } else if (current_item.get_top_y() > a.get_bottom_y() && current_item.get_top_y() < a.get_bottom_y() + 10) {\n object = a;\n place = \"bottom\";\n console.log(\"add bottom\");\n } else if (current_item.get_top_y() >= a.get_top_y() && current_item.get_top_y() <= a.get_bottom_y()) {\n object = a;\n place = \"bottom\";\n console.log(\"add below\")\n }\n }\n });\n console.log(object, place);\n if (object == null) {\n if (items.length == 0) { //if this was only block that was on screen and was then moved\n items[0] = current_item;\n current_item.index = 0;\n current_item.y = 10;\n current_item.render();\n } else { //add as last element\n current_item.y = items[items.length - 1].get_bottom_y() + 10;\n current_item.index = items.length;\n items[items.length] = current_item;\n current_item.render();\n }\n } else { //found a block to connect\n if (place == \"top\") {\n //insert itself into that position and unpdate everything below it\n items.splice(object.index, 0, current_item);\n current_item.index = object.index;\n current_item.y = object.get_top_y();\n current_item.render();\n for (let i = current_item.index + 1; i < items.length; i++) {\n items[i].index += 1;\n items[i].y += current_item.get_height() + 10;\n items[i].render();\n }\n } else {\n items.splice(object.index + 1, 0, current_item);\n current_item.index = object.index + 1;\n current_item.y = object.get_bottom_y() + 10;\n current_item.render();\n for (let i = object.index + 2; i < items.length; i++) {\n items[i].index += 1;\n items[i].y += current_item.get_height() + 10;\n items[i].render();\n }\n }\n }\n current_item = null;\n}", "title": "" }, { "docid": "9df4be135d5ead2ddb2db1c3103ceeab", "score": "0.54491615", "text": "function move_piece_blocks(what, dx, dy)\n{\n var beg_x, end_x, beg_y, end_y, inc_x, inc_y;\n\n if (dx == 0 && dy == 0) {\n\tdebug(1, 'Warning: trying to move_piece_blocks(what, 0, 0)');\n\treturn;\n }\n\n if (!what)\n\twhat = cur_piece;\n\n beg_x = end_x = what.x;\n beg_y = end_y = what.y;\n\n if (dx > 0) {\n\tbeg_x += what.w - 1;\n\tinc_x = -1;\n } else\n\tif (dx <= 0) {\n\t end_x += what.w - 1;\n\t inc_x = 1;\n\t}\n\n if (dy > 0) {\n\tbeg_y += what.h - 1;\n\tinc_y = -1;\n } else\n\tif (dy <= 0) {\n\t end_y += what.h - 1;\n\t inc_y = 1;\n\t}\n\n for (var y = beg_y; y != end_y + inc_y; y += inc_y)\n\tfor (var x = beg_x; x != end_x + inc_x; x += inc_x)\n\t if (what.shape[y - what.y][x - what.x] == XXX) {\n\t\tvar ob;\n\n\t\t//\tplayfield[x][y] = playfield[x - dx][y - dy];\n\t\tset_pl(x, y, x - dx, y - dy);\n\t\tplayfield[x - dx][y - dy] = null;\n\t\tevas_object_move(playfield[x][y], OX(x, what.ox), OY(y, what.oy));\n\t\n\t\tif (ob = playfield_bonus[x - dx][y - dy]) {\n\t\t playfield_bonus[x][y] = playfield_bonus[x - dx][y - dy];\n\t\t playfield_bonus[x - dx][y - dy] = null;\n\n\t\t type_bonus[x][y] = type_bonus[x - dx][y - dy];\n\t\t type_bonus[x - dx][y - dy] = null;\n\n\t\t evas_object_move(playfield_bonus[x][y], OX(x, what.ox), OY(y, what.oy));\n\t\t}\n\n\t\tif (ob = playfield_crado[x - dx][y - dy]) {\n\t\t playfield_crado[x][y] = playfield_crado[x - dx][y - dy];\n\t\t playfield_crado[x - dx][y - dy] = null;\n\t\t evas_object_move(playfield_crado[x][y], OX(x, what.ox), OY(y, what.oy));\n\t\t}\n\t }\n}", "title": "" }, { "docid": "0dfef60d173cb0054f6389311fc3aefa", "score": "0.5442084", "text": "function buildL(row, col, orientation) {\n if (orientation === 1) {\n blockCoords = [[row, col], [row + 1, col], [row + 1, col - 1], [row + 1, col - 2]];\n }\n\n else if (orientation === 2) {\n blockCoords = [[row, col], [row, col - 1], [row - 1, col - 1], [row - 2, col - 1]];\n }\n\n else if (orientation === 3) {\n blockCoords = [[row, col], [row - 1, col], [row - 1, col + 1], [row - 1, col + 2]];\n }\n\n else {\n blockCoords = [[row, col], [row, col + 1], [row + 1, col + 1], [row + 2, col + 1]];\n };\n\n return blockCoords;\n }", "title": "" }, { "docid": "89651e2af3a29e775f5ca521fd77cb61", "score": "0.5437645", "text": "function maze_render(){\n \nvar x_pos = 380;\nvar y_pos = 380;\n\nfor(j=0; j < 100; j++){\n for(i=0; i< 10; i++){\n blockarr[j] = new PIXI.Sprite(PIXI.Texture.fromImage(\"./assets/block.png\"));\n blockarr[j].anchor.x = 0.5;\n blockarr[j].anchor.y = 0.5;\n\n blockarr[j].position.x = x_pos;\n blockarr[j].position.y = y_pos;\n \n stage.addChild(blockarr[j]);\n \n x_pos -= 40;\n if(blockarr[j].position.y == 340){\n if(blockarr[j].position.x >= 60 && blockarr[j].position.x <= 340){\n blockarr[j].alpha = 0;\n }\n\n }\n if(blockarr[j].position.y == 300 ){\n if(blockarr[j].position.x == 260){\n blockarr[j].alpha = 0;\n }\n }\n if (blockarr[j].position.y == 260){\n if(blockarr[j].position.x == 100 || blockarr[j].position.x == 180 || blockarr[j].position.x == 260 || blockarr[j].position.x == 300 || blockarr[j].position.x == 340){\n blockarr[j].alpha = 0;\n }\n }\n if (blockarr[j].position.y == 220){\n if(blockarr[j].position.x >= 60 && blockarr[j].position.x <= 260){\n blockarr[j].alpha = 0;\n }\n }\n if (blockarr[j].position.y == 180){\n if(blockarr[j].position.x == 60|| blockarr[j].position.x == 300 || blockarr[j].position.x == 340 || blockarr[j].position.x == 380){\n blockarr[j].alpha = 0;\n }\n }\n if (blockarr[j].position.y == 140){\n if(blockarr[j].position.x == 60 || blockarr[j].position.x == 100 || blockarr[j].position.x == 140 || blockarr[j].position.x == 300 || blockarr[j].position.x == 380){\n blockarr[j].alpha = 0;\n }\n }\n if (blockarr[j].position.y == 100){\n if (blockarr[j].position.x == 140 || blockarr[j].position.x == 180 || blockarr[j].position.x == 220 || blockarr[j].position.x == 260 || blockarr[j].position.x == 300 || blockarr[j].position.x == 380 ){\n blockarr[j].alpha = 0;\n }\n }\n if(blockarr[j].position.y == 60){\n if(blockarr[j].position.x == 60 || blockarr[j].position.x == 100 || blockarr[j].position.x == 140 || blockarr[j].position.x == 300 || blockarr[j].position.x == 380){\n blockarr[j].alpha = 0;\n }\n }\n\n\n\n\n }\n console.log(blockarr[j].position.x);\n x_pos = 380;\n y_pos -=40;\n}\n}", "title": "" }, { "docid": "527f5d639826c26cf308af241c2ab3e0", "score": "0.54334044", "text": "function moveBlock(event) {\n\tif (block === null && (event.target === box[0].firstElementChild || event.target === box[1].firstElementChild || event.target === box[2].firstElementChild)) {\n\t\tblock = event.target\n\t\tblockColor = block.style.backgroundColor\n\t\tblock.style.backgroundColor = 'gray'\n\t\tblockValue = event.target.getAttribute('data-value')\n\t} else if (block !== null && (event.target === box[0] || event.target === box[1] || event.target === box[2])) {\n\t\tnewBox = event.target\n\t\tnewBoxvalue = event.target.firstElementChild\n\n\t\tif (event.target.children.length > 0) {\n\t\t\ttopValue = event.target.firstElementChild.getAttribute('data-value')\n\t\t}\n\t\tcompare()\n\t}\n}", "title": "" }, { "docid": "7ac9553e2bd86909823e9f3b4edc20d8", "score": "0.5426909", "text": "function CylindricalBlock(startRadius = 0.0, width = 0.0, startAngle = 0.0, blockLength = 0.0, startHeight = 0.0, height = 0.0, meshSize = 0, normalization = 1.0, color = new Color(0.0, 0.0, 0.0, 1.0)) {\n\n // Initialze helper variables.\n var index = 0;\n var arrayOffset = 0;\n var coordinatesPerPoint = 3;\n var deltaAngle = 0.0;\n var currentAngle = 0.0;\n var startPoint = null;\n var endPoint = null;\n var currentCoordinates = [];\n var bottomFace = [];\n var topFace = [];\n\n // Initialize the properties of this block object.\n this.startRadius = startRadius;\n this.width = width;\n this.startAngle = startAngle;\n this.blockLength = blockLength;\n this.startHeight = startHeight;\n this.height = height;\n this.meshSize = meshSize;\n this.normalization = normalization;\n this.color = color;\n\n // Calculate the number of points needed to describe\n // this block. There are 4 rounded edges, each with\n // (meshSize + 1) points.\n this.pointsPerRoundedFace = 2 * (this.meshSize + 1);\n this.numberOfPoints = 2 * this.pointsPerRoundedFace;\n this.cornerPoints = [\n 0,\n 1,\n this.meshSize * 2,\n this.meshSize * 2 + 1,\n this.pointsPerRoundedFace,\n this.pointsPerRoundedFace + 1,\n this.pointsPerRoundedFace + (this.meshSize * 2),\n this.pointsPerRoundedFace + (this.meshSize * 2) + 1\n ];\n\n // Create an array containing the points used to\n // describe this block and the indices used to \n // determine which triangles are drawn. Store colors.\n this.points = [];\n this.coordinates = [];\n this.colors = [];\n this.triangles = [];\n\n // Calculate the angle width to use for construction.\n deltaAngle = this.blockLength / this.meshSize;\n\n // Start creating the bottom face.\n for(index = 0; index <= this.meshSize; index++) {\n currentAngle = this.startAngle + (index * deltaAngle);\n startPoint = new CylindricalPoint(this.startRadius, currentAngle, this.startHeight, this.normalization);\n endPoint = new CylindricalPoint(this.startRadius + this.width, currentAngle, this.startHeight, this.normalization);\n this.points.push(startPoint.toBox());\n this.points.push(endPoint.toBox());\n }\n\n // Start creating the top face. The height of these\n // points should be this.height.\n for(index = 0; index <= this.meshSize; index++) {\n currentAngle = this.startAngle + (index * deltaAngle);\n startPoint = new CylindricalPoint(this.startRadius, currentAngle, this.startHeight + this.height, this.normalization);\n endPoint = new CylindricalPoint(this.startRadius + this.width, currentAngle, this.startHeight + this.height, this.normalization);\n this.points.push(startPoint.toBox());\n this.points.push(endPoint.toBox());\n }\n\n // Populate the array of coordinates from each point.\n for(index = 0; index < this.numberOfPoints; index++) {\n currentCoordinates = this.points[index].toArray();\n this.coordinates.push(currentCoordinates[0]);\n this.coordinates.push(currentCoordinates[1]);\n this.coordinates.push(currentCoordinates[2]);\n }\n\n // Populate the array of colors.\n for(index = 0; index < this.numberOfPoints; index++) {\n this.colors.push(this.color.getRed());\n this.colors.push(this.color.getGreen());\n this.colors.push(this.color.getBlue());\n this.colors.push(this.color.getAlpha());\n }\n\n // Create an array of indices that will be used to \n // determine how triangles of the face are to be \n // drawn. Start with the bottom face.\n for(index = 0; index < this.meshSize; index++) {\n // First triangle\n this.triangles.push(2 * index);\n this.triangles.push(2 * index + 1);\n this.triangles.push(2 * index + 2);\n // Second triangle\n this.triangles.push(2 * index + 1);\n this.triangles.push(2 * index + 2);\n this.triangles.push(2 * index + 3);\n }\n\n // Proceed to draw the top face.\n for(index = 0; index < this.meshSize; index++) {\n // Get points from the second half of the \n // points array.\n arrayOffset = this.pointsPerRoundedFace + (2 * index);\n // First triangle\n this.triangles.push(arrayOffset);\n this.triangles.push(arrayOffset + 1);\n this.triangles.push(arrayOffset + 2);\n // Second triangle\n this.triangles.push(arrayOffset + 1);\n this.triangles.push(arrayOffset + 2);\n this.triangles.push(arrayOffset + 3);\n }\n\n // Proceed to draw the back face\n for(index = 0; index < this.meshSize; index++) {\n // Get points from the second half of the \n // points array.\n arrayOffset = this.pointsPerRoundedFace + (2 * index);\n // First triangle\n this.triangles.push(2 * index);\n this.triangles.push(arrayOffset);\n this.triangles.push(2 * index + 2);\n // Second triangle\n this.triangles.push(arrayOffset);\n this.triangles.push(2 * index + 2);\n this.triangles.push(arrayOffset + 2);\n }\n\n // Proceed to draw the front face\n for(index = 0; index < this.meshSize; index++) {\n // Get points from the second half of the \n // points array.\n arrayOffset = this.pointsPerRoundedFace + (2 * index);\n // First triangle\n this.triangles.push(2 * index + 1);\n this.triangles.push(arrayOffset + 1);\n this.triangles.push(2 * index + 3);\n // Second triangle\n this.triangles.push(arrayOffset + 1);\n this.triangles.push(2 * index + 3);\n this.triangles.push(arrayOffset + 3);\n }\n\n // Proceed to draw the left face\n this.triangles.push(0);\n this.triangles.push(this.pointsPerRoundedFace);\n this.triangles.push(1);\n this.triangles.push(this.pointsPerRoundedFace);\n this.triangles.push(1);\n this.triangles.push(this.pointsPerRoundedFace + 1);\n\n // Proceed to draw the right, and final, face\n this.triangles.push(this.pointsPerRoundedFace - 2);\n this.triangles.push(this.numberOfPoints - 2);\n this.triangles.push(this.pointsPerRoundedFace - 1);\n this.triangles.push(this.numberOfPoints - 2);\n this.triangles.push(this.pointsPerRoundedFace - 1);\n this.triangles.push(this.numberOfPoints - 1);\n \n}", "title": "" } ]
08d5f2e12d187abc1096a159828796d5
setup function for checking price
[ { "docid": "540709fbdf29cf55e463355e4c9c21c9", "score": "0.0", "text": "async function checkPrice() {\r\n // ensure all our code tries. If it ever fails it will go into the catch section\r\n try {\r\n console.log(\"checkPrice() called\");\r\n const priceString = await nightmare\r\n .goto(url) // goes to a URL and downloads the page\r\n .wait(\"#priceblock_ourprice\") // waits until some element is rendered on the page (this makes it be able to work with React so it can wait till HTML is created)\r\n .evaluate(() => document.getElementById(\"priceblock_ourprice\").innerText) // now we run some code on the loaded document. It takes a function which allows you to write JS as if you were on the front end of that app\r\n .end();\r\n \r\n const priceNumber = parseFloat(priceString.replace(\"$\", \"\"));\r\n console.log(priceNumber);\r\n if (priceNumber < minPrice) {\r\n // send a special message that will enable you to view the website from the email\r\n // await so nothing weird happens. Like our code exits before our email is sent. It ensures the email\r\n // will always be sent\r\n await sendEmail(\r\n \"Price is low\", \r\n `The price on ${url} has dropped below our ${minPrice}`\r\n )\r\n console.log(\"It is cheap \", priceString);\r\n }\r\n } catch (e) { \r\n await sendEmail(\"Amazon Price Checker Error\", e.message)\r\n // throw so if we check the logs when the app is running, we will see the error show up in console\r\n throw e \r\n }\r\n}", "title": "" } ]
[ { "docid": "a35dab73dfc5eabaa4b18b36c0e34a0b", "score": "0.6510093", "text": "function initializeGetMarketPrice() {\n // Test PLEX in Dodixie\n var itemId = 29668;\n var regionId = 10000032;\n var stationId = 60011866;\n var orderType = \"SELL\";\n\n var price = getMarketPrice(itemId, regionId, stationId, orderType);\n Logger.log(price);\n\n // Now in Jita\n regionId = 10000002;\n stationId = 60003760;\n\n price = getMarketPrice(itemId, regionId, stationId, orderType);\n Logger.log(price);\n}", "title": "" }, { "docid": "7e8c5e20b781017b61c54c01f8fb175a", "score": "0.6457607", "text": "function setPrice() {\n\tsetPricesExceptCups(); // calling function - setting up the total values\n\tsetCupPrice(); // set up prices for cups.\n\tvar priceLabel = document.getElementById(\"costTot\"); // fnding and id\n\t//var check = setCupPrice(); // boolean value - checks if \"CUP\" is selected\n\tvar sum = 0; //total sum set to 0\n\n\t/* if (check === true){ // We may add \"iF cup is selected\" to calculate total value only if cup is selected\n\t * I removed it for now as I realized that user may wish to calculate the prices of\n\t * extra item only*/\n\tfor (var i = 0; i < priceArr.length; i++) {\n\t\tsum = sum + priceArr[i];\n\t}\n\tpriceLabel.innerHTML = \"&euro; \" + sum.toFixed(2);\n\n\t//}\n\t/*\n\t if (check === false){ // otherwise throw an error\n\t window.alert(\"You must select cup size\");\n\t }\n\t */\n}", "title": "" }, { "docid": "572a1c6d56bcf8716b2300abcb0a8c3e", "score": "0.64289147", "text": "static checkPrice(price) {\n if (price > Car.#MAX_PRICE) {\n return \"Error! Price exceeds the maximum\";\n } else {\n return \"Success! Price is within acceptable limits\";\n }\n }", "title": "" }, { "docid": "209568bc25897df0237ece2de6c4a440", "score": "0.63623273", "text": "function checkCrypto() {\n if(chosenCurrency != currencySelector.val()) {\n var chosenCurrency = currencySelector.val()\n if(chosenCurrency != \"USD\") {\n getCryptoPrice(chosenCurrency);\n }\n else if(onIntro == false) {\n if(favoritesShown) {\n populateFavorites()\n }\n else {\n searchCards()\n }\n }\n }\n}", "title": "" }, { "docid": "747e0944418fd553b66112a428b61bf7", "score": "0.6261611", "text": "function calculatePrice() {\n\t\t\tmodelPrice = parseInt($('input[name=engine]:checked', '#autoForm').val());\n\t\t\tmodelPrice += parseInt($('input[name=transmission]:checked', '#autoForm').val());\n\t\t\tmodelPrice += parseInt($('input[name=package]:checked', '#autoForm').val());\n\t\t\tmodelPriceHolder.text(modelPrice + ' BYN');\n\t\t\t}", "title": "" }, { "docid": "403f9f0a61b619d57f7b5ba8b8477610", "score": "0.61629635", "text": "function TotalPricesForExchage(){\n if (MicrosoftExchangeNeedOrNot==1){\n Exchange_TWO_Prices = 40.698;\n Exchange_THREE_Prices = 28.9595;\n Exchange_FIVE_Prices = 19.2185;\n }else{\n Exchange_TWO_Prices = 0;\n Exchange_THREE_Prices = 0;\n Exchange_FIVE_Prices = 0;\n }\n }", "title": "" }, { "docid": "959facef792dd2066c6726b47140e6f3", "score": "0.61370087", "text": "function setupPrices () {\n const priceEls = document.querySelectorAll('.search-result-price')\n for (let i = 0; i < priceEls.length; i++) {\n const priceEl = priceEls[i]\n\n // Make sure we not setting up already set up elements\n if (priceEl.dataset.sywertPrice) {\n return\n }\n\n priceEl.dataset.euroPrice = priceEl.innerText\n\n const euroPrice = parseInt(priceEl.innerText.replace(/\\D/g, ''))\n if (euroPrice > 0) {\n const sywertPrice = Math.round(euroPrice / SYWERT_RATE * 1000) / 1000\n const qualifier = priceEl.innerText.match(/\\d+\\s(.+)/)[1]\n const newText = `${sywertPrice}`.replace('.', ',') + ' Sywert ' + qualifier\n priceEl.dataset.sywertPrice = newText\n } else {\n // Not a number, something like 'Prijs op aanvraag'. In that case, just show the original text.\n priceEl.dataset.sywertPrice = priceEl.dataset.euroPrice\n }\n }\n }", "title": "" }, { "docid": "cdd28eeba4f4ed5b017f872f65e35753", "score": "0.61105275", "text": "function price_it ()\n\t\t\t{\n\t\t\t\tvar str = get();\n\t\t\t\tvar price = price_format(str);\n\t\t\t\tif (str != price) set(price);\n\t\t\t\tif(parseFloat(str) == 0.0 && clearOnEmpty) set('');\n\t\t\t}", "title": "" }, { "docid": "ec194dd0ff12dc8a5b0b60ef46fc1d82", "score": "0.61035985", "text": "function TotalPricesForRouter(){\n if ($('#input-equipment:checked').val()==1){\n Router_TWO_Prices = 7.182 * getRouterNumber();\n Router_THREE_Prices = 5.1105 * getRouterNumber();\n Router_FIVE_Prices = 3.3915 * getRouterNumber();\n } else {\n Router_TWO_Prices = 0;\n Router_THREE_Prices = 0;\n Router_FIVE_Prices = 0;\n }\n }", "title": "" }, { "docid": "d29a7d27c1d4ca54b4fa171b76fd6021", "score": "0.6097137", "text": "feesCalculator(){\n \n if(this.weight<=1){\n this.price= 1\n }\n else if(1<this.weight && this.weight<=5){\n this.price = 2\n }\n else if(5<this.weight && this.weight<=10){\n this.price = 3\n }\n else if(10<this.weight && this.weight<=20){\n this.price = 5\n }\n else {this.price= 10}\n }", "title": "" }, { "docid": "ceeeb1301d2b66bae3891a56a7d9121f", "score": "0.60858655", "text": "function CustomerPricingRules () {\n\n}", "title": "" }, { "docid": "d41c0f315196dd86d1cdaf1c406441d6", "score": "0.6062651", "text": "function calculatePrice() {\n\t\tvar sum = 0;\n\t\tvar productionSupportMin = 200;\n\t\tvar value = 0;\n\t\tvar calculation = 0;\n\t\tvar text = '';\n\t\tvar supportCheckbox = $('input[name=premium]');\n\n\t\t// RAM\n\t\tvalue = slider_ram_target.noUiSlider.get();\n\t\tcalculation = value > slider_ram ? (value - slider_ram) * ram_price : 0;\n\t\ttext = value + ' GB';\n\t\t$('#slider_ram').parent('.slider').find('.price').html(text + ' - <h4 class=\"primary inline\">' + (calculation != 0 ? calculation.toFixed(2) + '</h4>' + ' &euro;' : 'FREE')).data('value', calculation.toFixed(2));\n\t\tsum += calculation;\n\n\t\tif(calculation == 0) {\n\t\t\t$('#slider_ram').find('.noUi-handle').addClass('grey-handle');\n\t\t} else {\n\t\t\t$('#slider_ram').find('.noUi-handle').removeClass('grey-handle')\n\t\t}\n\n\t\t// DISK\n\t\tvalue = slider_disk_target.noUiSlider.get();\n\t\tcalculation = value > slider_disk ? (value - slider_disk) * disk_price : 0;\n\t\ttext = value + ' GB';\n\t\t$('#slider_disk').parent('.slider').find('.price').html(text + ' - <h4 class=\"primary inline\">' + (calculation != 0 ? calculation.toFixed(2) + '</h4>' + ' &euro;' : 'FREE')).data('value', calculation.toFixed(2));\n\t\tsum += calculation;\n\n\t\tif(calculation == 0) {\n\t\t\t$('#slider_disk').find('.noUi-handle').addClass('grey-handle');\n\t\t} else {\n\t\t\t$('#slider_disk').find('.noUi-handle').removeClass('grey-handle')\n\t\t}\n\n\t\t// TRAFFIC\n\t\tvalue = slider_traffic_target.noUiSlider.get();\n\t\tcalculation = value > slider_traffic ? (value - slider_traffic) * traffic_price : 0;\n\t\ttext = value + ' GB';\n\t\t$('#slider_traffic').parent('.slider').find('.price').html(text + ' - <h4 class=\"primary inline\">' + (calculation != 0 ? calculation.toFixed(2) + '</h4>' + ' &euro;' : 'FREE')).data('value', calculation.toFixed(2));\n\t\tsum += calculation;\n\n\t\tif(calculation == 0) {\n\t\t\t$('#slider_traffic').find('.noUi-handle').addClass('grey-handle');\n\t\t} else {\n\t\t\t$('#slider_traffic').find('.noUi-handle').removeClass('grey-handle')\n\t\t}\n\n\t\tif (supportCheckbox.prop('checked') && sum <= productionSupportMin) {\n\t\t\tsum = productionSupportMin;\n\t\t}\n\n\t\tif (sum >= productionSupportMin && !supportCheckbox.prop('checked')) {\n\t\t\tsupportCheckbox.prop('checked', true);\n\t\t}\n\n\t\tcalculator.find('.total_price').html(sum != 0 ? sum.toFixed(2) + ' &euro;' : 'Free');\n}", "title": "" }, { "docid": "23cb8eaab6d742e974165cb6e3d4b851", "score": "0.60075355", "text": "function calc_price_vars() {\n price_vehicle = (selectedvehicle - 1 == -1)?0:vehicle_price[selectedvehicle - 1];\n \n //BUG: In buggy mode any price greater 29000 will be ignored\n if (buggyVersion && price_vehicle >= 29000) {\n price_vehicle = 0;\n }\n \n price_special = vehicle_specialmodel_price[selectedspecial];\n price_extra = 0;\n extra_count = 0;\n // some accessory may be contained in the selected model\n for(var i = 0; i < accessory_price.length && document.getElementById('AddAccessoryPriceChkbox').checked == true; i++) {\n if(selectedaccesso.indexOf(\"xS\" + i + \"x\") != -1) {\n if(vehicle_specialmodel_extra[selectedspecial].indexOf(\"xS\" + i + \"x\") == -1) {\n if(buggyVersion && parseInt(accessory_id[i].substr(1)) % 3 == 0) {\n extra_count--;\n }\n extra_count++;\n price_extra += accessory_price[i];\n }\n }\n }\n extra_discount = 0;\n if(3 <= extra_count) {\n extra_discount = 10; // if there are 3 ore more <u>extra</u> accessory there will be 10% of discount\n }\n if(5 <= extra_count) {\n extra_discount = 15; // if there are 5 ore more <u>extra</u> accessory there will be 15% of discount\n }\n // calc total price\n price_total = (price_vehicle / 100 * (100 - thecar_discount)) + price_special + price_extra / 100 * ((100 - extra_discount));\n }", "title": "" }, { "docid": "ab519cc7fbef7bf6ff6796acc73420bd", "score": "0.6000883", "text": "function getConfigPrice() {\r\n var prc = 0;\r\n return prc\r\n}", "title": "" }, { "docid": "df99ff4e9c7b0d1ffc17aa26b6fa53f5", "score": "0.59742975", "text": "function setTotalPrice() {\n // all ok\n\n return;\n\n if (ProductData.hasOwnProperty('mainPrice')) {\n $('.add-to-cart-button').removeClass(\"unavailable\");\n ProductData.totalPrice = +ProductData.mainPrice;\n } else {\n $('.add-to-cart-button').addClass(\"unavailable\");\n }\n\n if (ProductData.hasOwnProperty('mainPrice') && ProductData.hasOwnProperty('shipping')) {\n ProductData.totalPrice = (+ProductData.mainPrice * ProductData.quantity) + (+ProductData.shipping['cost']);\n $('#total-price').html(ProductData.totalPrice);\n $('.add-to-cart-button').removeClass(\"unavailable\");\n }\n // no shipping\n else {\n $('#total-price').html(\"\");\n $('#no-shipping-warning').removeClass(\"hidden-warning\");\n $('.add-to-cart-button').addClass(\"unavailable\");\n }\n\n if (ProductData.hasOwnProperty('shipping')) {\n $('#no-shipping-warning').addClass(\"hidden-warning\");\n }\n }", "title": "" }, { "docid": "c451688e7a30b34902a49cafbecd0e2c", "score": "0.5966789", "text": "function TotalPricesForSwitch(){\n if ($('#input-equipment:checked').val()==1){\n Switch_TWO_Prices = 12.9276 * getSwitchNumber();\n Switch_THREE_Prices = 9.1989 * getSwitchNumber();\n Switch_FIVE_Prices = 6.1047 * getSwitchNumber();\n } else {\n Switch_TWO_Prices = 0;\n Switch_THREE_Prices = 0;\n Switch_FIVE_Prices = 0;\n }\n \n }", "title": "" }, { "docid": "774cf75e780047996a8cc0f10e815230", "score": "0.59585714", "text": "function getSetCasePrice(){\n const price= price2*parseInt(input2.value)\n if(price){\n casePrice.innerText=price\n return price\n }\n else{\n casePrice.innerText=0\n input2.value=0\n return 0\n }\n}", "title": "" }, { "docid": "6e729c0a82de2faa6e41a4cb2342e945", "score": "0.5947172", "text": "function checkPrice() {\n var price = document.getElementById(\"productPrice\").value;\n // check if price is all numeric\n var illegalChar = /[^0-9.]/g;\n if ((illegalChar.test(price))) {\n document.getElementById(\"priceAlert\").innerHTML = \"برای قیمت گذاری تنها از اعداد استفاده نمایید\";\n $(\"#submitOrderButton\").prop('disabled', true);\n priceFlag = false;\n return priceFlag;\n } else\n {\n document.getElementById(\"priceAlert\").innerHTML = \"\";\n $(\"#submitOrderButton\").prop('disabled', false);\n priceFlag = true;\n return priceFlag;\n }\n\n}", "title": "" }, { "docid": "65e51789dfbe968b855744a811f6c3df", "score": "0.59405214", "text": "constructor({ price }) {\n this.price = price;\n }", "title": "" }, { "docid": "932b73cb517186580c6f547ccf5206ef", "score": "0.5938056", "text": "function setPriceAndPageView() {\n let pageViewValue = document.getElementById(\"pageview-slider\").value;\n let discount = document.getElementById(\"discount-toggler\").checked\n ? true\n : false;\n\n console.log(\n \"Value: \" + pageViewValue + \", discount: \" + (discount ? \"yes\" : \"no\")\n );\n\n let pageViewString = \"\";\n let pageViewPrice = -1;\n switch (Number(pageViewValue)) {\n case 1:\n {\n pageViewString = \"10 k\";\n pageViewPrice = 8;\n }\n break;\n\n case 2:\n {\n pageViewString = \"50 k\";\n pageViewPrice = 12;\n }\n break;\n\n case 3:\n {\n pageViewString = \"100 k\";\n pageViewPrice = 16;\n }\n break;\n\n case 4:\n {\n pageViewString = \"500 k\";\n pageViewPrice = 24;\n }\n break;\n\n case 5:\n {\n pageViewString = \"1 M\";\n pageViewPrice = 36;\n }\n break;\n }\n\n if (discount) {\n pageViewPrice = (pageViewPrice - pageViewPrice * 0.25).toFixed(0);\n }\n\n document.getElementById(\"pageviews_amount\").innerText = pageViewString;\n document.getElementById(\"price-number\").innerText = pageViewPrice;\n}", "title": "" }, { "docid": "1738264604fe25e8fed104c0e205a4c5", "score": "0.5936698", "text": "function BalconyExtra() {\n var BalconyPrice = 0;\n //Get a reference to the form id=\"getOptionsBooking\"\n var theForm = document.forms[\"getOptionsBooking\"];\n //Get a reference to the checkbox id=\"local\"\n var includeBalcony = theForm.elements[\"balcony\"];\n\n //If they checked the box set LocalPrice to 60\n if (includeBalcony.checked == true) {\n BalconyPrice = 30;\n }\n //finally we return the candlePrice\n return BalconyPrice;\n }", "title": "" }, { "docid": "bfddd9443352c49afb61f68e8aae9fbb", "score": "0.59251404", "text": "function priceFinder(city,accomdationType,guests,checkIn,checkOut){\n let londonBase = 80;\n let parisBase = 70;\n let madridBase = 40;\n let genevaBase =80;\n let romeBase = 50;\n let sydneyBase = 100;\n let amsterdamBase = 60;\n // Final Price Calculator\n function totalPrice(cityBasePrice,seasonTwoTax,seasonThreeTax,seasonTwoDays,seasonThreeDays,accomoType,guests,days){\n let accomoTaxes = {\n camp:0.10,\n hostel:0.20,\n bnb:0.30,\n hotel:0.40,\n resort:0.60\n }\n let accomodationTax = cityBasePrice*accomoTaxes[accomoType];\n let seasonTwoTotalTax = (cityBasePrice*seasonTwoTax)*seasonTwoDays;\n let seasonThreeTotalTax = (cityBasePrice*seasonThreeTax)*seasonThreeDays;\n let finalPrice = ((cityBasePrice*days)+accomodationTax+seasonTwoTotalTax+seasonThreeTotalTax)*guests;\n return finalPrice\n\n }\n seasonDays = seasonFinder(checkIn,checkOut); \n days = calcDays(checkIn,checkOut)\n if(city=='london')return (totalPrice(londonBase,0.25,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='paris')return (totalPrice(parisBase,0.22,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='madrid')return (totalPrice(madridBase,0.18,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='geneva')return (totalPrice(genevaBase,0.20,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='rome') return (totalPrice(romeBase,0.20,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='sydney')return (totalPrice(sydneyBase,-0.18,0.10,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n if(city=='amsterdam')return (totalPrice(amsterdamBase,0.20,0,seasonDays[0],seasonDays[1],accomdationType,guests,days));\n \n}", "title": "" }, { "docid": "ade4a88eddaf5d16f583e52cfa6b9966", "score": "0.59223306", "text": "function checkPrice(price){\n switch(price){\n case 100:\n return 'One hundred'\n break\n\n case 200:\n return 'Two hundred'\n break\n\n default: \n return 'Out of budget'\n }\n}", "title": "" }, { "docid": "7d4b7ed2aac7be8475db28e3553cc0ad", "score": "0.59205496", "text": "function setPrice()\n{\n\tvar Name = serviceTypeSelected;\n\tvar tat = document.getElementById(\"txtTurnAroundTime\").value;\n\tvar rate = 0;\n\tif (tat == \"5\" || tat == \"0\")\n\t{\n\t\tif (Name == \"Standard Editing\")\n\t\t{\n\t \trate = 0.035;\n\t\t}\n\t\telse if (Name == \"Advanced Editing\")\n\t\t{\n\t \trate = 0.06;\n\t\t}\n\t\telse if (Name == \"Substantive Editing\")\n\t\t{\n\t \trate = 0.08;\n\t\t}\n\t}\n\n\telse if (tat == \"3\")\n\t{\n\t\tif (Name == \"Standard Editing\")\n\t\t{\n\t\t\trate = 0.04;\n\t\t}\n\t\telse if (Name == \"Advanced Editing\")\n\t\t{\n\t\t\trate = 0.07;\n\t\t}\n\t\telse if (Name == \"Substantive Editing\")\n\t\t{\n\t\t\trate = 0.09;\n\t\t}\n\t}\n\n\telse if (tat == \"2\")\n\t{\n\t\tif (Name == \"Standard Editing\")\n\t\t{\n\t\t\trate = 0.05;\n\t\t}\n\t\telse if (Name == \"Advanced Editing\")\n\t\t{\n\t\t\trate = 0.08;\n\t\t}\n\t\telse if (Name == \"Substantive Editing\")\n\t\t{\n\t\t\trate = 0.12;\n\t\t}\n\t}\n\n\tvar wordCount = document.getElementById(\"txtWordCount\").value;\n\tvar totalPrice = 0;\n\ttotalPrice = wordCount * rate;\n\n\tvar discountPercent = document.getElementById(\"txtDiscountPercent\").value;\n\tif(discountPercent != \"0\")\n\t{\n\t\tdiscountPrice = (discountPercent/100)* totalPrice;\n\t\ttotalPrice -= discountPrice;\n\t}\n\n\tvar discountAmount = document.getElementById(\"txtDiscountAmount\").value;\n\tif (discountAmount != \"0\")\n\t{\n\t\ttotalPrice -= discountAmount;\n\t}\n\tdocument.getElementById(\"txtTotalAmount\").value = totalPrice;\n}", "title": "" }, { "docid": "756c58f5d425d95f60e6d55307ddcb07", "score": "0.5920076", "text": "function calcPltPrice() {\n \"use strict\";\n // alert(\"Calc Price\")\n let matchesPlayed = parseInt(elPltMatchesPlayed.value);\n let pltPrice = parseInt(elPltRankCurrent.value) * matchesPlayed;\n /* Adds % to price if user selects the checkbox. */\n if (isPltBoosted()) {\n pltPrice += (0.40 * pltPrice);\n }\n if (isPltStreamed()) {\n pltPrice += (0.15 * pltPrice);\n }\n if (isPltExpress()) {\n pltPrice += (0.50 * pltPrice);\n }\n /* Increases price based on what mode they user selects. */\n let queue = elPltRankQueue.value;\n if (queue === '2v2') {\n pltPrice += (0.15 * pltPrice);\n } else if (queue === '3v3') {\n pltPrice += (0.25 * pltPrice);\n }\n /* Convert to String Dollar Amount */\n pltPrice = pltPrice.toFixed(2);\n let text = pltPrice + \" USD\";\n document.getElementById('place-price-text').innerHTML = text;\n}", "title": "" }, { "docid": "a898ae172ba2345431247f3804adcee2", "score": "0.5915891", "text": "function calcPrice(){\n var basePrice;\n var totalPrice;\n var quantity = parseInt($(\"#quant\").val());\n\n if(cartObj == \"album1\" || cartObj == \"album2\" || cartObj == \"album3\"){\n basePrice = parseFloat($(\"#mFormat\").val());\n }\n if(cartObj == \"tshirt\"){\n var size = $(\"#sSize\").val();\n if(size == \"small\" || size == \"medium\" || size == \"large\"){\n basePrice = 20;\n }\n else{\n basePrice = 23;\n }\n }\n\n totalPrice = basePrice * quantity;\n modalPrice = \"$\" + totalPrice;\n\n if(basePrice && quantity){\n $(\"#itemPrice\").text(modalPrice);\n }\n }", "title": "" }, { "docid": "c582c6bb70c434fec24c855e78155714", "score": "0.5911413", "text": "function isChecked(workshop, price) {\n if (workshop.prop('checked')) {\n totalCost += price;\n }\n }", "title": "" }, { "docid": "29b60a634cd3e734e17eadbb4b6c8309", "score": "0.5908565", "text": "function customOrderCost(){\n\tvar specialPricing = false;\n\tvar customOrderPrice = 0;\n var customOrderValues = {};\n \n console.log(\"customOrderCost()\");\n console.log(\"...... retreiving order cost\");\n customOrderValues.color = $(\"input[type=radio][name=customOrderColor]:checked\").val();\n customOrderValues.size = $(\"#customOrderSize\").find(':selected').val(); \n customOrderValues.coated = $(\"#customOrderPaperCoating\").find(':selected').val();\n customOrderValues.paper = $(\"#customOrderPaperStock\").find(':selected').val();\n customOrderValues.bleed = $(\"#customOrderBleed\").find(':selected').val();\n\n\tcustomOrderValues.edge = $(\"#customOrderEdge\").find(':selected').val();\n\tcustomOrderValues.packaging = $(\"#customOrderPackaging\").find(':selected').val();\n\tcustomOrderValues.laminate = $(\"#customOrderLaminate\").find(':selected').val();\n\tcustomOrderValues.fold = $(\"#customOrderFold\").find(':selected').val();\n\tcustomOrderValues.binding = $(\"#customOrderBindingOptions\").find(':selected').val();\n\tcustomOrderValues.tabs = $(\"#customOrderBindingTabs\").find(':selected').val();\n\t\n // quanitiy\n // instantiate 'quantity' to value in textfield (if empty, sets value to 0)\n var customQuantity = $(\"#customOrderQuanity\").val() ;\n if ((customQuantity == null) || (customQuantity == ''))\n \tcustomQuantity = 0;\n var pageCount = '';\n pageCount = $(\"#customOrderPages\").val();\n if ((pageCount == null) || (pageCount == ''))\n \tpageCount = 0;\n \t\n console.log(\"quantity: \" + customQuantity);\n console.log(\"pages: \" + pageCount);\n // customOrderPriceTotal;\n // Black and White\n console.log('----------'); \n\n if(customOrderValues.color == 'Black&White'){\n customOrderPrice += .08;\n console.log('color = Black & White'); \n\n // Paper Bleed \n if(customOrderValues.bleed == 'yes') {\n customOrderPrice += .04;\n console.log('bleed = Yes');\n } \n \n // Paper Size 8.5 x 11\n if(customOrderValues.size == '8.5x11') {\n console.log('size = 8.5x11');\n if(customOrderValues.paper == 'regular20lb'){\n // customOrderPrice += .01;\n console.log('option = regular20lb');\n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .01;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .03;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .04;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .06;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .08;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .10;\n console.log('option = heavyStock110lb'); \n }\n // Paper Size 8.5 x 14\n }else if(customOrderValues.size == '8.5x14'){\n console.log('else if -> 8.5x14');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .04;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .06;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .07;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .08;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .09;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .10;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .12;\n console.log('option = heavyStock110lb'); \n } \n // Paper Size 11 x 17 \n }else if(customOrderValues.size == '11x17'){\n console.log('else if -> 11x17');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .05;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .06;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .07;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .08;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .09;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .10;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .12;\n console.log('option = heavyStock110lb'); \n } \n // Paper Size 12 x 18\n }else if(customOrderValues.size == '12x18'){\n console.log('else if -> 12x18');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .08;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .08;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .09;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .10;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .11;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .12;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .13;\n console.log('option = heavyStock110lb'); \n } \n } \n\n // Color Custom Product \n }else {\n console.log('color = color'); \n customOrderPrice += .40;\n \n // Paper Bleed \n if(customOrderValues.bleed == 'yes') {\n customOrderPrice += .05;\n console.log('bleed = Yes');\n } \n \n // Paper Size 8.5 x 11\n if(customOrderValues.size == '8.5x11') {\n console.log('size = 8.5x11');\n if(customOrderValues.paper == 'regular20lb'){\n // customOrderPrice += .01;\n console.log('option = regular20lb');\n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .05;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .09;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .11;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .15;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .18;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .28;\n console.log('option = heavyStock110lb'); \n }\n // Paper Size 8.5 x 14\n }else if(customOrderValues.size == '8.5x14'){\n console.log('else if -> 8.5x14');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .05;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .35;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .39;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .41;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .45;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .48;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .58;\n console.log('option = heavyStock110lb'); \n } \n // Paper Size 11 x 17 \n }else if(customOrderValues.size == '11x17'){\n console.log('else if -> 11x17');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .20;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .35;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .39;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .41;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .45;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .48;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .58;\n console.log('option = heavyStock110lb'); \n } \n // Paper Size 12 x 18\n }else if(customOrderValues.size == '12x18'){\n console.log('else if -> 12x18');\n if(customOrderValues.paper == 'regular20lb'){\n customOrderPrice += .45;\n console.log('option = regular20lb'); \n }else if(customOrderValues.paper == 'premium28lb'){\n customOrderPrice += .45;\n console.log('option = premium28lb'); \n }else if(customOrderValues.paper == 'medium80lb'){\n customOrderPrice += .49;\n console.log('option = medium80lb'); \n }else if(customOrderValues.paper == 'heavy100lb'){\n customOrderPrice += .51;\n console.log('option = heavy100lb'); \n }else if(customOrderValues.paper == 'lightStock80lb'){\n customOrderPrice += .55;\n console.log('option = lightStock80lb'); \n }else if(customOrderValues.paper == 'meduimStock100lb'){\n customOrderPrice += .58;\n console.log('option = meduimStock100lb'); \n }else if(customOrderValues.paper == 'heavyStock110lb'){\n customOrderPrice += .68;\n console.log('option = heavyStock110lb'); \n } \n } \n } \n\n // Paper Options - Coated : Dull?\n if(customOrderValues.coated == 'Coated') {\n customOrderPrice += .05;\n console.log('coated = yes'); \n }\n\n// var customOrderValues = [];\n// customOrderValues.push( $(\"#customOrderSize\").find(':selected').data(\"price\") ); \n// customOrderValues.push( $( \"input[type=radio][name=customOrderColor]:checked\" ).data(\"price\"));\n// customOrderValues.push( $(\"#customOrderPaperCoating\").find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderEdge\").find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderPackaging\").find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderPaperStock\").find(':selected').data(\"price\") );\n// customOrderValues.push( $( \"input[type=radio][name=customOrderPrintOptions]:checked\" ).data(\"price\") );\n// customOrderValues.push( $(\"#customOrderBleed\").find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderLaminate\").find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderFold\").find(':selected').data(\"price\") );\n// // binding\n// customOrderValues.push( $( \"#customOrderBindingOptions\" ).find(':selected').data(\"price\") );\n// customOrderValues.push( $(\"#customOrderBindingTabs\").find(':selected').data(\"price\") );\n// // customOrderValues.push( $(\"#customOrderFinishing\").find(':selected').data(\"price\") );\n// // quanitiy\n// var customQuantity = $(\"#customOrderQuanity\").val() ;\n \n// // convert array of strings to array of num\n// var sum = customOrderValues.map(Number);\n\n// // sum of array in array x quantity\n// //customOrderPrice = (sum.reduce(function(a, b) { return a + b; })) * customQuantity ;\n\n// // sum of array cost per item\n// customOrderPrice = (sum.reduce(function(a, b) { return a + b; })) ;\n// customOrderPrice = customOrderPrice.toFixed(2);\n// // sum of array in array x quantity\n\n\t$('#quantityTotal').text(customQuantity);\n\tcustomOrderPrice = customOrderPrice * pageCount;\n\t\n\tif ((customOrderValues.edge == \"Standard\") && (customOrderValues.packaging == \"Shrink Wrap\") &&\n\t\t(customOrderValues.laminate == \"No\") && (customOrderValues.fold == \"No\") &&\n\t\t(customOrderValues.binding == \"None\") && (customOrderValues.tabs == \"None\"))\n\t{\n\t\tspecialPricing = false;\n\t\tcustomOrderPriceTotal = customOrderPrice * customQuantity;\n\t\tcustomOrderPriceTotal = customOrderPriceTotal.toFixed(2);\n\t\t$('#costPerItem').text('$' + customOrderPrice.toFixed(2)); \n\t $('#costTotal').text('$' + customOrderPriceTotal);\n\t}\n\t\n\telse\n\t{\n\t\tspecialPricing = true;\n\t\tcustomOrderPriceTotal = \"Special Pricing\";\n\t\t$('#costPerItem').text(customOrderPriceTotal);\n\t $('#costTotal').text(customOrderPriceTotal);\n\t}\n\n\tconsole.log(\"Basic Order Information\");\n\tconsole.log(\"<------------------------------->\");\n\tconsole.log(\"Project Page Length: \" + pageCount);\n\tconsole.log(\"Number of Copies: \" + customQuantity);\n\tconsole.log(\"Special Order and Binding options\");\n\tconsole.log(\"<------------------------------->\");\n\tconsole.log(\"Special Order Edge: \" + customOrderValues.edge);\n\tconsole.log(\"Special Order Packaging: \" + customOrderValues.packaging);\n\tconsole.log(\"Special Order Laminate: \" + customOrderValues.laminate);\n\tconsole.log(\"Special Order Fold: \" + customOrderValues.fold);\n\tconsole.log(\"Binding Options: \" + customOrderValues.binding);\n\tconsole.log(\"Binding Tabs: \" + customOrderValues.tabs);\n\tconsole.log(\"Specialized Pricing Applies (T/F): \" + specialPricing);\n\tconsole.log(\"Unit Price: \" + customOrderPrice);\n\tconsole.log(\"Total Price: \" + customOrderPriceTotal);\n\tconsole.log(\"....... order costs retreived\");\n /* customOrderPriceTotal = 0;\n customOrderPrice = 0;*/\n}", "title": "" }, { "docid": "fe33237a087a817131b7edfb964e683e", "score": "0.5879782", "text": "function init_ecommerce(){\n\n var current_min_price = 0,\n current_max_price = 500;\n\n $( '.price_slider' ).slider({\n range: true,\n min: 0,\n max: 700,\n values: [ current_min_price, current_max_price ],\n create: function() {\n $( '.price_label span.from' ).html( '$' + current_min_price );\n $( '.price_label span.to' ).html( '$' + current_max_price );\n },\n slide: function( event, ui ) {\n $( '.price_label span.from' ).html( '$' + ui.values[ 0 ] );\n $( '.price_label span.to' ).html( '$' + ui.values[ 1 ] );\n }\n });\n\n $('.input-radio', '#payment').on('change', function(){\n var val = $('.input-radio:checked', '#payment').val();\n $('.payment_box', '#payment').hide();\n $('.payment_method_'+val, '#payment ').show();\n });\n\n if (typeof $.fn.easyZoom !== \"undefined\") {\n $('.easyzoom').easyZoom();\n }\n\n var $tools = $('ul.grid-list');\n if($tools.length){\n $('a', $tools).on('click', function(e){\n e.preventDefault();\n var $this = $(this),\n $gridlist = $this.closest('.grid-list'),\n $products = $this.closest('#main').find('.products');\n\n $gridlist.find('a').removeClass('active');\n $this.addClass('active');\n $products\n .removeClass($this.data('remove'))\n .addClass($this.data('layout'));\n\n });\n }\n\n }", "title": "" }, { "docid": "8fa5dd46a989b8ab739a9362c79734bc", "score": "0.58756787", "text": "function calcPrice() {\n\tvar packInp = $('.js-pack:checked');\n\tvar price = 0;\n\n\tif (packInp.data('type') == 'single') {\n\t\tprice = 100;\n\t} else if(packInp.data('type') == 'multiple') {\n\t\tprice = 200;\n\t}\n\n\t$('.js-group-events:checked').each(function(i, el) {\n\t\tif(!$(el).siblings('.js-teamid').val()) {\n\t\t\tprice += 500;\n\t\t}\n\t})\n\n\t$('.js-workshop-events:checked').each(function(i, el) {\n\t\tprice += $(el).data(\"price\");\n\t})\n\n\t$('.js-amount').html('Total Amount: ' + price);\n}", "title": "" }, { "docid": "a7d2ebc119b89b714e9f191bca99826e", "score": "0.587303", "text": "function calculatePrice(userType, productType, price, publishedDate) {\n try {\n var price = 100;\n return whichClient(userType) + isNewProduct(productType) + price + todayRebate(publishedDate);\n } catch (ex) {\n console.log(ex);\n }\n return 0;\n}", "title": "" }, { "docid": "dc80558a3e6077dfc6f2f21c33f7f90e", "score": "0.5865965", "text": "function getCost() {\r\n\tif (productType[0].checked == true && nbElevator.value != 0) {\r\n\t\t// set the price and the fee of installation\r\n\t\tunitPrice.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(7565);\r\n\t\tpriceElevator.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(7565 * nbElevator.value);\r\n\t\tinstFee.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (7565 * 0.1));\r\n\t\ttotalCost.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (7565 * 1.1));\r\n\t} else if (productType[1].checked == true && nbElevator.value != 0) {\r\n\t\t// set the price\r\n\t\tunitPrice.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(12345);\r\n\t\tpriceElevator.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(12345 * nbElevator.value);\r\n\t\tinstFee.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (12345 * 0.13));\r\n\t\ttotalCost.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (12345 * 1.13));\r\n\t} else if (productType[2].checked == true && nbElevator.value != 0) {\r\n\t\t// set the price\r\n\t\tunitPrice.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(15400);\r\n\t\tpriceElevator.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(15400 * nbElevator.value);\r\n\t\tinstFee.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (15400 * 0.16));\r\n\t\ttotalCost.value = new Intl.NumberFormat(\"en-US\", {\r\n\t\t\tstyle: \"currency\",\r\n\t\t\tcurrency: \"USD\",\r\n\t\t}).format(nbElevator.value * (15400 * 1.16));\r\n\t} else {\r\n\t\treloadForm();\r\n\t}\r\n}", "title": "" }, { "docid": "491c36859daaaeffff3a6ea07fe2dc30", "score": "0.5856489", "text": "static applyProductPrice(productPrice) {\n cy.selectTab('M_ProductPrice');\n cy.pressAddNewButton();\n cy.writeIntoLookupListField('M_PriceList_Version_ID', productPrice.priceList, productPrice.priceList, true, true);\n\n cy.writeIntoStringField('PriceList', productPrice.listPriceAmount, true, null, true);\n cy.writeIntoStringField(\n 'PriceStd',\n productPrice.standardPriceAmount,\n true /*modal*/,\n null /*rewriteUrl*/,\n true /*noRequest*/\n );\n cy.writeIntoStringField('PriceLimit', productPrice.limitPriceAmount, true, null, true);\n\n const taxCategory = getLanguageSpecific(productPrice, 'taxCategory');\n cy.selectInListField('C_TaxCategory_ID', taxCategory, true);\n\n cy.pressDoneButton();\n }", "title": "" }, { "docid": "699838c8751a1fe75b82baa570af2d55", "score": "0.5847067", "text": "function watchSetPricesBtn() {\n $(document).on(\"click\", \"#js-setPrices\", event => {\n event.stopPropagation();\n event.preventDefault();\n $('input[name=priceRange]:checked').map(function () {\n howExpensive.push($(this).val());\n });\n if (howExpensive.length === 0) {\n $(\"#errorMessage\").text('Please select one or more price options');\n } else {\n priceStr = howExpensive.toString();\n $(\"#errorMessage\").empty();\n $(\"form\").html(content.foodForm);\n }\n })\n}", "title": "" }, { "docid": "59ecb6cd8234d84f020faab1e63ae8e2", "score": "0.5846877", "text": "function price_change(){\r\n console.log(\"ENTERING PRICE CHANGE ROUTINE\");\r\n // calculate price for pizzas only if size is already entered\r\n if (food_choice.includes(\"Pizza\")){\r\n\r\n if (size_choice != \"\"){\r\n\r\n // calculate base price\r\n base_price = size_prices[size_choice];\r\n\r\n // store toppings choices and update toppings price if they're not null\r\n if ($('#toppings').val() != \"\"){\r\n toppings_choices = $('#toppings').val();\r\n console.log(\"toppings_choices: \"+toppings_choices+\"; toppings_choices length: \"+toppings_choices.length );\r\n\r\n // control price for when topping is more than three or pizza is special\r\n if (toppings_choices.length > 3 || food_choice.includes(\"Special\")){\r\n toppings_price = 0;\r\n }\r\n else{\r\n toppings_price = toppings_prices[toppings_choices.length];\r\n }\r\n }\r\n else {\r\n toppings_price = 0;\r\n }\r\n } else {\r\n base_price = 0;\r\n toppings_price = 0;\r\n }\r\n }\r\n\r\n // else calculate price for subs\r\n else if (food_choice.includes(\"Sub\")){\r\n if (size_choice != \"\"){\r\n\r\n // calculate base price\r\n base_price = size_prices[size_choice];\r\n\r\n // store toppings choices and update toppings price\r\n if ($('#toppings').val() != \"\"){\r\n toppings_choices = $('#toppings').val();\r\n console.log(\"toppings_choices: \"+toppings_choices+\"; toppings_choices length: \"+toppings_choices.length );\r\n toppings_price = toppings_prices[1]*toppings_choices.length;\r\n }\r\n else {\r\n toppings_price = 0;\r\n }\r\n } else {\r\n base_price = 0\r\n toppings_price = 0;\r\n }\r\n }\r\n // else calculate price for Dinner Platter\r\n else if (food_choice.includes(\"Dinner Platters\")){\r\n console.log(\"entered Dinner Platters price calculation\");\r\n if (size_choice != \"\"){\r\n // calculate base price\r\n console.log(size_choice);\r\n console.log(\"entered size_choice != null\");\r\n base_price = size_prices[size_choice];\r\n }\r\n else{\r\n base_price = 0;\r\n }\r\n }\r\n // else calculate price for the Pasta and Salads\r\n else {\r\n // calculate base price\r\n console.log(\"entered Pasta and Salads price calculation\");\r\n base_price = size_prices[\"Regular\"];\r\n }\r\n\r\n // calculate order price\r\n console.log(\"base price is: $\"+base_price);\r\n console.log(\"toppings price is: $\"+toppings_price);\r\n order_price = parseFloat(base_price)+parseFloat(toppings_price);\r\n console.log(\"order price is: $\"+order_price);\r\n $('#order_price').text(order_price);\r\n\r\n return;\r\n}", "title": "" }, { "docid": "e93170b13efff33ea1c2bd693f32e368", "score": "0.5841645", "text": "function priceValidation(myfld,evnt,len,currList)\n{\n\tvar prec = 3;\n\tif(currList.value == \"select\")\n\t{\n\t\tif(currList.name == \"uom\")\n\t\t\talert(\"Please select Unit Of Measurement.\");\n\t\telse\n\t\t\talert(\"Please select currency.\");\n\t\tcurrList.focus();\n\t\treturn false;\n\t}\n\telse if(fnTrim(currList.value) != \"BD\")\n\t\tprec = 2;\n\tvar ln = len-3;\n\tvar keycode;\n\tif(window.event)\n\t\tkeycode = window.event.keyCode;\n\telse if(evnt)\n\t\tkeycode = evnt.which;\n\telse \n\t\treturn true;\n\n\tif(keycode == 46 || (keycode > 47 && keycode < 58))\n\t{\n\t\tif(keycode == 46 && myfld.value.indexOf('.')!=-1)\n\t\t\treturn false;\n\t\tif(keycode == 46 && myfld.value.length == ln)\n\t\t\treturn true;\n\t\tif(myfld.value.indexOf('.')!=-1)\n\t\t{\n\t\t\tif((myfld.value.length-myfld.value.indexOf('.')) <= prec )\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\tif(myfld.value.length < ln)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "8b798b9d13189b73731476e80867338c", "score": "0.5835876", "text": "function priceCalcs()\r\n{\t\r\n\tvar costPrice = 0;\r\n\tvar rrp = 0;\r\n\tvar distPrice = 0;\r\n\tvar wholesalePrice = 0;\r\n\r\n\t//get matrix line IDs as parameters\r\n\tgetParams();\r\n\t\r\n\t//get cost (base) price\r\n\tcostPrice = nlapiGetLineItemMatrixValue('price1', 'price', costPriceLineID, amountColumnID);\r\n\titemRecord.setFieldValue('custitem_label_ukprice', costPrice); //2.0.1 Display UK price inc. VAT on label - MJL\r\n\t//itemRecord.setFieldValue('custitem_label_europrice', costPrice); //[TODO] Uncomment this line after inclusion of EUR pricing sublist\r\n\t\r\n\t//calc and set RRP value, then return\r\n\trrp = rrpCalc(costPrice);\r\n\t\r\n\t//use RRP value to calc and return dist and wholesale prices\r\n\tdistPrice = distCalc(costPrice);\r\n\twholesalePrice = wholesaleCalc(costPrice);\r\n\t\r\n\t//commit RRP, dist price and wholesale price lines\r\n\titemCommit(rrp, distPrice, wholesalePrice);\r\n\t\r\n\t//submit item record\r\n\titemSubmit();\r\n}", "title": "" }, { "docid": "67d9e9d34fa6c6a795d16b1f647c2fa1", "score": "0.5828607", "text": "isPriceValid(price){\n\n if(isNaN(parseFloat(price))){\n return false;\n }\n \n if(price.length > 0){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "24b5ea41fcfc79313c81f7fb8406e856", "score": "0.5827363", "text": "function budgetCalculator(watch,mobile,laptop){\n if(watch <= 0 || mobile <= 0 || laptop <= 0){\n return \"error!!\"\n }\n\n else{\n var watchPrice = watch * 50;\n var mobilePrice = mobile * 100;\n var laptopPrice = laptop * 500;\n \n mainPrice = watchPrice+mobilePrice+laptopPrice;\n }\n return mainPrice\n}", "title": "" }, { "docid": "4f1501e86c2ea489ea3433bd73b01bfe", "score": "0.5786355", "text": "function validatebid_price(){\n\t\tvar current \t= $('#time').data('current');\n\t\tvar actual_bid \t= $('#_actual_bid').val();\n\t\tvar appendIn \t= $('div.product-type-auction').parent();\n\t\tvar roundval\t= RoundPrice(actual_bid);\n\t\t\n\t\t//check if bid is not rounded by 10\n\t\tif((actual_bid != roundval) && (actual_bid != listingprice)){\n\t\t\t$(appendIn).wacNotices({msgs: 'Please enter a Bid that is rounded to a multiplier of 10 (e.g. '+roundval+' instead of '+actual_bid+')'});\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//check if not a valid number\n\t\tif(actual_bid == ''){\n\t\t\t$(appendIn).wacNotices({msgs: 'Bid price is not correct!'});\n\t\t\treturn false;\n\t\t}\n\t\t//check max bid placed per user\n\t\telse if(bidplaced !== undefined && (bidplaced >= allowedbids)){\n\t\t\t$(appendIn).wacNotices({msgs: 'You can only bid on 3 Live Auctions at the same time.'});\n\t\t\treturn false;\n\t\t}\n\t\t//check bid price not more than 50% of listing price\n\t\telse if(listingprice !== undefined){\n\t\t\t//listing price 50% check\n\t\t\t$bidpricemax = listingprice*1.5;\n\t\t\t// console.log(actual_bid,$bidpricemax);\n\t\t\tif(actual_bid && actual_bid > $bidpricemax){\n\t\t\t\t$('#_actual_bid').val(current);\n\t\t\t\t$(appendIn).wacNotices({msgs: 'Bid more than 50% of listing price is not allowed!'});\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// console.log(actual_bid);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "93150e54b8502725667aa55f0fcc130d", "score": "0.57545084", "text": "function shopingCalculator(tshirt, sunglass, watch) {\n if (tshirt < 0 || sunglass < 0 || watch < 0) {\n return \"Please Pay Attention While Billing\";\n }\n else {\n var tshirtPrice = tshirt * 50;\n var sunglassPrice = sunglass * 100;\n var watchPrice = watch * 500;\n var totalPrice = tshirtPrice + sunglassPrice + watchPrice;\n }\n return totalPrice;\n}", "title": "" }, { "docid": "2cb20985e9d6b3b65ced6e2bb85cb26b", "score": "0.5736371", "text": "function checkAndSet(check) {\n if (check.parentElement.classList.contains('chair-title')) {\n nameTitle.innerText = check.innerText;\n valTitle.innerText = check.dataset.price;\n }\n if (check.parentElement.classList.contains('chair-color')) {\n nameColor.innerText = check.innerText;\n valColor.innerText = check.dataset.price;\n }\n if (check.parentElement.classList.contains('chair-pattern')) {\n namePattern.innerText = check.innerText;\n valPattern.innerText = check.dataset.price;\n }\n }", "title": "" }, { "docid": "d26cc9b27cadf574126ad8e10dbd1600", "score": "0.57344776", "text": "function preparePriceAndDiscount() {\n if (!$scope.showDiscount) {\n $scope.product.percentage_off = null;\n $scope.product.original_price = null;\n return;\n }\n if ($scope.product.percentage_off && !$scope.presentPercentageOff) {\n $scope.product.percentage_off = null;\n }\n if ($scope.product.original_price && !$scope.presentOriginalPrice) {\n $scope.product.original_price = null;\n }\n }", "title": "" }, { "docid": "114d080c9537df69343c08269ed9eaa7", "score": "0.569691", "text": "constructor(productName, price, website) {\n this.productName = productName;\n this.price = price;\n this.website = website; \n }", "title": "" }, { "docid": "c95f78a261f91f7e6c5eca32a50241ed", "score": "0.5688531", "text": "function getPrice() {\n if (price_alogoritm_fibonaci) {\n\n return fibonacci_algoritm();\n } else if (price_alogoritm_randValue) {\n\n return rand_value_algoritm();\n } else if (price_alogoritm_double) {\n\n return double_algoritm();\n }\n\n // return 0;\n}", "title": "" }, { "docid": "e556e52cbfc814cd12cc6f723cd38d7a", "score": "0.5683028", "text": "function orderprice(){\n \n \n \n if($('#order_type').val()=='1'){\n \n order_trigger_price=\"0\";\n order_price=\"0\";\n \n }\n else if($('#order_type').val()=='2'){\n \n order_price=$('#order-price').val(); \n order_trigger_price=\"0\"; \n \n }\n else if($('#order_type').val()=='3'){\n \n order_price=$('#order-price').val(); \n order_trigger_price=$('#order-trigger-price').val();\n \n }\n else if($('#order_type').val()=='4'){\n \n order_trigger_price=$('#order-trigger-price').val(); \n order_price=\"0\";\n \n }\n \n }", "title": "" }, { "docid": "55bd72e6c00881a8ab92da84691dd2a7", "score": "0.56755716", "text": "function setTooLowPrice(opts, side) {\n try {\n if (side === 'buy') return;\n let otherSide = 'buy';\n let baseUnheldBalance = getBaseUnheldBalance(opts);\n let quoteUnheldBalanceConverted = getQuoteUnheldBalanceConverted(opts);\n // you cannot limit sell for the best ask\n opts[side].tooLowPrice = opts.product.ticker.best_bid;\n // maintain a larger balance of quote currency as the rate increases\n let holdQuotePercent = getRateHoldPercent(opts, side, opts[side].tooLowPrice);\n let fullHeld = addRound8(baseUnheldBalance, quoteUnheldBalanceConverted);\n\n // check whether to boost selling\n if (opts.product.config.lowHeldPercent && opts.product.config.boost) {\n // check if low base currency held. if held is < total held * low held percent then low held and sell more\n let held = quoteUnheldBalanceConverted;\n let lowHeld = multRound8(fullHeld, opts.product.config.lowHeldPercent);\n if (held < lowHeld) {\n // we don't hold much, boost orders to get more. for ltc boost buys, for btc boost sells\n opts[side].boostedSize = subRound8(lowHeld, held);\n // don't check other rules that limit the price\n return;\n }\n }\n\n let heldNeeded = multRound8(fullHeld, holdQuotePercent);\n if (heldNeeded > quoteUnheldBalanceConverted) {\n // find the higher rate that would be ok to sell at\n opts[side].tooLowPrice = Math.max(\n opts[side].tooLowPrice,\n getRateFromPercent(opts, side, divRound8(quoteUnheldBalanceConverted, fullHeld))\n );\n }\n log.debug(\n side +\n ' tooLowPrice: ' +\n opts[side].tooLowPrice +\n ', used quoteUnheldBalanceConverted: ' +\n quoteUnheldBalanceConverted +\n ', holdQuotePercent: ' +\n holdQuotePercent +\n ', fullHeld: ' +\n fullHeld +\n ', heldNeeded: ' +\n heldNeeded\n );\n // sell higher than last completed buy\n if (opts.product[side].lastFillPrice) {\n if (opts[side].tooLowPrice < opts.product[otherSide].lastFillPrice) {\n opts[side].tooLowPrice = opts.product[otherSide].lastFillPrice;\n }\n }\n // if last sell is more recent than last buy, sell higher than last sell\n if (moreRecent(opts.product[side].lastFillTime, opts.product[otherSide].lastFillTime)) {\n if (opts[side].tooLowPrice < opts.product[side].lastFillPrice) {\n opts[side].tooLowPrice = opts.product[side].lastFillPrice;\n }\n }\n log.debug(\n side +\n ' tooLowPrice: ' +\n opts[side].tooLowPrice +\n ', used quoteUnheldBalanceConverted: ' +\n quoteUnheldBalanceConverted +\n ', holdQuotePercent: ' +\n holdQuotePercent +\n ', fullHeld: ' +\n fullHeld +\n ', heldNeeded: ' +\n heldNeeded\n );\n } catch (err) {\n log.error(err.stack);\n }\n}", "title": "" }, { "docid": "bd0f42e4f15240cfd62472b02c0bf2bb", "score": "0.5675082", "text": "function priceCheck(fsym, tsyms) {\n let url = `${base}price?fsym=${fsym}&tsyms=${tsyms}`\n return fetchJSON(url)\n}", "title": "" }, { "docid": "8eda56adf5b4b34caa6b88091322b8f7", "score": "0.56736493", "text": "function getprice(symbol,currency) { \n var APIKey = \"f6c04b8c1b5d332df2dc000cf67455fc99d7ca2d00cc1d33a85e818756a85988\";\n queryURL = \"https://min-api.cryptocompare.com/data/pricemultifull?fsyms=\" + symbol + \"&tsyms=\" + currency + \"&api_key=\" + APIKey;\n console.log(queryURL)\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n spotdata = response;\n //var formattedChange;\n console.log(spotdata)\n price = parseFloat(spotdata.RAW[symbol][currency].PRICE)\n //changePCT = parseFloat(spotdata.RAW[symbol][currency].CHANGEPCT24HOUR)\n //formattedChange = changePCT.toFixed(2) \n var formattedPrice = price.toFixed(2) \n var transamount = parseFloat($(\"#quantity\").val().trim());\n //console.log(formattedChange)\n console.log(formattedPrice)\n console.log(currency)\n formattedPrice = transamount * formattedPrice;\n //$(\".change1\").text(formattedChange+\"%\")\n $(\"#price1\").text(formattedPrice + \" \" + currency);\n //$(\".change1\").html(formattedChange+\"%\")\n // console.log(formattedChange < 0)\n // if (formattedChange < 0) {\n // $(\"#change1\").addClass(\"callout alert\");\n // $(\"#change1\").text(formattedChange+\"%\")\n // } else {\n // $(\"#change1\").addClass(\"callout success\");\n // $(\"#change1\").text(formattedChange+\"%\")\n // }\n\n });\n}", "title": "" }, { "docid": "7958e4dd2ace87232cf64b55b2076f4e", "score": "0.56736237", "text": "function addListingPrice() {\n /**\n * Callback when items have finished adding.\n * @callback addCurrencies-callback\n * @param {Array} reasons - Array of reasons if value was not met for each currency.\n */\n \n /**\n * Add currencies to the trade.\n * @param {Boolean} isYou - Are we adding from your inventory?\n * @param {Object} currencies - Object containing currencies.\n * @param {addCurrencies-callback} callback - Callback when all items have been added.\n * @returns {undefined}\n */\n function addCurrencies(isYou, currencies, callback) {\n const names = Object.keys(currencies).filter((currency) => {\n return currencies[currency] > 0;\n });\n const reasons = [];\n const index = parseInt(page.controls.$index.val()) || 0;\n \n function addCurrency(callback) {\n let currency = names.shift(); // get first name and remove it from array\n let amount = currencies[currency];\n \n if (currency) {\n addItems(currency, amount, index, isYou, (satisfied) => {\n if (satisfied === false) {\n reasons.push(`not enough ${currency.toLowerCase()}`);\n }\n \n addCurrency(callback); // recurse\n });\n } else {\n return callback(reasons);\n }\n }\n \n addCurrency(callback);\n }\n \n // 0 = buy order\n // 1 = sell order\n const listingIntent = urlParams.listing_intent;\n // we are buying, add items from our inventory\n const isYou = listingIntent == 1;\n \n addCurrencies(isYou, {\n KEYS: parseInt(urlParams.listing_currencies_keys) || 0,\n METAL: parseFloat(urlParams.listing_currencies_metal) || 0\n }, (reasons) => {\n if (reasons.length > 0) {\n // display message if any currencies were not met\n alert(`Listing value could not be met: ${reasons.join(' and ')}`);\n }\n });\n }", "title": "" }, { "docid": "a45f707c76eab8cc2624015d6d211d9b", "score": "0.5672844", "text": "function setCupPrice() {\n\tpriceArr[0] = 0; //setting up cup price to 0\n\tfor (var i = 0; i < cupArr.length; i++) {\n\t\tif (cupArr[i].checked == true) {\n\t\t\tpriceArr[0] = parseFloat(cupArr[i].value); // if true add-up the value and return true\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "7780af0b7cafc5aa826c13eb2249b2c3", "score": "0.5670817", "text": "function LocalExtra() {\n var LocalPrice = 0;\n //Get a reference to the form id=\"getOptionsBooking\"\n var theForm = document.forms[\"getOptionsBooking\"];\n //Get a reference to the checkbox id=\"local\"\n var includeLocal = theForm.elements[\"local\"];\n\n //If they checked the box set LocalPrice to 60\n if (includeLocal.checked == true) {\n LocalPrice = 60;\n }\n //finally we return the candlePrice\n return LocalPrice;\n }", "title": "" }, { "docid": "a8d9255fe5e655d4391267bc2234e749", "score": "0.56578755", "text": "function checkChoice(whichbox) {\nwith (whichbox.form) {\nvar p = price.value;\nvar prior = priorval.value;\nvar savings = \"$0.00\";\n// Make sure value is a number and no decimal is entered, or reset to prior\nif (isNaN(whichbox.value)) {\nwhichbox.value = prior;\nwhichbox.focus();\n}\nwhichbox.value = Math.abs(whichbox.value);\nvar dec = whichbox.value.indexOf('.', 1)\nif (dec > 0) {\nalert('No decimal places allowed for \\\"' +whichbox.name +'\\\" !');\nwhichbox.value = prior;\nwhichbox.focus();\n}\nhiddentotal.value = eval(hiddentotal.value) - eval(p * prior);\nprior = whichbox.value;\nhiddentotal.value = eval(p * whichbox.value);\nsavings = formatCurrency(hiddentotal.value);\nreturn(savings.substring(0,(savings.length)-3));\n}\n}", "title": "" }, { "docid": "cf4ac9fa1feda840f0a8d11881e52d1b", "score": "0.5655194", "text": "function getSetPhonePrice(input){\n const price= price1*parseInt(input1.value)\n if(price){\n phonePrice.innerText=price\n return price\n }\n else{\n phonePrice.innerText=0\n input1.value=0\n return 0\n }\n}", "title": "" }, { "docid": "8a793a575dc8131e2483b83bf33c4963", "score": "0.5648003", "text": "function start(purchaseOrder,gainSellPoints,lossSellPoints) {\n\n // if (currentPrice.getCurrentPrice() >= purchaseprice + gainSellPoints)\n // sell it\n // else (currentPrice.getCurrentPrice() <= purchaseprice - lossSellPoints)\n // sell it\n}", "title": "" }, { "docid": "defbb70aa64fad5298d4f9d0a116c4c9", "score": "0.5643106", "text": "function calculator(userID, country, clothesType, productPrice) {\n switch (country) {\n case \"ترکیه\":\n var country = \"Turkey\";\n var currency = \"TL\";\n var currencyRate = 2000;\n var weightCost = 250000; // per killo\n var shippingCost = 150000; //defualt for shoes\n break;\n case \"انگلیس\":\n var country = \"UK\";\n var currency = \"UK-Pound\";\n var currencyRate = 39000;\n var weightCost = 600000; //70000 per killo dor kargo + 5000 Peik Iran\n var shippingCost = 500000;\n break;\n case \"فرانسه\":\n var country = \"FR\";\n var currency = \"Euro\";\n var currencyRate = 4900;\n var weightCost = 80000; //70000 per killo dor kargo + 5000 Peik Iran\n var shippingCost = 80000;\n break;\n }\n//final price is calculated based on userID, userMargin variable keeps this value for adding up to users final price.\n switch (userID) {\n case \"1\":\n case \"3\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n case \"22\":\n case \"25\":\n\t\tcase \"41\":\n case \"32\":\n var discount = 8000;\n var userMargin = 0;\n break;\n default:\n var discount = 0;\n var userMargin = 0;\n break;\n }\n // if uk selected as a country then discount is zero\n if (country === \"UK\" || country === \"FR\") {\n var discount = 0;\n }\n\n var benneksMargin = 0;\n var totalCost = 0;\n // set benneksmargin based on product price\n if (productPrice >= 0 && productPrice <= 100) {\n benneksMargin = 0.2;\n } else if (productPrice > 100 && productPrice <= 200) {\n benneksMargin = 0.15;\n } else {\n benneksMargin = 0.1;\n }\n// if buying from uk then benneks margin should be 15% regardless of productPrice\n if (country === \"UK\" || country === \"FR\") {\n benneksMargin = 0.23;\n }\n switch (clothesType) {\n//Man and Women bag\n case \"کیف زنانه\":\n case \"کیف مردانه\":\n case \"کیف بچه گانه\":\n weight = 600;\n shippingCost = (weightCost * 600) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women shoes\n case \"کفش زنانه\":\n case \"کفش مردانه\":\n case \"کفش بچه گانه\":\n weight = 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products around 200 gr\n case \"پیراهن مردانه\":\n case \"تی شرت مردانه\":\n case \"لباس زیر مردانه\":\n case \"شلوارک مردانه\":\n case \"مایو مردانه\":\n case \"شلوارک زنانه\":\n case \"تاپ زنانه\":\n case \"لباس زیر زنانه\":\n case \"تی شرت زنانه\":\n case \"کلاه، شال، روسری، دستکش\":\n case \"بیکینی\":\n case \"رو مایو زنانه\":\n case \"لباس خواب زنانه\":\n case \"ساپورت زنانه\":\n case \"بلوز زنانه\":\n case \"دامن زنانه\":\n case \"بلوز شلوار ست بچه گانه\":\n case \"تی شرت بچه گانه\":\n case \"سرهمی بچه گانه\":\n case \"لباس خواب بچه گانه\":\n case \"شلوارک جین بچه گانه\":\n case \"مایو بچه گانه\":\n case \"پلیور بچه گانه\":\n case \"پیراهن بچه گانه\":\n case \"دامن بچه گانه\":\n case \"2-3 سال\":\n case \"3-4 سال\":\n case \"4-5 سال\":\n case \"5-6 سال\":\n case \"6-7 سال\":\n case \"7-8 سال\":\n case \"8-9 سال\":\n case \"9-10 سال\":\n case \"10-11 سال\":\n case \"11-12 سال\":\n case \"12-13 سال\":\n case \"13-14 سال\":\n case \"0-1 ماه\":\n case \"2-4 ماه\":\n case \"4-6 ماه\":\n case \"6-12 ماه\":\n case \"12-18 ماه\":\n case \"18-24 ماه\":\n weight = 200;\n shippingCost = (weightCost * 200) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products around 300 gr\n case \"کاردیگان سبک زنانه\":\n case \"پلیورهای نازک زنانه\":\n case \"شلوار معمولی زنانه\":\n case \"پانچو\":\n case \"سرهمی زنانه\":\n case \"مانتو زنانه\":\n case \"سوئیت شرت زنانه\":\n weight = 300;\n shippingCost = (weightCost * 300) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products around 400 gr\n case \"شلوار معمولی مردانه\":\n case \"شلوار جین مردانه\":\n case \"پلیور مردانه سبک\":\n case \"کاردیگان زنانه\":\n case \"جین زنانه\":\n case \"کاردیگان سنگین زنانه\":\n case \"بارونی زنانه\":\n case \"کت تابستانی زنانه\":\n case \"پیراهن زنانه\":\n case \"کاپشن بچه گانه\":\n case \"گرمکن بچه گانه\":\n weight = 400;\n shippingCost = (weightCost * 400) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products around 600 gr\n case \"کت معمولی مردانه\":\n case \"کت زمستانی زنانه\":\n case \"کاپشن سبک زنانه\":\n case \"کت جین زنانه\":\n case \"کت چرم زنانه\":\n case \"پلیور سنگین زنانه\":\n case \"پالتو زنانه سبک\":\n weight = 600;\n shippingCost = (weightCost * 600) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products around 800 gr\n case \"گرمکن مردانه\":\n case \"کت جین مردانه\":\n case \"پلیور مردانه سنگین\":\n case \"کاپشن سبک مردانه\":\n case \"گرمکن زنانه\":\n case \"کاپشن سنگین زنانه\":\n case \"کت جیر زنانه\":\n case \"پالتو زنانه سنگین\":\n weight = 800;\n shippingCost = (weightCost * 800) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n //Man and Women products more than 1 kg\n case \"کاپشن سنگین مردانه\":\n case \"کت چرم مردانه\":\n case \"پالتو مردانه\":\n case \"اورکت مردانه\":\n case \"کت شلوار مردانه\":\n case \"سنگین زنانه\":\n weight = 1200;\n shippingCost = (weightCost * 1200) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n // others\n case \"کالای نیم کیلو\" :\n weight = 500;\n shippingCost = (weightCost * 500) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n\n case \"کالای یک کیلو\" :\n weight = 1000;\n shippingCost = (weightCost * 1000) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای یک و نیم کیلو\" :\n weight = 1500;\n shippingCost = (weightCost * 1500) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای دو کیلو\" :\n weight = 2000;\n shippingCost = (weightCost * 2000) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای دو و نیم کیلو\" :\n weight = 2500;\n shippingCost = (weightCost * 2500) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای سه کیلو\" :\n weight = 3000;\n shippingCost = (weightCost * 3000) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای سه و نیم کیلو\" :\n weight = 3500;\n shippingCost = (weightCost * 3500) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای چهار کیلو\" :\n weight = 4000;\n shippingCost = (weightCost * 4000) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کالای پنج کیلو\" :\n weight = 5000;\n shippingCost = (weightCost * 5000) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n case \"کیف پول\":\n case \"کمربند\":\n case \"عینک\":\n case \"عطر\":\n case \"ساعت\":\n case \"زیورآلات\":\n case \"جوراب\":\n case \"انواع کلاه بچه گانه\":\n case \"جوراب و لباس زیر بچه گانه\":\n case \"اسباب بازی بچه گانه\":\n case \"تمامی لباس های نوزادی\":\n weight = 120;\n shippingCost = (weightCost * 120) / 1000;\n totalCost = (productPrice * currencyRate) + ((productPrice * currencyRate) * benneksMargin) + shippingCost + ((productPrice * currencyRate) * userMargin) - discount;\n //return totalCost;\n return {\n totalCost: totalCost,\n productWeight: weight,\n benneksMargin: benneksMargin,\n currencyRate: currencyRate,\n currency: currency,\n iranDeliverCost: shippingCost\n }\n break;\n }\n\n}", "title": "" }, { "docid": "9ba019f3b3eca68d02e487fb0ad6e0f2", "score": "0.56428903", "text": "function setDollar2(){\n costPreference = 2\n }", "title": "" }, { "docid": "fe991bca21232ee881045d1f06670bda", "score": "0.5639284", "text": "function setDollar1(){\n costPreference = 1\n }", "title": "" }, { "docid": "3a4c3f2fe292b621ef69eed0df34c729", "score": "0.5638942", "text": "function ValidatePricing()\n\t{\n\t \n\t ErPricingSht001='Add Failed. ';\n\t\t//Set short message with the error code\t\n\t\tvar ShortMessage=ErPricingSht001;\n\t\t//set long message as empty\n\t\tvar LongMessage=\"\";\n\t\t//check textbox login name is empty\n\t\tif(true==IstxtEmpty('txtPricingElement'))\n\t\t{\n\t\t\t//check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErPricingElement001;\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErPricingElement001;\n\t\t\t}\t\t\t\n\t\t}\n\t\tif(true==IstxtEmpty('txtPricingFee'))\n\t\t{\n\t\t\t//check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErPricingElement002;\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErPricingElement002;\n\t\t\t}\t\t\t\n\t\t}\n\t\telse if(!((0 <= parseFloat(document.all('txtPricingFee').value)) && (99999999.99 >= parseFloat(document.all('txtPricingFee').value))))\n\t {\n\t //check long message is empty\n\t\t\tif(\"\"==LongMessage)\n\t\t\t{\n\t\t\t\t//set long message\n\t\t\t\tLongMessage=ErPricingElement004;\n\t\t\t}\n\t\t\t//if long message is not empty\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set longmessage with newline char and long message code\n\t\t\t\tLongMessage=LongMessage + '\\n' + ErPricingElement004;\n\t\t\t}\t\n\t }\n\t\t//if long message is empty\n\t\tif(\"\"==LongMessage)\n\t\t{\n\t\t\t//Validation success\n\t\t\treturn true;\n\t\t}\n\t\t//if long message is not empty\n\t\telse\n\t\t{\n\t\t\t//set error message on toppage\n\t\t\tSetErrorMessage(ShortMessage,LongMessage);\n\t\t\t//validation failure\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "a8528cebd5c450d0f78bbf597b14aa79", "score": "0.5617672", "text": "function price(){\n result = (room_price * days_between($('#booking_check_in').val(),$('#booking_check_out').val()))\n if (room_checked_count != 0) {\n result = (result * room_checked_count)\n $('#amount').text(result);\n $('#amount_hidden').val(result)\n }else {\n $('#amount').text(0);\n }\n}", "title": "" }, { "docid": "c89350b9d5ef563cb047cefa41a63247", "score": "0.5605872", "text": "enoughMoney() {\n if (this.money >= this.choice.price) {\n return true;\n } else {\n console.error(\"Not enough money\");\n return false;\n }\n }", "title": "" }, { "docid": "3b96c93f451f9497d34ce1efcb110b64", "score": "0.55973715", "text": "function calcPrice() {\n var basePrice = 6 ;\n \n var addOnCost = null;\n console.log(addOnCost);\n /* selezionare checked box */\n var checks = document.querySelectorAll(\"input[type='checkbox']\");\n console.log(checks);\n /* Calcolare il totale delle aggiunte tramite controllo checked box */\n for (let index = 0; index < checks.length; index++) {\n const element = checks[index];\n console.log(element);\n var elPrice = element.getAttribute(\"data-price\");\n console.log(elPrice);\n if (element.checked == true){\n addOnCost += Number(elPrice)\n }\n \n }\n //Prezzo con aggiunte utente\n var addBurgerPrice = basePrice + addOnCost;\n console.log(addBurgerPrice);\n //Lista coupon sconto\n var couponSconto = [\"sconto10\",\"sconto15\",\"sconto20\"]\n //Verifica coupon, applica sconto, stampa\n var userFinalPrice = document.getElementById(\"show_price\");\n console.log(userFinalPrice);\n var inputCoupon = document.getElementById(\"coupon\").value;\n if (couponSconto.includes(inputCoupon) && inputCoupon === \"sconto10\" ){\n addBurgerPrice -= addBurgerPrice * 0.1;\n userFinalPrice.innerHTML = \"$ \" + addBurgerPrice;\n \n } else if (couponSconto.includes(inputCoupon) && inputCoupon === \"sconto15\") {\n addBurgerPrice -= addBurgerPrice * 0.15;\n userFinalPrice.innerHTML = \"$ \" + addBurgerPrice;\n }else if (couponSconto.includes(inputCoupon) && inputCoupon === \"sconto20\"){\n addBurgerPrice -= addBurgerPrice * 0.15;\n userFinalPrice.innerHTML = \"$ \" + addBurgerPrice;\n } else {\n userFinalPrice.innerHTML = \"$ \" + addBurgerPrice;\n }\n}", "title": "" }, { "docid": "fd3fa0cb93c3d7ab52ae203a326b0520", "score": "0.55938745", "text": "function show_product_price() {\n\tcurrentprice = extract_value(postbody, 'Current price:', '<br');\n\tdiscountprice = extract_value(postbody, 'Discount price:', '<br');\n\tif (parseFloat(discountprice) > 0 && parseFloat(discountprice) < parseFloat(currentprice)) {\n\t\tvar discpercentage = (100-((100*discountprice)/currentprice)).toFixed(0);\n\t\tdocument.write('<table class=\"prices\"><tr><td rowspan=2 class=\"text\">' + translate_sentence('Price') + ':</td>');\n\t\tdocument.write('<td rowspan=2 class=\"final-price\">' + format_currency(discountprice) + '</td><td class=\"off\">');\n\t\tdocument.write('<div class=\"item_price hide\">' + discountprice + '</div>');\t//The price must be in USD for checkout.\n\t\tif (selected_language == 'es') {document.write('&#161;');}\n\t\tdocument.write(discpercentage + '% ' + translate_sentence('OFF') + '!</td></tr><tr><td class=\"off\"><s>' + format_currency(currentprice) + '</s></td></tr></table>');\n\t} else {\n\t\tdocument.write('<div class=\"prices\"><center><table><td class=\"text\">' + translate_sentence('Price') + ':</td>');\n\t\tdocument.write('<td class=\"final-price\">' + format_currency(currentprice) + '<td></table></center></div>');\n\t\tdocument.write('<div class=\"item_price hide\">' + currentprice + '</div>');\t//The price must be in USD for checkout.\n\t}\n}", "title": "" }, { "docid": "3e72454376ef721aac69eec2318e4a37", "score": "0.55936587", "text": "function setMainPrice() {\n var selectedSku = ProductData.selectedSku;\n var mainPrice = $('#main-price');\n var totalPrice = $('#total-price');\n totalPrice.html('<p>בחר מהאפשרויות</p>');\n\n var notSelectedMsg = $('#not-selected-sku');\n\n selectedNoKeys = [];\n for (var i in selectedSku) {\n selectedNoKeys.push(selectedSku[i]);\n }\n\n for (var i in ProductData.skuData) {\n var skuSet = ProductData.skuData[i].skuPropIds.split(\",\");\n\n\n ProductData.selectedSkuVariant = ProductData.skuData[i];\n // convert array to unnamed array ( to make intersections possible )\n skuSet = skuSet.map(function (item) {\n return +item;\n });\n\n // find intersection between selected things and available sku set ( array of IDs )\n intersect = _.intersection(skuSet, selectedNoKeys);\n\n // if selected stuff matches with any set of sku - set new price\n if (intersect.length === ProductData.totalSkuNum) {\n // ProductData.mainPrice = Math.ceil(+ProductData.skuData[i].skuVal.skuCalPrice);\n ProductData.mainPrice = isNaN(ProductData.skuData[i].skuVal.actSkuCalPrice)\n ? Math.ceil(+ProductData.skuData[i].skuVal.skuCalPrice)\n : ProductData.skuData[i].skuVal.actSkuCalPrice;\n ProductData.original_mainPrice = isNaN(ProductData.skuData[i].skuVal.original_actSkuCalPrice)\n ? Math.ceil(+ProductData.skuData[i].skuVal.original_skuCalPrice)\n : ProductData.skuData[i].skuVal.original_actSkuCalPrice;\n\n // reset quantity selector\n qty(1);\n\n // set main price ( in the top )\n mainPrice.html(ProductData.mainPrice + '<i class=\"fa fa-ils custom-fa\"></i> ');\n $('.button-price').html(ProductData.mainPrice + '<i class=\"fa fa-ils custom-fa\"></i> ');\n\n // set total price ( main * quantity + shipping )\n totalPrice.html(((+ProductData.mainPrice) + (+ProductData.shipping['cost'])) + '<i class=\"fa fa-ils custom-fa\"></i> ');\n\n\n notSelectedMsg.addClass(\"my-hidden\");\n\n // make add button active\n $('.add-to-cart-button').removeClass(\"unavailable\");\n\n // show available amount of items\n $('#available-amount').html(ProductData.selectedSkuVariant.skuVal.availQuantity);\n\n return;\n } else delete ProductData.mainPrice;\n }\n\n\n // disable buy button and restore warning text\n // $('#add-to-cart-button').prop('disabled', true);\n\n notSelectedMsg.removeClass(\"my-hidden\");\n\n // set price back to base if not all required sku's selected\n mainPrice.html(ProductData.priceRange + '<i class=\"fa fa-ils custom-fa\"></i> ');\n $('.button-price').html(ProductData.priceRange + '<i class=\"fa fa-ils custom-fa\"></i> ');\n }", "title": "" }, { "docid": "823bb1c4873d8b1920dc920e2ba09a7d", "score": "0.5591722", "text": "function cake (name,price){\n if(price>=10){\n console.log(name+\"is a piece of art\");\n }else{\n console.log(name+\"is just soso\");\n }\n}", "title": "" }, { "docid": "709f1f0acac70b31374578dce9ad4836", "score": "0.55900794", "text": "function CheckBasePrice(group_id, group_item_count, group_item_serial, group_count, aftertax){\r\n var tax = '';\r\n if(aftertax=='1'){\r\n tax = 'at_'\r\n }else if(aftertax=='0'){\r\n tax = 'bt_'\r\n }\r\n var item_qty = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_qty\").value);\r\n var tax_rate = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_tax_rate\").value);\r\n var base_price = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_baseprice\").value);\r\n var net_price = parseFloat(document.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_netprice\").value);\r\n var base_disc = parseInt(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_basedisc\").value);\r\n var disc = CheckNumeric(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value);\r\n var emp_quote_discountupdate = document.getElementById(\"emp_quote_discountupdate\").value;\r\n var emp_quote_priceupdate = document.getElementById(\"emp_quote_priceupdate\").value;\r\n if(emp_quote_discountupdate=='1'){\r\n if(eval(base_price)<eval(disc)){\r\n document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value = parseInt(base_price);\r\n }\r\n }else if(emp_quote_discountupdate=='0'){\r\n if(eval(base_disc)<eval(disc)){\r\n document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value = base_disc;\r\n }\r\n }\r\n disc = CheckNumeric(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value);\r\n document.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_total\").innerHTML = CheckNumeric(((((base_price - disc)*tax_rate/100)+(base_price - disc)))*item_qty).toFixed(2);\r\n document.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_amount\").value = CheckNumeric(((((base_price - disc)*tax_rate/100)+(base_price - disc)))*item_qty).toFixed(2);\r\n GroupValue(group_id, group_item_count, group_count, aftertax);\r\n CalculateTotal(aftertax);\r\n}", "title": "" }, { "docid": "98c74c6a8f5353c6123d55e59e1cfabf", "score": "0.55851793", "text": "function discountPrice() {\n if(!discountCheckbox.checked) {\n switch (slider.value) {\n case '1' :\n price.textContent = `$8.00` \n break;\n case '2' :\n price.textContent = `$12.00` \n break;\n case '3' :\n price.textContent = `$16.00` \n break;\n case '4' :\n price.textContent = `$24.00` \n break;\n case '5' :\n price.textContent = `$36.00` \n break;\n\n default: \n };\n } \n\n if(discountCheckbox.checked) {\n switch (slider.value) {\n case '1' :\n price.textContent = `$6.00` \n break;\n case '2' :\n price.textContent = `$9.00` \n break;\n case '3' :\n price.textContent = `$12.00` \n break;\n case '4' :\n price.textContent = `$18.00` \n break;\n case '5' :\n price.textContent = `$27.00` \n break;\n\n default: \n };\n }\n}", "title": "" }, { "docid": "4689115cb5e981b8f1fa250ff3716f99", "score": "0.55838156", "text": "function isPriceFormValid(){\r\n return(ImcField_Client.isValid() && ImcField_Com.isValid() && PuplicField_Comp.isValid() && InternationalField.isValid() && PuplicField_Client.isValid() && ValidFromField.isValid());\r\n }", "title": "" }, { "docid": "e1a303b1b440ae8827030ecb7c996e44", "score": "0.558138", "text": "function calculatePricing()\n\t{\n\t\tvar sellValue, marginValue, costValue, profitValue;\n\t\t\n\t\tsellValue = sell.getValue();\n\t\tmarginValue = margin.getValue();\n\t\t\n\t\tcostValue = sellValue - (sellValue * marginValue) / 100;\n\t\tprofitValue = (sellValue - costValue);\n\t\t\t\n\t\tcost.setValue(costValue);\n\t\tprofit.setValue(profitValue);\n\t}", "title": "" }, { "docid": "5ea74176adcae1f9185f26c4efea7cb5", "score": "0.55805165", "text": "function enquire(){\n serviceTag = document.getElementById(\"service\");\n priceList = document.getElementById(\"priceTag\");\n toDisplay = document.getElementById(\"billingAddress\");\n payNow = document.getElementById(\"payNow\");\n myForm = document.getElementById(\"form\");\n prefill();\n serviceTag.onchange = checkPrice;\n option.onclick = showDifferentBilling;\n myForm.onsubmit = checkForm;\n}", "title": "" }, { "docid": "bc03caab01e424f254c9967f603275fb", "score": "0.5578078", "text": "function priceCheck(value) {\n if (/(\\d+\\.\\d{1,2})/.test(value)) {\n return true\n }\n return chalk.red('Please enter a valid number')\n}", "title": "" }, { "docid": "a3dd89ab241019dd131a8cab112ede31", "score": "0.5574291", "text": "function calcTotalPrice(summe, discount) {\n let total = 0;\n discount = calcSale();\n\n if (summe >= 20) {\n document.getElementById('deliverycosts').innerHTML = `${freedelivery.toFixed(2).replace(\".\", \",\")} €`; //freedelivery is defined at vriables.js (0€)\n noDeliveryCosts(total, summe, discount);\n } else {\n payDeliveryCosts(total, summe, discount);\n }\n}", "title": "" }, { "docid": "de4b7405f692f2e8c23bfb48ce81035a", "score": "0.55707574", "text": "function priceUpdate () {\n\t\tapple.priceCalculator();\n\t\t$('.apple').find('.price').find('span').remove();\n\t\t$('.apple').find('.price').append('<span> Price: $' + apple.price.toFixed(2) +'</span>');\n\t\tbanana.priceCalculator();\n\t\t$('.banana').find('.price').find('span').remove();\n\t\t$('.banana').find('.price').append('<span> Price: $' + banana.price.toFixed(2) +'</span>');\n\t\tgrape.priceCalculator();\n\t\t$('.grape').find('.price').find('span').remove();\n\t\t$('.grape').find('.price').append('<span> Price: $' + grape.price.toFixed(2) +'</span>');\n\t\torange.priceCalculator();\n\t\t$('.orange').find('.price').find('span').remove();\n\t\t$('.orange').find('.price').append('<span> Price: $' + orange.price.toFixed(2) +'</span>');\n\t}", "title": "" }, { "docid": "ef776b9248201d8d0d6e52e33bdf9715", "score": "0.5553466", "text": "function updatePrice() {\r\n var initialPrice = $('.price-update').data('price');\r\n var total = initialPrice;\r\n $('.addon-product .checkbox input:checked').each( function() {\r\n total += $(this).closest('.addon-product').find('.addon-variant-price').data('price');\r\n });\r\n $('.price-update').html( formatCurrency( total ) ).addClass('emphasis');\r\n setTimeout(function() {\r\n $('.price-update').removeClass('emphasis');\r\n }, 150);\r\n }", "title": "" }, { "docid": "c273f8277f0e11ffe268fa0ec85b8314", "score": "0.55530465", "text": "function checkForm() {\n var a = true\n if (isNaturalNumber($pr_price.val())) {\n if (Number($pr_price.val()) > 500000) {\n $('#error-price').html('Tiền có giá trị 0 - 500.000')\n a = false\n } else {\n $('#error-price').html('')\n }\n } else {\n $('#error-price').html('Tiền là giá trị số dương')\n a = false\n }\n\n if (isValidName($pr_name.val())) {\n $('#error-name').html('')\n } else {\n $('#error-name').html('Tên là ký tự chữ số dài từ 2 - 200 ký tự')\n a = false\n }\n if (a) emptyError()\n return a;\n }", "title": "" }, { "docid": "5126537fd0a1f585859e8cac856e207b", "score": "0.5550219", "text": "async setXrpPrice() {\n this.setState({fetchingPrice: true});\n //get price calc from server\n let response = await fetch(`${Routing.domain}/pricing`, {\n method: \"POST\",\n headers: {\"Content-Type\": \"text/plain\"}\n });\n if (response.ok) {\n //set state with retreived data\n response.json()\n .then(body => {\n const totalNoTip = (body.data.other.total + body.data.xrp.total + body.data.stripe.flatFee) / (1 - body.data.stripe.percentage);\n //calc fees from https://support.stripe.com/questions/charging-stripe-fees-to-customers\n const stripeTotal = ((body.data.other.total + body.data.xrp.total + this.state.pricing.calc.tip + body.data.stripe.flatFee) / (1 - body.data.stripe.percentage)) - (body.data.other.total + body.data.xrp.total + this.state.pricing.calc.tip);\n const total = body.data.other.total + body.data.xrp.total + this.state.pricing.calc.tip + stripeTotal;\n const calc = {\n stripeTotal: stripeTotal,\n xrpTotal: body.data.xrp.total,\n tip: this.state.pricing.calc.tip,\n total: total,\n }\n this.setState({fetchingPrice: false, pricing: {...body.data, calc: calc, totalNoTip: totalNoTip}})\n })\n }\n }", "title": "" }, { "docid": "bb73474323ffb3131b306786d0d2f577", "score": "0.5549446", "text": "function setHostingBasedOnGT() {\n document.getElementById(\"AODBaseQty\").value = getCellValue(document.getElementById(\"GTSuiteTOTRus\"));\n // document.getElementById(\"GTSuiteTOTRus\").getElementsByClassName(\"tdRUS\")[0].onchange();\n checkRules(document.getElementById(\"GTSuiteTOTRus\").getElementsByClassName(\"tdRUS\")[0]);\n document.getElementById(\"GTFullQty\").value = getCellValue(document.getElementById(\"GTSuiteTOTRus\"));\n // document.getElementById(\"GTFullQty\").onchange();\n checkRules(document.getElementById(\"GTFullQty\"));\n SetPrices(); // Sets the AODHosting Prices based on the currency\n}", "title": "" }, { "docid": "81f004705867128b1d4c38d6bcf55845", "score": "0.5542911", "text": "function alacarte_init_price_filter() {\n $( 'input#min_price, input#max_price' ).hide();\n $( '.price_slider, .price_label' ).show();\n\n var min_price = $( '.price_slider_amount #min_price' ).data( 'min' ),\n max_price = $( '.price_slider_amount #max_price' ).data( 'max' ),\n current_min_price = $( '.price_slider_amount #min_price' ).val(),\n current_max_price = $( '.price_slider_amount #max_price' ).val();\n if(typeof $.slider != 'undefined'){\n $( '.price_slider:not(.ui-slider)' ).slider({\n range: true,\n animate: true,\n min: min_price,\n max: max_price,\n values: [ current_min_price, current_max_price ],\n create: function() {\n\n $( '.price_slider_amount #min_price' ).val( current_min_price );\n $( '.price_slider_amount #max_price' ).val( current_max_price );\n\n $( document.body ).trigger( 'price_slider_create', [ current_min_price, current_max_price ] );\n },\n slide: function( event, ui ) {\n\n $( 'input#min_price' ).val( ui.values[0] );\n $( 'input#max_price' ).val( ui.values[1] );\n\n $( document.body ).trigger( 'price_slider_slide', [ ui.values[0], ui.values[1] ] );\n },\n change: function( event, ui ) {\n\n $( document.body ).trigger( 'price_slider_change', [ ui.values[0], ui.values[1] ] );\n }\n });\n }\n }", "title": "" }, { "docid": "437e150c48389ee7168f3b838db37a0f", "score": "0.5536965", "text": "function checkCurrentPrice(){\n\trequest(queryUrl, function(error, response, body) {\n\t\n\t// If user has empty input \n \tif(!error && response.statusCode === 200) {\n \t// Display output \n \tvar currentPrice = JSON.parse(body).data.amount;\n \tvar ans = ((currentPrice - entryPrice)/entryPrice) *100;\n \tvar percentChange = Math.round(ans*100)/100;\n \n \tif (ans <= 0) {\n \t\tvar textMessage = dateFormat(now) + \"\\n\" + \"percent change \"+ percentChange + \"%\"+ \"\\n\" +\n \"Current Price $\" + currentPrice + \"\\n\" + \" Buy now!\";\n \t\tconsole.log(percentChange);\n \t\tconsole.log(textMessage);\n \t\tsendMessage(textMessage);\n\n // if ans is greater than 20 then \"Sell now!\" \t\t\n \t}else if (ans >= 20){\n \t\tvar textMessage = dateFormat(now) + \"\\n\"+ \"percent change \" + percentChange +\"%\"+ \"\\n\" +\n \"Current Price $\" + currentPrice + \"\\n\" + \" Sell now!\";\n \t\tconsole.log(percentChange);\n \t\tconsole.log(textMessage);\n \t\tsendMessage(textMessage);\n \t}else{ \n \t\treturn; // No action taken\n \t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d70dc4ba10d3720b650f5ef147c999e5", "score": "0.5535102", "text": "function checkRepairCost()\r\n {\r\n $repairCost = $('#repair-cost-input').val();\r\n \r\n // if string not empty remove dollar sign if there\r\n //if ($repairCost != \"\")\r\n //{\r\n $repairCost = $repairCost.replace(\"$\", \"\");\r\n //}\r\n\r\n // check for vaild repair cost type or allow if blank\r\n if ($repairCostRegex.test($repairCost) == true || $repairCost == \"\")\r\n {\r\n $('#repair-cost-input').css('background-color', 'white');\r\n }\r\n else\r\n {\r\n $errorMessagesArray.push(\"Repair Cost - Must contain full numbers and decimals only. Maxmium of 10 characters allowed. If no repair cost is available, leave blank.\");\r\n $('#repair-cost-input').css('background-color', '#ffaeb0');\r\n \r\n }\r\n }", "title": "" }, { "docid": "784f444183cdff6fd4f634eada7a8f2f", "score": "0.55340964", "text": "function latteChoiceMade() {\n var size = document.getElementsByName(\"sizeLatte\");\n var extras = document.getElementsByName(\"extrasLatte\");\n var quantity = Number(document.getElementsByName(\"qtyLatte\")[0].value);\n\n var sizePrice = 0;\n var extraPrice = 0;\n var drinkPrice;\n\n if (quantity == 0) {\n quantity = 1;\n }\n if (size[0].checked) {\n sizePrice = Number(size[0].value);\n }\n if (size[1].checked) {\n sizePrice = Number(size[1].value);\n }\n if (size[2].checked) {\n sizePrice = Number(size[2].value);\n }\n if (extras[0].checked) {\n extraPrice = Number(extras[0].value) + extraPrice;\n }\n if (extras[1].checked) {\n extraPrice = Number(extras[1].value) + extraPrice;\n }\n if (extras[2].checked) {\n extraPrice = Number(extras[2].value) + extraPrice;\n }\n if (extras[3].checked) {\n extraPrice = Number(extras[3].value) + extraPrice;\n }\n if (extras[4].checked) {\n extraPrice = Number(extras[4].value) + extraPrice;\n }\n\n drinkPrice = sizePrice + extraPrice;\n drinkPrice = drinkPrice * quantity;\n var priceString = \"LKR \" + drinkPrice;\n\n document.getElementsByClassName('shop-item-price')[0].innerText = priceString;\n}", "title": "" }, { "docid": "07cc0da9b537e84e61cf454644be153b", "score": "0.5530875", "text": "function CheckBasePrice(){\r\n var base_price = document.getElementById(\"txt_item_baseprice\").value;\r\n var price_variable = document.getElementById(\"txt_item_pricevariable\").value;\r\n var price = document.getElementById('txt_item_price').value;\r\n if((eval(price) < eval(base_price)) && price_variable!=1){\r\n document.getElementById('txt_item_price').value = base_price;\r\n price = base_price;\r\n CalItemTotal();\r\n }\r\n}", "title": "" }, { "docid": "70ae9ca1bcc7c5be056a58ab0bc08d69", "score": "0.5524052", "text": "function updatePrice(type, price) {\n if (type.includes(\"8GB\")) {\n extraMemory.innerText = price;\n } else if (type.includes(\"16GB\")) {\n extraMemory.innerText = price;\n } else if (type.includes(\"256GB\")) {\n extraStorage.innerText = price;\n } else if (type.includes(\"512GB\")) {\n extraStorage.innerText = price;\n } else if (type.includes(\"1TB\")) {\n extraStorage.innerText = price;\n } else if (type.includes(\"prime\")) {\n deliveryCharge.innerText = price;\n } else if (type.includes(\"fast\")) {\n deliveryCharge.innerText = price;\n }\n}", "title": "" }, { "docid": "2a7fb37159a4b6ab7dbd1d5a86cf2737", "score": "0.5520506", "text": "function priceCurrency(prc,curr)\n{\n\tcurr = fnTrim(curr);\n\tif(curr == \"select\")\n\t\treturn false;\n\telse if(curr != \"BD\" && prc.indexOf('.') != -1 && ((prc.substring(prc.indexOf('.')+1)).length > 2))\n\t\treturn false;\n\telse\n\t\treturn true;\n}", "title": "" }, { "docid": "c02b089567cd4f3882470bb5c959c0d4", "score": "0.5517832", "text": "function show_product_supplier_price() {\n\tif (postbody.match(/Supplier price:/gi)){\n\t\tsupplier_price = extract_text(postbody, 'Supplier price:', '<br');\n\t\tif (!isNaN(supplier_price) && supplier_price !== null && supplier_price !== ''){\n\t\t\tdocument.write('<br>' + translate_sentence('Supplier price') + ': ' + format_currency(supplier_price));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a2dd106677807312e5690d7724ee56e4", "score": "0.54945153", "text": "function changePrice() {\n if ($('#switch1').is(\":checked\")) {\n if ($pr_sale.val() != 0 && $pr_price.val() != '') {\n $('#price-sale-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-preview').html(formatNumber($pr_price.val() - $pr_price.val() / 100 * $pr_sale.val()) + \" ₫\")\n $('#sale-preview').show()\n $('#sale-preview').html($pr_sale.val() + \"%\")\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n } else {\n $('#price-preview').html(formatNumber($pr_price.val()) + \" ₫\")\n $('#price-sale-preview').html('')\n $('#sale-preview').hide()\n }\n }", "title": "" }, { "docid": "2f2aa157e513293abf2529b84d46143c", "score": "0.5487858", "text": "function setCoins(highPrice) {\n\n var startingDollars = document.getElementById('dollarAmount').value;\n\n var numCoins = (startingDollars / highPrice).toFixed(2);\n\n pageDisplay('coinCount', numCoins);\n\n //temporary call\n setCurrentPrice(numCoins);\n \n \n \n\n}", "title": "" }, { "docid": "13144bbc1a755ddb945933ca5358378f", "score": "0.5476218", "text": "function checkPrice(){\n if(serviceTag.value != \"\"){\n switch(serviceTag.value){\n case \"a\":{\n priceList.value = \"Ticket: Melbourne - Adelaide (via Bendigo and Nhill/Horsham) Single Price: AUD $\"+ ticketA;\n break;\n }\n case \"b\":{\n priceList.value = \"Ticket: Melbourne - Canberra (via Albury) Single Price: AUD $\"+ ticketB;\n break;\n }\n case \"c\":{\n priceList.value = \"Ticket: Melbourne - Canberra (via Bairnsdale)) Single Price: AUD $\"+ ticketC;\n break;\n }\n case \"d\":{\n priceList.value = \"Ticket: Mildura - Albury Single Price: AUD $\"+ ticketD;\n break;\n }\n case \"e\":{\n priceList.value = \"Charter Pickup Single Price: AUD $\"+ ticketE;\n break;\n }\n case \"f\":{\n priceList.value = \"Accomendation Single Price: AUD $\"+ ticketF;\n break;\n }\n }\n } else{\n priceList.value =\"Need to select a service!\";\n }\n}", "title": "" }, { "docid": "6e1b630c2c9c5156b6893f70f5da839f", "score": "0.547523", "text": "function setup() {\n\tgetCurrencyWidget(document.getElementById(\"currencyWidget\"));\n\tdocument.getElementById(\"currencyWidget\").addEventListener(\"change\", refresh, false);\t\n\torder = orderFactory();\n\trefresh();\n}", "title": "" }, { "docid": "a6b2fea3cb14b96b6a8725dd5218f7cd", "score": "0.54742634", "text": "function getPrice(x){\r\n\tvar price;\r\n\t//player\r\n\tif (x<=4){\r\n\t\tprice=10;\r\n\t}\r\n\t//Coach\r\n\telse if(x<=8){\r\n\t\tprice=15;\r\n\t}\r\n\t//Refaree\r\n\telse{\r\n\t\tprice=25;\r\n\t}\r\n\treturn price;\r\n}", "title": "" }, { "docid": "9196000cab171cafa6b805e844f7fecb", "score": "0.5469217", "text": "function setPricesExceptCups() {\n\tvar upgrade = document.getElementsByClassName(\"class-upgrade\"); //selecting all options from \"upgrade\" section\n\tvar addOn = document.getElementsByClassName(\"class-addon\"); //selecting all options from \"addon\" section\n\tvar supplier = document.getElementsByClassName(\"class-supplier\"); //selecting all options from \"supplier\" section\n\t/*At first, set up all values within priceArr to 0*/\n\tfor (var x = 1; x < priceArr.length; x++) {\n\t\tpriceArr[x] = 0;\n\t}\n\t/* The below each FOR loop, loops though assigned section to validate how many inputs are true (checked). If checked then accumulate the\n\t total value in an priceArr accordingly*/\n\tfor (var i = 0; i < upgrade.length; i++) {\n\t\tif (upgrade.item(i).checked == true) {\n\t\t\tpriceArr[1] += parseFloat(upgrade.item(i).value);\n\t\t}\n\t}\n\tfor (var b = 0; b < addOn.length; b++) {\n\t\tif (addOn.item(b).checked == true) {\n\t\t\tpriceArr[2] += parseFloat(addOn.item(b).value);\n\t\t}\n\t}\n\tfor (var c = 0; c < supplier.length; c++) {\n\t\tif (supplier.item(c).checked == true) {\n\t\t\tpriceArr[3] += parseFloat(supplier.item(c).value);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "38dea4fb4af34df50b5b537183fd9996", "score": "0.5462763", "text": "function willBuyDrink(isHotOutside, moneyInPocket){\nif((isHotOutside)&&(moneyInPocket> 10.50)){\n return true;\n}else{\n return false;\n}\n}", "title": "" }, { "docid": "b6478f5005730a120f32ba18fe86ee30", "score": "0.54608196", "text": "function budgetCalculator(watch, phone, laptop) {\n if (watch < 0 || phone < 0 || laptop < 0) { // This is condition for error handling\n return 'invalid input';\n }\n\n var watchPrice = 50 * watch;\n var phonePrice = 100 * phone;\n var laptopPrice = 500 * laptop;\n var totalPrice = watchPrice + phonePrice + laptopPrice;\n return totalPrice;\n}", "title": "" }, { "docid": "36ff0fe6f6e0a0a6245de2954e2171d4", "score": "0.5460376", "text": "function checkout() {\n const transportType = $(\"input[name=transport_ype]:checked\").val();\n if (transportType == undefined) {\n setAlertContent(\"Please pick a transport type\", \"alert-danger\");\n } else {\n const grandTotal = parseFloat($(\"#total_amount\").val());\n if (grandTotal > getCurrentBalance()) {\n setAlertContent(\n `Please buy within your Credit of $${getCurrentBalance()}`,\n \"alert-danger\",\n \"alert-success alert-warning\"\n );\n } else {\n setCurrentBalance(grandTotal);\n setAlertContent(\n \"<i class='fa fa-thumbs-up'></i> \" +\n \"Thank you for your purchase, Your order is being processed. Please finish by rating our products\",\n \"alert-success\",\n \"alert-danger alert-warning\"\n );\n $(\"#my_cart_modal_content\").hide();\n $(\"#checkoutButton\").hide();\n $(\"#ratings\").show();\n $(\"#finishRatingButton\").show();\n }\n }\n}", "title": "" }, { "docid": "98aabf6991f15c817bc7b062c487ddf4", "score": "0.54596174", "text": "getPurchasePrice() {\n let result = this._purchasePrice ? this._purchasePrice : 0.0;\n return result;\n }", "title": "" }, { "docid": "6db9e0c48a835dc04446ab6838846ac7", "score": "0.54572505", "text": "function ValidatePriceSetEntry () {\n\tvar err, ok, i,s\n\t\n\terr = \"\";\n\tok = true;\n\t// Weights entered?\n\t$('input[name^=Size]').each(function() {\n\t\ti = $(this).attr('title');\n\t\ts = parseInt($(this).val());\n\n\t\tif (parseInt(s) > 0)\n\t\t\t{\n\t\t\tok = ok && ($('#PrintShipWeight'+i).val() > 0) \n\t\t\t\t&& ($('#MatteShipWeight'+i).val() > 0)\n\t\t\t\t&& ($('#FrameToPrintShipWeight'+i).val() > 0)\n\t\t\t\t&& ($('#FrameMatteShipWeight'+i).val() > 0);\n\t\t\t\t\n\t\t\tif (!ok)\n\t\t\t\t{\n\t\t\t\tif (isNaN(i))\n\t\t\t\t\terr = err + \"The new entry in Print Pricing for size \"+s+\" is missing weight information.\\n \";\n\t\t\t\telse\n\t\t\t\t\terr = err + \"Print Pricing entry #\"+i+\" is missing Shipping Weight information.\\n \";\n\t\t\t\t}\n\t\t\tif (err)\n\t\t\t\talert (err);\n\t\t\t}\n\t});\n\t\t\n\treturn ok;\n}", "title": "" }, { "docid": "db21a4e853ce32dc657e913d6610e130", "score": "0.545373", "text": "constructor(title, author, price) {\n super(title, author);\n this.price = price;\n }", "title": "" }, { "docid": "6139aa6b3a6098eaac8a5e658b5b2302", "score": "0.54516375", "text": "function checkout(price, qty, member){\n\tvar result = price * qty;\n\tswitch(member){\n\t\tcase \"VIP\":\n\t\t\tresult *= 0.7;\n\t\t\tbreak;\n\t\tcase \"Premium\":\n\t\t\tresult *= 0.6;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "b2bec64429c8e347cca5097bf662232d", "score": "0.54307127", "text": "async getPrice(date) {\n try {\n const priceInfo = await getPriceFromAPI(date);\n return priceInfo.price;\n }\n catch(e) {\n return false;\n }\n }", "title": "" }, { "docid": "c48ec79c5970c538a14d461ad2f65366", "score": "0.542346", "text": "clickBuyNowOnAppOverviewAndUpdateEditionOfProduct(editionName, additionalUsersCount) {\n // cy.get(this.#buyNowBtnV2Css).click()\n cy.get(this.#buyNowCommonCss).parent().click()\n\n if (editionName !== \"\" && additionalUsersCount !== \"\") {\n cy.get(this.#priceWrapperOnCreateOrderPageCss).then($body => {\n if ($body.find(this.#priceWrapperNameCss.replace('DYNAMIC_LOCATOR_VARIABLE', editionName)).length > 0) {\n cy.wrap($body.find(this.#priceWrapperNameCss.replace('DYNAMIC_LOCATOR_VARIABLE', editionName))).as('editionNameWB')\n\n cy.get('@editionNameWB').parent().find('input').check()\n // .parent().find('input').check()\n cy.wait(10000)\n cy.get(this.#additionalUsersTextboxCss).clear().type(additionalUsersCount)\n } else {\n throw new Error(\"Price wrapper: \" + editionName + \" is invalid\")\n }\n });\n } else if (editionName === \"\" && additionalUsersCount !== \"\") {\n cy.get(this.#additionalUsersTextboxCss).clear().type(additionalUsersCount)\n }\n\n cy.get(this.#createOrderContinueBtnCss).click()\n cy.wait(5000)\n }", "title": "" }, { "docid": "c8cd84ed0b9c3ed60e034f40922bf496", "score": "0.54222834", "text": "function priceByCrust(){\r\n let valueOfCrust = document.getElementById('pizza-crust').value;\r\n if(valueOfCrust==1){\r\n priceOfSize = 220;\r\n return priceOfCrust;\r\n }\r\n else if(valueOfCrust==2){\r\n priceOfCrust = 300;\r\n return priceOfCrust;\r\n }\r\n else if(valueOfCrust==3){\r\n priceOfCrust = 190;\r\n return priceOfCrust;\r\n }\r\n else if(valueOfCrust==4){\r\n priceOfCrust = 350;\r\n return priceOfCrust;\r\n }\r\n else if(valueOfCrust==5){\r\n priceOfCrust = 400;\r\n return priceOfCrust;\r\n }\r\n}", "title": "" } ]
9510fe7e47653c0fef0e2bd4f9c1af74
Carga el slot en el indice dado con el item marcado O con uno aleatorio si no se pasa el argumento
[ { "docid": "2150f107f7fee92800e8970b510408da", "score": "0.71351326", "text": "function cargarSlot(slots, indice, slotItem){\r\n\tslots[indice] = slotItem || getSlotItem(slotItems);\r\n\t//Usado para notificar cambio de Slot\r\n\tif(cambioDeSlot)\r\n\t\tcambioDeSlot(slots, indice);\r\n}", "title": "" } ]
[ { "docid": "f7fbff8d78e108acff86d6dd1e9faa00", "score": "0.6685398", "text": "function getSlotItem(slots){\r\n\tvar numero = getNumeroAlAzar(slots.length);\r\n\treturn slots[numero];\r\n}", "title": "" }, { "docid": "b95e12386a1ac6624020ddfbbd8a55fa", "score": "0.58704", "text": "swapItem(data){\n\t\tlet oldslot = data.old;\n\t\tlet newslot = data.new;\n\t\tif(this.inventory[\"slot\"+oldslot] !== \"\" || this.inventory[\"slot\"+newslot] !== \"\"){\n\t\t\tlet temp = this.inventory[\"slot\"+newslot];\n\t\t\tthis.inventory[\"slot\"+newslot] = this.inventory[\"slot\"+oldslot];\n\t\t\tthis.inventory[\"slot\"+oldslot] = temp;\n\t\t}\n\t}", "title": "" }, { "docid": "9eb0aca5061020e1757c25c457668043", "score": "0.58408475", "text": "function inventorySlot(slot, isEmpty, item){\n this.isEmpty = isEmpty;\n this.slot = slot;\n this.item = item;\n}", "title": "" }, { "docid": "75efd75400afa0f21d4b9044e4c3e7e1", "score": "0.57736623", "text": "function cargarSlots(slots){\r\n\toperarSlots(slots, cargarSlot);\r\n}", "title": "" }, { "docid": "50891de193c2910496f481f4429d10f2", "score": "0.5689893", "text": "function cargarCapaConSlotItem(slotDiv, slotItem) {\r\n\t//vaciarElemento(slotDiv);\r\n\t//var img = document.createElement(\"img\");\r\n\tvar img = slotDiv.querySelector(\"img\");\r\n\timg.alt = slotItem.nombre;\r\n\timg.src = slotItem.imagen;\r\n\t//slotDiv.appendChild(img);\r\n}", "title": "" }, { "docid": "a39148f7fc0b0c667b029f91254a5dc9", "score": "0.56871104", "text": "clickComprar(item_type, item_id, item_idx, item_name, item_description, item_price){\n\n this.setState({\n item_type: item_type,\n item_id: item_id,\n item_idx: item_idx,\n item_name: item_name,\n item_description: item_description,\n item_price: item_price,\n item_quantity: 1\n }, () => {\n this.toggleModalCompra();\n });\n \n }", "title": "" }, { "docid": "1661bd5a2cdacf04f98493cccf950931", "score": "0.56483513", "text": "function addSlot(){\n addSlotNumbered(1);\n}", "title": "" }, { "docid": "925e5d16be603405d78aff8e110f52d3", "score": "0.56230855", "text": "function AdicionaItem(tipo_item, div, div_pai) {\n var input_em_uso = CriaInputCheckbox(false);\n input_em_uso.name = 'em_uso';\n input_em_uso.addEventListener('change', {\n tipo_item: tipo_item,\n handleEvent: function(e) {\n ClickUsarItem(this.tipo_item, e.target); } });\n div.appendChild(input_em_uso);\n\n var select = CriaSelect();\n var items_ordenados = [];\n var tabela_item = tabelas_itens[tipo_item].tabela;\n for (var chave in tabela_item) {\n items_ordenados.push({ chave_item: chave, valor_item: tabela_item[chave] });\n }\n items_ordenados.sort(function(ie, id) {\n return Traduz(ie.valor_item.nome).localeCompare(Traduz(id.valor_item.nome));\n });\n items_ordenados.forEach(function(item) {\n select.appendChild(\n CriaOption(Traduz(item.valor_item.nome) + ' (' + TraduzDinheiro(item.valor_item.preco) + ')', item.chave_item));\n });\n select.addEventListener('change', AtualizaGeral);\n select.name = 'item';\n div.appendChild(select);\n\n var botao_remover = CriaBotao('-', null, null);\n botao_remover.addEventListener('click', {\n handleEvent: function(e) {\n RemoveFilho(div, div_pai);\n AtualizaGeral();\n e.stopPropagation();\n } });\n div.appendChild(botao_remover);\n\n var button_vender = CriaBotao(Traduz('Vender'), null, 'venda', {\n div: div,\n tabela: tabela_item,\n handleEvent: function(evt) {\n ClickVenderItem(this.div, this.tabela);\n }\n });\n var button_comprar = CriaBotao(Traduz('Comprar'), null, 'compra', {\n div: div,\n tabela: tabela_item,\n handleEvent: function(evt) {\n ClickComprarItem(this.div, this.tabela);\n }\n });\n div.appendChild(button_vender);\n div.appendChild(button_comprar);\n\n div_pai.appendChild(div);\n}", "title": "" }, { "docid": "c58fabcf9154d3466ac8a14d27250458", "score": "0.56198484", "text": "function unequipItem(slot)\n{\n\tif(!inventoryUI[slot].inUse)\n\t\treturn;\n\telse\n\t{\n\t\tinventoryUI[slot].item = null;\n\t\tinventoryUI[slot].inUse = false;\n\t}\n}", "title": "" }, { "docid": "370958524b30d0a582a3cf8d4f889127", "score": "0.5602425", "text": "function slotCreation() {\r\n for (var slotNo = 0; slotNo < inventoryLocations.length; slotNo ++){\r\n var presetXPos = 0.5;\r\n slotPresent1 = this.game.renderer.width *presetXPos + 0.1 , this.game.renderer.height * 0.36, itemToDisplay//gameWidth * presetXPos + 0.1;\r\n \r\n presetXPos += 3; \r\n }\r\n}", "title": "" }, { "docid": "c8d1a775979c85e87ca13a175bff750a", "score": "0.5568511", "text": "addItem(item) {\n let slotNum = this.slots.indexOf(null);\n if (slotNum != -1) {\n this.slots[slotNum] = item;\n } else {\n log.message({\n type: \"party\",\n message: `${this.name}'s inventory is full.`,\n });\n return false;\n }\n }", "title": "" }, { "docid": "085b068f3f91c2cc7ca1d180eacb26f0", "score": "0.5510718", "text": "function useItem(item, slot){\n\tthis.item = item;\n\tthis.slot = slot;\n\tswitch(item)\n\t{\n\t\tcase \"Weak Mana Potion\":\n\t\t{\n\t\t\t//effect goes here\n\t\t\tinventory[slot] = nothing;\n\t\t\tdocument.getElementById('output').value += \"\\nUsed Weak Mana Potion.\";\n\t\t\tAutoScroll();\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Strong Mana Potion\":\n\t\t{\n\t\t\t//effect goes here\n\t\t\tinventory[slot] = nothing;\n\t\t\tdocument.getElementById('output').value += \"\\nUsed Strong Mana Potion.\";\n\t\t\tAutoScroll();\n\t\t\tbreak;\n\t\t}\n\t\tcase \"Nothing\":\n\t\t{\n\t\t\tdocument.getElementById('output').value += \"\\nInventory slot is empty.\";\n\t\t\tAutoScroll();\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "40a84228181e60720b47957082a95724", "score": "0.5502057", "text": "function AdicionaSlotFeitico(div_nivel_slots, precisa_memorizar, chave_classe, nivel, slots, indice) {\n div_nivel_slots.appendChild(\n CriaDomSlotFeitico(precisa_memorizar, chave_classe, nivel, indice, slots));\n}", "title": "" }, { "docid": "6c09305553d2045ca2dd3dca70e6588d", "score": "0.54924464", "text": "function equipItem(c,msg) {\r\n\t\tvar id = msg.id;\r\n\t\tvar index = msg.index;\r\n\t\tif (c.inventory.items[id] && c.inventory.items[id]>=msg.count && itemtypesH[id].slot.indexOf(index)>-1){\t//TODO: check if item goes there\t//equiplist[id][index]\r\n\t\t\tif (!c.inventory.equips[index]) {\r\n\t\t\t\tc.inventory.items[id]-=msg.count;\r\n\t\t\t\tc.inventory.equips[index]=createItem(id,msg.count);\r\n\t\t\t\t//c.armor = getInventoryArmor(c.inventory);\r\n\t\t\t} else if (itemimgid(c.inventory.equips[index]) == id){\r\n\t\t\t\tvar x = clamp(itemcount(c.inventory.equips[index]) + msg.count, 1, 10);\r\n\t\t\t\tc.inventory.items[id] -= x - itemcount(c.inventory.equips[index]);\r\n\t\t\t\tc.inventory.equips[index]=createItem(id,x);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "29c86603eeb3f226130b391c173f1471", "score": "0.5446124", "text": "addItem(_item) { }", "title": "" }, { "docid": "29c86603eeb3f226130b391c173f1471", "score": "0.5446124", "text": "addItem(_item) { }", "title": "" }, { "docid": "1d085d7a54514199dbc850d48e065ddd", "score": "0.54219174", "text": "function equipItemP(itemToEquip)\n{\n\tinventoryUI[0].item = item[itemToEquip];\n\tinventoryUI[0].inUse = true;\n}", "title": "" }, { "docid": "e61ff4af0f4e00d138522609d41ef23e", "score": "0.5419855", "text": "function prepareSlots(){\n\tslotContainer.removeAllChildren();\n\t\n\tfor(var c = 0; c<slotSettings.column; c++){\n\t\tshuffle(slotData.array[c].slots);\n\t\t\n\t\tvar currentX = slotSettings.startX + (slotSettings.width/2) + (slotSettings.width * c);\n\t\tvar currentY = slotSettings.startY + (slotSettings.height/2);\n\t\tcurrentY += slotSettings.height * slotSettings.row;\n\t\tif(slotData.extraslot > 1){\n\t\t\tcurrentY += slotSettings.height * (slotData.extraslot-1);\n\t\t}\n\t\t\n\t\tslotData.array[c].total = spinSettings.slots * slotSettings.row;\n\t\tslotData.array[c].total += slotData.extraslot;\n\t\t\n\t\tvar previousIndexArray = [];\n\t\tif(slotData.array[c].obj.length > 0){\n\t\t\tfor(var s = slotData.array[c].obj.length-slotSettings.row; s<slotData.array[c].obj.length; s++){\n\t\t\t\tpreviousIndexArray.push(slotData.array[c].obj[s].slotIndex);\t\n\t\t\t}\n\t\t}\n\t\tslotData.array[c].obj.length = 0;\n\t\t\n\t\tvar previousIndex = 0;\n\t\tfor(var s = 0; s<slotData.array[c].total; s++){\n\t\t\tvar resultSlot = false;\n\t\t\tif(s >= slotData.extraslot && previousIndex < previousIndexArray.length){\n\t\t\t\tvar slotIndex = previousIndexArray[previousIndex];\n\t\t\t\tpreviousIndex++;\n\t\t\t}else{\n\t\t\t\tvar index = slotData.array[c].index;\n\t\t\t\tvar slotIndex = slotData.array[c].slots[index];\n\t\t\t\tslotData.array[c].index++;\n\t\t\t\tif(slotData.array[c].index > slotData.array[c].slots.length-1){\n\t\t\t\t\tslotData.array[c].index = 0;\n\t\t\t\t\tshuffle(slotData.array[c].slots);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvar slotObj = $.slots[slotIndex].clone();\n\t\t\tslotObj.slotIndex = slotIndex;\n\t\t\tslotObj.mask = $.columnMask[c];\n\t\t\tslotContainer.addChild(slotObj);\n\t\t\t\n\t\t\tslotData.array[c].obj.push(slotObj);\n\t\t\t\n\t\t\tslotObj.x = currentX;\n\t\t\tslotObj.y = currentY;\n\t\t\tslotObj.oriY = slotObj.y;\n\t\t\t\n\t\t\tcurrentY -= (slotSettings.height);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bccaa2435bbfb058fc7a306c7ef5e0f7", "score": "0.54046357", "text": "newSlotCallback() {\n this.totalSlots++;\n }", "title": "" }, { "docid": "76fb6fa984925a81dfe8dca4b0c35f37", "score": "0.53932285", "text": "addItem() {\n }", "title": "" }, { "docid": "04e39f68d58c8bc3a981b7092bc7b428", "score": "0.53824204", "text": "removeItem(slotNum) {\n let item = this.slots[slotNum];\n this.slots[slotNum] = null;\n return item;\n }", "title": "" }, { "docid": "7bc5d3176f61159f8722671a762440a8", "score": "0.5380421", "text": "function addItem(newItem)\n{\n for(let i = 0; i <= 24; i++){\n if(iSlots[i].item == null)\n {\n iSlots[i].item = newItem; \n eqUpdate();\n break;\n }\n }\n}", "title": "" }, { "docid": "1e09340ba45089880af9a551cefcd6b5", "score": "0.537016", "text": "function addItemToFirstOpenSlot(itemName) {\n output(`new item: ${itemName}`);\n for (let i = 0; i < inventory.length; i++) {\n if (!inventory[i] || inventory[i] == '') {\n inventory[i] = itemName;\n updateInventorySlot(i);\n break;\n }\n }\n}", "title": "" }, { "docid": "80b0bb649f4cf2ef204d3b1495c5ab9e", "score": "0.53622234", "text": "function handleSelectedItem(event) { /*Toda vez que a função é disparada, passa pra dentro dela um evento*/\n const itemLi = event.target;\n \n //adicionar ou remover com js\n itemLi.classList.toggle(\"selected\")\n\n //Pegar os número que tem no id do item selecionado*\n const itemId= itemLi.dataset.id; \n \n\n //Verificar se existem items selecionados, se sim\n //pegar os items selecionados\n const alreadySelected = selectedItems.findIndex(item=>{\n const itemFound = item == itemId\n return itemFound\n })\n\n //se já estiver selecionado, tirar da seleção\n if(alreadySelected >=0){\n //tirar da seleção\n\n }\n\n\n //se não estiver selecionado, add à seleção\n\n //atualizar o campo escondido com os items selecionados\n\n}", "title": "" }, { "docid": "6cf0a4fc1f1c09f408bbf4c8fd0cb7f1", "score": "0.5354755", "text": "addIdToData(item, index, page) {\n item.id = `${page}-${index}`\n return item\n }", "title": "" }, { "docid": "5c0061b302ad501cb5c48c95ef81ae41", "score": "0.53488994", "text": "function girarSlot(slots, indice){\r\n\tvar id = setInterval(() => {\r\n\t\tcargarSlot(slots, indice);\r\n\t}, msGiro);\r\n\tidsSpinners.push(id);\r\n}", "title": "" }, { "docid": "3985dd28f7bc5eef3f18f30d40ee2020", "score": "0.5347696", "text": "returnItem(i) {\n \n var id = i;\n var newSize = this.state.sizes;\n \n newSize[id] += this.state.quantity;\n \n // persist to firebase\n var refName = this.state.year + '/' + this.state.item;\n var dbref = fire.database().ref(refName);\n \n dbref.set({\n 0: newSize[0],\n 1: newSize[1],\n 2: newSize[2],\n 3: newSize[3],\n 4: newSize[4],\n 5: newSize[5],\n color: this.state.color,\n price: this.state.price\n });\n }", "title": "" }, { "docid": "c16f16899c1303c5e6409c6674963f80", "score": "0.53209543", "text": "addItem(itemId, quantity) {\n let found = this.panier.find(i => i.item == itemId)\n if (found) {\n found.quantity += quantity\n } else {\n this.panier.push({ item: itemId, quantity: 1 })\n }\n if(found && found.quantity==0){\n this.panier.splice(this.panier.indexOf(found), 1)\n }\n this.refresh();\n }", "title": "" }, { "docid": "18d1e4eed57ffa95912849fef67a799c", "score": "0.53180516", "text": "scrollToItem(item) {\n let iv = this.i.it(item);\n return (iv);\n }", "title": "" }, { "docid": "0697c1ee7cfcf0a8f84b3ae07a1190bd", "score": "0.53004247", "text": "clickItem(maLoai, tenLoai){\n this.props.navigation.navigate('ListMotobike', {idLoai: maLoai, thamSo: tenLoai})\n }", "title": "" }, { "docid": "08543442776d7b4a358a076b3ce3a2e1", "score": "0.52991974", "text": "function __onUpdateItem(cmd, data){\n\n function __getTargetRowData(){\n var __target = __dsFertilizantes.Where({ _id : data.ProductoRegistrado._id})[0];\n var __rowIndex = __dsFertilizantes.indexOf(__target); \n var __cells = $('.row_edit', __container)[__rowIndex].cells;\n return { fertilizante : __target,\n cells : __cells };\n }\n \n function __setEstado(estado){\n return function(item){\n item.fertilizante._estado = cmd.data[0];\n item.fertilizante._literalEstado = __estados[cmd.data[0] || 'R'];\n item.cells[8].textContent = __estados[cmd.data[0] || 'R']; \n return item;\n }( __getTargetRowData());\n }\n\n ({ \n Inscribir : function(){ \n if(data._tipo == 'I'){ \n _$Fabricante.Fertilizantes\n .push(function(f){\n f._literalEstado = __estados[f._estado || 'R']; \n f._fechaDeInscripcion = f._fechaDeInscripcion.fixDate(),\n f._fechaDeRenovacion = '', \n f._fechaDeCaducidad = f._fechaDeCaducidad;\n f._denominacion = data._denominacion;\n f._nombresComerciales = [];\n f._tipoDeFertilizante = '{_codigo} - {_descripcion}'.format(_tiposDeFertilizantes[data._idAbono]);\n f._expediente = data._expediente;\n return f; \n }(data.ProductoRegistrado));\n __initTable();\n __updateStatus();\n return; \n } \n (function(fertilizante){\n // =================================================================================\n // Quitar el fertilizante si hay cambio de titular\n // =================================================================================\n if(_$Fabricante._id != data._idFabricante){\n var __row = $('#row_f_{_id}'.format(fertilizante), __container)[0];\n if(__row) __row.parentNode.removeChild(__row); // Quitar la fila de la tabla \n _$Fabricante.Fertilizantes.remove(fertilizante); // Quitar del array\n if(__dsFertilizantes != _$Fabricante.Fertilizantes){ // Quitar de los filtrados\n __dsFertilizantes.remove(fertilizante); \n }\n __sync_checked();\n __updateStatus();\n return;\n }\n // =================================================================================\n // Actualizar los nuevos datos del fertilizante\n // =================================================================================\n var __cells = $('#row_f_{_id} td'.format(fertilizante), __container);\n fertilizante._literalEstado = __estados['R'];\n fertilizante._codigo = data.ProductoRegistrado._codigo;\n fertilizante._fechaDeCaducidad = data.ProductoRegistrado._fechaDeCaducidad;\n fertilizante._fechaDeInscripcion = data.ProductoRegistrado._fechaDeInscripcion;\n fertilizante._fechaDeRenovacion = data.ProductoRegistrado._fechaDeRenovacion; \n __cells[1].textContent = fertilizante._codigo;\n __cells[5].textContent = fertilizante._fechaDeInscripcion;\n __cells[6].textContent = fertilizante._fechaDeRenovacion;\n __cells[7].textContent = fertilizante._fechaDeCaducidad\n __cells[8].textContent = fertilizante._literalEstado;\n }(_$Fabricante.Fertilizantes\n .Where({ _id : data.ProductoRegistrado._id})[0])); \n \n },\n SaveFertilizante : function(){\n (function(item){\n var __f = JSON.parse(cmd.data[3]);\n item.fertilizante._codigo = cmd.data[1];\n item.fertilizante._fechaDeCaducidad = cmd.data[2];\n item.fertilizante._fechaDeInscripcion = __f._fechaDeInscripcion.fixDate();\n item.fertilizante._fechaDeRenovacion = __f._fechaDeRenovacion.fixDate(); \n item.cells[1].textContent = item.fertilizante._codigo;\n item.cells[5].textContent = item.fertilizante._fechaDeInscripcion;\n item.cells[6].textContent = item.fertilizante._fechaDeRenovacion;\n item.cells[7].textContent = item.fertilizante._fechaDeCaducidad\n }(__setEstado())); \n },\n HabilitarFertilizante : function(){ __setEstado(); },\n DeshabilitarFertilizante : function(){ __setEstado(); },\n ProrrogarFertilizante : function(){ __setEstado(); }\n })[cmd.name]();\n }", "title": "" }, { "docid": "e52a294d2760a5399f19ae60c34b091a", "score": "0.52989566", "text": "function guiSell(){\n\tvar i : int;\n\t\n\t\n\t//if(nSellItems<1) GUI.Label(Rect(20, 40, 300, 20), \"No items available for selling.\");\n\t\n\t//RADU: TUTORIALS if it's the first time displaying, show tutorial overlay\n\tCommonConstants.DrawTutorialOverlay( CommonConstants.TUT_AUCTION_SELL );\n\n var t = new Item();\n\t\n\tGUI.DrawTexture(Rect(4, 40, 471, 234), texSellFrame);\n\tsellScrollPos = GUI.BeginScrollView(sellItemsFrame, sellScrollPos, Rect(0, 0, 145, nSellItems*27));\n\n\tfor(i = 0; i<nSellItems; i++){\n\t\tt = myItems[i];\n\n\t\tstyleList = i == nSellItem ? styleBut : styleButP;\n\t\t\tif (t.quantity < 2) {\n\t\t\t\tsellItemCnt.text = \" \" + (t.name.length>14 ? t.name.Substring(0,14)+\"..\" : t.name);\n\t\t\t} else {\n\t\t\t\tsellItemCnt.text = \" \" + (t.name.length>14 ? t.name.Substring(0,14)+\"..[\"+t.quantity+\"]\" : t.name);\n\t\t}\n\n\t\tsellItemCnt.image = texSellItems[i];\n\t\tif(ScrollButton(Rect(0, (27*i), 190, 26), sellItemCnt) || i == nSellItem){\n\t\t\ttexAH = Resources.Load(\"Menus/Inventory/Icons/\" + t.id);\n\t\t\tsTitle = t.name;\n\t\t\tsAH =\t(t.brutality > 0 ? (\"\\nBrutality : \" + t.brutality) : \"\") +\n\t\t\t\t\t(t.quantity > 0 ? (\"\\nQuantity : \" + t.quantity) : \"\") +\n\t\t\t\t\t(t.accuracy > 0 ? (\"\\nAccuracy : \" + t.accuracy) : \"\") +\n\t\t\t\t\t(t.fortitude > 0 ? (\"\\nFortitude : \" + t.fortitude) : \"\") +\n\t\t\t\t\t(t.attack > 0 ? (\"\\nAttack : \" + t.attack) : \"\") +\n\t\t\t\t\t(t.defense > 0 ? (\"\\nDefense : \" + t.defense) : \"\") +\n\t\t\t\t\t(t.health > 0 ? (\"\\nHealth : \" + t.health) : \"\") +\n\t\t\t\t\t(t.regen > 0 ? (\"\\nRegen : \" + t.regen) : \"\") +\n\t\t\t\t\t((t.weapon_dmg_min != 0 || t.weapon_dmg_max != 0) ? \n\t\t\t\t\t(\"\\nDamage : \"\t+ t.weapon_dmg_min + \" - \"\n\t\t\t\t\t\t\t\t\t+ t.weapon_dmg_max) : \"\") +\n\t\t\t\t\t(t.level > 0 ? (\"\\nRequired level : \" + t.level) : \"\");\n\t\t\tnSellItem = i;\n\t\t}\n\t}\n\tGUI.EndScrollView();\n\tif(nSellItem != -1){\n\t\tGUI.DrawTexture(Rect(185, 72, 51, 52), texAH);\n\t\tstyleText1.normal.textColor = Color(1, 0.6, 0, 1);\n\t\tGUI.Label(Rect(240, 72, 80, 20), sTitle, styleText1);\n\t\tGUI.Label(Rect(240, 80, 220, 200), sAH, styleText2);\n\t\tstyleText1.normal.textColor = Color(1, 1, 1, 1);\n\t\tGUI.Label(Rect(185, 160, 80, 20), \"Quantity:\", styleText1);\n\t\tGUI.Label(Rect(185, 199, 80, 20), \"Price:\", styleText1);\n\t\tGUI.Label(Rect(185, 237, 80, 20), \"Expires in 24 h.\", styleText1);\n \n\t\tsAux = sQuantity;\n\t\tsAux = GUI.TextField (Rect (183, 179.5, 92.5, 20), sAux, 25);\n\t\tif(sAux.length<1) sAux = \"0\";\n\t\tif(parseInt(sAux)) sQuantity = sAux; else sAux = sQuantity;\n\t\tt = myItems[nSellItem];\n\t\tif(parseInt(sQuantity)>t.quantity) sQuantity = \"\"+t.quantity;\n //Debug.Log(\"sAux : \"+sAux);\n \n\t\tsAux = sPrice;\n\t\tsAux = GUI.TextField (Rect (183, 218.5, 92.5, 20), sAux, 25);\n\t\tif(sAux.length<1) sAux = \"0\";\n\t\tif(parseInt(sAux)) sPrice = sAux; else sAux = sPrice;\n\t\t\n\t\t/*sAux = sExpire;\n\t\tsAux = GUI.TextField (Rect (332, 241, 93, 20), sAux, 25);\n\t\tif(sAux.length<1) sAux = \"0\";\n\t\tif(parseInt(sAux)) sExpire = sAux; else sAux = sExpire;\n\t\tif(parseInt(sExpire)>48) sExpire = \"48\";\n\t\t*/\n\t\t\n\t\tif( GUI.Button( Rect( 377, 225, 83, 36 ), \"Back\", styleButSmll ) ){\n\t\t\tscriptMain.bGUI = true;\n\t\t\tCraft.bCraft = false;\n\t\t\tbSell = false;\n\t\t\tbBuy = false;\n\t\t\tbExpired = false;\n\t\t\tGlobal.bNeedToUpdateInv = true;\n\t\t}\n\t\t\n\t\tif(GUI.Button(Rect(377, 75, 83, 33), \"Sell\", styleButBig) && parseInt(sQuantity) > 0)\n\t\tif ( !is_updating_ah )\n\t\t{\n SellItem();\n // guiSell();\n print(\"S-a vandut + ceva\");\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "5fca6fd1ae158479bf5edb30d824db71", "score": "0.5274301", "text": "function seleccionarItem(e) {\n elementId = e.target.id;\n // alert(document.body.getElementsByTagName(\"td\")[0]);\n\n $('#' + elementId).toggleClass('table-seleccion');\n if ($('#' + elementId).hasClass('table-seleccion')) {\n item_ant=item;\n if (item_ant){\n $('#' + item_ant).toggleClass('table-seleccion');\n }\n // Guardo id de item seleccionado\n item = elementId;\n } else {\n // Reseteo el item\n item = null;\n }\n}", "title": "" }, { "docid": "74ca6fd68ed75b079707f139aba06ec9", "score": "0.52712023", "text": "addItemToCombatSlot(itemID,slotID,combatMode){\n this._battleSlotsItems[combatMode][slotID] = itemID;\n return true;\n }", "title": "" }, { "docid": "6bde62fc1bc0fd51d6d5010c1e3cd447", "score": "0.52578574", "text": "function getSlot(i, a)\n\t{\n\t\tvar slot = i >> (5 * a.height);\n\t\twhile (a.lengths[slot] <= i)\n\t\t{\n\t\t\tslot++;\n\t\t}\n\t\treturn slot;\n\t}", "title": "" }, { "docid": "6bde62fc1bc0fd51d6d5010c1e3cd447", "score": "0.52578574", "text": "function getSlot(i, a)\n\t{\n\t\tvar slot = i >> (5 * a.height);\n\t\twhile (a.lengths[slot] <= i)\n\t\t{\n\t\t\tslot++;\n\t\t}\n\t\treturn slot;\n\t}", "title": "" }, { "docid": "6bde62fc1bc0fd51d6d5010c1e3cd447", "score": "0.52578574", "text": "function getSlot(i, a)\n\t{\n\t\tvar slot = i >> (5 * a.height);\n\t\twhile (a.lengths[slot] <= i)\n\t\t{\n\t\t\tslot++;\n\t\t}\n\t\treturn slot;\n\t}", "title": "" }, { "docid": "7f65ffc4460eaa211b5a472972d45b90", "score": "0.5246432", "text": "function sumaPremio(slot) {\r\n\t//premio = premio > 0 ? premio * (slot.premio > 0 ? slot.premio : 1) : premio + slot.premio;\r\n\tbanco.setPremio(banco.getPremio() > 0 ? banco.getPremio() * slot.premio : banco.getPremio() + slot.premio);\r\n\t//alert(slot.premio + \"|\" + banco.getPremio());\r\n\treturn banco.getPremio();\r\n}", "title": "" }, { "docid": "9081a20a795ac66cbb471a0c529433b4", "score": "0.5235263", "text": "function InventorySlot(inventoryWindow, x, y, slotIndex)\n{\n InventorySlot.baseConstructor.call(this);\n\n\tthis.inventoryWindow = inventoryWindow;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.viewItem = null;\n\tthis.slotIndex = slotIndex;\n}", "title": "" }, { "docid": "9d471f3b64b9e91e0fcaf4cf7c3a6831", "score": "0.52213377", "text": "function click_nastroj(nastroj){\n\tif (clicked_item){clicked_item = null;}\n\tclicked_nastroj = nastroj;\n\tif (nastroj == \"kartez\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na prvu udalost, z kt. chces urobit kartez. sucin.\";\n\t} else if (nastroj == \"zjednotenie\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na prvu udalost\";\n\t} else if (nastroj == \"prienik\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na prvu udalost.\";\n\t} else if (nastroj == \"minus\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na pravdepodobnost, z ktorej chces vypocitat opacnu udalosť.\";\n\t} else if (nastroj == \"pravdepodobnost\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na udalost s priaznivymi pripadmi.\";\n\t} else if (nastroj == \"vysledok\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na pravdepodobnost, ktora je podla teba vysledkom.\";\n\t}\n}", "title": "" }, { "docid": "03e96b320fcb02fc90c6276fc6f07149", "score": "0.52190226", "text": "function itemClick(event) {\n let item = event.target.getAttribute('data-item'); /* pegou a posicao que foi passada\n como parametro no evento atraves do target e salvou na variavel item */\n if(playing && square[item] === '') { // se o item dentro do indice do tabuleiro tiver vazio\n square[item] = player; //preenche ao clicar com o simbolo do player da vez O ou X\n renderSquare(); // renderiza no HTML o que foi salvo \n togglePlayer();\n }\n}", "title": "" }, { "docid": "943b57f8486241fd62bbd86e9b3a111c", "score": "0.5218631", "text": "rentItem(e){\n\t\tconst button = e.target;\n\t\tconst index = parseInt(button.dataset.index);\n\t\tconst selectedItem = this.state.items[index];\n\t\tthis.setState({\n\t\t\tmodalShow: true,\n\t\t\titem: selectedItem\n\t\t})\n\t\t// console.log(\"open\", this.state)\n\t}", "title": "" }, { "docid": "54694cb9ae7fe52476b03d4892caf8c0", "score": "0.52180517", "text": "function click_item(i){\n\t//neklikol na nastroj\n\tif (!clicked_nastroj){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Neklikol si na nástroj.\";\n\t\treturn;\n\t}\n\n\tif (clicked_item == i){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\treturn;\n\t}\n\t\n\t//klikol na nastroj a prvy item\n\tif (!clicked_item){\n\t\tif (udalosti[i.innerHTML] != undefined && (clicked_nastroj == \"kartez\" || clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\t\tclicked_item=i;\n\t\t\tif (clicked_nastroj == \"kartez\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost, z kt. chces urobit kartez. sucin.\";\n\t\t\t} else if (clicked_nastroj == \"zjednotenie\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t} else if (clicked_nastroj == \"prienik\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t} else if (clicked_nastroj == \"pravdepodobnost\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na udalost so vsetkymi pripadmi.\";\n\t\t\t}\n\t\t}\n\t\telse if (cisla[i.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\")){\n\t\t\tclicked_item=i;\n\t\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t} else if (clicked_nastroj == \"prienik\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t}\n\t\t}\n\t\telse if (kombinatorika[i.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\t\tclicked_item=i;\n\t\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t} else if (clicked_nastroj == \"prienik\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na druhu udalost.\";\n\t\t\t} else if (clicked_nastroj == \"pravdepodobnost\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Teraz klikni na udalost so vsetkymi pripadmi.\";\n\t\t\t}\n\t\t}\n\t\t//kontroluje vysledok\n\t\telse if (cisla[i.innerHTML] != undefined && clicked_nastroj == \"vysledok\"){\n\t\t\tif (cisla[i.innerHTML].citatel == akt_vysledok.citatel && cisla[i.innerHTML].menovatel == akt_vysledok.menovatel){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Dobry vysledok\";\n\t\t\t\ti.style.backgroundColor = \"#cef4ff\";\n\t\t\t\t//i.style.backgroundColor = \"#66ff33\";\n\t\t\t\tspravny_vysledok = true;\n\t\t\t\tsave_btns();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zly vysledok\";\n\t\t\t}\n\t\t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (cisla[i.innerHTML] != undefined && clicked_nastroj == \"minus\"){\n\t\t\tvar novy_zlomok = rozdiel_zlomkov(1,1,cisla[i.innerHTML].citatel,cisla[i.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\t//console.log(cit/men <= 1);\n\t\t\tif (cit/men <= 1){\n\t\t\t\tvar ozn = \"( 1 - \"+cisla[i.innerHTML].oznacenie+\" )\";\n\t\t\t\tvar text = \"( doplnok ku \"+cisla[i.innerHTML].nazov+\" )<br><sub>\"+ozn+\"</sub>\";\n\t\t\t\tcisla[text] = {\"nazov\":\"( doplnok ku \"+cisla[i.innerHTML].nazov+\" )\", \"citatel\": cit, \"menovatel\": men, \"oznacenie\":ozn};\n\t\t\t\ti.innerHTML = text;\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Dobre si klikol.\";\n\n\t\t\t\t//console.log(i.style.backgroundColor);\n\t\t\t\tif (i.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\ti.style.backgroundColor = \"#ffffff\";\n\t\t\t\t\tif (udalosti[i.innerHTML] != undefined){\n\t\t\t\t\t\ti.style.backgroundColor = \"#e6e6ff\";\n\t\t\t\t\t}else if(kombinatorika[i.innerHTML] != undefined){\n\t\t\t\t\t\ti.style.backgroundColor = \"#ffe6e6\";\n\t\t\t\t\t} else if(cisla[i.innerHTML] != undefined){\n\t\t\t\t\t\ti.style.backgroundColor = \"#e6ffe6\";\n\t\t\t\t\t}\n\t\t\t\t\tvar pom = false;\n\t\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\t\tpom = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (document.getElementById(\"vypis\").innerHTML != \"Dobre si klikol.\"){\n\t\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t\t}\n\t\t\tclicked_nastroj = null;\n\t\t}\n\t\telse{\n\t\t\tclicked_nastroj = null;\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t\treturn;\n\t}\n\n\t//klikol na nastroj a druhy item\n\t//nastroje pre udalosti\n\tif (udalosti[i.innerHTML] != undefined && udalosti[clicked_item.innerHTML] != undefined && (clicked_nastroj == \"kartez\" || clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\tvar set = zjednotenie(udalosti[clicked_item.innerHTML].mnozina,udalosti[i.innerHTML].mnozina);\n\t\t\tvar text = udalost_to_text(\"( \"+udalosti[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+udalosti[i.innerHTML].nazov+\" )\",\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" ∪ \"+udalosti[i.innerHTML].oznacenie+\" )\",set);\n\t \t\tudalosti[text] = {\"nazov\":\"( \"+udalosti[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+udalosti[i.innerHTML].nazov+\" )\",\"oznacenie\":\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" ∪ \"+udalosti[i.innerHTML].oznacenie+\" )\", \"mnozina\":set};\n\t \t\tclicked_item.innerHTML = text;\n\t \t\tbuttony.splice(buttony.indexOf(i),1);\n\t \t\ti.remove();\n\t \t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t \t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"prienik\"){\n\t\t\tvar set = prienik(udalosti[clicked_item.innerHTML].mnozina,udalosti[i.innerHTML].mnozina);\n\t\t\tvar text = udalost_to_text(\"( \"+udalosti[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+udalosti[i.innerHTML].nazov+\" )\",\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" ∩ \"+udalosti[i.innerHTML].oznacenie+\" )\",set);\n\t \t\tudalosti[text] = {\"nazov\":\"( \"+udalosti[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+udalosti[i.innerHTML].nazov+\" )\",\"oznacenie\":\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" ∩ \"+udalosti[i.innerHTML].oznacenie+\" )\", \"mnozina\":set};\n\t \t\tclicked_item.innerHTML = text;\n\t \t\tbuttony.splice(buttony.indexOf(i),1);\n\t \t\ti.remove();\n\t \t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t \t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"pravdepodobnost\"){\n\t\t\tif (je_podmnozina(udalosti[clicked_item.innerHTML].mnozina,udalosti[i.innerHTML].mnozina)){\n\t\t\t\tvar pravdep = najme_menovatel(udalosti[clicked_item.innerHTML].mnozina.length,udalosti[i.innerHTML].mnozina.length);\n\t\t\t\tvar citatel = pravdep[0];\n\t\t\t\tvar menovatel = pravdep[1];\n\t\t\t\tvar ozn = \"P ( \"+udalosti[clicked_item.innerHTML].oznacenie+\" z \"+udalosti[i.innerHTML].oznacenie+\" )\";\n\t\t\t\tvar text = \"<strong>P (</strong> { \"+udalosti[clicked_item.innerHTML].nazov+\" } z { \"+udalosti[i.innerHTML].nazov+\" } <strong>)</strong><br><sub>\"+ozn+\"</sub>\";\n\t\t\t \tcisla[text] = {\"nazov\":\"<strong>P (</strong> { \"+udalosti[clicked_item.innerHTML].nazov+\" } z { \"+udalosti[i.innerHTML].nazov+\" } <strong>)</strong>\",\"citatel\": citatel, \"menovatel\": menovatel, \"oznacenie\":ozn};\n\t\t\t \tclicked_item.innerHTML = text;\n\t\t\t \tbuttony.splice(buttony.indexOf(i),1);\n\t\t\t \ti.remove();\n\t\t\t \tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\t\tvar pom = false;\n\t\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\t\tpom = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t\t}\n\t\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t\t}\n\t\t\t \tclicked_item = null;\n\t\t\t \tclicked_nastroj = null;\n\t\t\t}\t\n\t\t}\n\t\telse if (clicked_nastroj == \"kartez\"){\n\t\t\tvar set = karteziansky_sucin(udalosti[clicked_item.innerHTML].mnozina,udalosti[i.innerHTML].mnozina);\n\t\t\tvar text = udalost_to_text(\"( \"+udalosti[clicked_item.innerHTML].nazov+\" X \"+udalosti[i.innerHTML].nazov+\" )\",\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" X \"+udalosti[i.innerHTML].oznacenie+\" )\",set);\n\t\t\tudalosti[text] = {\"nazov\":\"( \"+udalosti[clicked_item.innerHTML].nazov+\" X \"+udalosti[i.innerHTML].nazov+\" )\",\"oznacenie\":\"( \"+udalosti[clicked_item.innerHTML].oznacenie+\" X \"+udalosti[i.innerHTML].oznacenie+\" )\", \"mnozina\":set};\n\t \t\tclicked_item.innerHTML = text;\n\t \t\tbuttony.splice(buttony.indexOf(i),1);\n\t \t\ti.remove();\n\t \t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t \t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t} else{\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t}\n\n\t//nastroje pre cisla\n\telse if (cisla[i.innerHTML] != undefined && cisla[clicked_item.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\")){\n\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\tvar novy_zlomok = sucet_zlomkov(cisla[clicked_item.innerHTML].citatel,cisla[clicked_item.innerHTML].menovatel,cisla[i.innerHTML].citatel,cisla[i.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar ozn = \"( \"+cisla[clicked_item.innerHTML].oznacenie+\" ∪ \"+cisla[i.innerHTML].oznacenie+\" )\";\n\t\t\tvar text = \"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+cisla[i.innerHTML].nazov+\" )<br><sub>\"+ozn+\"</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+cisla[i.innerHTML].nazov+\" )\", \"citatel\": cit, \"menovatel\": men, \"oznacenie\":ozn};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"prienik\"){\n\t\t\tvar novy_zlomok = najme_menovatel(cisla[clicked_item.innerHTML].citatel*cisla[i.innerHTML].citatel,cisla[clicked_item.innerHTML].menovatel*cisla[i.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar ozn = \"( \"+cisla[clicked_item.innerHTML].oznacenie+\" ∩ \"+cisla[i.innerHTML].oznacenie+\" )\";\n\t\t\tvar text = \"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+cisla[i.innerHTML].nazov+\" )<br><sub>\"+ozn+\"</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+cisla[i.innerHTML].nazov+\" )\", \"citatel\": cit, \"menovatel\": men, \"oznacenie\":ozn};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t} else{\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t}\n\n\t//nastroje pre kombinatoriku\n\telse if (kombinatorika[i.innerHTML] != undefined && kombinatorika[clicked_item.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\tvar nova_kombinatorika = kombinatorika[clicked_item.innerHTML].cislo + kombinatorika[i.innerHTML].cislo;\n\t\t\tvar text = \"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>alebo</strong> \"+kombinatorika[i.innerHTML].popis+\" )<br><sub>( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" + \"+kombinatorika[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tkombinatorika[text] = {\"popis\":\"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>alebo</strong> \"+kombinatorika[i.innerHTML].popis+\" )\",\"oznacenie\":\"( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" + \"+kombinatorika[i.innerHTML].oznacenie+\" )\", \"cislo\":nova_kombinatorika};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"prienik\"){\n\t\t\tvar nova_kombinatorika = kombinatorika[clicked_item.innerHTML].cislo * kombinatorika[i.innerHTML].cislo;\n\t\t\tvar text = \"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>a zároveň</strong> \"+kombinatorika[i.innerHTML].popis+\" )<br><sub>( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" * \"+kombinatorika[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tkombinatorika[text] = {\"popis\":\"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>a zároveň</strong> \"+kombinatorika[i.innerHTML].popis+\" )\",\"oznacenie\":\"( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" * \"+kombinatorika[i.innerHTML].oznacenie+\" )\", \"cislo\":nova_kombinatorika};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t \t}\n\t \telse if (clicked_nastroj == \"pravdepodobnost\"){\n\t\t\tif (parseInt(kombinatorika[clicked_item.innerHTML].cislo) <= parseInt(kombinatorika[i.innerHTML].cislo)){\n\t\t\t\tvar novy_zlomok = najme_menovatel(parseInt(kombinatorika[clicked_item.innerHTML].cislo),parseInt(kombinatorika[i.innerHTML].cislo));\n\t\t\t\tvar cit = novy_zlomok[0];\n\t\t\t\tvar men = novy_zlomok[1];\n\t\t\t\tvar ozn = \"P ( { \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" } z { \"+kombinatorika[i.innerHTML].oznacenie+\" } )\";\n\t\t\t\tvar text = \"<strong>P (</strong> { \"+kombinatorika[clicked_item.innerHTML].popis+\" } z { \"+kombinatorika[i.innerHTML].popis+\" } <strong>)</strong><br><sub>\"+ozn+\"</sub>\";\n\t\t\t \tcisla[text] = {\"nazov\":\"<strong>P (</strong> { \"+kombinatorika[clicked_item.innerHTML].popis+\" } z { \"+kombinatorika[i.innerHTML].popis+\" } <strong>)</strong>\", \"citatel\":cit, \"menovatel\":men, oznacenie:ozn};\n\t\t\t \tclicked_item.innerHTML = text;\n\t\t\t \tbuttony.splice(buttony.indexOf(i),1);\n\t\t\t \ti.remove();\n\t\t\t \tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\t\tvar pom = false;\n\t\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\t\tpom = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t\t}\n\t\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t\t}\n\t\t\t \tclicked_item = null;\n\t\t\t \tclicked_nastroj = null;\n\t\t\t}\t\n\t\t} else{\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t}\n\t//nastroje pre 1. kombinatoriku a 2. cislo\n\telse if (kombinatorika[i.innerHTML] != undefined && cisla[clicked_item.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\tvar novy_zlomok = sucet_zlomkov(cisla[clicked_item.innerHTML].citatel,cisla[clicked_item.innerHTML].menovatel,kombinatorika[i.innerHTML].cislo,1);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar text = \"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+kombinatorika[i.innerHTML].popis+\" )<br><sub>( \"+cisla[clicked_item.innerHTML].oznacenie+\" + \"+kombinatorika[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>alebo</strong> \"+kombinatorika[i.innerHTML].popis+\" )\",\"oznacenie\":\"( \"+cisla[clicked_item.innerHTML].oznacenie+\" + \"+kombinatorika[i.innerHTML].oznacenie+\" )\",\"citatel\":cit,\"menovatel\":men};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"prienik\"){\n\t\t\tvar novy_zlomok = najme_menovatel(cisla[clicked_item.innerHTML].citatel*kombinatorika[i.innerHTML].cislo,cisla[clicked_item.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar text = \"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+kombinatorika[i.innerHTML].popis+\" )<br><sub>( \"+cisla[clicked_item.innerHTML].oznacenie+\" * \"+kombinatorika[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+cisla[clicked_item.innerHTML].nazov+\" <strong>a zároveň</strong> \"+kombinatorika[i.innerHTML].popis+\" )\",\"oznacenie\":\"( \"+cisla[clicked_item.innerHTML].oznacenie+\" * \"+kombinatorika[i.innerHTML].oznacenie+\" )\",\"citatel\":cit,\"menovatel\":men};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t} else{\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t}\n\t//nastroje pre 1. cislo a 2. kombinatorika\n\telse if (cisla[i.innerHTML] != undefined && kombinatorika[clicked_item.innerHTML] != undefined && (clicked_nastroj == \"zjednotenie\" || clicked_nastroj == \"prienik\" || clicked_nastroj == \"pravdepodobnost\")){\n\t\tif (clicked_nastroj == \"zjednotenie\"){\n\t\t\tvar novy_zlomok = sucet_zlomkov(kombinatorika[clicked_item.innerHTML].cislo,1,cisla[i.innerHTML].citatel,cisla[i.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar text = \"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>alebo</strong> \"+cisla[i.innerHTML].nazov+\" )<br><sub>( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" + \"+cisla[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>alebo</strong> \"+cisla[i.innerHTML].nazov+\" )\",\"oznacenie\":\"( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" + \"+cisla[i.innerHTML].oznacenie+\" )\",\"citatel\":cit,\"menovatel\":men};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t}\n\t\telse if (clicked_nastroj == \"prienik\"){\n\t\t\tvar novy_zlomok = najme_menovatel(kombinatorika[clicked_item.innerHTML].cislo*cisla[i.innerHTML].citatel,cisla[i.innerHTML].menovatel);\n\t\t\tvar cit = novy_zlomok[0];\n\t\t\tvar men = novy_zlomok[1];\n\t\t\tvar text = \"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>a zároveň</strong> \"+cisla[i.innerHTML].nazov+\" )<br><sub>( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" * \"+cisla[i.innerHTML].oznacenie+\" )</sub>\";\n\t\t\tcisla[text] = {\"nazov\":\"( \"+kombinatorika[clicked_item.innerHTML].popis+\" <strong>a zároveň</strong> \"+cisla[i.innerHTML].nazov+\" )\",\"oznacenie\":\"( \"+kombinatorika[clicked_item.innerHTML].oznacenie+\" * \"+cisla[i.innerHTML].oznacenie+\" )\",\"citatel\":cit,\"menovatel\":men};\n\t\t\tclicked_item.innerHTML = text;\n\t\t\tbuttony.splice(buttony.indexOf(i),1);\n\t\t\ti.remove();\n\t\t\tif (clicked_item.style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffffff\";\n\t\t\t\tvar pom = false;\n\t\t\t\tfor (var b=0; b<buttony.length; b++){\n\t\t\t\t\tif (buttony[b].style.backgroundColor == \"rgb(206, 244, 255)\"){\n\t\t\t\t\t\tpom = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!pom){spravny_vysledok = false;}\n\t\t\t}\n\t\t\tif (udalosti[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6e6ff\";\n\t\t\t}else if(kombinatorika[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#ffe6e6\";\n\t\t\t} else if(cisla[clicked_item.innerHTML] != undefined){\n\t\t\t\tclicked_item.style.backgroundColor = \"#e6ffe6\";\n\t\t\t}\n\t\t\tclicked_item = null;\n\t \t\tclicked_nastroj = null;\n\t\t} else{\n\t\t\tdocument.getElementById(\"vypis\").innerHTML = \"Zle si klikol.\";\n\t\t}\n\t}\n\tif (document.getElementById(\"vypis\").innerHTML != \"Zle si klikol.\"){\n\t\tdocument.getElementById(\"vypis\").innerHTML = \"Dobre si klikol.\";\n\t}\n\tclicked_nastroj = null;\n\tclicked_item = null;\n}", "title": "" }, { "docid": "fd39cc8cd78530b1d1ba8c8a42f2d6d3", "score": "0.52038115", "text": "function getSlot(i, a) {\n\t\tvar slot = i >> 5 * a.height;\n\t\twhile (a.lengths[slot] <= i) {\n\t\t\tslot++;\n\t\t}\n\t\treturn slot;\n\t}", "title": "" }, { "docid": "b10fb3e701ea9be310e2f8555fdfb4ab", "score": "0.5190537", "text": "if ( argumentos . comprimento ) {\n\t\t\t opções de retorno === indefinido ?\n\t\t\t\teste :\n\t\t\t\tisso . cada ( função ( i ) {\n\t\t\t\t\tjQuery . deslocamento . setOffset ( this , options , i ) ;\n\t\t\t\t} ) ;", "title": "" }, { "docid": "7f2a69406011a1e1823795108f7f6967", "score": "0.5179918", "text": "function selectInventory() {\n var index;\n if (livello < 3) {\n index = livello;\n } else {\n index = 3\n }\n\n if (inventarioPos < index) {\n for (i = 0; i < index; i++) {\n var realIndex = i + 1;\n if (i == inventarioPos) {\n document.getElementById(\"inventory\" + realIndex.toString()).style.border = \"1px solid #E4AE6E\";\n } else {\n document.getElementById(\"inventory\" + realIndex.toString()).style.border = \"1px solid black\";\n }\n }\n }\n\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "199654924969e8e6ecb06b0ff3ccb1d9", "score": "0.51770043", "text": "function getSlot(i, a)\n{\n\tvar slot = i >> (5 * a.height);\n\twhile (a.lengths[slot] <= i)\n\t{\n\t\tslot++;\n\t}\n\treturn slot;\n}", "title": "" }, { "docid": "9a23c4c21b0768b26350df44fe4ce779", "score": "0.51742405", "text": "function getPremioSlots(slots) {\r\n\t//banco.premio = 0;\r\n\toperarSlots(slots, function(slots, indice){ sumaPremio(slots[indice]) });\r\n\tif(esPleno(slots))\r\n\t\tbanco.setPremio(banco.getPremio() * (multiplicadorPorPleno || slots.length));\r\n}", "title": "" }, { "docid": "5e4e1b822c76a0a9df3995a773d0c52f", "score": "0.516742", "text": "function adjustedIndex(slot) {\n\t var undefinedIndex;\n\n\t if (!slot) {\n\t return undefinedIndex;\n\t }\n\n\t var delta = 0;\n\t while (!slot.firstInSequence) {\n\t delta++;\n\t slot = slot.prev;\n\t }\n\n\t return (\n\t typeof slot.indexNew === \"number\" ?\n\t slot.indexNew + delta :\n\t typeof slot.index === \"number\" ?\n\t slot.index + delta :\n\t undefinedIndex\n\t );\n\t }", "title": "" }, { "docid": "85cd930c9d8466cda7083ef4f5f4c707", "score": "0.51615506", "text": "function selected(clicked_id) {\n selectedSlot = clicked_id;\n generateNumber(); \n}", "title": "" }, { "docid": "1dc4485eef83107695e1a065eea4269d", "score": "0.5150832", "text": "changeLineitemQuantity(quantity,index){\n // console.log('cliq',this)\n // console.log(arguments)\n var tempLineitems = this.state.invoiceInfo.lineitems.slice();\n tempLineitems[index].quantity = quantity\n this.setState({\n invoiceInfo:{\n customerName:this.state.invoiceInfo.customerName,\n invoiceNumber:this.state.invoiceInfo.invoiceNumber,\n lineitems:tempLineitems\n }\n })\n }", "title": "" }, { "docid": "22e0b2cafe330365327696a34f2afad9", "score": "0.5141909", "text": "function trocaCorpo(idx, i){\n\n\tanimal_montando.removeChildAt(1);\n\n\tidxY += i;\n\tif(idx == 9 && i == 1) { idxY = 0; }\n\tif (idx == 0 && i == -1 ) { idxY = 9; }\n\t\n\tthis.bM = corpos.getChildAt(idxY).clone(true);\n\n\tthis.bM.x = crpUp.x;\n\tthis.bM.y = ((crpUp.y + crpDown.y) /2) + 50;\n\tthis.bM.scaleX = this.bM.scaleY = 0.3;\n\tanimal_montando.addChildAt(bM, 1);\n\n\tif(gameCaixa.contains(animal_atual) || criarArea.contains(animal_atual)){\n\t\tgerarAtual();\n\t}\n\t\n}", "title": "" }, { "docid": "6c0ad5e223cd67ca8b4322de77446547", "score": "0.5139092", "text": "function adjustedIndex(slot){var undefinedIndex;if(!slot){return undefinedIndex;}var delta=0;while(!slot.firstInSequence){delta++;slot=slot.prev;}return typeof slot.indexNew===\"number\"?slot.indexNew+delta:typeof slot.index===\"number\"?slot.index+delta:undefinedIndex;}// Updates the new index of the first slot in each sequence after the given slot", "title": "" }, { "docid": "10e9c00a212853ab35fabd425a5a6340", "score": "0.5137664", "text": "Item(string, int) {\n\n }", "title": "" }, { "docid": "5ba21ed5fe80f27d21f5334ab984f170", "score": "0.5134422", "text": "bookSlot(event) {\n this.phyId = event.detail.phyId;\n this.phyName = event.detail.phyName;\n this.slotStart = event.detail.slotStart;\n this.slotEnd = event.detail.slotEnd;\n this.slotName = event.detail.slotName;\n this.bookDate = event.detail.dt;\n this.showBookingSlotModal = true;\n }", "title": "" }, { "docid": "34025126cca6c3d7dd3cb2d469b89067", "score": "0.51317453", "text": "addSlot(slot) {\n this.freeSlots.push(slot);\n }", "title": "" }, { "docid": "32a1fded251b2d4d46b421d9f199957d", "score": "0.51300675", "text": "function addItem(dataService, schemaService, locationService, pointer, index = 0) {\n const list = dataService.get(pointer);\n const schema = schemaService.get(pointer);\n if (schema.type !== \"array\") {\n throw new Error(`Can not add item to a non-array (${pointer})`);\n }\n const selectOptions = schemaService.getChildSchemaSelection(pointer, index);\n // single option, immediately create template data and add item to list\n if (selectOptions.length === 1) {\n addSelection(0, schemaService, dataService);\n return;\n }\n // multiple options, ask user\n const element = createElement(\".overlay__item\");\n const selection = selectOptions.map((item, oneOfIndex) => ({\n icon: UISchema.getDefaultOption(item, \"icon\"),\n title: UISchema.getDefaultOption(item, \"title\"),\n description: UISchema.getDefaultOption(item, \"description\"),\n value: oneOfIndex\n }));\n // fetch overlay options\n const options = getEditronOptions(schemaService.get(pointer));\n const overlayOptions = {\n header: \"\",\n ...options === null || options === void 0 ? void 0 : options.overlay\n };\n // create user-selection\n m.render(element, m(SelectTileComponent, {\n // description: \"Modulauswahl - Bitte wählen\",\n value: 0,\n options: selection,\n onchange: (value) => {\n const selectedIndex = parseInt(value, 10);\n addSelection(selectedIndex, schemaService, dataService);\n OverlayService.close();\n locationService.goto(`${pointer}/${index}`);\n }\n }));\n // add data of selection\n function addSelection(selectedIndex, schemaService, dataService) {\n const itemSchema = selectOptions[selectedIndex];\n const itemData = schemaService.getTemplate(itemSchema);\n list.splice(index, 0, itemData);\n dataService.set(pointer, list);\n }\n // and ask question\n OverlayService.open(element, {\n header: overlayOptions.header,\n confirmButton: false\n });\n // .then(action => { console.log(\"dialog closed\", action); });\n}", "title": "" }, { "docid": "19b477725ccdf15ecefa9a6565c76adf", "score": "0.5128511", "text": "renderItem(item, index) {\n return (\n <TouchableOpacity activeOpacity={0.9} onPress={() => this.selectProduct(item)} style={styles.productItem}>\n <Text>{item.item.name}</Text>\n </TouchableOpacity>\n )\n }", "title": "" }, { "docid": "e036e5a819fa19db4cb6cc16789b91f3", "score": "0.5125363", "text": "function biCreate(container, budgetNum) {\n itemCount++;\n itemArray.push(`budget${budgetNum}-item${itemCount}`);\n let large =\n `<div id=\"item${itemCount}card\" name=\"item${itemCount}\" class=\"card card-inverse-success wizardcard-context new-item\">\n <div class=\"card-header bihead mt-1\">\n <div class=\"row\">\n <div class=\"col-1\">\n <button onclick=\"remBi(this.name , 'budget${budgetNum}')\" name=\"item${itemCount}\" class=\"btn btn-rounded btn-primary btn-icon ml-1\" type=\"button\"><i class=\"mdi mdi-window-close \"></i></button>\n </div>\n <div class=\"col-3\">\n <div class=\"card-title batitle text-right\">\n <a href=\"#\" data-type=\"text\" id=\"item${itemCount}name\" class=\"budgetName budgetNamecontainer\">Sample Item</a>\n </div>\n </div>\n <div class=\"offset-1 col-3\">\n Target Amount:\n </div>\n <div class=\"col-4\">\n <input id=\"item${itemCount}target\" class=\"budgetitemtotal text-center\" data-inputmask=\"'alias': 'currency'\" />\n </div>\n </div>\n </div>\n </div>`;\n $(container).append(large);\n $(\":input\").inputmask();\n $('.budgetName').editable({\n validate: function (value) {\n if ($.trim(value) === '') return ' This field is required';\n }\n });\n $('.itemBtn').blur();\n}", "title": "" }, { "docid": "dfdf4dcd21c68b436a20790c246a9220", "score": "0.5123445", "text": "function onItemSelecionado(evento, item){\r\n\t\tvar resposta = $.ajax({\r\n\t\t\turl: 'item', \r\n\t\t\tmethod: 'POST',\r\n\t\t\tdata: {\r\n\t\t\t\tcodigoCerveja: item.codigo,\r\n\t\t\t\tuuid: this.uuid\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t// renderiza na tela o html passado por onItemAtualizadoNoServidor\r\n\t\tresposta.done(onItemAtualizadoNoServidor.bind(this));\r\n\t}", "title": "" }, { "docid": "031be4cfebdd71c1daf17562c7685f13", "score": "0.5119392", "text": "_renderItem({ item, index }) {\n return <CarouselItem data={item} even={(index + 1) % 2 === 0} onPress={visibleModal} ImageCarousel={this.image}/>;\n }", "title": "" }, { "docid": "ebd2259cc0489e00f77233c1326ddd7a", "score": "0.511168", "text": "useItem() {\n let graphic = this.windowBoxInformation.content;\n if (graphic.item.system.consumable) {\n Game.current.useItem(graphic.item);\n }\n if (graphic.item.nb > 0) {\n graphic.updateNb();\n }\n else {\n this.updateForTab();\n this.substep = 0;\n Manager.Stack.requestPaintHUD = true;\n }\n this.windowBoxUseItem.content.updateStats();\n Manager.Stack.requestPaintHUD = true;\n }", "title": "" }, { "docid": "0428b0b6dcdc386b40b0c93975752598", "score": "0.509465", "text": "edit(item){}", "title": "" }, { "docid": "491d4f144333b5fa9b5488bc27ea3dd9", "score": "0.508691", "text": "function createItems(){\n itemHandler.splice(itemHandler.length,0,document.createElement('div')); //añadimos al final el div\n var index = itemHandler.length-1; \n \n itemHandler[index].classList.add('item'/*,itemName[index]*/);\n itemHandler[index].id = \"item\" + String(index); //item0, item1, item2...\n itemHandler[index].onclick = function() {buyItem(this.id)};\n \n var img = document.createElement('img');\n img.src = itemSprite[index];\n img.classList.add('foto');\n itemHandler[index].appendChild(img);\n \n var text = document.createElement('div');\n text.textContent = itemName[index];\n \n generateBr(text);\n generateSpan(text,\"Nº: \");\n \n \n itemCountHandler[index] = document.createElement('span');\n itemCountHandler[index].textContent = 0;\n //count.classList.add('');\n //count.id = \"\" + String(index);\n text.appendChild(itemCountHandler[index]);\n \n \n generateBr(text);\n generateSpan(text,\"Precio: \");\n \n \n itemCostHandler[index] = document.createElement('span');\n itemCostHandler[index].textContent = itemCost[index];\n //price.classList.add('');\n //price.id = \"\" + String(index);\n text.appendChild(itemCostHandler[index]);\n \n \n generateBr(text);\n generateSpan(text,\"Recompensa: \" + itemReward[index]);\n \n itemHandler[index].appendChild(text);\n \n items.appendChild(itemHandler[itemHandler.length-1]);\n}", "title": "" }, { "docid": "ae4c9707d841a9314ef5f520ea56af2e", "score": "0.50841355", "text": "function clickSlot(slotClicked){\n for(var i = 0; i < slots.length; ++i){\n owned = false;\n if(slotClicked === slots[i].keyIndex){\n for(var q = 0; q < playerState.purchases.length; q++){\n if(playerState.purchases[q] == slots[i].key){\n owned = true;\n }\n }\n if(!owned) {\n if(defEngine.canAfford(slots[i].cost)){\n defEngine.spendGold(slots[i].cost);\n slots[i].text.setText(\"Owned\");\n slots[i].text.fill = grd3;\n playerState.purchases.push(slots[i].key);\n }\n }\n console.log(playerState.purchases);\n console.log(slots[i].text._text);\n }\n }\n updatePurchases();\n }", "title": "" }, { "docid": "c770a73f70c897ba11d0cdfbb8ca76c9", "score": "0.50832456", "text": "function clickSarrus(item,nombre){\n\t//Añade el id al orden\n\tORDENARRAY.push(Number(item));\n\tvar seleccionados=document.getElementById(\"listaSeleccionados\");\n\tvar correccion=document.getElementById(\"correccion\");\n\t//Si no ha pulsado como minimo 18 veces añade el ultimo pulsado\n\tif (ORDENARRAY.length<=18) {\n\t\tseleccionados.innerHTML+='posicion '+ nombre;\n\t\tseleccionados.innerHTML+='. ';\n\t}\n\t//Cuando supera los 17 click comprueba el orden. ya que sarrus se hace en 18 click\n\tif (ORDENARRAY.length > 17){\n\n\t\tif (String(ORDENARRAY)==String(ORDENEVALIDOS)) {\n\t\t\tcorreccion.innerHTML=\"¡CORRECTO!\";\n\t\t} else {\n\t\t\tcorreccion.innerHTML=\"Vuelve a probar\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "67a095be27fa8d93a42a9dbbfaddc787", "score": "0.50824994", "text": "function setItem(index, offset, status, height, offsetTop) {\n vm.items[index] = {\n offset: offset,\n status: status,\n height: height,\n offsetTop: offsetTop\n };\n }", "title": "" }, { "docid": "eb9adaa00273d7f4c2f244427ef51cdb", "score": "0.50764865", "text": "function itemMarcado(event, ui)\n{\n var item = ui.item.label;\n switch(ui.item.value.opt){\n case 'protagonista':\n $(\"#protagonista\").val(item);\n break;\n case 'medio':\n $(\"#medio\").val(item);\n break;\n case 'programa':\n $(\"#programa\").val(item);\n break;\n case 'ciudad':\n $(\"#ciudad\").val(item);\n break;\n }\n event.preventDefault();\n}", "title": "" }, { "docid": "fc8923ee83f1918fc2686bdc5124cafe", "score": "0.5073791", "text": "handleItemClick(e) {\n let newValue, itemInt, itemPosition;\n const instance = this,\n node = e.target,\n props = instance.props,\n item = node && node.getAttribute(\"data-id\");\n if (!props.disabled && !props.readOnly && !this._buttonDown) {\n if (props.closeOnClick) {\n instance.setState({expanded: false});\n instance.focus(true, BTN_REFOCES_TRANS_TIME);\n }\n else {\n instance._focusContainer.focusElement(Array.prototype.indexOf.call(node.parentNode.querySelectorAll(\"li\"), node));\n }\n if (item) {\n itemInt = parseInt(item, 10);\n if (props.multiSelect) {\n newValue = props.selected;\n if (typeof newValue===\"number\") {\n newValue = [newValue];\n }\n else if (!newValue) {\n newValue = [];\n }\n itemPosition = newValue.indexOf(itemInt);\n if (itemPosition===-1) {\n newValue.push(itemInt);\n }\n else {\n newValue.splice(itemPosition, 1);\n }\n }\n else {\n newValue = itemInt;\n }\n instance.props.onChange(newValue);\n }\n }\n }", "title": "" }, { "docid": "794ffa5cfc1505217f13547c9ccb1c1f", "score": "0.5072838", "text": "buy(item, tradesman) {}", "title": "" }, { "docid": "3767c8d597d257dd07c73ccd0de807c4", "score": "0.5072504", "text": "addItem(item) {\n var items = this.items;\n\n var item = items[item.id] = {\n 'name': item.name,\n 'height': item.height,\n 'width': item.width,\n 'location': item.location\n };\n }", "title": "" }, { "docid": "0c49da4447f548f0dd6f52cdb3527334", "score": "0.5068999", "text": "item(index, value) {\n if (arguments.length === 1) return items[index];\n return modifyItems(items => (items[index] = value));\n }", "title": "" }, { "docid": "a7b54cd818369cac893e76879bd6d2c0", "score": "0.50489956", "text": "dropItem(slot, droppedItemObj){\n\t\tif(this.inventory[\"slot\"+slot] !== \"\" && slot !== null){\n\t\t\tlet temp = this.inventory[\"slot\"+slot];\n\t\t\tdroppedItemObj.dropItem(this.x, this.y, temp, this.email);\n\t\t\tthis.inventory[\"slot\"+slot] = \"\";\n\t\t\tif(temp !== undefined){\n\t\t\t\tthis.setGameMessage('Dropped item: '+temp.name);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b55bebfc510db383ac3e6cbe2eb5099b", "score": "0.504709", "text": "putItem(item) {\n this.inventory.push(item);\n this.recalculateInventorySlots();\n this.engine.item_tutorial_message.hide();\n this.engine.sound.play(\"pickup\");\n }", "title": "" }, { "docid": "d252d18cdb397bdf4b3b7c017d831e76", "score": "0.50467914", "text": "function setslot(ai, bi, len = 1, str = 1, pow = 0, role, prio, type = role.id) {\n role.springs.push({ at: toTid(ai), bt: toTid(bi), len, str, pow, type, prio });\n }", "title": "" }, { "docid": "8ae463a0b88adf84d7b32beee07c382c", "score": "0.5042303", "text": "function placeItem( event ) {\n scene.add( item.clone() );\n }", "title": "" }, { "docid": "44fa4c9750805f10a1f8bf1e901707be", "score": "0.5040893", "text": "function addItem() {\n\n\n //$.mobile.silentScroll();\n\n\n // Neues Item mit Default-Werten löschen\n //category,brand,description,count,price,creationdate,lastupdatetdate\n actItem = new Item(\"\", \"\", \"\", \"\", \"\", \"\", new Date(), templatePhoto, \"no barcode\");\n\n\n // und so tun, als ob es eine gäbe...\n edit();\n\n valid.validate(); // erstmalige Validierung\n }", "title": "" }, { "docid": "04657a8aa6556c8259dfee7363e79369", "score": "0.50230455", "text": "function addSalvoEvent(gridSalvo){\n $(\".grid-stack-item\").click(function() {\n// var h = parseInt($(this).attr(\"data-gs-height\"));\n// var w = parseInt($(this).attr(\"data-gs-width\"));\n var posX = parseInt($(this).attr(\"data-gs-x\"));\n var posY = parseInt($(this).attr(\"data-gs-y\"));\n gridSalvo.addWidget($('<div id=\"Bomb\"><div class=\"grid-stack-item-content Bomb\"></div><div/>'), posX, posY, 1, 1, true);\n });\n}", "title": "" }, { "docid": "da69664166fb7ff07c0dbe64d900cd1c", "score": "0.5020301", "text": "addItem(i,q){\n this.itemList.push(i);\n this.itemQuantity.push(q);\n }", "title": "" }, { "docid": "7c13f213dc7e14b6c246c2e4945d5efc", "score": "0.5015781", "text": "function MenuClicked(nama_item, harga, gambar_item) {\n console.log(\"menu start\")\n for (let i = 0; i < orderItem.length; i++) {\n if (orderItem[i][\"nama_item\"] == nama_item) {\n orderItem[i][\"kelipatan\"] += 1\n LoopOrder()\n return\n }\n }\n let order = {\n \"nama_item\": nama_item,\n \"harga\": harga,\n \"gambar_item\": gambar_item,\n \"kelipatan\": 1,\n }\n orderItem.push(order)\n LoopOrder()\n}", "title": "" }, { "docid": "1bdc968479f5c7b89bcf6d451029f36d", "score": "0.5010895", "text": "function handleItem(item) {\n console.log(item.value)\n setItem(item.value);\n if (item.value === \"descuentocuota\") {\n setRuta(\"Reclamos/ Reclamos de facturacion/ Cliente solicita descuento de cuota fija WF\")\n\n } else if (item.value === \"locucion\") {\n setRuta(\"Reclamos/ Servicios Bloqueados/ Cliente al dia locucion mora activa - WF\");\n \n } else if (item.value === \"aclaracionsincarta\") {\n setRuta(\"Reclamos/ Reclamos de facturacion/ Reclamo Aclaraciones - Sin Carta WF\");\n\n } else if (item.value === \"cablesbajos\") {\n setRuta(\"Reclamos/ Averia/ Lineas o cables bajos WF\");\n\n } else if (item.value === \"solaceico\") {\n setRuta(\"Reclamos/ Reincidencia de Llamadas/ Reclamo de Sol escalado a CEICO WF\");\n\n } else if (item.value === \"bajavigente\") {\n setRuta(\"Cancelaciones/ WF Seguimiento/ Solicitud de baja con contrato vigente WF\");\n\n } else if (item.value === \"bajavencido\") {\n setRuta(\"Cancelaciones/ WF Seguimiento/ Solicitud baja C Vencido Reforma Ley2019 WF\");\n \n } else if (item.value === \"norecibefac\") {\n setRuta(\"Reclamos/ Entrega de Factura/ No recibe factura - Direccion Correcta WF\");\n \n } else if (item.value === \"procesoincompleto\") {\n setRuta(\"Reclamos/ Mala atención al cliente/ Proceso incompleto WF\");\n\n }\n \n }", "title": "" }, { "docid": "f77fbe7c6cce072e0e49f87587e237d9", "score": "0.50056845", "text": "function create_default_slot_14(ctx) {\n \tlet t;\n\n \treturn {\n \t\tc() {\n \t\t\tt = text(/*title*/ ctx[4]);\n \t\t},\n \t\tm(target, anchor) {\n \t\t\tinsert(target, t, anchor);\n \t\t},\n \t\tp(ctx, dirty) {\n \t\t\tif (dirty[0] & /*title*/ 16) set_data(t, /*title*/ ctx[4]);\n \t\t},\n \t\td(detaching) {\n \t\t\tif (detaching) detach(t);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "845690aa1d5de7841668f7fc408c1a7e", "score": "0.50022346", "text": "function cartItemClickListener(event) {\n const clicarItem = event.target;\n clicarItem.remove();\n soma();\n salvarItens();\n // chamo as funções soma e salvarItens aqui também pois quando eu tirar algum intem da lista preciso somar de novo e salvar de novo\n}", "title": "" }, { "docid": "b44f7548d8faa29bb9a20cb8d8fceb1d", "score": "0.4995924", "text": "function modificationItem(item)\t\r\n{\r\n\t// Cas particulier du nom de la transaction\r\n\t// ----------------------------------------\r\n\tif(item == 0){\r\n\t\tvar tName = document.getElementById(\"itemTransactionInputField\").value;\r\n\t\tif (tName.trim() == '') {tName = \"???\"};\r\n\t\tdocument.getElementById(\"schemaTitleBarBlock\").firstChild.nodeValue = tName;\r\n\t\t// Stockage en mémoire\r\n\t\tlocalStorage.setItem(\"transactionNameLS\", tName);\r\n\t\treturn;}\r\n\t\t\r\n\t// Récupérer l'item dans la liste du volet gauche\r\n\t// ----------------------------------------------\r\n\tvar itemObject = document.getElementById(item.substring(0,8) + '_Input');\t\r\n\tconsole.log('modificationItem :\\n...item = ' + item + ' | value = ' + itemObject.value); // = texte saisi\r\n\t\r\n\tif (itemObject.value.trim() == '') {itemObject.value = \"???\"};\r\n\r\n\t\t\r\n\t// Récupérer le libellé correspondant dans le schéma\r\n\t// -------------------------------------------------\r\n\tvar schemaObject = document.getElementById(item.substring(0,8) + '_Label');\t\r\n \r\n\t// Création d'un noeud contenant le texte saisi\r\n\t// --------------------------------------------\r\n\tvar texte = document.createTextNode(itemObject.value);\t\r\n\t\r\n\t// Récupération du type du dernier noeud du conteneur du texte\r\n\t// -----------------------------------------------------------\r\n\tvar lastType = schemaObject.lastChild.nodeType;\t\t\t\t\t\r\n\tconsole.log('modificationItem :\\n...lastType = ' + lastType );\r\n\r\n\tif (lastType == 1) {\t\t\t\t\t\r\n\t\tschemaObject.appendChild(texte);\t\t\t\t\t\t\t\t// Le dernier enfant n'est pas du texte --> on ajoute\r\n\t} else {\r\n\t\tschemaObject.replaceChild(texte, schemaObject.lastChild);\t// Sinon on remplace\r\n\t} \r\n\t\r\n\t// Mise à jour du tableau en mémoire (itemsList) : remplacement de la partie de droite par le nouveau libellé \r\n\t// ----------------------------------------------------------------------------------------------------------\r\n\tfor (var i = 0, c = itemsList.length ; i < c; i++) {\r\n\t\tif (itemsList[i].substring(0,8) == item.substring(0,8)) {\r\n\t\t\titemsList[i] = itemsList[i].substring(0,8) + '_' + itemObject.value;\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconsole.log('modificationItem :\\n...itemsList [' + i + '] = ' + itemsList[i]);\r\n}", "title": "" }, { "docid": "9aaaec25561f4cd2f527ede2e90a5281", "score": "0.49921188", "text": "function getCardSlot(index){\n var cardSlot = new THREE.Object3D();\n var card = getCard(false);\n var cardSelection = getCardSelection(false);\n var fieldIndex = getFieldIndex(index);\n cardSlot.add(card);\n cardSlot.add(cardSelection);\n cardSlot.add(fieldIndex);\n cardSelection.position.set(0,0,-1);\n fieldIndex.position.set(0,0,-.5);\n fieldPositions.push(fieldIndex);\n cardSlots.push(cardSelection);\n cards.push(card);\n return cardSlot;\n}", "title": "" }, { "docid": "118c86ceb2e3e98354f4aa66598dc95e", "score": "0.49889025", "text": "function itemClick(e) {\n\t\tif (!e.itemData.items) {\n\t\t\t//notify(`The \"${ e.itemData.text }\" item was clicked`, 'success', 1500);\n\t\t\tif (e.itemData.text === '') {\n\n\t\t\t}\n\t\t\tif (!proyects.DatosPresupuesto || !proyects.DatosPresupuesto[0]) return;\n\t\t\tif (proyects.Sub_sel === '') {\n\t\t\t\tSwal.fire({\n\t\t\t\t\ttitle: 'Error!',\n\t\t\t\t\ttext: 'Debe seleccionar un SubPresupuesto',\n\t\t\t\t\ticon: 'error',\n\t\t\t\t\tconfirmButtonText: 'Ok'\n\t\t\t\t})\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tlet NCod = proyects.DataPc.length + 1;\n\t\t\tlet NCodStr = '00000000000000';\n\t\t\tif (NCod >= 10)\n\t\t\t\tNCodStr = '0000000000000';\n\t\t\tif (NCod >= 100)\n\t\t\t\tNCodStr = '000000000000';\n\t\t\tif (NCod >= 1000)\n\t\t\t\tNCodStr = '00000000000';\n\t\t\tif (NCod >= 10000)\n\t\t\t\tNCodStr = '0000000000';\n\t\t\tif (NCod >= 100000)\n\t\t\t\tNCodStr = '000000000';\n\t\t\tif (NCod >= 1000000)\n\t\t\t\tNCodStr = '00000000';\n\t\t\tif (NCod >= 10000000)\n\t\t\t\tNCodStr = '0000000';\n\t\t\tif (NCod >= 100000000)\n\t\t\t\tNCodStr = '000000';\n\t\t\tif (NCod >= 1000000000)\n\t\t\t\tNCodStr = '00000';\n\t\t\tif (NCod >= 10000000000)\n\t\t\t\tNCodStr = '0000';\n\t\t\tif (NCod >= 100000000000)\n\t\t\t\tNCodStr = '000';\n\n\t\t\t//alert(NCodStr + NCod)\n\t\t\tvar ItemN = [{\n\t\t\t\tCodPresupuesto: proyects.DatosPresupuesto[0].CodPresupuesto,\n\t\t\t\tCodSubpresupuesto: proyects.Sub_sel,\n\t\t\t\tDescripcion: \"\",\n\t\t\t\tERPCode: proyects.DatosPresupuesto[0].CodPresupuesto + proyects.Sub_sel + NCodStr + NCod,\n\t\t\t\tItem: NCodStr + NCod,\n\t\t\t\tMetrado: null,\n\t\t\t\tNivel: 1,\n\t\t\t\tOrden: \"01.15.12\",\n\t\t\t\tOrdenJerarquico: proyects.Sub_sel + \"02.01.01\" + getRandomString(2),\n\t\t\t\tPhantomParentId: null,\n\t\t\t\tPrecio1: null,\n\t\t\t\tPrecio2: null,\n\t\t\t\tSecuencial: 1,\n\t\t\t\tUnidad: null,\n\t\t\t}];\n\n\n\t\t\tif (e.itemData.text === 'Título') {\n\t\t\t\tsetShowTit(true);\n\t\t\t\tlet Niv = 1;\n\t\t\t\tif (itemSel)\n\t\t\t\t\tNiv = parseInt(itemSel.Nivel);\n\t\t\t\tif (Niv === 1) {\n\t\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === 1).length + 1;\n\t\t\t\t\tlet Cod1S = '0';\n\t\t\t\t\tif (Cod1 >= 10)\n\t\t\t\t\t\tCod1S = '';\n\t\t\t\t\tItemN[0].PhantomParentId = null;\n\t\t\t\t\tItemN[0].Orden = Cod1S + Cod1;\n\t\t\t\t\tItemN[0].OrdenJerarquico = proyects.Sub_sel + Cod1S + Cod1;\n\t\t\t\t} else {\n\t\t\t\t\t//console.log('ESTE ES ITEM SEL');\n\t\t\t\t\t//console.log(itemSel);\n\t\t\t\t\t//let CodPToca='';\n\t\t\t\t\t//CodPToca=itemSel.OrdenJerarquico;\n\t\t\t\t\t/*if (itemSel.Unidad===null)\n\t\t\t\t\t{\n\t\t\t\t\t\tCodPToca=itemSel.OrdenJerarquico;\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tCodPToca=itemSel.PhantomParentId;\n\t\t\t\t\t}*/\n\t\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === Niv && item.PhantomParentId === itemSel.PhantomParentId).length + 1;\n\t\t\t\t\tlet Cod1S = '0';\n\t\t\t\t\tif (Cod1 >= 10)\n\t\t\t\t\t\tCod1S = '';\n\t\t\t\t\tItemN[0].PhantomParentId = itemSel.PhantomParentId;\n\t\t\t\t\tItemN[0].Orden = itemSel.PhantomParentId.substring(3, itemSel.PhantomParentId.length) + \".\" + Cod1S + Cod1;\n\t\t\t\t\tItemN[0].OrdenJerarquico = itemSel.PhantomParentId + \".\" + Cod1S + Cod1;\n\t\t\t\t}\n\t\t\t\tItemN[0].Nivel = Niv;\n\t\t\t\t/*if (Niv===1)\n\t\t\t\tItemN[0].PhantomParentId=null;\n\t\t\t\telse\n\t\t\t\tItemN[0].PhantomParentId=itemSel.OrdenJerarquico;*/\n\t\t\t\tdispatch(selectTITULOS('', '20', '1', ''));\n\t\t\t\tsetItemAgregar(ItemN);\n\t\t\t}\n\n\t\t\tif (e.itemData.text === 'Título ') {\n\t\t\t\tsetShowTit(true);\n\t\t\t\t//ItemN[0].PhantomParentId=itemSeleccionado;\n\t\t\t\tlet Niv = parseInt(itemSel.Nivel) + 1;\n\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === Niv && item.PhantomParentId === itemSel.OrdenJerarquico).length + 1;\n\t\t\t\tlet Cod1S = '0';\n\t\t\t\tif (Cod1 >= 10)\n\t\t\t\t\tCod1S = '';\n\t\t\t\t//alert(Cod1)\n\t\t\t\tItemN[0].Orden = itemSel.OrdenJerarquico.substring(3, itemSel.OrdenJerarquico.length) + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].OrdenJerarquico = itemSel.OrdenJerarquico + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].PhantomParentId = itemSel.OrdenJerarquico;\n\t\t\t\tItemN[0].Nivel = Niv;\n\t\t\t\tdispatch(selectTITULOS('', '20', '1', ''));\n\t\t\t\tsetItemAgregar(ItemN);\n\t\t\t}\n\n\n\t\t\tif (e.itemData.text === 'Partida') {\n\t\t\t\tsetShowPart(true);\n\n\t\t\t\tlet Niv = 1;\n\t\t\t\tif (itemSel)\n\t\t\t\t\tNiv = parseInt(itemSel.Nivel);\n\t\t\t\t/*if (Niv===1){\n\t\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === 1).length + 1;\n\t\t\t\t\tlet Cod1S='0';\n\t\t\t\t\tif (Cod1>=10)\n\t\t\t\t\tCod1S='';\n\t\t\t\t\tItemN[0].PhantomParentId=null;\n\t\t\t\t\tItemN[0].Orden=Cod1S + Cod1;\n\t\t\t\t\tItemN[0].OrdenJerarquico= proyects.Sub_sel + Cod1S + Cod1;\n\t\t\t\t}else{*/\n\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === Niv && item.PhantomParentId === itemSel.PhantomParentId).length + 1;\n\t\t\t\tlet Cod1S = '0';\n\t\t\t\tif (Cod1 >= 10)\n\t\t\t\t\tCod1S = '';\n\t\t\t\tItemN[0].PhantomParentId = itemSel.PhantomParentId;\n\t\t\t\tItemN[0].Orden = itemSel.PhantomParentId.substring(3, itemSel.PhantomParentId.length) + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].OrdenJerarquico = itemSel.PhantomParentId + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].Metrado = 0;\n\t\t\t\tItemN[0].Precio1 = 0;\n\t\t\t\t//}\n\t\t\t\tItemN[0].Nivel = Niv;\n\n\n\t\t\t\tdispatch(selectPARTIDAS('', '20', '1', ''));\n\t\t\t\t/*let Niv=1;\n\t\t\t\tif (itemSel)\n\t\t\t\t\tNiv=parseInt(itemSel.Nivel);\n\n\t\t\t\tItemN[0].Nivel=Niv;\n\t\t\t\tif (Niv===1)\n\t\t\t\tItemN[0].PhantomParentId=null;\n\t\t\t\telse\n\t\t\t\tItemN[0].PhantomParentId=itemSel.OrdenJerarquico;*/\n\t\t\t\tsetItemAgregar(ItemN);\n\t\t\t}\n\n\t\t\tif (e.itemData.text === 'Partida ') {\n\t\t\t\tsetShowPart(true);\n\n\t\t\t\tlet Niv = parseInt(itemSel.Nivel) + 1;\n\t\t\t\tlet Cod1 = proyects.DataPc.filter(item => item.Nivel === Niv && item.PhantomParentId === itemSel.OrdenJerarquico).length + 1;\n\t\t\t\tlet Cod1S = '0';\n\t\t\t\tif (Cod1 >= 10)\n\t\t\t\t\tCod1S = '';\n\t\t\t\t//alert(Cod1)\n\t\t\t\tItemN[0].Orden = itemSel.OrdenJerarquico.substring(3, itemSel.OrdenJerarquico.length) + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].OrdenJerarquico = itemSel.OrdenJerarquico + \".\" + Cod1S + Cod1;\n\t\t\t\tItemN[0].PhantomParentId = itemSel.OrdenJerarquico;\n\t\t\t\tItemN[0].Nivel = Niv;\n\t\t\t\tItemN[0].Metrado = 0;\n\t\t\t\tItemN[0].Precio1 = 0;\n\n\n\t\t\t\tdispatch(selectPARTIDAS('', '20', '1', ''));\n\n\t\t\t\t/*let Niv=parseInt(itemSel.Nivel)+1;\n\t\t\t\tItemN[0].PhantomParentId=itemSel.OrdenJerarquico;\n\t\t\t\tItemN[0].Nivel=Niv;*/\n\n\t\t\t\tsetItemAgregar(ItemN);\n\t\t\t}\n\n\n\n\t\t}\n\t}", "title": "" }, { "docid": "284365ec06768b7c8a0543db1499a38b", "score": "0.49835795", "text": "function selectItem() { //CLICK\n // $(\"#msg\").val('');\n // alert(\"hey\");\n selectedItem = $(this).data('idnumber');\n index = $(this).data('index');\n // console.log(selectedItem);\n $(\"#itemId\").val(index);\n}", "title": "" }, { "docid": "9e7222d39ddf5f8614634c2763165dd3", "score": "0.49782634", "text": "function selectItem(id, itemType, item, quantity) {\n const bill_item = { ...item };\n bill_item.type = itemType;\n bill_item.quantity = quantity;\n\n bill[id] = bill_item;\n\n calculateBill();\n }", "title": "" }, { "docid": "35fff461878bd19a47885af935bb8cd8", "score": "0.49757847", "text": "function buyUnitSlot(){\n playerState.unitSlots += 1;\n defEngine.addUnit();\n }", "title": "" }, { "docid": "720bc887a602265a8d388dff0928ce87", "score": "0.49745035", "text": "createSlots() {\n var me = this,\n slotOrder = me.getSlotOrder(),\n hours = [],\n minutes = [],\n slots = [],\n ln, i;\n\n for (i = 0, ln = 24; i < ln; i++) {\n hours.push({\n text: i,\n value: i\n });\n }\n\n for (i = 0, ln = 60; i < ln; i = i + 5) {\n minutes.push({\n text: Ext.String.leftPad(i, 2, '0'),\n value: i\n });\n }\n\n slotOrder.forEach(function (item) {\n slots.push(me.createSlot(item, hours, minutes));\n });\n\n me.setSlots(slots);\n }", "title": "" }, { "docid": "e0378542fc560ccb7deb3bf863c26dca", "score": "0.4973999", "text": "useItem(){\n //First, we check to see if the unit has an Item equipped\n if(player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem!=0){\n //Display message announcing that the unit has used their item\n this.displayMessage = player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].name +\n \" uses \" +\n items[player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem].name +\n \"!\";\n //this.displayMessage = player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].name + \" uses \" + items.list[player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem][1] + \"!\";\n myCombatScreen.printMessageBar(this.displayMessage);\n //Execute the items associated function\n items[player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem].function(player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]]);\n //items.list[player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem][2](player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]]);\n console.log(\"Using equipped item!\");\n //Remove the item from the unit, and update the screen\n player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].myItem = 0;\n //myCombatScreen.updateScreen(1,1,1);\n }\n else{\n //If the unit does not have an equipped item, we display a message, and nothing else\n this.displayMessage = player.myCreatures[player.myCombatCreatures[combatLogi.selectedAlly]].name + \" does not have an item equipped!\";\n myCombatScreen.printMessageBar(this.displayMessage);\n }\n combatLogi.update();\n }", "title": "" }, { "docid": "cf5a0db54289f011de7db8971b801035", "score": "0.49679217", "text": "addItem(item, coords) {\n let [x, y] = coords;\n y = this.grid.length - (y + 1);\n this.grid[y][x] = item;\n }", "title": "" } ]
3632f591ae7ff401d26ab5d336b9cd9a
This method updates the blog liked_by
[ { "docid": "a87c1987a029061647e1774b1af55bc2", "score": "0.6681231", "text": "function likeBlog(user, blogId) {\n\n\tvar searchQuery = {};\n\tvar updateQuery = {};\n\tsearchQuery = {\n\t\t$and: [{\n\t\t\tliked_by: {\n\t\t\t\t$ne: user.user_name\n\t\t\t}\n\t\t}, {\n\t\t\t\tblog_id: blogId\n\t\t\t}]\n\t};\n\tupdateQuery = {\n\t\t$push: {\n\t\t\tliked_by: user.user_name\n\t\t}\n\t};\n\n\tvar options = { new: true };\n\n\treturn new Promise(function (resolve, reject) {\n\t\tBlog.findOneAndUpdate(searchQuery, updateQuery, options, function (err, blog) {\n\t\t\tif (!err) {\n\t\t\t\tresolve(blog);\n\t\t\t} else {\n\t\t\t\treject(err)\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" } ]
[ { "docid": "89fe3b8eab7cc3ee4cc81de1c3bcc595", "score": "0.69001186", "text": "function handleLike( post_id ){\n\n const newUserLikedPosts = newUserData?.likedPosts;\n let newUser;\n \n if(newUserLikedPosts?.includes(post_id)){\n // remove the liked post from the list \n let dataIndex = newUserLikedPosts.indexOf(post_id);\n newUserLikedPosts?.splice(dataIndex, 1);\n }else{\n //add the liked post_id to the list \n newUserLikedPosts?.push(post_id);\n }\n\n // update the state\n newUser = {...currentUserData.userData};\n newUser.likedPosts = newUserLikedPosts;\n setNewUserData(newUser);\n \n firebase.firestore().collection(\"users\").doc(currentUserData.userDocId).update({\n likedPosts: newUser.likedPosts,\n });\n\n }", "title": "" }, { "docid": "9acda1d9374f87a2c86ef0d7c8923aae", "score": "0.64111644", "text": "function likePost(post) {\n\t\t\tPost.like(post.id).then(function() {\n\t\t\t\tpost.liked = true;\n\t\t\t\tpost.likes++;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "aa3a4e3eb2fab1c53f8daddc353e4d19", "score": "0.63095963", "text": "async likePost(req, res) {\n try {\n const { uuid, name } = req.userData;\n const { like, post_uuid } = req.query;\n const post = await Post.findOne({\n where:{ uuid: post_uuid}\n });\n if (!post) return sendErrorResponse(res, 404, 'post not found');\n await post.likes.push(\n {\n user_uuid: uuid,\n user_name: name,\n like,\n });\n const postUpdate = await Post.update(\n {\n \n likes: post.likes,\n },\n {\n returning: true,\n where: { uuid: post_uuid },\n },\n );\n return sendSuccessResponse(res, 200, postUpdate);\n } catch (error) {\n console.log(error);\n return sendErrorResponse(res, 500, 'An error occurred while commenting on the post');\n }\n }", "title": "" }, { "docid": "36d8d7bea350399188460782e9b94574", "score": "0.6263898", "text": "function likePost(user, postId) {\n\n var searchQuery = {};\n var updateQuery = {};\n\t\tsearchQuery = {\n $and: [{\n liked_by: {\n $ne: user.user_name\n }\n }, {\n post_id: postId\n }]\n\t\t};\n\t\tupdateQuery = {\n $push: {\n liked_by: user.user_name\n }\n\t\t};\n\n var options = { new: true };\n\n return new Promise(function (resolve, reject) {\n Post.findOneAndUpdate(searchQuery, updateQuery, options, function (err, post) {\n if (!err) {\n resolve(post);\n } else {\n reject(err)\n }\n });\n });\n}", "title": "" }, { "docid": "2d8f9586c4b333565506dad4e6900cea", "score": "0.61638725", "text": "like() {\r\n // Update the like number.\r\n this._currentMeme.likeNumber++;\r\n var likeNumber = this._currentMeme.likeNumber;\r\n this.updateLikeNumberElement(likeNumber);\r\n }", "title": "" }, { "docid": "8a0c243b3a69561a6259366925867d25", "score": "0.6157524", "text": "async function like_post(post_id, liked) {\n const response = await fetch(`like/${post_id}`, {\n method: \"PUT\",\n body: JSON.stringify ({\n liked: liked\n })\n });\n const updated_likes = await response.json();\n\n return updated_likes;\n}", "title": "" }, { "docid": "8017e020fe2fb06f519d72b533a2f8d4", "score": "0.6112701", "text": "function like(req) {\n db.data.run(`UPDATE tweets SET likes=likes + 1 WHERE rowid = ${req.tweetid}`,\n function(err) {\n if (err) {\n console.error(\"Error updating the number of likes\");\n }\n });\n}", "title": "" }, { "docid": "f412436e0e4ad3429784cbaccae51c95", "score": "0.60474473", "text": "async function likePost(commentId, isLiked) {\n try {\n let pool = await sql.connect(config);\n const addOrRemove = isLiked ? 1 : -1;\n await pool\n .request()\n .query(\n `update comments set Likes = Likes + ${addOrRemove} where Comment_Id = ${commentId}`\n );\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "f18b70a70b7be252b9271f440fe47b0f", "score": "0.60339475", "text": "like() {\n // Update the like number.\n this._currentMeme.likeNumber++;\n var likeNumber = this._currentMeme.likeNumber;\n // TODO: update the like number of the \"#meme-likes-id\" element.\n this.updateLikeNumberElement(likeNumber);\n }", "title": "" }, { "docid": "12c6d2690d9a0401e88d77952626f72e", "score": "0.6027846", "text": "async function togglePostLike(req,res,next){\n try {\n const group = await Group.findById(req.params.groupId)\n const post = group.posts.id(req.params.postId)\n if (!group || !post) {\n throw new Error('Not Found')\n }\n if (post.likes.includes(req.currentUser._id)) {\n post.likes.pull(req.currentUser)\n } else {\n post.likes.push(req.currentUser)\n }\n \n \n await group.save()\n res.status(201).json('post liked/unliked successfully')\n\n } catch (err){\n next(err)\n }\n}", "title": "" }, { "docid": "a210151564666860a49051d77e8853fb", "score": "0.60020095", "text": "setLiked() {\n if (typeof window !== `undefined` && this.tweet.id) {\n let tweets = window.localStorage.getItem('liked-tweets') || ``\n tweets += `|${this.tweet.id.toString()}|`\n window.localStorage.setItem('liked-tweets', tweets)\n }\n }", "title": "" }, { "docid": "d0a75c62046055383481b08e504aaade", "score": "0.5989481", "text": "updateLike(postId, value) {\n return this.database.ref(`likes/${postId}/${this.auth.currentUser.uid}`)\n .set(value ? firebase.database.ServerValue.TIMESTAMP : null);\n }", "title": "" }, { "docid": "1b8c96b3f6c3d79d1526f3386cac77ff", "score": "0.59606415", "text": "async likePost(_, { postId }, context) {\n const { username } = checkAuth(context);\n // find instance of post\n const post = await Post.findById(postId);\n if(post){\n // check if user already liked post \n if(post.likes.find(likes => likes.username === username)){\n //remove the like (unlike) \n post.likes = post.likes.filter((like) => like.username !== username);\n //await post.save()\n } else {\n //like the post \n post.likes.push({\n username,\n createdAt: new Date().toISOString() \n })\n }\n // save post regardless of action\n await post.save();\n return post;\n } else throw new UserInputError('Post not found');\n }", "title": "" }, { "docid": "5cba403290e2f033a0de5f309dcc7c7d", "score": "0.59240985", "text": "function addLikeToProfile(req, newLike) {\n return User.findOne({ \"userID\": req.user.id }, (error, change) => {\n for ( let i = 0; i < change.songLikes.length; i++ ) {\n if (change.songLikes[i] == newLike) {\n return;\n }\n }\n change.songLikes.push(newLike);\n change.save();\n })\n}", "title": "" }, { "docid": "7270e3148537a24dba4ceade52e9167c", "score": "0.592395", "text": "function updateLikes(e) {\n let toyDataId = e.target.dataset.id\n\n let currentToyLikes = parseInt(e.target.dataset.likes)\n\n let data = {likes: currentToyLikes + 1}\n\n e.target.parentElement.querySelector(\"p\").innerText = `${currentToyLikes + 1} Likes`\n\n e.target.dataset.likes = currentToyLikes + 1\n\n fetch(`http://localhost:3000/toys/${toyDataId}`, {\n method: 'PATCH',\n headers:\n {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(data)\n }).then(res => res.json())\n .then(data => {\n e.target.parentElement.querySelector(\"p\").innerText = `${data.likes} Likes`\n\n e.target.dataset.likes = data.likes\n })\n\n}", "title": "" }, { "docid": "c22d0533f4b407fb87d3f281913e074d", "score": "0.5920385", "text": "async createNewLikeToPost(input) {\n\n const { postid, type } = input;\n const userID = this._getAuthUserID();\n\n if (!userID) throw new Error('User not authenticated');\n\n try {\n type === 'add' ? await this.model.findOneAndUpdate(\n { _id: postid },\n {\n $addToSet: {\n userliked: userID\n }\n },\n { new: true, runValidators: true }\n )\n : await this.model.findOneAndUpdate(\n { _id: postid },\n {\n $pull: {\n userliked: userID\n }\n },\n { new: true, runValidators: true }\n )\n const postResult = await this.model.findOne({ _id: postid });\n return {\n userliked: postResult.userliked,\n postid\n }\n }\n catch (err) {\n throw new Error(err.message);\n }\n\n }", "title": "" }, { "docid": "d386ff0f892119c824a34b1fb2261bde", "score": "0.5913829", "text": "async likePost( _ , { postId } , context ){\n const { username } = checkAuth(context );\n const post = await Post.findById(postId);\n if( post ){\n if( post.likes.find( like => like.username === username ) ){\n // post already like unlike it \n post.likes = post.likes.filter( like => like.username !== username ) // return everthing that doesnot maches the current username \n \n }else{\n // not like , like the post\n post.likes.push({\n username ,\n createdAt : new Date().toISOString()\n }) \n }\n await post.save();\n return post ;\n }else{\n throw new UserInputError('Post not found')\n }\n\n }", "title": "" }, { "docid": "01041e2126f6e629d62a6c41b60e11c5", "score": "0.5873953", "text": "function updatelike(message_id){\n console.log(\"clicked on like button\"+ message_id);\n button_id=message_id;\n likes=document.getElementById(button_id).value;\n updated_LIKES= Number(likes)+1;\n console.log(updated_LIKES);\n firebase.database().ref(room_name).child(message_id).update({\n likes: updated_LIKES\n });\n}", "title": "" }, { "docid": "a68b0b9cbb845b77d552f958eff338f0", "score": "0.5845204", "text": "function updateLikes(id, likes) {\n let likeCount = document.getElementById(`post_likecount_${id}`);\n\n likeCount.innerHTML = likes;\n\n}", "title": "" }, { "docid": "06c506d51565ab3df05bd2be7e3fca0b", "score": "0.5837448", "text": "async function like() {\n await likePost(post);\n }", "title": "" }, { "docid": "55facdb7c0ac9ee6e2f188fd93a70ffc", "score": "0.58253574", "text": "like(event) {\n this.postRecrod.updateLikeCount(this.topic.like_count + 1);\n if (this.postRecrod.likeAction && this.postRecrod.likeAction.get(\"canToggle\")) {\n this.postRecrod.likeAction.togglePromise(this.postRecrod).then((result) => {\n if (result.acted) {\n this.$('.topic-custom-like').addClass('liked');\n this.$('.likes-count > .number').html(this.topic.like_count + 1);\n this.topic.set(\"like_count\", this.topic.like_count + 1);\n } else {\n this.$('.topic-custom-like.liked').removeClass('liked');\n this.$('.likes-count > .number').html(this.topic.like_count - 1);\n this.topic.set(\"like_count\", this.topic.like_count - 1);\n }\n });\n }\n }", "title": "" }, { "docid": "951c59b2e1b43479d276d2618e3c1b90", "score": "0.5811918", "text": "function addLikes(toy){\n toy.likes++;\n //const likeButton = document.querySelector(\".like-btn\")\n fetch(`http://localhost:3000/toys/${toy.id}`,{\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json'\n },\n body: JSON.stringify({\n \"likes\": toy.likes\n })\n })\n}", "title": "" }, { "docid": "094061407fc3eeb21b0dfcc5ffbd6b5d", "score": "0.58100283", "text": "async function toggleCommentLike(req,res,next){\n try {\n const group = await Group.findById(req.params.groupId)\n const post = group.posts.id(req.params.postId)\n const commentToLike = post.comments.id(req.params.commentId)\n if (!group || !post || !commentToLike) {\n throw new Error('Not Found')\n }\n if (commentToLike.likes.includes(req.currentUser._id)) {\n commentToLike.likes.pull(req.currentUser)\n } else {\n commentToLike.likes.push(req.currentUser)\n }\n await group.save()\n res.status(201).json('post liked/unliked successfully')\n\n } catch (err){\n next(err)\n }\n}", "title": "" }, { "docid": "ff02c76b8d34e893943d93689a6ceaa5", "score": "0.5801292", "text": "function likes(post_id) {\n console.log(\"Like/Unlike toggler\");\n fetch(`/post/${post_id}`,{\n method: 'PUT'\n\n });\n\n\n const div_post = document.querySelector(`#post-${post_id}`);\n const like_button_color = div_post.querySelector('#like-button').style.color;\n if (like_button_color === \"red\") {\n div_post.querySelector('#like-button').style.color = \"darkgray\";\n div_post.querySelector('#like-button').setAttribute('title', 'like');\n var count = div_post.querySelector(\"#like-counter\");\n var update_count = parseInt(count.innerHTML) - 1;\n count.innerHTML = update_count.toString();\n }\n else {\n div_post.querySelector('#like-button').style.color = \"red\";\n div_post.querySelector('#like-button').setAttribute('title', 'unlike');\n var count = div_post.querySelector(\"#like-counter\");\n var update_count = parseInt(count.innerHTML) + 1;\n count.innerHTML = update_count.toString();\n }\n\n}", "title": "" }, { "docid": "4704f7d1c0691b58c2f0249a3d7e29c8", "score": "0.57997453", "text": "updateLikeNumberElement(likeNumber) {\n // TODO: Set the number of likes by updating the text of the element with the ID\n // \"#meme-likes-id\".\n }", "title": "" }, { "docid": "e28468357a28e4211d6f8219d1cad570", "score": "0.5731397", "text": "setCandidateLike(send, userId, profileId){\n matches.like(userId, profileId);\n }", "title": "" }, { "docid": "90ca7bc399d7c5a94547cd86f6786617", "score": "0.57275146", "text": "function addListenersToLikes() {\n // Listen for clicks on like button\n $('#tweets-container').on('click', 'i.fa-heart', function () {\n let currentUser = Cookies.get('email')\n if (currentUser) {\n if ($(this).data('owner') !== currentUser){\n let counterElm = $(this).siblings(('#like-counter'))\n let counter = Number(counterElm.text())\n if ($(this).hasClass('liked')) {\n counterElm.text(counter - 1)\n } else {\n counterElm.text(counter + 1)\n }\n //\n\n\n const _id = $(this).data('_id')\n const elm = $(this)\n $.ajax({\n method: 'PUT',\n url: `/tweets/${_id}/like`,\n data: {email: Cookies.get('email')}\n }).then(function () {\n // Then, toggle the liked class\n elm.toggleClass('liked')\n })\n\n }\n }\n })\n}", "title": "" }, { "docid": "d360ce883b81b38649152f73cfaf1f9f", "score": "0.570761", "text": "function addLike(liker, statusUser, statusID, callback) {\n // Query for the status\n Status\n .query(statusUser)\n .where('id').equals(statusID)\n .exec((err, data) => {\n // Status is not found or there is an error\n if (err || !data) {\n if (err) {\n callback(null, \"There was an error looking up status: \" + err);\n } else {\n callback(null, \"Status does not exist.\");\n }\n } else {\n // Status object that is being liked\n const statusObject = data.Items[0].attrs;\n\n // Create like object\n const likeObject = {\n statusID: statusID,\n id: uuid(),\n liker: liker,\n };\n\n // Put Like object in table\n Like.create(likeObject, (errLike, dataLike) => {\n if(errLike || !dataLike) {\n callback(null, \"There was an error adding like to the table: \" + errLike.message);\n } else {\n // Old Status Object\n const oldStatus = statusObject;\n\n // Increase likesCount by 1\n oldStatus.likesCount = parseInt(oldStatus.likesCount, 10) + 1;\n\n // Update likes count of status in table\n Status.update(oldStatus, (updateErr, updateData) => {\n if(updateErr || !updateData) {\n callback(null, \"There was an error updating likes count.\");\n } else{\n callback({success: true}, null);\n }\n });\n }\n });\n }\n });\n}", "title": "" }, { "docid": "f5a56271879c195f5062e5ce364ab920", "score": "0.57008666", "text": "LikePost({ userId, postId }) {\n let post = Fetch.General.posts(postId);\n Check.Cursor(post).some();\n post = _.head(post.fetch());\n\n if (_.includes(post.get('useless'), userId))\n return 'You already useless this post';\n\n const like = post.get('like');\n _.includes(like, userId) ? _.pull(like, userId) : like.push(userId);\n post.set('like', like);\n\n Check.Astro(post).valid();\n post.save();\n return 'Useless';\n }", "title": "" }, { "docid": "9958f6fd87d1ca1c96f41a1a0b65c439", "score": "0.56949246", "text": "function onEntryLikePressed($entry) {\n likeEntry($entry);\n }", "title": "" }, { "docid": "d55608c17fdcb68333f5c79a7d69875e", "score": "0.56936187", "text": "function addLike(imgObj, likeButton) {\n\timgObj.likes++;\n\tfetch(IMAGES_URL + `/${imgObj.id}`, {\n\t\tmethod: 'PATCH',\n\t\theaders: { 'Content-Type': 'application/json' },\n\t\tbody: JSON.stringify({\n\t\t\tlikes: imgObj.likes\n\t\t})\n\t})\n\t\t.then((response) => {\n\t\t\treturn response.json();\n\t\t})\n\t\t.then((json) => {\n\t\t\tlikeButton.textContent = `Like this photo! ${json.likes} `;\n\t\t});\n}", "title": "" }, { "docid": "bc1b77e94ecae02199b282441249aced", "score": "0.568061", "text": "function updateLikeInPopup(popupLikeSelector,clickedObj){\r\n\t\r\n\tvar likesCount = clickedObj.find('#clicks').text();\r\n\tvar isLiked = clickedObj.find('a.like-counter > img').hasClass('liked');\r\n\tvar moduleId = clickedObj.find('a.like-counter').attr('data-module');\r\n\tvar entryId = clickedObj.find('a.like-counter').attr('data-entry');\r\n\t\r\n\t\r\n\tif(isLiked){\r\n\t\t$(popupLikeSelector +' a').find('img').addClass('liked').attr('src', '../images/likeHover.png?version=1.1');\r\n\t}else{\r\n\t\t$(popupLikeSelector +' a').find('img').removeClass('liked').attr('src', '../images/like.png');\r\n\t}\r\n\t\t\r\n\r\n\t$(popupLikeSelector +' a.like-counter').attr('data-module',moduleId);\r\n\t$(popupLikeSelector +' a.like-counter').attr('data-entry',entryId);\r\n\t$(popupLikeSelector +' a:last-child').text(likesCount);\r\n\t \r\n}", "title": "" }, { "docid": "3542a0c5b4e61896bcee4bec794185ac", "score": "0.56702095", "text": "async function updateLike(wineId) {\n if (!localStorage.getItem(\"userid\")) return;\n const result = await request(`users/${localStorage.getItem('userid')}/likes/wines`)\n const isLiked = result.some(r => r.id === wineId)\n likeButton.children[0].classList.toggle(\"fas\", !isLiked)\n likeButton.children[0].classList.toggle(\"far\", isLiked)\n likeButton.setAttribute('data-liked', isLiked)\n\n\n}", "title": "" }, { "docid": "50a4932e21f597e392ef594f4a286d08", "score": "0.5659578", "text": "function updateCommentLikes(commentId, number) {\n // update comment with this commentId likes on db ny number //\n let api = \"../api/Comments?commentId=\" + commentId + \"&likes=\" + number + \"&dislikes=0\";\n ajaxCall(\"PUT\", api, \"\", updateLikesSuccess, updateError);\n // POST USERLIKESCOMM //\n updateUserLikeComment(commentId, true, number > 0);\n}", "title": "" }, { "docid": "e0c9744891a9efd213e6a1f569ad82dc", "score": "0.5654312", "text": "function likeEntry($entryElement) {\n var entryId = parseInt($entryElement.attr('entry-id'));\n\n $.ajax({\n type: \"POST\",\n url: ksData.templateDirectoryUri + '/api/like_entry.php',\n data: {entry_id: entryId},\n success: function (data, textStatus, jqXHR) {\n\n if (!data || data.error) {\n return;\n }\n\n $entryElement.find('.entry-like-button-text').text('');\n $entryElement.find('.entry-like-button-count').text(data.likes.toString());\n $entryElement.find('.entry-like-button').addClass('liked');\n\n },\n dataType: 'json'\n });\n }", "title": "" }, { "docid": "e13a5fe52ff60b4a608470cc983b40d0", "score": "0.56394964", "text": "function likeCause(selected) {\n if (arca.ownerId != arca.currentUser) {\n radmenu_fadeOut();\n }\n\n $.post(arca.ajax.likeCause({causeId: selected.id}), function (result) {\n selected.data.hasUserLiked = result.hasliked;\n selected.data.likeCount = result.count;\n if (arca.ownerId != arca.currentUser) {\n radmenu_updateLikeButtons(selected);\n }\n });\n}", "title": "" }, { "docid": "d8db98457183628a2058ba9fc91e5fbc", "score": "0.5632013", "text": "function addLike(req, newLike) {\n return User.findOne({ \"userID\": req.user.id }, (error, user) => {\n for ( let i = 0; i < user.songLikes.length; i++ ) {\n if (user.songLikes[i] == newLike) {\n return;\n }\n }\n return Song.findOne({ \"audioID\": newLike }, (error, change) => {\n change.numberOfLikes = change.numberOfLikes + 1;\n change.save();\n });\n })\n}", "title": "" }, { "docid": "2f5fda43cb60881d09c1184063173fb1", "score": "0.56168765", "text": "updateLikeNumberElement(likeNumber) {\r\n $(\"#meme-likes-id\").text(likeNumber + \" Likes\");\r\n }", "title": "" }, { "docid": "48b9d34d084dd36b0499b47aaa4c5950", "score": "0.5609098", "text": "function ModifyLike(type, num) {\n let request = {id: GetPostId(props.post), \n author: props.user}\n const success = () => {\n setLike(num);\n // setNewLike(newNum); // reflect modification\n }\n ModLike(type, request, success);\n }", "title": "" }, { "docid": "4486d7e710a3b06b0c1d9b8b704048e3", "score": "0.5600789", "text": "function likePost(id) {\n console.log(\"Liking post \", id);\n $(`#like-${id}`).attr('data-state', 'liked');\n $.post(`/api/likes/${id}`);\n // make a HTTP post to the likes table\n}", "title": "" }, { "docid": "7509f929c65aa6e820e96d633fa12333", "score": "0.55771", "text": "async addLike(req, res, next) {\n\t\ttry {\n\t\t\tlet findUser = await comment.findOne({ _id: req.params.id });\n\t\t\tif (findUser.likeBy.includes(req.profile.id)) {\n\t\t\t\tconst error = new Error(\"You can't like twice\");\n\t\t\t\terror.statusCode = 400;\n\t\t\t\tthrow error;\n\t\t\t} else findUser.likeBy.push(req.profile.id);\n\t\t\tfindUser.save();\n\t\t\tres.status(200).json({\n\t\t\t\tsuccess: true,\n\t\t\t\tmessage: \"Success\",\n\t\t\t\tdata: findUser,\n\t\t\t});\n\t\t\tawait activities.create({\n\t\t\t\ttype: \"like_comment\",\n\t\t\t\tcomment_id: findUser._id,\n\t\t\t\towner: req.profile.id,\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tif (!err.statusCode) {\n\t\t\t\terr.statusCode = 500;\n\t\t\t}\n\t\t\tnext(err);\n\t\t}\n\t}", "title": "" }, { "docid": "f5af522f78726c539ee395d81097c4c6", "score": "0.5571311", "text": "function unlikeBlog(user, blogId) {\n\n\tvar searchQuery = {};\n\tvar updateQuery = {};\n\tsearchQuery = {\n\t\t$and: [{\n\t\t\tliked_by: user.user_name\n\t\t}, {\n\t\t\t\tblog_id: blogId\n\t\t\t}]\n\t};\n\tupdateQuery = {\n\t\t$pull: {\n\t\t\tliked_by: user.user_name\n\t\t}\n\t};\n\tvar options = { new: true };\n\n\treturn new Promise(function (resolve, reject) {\n\t\tBlog.findOneAndUpdate(searchQuery, updateQuery, options, function (err, blog) {\n\t\t\tif (!err) {\n\t\t\t\tresolve(blog);\n\t\t\t} else {\n\t\t\t\treject(err)\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "7b7d81b795e1c4bb6c2d24b6d8f6ad1c", "score": "0.55613744", "text": "likePost(data){\n let dataList = [];\n for(let item of this.state.pageData){\n let post = item;\n if(item.id === data.id){\n data.user_has_liked === true ? post.user_has_liked = false : post.user_has_liked = true;\n post.user_has_liked === false ? post.likes.count = post.likes.count -1 : post.likes.count = post.likes.count + 1;\n }\n dataList.push(post);\n }\n this.setState({pageData:dataList})\n }", "title": "" }, { "docid": "cf66ff32e23851ad137e2db888a58565", "score": "0.5553899", "text": "static async createLike(feedId, feedEvent, user) {\n try {\n const { login, id, avatar_url } = user;\n\n console.log(`${login} with id ${id} liked post ${feedId}`);\n\n const postDoc = await this.getPost(feedId);\n\n const newLike = {\n userName: login,\n userId: id,\n userAvatar: avatar_url,\n timestamp: new Date()\n };\n\n if (!postDoc) {\n // Create new document\n await this.create({\n id: feedId,\n githubPost: feedEvent,\n likes: [newLike]\n });\n } else {\n // Update existing document\n await this.findOneAndUpdate(\n { id: feedId },\n { $addToSet: { likes: newLike } }\n );\n }\n\n // Create notification for receiving user\n\n // User.createAndSaveNotification(feedEvent, newLike, \"like\");\n\n return true;\n } catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "51392083f3867ce06b2e27352f60f8c2", "score": "0.55413383", "text": "function updateToyLikes(url, newNum){\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify({\n \"likes\": newNum\n })\n })\n }", "title": "" }, { "docid": "c21dea1d0026571c9cd5ed3a197f76d0", "score": "0.5531912", "text": "function like_post(post_id) {\n \t$.ajax({\n\t\turl: \"/cgi-bin/postHandler.py\",\n\n\t\ttype: \"POST\",\n\n\t\tdata: \"like=true&id=\" + post_id,\n\n\t\tdataType: \"json\",\n\n\t\tsuccess: function(data) {\n\t\t\tif(data.result == 'succeed') {\n\t\t\t\told_likes = parseInt($(\"#\"+post_id).text());\n\n\t\t\t\t$(\"#\"+post_id).text(++old_likes);\n\n\t\t\t}\n\t\t\telse if(data.result != \"no change\") {\n\t\t\t\talert(\"server error\")\n\t\t\t}\n\t\t},\n\n\t\terror: function(data) {\n\t\t\talert(\"server error\");\n\t\t\tconsole.log(data);\n\t\t}\n\n\t});\n }", "title": "" }, { "docid": "b7b63802628616fa5c2b5481f01b1680", "score": "0.55030334", "text": "changelikes(email,post){\n return new Promise((resolve,reject)=>{\n try{\n Post.update({ likes:post.like}, {\n where: {\n moboremail:post.moboremail,\n postid:post.id\n }\n }).then(function(){\n resolve('success');\n })\n }catch(err){\n reject(err)\n }\n })\n }", "title": "" }, { "docid": "5d0e89afd83c98b97ffe6b39151f7700", "score": "0.5493758", "text": "function wpbooklistCommentsLikeButton() {\n\n\t\t$( document ).on( 'click', '.wpbooklist-comments-likes-thumb-img-wrapper', function( event ) {\n\n\t\t\tvar newlikes = 0;\n\t\t\tvar commentid = '';\n\t\t\tvar request = '';\n\t\t\tvar bookuid = $( this ).attr( 'data-bookuid' );\n\n\t\t\t// Dim and disable the like button, and get the attributes needed to update the DB.\n\t\t\t$(this).css({ 'opacity': '0.5', 'pointer-events': 'none' });\n\t\t\tcommentid = $( this ).attr( 'data-commentid' );\n\n\t\t\t// Increment the Like number.\n\t\t\tnewlikes = parseInt( $(this).attr( 'data-likes' ) ) + 1 ;\n\n\t\t\t// Display the new Like number.\n\t\t\t$(this).next( '.wpbooklist-comments-total-likes-p' ).text( newlikes + ' ' + wpbooklistCommentsPhpVariables.trans36 );\n\n\t\t\tvar data = {\n\t\t\t\t'action': 'wpbooklist_comments_like_action',\n\t\t\t\t'security': wpbooklistCommentsPhpVariables.adminnonce1,\n\t\t\t\t'commentid': commentid,\n\t\t\t\t'newlikes': newlikes,\n\t\t\t\t'bookuid': bookuid\n\t\t\t};\n\n\t\t\tconsole.log(data);\n\n\t\t\trequest = $.ajax({\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: data,\n\t\t\t\ttimeout: 0,\n\t\t\t\tsuccess: function( response ) {\n\t\t\t\t\tconsole.log(response);\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tconsole.log( errorThrown );\n\t\t\t\t\tconsole.log( textStatus );\n\t\t\t\t\tconsole.log( jqXHR );\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "bac164fe9ad5100c8ea70344348a402d", "score": "0.5490246", "text": "toggleLikePost() {\n\t\tlet { isLiked } = this.state.postObject;\n\t\tif (isLiked == false) {\n\t\t\tthis.like();\n\t\t} else {\n\t\t\tthis.disLike();\n\t\t}\n\t}", "title": "" }, { "docid": "cd8fcd08241b4f3de80277effc37031e", "score": "0.54728246", "text": "function likein(){\n let parantId = this.parentElement.parentElement.id;\n let findTweeData = data.find(x => x.id ===parantId);\n\n if(findTweeData &&findTweeData.likeUser.indexOf(userNameLogin) ===-1){\n findTweeData.likeUser.push(userNameLogin);\n }else if(findTweeData &&findTweeData.likeUser.indexOf(userNameLogin) !==-1){\n findTweeData.likeUser.splice(findTweeData.likeUser.findIndex(x => x===userNameLogin),1)\n }\n createTweets(data);\n}", "title": "" }, { "docid": "da21d87ad0ab66a690a6a47d67ff7662", "score": "0.54669195", "text": "addLikes(cardId) {\n return fetch(this._baseUrl + \"/cards/likes/\" + cardId, {\n method: \"PUT\",\n headers: this._headers,\n }).then(responseHandler);\n }", "title": "" }, { "docid": "a6a84c81a865e0919b5da7e45b983715", "score": "0.54594666", "text": "set likeNumber(likeNumber) {\r\n this._likeNumber = likeNumber;\r\n }", "title": "" }, { "docid": "69d608c05277b2b642245656777c484e", "score": "0.54522127", "text": "function updateLikeFromPopup(popupDtlLikeSelector){\r\n\t\r\n\tvar detailModuleName=$(popupDtlLikeSelector +' a.like-counter').attr('data-module');\r\n\tvar detailEntryId=$(popupDtlLikeSelector +' a.like-counter').attr('data-entry');\r\n\tvar isDetailLiked = $(popupDtlLikeSelector +' a.like-counter > img').hasClass('liked');\t\r\n\tvar detailLikesCount = $(popupDtlLikeSelector).find('#clicks').text();\r\n\t\r\n\tvar mainLikeSelector = \"#\"+detailModuleName + \"-\" + detailEntryId;\r\n\t\r\n\t\r\n\tif( detailModuleName && detailEntryId && detailLikesCount) {\r\n\t\t\r\n\t\t$(mainLikeSelector +' a:last-child').text(detailLikesCount);\r\n\t\t\r\n\t\tif(isDetailLiked){\r\n\t\t\t$(mainLikeSelector +' a').find('img').addClass('liked').attr('src', '../images/likeHover.png?version=1.1');\r\n\t\t}else{\r\n\t\t\t$(mainLikeSelector +' a').find('img').removeClass('liked').attr('src', '../images/like.png');\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "6439e950d97d7102f1f2996d7adc6523", "score": "0.54500246", "text": "like(name) {\r\n this.getUsername(); \r\n return db.collection(\"likes\").doc(name+\"-\"+User).set({ name:name, user:User });\r\n }", "title": "" }, { "docid": "b59f6ec42f4b3abd09fcf89fa272778e", "score": "0.5447671", "text": "function likeMe() {\n let $counter = $(this).siblings('span');\n let count = parseInt($counter.text());\n count++;\n $counter.text(count);\n $.ajax(`http://localhost:3000/characters/${$(this).attr('name')}`, {method: 'PUT', dataType: 'JSON'});\n}", "title": "" }, { "docid": "7df68486434a1c03a1ed357dd0b80bd4", "score": "0.5445744", "text": "function liked(id){\n fetch(`/liked/${id}`,{method:\"GET\"})\n .then(response => response.json())\n .then(result => {\n if(result.message ===\"notliked\"){\n const liked_count = parseInt(document.querySelector(`.post_likes_count_${id}`).innerText);\n document.querySelector(`.svg_icon_${id} svg`).setAttribute('fill','red');\n document.querySelector(`.post_likes_count_${id}`).innerText = liked_count+1;\n fetch(`/liked/${id}`,{method:\"PUT\"})\n }\n else{\n const liked_count = parseInt(document.querySelector(`.post_likes_count_${id}`).innerText);\n document.querySelector(`.svg_icon_${id} svg`).setAttribute('fill','black');\n document.querySelector(`.post_likes_count_${id}`).innerText = liked_count-1;\n fetch(`/liked/${id}`,{method:\"PUT\"})\n }\n })\n}", "title": "" }, { "docid": "79aeecd594105f73169ad171ba36a2d1", "score": "0.54457206", "text": "set likeNumber(likeNumber) {\n this._likeNumber = likeNumber;\n }", "title": "" }, { "docid": "87b9979fa83d5b29fec4e90dac92f2a0", "score": "0.54426104", "text": "function unLikePost(user, postId) {\n\n var searchQuery = {};\n var updateQuery = {};\n\t\tsearchQuery = {\n $and: [{\n liked_by: user.user_name\n }, {\n post_id: postId\n }]\n\t\t};\n\t\tupdateQuery = {\n $pull: {\n liked_by: user.user_name\n }\n\t\t};\n var options = { new: true };\n\n return new Promise(function (resolve, reject) {\n Post.findOneAndUpdate(searchQuery, updateQuery, options, function (err, post) {\n if (!err) {\n resolve(post);\n } else {\n reject(err)\n }\n });\n });\n}", "title": "" }, { "docid": "162aae19ae8079e86743f1c9a704c1c8", "score": "0.54390174", "text": "function updatesLikes(likes, id){\n return fetch(\"http://localhost:3000/toys/\" + id, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n likes: ++likes\n })\n }).then(res => {return res.json()})\n .catch(err => {\n displayError(err)\n })\n // .then(_ => window.location.reload())\n}", "title": "" }, { "docid": "ce111c23541bca17b6cbf64eeb1aa2af", "score": "0.54357344", "text": "function like(id, uid, cantLikes, mensaje, nombre){\n\t \n\tfirebase.database().ref('muro/' + id).set({\n\t\tmensaje: mensaje,\n\t\tuid: uid,\n\t\tusuario: nombre,\n\t\tlikes: cantLikes+1,\n\t\tcomentario: '',\n\t}).catch(error => {\n\t\tconsole.log(error)\n\t});\n\t \n\t totalLikes+=1\n\tfirebase.database().ref('muro/tot_likes').set({\n\t\tlikes: totalLikes\n\t}).catch(error => {\n\t\tconsole.log(error)\n\t});\n }", "title": "" }, { "docid": "43ecc5d53a3aea9ef18039954e6c4844", "score": "0.5426872", "text": "function like() {\n\tvar index = Math.floor(Math.random() * hashtagList.length);\n\tvar ranHash = hashtagList[index];\n\tvar postSearch = {q: ranHash, count: 2, result_type: \"mixed\"};\n\n\t// Finds a tweet to like:\n\tT.get('search/tweets', postSearch, function (error, data) {\n\t\t// log out any errors and responses\n\t\tconsole.log(error, data);\n \t // Likes the post if the search (or the actual liking) doesn't have an error\n\t\t// likeId is the id of the like and commented post\n\t\tif (!error) {\n\t\t\tvar likeId = data.statuses[0].id_str;\n\t\t\tT.post('favorites/create', {id: likeId}, function(error, response) {\n\t\t\t\tconsole.log(response);\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(\"something wrong here :(\")\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"all good...check the bot, it liked something!\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar handle = data.statuses[0].user.screen_name;\n\t\t\tvar ranMess = exclamations[Math.floor(Math.random() * exclamations.length)];\n\t\t\tvar replyMessage = \"@\" + handle + \" \" + ranMess;\n\n\t\t\t// Here is where the function adds a comment\n\t\t\tT.post('statuses/update', {in_reply_to_status_id: likeId, status: replyMessage}, function (error, response) {\n\t\t\t\tconsole.log(response);\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(\"something wrong here :(\")\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Success! The bot just added a comment!\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tvar check = Math.floor(Math.random() * 10);\n\t\t\tif (check < 5) {\n\t\t\t\tvar interact = interact_comments[Math.floor(Math.random() * interact_comments.length)];\n\t\t\t\tT.post('statuses/update', {in_reply_to_status_id: likeId, status: interact}, function (error, response) {\n\t\t\t\t\tconsole.log(response);\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\tconsole.log(\"something wrong here :(\")\n\t\t\t\t\t\tconsole.log(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Success! The bot just added a comment!\");\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"There was an error with the hashtag search: \");\n\t\t\tconsole.log(error);\n\t\t}\n });\n}", "title": "" }, { "docid": "f55223130a2f8e6170542607640fd9d2", "score": "0.5425171", "text": "function like(liked, modalActivo, urlIma) {\n console.log('liked');\n imagea.liked = liked;\n imagea.likes += liked ? 1 : -1;\n\n if (!modalActivo) {\n //Caso cuando son los likes de la pagina del usuario\n var newEl = render(user);\n yoyo.update(template, newEl);\n } else {\n //Caso donde son los likes del modal de la imagen\n //Cambio la clase del div para ponerlo en liked o disliked segun corresponda\n document.getElementById(`likes-${urlIma}`).classList.toggle('liked'); //Hago el nuevo span para actualizar el numero de likes\n\n var numLikes = yoyo`<span id=\"numLikes-${urlIma}\" class=\"likes\"> ${translate.message('likes', {\n likes: imagea.likes\n })}</span>`; //Pido el span viejo\n\n var viejo = document.getElementById(`numLikes-${urlIma}`); //Le digo a yoyo que cambie el span viejo por el span nuevo\n\n yoyo.update(viejo, numLikes);\n }\n\n return false;\n } //Div para toda la imagen y texto", "title": "" }, { "docid": "278a4f0be655fbf0d4588d30e8e33e28", "score": "0.5422981", "text": "function likAktivitet() {\n setFillState(!fillState);\n\n fetch(`http://localhost:8000/whoLiked/${task.activity_id}/`, {\n method: \"PUT\",\n headers: {\n Authorization: `Token ${cookieToken[\"mytoken\"]}`,\n },\n })\n .then((result) => {\n if (!result.ok) throw result;\n updateTasks(cookieToken[\"mytoken\"]);\n return result.json();\n })\n .catch((error) => {\n console.log(error);\n });\n\n if (task.who_liked.split(\",\").includes(user.username)) {\n task.who_liked = \"\";\n userLikeState = true;\n } else {\n task.who_liked = user.username;\n userLikeState = false;\n }\n\n history.replace({ pathname: location.pathname, state: { task: task } });\n }", "title": "" }, { "docid": "4d4115d1a4f98d2a7b1f0d0735f0cf2c", "score": "0.5419063", "text": "function likeFunction(e){\n \n let likedComments;\n\n /* check if localstorage.likedcomments exists */\n if(localStorage.likedComments){\n /* if it does, parse it store it in the likedComments variable */\n likedComments = JSON.parse(localStorage.likedComments)\n /* if the ID of the comment being liked is already in the likedComments array, return */\n if(likedComments.find(id => id === e.target.dataset.commentId)) {\n return\n }\n } else {\n /* if localStorage.likedComments is undefined, set likedComments to an empty array */\n likedComments = []\n localStorage.likedComments = JSON.stringify([])\n }\n\n if(e.target.classList.contains('comments__like-icon')){\n likedComments.push(e.target.dataset.commentId)\n localStorage.likedComments = JSON.stringify(likedComments)\n \n let likes = parseInt(e.target.parentNode.parentNode.dataset.likes)\n likes += 1\n e.target.parentNode.parentNode.dataset.likes = likes\n let likesSpan = e.target.parentNode.previousSibling\n likesSpan.innerText = `${likes} likes` \n\n axios.put(`${_URL}comments/${e.target.dataset.commentId}/like?api_key=${API_KEY}`)\n } \n}", "title": "" }, { "docid": "924777d8a5514734086d8d2f5a47eaaf", "score": "0.5412239", "text": "changeLiked() {\n this.state.liked = !this.state.liked;\n }", "title": "" }, { "docid": "5f2868e01a046084f3c3f40fca4eb87e", "score": "0.5392101", "text": "function updateToyLikes(toyId, likesNumber){\n const data = {likes: likesNumber}\n return fetch(\n `http://localhost:3000/toys/${toyId}`,\n {\n method: \"PATCH\",\n headers: \n {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(data)\n })\n}", "title": "" }, { "docid": "3f955702347528d3d2194b8adc2327e1", "score": "0.53886706", "text": "async updateLike (req, res) {\n if (!this.validateDateTimeStamp(req.params.dateId)) return res.status(400).send('Invalid payload');\n try {\n const result = await this.messageService.updateLike(req.params.dateId);\n console.log(`${this.logger} - Updated like count`, result);\n return res.status(200).send('Updated');\n } catch (err) { \n console.log(`${this.logger} Internal Server error: ${JSON.stringify(err)}`.error);\n return res.sendStatus(500);\n }\n }", "title": "" }, { "docid": "8f7b4d4ade6040dd64ab17a77995b6d7", "score": "0.5353332", "text": "function postLike(event) {\n event.preventDefault();\n\n var like = $('.pet').data('uuid'),\n data = JSON.stringify(like);\n $.post(FIREBASE_URL + '/users/' + fb.getAuth().uid + '/data/likes.json', data, function () {\n });\n}", "title": "" }, { "docid": "5c28954435ae59e5062e6b618d94d2ad", "score": "0.53486174", "text": "function like() {\n request({ method: 'POST', body: { target_id }, path: '/api/like' })\n .then(data => {\n if (data.status === 'ok') {\n getRandomUser()\n toastr[\"success\"]('User successfully was liked!')\n } else {\n }\n })\n }", "title": "" }, { "docid": "1c025e96ada3c0f8a974943330efbf53", "score": "0.5343074", "text": "function postRatingUpdate(user, location, contents) {\n // If we were implementing this for real on an actual server, we would check\n // that the user ID is correct & matches the authenticated user. But since\n // we're mocking it, we can be less strict.\n\n // Get the current UNIX time.\n var time = new Date().getTime();\n // The new status update. The database will assign the ID for us.\n var newStatusUpdate = {\n \"likeCounter\": [],\n \"type\": \"statusUpdate\",\n \"contents\": {\n \"author\": user,\n \"postDate\": time,\n \"location\": location,\n \"contents\": contents,\n \"likeCounter\": []\n },\n // List of comments on the post\n \"comments\": []\n };\n\n // Add the status update to the database.\n // Returns the status update w/ an ID assigned.\n newStatusUpdate = addDocument('feedItems', newStatusUpdate);\n // Add the status update reference to the front of the current user's feed.\n var userData = readDocument('users', user);\n var feedData = readDocument('feeds', userData.feed);\n feedData.contents.unshift(newStatusUpdate._id);\n // Update the feed object.\n writeDocument('feeds', feedData);\n // Return the newly-posted object.\n return newStatusUpdate;\n}", "title": "" }, { "docid": "2e5ac67425fa33738e2781d72bbb986d", "score": "0.53387576", "text": "function likeChangeHandler(){\n var newLikeC=likeC+1;\n setlikeC(newLikeC);\n }", "title": "" }, { "docid": "6e40aaf387d3c34cb95eddadfb84ea19", "score": "0.53236514", "text": "function like(req, res, value, type, mId, cId) {\n if (type === \"topic\") {\n //increases or decreases topic rating score depending on value\n Messages.findOneAndUpdate({ messageId: mId }, { $inc: { rating: value } })\n .then(() => {\n res.redirect(\"back\");\n })\n .catch((err) => {\n console.log(err);\n });\n } else if (type === \"comment\") {\n Messages.findOneAndUpdate(\n { messageId: mId, \"comments.id\": cId },\n { $inc: { \"comments.$.rating\": value } }\n )\n .then((obj) => {\n res.redirect(\"back\");\n })\n .catch((err) => {\n console.log(err);\n });\n }\n}", "title": "" }, { "docid": "ba1f70b2cefbd90555ceae344dd130c9", "score": "0.5310999", "text": "function likePost(entryID) {\n if (WAITING_FOR_AJAX) {\n return;\n }\n WAITING_FOR_AJAX = true;\n var $likeButton = $('#' + entryID + ' .like-button');\n $.post({\n url : '/likepost/' + String(entryID),\n success: function() {\n var $likeCount = $('#' + entryID + ' .like-count');\n // toggle to unlike\n $likeButton.text('👍 Unlike');\n\n // change onclick to unlike function\n oldFunc = $likeButton.attr('onclick');\n newFunc = oldFunc.replace('like', 'unlike');\n $likeButton.attr('onclick', newFunc);\n\n // increment like-count\n var likeCount = parseInt($likeCount.text());\n $likeCount.text(likeCount + 1);\n WAITING_FOR_AJAX = false;\n },\n error: function() {\n alert(\"Not allowed to like!\");\n WAITING_FOR_AJAX = false;\n }\n });\n}", "title": "" }, { "docid": "240a4e2c5cb2bd63d930a51bb5fdbf69", "score": "0.5293494", "text": "function postLikeHandler(){\n // event.preventDefault();\n //let hash = splitHash(window.location.hash);\n let id = this.dataset.id\n //console.log(id)\n Model.addLike(Number(id))\n}", "title": "" }, { "docid": "109eb2b34ea5d085d6a5544b58dfc141", "score": "0.5273216", "text": "function updateBlogViews(blogId, userName) {\n\tvar searchQuery = {\n\t\t$and: [{\n\t\t\tviewed_by: {\n\t\t\t\t$ne: userName\n\t\t\t}\n\t\t}, {\n\t\t\t\tblog_id: blogId\n\t\t\t}]\n\t};\n\tvar updateQuery = {\n\t\t$push: {\n\t\t\tviewed_by: userName\n\t\t}\n\t};\n\tvar options = { new: true };\n\n\treturn new Promise(function (resolve, reject) {\n\t\tBlog.findOneAndUpdate(searchQuery, updateQuery, options, function (err, blog) {\n\t\t\tif (!err) {\n\t\t\t\tresolve(blog);\n\t\t\t} else {\n\t\t\t\treject(err)\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "e779d2721de7f93414eb3b79f3f2028b", "score": "0.5272066", "text": "_isImageLiked(){\n if(this._likes.some(like => like._id === this._userId)){\n this._likeButton.classList.add(\"card__heart-icon_active\");\n } else {\n this._likeButton.classList.remove(\"card__heart-icon_active\");\n }\n }", "title": "" }, { "docid": "86ffd92839c96876b6247e6c5f8d1f4e", "score": "0.52667296", "text": "function addLike(obj){\r\n const likeObj = {\r\n method: 'PATCH',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json'\r\n },\r\n body: JSON.stringify({\r\n 'name': obj.name,\r\n 'image': obj.image,\r\n 'likes': obj.likes ++\r\n })\r\n }\r\n\r\n return fetch(`http://localhost:3000/toys/${obj.id}`, likeObj)\r\n .then(function(response){\r\n return response.json()\r\n })\r\n .then(function(json){\r\n console.log(json)\r\n })\r\n .catch(function(error){\r\n console.log(error.message);\r\n });\r\n}", "title": "" }, { "docid": "401aad7880913648bb15f9c823e2a5ea", "score": "0.52536607", "text": "function handleUpVote() {\n if (!user) {\n history.push('/login');\n } else {\n // Get reference for item to change\n const voteRef = firebase.database.collection('links').doc(link.id);\n console.log('Reference to item to change', voteRef)\n\n // Before update must get the item\n voteRef.get()\n .then( doc => {\n // First Check if doc exists\n if (doc.exists) {\n // Get Previous Votes\n const previousVotes = doc.data().votes;\n console.log(previousVotes, 'Prev Votes');\n\n // Create new vote object\n const newVote = { votedBy: { id: user.uid, user: user.displayName } };\n\n // Add new vote\n const updatedVotesArray = [ ...previousVotes, newVote ];\n\n // Update firebase with new vote. Must specify via object whta property to update\n voteRef.update({ votes: updatedVotesArray })\n } \n })\n .catch( error => console.error('Error updating votes: ',error) );\n }\n }", "title": "" }, { "docid": "aec39f5d21be03d58caa15771f28dc61", "score": "0.5252837", "text": "function like() {\n $(this).siblings('.fas.fa-heart').removeClass('d-none');\n $(this).addClass('d-none');\n let num = $(this).siblings('span').text();\n $(this).siblings('span').text(+num + 1);\n\n applyChange(this, '+');\n}", "title": "" }, { "docid": "f6e0e95382ffad67f80d3dba4e9e2301", "score": "0.5249474", "text": "async follow(postId, userId) {\n let postInfo = await this.getPostById(postId);\n const postCollection = await posts();\n\n const updateInfo = await postCollection.updateOne(\n { _id: ObjectId(postId) },\n { $addToSet: { followers: userId } }\n );\n if (!updateInfo.matchedCount && !updateInfo.modifiedCount) {\n throw \"Update failed\";\n }\n await users.addFollowToUser(userId, postId);\n return await this.getPostById(postId);\n }", "title": "" }, { "docid": "550376d12c9175cdac05da650bfdecae", "score": "0.5231724", "text": "function likeUser (event) {\n event.preventDefault();\n //use event.target to get the uid, grab the data attribute\n //hides the like button\n $(event.target).toggle();\n //shows the unlike button\n $(event.target).siblings('.unlikeUser').toggle();\n\n //save the likes array to firebase\n saveLikes(likedSimpleLogin(event))\n\n showMatch(event, likedSimpleLogin(event));\n}//end likeUser", "title": "" }, { "docid": "c04cbfeb29daaef6341baaf481be5129", "score": "0.5228665", "text": "function toggleLike(button, data, isResponse) {\n\tvar type = isResponse ? 1 : 0;\n\tbutton = $(button);\n\tvar likeText = button.find(\".like-text\");\n\tvar numLikes = button.find(\".num-likes\");\n\t\n\tif (data.liked) {\n\t\tpost(\"discussion.php\", {unlike: type, id: data.id}, function () {\n\t\t\tdata.likes--;\n\t\t\tdata.liked = 0;\n\t\t\tbutton.removeClass(\"liked\");\n\t\t\tlikeText.text(\"like\");\n\t\t\tnumLikes.text(data.likes);\n\t\t}, function () {\n\t\t\tnavigator.nofication.alert(\"You must be online to unlike this post.\", null, \"Post\");\n\t\t});\n\t} else {\n\t\tpost(\"discussion.php\", {like: type, id: data.id}, function () {\n\t\t\tdata.likes++;\n\t\t\tdata.liked = 1;\n\t\t\tbutton.addClass(\"liked\");\n\t\t\tlikeText.text(\"unlike\");\n\t\t\tnumLikes.text(data.likes);\n\t\t}, function () {\n\t\t\tnavigator.nofication.alert(\"You must be online to like this post.\", null, \"Post\");\n\t\t});\n\t}\n}", "title": "" }, { "docid": "081696527de09af167d90663eca7c416", "score": "0.5217984", "text": "function updatelikes(){\n likecount = likecount+1;\n\n if (likecount ==1)\n likebtntagline= 'person likes this!';\n else\n likebtntagline= 'persons like this!';\n\n document.getElementById('like-btn').innerHTML = '<i class=\\\"fa fa-thumbs-up\\\" aria-hidden=\\\"true\\\"></i>'+ 'Liked' +' </button>';\n\n document.getElementById('like-btn-tag-line').innerHTML = likecount+\" \"+likebtntagline;\n}", "title": "" }, { "docid": "4496f237215a9be7cd56aa2f1748191e", "score": "0.5216443", "text": "handleLike(id)\n\t{\n\t\tthis.props.p.like=this.props.p.like+1;\n\t\tthis.setState({prez: id});\n\t}", "title": "" }, { "docid": "16cbe9a4d24e4455fbd08460965e7c0e", "score": "0.52157515", "text": "function incrementLikes(id, newLikes)\n{\n return fetch(`${TOYS_URL}/${id}`, {\n method: 'PATCH',\n headers:\n {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body:\n JSON.stringify(newLikes)\n })\n}", "title": "" }, { "docid": "317a582d361957aa37ed7422224db42a", "score": "0.5214423", "text": "function addLike(e){\n e.preventDefault();\n axios\n .put(`https://project-1-api.herokuapp.com/comments/${e.target.name}/like?api_key=2e1a6531-4e3e-416c-b29c-a2de3c13c26a`)\n \n .then( (result) => {\n e.target.parentElement.innerHTML = `\n <button type=\"submit\" class=\"comment__like-btn\" name=\"${result.data.id}\">♥\n </button> ${result.data.likes} likes`;\n e.target.disabled = true;})\n \n .catch((error) => {\n console.error(error);\n })\n}", "title": "" }, { "docid": "862deb2ab6a93cce7852d9047ca844c3", "score": "0.52043205", "text": "handleLike() {\n return new Promise(() => {\n document.getElementById(this.state.messageID).disabled = false\n setTimeout(() => {\n if (this.state.likedByUser === false) {\n document.getElementById(this.state.messageID).disabled = true\n return (this.client.postLike(this.state.messageID)\n .then(response => {\n this.setState((state, props) => ({\n likedByUser: true,\n likes: state.likes + 1,\n userLike: response.data.like.id\n })\n )\n }))\n }\n // If there is a like, DELETE the like\n else {\n document.getElementById(this.state.messageID).disabled = true\n return this.client.deleteLike(this.state.userLike)\n .then(this.setState((state) => ({ likedByUser: false, likes: state.likes - 1 })))\n }\n }, 2000)\n })\n }", "title": "" }, { "docid": "931cbf46c27e97a8458a396958f65b37", "score": "0.52014214", "text": "showLikes(data) {\n const icon = data.user_liked\n ? '<i class=\"fas fa-thumbs-up fa-lg mr-1\"></i><i class=\"far fa-thumbs-up fa-lg mr-1\" style=\"display: none;\"></i>'\n : '<i class=\"far fa-thumbs-up fa-lg mr-1\"></i><i class=\"fas fa-thumbs-up fa-lg mr-1\" style=\"display: none;\"></i>';\n $('#likes-zone').html(`<span>${icon}</span>`);\n $('#likes-zone').next().text(data.likes);\n // if user is not editor allow liking/un-liking.\n if (!data.editor) {\n // if not editor add data-mission_id to likes-zone with user id.\n $('#likes-zone').data('mission_id', data.id);\n $('#likes-zone').addClass('like-mission');\n $('#likes-zone').addClass('hover-primary-alt2');\n } else {\n $('#likes-zone').removeClass('like-mission');\n $('#likes-zone').removeClass('hover-primary-alt2');\n }\n }", "title": "" }, { "docid": "6e4e54880fc42772e6551153691feea6", "score": "0.519216", "text": "function likeUpdate(){\n var j=document.getElementById('likeButton');\n if(numberOfLikes==0){\n numberOfLikes++;\n j.innerHTML='Liked!';\n document.getElementById('like-active').innerHTML=\"1 person likes this!\";\n }\n else if(numberOfLikes>0){\n numberOfLikes++;\n j.innerHTML='Liked!';\n document.getElementById('like-active').innerHTML= numberOfLikes+\" people have liked this!\";\n }\n}", "title": "" }, { "docid": "8988f9a1e35712c6959066d06353e18a", "score": "0.51861894", "text": "function likePost(postid) {\n\n // Get the specific like count\n likeNumberDiv = document.querySelector(`.likeNumber[data-postid='${postid}']`);\n likeNumber = parseInt(likeNumberDiv.innerHTML);\n\n // Send request to update like number\n const request = new Request(\n `/likePost/${postid}`,\n {headers: {'X-CSRFToken': csrftoken}}\n );\n\n fetch(request, {\n method: 'POST',\n mode: 'same-origin'\n })\n .then(response => response.json().then(data => ({status: response.status, body: data})))\n .then(result => {\n console.log(result.status)\n // Print message\n if (result.status === 201) {\n console.log(result.body.message)\n if (result.body.message === 'liked') {\n // Add +1 to like count\n likeNumber++;\n\n // Update value\n likeNumberDiv.innerHTML = likeNumber;\n }\n else {\n // Add +1 to like count\n likeNumber--;\n\n // Update value\n likeNumberDiv.innerHTML = likeNumber;\n }\n \n }\n else {\n console.log('Sorry, you can only like a post once.');\n }\n });\n}", "title": "" }, { "docid": "1de3220bf20a94c9fda3aa356546fd90", "score": "0.5183405", "text": "function toggleLikes(in_tweet) {\n if (LoginState().isLoggedIn() === false) {\n displayLoginModal();\n return;\n }\n Likes(in_tweet).toggle();\n const likeCount = in_tweet.hearts + Likes(in_tweet).get();\n if (likeCount) {\n document.getElementById(`${in_tweet.id}-likes`).innerText = likeCount;\n } else {\n document.getElementById(`${in_tweet.id}-likes`).innerText = \"\";\n }\n}", "title": "" }, { "docid": "0635e6bfad4ace9ea9380b978a4e0526", "score": "0.5172823", "text": "changeLikeCardStatus(cardId, isLiked) {\n return fetch(`${this._baseUrl}/cards/likes/${cardId}`, {\n headers: this._headers,\n method: isLiked ? \"DELETE\" : \"PUT\",\n })\n .then((res) =>\n res.ok ? res.json() : Promise.reject(`Error: ${res.status}`)\n )\n .catch((err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "d7246ca4daa3edbd91c22a4501c303c1", "score": "0.5166575", "text": "function like_add(post_id) {\n\t$.post( $(\"#like_\"+post_id).attr(\"ajax\"), {post_id:post_id}, function(data) {\n\t\tlike_get(post_id);\n\t}).done(function() {\n\t\tchangeText(post_id);\n\t});\n}", "title": "" }, { "docid": "165377d9444b3ccf4763552055ea34be", "score": "0.5165034", "text": "hasLiked() {\n const userID = Meteor.userId();\n if (_.indexOf(this.props.issue.likedBy, userID) >= 0) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "29272a0a9c00726e3ad0f5b111ca69a8", "score": "0.51640975", "text": "function like(post_id)\n{\n var target_url = '/post/' + post_id + '/like/';\n var xhr = new XMLHttpRequest();\n xhr.open('get', target_url);\n\n xhr.onreadystatechange = function()\n {\n if(xhr.readyState === 4)\n {\n if(xhr.status === 200)\n {\n var like_button_css_path = '#like_button_' + post_id;\n var target_element = $(like_button_css_path);\n var t = \"unlike(\" + post_id + \")\";\n target_element.attr(\"onclick\", t);\n target_element.html('<i class=\"thumbs outline down icon\"></i>Unlike');\n\n var like_count_css_path = '#like_count_' + post_id;\n var count1 = parseInt($(like_count_css_path).text());\n $(like_count_css_path).text(String(count1 + 1));\n }\n }\n };\n xhr.send(null);\n}", "title": "" }, { "docid": "3acf677a1b7d002df7980e45c829bdb4", "score": "0.51632106", "text": "function radmenu_updateLikeButtons(selectedNode) {\n if (arca.currentUser != 'null') {\n // hide like buttons if user is not logged in\n $('#radmenu-event-likeCause').hide();\n // dislike\n $('#radmenu-event-dislikeCause').hide();\n } else if (!selectedNode.data.hasUserLiked) {\n // show like button if user has not liked\n $('#radmenu-event-likeCause').show();\n // hide dislike button if user has not liked\n $('#radmenu-event-dislikeCause').hide();\n } else if (selectedNode.data.hasUserLiked && arca.currentUser != arca.ownerId) {\n // hide like button if user has liked and is not the owner of the rca case\n $('#radmenu-event-likeCause').hide();\n // show dislike button if user has liked\n $('#radmenu-event-dislikeCause').show();\n } else {\n // show like button if user has liked and is the owner\n // show dislike button if user has liked and is the owner\n $('#radmenu-event-likeCause, #radmenu-event-dislikeCause').show();\n }\n}", "title": "" }, { "docid": "9e1d6c1bf1af681abae365c2a730e64d", "score": "0.5128015", "text": "handleClick() {\n // Increment the likes property stored in state\n this.setState(prevState => ({\n likes: prevState.likes + 1\n }));\n }", "title": "" }, { "docid": "dbc22b9a509bcefae5c32924ff10ab7d", "score": "0.5122644", "text": "function increaseLikes(event) {\n\n let like = event.target.children[0].innerText\n let counter = parseInt(like)\n // counter += 1\n ++counter\n event.target.children[0].innerText = counter\n addLike(event, counter)\n}", "title": "" }, { "docid": "5f77d9afe68f62fe257ce3e19988f878", "score": "0.51184106", "text": "function updateAuthorName(author){\n var displayName;\n if(author.creator_name){\n displayName = author.creator_name;\n }\n else{\n displayName = author.creator_id;\n }\n \n jQuery(\"span#authorName\").html(displayName);\n jQuery(\"b#authorName\").html(displayName);\n }", "title": "" }, { "docid": "211d4ab3e1c0bb3c763823dcc8652674", "score": "0.5116619", "text": "async function like() {\n let users = await vk.api.users.get({ user_ids: usersToLike.split(',')[counter] });\n counter++;\n if (counter === usersToLike.split(',').length) counter = 0;\n for (let p = 0; p < groups.length; p++) {\n let { items } = await vk.api.wall.get({ count: 10, owner_id: groups[p] });\n let posts = items;\n for(let j = 0; j < posts.length; j++) {\n // if (j <= 2){\n // await vk.api.likes.add({ type: 'post', owner_id: groups[p], item_id: posts[j].id });\n // }\n \n let coms = await vk.api.wall.getComments({ owner_id: groups[p], post_id: posts[j].id });\n for(let k = 0; k < coms.items.length; k++) {\n if (coms.items[k].from_id === users[0].id) {\n await vk.api.likes.add({ type: 'comment', owner_id: groups[p], item_id: coms.items[k].id });\n console.log(`Лайкнут комментарий с текстом <${coms.items[k].text}> от <${users[0].first_name} ${users[0].last_name}>`);\n break;\n }\n }\n }\n }\n}", "title": "" } ]
2a54fa0b02adcab772d795966bd29489
25.4.1.8 UpdatePromiseFromPotentialThenable ( x, promiseCapability )
[ { "docid": "635054de13e5bff2fbf3f2eed02be2c3", "score": "0.87530917", "text": "function UpdatePromiseFromPotentialThenable ( x, promiseCapability ) {\n var then, rejectResult, thenCallResult;\n if ( Type(x) !== 'object' ) {\n return 'not a thenable';\n }\n try {\n then = x.then;\n } catch ( e ) {\n rejectResult = promiseCapability['[[Reject]]'].call(undefined, e);\n return null;\n }\n if ( !IsCallable(then) ) {\n return 'not a thenable';\n }\n try {\n thenCallResult = then.call(x, promiseCapability['[[Resolve]]'],\n promiseCapability['[[Reject]]']\n );\n } catch ( e ) {\n rejectResult = promiseCapability['[[Reject]]'].call(undefined, e);\n return null;\n }\n return null;\n }", "title": "" } ]
[ { "docid": "bac508da321cf3e734e1c216d53437a3", "score": "0.6300664", "text": "_setThenable(promise) {\n this._promise = promise;\n }", "title": "" }, { "docid": "d467e68ee281f88df98070a8a813c55a", "score": "0.6218035", "text": "function resolve(promise, x) {\n if (promise === x) {\n promise.reject(new TypeError(\"A promise cannot be resolved with itself.\"))\n return\n }\n\n if (isThenable(x)) {\n try {\n x.then(\n function(value) {\n resolve(promise, value)\n },\n function(reason) {\n promise.reject(reason)\n }\n )\n } catch (e) {\n promise.reject(e)\n }\n } else {\n promise.resolve(x)\n }\n}", "title": "" }, { "docid": "196cab91afa9bba2f3c122292334805a", "score": "0.6202315", "text": "function settlePromise(promise, state, result) {\n var promiseSlots = slots(promise);\n if (promiseSlots.state !== PENDING_STATE) {\n throw new Error('Settling a ' + promiseSlots.state + ' promise');\n }\n\n var reactions;\n if (state === FULFILLED_STATE) {\n reactions = promiseSlots.fulfillReactions;\n } else if (state === REJECTED_STATE) {\n reactions = promiseSlots.rejectReactions;\n }\n\n promiseSlots.result = result;\n promiseSlots.fulfillReactions = undefined;\n promiseSlots.rejectReactions = undefined;\n promiseSlots.state = state;\n\n var count = reactions.length;\n count && setImmediate(function() {\n for (var i = 0; i < count; ++i) {\n reactions[i](promiseSlots.result);\n }\n });\n }", "title": "" }, { "docid": "175a09124b7cc9aba1e48b85010397c1", "score": "0.60638", "text": "function PromiseReactionTask ( reaction, argument ) {\n var promiseCapability = reaction['[[Capabilities]]'],\n handler = reaction['[[Handler]]'],\n handlerResult, selfResolutionError, updateResult;\n try {\n handlerResult = handler.call(undefined, argument);\n } catch ( e ) {\n return promiseCapability['[[Reject]]'].call(undefined, e);\n }\n if ( SameValue(handlerResult, promiseCapability['[[Promise]]']) ) {\n selfResolutionError = TypeError();\n return promiseCapability['[[Reject]]']\n .call(undefined, selfResolutionError);\n }\n updateResult = UpdatePromiseFromPotentialThenable(handlerResult,\n promiseCapability\n );\n if ( updateResult === 'not a thenable' ) {\n return promiseCapability['[[Resolve]]'].call(undefined, handlerResult);\n }\n return undefined;\n }", "title": "" }, { "docid": "ac5e1601ba218c117931bd2de9b4d2cb", "score": "0.58363104", "text": "function IfAbruptRejectPromise(value, capability) {\n var rejectResult = capability['[[Reject]]'].call(undefined, value);\n return capability['[[Promise]]'];\n }", "title": "" }, { "docid": "18229aa914765c61e9993875886896b2", "score": "0.5732884", "text": "function resolveX(promise, x) {\n\t// 2.3.1\n\tif(x === promise) {\n\t\tpromise.reject(new Error('TypeError'));\n\t}\n\tif(x instanceof Promise) { // 2.3.2\n\t\treturn resolvePromise(promise, x);\n\t}else if(isThenable(x)) { // 2.3.3\n\t\treturn resolveThen(promise, x);\n\t}else { // 2.3.4\n\t\treturn promise.resolve(x);\n\t}\n}", "title": "" }, { "docid": "eca65bf80de875b2c8455087a0c86da0", "score": "0.57133293", "text": "async onCapabilityLocked( value, opts ) {\n this.log('onCapabilityLocked', value);\n if(value) return;\n await this.getDriver().sendSignal(this);\n this._debounceLocked();\n }", "title": "" }, { "docid": "7a00038c1d5f2c6678500d7134487438", "score": "0.5689511", "text": "function PromiseResolveThenableJob(promiseToResolve, thenable, then) {\n // SPEC BUG: promise vs. promiseToResolve\n var resolvingFunctions = CreateResolvingFunctions(promiseToResolve);\n try {\n var thenCallResult = then.call(thenable, resolvingFunctions['[[Resolve]]'],\n resolvingFunctions['[[Reject]]']);\n } catch (thenCallResult) {\n var status = resolvingFunctions['[[Reject]]'].call(undefined, thenCallResult);\n NextJob(status); return;\n }\n NextJob(thenCallResult);\n }", "title": "" }, { "docid": "3d146caf93f762f34bcbe1b48f844c38", "score": "0.5676259", "text": "function objectiveProgress(objectiveObject,playerId){\n\nif(objectiveObject == \"empty\"){return null}\n\nif(objectiveObject.activeEffect !== true && objectiveObject.effect !== undefined){\n \n var effectPuppetId = model.objectiveEffectFunctions[objectiveObject.effect](objectiveObject.location,objectiveObject.effectDuration);\n objectiveObject.activeEffect = true;\n objectiveObject.effectPuppetId = effectPuppetId;\n}\n\nvar returnPromise = new Promise(function(resolve,reject){resolve(model.objectiveCheckFunctions[objectiveObject.type](objectiveObject,playerId));})\n\nreturnPromise.then(function(result){//TODO replace the 0 with playerId\n //console.log(\"result of progress = \"+result)\n if(objectiveObject.maxTime< model.scenarioModel.RealTimeSinceLanding && model.scenarioModel.RealTimeSinceLanding !== -200000 && objectiveObject.maxTime !== undefined){result = true}\n if(result == null){return}\n if(result === true){//move from active objectives into finished, update ui, activate success triggers\n if(objectiveObject.effectPuppetId !== undefined){\n \n objectiveObject.effectPuppetId.then(function(result){api.puppet.killPuppet(result)})\n }\n \n objectiveModel.finishedObjectives.push(objectiveObject)\n\n \n objectiveModel.activeObjectives = removeByAttr(objectiveModel.activeObjectives,\"id\",objectiveObject.id)\n \n for(var j = 0;j<objectiveObject.successTriggers.length;j++){\n \n model.activateTrigger(objectiveObject.successTriggers[j]);\n\n }\n for(var j = 0;j<objectiveObject.successObjectives.length;j++){\n \n \n console.log(\"making objective active: \"+objectiveObject.successObjectives[j])\n model.makeObjectiveActiveByName(objectiveObject.successObjectives[j])\n \n \n\n }\n\n }\n else if(result === false){//move from active to finished, update ui, activate failure triggers. \n \n objectiveModel.finishedObjectives.push(objectiveObject)\n objectiveModel.activeObjectives = objectiveModel.activeObjectives.filter(function(item) {\n return item !== value\n })\n\n }\n else{//other result should be an update to progress, so update ui\n\n if(objectiveObject.timesCalled !== undefined){\n \n objectiveObject.timesCalled += 1;\n\n }\n if(objectiveObject.progress !== undefined){objectiveObject.progress = result;}\n }\n \n \n }).catch(function(err){console.log(err)})\n\n \n}", "title": "" }, { "docid": "ee85d1317a16983a199ad419366f10ec", "score": "0.5655367", "text": "function FulfillPromise(promise, value) {\n console.assert(promise['[[PromiseState]]'] === 'pending');\n var reactions = promise['[[PromiseFulfillReactions]]'];\n set_internal(promise, '[[PromiseResult]]', value);\n set_internal(promise, '[[PromiseFulfillReactions]]', undefined);\n set_internal(promise, '[[PromiseRejectReactions]]', undefined);\n set_internal(promise, '[[PromiseState]]', 'fulfilled');\n return TriggerPromiseReactions(reactions, value);\n }", "title": "" }, { "docid": "438d165a9d4bbadb7489f39028d815dd", "score": "0.5605652", "text": "function NewPromiseCapability(c) {\n // To keep Promise hermetic, this doesn't look much like the spec.\n return CreatePromiseCapabilityRecord(undefined, c);\n }", "title": "" }, { "docid": "be2629da1edd7a4112f3ad1bae00fdf2", "score": "0.5604242", "text": "function ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise) {\n try {\n // This relies on the brand-check that is enforced by Promise.prototype.then(). As with the rest of the reference\n // implementation, it doesn't attempt to do the right thing if someone has modified the global environment.\n Promise.prototype.then.call(promise, undefined, () => {});\n } catch (e) {\n // The brand check failed, therefore the internal slot is not present and there's nothing further to do.\n }\n}", "title": "" }, { "docid": "94ee98ea2f9388fd52cc2f9981f7651c", "score": "0.55877304", "text": "function ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise) {\n try {\n // This relies on the brand-check that is enforced by Promise.prototype.then(). As with the rest of the reference\n // implementation, it doesn't attempt to do the right thing if someone has modified the global environment.\n Promise.prototype.then.call(promise, undefined, function () {});\n } catch (e) {\n // The brand check failed, therefore the internal slot is not present and there's nothing further to do.\n }\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1bc078bd49235530b4583329caaad8be", "score": "0.55473816", "text": "function coerce(promise) {\n var deferred = defer();\n nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "c80ebd0ca03f31391d57b40c5624d913", "score": "0.55410206", "text": "function IfAbruptRejectPromise ( value, capability ) {\n try {\n capability['[[Reject]]'].call(undefined, [value]);\n } catch ( e ) {\n return e;\n }\n return capability;\n }", "title": "" }, { "docid": "7b1d11b688b9312f4302a0b6726bf637", "score": "0.5538677", "text": "function silencePromise(promise) {\n return promise.then(() => { }, () => { });\n}", "title": "" }, { "docid": "cc6444f494c4e71f54a58098a5fbfe6e", "score": "0.548055", "text": "static #proxyPromise(promise) {\n if (promise instanceof PPromise) {\n return promise;\n } else {\n return new PPromise(promise, solid, []);\n }\n }", "title": "" }, { "docid": "8bd300b0ac2c7d67ef52b8dd71d841e9", "score": "0.5401415", "text": "function _resolveWithWhistle() {\n\t\t\twaitOnSfx(\"timeout-whistle\").then(resolve);\n\t\t}", "title": "" }, { "docid": "9c2f9555a4d2c5639899668ec7bb9fa9", "score": "0.5387204", "text": "_watchPromise(propName, promise) {\n const asyncProp = this.asyncProps[propName];\n asyncProp.pendingLoadCount++;\n const loadCount = asyncProp.pendingLoadCount;\n promise\n .then(data => {\n data = this._postProcessValue(propName, data);\n this._setAsyncPropValue(propName, data, loadCount);\n\n const onDataLoad = this.layer && this.layer.props.onDataLoad;\n if (propName === 'data' && onDataLoad) {\n onDataLoad(data, {propName, layer: this.layer});\n }\n })\n .catch(error => _utils_log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error(error)());\n }", "title": "" }, { "docid": "7f23bc35eff4001e6ce4d529ca00f544", "score": "0.53392816", "text": "function PromiseReactionJob(reaction, argument) {\n var promiseCapability = reaction['[[Capabilities]]'];\n var handler = reaction['[[Handler]]'];\n var handlerResult, status;\n try {\n if (handler === 'Identity') handlerResult = argument;\n else if (handler === 'Thrower') throw argument;\n else handlerResult = handler.call(undefined, argument);\n } catch (handlerResult) {\n status = promiseCapability['[[Reject]]'].call(undefined, handlerResult);\n NextJob(status); return;\n }\n status = promiseCapability['[[Resolve]]'].call(undefined, handlerResult);\n NextJob(status);\n }", "title": "" }, { "docid": "b2ab1a22ecb981c6ec85896f7c0f4418", "score": "0.5336589", "text": "function coerce(promise){var deferred=defer();Q.nextTick(function(){try{promise.then(deferred.resolve,deferred.reject,deferred.notify);}catch(exception){deferred.reject(exception);}});return deferred.promise;}", "title": "" }, { "docid": "a9162ad35ab6db3c7095eface79882dc", "score": "0.532444", "text": "function coerce(promise) {\n\t var deferred = defer();\n\t Q.nextTick(function () {\n\t try {\n\t promise.then(deferred.resolve, deferred.reject, deferred.notify);\n\t } catch (exception) {\n\t deferred.reject(exception);\n\t }\n\t });\n\t return deferred.promise;\n\t}", "title": "" }, { "docid": "a9162ad35ab6db3c7095eface79882dc", "score": "0.532444", "text": "function coerce(promise) {\n\t var deferred = defer();\n\t Q.nextTick(function () {\n\t try {\n\t promise.then(deferred.resolve, deferred.reject, deferred.notify);\n\t } catch (exception) {\n\t deferred.reject(exception);\n\t }\n\t });\n\t return deferred.promise;\n\t}", "title": "" }, { "docid": "a9162ad35ab6db3c7095eface79882dc", "score": "0.532444", "text": "function coerce(promise) {\n\t var deferred = defer();\n\t Q.nextTick(function () {\n\t try {\n\t promise.then(deferred.resolve, deferred.reject, deferred.notify);\n\t } catch (exception) {\n\t deferred.reject(exception);\n\t }\n\t });\n\t return deferred.promise;\n\t}", "title": "" }, { "docid": "a9162ad35ab6db3c7095eface79882dc", "score": "0.532444", "text": "function coerce(promise) {\n\t var deferred = defer();\n\t Q.nextTick(function () {\n\t try {\n\t promise.then(deferred.resolve, deferred.reject, deferred.notify);\n\t } catch (exception) {\n\t deferred.reject(exception);\n\t }\n\t });\n\t return deferred.promise;\n\t}", "title": "" }, { "docid": "a9162ad35ab6db3c7095eface79882dc", "score": "0.532444", "text": "function coerce(promise) {\n\t var deferred = defer();\n\t Q.nextTick(function () {\n\t try {\n\t promise.then(deferred.resolve, deferred.reject, deferred.notify);\n\t } catch (exception) {\n\t deferred.reject(exception);\n\t }\n\t });\n\t return deferred.promise;\n\t}", "title": "" }, { "docid": "7081abba9d63ede9c930c76251f40475", "score": "0.5291216", "text": "function executePromiseTask(promise, fn) {\n // Promise Resolution Procedure:\n // https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n try {\n fn(function (value) {\n if (promise._state !== null)\n return; // Already settled\n if (value === promise)\n throw new TypeError('A promise cannot be resolved with itself.');\n var shouldExecuteTick = promise._lib && beginMicroTickScope();\n if (value && typeof value.then === 'function') {\n executePromiseTask(promise, function (resolve, reject) {\n value instanceof Promise ?\n value._then(resolve, reject) :\n value.then(resolve, reject);\n });\n }\n else {\n promise._state = true;\n promise._value = value;\n propagateAllListeners(promise);\n }\n if (shouldExecuteTick)\n endMicroTickScope();\n }, handleRejection.bind(null, promise)); // If Function.bind is not supported. Exception is handled in catch below\n }\n catch (ex) {\n handleRejection(promise, ex);\n }\n}", "title": "" }, { "docid": "17da77265f23284abef12194de1c5d3a", "score": "0.5283373", "text": "function wrapPendingPromise(store, promise, state, depValues, executionId) {\n return promise.then(value => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$2;\n }\n const loadable = loadableWithValue$1(value);\n maybeFreezeValue(value);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n return {\n __value: value,\n __key: key\n };\n }).catch(errorOrPromise => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$2;\n }\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n if (Recoil_isPromise(errorOrPromise)) {\n return wrapPendingDependencyPromise(store, errorOrPromise, state, depValues, executionId);\n }\n const loadable = loadableWithError$1(errorOrPromise);\n maybeFreezeValue(errorOrPromise);\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw errorOrPromise;\n });\n }", "title": "" }, { "docid": "5d24a569fe0c15f0f2df693334ba9069", "score": "0.5275852", "text": "static resolve(value){return Thenable.resolve(value);}", "title": "" }, { "docid": "8274c3c990bb1061e8f0506c7b34b565", "score": "0.5272068", "text": "function _promiseDecorator(promise) {\n if (startingUp)\n promise = timeout(requestTimeoutBeforeReady, promise);\n return promise;\n }", "title": "" }, { "docid": "0535a15c4f66ba001e16ed31b12872dd", "score": "0.5268924", "text": "function coerce(promise) {\r\n var deferred = defer();\r\n Q.nextTick(function () {\r\n try {\r\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\r\n } catch (exception) {\r\n deferred.reject(exception);\r\n }\r\n });\r\n return deferred.promise;\r\n}", "title": "" }, { "docid": "0535a15c4f66ba001e16ed31b12872dd", "score": "0.5268924", "text": "function coerce(promise) {\r\n var deferred = defer();\r\n Q.nextTick(function () {\r\n try {\r\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\r\n } catch (exception) {\r\n deferred.reject(exception);\r\n }\r\n });\r\n return deferred.promise;\r\n}", "title": "" }, { "docid": "9b6ae5d7a7fa6b16d6eac1cce4458d50", "score": "0.5260527", "text": "function performPledgeThen(pledge, onFulfilled, onRejected, resultCapability) {\n assertIsPledge(pledge);\n\n if (!isCallable(onFulfilled)) {\n onFulfilled = undefined;\n }\n\n if (!isCallable(onRejected)) {\n onRejected = undefined;\n }\n\n const fulfillReaction = new PledgeReaction(resultCapability, \"fulfill\", onFulfilled);\n const rejectReaction = new PledgeReaction(resultCapability, \"reject\", onRejected);\n\n switch (pledge[PledgeSymbol.state]) {\n\n case \"pending\":\n pledge[PledgeSymbol.fulfillReactions].push(fulfillReaction);\n pledge[PledgeSymbol.rejectReactions].push(rejectReaction);\n break;\n\n case \"fulfilled\": \n {\n const value = pledge[PledgeSymbol.result];\n const fulfillJob = new PledgeReactionJob(fulfillReaction, value);\n hostEnqueuePledgeJob(fulfillJob);\n }\n break;\n\n case \"rejected\":\n {\n const reason = pledge[PledgeSymbol.result];\n if (pledge[PledgeSymbol.isHandled] === false) {\n hostPledgeRejectionTracker(pledge, \"handle\");\n }\n\n const rejectJob = new PledgeReactionJob(rejectReaction, reason);\n hostEnqueuePledgeJob(rejectJob);\n }\n break;\n\n default:\n throw new TypeError(`Invalid pledge state: ${pledge[PledgeSymbol.state]}.`);\n }\n\n pledge[PledgeSymbol.isHandled] = true;\n\n return resultCapability ? resultCapability.pledge : undefined;\n}", "title": "" }, { "docid": "8b8a7180010378ebe8f692c56458a4db", "score": "0.52515197", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "35fcd3ca69ae7a24587de0898cc42bbc", "score": "0.52053875", "text": "function coerce(promise) {\n var deferred = defer();\n Q.nextTick(function () {\n try {\n promise.then(deferred.resolve, deferred.reject, deferred.notify);\n } catch (exception) {\n deferred.reject(exception);\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "7f3a2aaf3304549f32114dbd929935c7", "score": "0.51768833", "text": "function PromiseAllResolveElementFunction() {\n var F = function(x) {\n var alreadyCalled = F['[[AlreadyCalled]]'];\n if (alreadyCalled.value) return undefined;\n alreadyCalled.value = true;\n var index = F['[[Index]]'];\n var values = F['[[Values]]'];\n var promiseCapability = F['[[Capabilities]]'];\n var remainingElementsCount = F['[[RemainingElements]]'];\n try {\n values[index] = x;\n } catch (result) {\n promiseCapability['[[Reject]]'].call(undefined, result);\n return promiseCapability['[[Promise]]'];\n }\n remainingElementsCount.value -= 1;\n if (remainingElementsCount.value === 0)\n return promiseCapability['[[Resolve]]'].call(undefined, values);\n return undefined;\n };\n return F;\n }", "title": "" }, { "docid": "e5379f0ae10fb102dc3e56a7e8a0a4d6", "score": "0.51335996", "text": "function Promise() {}", "title": "" }, { "docid": "e5379f0ae10fb102dc3e56a7e8a0a4d6", "score": "0.51335996", "text": "function Promise() {}", "title": "" }, { "docid": "e5379f0ae10fb102dc3e56a7e8a0a4d6", "score": "0.51335996", "text": "function Promise() {}", "title": "" }, { "docid": "3cd7840cbc86a98c0c36880a2b0502cd", "score": "0.51227236", "text": "intercept(promise, then, ctch) {\n let result = promise\n if (then) {\n result = result.then(result => this.then(_ => then(result)))\n }\n if (ctch) {\n result = result.catch(error => this.then(_ => ctch(error)).then(e => this.reject(e)))\n }\n return result\n }", "title": "" }, { "docid": "c28edb54fe2c5198c4bb079763de38c6", "score": "0.51199543", "text": "function makeAsync (promise) {\n\n\t// capture the original then() from the promise's front-end API\n\tvar prevThen = (promise.promise || promise.safe || promise).then;\n\n\t// this function will wrap a function in a 0msec setTimeout\n\t// and run a preparation function when it is invoked\n\tfunction makeAsync (func, prep) {\n\t\treturn function () {\n\t\t\tprep && prep();\n\t\t\tvar args = arguments;\n\t\t\tsetTimeout(function () {\n\t\t\t\tfunc.apply(promise, args);\n\t\t\t}, 0);\n\t\t};\n\t}\n\n\t// this is the preparation function\n\t// it makes our ref to the original then() async\n\tfunction finalize () {\n\t\tprevThen = makeAsync(prevThen);\n\t}\n\n\t// wrap all of our methods\n\n\t// Note: resolve() and reject() will get overwritten once the promise is\n\t// completed, but that's ok since we no longer need them to be async.\n\tpromise.resolve = makeAsync(promise.resolve, finalize);\n\tpromise.reject = makeAsync(promise.reject, finalize);\n\tpromise.progress && (promise.progress = makeAsync(promise.progress));\n\n\t// initially, then() will just call the original then()\n\tpromise.then = function () { prevThen.apply(this, arguments); };\n\n\treturn promise;\n\n}", "title": "" }, { "docid": "9a68610390e12cb9862b5ce255f131a1", "score": "0.5119872", "text": "function myPromise() {\n return new Promise((resolve, reject) => {\n try {\n setTimeout(() => {\n resolve('My new promise')\n }, 4000)\n } catch {\n reject('O NO')\n }\n })\n}", "title": "" }, { "docid": "a8ffce675638893a100de46bd74f355a", "score": "0.51022446", "text": "function promise(v) { return (v instanceof Promise) ? v : new Promise(v); }", "title": "" }, { "docid": "8cb2e4f45ad620ae85b1c1624495e6f5", "score": "0.50755453", "text": "function executePromiseTask(promise, fn) {\n // Promise Resolution Procedure:\n // https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n try {\n fn(function (value) {\n if (promise._state !== null) return;\n if (value === promise) throw new TypeError('A promise cannot be resolved with itself.');\n var shouldExecuteTick = promise._lib && beginMicroTickScope();\n if (value && typeof value.then === 'function') {\n executePromiseTask(promise, function (resolve, reject) {\n value instanceof Promise ? value._then(resolve, reject) : value.then(resolve, reject);\n });\n } else {\n promise._state = true;\n promise._value = value;\n propagateAllListeners(promise);\n }\n if (shouldExecuteTick) endMicroTickScope();\n }, handleRejection.bind(null, promise)); // If Function.bind is not supported. Exception is handled in catch below\n } catch (ex) {\n handleRejection(promise, ex);\n }\n}", "title": "" }, { "docid": "ec54c39a118fde34a044ddc673a33886", "score": "0.5074607", "text": "function PromiseAllResolveElementFunction () {\n return function F ( x ) {\n var index = F['[[Index]]'],\n values = F['[[Values]]'],\n promiseCapability = F['[[Capabilities]]'],\n remainingElementsCount = F['[[RemainingElements]]'];\n try {\n values[index] = x;\n } catch ( e ) {\n return IfAbruptRejectPromise(e, promiseCapability);\n }\n remainingElementsCount['[[value]]']--;\n if ( remainingElementsCount['[[value]]'] === 0 ) {\n promiseCapability['[[Resolve]]'].call(undefined, values);\n }\n return undefined;\n };\n }", "title": "" }, { "docid": "67c74ed3db4ae75e63cf581da51263de", "score": "0.50617856", "text": "function initTranspolePromise(context) {\n 'use strict';\n\n var Transpole = context.Transpole,\n\n PENDING = 0,\n FULFILLED = 1,\n REJECTED = 2;\n\n /**\n * Check if a value is a Promise and, if it is,\n * return the `then` method of that promise.\n *\n * @param {Promise|Any} value\n * @return {Function|Null}\n */\n function getThen(value) {\n var t = typeof value;\n\n if (value && (t === 'object' || t === 'function')) {\n var then = value.then;\n\n if (typeof then === 'function') {\n return then;\n }\n }\n\n return null;\n }\n\n /**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n *\n * @param {Function} fn A resolver function that may not be trusted\n * @param {Function} onFulfilled\n * @param {Function} onRejected\n */\n function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n\n try {\n fn(function (value) {\n if (done) {\n return;\n }\n\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) {\n return;\n }\n\n done = true;\n onRejected(reason);\n });\n } catch (e) {\n if (done) {\n return;\n }\n\n done = true;\n onRejected(e);\n }\n }\n\n /**\n * @constructor\n * @param {Function} fn [description]\n */\n function Promise(fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n\n if (typeof fn !== 'function') {\n throw new TypeError('fn must be a function');\n }\n\n var state = PENDING, // store state which can be PENDING, FULFILLED or REJECTED\n\n value = null, // store value once FULFILLED or REJECTED\n\n handlers = []; // store sucess & failure handlers\n\n function fulfill(result) {\n state = FULFILLED;\n value = result;\n\n handlers.forEach(handle);\n handlers = [];\n }\n\n function reject(error) {\n state = REJECTED;\n value = error;\n\n handlers.forEach(handle);\n handlers = [];\n }\n\n function resolve(result) {\n try {\n var then = getThen(result);\n\n if (then) {\n doResolve(then.bind(result), resolve, reject);\n\n return;\n }\n\n fulfill(result);\n } catch (e) {\n reject(e);\n }\n }\n\n function handle(handler) {\n if (state === PENDING) {\n handlers.push(handler);\n } else {\n if (state === FULFILLED && typeof handler.onFulfilled === 'function') {\n handler.onFulfilled(value);\n }\n\n if (state === REJECTED && typeof handler.onRejected === 'function') {\n handler.onRejected(value);\n }\n }\n }\n\n /**\n *\n * @param {Function} onFulfilled [description]\n * @param {Function} onRejected [description]\n */\n this.done = function (onFulfilled, onRejected) {\n // ensure we are always asynchronous\n setTimeout(function () {\n handle({\n onFulfilled: onFulfilled,\n onRejected: onRejected\n });\n }, 0);\n };\n\n /**\n *\n * @param {Function} onFulfilled [description]\n * @param {Function} onRejected [description]\n * @return {Promise} [description]\n */\n this.then = function (onFulfilled, onRejected) {\n var self = this;\n\n return new Promise(function (resolve, reject) {\n return self.done(function (result) {\n if (typeof onFulfilled === 'function') {\n try {\n return resolve(onFulfilled(result));\n } catch (e) {\n return reject(e);\n }\n } else {\n return resolve(result);\n }\n }, function (error) {\n if (typeof onRejected === 'function') {\n try {\n return resolve(onRejected(error));\n } catch (e) {\n return reject(e);\n }\n } else {\n return reject(error);\n }\n });\n });\n };\n\n\n doResolve(fn, resolve, reject);\n }\n\n Transpole.Promise = Promise;\n}", "title": "" }, { "docid": "c48628d483223e1cb673b47d184aa935", "score": "0.50595444", "text": "delayPromise(promise, cacheHitInformation) {\n const start = new Date();\n\n const handleEndedPromise = (action, responseOrError) => {\n const end = new Date();\n\n const timeToWait = this.options.delay - (end - start);\n const isFromCache = cacheHitInformation.hit;\n\n if (timeToWait > 0 && !isFromCache) {\n setTimeout(() => action(responseOrError), timeToWait);\n } else {\n action(responseOrError); // immediate resolve\n }\n };\n\n return new Promise((resolve, reject) => {\n promise\n .then((response, query, test) => {\n handleEndedPromise(resolve, response);\n })\n .catch((error, query) => {\n handleEndedPromise(reject, error);\n });\n });\n }", "title": "" }, { "docid": "6c39b9f1ec5194ff8fbc08e0b0009dc1", "score": "0.5052111", "text": "function promisify(original) {\n return function promiseWrap() {\n const args = Array.prototype.slice.call(arguments);\n return new Promise((resolve, reject) => {\n original.apply(this, args.concat((err, value) => {\n if (err) return reject(err);\n resolve(value);\n }));\n });\n };\n}", "title": "" }, { "docid": "145ed7591f8c9fe46778b99f57b391e8", "score": "0.50488263", "text": "whenOptedIn() {\n const deferred = defer();\n deferredsAwaitingResolution.push(deferred);\n processDeferreds();\n return deferred.promise;\n }", "title": "" }, { "docid": "6fa07fa0f990783b7c51195fa34fd2e3", "score": "0.5036085", "text": "function syncPromise(promise) {\n let isDone = false;\n let res, err;\n promise.then(value => {\n res = value;\n isDone = true;\n }, error => {\n err = error;\n isDone = true;\n });\n\n _deasync.default.loopWhile(() => !isDone);\n\n if (err) {\n throw err;\n } // $FlowFixMe this is valid since we wait using deasync above\n\n\n return res;\n}", "title": "" }, { "docid": "9bc758c692c6ae42e8d9af6825348481", "score": "0.5031922", "text": "function wrapPromise(promise) {\n let status = 'pending';\n let result;\n const suspender = promise.then(\n (r) => {\n status = 'success';\n result = r;\n },\n (e) => {\n status = 'error';\n result = e;\n },\n );\n return {\n read() {\n if (status === 'pending') {\n throw suspender;\n } else if (status === 'error') {\n throw result;\n } else if (status === 'success') {\n return result;\n }\n },\n };\n}", "title": "" }, { "docid": "4b19e4f59d08adb34c0a742f2689f9d2", "score": "0.5019965", "text": "function isThenable ( obj ) {return obj && obj.then && typeof obj.then === \"function\";}", "title": "" }, { "docid": "f67cd6b87c1d6905d2fd11dbf97ee102", "score": "0.50104743", "text": "function promiseTask() {\n return Promise.resolve('the value is ignored');\n}", "title": "" }, { "docid": "41314055166b05408619091939866437", "score": "0.50087774", "text": "then(onFulfilled, onRejected) {\n let newValue;\n let newRejectionReason;\n\n try {\n if (this.value === this || this.rejectionReason === this) {\n throw new TypeError(\"Thenable cannot resolve to itself.\");\n }\n\n if (this.rejectionReason) {\n if (typeof onRejected === \"function\") {\n if (typeUtils.isInstanceOf(this.rejectionReason, Promise)) {\n return this.rejectionReason.then(undefined, onRejected);\n }\n\n newValue = onRejected(this.rejectionReason);\n } else {\n newRejectionReason = this.rejectionReason;\n }\n } else if (typeof onFulfilled === \"function\") {\n if (typeUtils.isInstanceOf(this.value, Promise)) {\n return this.value.then(onFulfilled);\n }\n\n newValue = onFulfilled(this.value);\n }\n } catch (e) {\n newRejectionReason = e;\n }\n\n newValue = newValue || this.value;\n return Thenable._resolveOrReject(newValue, newRejectionReason);\n }", "title": "" }, { "docid": "5cc47b25cde2dc7b71b258529d38a837", "score": "0.50055856", "text": "updateStatus(update)\n {\n return new Promise((resolved, rejected) => {\n // -- if things status (local) is requested\n if (this.local)\n {\n let payload = JSON.stringify(update);\n var request = http.request(({\n host: config.thing.host,\n port: config.thing.port,\n path: config.thing.path,\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': payload.length\n }\n }), responce => {\n \n var data = '';\n responce.on('data', b => {\n data += b;\n });\n responce.on('end', () => {\n if (responce.statusCode === 200)\n resolved(JSON.parse(data));\n else {\n console.log(data);\n rejected(responce.statusCode);\n }\n });\n responce.on('error', err => {\n console.log(err);\n rejected(err);\n });\n });\n request.write(payload);\n request.end();\n }\n // -- if shadow status is requested\n else\n {\n let updateRequest = {\n payload: JSON.stringify({\n state: {\n desired: update\n }\n }),\n thingName: config.shadow.thingName\n };\n\n // console.log(params);\n\n this.iotData.updateThingShadow(updateRequest, (err, data) => {\n if (err)\n rejected(err)\n else\n {\n var o = JSON.parse(data.payload);\n // console.log(data);\n this.getStatus().then(status => { resolved(status); });\n // resolved(o.state.reported);\n } \n });\n };\n });\n }", "title": "" }, { "docid": "768ed521987014900934cd28be6d462e", "score": "0.4997911", "text": "function goodProm(maybePromise) {\n return Promise.resolve(maybePromise)\n}", "title": "" }, { "docid": "a0739c10eb5fbbf20b353388f7662b97", "score": "0.4983236", "text": "function checkPending() {\n remaining--;\n if (!remaining) {\n promise.resolve.call(context, resolutions);\n }\n }", "title": "" }, { "docid": "8468a29e780b6f3ae7ddc135a035c877", "score": "0.4966238", "text": "function firstLockBox() {\n return new Promise(function(resolve, reject) {\n if(true) {\n resolve(12345);\n } else {\n reject(Error('Unexpected Error'));\n }\n })\n}", "title": "" }, { "docid": "7e2c87733e567c7107ebeffefd60a575", "score": "0.49650297", "text": "function signal() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n promise.resolve = resolve;\n promise.reject = reject;\n return promise;\n}", "title": "" }, { "docid": "69417da1d8fb2257cdeea6b586e9de72", "score": "0.49617624", "text": "function wrapPendingDependencyPromise(store, promise, state, existingDeps, executionId) {\n return promise.then(resolvedDep => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$2;\n }\n if (resolvedDep instanceof Canceled$1) {\n Recoil_recoverableViolation('Selector was released while it had dependencies');\n return CANCELED$2;\n }\n const {__key: resolvedDepKey, __value: depValue} = resolvedDep !== null && resolvedDep !== void 0 ? resolvedDep : {};\n /**\n * We need to bypass the selector dep cache if the resolved dep was a\n * user-thrown promise because the selector dep cache will contain the\n * stale values of dependencies, causing an infinite evaluation loop.\n */\n let bypassSelectorDepCacheOnReevaluation = true;\n if (resolvedDepKey != null) {\n /**\n * Note for async atoms, this means we are changing the atom's value\n * in the store for the given version. This should be alright because\n * the version of state is now stale and a new version will have\n * already been triggered by the atom being resolved (see this logic\n * in Recoil_atom.js)\n */\n state.atomValues.set(resolvedDepKey, loadableWithValue$1(depValue));\n /**\n * We've added the resolved dependency to the selector dep cache, so\n * there's no need to bypass the cache\n */\n bypassSelectorDepCacheOnReevaluation = false;\n }\n const [loadable, depValues] = evaluateSelectorGetter(store, state, executionId, bypassSelectorDepCacheOnReevaluation);\n if (isLatestExecution(store, executionId)) {\n updateExecutionInfoDepValues(depValues, store, executionId);\n }\n maybeFreezeLoadableContents(loadable);\n if (loadable.state !== 'loading') {\n setCache(state, depValuesToDepRoute(depValues), loadable);\n setDepsInStore(store, state, new Set(depValues.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n }\n if (loadable.state === 'hasError') {\n throw loadable.contents;\n }\n if (loadable.state === 'hasValue') {\n return {\n __value: loadable.contents,\n __key: key\n };\n }\n /**\n * Returning promise here without wrapping as the wrapepr logic was\n * already done when we called evaluateSelectorGetter() to get this\n * loadable\n */\n return loadable.contents;\n }).catch(error => {\n if (!selectorIsLive()) {\n // The selector was released since the request began; ignore the response.\n clearExecutionInfo(store, executionId);\n return CANCELED$2;\n }\n const loadable = loadableWithError$1(error);\n maybeFreezeValue(error);\n setCache(state, depValuesToDepRoute(existingDeps), loadableWithError$1(error));\n setDepsInStore(store, state, new Set(existingDeps.keys()), executionId);\n setLoadableInStoreToNotifyDeps(store, loadable, executionId);\n throw error;\n });\n }", "title": "" }, { "docid": "f7fdd8358c4d43481cc4903887084d32", "score": "0.49588826", "text": "function watchTutorialOnPromise(){\n return new Promise((resolve, reject) => {\n if(userLeft) {\n var d = new Date();\n var n = d.getMilliseconds();\n console.log('promise rejected at',n);\n reject({status:'User Left', message: ':('})\n } else if(userWatchingCatMeme) {\n var d = new Date();\n var n = d.getMilliseconds();\n console.log('promise rejected at',n);\n reject({status: 'User watching cat meme', message:'User not learning Promises'})\n } else {\n var d = new Date();\n var n = d.getMilliseconds();\n console.log('promise resolved at',n);\n resolve({status: 'User Watching Promise Tutorials', message: 'Gonna finish lot of work then'})\n }\n })\n}", "title": "" }, { "docid": "57d70b3ee5e3b4097e1388e90827f6cf", "score": "0.49535298", "text": "function isThenable(value) {\n return value && typeof value === 'object' && typeof value.then === 'function';\n}", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "5dff97e3b15b4aa174c891b78622f129", "score": "0.49515238", "text": "function become(newPromise) {\n resolvedPromise = newPromise;\n promise.source = newPromise;\n\n array_reduce(messages, function (undefined, message) {\n nextTick(function () {\n newPromise.promiseDispatch.apply(newPromise, message);\n });\n }, void 0);\n\n messages = void 0;\n progressListeners = void 0;\n }", "title": "" }, { "docid": "aea3f3a2374b6ece4c01ef83688ab166", "score": "0.49464977", "text": "function become(newPromise){resolvedPromise=newPromise;if(Q.longStackSupport&&hasStacks){// Only hold a reference to the new promise if long stacks\n// are enabled to reduce memory usage\npromise.source=newPromise;}array_reduce(messages,function(undefined,message){Q.nextTick(function(){newPromise.promiseDispatch.apply(newPromise,message);});},void 0);messages=void 0;progressListeners=void 0;}", "title": "" }, { "docid": "d728c3d9a622b4381223a3a7a5e9fdd1", "score": "0.49403036", "text": "then(...args) { return this.toPromise().then(...args); }", "title": "" }, { "docid": "57cd97e717169473003f358883b60923", "score": "0.49204728", "text": "function fnDelayedPromise(resolve, reject) {\n function afterTimeout() {\n resolve();\n }\n setTimeout(afterTimeout, 2000);\n}", "title": "" }, { "docid": "9be228de2a6cde1f5e879e3eb41e5aa7", "score": "0.4920232", "text": "_generatePromise() {\n\n const scope = this\n\n this.promise = when.promise(function(resolve, reject) {\n scope.status = Task.STATUS.PENDING\n scope.resolve = resolve\n scope.reject = reject\n scope.value = undefined\n })\n\n this.promise.catch( _handleError.bind(this) )\n\n return this.promise\n\n }", "title": "" }, { "docid": "ce9aaf539b24d98361603394785c74fa", "score": "0.49106908", "text": "function simplePromises() {\n // invoke async function\n delayedPromise().then(() => {\n // execute on success\n }).catch(() => {\n // execute on error\n });\n // code here does NOT wait for async call\n}", "title": "" }, { "docid": "170798e28454e5f57baf586fcd1a3817", "score": "0.49060783", "text": "function performPledgeAllSettled(iteratorRecord, constructor, resultCapability, pledgeResolve) {\n\n assertIsConstructor(constructor);\n assertIsCallable(pledgeResolve);\n\n const values = [];\n const remainingElementsCount = { value: 1 };\n let index = 0;\n\n /* eslint-disable-next-line no-constant-condition */\n while (true) {\n let next;\n\n try {\n next = iteratorStep(iteratorRecord);\n } catch (error) {\n iteratorRecord.done = true;\n resultCapability.reject(error);\n return resultCapability.pledge;\n }\n\n if (next === false) {\n remainingElementsCount.value = remainingElementsCount.value - 1;\n if (remainingElementsCount.value === 0) {\n resultCapability.resolve(values);\n }\n\n return resultCapability.pledge;\n }\n\n let nextValue;\n\n try {\n nextValue = iteratorValue(next);\n } catch (error) {\n iteratorRecord.done = true;\n resultCapability.reject(error);\n return resultCapability.pledge;\n }\n\n values.push(undefined);\n const nextPledge = pledgeResolve.call(constructor, nextValue);\n const resolveElement = createPledgeAllSettledResolveElement(index, values, resultCapability, remainingElementsCount);\n const rejectElement = createPledgeAllSettledRejectElement(index, values, resultCapability, remainingElementsCount);\n\n remainingElementsCount.value = remainingElementsCount.value + 1;\n nextPledge.then(resolveElement, rejectElement);\n index = index + 1;\n }\n\n}", "title": "" }, { "docid": "1c10437dcdc2eb0c78d834df5259ce0d", "score": "0.48986068", "text": "async updateCapabilities() {\n const data = await this._doApiCall(apiUrlCapabilities);\n if (!data._failed && data.capabilities) {\n // Don't test data.capabilities.files_sharing.api_enabled because the next line contains it all\n // Is public sharing enabled?\n this.public_shares_enabled = !!data.capabilities.files_sharing &&\n !!data.capabilities.files_sharing.public && !!data.capabilities.files_sharing.public.enabled;\n if (this.public_shares_enabled) {\n // Remember if a download password is required\n if (data.capabilities.files_sharing.public.password) {\n if (data.capabilities.files_sharing.public.password.enforced_for &&\n 'boolean' === typeof data.capabilities.files_sharing.public.password.enforced_for.read_only) {\n // ownCloud\n this.enforce_password = !!data.capabilities.files_sharing.public.password.enforced_for.read_only;\n } else {\n //Nextcloud \n this.enforce_password = !!data.capabilities.files_sharing.public.password.enforced;\n }\n }\n // Remember maximum expiry set on server\n delete this.expiry_max_days;\n if (data.capabilities.files_sharing.public.expire_date &&\n data.capabilities.files_sharing.public.expire_date.enforced &&\n isFinite(data.capabilities.files_sharing.public.expire_date.days) &&\n data.capabilities.files_sharing.public.expire_date.days > 0) {\n this.expiry_max_days = parseInt(data.capabilities.files_sharing.public.expire_date.days);\n }\n }\n\n // Remember password policy urls if they are present (AFAIK only in NC 17+)\n if (data.capabilities.password_policy && data.capabilities.password_policy.api) {\n try {\n const u = new URL(data.capabilities.password_policy.api.validate);\n if (u.host === (new URL(this.serverUrl)).host) {\n this._password_validate_url = u.origin + u.pathname;\n }\n } catch (error) { /* Error just means there is no url */ }\n try {\n const u = new URL(data.capabilities.password_policy.api.generate);\n if (u.host === (new URL(this.serverUrl)).host) {\n this._password_generate_url = u.origin + u.pathname;\n }\n } catch (error) { /* Error just means there is no url */ }\n }\n\n // Take version from capabilities\n this.cloud_versionstring = data.version.string;\n // Take name & type from capabilities\n if (data.capabilities.theming && data.capabilities.theming.name) {\n this.cloud_productname = data.capabilities.theming.name;\n this.cloud_type = \"Nextcloud\";\n this.cloud_supported = data.version.major >= ncMinimalVersion;\n } else if (data.capabilities.core.status && data.capabilities.core.status.productname) {\n this.cloud_productname = data.capabilities.core.status.productname;\n this.cloud_type = \"ownCloud\";\n this.cloud_supported = parseInt(data.version.major) * 10000 +\n parseInt(data.version.minor) * 100 +\n parseInt(data.version.micro) >= ocMinimalVersion;\n } else if (data.version.major >= ncMinimalVersion) {\n this.cloud_productname = 'Nextcloud';\n this.cloud_type = \"Nextcloud\";\n this.cloud_supported = true;\n } else {\n this.cloud_type = \"Unsupported\";\n this.cloud_supported = false;\n }\n }\n this.store();\n return data;\n }", "title": "" }, { "docid": "5e54cc67d9c06d6ba6b5508afe9e7d8d", "score": "0.48880288", "text": "function browserFeatureTestAsPromise() {\n var promise = new Promise(function(resolve, reject) {\n browserFeatureTest(resolve);\n });\n return promise;\n}", "title": "" }, { "docid": "e487d0c417316f8cf3b76c77cc0fd555", "score": "0.487937", "text": "function promise () {\n return new Promise(resolve => {\n for (let i = 0; i < 1e+9; i++);\n resolve(true)\n })\n}", "title": "" }, { "docid": "23603b79848ad26cbc77a3903850dbf8", "score": "0.48736268", "text": "function delayedPromise() {\n return new Promise((resolve, reject) => {\n function afterTimeout() {\n resolve();\n }\n setTimeout(afterTimeout, 1000);\n });\n}", "title": "" }, { "docid": "d5b07808673adcb608da93005fc115aa", "score": "0.48726624", "text": "function isThenable(value) {\n\t return value && typeof value === 'object' && typeof value.then === 'function';\n\t}", "title": "" }, { "docid": "9470da7a828e5a326774cddeb5148016", "score": "0.4868822", "text": "function syncThen(promise, thenFunc) {\n\t// not a promise, or an already-resolved promise?\n\tif (!promise || !promise.then || promise.state() === 'resolved') {\n\t\treturn $.when(thenFunc()); // resolve immediately\n\t}\n\telse if (thenFunc) {\n\t\treturn promise.then(thenFunc);\n\t}\n}", "title": "" }, { "docid": "9470da7a828e5a326774cddeb5148016", "score": "0.4868822", "text": "function syncThen(promise, thenFunc) {\n\t// not a promise, or an already-resolved promise?\n\tif (!promise || !promise.then || promise.state() === 'resolved') {\n\t\treturn $.when(thenFunc()); // resolve immediately\n\t}\n\telse if (thenFunc) {\n\t\treturn promise.then(thenFunc);\n\t}\n}", "title": "" } ]
2131e03bb284a6ec353eb87757f5cf98
Author: jsandoe Copyright (c) 2022 by The Concord Consortium, Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==========================================================================
[ { "docid": "df8d346ed006fe84140ed92280663cf0", "score": "0.0", "text": "function initialize(iEventHandlers) {\n let eventHandlers = iEventHandlers;\n\n setEventHandler('html', 'click', iEventHandlers.selectHandler, true);\n setEventHandler('.fe-clear-button', 'click', eventHandlers.clearData);\n setEventHandler('.fe-pop-up-anchor,#fe-info-close-button', 'click',\n function (/*ev*/) {\n let parentEl = findAncestorElementWithClass(this, 'fe-pop-up');\n togglePopUp(parentEl);\n });\n\n}", "title": "" } ]
[ { "docid": "c427e3a76d3b76f62024bb51af1df9d0", "score": "0.5514826", "text": "function joeembed(args) {\r\n let embed = new MessageEmbed()\r\n .setDescription(args)\r\n .setColor(\"#fffff\")\r\n message.channel.send({ embed: embed })\r\n }", "title": "" }, { "docid": "650ff554859977bab92401016e1b7806", "score": "0.5389554", "text": "private public function m246() {}", "title": "" }, { "docid": "8781eb1521e87c8853648b038e9f1b6a", "score": "0.52745", "text": "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r\n/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */}", "title": "" }, { "docid": "c9ff6265a6cfe8bb1093fc80f27fe0c8", "score": "0.5206682", "text": "function licNotice(answer) {\n if (answer === 'Apache 2.0') {\n return `\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file \n except in compliance with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed under the \n License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, \n either express or implied. See the License for the specific language governing permissions \n and limitations under the License.\n `\n } else if (answer === 'GPLv3') {\n return `\n This program is free software: you can redistribute it and/or modify it under the terms of the \n GNU General Public License as published by the Free Software Foundation, either version 3 of \n the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \n without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n See the GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along with this program. \n If not, see <https://www.gnu.org/licenses/>.\n `\n } else if (answer === 'MIT') {\n return `\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software \n and associated documentation files (the \"Software\"), to deal in the Software without \n restriction, including without limitation the rights to use, copy, modify, merge, publish, \n distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the \n Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or \n substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \n BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n `\n } else if (answer === 'Unlicense') {\n return `\n This is free and unencumbered software released into the public domain.\n\n Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, \n either in source code form or as a compiled binary, for any purpose, commercial or \n non-commercial, and by any means.\n\n In jurisdictions that recognize copyright laws, the author or authors of this software \n dedicate any and all copyright interest in the software to the public domain. We make this \n dedication for the benefit of the public at large and to the detriment of our heirs and \n successors. We intend this dedication to be an overt act of relinquishment in perpetuity of \n all present and future rights to this software under copyright law.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING \n BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN \n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n For more information, please refer to https://unlicense.org\n `\n }\n}", "title": "" }, { "docid": "87ba68c22404f14f983ab256193c0855", "score": "0.51856524", "text": "function version(){ return \"0.13.0\" }", "title": "" }, { "docid": "44dfde9906fa1c183245d889a94dcfc2", "score": "0.5156025", "text": "private internal function m248() {}", "title": "" }, { "docid": "b4fe5e1d98ddf796ef52c92cae7eb15d", "score": "0.5142055", "text": "static get is() { return 'lingo-live-write-message'; }", "title": "" }, { "docid": "f6bc26dff2d3b843c9e5b55439a19285", "score": "0.51107687", "text": "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5067895", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "1136cac8fa06f8dfae03c4b9aba95c66", "score": "0.5047566", "text": "function yo(){ }", "title": "" }, { "docid": "22f576058acffa285555da2d8cfead1c", "score": "0.4989357", "text": "function yoMamaJoke() {\n const agent = new https.Agent({ \n rejectUnauthorized: false\n });\n axios.get('http://api.yomomma.info')\n .then(res => {\n const joke = res.data.joke;\n\n const params = {\n icon_emoji: ':laughing:'\n }\n\n bot.postMessageToChannel(\n 'general',\n `Yo Mama: ${joke}`, \n params\n )\n }).catch(err => {\n console.log(err)\n })\n}", "title": "" }, { "docid": "faccde171dda7ff82e5a824ab80d2a27", "score": "0.49883202", "text": "function API(e=\"untitled\",s=!1){return new class{constructor(e,s){this.name=e,this.debug=s,this.isRequest=\"undefined\"!=typeof $request,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>{if(this.isNode){const e=\"undefined\"!=typeof $request?void 0:require(\"request\"),s=require(\"fs\");return{request:e,fs:s}}return null})(),this.initCache();const t=(e,s)=>new Promise(function(t){setTimeout(t.bind(null,s),e)});Promise.prototype.delay=function(e){return this.then(function(s){return t(e,s)})}}get(e){return this.isQX?(\"string\"==typeof e&&(e={url:e,method:\"GET\"}),$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.get(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}post(e){return e.body&&e.headers&&!e.headers[\"Content-Type\"]&&(e.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\"),this.isQX?(\"string\"==typeof e&&(e={url:e}),e.method=\"POST\",$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.post(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request.post(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}initCache(){if(this.isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||\"{}\")),(this.isLoon||this.isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||\"{}\")),this.isNode){let e=\"root.json\";this.node.fs.existsSync(e)||this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.root={},e=`${this.name}.json`,this.node.fs.existsSync(e)?this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.cache={})}}persistCache(){const e=JSON.stringify(this.cache);this.isQX&&$prefs.setValueForKey(e,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(e,this.name),this.isNode&&(this.node.fs.writeFileSync(`${this.name}.json`,e,{flag:\"w\"},e=>console.log(e)),this.node.fs.writeFileSync(\"root.json\",JSON.stringify(this.root),{flag:\"w\"},e=>console.log(e)))}write(e,s){this.log(`SET ${s}`),-1!==s.indexOf(\"#\")?(s=s.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(e,s),this.isQX&&$prefs.setValueForKey(e,s),this.isNode&&(this.root[s]=e)):this.cache[s]=e,this.persistCache()}read(e){return this.log(`READ ${e}`),-1===e.indexOf(\"#\")?this.cache[e]:(e=e.substr(1),this.isSurge||this.isLoon?$persistentStore.read(e):this.isQX?$prefs.valueForKey(e):this.isNode?this.root[e]:void 0)}delete(e){this.log(`DELETE ${e}`),-1!==e.indexOf(\"#\")?(e=e.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(null,e),this.isQX&&$prefs.removeValueForKey(e),this.isNode&&delete this.root[e]):delete this.cache[e],this.persistCache()}notify(s=e,t=\"\",i=\"\",o,n){if(this.isSurge){let e=i+(null==n?\"\":`\\n\\n多媒体链接:${n}`),r={};o&&(r.url=o),\"{}\"==JSON.stringify(r)?$notification.post(s,t,e):$notification.post(s,t,e,r)}if(this.isQX){let e={};o&&(e[\"open-url\"]=o),n&&(e[\"media-url\"]=n),\"{}\"==JSON.stringify(e)?$notify(s,t,i):$notify(s,t,i,e)}if(this.isLoon){let e={};o&&(e.openUrl=o),n&&(e.mediaUrl=n),\"{}\"==JSON.stringify(e)?$notification.post(s,t,i):$notification.post(s,t,i,e)}if(this.isNode){let e=i+(null==o?\"\":`\\n\\n跳转链接:${o}`)+(null==n?\"\":`\\n\\n多媒体链接:${n}`);if(this.isJSBox){const i=require(\"push\");i.schedule({title:s,body:t?t+\"\\n\"+e:e})}else console.log(`${s}\\n${t}\\n${e}\\n\\n`)}}log(e){this.debug&&console.log(e)}info(e){console.log(e)}error(e){console.log(\"ERROR: \"+e)}wait(e){return new Promise(s=>setTimeout(s,e))}done(e={}){this.isQX||this.isLoon||this.isSurge?this.isRequest?$done(e):$done():this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}}(e,s)}", "title": "" }, { "docid": "1c15b63cf65f6d8b0853e2b9a1ba4f6e", "score": "0.49754784", "text": "function hc(){}", "title": "" }, { "docid": "adab1c782f29f966e80c72dca198d1a0", "score": "0.4967532", "text": "function je(e, t) {\n void 0 === e && (e = \"\"),\n _e(\n {\n style: {\n MozOsxFontSmoothing: \"grayscale\",\n WebkitFontSmoothing: \"antialiased\",\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n speak: \"none\",\n },\n fontFace: { fontFamily: '\"FabricMDL2Icons\"', src: \"url('\" + e + \"fabric-icons-a13498cf.woff') format('woff')\" },\n icons: {\n GlobalNavButton: \"\",\n ChevronDown: \"\",\n ChevronUp: \"\",\n Edit: \"\",\n Add: \"\",\n Cancel: \"\",\n More: \"\",\n Settings: \"\",\n Mail: \"\",\n Filter: \"\",\n Search: \"\",\n Share: \"\",\n BlockedSite: \"\",\n FavoriteStar: \"\",\n FavoriteStarFill: \"\",\n CheckMark: \"\",\n Delete: \"\",\n ChevronLeft: \"\",\n ChevronRight: \"\",\n Calendar: \"\",\n Megaphone: \"\",\n Undo: \"\",\n Flag: \"\",\n Page: \"\",\n Pinned: \"\",\n View: \"\",\n Clear: \"\",\n Download: \"\",\n Upload: \"\",\n Folder: \"\",\n Sort: \"\",\n AlignRight: \"\",\n AlignLeft: \"\",\n Tag: \"\",\n AddFriend: \"\",\n Info: \"\",\n SortLines: \"\",\n List: \"\",\n CircleRing: \"\",\n Heart: \"\",\n HeartFill: \"\",\n Tiles: \"\",\n Embed: \"\",\n Glimmer: \"\",\n Ascending: \"\",\n Descending: \"\",\n SortUp: \"\",\n SortDown: \"\",\n SyncToPC: \"\",\n LargeGrid: \"\",\n SkypeCheck: \"\",\n SkypeClock: \"\",\n SkypeMinus: \"\",\n ClearFilter: \"\",\n Flow: \"\",\n StatusCircleCheckmark: \"\",\n MoreVertical: \"\",\n },\n },\n t,\n );\n }", "title": "" }, { "docid": "4fe40e323fdc0cf6406e791ac0e8e769", "score": "0.49505243", "text": "function t(e,t,a,s){var i,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(r=(n<3?i(r):n>3?i(t,a,r):i(t,a))||r);return n>3&&r&&Object.defineProperty(t,a,r),r\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "7b3660bcf6ef0997b43a11b560a4b0c1", "score": "0.49439403", "text": "function e(t,e,r,o){var i,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,o);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(a=(s<3?i(a):s>3?i(e,r,a):i(e,r))||a);return s>3&&a&&Object.defineProperty(e,r,a),a\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */}", "title": "" }, { "docid": "c6cdab38a2fee4945b448ab355954a1b", "score": "0.4940149", "text": "async setup() { }", "title": "" }, { "docid": "99759f6dfc45fbdf6954e2c9b1e5817a", "score": "0.492891", "text": "function $s(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i, o, s, u, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n return ru(n = O(t)), iu(n), !0 !== e || !0 === n.Oo ? [ 3 /*break*/ , 3 ] : (r = n.sharedClientState.getAllActiveQueryTargets(), \n [ 4 /*yield*/ , Js(n, r.toArray()) ]);\n\n case 1:\n return i = h.sent(), n.Oo = !0, [ 4 /*yield*/ , ns(n.remoteStore, !0) ];\n\n case 2:\n for (h.sent(), o = 0, s = i; o < s.length; o++) u = s[o], Mo(n.remoteStore, u);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== e || !1 === n.Oo ? [ 3 /*break*/ , 7 ] : (a = [], c = Promise.resolve(), \n n.Vo.forEach((function(t, e) {\n n.sharedClientState.isLocalQueryTarget(e) ? a.push(e) : c = c.then((function() {\n return Us(n, e), Gi(n.localStore, e, \n /*keepPersistedTargetData=*/ !0);\n })), Fo(n.remoteStore, e);\n })), [ 4 /*yield*/ , c ]);\n\n case 4:\n return h.sent(), [ 4 /*yield*/ , Js(n, a) ];\n\n case 5:\n return h.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = O(t);\n e.Co.forEach((function(t, n) {\n Fo(e.remoteStore, n);\n })), e.No.ts(), e.Co = new Map, e.Do = new Ke(st.comparator);\n }(n), n.Oo = !1, [ 4 /*yield*/ , ns(n.remoteStore, !1) ];\n\n case 6:\n h.sent(), h.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "d84dc277424b91d41d85dddb69db7558", "score": "0.49093696", "text": "function zu(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, u, s, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n return t.Ll = function(e, n, r) {\n return function(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, u;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(s) {\n switch (s.label) {\n case 0:\n return i = e.view.fl(n), i.lc ? [ 4 /*yield*/ , ho(t.bh, e.query, \n /* usePreviousResults= */ !1).then((function(t) {\n var n = t.documents;\n return e.view.fl(n, i);\n })) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n i = s.sent(), s.label = 2;\n\n case 2:\n return o = r && r.$e.get(e.targetId), u = e.view.wi(i, \n /* updateLimboDocuments= */ t.Ml, o), [ 2 /*return*/ , (es(t, e.targetId, u.Il), \n u.snapshot) ];\n }\n }));\n }));\n }(t, e, n, r);\n }, [ 4 /*yield*/ , ho(t.bh, e, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return i = h.sent(), o = new Uu(e, i.Rc), u = o.fl(i.documents), s = Tn.Le(n, r && \"Offline\" /* Offline */ !== t.onlineState), \n a = o.wi(u, \n /* updateLimboDocuments= */ t.Ml, s), es(t, n, a.Il), c = new Mu(e, n, o), [ 2 /*return*/ , (t.vl.set(e, c), \n t.Sl.has(n) ? t.Sl.get(n).push(e) : t.Sl.set(n, [ e ]), a.snapshot) ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "52b64fbfa48bc95d11ed241ebbfa874b", "score": "0.48922563", "text": "protected internal function m252() {}", "title": "" }, { "docid": "06ef5710db3984916e89abbaca5ef691", "score": "0.48573485", "text": "function Hs(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(o) {\n switch (o.label) {\n case 0:\n return [ 4 /*yield*/ , Qi((n = O(t)).localStore, e.query, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return r = o.sent(), i = e.view.Ao(r), [ 2 /*return*/ , (n.isPrimaryClient && js(n, e.targetId, i.To), \n i) ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "0fccacaadfbb6dc54d4cfb1d8c37084c", "score": "0.48566842", "text": "function $s(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i, o, s, u, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n return iu(n = L(t)), ou(n), !0 !== e || !0 === n.Oo ? [ 3 /*break*/ , 3 ] : (r = n.sharedClientState.getAllActiveQueryTargets(), \n [ 4 /*yield*/ , Zs(n, r.toArray()) ]);\n\n case 1:\n return i = h.sent(), n.Oo = !0, [ 4 /*yield*/ , rs(n.remoteStore, !0) ];\n\n case 2:\n for (h.sent(), o = 0, s = i; o < s.length; o++) u = s[o], Fo(n.remoteStore, u);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== e || !1 === n.Oo ? [ 3 /*break*/ , 7 ] : (a = [], c = Promise.resolve(), \n n.Vo.forEach((function(t, e) {\n n.sharedClientState.isLocalQueryTarget(e) ? a.push(e) : c = c.then((function() {\n return Bs(n, e), Qi(n.localStore, e, \n /*keepPersistedTargetData=*/ !0);\n })), Vo(n.remoteStore, e);\n })), [ 4 /*yield*/ , c ]);\n\n case 4:\n return h.sent(), [ 4 /*yield*/ , Zs(n, a) ];\n\n case 5:\n return h.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = L(t);\n e.Co.forEach((function(t, n) {\n Vo(e.remoteStore, n);\n })), e.No.ts(), e.Co = new Map, e.Do = new Ge(ut.comparator);\n }(n), n.Oo = !1, [ 4 /*yield*/ , rs(n.remoteStore, !1) ];\n\n case 6:\n h.sent(), h.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "1744c28f9eb97634d68d7fc0431df1ee", "score": "0.48523957", "text": "function Ys(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(o) {\n switch (o.label) {\n case 0:\n return [ 4 /*yield*/ , zi((n = L(t)).localStore, e.query, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return r = o.sent(), i = e.view.Ao(r), [ 2 /*return*/ , (n.isPrimaryClient && Ks(n, e.targetId, i.To), \n i) ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "a47321df19a3676289c6ed3a469a77d8", "score": "0.4846244", "text": "function y(e){let t=R,n=D,r=j,s=v,i=M,o=B,a=_,u=new Uint8Array(x.slice(0,R)),d=E,c=E.slice(0,E.length),g=F,l=Y,p=e();return R=t,D=n,j=r,v=s,M=i,B=o,_=a,x=u,Y=l,E=d,E.splice(0,E.length,...c),F=g,P=new DataView(x.buffer,x.byteOffset,x.byteLength),p}", "title": "" }, { "docid": "4a0ac157e92a7745c5170398d1632465", "score": "0.48461503", "text": "function setup() {\n \n}", "title": "" }, { "docid": "8888b251505468cc9b16e2fa59977c6e", "score": "0.48430002", "text": "function testEliza () {\n let eliza = new ElizaBot();\n console.log(eliza.getInitial());\n console.log(eliza.transform(\"I've been wondering if you'd be a good test\"));\n}", "title": "" }, { "docid": "adb523a3659b948dce8b1db5d5c4e12a", "score": "0.48419273", "text": "function Zs(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(o) {\n switch (o.label) {\n case 0:\n return [ 4 /*yield*/ , Ji((n = C(t)).localStore, e.query, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return r = o.sent(), i = e.view.So(r), [ 2 /*return*/ , (n.isPrimaryClient && Ws(n, e.targetId, i.Po), \n i) ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "7a137112695f1408bff6f4d357ab7b1e", "score": "0.48398015", "text": "execute(message, args){\n const newEmbed = new Discord.MessageEmbed();\n /*\n START OF EDITING EMBED FIELD\n */\n newEmbed.setTitle(\"!Riebot Commands\");\n newEmbed.addFields(\n {name: \"animate\", value: '\"\",<index>, insert <tenor gif>, delete <anime index>'},\n {name: \"anime\", value: \"<anime/artist name>\"},\n {name: \"help\", value: \"< >\"},\n {name: \"ping\", value: \"< >\"},\n {name: \"rank\", value: \"<(optional) @user>\"},\n {name: \"spotify\", value: \"<song/artist>\"},\n {name: \"weather\", value: \"<zipcode>\"}\n );\n//banned\n if(message.author.id === \"620394107616886786\") {\n newEmbed.setTitle('AHHH BICDICKYYYYYY');\n }\n /*\n END OF EDITING EMBED FIELD stop fking w the console\n */\n message.channel.send(newEmbed);\n }", "title": "" }, { "docid": "1e44cb8f88279fa532ce1182b398fee0", "score": "0.48103854", "text": "sendAzkar(bot, mode) {\n const { getRandomItem, makeMessage, send } = require(\"./lib\");\n const { Markup } = require(\"telegraf\");\n let azkarData = require(\"../db/azkar.json\");\n let mas = getRandomItem(\n Array.from(azkarData)\n );\n send(\n bot,\n mode,\n makeMessage(mas)\n );\n }", "title": "" }, { "docid": "384b24256fe99107d91a331e3a23845c", "score": "0.48101866", "text": "getMeta () {\n }", "title": "" }, { "docid": "407a4a1dcd964daecd1205f9b5e85cf9", "score": "0.47947508", "text": "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "title": "" }, { "docid": "115066c9510eaa034d855bc44c7d9c5f", "score": "0.47787923", "text": "function eu(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, s;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(u) {\n switch (u.label) {\n case 0:\n return (i = O(t)).Oo ? (\n // If we receive a target state notification via WebStorage, we are\n // either already secondary or another tab has taken the primary lease.\n D(\"SyncEngine\", \"Ignoring unexpected query state notification.\"), [ 3 /*break*/ , 8 ]) : [ 3 /*break*/ , 1 ];\n\n case 1:\n if (!i.Vo.has(e)) return [ 3 /*break*/ , 8 ];\n switch (n) {\n case \"current\":\n case \"not-current\":\n return [ 3 /*break*/ , 2 ];\n\n case \"rejected\":\n return [ 3 /*break*/ , 5 ];\n }\n return [ 3 /*break*/ , 7 ];\n\n case 2:\n return [ 4 /*yield*/ , Wi(i.localStore) ];\n\n case 3:\n return o = u.sent(), s = on.createSynthesizedRemoteEventForCurrentChange(e, \"current\" === n), \n [ 4 /*yield*/ , Qs(i, o, s) ];\n\n case 4:\n return u.sent(), [ 3 /*break*/ , 8 ];\n\n case 5:\n return [ 4 /*yield*/ , Gi(i.localStore, e, \n /* keepPersistedTargetData */ !0) ];\n\n case 6:\n return u.sent(), Us(i, e, r), [ 3 /*break*/ , 8 ];\n\n case 7:\n C(), u.label = 8;\n\n case 8:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "f52d81fb094fb818cd1bc35d11d34b8a", "score": "0.47750863", "text": "function Pythia() {}", "title": "" }, { "docid": "98bce93b2e836556dba10956a9e8304f", "score": "0.47711322", "text": "function nu(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i, o, s, u, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n return au(n = C(t)), cu(n), !0 !== e || !0 === n.Uo ? [ 3 /*break*/ , 3 ] : (r = n.sharedClientState.getAllActiveQueryTargets(), \n [ 4 /*yield*/ , ru(n, r.toArray()) ]);\n\n case 1:\n return i = h.sent(), n.Uo = !0, [ 4 /*yield*/ , us(n.remoteStore, !0) ];\n\n case 2:\n for (h.sent(), o = 0, s = i; o < s.length; o++) u = s[o], Bo(n.remoteStore, u);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== e || !1 === n.Uo ? [ 3 /*break*/ , 7 ] : (a = [], c = Promise.resolve(), \n n.$o.forEach((function(t, e) {\n n.sharedClientState.isLocalQueryTarget(e) ? a.push(e) : c = c.then((function() {\n return zs(n, e), Yi(n.localStore, e, \n /*keepPersistedTargetData=*/ !0);\n })), jo(n.remoteStore, e);\n })), [ 4 /*yield*/ , c ]);\n\n case 4:\n return h.sent(), [ 4 /*yield*/ , ru(n, a) ];\n\n case 5:\n return h.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = C(t);\n e.ko.forEach((function(t, n) {\n jo(e.remoteStore, n);\n })), e.Mo.cs(), e.ko = new Map, e.Oo = new We(H.comparator);\n }(n), n.Uo = !1, [ 4 /*yield*/ , us(n.remoteStore, !1) ];\n\n case 6:\n h.sent(), h.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "1e535a21da6c0c68a53a9395286a5478", "score": "0.4770097", "text": "async function main() {\n if(bre.network.name.indexOf(\"sidechain\")>=0 || bre.network.name.indexOf(\"sokol\")>=0){\n const Liker = await deploy(\"Liker\")\n const NiftyRegistry = await deploy(\"NiftyRegistry\")\n const NiftyInk = await deploy(\"NiftyInk\")\n const NiftyToken = await deploy(\"NiftyToken\")\n const NiftyMediator = await deploy(\"NiftyMediator\")\n await NiftyRegistry.setInkAddress(NiftyInk.address)\n await NiftyRegistry.setTokenAddress(NiftyToken.address)\n await NiftyRegistry.setBridgeMediatorAddress(NiftyMediator.address)\n await NiftyInk.setNiftyRegistry(NiftyRegistry.address)\n await NiftyToken.setNiftyRegistry(NiftyRegistry.address)\n await NiftyMediator.setNiftyRegistry(NiftyRegistry.address)\n await Liker.addContract(NiftyInk.address)\n\n if(bre.network.name.indexOf(\"kovan\")>=0){\n await NiftyMediator.setBridgeContract(\"0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560\")\n await NiftyRegistry.setTrustedForwarder(\"0x77777e800704Fb61b0c10aa7b93985F835EC23fA\")\n await NiftyMediator.setRequestGasLimit(\"1500000\")\n }\n\n if(bre.network.name.indexOf(\"sidechain\")>=0) {\n let trustedForwarder\n try{\n await NiftyMediator.setBridgeContract(\"0x9539a46432a405f0CCc1a1fceaD5866bFf271B04\")\n await NiftyMediator.setRequestGasLimit(\"1500000\")\n\n let trustedForwarderObj = JSON.parse(fs.readFileSync(\"../react-app/src/gsn/Forwarder.json\"))\n console.log(\"⛽️ Setting GSN Trusted Forwarder on NiftyRegistry to \",trustedForwarderObj.address)\n await NiftyRegistry.setTrustedForwarder(trustedForwarderObj.address)\n console.log(\"⛽️ Setting GSN Trusted Forwarder on Liker to \",trustedForwarderObj.address)\n await Liker.setTrustedForwarder(trustedForwarderObj.address)\n }catch(e){\n console.log(e)\n }\n }\n }\n\n if(bre.network.name.indexOf(\"localhost\")>=0 || bre.network.name.indexOf(\"kovan\")>=0){\n const NiftyMain = await deploy(\"NiftyMain\")\n\n if(bre.network.name.indexOf(\"kovan\")>=0) {\n await NiftyMain.setBridgeContract(\"0xFe446bEF1DbF7AFE24E81e05BC8B271C1BA9a560\")\n await NiftyMain.setMediatorContractOnOtherSide(\"0x339d0e6f308a410F18888932Bdf661636A0F538f\")\n await NiftyMain.setRequestGasLimit(\"1500000\")\n }\n\n if(bre.network.name.indexOf(\"localhost\")>=0) {\n await NiftyMain.setBridgeContract(\"0x9539a46432a405f0CCc1a1fceaD5866bFf271B04\")\n await NiftyMain.setRequestGasLimit(\"1500000\")\n let MediatorAddress = fs.readFileSync(bre.config.paths.artifacts + \"/NiftyMediator.address\").toString()\n await NiftyMain.setMediatorContractOnOtherSide(MediatorAddress)\n }\n }\n}", "title": "" }, { "docid": "9cfe95481880010cc9a163e10c8f7893", "score": "0.47568908", "text": "getEntity() {}", "title": "" }, { "docid": "97f7c9999e25ef81589ddcc44594ed4a", "score": "0.47491175", "text": "function uu(t, e, n) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var r, i, o, s, u, a, c, h, f, l;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(d) {\n switch (d.label) {\n case 0:\n if (!(r = au(t)).Uo) return [ 3 /*break*/ , 10 ];\n i = 0, o = e, d.label = 1;\n\n case 1:\n return i < o.length ? (s = o[i], r.$o.has(s) ? (\n // A target might have been added in a previous attempt\n _(\"SyncEngine\", \"Adding an already active target \" + s), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , Xi(r.localStore, s) ]) : [ 3 /*break*/ , 6 ];\n\n case 2:\n return u = d.sent(), [ 4 /*yield*/ , Hi(r.localStore, u) ];\n\n case 3:\n return a = d.sent(), [ 4 /*yield*/ , Os(r, iu(u), a.targetId, \n /*current=*/ !1) ];\n\n case 4:\n d.sent(), Bo(r.remoteStore, a), d.label = 5;\n\n case 5:\n return i++, [ 3 /*break*/ , 1 ];\n\n case 6:\n c = function(t) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(e) {\n switch (e.label) {\n case 0:\n return r.$o.has(t) ? [ 4 /*yield*/ , Yi(r.localStore, t, \n /* keepPersistedTargetData */ !1).then((function() {\n jo(r.remoteStore, t), zs(r, t);\n })).catch(yi) ] : [ 3 /*break*/ , 2 ];\n\n // Release queries that are still active.\n case 1:\n // Release queries that are still active.\n e.sent(), e.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }, h = 0, f = n, d.label = 7;\n\n case 7:\n return h < f.length ? (l = f[h], [ 5 /*yield**/ , c(l) ]) : [ 3 /*break*/ , 10 ];\n\n case 8:\n d.sent(), d.label = 9;\n\n case 9:\n return h++, [ 3 /*break*/ , 7 ];\n\n case 10:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "c5cb017583df451c0924750b91b92364", "score": "0.47387764", "text": "function vs(t, e, n) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var r, i, o, u, s, a, c, h, f, l;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(p) {\n switch (p.label) {\n case 0:\n if (!(r = ys(t)).kl) return [ 3 /*break*/ , 10 ];\n i = 0, o = e, p.label = 1;\n\n case 1:\n return i < o.length ? (u = o[i], r.Sl.has(u) ? (\n // A target might have been added in a previous attempt\n N(\"SyncEngine\", \"Adding an already active target \" + u), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , fo(r.bh, u) ]) : [ 3 /*break*/ , 6 ];\n\n case 2:\n return s = p.sent(), [ 4 /*yield*/ , ao(r.bh, s) ];\n\n case 3:\n return a = p.sent(), [ 4 /*yield*/ , zu(r, ls(s), a.targetId, \n /*current=*/ !1) ];\n\n case 4:\n p.sent(), tu(r.yl, a), p.label = 5;\n\n case 5:\n return i++, [ 3 /*break*/ , 1 ];\n\n case 6:\n c = function(t) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(e) {\n switch (e.label) {\n case 0:\n return r.Sl.has(t) ? [ 4 /*yield*/ , co(r.bh, t, \n /* keepPersistedTargetData */ !1).then((function() {\n eu(r.yl, t), $u(r, t);\n })).catch(mi) ] : [ 3 /*break*/ , 2 ];\n\n // Release queries that are still active.\n case 1:\n // Release queries that are still active.\n e.sent(), e.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }, h = 0, f = n, p.label = 7;\n\n case 7:\n return h < f.length ? (l = f[h], [ 5 /*yield**/ , c(l) ]) : [ 3 /*break*/ , 10 ];\n\n case 8:\n p.sent(), p.label = 9;\n\n case 9:\n return h++, [ 3 /*break*/ , 7 ];\n\n case 10:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "ebbeeae6513372ecac13d0672c33beeb", "score": "0.47298023", "text": "function test_candu_graphs_datastore_vsphere6() {}", "title": "" }, { "docid": "d7fbe10c43768a128763b12c3f3a405e", "score": "0.47190428", "text": "function Os(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, s, u, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n return t.Qo = function(e, n, r) {\n return function(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, s;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(u) {\n switch (u.label) {\n case 0:\n return i = e.view.Io(n), i.Mn ? [ 4 /*yield*/ , Ji(t.localStore, e.query, \n /* usePreviousResults= */ !1).then((function(t) {\n var n = t.documents;\n return e.view.Io(n, i);\n })) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n i = u.sent(), u.label = 2;\n\n case 2:\n return o = r && r.targetChanges.get(e.targetId), s = e.view.applyChanges(i, \n /* updateLimboDocuments= */ t.isPrimaryClient, o), [ 2 /*return*/ , (Ws(t, e.targetId, s.Po), \n s.snapshot) ];\n }\n }));\n }));\n }(t, e, n, r);\n }, [ 4 /*yield*/ , Ji(t.localStore, e, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return i = h.sent(), o = new ks(e, i.jn), s = o.Io(i.documents), u = fn.createSynthesizedTargetChangeForCurrentChange(n, r && \"Offline\" /* Offline */ !== t.onlineState), \n a = o.applyChanges(s, \n /* updateLimboDocuments= */ t.isPrimaryClient, u), Ws(t, n, a.Po), c = new Cs(e, n, o), \n [ 2 /*return*/ , (t.No.set(e, c), t.$o.has(n) ? t.$o.get(n).push(e) : t.$o.set(n, [ e ]), \n a.snapshot) ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "ea11f4995ec49b1227adbeee39ffc627", "score": "0.47176585", "text": "function setup() {\n\n\n}", "title": "" }, { "docid": "ea11f4995ec49b1227adbeee39ffc627", "score": "0.47176585", "text": "function setup() {\n\n\n}", "title": "" }, { "docid": "d344324003d4f7a8fdad3ae3bc458fcb", "score": "0.47057384", "text": "function AeUtil() {}", "title": "" }, { "docid": "208e03af15c7d152585854075f0bd3b5", "score": "0.47045717", "text": "function yo(t, e) {\n // Use two different prefix formats:\n // * firestore / persistenceKey / projectID . databaseID / ...\n // * firestore / persistenceKey / projectID / ...\n // projectIDs are DNS-compatible names and cannot contain dots\n // so there's no danger of collisions.\n var n = t.projectId;\n return t.j || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\"\n /**\n * Implements `LocalStore` interface.\n *\n * Note: some field defined in this class might have public access level, but\n * the class is not exported so they are only accessible from this module.\n * This is useful to implement optional features (like bundles) in free\n * functions, such that they are tree-shakeable.\n */;\n}", "title": "" }, { "docid": "61b48438d67c3a8d78cd47998cc92a38", "score": "0.4704261", "text": "async init() {\n\n }", "title": "" }, { "docid": "b33f113b364cb6a949568de25eed0541", "score": "0.47016868", "text": "transient private internal function m185() {}", "title": "" }, { "docid": "26875e913bc14f47bb6679dd49bad0a7", "score": "0.4696941", "text": "async function n(s,n,a){n=l$2.from(n);const u=r$1(s);return r(u,n,a).then((r=>{const e=r.data,o={};return Object.keys(e).forEach((r=>o[r]=g.fromJSON(e[r]))),o}))}", "title": "" }, { "docid": "7549e22215f684ee26bddb03d28144b7", "score": "0.4692106", "text": "async run(ctx, args) {\n return ctx.reply(`${this.constructor.name} does not provide a \\`run()\\` implementation.${ctx.author.id !== this.client.constants.ownerID ? \" This is a bug, please report this in our server at https://discord.gg/mDkMbEh\" : \"\"}`);\n }", "title": "" }, { "docid": "1c580e0e20342e4b3d04238ef4958de4", "score": "0.46876952", "text": "function hs(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i, o, u, s, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n return ys(n = O(t)), ms(n), !0 !== e || !0 === n.kl ? [ 3 /*break*/ , 3 ] : (r = n.Vl.va(), \n [ 4 /*yield*/ , fs(n, r.it()) ]);\n\n case 1:\n return i = h.sent(), n.kl = !0, [ 4 /*yield*/ , bu(n.yl, !0) ];\n\n case 2:\n for (h.sent(), o = 0, u = i; o < u.length; o++) s = u[o], tu(n.yl, s);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== e || !1 === n.kl ? [ 3 /*break*/ , 7 ] : (a = [], c = Promise.resolve(), \n n.Sl.forEach((function(t, e) {\n n.Vl.Ma(e) ? a.push(e) : c = c.then((function() {\n return $u(n, e), co(n.bh, e, \n /*keepPersistedTargetData=*/ !0);\n })), eu(n.yl, e);\n })), [ 4 /*yield*/ , c ]);\n\n case 4:\n return h.sent(), [ 4 /*yield*/ , fs(n, a) ];\n\n case 5:\n return h.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = O(t);\n e.xl.forEach((function(t, n) {\n eu(e.yl, n);\n })), e.Nl.Oc(), e.xl = new Map, e.Cl = new rn(tt.H);\n }(n), n.kl = !1, [ 4 /*yield*/ , bu(n.yl, !1) ];\n\n case 6:\n h.sent(), h.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "e6e8c8621e14f4cb240fbfd3565218b9", "score": "0.46846664", "text": "function RedisBox () {}", "title": "" }, { "docid": "ee8e0fd2bda30d4ac27438518dc5beab", "score": "0.46710223", "text": "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "title": "" }, { "docid": "d7befc63295f89b120a726bb9427759f", "score": "0.4670386", "text": "function halo() {\n return '\"Halo Sanbers!\"';\n}", "title": "" }, { "docid": "7d9bf084c2e0a5e8a460dbec92d73a41", "score": "0.46697772", "text": "function $o(t, e, n) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var r = this;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(i) {\n switch (i.label) {\n case 0:\n if (!Nr(e)) throw e;\n // Disable network and raise offline snapshots\n return t.Qr.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Uo(t) ];\n\n case 1:\n // Disable network and raise offline snapshots\n return i.sent(), t.jr.set(\"Offline\" /* Offline */), n || (\n // Use a simple read operation to determine if IndexedDB recovered.\n // Ideally, we would expose a health check directly on SimpleDb, but\n // RemoteStore only has access to persistence through LocalStore.\n n = function() {\n return Ki(t.localStore);\n }), \n // Probe IndexedDB periodically and re-enable network\n t.asyncQueue.enqueueRetryable((function() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(r, void 0, void 0, (function() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(e) {\n switch (e.label) {\n case 0:\n return _(\"RemoteStore\", \"Retrying IndexedDB access\"), [ 4 /*yield*/ , n() ];\n\n case 1:\n return e.sent(), t.Qr.delete(1 /* IndexedDbFailed */), [ 4 /*yield*/ , Vo(t) ];\n\n case 2:\n return e.sent(), [ 2 /*return*/ ];\n }\n }));\n }));\n })), [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "48f17cbb9969542a11f0a76954f335de", "score": "0.46641687", "text": "function gogo(){\n\tvar app = new koa();\n\tvar soc;\n\tapp.on(\"error\", val => {\n\t\tconsole.log(val, \"APP 级别报错才会出现\");\n\t})\n\t//使用nginx调用静态文件;\n\t// app.use(koaStatic(path.resolve(__dirname,\"../build\")))\n\t// app.use(koaStatic('.'))\n\tapp.use(async (o, next) =>{\n\t\ttry{\n\t\t\tif(!o.io){\n\t\t\t\to.io = soc; //bind socket to koa request instances\t\n\t\t\t}\n\n\t\t\to.io.emit(\"m3\", \" ask you shale receive, bimmer m3 , yeah..\")\t\n\t\t\tconsole.log(1)\n\t\t\tawait next();\n\t\t\to.body.cok = koas.parseCookie(o.request.headers.cookie);\n\t\t\tconsole.log(8)\n\t\t}catch(err){\n\t\t\to.response.status = 500;\n\t\t\to.body = {\n\t\t\t\terrorCode: 0,\n\t\t\t\tmessage: err+\" >> \"+o.outfit+ \" >> \"+o.url\n\t\t\t};\n\t\t}\n\t})\n\n\tapp.use(koabody())\n\n\tapp.use(async (o,next) => {\n\t\t// throw new Error(\"去屎吧\")\n\t\t// o.throw(500, 'name required'); //也可以绕过第一个错误处理的方法;\n\t\tconsole.log(o.query,o.querystring, o.request.header,\" queryyyyyyyyyyyyyyy \")\n\t\to.skill = o.request.body.skill || \"sleep\";\n\t\tconsole.log(2)\n\t\tawait next();\n\t\tconsole.log(7)\n\t})\n\tapp.use(koatools.test())\n\tapp.use(router.routes()).use(router.allowedMethods())\n\trouter.get(\"/api/rr\", async (o, next) =>{\n\t\to.pos = 'ride';\n\t\to.isrr = true;\n\t\tawait next();\n\t})\n\trouter.get(\"/api/addCookies\", async (o, next) =>{\n\t\tlet date = new Date();\n\t\tdate.setUTCFullYear(2018)\n\t\tlet list = koas.setCookie({\n\t\t\t// name:\"zhangmingzhi\",\n\t\t\t// age: 29,\n\t\t\t// sex: \"male\",\n\t\t\t// adds: \"chengdushiyanshi\",\n\t\t\t// isMarired: true,\n\t\t\tson: \"goudan\",\n\t\t\t// ['Max-Age']: 60,\n\t\t\t// ['Max-Age']: 360000,\n\t\t\texpires: date.toUTCString(),\n\t\t\tdomain: null,\n\t\t\tpath: \"/\"\n\t\t});\n\t\t// o.set(\"Set-Cookie\", list)\n\t\t// o.res.writeHead(200,[\n\t\t// \t['Set-Cookie', 'Expires='+date.toUTCString()],\n\t\t// \t['Set-Cookie', 'Domain=\"\"'],\n\t\t// \t['Set-Cookie', 'Son=goudan'],\n\t\t// \t['Set-Cookie', 'Path=/'],\n\t\t// \t['Set-Cookie', 'Max-Age=36000000'],\n\t\t// ])\n\t\t// o.response.set(\"Set-Cookie\", [\"aaa=bbb\",\"ccc=ddd\",\"eee=fff\", \"maxAge=60\", 'domain=\"\"', \"expires=\"+date.toUTCString()])\n\t\t\n\t\tawait next();\n\t})\n\trouter.get(\"/api/removeCookies\", async (o, next) =>{\n\t\tlet date = new Date();\n\t\tdate.setUTCFullYear(1111);\n\t\to.response.set(\"Set-Cookie\", koas.setCookie({\n\t\t\tExpires: date.toUTCString(),\n\t\t\t['Max-Age']: -1\n\t\t}))\n\t\tawait next();\n\t})\n\trouter.post(\"/api/hello\", async (o, next) =>{\n\t\to.body = \"hello from zmz\";\n\t\tconsole.log(3)\n\t\tawait next();\n\t\tconsole.log(6);\n\t})\n\trouter.get(\"/api/\",koabody, async (o, next) =>{\n\t\to.pos = 'ride';\n\t\to.isrr = true;\n\t\tawait next();\n\t\t\n\t})\n\t// router.get(\"/api/getCollections\",mongoApi.querys())\n\t// router.post(\"/api/addCar\",mongoApi.addCar())\n\t// router.post(\"/api/queryMycar\",mongoApi.queryMycar())\n\t// router.post(\"/api/deleteCar\",mongoApi.deleteCar())\n\trouter.get(\"/api/download\",koas.download())\n\trouter.post(\"/api/getPhoto\",koas.getPhoto())\n\trouter.post(\"/api/initPhotos\",koas.initPhotos())\n\trouter.post(\"/api/sendEmail\",koas.sendEmail())\n\trouter.post(\"/api/upload\", upload.single(\"hehe\"), koas.upload())\n\trouter.post(\"/api/trax\", upload.single(\"hehe\"), koas.trax())\n\trouter.post(\"/api/autohomepacong\", koas.autohome())\n\tapp.use( async (o, next) =>{\n\t\tif(o.isrr){\n\t\t\to.outfit = \"nothing\"\t\n\t\t}else{\n\t\t\to.outfit = 'black lace'\n\t\t}\n\t\to.body = {name: ` ^^kendra lust wear ${o.outfit} and suck it down >>> ${o.pos} style`}\n\t\to.io.emit(\"windowa\", \"kendra lust\");\n\t\tconsole.log(4)\n\t\tawait next();\n\t\tconsole.log(5);\n\t})\n\tvar server = app.listen(0);\n\tvar io = socketIO(server);\n\tprocess.on(\"message\", (msg, handler) => {\n\t\tif(msg !== \"sticky-session\"){\n\t\t\tconsole.log(\"koa.js, cluster socket.io need font-facing server response first!!!\")\n\t\t\treturn;\n\t\t}\n\t\tserver.emit(\"connection\", handler);\n\t\thandler.resume();\n\t})\n\tio.on(\"connection\", socket => {\n\t\tsocket.on(\"setSoc\", msg => {\n\t\t\tif(!soc){\n\t\t\t\tsoc = socket;\t\t\t\t\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "38496dc0f6298cbf1f71c534161f515c", "score": "0.4661003", "text": "async run() {\n }", "title": "" }, { "docid": "3d5dc3d3e04f06ae4f7b5511e5fcbcac", "score": "0.46524066", "text": "function GetProto() {\r\n return `\r\n // See README.txt for information and build instructions.\r\n\r\n package CanOpenBridge;\r\n\r\n //option java_package = \"com.burkert.cop\";\r\n //option java_outer_classname = \"CanOpenBridge\";\r\n\r\n // put an optional field here for every new classtype\r\n message MessageWrapper {\r\n optional SDO SDO = 1;\r\n optional PDO PDO = 2;\r\n optional Event Event = 3;\r\n optional AddNode AddNode = 4;\r\n optional RemoveNode RemoveNode = 5;\r\n optional Commands Commands = 6;\r\n optional SYNC SYNC = 7;\r\n optional SdoProgress SdoProgress = 8;\r\n optional Request Request = 9;\r\n optional RequestProgress RequestProgress = 10;\r\n optional RawData RawData = 11;\r\n optional CanMeasure CanMeasure = 12;\r\n }\r\n\r\n message SDO {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n enum Control {\r\n READ = 0;\r\n WRITE = 1;\r\n\t RESPONSE = 2;\r\n\t ABORT = 3;\r\n\t READ_BLOCK = 4;\r\n\t WRITE_BLOCK = 5;\r\n }\r\n required Control control = 4;\r\n optional bytes data = 5;\r\n optional int32 totalBlockLen = 6;\r\n optional uint64 timestamp = 7;\r\n }\r\n\r\n message PDO {\r\n required int32 nodeId = 6;\r\n required int32 pdoNumber = 7;\r\n required bytes data = 8;\r\n required uint64 timestamp = 9;\r\n }\r\n\r\n message Event {\r\n required int32 nodeId = 10;\r\n required bytes data = 11;\r\n required uint64 timestamp = 12;\r\n enum EventType {\r\n EMERGENCY = 0;\r\n BDO = 1;\t\r\n SERVERINFO = 2;\r\n\t SERVERERROR = 3;\r\n\t NMT = 4;\r\n }\r\n required EventType eventType = 16;\r\n }\r\n\r\n message AddNode {\r\n required int32 nodeId = 13;\r\n optional int32 deviceStatus = 14;\r\n }\r\n\r\n message RemoveNode {\r\n required int32 nodeId = 14;\r\n }\r\n\r\n message Commands {\r\n enum Command {\r\n SHUTDOWN = 0;\r\n RESTART_SOCKET = 1;\r\n }\r\n required Command command = 15;\r\n }\r\n\r\n message SYNC {\r\n required uint32 flags = 17;\r\n }\r\n\r\n message SdoProgress {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n required int32 value = 4;\r\n }\r\n\r\n message Request {\r\n\t enum RequestType {\r\n\t\t Complete = 0;\r\n\t\t SearchCANopenDevices = 1;\r\n\t\t GetLSS_Slave = 2;\r\n\t\t CnfLSS_Slave = 3;\r\n\t\t CanRawData = 4;\r\n\t\t CanMeasure = 5;\r\n\t }\r\n\t required RequestType requestType = 1;\r\n\t optional int32 nodeID = 2;\r\n\t optional int32 baudrate = 3;\r\n\t optional int32 result = 4;\r\n\t optional int32 vendorID = 5;\r\n\t optional int32 productCode = 6;\r\n\t optional int32 revisionNumber = 7;\r\n\t optional int32 serialNumber = 8;\r\n\t optional int32 rawDataActive = 9;\r\n\t optional int32 canMeasureActive = 10;\r\n }\r\n\r\n message RequestProgress {\r\n\t required int32 value = 1;\r\n }\r\n message RawData {\r\n required uint32 cobId = 1;\r\n required bytes data = 2;\r\n required uint64 timeStamp = 3;\r\n required bool direction = 4; \r\n }\r\n\r\n message CanMeasure{\r\n required int32 errorFlags = 1;\r\n required int32 canHRise = 2;\r\n required int32 canHFall = 3;\r\n required int32 canLRise = 4;\r\n required int32 canLFall = 5;\r\n }\r\n\t\t`;\r\n}", "title": "" }, { "docid": "3851bc35b2cb99d240553f3088eaa830", "score": "0.46519965", "text": "obtain(){}", "title": "" }, { "docid": "b391d5124758008726468f95affd0993", "score": "0.46518043", "text": "function getAgentEmbed(agentData,message){\n\n //load cdn from client\n let cdn = message.client.cdn;\n\n //make new embed (bot base embed)\n let embed = message.client.baseEmbed(message);\n\n //get emojis data-pack\n let emojis = message.client.customEmojis;\n\n //excute things from the given data\n let {\n inGameName, origin,\n biography, role,\n abilities\n } = agentData;\n\n //get agent images\n let images = cdn['agents']['byName'][inGameName.toLowerCase()];\n\n //set embed title\n embed.setTitle(`${inGameName} - ${getRole(role,emojis)}`);\n\n //create new variable (description)\n let des = \"\";\n\n //add country to the description\n des += `**Country:**\\n${getCountry(origin,emojis)}\\n\\n`;\n\n //create a new variable (later: put processed abilities string in)\n let abStr = \"\";//ab = abilities; str = string;\n\n //process the abilities\n //loop on them one-by-one\n for(let [key,value] of Object.entries(abilities)){\n\n //create a variable to put ability type in (if exist)\n let type = \"\";\n\n //check ability hotkey\n switch(key){\n case \"E\": type = \"Signature\";break;\n case \"X\": type = \"Ultimate\";break;\n case \"X2\": type = \"Ultimate\";break;\n };\n\n //add ability data to \"abStr\" variable\n abStr += `\\n**${key/*hotkey*/}** - ${value/*ability name*/}${type ? ` - **${type}**` : ''/*ability type(if exist)*/}`;\n };\n\n //add abilities to des\n des += `**Abilities:**${abStr}\\n`;\n\n //add biography to des\n des += `\\n**Biography:**\\n${biography}`;\n\n //set Embed description\n embed.setDescription(des);\n\n //set embed Thumbnail (in game icon)\n embed.setThumbnail(images.inGameIcon)\n\n //set embed image (art work)\n embed.setImage(images.artwork)\n\n //return the embed\n return embed;\n }", "title": "" }, { "docid": "f5e7e1029260e3976060a7e442bfdf70", "score": "0.464949", "text": "function nu(t, e, n) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var r, i, o, s, u, a, c, h, f, l;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(d) {\n switch (d.label) {\n case 0:\n if (!(r = ru(t)).Oo) return [ 3 /*break*/ , 10 ];\n i = 0, o = e, d.label = 1;\n\n case 1:\n return i < o.length ? (s = o[i], r.Vo.has(s) ? (\n // A target might have been added in a previous attempt\n D(\"SyncEngine\", \"Adding an already active target \" + s), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , zi(r.localStore, s) ]) : [ 3 /*break*/ , 6 ];\n\n case 2:\n return u = d.sent(), [ 4 /*yield*/ , Ki(r.localStore, u) ];\n\n case 3:\n return a = d.sent(), [ 4 /*yield*/ , ks(r, Zs(u), a.targetId, \n /*current=*/ !1) ];\n\n case 4:\n d.sent(), Mo(r.remoteStore, a), d.label = 5;\n\n case 5:\n return i++, [ 3 /*break*/ , 1 ];\n\n case 6:\n c = function(t) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(e) {\n switch (e.label) {\n case 0:\n return r.Vo.has(t) ? [ 4 /*yield*/ , Gi(r.localStore, t, \n /* keepPersistedTargetData */ !1).then((function() {\n Fo(r.remoteStore, t), Us(r, t);\n })).catch(hi) ] : [ 3 /*break*/ , 2 ];\n\n // Release queries that are still active.\n case 1:\n // Release queries that are still active.\n e.sent(), e.label = 2;\n\n case 2:\n return [ 2 /*return*/ ];\n }\n }));\n }, h = 0, f = n, d.label = 7;\n\n case 7:\n return h < f.length ? (l = f[h], [ 5 /*yield**/ , c(l) ]) : [ 3 /*break*/ , 10 ];\n\n case 8:\n d.sent(), d.label = 9;\n\n case 9:\n return h++, [ 3 /*break*/ , 7 ];\n\n case 10:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "81461dd979fa1c4878ecf23493a7d550", "score": "0.4649015", "text": "react (message)\n {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "9d22134b27cc1451b80e6be5289dbafa", "score": "0.46484682", "text": "function o0(e = 'default argument') {\n try { {\n var o3 = () => { try {\n'use strict';\n}catch(e){} }\n\n try {\no18(o3, \"Strict-mode lambda\");\n}catch(e){}\n } } catch(e) {}try { try {\nPromise.call(promise, undefined);\n}catch(e){} } catch(e) {}\n}", "title": "" }, { "docid": "ba7fb677af951885c548940181af2ce5", "score": "0.46477947", "text": "function Xi(t, e) {\n // Use two different prefix formats:\n // * firestore / persistenceKey / projectID . databaseID / ...\n // * firestore / persistenceKey / projectID / ...\n // projectIDs are DNS-compatible names and cannot contain dots\n // so there's no danger of collisions.\n var n = t.projectId;\n return t.o || (n += \".\" + t.database), \"firestore/\" + e + \"/\" + n + \"/\"\n /**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */;\n}", "title": "" }, { "docid": "0869e81d5edc04d2a0e638580bf116a6", "score": "0.46473828", "text": "function Belt_Send(channel,info) {\n if (info === undefined) channel.send('Нет данных из источника.. [undefined] :confused:');\n else {\n const embed = new Discord.RichEmbed();\n //if (info.show_who !== false) embed.setAuthor(me + ' запрашивает..', avatar);\n if (info.author_name !== undefined && info.author_name !== null) embed.setAuthor(info.author_name, info.author_avatar);\n if (info.title !== undefined && info.title !== null) embed.setTitle(info.title);\n if (info.color !== undefined) embed.setColor(info.color);\n if (info.description !== undefined) embed.setDescription(info.description);\n if (info.footer !== undefined) embed.setFooter(info.footer, info.footer_icon);\n if (info.image !== undefined) embed.setImage(info.image); //- ФОТКА НА ПОЛЭКРАНА!!!\n if (info.thumbnail !== undefined) embed.setThumbnail(info.thumbnail);\n if (info.timestamp !== undefined) embed.setTimestamp();\n if (info.url !== undefined) embed.setURL(info.url);\n\n // -------- СОЗДАТЬ СЕТКУ ЗНАЧЕНИЙ -------\n var fields = info.fields;\n if (isArray(fields)) fields.forEach(function (field) {\n if (field['insertline'] !== false) embed.addBlankField(field['insertline_group']);\n embed.addField(field['title'], field['value'], field['group']);\n //console.log(field);\n });\n // ----------------------------------------\n //client.channels.get(info.guild_channel).send({embed});\n channel.send({embed});\n }\n}", "title": "" }, { "docid": "863dc176a2cc481f954052cde69e2f0b", "score": "0.46457732", "text": "function Note() \r\n{\r\n return (\r\n <div className=\"note\">\r\n <h1 className=\"h1\"> \r\n Hi I made this project during the 7 Days Free Bootcamp\r\n \r\n The instructor during the session was Mr. Shaurya Sinha (Data Analyst Intern at Jio). I got to\r\nlearn a lot during these 7 days and it was an amazing experience learning with SHAPEAI.\r\n</h1>\r\n </div> );\r\n}", "title": "" }, { "docid": "8957aa0249b69b4db860516e63b177f7", "score": "0.46435818", "text": "async function main(){\n try {\n // Connect to the MongoDB cluster\n await mClient.connect();\n console.log(\"connected to Mongo Server\");\n // Make the appropriate DB calls\n await listDatabases(mClient);\n //Do not close the client as we will be using it throughout the whole running of the bot\n\n } catch (e) {\n console.error(e);\n }\n\n\n async function listDatabases(mClient){\n /*\n Mongoclient.open();\n */\n databasesList = await mClient.db().admin().listDatabases();\n\n console.log(\"Databases:\");\n databasesList.databases.forEach(db => console.log(` - ${db.name}`));\n };\n\n client.on(\"message\", function(message){\n var day = \"none\";\n switch (new Date().getDay()) {\n case 0:\n day = \"Sunday\";\n break;\n case 1:\n day = \"Monday\";\n break;\n case 2:\n day = \"Tuesday\";\n break;\n case 3:\n day = \"Wednesday\";\n break;\n case 4:\n day = \"Thursday\";\n break;\n case 5:\n day = \"Friday\";\n break;\n case 6:\n day = \"Saturday\";\n }\n\n const guild = message.guild;\n if(message.author.bot) return; //Looks to see if the author of message is another bot, If it is dont go any further\n\n message.guild.channels.cache.forEach((val, inx) =>{ //checks number of channels to gauge if the server has been created or not, later on checks bool.\n i++;\n console.log(\"\" + i);\n })\n if (i>5){\n creationBool=true;\n console.log(\"im here in True\");\n i=0;\n }else {\n creationBool=false;\n console.log(\"im here in False\");\n i=0;\n }\n\n const messageAuthor = message.author.username;\n var switchArg=\"none\";\n console.log(messageAuthor);\n if (!message.content.startsWith(prefix)){\n const argument = message.content;\n const msg = argument.toLowerCase();\n contents = message.content.toLowerCase();\n\n if(new RegExp(dictionary.join(\"|\")).test(contents)){\n if (dictionary.length !=0){\n console.log(\"User: \" + messageAuthor + \" has indicated that there's an issue or possibly needs help\");\n wG = true;\n }\n }\n else{\n wG=false;\n }\n\n\t contents = message.content.toLowerCase(); //sets contents\n\t var dbChannel= message.channel.name; //sets channel name from message for later\n\n //Looks for message containing a topic the tutor is looking for (Topics[])\n\t topicLength = topics.length;\n\t while (topicLength >= -1){\n\t\t console.log(\"topiclength: \" +topicLength);\n\n\t\t if (contents.indexOf(topics[topicLength])!=-1){\n\t\t\t foundTopic = true;\n\t\t\t console.log(\"I'm in the while loop iteration: \" + topicLength);\n\t\t\t console.log(\"topic found \" + topics[topicLength]);\n\t\t\t dbTopic = topics[topicLength];\n\t\t\t break;\n\t\t }else if (topicLength == -1){\n\t\t\t console.log(\"inside of the else, Topic length -1\"); //Debug comment, If here then topic was not found in message, break from loop\n\t\t\t dbTopic = \"none\";\n\t\t\t foundTopic = false;\n\t\t\t break;\n\t\t }\n\t\t topicLength = topicLength - 1;\n\t }\n //If we found a topic or we've regexed a word from our dictionary go here to log to DB\n if (foundTopic || wG){\n const db = mClient.db(dbName);\n const col = db.collection(\"discordBot\");\n console.log(\"in writeDB\"); //debug comment to show in console that bot is writing into the DB\n\n\n \t\tlet userMessage = {\n \t\t\t\"username\": messageAuthor,\n \t\t\t\"message\": msg,\n \t\t\t\"issue\": wG,\n \t\t\t\"topic\": dbTopic,\n \t\t\t\"channel\": dbChannel,\n \"day\": day\n \t\t }\n\n\n const p = col.insertOne(userMessage);\n console.log(userMessage);\n wG = null;\n }\n\n }\n\n //ELSE GO TO COMMANDS (!commands)\n else {\n const commandBody = message.content.slice(prefix.length);\n const args = commandBody.split(' '); //splits up the string to find command/etc\n const command = args.shift().toLowerCase(); //moves everything to lower case\n\n if (message.channel.name != \"bot-commands\"){\n\n //Command for building the server, adding channels under headings etc\n if (command === \"buildserver\"){\n //Creates the channels if not all are made etc, Counts channels\n if (!creationBool){\n //creates and gives admin role for later use\n guild.roles.create({\n data: {\n name: 'Administrator',\n color: 'BLUE',\n },\n reason: 'Creating role for admin',\n })\n .then(console.log)\n .catch(console.error);\n\n //gives user the role for later use, only want admin/server owner to be able to add topics\n let role = message.guild.roles.cache.find(role => role.name ===\"Administrator\");\n let member = message.member;\n member.roles.add(\"\" + role).catch(console.error);\n\n //for each channel finds the ID for voice channels heading and text channels heading\n message.guild.channels.cache.forEach((val, inx) =>{\n const channelName = val.name;\n\n if (channelName === \"Voice Channels\"){\n voiceChannel = inx;\n console.log(\"\\nLogged voice channel \" +voiceChannel + \"\\n\");\n } else if (channelName === \"Text Channels\"){\n textChannel = inx;\n console.log(\"\\nLogged Text Channels \" +textChannel + \"\\n\");\n }\n })\n\n guild.channels.create(\"Welcome\", { parent: textChannel, type: \"text\", permissionOverwrites:[{id:\"\" + guild, deny: ['SEND_MESSAGES']}], reason: \"logging new channel\"})\n .then(channel => channel.send(\"Hi there, This area is to give a short description of how this bot works and how the channels below work.\\n Be sure to talk about all homework issues in the homework help channel, This bot will check every channel but it specifically uses the homework help channel to compile help or giving help requests\"))\n guild.channels.create(\"General Chat\", { parent: textChannel, type: \"text\", reason: \"logging new channel\"})\n guild.channels.create(\"Homework Help\", { parent: textChannel, type: \"text\", reason: \"logging new channel\"})\n guild.channels.create(\"Off-Topic\", { parent: textChannel, type: \"text\", reason: \"logging new channel\"})\n guild.channels.create(\"Bot Commands\", { parent: textChannel, type: \"text\", reason: \"logging new channel\"})\n guild.channels.create(\"Homework Chat (voice)\", { parent: voiceChannel, type: \"voice\", reason: \"logging new channel\"})\n guild.channels.create(\"One-To-One\", { parent: voiceChannel, type: \"voice\", reason: \"logging new channel\"})\n .then(console.log)\n .catch(console.error);\n\n message.reply(\"completed channel creation\");\n message.channel.delete();\n creationBool = true;\n } else if (creationBool) {\n message.reply(\"already created channels here, Or you have set the channel up already\\nIf you'd like to have the bot make them automatically please delete all channels and use !buildserver\");\n } else{\n message.reply(\"uhoh\");\n }\n } else{\n message.reply(\"You've sent your command outside of the bot-commands channel. The only command you can use outside of that is !buildserver\\n **please use that if you have just added the bot to an empty server, then you can use !help for commands**\");\n }\n }else{\n \t if (command === \"commands\" || command === \"help\"){\n \t\t message.reply(\"Hi there, Thanks for using the student dashboard collection bot\\n**The commands to use this bot are as follows.**\\n**!history** : This command will show all messages gotten locally (Debug)\\n**!database** : this command will look for all documents in the database and return them here (Debug)\\n**!buildserver** : If you're new you should use this, This will allow the bot to build up your server. The bot will work without but it will work better with its own hierarchy. Please delete all but one channel before using this command\\n**!topics** : This command will allow you to enter custom topics for the bot to find and use in its collection and sending to the DB\\n**!purge** : this command will allow you to remove ALL entries from the database to start again\");\n \t }\n\n else if (command === \"history\"){\n if (goodMsg != 0 && badMsg != 0){\n message.reply(\"messages that need help:\");\n message.channel.send(goodMsg.map((message) => `${message}\\n`)); //returns all in array\n message.channel.send(\"And here's the people that give help:\\n\")\n message.channel.send(badMsg.map((message) => `${message}\\n`)); //returns all in array\n }else{\n message.channel.send(\"The internal volatile array is empty.\");\n }\n }\n\n else if (command === \"database\"){\n const db = mClient.db(dbName);\n const col = db.collection(\"discordBot\");\n try{\n retrieveM().then;\n console.log(\"Opening Retrieve \");\n async function retrieveM(mClient){\n console.log(\"in Retrieve////\");\n const cursor = col.find();\n //.batchSize(NUMBER_OF_DOCUMENTS_IN_BATCH);\n const findResult = await col.find({\n //name: \"Jabbafeet\",\n });\n\n await cursor.forEach(console.dir);\n var docNumber = await db.collection('discordBot').find().count();\n\n //If there's no documents, notify user and return.\n if(docNumber === 0){\n message.channel.send(\"Database is empty\");\n return;\n }\n //Finds each document and sends it back out to the user in Discord. Count's the documents with Console.log to show if it should be in there on console\n cursor.forEach( function(myDoc)\n {\n i++;\n console.log(\" I shouldn't be here if DB empty. Document: \" +i);\n message.channel.send( \"User: \" + myDoc.username + \" \\nMessage: \" + myDoc.message );\n })\n }\n }catch(e){\n console.error(e);\n }\n i=0;\n }\n\n // Built in bot command to remove all documents in DB/Col\n else if (command === \"purge\"){\n const db = mClient.db(dbName);\n message.reply(\"Are you Sure? (Yes/No)\");\n const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id, { time: 10000 });\n console.log(collector)\n collector.on('collect', message => {\n if (message.content.toUpperCase() == \"YES\") {\n try{\n db.collection('discordBot').deleteMany({});\n }catch(e){\n console.error(e);\n }\n message.reply(\"Completed, All documents in Database have been removed\");\n collector.stop();\n return;\n } else if (message.content.toUpperCase() == \"NO\") {\n message.channel.send(\"Have not removed anything in Database\");\n collector.stop();\n return;\n }\n })\n collector.on('end', (collected,reason) =>{\n console.log(\"\" + reason);\n if (reason == \"time\"){\n message.reply(\"this request has timed out\");\n }\n\n })\n //const col= db.collection(\"discordBot\");\n }\n else if (command === \"topics\"){ //If command = topics allow admin/tutor to listt the topics they'd like to use\n if (message.member.roles.cache.find(r=>r.name===\"Administrator\")){\n message.reply(\"Collecting your topics now. Please type them and send one by one\\n please note that if you use two words like For Loops, it looks for For Loops and not for and loop\\n type end to stop.\");\n const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id, { time: 90000 });\n console.log(collector)\n collector.on('collect', message =>{\n if (message.content.toUpperCase() != \"END\"){\n \t\t\t\t if(new RegExp(topics.join(\"|\")).test(contents)){ //if RegExp finds that messages match whats in topics, will not let user put a duplicate in\n \t\t\t\t\t if (topics.length !=0){\n \t\t\t\t\t\tmessage.reply(\"This topic was already collected, please send another or end to finish.\");\n \t\t\t\t\t }\n \t\t\t\t\t else {\n \t\t\t\t\t\t message.reply(\"collected \" +message.content);\n \t\t\t\t\t\t const argument = message.content;\n \t\t\t\t\t\t const msg = argument.toLowerCase();\n \t\t\t\t\t\t topics.push(msg);\n \t\t\t\t\t}\n \t\t\t\t } else {\n \t\t\t\t\t message.reply(\"collected \" +message.content);\n \t\t\t\t\t const argument = message.content;\n \t\t\t\t\t const msg = argument.toLowerCase();\n \t\t\t\t\t topics.push(msg);\n \t\t\t\t }\n }\n else{\n message.channel.send(\"Those topics are now noted and looked for.\\n When found this will be logged to the Database\");\n collector.stop();\n topics.forEach(element => console.log(element));\n }\n\n });\n } else{\n message.reply(\"You cannot use this command as you're not the tutor\");\n }\n }\n\n else{\n message.reply(\"your command was not correct\");\n }\n }\n }\n });\n}", "title": "" } ]
873ba8b1ad9ac104ed2d19833e15a5c1
actual modulo handles negative numbers (for dates before 1970):
[ { "docid": "9c36c71b8ef53c1ab1f391b23531c238", "score": "0.0", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" } ]
[ { "docid": "7894a30340ac317a79fc849f3808057b", "score": "0.7070611", "text": "function realModulo (num, modulo) {\n return ((num % modulo) + modulo) % modulo\n}", "title": "" }, { "docid": "129a49b1564ce993038db90615efc1de", "score": "0.6813153", "text": "function remainder(c,e){var b=c,a=e,d={result:\"NaN\",modulo:\"NaN\"};d.result=Math.floor(b/a).toString();d.modulo=(b%a).toString();return d}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "f72ad29be0a4b077c88abfda555b339c", "score": "0.6722426", "text": "function modulo(dividend, divisor)\n{\n var epsilon = divisor / 10000;\n var remainder = dividend % divisor;\n\n if (Math.abs(remainder - divisor) < epsilon || Math.abs(remainder) < epsilon) {\n remainder = 0;\n }\n\n return remainder;\n}", "title": "" }, { "docid": "ad06238a42904819f81163f622160592", "score": "0.6620504", "text": "function mod( a, b ){ let v = a % b; return ( v < 0 )? b+v : v; }", "title": "" }, { "docid": "32849440ea8931040d2b6afd2eafb4aa", "score": "0.6592936", "text": "function modulo(num1, num2) {\n return num1 - (Math.trunc(num1/num2) * num2);\n }", "title": "" }, { "docid": "144bcf5d0a9828790557fad8f2ac32ca", "score": "0.6551483", "text": "function modulo(x,y){\r\n if ( y=== 0){\r\n return \"NaN\";\r\n }\r\n else if (y===1){\r\n return 0;\r\n }\r\n else if (y> x){\r\n return x;\r\n }\r\n return modulo(x-y, y);\r\n}", "title": "" }, { "docid": "8675cfb15bdbfa6c7e93a2ac35b03fa5", "score": "0.64930606", "text": "function mod(a, b)\n{\n return a - (b * Math.floor(a / b));\n}", "title": "" }, { "docid": "c4ced7deffc746db5413d106a4769d9a", "score": "0.6484309", "text": "function mod(a, b)\n\t{\n\t return a - (b * Math.floor(a / b));\n\t}", "title": "" }, { "docid": "e0781cba381ce77cf53a447c6173249d", "score": "0.6446927", "text": "function modulo(a,b){\n\t\tvar r = a % b;\n\t\treturn r<0?b+r:r;\n\t}", "title": "" }, { "docid": "6ed7c6c526f208f1bbad4e37ad749930", "score": "0.6442077", "text": "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "title": "" }, { "docid": "6ed7c6c526f208f1bbad4e37ad749930", "score": "0.6442077", "text": "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "title": "" }, { "docid": "6ed7c6c526f208f1bbad4e37ad749930", "score": "0.6442077", "text": "function mod(a, b) {\n return a - (b * Math.floor(a / b));\n}", "title": "" }, { "docid": "221d8b9d03fa6327ec3839974606db8c", "score": "0.6416693", "text": "function modulo(a, b) {\n\t return ((a % b) + b) % b;\n\t }", "title": "" }, { "docid": "cd654214294c8667b8e03784bdbb7e17", "score": "0.64111274", "text": "function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}", "title": "" }, { "docid": "4ec90bca5435281c66a0488a8798539a", "score": "0.64088917", "text": "function mod(n, p)\n{\n if ( n < 0 )\n n = p - Math.abs(n) % p;\n\n return n % p;\n}", "title": "" }, { "docid": "04b5557afbf361af494dcd1783cfc3aa", "score": "0.6405374", "text": "function mod(a,b){return(((a % b) + b) % b)}", "title": "" }, { "docid": "1cadb7f18bafaf916a59dbef5bd8bb8a", "score": "0.640352", "text": "function modulo(num1, num2) {\n let answer = num1 / num2;\n let theNumber = NaN;\n if(num1 < 0 || num2 < 0) {\n theNumber = Math.round(answer);\n } else {\n theNumber = Math.floor(answer);\n }\n let thisHold = theNumber * num2;\n console.log(thisHold); //returns 24\n let remainder = num1 - thisHold; //25 - 24\n return remainder;\n}", "title": "" }, { "docid": "9e750a8c46fa89a37fe6227b86289e97", "score": "0.63914853", "text": "function remainder(a, b) {\n if (a === 0 || b === 0) {\n return NaN;\n }\n return a > b ? a % b : b % a;\n}", "title": "" }, { "docid": "eab9e6bb96a2e14b447e55d893b40b33", "score": "0.6387164", "text": "function Mod(X, Y) { return X - Math.floor(X/Y)*Y }", "title": "" }, { "docid": "2e2795290955014fe57fb795ad5d06d5", "score": "0.63848686", "text": "function modulo(num1, num2) {\n if(isNaN(num1) || isNaN(num2)){\n return NaN;\n }\n if(num1 === 0){\n return 0;\n }\n if(num2 === 0){\n return NaN;\n }\n \n let num1Result = Math.abs(num1); //returns 25\n let num2Result = Math.abs(num2); //returns 4\n // console.log(num1Result); returns 25\n // console.log(num2Result); returns 4\n let answer = num1Result - Math.floor(num1Result / num2Result) * num2Result;\n // console.log(answer); returns 1 -> 6 * 4 = 24 , 25 - 24 = 1\n if(num1 < 0) {\n return -(answer); //if negative itll return negative\n } else {\n return answer; //returns regular number\n }\n\n}", "title": "" }, { "docid": "90fccd9f36b224edc1fa2d7e035f3e00", "score": "0.6378425", "text": "function modulo(first, second) {\n return first % second;\n}", "title": "" }, { "docid": "42326db9d31afaf17bf7174859768ecd", "score": "0.6365343", "text": "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "title": "" }, { "docid": "aba291f2db24fae0f92ded3c4030fb6e", "score": "0.63609546", "text": "function sc_modulo(x, y) {\n\n\n\n\n \n var remainder = x % y;\n \n\n\n\n\n\n\n\n // if they don't have the same sign\n if ((remainder * y) < 0)\n\treturn remainder + y;\n else\n\treturn remainder;\n}", "title": "" }, { "docid": "958bfba2a23b04e87f5d2191c500f45c", "score": "0.6356128", "text": "function modulo(x,y){\n\tif(x === 0){\n\t\treturn 0;\n\t} else if(y > x){\n\t\treturn x;\n\t} else {\n\treturn modulo(x-y,y);\n\t}\n}", "title": "" }, { "docid": "5d6bc58739a8834843fafaddce2fb87a", "score": "0.6355669", "text": "function sc_modulo(x, y) {\n var remainder = x % y;\n // if they don't have the same sign\n if ((remainder * y) < 0)\n\treturn remainder + y;\n else\n\treturn remainder;\n}", "title": "" }, { "docid": "cc50ee58259ce3b1bd21ede0be07eee5", "score": "0.63526845", "text": "function modulo(a, b) {\n return a % b;\n}", "title": "" }, { "docid": "cbe5e04ff145fe83a50b16b94c012385", "score": "0.63128644", "text": "function remainder(a, b){\n if(a > b){\n return a % b;\n }\n if(b > a){\n return b % a;\n }\n if( a || b < 0){\n // negative check\n return 0;\n }\n}", "title": "" }, { "docid": "6d2452c2a7e27d0c9e01ea7e099d666b", "score": "0.6275978", "text": "mod(a) {\n\t\tvar r = this._newInstance();\n\t\tthis.abs().divRemTo(a, null, r);\n\t\tif (this.s < 0 && r.compareTo(this._newInstanceFromInt(0)) > 0) a.subTo(r, r);\n\t\treturn r;\n\t}", "title": "" }, { "docid": "0826d89beac630629e2f8340afcb0421", "score": "0.62586737", "text": "function remainder(a, b) {\n return a % b;\n }", "title": "" }, { "docid": "c149dc7cb704d5062aca48b620c277a0", "score": "0.625651", "text": "function remainder(a, b) {\n return a % b;\n}", "title": "" }, { "docid": "c1b5be8c5adc054002b1321a822bd4c8", "score": "0.62547845", "text": "function mod(x, y) {\n let r = x % y;\n return r < 0 ? y + r : r; \n}", "title": "" }, { "docid": "19fd9ed3fd81a42dd70ff6a2bea8fcb6", "score": "0.62541384", "text": "function modulo(num1, num2) {\n // your code here\n return num1 % num2;\n }", "title": "" }, { "docid": "8b1546201e6ae955fde9989a9d596e1f", "score": "0.62295014", "text": "function modulo(a, b) {\n return ((a % b) + b) % b;\n }", "title": "" }, { "docid": "e3775658d31d4478d7c6080893b6be67", "score": "0.6224464", "text": "function mod(m, val) {\n while (val < 0) {\n val += m;\n }\n return val % m;\n}", "title": "" }, { "docid": "c34421954ca0ee1c7de02443d53607be", "score": "0.6212402", "text": "function modr(x, y) {\n var tmp = x % y;\n if (tmp * y < 0) {\n tmp += y;\n }\n return tmp;\n}", "title": "" }, { "docid": "0d0c2b6d6022543ca2811283d222ef88", "score": "0.62013197", "text": "function remainder(x, y) {\n return x % y;\n}", "title": "" }, { "docid": "0d0c2b6d6022543ca2811283d222ef88", "score": "0.62013197", "text": "function remainder(x, y) {\n return x % y;\n}", "title": "" }, { "docid": "d6507b8260beabf1e120e887e0d07940", "score": "0.6190932", "text": "function Mod(num, div) { return div * ((num / div) - Mathf.Floor(num / div)); }", "title": "" }, { "docid": "f411321bc95c4648bc3e569348b38073", "score": "0.61898774", "text": "function modulo2(a, b)\n{\n\treturn a-b * Math.floor(a/b);\n}", "title": "" }, { "docid": "c7bc7387c704c19fe93316ac694b4e1b", "score": "0.6169109", "text": "function modulo(a, n){\r\n if(a >= 0){\r\n return a%n;\r\n }else{\r\n return (a%n) + n;\r\n }\r\n}", "title": "" }, { "docid": "a21b4ea9bda7d25f4c01f6ee40b30211", "score": "0.61639553", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "cbf1a977d96cc221788441af53e7c676", "score": "0.61615455", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor\n }", "title": "" }, { "docid": "de460ec9245ab567de1820b2a1f6ea25", "score": "0.61577207", "text": "function modulo(num1, num2) {\n // your code here\n let q = parseInt(num1 / num2);\n let p = q * num2;\n return num1 - p;\n}", "title": "" }, { "docid": "3ea7a464289e2ee59809375696904794", "score": "0.6154328", "text": "function mod$1(dividend, divisor) {\r\n return ((dividend % divisor) + divisor) % divisor\r\n }", "title": "" }, { "docid": "7e3b9b0b1c52fb79d97875dff115f5df", "score": "0.6151433", "text": "function modulo(x, y) {\n return ((x % y) + y) % y;\n}", "title": "" }, { "docid": "49fdb92a0c35cd27bcd5cacd97dc12ad", "score": "0.6145134", "text": "function modulo(num1, num2) {\n // your code here\n i = parseInt(num1 / num2);\n console.log(i); //returns 6\n j = i * num2;\n console.log(j); //returns 24 (6 * 4)\n return num1 - j; // 25 - 24 = 1\n }", "title": "" }, { "docid": "37cb9413994dbd9b65b38ccaa256c45d", "score": "0.61398065", "text": "function mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n}", "title": "" }, { "docid": "2bdfd52df2a2993869001c3fcf633ab4", "score": "0.6136158", "text": "function modulo(a , b){\n return (remainder(a , b));\n}", "title": "" }, { "docid": "89ebb2c576551256aea6f74bb8edc233", "score": "0.613354", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "601676a7982b03c574fefb908aaa7f1b", "score": "0.6121446", "text": "function sc_remainder(x, y) {\n return x % y;\n}", "title": "" }, { "docid": "3b05d5c3aaba3d4fe1556678c42855ab", "score": "0.6118286", "text": "function mod(d, n) {\n var value = n % d;\n return value < 0 ? value + d : value;\n}", "title": "" }, { "docid": "405a1b2103bc50f9f2c51176e63bfa8b", "score": "0.6118125", "text": "function mod(a, n) {\n return a - floor(a / n) * n;\n}", "title": "" }, { "docid": "a0ab265880e7cacdbe2228d6ac2cd77d", "score": "0.6118011", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "10e3d67d3ea370b025a30c9b4356a673", "score": "0.61079985", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "aa72bd8303e6da0aaba5aff160d5c117", "score": "0.61057043", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "6ee1bb37cb6a8c468ced09b4f4fc16dc", "score": "0.6102226", "text": "function mod(x, m) { return (x % m + m) % m }", "title": "" }, { "docid": "2d96d2a0c3de64ceb8f1a67dfb8b29c6", "score": "0.6101837", "text": "function remainder(a, b) {\n // Divide the larger argument by the smaller argument and return the remainder\n if (a > b) {\n return a % b;\n } else if (b > a) {\n return b % a;\n } else if (a == 0 || b == 0) {\n return NaN;\n } else if (a < 0) {\n return (a = 0);\n }\n}", "title": "" }, { "docid": "c1ff037c6f921947afead342a4ae1557", "score": "0.6087709", "text": "function mod$1(dividend, divisor) {\n\t return (dividend % divisor + divisor) % divisor;\n\t }", "title": "" }, { "docid": "5de98146e85caef1d84a00364ab0c2bc", "score": "0.6087417", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "9629e06416719297a36ca135acc6fedc", "score": "0.6087178", "text": "function modulo10(a) {\n\treturn a % 10 ;\n}", "title": "" }, { "docid": "bfb93db55125da425eb3531d8d32bd9b", "score": "0.6081617", "text": "function mod(x, y) {\n return ((x % y) + y) % y;\n }", "title": "" }, { "docid": "147949d9afd76f458684a4fa184c9d29", "score": "0.6079306", "text": "function remainder(a , b){\n return a % b;\n}", "title": "" }, { "docid": "ae45dfabe210f3266c4a1c9fc6d37427", "score": "0.607094", "text": "function mod(n, mod) {\n return ((n % mod) + mod) % mod;\n}", "title": "" }, { "docid": "c4e0b0fad5e12e16a5df174a7f343432", "score": "0.6070056", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n}", "title": "" }, { "docid": "6e9f75454055ab19be8d211f8f21d664", "score": "0.60665315", "text": "function Modulus(num1, num2) {\n\treturn num1 % num2;\n}", "title": "" }, { "docid": "359e4d605d4344ee8316d931d5308aa9", "score": "0.6065071", "text": "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "title": "" }, { "docid": "359e4d605d4344ee8316d931d5308aa9", "score": "0.6065071", "text": "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "title": "" }, { "docid": "37283b66b85fddafc9ddfb3e0d04aa6e", "score": "0.6062478", "text": "function calculateRemainder (num, denom) {\n return Math.abs(num % denom);\n}", "title": "" }, { "docid": "8aef502c717826132a000ecc27d6e870", "score": "0.6037429", "text": "function bnMod(a){\nvar r=nbi();\nthis.abs().divRemTo(a,null,r);\nif(this.s<0&&r.compareTo(BigInteger.ZERO)>0)a.subTo(r,r);\nreturn r;\n}", "title": "" }, { "docid": "d524e1dce038808c82d4f60c6101fec0", "score": "0.6036311", "text": "function sc_remainder(x, y) {\n\n\n\n\n\n var res = x % y;\n \n\n\n\n\n\n\n\n\n return res;\n}", "title": "" }, { "docid": "0c2fd9c5a75a400ade0809d5cb93ba2b", "score": "0.602075", "text": "function amod(a, b) {\n return mod(a - 1, b) + 1;\n}", "title": "" }, { "docid": "cb9b618322c99271d86671db63b4e360", "score": "0.60149425", "text": "function mod_(x, y) {\n if (y === 0) {\n throw division_by_zero;\n } else {\n return x % y;\n }\n}", "title": "" }, { "docid": "d7d293fbcfe4b249b67a5cd2ce19a598", "score": "0.6014854", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "75083d4227ed5df745fabddaa7be5aaa", "score": "0.60128164", "text": "function modulo(number, divider) {\n return number % divider;\n}", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.60122365", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.60122365", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.60122365", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.60122365", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "08377c9628ac255d6fc88b8557c934b0", "score": "0.6011501", "text": "function remainder(number, divisor) {\n return number % divisor;\n}", "title": "" }, { "docid": "08377c9628ac255d6fc88b8557c934b0", "score": "0.6011501", "text": "function remainder(number, divisor) {\n return number % divisor;\n}", "title": "" }, { "docid": "820103de4862b506ad17ad902c9b673d", "score": "0.6000257", "text": "remainder(a, b) {\n return a % b;\n }", "title": "" }, { "docid": "47b3b6370c6272333d05aea663621f7b", "score": "0.59935385", "text": "function mod(a, b) {\n return ((a % b) + b) % b;\n}", "title": "" }, { "docid": "fc0854b7e84966aeb492999a32427e9f", "score": "0.5991986", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "593590ad64bedc90068813c18f31dcbd", "score": "0.597835", "text": "function mod(n, m) {\r\n var remain = n % m\r\n return Math.floor(remain >= 0 ? remain : remain + m)\r\n }", "title": "" }, { "docid": "f609977b074750e5910017c36d8cd9d2", "score": "0.59625477", "text": "function mod(a, n) {\n return ((a % n) + n) % n;\n }", "title": "" }, { "docid": "a5557b80ba689f07facb4419b3e7ff35", "score": "0.5954725", "text": "function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}", "title": "" }, { "docid": "a5557b80ba689f07facb4419b3e7ff35", "score": "0.5954725", "text": "function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}", "title": "" }, { "docid": "a5557b80ba689f07facb4419b3e7ff35", "score": "0.5954725", "text": "function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}", "title": "" }, { "docid": "a5557b80ba689f07facb4419b3e7ff35", "score": "0.5954725", "text": "function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}", "title": "" }, { "docid": "a5557b80ba689f07facb4419b3e7ff35", "score": "0.5954725", "text": "function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}", "title": "" }, { "docid": "7f502bcaec5c5e9a96390ae589c83035", "score": "0.59474856", "text": "function mod(n, m) {\r\n\t\tvar reste = n % m;\r\n\t\treturn Math.floor(reste >= 0 ? reste : reste + m);\r\n\t}", "title": "" } ]
2aafaa5ae2b633ae517fd695a035ec46
Helper function that maps ArrayBufferViews to ArrayBuffers Used by BlobBuilder constructor and old browsers that didn't support it in the Blob constructor.
[ { "docid": "7f722978486edf001850352d289b1ee4", "score": "0.6767694", "text": "function mapArrayBufferViews(ary) {\n\t for (var i = 0; i < ary.length; i++) {\n\t var chunk = ary[i];\n\t if (chunk.buffer instanceof ArrayBuffer) {\n\t var buf = chunk.buffer;\n\n\t // if this is a subarray, make a copy so we only\n\t // include the subarray region from the underlying buffer\n\t if (chunk.byteLength !== buf.byteLength) {\n\t var copy = new Uint8Array(chunk.byteLength);\n\t copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t buf = copy.buffer;\n\t }\n\n\t ary[i] = buf;\n\t }\n\t }\n\t}", "title": "" } ]
[ { "docid": "b7d499699972a48359131ff5e16d0387", "score": "0.6972978", "text": "function mapArrayBufferViews(ary){for(var i=0;i<ary.length;i++){var chunk=ary[i];if(chunk.buffer instanceof ArrayBuffer){var buf=chunk.buffer;// if this is a subarray, make a copy so we only\n// include the subarray region from the underlying buffer\nif(chunk.byteLength!==buf.byteLength){var copy=new Uint8Array(chunk.byteLength);copy.set(new Uint8Array(buf,chunk.byteOffset,chunk.byteLength));buf=copy.buffer;}ary[i]=buf;}}}", "title": "" }, { "docid": "20ca015647428c4b368ea9ff2c804b23", "score": "0.6967368", "text": "function mapArrayBufferViews(ary){for(var i=0;i<ary.length;i++){var chunk=ary[i];if(chunk.buffer instanceof ArrayBuffer){var buf=chunk.buffer;// if this is a subarray, make a copy so we only\n\t// include the subarray region from the underlying buffer\n\tif(chunk.byteLength!==buf.byteLength){var copy=new Uint8Array(chunk.byteLength);copy.set(new Uint8Array(buf,chunk.byteOffset,chunk.byteLength));buf=copy.buffer;}ary[i]=buf;}}}", "title": "" }, { "docid": "bc7ae48db451a1aab1f62736674597ba", "score": "0.67960405", "text": "function mapArrayBufferViews(ary) {\r\n\t return ary.map(function(chunk) {\r\n\t if (chunk.buffer instanceof ArrayBuffer) {\r\n\t var buf = chunk.buffer;\r\n\r\n\t // if this is a subarray, make a copy so we only\r\n\t // include the subarray region from the underlying buffer\r\n\t if (chunk.byteLength !== buf.byteLength) {\r\n\t var copy = new Uint8Array(chunk.byteLength);\r\n\t copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n\t buf = copy.buffer;\r\n\t }\r\n\r\n\t return buf;\r\n\t }\r\n\r\n\t return chunk;\r\n\t });\r\n\t}", "title": "" }, { "docid": "a9a5604cb7be35f6b8b4b1ae0cf616c6", "score": "0.67786485", "text": "function mapArrayBufferViews(ary) {\n\t\t\t\t\t\tfor (var i = 0; i < ary.length; i++) {\n\t\t\t\t\t\t\tvar chunk = ary[i];\n\t\t\t\t\t\t\tif (chunk.buffer instanceof ArrayBuffer) {\n\t\t\t\t\t\t\t\tvar buf = chunk.buffer;\n\n\t\t\t\t\t\t\t\t// if this is a subarray, make a copy so we only\n\t\t\t\t\t\t\t\t// include the subarray region from the underlying buffer\n\t\t\t\t\t\t\t\tif (chunk.byteLength !== buf.byteLength) {\n\t\t\t\t\t\t\t\t\tvar copy = new Uint8Array(chunk.byteLength);\n\t\t\t\t\t\t\t\t\tcopy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t\t\t\t\t\t\t\t\tbuf = copy.buffer;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tary[i] = buf;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "576b0e25c7b928eb3ae43bbb13eddcfc", "score": "0.671481", "text": "function mapArrayBufferViews(ary) {\n\t\t for (var i = 0; i < ary.length; i++) {\n\t\t var chunk = ary[i];\n\t\t if (chunk.buffer instanceof ArrayBuffer) {\n\t\t var buf = chunk.buffer;\n\n\t\t // if this is a subarray, make a copy so we only\n\t\t // include the subarray region from the underlying buffer\n\t\t if (chunk.byteLength !== buf.byteLength) {\n\t\t var copy = new Uint8Array(chunk.byteLength);\n\t\t copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t\t buf = copy.buffer;\n\t\t }\n\n\t\t ary[i] = buf;\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "71ccd56095a96d64850921caf1fe00b3", "score": "0.6699101", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function (chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer; // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n }", "title": "" }, { "docid": "9afbed1c35156bca39ba50510ed93742", "score": "0.664615", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n }", "title": "" }, { "docid": "a228b958306054a69f38240307e15844", "score": "0.66160256", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function (chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n return buf;\n }\n return chunk;\n });\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "06b55a22097e7c05ec55be217beae8e8", "score": "0.6609566", "text": "function mapArrayBufferViews(ary) {\r\n return ary.map(function(chunk) {\r\n if (chunk.buffer instanceof ArrayBuffer) {\r\n var buf = chunk.buffer;\r\n\r\n // if this is a subarray, make a copy so we only\r\n // include the subarray region from the underlying buffer\r\n if (chunk.byteLength !== buf.byteLength) {\r\n var copy = new Uint8Array(chunk.byteLength);\r\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\r\n buf = copy.buffer;\r\n }\r\n\r\n return buf;\r\n }\r\n\r\n return chunk;\r\n });\r\n}", "title": "" }, { "docid": "239fbdb5ab5c82520fb363c842b627df", "score": "0.6604444", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(\n new Uint8Array(\n buf,\n chunk.byteOffset,\n chunk.byteLength\n )\n );\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n }", "title": "" }, { "docid": "5873fc5ecf8f9468f894a245793e5e56", "score": "0.65807736", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n }", "title": "" }, { "docid": "2238a26d3333648a5d3d6dad14740f49", "score": "0.6559019", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "2238a26d3333648a5d3d6dad14740f49", "score": "0.6559019", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "2238a26d3333648a5d3d6dad14740f49", "score": "0.6559019", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "2238a26d3333648a5d3d6dad14740f49", "score": "0.6559019", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "2238a26d3333648a5d3d6dad14740f49", "score": "0.6559019", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function(chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "9f579c1948a9beb70fc79f9ae324164b", "score": "0.6557297", "text": "function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}", "title": "" }, { "docid": "f2502900b6e5cb506ea6caa55ecdd6e0", "score": "0.65516496", "text": "function mapArrayBufferViews(ary) {\n return ary.map(function (chunk) {\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n return buf;\n }\n\n return chunk;\n });\n}", "title": "" }, { "docid": "760a4d42c2fe41dc1f27c89dc9d187af", "score": "0.65356576", "text": "function _toArrayBuffer (buffer) {\n\tvar \n\tab = new ArrayBuffer(buffer.length),\n\tview = new Uint8Array(ab);\n\t\n\tfor (var i = 0; i < buffer.length; ++i) {\n\t\tview[i] = buffer[i];\n\t}\n\treturn ab;\n}", "title": "" }, { "docid": "ca53a112d251c3dafea2df0a8e47be48", "score": "0.6474165", "text": "function buffer2ArrayBuffer(buffer) {\n\t var buf = new ArrayBuffer(buffer.length);\n\t var bufView = new Uint8Array(buf);\n\t for (var i = 0; i < buffer.length; i++) {\n\t bufView[i] = buffer[i];\n\t }\n\t return buf;\n\t}", "title": "" }, { "docid": "ca53a112d251c3dafea2df0a8e47be48", "score": "0.6474165", "text": "function buffer2ArrayBuffer(buffer) {\n\t var buf = new ArrayBuffer(buffer.length);\n\t var bufView = new Uint8Array(buf);\n\t for (var i = 0; i < buffer.length; i++) {\n\t bufView[i] = buffer[i];\n\t }\n\t return buf;\n\t}", "title": "" }, { "docid": "ca53a112d251c3dafea2df0a8e47be48", "score": "0.6474165", "text": "function buffer2ArrayBuffer(buffer) {\n\t var buf = new ArrayBuffer(buffer.length);\n\t var bufView = new Uint8Array(buf);\n\t for (var i = 0; i < buffer.length; i++) {\n\t bufView[i] = buffer[i];\n\t }\n\t return buf;\n\t}", "title": "" }, { "docid": "300471e7264083a3b8b8815c8805b470", "score": "0.642643", "text": "function buffer2ArrayBuffer(buffer) {\n\tvar buf = new ArrayBuffer(buffer.length);\n\tvar bufView = new Uint8Array(buf);\n\tfor (var i = 0; i < buffer.length; i++) {\n\t\tbufView[i] = buffer[i];\n\t}\n\treturn buf;\n}", "title": "" }, { "docid": "40727f2f06bd3c44d79e5b8d58d19d95", "score": "0.630632", "text": "function toArrayBuffer(buffer) {\r\n var ab = new ArrayBuffer(buffer.length);\r\n var view = new Uint8Array(ab);\r\n for (var i = 0; i < buffer.length; ++i) {\r\n view[i] = buffer[i];\r\n }\r\n return ab;\r\n}", "title": "" }, { "docid": "1857a51a9154a4ccd0e1f475080eb109", "score": "0.6152067", "text": "function isArrayBufferView(obj) {\n return typeof ArrayBuffer.isView === 'function' && ArrayBuffer.isView(obj);\n }", "title": "" }, { "docid": "1857a51a9154a4ccd0e1f475080eb109", "score": "0.6152067", "text": "function isArrayBufferView(obj) {\n return typeof ArrayBuffer.isView === 'function' && ArrayBuffer.isView(obj);\n }", "title": "" }, { "docid": "b7070e6f9215e833f6236f94437b4250", "score": "0.61445135", "text": "function isArrayBufferView (obj) {\n\t return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n\t}", "title": "" }, { "docid": "b7070e6f9215e833f6236f94437b4250", "score": "0.61445135", "text": "function isArrayBufferView (obj) {\n\t return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n\t}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "8775656f670a53ec094f4edf5d9b003c", "score": "0.6107159", "text": "function isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}", "title": "" }, { "docid": "e3ebf85e147c14399244debc783863c4", "score": "0.6099922", "text": "function isArrayBufferView(obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj);\n }", "title": "" }, { "docid": "c0803a4fc1de98e8018993748e120393", "score": "0.60822076", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n }", "title": "" }, { "docid": "c0803a4fc1de98e8018993748e120393", "score": "0.60822076", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n }", "title": "" }, { "docid": "62d137675ef592a1f692df9b7f94363b", "score": "0.60809135", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__[\"a\" /* default */])(bufferSource)\n );\n}", "title": "" }, { "docid": "62d137675ef592a1f692df9b7f94363b", "score": "0.60809135", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__[\"a\" /* default */])(bufferSource)\n );\n}", "title": "" }, { "docid": "a932cb4209d97069f4a8fc58526c0275", "score": "0.60783744", "text": "function bufferFromArrayBuffer(arrayBuffer) {\n var buffer = Buffer.alloc(arrayBuffer.byteLength);\n var view = new Uint8Array(arrayBuffer);\n\n for (var _i = 0; _i < buffer.length; ++_i) {\n buffer[_i] = view[_i];\n }\n\n return buffer;\n}", "title": "" } ]
30701de2c518fb2dd4f454575e876081
Detaches a view from dirty checking again.
[ { "docid": "f042eb13ac628e5f270883cacd3a6c05", "score": "0.6137194", "text": "detachView(viewRef) {\n const view = viewRef;\n remove(this._views, view);\n view.detachFromAppRef();\n }", "title": "" } ]
[ { "docid": "5e284fc53cc0e5f932e9bee3fec80e7a", "score": "0.6913246", "text": "function detach(view) {\n while (screen.focused && screen.focused !== view) screen.rewindFocus()\n view.detach()\n render()\n}", "title": "" }, { "docid": "21999666948617d3f961f44b2bf1b560", "score": "0.6437636", "text": "function clearView() {\n\t\ttoolbarsManager.proxyCall('deactivateButton', currentView.type);\n\t\tcurrentView.removeElement();\n\t\tcurrentView = t.view = null;\n\t}", "title": "" }, { "docid": "925e43f2830471e79bc13535bceaad14", "score": "0.63536006", "text": "function detachConfirmModifications() {\n if( beforeUnloadView ) {\n beforeUnloadView.detach();\n beforeUnloadView = null;\n }\n }", "title": "" }, { "docid": "42b2ec6c8d01f837111084bf39f53f91", "score": "0.6266881", "text": "function renderDetachView(lView) {\n executeActionOnView(lView[RENDERER], 1 /* Detach */, lView, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "9b3c01b1f363860a2bd4e19f0fe84bb8", "score": "0.62488115", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);\n}", "title": "" }, { "docid": "51bbdc97a3999b7ea76b764187ccc227", "score": "0.62118673", "text": "function leaveView(newView){var tView=lView[TVIEW];if(isCreationMode(lView)){lView[FLAGS]&=~1/* CreationMode */;}else{executeHooks(lView,tView.viewHooks,tView.viewCheckHooks,checkNoChangesMode);// Views are clean and in update mode after being checked, so these bits are cleared\nlView[FLAGS]&=~(8/* Dirty */|2/* FirstLViewPass */);lView[FLAGS]|=32/* RunInit */;lView[BINDING_INDEX]=tView.bindingStartIndex;}enterView(newView,null);}", "title": "" }, { "docid": "184d7528e719d906ee83fb5594c84d59", "score": "0.62043685", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2\n /* Detach */\n , null, null);\n}", "title": "" }, { "docid": "a49447c3f0facf9a75e69eaf5176e511", "score": "0.6200209", "text": "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "title": "" }, { "docid": "7e80dfcff478fa6147e18f99651e8ec4", "score": "0.61758333", "text": "function detachView(lContainer,removeIndex,detached){var views=lContainer[VIEWS];var viewToDetach=views[removeIndex];if(removeIndex>0){views[removeIndex-1][NEXT]=viewToDetach[NEXT];}views.splice(removeIndex,1);if(!detached){addRemoveViewFromContainer(viewToDetach,false);}if(viewToDetach[QUERIES]){viewToDetach[QUERIES].removeView();}viewToDetach[CONTAINER_INDEX]=-1;viewToDetach[PARENT]=null;// Unsets the attached flag\nviewToDetach[FLAGS]&=~16/* Attached */;return viewToDetach;}", "title": "" }, { "docid": "855864cf8bf98a50d3b80a575b5549ad", "score": "0.6167135", "text": "function renderDetachView(tView, lView) {\n applyView(tView, lView, lView[RENDERER], 2\n /* Detach */\n , null, null);\n }", "title": "" }, { "docid": "67e13980644cd5cef5b8b81868e8fa0e", "score": "0.6096202", "text": "detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }", "title": "" }, { "docid": "67e13980644cd5cef5b8b81868e8fa0e", "score": "0.6096202", "text": "detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }", "title": "" }, { "docid": "03c2907458d1438ffd9750e74dd6c2d6", "score": "0.60445327", "text": "function detachView(lContainer, removeIndex, detached) {\n var views = lContainer[VIEWS];\n var viewToDetach = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1][NEXT] = viewToDetach[NEXT];\n }\n views.splice(removeIndex, 1);\n if (!detached) {\n addRemoveViewFromContainer(viewToDetach, false);\n }\n if (viewToDetach[QUERIES]) {\n viewToDetach[QUERIES].removeView();\n }\n viewToDetach[CONTAINER_INDEX] = -1;\n viewToDetach[PARENT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~8 /* Attached */;\n}", "title": "" }, { "docid": "f2ac4915cae21603a2f2d716b373500a", "score": "0.60410017", "text": "detach() {\n this._scrolledIndexChange.complete();\n\n this._viewport = null;\n }", "title": "" }, { "docid": "5fff9a82426f2e00fbe797afa4e9d367", "score": "0.6012903", "text": "function cleanUpView(view) {\n if (isLView(view) && !(view[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n view[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n view[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(view);\n removeListeners(view);\n var hostTNode = view[T_HOST];\n // For component views only, the local renderer is destroyed as clean up time.\n if (hostTNode && hostTNode.type === 3 /* Element */ && isProceduralRenderer(view[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n view[RENDERER].destroy();\n }\n // For embedded views still attached to a container: remove query result from this view.\n if (viewAttachedToContainer(view) && view[QUERIES]) {\n view[QUERIES].removeView();\n }\n }\n}", "title": "" }, { "docid": "9f527661a43e9dff1d7983de3c1dd9e7", "score": "0.6010883", "text": "_detachAndCacheView(index, viewContainerRef) {\n const detachedView = viewContainerRef.detach(index);\n\n this._maybeCacheView(detachedView, viewContainerRef);\n }", "title": "" }, { "docid": "463f7d47e1992f586b13d21331ee9640", "score": "0.6008397", "text": "function leaveView() {\n var oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n }", "title": "" }, { "docid": "2ffe6d56085ad0e68bc12af4574ac7d2", "score": "0.59812725", "text": "function clearView() {\n\t\t\theader.deactivateButton(currentView.type);\n\t\t\tcurrentView.removeElement();\n\t\t\tcurrentView = t.view = null;\n\t\t}", "title": "" }, { "docid": "402742d25c4e963cdc8d1cabbe386e18", "score": "0.59567255", "text": "hideView() {\n\t\tthis.content.clear();\n\t}", "title": "" }, { "docid": "1385be4ed52eead19f39c4c33084e195", "score": "0.59443384", "text": "_detachAndCacheView(index, viewContainerRef) {\n const detachedView = viewContainerRef.detach(index);\n this._maybeCacheView(detachedView, viewContainerRef);\n }", "title": "" }, { "docid": "c6b373f5acd7f5184bad24afb7757300", "score": "0.5928882", "text": "function leaveView(newView, safeToRunHooks) {\n var tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~4 /* CreationMode */;\n }\n else {\n try {\n resetPreOrderHookFlags(lView);\n safeToRunHooks && executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode, 2 /* AfterViewInitHooksToBeRun */, undefined);\n }\n finally {\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n }\n setCachedStylingContext(null);\n enterView(newView, null);\n}", "title": "" }, { "docid": "1d67fe5c4aad1607860c4b59aadf3575", "score": "0.59256095", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256\n /* Destroyed */\n )) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128\n /* Attached */\n ; // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n\n lView[FLAGS] |= 256\n /* Destroyed */\n ;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView); // For component views only, the local renderer is destroyed at clean up time.\n\n if (lView[TVIEW].type === 1\n /* Component */\n && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n\n var declarationContainer = lView[DECLARATION_LCONTAINER]; // we are dealing with an embedded view that is still inserted into a container\n\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n } // For embedded views still attached to a container: remove query result from this view.\n\n\n var lQueries = lView[QUERIES];\n\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n }", "title": "" }, { "docid": "88964c6f721110d3cc96e47337a219e7", "score": "0.5922461", "text": "function clearView() {\n\t\theader.deactivateButton(currentView.type);\n\t\tcurrentView.removeElement();\n\t\tcurrentView = t.view = null;\n\t}", "title": "" }, { "docid": "4846a74c5ab6efb8ab15143ab272aa0d", "score": "0.5894651", "text": "invalidate () {\n this.focus = null\n\n this.invoke('unarchive', null)\n\n this.reconcile()\n }", "title": "" }, { "docid": "da1f214573867eba457fd13f01523ef8", "score": "0.588309", "text": "function leaveView() {\n var oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "2cd917c0a4909dde4fd5a62ec3c0dbda", "score": "0.58800626", "text": "function leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}", "title": "" }, { "docid": "4f638dfeceb9830765d6682c9f2b2e9a", "score": "0.5877933", "text": "_detachView(index, viewContainerRef) {\n return viewContainerRef.detach(index);\n }", "title": "" }, { "docid": "4f638dfeceb9830765d6682c9f2b2e9a", "score": "0.5877933", "text": "_detachView(index, viewContainerRef) {\n return viewContainerRef.detach(index);\n }", "title": "" }, { "docid": "460441398a9059a5499ca1d1d2eecaf4", "score": "0.5877372", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256\n /* Destroyed */\n )) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128\n /* Attached */\n ; // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n\n lView[FLAGS] |= 256\n /* Destroyed */\n ;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView); // For component views only, the local renderer is destroyed at clean up time.\n\n if (lView[TVIEW].type === 1\n /* Component */\n && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n\n var declarationContainer = lView[DECLARATION_LCONTAINER]; // we are dealing with an embedded view that is still inserted into a container\n\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n } // For embedded views still attached to a container: remove query result from this view.\n\n\n var lQueries = lView[QUERIES];\n\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "1dc1ea6dd60924510f40691d18a3d216", "score": "0.5851513", "text": "function cleanUpView(tView, lView) {\n if (!(lView[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is removed when the view is detached from its parent, however\n // if it's a root view, the flag won't be unset hence why we're also removing on destroy.\n lView[FLAGS] &= ~128 /* Attached */;\n // Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook\n // runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If\n // We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.\n // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is\n // really more of an \"afterDestroy\" hook if you think about it.\n lView[FLAGS] |= 256 /* Destroyed */;\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n // For component views only, the local renderer is destroyed at clean up time.\n if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n // we are dealing with an embedded view that is still inserted into a container\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n // and this is a projected view\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n // For embedded views still attached to a container: remove query result from this view.\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n }\n}", "title": "" }, { "docid": "972401e0eb73f592eec8911ed27da3c1", "score": "0.5842182", "text": "function detachView(lContainer, removeIndex, detached) {\n var views = lContainer[VIEWS];\n var viewToDetach = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1][NEXT] = viewToDetach[NEXT];\n }\n views.splice(removeIndex, 1);\n if (!detached) {\n addRemoveViewFromContainer(viewToDetach, false);\n }\n if (viewToDetach[QUERIES]) {\n viewToDetach[QUERIES].removeView();\n }\n viewToDetach[CONTAINER_INDEX] = -1;\n viewToDetach[PARENT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~16 /* Attached */;\n return viewToDetach;\n}", "title": "" }, { "docid": "972401e0eb73f592eec8911ed27da3c1", "score": "0.5842182", "text": "function detachView(lContainer, removeIndex, detached) {\n var views = lContainer[VIEWS];\n var viewToDetach = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1][NEXT] = viewToDetach[NEXT];\n }\n views.splice(removeIndex, 1);\n if (!detached) {\n addRemoveViewFromContainer(viewToDetach, false);\n }\n if (viewToDetach[QUERIES]) {\n viewToDetach[QUERIES].removeView();\n }\n viewToDetach[CONTAINER_INDEX] = -1;\n viewToDetach[PARENT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~16 /* Attached */;\n return viewToDetach;\n}", "title": "" }, { "docid": "f5b0bc5a4bfeb3ef8a614ba4c189b7fc", "score": "0.5792318", "text": "_detachAndCacheView(index, viewContainerRef) {\n const detachedView = this._detachView(index, viewContainerRef);\n this._maybeCacheView(detachedView, viewContainerRef);\n }", "title": "" }, { "docid": "2d7734b8a28279dbd3caa4dae85b8cfa", "score": "0.5789953", "text": "disposeFor(element) {\n const viewSource = this.unload(element);\n\n if (viewSource) {\n viewSource.view = null;\n viewSource.viewSlot = null;\n\n this.viewMap.delete(element);\n }\n }", "title": "" }, { "docid": "9e315a40db16fab8fd95e189a2e6465f", "score": "0.57591033", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64\n /* Dirty */\n ;\n var parent = getLViewParent(lView); // Stop traversing up as soon as you find a root view that wasn't attached to any container\n\n if (isRootView(lView) && !parent) {\n return lView;\n } // continue otherwise\n\n\n lView = parent;\n }\n\n return null;\n }", "title": "" }, { "docid": "3e594ac8e8ac4ec1d39c918d2aada6a1", "score": "0.5749585", "text": "function leaveView(newView) {\n var tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~1 /* CreationMode */;\n }\n else {\n executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode);\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(8 /* Dirty */ | 2 /* FirstLViewPass */);\n lView[FLAGS] |= 32 /* RunInit */;\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n enterView(newView, null);\n}", "title": "" }, { "docid": "3e594ac8e8ac4ec1d39c918d2aada6a1", "score": "0.5749585", "text": "function leaveView(newView) {\n var tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~1 /* CreationMode */;\n }\n else {\n executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode);\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(8 /* Dirty */ | 2 /* FirstLViewPass */);\n lView[FLAGS] |= 32 /* RunInit */;\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n enterView(newView, null);\n}", "title": "" }, { "docid": "7ee5d015e6097100faebfb387416fc0e", "score": "0.5748762", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64\n /* Dirty */\n ;\n var parent = getLViewParent(lView); // Stop traversing up as soon as you find a root view that wasn't attached to any container\n\n if (isRootView(lView) && !parent) {\n return lView;\n } // continue otherwise\n\n\n lView = parent;\n }\n\n return null;\n}", "title": "" }, { "docid": "65b3349f80d987a7f4ac77443f8798d6", "score": "0.57441396", "text": "function _removeLayout(view){\n\t\tview._buffer = view._layout = null;\n\t}", "title": "" }, { "docid": "0b3856a48b27da68e4f47bb8bd274e10", "score": "0.5726015", "text": "function detachAndClean() {\n configureAria(opts.target, false);\n\n element.attr('opacity', 0);\n element.removeClass('md-active');\n detachElement(element, opts);\n\n announceClosed(opts);\n\n if (!opts.$destroy && opts.restoreFocus) {\n opts.target.focus();\n }\n }", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "1ac9a94ca50cd58e221a11092b75c024", "score": "0.57151514", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n const parent = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent) {\n return lView;\n }\n // continue otherwise\n lView = parent;\n }\n return null;\n}", "title": "" }, { "docid": "bb5f9d4fbb9291cd58818a4c78bdac2b", "score": "0.5707253", "text": "delView(_viewId) {\n this.__views[_viewId] = null;\n this._freeViewIds.push(_viewId);\n }", "title": "" }, { "docid": "c7f8409377f6b24efebb6f136780229b", "score": "0.5698625", "text": "deactivateView() {\r\n if (this.currentView.constructor.is) {\r\n this.currentView.dispatchEvent(new CustomEvent('lazy-board-view-exit'));\r\n }\r\n // The current view is hiding.\r\n this.currentView.style.display = 'none';\r\n this.currentView = null;\r\n }", "title": "" }, { "docid": "37505523ed4aa61f3e0a40139e7b5fa4", "score": "0.5698348", "text": "function markViewDirty(lView) {\n while (lView) {\n lView[FLAGS] |= 64 /* Dirty */;\n var parent_1 = getLViewParent(lView);\n // Stop traversing up as soon as you find a root view that wasn't attached to any container\n if (isRootView(lView) && !parent_1) {\n return lView;\n }\n // continue otherwise\n lView = parent_1;\n }\n return null;\n}", "title": "" }, { "docid": "720e9b2803221b363464e6a5450e0c70", "score": "0.5693865", "text": "function markViewDirty(lView){while(lView&&!(lView[FLAGS]&128/* IsRoot */)){lView[FLAGS]|=8/* Dirty */;lView=lView[PARENT];}lView[FLAGS]|=8/* Dirty */;ngDevMode&&assertDefined(lView[CONTEXT],'rootContext should be defined');var rootContext=lView[CONTEXT];scheduleTick(rootContext,1/* DetectChanges */);}", "title": "" }, { "docid": "eb33be4233b8b3d0aa94dc486eb2a269", "score": "0.5619751", "text": "clearDirtyState() {\n this._dirty = false;\n }", "title": "" }, { "docid": "300991ab908ceb583301599e2b35b03c", "score": "0.56111807", "text": "detach() {\n\t\tif (this.panel) {\n\t\t\tthis.panel.destroy();\n\t\t}\n\t}", "title": "" }, { "docid": "b0f458449254cd66f65833f0f6d98950", "score": "0.5593619", "text": "detach() {\n delete this._component;\n }", "title": "" }, { "docid": "928ea7cd9b7490938accaffca9af82f2", "score": "0.55665", "text": "detach() {\n this.attached.removeEventListener('mousedown', this.event);\n this.attached.removeEventListener('mouseup', this.event);\n this.attached.removeEventListener('click', this.event);\n this.attached.removeEventListener('dblclick', this.event);\n \n this.attached = null;\n }", "title": "" }, { "docid": "f423787b3ff8ebec89cb62792b49197b", "score": "0.5558135", "text": "_maybeCacheView(view, viewContainerRef) {\n if (this._viewCache.length < this.viewCacheSize) {\n this._viewCache.push(view);\n this.extApi.rowsApi.findRowByElement(view.rootNodes[0])._detach();\n // Notify this row is not part of the view, its cached (however, the component and any child component is not destroyed)\n }\n else {\n const index = viewContainerRef.indexOf(view);\n // The host component could remove views from the container outside of\n // the view repeater. It's unlikely this will occur, but just in case,\n // destroy the view on its own, otherwise destroy it through the\n // container to ensure that all the references are removed.\n if (index === -1) {\n view.destroy();\n }\n else {\n viewContainerRef.remove(index);\n }\n }\n }", "title": "" }, { "docid": "25a73efdb8a85afe0734d971c42031d7", "score": "0.55379224", "text": "function removeViewFromContainer(tView, lView) {\n var renderer = lView[RENDERER];\n applyView(tView, lView, renderer, 2\n /* Detach */\n , null, null);\n lView[HOST] = null;\n lView[T_HOST] = null;\n }", "title": "" }, { "docid": "f121bb5aa2428727ec589ffb51ad7130", "score": "0.5514437", "text": "detach() {\n invariant(this.parent, 'Node is not parented');\n this.parent.children.splice(this.parent.children.indexOf(this), 1);\n this.parent.el.removeChild(this.el);\n this.parent = null;\n }", "title": "" }, { "docid": "d87ff591e50d149ac4f2fbb0f4c86e87", "score": "0.549382", "text": "function markViewDirty(view) {\n var currentView = view;\n while (currentView && !(currentView[FLAGS] & 64 /* IsRoot */)) {\n currentView[FLAGS] |= 4 /* Dirty */;\n currentView = currentView[PARENT];\n }\n currentView[FLAGS] |= 4 /* Dirty */;\n ngDevMode && assertDefined(currentView[CONTEXT], 'rootContext should be defined');\n var rootContext = currentView[CONTEXT];\n scheduleTick(rootContext, 1 /* DetectChanges */);\n}", "title": "" }, { "docid": "292088d0f476a9e46b877cb0b1f3483d", "score": "0.54800063", "text": "function detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n var indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n var viewToDetach = lContainer[indexInContainer];\n\n if (viewToDetach) {\n var declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n\n var removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromContainer(viewToDetach[TVIEW], viewToDetach); // notify query that a view has been removed\n\n var lQueries = removedLView[QUERIES];\n\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null; // Unsets the attached flag\n\n viewToDetach[FLAGS] &= ~128\n /* Attached */\n ;\n }\n\n return viewToDetach;\n }", "title": "" }, { "docid": "10bb4b787bda107255d4eb758b47b625", "score": "0.5476092", "text": "function completeDetachment(node) {\n if (node.payload !== undefined) {\n if (node.payload.referenceParent !== undefined) {\n if (node.payload.referenceParent.payload !== undefined) {\n if (node.payload.referenceParent.payload.uiObject !== undefined) {\n node.payload.referenceParent.payload.uiObject.isShowing = false\n }\n }\n }\n node.payload.referenceParent = undefined\n if (node.savedPayload !== undefined) {\n node.savedPayload.referenceParent = undefined\n }\n }\n }", "title": "" }, { "docid": "97e30f17a70bc7c0126de35c3b9a996b", "score": "0.5475196", "text": "function detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n var indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n var viewToDetach = lContainer[indexInContainer];\n\n if (viewToDetach) {\n var declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n\n var removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromContainer(viewToDetach[TVIEW], viewToDetach); // notify query that a view has been removed\n\n var lQueries = removedLView[QUERIES];\n\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW]);\n }\n\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null; // Unsets the attached flag\n\n viewToDetach[FLAGS] &= ~128\n /* Attached */\n ;\n }\n\n return viewToDetach;\n}", "title": "" }, { "docid": "9f2bca1ba738ee09f16a1fe37699efa8", "score": "0.54675055", "text": "discardChanges() {\n this.editMode = false;\n this.removeListener();\n }", "title": "" }, { "docid": "d73fcefa9d5d16ca21488d0b031d6f7f", "score": "0.5450063", "text": "function restoreView(viewToRestore){contextLView=viewToRestore;}", "title": "" }, { "docid": "87bab9f3fab2823cc047040838433ccb", "score": "0.5447988", "text": "function embeddedViewEnd() {\n var lView = getLView();\n var viewHost = lView[HOST_NODE];\n if (isCreationMode(lView)) {\n refreshDescendantViews(lView); // creation mode pass\n lView[FLAGS] &= ~1 /* CreationMode */;\n }\n refreshDescendantViews(lView); // update mode pass\n leaveView(lView[PARENT]);\n setPreviousOrParentTNode(viewHost);\n setIsParent(false);\n}", "title": "" }, { "docid": "87bab9f3fab2823cc047040838433ccb", "score": "0.5447988", "text": "function embeddedViewEnd() {\n var lView = getLView();\n var viewHost = lView[HOST_NODE];\n if (isCreationMode(lView)) {\n refreshDescendantViews(lView); // creation mode pass\n lView[FLAGS] &= ~1 /* CreationMode */;\n }\n refreshDescendantViews(lView); // update mode pass\n leaveView(lView[PARENT]);\n setPreviousOrParentTNode(viewHost);\n setIsParent(false);\n}", "title": "" }, { "docid": "5d2bbbc4ac2ef824ebbbdb1476247108", "score": "0.54457635", "text": "function destroyLView(view){var renderer=view[RENDERER];if(isProceduralRenderer(renderer)&&renderer.destroyNode){walkTNodeTree(view,2/* Destroy */,renderer,null);}destroyViewTree(view);// Sets the destroyed flag\nview[FLAGS]|=64/* Destroyed */;}", "title": "" }, { "docid": "3cd4c9a1a6749329b91c59bac7d7123f", "score": "0.5436621", "text": "expire() {\n this.viewer = null // Sever reference back to this viewer to make it clear that this is attached\n delete this.response_buffer\n }", "title": "" }, { "docid": "186726e8e74640620f265ee18e1c8eda", "score": "0.542707", "text": "function leaveViewLight() {\n var oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null;\n oldLFrame.lView = null;\n return oldLFrame;\n }", "title": "" }, { "docid": "a8e4d283075aa3491b0c6410c8f149b8", "score": "0.5418625", "text": "componentWillUnmount() {\n // Cleans up Blaze view\n Blaze.remove(this.view);\n }", "title": "" }, { "docid": "75f2411a2a04e41ff1dd6c5c14ce232d", "score": "0.54170096", "text": "function destroyLView(view) {\n var renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkTNodeTree(view, 2 /* Destroy */, renderer, null);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= 64 /* Destroyed */;\n}", "title": "" }, { "docid": "75f2411a2a04e41ff1dd6c5c14ce232d", "score": "0.54170096", "text": "function destroyLView(view) {\n var renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkTNodeTree(view, 2 /* Destroy */, renderer, null);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= 64 /* Destroyed */;\n}", "title": "" }, { "docid": "c7f6dc760b4808cc903cd53247d9e465", "score": "0.5416514", "text": "detach() {}", "title": "" }, { "docid": "95a7dfc93d9234c25a831b9caf5251c2", "score": "0.54121435", "text": "detached() {\r\n const that = this;\r\n\r\n super.detached();\r\n\r\n //Handle ScrollView events\r\n if (that._scrollView) {\r\n that._scrollView.unlisten();\r\n delete that._scrollView;\r\n }\r\n }", "title": "" }, { "docid": "816af17e96559f9f0214a541f1f20c04", "score": "0.540664", "text": "__remove() {\n this.__detach();\n this.attrs.onRemoved && this.attrs.onRemoved.trigger();\n this.removed();\n Akili.removeScope(this.__scope.__name);\n this.el.remove();\n }", "title": "" }, { "docid": "8f79b1312ea58abe99c2ecd37688e226", "score": "0.5402345", "text": "detach() {\n if (!this.owner) {\n return;\n }\n\n _each(this.events(), (handler, event) => {\n handler = Event.normalizeHandler(handler, this);\n this.owner.off(event, handler);\n });\n this.owner = null;\n }", "title": "" }, { "docid": "a0f17e287085fb9f4bd1d47ea3feafed", "score": "0.54010063", "text": "function unlock_core_view_reload(){\n\tlast_loaded_core_view = undefined;\n}", "title": "" }, { "docid": "8e1e705953c7c3f102b4a4b63c2ed7a0", "score": "0.5391655", "text": "function removeViewFromContainer(tView, lView) {\n var renderer = lView[RENDERER];\n applyView(tView, lView, renderer, 2\n /* Detach */\n , null, null);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}", "title": "" }, { "docid": "9369a452065e4d3a5fcc28c97f1e5325", "score": "0.5390179", "text": "function embeddedViewEnd() {\n var viewHost = viewData[HOST_NODE];\n refreshDescendantViews();\n leaveView(viewData[PARENT]);\n previousOrParentTNode = viewHost;\n isParent = false;\n}", "title": "" }, { "docid": "0cf9635fe575cfd1005789dc1814e6f4", "score": "0.53887105", "text": "function destroyLView(view) {\n var renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkTNodeTree(view, 2 /* Destroy */, renderer, null);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= 32 /* Destroyed */;\n}", "title": "" }, { "docid": "5faa3e59da32523371eabf40b91ee509", "score": "0.53813297", "text": "detach(index = -1) {\n if (index == -1)\n index = this.length - 1;\n return this.viewManager.detachViewInContainer(this.element, index);\n }", "title": "" } ]
59139a97420f8c0d35b983cf3dc1f1d9
Forms are assigned sequence numbers when they're opened.
[ { "docid": "d1a3b31e900f4eacbbf15414e2501205", "score": "0.0", "text": "function serve() {\n const app = express();\n var port;\n app.set('etag', false); // convenient for troubleshooting\n app.set('trust proxy', ['loopback']); // to find the IP address of a client\n app.use(morgan('[:date[iso]] :method :url :status :res[content-length] - :response-time'));\n app.all('/http-echo', function(req, res, next) {\n // Respond with a copy of the request.\n try {\n var headers = 'Request was:\\n'\n + req.method + ' ' + req.url\n + (req.httpVersion ? \" HTTP/\" + req.httpVersion : \"\")\n + '\\n' + formatRawHeaders(req.rawHeaders) + '\\n';\n req.pipe(concat_stream(function(body) {\n res.set({'Content-Type': TEXT_PLAIN});\n res.end(headers + body.toString(CHARSET));\n }));\n } catch(err) {\n res.set({'Content-Type': TEXT_HTML});\n res.end(errorToHTML(err, JSON.stringify(req.body)), CHARSET);\n }\n });\n app.use(bodyParser.json({type: JSON_TYPE}));\n app.use(bodyParser.urlencoded({extended: false}));\n app.post(OpenOutpostMessage, function(req, res, next) {\n // req.body is an array, thanks to bodyParser.json\n const args = req.body;\n res.end();\n if (args && args.length > 0) {\n const formId = '' + nextFormId++;\n onOpen(formId, args);\n const command = 'start \"Browse\" /B http://' + LOCALHOST + ':' + port + '/form-' + formId;\n log(command);\n child_process.exec(\n command,\n function(err, stdout, stderr) {\n log(err);\n log('started browser ' + stdout.toString(ENCODING) + stderr.toString(ENCODING));\n });\n }\n });\n app.get('/form-:formId', function(req, res, next) {\n keepAlive(req.params.formId);\n onGetForm(req.params.formId, res);\n });\n app.post('/submit-:formId', function(req, res, next) {\n keepAlive(req.params.formId);\n onSubmit(req.params.formId, req.body, res);\n });\n app.get('/ping-:formId', function(req, res, next) {\n keepAlive(req.params.formId);\n res.statusCode = NOT_FOUND;\n res.set({'Cache-Control': 'no-cache, no-store, must-revalidate', // HTTP 1.1\n 'Pragma': 'no-cache', // HTTP 1.0\n 'Expires': '0'}); // proxies\n res.end(); // with no body. The client ignores this response.\n });\n app.get('/msgs/:msgno', function(req, res, next) {\n // The client may not get the message this way,\n // since the server doesn't know what the formId is.\n // Instead, onGetForm includes JavaScript code\n // which passes the message to set_form_data_div.\n res.statusCode = NOT_FOUND;\n res.end(); // with no body\n });\n app.post(StopServer, function(req, res, next) {\n res.end(); // with no body\n log('stopped');\n process.exit(0);\n });\n app.get('/manual', function(req, res, next) {\n onGetManual(res);\n });\n app.post('/manual-create', function(req, res, next) {\n try {\n const formId = '' + nextFormId++;\n const form = req.body.form;\n const space = form.indexOf(' ');\n onOpen(formId, ['--message_status', 'manual',\n '--addon_name', form.substring(0, space),\n '--filename', form.substring(space + 1)]);\n res.redirect('/form-' + formId);\n } catch(err) {\n res.set({'Content-Type': TEXT_HTML});\n res.end(errorToHTML(err, JSON.stringify(req.body)), CHARSET);\n }\n });\n app.post('/manual-view', function(req, res, next) {\n try {\n var args = ['--message_status', 'unread', '--mode', 'readonly'];\n for (var name in req.body) {\n args.push('--' + name);\n args.push(req.body[name]);\n }\n if (req.body.message) {\n args.push('--addon_name');\n args.push(req.body.message.match(/^\\s*!([^!\\r\\n]*)!/)[1])\n }\n const formId = '' + nextFormId++;\n onOpen(formId, args);\n res.redirect('/form-' + formId);\n } catch(err) {\n res.set({'Content-Type': TEXT_HTML});\n res.end(errorToHTML(err, JSON.stringify(req.body)), CHARSET);\n }\n });\n app.post('/http-request', function(req, res, next) {\n onPostHttpRequest(req, res);\n });\n app.get(/^\\/.*/, express.static(PackItForms, {setHeaders: function(res, path, stat) {\n if (path && path.toLowerCase().endsWith(\".pdf\")) {\n res.set('Content-Type', 'application/pdf');\n }\n }}));\n\n const server = app.listen(0);\n const address = server.address();\n port = address.port;\n if (!fs.existsSync('logs')) {\n fs.mkdirSync('logs');\n }\n fs.writeFileSync(PortFileName, port + '', {encoding: ENCODING}); // advertise my port\n const logFileName = path.resolve('logs', 'server-' + port + '.log');\n logToFile(logFileName);\n log('Listening for HTTP requests on port ' + port + '...');\n deleteOldFiles('logs', /^server-\\d*\\.log$/, LogFileAgeLimitMs);\n const checkSilent = setInterval(function() {\n // Scan openForms and close any that have been quiet too long.\n var anyOpen = false;\n for (formId in openForms) {\n var form = openForms[formId];\n if (form) {\n form.quietSeconds += 5;\n // The client is expected to GET /ping-formId every 30 seconds.\n if (form.quietSeconds >= 300) {\n closeForm(formId);\n } else {\n anyOpen = true;\n }\n }\n }\n if (!anyOpen) {\n log('forms are all closed');\n clearInterval(checkSilent);\n server.close();\n fs.readFile(PortFileName, {encoding: ENCODING}, function(err, data) {\n if (data.trim() == (port + '')) {\n fs.unlink(PortFileName, log);\n }\n process.exit(0);\n });\n }\n }, 5000);\n}", "title": "" } ]
[ { "docid": "d78fcfdd3bd231a96a0a2faba91f8a1e", "score": "0.5614419", "text": "handleNewSequence(event){\n this.handleCloseModals();\n this.sequenceId = event.detail;\n }", "title": "" }, { "docid": "7c659788175e178283eaaa528500b939", "score": "0.5552402", "text": "function addForm() {\n var currentForms = readForms();\n currentForms.push(new StudentForm());\n console.log(\"currentForms length at init: \" + currentForms.length);\n showForms(currentForms);\n animateAddForm(currentForms.length - 1);\n numForms++;\n console.log(\"numForms: \" + numForms);\n}", "title": "" }, { "docid": "744737f127f0bdb8fc947b1cb9cdee40", "score": "0.55177075", "text": "function manageMatNums() {\n clearMini();\n if(save.props.sequenceType == \"custom\") {\n var validated = validateSequence(save.props.sequence);\n if(validated) {\n matNums = validated.slice();\n matIndex = matNums.length-1;\n } else {\n matNums = defaultMatNums.slice();\n shuffle(matNums);\n }\n } else {\n matNums = defaultMatNums.slice();\n shuffle(matNums);\n }\n}", "title": "" }, { "docid": "929b83c65d5d9e7f658ca4b1c3515e74", "score": "0.5403804", "text": "function resetForms() {\n var studentForms = readForms();\n showForms(studentForms);\n}", "title": "" }, { "docid": "c103942ccce73c598744e4e9d6bf3dad", "score": "0.5193155", "text": "function initForm() {\n currentStep = 0; // set global counter to first step\n maxStep = formSteps.length - 1; // global variable with highest index\n\n\n // init each item in breadcrumb nav menu with correct step number\n for (let i = 0; i <= maxStep; i++) {\n (function (step) {\n logoSteps[i].onclick = () => {\n currentStep = step; // change global counter onclick\n showStep(step); // show clicked step\n }\n })(i);\n }\n\n // init date fields with today\n let dates = document.querySelectorAll(\"input[type=date]\")\n dates.forEach(element => { element.valueAsDate = new Date(); });\n\n // overwrite pageload with first step in form\n // console.log(\"replaced pageload with state step: \" + currentStep);\n history.replaceState({ \"step\": currentStep }, \"\", \"\");\n // finally show first step\n showStep(currentStep);\n }", "title": "" }, { "docid": "86c727113ba52f321d2eb99b645589f4", "score": "0.51882595", "text": "_readFromForm() {\n this.dao.doi = document.getElementById('doi').value;\n this.dao.citation_long = document.getElementById('citation_long').value;\n this.dao.citation_short = document.getElementById('citation_short').value;\n }", "title": "" }, { "docid": "508b3c6df3833c7642cbd3283499f369", "score": "0.5160716", "text": "setSequence(num) {\n this._currentSequenceNum = num\n if (!_.isObject(this._seq[num])) this._seq[num] = new Sequence(this._length)\n return this\n }", "title": "" }, { "docid": "57c4212b9677ca60c794c8fe280127f4", "score": "0.5102112", "text": "function getFormNumber(of) {\n var matches = of.match(/^(.*?)\\-(\\d*)\\-(.*?)$/);\n return matches === null ? \"\" : matches[2];\n}", "title": "" }, { "docid": "af7e1327048e42a3d863c5d01ffcb0ad", "score": "0.50428784", "text": "get sequenceNumber() {\n return this.readUInt16LE( 16 )\n }", "title": "" }, { "docid": "91b8a9fbc8884ba641d7a12f96e9e88e", "score": "0.5039137", "text": "function UniconURLSequencer (guid,doneFunction)\n{\n var thisRef = this;\n var sequence = [];\n var seqPos = 0;\n var lastTime = 0;\n var resetForm;\n var resetFormGuid;\n \n \n /* set to stillWaitingAsOf 0 initially, will be updated by other window when loading a page */\n this.stillWaitingAsOf = 0; \n\n // Property Flag to determine whether or not Form(s) are ready to be submitted\n this.isReady = false;\n \n // Property Flag to determine if a start is requested once Ready\n this.isStartRequested = false;\n\n // To add another form to submit in sequence\n this.add = function(formId,sendId)\n {\n var position = sequence.length;\n sequence[position] = {\"formId\":formId,\"sendId\":sendId}; \n }\n\n // To retrieve a Form Reference by Send Id\n this.getFormRefBySendId = function(sendId)\n {\n var formRef;\n for (var i=0; i<sequence.length; i++)\n {\n if (sequence[i].sendId == sendId)\n {\n formRef = document.getElementById(sequence[i].formId);\n break;\n }\n }\n return formRef;\n }\n\n // Return array of send Ids for this Sequence\n this.getSendIds = function()\n {\n var sendIdArray = [];\n for (var i=0; i<sequence.length; i++)\n {\n sendIdArray[sendIdArray.length] = sequence[i].sendId;\n }\n return sendIdArray;\n }\n\n // To start running the sequence, beginning with the first added form\n this.start = function()\n {\n if (!thisRef.isReady) \n {\n //window.status='Start requested flag set';\n thisRef.isStartRequested = true;\n return;\n }\n // If first time sequence is run, store initial values of reset form\n if (!resetFormGuid)\n {\n resetForm = document.getElementById(guid+\"_resetForm\");\n resetFormGuid = document.getElementById(guid+\"_resetForm_guid\"); \n }\n seqPos = 0;\n thisRef.next();\n }\n\n // To submit the next form in the sequence. Actually submits the reset form and waits for onreset\n this.next = function()\n {\n if (seqPos == sequence.length-1 && !doneFunction)\n {\n // If last form, don't need to reset 1st, just submit\n var nextFormRef = document.getElementById(sequence[seqPos].formId);\n nextFormRef.submit();\n }\n else if (seqPos < sequence.length)\n {\n // Load reset file into Window/Iframe pointing to this sequence\n resetFormGuid.value = guid;\n resetForm.submit();\n }\n else if (doneFunction)\n {\n doneFunction();\n }\n }\n\n // When reset page has loaded, submit next request\n this.onreset = function()\n {\n var nextFormRef = document.getElementById(sequence[seqPos].formId);\n sequence[seqPos].startTime = (new Date()).getTime();\n window.setTimeout(\"UniconSSOSequences['\"+guid+\"'].checkLoadingStatus()\",300);\n nextFormRef.submit();\n }\n\n // Method to check the loading status of a sequence URL is being loaded\n // When loaded call onload()\n this.checkLoadingStatus = function()\n {\n if (thisRef.stillWaitingAsOf > 0)\n {\n if(lastTime > 0 && lastTime == thisRef.stillWaitingAsOf)\n {\n lastTime = 0;\n thisRef.onload();\n }\n else\n {\n lastTime = thisRef.stillWaitingAsOf;\n window.setTimeout(\"UniconSSOSequences['\"+guid+\"'].checkLoadingStatus()\",300);\n }\n\n }\n else\n {\n window.setTimeout(\"UniconSSOSequences['\"+guid+\"'].checkLoadingStatus()\",300);\n }\n \n\n }\n \n // When sequence form has loaded, this is called. Update sequence position and call next()\n this.onload = function()\n {\n sequence[seqPos].stopTime = (new Date()).getTime();\n seqPos++;\n thisRef.next();\n }\n\n}", "title": "" }, { "docid": "e96bc54e126a6717d36aa279e82224ce", "score": "0.50352997", "text": "function readForms() {\n var studentForms = new Array();\n console.log(\"numForms in readForms: \" + numForms);\n for (var i = 0; i < numForms; i++) {\n console.log(\"in the readForms loop, index: \" + i);\n var currentForm = document.forms[formID + i];\n var currentStudent = new StudentForm(\n currentForm[fNameID].value, currentForm[lNameID].value, currentForm[emailID].value);\n studentForms.push(currentStudent);\n }\n console.log(\"size of studentForms: \" + studentForms.length);\n return studentForms;\n}", "title": "" }, { "docid": "29cad1e34f03cc90bf223f3de359f177", "score": "0.50062263", "text": "function set_sequence()\n {\n hidden_field = document.getElementById(\"label_sequences_hidden_field\");\n seq = \"[\";\n for(i = 0;i < labels.length ; i ++)\n {\n if(i == labels.length - 1)\n seq += \"'\" + labels[i] + \"']\"; \n else\n seq += \"'\" + labels[i] + \"',\"; \n \n hidden_field.value = seq;\n }\n \n }", "title": "" }, { "docid": "103ba77484ef9bc9fe47b0391183bb5b", "score": "0.4998152", "text": "function setTabindex()\n {\n\tvar dataValues = {};\n\tvar i = 1;\n\t$('#detailsForm').find('input').each(\n\t function(unusedIndex, child) {\n\n\t\t$(this).attr(\"placeholder\", 'n/a');\n\n\t\tvar name = $(this).attr(\"name\");\n\t\tdataValues[child.name] = child.value;\n\n\t\t$(this).attr(\"tabindex\", i);\n\t\t++ i;\n\t });\n }", "title": "" }, { "docid": "529d7f378ac9688a34725d7c8075de2c", "score": "0.49684027", "text": "function assignFocus() {\n var counter = 0;\n $('.error-summary-list a').each(function () {\n var linkhash = $(this).attr(\"href\").split('#')[1];\n $('#' + linkhash).parents('.form-field, .form-group').first().attr('id', 'f-' + counter);\n $(this).attr('data-focuses', 'f-' + counter);\n counter++;\n });\n }", "title": "" }, { "docid": "5d36d4c644509c9192b21c1f9adf4e9c", "score": "0.49673563", "text": "function formForQuestion(i)\n {\n return(\"formForQuestion\" + i);\n }", "title": "" }, { "docid": "e1d1fb49fc5162927b3659ca79313676", "score": "0.4963878", "text": "function autoTab(thisval,fname, flen){\n\tvar fieldname = eval(\"document.formulario.\" + fname);\n\t\n\tif(thisval != 9 && thisval != 16){\n\t\tif(fieldname.value.length <= flen){\n\t\t\tfieldname.focus();\n\t\t}\n\t\telse{\n\t\t\tfor(x=0; x<document.formulario.elements.length; x++){\n\t\t\t\tif(fieldname.name == document.formulario.elements[x].name){\n\t\t\t\tvar nextfield = x + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdocument.formulario.elements[nextfield].focus();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "79a374c8321373144509a48391718128", "score": "0.4961868", "text": "function SetUpRefFields() {\n\tvar FormName = document.forms.namedItem(\"lgt_pipeline_step1_form\");\n\tFormName.Step2.style.display = \"block\";\n\tif (document.getElementById(\"r_case1\").checked) {\n\t\tdocument.getElementById('ddonor').style.display = \"block\";\n\t\tdocument.getElementById('dhost').style.display = \"block\";\n\t\tdocument.getElementById('drefseq').style.display = \"none\";\n\t} else if (document.getElementById(\"r_case2\").checked) {\n\t\tdocument.getElementById('ddonor').style.display = \"block\";\n\t\tdocument.getElementById('dhost').style.display = \"none\";\n\t\tdocument.getElementById('drefseq').style.display = \"none\";\n\t} else if (document.getElementById(\"r_case3\").checked) {\n\t\tdocument.getElementById('ddonor').style.display = \"none\";\n\t\tdocument.getElementById('dhost').style.display = \"block\";\n\t\tdocument.getElementById('drefseq').style.display = \"block\";\n\t}\n\tResetText();\n}", "title": "" }, { "docid": "f14d51ebd88e9b4c515577a3a37aec3a", "score": "0.49424204", "text": "function addForm(parentId){\r\n displayForm(parentId, nextQuestionId);\r\n readData('id'+nextQuestionId, true); \r\n nextQuestionId++;\r\n }", "title": "" }, { "docid": "7be79fd2c63058083d38db4dd5662982", "score": "0.48856613", "text": "function FormNodeIndex() {}", "title": "" }, { "docid": "d2a99acd90927f50dde99a429fa06281", "score": "0.4872132", "text": "function setForm(num) {\n\t\treturn num<10?\"0\"+num:num;\n\t}", "title": "" }, { "docid": "ce30b60926cafac515b70636c322ae23", "score": "0.48659045", "text": "function onOpen() {\n Logger.log('Running onOpen()...');\n var formURL = SpreadsheetApp.getActiveSpreadsheet().getFormUrl();\n Logger.log('Spreadsheet associated with form with URL: ' + formURL);\n var form = FormApp.openById(RECORD_TEAMWORK_FORM_ID);\n var items = form.getItems();\n for (var i in items) {\n var item = items[i];\n Utilities.formatString('Item %s of type %s has ID: %d',\n item.getTitle(),\n item.getType(),\n item.getId());\n }\n}", "title": "" }, { "docid": "ae0c714c0bf682e6c7c57ae4e9afc310", "score": "0.4863328", "text": "function next_options(myform) \n{\n var numoptions = myform.FIELD_COUNT.value;\n var nextindex = next_index(myform);\n var i;\n for(i=1;i<=numoptions;i++) {\n var thisvalue = eval ('myform.FIELD_VALUE_' + nextindex);\n var thisfield = eval('myform.FIELD_' + i);\n if(typeof(thisvalue.value) != 'string') {\n thisfield.value=thisvalue[i-1].value;\n } else {\n // one field file\n thisfield.value=thisvalue.value;\n }\n }\n myform.SELECTED_INDEX.value = nextindex;\n}", "title": "" }, { "docid": "7895354b2fb6ae2ddff3759005411181", "score": "0.486206", "text": "function normalizeIndex() {\n var files = $('.tab .files .section__files .file');\n\n files.each(function(index, el) {\n $(el).find('.file__aragement-input').val(index + 1);\n });\n}", "title": "" }, { "docid": "e3c2d2db11199d7aaffb05f9a7de87f0", "score": "0.48596397", "text": "function processEditForm(form) {\n\t\t\t\t!!fields['title'].trim() ? numValidField++ : form['title']();\n\t\t\t\t!!fields['text'].trim() ? numValidField++ : form['text']();\n\t\t\t}", "title": "" }, { "docid": "7504cf771d55da573e81ebdf57df80a3", "score": "0.48504323", "text": "function resetCounter(form) {\n $(form).find(\"textarea\").val('');\n $(form).find(\".counter\").text(140);\n }", "title": "" }, { "docid": "4ec26f2f86972840136d6c358df2c8b2", "score": "0.4846849", "text": "function AddSensorParameterForm() {\n //e.preventDefault()\n \n const newForm = sensorForm[0].cloneNode(true) //Clone the bird form\n $(newForm).attr('class','row parameter-form');\n let formRegex = RegExp(`parameter-(\\\\d){1}-`,'g') //Regex to find all instances of the form number\n\n formNum++ //Increment the form number\n newForm.innerHTML = newForm.innerHTML.replace(formRegex, `para-${formNum}-`) //Update the new form to have the correct form number\n\n //container.insertBefore(newForm, addButton) //Insert the new form at the end of the list of forms\n //$(newForm).insertBefore( \"#btn-add-parameter\" );\n $(newForm).val('');\n $('.parameter-card').append($(newForm));\n \n totalForms.setAttribute('value', `${formNum+1}`) //Increment the number of total forms in the management form\n\n }", "title": "" }, { "docid": "8ba875568f1c61ab4a8d42750403f21a", "score": "0.4845699", "text": "onSubmitEditing(number) {\n if (number < 3) {\n this.inputs[number + 1].focus();\n } else {\n }\n }", "title": "" }, { "docid": "dec848f51aca2646d8863227073a41eb", "score": "0.4842665", "text": "function loadMessage(index){\n openForm('read',index);\n}", "title": "" }, { "docid": "f6ea3ff9b2ba8d03b251b114d7f3a616", "score": "0.48236722", "text": "function updatePhone(index) {\n var Phone = parseInt(read.question('enter the new phone number'));\n data[index].state = Phone;\n writefile(data);\n }", "title": "" }, { "docid": "d7f04d7f0a952ee82f0b2c3c6d4e943c", "score": "0.4818317", "text": "function fillForm(i) {\n if (i<length) {\n passwordForms[i].fill(credentials, function() { fillForm(i+1); });\n }\n }", "title": "" }, { "docid": "4fba03cb84a2d298b43c10df4c7d9c36", "score": "0.4817722", "text": "handleCreateNewSequence(){\n this.showNewSequenceModal = true;\n }", "title": "" }, { "docid": "0cdb7967d623555b6b6c432f7bf1870b", "score": "0.47964126", "text": "function sequence(name,content){\n\tthis.name=name;\n\tthis.content=content;\n}", "title": "" }, { "docid": "b6ec55f5c14a99e9645f6d64aa9a17d3", "score": "0.47873285", "text": "function setReadonlyCargoDesc()\n{\n var esiStatus = document.forms[0].esiStatusCode;\n //if(null==esiStatus)\n // {\n //esiStatus = parent.opener.document.forms[0].esiStatusCode;\n //}\n var bookingNo = document.forms[0].bookingNo;\n if(null==bookingNo)\n {\n bookingNo = parent.opener.document.forms[0].bookingNo;\n }\n /*var marksAndNumbersInPopup = document.forms[0].marksAndNumbers;\n var descriptionInPopup = document.forms[0].description;\n if(undefined!=esiStatus && undefined!=marksAndNumbersInPopup\n && undefined!=descriptionInPopup && undefined!=bookingNo)\n {\n marksAndNumbersInPopup.readOnly = (SUBMITTED_MODE==esiStatus.value||''==bookingNo.value?\"true\":\"\");\n descriptionInPopup.readOnly = (SUBMITTED_MODE==esiStatus.value||''==bookingNo.value?\"true\":\"\");\n }*/\n}", "title": "" }, { "docid": "141572b25e0da62dd17fd1dd283191bf", "score": "0.47871342", "text": "function setEventCounter () {\n\t\t\n\t\tvar keyStr = '!E&'+eventCounter; //evaluating current event\n\t\tconsole.log(\"evaluating \"+keyStr);\n\t\tclearFormVariablesFromLS();\n\t\t\n\t\t//CLEAREAR LOS VALORES DEL FORM EN SI\n\t\t$('#sampleProperties')[0].reset();\n\t\t$('#analysesForm')[0].reset();\n\t\t$('#sampleParameters')[0].reset();\n\t\t$('#sampleParameters2')[0].reset();\n\t\t$('#setAtributesForm')[0].reset();\n\t\tif ($('#editAnalysisForm').length) {\n\t\t\tconsole.log(\"AnalysisForm exists - reset\");\n\t\t\t$('#editAnalysisForm')[0].reset();\n\t\t} else {\n\t\t\tconsole.log(\"AnalysisForm does not exist\");\n\t\t}\n\t\t\n\t\t//$('#evtDate').val('');\n\t\tif (keyStr in ls) { //if event exists in local storage\n\t\t\tif (ls.getItem(keyStr)==='') {//if event with nodata, keep same EC \n\t\t\t\tconsole.log(\"Esta vacio\");\n\t\t\t\t\n\t\t\t}\n\t\t\telse { //if event has data, create new event counter\n\t\t\t\tconsole.log(\"hay data\");\n\t\t\t\teventCounter++;\n\t\t\t\tsave_eventTags(\"!EC\",eventCounter);\n\t\t\t\t\n\t\t\t}\n\t\t} else { //if event does not exist, save it\n\t\t\tsave_eventTags(\"!EC\",eventCounter);\n\t\t}\n\t\tconsole.log(\"Current event key is: !E&\"+eventCounter);\n\t\taddOrEdit=0;\n\t }", "title": "" }, { "docid": "da5a256d4a85457a2d633a0b124c6ffa", "score": "0.47858733", "text": "handleOpenForm() {\n this.setState({ openedForm: !this.state.openedForm })\n }", "title": "" }, { "docid": "2d35e327d1fb88d6dff91f29d079a986", "score": "0.4776652", "text": "get seq() {\n if (!_.isObject(this._seq[this._currentSequenceNum])) this._seq[this._currentSequenceNum] = new Sequence(this._length)\n return this._seq[this._currentSequenceNum]\n }", "title": "" }, { "docid": "276ad709f4f624ebdba1792ade049ea5", "score": "0.47681054", "text": "function VF_SY121_GETFORMFIELDS()\n{\n var intControls = TONUMBER( VF_SY121_GETNL_VALUE(\"ActiveForm.Controls.Count\") );\n var intI = 0;\n var strFieldName = \"\";\n var strFieldValue = \"\";\n var intCounter = parseInt(VFPROP_Get(\"uArguments.Total\",1),10);\n \n for (intI = 0; intI < intControls; intI++)\n { \n strFieldName = VF_SY121_GETNL_VALUE(\"ActiveForm.Controls(\" + intI + \").Name\");\n\n if ( strFieldName != \"\" ) \n {\n intCounter++;\n strFieldValue = VF_SY121_GETNL_VALUE(\"ActiveForm.Controls(\" + intI + \").Text\", true);\n\n VFPROP_Set(\"uField.Name\",intCounter,strFieldName.toUpperCase());\n VFPROP_Set(\"uField.Value\",intCounter,strFieldValue);\n } \n }\n\n VFPROP_Set(\"uField.Total\",1,intCounter.toString());\n}", "title": "" }, { "docid": "2acd25a85501a9380157d537e4d75953", "score": "0.47566628", "text": "function changeFormValue(number){\n setBarcode(number);\n fetchFoodData(number)\n }", "title": "" }, { "docid": "39662efc4ea32b6c49ee9a2a5af3e78f", "score": "0.47551304", "text": "function setaFocoNumber(campo) { \r\n var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; \r\n if (keyCode == 13) { \r\n var i; \r\n for (i = 1; i < campo.form.elements.length; i++) \r\n if (campo == campo.form.elements[i]) \r\n break; \r\n i = (i + 2) % campo.form.elements.length; \r\n campo.form.elements[i].focus(); \r\n event.preventDefault(); \r\n return false; \r\n } \r\n return false; \r\n}", "title": "" }, { "docid": "05c17d724d4a2eaf812aa91ba51620e2", "score": "0.47484893", "text": "function CURRENT_FORM()\n{\n return(VF_SY120_GETCURRENTFORM());\n}", "title": "" }, { "docid": "fd1d7f94f2f40a3357976652a002d1cb", "score": "0.4738083", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('segSocieFrm.accion'), \n\t\tget('segSocieFrm.origen'));\n\n\n\tset('segSocieFrm.id', jsSegSocieId);\n\tset('segSocieFrm.paisOidPais', [jsSegSociePaisOidPais]);\n\tset('segSocieFrm.codSoci', jsSegSocieCodSoci);\n\tset('segSocieFrm.valDeno', jsSegSocieValDeno);\n\tset('segSocieFrm.valDire', jsSegSocieValDire);\n\tset('segSocieFrm.valTlfn', jsSegSocieValTlfn);\n\tset('segSocieFrm.valFax', jsSegSocieValFax);\n\tset('segSocieFrm.valIdenFisc', jsSegSocieValIdenFisc);\n\t\n}", "title": "" }, { "docid": "97edc4809fed291b1868b897f5b781a3", "score": "0.4731541", "text": "function settings() {\n\t// Set whether to increment sequence length on success\n\tif (document.getElementById(\"reverse\").checked) {\n\t\treverse_check = true;\n\t} else {\n\t\treverse_check = false;\n\t}\n\t\n\t// Set number of digits if it is different\n\tif (document.getElementById(\"number_of_digits_input\").value != \"X\" &&\n\t\tdocument.getElementById(\"number_of_digits_input\").value != numseq_length) {\n\t\t\t\n\t\tvar field = Number(document.getElementById(\"number_of_digits_input\").value);\n\t\tif (field != NaN) numseq_length = field;\n\t}\n\t\n\t// Set whether to see or not the number of digits\n\tif (document.getElementById(\"number_of_digits_checkbox\").checked) {\n\t\tdocument.getElementById(\"number_of_digits_input\").value = numseq_length;\n\t} else {\n\t\tdocument.getElementById(\"number_of_digits_input\").value = \"X\";\n\t}\n\t\n\t// Set whether to congratulate you if you enter the sequence correctly\n\tif (document.getElementById(\"congratulate\").checked) {\n\t\tcongratulate = true;\n\t} else {\n\t\tcongratulate = false;\n\t}\n\t\n\t// Set whether to increment sequence length on success\n\tif (document.getElementById(\"inc_len\").checked) {\n\t\tinc_len = true;\n\t} else {\n\t\tinc_len = false;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "d76e3876a8f8538d19772a6985e0afe2", "score": "0.47302574", "text": "function OpenCCfForm(currClaimSNo) {\n \n if (userContext.SysSetting.ClientEnvironment == 'UK' || userContext.SysSetting.ClientEnvironment == 'G8')\n window.open(\"../Client/\" + userContext.SysSetting.ClientEnvironment + \"/Claim/ClaimForm.html?sno=\" + currClaimSNo + \"&pagename=Irregularity\");\n else\n window.open(\"CargoClaimFormPrint.html?sno=\" + currClaimSNo + \"&pagename=Irregularity\");\n}", "title": "" }, { "docid": "a86e03638eb8cf0ffe3cc72f2b77815d", "score": "0.47277865", "text": "function editSequence(seq_name){\n\t$(\"#name\").val(seq_name);\n\tjson = JSON.parse($(\"#data_\"+seq_name).text());\n\tnodes.clear();\n\tedges.clear();\n\tnodes.update(json[0]);\n\tedges.update(json[1]);\n}", "title": "" }, { "docid": "f0b2253e8e99989e7edd46931a1430a6", "score": "0.47232747", "text": "function loadEdit()\n{\n var\tnamePattern\t= /^([a-zA-Z_]+)(\\d+)$/;\n\n // determine which half of the window child frames are opened\n if (window.frameElement)\n {\t\t\t\t// dialog opened in half frame\n\t\tnameChildFrameClass\t= window.frameElement.className;\n\t\tif (nameChildFrameClass == 'left')\n\t\t nameChildFrameClass\t= 'right';\n\t\telse\n\t\t nameChildFrameClass\t= 'left';\n }\t\t\t\t// dialog opened in half frame\n\n // handle keystrokes anywhere in body of page\n document.body.addEventListener('keydown', eeKeyDown);\n\n // activate functionality of various input fields\n var\tfocusSet\t = false;\n for (var fi = 0; fi < document.forms.length; fi++)\n {\t\t\t\t // loop through all forms in page\n\t\tvar form\t\t= document.forms[fi];\n\t\tform.updateCitation\t= updateCitation;\n\n\t\t// set action methods for form\n\t\tif (form.name == 'nameForm')\n\t\t{\t\t\t // main form\n\t\t form.onsubmit\t = suppressSubmit;\n\t\t form.onreset \t = resetForm;\n\t\t form.sourceCreated\t= sourceCreated; // feedback function\n\t\t}\t\t\t // main form\n\n\t\tvar formElts\t = form.elements;\n\t\tfor (var i = 0; i < formElts.length; ++i)\n\t\t{\t\t\t // loop through all elements in form\n\t\t var element\t = formElts[i];\n\n\t\t if (element.nodeName.toLowerCase() == 'fieldset')\n\t\t\t\tcontinue;\n\n\t\t var\tname;\n\t\t if (element.name && element.name.length > 0)\n\t\t\t\tname\t = element.name;\n\t\t else\n\t\t\t\tname\t = element.id;\n\t\t var matches\t = namePattern.exec(name);\n\t\t var\tid\t = '';\n\t\t if (matches)\n\t\t {\t\t // name matched the pattern\n\t\t\t\tname\t = matches[1];\n\t\t\t\tid\t = matches[2]; // IDSX of citation\n\t\t }\t\t // name matched the pattern\n\n\t\t // take action specific to specific elements\n\t\t switch(name.toLowerCase())\n\t\t {\t\t\t // action depends upon element name\n\t\t\t\tcase 'surname':\n\t\t\t\t{\t // name fields\n\t\t\t\t element.addEventListener('keydown', keyDown);\n\t\t\t\t element.addEventListener('change', change);\t// default\n\t\t\t\t element.checkfunc\t\t= checkName;\n \t\t\t if (!focusSet)\n\t \t\t {\t\t // need focus in some field\n\t\t \t\t element.focus();\t// set focus\n\t\t\t \t focusSet\t = true;\n\t\t\t }\t\t // need focus in some field\n\t\t\t\t break;\n\t\t\t\t}\t // name fields\n\n\t\t\t\tcase 'givenname':\n\t\t\t\t{\t // name fields\n\t\t\t\t element.addEventListener('keydown', keyDown);\n\t\t\t\t element.addEventListener('change', change);\t// default\n\t\t\t\t element.checkfunc\t\t= checkName;\n \t\t\t if (!focusSet)\n\t \t\t {\t\t // need focus in some field\n\t\t \t\t element.focus();\t// set focus\n\t\t\t \t focusSet\t = true;\n\t\t\t }\t\t // need focus in some field\n\t\t\t\t break;\n\t\t\t\t}\t // name fields\n\n\t\t\t\tcase 'updname':\n\t\t\t\t{\t\t // <button id='updName'>\n\t\t\t\t element.addEventListener('keydown', keyDown);\n\t\t\t\t element.addEventListener('click', updateName);\n\t\t\t\t break;\n\t\t\t\t}\t\t // <button id='updName'>\n\t\t\t\t\n\t\t\t\tcase 'clear':\n\t\t\t\t{\t\t // <button id='Clear'>\n\t\t\t\t element.addEventListener('click', clearNotes);\n\t\t\t\t break;\n\t\t\t\t}\t\t // <button id='Clear'>\n\t\t\t\t\n\t\t\t\tcase 'note':\n\t\t\t\t{\t\t // textual notes on name\n var noteEditor = tinyMCE.get('note');\n if (noteEditor)\n {\n\t \t\t\t if (!focusSet)\n\t\t \t\t {\t\t // need focus in some field\n\t\t\t \t\t noteEditor.focus();\t// set focus\n\t\t\t\t \t focusSet\t = true;\n\t\t\t\t }\t\t // need focus in some field\n }\n else\n { // not using tinyMCE \n \t\t\t\t element.addEventListener('change', change);\t// default\n\t \t\t\t if (!focusSet)\n\t\t \t\t {\t\t // need focus in some field\n\t\t\t \t\t element.focus();\t// set focus\n\t\t\t\t \t focusSet\t = true;\n\t\t\t\t }\t\t // need focus in some field\n }\n\t\t\t\t break;\n\t\t\t\t}\t\t // textual notes on name\n\t\t\t\t\n\t\t\t\tcase 'addcitation':\n\t\t\t\t{\t\t // add citation to primary fact\n\t\t\t\t element.addEventListener('click', addCitation);\n\t\t\t\t break;\n\t\t\t\t}\t\t // add citation to primary fact\n\n\t\t\t\tcase 'editcitation':\n\t\t\t\t{\t\t // edit citation to primary fact\n\t\t\t\t element.addEventListener('click', editCitation);\n\t\t\t\t break;\n\t\t\t\t}\t\t // edit citation to primary fact\n\n\t\t\t\tcase 'delcitation':\n\t\t\t\t{\t\t // edit citation to primary fact\n\t\t\t\t element.addEventListener('click', deleteCitation);\n\t\t\t\t break;\n\t\t\t\t}\t\t // edit citation to primary fact\n\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t element.addEventListener('keydown', keyDown);\n\t\t\t\t element.addEventListener('change', change);\t// default\n\t\t\t\t break;\n\t\t\t\t}\t\t // default\n\n\t\t }\t\t\t // action depends upon element name\n\t\t}\t\t\t // loop through all elements in the form\n }\t\t\t\t // loop through all forms in page\n\n hideRightColumn();\n}", "title": "" }, { "docid": "910dcc201086d23f13636dc3ad0ba86e", "score": "0.47180977", "text": "function seleccionar_pagina(num_pagina){\n\tf= document.form1;\n\tf.target\t\t\t\t= '_self';\n\tf.num_pagina.value\t\t= num_pagina;\n\tf_enter()\n}", "title": "" }, { "docid": "c84c5127345db8c00eb1ac1e3ef99459", "score": "0.4711509", "text": "function pdf_actuacion_fiscal(form, pdf) {\r\n\tvar forganismo = document.getElementById(\"forganismo\").value;\r\n\tvar fregistrod = document.getElementById(\"fregistrod\").value;\r\n\tvar fregistroh = document.getElementById(\"fregistroh\").value;\r\n\tvar forganismoext = document.getElementById(\"forganismoext\").value;\r\n\tvar fdependenciaext = document.getElementById(\"fdependenciaext\").value;\r\n\tvar fedoreg = document.getElementById(\"fedoreg\").value;\r\n\tvar factuacion = document.getElementById(\"factuacion\").value;\r\n\tvar fproceso = document.getElementById(\"fproceso\").value;\r\n\t\r\n\tif (factuacion == \"\") alert(\"¡ERROR: Debe seleccionar una actuación!\");\r\n\telse {\r\n\t\tif (fproceso == \"01\") {\r\n\t\t\tif (pdf == \"planificacion\")\r\n\t\t\t\twindow.open(\"pf_pdf_actuacion_fiscal.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t\telse if (pdf == \"ejecucion\")\r\n\t\t\t\twindow.open(\"pf_pdf_actuacion_fiscal_ejecucion.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t}\r\n\t\telse if (fproceso == \"02\") {\r\n\t\t\tif (pdf == \"planificacion\")\r\n\t\t\t\twindow.open(\"pf_pdf_potestad_investigativa.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t\telse if (pdf == \"ejecucion\")\r\n\t\t\t\twindow.open(\"pf_pdf_potestad_investigativa_ejecucion.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t}\r\n\t\telse if (fproceso == \"03\") {\r\n\t\t\tif (pdf == \"planificacion\")\r\n\t\t\t\twindow.open(\"pf_pdf_determinacion_responsabilidades.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t\telse if (pdf == \"ejecucion\")\r\n\t\t\t\twindow.open(\"pf_pdf_determinacion_responsabilidades_ejecucion.php?forganismo=\"+forganismo+\"&fregistrod=\"+fregistrod+\"&fregistroh=\"+fregistroh+\"&forganismoext=\"+forganismoext+\"&fdependenciaext=\"+fdependenciaext+\"&fedoreg=\"+fedoreg+\"&fproceso=\"+fproceso+\"&codigo=\"+factuacion, '', 'toolbar=no, menubar=no, location=no, scrollbars=yes, height=800, width=800, left=200, top=200, resizable=yes');\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "4477a4488e53c38c9916a69063bfd113", "score": "0.47093707", "text": "async updateFileStreamsNextSeqNum () {\n\t\tawait this.data.streams.updateDirect(\n\t\t\t{ teamId: this.teamId, type: 'file' },\n\t\t\t{ $set: { nextSeqNum: 1 } },\n\t\t\t{ multi: true }\n\t\t);\n\t}", "title": "" }, { "docid": "2804174d25e591ac01cc56bdf036458c", "score": "0.46923298", "text": "function assignStepSeqNumbers() {\n var currentStepListItems = document.getElementById(\"sortableCurrentSteps\").getElementsByTagName(\"li\");\n var doAllStepsHaveOper = true;\n\n if (currentStepListItems.length == 0) { //Checks if there aren't any steps.\n submitButtonsValidationResponse(false, \"Cannot Lock or Save without any steps\");\n }\n else {\n submitButtonsValidationResponse(true, \"\");\n\n for (var i = 0; i < currentStepListItems.length; i++) { //Iterates through steps. If a step doesn't have an operation, doAllStepsHaveOper is set to false.\n currentStepListItems[i].id = currentStepListItems[i].id.substring(0, (currentStepListItems[i].id.indexOf(\"-\") + 1)) + i;\n\n var currentStepIdInput = currentStepListItems[i].getElementsByTagName(\"input\")[0];\n currentStepIdInput.id = currentStepIdInput.id.substring(0, currentStepIdInput.id.indexOf(\"-\") + 1) + i;\n currentStepIdInput.name = \"CurrentStepIds[\" + i + \"]\";\n\n var currentStepOperInput = currentStepListItems[i].getElementsByTagName(\"input\")[1];\n currentStepOperInput.id = currentStepOperInput.id.substring(0, currentStepOperInput.id.indexOf(\"-\") + 1) + i;\n currentStepOperInput.name = \"CurrentOperationIds[\" + i + \"]\";\n if (currentStepOperInput.value == \"\") { doAllStepsHaveOper = false; }\n\n var currentStepSeqInput = currentStepListItems[i].getElementsByTagName(\"input\")[2];\n currentStepSeqInput.id = currentStepSeqInput.id.substring(0, currentStepSeqInput.id.indexOf(\"-\") + 1) + i;\n currentStepSeqInput.value = i;\n\n //Collapse Anchor, Operation Anchor, collapsable div\n var theAnchors = currentStepListItems[i].getElementsByTagName(\"a\");\n\n //This just finds the \"-\" and replaces the number after it, which is the the seq number\n theAnchors[0].dataset.target = theAnchors[0].dataset.target.substring(0, (theAnchors[0].dataset.target.indexOf(\"-\") + 1)) + i; //Update anchor collapse data target\n theAnchors[0].id = theAnchors[0].id.substring(0, (theAnchors[0].id.indexOf(\"-\") + 1)) + i;\n theAnchors[1].id = theAnchors[1].id.substring(0, (theAnchors[1].id.indexOf(\"-\") + 1)) + i;\n //Finds the collapsable details div on the step and replaces to seq number\n for (var j = 0; j < currentStepListItems[i].childNodes.length; j++) {\n if (currentStepListItems[i].childNodes[j].id != undefined) {\n if (currentStepListItems[i].childNodes[j].id.startsWith(\"currentStepDetails_\")) {\n var detailsDivId = currentStepListItems[i].childNodes[j].id;\n currentStepListItems[i].childNodes[j].id = detailsDivId.substring(0, (detailsDivId.indexOf(\"-\") + 1)) + i;\n }\n }\n }\n }\n\n if (doAllStepsHaveOper) {\n submitButtonsValidationResponse(true, \"\");\n }\n else {\n submitButtonsValidationResponse(false, \"Every step needs to have an operation to lock or save.\");\n }\n }\n}", "title": "" }, { "docid": "2be2bba81973104c39b327ae509586ed", "score": "0.46885577", "text": "function get_next_seq () {\n if (!getItem('userid')) return null ; // error - not logged in\n var seq = getItem('seq') ;\n if (!seq) {\n seq = '0' ;\n setItem('seq', seq) ;\n }\n seq = parseInt(seq) + 1 ;\n setItem('seq', seq.toString()) ;\n return seq ;\n } // get_next_seq", "title": "" }, { "docid": "e405ee843cabd40209569dea2aa6eed8", "score": "0.46876034", "text": "function setupEditForm() {\n\n\t\t$(\"#_ProcessFormBuilderView\").click(function(e) {\n\t\t\tsetupPreviewViewport('ProcessFormBuilderView');\n\t\t\treturn false;\n\t\t});\n\n\t\t$(\"#_ProcessFormBuilderEntries\").attr('href', '../listEntries/?id=' + $('#form_id').attr('value'));\n\n\t\t$formFields.change(formFieldsChangeEvent).bind('init', formFieldsChangeEvent);\n\n\t\t$(\"#_ProcessFormBuilderEmbed\").click(function() {\n\t\t\t$.get(\"../embedForm?id=\" + $(\"#form_id\").val(), function(data) {\n\t\t\t\t$(\"#ProcessFormBuilderEmbedMarkup\").html(data);\n\t\t\t\t$(\".ProcessFormBuilderAccordion\").accordion({autoHeight: false, heightStyle: 'content'});\n\t\t\t});\n\t\t});\n\n\t\t$(\"#_ProcessFormBuilderExport\").click(function() {\n\t\t\t$.get(\"../exportForm?id=\" + $(\"#form_id\").val(), function(data) {\n\t\t\t\t$(\"#ProcessFormBuilderExportJSON\").val(data).click(function() {\n\t\t\t\t\t$(this).select()\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t\t\n\t\tvar $columnWidth = $(\"#columnWidth\");\n\t\tif($columnWidth.length > 0 && parseInt($columnWidth.val()) < 1) $columnWidth.val('100');\n\n\t\t// submit/save settings\n\t\tif($(\"#fieldsetActions\").length > 0) {\n\t\t\t$(\"#wrap_Inputfield_form_saveFlags\").find('input').change(saveFlagsChangeEvent);\n\t\t\tsaveFlagsChangeEvent();\n\t\t}\n\n\t\tsetupModalFieldEditor();\n\t\tsetupListFieldsColumnWidthAdjust();\n\t}", "title": "" }, { "docid": "6d8afed10d6369832535a45c39694854", "score": "0.46830866", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cccTipoAbonoSubprFrm.accion'), \n\t\tget('cccTipoAbonoSubprFrm.origen'));\n\n\n\tset('cccTipoAbonoSubprFrm.id', jsCccTipoAbonoSubprId);\n\tset('cccTipoAbonoSubprFrm.subpOidSubp', [jsCccTipoAbonoSubprSubpOidSubp]);\n\tset('cccTipoAbonoSubprFrm.tcabOidTcab', [jsCccTipoAbonoSubprTcabOidTcab]);\n\tset('cccTipoAbonoSubprFrm.cucoOidCuenCont', [jsCccTipoAbonoSubprCucoOidCuenCont]);\n\t\n}", "title": "" }, { "docid": "d2d853e96dde550ab248c18e50dd84d1", "score": "0.4674315", "text": "function onLoad()\n{\n for (var fi = 0; fi < document.forms.length; fi++)\n {\t\t\t// loop through all forms\n\t\tvar\tform\t\t= document.forms[fi];\n\n\t\t// set action methods for form as a whole\n\t\tif (form.name == 'indForm')\n\t\t{\t\t// main form\n\t\t form.onsubmit\t\t= validateForm;\n\t\t // feedback from dialog to get IDIR of second individual\n\t\t form.callidir\t\t= callidir;\n\t\t}\n\n\t\t// activate handling of key strokes in text input fields\n\t\t// including support for context specific help\n\t\tvar formElts\t= form.elements;\n\t\tfor (var i = 0; i < formElts.length; ++i)\n\t\t{\t\t// loop through elements\n\t\t var element\t= formElts[i];\n\n\t\t // take action on specific elements by name\n\t\t var\tname\t= element.name;\n\t\t if (name.length == 0)\n\t\t\t\tname\t= element.id;\n\t\t switch(name)\n\t\t {\t\t// switch on name of element\n\t\t\t\tcase 'choose':\n\t\t\t\t{\t// pop up dialog of matching individuals\n\t\t\t\t element.onclick\t= chooseIndivid;\n\t\t\t\t element.focus();\n\t\t\t\t break;\n\t\t\t\t}\t// pop up dialog of matching individuals\n\n\t\t\t\tcase 'donotmerge':\n\t\t\t\t{\t// mark to never merge\n\t\t\t\t element.onclick\t= doNotMerge;\n\t\t\t\t break;\n\t\t\t\t}\t// mark to never merge\n\n\t\t\t\tcase 'view2':\n\t\t\t\t{\t// view details of second individual\n\t\t\t\t element.onclick\t= viewSecond;\n\t\t\t\t break;\n\t\t\t\t}\t// view details of second individual\n\n\t\t\t\tdefault:\n\t\t\t\t{\t// other elements\n\t\t\t\t if (element.type == 'checkbox')\n\t\t\t\t {\n\t\t\t\t\t\telement.onclick\t= radioButton;\n\t\t\t\t }\t// check box\n\t\t\t\t else\n\t\t\t\t {\t// other input element\n\t\t\t\t\t\telement.onkeydown\t= keyDown;\n\t\t\t\t\t\telement.onchange\t= change;\n\t\t\t\t }\t// other input element\n\t\t\t\t break;\n\t\t\t\t}\t// default\n\t\t }\t\t// switch on name of element\n\t\t}\t\t// looping through elements\n }\t\t\t// loop through all forms\n}", "title": "" }, { "docid": "4bff89df9656b5b28588fb6ed49235ed", "score": "0.46724594", "text": "function f_imprime_factura(){\n\tf\t\t\t\t= document.form1;\n\tf.target = \"_blank\";\n\tnavegar(1028);\n}", "title": "" }, { "docid": "fa37d1e1dfbc85d537a1ec02979c1e6f", "score": "0.46691588", "text": "function funcSetStoredTextInput(form_FD) {\n if (form_FD) {\n let inputDOM;\n\n for (let [key, value] of Object.entries(form_FD)) {\n\n inputDOM = document.getElementById(key);\n\n if (inputDOM && inputDOM.getAttribute(\"type\") === \"text\" && inputDOM.readOnly === false) {\n // console.log(key, value);\n inputDOM.value = value;\n }\n }\n }\n}", "title": "" }, { "docid": "30d411cee0d50b6e970abbc428a1fbf3", "score": "0.46634823", "text": "function formId() {\n var _id = FormApp.getActiveForm().getId();\n}", "title": "" }, { "docid": "06c962fdfc4086a24be41828ffbc0cf0", "score": "0.46629724", "text": "get localSequenceNumber() {\n return this.dialogState.localSequenceNumber;\n }", "title": "" }, { "docid": "a2a92184927661d2670730d2f02b33cc", "score": "0.46600544", "text": "function _nxt_form() {\n\n\t\t\t\tvar nextForms = moduleNext.find('#_feedback form');\n\n\t\t\t\tnextForms.each(function () {\n\n\t\t\t\t\tvar form = $(this),\n\t\t\t\t\t\ttoggleForms = form.find('.toggle-form'),\n\t\t\t\t\t\ttoggleFormsBoxes = form.find('.toggle-box'),\n\t\t\t\t\t\tformConfirm = moduleNext.find('#_feedback .confirm');\n\t\t\t\t\t\t_class = 'open';\n\n\t\t\t\t\ttoggleForms.each(function () {\n\t\t\t\t\t\tvar toggleForm = $(this),\n\t\t\t\t\t\t\toption = toggleForm.attr('data-option') || 'Error',\n\t\t\t\t\t\t\ttoggleHandle = toggleForm.find('.toggle-handle'),\n\t\t\t\t\t\t\ttoggleBox = toggleForm.find('.toggle-box'),\n\t\t\t\t\t\t\tcancel = toggleForm.find('.cancel'),\n\t\t\t\t\t\t\tsubmit = toggleForm.find('.submit'),\n\t\t\t\t\t\t\ttextarea = toggleForm.find('textarea'),\n\t\t\t\t\t\t\tspeed = 300;\n\n\t\t\t\t\t\ttoggleHandle.on('click', function (event) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\ttoggleFormsBoxes.slideUp(speed);\n\t\t\t\t\t\t\ttoggleBox.slideDown(speed);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tcancel.on('click', function (event) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\ttoggleFormsBoxes.slideUp(speed);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t//handle form submission\n\t\t\t\t\t\tsubmit.on('click', function (event){\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tnextForms.hide();\n\t\t\t\t\t\t\tformConfirm.show();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t}", "title": "" }, { "docid": "93e683a530e704e5672a0f2e12331227", "score": "0.46542093", "text": "fill_form( ) {\n let data = new Information( this.cid ).read();\n console.log( data );\n Object.keys( data ).forEach( (key) => {\n this.handle.elements[ key ].value = data[ key ];\n } ); // end for each key\n }", "title": "" }, { "docid": "5fd81006f29b609d444011d3b961d537", "score": "0.46523938", "text": "function pager_form(e) {\n e.preventDefault();\n var value = this.get('value');\n var olMap = Y.one('.olMap');\n var olMapData = olMap.getData();\n var current = parseInt(olMapData.sequence, 10);\n var css_class;\n if (value.match(/\\D/)) {\n css_class = 'error';\n }\n else {\n value = parseInt(value, 10);\n if (value !== current && (value > 0 && value <= sequenceCount)) {\n css_class = 'ok';\n Y.one('.current_page').set('text', value);\n pjax.navigate(bookUrl + '/' + value);\n }\n else {\n if (value !== current) {\n css_class = 'error';\n }\n else {\n css_class = 'warning';\n }\n }\n }\n this.addClass(css_class).transition({\n duration: 1,\n easing: 'ease-in',\n opacity: 0.9\n }, function() {\n this.removeClass(css_class);\n });\n }", "title": "" }, { "docid": "a09faa529bba5b329d9e532e63098805", "score": "0.46479565", "text": "function removeSeqForm(e) {\n //const sequences = document.querySelector('#new-meeting-sequences');\n //sequences.removeChild(i);\n const elem = e.target.parentElement;\n const parent = document.querySelector('#new-meeting-sequences');\n\n const i = Array.prototype.indexOf.call(parent.children, elem);\n sequenceForm.splice(i, 1);\n\n parent.removeChild(elem);\n}", "title": "" }, { "docid": "8929fc8f895152e14dee8cbe11af9de5", "score": "0.46465182", "text": "function f_asignar_valores(){\n\tf\t\t\t= document.form1;\n\tf.cod_tabla_detalle.value = 11;\n\tf.cod_tabla.value = 1;\n\tnavegar_limpiando_variables(1022);\t\n\n}", "title": "" }, { "docid": "d03caa4ffc904ee536e4290d7d308768", "score": "0.46265674", "text": "function newDesignId(){\n\t\tvar\n\t\t\tsavedDesigns = params.get('savedDesigns'),\n\t\t\ti = savedDesigns.length,\n\t\t\tid = 0\n\t\t;\n\t\twhile (i--){\n\t\t\tif (savedDesigns[i].id >= id){\n\t\t\t\tid = savedDesigns[i].id + 1;\n\t\t\t}\n\t\t}\n\t\treturn id;\n\t}", "title": "" }, { "docid": "58ba1bcd9aeb88873b2547afbe5717f9", "score": "0.46218082", "text": "static getID(ctx) {\n return ctx.currentID || `p-${HTMLForm.domID++}`;\n }", "title": "" }, { "docid": "58ba1bcd9aeb88873b2547afbe5717f9", "score": "0.46218082", "text": "static getID(ctx) {\n return ctx.currentID || `p-${HTMLForm.domID++}`;\n }", "title": "" }, { "docid": "a99505f026b95df0e1872128f58d378d", "score": "0.4620416", "text": "function setIDs() {\n // Get all the elements with the 'setID' class\n let elements = document.getElementsByClassName('setID');\n\n // Iterate through all the element\n for (let i = 0; i < elements.length; i++) {\n // If it is of the type input\n if (elements[i].tagName.toLowerCase() === \"input\") {\n // Create an id\n let id = 1000 + i;\n // Set the id of the element\n elements[i].id = id;\n // If the next element has the 'setFor' class\n if (elements[i].nextElementSibling.classList.contains('setFor')) {\n // Set the for value to the id\n elements[i].nextElementSibling.htmlFor = id;\n }\n }\n }\n}", "title": "" }, { "docid": "8fa56710fdf0ca28d0f3a3ed5e0ba48a", "score": "0.46126693", "text": "genNewOutId() {\n this.fIndex++;\n }", "title": "" }, { "docid": "4787703b402e92ce83e39237ecff4075", "score": "0.46042106", "text": "upIterator() {\n let canContinue = this.determineMaxPrullenbakken();\n if (!canContinue) return;\n\n if (this.iterator < this.details.length) {\n let div = document.createElement('div');\n let numberBox = document.createElement(\"input\");\n let textBoxLabl = document.createElement(\"label\");\n\n if (this.details[this.iterator] == 'Prullenbakken') {\n textBoxLabl.className = \"ml-2\";\n textBoxLabl.innerText = this.details[this.iterator] + ` (max. ${this.maxPrullenbakken}):`;\n let formElementsToLock = document.getElementsByClassName('formElement');\n for (const e of formElementsToLock) {\n e.disabled = true;\n }\n } else {\n textBoxLabl.className = \"ml-2\";\n numberBox.className = \"ml-2 formElement\";\n textBoxLabl.innerText = this.details[this.iterator] + \":\";\n }\n\n numberBox.id = this.details[this.iterator];\n numberBox.type = \"number\";\n numberBox.min = \"0\";\n numberBox.required = true;\n\n if (this.limits[this.iterator] != undefined) {\n // check for tents. If a tent is 'placed', change the limits.\n if (this.iterator == 1) {\n let tentenBox = document.getElementById(\"Tenten\");\n tentenBox.addEventListener(\"change\", () => {\n this.handleTentChanges();\n });\n }\n numberBox.max = this.limits[this.iterator];\n }\n textBoxLabl.setAttribute(\"for\", this.details[this.iterator]);\n\n div.appendChild(textBoxLabl);\n div.appendChild(numberBox);\n\n this.form.appendChild(div);\n this.formfields.push(numberBox);\n this.iterator = this.iterator + 1;\n } else {\n let next = document.getElementById(\"nextBtn\");\n next.remove();\n let finish = document.createElement(\"button\");\n finish.innerText = \"Afronden\";\n finish.id = \"finish\";\n finish.addEventListener(\"click\", () => {\n this.saveForm();\n });\n this.formContainer.appendChild(finish);\n }\n }", "title": "" }, { "docid": "207cc3926aa6b98e595bf937f047d223", "score": "0.45987788", "text": "function addSequenceNumber(name_col_seq, name_col_proyect, name_col_date, num_char_base, num_digits_seq, proyect, date) {\n // Get the sheet where we save the answers\n var sheet = SpreadsheetApp.getActiveSheet();\n // Get the last row with data\n var row = sheet.getLastRow();\n // Get col\n var col = getColumnNumByName(sheet, name_col_seq) + 1;\n // Call to function to get sequence number\n var record = getSequenceNumber(sheet, getColumnNumByName(sheet, name_col_proyect), getColumnNumByName(sheet, name_col_date), num_char_base, num_digits_seq, proyect, date.getYear());\n // Set the sequence number in the cell specified\n sheet.getRange(row, col).setValue(record);\n}", "title": "" }, { "docid": "811b48e3e00a5c56909b892ebe0272ae", "score": "0.4595685", "text": "function initDispositionValues(){\r\n\tif (isDispositionSupported()){\r\n\t\tfor (var j = 0; j < dispositionCount; j++) {\r\n\t\t\tvar cb = codesComboboxes[j+\"\"];\r\n\t\t\tcb.clearValue();\r\n\t\t\t//in hierarchical mode, clear the children as well\r\n\t\t\tif (j > 0 && isHierarchical()) {\r\n\t\t\t\tcb.store.removeAll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tagentNotesTextArea.setValue('');\r\n\tupdateSmartPad('');\r\n}", "title": "" }, { "docid": "a22f50939eb0c2888a58f1d810ae817b", "score": "0.4589113", "text": "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('recOperaViewFrm.accion'), \n\t\tget('recOperaViewFrm.origen'));\n\n\n\tset('recOperaViewFrm.id', jsRecOperaViewId);\n\tset('recOperaViewFrm.codOper', jsRecOperaViewCodOper);\n\tset('recOperaViewFrm.valDescLarg', jsRecOperaViewValDescLarg);\n\tset('recOperaViewFrm.indAnul', jsRecOperaViewIndAnul);\n\tset('recOperaViewFrm.indIngrEnvi', jsRecOperaViewIndIngrEnvi);\n\tset('recOperaViewFrm.valIngrDevu', jsRecOperaViewValIngrDevu);\n\tset('recOperaViewFrm.valPerd', jsRecOperaViewValPerd);\n\tset('recOperaViewFrm.indEspeMercFisi', jsRecOperaViewIndEspeMercFisi);\n\tset('recOperaViewFrm.indDevuFisiFact', jsRecOperaViewIndDevuFisiFact);\n\tset('recOperaViewFrm.numCampHist', jsRecOperaViewNumCampHist);\n\tset('recOperaViewFrm.indEnviGeneDevu', jsRecOperaViewIndEnviGeneDevu);\n\tset('recOperaViewFrm.indDevuGeneEnvi', jsRecOperaViewIndDevuGeneEnvi);\n\tset('recOperaViewFrm.paisOidPais', [jsRecOperaViewPaisOidPais]);\n\tset('recOperaViewFrm.indFaltMerc', jsRecOperaViewIndFaltMerc);\n\t\n}", "title": "" }, { "docid": "23c3c5dda51337c3517ea610874a80aa", "score": "0.458803", "text": "function resetpagefiels(){\n document.getElementById(\"hidprevid\").value = 0;\n document.getElementById(\"hidnextid\").value = 10;\n document.getElementById(\"gotopageid\").value = \"\";\n }", "title": "" }, { "docid": "ddbbe5305072c0686076d5546fbb6244", "score": "0.4575872", "text": "function openNewMemberForm() {\r\n // let randomPhoneNr = '07' + Math.floor(Math.random() * 100000000);\r\n // globalVarStuf.phone_input.val(randomPhoneNr); \r\n globalVarStuf.availableSessions_input.val(0);\r\n globalVarStuf.usedSessions_input.val(0);\r\n globalVarStuf.startDate_input.val(today);\r\n $('#modal1').fadeIn();\r\n}", "title": "" }, { "docid": "57f7467c3e3eb851826f9324a932f597", "score": "0.4575825", "text": "function f_imprime_factura(){\n\tf\t\t\t\t= document.form1;\n\tf.target = \"_blank\";\n\tnavegar(1025);\n}", "title": "" }, { "docid": "917ea8d133066d3e8f1ea77ef97b2d6a", "score": "0.45717227", "text": "function resetPresidentForm(){\n fechaAuditoriaField.setValue('');\n usuariosAuditoriaNumberField.setValue('');\n programadaAuditoriaRadios.setValue('');\n realizadaAuditoriaRadios.setValue('');\n sectorAuditoriaCombo.setValue('');\n }", "title": "" }, { "docid": "738da093d24dbb6fe3a523fcff971e5c", "score": "0.45692983", "text": "function next_example(myform) \n{\n\tvar numoptions = myform.FIELD_COUNT.value;\n}", "title": "" }, { "docid": "52cdd96a08fb2ffc3462903acf03bb3b", "score": "0.45578352", "text": "generateSequence() {\n // ignore if no notes recorded\n if (!this.recordedNotes.length) {\n console.log('No notes recorded.');\n return;\n }\n\n // create the sequence\n const sequence = {};\n const notes = [...this.recordedNotes];\n const firstFrame = notes[0][1];\n notes.forEach(([note, framePlayed]) => {\n const relativeFrame = framePlayed - firstFrame;\n if (sequence[relativeFrame]) {\n sequence[relativeFrame].push(note);\n } else {\n sequence[relativeFrame] = [note];\n }\n });\n console.log(JSON.stringify(sequence));\n\n // clear the recording\n this.clearRecording();\n this.setAppState(3);\n }", "title": "" }, { "docid": "ab94d75ba89c1685786b00ac76808321", "score": "0.4555757", "text": "function processNewForm(form) {\n\t\t\t\tfor (let key in fields) {\n\t\t\t\t\tfields[key].trim();\n\t\t\t\t\t!!fields[key] ? numValidField++ : form[key]();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d39bb0a08c9dc0416f893da41549e317", "score": "0.4544971", "text": "function setupForms() {\n console.log('setupForms()');\n var e = document.querySelectorAll('form [type=submit]');\n for(var i=0, I=e.length; i<I; i++)\n e[i].onclick = function() { this.form.submitted = this.name; };\n}", "title": "" }, { "docid": "f4a4dbd91407e6c7c368c732f6b11829", "score": "0.45446104", "text": "async changeForm (form1, form2) {\n const shift = this.body.offsetWidth / 2\n await Doc.animate(animationLength, progress => {\n form1.style.right = `${progress * shift}px`\n }, 'easeInHard')\n Doc.hide(form1)\n form1.style.right = '0px'\n form2.style.right = -shift\n Doc.show(form2)\n form2.querySelector('input').focus()\n await Doc.animate(animationLength, progress => {\n form2.style.right = `${-shift + progress * shift}px`\n }, 'easeOutHard')\n form2.style.right = '0px'\n }", "title": "" }, { "docid": "24785e097aad3c208afd248ffa5bc809", "score": "0.4527245", "text": "function ninja_forms_mp_set_page_show( form_id, page ){\r\n\tjQuery(\"#ninja_forms_form_\" + form_id + \"_mp_page_\" + page + \"_show\").val(1);\r\n}", "title": "" }, { "docid": "c03b75e1acacd2c48d31bce56651afd3", "score": "0.45198706", "text": "function ActivateForms() {\n // Get authenticity token from head of page\n var token = authenticityToken();\n\n DOM.Each('form', function(f) {\n\n // Create an input element \n var csrf = document.createElement(\"input\");\n csrf.setAttribute(\"name\", \"authenticity_token\");\n csrf.setAttribute(\"value\", token);\n csrf.setAttribute(\"type\", \"hidden\");\n\n //Append the input\n f.appendChild(csrf);\n });\n}", "title": "" }, { "docid": "469edd1b7e91594fbcb7910450c6c9ca", "score": "0.45171934", "text": "function goToNextAndSaveData(number) {\n if (number === 2) {\n let numberOfCh = +document.getElementById(\"numberOfChoicesText\").value;\n state.choicesNumber = numberOfCh;\n Ui.initViewChoices(numberOfCh);\n Ui.changeViewModeTo(2)\n } else if (number === 3) {\n let form = document.getElementById(\"formChoice\").elements;\n var data = [];\n for (let i = 0; i < form.length; i++) {\n data[i] = form[i].value;\n }\n state.choicesNames = data;\n Ui.changeViewModeTo(3);\n } else if (number === 4) {\n let numberOfDms = document.getElementById(\"numberOfDmsText\").value;\n let numberOfCr = document.getElementById(\"numberOfCriteriaText\").value;\n state.weightNumber = numberOfDms;\n state.numberOfCritiria = numberOfCr;\n Ui.initializeCritiriaView(numberOfDms, numberOfCr);\n Ui.changeViewModeTo(4);\n } else if (number === 5) {\n let crTable = document.getElementById(\"critiriaForm\").elements;\n saveCritiria(crTable)\n Ui.initializeMatrix(state.choicesNames, state.critiriaNames)\n Ui.changeViewModeTo(5);\n } else if (number === 6) {\n let matrix = document.getElementById(\"matrixForm\").elements; \n console.log(matrix);\n saveMatrix(matrix);\n getResults();\n }\n}", "title": "" }, { "docid": "a41e91f6a036942c25055bcaf271280c", "score": "0.45081744", "text": "function addIncidentForms(num) {\n\t// The number of incidents the user has been involved in\n\tincidents = parseInt(num,10);\n\t// The div element where these incidents will go\n\tvar container = document.getElementById(\"incidents\");\n\t// If the number supplied by the user is smaller than the current incidents in the form\n\tif(incidents < prev_incidents) {\n\t\t\n\t\t// Trim the extra forms\n\t\tfor(i=prev_incidents; i>incidents; i--) {\n\t\t\t// Use 9 since each incident form uses 9 elements (1 label and 1 break line pre incident, + 1 extra break line = 4(2)+1 = 9)\n\t\t\tfor(j=0;j<13;j++) {\n\t\t\t\t// Remove elements from the back\n\t\t\t\tcontainer.removeChild(container.lastChild);\n\t\t\t}\n\t\t}\n\t}\n\t// Else if the number supplied is greater than the current incidents in the form\n\telse if(incidents > prev_incidents) {\n\t\n\t\tvar lower = prev_incidents + +1;\n\t\tvar upper = incidents + +1;\n\t\t\n\t\t// Add the new elements starting from 1 more than the current number of incidents\n\t\tfor(k=lower;k<upper;k++) {\n\t\t\t// The date input\n\t\t\tvar date_label = document.createElement('label');\n\t\t\tdate_label.setAttribute('for','incident_date'+k);\n\t\t\tvar date_input = document.createElement(\"input\");\n\t\t\tdate_input.setAttribute('type',\"date\");\n\t\t\tdate_input.setAttribute('id',\"incident_date\"+k);\n date_input.setAttribute('name',\"incident_date\"+k);\n date_input.className = \"data accident\";\n\t\t\tdate_label.appendChild(document.createTextNode(\"Date of incident \"+k+\": \"));\n\t\t\tcontainer.appendChild(date_label);\n\t\t\tcontainer.appendChild(date_input);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\n\t\t\t// The sum of claim input\n\t\t\tvar num_label = document.createElement('label');\n\t\t\tnum_label.setAttribute('for',\"claim_sum\"+k);\n\t\t\tvar num_input = document.createElement(\"input\");\n\t\t\tnum_input.setAttribute('type',\"number\");\n\t\t\tnum_input.setAttribute('id',\"claim_sum\"+k);\n num_input.setAttribute('name',\"claim_sum\"+k);\n num_input.setAttribute('min','1');\n\t\t\tnum_input.setAttribute('step','200');\n\t\t\tnum_input.className = \"data\"; \n\t\t\tnum_input.setAttribute('value',\"200\");\n\t\t\tnum_label.appendChild(document.createTextNode(\"Total sum of claim \"+k+\" £:\"));\n\t\t\tcontainer.appendChild(num_label);\n\t\t\tcontainer.appendChild(num_input);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\t\n\t\t\t// The type of incident input\n\t\t\tvar type_label = document.createElement('label');\n\t\t\ttype_label.setAttribute('for',\"type_incident\"+k);\n\t\t\tvar type_input = document.createElement('select');\n\t\t\ttype_input.setAttribute('id',\"incident_type\"+k);\n type_input.setAttribute('name',\"incident_type\"+k);\n type_input.className = \"data\";\n\t\t\ttype_input.options[0] = new Option(\"Head on collision\",\"Head on collision\",true,false);\n\t\t\ttype_input.options[1] = new Option(\"Single vehicle collision\",\"Single vehicle collision\",false,false);\n\t\t\ttype_input.options[2] = new Option(\"Intersection collision\",\"Intersection collision\",false,false);\n\t\t\ttype_label.appendChild(document.createTextNode(\"Type of incident \"+k+\": \"));\n\t\t\tcontainer.appendChild(type_label);\n\t\t\tcontainer.appendChild(type_input);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\n\t\t\t// The description of incident input\n\t\t\tvar description_label = document.createElement('label');\n\t\t\tdescription_label.setAttribute('for',\"description\"+k);\n\t\t\tvar description_input = document.createElement('input');\n\t\t\tdescription_input.setAttribute('type',\"text\");\n\t\t\tdescription_input.setAttribute('id',\"description\"+k);\n description_input.setAttribute('name',\"description\"+k);\n description_input.className = \"data\";\n\t\t\tdescription_label.appendChild(document.createTextNode(\"Description of incident \"+k+\": \"));\n\t\t\tcontainer.appendChild(description_label);\n\t\t\tcontainer.appendChild(description_input);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\n\t\t}\n\t}\n\t// Set prev_incidents to equal incidents\n\tprev_incidents = incidents;\n}", "title": "" }, { "docid": "3942ca610616676dde25bd45b24052cd", "score": "0.45053166", "text": "function onGetForm(formId, res) {\n res.set({'Content-Type': TEXT_PLAIN});\n var form = openForms[formId];\n if (formId <= 0) {\n res.status(400).end('Form numbers start with 1.', CHARSET);\n } else if (!form) {\n log('form ' + formId + ' is not open');\n if (formId < nextFormId) {\n res.status(NOT_FOUND)\n .end('Form ' + formId + ' was discarded, since the browser page was closed.',\n CHARSET);\n } else {\n res.status(NOT_FOUND)\n .end('Form ' + formId + ' has not been opened.',\n CHARSET);\n }\n } else {\n log('form ' + formId + ' viewed');\n try {\n res.set({'Content-Type': TEXT_HTML});\n if (!form.environment) {\n var parsed = parseArgs(form.args);\n form.envelope = parsed.envelope;\n form.environment = parsed.environment;\n form.environment.pingURL = '/ping-' + formId;\n form.environment.submitURL = '/submit-' + formId;\n }\n if (form.message == null) {\n form.message = getMessage(form.environment);\n if (form.message) {\n if (!form.environment.filename) {\n var foundFilename = /[\\r\\n]#[ \\t]*FORMFILENAME:([^\\r\\n]*)[\\r\\n]/.exec(form.message);\n if (foundFilename) {\n form.environment.filename = foundFilename[1].trim();\n }\n }\n const status = form.environment.message_status;\n if (!(status == 'unread' || status == 'read' || (form.envelope.ocall && form.envelope.oname))) {\n const fields = parseMessage(form.message);\n if (!form.envelope.ocall && fields.OpCall) {\n form.envelope.ocall = fields.OpCall;\n }\n if (!form.envelope.oname && fields.OpName) {\n form.envelope.oname = fields.OpName;\n }\n }\n }\n }\n log(form.envelope);\n log(form.environment);\n if (!form.environment.addon_name) {\n throw new Error('addon_name is ' + form.environment.addon_name);\n }\n if (!form.environment.filename) {\n throw new Error('filename is ' + form.environment.filename);\n }\n var html = fs.readFileSync(path.join(PackItForms, form.environment.filename), ENCODING);\n html = expandDataIncludes(html, form);\n res.send(html);\n } catch(err) {\n res.send(errorToHTML(err, form));\n }\n }\n}", "title": "" }, { "docid": "ca414bd57e13abebd9668273ca303cac", "score": "0.45041853", "text": "function setPage() {\n // Set current date\n const today = new Date();\n\n const d = today.getDay();\n const m = today.getMonth();\n const y = today.getFullYear();\n\n const todayStr = `${(d <= 9 ? '0' + d : d)}/${(m <= 9 ? '0' + m : m)}/${y}`\n\n // Set title and date\n document.querySelector(\"#title\").innerHTML = meeting.title;\n document.querySelector(\"#date\").innerHTML = todayStr;\n\n // Init progress bar\n if (interval) {\n clearInterval(interval);\n interval = undefined;\n }\n initProgressBarUI(meeting.getSequences());\n\n if(!sequenceForm.length) {\n // Add a first sequence to settings view\n addSeqForm();\n }\n}", "title": "" }, { "docid": "c9d36c92b292b49a503afd258f0c3137", "score": "0.45026913", "text": "function openForm() {\n if (document.getElementById(\"open\").value == 0) {\n document.getElementById(\"form\").style.display = \"block\";\n }\n}", "title": "" }, { "docid": "ac09a4a55429d344b61a47875950d5d7", "score": "0.45019618", "text": "function SetUpInputFields() {\n\tvar FormName = document.forms.namedItem(\"lgt_pipeline_step1_form\");\n\tFormName.Step3.style.display = \"block\";\n\tif (document.getElementById(\"rbam\").checked) {\n\t\tdocument.getElementById('dbam').style.display = \"block\";\n\t\tdocument.getElementById('dfastq').style.display = \"none\";\n\t\tdocument.getElementById('dsra').style.display = \"none\";\n\t} else if (document.getElementById(\"rfastq\").checked) {\n\t\tdocument.getElementById('dbam').style.display = \"none\";\n\t\tdocument.getElementById('dfastq').style.display = \"block\";\n\t\tdocument.getElementById('dsra').style.display = \"none\";\n\t} else if (document.getElementById(\"rsra\").checked) {\n\t\tdocument.getElementById('dbam').style.display = \"none\";\n\t\tdocument.getElementById('dfastq').style.display = \"none\";\n\t\tdocument.getElementById('dsra').style.display = \"block\";\n\t}\n\tResetText();\n}", "title": "" }, { "docid": "e1c129b5b6b6128795862e91e5c90c89", "score": "0.44977176", "text": "function update_program_sequence( program_name ) {\n var program = programs[program_name]['program'];\n var block_html_insert = codify_program( program, 0, ti + 100 );\n $(\"#program-sequence\").html(block_html_insert);\n}", "title": "" }, { "docid": "c99d14a91eb73c2429fb3466f2b8baf1", "score": "0.44902554", "text": "function changeNum(){\n var newNum = document.getElementById(\"changeNum\").value;\n if( newNum == \"\" || newNum == NaN )\n return;\n changeDMNum(newNum);\n initWrite();\n orderByName();\n}", "title": "" }, { "docid": "45be07c71aaec1dfba173d83fd2c16bb", "score": "0.44897592", "text": "function writeFormDetails( bn ) {\n // expect string\n if (bn === '' && typeof bn !== 'string') { return; }\n // retrieve requested item and pass to form fields\n\t var c, \n\t ele, \n\t\t savedItemObj = JSON.parse( window.localStorage.getItem(bn) );\n\t for (c in savedItemObj) {\n\t ele = document.getElementsByName(c)[0];\n\t if (ele !== undefined && 'value' in ele) {\n\t\t ele.value = savedItemObj[c];\n\t\t }\n\t\t ele = null;\n }\n }", "title": "" }, { "docid": "77bce2d38eb2c7abd98fe6d4e25db304", "score": "0.4484977", "text": "function _setCounterValue() {\n\t\t\n\t\t\tobj.children('[name=\"' + _getOption('counterFieldName') + '\"]').val(_getOption('number'));\n\t\t\t\n\t\t}", "title": "" }, { "docid": "92ed1a65b312425c0b2448847fa1236f", "score": "0.4482874", "text": "function seq2frame(seqno) {\n var frameno;\n\n /* sanitize for lower bound */\n if (seqno < 0) seqno = 0;\n\n /* lookup the frame number assigned to the sequence number, thereby sanitizing for the\n * upper sequence number bound */\n switch (s.mode) {\n case \"movie\":\n // in movie mode, the frameno equals the seqno\n if (seqno >= s.frameCount) return null;\n frameno = seqno;\n break;\n case \"sequence\":\n if (seqno >= s.sequence.length) return null;\n frameno = s.sequence[seqno];\n break;\n case \"varsequence\":\n if (seqno >= Math.floor((s.sequence.length + 1) / 2)) return null;\n frameno = s.sequence[2 * seqno];\n break;\n //default: return null;\n }\n\n return frameno;\n }", "title": "" }, { "docid": "2d02c4f04c6e79b17f236a82725e1f59", "score": "0.44809872", "text": "function resetPresidentForm(){\n moduloField.setValue('');\n accionField.setValue('');\n iconoField.setValue('');\n ordenField.setValue('');\n }", "title": "" }, { "docid": "f1f85bf9672fb8d71bc7eb067e4c6243", "score": "0.44808447", "text": "function AbreForm() {\n debugger; \n\n var NomFrm = txtForm.GetText();\n window.open(NomFrm, '_parent', 'channelmode = no,directories = no,fullscreen = yes,height=665,width=1230,left = 80,location = no,menubar = no,resizable = yes,scrollbars = yes,status = no,titlebar = ' + NomFrm + ',toolbar = no,top = 0')\n \n}", "title": "" }, { "docid": "db5a4a17a5e6676a8cfc7ded95eeb59f", "score": "0.4471216", "text": "function prueba_formulario_registro_cards(){\n\tvar ide = $('#cards-list-tab').data('newid')\n\tide++;\n\n\t$('#formCards #name').val('prueba: '+ide)\n\t$('#formCards #email').val('prueba'+ide+'@admin.com')\n\t$('#formCards #password').val('qaws12pj-22')\n}", "title": "" }, { "docid": "13d8fdb49284deba72742d43251db20a", "score": "0.44696254", "text": "function openCardForm(evt) {\n formCardEl.reset();\n openModal(modalCard);\n}", "title": "" }, { "docid": "c88d6b408306f4112e00e436282a4e4b", "score": "0.4463837", "text": "function CreateForm() {\n \n \n\n\n var mainform = 'Form not found <= CreateForm';\n if(forms.hasOwnProperty(this.formid)){\n mainform = forms[this.formid].bind(this)();\n }\n return mainform;\n\n\n }", "title": "" }, { "docid": "6b72f4c7cd4c5874e3e938c68c5dfb62", "score": "0.4461202", "text": "function renewForm() {\n getMyEle('fname-field').value = '';\n getMyEle('lname-field').value = '';\n getMyEle('id-num-field').value = '';\n getMyEle('role-field').selectedIndex = 0;\n}", "title": "" }, { "docid": "e7ea8e34084fba356d86c51e2d826eda", "score": "0.4458998", "text": "submit( event ) {\n console.log( 'EditForm submit' );\n let params = new Parameters( this.handle );\n event.preventDefault();\n new Information( this.cid ).write( params.all() );\n console.log( 'CID 02: ', this.cid );\n window.location.href = './complete.html#' + this.cid;\n }", "title": "" }, { "docid": "b9ca616751b96d9d61f0de1c7eab3c47", "score": "0.4458323", "text": "onChange()\n {\n this._localID++;\n }", "title": "" } ]
57a05b7b7e0ebb059a40458eefc70941
Add an event listener
[ { "docid": "89f0c4ecb6d18364417196126368b4ee", "score": "0.67881817", "text": "addEventListener(event, listener) {\n this.source.addEventListener(\"change\", listener);\n }", "title": "" } ]
[ { "docid": "30219bf06e589f8ed1bd6cec04ef40cc", "score": "0.75155467", "text": "on(event, listener){\n this._events.on(event, listener);\n }", "title": "" }, { "docid": "1e472dda6c259e87ed9c711e1db71ef0", "score": "0.7504734", "text": "addListener(listener){ this.listener.push(listener) }", "title": "" }, { "docid": "7b0edf582cadb30b1a58b21323dbef9a", "score": "0.7503936", "text": "addEventListener(listener){\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "33b6422e9581cbfb8512135f3151244b", "score": "0.73286664", "text": "addListener(listener) {\n this.listeners.push(listener);\n }", "title": "" }, { "docid": "74548eb0b914059ac937167660aeb7f0", "score": "0.7290296", "text": "function addEventListener( eventName, callback ) {\n\t\tif ( eventName && callback ) {\n\t\t\tlisteners.push( { eventName, callback } );\n\t\t} else {\n\t\t\tthrow 'Error : an argument is missing';\n\t\t};\n\t}", "title": "" }, { "docid": "e6bc53ae824b6ec20619dfb35e3e314a", "score": "0.7264031", "text": "addListener(listener) {\n\t\tthis.listeners.push(listener);\n\t}", "title": "" }, { "docid": "ac20b42b42a5c8be438620eb672e56be", "score": "0.72578585", "text": "addListeners(){}", "title": "" }, { "docid": "172e4163aa152ebeb1bc3dfed3be9fa8", "score": "0.72307795", "text": "function add_listener(comp) {\r\n comp.on(event_name, listener, me, listeners.options);\r\n }", "title": "" }, { "docid": "6dbec92db5f7e3e8fd941b0e9b20464e", "score": "0.72017884", "text": "addListener(listener) {\n this.listeners.push(listener.bind(this).listener);\n }", "title": "" }, { "docid": "344b699f6e31bb82dc2e4c873e3bb4cd", "score": "0.71470016", "text": "addEventListener(eventName, listener) {\n if(eventName == \"update\") {\n if(this._tweeker) {\n this._container.addEventListener(eventName, listener);\n }\n }\n else {\n this._container.addEventListener(eventName, listener);\n }\n }", "title": "" }, { "docid": "515041b6b2650e548ee3a2ee92c7fd35", "score": "0.7085425", "text": "addListener(listener)\n\t{\n\t\tthis._listeners.push(listener);\n\t}", "title": "" }, { "docid": "cfb843c13ce01b92b2b6482d92786d31", "score": "0.7073962", "text": "on(type, listener) {\n\t this.each(el => el.addEventListener(type, listener));\n\t }", "title": "" }, { "docid": "30aabf17b5630d8f8f043a8daa2a5f06", "score": "0.70670074", "text": "on(eventName, callback) {\r\n\t\tthis.listeners.push({\"eventName\":eventName, \"callback\":callback})\r\n\t}", "title": "" }, { "docid": "8d188e7d88f97930bf8f99b7087ad814", "score": "0.7056234", "text": "function listen(event, listener) {\n window.addEventListener(event, function (e) {\n listener(e.detail);\n });\n }", "title": "" }, { "docid": "3c596a37d7bad3b132ba706c489a284c", "score": "0.7031136", "text": "on(eventType, listener) {\r\n const events = this.events;\r\n const eventList = Array.isArray(eventType) ? eventType : [eventType];\r\n eventList.forEach(eventType => {\r\n if (!events.has(eventType))\r\n events.set(eventType, [listener]);\r\n else\r\n events.get(eventType).push(listener);\r\n });\r\n }", "title": "" }, { "docid": "892bb2d0785e7deaba983bd1c42fccc3", "score": "0.7002343", "text": "function onFn(event, callback) {\n\n if (!listeners[event]) {\n listeners[event] = [];\n }\n\n listeners[event].push(callback)\n }", "title": "" }, { "docid": "7949d410f7947e349b07c0ae3f0946c5", "score": "0.69792825", "text": "function listen(fn) {\n listeners.push(fn);\n }", "title": "" }, { "docid": "eef9d5c8f44bab39101150b42c906cf0", "score": "0.6967643", "text": "function main() {\n addEventListeners()\n}", "title": "" }, { "docid": "c93509a591008b785ec2ca0cd8ccb5d2", "score": "0.696409", "text": "function addEventListeners() {\n canvas.addEventListener('click', clickListener, false);\n}", "title": "" }, { "docid": "3b5ae743aed72df83cfeafec24bce731", "score": "0.6923805", "text": "on(event, callback) {\n this.addEventListener(event, callback)\n }", "title": "" }, { "docid": "11b8c7faba8b3ded1dfe40bb784e06c2", "score": "0.69175965", "text": "function addEventListeners() {\n document.getElementById(\"createNewFile\").addEventListener(\"click\", openDialog);\n document.getElementById(\"dialogClose\").addEventListener(\"click\", closeDialog);\n document.getElementById(\"save\").addEventListener(\"click\", saveEditing);\n document.getElementById(\"delete\").addEventListener(\"click\", openDeleteLists);\n document.getElementById(\"cancelBtn\").addEventListener(\"click\", closeEditingWindow);\n document.getElementById(\"createFileButton\").addEventListener(\"click\", setAction);\n\n console.log(\"HUB: EventListeners have been loaded\");\n}", "title": "" }, { "docid": "1c94eb66603553d198e350982e668cc2", "score": "0.69095516", "text": "function main() {\n addEventListeners();\n}", "title": "" }, { "docid": "0de3c9ed888cdf675eaffb95ec8e48fb", "score": "0.68463236", "text": "addEventListener (event = String, fn = Function) {\n }", "title": "" }, { "docid": "533f90714f4a30bf0c05e71a7cb2115e", "score": "0.68334794", "text": "function addListener(eventType, fn) {\n if (document.addEventListener) {\n document.addEventListener(eventType, fn, false);\n } else {\n document.attachEvent(\"on\" + eventType, fn);\n }\n}", "title": "" }, { "docid": "833cbd57df82f11328d68c98148b2b34", "score": "0.6807058", "text": "addListeners() {\n this.eventListeners('addEventListener');\n }", "title": "" }, { "docid": "b6601ecc4e8fb989bca9a22d9b966a70", "score": "0.67944896", "text": "addEventListener(type, handler, options = {}) {\n if (!this.__eventListener[type]) {\n this.__eventListener[type] = [];\n }\n this.__eventListener[type].push({ cb: handler, options });\n }", "title": "" }, { "docid": "36e0aa55bbfe66841e5fcfa1a7cd1b17", "score": "0.6793322", "text": "function createEventListener() {\n\t\"use strict\";\n\t// event listener for the add button\n\tif (addButton.addEventListener) {\n\t\taddButton.addEventListener(\"click\", addHeroToList, false);\n\t} else if (addButton.attachEvent) {\n\t\taddButton.attachEvent(\"onclick\", addHeroToList);\n\t}\n}", "title": "" }, { "docid": "ca4c4853628ee665235a01699b429d8a", "score": "0.6741073", "text": "function listener(event, exec_state, event_data, data) {\n }", "title": "" }, { "docid": "087c96fbc17da3290fc0eefd767027a8", "score": "0.6736951", "text": "function addListener(element, events, listener) {\n if (!element || !element.addEventListener)\n return;\n if (!Array.isArray(events))\n events = [events];\n element.addEventListener(events.join(' '), listener);\n}", "title": "" }, { "docid": "63622f8af0ba45aa82875dc8fddf809b", "score": "0.6734939", "text": "listener_on(listener = this.listener) {\n this.addListener('scheduled_evt', listener);\n }", "title": "" }, { "docid": "994f61c09cadf6aee82c9a6ae3090aa0", "score": "0.6734834", "text": "function _addEventListeners() {\n dom.$button.on( 'click', _onButtonClick );\n dom.$window.on( 'hashchange', _onHashChange );\n }", "title": "" }, { "docid": "326ee89b3837790c33a0dfaa06be9e77", "score": "0.67295146", "text": "addEventListener(type, listener) {\r\n if (this._listeners[type]) {\r\n this._listeners[type].push(listener);\r\n }\r\n }", "title": "" }, { "docid": "17d1db8755dab1dace0008c518d72818", "score": "0.67254114", "text": "function addClickNodeListener (callback) {\n clickNodeListeners.push(callback);\n }", "title": "" }, { "docid": "db915629e7c5817226cff25c0d057f29", "score": "0.670688", "text": "function ListenEvent(e, ev, f) {\r\n if (!e) return;\r\n if (e.addEventListener) {\r\n e.addEventListener(ev, f, false);\r\n } else if (e.attachEvent) {\r\n e.attachEvent(\"on\" + ev, f);\r\n } else if (typeof e[\"on\" + ev] != \"undefined\") {\r\n e[\"on\" + ev] = f;\r\n }\r\n }", "title": "" }, { "docid": "7e67d6b9f0011bded7a813afe471edf7", "score": "0.6694264", "text": "function addEventListener() {\n openingLine.addEventListener('click', changeLine);\n settingLine.addEventListener('click', changeLine);\n characterLine.addEventListener('click', changeLine);\n sidekickLine.addEventListener('click', changeLine);\n questLine.addEventListener('click', changeLine);\n problemLine.addEventListener('click', changeLine);\n endingLine.addEventListener('click', changeLine);\n}", "title": "" }, { "docid": "15e1e1eed35f276e403e17ed4b9d4289", "score": "0.66741705", "text": "function bindWebviewEvent (event, fn) {\n webviewEvents.push({\n event: event,\n fn: fn\n })\n}", "title": "" }, { "docid": "468f14951c49a727efa89ccbd1559300", "score": "0.6670356", "text": "function addEventListeners(listeners, el) {\n var sprintClone = Sprint(el)\n Object.keys(listeners).forEach(function(key) {\n listeners[key].forEach(function(callback) {\n sprintClone.on(key, callback)\n })\n })\n }", "title": "" }, { "docid": "66990ca9e5a78d28205d97bde553b936", "score": "0.6670162", "text": "attach( listener ){\n this._listeners.push( listener );\n }", "title": "" }, { "docid": "a49b6b1b8b6a09ad8509a4fe189122fb", "score": "0.6669366", "text": "addEventListener( callback ) {\n const listenersInitialised = !!this.$$eventListeners.$$global\n ;\n\n if ( !listenersInitialised ) {\n this.$$eventListeners.$$global = [];\n }\n\n this.$$eventListeners.$$global.push( callback );\n }", "title": "" }, { "docid": "eadef4336804c62f3a45cfdbcd8673c5", "score": "0.6668349", "text": "function addOnClickEvent(){\n\t\t\tcontainer.on(\"click\", sendOnClickEvent);\n\t\t}", "title": "" }, { "docid": "8e38214a83d9ebb1e9e7be14130e42c6", "score": "0.66591674", "text": "function addListeners() {\n document.addEventListener(CLICK, onClick);\n document.addEventListener(KEY_PRESS, onKeyPress);\n document.addEventListener(KEY_UP, onKeyUp);\n}", "title": "" }, { "docid": "35091c1d7e8e642056ac81a51b1ee819", "score": "0.6658688", "text": "function listener(x){x.addEventListener(\"click\", onclick);}", "title": "" }, { "docid": "b6e92b71d478e166b16536a23e2d919c", "score": "0.66486555", "text": "registerListener(aListener) {\n this._listeners.push(aListener);\n }", "title": "" }, { "docid": "deffc4cc071e12f37c6ac039f52dd328", "score": "0.66450775", "text": "function addListener(el, ev, listener) {\n if (el.addEventListener) { \n el.addEventListener(ev, listener, false); \n } else if (el.attachEvent) { \n el.attachEvent(\"on\" + ev, listener); \n }\n}", "title": "" }, { "docid": "33b943d8eddb551fa3114f567e86f024", "score": "0.6625239", "text": "function addEvent(element,eventName,callback){if(element.addEventListener)element.addEventListener(eventName,callback,false);else element.attachEvent(eventName,callback,false);} /////////////////////////////////////", "title": "" }, { "docid": "35b7fd4c080f9bf55dfb1fc5154a5a50", "score": "0.66104716", "text": "function addEventListeners() {\n // Event listeners and handlers\n window.addEventListener('resize', onWindowResize, false);\n cv.addEventListener('wheel', onScroll, false);\n cv.addEventListener('pointerdown', pointerDown, false);\n cv.addEventListener('pointerup', pointerUp, false);\n cv.addEventListener('dblclick', onDoubleClick, false);\n}", "title": "" }, { "docid": "755abef4a4c7eb1e580c6f0bdf4ae047", "score": "0.6605895", "text": "on(...args) {\n this.addEventListener.apply(this, args);\n }", "title": "" }, { "docid": "06786fef12a81732002532754c8ce84b", "score": "0.6596981", "text": "on(event, listener) {\n (this._events[event] || (this._events[event] = [])).push(listener);\n return this;\n }", "title": "" }, { "docid": "874fb314b0327f8b4f8f4413b3edbd3e", "score": "0.6567939", "text": "function addCustomListener(object, type, handler) {\n\tif (object.addEventListener) {\n\t\tobject.addEventListener(type, handler);\n\t} else // if(object.attachEvent)\n\t{\n\t\tobject['on'+type] = handler;\n\t}\n}", "title": "" }, { "docid": "ff4c3c9b545dc0345de818c03e64694d", "score": "0.65660304", "text": "addListener(callback) {\n\t\tthis.callbacks.push(callback);\n\t}", "title": "" }, { "docid": "ff4c3c9b545dc0345de818c03e64694d", "score": "0.65660304", "text": "addListener(callback) {\n\t\tthis.callbacks.push(callback);\n\t}", "title": "" }, { "docid": "d34e392ac96fe4755eae0ea286019f2f", "score": "0.65603036", "text": "#registerEventListeners() {\n this.#addOnFocusEventListener();\n this.#addOnHelpIconClickEventListener();\n }", "title": "" }, { "docid": "99734679ddd57d9572151574930cae00", "score": "0.6551765", "text": "function addListener(evnt, func) {\n if (window.addEventListener) {\n window.addEventListener(evnt, func, false); \n } else if (window.attachEvent) window.attachEvent('on' + evnt, func);\n}", "title": "" }, { "docid": "9af756ebce763e8ad3e3f61d634aa876", "score": "0.6550593", "text": "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "title": "" }, { "docid": "9af756ebce763e8ad3e3f61d634aa876", "score": "0.6550593", "text": "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "title": "" }, { "docid": "9af756ebce763e8ad3e3f61d634aa876", "score": "0.6550593", "text": "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "title": "" }, { "docid": "9af756ebce763e8ad3e3f61d634aa876", "score": "0.6550593", "text": "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "title": "" }, { "docid": "b0cdc2534bdb9fe842b7fa35a10f790a", "score": "0.65450716", "text": "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "title": "" }, { "docid": "b0cdc2534bdb9fe842b7fa35a10f790a", "score": "0.65450716", "text": "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "title": "" }, { "docid": "b0cdc2534bdb9fe842b7fa35a10f790a", "score": "0.65450716", "text": "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "title": "" }, { "docid": "af1f52bcab0490b2bce94795fe73263e", "score": "0.65422976", "text": "function on(event, callback) {\n listeners.set(event, callback);\n}", "title": "" }, { "docid": "1311e6319181f91beb9d42a5f64b47a5", "score": "0.65422744", "text": "function addEvent(element, listener, handler) {\r\n\t//if the system is not set up, set it up, and\r\n\t// store any outside script's event registration in the first handler slot\r\n\tif(typeof element[listener] != 'function' || \r\n\ttypeof element[listener + '_num'] == 'undefined'){\r\n\t\telement[listener + '_num'] = 0;\r\n\t\tif(typeof element[listener] == 'function'){\r\n\t\t\telement[listener + 0] = element[listener];\r\n\t\t\telement[listener + '_num']++;\r\n\t\t}\r\n\t\telement[listener] = function(e){\r\n\t\t\tvar r = true; e = (e) ? e : window.event;\r\n\t\t\tfor(var i = 0; i < element[listener + '_num']; i++)\r\n\t\t\t\tif(element[listener + i](e) === false) r = false;\r\n\t\t\treturn r;\r\n\t\t}\r\n\t}\r\n\t//if handler is not already stored, assign it\r\n\tfor(var i = 0; i < element[listener + '_num']; i++)\r\n\t\tif(element[listener + i] == handler) return;\r\n\telement[listener + element[listener + '_num']] = handler;\r\n\telement[listener + '_num']++;\r\n}", "title": "" }, { "docid": "6f69c0dd4d3b5154137abcf8559288f0", "score": "0.65395546", "text": "function subscribe(listener) {\n listeners.push(listener);\n }", "title": "" }, { "docid": "f265a4fe34174d036166ef3d30fd3b9c", "score": "0.6538105", "text": "addListeners() {\n\n }", "title": "" }, { "docid": "ec4fffe1afc45745fccdc76938ce7b32", "score": "0.6529527", "text": "function addEvent(value1, value2, value3) {\n value1.addEventListener(value2, value3);\n}", "title": "" }, { "docid": "4bc834d90132de3eae5f08473395ff6e", "score": "0.6528189", "text": "function addListener(element, event, listener) {\n if (element.attachEvent) {\n return element.attachEvent('on' + event, listener);\n } else {\n return element.addEventListener(event, listener, false);\n }\n }", "title": "" }, { "docid": "791769a7cf334fa2b23c6915a5932a8a", "score": "0.65246534", "text": "function addListener(el, evt, fn) {\n if (window.addEventListener) {\n el.addEventListener(evt, fn, false);\n }\n else {\n el.attachEvent('on' + evt, fn);\n }\n}", "title": "" }, { "docid": "cc6830d4106d851744c63669057b3bc5", "score": "0.65206116", "text": "addDomListener() {}", "title": "" }, { "docid": "cc6830d4106d851744c63669057b3bc5", "score": "0.65206116", "text": "addDomListener() {}", "title": "" }, { "docid": "cc6830d4106d851744c63669057b3bc5", "score": "0.65206116", "text": "addDomListener() {}", "title": "" }, { "docid": "91f4e3934d1ae3a9acb1d9e8afbd3a87", "score": "0.65141165", "text": "on (name, listener) {\n return this.addListener(name, listener, 'on');\n }", "title": "" }, { "docid": "7dd1beacadcbd1ca8f0cbd1e772c2a47", "score": "0.65096545", "text": "addListener(event, handler) {\n const { socket, store, listeners } = this;\n const fn = (payload) => handler(payload, store);\n\n if (event in listeners) {\n throw new Error(`already listening for ${event}`);\n }\n socket.on(event, fn);\n this.listeners[event] = fn;\n }", "title": "" }, { "docid": "d1e7b83fc6ed4865c1f64f688feb643d", "score": "0.64988524", "text": "function addListener(target, eventType, fn) {\r\n\t\ttarget.attachEvent(eventType, fn);\r\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\r\n\t}", "title": "" }, { "docid": "d4462daa07b4f49fa6557c69d0ec72a5", "score": "0.64909685", "text": "function listen(evnt, elem, func) {\n\n\t\tif (elem.addEventListener) {\n\t \telem.addEventListener(evnt,func,false);\n\t\t} else if (elem.attachEvent) { // IE DOM\n\t\t\telem.attachEvent(\"on\"+evnt, func);\n\t }\n\t}", "title": "" }, { "docid": "896f3347cf75d2149c4e5b8de83a64ee", "score": "0.648822", "text": "on(event, callback) {\n this.events[event] = callback;\n }", "title": "" }, { "docid": "52c8e6aa8ab2b257c6b709488bdd07cb", "score": "0.64830226", "text": "function addEventListenerHandler(event, el, fn){\n\tel.addEventListener(event, fn, false)\n}", "title": "" }, { "docid": "915c12412342306037c26f9e117bd5a1", "score": "0.64821887", "text": "function listen(event,item,funct) {\n\t\tif(item.addEventListener) {\n\t\t\titem.addEventListener(event,funct,false);\n\t\t\tconsole.log(\"ADDEVENT\");\n\t\t}\n\t\telse if (item.attachEvent) {\n\t\t\titem.attachEvent(\"on\"+event, funct);\n\t\t\tconsole.log(\"ATTACHEVENT\");\n\t\t}\n\t\telse{\n\t\t//if both can't be done, the website won't work.\n\t\tconsole.log(\"NOEVENT\");\n\t\talert(\"couldn't attach event// UNAVAILABLE LISTENER\");\n\t\t}\n\t}", "title": "" }, { "docid": "232fe0c9119af2348b797cf51b28c5b1", "score": "0.64801884", "text": "function addListener(element, type, response) {\n if (element.addEventListener) {\n element.addEventListener(type, response, false);\n }\n else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, response);\n }\n }", "title": "" }, { "docid": "170bdba6b7614e32be69ae70715d3916", "score": "0.64654315", "text": "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "title": "" }, { "docid": "03afaa52777da5c888cc77fc69e8e0f4", "score": "0.64639044", "text": "attach(listener) {\n this._listeners.push(listener);\n }", "title": "" }, { "docid": "617a061690cf0f78152dddb7511b7a03", "score": "0.64633876", "text": "on(event, listener) {\n (this._events[event] || (this._events[event] = [])).push(listener);\n return this;\n }", "title": "" }, { "docid": "617a061690cf0f78152dddb7511b7a03", "score": "0.64633876", "text": "on(event, listener) {\n (this._events[event] || (this._events[event] = [])).push(listener);\n return this;\n }", "title": "" }, { "docid": "a1de6a3f7e798e72eed9bd9372ea70d1", "score": "0.6458988", "text": "function addListeners(component, response) {\n Object.entries(response).forEach(([eventName, funcNames]) => {\n component.attachedCustomEvents.push(eventName)\n funcNames.forEach((funcName) => {\n component.addCustomEventListener(eventName, funcName)\n })\n })\n }", "title": "" }, { "docid": "bf1ea8cd18b9caa4656f9d7aa910ca73", "score": "0.6457391", "text": "_addListeners() {\r\n this._debug('addListeners');\r\n for (const [type, handler] of this.eventToHandler) {\r\n this._ws.addEventListener(type, handler);\r\n }\r\n }", "title": "" }, { "docid": "2da391c87158441814ce199b905a6cab", "score": "0.6451766", "text": "function eventAddListener(event, listener) {\r\n\t\tevents.addListener(event, listener)\r\n\t\treturn returnObject\r\n\t}", "title": "" }, { "docid": "6aa4023511c412c60ffb84cbe9f8bf2d", "score": "0.6438584", "text": "addEventListeners() {\n this.micBtn.addEventListener(\"click\", () => this.onListenButtonClick());\n this.sendTextButton.addEventListener(\"click\", () => this.onSendButtonClick());\n this.userInput.addEventListener(\"input\", () => this.changeInputButtonOnUserInput());\n this.userInput.addEventListener(\"keypress\", (e) => this.onEnterPressed(e));\n this.hideUserInputContainerBtn.addEventListener(\"click\", () => this.toggleBotIntegrationContainer());\n }", "title": "" }, { "docid": "f9e3fc7c6e230d783cdb221695898c14", "score": "0.64346874", "text": "on (eventName, handler){\n this._handlers[ eventName ] = handler; \n }", "title": "" }, { "docid": "d5ed0e324a96169f74afdd5dbe4ba65b", "score": "0.6433896", "text": "customMapAddListener(event) {\n this.map.addListener(event);\n }", "title": "" }, { "docid": "133458da307f31fbed82d058d311782b", "score": "0.64260924", "text": "function on(el, name, fn) {\n el.addEventListener(name, fn, true);\n }", "title": "" }, { "docid": "070f3e5e6b744fa82419ca1c8c66973a", "score": "0.6424621", "text": "on(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false);\n }", "title": "" }, { "docid": "0cb3872ba9ec2de7a6c3c51988edcf4c", "score": "0.64172363", "text": "function _addEvents() {\n BUTTON.addEventListener('click', open, false);\n MODAL_CLOSE.forEach((item) => item.addEventListener('click', close, false));\n document.addEventListener('keydown', _bindKeyPress, false);\n }", "title": "" }, { "docid": "24c6f1cf19737dc95f201db672c2a593", "score": "0.6411751", "text": "function addEventListener(elementToListenTo, descriptorId, chartName){\n\n\t\t\t$(document).on(\"click\", elementToListenTo, function(){\n\t\t\t\tchartName(\"#visualizationSpace\", unique, companiesList, descriptorId);\n\t\t\t});///end event listener for button\n\t\t}", "title": "" }, { "docid": "44862ebd79941b5c02af2ef3afb849ea", "score": "0.64074713", "text": "function addEvent(el, type, handler) {\n if (el.attachEvent) el.attachEvent('on' + type, handler);\n else el.addEventListener(type, handler);\n }", "title": "" }, { "docid": "fb4ab6129408ca76049369cad31574a6", "score": "0.63944495", "text": "function on(event, func) {\n\t\t var _listeners = this._listeners;\n\t\t if (!_listeners.hasOwnProperty(event)) {\n\t\t _listeners[event] = [];\n\t\t }\n\t\t _listeners[event].push(func);\n\t\t}", "title": "" }, { "docid": "276cf8a85da9f2c58431a966d1d5166b", "score": "0.638087", "text": "addListeners() {\n this.root.querySelector(\"commit-element\").addEventListener(\"commit-button-press\", ev => {\n if(!this.tryToCommit(ev.detail)) ev.preventDefault();\n });\n this.editorContainer.addEventListener(\"editor-content-change\", ev => this.onEditorContentChange(ev.detail));\n this.root.querySelector(\"revert-button\").addEventListener(\"revert-changes\", () => this.tryToRevert());\n this.root.querySelector(\"switch-editor-buttons\").addEventListener(\"editor-button-press\", ev => this.onSwitchEditorButtonPress(ev.detail));\n this.fileBrowser.addEventListener(\"open-file\", event => this.setCurrentEditorContent(event.detail));\n this.editorContainer.addEventListener(\"change-row-selected\", event => this.chartsComponent.showTooltips(event.detail));\n this.root.querySelector(\"generate-button\").addEventListener(\"generated\", ev => {\n if(this.filePath != null) this.editor.insertGeneratedContent(ev.detail);\n });\n this.root.querySelector(\"#file-name\").addEventListener(\"dblclick\", EasterEgg);\n }", "title": "" }, { "docid": "301c67501aa9a7d63e933fd79e210711", "score": "0.6370884", "text": "addListener(event, callback, component){\n\n if(typeof callback === 'function'){\n\n if (!this.listeners.has(event)) this.listeners.set(event, []);\n this.listeners.get(event).push({ callback, component });\n\n Logger.info(`#${event} subscribe, component: ${component.$options.name}`);\n\n } else {\n\n throw new Error(`callback must be a function`);\n\n }\n\n }", "title": "" }, { "docid": "a36b2d16e0628f771607908266f14db1", "score": "0.63694483", "text": "function addEvent( el, type, fn ) {\n if (el.attachEvent) {\n el.attachEvent && el.attachEvent( 'on' + type, fn );\n } else {\n el.addEventListener( type, fn, false );\n }\n }", "title": "" }, { "docid": "60eb804825685665182e6fca9972c6e8", "score": "0.6362165", "text": "function addListeners() {\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, expandStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_FINISH, expandFinishHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_START, collapseStartHandler);\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_FINISH, collapseFinishHandler);\n creative.dom.expandButton.addEventListener('click', onExpandHandler, false);\n creative.dom.collapseButton.addEventListener('click', onCollapseClickHandler, false);\n creative.dom.expandedExit.addEventListener('click', exitClickHandler);\n creative.dom.collapsedExit.addEventListener('click', collapsedExitClickHandler);\n creative.dom.exitGauche.addEventListener('click', exitClickHandlerGauche);\n creative.dom.exitDroite.addEventListener('click', exitClickHandlerDroite);\n}", "title": "" }, { "docid": "f860b6d62432bec018302c58b4d8a9ad", "score": "0.63575065", "text": "addEvent(event, callback) {\n\t\tvar self = this;\n\t\twindow.addEventListener(event, function(e) {\n\t\t\treturn callback.apply(self, [e]);\n\t\t});\n\t}", "title": "" }, { "docid": "b425463e7234b00f63cafa80cd30d904", "score": "0.63515615", "text": "addListeners() {\n this.startGameButton.addEventListener(\"click\", this.startGameHandler);\n this.gameOptionsButton.addEventListener(\"click\", this.gameOptionsHandler);\n this.gameCreditsButton.addEventListener(\"click\", this.gameCreditsHandler);\n this.exitGameButton.addEventListener(\"click\", this.exitGameHandler);\n this.saveGameButton.addEventListener(\"click\", this.saveGameOptionsHandler);\n this.restartGameButton.addEventListener(\"click\", this.startGameHandler);\n }", "title": "" } ]
d88264b11077ed59f274679cc9640453
function to check the products stock and price of the cart before submitting order
[ { "docid": "0c7e8013a8a1f831f9372bda365a06d2", "score": "0.6414966", "text": "async function cartConfirm() {\n //console.log(\"INSIDE CONFIRM CART API-==============================================\")\n var self = this;\n var body = self.body;\n var nosql = new Agent();\n var decoded = self.token;\n var { cart, err } = await FetchExistingCart(decoded.phone);\n var outOfStockIds = [];\n if (err) {\n return self.json({ status: false, message: \"Invalid Cart\" });\n }\n for (let i = 0; i < body.length; i++) {\n var singleProduct = body[i];\n for (let j = 0; j < cart.products.length; j++) {\n var cartProduct = cart.products[j];\n // if product out of stock remove the product from cart\n if (singleProduct.statusCode == 'OUTOFSTOCK') {\n console.log(\"OUTOFSTOCK-------------------\");\n if (cartProduct.cartId == `${singleProduct.pid}-${singleProduct.vid}`) {\n outOfStockIds.push(singleProduct.pid);\n }\n }\n\n if (singleProduct.statusCode == 'PRICECHECKFAIL') {\n console.log(\"PRICE CHECK FAIL=======================\");\n var { product, err } = await FetchProduct(singleProduct.id, singleProduct.variant.id);\n\n if (err || product == null) {\n self.json({\n status: false,\n message: \"Invalid Product\"\n })\n return;\n }\n // console.log(\"product--------\", product);\n if (cartProduct.cartId == `${product.id}-${product.variant.id}`) {\n cart.products[j].variant.prices = product.variant.prices;\n }\n }\n }\n\n }\n\n\n console.log(\"outOfStockIds\", outOfStockIds);\n // remove the out of stock products from cart\n for (let k = 0; k < outOfStockIds.length; k++) {\n var pid = outOfStockIds[k];\n var pindex = cart.products.findIndex(x => x.id == pid);\n //console.log(\"cart.products.indexOf(pid)\",pindex)\n delete cart.products.splice(pindex, 1);\n }\n\n // console.log(\"cart\", cart.products);\n // return;\n // update cart product\n cart.id = decoded.phone;\n nosql.update('updateCart', 'cart').make(function (builder) {\n builder.where('id', decoded.phone)\n builder.set('products', cart.products);\n })\n var updateCart = await nosql.promise('updateCart');\n var cartData = await processCart(cart);\n // console.log(\"cartData\", cartData);\n // return;\n // nosql.update('updateCart', 'cart').make(function (builder) {\n // builder.set('products', cart.products);\n // builder.where('id', decoded.phone);\n // });\n // await nosql.promise('updateCart');\n\n // self.json({\n // status: true,\n // data: cartData\n // });\n //console.log(\"updateCart---------------------------->\",updateCart)\n if (updateCart > 0) {\n await updateCartWhenPriceChange(decoded.phone)\n self.json({\n status: true,\n data: cartData\n });\n } else {\n self.json({\n status: false,\n data: []\n });\n }\n\n}", "title": "" } ]
[ { "docid": "6828246b1317bbffb0e137c161e071f8", "score": "0.7211036", "text": "function checkCartChanges() {\n\t$('.quantities').keyup(function(){\n\t\tvar qty = $(this).val();\n\t\tvar id = $(this).data('id');\n\t\tproducts = updateCart(id, qty);\n\t\tdisplayCheckout();\n\t})\n}", "title": "" }, { "docid": "b9bdb31ce085e0e5eea7c01b4648eddc", "score": "0.68099874", "text": "function quantityCheck(key){\r\n $('[name=\"cartQty_' + key + '\"]').on('focus', function(){\r\n clearError($('[name=\"cartQty_' + key + '\"]'));\r\n });\r\n \r\n $('[name=\"cartQty_' + key + '\"]').on('blur', function(){ \r\n //Qty < 0\r\n if(Number($('[name=\"cartQty_' + key + '\"]').val()) < 0){\r\n $('[name=\"cartErrorMsg\"]').html(\"Please enter 0 or a positive number.\");\r\n errorHandler($('[name=\"cartQty_' + key + '\"]'));\r\n validShopCart = false;\r\n return;\r\n }\r\n //Qty not a number\r\n else if(isNaN($('[name=\"cartQty_' + key + '\"]').val())){\r\n $('[name=\"cartErrorMsg\"]').html(\"Please enter a number.\");\r\n errorHandler($('[name=\"cartQty_' + key + '\"]'));\r\n validShopCart = false;\r\n return;\r\n }\r\n //Qty == 0\r\n else if($('[name=\"cartQty_' + key + '\"]').val().trim() == 0){\r\n sessionStorage.removeItem(key);\r\n validShopCart = true;\r\n }\r\n //Qty > Qty Available\r\n else if($('[name=\"cartQty_' + key + '\"]').val().trim() > Number(fetchQuantitySupplements(key))){\r\n $('[name=\"cartErrorMsg\"]').html(\"There are only \" + fetchQuantitySupplements(key) + \" left in stock.\");\r\n errorHandler($('[name=\"cartQty_' + key + '\"]'));\r\n validShopCart = false;\r\n return;\r\n }\r\n //Qty valid\r\n else{\r\n sessionStorage.setItem(key, $('[name=\"cartQty_' + key + '\"]').val().trim());\r\n validShopCart = true;\r\n }\r\n \r\n updateCart();\r\n });\r\n }", "title": "" }, { "docid": "2ef76d152812b5046ad405e6942e8fa7", "score": "0.67927825", "text": "function get_product(form, elt) {\n const review_price = true;\n const qty = form.find(\".qty_input\").val();\n if (review_price) {\n var data = {\n table: \"cart\",\n url: \"showDetails\",\n data_type: \"values\",\n model_method: \"update_UserCartPrice\",\n frm: form,\n frm_name:\n form.attr(\"class\") + form.find(\"input[name='item_id']\").val(),\n params: elt,\n };\n Call_controller(data, display_product);\n function display_product(response, elt) {\n if (response.result == \"success\") {\n // 1- updat product price\n elt\n .parents(\".cart-qty\")\n .parent()\n .next()\n .find(\".product_price\")\n .html(function () {\n return operation._currency.format(\n parseFloat(\n response.msg[0].p_regular_price * response.msg[0].item_qty\n )\n );\n });\n // 2- update subtotal price\n phpPlugin.wrapper\n .find(\"#deal-price\")\n .html(function (i, deal_price) {\n return operation._currency.format(\n operation._parseLocaleNumber(deal_price, \"de\") -\n (parseInt(response.msg[2]) - response.msg[0].item_qty) *\n parseFloat(response.msg[0].p_regular_price)\n );\n });\n //3-Update taxes and TTC\n if (response.msg[1].length != 0) {\n // a)- update Taxe line values\n $.each(response.msg[1], function (key, val) {\n $(\".\" + key + \" .value\").html(function (i, tax) {\n const old_tax =\n (parseFloat(response.msg[0].p_regular_price) *\n parseFloat(response.msg[1][key][2]) *\n response.msg[2]) /\n 100;\n const actual_tax =\n operation._parseLocaleNumber(tax, \"de\") - old_tax + val[0];\n return operation._currency.format(\n operation._parseLocaleNumber(tax, \"de\") - old_tax + val[0]\n );\n });\n });\n //b) Update total price ttc\n phpPlugin.wrapper\n .find(\"#total-price\")\n .html(function (i, t_price) {\n const old_price = operation._parseLocaleNumber(t_price, \"de\");\n let taxes = 0;\n $.each(response.msg[1], function (key, val) {\n const old_tax =\n (parseFloat(response.msg[0].p_regular_price) *\n parseFloat(response.msg[1][key][2]) *\n parseInt(response.msg[2])) /\n 100;\n const actual_tax = val[0];\n taxes = taxes + (actual_tax - old_tax);\n });\n return operation._currency.format(\n old_price +\n taxes +\n (parseInt(response.msg[0].item_qty) -\n parseInt(response.msg[2])) *\n parseFloat(response.msg[0].p_regular_price)\n );\n });\n } else {\n phpPlugin.wrapper\n .find(\"#total-price\")\n .html(function (i, t_price) {\n return operation._currency.format(\n operation._parseLocaleNumber(t_price, \"de\") -\n (parseInt(response.msg[2]) - qty) *\n parseFloat(response.msg[0].p_regular_price)\n );\n });\n }\n }\n }\n }\n }", "title": "" }, { "docid": "89561b04ef1be6caf06474f046f3f0b8", "score": "0.67608905", "text": "function stockComparison() {\n connection.query(\"SELECT * FROM products WHERE product_name = '\" + a + \"'\",\n function (error, res) { \n if (error) throw error;\n stockQuantity = res[0].stock_quantity; \n // condition if the item is in stock \n if (stockQuantity > unitSold) { // BUG where it was allowed for the program to continue purchase without a valid id an\n stockQuantity = stockQuantity - unitSold;\n total = total + res[0].price;\n console.log(chalk.green(\"order placed!\"));\n orderFunction();\n } else {\n console.log(chalk.red(\"item is not in stock, would you like to try again?\"));\n inquirer\n .prompt({\n name: \"continue\",\n type: \"list\",\n choices: [\"YES\", \"EXIT\"]\n }).then(function (answer) {\n if (answer.continue === \"YES\") {\n showItems();\n } else {\n console.log(\"Thank you for shopping at Bamazon!\");\n }\n })\n }\n })\n}", "title": "" }, { "docid": "95dff613d1d946a72a45b7f4b62540ba", "score": "0.6736693", "text": "function stockCheck(qtyInCart){\r\n //console.log(`global var qty= ${qtyInCart} and I'm in the function where I want to check the stock`);\r\n connection.query(\"SELECT * FROM products WHERE item_id =?\", [itemNumber], (err, res)=>{\r\n for(var i=0; i< res.length; i++){\r\n var item = res[i].product_name;\r\n var price = res[i].price;\r\n separator();\r\n console.log(`Stock quantity from DB for ${item}: ${res[i].stock_quantity}`);\r\n inStock_quantity = res[i].stock_quantity;\r\n };\r\n if(inStock_quantity > qtyInCart){\r\n \r\n //update the DB to change stock_quantity for their item\r\n connection.query(\"UPDATE products SET stock_quantity=stock_quantity-? WHERE item_id =?\", [qtyInCart, itemNumber], (err, res) => {\r\n //console.log(res);\r\n separator();\r\n console.log(`Your order has been placed:`)\r\n console.log(`Order Details:`)\r\n console.log(`${item} \\t Quantity: ${qtyInCart} \\t Total: $${price* qtyInCart}`)\r\n connection.end();\r\n \r\n });\r\n \r\n } else{\r\n separator();\r\n console.log(`Insufficient Quantity, Please make another selection\\n\\n\\n`);\r\n start();\r\n\r\n }\r\n });\r\n }//end stockCheck()", "title": "" }, { "docid": "5e2f9b49b8f3474712a35be95a8310ee", "score": "0.67187405", "text": "function checkInput(){\n\n\tvar nameProduct = document.getElementById(\"name_product\");\n\tvar priceProduct = document.getElementById(\"price_product\");\n\tif (nameProduct.value != \"\" && priceProduct.value != \"\") {\n\t\t// addProduct();\n\t\t\n\t\tadd(nameProduct.value, priceProduct.value, 1);\n\t\t\n\t\tdisplayAllProducts()\n\t\tloadNewElement()\n\t\ttotal();\n\t}\n}", "title": "" }, { "docid": "a12e8d43b23a0da88b03c4951ef5a758", "score": "0.66964763", "text": "function changeAvailableStock() {\n\n\t\t\t\tvar selectedStockPartId = $('#so-part_id').val();\n\n\t\t\t \t$('#so-qty').val('');\n\t\t\t \t$('#so-st_qty').val('');\n\n\t\t $.post(\"?r=stock/ajax-checkstock\",{\n\t\t selectedStockPartId:selectedStockPartId\n\t\t },\n\t\t function(data, status){\n\t\t\t returnData = JSON.parse(data);\n\t\t\t var partId = returnData['partId'];\n\t\t\t var totalAddedQty = 0;\n\t\t\t var totalAvailableQty = parseFloat(returnData['stQty']);\n\t\t\t $(\".stock-qty-\" + partId).each(function() {\n\t\t\t\t\t totalAddedQty += parseFloat($(this).val());\n\t\t\t\t\t});\n\t\t\t\t\ttotalAvailableQty -= totalAddedQty;\n\t\t\t // check through the form here, to get the added qty\n\t\t\t $('#so-st_qty').val(parseFloat(totalAvailableQty).toFixed(3));\n\t\t });\n\t \t}", "title": "" }, { "docid": "e94b6abf097cf4b55c11f23105c11b25", "score": "0.66913617", "text": "function onClickAddToCart() {\n // Clear any error message that might already be displayed from a previous click\n setErrorMessage(\"\");\n\n const productId = getSelectedDropdownId(\"product\");\n const quantity = document.getElementById(\"quantity\").value;\n\n if (validateProduct(productId) && validateQuantity(quantity)) {\n // everything is ok...we can pass the data to the server-side code\n }\n}", "title": "" }, { "docid": "0b477f313389e799f9261d58b4616ed5", "score": "0.66687083", "text": "async function verifyCart() {\n console.log(\"INSIDE VERIFY CART API -----------------------------------------\")\n var self = this;\n var body = self.body;\n var decoded = self.token;\n var { cart, err } = await FetchExistingCart(decoded.phone);\n var data = await checkCartStock(body.pincode, cart);\n\n\n if (data.status == false) {\n return self.json(data);\n }\n var result = [];\n for (let i = 0; i < data.products.length; i++) {\n const productObj = data.products[i];\n var variant = productObj.variant;\n var obj = {};\n\n if (productObj.variant.stock == 0) {\n console.log(\"productObj.name\", productObj.name);\n console.log(\"variant.title\", productObj.variant.title);\n obj.statusCode = \"OUTOFSTOCK\";\n obj.productName = productObj.name;\n obj.pid = productObj.id;\n obj.vid = productObj.variant.id;\n obj.variantName = productObj.variant.title;\n obj.message = `${productObj.name}(${productObj.variant.title}) is out of stock`;\n result.push(obj);\n } else {\n obj = productObj\n obj.statusCode = \"INSTOCK\"\n\n // check price of the products with price and compare with db\n var { product, err } = await FetchProduct(obj.id, obj.variant.id);\n\n if (err || product == null) {\n self.json({\n status: false,\n message: \"Invalid Product\"\n })\n return;\n }\n //console.log(\"product\", product);\n if (obj.id == product.id) {\n var vquantity = [];\n var vprices = [];\n for (let k = 0; k < product.variant.prices.length; k++) {\n const price = product.variant.prices[k];\n vquantity.push(price.quantity);\n vprices.push(price.price);\n }\n\n // new logic start =================================\n\n if (vquantity.indexOf(obj.quantity) != -1) {\n vquantity.sort(function (a, b) {\n return a - b;\n });\n console.log(\"v quantity after sort\", vquantity);\n var priceIndex = vquantity.indexOf(obj.quantity);\n //console.log(\"exact quantity\", vquantity, \"prodquantity\", obj.quantity,obj.variant.prices);\n obj.variant.prices.map(x => {\n if (x.quantity == obj.quantity) {\n //console.log(\"x.price\",x.price ,\"vprices[priceIndex]\",vprices[priceIndex] , vprices);\n\n if (x.price != vprices[priceIndex]) {\n console.log(\"PRICES CHECK\", \"cart price\", obj.name, x.price, \"product price\", vprices[priceIndex], \"quantity\", obj.quantity);\n obj.statusCode = \"PRICECHECKFAIL\";\n obj.message = `Price has been changed from ₹${x.price} to ₹${vprices[priceIndex]} for ${productObj.name}`\n obj.variant.prices[priceIndex].price = x.price;\n } else {\n console.log(\"PRICE NOT CHANGED---------\");\n }\n }\n })\n\n } else {\n // console.log(\"CLOSEST QUANTITY==========================\");\n vquantity.sort(function (a, b) {\n return a - b;\n });\n // console.log(\"v quantity after sort\", vquantity);\n var goal = obj.quantity; // 6\n\n var closest = vquantity.find(e => e <= goal);\n var priceIndex = vquantity.indexOf(closest);\n // console.log(\"closest quantity\", vquantity, \"prodquantity\", closest, \"priceIndex\", priceIndex);\n obj.variant.prices.map(x => {\n if (x.quantity == closest) {\n console.log(\"XXXXPRICE \", x.price, \"BBBBBBBBBB\", vprices[priceIndex]);\n if (x.price != vprices[priceIndex]) {\n console.log(\"PRICES CHECK\", \"cart price\", obj.name, x.price, \"product price\", vprices[priceIndex], \"quantity\", closest);\n obj.statusCode = \"PRICECHECKFAIL\";\n obj.message = `Price has been changed from ₹${x.price} to ₹${vprices[priceIndex]} for ${productObj.name}`\n obj.variant.prices[priceIndex].price = x.price;\n } else {\n console.log(\"PRICE NOT CHANGED---------\");\n }\n }\n })\n }\n\n // new logic end ===================================\n\n }\n //console.log(product);\n // variants.push(product.variant);\n result.push(obj);\n }\n }\n self.json(result);\n}", "title": "" }, { "docid": "c9beeb8dd19b13051a0fad266f20c8c4", "score": "0.66202956", "text": "function submitCheckout() {\n\n const productIds = [];\n\n state.cart.forEach((item) => {\n for (let i = 0; i < item.purchaseQuantity; i++) {\n productIds.push(item._id)\n }\n })\n // call useLazyQuery hook\n getCheckout({ variables: { products: productIds }})\n }", "title": "" }, { "docid": "8133d435a9c9f8208d5bcb6111fb967c", "score": "0.65978414", "text": "function verifyStock() {\n connection.query(\n \"SELECT * FROM products WHERE ?\",\n {\n item_id: itemRequest\n },\n\n function(error, response) {\n if (error) throw error;\n\n if (itemQuantity > response[0].stock_quantity) {\n console.log(\"Sorry!\", \" We don't have enough \" + response[0].product_name + \"'s in stock. Please select a smaller quantity or try again at another time.\");\n console.log(\" \");\n shopBamazon()\n }\n//Know I could have done this cleaner\n else {\n console.log(\"Congratulation!\", \" We have your \" + response[0].product_name + \"'s in stock.\");\n console.log(\" \");\n var availStock = response[0].stock_quantity;\n var itemPrice = response[0].price;\n var purchaseTotal = itemPrice * itemQuantity;\n updateInventory(availStock, itemQuantity, itemRequest);\n totalCost(purchaseTotal.toFixed(2), itemQuantity); \n }\n })\n }", "title": "" }, { "docid": "587a5082cd3cd9e0a17e5923faf820e8", "score": "0.65335566", "text": "function add_to_cart_item(product_id, product_name = 'p', default_variant = '', variant_price = '') {\n\n if ((default_variant == '') || (variant_price != '')) {\n window.location.replace(base_url + \"product/\" + product_name + \"/\" + product_id);\n return false;\n }\n\n var variant = default_variant;\n var qnty = 1;\n\n var product_quantity = qnty;\n if (product_id == 0) {\n\n Swal({\n type: 'warning',\n title: display(\"ooops_something_went_wrong\")\n });\n return false;\n }\n if (qnty <= 0) {\n Swal({\n type: 'warning',\n title: display(\"please_keep_quantity_up_to_zero\")\n });\n return false;\n }\n\n //before add to cart check product stock\n $.ajax({\n type: \"post\",\n async: true,\n url: base_url + \"web/Product/check_quantity_wise_stock\",\n data: {\n \"csrf_test_name\": CSRF_TOKEN,\n \"product_quantity\": product_quantity,\n \"product_id\": product_id,\n 'variant': variant\n },\n success: function(data) {\n if (data == 'no') {\n Swal({\n type: 'warning',\n title: display(\"not_enough_product_in_stock\")\n })\n return false;\n }\n if (data == 'yes') {\n $.ajax({\n type: \"post\",\n async: true,\n url: base_url + \"web/Home/add_to_cart_details\",\n data: {\n \"csrf_test_name\": CSRF_TOKEN,\n \"product_id\": product_id,\n \"qnty\": qnty,\n \"variant\": variant\n },\n success: function(data) {\n $(\"#tab_up_cart\").load(location.href + \" #tab_up_cart>*\", \"\");\n if (default_variant === 'buy') {\n window.location.replace(base_url + \"checkout\");\n }\n Swal({\n type: 'success',\n title: display(\"product_added_to_cart\")\n })\n },\n error: function() {\n Swal({\n type: 'warning',\n title: display(\"request_failed\")\n })\n }\n });\n }\n },\n error: function() {\n Swal({\n type: 'warning',\n title: display(\"request_failed\")\n })\n }\n });\n}", "title": "" }, { "docid": "25923fb16d027e10dd8a05ee3fc7f42b", "score": "0.6509662", "text": "@DBDecorators.table(tables.Product)\n static async hasStock(cart) {\n let products = await Product.getAll(cart.products.map(function (product) { return product.id; }));\n let allProductsHaveStock = true;\n products.forEach(function (dbProduct) {\n let requestedQuantity = cart.products.filter(function (cartProduct) {\n return cartProduct.id === dbProduct.id\n })[0].quantity;\n if (dbProduct.stock < requestedQuantity) {\n allProductsHaveStock = false;\n }\n });\n return allProductsHaveStock;\n }", "title": "" }, { "docid": "798997cfe727791b30dae0de2fb979b7", "score": "0.6508913", "text": "function cartResumeDetail(e) {\n\n if (window.location.pathname == \"/cart\") {\n\n // Resumen de productos\n var products1 = [];\n var products2 = [];\n var products3 = [];\n var products4 = [];\n var products5 = [];\n var products6 = [];\n // console.log(e);\n try {\n vtexjs.checkout.getOrderForm().done(order => {\n for( var i = 0; i < order.items.length; i ++ ) {\n var categoryIds = [];\n var categoryString = [];\n categoryIds = order.items[i].productCategories\n categoryIds = Object.keys(categoryIds);\n\n for( var j = 0; j < categoryIds.length; j ++ ) {\n categoryString.push(order.items[i].productCategories[categoryIds[j]]);\n }\n var breadcrumb = categoryString;\n breadcrumb = breadcrumb.toString();\n breadcrumb = breadcrumb.replace(\",\", \"/\");\n\n var productQuantity = order.items[i].quantity\n var propductPum = order.items[i].measurementUnit;\n\n if (propductPum == \"kg\") {\n productQuantity = (order.items[i].unitMultiplier * 1000) * productQuantity ;\n }\n\n if (propductPum == \"kg\") {\n propductPum = \"Gramo\"\n }\n\n if (i <= 19) {\n products1.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n } else if (i >= 20 && i <= 39) {\n products2.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n } else if (i >= 40 && i <= 59) {\n products3.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n } else if (i >= 60 && i <= 79) {\n products4.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n } else if (i >= 80 && i <= 99) {\n products5.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n } else {\n products6.push(\n {\n 'brand' : order.items[i].additionalInfo.brandId,\n 'category' : breadcrumb,\n 'id' : order.items[i].id,\n 'name' : order.items[i].name,\n 'price' : order.items[i].sellingPrice / 100,\n 'quantity' : productQuantity,\n 'dimesion1' : propductPum,\n 'dimesion2' : order.items[i].seller\n }\n ); \n }\n };\n // ECImpressions.resumeCart(products, e);\n\n if (products1.length > 0) {\n ECImpressions.resumeCart(products1, e);\n }\n if (products2.length > 0) {\n ECImpressions.resumeCart(products2, e);\n }\n if (products3.length > 0) {\n ECImpressions.resumeCart(products3, e);\n }\n if (products4.length > 0) {\n ECImpressions.resumeCart(products4, e);\n }\n if (products5.length > 0) {\n ECImpressions.resumeCart(products5, e);\n }\n if (products6.length > 0) {\n ECImpressions.resumeCart(products6, e);\n }\n }); \n \n } catch (e) {\n console.log(e)\n }\n\n \n } \n}", "title": "" }, { "docid": "15d4872b1f16028eb2677994271f4191", "score": "0.6470024", "text": "function checkStock(product, units) {\n // console.log('number of units: ' + units, \"product ID: \" + product);\n connection.query('SELECT * FROM bamazon_db.products where item_id=' + product, function (error, results, fields) {\n if (error) throw error;\n console.log('view all products below!');\n console.log(results);\n\n\n\n // connection.query('SELECT * FROM bamazon_db.products where stock_quantity=' + units, function (error, results, fields) {\n // if (error) throw error;\n // console.log('view all products below!');\n // if(results < '[]'){\n // console.log('product is not available!')\n // }\n // console.log(results);\n // });\n });\n}", "title": "" }, { "docid": "26d424379f2023df2f54d8da699c33f2", "score": "0.64627934", "text": "function validateProductDataToAddInOrdercart(fcClass){\n try{\n var blankFieldValueCount = 0 ;\n if(fcClass!==false && fcClass!=='' && fcClass!==undefined){\n if($('.'+fcClass).length===1){\n if($('.'+fcClass).find('textarea').length===1){\n var userMsgOnProduct = removeHtmlStripTagsOfContent($('.'+fcClass).find('textarea').val());\n if(userMsgOnProduct==='' || userMsgOnProduct===false || userMsgOnProduct===undefined){\n $('.'+fcClass).find('textarea').css({'border-color':'#f18178'});\n blankFieldValueCount++;\n }else{\n $('.'+fcClass).find('textarea').css({'border-color':'#ccc'});\n }\n }\n if($('.'+fcClass).find(\"input[type='text']\").length===1){\n var userProductQty = removeHtmlStripTagsOfContent($('.'+fcClass).find(\"input[type='text']\").val());\n if(userProductQty==='' || userProductQty===false || userProductQty===undefined || parseInt(userProductQty)<0){\n $('.'+fcClass).find(\"input[type='text']\").css({'border-color':'#f18178'});\n blankFieldValueCount++;\n }else{\n $('.'+fcClass).find(\"input[type='text']\").css({'border-color':'#ccc'});\n }\n }\n }\n }\n if(blankFieldValueCount>0){\n return false;\n }else{\n return true;\n }\n }catch(ex){\n return false;\n }\n}", "title": "" }, { "docid": "abe923c1970943b8a376e2d9d9e4d0f2", "score": "0.64532804", "text": "checkStock() {\n for (var x = 0; x < this.items.length; x++) {\n if (this.items[x].stock <= 2) {\n this.addStock(this.items[x].name);\n }\n }\n }", "title": "" }, { "docid": "9fdf70d4d0db7bfad1c711236194c5a3", "score": "0.6438688", "text": "function checkStock(id, qty) {\n const sql = `SELECT * FROM products WHERE item_id = ${id}`;\n\n db.query(sql, (err, res) => {\n if (err) throw err;\n\n // If avaialable stock is greater than or equal to desired amount\n // calls handlePurchse\n // else sends the user an error and breaks the process\n res[0].stock_quantity >= qty ? handlePurchase(id, qty) : console.log('Error: Insufficient Quantity');\n });\n}", "title": "" }, { "docid": "4d4d947a3c82852c440692ec9fb34c24", "score": "0.6429974", "text": "function buySell() {\r\n\t\tlet parent = purchaseButton.parentNode;\r\n\t\tlet ticker = parent.parentNode.querySelector(\"h3\").innerHTML;\r\n\t\tlet quantityElement = parent.querySelector(\".quantity\");\r\n\t\tlet positive = true;\r\n\t\tif (!purchaseType) {\r\n\t\t\tpositive = false;\r\n\t\t}\r\n\r\n\t\tif (currentProfile == null) {\r\n\t\t\talert(\"Please sign in to use this feature!\");\r\n\t\t\tquantityElement.value = \"\";\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tlet quantity = parseInt(quantityElement.value);\r\n\t\t\tquantityElement.value = \"\";\r\n\t\t\tif (isNaN(quantity)) {\r\n\t\t\t\talert(\"Please input a valid input into the quantity selector\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (quantity <= 0) {\r\n\t\t\t\talert(\"Please input a positive integer quantity\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tfor (let s of currentProfile.stocks) {\r\n\t\t\t\t// Note that if stocks are purchased on different days with different prices,\r\n\t\t\t\t// then they will have different stock sections.\r\n\t\t\t\tif ((s.ticker == ticker) && (Math.abs(s.open \r\n\t\t\t\t\t\t\t- availableStocks[ticker].open) < .01)) {\r\n\t\t\t\t\tconsole.log(\"stock found\");\r\n\t\t\t\t\tif (positive) {\r\n\t\t\t\t\t\ts.quantity += quantity;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (quantity > s.quantity) {\r\n\t\t\t\t\t\t\talert(\"You do not have enough stock to sell\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts.quantity -= quantity;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\teditProfile(currentProfile.name, currentProfile.password,\r\n\t\t\t\t\t\t\tcurrentProfile.stocks);\r\n\t\t\t\t\tdisplayCurrentProfile();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!positive) {\r\n\t\t\t\talert(\"You do not have the stock to sell\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.log(\"stock not found\");\r\n\t\t\tlet stockObj = availableStocks[ticker];\r\n\t\t\tstockObj.quantity = quantity;\r\n\t\t\tcurrentProfile.stocks.push(stockObj);\r\n\t\t\teditProfile(currentProfile.name, currentProfile.password,\r\n\t\t\t\t\tcurrentProfile.stocks);\r\n\t\t\tdisplayCurrentProfile();\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "6241b631e183b305d08e5182b081b0a2", "score": "0.64240485", "text": "function checkQuantity(item_id, quantityOrdered) {\n let query = connection.query(\"SELECT product_name, stock_quantity, item_id FROM products WHERE item_id=?\", [item_id],\n (error, response) => {\n if (error) throw error;\n response.forEach(product => {\n // DEV: Log info\n console.log(`Product: ${product.product_name} | Quantity: ${product.stock_quantity} | Ordered: ${quantityOrdered}`);\n\n // Check if enough item is in stock\n if(product.stock_quantity < quantityOrdered) {\n console.log(`\\nNot enough ${product.product_name}s in stock...\\n`);\n bamazonPrompts.start();\n }\n\n\n // console.log(\"IM IN ELSE. Print item_id: \", product.item_id);\n buy(product.item_id, quantityOrdered);\n\n // Get order for customer\n takeOrder(product.item_id, product.product_name, quantityOrdered);\n });\n });\n}", "title": "" }, { "docid": "12f859cb6044a184c196b5d96d0c1ba6", "score": "0.6420807", "text": "function checkLocalStorage() {\n if (localStorage.getItem(\"seceltedProduct\") !== null) {\n fromLocalStorageTo();\n cartPage();\n totalPrice();\n }\n}", "title": "" }, { "docid": "f05043bd8c6dddae23979021ac27601c", "score": "0.6384121", "text": "function validateProductDataToUpdateInOrdercart(fcClass){\n try{\n var blankFieldValueCount = 0 ;\n if(fcClass!==false && fcClass!=='' && fcClass!==undefined){\n if($('.'+fcClass).length===1){\n if($('.'+fcClass).find(\"input[type='text']\").length===1){\n var userProductQty = removeHtmlStripTagsOfContent($('.'+fcClass).find(\"input[type='text']\").val());\n if(userProductQty==='' || userProductQty===false || userProductQty===undefined || parseInt(userProductQty)<0){\n $('.'+fcClass).find(\"input[type='text']\").css({'border-color':'#f18178'});\n blankFieldValueCount++;\n }else{\n $('.'+fcClass).find(\"input[type='text']\").css({'border-color':'#ccc'});\n }\n }\n }\n }\n if(blankFieldValueCount>0){\n return false;\n }else{\n return true;\n }\n }catch(ex){\n return false;\n }\n}", "title": "" }, { "docid": "c51aed147bb919cb50c5a90bc0f3dc5c", "score": "0.63721794", "text": "function stockCountdown(responseStock) {\n var selectorStock1 = $jq321(\"form[action='/cart/add']\").find(\"button[type='submit'],input[type='submit']\").parent();\n var selectorStock2 = $jq321(\"form[action='/cart/add']\");\n var selectorStock3 = $jq321(\"form[action='/cart/add']:first\").find(\"button[type='submit'],input[type='submit']\").parent();\n var selectorStock4 = $jq321(\"form[action='/cart/add']:first\");\n var selectorStock5 = $jq321(\"#shopify-section-product-template\").find(\"form[action='/cart/add']\").find(\"button[type='submit'],input[type='submit']\").parent();\n var selectorStock6 = $jq321(\"#shopify-section-product-template\").find(\"form[action='/cart/add']\");\n\n if (responseStock.above_cart == 1) {\n if (selectorStock1.length == 1) {\n selectorStock1.prepend(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock1.prepend(responseStock.soldView);\n }\n } else if (selectorStock2.length == 1) {\n selectorStock2.prepend(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock2.prepend(responseStock.soldView);\n }\n } else if (selectorStock3.length == 1) {\n $jq321(responseStock.view).insertBefore(selectorStock3);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n $jq321(responseStock.soldView).insertBefore(selectorStock3);\n }\n } else if (selectorStock4.length == 1) {\n selectorStock4.prepend(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock4.prepend(responseStock.soldView);\n }\n } else if (selectorStock5.length == 1) {\n $jq321(responseStock.view).insertBefore(selectorStock5);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n $jq321(responseStock.soldView).insertBefore(selectorStock5);\n }\n } else if (selectorStock6.length == 1) {\n selectorStock6.prepend(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock6.prepend(responseStock.soldView);\n }\n }\n } else {\n if (selectorStock1.length == 1) {\n selectorStock1.append(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock1.append(responseStock.soldView);\n }\n } else if (selectorStock2.length == 1) {\n selectorStock2.append(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock2.append(responseStock.soldView);\n }\n } else if (selectorStock3.length == 1) {\n $jq321(responseStock.view).insertAfter(selectorStock3);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n $jq321(responseStock.soldView).insertAfter(selectorStock3);\n }\n } else if (selectorStock4.length == 1) {\n selectorStock4.append(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock4.append(responseStock.soldView);\n }\n } else if (selectorStock5.length == 1) {\n $jq321(responseStock.view).insertAfter(selectorStock5);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n $jq321(responseStock.soldView).insertAfter(selectorStock5);\n }\n } else if (selectorStock6.length == 1) {\n selectorStock6.append(responseStock.view);\n if (responseStock.soldOutSettings !== undefined && responseStock.soldOutProduct === undefined) {\n selectorStock6.append(responseStock.soldView);\n }\n }\n }\n\n if (responseStock.variantCheck == 0 && responseStock.soldOutProduct == 1) {\n $jq321(\".cc-sp-sc-sold-div\").show();\n } else if (responseStock.variantCheck == 0 && responseStock.soldOutProduct === undefined) {\n $jq321(\".cc-sp-sc-stock-div\").show();\n } else if (responseStock.variantCheck == 1 && responseStock.soldOutProduct === undefined) {\n $jq321(\".cc-sp-sc-stock-div\").show();\n } else if (responseStock.variantCheck == 1 && responseStock.soldOutProduct == 1) {\n $jq321(\".cc-sp-sc-sold-div\").show();\n }\n }", "title": "" }, { "docid": "f5657fd7e3c0cd813f39133f0cd5b3a6", "score": "0.6353797", "text": "function checkAvail(order, itemsArray){\n\tprod = parseInt(order.item_ID);\n\tqty = parseInt(order.quantity);\n\n\tfor (var a = 0; a < itemsArray.length; a++) {\n\t\tif (itemsArray[a].ID === prod && itemsArray[a].Qty < qty){\n\t\t\t// if no, let customer know\n\t\t\tconsole.log(\"We are unable to fulfill your order at this time. \\nInsufficient Quantity\");\n\t\t\t// and prevent order from completing\n\t\t\tconnection.end();\n\t\t\t} \n\t\telse if (itemsArray[a].ID === prod && itemsArray[a].Qty > qty){\n\t\t\tupdateProduct(order);\t\t\n\t\t} // end if else\n\t}; // end for loop\n} // end function", "title": "" }, { "docid": "4987ddd331ee290116691d1eb169ab1b", "score": "0.63537717", "text": "function submit_product(type)\n{ \n var client = $('#client').val();\n var sale_note = CKEDITOR.instances.sale_note.getData();\n var product_list= new Array();\n\n var s_list = glob_prod.filter(function (el) {\n return el != null;\n });\n\n \n if(s_list == '' || s_list == null)\n {\n $( document ).ready(function() { errorSwal('error','Please enter details')});\n return false;\n }\n else\n {\n for (var key in s_list) \n { \n \n var id = s_list[key]['product_id'];\n var qt = $('#quantity_'+id).val();\n var price = $('#price_'+id).val();\n var discount = $('#discount_'+id).val();\n var stock = $('#stock_'+id).val();\n var tax1 = $('#tax_'+id).val();\n var name = $('#name_'+id).val();\n var part_num = $('#part_num_'+id).val();\n\n if(price == '' || price == 0)\n { \n \n $( document ).ready(function() { errorSwal('error','Please enter \\''+part_num+'\\' price')});\n return false;\n }\n \n if(tax1 == '' || tax1 == '.0' || tax1 == '.00')\n {\n \n $( document ).ready(function() { errorSwal('error','Please enter \\''+part_num+'\\' tax')});\n return false;\n }\n if(qt == '' || (parseInt(qt) > parseInt(stock)) || (parseInt(qt) == 0))\n {\n \n $( document ).ready(function() { errorSwal('error','Please enter \\''+part_num+'\\' quantity')});\n return false;\n }\n\n if(discount == '.' || discount == '' || discount =='.0' || discount == '.00')\n {\n discount=0.00;\n }\n\n qt = parseInt(qt);\n stock = parseInt(stock);\n price = parseFloat(price);\n discount = parseFloat(discount);\n tax1 = parseFloat(tax1);\n \n\n \n\n var dis = parseFloat(price * discount)/100;\n var new_price = parseFloat(price) - parseFloat(dis);\n var tax = parseFloat(new_price * tax1)/100;\n var sell_price = parseFloat(new_price) + parseFloat(tax);\n var amount = parseFloat(sell_price * qt);\n\n\n \n sell_price = sell_price.toFixed(2);\n amount = amount.toFixed(2);\n\n \n product_list[id] ={product_id:id,client_id:client,quantity:qt,stock:stock,price:price,discount:dis,per_discount:discount,per_tax:tax1,tax:tax,sell_price:sell_price,amount:amount,sale_note:sale_note,name:name};\n \n \n } \n\n product_list = product_list.filter(function (el) {\n return el != null;\n });\n }\n \n \n\nif(type == 1)\n{\n var link = base_url + \"Sell/Add_product\";\n var redirect = base_url+\"Sell\" ;\n}\nelse if(type == 2)\n{\n var link = base_url + \"Quotation/Add_product\";\n var redirect = base_url+\"Quotation\" ;\n}\n\n$(\"#loader\").removeClass('d-none');\n\n $.ajax({\n type: \"POST\",\n url: link,\n data: {s_list:product_list},\n success: function(response) {\n $(\"#loader\").addClass('d-none');\n console.log(response);\n var res = JSON.parse(response);\n if(res.stat == 200)\n {\n successSwal('new_msg',res.msg);\n window.location = redirect;\n //glob_prod = '';\n }\n else if(res.stat == 400)\n {\n errorSwal('error',res.msg);\n }\n \n },\n error: function(response) {\n errorSwal('error','Something went wrong. Reload & try again.');\n return;\n }\n });\n}", "title": "" }, { "docid": "6399a7dfe3b1deaa30f4aa943fcf0939", "score": "0.6352113", "text": "function check() {\n connection.query(\"SELECT stock_quantity FROM products WHERE item_id=\" + res.item_id,\n function (err, response) {\n if (err) throw err;\n if (response[0].stock_quantity < 1) {\n console.log(\"We are out of stock!\");\n bamazon();\n }\n else {\n console.log(\"Thank you for your purchase!\");\n updatedQ = response[0].stock_quantity - 1;\n console.log(updatedQ + \" remaining.\");\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedQ\n },\n {\n item_id: res.item_id\n }\n ],\n function (error) {\n if (error) throw err;\n\n }\n );\n\n bamazon();\n }\n });\n\n }", "title": "" }, { "docid": "77882f089a27db45897cde8ec3630939", "score": "0.63473487", "text": "function addToCart() {\n // get needed data\n let size, price, milk, quantity;\n const drinkSmall = document.getElementById('small').checked;\n const drinkMedium = document.getElementById('medium').checked;\n const drinkLarge = document.getElementById('large').checked;\n if (drinkSmall) { \n size = 'small';\n price = 1;\n } else if (drinkMedium) { \n size = 'medium';\n price = 2;\n } else if (drinkLarge) { \n size = 'large';\n price = 3;\n } else { \n alert(\"Size required.\");\n }\n quantity = document.getElementById('quantity').value;\n const wholeMilk = document.getElementById('whole').checked;\n const skimMilk = document.getElementById('skim').checked;\n const veganMilk = document.getElementById('vegan').checked;\n if (wholeMilk) { \n milk = 'Whole milk';\n } else if (skimMilk) { \n milk = 'Skim milk';\n } else if (veganMilk) { \n milk = 'Vegan milk';\n } else { \n milk = '';\n }\n console.log(`${size}, ${price}, ${milk}, ${quantity}`);\n \n subTotal += price * quantity;\n taxes = subTotal * .06;\n total = subTotal + taxes;\n\n document.getElementById(\"subtotal-price\").innerText = `$ ${subTotal}`;\n document.getElementById(\"total-price\").innerText = `Taxes: $ ${taxes} \\n Total: $ ${total}`;\n document.getElementsByClassName(\"product-name\").innerText = `Items: ${productInfo}`;\n\n //PRODUCT NAME x QUANTITY = $ PRICE\n \n let productListItemElement = document.createElement(\"li\");\n productListItemElement.innerText = `${productTitle} x ${quantity} = $ ${price * quantity} \\n ${milk}`;\n document.getElementById(\"checkout-item-list\").appendChild(productListItemElement);\n //RESET FORM\n document.getElementById('whole').checked = false;\n document.getElementById('skim').checked = false;\n document.getElementById('vegan').checked = false;\n document.getElementById('small').checked = false;\n document.getElementById('medium').checked = false;\n document.getElementById('large').checked = false;\n document.getElementById('quantity').value = 1;\n modalDrink.style.display = \"none\";\n}", "title": "" }, { "docid": "d15c912d4067de14405c055d9ac3bb81", "score": "0.6343812", "text": "function registerAddToCartInListPage() {\n\n $(\".shelf-content .product-shelf .product-item .product-item__add-to-cart\").on(\"click\", function(e, o) {\n\n try {\n var producttId = $(this).parents(\".product-item\").attr('data-id');\n var productName = $(this).parents(\".product-item\").find('.product-item__bottom .product-item__info .product-item__name span').text();\n var productBrand = $(this).parents(\".product-item\").find('.product-item__bottom .product-item__info .product-item__brand').text();\n var productPrice = parseInt($(this).parents(\".product-item\").find('.product-prices__wrapper .product-prices__price .product-prices__value--best-price').text().replace(\"$\",\"\").replace(\".\",\"\").replace(\".\",\"\"));\n var productQuantityCart = $(this).parents(\".product-item\").find('.product-item__controls .product-item__quantity .product-quantity__input').val();\n var productPum = $(this).parents(\".product-item\").find('.product-item__bottom .product-prices__wrapper .product-prices__price--price-per-unit').text();\n var urlSite = window.location.href;\n urlSite = urlSite.replace(\"https://busqueda.tiendasjumbo.co\", \"\");\n urlSite = urlSite.replace(\"https://www.tiendasjumbo.co\", \"\");\n Pum = productPum.split(\" a \")[0];\n if (Pum == \"\"){\n Pum = \"Unidad\";\n } \n\n if (productQuantityCart.indexOf(\"kg\") !== -1) {\n productQuantityCart = parseFloat(productQuantityCart.split(\" \")[0]) * 1000;\n }\n\n var r = {\n // list : urlSite,\n category: urlSite, \n brand : productBrand,\n id : producttId,\n name : productName,\n price : productPrice,\n quantity : productQuantityCart,\n dimesion1 : Pum\n };\n ECImpressions.productClick(r), ECImpressions.addToCart(r)\n\n \n } catch (e) {\n console.log(e)\n }\n\n });\n}", "title": "" }, { "docid": "5564de604d3159fa58792677a91f5abd", "score": "0.63393575", "text": "function displayAddCartMessage() {\n var totalStock = parseInt(ProductDetails[0].stock); //the totalstock of the product\n var orderValue = parseInt(document.getElementById(\"qty\").value); //the qty entered in the order qty field\n if (orderValue >= 1 && orderValue <= totalStock) { \n //if ordered qty is greater than 1 and less or equal to the total stock\n //the call the function that generates the object and makes further validations\n document.getElementById(\"add_cart_message\").style.visibility = \"visible\";\n document.getElementById(\"add_cart_message\").style.backgroundColor = \"rgb(201, 201, 201)\";\n setTimeout(function () { document.getElementById(\"add_cart_message\").style.visibility = \"hidden\"; }, 3000)\n document.getElementById(\"add_cart_message\").innerHTML = orderValue + \" pcs \" + ProductDetails[\"0\"].Name + \" was added to the cart!\"\n generateCartObject();\n document.getElementById(\"qty\").value = \"\";\n showNoOfItems();\n\n } else if (orderValue <= 0 || isNaN(orderValue)) { //if the ordered qty is less than 0 or invalid, display a message\n document.getElementById(\"add_cart_message\").style.visibility = \"visible\";\n document.getElementById(\"add_cart_message\").style.backgroundColor = \"red\";\n document.getElementById(\"add_cart_message\").innerHTML = \"Please choose a valid quantity!\"\n } else { //if the ordered qty is greather than the stock-display a message\n document.getElementById(\"add_cart_message\").style.visibility = \"visible\";\n document.getElementById(\"add_cart_message\").style.backgroundColor = \"red\";\n document.getElementById(\"add_cart_message\").innerHTML = \"There is not enough stock!\"\n }\n}", "title": "" }, { "docid": "db9b62f13654b0629a27e4de197ab060", "score": "0.63315624", "text": "function checkOut(e){\r\ne.preventDefault();\r\n\r\n let allNames = [];\r\n let allPrices = [];\r\n\r\n let pName = this.parentNode.querySelectorAll(\".product__name\") ;\r\n let pPrice = this.parentNode.querySelectorAll(\".product__price\") ;\r\n\r\n if( pName.length < 1 ) return console.log(\"Bascket is Empty\")\r\n\r\n for( let i = 0; i < pName.length ; i++ ){\r\n allNames.push(pName[i].innerText )\r\n }\r\n\r\n for( let i = 0; i < pPrice.length ; i++ ){\r\n\r\n let index = bigPP.indexOf(pPrice[i]) ;\r\n bigPP.splice(index, 1) ;\r\n refreshPrice()\r\n\r\n let numPrice = parseFloat(pPrice[i].innerText.replace(\",\" ,\r\n \".\").split(\" \").shift()).toFixed(2) \r\n \r\n allPrices.push(numPrice)\r\n }\r\n\r\nfor( let i = 0 ; i < allNames.length ; i++ ){\r\n\r\nwindow.dataLayer = window.dataLayer || []; \r\ndataLayer.push({ ecommerce: null }); \r\nwindow.dataLayer.push({ \r\n 'event': 'purchase', \r\n 'ecommerce': {\r\n \"actionField\": {\r\n \"id\": parseInt(Math.random()*10000)\r\n },\r\n 'items': {\r\n 'item_name': allNames[i], \r\n 'price': allPrices[i] ,\r\n \"quantity\": 1\r\n }\r\n }\r\n});\r\n}\r\n\r\nlet clearing = document.querySelectorAll(\".yourBasket\")\r\n clearing.forEach( e => e.remove() )\r\n\r\n // send to noIndex page .html /thanks/\r\n location.href = \"https://www.kolovare.com/gracias.html\";\r\n\r\n}", "title": "" }, { "docid": "7c9f64945f110a39041e17d9168d496f", "score": "0.6331307", "text": "function formProcessing(proceedToCheckout, removePurchasableProductId, upSellId) {\n\n var purchasableProductIds = [];\n var purchasableProductIdQueryString = \"\";\n var quantities = [];\n var quantityQueryString = \"\";\n\n jQuery('input[name^=\"qty_\"]').each(function() {\n purchasableProductIds.push(jQuery(this).attr(\"name\").replace(/qty_/, \"\"));\n quantities.push(jQuery(this).val());\n });\n\n for (var x = 0; x < purchasableProductIds.length; x++) {\n purchasableProductIdQueryString += purchasableProductIds[x];\n if (x < purchasableProductIds.length - 1) {\n purchasableProductIdQueryString += \",\";\n }\n }\n\n for (var x = 0; x < quantities.length; x++) {\n quantityQueryString += quantities[x];\n if (x < quantities.length - 1) {\n quantityQueryString += \",\";\n }\n }\n\n jQuery('#purchasableProductIds').val(purchasableProductIdQueryString);\n jQuery('#quantities').val(quantityQueryString);\n\n if (removePurchasableProductId > 0) {\n jQuery('#removePurchasableProductId').val(removePurchasableProductId);\n }\n\n if (upSellId > 0) {\n jQuery('#upSellId').val(upSellId);\n }\n\n if (proceedToCheckout) {\n jQuery('#proceedToCheckout').val('true');\n } else {\n jQuery('#proceedToCheckout').val('false');\n }\n }", "title": "" }, { "docid": "b1f8b2eae7c7b737147d2514a5edc83c", "score": "0.6324084", "text": "function qty_validation(POST) {\n valid_qty = true;\n invalid_qty = false; //setting up variables and assuming no invalid qtys\n\n // Validates that form has valid quantities\n for (i = 0; i < products.length; i++) {\n num_puppies = POST[`quantity${i}`];\n\n\n //makes sure no invalid qtys with help for empty form from JOJO LAU\n if (!isNonNegInt(num_puppies) || POST.quantity0 == '' && POST.quantity1 == '' && POST.quantity2 == '' && POST.quantity3 == '' && POST.quantity4 == '' && POST.quantity5 == '') {\n console.log('invalid');\n invalid_qty = true;\n }\n\n\n if (isNonNegInt(num_puppies) && num_puppies > 0); {\n console.log('valid');\n valid_qty = true;\n }\n }\n\n // If there is only valid qtys validation function will return true & submit will go through\n if (valid_qty && !invalid_qty) {\n console.log('success');\n return true;\n }\n }", "title": "" }, { "docid": "41a6747eea261a73176a99ba24be4372", "score": "0.6315819", "text": "function validateCartNotEmpty() {\n\t\t$nextPageButton.addClass( 'disabled' );\n\t\tTwc.Checkout.Loading.show();\n\t\t$.ajaxQueue( {\n\t\t\t\turl: Twc.Settings.ajaxUrls.StartCheckout,\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype: 'post',\n\t\t\t\tdata: {}\n\t\t\t} )\n\t\t\t.done( function( data, textStatus, jqXHR ) {\n\t\t\t\ttry {\n\t\t\t\t\tif ( data !== null && data.result != \"failure\" ) {\n\t\t\t\t\t\t//nav to next page functionality\n\t\t\t\t\t\twindow.location.href = $nextPageButton.attr( 'href' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTwc.Checkout.Loading.hide();\n\t\t\t\t\t\t$.cookie( 'emptyCart', null, {} ); // set cookie in order to know not to trigger the empty cart modal\n\t\t\t\t\t\t//open a modal that redirects to the current services page\n\t\t\t\t\t\tshowEmptyCartModal();\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tTwc.Checkout.Util.catchError( e );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.fail( function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tif ( textStatus !== 'abort' ) {\n\t\t\t\t\tTwc.Checkout.Util.catchError( errorThrown );\n\t\t\t\t\tTwc.Checkout.Util.showErrorMessage( errorThrown );\n\t\t\t\t}\n\t\t\t\t$nextPageButton.removeClass( 'disabled' );\n\t\t\t\tTwc.Checkout.Loading.hide();\n\t\t\t} )\n\t\t\t.always( function() { // ajax completed; clean up any preventions\n\t\t\t} );\n\t}", "title": "" }, { "docid": "2662c5e753cd677dfdadecb5e524df17", "score": "0.62980294", "text": "function checkToEnableAddToCart () {\n if ($('.product-choice a').hasClass('success')) {\n if ($('a#thisisagift').hasClass('success')) {\n if ($('#giftemail_input').val() != '') {\n $(\"#addtocart\").removeClass('disabled');\n }\n } else {\n $(\"#addtocart\").removeClass('disabled');\n } \n }\n }", "title": "" }, { "docid": "a3ca1572e03b6f4fee267595c64e576f", "score": "0.62968177", "text": "function checkInventory(prod, qty) {\n // \n connection.query(`SELECT stock_quantity FROM products WHERE product_name=\"` + prod + `\"`, function (err, res) {\n if (err) throw err;\n //\n var new_qty = parseInt(res[0].stock_quantity) + qty;\n adjustInventory(prod, new_qty);\n });\n}", "title": "" }, { "docid": "5838b6f9d19963c4d81e2ff9fd9b686d", "score": "0.62961406", "text": "function addToCart() {\n if (product.stock === 0) {\n document.querySelector(\".error-message\").classList.add(\"visible\");\n setTimeout(removeMessages, 3000);\n return;\n }\n for (let i = 0; i < TScart.length; i++) {\n if (TScart[i].product.name.includes(id)) {\n document.querySelector(\".cart-duplicate-item\").classList.add(\"visible\");\n setTimeout(removeMessages, 3000);\n return;\n }\n }\n document.querySelector(\".c1\").classList.add(\"hidden\");\n document.querySelector(\".c2\").classList.remove(\"hidden\");\n document.querySelector(\".message\").classList.add(\"visible\");\n setTimeout(removeMessages, 3000);\n let quantity = document.querySelector('.quantity').value;\n TScart.push({\n \"product\": product,\n \"quantity\": quantity\n });\n localStorage.setItem(\"TScart\", JSON.stringify(TScart));\n cartQuantity();\n}", "title": "" }, { "docid": "f77fffe26253c47812e98a4ae6d1cd00", "score": "0.62929845", "text": "function addToBag({product}){\n var cartProducts =[];\n var cartCount = 0;\n var prodAlreadyInCart = \"false\";\n let cartObject = JSON.parse(localStorage.getItem(\"cart\"));\n let cartItems =\"\";\n if (cartObject != null) {\n cartItems = cartObject.cartItems;\n console.log(\"products: \"+ product);\n cartItems.map(cartItem => {\n cartCount = cartCount+1;\n //Check if the product already exist in the cart\n if (prodAlreadyInCart === \"false\"){\n if(cartItem.product.productID !== null && cartItem.product.productID === product.productID){\n //Product found in cart\n prodAlreadyInCart = \"true\"; \n console.log(\"Product is already in your cart...\");\n }\n }\n });\n } \n //If the product doesn't exist in the cart, add it to the cart.\n if (prodAlreadyInCart === \"false\"){\n //When the product is added to cart from outside PDP, quantity will be 1 and color will be the SKU color.\n //Since color and SKU selection is provided in PDP alone.\n cartItems.push({\"product\": product, \"quantity\": \"1\", \"color\":product.filterableFacets.Color});\n cartCount = cartCount +1;\n //Update the shopping cart with the products in localstorage.\n UpdateCart(\"updateProducts\", cartItems);\n //Keep the cart product count in localstorage to display on the badge.\n localStorage.setItem(\"cartCount\",JSON.stringify(cartCount));\n }\n}", "title": "" }, { "docid": "d08189cd4338d38884c043fa67105ade", "score": "0.6289663", "text": "function addToCart(prod,q,redirect) {\n saveProducts();\n if(productsInCart!= null){\n if(`${prod.ProductId}` in productsInCart )\n {\n productsInCart[prod.ProductId].amount +=q;\n }else\n {\n let product ={\n\t\t\t\tid:prod.ProductId,\n productName:prod.Name,\n amount:q,\n productPrice:prod.Price,\n productCat:prod.Category,\n supplierName:prod.SupplierName,\n photo:prod.ProductPicUrl\n }\n productsInCart={\n ...productsInCart,\n [prod.ProductId]:product\n }\n }\n\t}\n\t\n else{ // in case it is the first product i put in cart\n productsInCart={\n [prod.ProductId]:{\n\t\t\t\tid:prod.ProductId,\n\t\t\t\tproductName:prod.Name,\n\t\t\t\tamount:q,\n\t\t\t\tproductPrice:prod.Price,\n\t\t\t\tproductCat:prod.Category,\n\t\t\t\tsupplierName:prod.SupplierName,\n\t\t\t\tphoto:prod.ProductPicUrl\n\t\t\t}\n }\n }\n\tcartItems=cartItems+q;\n localStorage.setItem('productInCart', JSON.stringify(productsInCart));\n\tlocalStorage.setItem('cartNumbers', cartItems);\n\tif(document.querySelector('.cart span')) {\n\t\tdocument.querySelector('.cart span').textContent=cartItems; \n\t}\n\n\tgetTotalCost(); \n\t$(\"#side\").html(`${cartItems} items , EGP${totalCost} <a href='his.html' id='checked'>Checkout</a>`); \n\t\n\tif(redirect) {\n\t\twindow.location = \"cart.html\";\n\t} \n}", "title": "" }, { "docid": "e90982feba92b688515ceba1c7bc64f3", "score": "0.62853533", "text": "function checkStock(item, userQuantity) {\n var query = \"SELECT stock_quantity, price FROM products WHERE ?\";\n connection.query(query, {item_id: item}, function(err, res){\n if (res[0].stock_quantity >= userQuantity) {\n confirmOrder(item, userQuantity, res[0].stock_quantity, res[0].price);\n }\n else {\n console.log(\"\\n--------------------------------\\n\");\n console.log(\"Sorry we only have \" + res[0].stock_quantity + \" of that item.\");\n console.log(\"\\n--------------------------------\\n\");\n\n userSelectProduct();\n }\n });\n}", "title": "" }, { "docid": "aaf34cb155bf3adb1333c23d3d004b7c", "score": "0.62569153", "text": "function AddToCart(thisForm) {\n\n if (isDropShowing()){\n return false;\n }\n var iNumberOrdered = 0;\n var bAlreadyInCart = false;\n var notice = \"\";\n iNumberOrdered = GetCookie(\"NumberOrdered\");\n \n if ( iNumberOrdered == null )\n iNumberOrdered = 0;\n\n if ( thisForm.ID_NUM == null )\n strID_NUM = \"\";\n else\n strID_NUM = thisForm.ID_NUM.value;\n\t \n if ( thisForm.SKU == null )\n strSKU = \"\";\n else\n strSKU = thisForm.SKU.value;\n\t \n if ( thisForm.CURRENCY_SYMBOL == null )\n strCURRENCY_SYMBOL = \"\";\n else\n strCURRENCY_SYMBOL = thisForm.CURRENCY_SYMBOL.value;\n\t \n if ( thisForm.QUANTITY == null )\n strQUANTITY = \"1\";\n else\n strQUANTITY = thisForm.QUANTITY.value;\n\n if ( thisForm.PRICE == null )\n strPRICE = \"0.00\";\n else\n strPRICE = thisForm.PRICE.value;\n\n if ( thisForm.NAME == null )\n strNAME = \"\";\n else\n strNAME = thisForm.NAME.value;\n\n if ( thisForm.SHIPPING == null )\n strSHIPPING = \"0.00\";\n else\n strSHIPPING = thisForm.SHIPPING.value;\n\t \n if ( thisForm.TAX == null )\n strTAX = \"0.00\";\n else\n strTAX = thisForm.TAX.value;\n\t \n if ( thisForm.WEIGHT == null )\n strWEIGHT = \"0.00\";\n else\n strWEIGHT = thisForm.WEIGHT.value;\n\t \n if ( thisForm.TAXEXEMPTION == null )\n strTAXEXEMPTION = \"0\";\n else\n strTAXEXEMPTION = thisForm.TAXEXEMPTION.value;\n\t \n \n if ( thisForm.ADDITIONALINFO == null ) {\n strADDTLINFO = \"\";\n } else {\n if (thisForm.ADDITIONALINFO.selectedIndex == 0) {\n notice = \"Please \" + thisForm.ADDITIONALINFO[thisForm.ADDITIONALINFO.selectedIndex].text + \" from the drop down menu\";\n ShowAlert(notice, \"red\");\n\t //location.href=location.href;\n return false; }\n\t\t\tvar xx = thisForm.ADDITIONALINFO[thisForm.ADDITIONALINFO.selectedIndex].value.split(\"^\");\n\t\t\tstrADDTLINFO = xx[0];\n\t\t\tstrPRICE = parseFloat(strPRICE) + parseFloat( xx[1] );\n\t\t\tif (strSKU.length > 0 & xx[2].length > 0){\n\t\t\t\t\tstrSKU = strSKU + \"-\" + xx[2];\n\t\t\t}\n }\n \n \n\t \n if ( thisForm.ADDITIONALINFO2 != null ) {\n if (thisForm.ADDITIONALINFO2.selectedIndex == 0) {\n notice = \"Please \" + thisForm.ADDITIONALINFO2[thisForm.ADDITIONALINFO2.selectedIndex].text + \" from the drop down menu\";\n ShowAlert(notice, \"red\");\n\t //location.href=location.href;\n return false; }\n\t\t\tvar xx = thisForm.ADDITIONALINFO2[thisForm.ADDITIONALINFO2.selectedIndex].value.split(\"^\");\n\t\t\tstrADDTLINFO += \"; \" + xx[0];\n\t\t\tstrPRICE = parseFloat(strPRICE) + parseFloat( xx[1] );\n\t\t\tif (strSKU.length > 0 & xx[2].length > 0){\n\t\t\t\tstrSKU = strSKU + \"-\" + xx[2];\n\t\t\t}\n }\n if ( thisForm.ADDITIONALINFO3 != null ) {\n if (thisForm.ADDITIONALINFO3.selectedIndex == 0) {\n notice = \"Please \" + thisForm.ADDITIONALINFO3[thisForm.ADDITIONALINFO3.selectedIndex].text + \" from the drop down menu\";\n ShowAlert(notice, \"red\");\n\t //location.href=location.href;\n return false; }\n\t\t\tvar xx = thisForm.ADDITIONALINFO3[thisForm.ADDITIONALINFO3.selectedIndex].value.split(\"^\");\n\t\t\tstrADDTLINFO += \"; \" + xx[0];\n\t\t\tstrPRICE = parseFloat(strPRICE) + parseFloat( xx[1] );\n\t\t\tif (strSKU.length > 0 & xx[2].length > 0){\n\t\t\t\tstrSKU = strSKU + \"-\" + xx[2];\n\t\t\t}\n }\n if ( thisForm.ADDITIONALINFO4 != null ) {\n if (thisForm.ADDITIONALINFO4.selectedIndex == 0) {\n notice = \"Please \" + thisForm.ADDITIONALINFO4[thisForm.ADDITIONALINFO4.selectedIndex].text + \" from the drop down menu\";\n ShowAlert(notice, \"red\");\n\t //location.href=location.href;\n return false; }\n\t\t\tvar xx = thisForm.ADDITIONALINFO4[thisForm.ADDITIONALINFO4.selectedIndex].value.split(\"^\");\n\t\t\tstrADDTLINFO += \" \" + xx[0];\n\t\t\tstrPRICE = parseFloat(strPRICE) + parseFloat( xx[1] );\n\t\t\tif (strSKU.length > 0 & xx[2].length > 0){\n\t\t\t\tstrSKU = strSKU + \"-\" + xx[2];\n\t\t\t}\n }\n if ( thisForm.USERENTRY != null ) {\n\t\t\tstrADDTLINFO += \" \" + thisForm.USERENTRY.value;\n } \n if ( thisForm.USERENTRY2 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 2: \" + thisForm.USERENTRY2.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 3: \" + thisForm.USERENTRY3.value;\n } \n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 4: \" + thisForm.USERENTRY4.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 5: \" + thisForm.USERENTRY5.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 6: \" + thisForm.USERENTRY6.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 7: \" + thisForm.USERENTRY7.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 8: \" + thisForm.USERENTRY8.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 9: \" + thisForm.USERENTRY9.value;\n }\n if ( thisForm.USERENTRY3 != null ) {\n\t\t\tstrADDTLINFO += \"; Line 10: \" + thisForm.USERENTRY10.value;\n }\n if (strADDTLINFO != null) {\n strADDTLINFO = strADDTLINFO.replace( /\\x2F/g,\"#SF3SLASH#\");\n }\n strSLINK = thisForm.PAGE_LINK.value;\n\n //Is this product already in the cart? If so, increment quantity instead of adding another.\n for ( i = 1; i <= iNumberOrdered; i++ ) {\n NewOrder = \"Order.\" + i;\n database = \"\";\n database = GetCookie(NewOrder);\n\n Token0 = database.indexOf(\"|\", 0);\n Token1 = database.indexOf(\"|\", Token0+1);\n Token2 = database.indexOf(\"|\", Token1+1);\n Token3 = database.indexOf(\"|\", Token2+1);\n Token4 = database.indexOf(\"|\", Token3+1);\n\t Token5 = database.indexOf(\"|\", Token4+1);\n\t Token6 = database.indexOf(\"|\", Token5+1);\n\t Token7 = database.indexOf(\"|\", Token6+1);\n\t Token8 = database.indexOf(\"|\", Token7+1);\n\t Token9 = database.indexOf(\"|\", Token8+1);\n\t Token10 = database.indexOf(\"|\", Token9+1);\n\n fields = new Array;\n fields[0] = database.substring( 0, Token0 ); \t\t\t// ID_Num\n fields[1] = database.substring( Token0+1, Token1 );\t\t\t// Quantity\n fields[2] = database.substring( Token1+1, Token2 );\t\t\t// Price\n fields[3] = database.substring( Token2+1, Token3 );\t\t\t// Name\n fields[4] = database.substring( Token3+1, Token4 );\t\t\t// Shipping\n\t fields[5] = database.substring( Token4+1, Token5 );\t\t\t// Tax\n\t fields[6] = database.substring( Token5+1, Token6 );\t\t\t// Weight\n\t fields[7] = database.substring( Token6+1, Token7 );\t\t\t// Tax Exemption Flag\n fields[8] = database.substring( Token7+1, Token8 );\t// Additional Information\n\t fields[9] = database.substring( Token8+1, Token9 );\t// page link\n\t fields[10] = database.substring( Token9+1, Token10 );\t// SKU code\n\t fields[11] = database.substring( Token10+1, database.length );\t// SCurrency Symbol\n\t MonetarySymbol = fields[11];\n\n if ( fields[0] == strID_NUM &&\n fields[2] == strPRICE &&\n fields[3] == strNAME &&\n fields[8] == strADDTLINFO\n ) {\n bAlreadyInCart = true;\n dbUpdatedOrder = strID_NUM + \"|\" +\n (parseInt(strQUANTITY)+parseInt(fields[1])) + \"|\" +\n strPRICE + \"|\" +\n strNAME + \"|\" +\n strSHIPPING + \"|\" +\n\t\t\t\t\t\t strTAX + \"|\" +\n\t\t\t\t\t\t strWEIGHT + \"|\" +\n\t\t\t\t\t\t strTAXEXEMPTION + \"|\" +\n strADDTLINFO + \"|\" +\n\t\t\t\t\t\t strSLINK + \"|\" +\n\t\t\t\t\t\t strSKU + \"|\" +\n\t\t\t\t\t\t strCURRENCY_SYMBOL;\n strNewOrder = \"Order.\" + i;\n DeleteCookie(strNewOrder, \"/\");\n SetCookie(strNewOrder, dbUpdatedOrder, null, \"/\");\n notice = strQUANTITY + \" \" + strNAME + strAdded;\n break;\n }\n }\n\n\n if ( !bAlreadyInCart ) {\n iNumberOrdered++;\n\n if ( iNumberOrdered > 75 )\n {\n ShowAlert( strSorry, \"red\" );\n return false;\n }\n else {\n dbUpdatedOrder = strID_NUM + \"|\" + \n strQUANTITY + \"|\" +\n strPRICE + \"|\" +\n strNAME + \"|\" +\n strSHIPPING + \"|\" +\n\t\t\t\t\t\t strTAX + \"|\" +\n\t\t\t\t\t\t strWEIGHT + \"|\" +\n\t\t\t\t\t\t strTAXEXEMPTION + \"|\" +\n strADDTLINFO + \"|\" +\n\t\t\t\t\t\t strSLINK + \"|\" +\n\t\t\t\t\t\t strSKU + \"|\" +\n\t\t\t\t\t\t strCURRENCY_SYMBOL;\n\n strNewOrder = \"Order.\" + iNumberOrdered;\n SetCookie(strNewOrder, dbUpdatedOrder, null, \"/\");\n SetCookie(\"NumberOrdered\", iNumberOrdered, null, \"/\");\n notice = strQUANTITY + \" \" + strNAME + strAdded;\n }\n }\n\n if ( JumpToCart ) \n {\n\tholdjump = true;\n\t}\n\n if ( DisplayNotice ) \n \t{\n \t\tShowAlert(notice);\n \t}\n else \n \t{\n\t\tif ( JumpToCart ) \n \t{\n\t\t var webpage = location.href.lastIndexOf(\"/\");\n\t\t var cartpage = location.href.substring(0,webpage)+\"/cart\";\n\t\t window.location.href= cartpage; \n\t\t}\n\t\telse \n\t\t{ \n\t\t if ( ReloadPage )\n\t\t {\n \t\t\tvar webpage = location.href;\n\t\t\t window.location.href= webpage;\n\t\t }\n\t\t}\n\t}\nreturn false;\n}", "title": "" }, { "docid": "99fd3c1efb2d77aabfa9df10730a7840", "score": "0.6251096", "text": "function productCartEmptyValidate(log_message_id) {\n if(g_scenario_type == g_scenario_type_list.request_document || g_scenario_type == g_scenario_type_list.add_to_cart) {\n if(!g_cart_product_list.length) {\n var error_msg = 'Please select at least one item..';\n var msg_group = getMessageBox(log_message_id);\n\n if(g_scenario_type == g_scenario_type_list.request_document) {\n if(!isEmpty($.fn.fileinputLocales[g_language]) && !isEmpty($.fn.fileinputLocales[g_language]['validate_require_document_item'])) {\n error_msg = $.fn.fileinputLocales[g_language]['validate_require_document_item'];\n }\n\n } else if(g_scenario_type == g_scenario_type_list.add_to_cart) {\n if(!isEmpty($.fn.fileinputLocales[g_language]) && !isEmpty($.fn.fileinputLocales[g_language]['validate_require_product_item'])) {\n error_msg = $.fn.fileinputLocales[g_language]['validate_require_product_item'];\n }\n }\n\n createNotify(error_msg, msg_group.find('.chat-body'), 'cart_require_item', false, false);\n\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "70f21ac5d53d1821813a126e84cbbf40", "score": "0.62479234", "text": "function add_product1() {\r\n var product1,\r\n numberOfItems1 = document.getElementById(\"quantity1\").value;\r\n if(numberOfItems1 == \"\") {\r\n alert(\"You need to choose the quantity before adding the item to cart!\");\r\n } else if(!numbersOnly.test(numberOfItems1) || (numberOfItems1 == 0)) {\r\n alert(\"Invalid input!\");\r\n } else {\r\n products.push(\"FENDER SQUIER BULLET STRATOCASTER\");\r\n numberOfItems.push(numberOfItems1);\r\n var totalPrice1 = prices[0]*numberOfItems1;\r\n bill.push(totalPrice1);\r\n document.getElementById(\"addToCart1\").innerHTML = \"Added to Cart\";\r\n document.getElementById(\"addToCart1\").disabled = true;\r\n document.getElementById(\"removeFromCart1\").style.visibility = \"visible\";\r\n document.getElementById(\"quantity1\").disabled = true;\r\n }\r\n}", "title": "" }, { "docid": "00c22ee33202e639c27a10b7631bebe1", "score": "0.6243016", "text": "function order() {\n //notify user\n window.alert('Products ordered!');\n //balance credit\n credit -= sum;\n //reset shopping cart\n var product;\n for (product in products) {\n products[product].count = 0;\n }\n //reset total sum\n sum = 0;\n //apply changes\n updateProducts();\n}", "title": "" }, { "docid": "8b213dde855051eeb75b4ed1fcbfcc54", "score": "0.6231693", "text": "function validateInvoiceInput(prodID, status, quantity) {\n if(status){\n props.inventory.map( (item) => {\n let hasEnoughInStock = (item.quantity >= quantity)\n if(item.id === prodID){\n if(!hasEnoughInStock){\n alert(\"There is not enough inventory in stock to complete this invoice.\")\n }\n return hasEnoughInStock\n }\n })\n } else {\n let isInCatalog = props.catalog.hasOwnProperty(prodID)\n if(!isInCatalog) {\n alert(\"This product is not in the catalog.\")\n }\n return isInCatalog\n }\n }", "title": "" }, { "docid": "ae2bd93e9d4dcc683696f19a4fc8d416", "score": "0.62101656", "text": "function productpurchase(chair, bench, table) {\n\n Totalproductload = loadChairs + loadBenches + loadTables;\n Totalproductpurchase = chair + bench + table;\n //console.log(Totalproductload);\n //console.log(Totalproductpurchase);\n if (isloaderror) {\n\n if (isNaN(chair)) {\n console.log('error to purchase');\n return;\n }\n if (isNaN(bench)) {\n console.log('error to purchase');\n return;\n }\n if (isNaN(table)) {\n console.log('error to purchase');\n return;\n }\n\n if (chair >= loadChairs) {\n console.log('purchase Qty is higer then stock');\n console.log('please enter below of stock count');\n console.log('Chairs are not available');\n console.log('error message');\n console.log(`here Stock:${loadChairs}`);\n console.log(`Required Qty:${chair}`);\n return;\n } else {\n console.log('Chairs are available');\n console.log(`here Stock:${loadChairs}`);\n console.log(`Required Qty:${chair}`);\n console.log('');\n }\n\n if (bench >= loadBenches) {\n console.log('purchase Qty is higer then stock');\n console.log('please enter below of stock count');\n console.log('Benches are not available');\n console.log('error message');\n console.log(`here Stock:${loadBenches}`);\n console.log(`Required Qty:${bench}`);\n return;\n } else {\n console.log('Benches are available');\n console.log(`here Stock:${loadBenches}`);\n console.log(`Required Qty:${bench}`);\n console.log('');\n }\n if (table >= loadTables) {\n console.log('purchase Qty is higer then stock');\n console.log('please enter below of stock count');\n console.log('Tables are not available');\n console.log('error message');\n console.log(`here Stock:${loadTables}`);\n console.log(`Required Qty:${table}`);\n return;\n } else {\n console.log('Tables are available');\n console.log(`here Stock:${loadTables}`);\n console.log(`Required Qty:${table}`);\n console.log('');\n\n }\n } else {\n console.log('stock is not loaded');\n }\n display(chair, bench, table);\n display2(chair, bench, table);\n}", "title": "" }, { "docid": "964877d91ad18089dfcb227091f08ec1", "score": "0.61974716", "text": "function proceedCheckout() {\n let checkoutOrderContent = document.getElementsByClassName(\"checkout-div\")[0];\n let textPrice = checkoutOrderContent.getElementsByClassName(\"total-order\")[0].innerText.replace(\"Subtotal: $\",\"\");\n let subTotalPrice = parseFloat(textPrice);\n\n if(subTotalPrice !== 0){\n let modal = document.getElementById(\"summary-page\");\n modal.style.display = \"block\";\n blurControl();\n getOrderedItems(listOrderedItems); //FUNCTION FROM summary_page.js\n }else{\n alert(\"Please add items to the cart.\");\n }//end if-else\n \n}", "title": "" }, { "docid": "4e4cb2c1b38089a63cf8af2c6a2ad40a", "score": "0.61942285", "text": "function addToCart(){\n showSummary = false;\n validateOrder();\n}", "title": "" }, { "docid": "b8db0aafef527fd75b714b4b35e6d31d", "score": "0.6174914", "text": "requestAjax(data) {\r\n var csrftoken = Cart.getCookie('csrftoken');\r\n\r\n // Initiate new request\r\n const request = new XMLHttpRequest();\r\n request.open('POST', '/products/check-price/', true);\r\n\r\n // Set request header with CSRF token code\r\n request.setRequestHeader('X-CSRFToken', csrftoken);\r\n request.setRequestHeader('contentType', 'application/json; charset=utf-8');\r\n\r\n // Callback function for when request completes\r\n request.onload = () => {\r\n const serverResponse = JSON.parse(request.responseText);\r\n\r\n if (serverResponse.success) {\r\n const submitButton = document.querySelector('#order-button');\r\n console.log(`Server returned: ${serverResponse.image}`);\r\n // Adds price to submit button\r\n content = `${serverResponse.price}`;\r\n document.querySelector('#price').innerHTML = content;\r\n\r\n // Store data in button element for later use\r\n submitButton.setAttribute('data-name', serverResponse.name);\r\n submitButton.setAttribute('data-slug', serverResponse.slug);\r\n submitButton.setAttribute('data-price', serverResponse.price);\r\n\r\n // Sets product image\r\n this.setProductImage(serverResponse.image);\r\n\r\n // Add action url to form\r\n document.querySelector('#order-form').action = '#';\r\n\r\n if (data['category'] === 'Sub') {\r\n // Rechecks if toppings are selected, updates price\r\n this.priceToppings();\r\n }\r\n\r\n // Enables form to send data again, if blocked before\r\n document.querySelector('#order-form').onsubmit = e => {\r\n e.returnValue = true;\r\n };\r\n }\r\n else {\r\n // Insert error message in button\r\n document.querySelector('#price').innerHTML = 'Error retrieving price';\r\n\r\n this.displayAlert(serverResponse.message);\r\n\r\n //Removes form action url\r\n document.querySelector('#order-form').action = '#';\r\n\r\n // Prevents form from reloading the page if server does not return valid product\r\n document.querySelector('#order-form').onsubmit = e => {\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n\r\n console.log(`Sending to server: ${data.category}, ${data.size} and ${data.product}`)\r\n // Requests price information to server\r\n request.send(JSON.stringify(data));\r\n }", "title": "" }, { "docid": "8e2f6107639f197208a73ffe6d6b04bd", "score": "0.615853", "text": "getCart() {\n let cartCheck;\n function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = 'expires=' + d.toUTCString();\n document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';\n }\n typeof cartObjectData === 'undefined' || (cartObjectData ? cartObjectData.length == 0 : false) ? window.cartObjectData = {} : null;\n typeof AJAXSettings === 'undefined' ? window.AJAXSettings = {} : null;\n cartObjectData, AJAXSettings = {\n 'async': true,\n 'crossDomain': true,\n 'url': '/api/storefront/carts?include=lineItems.digitalItems.options,lineItems.physicalItems.options',\n 'method': 'GET',\n 'headers': {}\n };\n return Promise.resolve($.ajax(AJAXSettings).then(function(responseText) {\n Promise.resolve(JSON.stringify(responseText, null, 3))\n .then((data) => {\n cartObjectData = JSON.parse(data);\n return Promise.resolve(cartObjectData)\n .then((parsedData)=>{\n if(parsedData.length === 0) {\n setCookie('cart_id','',-1);\n window['bc_cookie'] = parseCookies();\n cartCheck = false;\n } else {\n setCookie('cart_id', String(parsedData[0].id));\n window['bc_cookie'] = parseCookies();\n cartCheck = true;\n } \n });\n \n });\n })).then(()=>{return cartCheck});\n }", "title": "" }, { "docid": "09b7ccceed694276e6a63eccbee31dfd", "score": "0.61582774", "text": "function getSelectedItem(){\n totalInCart += selectedQuantity;\n if (!qtyExist){\n showCart();\n }\n updateCart();\n }", "title": "" }, { "docid": "fc2a60d66099758bccd351650c3b3cdb", "score": "0.6150179", "text": "function checkInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n \n// If not, the app should log a phrase like Insufficient quantity!, and then prevent the order from going through.\n\n if (res[answer.productID - 1].stock_quanity == 0) {\n console.log(\"\")\n console.log(\"Insufficient Quantity!\")\n }\n\n// However, if your store does have enough of the product, you should fulfill the customer's order.\n\n else {\n console.log(\"\")\n console.log(\"Stock Quanity\")\n console.log(res[answer.productID - 1].stock_quanity)\n // productID.totalUnits - inquirerResponse.numUnits\n // =================================================================\n updateInv(); \n } \n });\n}", "title": "" }, { "docid": "88f6a5b61b1ddf98908ad806e881466e", "score": "0.61441255", "text": "function addProduct() {\r\n let productKey = $(this).attr(\"id\");\r\n SHOPPING_DATA.cart.push(PRODUCTS_DATA.PRODUCTS[productKey]);\r\n console.log(SHOPPING_DATA.cart.length)\r\n if (SHOPPING_DATA.cart.length==5){\r\n alert(\"Buy 5 more products to get a $5 discount\")\r\n } else if (SHOPPING_DATA.cart.length==10){\r\n alert (\"You had earned $5 discount\")\r\n }\r\n displayCart();\r\n $(\"#total\").text(\"$\" + SHOPPING_DATA.sumOfPrices.reduce(function(a, b) {\r\n return a + b;\r\n }, 0));\r\n showPrice();\r\n SHOPPING_DATA.sumOfPrices.push(Object.values(PRODUCTS_DATA)[selectedProduct.attr(\"id\")].price);\r\n\r\n}", "title": "" }, { "docid": "2fbf99f2ef0281408a1d73815533620d", "score": "0.61421454", "text": "function addStock() {\n\t// Get array of selected checkboxes from helper function\n\tvar boxesChecked = getSelectedRowBoxes();\n\t// for every index of the length of the array\n\tfor (var i = 0; i < boxesChecked.length; i++) {\n\t\t// Using DOM manipulation get a selected checkbox in the array\n\t\tvar status = boxesChecked[i].parentNode.parentNode.lastChild;\n\t\t// Change status to \"Yes\"\n\t\tstatus.textContent = \"Yes\";\n\t\t// And the class is now \"true\"\n\t\tstatus.className = \"true\";\n\n\t\t// Update the Product in the products array that \n\t\t// corresponds to the checked checkbox we're updating.\n\t\tvar prodId = boxesChecked[i].parentNode.parentNode.id;\n\t\tproducts[prodId].inStock = true;\n\n\t};\n\tsaveData();\n}", "title": "" }, { "docid": "7457c0abb7f0ec670cdf0ef0e23b6a25", "score": "0.6136663", "text": "function submit() {\n var stock = document.getElementById('stocksearch').value;\n if (stocks.includes(stock)) {\n addTickerToUserList(stock)\n }\n else {\n sendError()\n }\n }", "title": "" }, { "docid": "20f68cb00a792c5840b211e61c7d1cd1", "score": "0.6131297", "text": "function checkout() {\n var androidQuantity = $(\"#androidQuantity\").val();\n var iosQuantity = $(\"#iosQuantity\").val();\n\n $(\".section-shoppingCart\").show();\n $(\"#iosNum\").text(iosQuantity);\n $(\"#androidNum\").text(androidQuantity);\n $(\"#totalTotal\").text(\"Total: \" + (android.calc(androidQuantity)+ios.calc(iosQuantity)) + \"$\");\n }", "title": "" }, { "docid": "df0ba68c6928b36b22545a137376730c", "score": "0.6120939", "text": "function fieldsCheck(){\n\t//these will be the values to change to determine if all fields are complete\n\tconsole.log(\"running check\");\n\tvar sizes = document.getElementsByName(\"size\");\n\tvar sizeCheck = false;\n\tvar colors = document.getElementsByName(\"color\");\n\tvar colorCheck = false;\n\tvar quantity = document.getElementById(\"qty\").value;\n\tvar qntCheck = false;\n\t//loops throuigh sizes to see if one is checked\n\tfor (var i = 0; i < sizes.length; i++) {\n\t\tif(sizes[i].checked){\n\t\t\tsizeCheck = true;\n\t\t\tconsole.log(\"checking size\");\n\t\t}\t\n\t}\n\t//loops through colors to make sure one is checked\n\tfor (var i = 0; i < colors.length; i++) {\n\t\tif(colors[i].checked){\n\t\t\tcolorCheck = true;\n\t\t\tconsole.log(\"checking color\");\n\t\t}\n\t\t\t\n\t}\n\t//checks to see is the input typp number for quantity has at least one\n\tif (quantity >= 1){\n\t\tqntCheck = true;\n\t\tconsole.log(\"checking qty\");\n\t}\n\t//check all booleans are true then removes the diasbled attribute of the cart button\n\tif (sizeCheck && colorCheck && qntCheck){\n\t\tdocument.getElementById(\"addToCart\").disabled = false;\n\t\tconsole.log(\"size true\");\n\t}\n \n}", "title": "" }, { "docid": "d15e54045562cfd84012840768b44761", "score": "0.60980743", "text": "function addToCart() {\n button.addEventListener('click', (event) => {\n event.preventDefault() // prevent auto send\n\n // selected item object\n let selectedColor = document.querySelector('.colors .selected')\n let selectedId = document.querySelector('.id')\n let selectedImage = document.querySelector('.main-img img')\n let selectedName = document.querySelector('.name')\n let selectedPrice = document.querySelector('.price')\n let selectedQTY = document.querySelector('.value')\n let selectedSize = document.querySelector('.sizes .selected')\n let maxStock = getStock(\n selectedColor.getAttribute('alt'),\n selectedSize.textContent\n )\n let item = {\n color: {\n code: selectedColor.getAttribute('alt'),\n name: selectedColor.dataset.name,\n },\n id: parseInt(selectedId.textContent),\n main_image: selectedImage.getAttribute('src'),\n name: selectedName.textContent,\n price: parseInt(selectedPrice.textContent.slice(4)),\n qty: parseInt(selectedQTY.textContent),\n size: selectedSize.textContent,\n stock: maxStock,\n }\n\n // add selected item to cart\n let index\n if (cartList.length > 0) {\n for (let i = 0; i < cartList.length; i++) {\n if (\n cartList[i].color.code === item.color.code &&\n cartList[i].size === item.size &&\n cartList[i].id === item.id\n ) {\n index = i\n }\n }\n if (index >= 0) {\n cartList[index].qty = item.qty\n } else {\n cartList.push(item)\n }\n } else {\n cartList.push(item)\n }\n\n localStorage.setItem('cart', JSON.stringify(cartList))\n alert('已加入購物車')\n handleCartNum()\n })\n}", "title": "" }, { "docid": "7407e90d931e3894de002d83deb76449", "score": "0.60973537", "text": "function validateOrder() {\n\n// Query database\n\t\tvar queryStr = 'SELECT * FROM products WHERE ?';\n\t\tconnection.query(queryStr, {item_id: item}, function(err, data) {\n\n\t\t\tif (err) throw err;\n console.log(\"Your auction was created successfully!\");\n // re-prompt the user for if they want to bid or post\n start();\n }\n );\n }", "title": "" }, { "docid": "7849aacb14c5098602663b384e51da23", "score": "0.60961854", "text": "addToCart() {\n //API request does nothing, so we just have an alert for now\n if (\n this.state.cart.cartNumber !== undefined &&\n this.state.cart.cartSize !== undefined\n ) {\n window.alert(\n `Your order of ${this.state.cart.cartNumber} size ${this.state.cart.cartSize} item(s) has been added to your cart!`\n );\n this.setState({ cart: {} });\n } else {\n window.alert(\n `Please pick a size and number of items before adding to your cart!`\n );\n }\n }", "title": "" }, { "docid": "cc40dc75a4ac8620b12f82a5326f90b1", "score": "0.6088935", "text": "function addToCart(index){\r\n var tmpSku = imageSupplements[index].getAttribute(\"name\");\r\n \r\n $(\"[name='add_\" + tmpSku + \"']\").on('click', function(){\r\n //Qty empty\r\n if(isNaN($(\"[name='qty_\" + tmpSku + \"']\").val()) || ($(\"[name='qty_\" + tmpSku + \"']\").val()).trim().length == 0){\r\n $('#addToCartError_' + imageSupplements[index].getAttribute(\"name\")).html(\"Enter a number.\");\r\n errorHandler($(\"[name='qty_\" + tmpSku + \"']\"));\r\n }\r\n //Qty > available qty\r\n else if(Number($(\"[name='qty_\" + tmpSku + \"']\").val()) > (Number(fetchQuantitySupplements(tmpSku)) - Number(sessionStorage.getItem(tmpSku)))){\r\n $('#addToCartError_' + imageSupplements[index].getAttribute(\"name\")).html(\"Only \" + (Number(fetchQuantitySupplements(tmpSku)) - Number(sessionStorage.getItem(tmpSku))) + \" left in stock.\");\r\n errorHandler($(\"[name='qty_\" + tmpSku + \"']\"));\r\n }\r\n //Qty = \"-\" or \"0\"\r\n else if($(\"[name='qty_\" + tmpSku + \"']\").val() < 1){\r\n $('#addToCartError_' + imageSupplements[index].getAttribute(\"name\")).html(\"Enter a number > 0.\");\r\n errorHandler($(\"[name='qty_\" + tmpSku + \"']\"));\r\n }\r\n //Qty valid \r\n else{ \r\n updateSession(tmpSku, $(\"[name='qty_\" + tmpSku + \"']\").val());\r\n $('#addToCartError_' + imageSupplements[index].getAttribute(\"name\")).html(\"\");\r\n $(\"[name='qty_\" + tmpSku + \"']\").val(\"\")\r\n $('#dialog-modal_'+imageSupplements[index].getAttribute(\"name\")).dialog('close');\r\n //open shopping cart\r\n $('[name=\"cartDialog\"]').dialog('open'); \r\n //update shopping cart\r\n updateCart();\r\n updateQuantitySupplements(tmpSku, $(\"[name='qty_\" + tmpSku + \"']\").val());\r\n }\r\n });\r\n \r\n $(\"[name='qty_\" + tmpSku + \"']\").on('focus', function(){\r\n clearError($(\"[name='qty_\" + tmpSku + \"']\"));\r\n });\r\n }", "title": "" }, { "docid": "35996ca21cf15bb1cfef2fa5272bd89b", "score": "0.60811394", "text": "function btBuscarStock(){\n\t\tvar form = document.forms['MWEBFilterStockForm'];\n\t\tvar listado=[ form['codigoArticuloPropietario'].value, form['codigoArticulo'].value, \n form['descripcion'].value, form['categoria'].value, form['lote'].value,\n form['fechaIni'].value, form['fechaFin'].value ];\n\t\tif (estanTodosCamposVacios(listado) ) {\n\t\t\talert(txtCamposVacios);\n\t\t}\n\t\telse if (validaFechasStock()){\n\t\t\t//form['modo'].value = modo;\n //alert(listado);\n \t document.forms['MWEBFilterStockForm'].submit();\t \n \t} \n}", "title": "" }, { "docid": "5666fa96f66df54721b72bfbfd565b4a", "score": "0.6069995", "text": "function dataCheckInCarouselAddToCart() {\n\tvar datalength = jQuery('#carouseladdtocart > .carouselwrap > .carousel-box > .carouselscroll > em > .carouselscrollbox').length;\n\t\n\tif (datalength != null && datalength > 4) {\n\t\tjQuery('#carouseladdtocart > .carouselwrap > .carouselprev, #carouseladdtocart > .carouselwrap > .carouselnext').removeClass('hide');\n\t}\n\t\n\tvar ordercode = jQuery.urlParam(\"ordercode\");\n\t\n\tif(datalength != null && ordercode != undefined && ordercode !=null && ordercode != ''){\n\t\tjQuery('#carouseladdtocart > .carouselwrap > #addtocart-items-box > #addtocart-items-box_Carousel > .carouselContainer > .carouselProductLists > .carouselProduct > .carouselAddToCart > .button > .add-to-cart').val(\"Add To Order\");\n\t\t\n\t\tjQuery('#carouseladdtocart > .carouselwrap > .carousel-box > .carouselscroll > em > .carouselscrollbox > .item ').each(function(index) {\n\t\t\tjQuery('a').each(function(index) {\n\t\t\t\tvar imgNodes = jQuery(this).find('img');\n\t\t\t\tif(imgNodes != null && imgNodes[0] != null){\n\t\t\t\t\tjQuery(this).replaceWidth(imgNodes[0]);\n\t\t\t\t}\n\t\t\t});\n\t\t\tjQuery('.item-detail > .product-name').each(function(index) {\n\t\t\t\tvar label = node.innerHTML;\n\t\t\t\tvar p = jQuery('<p/>');\n\t\t\t\tp.html(label);\n\t\t\t\tjQuery(p).addClass(\"product-name\");\n\t\t\t\tjQuery(node).replaceWith(p);\n\t\t\t});\n\t\t});\n\t\t\n\t}\n\t\n\tjQuery(\"#addToCartModal .s7LazyLoad\").unveil(300);\n\n}", "title": "" }, { "docid": "ae104caea46ada0d84027477ed90e0ba", "score": "0.6066741", "text": "function updateCart() {\n\n // get all current products from localStorage\n let cartCurrentProducts = JSON.parse(localStorage.getItem(\"products\"));\n\n let buttonType = this.id.slice(0, 3); //get the button id first string part\n let id = this.id.slice(4); //get button id integer part\n let totalPrice = 0;\n\n cartCurrentProducts.forEach((product, index) => {\n\n //selecting the clicked product quantity input from the cart list\n productQuantity = document.querySelector(`#quantity-${id}`);\n let quantity = parseInt(productQuantity.value);\n\n if (product.product_id == id) {\n\n if (buttonType === \"add\") { //check button is for adding products\n quantity++;\n productQuantity.value = quantity;\n }\n else if (buttonType === \"sub\") { //check button is for subtracting products\n if (quantity > 1) { //subbract if products are >1\n quantity--;\n productQuantity.value = quantity;\n }\n else { //else remove the product from cart and localStorage\n quantity--;\n\n // delete the object from current cart items when 0 quantity\n cartCurrentProducts.splice(index, 1);\n\n // set the updated products in local Stprage\n localStorage.setItem('products', JSON.stringify(cartCurrentProducts));\n\n // reflect the cart product changes in cart page\n showCartProducts();\n\n // enforce to remove the header of cart products table, when no items in cart\n if (cartCurrentProducts.length == 0) {\n document.querySelector(\".user-cart-head\").style.display = \"none\";\n }\n }\n }\n\n //update the localStorage if quantity >=1\n if (quantity >= 1) {\n\n //calculate total price\n totalPrice = quantity * product.product_price;\n\n let cartItems = []; // array of selected products by user\n\n let productJson = {\n product_id: product.product_id,\n category_name: product.category_name,\n product_name: product.product_name,\n product_description: product.product_description,\n product_image: product.product_image,\n product_quantity: parseInt(productQuantity.value),\n product_price: product.product_price,\n total_price: totalPrice\n };\n\n // get all current products from cart \n let previousProducts = JSON.parse(localStorage.getItem(\"products\"));\n\n previousProducts.forEach(preProduct => {\n\n /*\n add the items which are not\n edited in cart\n */\n if (preProduct.product_id !== productJson.product_id) {\n cartItems.push(preProduct);\n }\n });\n\n // add the edited cart item\n cartItems.push(productJson);\n\n // storing product detail in local storage with totalprice and quantity\n localStorage.setItem(\"products\", JSON.stringify(cartItems));\n\n // reflect the cart product changes in cart page\n showCartProducts();\n }\n }\n });\n}", "title": "" }, { "docid": "996c5786f213796b00185bd9ec00285b", "score": "0.60578996", "text": "function getOrder () {\n let size = $(\"input:radio[name='size']:checked\").val();\n let sauce = $(\"input:radio[name='sauce']:checked\").val();\n let meatTops = [];\n let vegTops = [];\n\n//found better jquery modification for my checked box idea in first submission with loops\n$(\"input:checkbox[name='meat']:checked\").each(function() {\n let meatChecks = $(this).val();\n meatTops.push(meatChecks);\n});\n\n$(\"input:checkbox[name='veg']:checked\").each(function() {\n let vegChecks = $(this).val();\n vegTops.push(vegChecks);\n});\n//pass selections through to get priced and return to user display\nlet pizzaOrder = new PizzaOrder (size, sauce, vegTops, meatTops);\npizzaOrder.setPrice ();\n$(\"#sumPrice\").text(\"$\" + pizzaOrder.pizzaPrice);\n}", "title": "" }, { "docid": "feea63e94fd9c650e4f1bb8013fa99e2", "score": "0.60537916", "text": "function process_quantity_form (POST, response){\n model = products[0]['model'];\n model_price = products[0]['price'];\n}", "title": "" }, { "docid": "667f018458f8567769c9387334c2f313", "score": "0.6052249", "text": "function addCartVoucher(retailer_id){\n\n if (cart_process) return false;\n\n var voucher_price = $(\"select[name=voucher_prices]\").val();\n if (voucher_price == ''){\n $(\".price-notice\").html('Please select price').show();\n $(\"select[name=voucher_prices]\").change(function(){ $(\".price-notice\").hide(); });\n }\n else{\n var qty = $(\"input[name=qty]\").val();\n if (qty == ''){\n $(\".price-notice\").html('Choose your quality').show();\n $(\"input[name=qty]\").change(function(){ $(\".price-notice\").hide(); });\n }\n else{\n $(\"form[name=voucher_frm]\").find(\"input[name=voucher_price]\").val(voucher_price);\n $(\"form[name=voucher_frm]\").find(\"input[name=retailer_id]\").val(retailer_id);\n $(\"form[name=voucher_frm]\").find(\"input[name=qty]\").val(qty);\n\n cart_process = true;\n var data = {price: voucher_price, retailer_id: retailer_id, qty: qty};\n $.post(\"/site/AjaxAddCart\", data, function(response){\n if (response.status == 'success'){\n toggleMessage('success', response.message);\n updateTopBag(response.total);\n }\n else toggleMessage('error', response.message);\n\n $(\".add-cart-loader\").hide();\n cart_process = false;\n });\n }\n }\n}", "title": "" }, { "docid": "89454a0932f306110d9369b4725054ea", "score": "0.6047174", "text": "function updateCart(){\r\n var str = \"<div id='cartItems'>\";\r\n var key;\r\n var val;\r\n var tmpRetail;\r\n var subtotal = 0;\r\n \r\n if(sessionStorage.length == 0){\r\n str += \"<div id='emptyMsg'><h1>Your cart is empty</h1><p>\" + \r\n \"<input type='button' name='continueShopping' class='buttonStyle' value='Continue Shopping' /></p></div></div>\"; \r\n }\r\n else{\r\n for(var k = 0; k < sessionStorage.length; k++) { \r\n key = sessionStorage.key(k); \r\n val = sessionStorage.getItem(key);\r\n tmpRetail = fetchRetailSupplements(key);\r\n subtotal += (val*tmpRetail);\r\n\r\n str += \"<p><input type='button' name='remove_\" + key +\"' class='removeSupplementBtn' value='x'/>\" + \r\n \"<img src='http://www.***.com/~workoutSupplements/onlineStore/images/\" + \r\n key.toUpperCase() + \".jpg' width='75px' />\" + \r\n \"<span>\" + \r\n \"<input type='text' name='cartQty_\" + key + \"' size='5' value='\" + val + \"'/>\" +\r\n \" x <input type='text' size='5' value='\" +tmpRetail + \"' disabled/> = <input type='text' name='cartSubTotal_\" + \r\n key + \"' size='5' value='\" + \r\n (val*tmpRetail).toFixed(2) +\"' disabled/></span></p>\"; \r\n } \r\n str += \"</div>\";\r\n str += \"<div id='subtotalPrice'><div id='cartErrorMsg' name='cartErrorMsg'>&nbsp;</div><hr><p>SUBTOTAL : $\" + subtotal.toFixed(2) + \"</p>\";\r\n str += \"<p><input type='button' name='continueShopping' class='buttonStyle' value='Continue Shopping' />\";\r\n str += \"<input type='button' name='checkout' class='buttonStyle' value='Check Out Now'/>\";\r\n str += \"</p></div>\";\r\n }\r\n $('[name=\"cartDialog\"]').html(str);\r\n cartButtons();\r\n }", "title": "" }, { "docid": "29ac3519aec2ff68929d27abbed0cf27", "score": "0.6043178", "text": "function calculTotalPrice() {\n\ttotalPrice = 0\n\tfor (i in cartStorage) {\n\t\tlet item = cartStorage[i]\n\t\ttotalPrice += item.price * item.quantity\n\t}\n\t// get a minimum of products to enable the submit button\n\tif (totalPrice < 1) {\n\t\tsubmitBtn.setAttribute(\"disabled\", true)\n\t}\n\n\treturn `\n <td class=\"text-center\"><h3>Prix total</h3></td>\n <td class=\"text-left\"><h3>${totalPrice / 100} €</h3></td>\n <td><h3> &nbsp; </h3></td>\n `\n}", "title": "" }, { "docid": "dca6acb4ee1a302a9da79ebb0117f4ac", "score": "0.6034189", "text": "function displayCart() {\n let cartItems = localStorage.getItem(\"productsInCart\")\n cartItems = JSON.parse(cartItems);\n let shoppingCart = document.querySelector(\".productscontainer\")\n let cartCost = localStorage.getItem(\"totalCost\");\n let productsinside = document.getElementsByClassName('productsinside');\n\n\n\n if (cartItems && shoppingCart) {\n shoppingCart.innerHTML = \" \";\n Object.values(cartItems).map(item => {\n shoppingCart.innerHTML += `<div class=\"productsinside\" >\n <img class=\"pic\" src = ./images/${item.tag}.jpg>\n <div class= \"productname\">${item.name}</div>\n <div class= \"price\">Price R ${item.price}</div>\n <div class= \"vat\">Vat R${item.price * 15/100}</div>\n <div class=\"qty\"><input type=\"text\" placeholder=\"Qty ${item.inCart}\" class=\"input\"></div>\n <div class=mastertotal>R ${item.inCart * item.price + item.price * 15/100 * item.inCart }</div>\n </div>`\n })\n\n let vat = cartCost * 15 / 100\n cartCost = JSON.parse(cartCost);\n\n shoppingCart.innerHTML += `\n\n <input type=\"button\" class=\"clearcart\" value=\"Clear Cart\" onclick=\"clearClick()\">\n\n <div class=\"mainheading\">\n Choose Your Delivery Option\n </div>\n\n <span class=\"product-header\">\n <form class=\"deliveryoption\">\n \n <h6 class=\"label\" id=\"label1\">Collection <input type=\"checkbox\" class=\"tick\" id=\"tick1\"> </h6> \n <p class=\"p\" id=\"p1\">Free - In Store</p>\n <input type=\"button\" class=\"addbtn\" id=\"addbtn1\" value=\"Add to Total\">\n \n \n <h6 class=\"label\" id=\"label2\">Delivery Option 1 <input type=\"checkbox\" class=\"tick\" id=\"tick2\"> </h6>\n \n <span class=\"show\">\n <p class=\"p\" id=\"p2\">- Less than 50Km R 150.00</p>\n <input type=\"button\" class=\"addbtn\" id=\"addbtn2\" value=\"Add to Total\">\n </span>\n \n <h6 class=\"label\" id=\"label3\">Delivery Option 2 <input type=\"checkbox\" class=\"tick\" id=\"tick3\"> </h6>\n \n <span class=\"show\">\n <p class=\"p\" id=\"p3\">- More than 50Km R 400.00</p>\n <input type=\"button\" class=\"addbtn\" id=\"addbtn3\" value=\"Add to Total\">\n </span>\n </form>\n </span>\n\n <span class=\"shoppingCarttotalContainer\">\n <div class=\"Promo\">\n <h6 class=\"ddheader\">Click On A Number From 1 to 10 To Qualify For A Discount</h6>\n <nav id=\"nav\">\n <ul id=\"maindrop\">\n <li>1-10</li>\n <ul id=\"subdrop\">\n <li id=\"a\">1</li>\n <li id=\"b\">2</li>\n <li id=\"c\">3</li>\n <li id=\"d\">4</li>\n <li id=\"e\">5</li>\n <li id=\"f\">6</li>\n <li id=\"g\">7</li>\n <li id=\"h\">8</li>\n <li id=\"i\">9</li>\n <li id=\"j\">10</li>\n </ul>\n </ul>\n </nav>\n <input id=\"promocode\" type=\"text\" placeholder=\"Promo Code\">\n <input type=\"button\" onclick=\"promo()\" value=\"Apply Discount\" class=\"applybtn\">\n </div>\n <h6 class=\"shoppingCarttotaltitle\">Shopping Cart Total Is</h6>\n <h6 class=\"shoppingCarttotal\">R ${cartCost + vat } Including VAT</h6>\n <h6 class=\"newshoppingCarttotal\">R ${cartCost + vat + 150 } Including VAT & Delivery</h6>\n <h6 class=\"bigshoppingCarttotal\">R ${cartCost + vat + 400 } Including VAT & Delivery</h6>\n <h6 class=\"discount10Carttotal\">R ${(cartCost + vat) * 0.10} Discount</h6>\n <h6 class=\"discount20Carttotal\">R ${(cartCost + vat) * 0.10} Discount</h6>\n <h6 class=\"grandshoppingCarttotal\">Grand Total R ${cartCost + vat - (cartCost + vat) * 0.10}</h6>\n <h6 class=\"grandshoppingCarttotal2\">Grand Total R ${cartCost + vat - (cartCost + vat) * 0.20}</h6>\n\n </span>`\n }\n}", "title": "" }, { "docid": "da582860ece21a691648a680b310f9a1", "score": "0.6028193", "text": "function submitCheckout(){\n const productIds = [];\n\n state.cart.forEach((item) =>{\n productIds.push(item._id);\n });\n\n getCheckout({\n variables: { games: productIds }\n });\n }", "title": "" }, { "docid": "d5d66d40599727f7f2628a1bb25de348", "score": "0.60273516", "text": "addQty() {\n if (this.getValidConfigProductIds().length === 1 && this.state.valid_product) {\n let stock = this.state.valid_product.stocks[0].qty;\n let currentQty = parseFloat(this.state.current_qty);\n let addQtyIncrement = this.getProductStockService(this.state.valid_product)\n .getAddQtyIncrement(this.state.valid_product);\n currentQty = NumberHelper.addNumber(currentQty, addQtyIncrement);\n if (currentQty > stock.qty) {\n currentQty = stock.qty;\n }\n let validateQty = this.validateQty(this.state.valid_product, currentQty);\n if (validateQty) {\n this.setState(\n {current_qty: String(currentQty)},\n this.recollectPriceAfterChangeQty\n );\n }\n }\n }", "title": "" }, { "docid": "7c974e77266b50c4774a1c20b9303e0e", "score": "0.60268086", "text": "function buyOrder() {\r\n const buyForm = document.getElementById(\"buyForm\");\r\n buyForm.submit()\r\n }", "title": "" }, { "docid": "49623189783a1acdea739b6653d98096", "score": "0.6018461", "text": "function sent() \r\n\t{\r\n\t\tgetJSONData(CART_BUY_URL).then(function(resultObj){\r\n\r\n\t\t\tif (resultObj.status === \"ok\"){\r\n\t\t\t\tbuyMsg = resultObj.data;\r\n\t\r\n\t\t\tlet htmlContentToAppend = \"\"; \r\n\t\t\tvar quantity = document.getElementById('productCount').value\r\n\r\n\t\t\tvar validStreet = document.getElementById('productAddress').checkValidity();\r\n\t\t\tvar validStreetNumber = document.getElementById('productNumber').checkValidity();\r\n\t\t\tvar validState = document.getElementById('productState').checkValidity();\r\n\t\t\tvar validDept = document.getElementById('productState1').checkValidity();\r\n\t\t\tvar validTel = document.getElementById('productTel').checkValidity();\r\n\t\t\tvar validCcName = document.getElementById('cc-name').checkValidity();\r\n\t\t\tvar validCcNum = document.getElementById('cc-number').checkValidity();\r\n\t\t\tvar validCcExp = document.getElementById('cc-expiration').checkValidity()\r\n\t\t\tvar validCcCvv = document.getElementById('cc-cvv').checkValidity()\r\n\t\t\r\n\r\n\t\tif (validStreet && validStreetNumber && validState && validDept && validTel && validCcName && validCcNum && validCcExp && validCcCvv && quantity > 0)\r\n\r\n\t\t\thtmlContentToAppend += `\r\n\t\t\t<div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\"><strong>\r\n\t \t\t` + buyMsg.msg + ` </strong>\r\n\t \t \t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\r\n\t\t\t<span aria-hidden=\"true\">&times;</span>\r\n\t\t\t</button>\r\n\t\t\t</div>`\r\n\t\r\n\t\tdocument.getElementById(\"buy\").innerHTML = htmlContentToAppend;\r\n\t} \r\n\tif (!validStreet || !validStreetNumber || !validState || !validDept || !validTel || !validCcName || !validCcNum || !validCcExp || !validCcCvv || quantity <= 0) {\r\n\r\n\t\tlet htmlContentToAppend = \"\"; \r\n\t\thtmlContentToAppend += `\r\n\t\t<div class=\"alert alert-danger alert-dismissible fade show\" role=\"alert\"><strong>Por favor, completa todos los campos</strong>\r\n\t \t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\r\n\t\t<span aria-hidden=\"true\">&times;</span>\r\n\t \t</button>\r\n\t\t</div>`\r\n\t\r\n\t\tdocument.getElementById(\"buy\").innerHTML = htmlContentToAppend;\r\n\t//\tconsole.log(\"hola\")\r\n\t };\r\n\r\n\t });\r\n\r\n }", "title": "" }, { "docid": "b693ba278a032d42c36ee434c4b63ebe", "score": "0.60149163", "text": "function shoppingList(element){\n var listOfItems = [];\n /* var a;\n object for the item in stock\n var itemStock = {\n _name : \"\",\n _numberInStock : a,\n _priceOfItem: b,\n };\n var reStock;\n var iS = itemStock._numberInStock;*/\n//Add the ability to restock the item\n\n//Add the ability to check if the item being added is in stock\n/*if(iS > 0){\n isInStock = false;\n return `${element} is not in stock. Please wait for restock`\n}else{*/\n //isInStock = true;\n this.getList = function(){\n console.log(listOfItems);\n };\n this.addToCart = function(element, amountOfItems){\n // add checking function to it\n /*if(listOfItems.indexOf(element) !== -1){\n listOfItems.push(element); \n } else {\n return \"An instance of this item is already added to your cart!\";\n }*/\n\t\t\tlistOfItems.push(element, amountOfItems);\n };\n this.removeFromCart = function(element){\n index = listOfItems.indexOf(element);\n listOfItems.splice(index,1);\n return `The ${element} has been removed from your Cart.`;\n };\n this.itemsInCart = function(){\n return `Your cart has ${listOfItems.length} item(s).`;\n };\n\n this.isEmpty = function(){\n return (listOfItems.length === 0);\n };\n\t\t\n}", "title": "" }, { "docid": "1312d03c33a6925ebad3033607918f69", "score": "0.59910154", "text": "totlPrice() {\n var count = 0;\n var price = 0;\n var off = 0;\n this.total = 0;\n var stockCount = 0;\n\n\n //count how many items of each we have, and rest it from stock\n for (var y = 0; y < this.items.length; y++) {\n \n count = 0;\n for (var z = 0; z < this.products.length; z++) {\n if (this.items[y].name === this.products[z].name) {\n count++; \n }\n }\n this.items[y].num = count;\n this.items[y].stock -= count;\n }\n \n \n //start calculating the price...\n for (var q = 0; q < this.products.length; q++) {\n this.total = this.total + this.products[q].price;\n }\n \n //every 4 same items, one for free, and 10% discount if do buy more than 4 items\n for (var t = 0; t < this.items.length; t++) {\n off = off + this.items[t].price * (Math.trunc(this.items[t].num / 4));\n if (Math.trunc(this.items[t].num / 4) >= 1) {\n this.products_off.push(\"you have \" + Math.trunc(this.items[t].num / 4) + \" \" + this.items[t].name + \" for free\");\n }\n }\n this.total = this.total - off;\n if (this.products.length > 4) {\n this.total = this.total - (this.total / 10);\n return this.total + \" euros with 10% discount\" + this.products_off;\n } else {\n return this.total + \" euros\";\n }\n\n }", "title": "" }, { "docid": "494ab241446ac0f66a18c19c26d94331", "score": "0.5986903", "text": "setStorage(slug, price, name) {\r\n\r\n let quantity = parseInt(document.querySelector('#id_quantity').value);\r\n\r\n let selectedToppings = Cart.addToppings();\r\n\r\n // Find if order with the same slug and toppings exists\r\n // Returns the product as a object, if exists, returns undefined if not\r\n let containsOrder = Cart.containsItem(slug, selectedToppings);\r\n\r\n console.log(`Type of containsOrder is ${typeof containsOrder}`)\r\n\r\n // If containsOrder returns 0 or higher number, an exact product already exists in cart\r\n if (containsOrder >= 0) {\r\n // If order exists, just add to quantity\r\n console.log('Adding to existing order')\r\n // Find the existing product in cart by its index, sum to the existing quantity\r\n Cart.orders[containsOrder]['quantity'] += quantity;\r\n Cart.saveOrder();\r\n\r\n } else {\r\n // If order do not exist, containsOrder will return -1\r\n console.log('creating new order')\r\n\r\n let order = {\r\n 'name': name,\r\n 'price': price,\r\n 'quantity': quantity,\r\n 'slug':slug,\r\n 'toppings': Cart.addToppings(),\r\n }\r\n\r\n Cart.orders.push(order);\r\n localStorage.setItem('orders', JSON.stringify(Cart.orders));\r\n }\r\n }", "title": "" }, { "docid": "8c69dc392bb0f586de4ce15568221be1", "score": "0.5974459", "text": "function isAvailableProduct(product_id, amount, selector){\n $.post(ROOT+'admin/stocks/is_available', {'product_id':product_id, 'amount': amount}, function(res){\n if(!res.success) {\n selector.addClass('bg-danger');\n //is_aval.push(0)\n } else selector.removeClass('bg-danger');\n },'json');\n }", "title": "" }, { "docid": "d89c559573e6723e7fab5d79ea963d03", "score": "0.5974443", "text": "function checking (ID, quant){\n connection.query(\"SELECT stock_quantity, product_name, price,total_sales, department_name FROM products WHERE ?\",{item_id: ID} , function(err, res){\n if(err) throw err;\n\n let newStock = res[0].stock_quantity - quant;\n let newProfit = res[0].total_sales + total(res[0].price, quant);\n\n if(res[0].stock_quantity<quant){\n console.log(\"Insufficient quantity!\");\n connection.end();\n } else if(res[0].stock_quantity===parseInt(quant)){\n console.log(\"Lucky You. You just bought the last \" + res[0].product_name + \". Have Fun!\");\n updatePurchase(ID, res[0].department_name, 0, newProfit, total(res[0].price, quant));\n console.log(\"Your total is \" + total(res[0].price, quant));\n } else if(res[0].stock_quantity>quant){\n console.log(\"Nice purchase! \" + res[0].product_name + \" is super fun!\");\n updatePurchase(ID, res[0].department_name, newStock, newProfit, total(res[0].price, quant));\n console.log(\"Your total is \" + total(res[0].price, quant));\n }\n });\n}", "title": "" }, { "docid": "09ced6542b570c7915bcdba25745cac1", "score": "0.59675735", "text": "function checkPrice(){\r\n var valTotal = sizeCost + upCost + addCost + optCost;//variable that will be used to compare to price in 'get cost' element - the read only element\r\n if(document.getElementById('getCost').value.length == 0){//this validation is to check if the element is blank\r\n alert('Please calculate total before ordering');//error message to be returned if element is blank\r\n return false;\r\n }\r\n else if (document.getElementById('getCost').value != valTotal.toFixed(2)){//this is to ensue if a selection is changed after total has been calculated that the total is recalculated i.e. does the value shown match cost of current selection\r\n alert('Selection has been changed - please re-calculate total before ordering');//error message if value shown does not represent current selection\r\n //alert(document.getElementById('getCost').value) //used to validate function\r\n //alert(valTotal.toFixed(2)) //used to validate function\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "32e39624ed128e0d197a69eddf247fc8", "score": "0.5966675", "text": "function addToCart(id) {\n // Get The In Cart Products Data\n let inCartProductsData = \n // If The InCart Data Is Existed\n JSON.parse(localStorage.getItem(\"InCartProducts\")) \n // Get The Data\n ? JSON.parse(localStorage.getItem(\"InCartProducts\")) \n // Else Return []\n : [];\n\n // Get The Target Product ..\n let targetProduct = productsDB.find((item) => item.id === id);\n\n // Check If The Product Is In Cart\n let isInCart = inCartProductsData.find((item) => item.id === targetProduct.id);\n\n // If The [ isInCart ] Is True \n if(isInCart) {\n alert(\"Product Is In Cart Already\");\n }else{ // Else\n // Push Him Inside The In Cart Products Data\n inCartProductsData.push(targetProduct);\n };\n\n // Set The inCartProductsData length Into Product Badge Length\n badgeCartLength.innerHTML = inCartProductsData.length;\n\n // Update The In Cart Products After The Changes\n localStorage.setItem(\"InCartProducts\", JSON.stringify(inCartProductsData));\n\n // Call Function Draw In Cart Product\n drawIncartProducts();\n\n}", "title": "" }, { "docid": "ae54ef332cff48f231bc84cdac81ba7e", "score": "0.5963942", "text": "function checkOut(stock, object, units) {\n var query = \"UPDATE products SET ? WHERE ?\";\n connection.query(query, [{stock_quantity: stock},{item_id: object.item_id}], function(err) {\n if (err) throw err;\n console.log(chalk.green(`You have ordered ${units} unit(s) of ~${object.product_name}~.`));\n console.log(chalk.cyan(`Your order total is $${units * object.price}`));\n askCustomer();\n });\n}", "title": "" }, { "docid": "99e9b438c0d268d849df993b796cc437", "score": "0.59636986", "text": "function checkquantity (id, quantity) {\n\n\tconnection.query('SELECT * from products where?',\n\t[{\n\t\titem_id: id\n\t}],\n\tfunction(err, results) {\n if (err) throw err;\n else {\n \t\n \t//Check to confirm enough inventory to complete purchase\n \tif(results[0].in_stock >= parseInt(quantity)) {\n \t\t\n \t\t//Determine cost of purchase\n \t\tvar cost = parseInt(quantity) * results[0].price;\n\n \t\t//Add sales to DB\n \t\t\tupdatesales(results,cost);\n \t\tconsole.log('The cost of your purchase is $' + cost + ' dollars.')\n \t\tupdatedb(id, quantity,results[0].in_stock);\n \t}\n \telse {\n \t\tconsole.log('I\\'m sorry, we don\\'t have enough of that product to meet your request');\n \t\tconnection.end();\n \t}\t\n }\n })\n\n\n}", "title": "" }, { "docid": "a391b308a06741d9a7874fc37a562515", "score": "0.59605664", "text": "function checkoutProduct(price, quantity, product){\n \n // Calculates total price\n var total = price * quantity\n console.log(\"\\nThe total for your \" + quantity + \" \" + product + \" is $\" + total.toFixed(2) + \"\\n\");\n \n // Function asks user if they are done or want to shop more\n shopAgain();\n \n}", "title": "" }, { "docid": "9f7cc872d9e6e8e14addb4ffb8058902", "score": "0.5960049", "text": "function cart_total(sum_res, c_email_, c_id_, c_img_url, c_item_price, c_cato_, c_name) {\n var total_cart = sessionStorage.getItem(\"_total_prod_\");\n\n document.getElementById('c_tot_prod').innerHTML = total_cart;\n document.getElementById('c_tot_price').innerHTML = sum_res;\n\n document.getElementById('tot_bill_').style.display = 'block';\n document.getElementById('cart_data_').style.display = 'none';\n\n document.getElementById('buy_now').style.display = 'none';\n\n\n\n\n place_order_car(c_email_, c_id_, c_img_url, c_item_price, c_cato_, c_name);\n\n\n}", "title": "" }, { "docid": "eda256d4c87686855345d3956929e679", "score": "0.59593886", "text": "function addToCartWithMessage(productId, price, stock) {\n\tif (addToCart(productId, price, stock)) {\n\t\t$(function () {\n\t\t\t$(\"#cart_alert\").fadeIn(300).delay(1500).fadeOut(400);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "995d4f9ce1ab061e959a7a8d5079d73c", "score": "0.5954972", "text": "addProdToCart(prod) {\n for (let i = 0; i < this.cartItems.length; i++) {\n if (this.cartItems[i].item.id === prod.id) {\n this.cartItems[i].quantity++;\n return;\n }\n }\n this.cartItems.push({\n item: prod,\n quantity: 1\n });\n\n // decrease stock when product\n // is added to the cart\n //console.log(this.cartItems);\n prod.inStock--;\n }", "title": "" }, { "docid": "4c291a2f3356ac4b64cd3eeb97798874", "score": "0.59488106", "text": "function checkMultipleForm(inpform, numelements){\n\nvar anythingechecked = false;\n\nfor(var i=0; i<numelements; i++){\n\nif($('#checked_'+i).is(':checked')){\n\nanythingechecked = true;\n\n\tif($('#os0_'+i).val()==\"0\"){\n\t\t alert(\"you need to enter a quantity greater than 0 for \"+$('#item_number_'+i).val());\n return false;\n\t}\n\t\telse if($('#os0_'+i).val()==\"\"){\n\t\t alert(\"you need to enter a quantity for \"+$('#item_number_'+i).val());\n return false;\n\t}\n\t\telse if(!/^\\d+$/.test($('#os0_'+i).val())){\n\t alert(\"The quantity you entered is invalid.\");\n return false;\n\t}\n//else if ($('#item_number_'+i).val()==\"\") \n// {\n// alert(\"you need to enter a Design Code\");\n// return false;\n// }\n//else if ($('#item_number_'+i).val().length!=7 && $('#item_number_'+i).val().length!=9)\n//{\n//alert(\"you need to enter a correct 7 digit Design Code\");\n//return false;\n//}\nelse if(!$('#item_name_'+i)){\n\talert(\"you must select a button size and a product type for \"+$('#item_number_'+i).val());\nreturn false;\n\t}\nelse if($('#item_name_'+i).val() == \"\" || $('#item_name_'+i).val() == \"none\"){\nalert(\"you must select a button size and a product type for \"+$('#item_number_'+i).val());\nreturn false;\n}\n\n}//end if checked\n\n}//end for i\n\nif(anythingechecked == false){\nalert(\"You did not check any items. Please check the checkboxes next items you want to add to your cart.\");\nreturn false;\n}\n\nreturn true;\n\n}", "title": "" }, { "docid": "66d3548ad0352775157d8f48b3d47353", "score": "0.5948472", "text": "function orderPizza(){\n var name=$(\"input#name\").val();\n var flavor=$(\"#flavor\").val();\n var size=$(\"#pizzasize\").val();\n var amount=$(\"#amount\").val();\n var crust=$(\"#crust\").val();\n var toppings=[];\n \n $.each($('input[name=\"toppings\"]:checked'),\n function(){\n toppings.push($(this).val());\n })\n \n var sizePrice;\n if(flavor===\"Cheese\"||flavor===\"Veggie\"||flavor===\"Pepperoni\"||flavor===\"Meat\"||flavor===\"Margherita\"||flavor===\"BBQ Chicken\"||flavor===\"Hawaiian\"||flavor===\"Buffalo\"){\n if(size===\"Small\"){\n sizePrice=500;\n }\n else if (size===\"Regular\"){\n sizePrice=800;\n }\n else if (size===\"Large\"){\n sizePrice=1500;\n }\n else if (size===\"Mega\"){\n sizePrice=2000;\n }\n }\n\n var crustPrice;\n if (crust===\"Crispy\"){\n crustPrice=50;\n }\n else if (crust===\"Cheese-Stuffed\"){\n crustPrice=100;\n }\n else if (crust===\"Glutten-free\"){\n crustPrice=150;\n }\n else if (crust===\"Flatbread\"){\n crustPrice=200;\n }\n\n var toppingCheckbox=$('input[name=\"toppings\"]:checked').length;\n var toppingPrice;\n if (size===\"Small\"){\n toppingPrice=toppingCheckbox*50;\n }\n else if (size===\"Regular\"){\n toppingPrice=toppingCheckbox*100;\n }\n else if (size===\"Large\"){\n toppingPrice=toppingCheckbox*200;\n }\n else if (size===\"Mega\"){\n toppingPrice=toppingCheckbox*300;\n }\n //unchecked boxes function\n $(\"input[type='checkbox']:not(:checked)\").prop({\n disabled:true\n });\n //function to deactivate button to avoid multiple orders\n $('placeholder').prop('disabled',true);\n //Total price function\n $(\"#orderfeedback\").show();\n\n var price=(sizePrice+crustPrice);\n var totalAmount=parseInt(price*amount);\n\n $(\".feedback\").text(\"Hello \"+name+\". Here are your order details:\");\n $(\".pizzasize\").append('<tr><td id=\"pizzasize\">' + size);\n $(\".amount\").append('<tr><td id=\"amount\">' + amount);\n $(\".crust\").append('<tr><td id=\"crust\">' + crust);\n $(\".flavor\").append('<tr><td id=\"flavor\">' + flavor);\n $(\".price1\").append('<tr><td id=\"price1\">' + totalAmount);\n\n arrayAllOrders.push(totalAmount);\n if (toppings==\"\"){\n $(\".toppings\").append('<tr><td id=\"toppings\">' + \"-\");\n }\n if (toppings != \"\") {\n $(\".toppings\").append('<tr><td id=\"toppings\">' + toppings);\n $(\".name\").text(name);\n }\n var delivery=200;\n var pickUp=0;\n var totalOnDelivery= totalAmount+delivery;\n\n if(document.getElementById(\"d\").checked == true && document.getElementById(\"p\").checked == false){\n prompt(\"Where are you located?\");\n alert(\"Your order will be delivered to your location in 30 minutes. Total amount payable on delivery is Ksh.\" + totalOnDelivery);\n } else if (document.getElementById(\"d\").checked == false && document.getElementById(\"p\").checked == true){\n alert(\"Total amount payable on pick up is \" + totalAmount);\n }\n \n}", "title": "" }, { "docid": "60c4feb909cba5681de7331b2c8a6b37", "score": "0.5947679", "text": "function inventoryCheck(itemID, itemQuantity) {\n connection.query('SELECT * FROM products WHERE item_id = ?', [itemID], function (error, results, fields) {\n if (error) throw error;\n if (results[0].stock_quantity === 0) {\n console.log(\"\\n***Sorry! We are currently out of stock\\n\".magenta);\n buyDifferent();\n } else if (itemQuantity > results[0].stock_quantity) {\n console.log(colors.magenta('\\n***Sorry! We only have ' + results[0].stock_quantity + ' ' + results[0].product_name + ' in stock.\\n'));\n buyDifferent();\n } else {\n console.log(colors.blue('\\n***You have added ' + colors.underline(itemQuantity + ' ' + results[0].product_name) + ' to your cart.\\n'));\n var totalCost = itemQuantity * results[0].price; //set variable to use later\n buyProduct(itemID, itemQuantity, totalCost); //pass arguments to next function\n }\n })\n}", "title": "" }, { "docid": "cebc9fa39466bbc23813e5724e4356c3", "score": "0.5946993", "text": "function validate_total_stock(){\n\t\t\t\tvar total_stock = document.getElementById('total_stock');\n\t\t\t\tvar error = \"\";\n\t\t\t\tvar total_available = document.getElementById('total_available');\n\n\t\t\t\tif(parseInt(total_stock.value) < parseInt(total_available.value)){\n\t\t\t\t\terror = \"Total stock can't be less than the total available.\";\n\t\t\t\t\talert(error);\n\t\t\t\t\ttotal_stock.value = parseInt(total_stock.value) + 1;\n\t\t\t\t}else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "293b285146476f04b7658c165dd9037c", "score": "0.59397894", "text": "async function purchaseCart() {\n\n let totalId = [];\n\n\n for(let i = 0; i < realPanier.length; i++) {\n for(let y = 0; y < realPanier[i].quantity; y++) {\n totalId.push(realPanier[i]._id);\n }\n }\n\n // construction de l'objet pour envoie a l'API\n\n let productsBody = {\n contact: {\n firstName: document.getElementById(\"prenom\").value,\n lastName: document.getElementById(\"name\").value,\n address: document.getElementById(\"adresse\").value,\n city: document.getElementById(\"ville\").value,\n email: document.getElementById(\"email\").value,\n },\n products: totalId,\n }\n \n const formCheck = await formcheck();\n\n\n // Envoie a l'API\n\n if(formCheck == true) {\n fetch(\"http://localhost:3000/api/cameras/order\", {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(productsBody)\n })\n .then(response => response.json())\n .then(data => { // ajout l'ordir id dans le storage\n let OrderId = data.orderId;\n localStorage.setItem('orderId', JSON.stringify(OrderId));\n window.location.replace(\"./Confirmation.html\");\n })\n }\n else {\n window.alert(\"Il y a des erreurs dans votre formulaire\");\n }\n}", "title": "" }, { "docid": "0d37bdb1bf89471e3361080c976be453", "score": "0.59384066", "text": "function check(id, number){\n // Selects stock_quantity from products table\n connection.query(\"SELECT STOCK_QUANTITY FROM PRODUCTS WHERE ITEM_ID=?\",[id],function(err,result){\n if(err) throw err;\n for(var i=0; i<result.length; i++){\n \n // If stock is minium, then alerts user insufficient quantity\n if(number > result[i].STOCK_QUANTITY){\n console.log(chalk.red(\"\\nSORRY. INSUFFICIENT QUANTITY. ORDER CAN'T BE PLACED NOW\"));\n console.log(chalk.yellow(\"\\nTRY PURCHASING OTHER STUFFS WHILE WE RELOAD!\\n\"));\n // For insufficient quantity, prompts user if they wish to continue\n ifContinue();\n }\n else if(number <= result[i].STOCK_QUANTITY){\n var newStock = result[i].STOCK_QUANTITY - number;\n // Update new stock value\n updateTable(id, newStock, number);\n }\n }\n \n })\n}", "title": "" }, { "docid": "d03c92551a0d06c7fef5856734bddedf", "score": "0.5935389", "text": "function product_sell()\n{ \n \n var total_tax = 0.00;\n var total_dis = 0.00;\n var total_price = 0.00;\n var total_qty = 0;\n var total_amt = 0.00;\n \n \n\n var s_list = glob_prod.filter(function (el) {\n return el != null;\n });\n \n var count = s_list.length;\n var total_sum ='';\n\n for(var key in s_list) {\n var id = s_list[key]['product_id'];\n \n \n var qt = $('#quantity_'+id).val();\n var stock = $('#stock_'+id).val();\n var name = $('#name_'+id).val();\n var part_num = $('#part_num_'+id).val();\n\n\n\n var price = $('#price_'+id).val();\n var discount = $('#discount_'+id).val();\n var tax1 = $('#tax_'+id).val();\n var tax_val = 0;\n var dis_val = 0;\n var price_val = 0;\n\n var con =\"\";\n \n if(price == '' || price == 0 || price == '.' || price == '0.')\n { \n \n price = 0.00;\n }\n \n if(tax1 == '' || tax1 == '.0' || tax1 == '.00' || tax1 == '.')\n {\n tax1 =0.00;\n \n }\n \n if(qt == '' || (parseInt(qt) > parseInt(stock)) || (parseInt(qt) == 0))\n { \n qt = 0;\n \n }\n \n if(discount == '.' || discount == '' || discount =='.0' || discount == '.00')\n {\n discount=0.00;\n }\n \n \n qt = parseInt(qt);\n stock = parseInt(stock);\n price = parseFloat(price);\n discount = parseFloat(discount);\n tax1 = parseFloat(tax1);\n \n\n \n\n var dis = parseFloat(price * discount)/100;\n var new_price = parseFloat(price - dis);\n var tax = parseFloat(new_price * tax1)/100;\n var sell_price = parseFloat(new_price) + parseFloat(tax);\n var amount = parseFloat(sell_price * qt);\n\n \n \n if(qt =='' || qt ==0 || qt== null)\n {\n tax_val = tax;\n dis_val = dis;\n price_val= price;\n }\n else\n {\n tax_val = parseFloat(tax * qt);\n dis_val = parseFloat(dis * qt);\n price_val = parseFloat(price * qt);\n }\n \n \n total_tax = parseFloat(total_tax) + parseFloat(tax_val);\n total_tax = total_tax.toFixed(2);\n total_dis = parseFloat(total_dis) + parseFloat(dis_val);\n total_dis = total_dis.toFixed(2);\n total_price = parseFloat(total_price) + parseFloat(price_val);\n total_price = total_price.toFixed(2);\n total_qty = parseInt(total_qty) + parseInt(qt);\n total_amt = parseFloat(total_amt) + parseFloat(amount);\n //total_amt = total_amt.toFixed(2);\n \n total_sum = total_amt.toFixed(2);\n\n sell_price = sell_price.toFixed(2);\n amount = amount.toFixed(2);\n \n\n var list_content='<td class=\"py-1\">'+count+'</td><td class=\"py-1\">'+total_price+'</td><td class=\"py-1\">'+total_dis+'</td><td class=\"py-1\">'+total_tax+'</td><td class=\"py-1\">'+ total_qty +'</td><td class=\"py-1\">'+total_sum+'</td>';\n\n \n $('#client').prop('disabled', 'disabled');\n $('#amt_'+id).html(amount);\n \n $('#r_list').html(list_content);\n $('#result_list').show();\n \n }\n \n}", "title": "" }, { "docid": "eb618bfe4358f2240bf655032b1454a1", "score": "0.593458", "text": "async checkout(event) {\n event.preventDefault();\n this.setState({ isLoading: true });\n if (!this.props.auth.isLoggedIn) {\n this.setState({ errors: { auth: \"You need to be logged in!\" } });\n this.setState({ isLoading: false });\n } else {\n //Check if the user is trying to buy their own products.\n let isProductsSelling = false;\n\n this.props.cart.items.forEach(orderItem => {\n const seller = orderItem.item.seller;\n if (seller.handle === this.props.auth.user.handle) {\n isProductsSelling = true;\n return;\n }\n });\n if (!isProductsSelling) {\n await this.props.createOrder(this.props.cart, this.props.history);\n } else {\n this.setState({ errors: { auth: \"You can't buy your own products!\" } });\n this.setState({ isLoading: false });\n }\n }\n }", "title": "" }, { "docid": "1b2c1ed4ed1be919790e66be427f8450", "score": "0.5932945", "text": "function addToCart(productId, price, stock) {\n\tvar oldval = readCookie(productId);\n\tif (oldval === null) {\n\t\toldval = 0;\n\t}\n\tvar instock = parseInt(stock);\n\tvar newval = parseInt(oldval) + 1;\n\tif (newval > instock) {\n\t\talert(\"Unable to add item: only \" + instock + \" left in stock\");\n\t\treturn false;\n }\n\tcreateCookie(productId, newval);\n\tupdateTotal(parsePrice(price));\n\treturn true;\n}", "title": "" }, { "docid": "6bd723848c54f4a4ed6fd1dd95f6062d", "score": "0.59323466", "text": "function chkBeforeSave() {\r\n\r\n\tvar addAccumAmt = form.querySelector( 'input[name=addAccumAmt]' ).value;\r\n\t\r\n\tif( isNaN( addAccumAmt ) ) {\r\n\t\t// 숫자만 입력해 주세요\r\n\t\tshowComModal( {type:\"warning\",msg:mLang.get(\"inputonlynumber\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=addAccumAmt]' ).focus() }} ); \r\n\t\treturn false;\r\n\t} else if( addAccumAmt > oldAccumAmt ) {\r\n\t\t// 양도할 적립금을 확인해 주세요\r\n\t\tshowComModal( {type:\"warning\",msg:mLang.get(\"checksendquantities\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=addAccumAmt]' ).focus() }} );\r\n\t\treturn false;\t\t\r\n\t} else if( !chkNull( form.querySelector( 'input[name=\"oldUsrId\"]' ).value ) ) {\r\n\t\t// 통합하실 전화번호를 입력해 주세요<br/>또는 이전하실 적립금이 없습니다\r\n\t\tshowComModal( {msg:mLang.get(\"inputintegratenumberornoquantitiestomove_br\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=\"oldUsrId\"]' ).focus() }} );\r\n\t\treturn false;\r\n\t} else if( !chkNull( form.querySelector( 'input[name=\"newUsrId\"]' ).value ) ) {\r\n\t\t// 통합하실 전화번호를 입력해 주세요\r\n\t\tshowComModal( {msg:mLang.get(\"inputintegratenumber\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=\"newUsrId\"]' ).focus() }} );\r\n\t\treturn false;\r\n\t} else if( form.querySelector( 'input[name=\"oldUsrId\"]' ).value == form.querySelector( 'input[name=\"newUsrId\"]' ).value ) {\r\n\t\t// 양도/양수자가 동일한 전화번호 입니다\r\n\t\tshowComModal( {msg:mLang.get(\"serv_sendrecvsamenumber\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=\"newUsrId\"]' ).focus() }} );\r\n\t\treturn false;\r\n\t} else if( form.querySelector( 'input[name=\"passwd\"]' ).value.length < 6 ) {\r\n\t\t// 비밀번호는 6자리 이상을 입력해 주세요\r\n\t\tshowComModal( {type:\"warning\",msg:mLang.get(\"chkpasswdlength\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=\"passwd\"]' ).focus() }} );\r\n\t\treturn false;\r\n\t}\r\n \t\r\n \treturn true;\r\n}", "title": "" }, { "docid": "4870bfe4324255126702359a51a9d0d2", "score": "0.59296095", "text": "function requestProduct(product){\n // start inquirer module (required globally)\n inquirer\n // structure of inquire: object\n .prompt([\n {\n // ask user to select product by item_id\n name: \"id\",\n type: \"input\",\n message: \"Please choose a product using the ID #: \" \n },\n {\n // asking user to select unit quantity of desired product\n name: \"quantity\",\n type: \"input\",\n // User choice: can exit BAMazon, or select unit quantity\n message: \"Please select the unit quantity you'd like. [You can also leave BAMazon by pressing 'Q']\",\n // validation logic for message above\n validate: function (value) {\n return value > 0 || value.toLowerCase() === \"q\";\n }\n }\n\n // response object to grab data\n ])\n .then(function (value) {\n\n // run fetchproduct();\n\n // if no enough quantity or out of stock: run loadProduct();\n // else: \"We've received your order, thank you!\";\n\n\n\n // if user clicked \"q\", then execute function to leave app\n if (value === \"q\"){\n checkIfShouldExit(value);\n }\n else {\n connection.query(\n \"SELECT ? FROM products\", function(err, res){}\n // display user answers from prompt\n // check to see if product is in stock\n // user unit quantity input\n var quantity = parseInt(value.quantity);\n var product = parseInt(value.id)\n var stock_quantity = parseInt(value.stock_quantity);\n var changeQuant = parseInt(stock_quantity - quantity);\n var cost = (quantity * product).toFixed(2);\n // out of stock, execute\n console.log(value.stock_quantity);\n if (quantity > value.stock_quantity) {\n console.log(\"Insufficient Quantities, please select another quantity of units.\");\n loadProducts();\n }\n }\n // otherwise, connect to database to reveal product & unit quantity\n // use & connect to create sql database\n \n \n {\n id: value.id,\n stock_quantity: value.stock_quantity,\n },\n function(err){\n if (err) return err;\n else {\n console.log(\"We've received your order!\")\n console.table(value);\n }\n\n // ====================================\n // add here the purchaseValue() function that tells the user the price\n // ====================================\n\n\n makePurchase(product, quantity);\n connection.end()\n }\n );\n });\n }", "title": "" }, { "docid": "e6a2e48a406f9753e2a209a8efff9f68", "score": "0.59294343", "text": "async function checkCartStock(pincode, cart) {\n var nosql = new Agent();\n var stock = 0;\n nosql.select('getpincode', 'pincodes').make(function (builder) {\n builder.where('pincode', pincode);\n builder.first();\n })\n\n var getpincode = await nosql.promise('getpincode');\n if (getpincode != null) {\n if (getpincode.wid != \"notAllocated\") {\n var wid = getpincode.wid;\n for (let k = 0; k < cart.products.length; k++) {\n const product = cart.products[k];\n var pid = product.id;\n //console.log(\"pid =========================\", pid);\n\n const variant = product.variant;\n var vid = variant.id;\n //console.log(\"vid ////////////////////////\", vid);\n var mongoClient = new Agent();\n mongoClient.select('getwstock', 'warehouse_stock').make(function (builder) {\n builder.where('variant_id', vid);\n builder.and();\n builder.where('warehouse_id', wid);\n builder.and();\n builder.where('product_id', pid);\n });\n var getwstock = await mongoClient.promise('getwstock');\n // console.log(\"getwstock\",getwstock);\n if (getwstock.length > 0) {\n if (getwstock[0].variant_id == vid) {\n //console.log(\"hellooo\",vid);\n stock = getwstock[0].stock;\n //console.log(\"stock\",stock);\n variant.stock = getwstock[0].stock;\n } else {\n console.log(\"VARIANT ID DOES NOT MATCH\");\n }\n } else {\n variant.stock = stock;\n }\n\n }\n return cart;\n } else {\n return { // if pincode is not attached to the warehouse\n status: false,\n message: \"Pincode is not available for delivery\"\n }\n }\n } else { // if pincode is invalid\n return {\n status: false,\n message: \"Pincode is not available for delivery\"\n }\n }\n}", "title": "" }, { "docid": "963031ffbbfba0fb28834f87e2c0f4ec", "score": "0.5926618", "text": "function calcCart() {\r\n // The line below states that the value of confName within the sessionStorage variable will be assigned the value of\r\n sessionStorage.confName = document.forms.regForm.elements.fnBox.value + \" \" + document.forms.regForm.elements.lnBox.value;\r\n // The following lines state that the value of the specified information stored in sessionStorage will be assigned the value of the specified elements with the provided ids in the HTML document.\r\n sessionStorage.confGroup = document.forms.regForm.elements.groupBox.value;\r\n sessionStorage.confMail = document.forms.regForm.elements.mailBox.value;\r\n sessionStorage.confPhone = document.forms.regForm.elements.phoneBox.value;\r\n sessionStorage.confBanquet = document.forms.regForm.elements.banquetBox.value;\r\n // The line below states that the value of confBanquetCost within the sessionStorage variable will be assigned the value of the confBanquet value mutiplied by 55.\r\n sessionStorage.confBanquetCost = sessionStorage.confBanquet * 55;\r\n // the line below creates a variable with the name of selectedIndex which is then assigned the value of the selectedIndex of the element with the id of sessionBox.\r\n var selectedIndex = document.getElementById(\"sessionBox\").selectedIndex;\r\n // The line below creates an if statements that will run if the value of selectedInde is not -1.\r\n if (selectedIndex != -1) {\r\n // The line below states that the value of confSession within the sessionStorage variable will be assigned the value of the text of the element with the id of sessionBoxand the selectedIndex.\r\n sessionStorage.confSession = document.forms.regForm.elements.sessionBox[selectedIndex].text;\r\n // The line below states that the value of confSessionCost within the sessionStorage variable will be assigned the value of the value of the element with the id of sessionBox and the selectedIndex.\r\n sessionStorage.confSessionCost = document.forms.regForm.elements.sessionBox[selectedIndex].value;\r\n // Otherwise the value of confSession will be an empty string and the value of confSessionCost will be 0.\r\n } else {\r\n sessionStorage.confSession = \"\";\r\n sessionStorage.confSessionCost = 0;\r\n }\r\n // The line below creates an if statement that will run if the element with an id of mediaCB is checked in the form. \r\n if (document.forms.regForm.elements.mediaCB.checked) {\r\n // The line below sets the value of confPack in the sessionStorage variable to yes.\r\n sessionStorage.confPack = \"yes\";\r\n //The line below sets the value of confPackCost in the sessionStorage variable to 115.\r\n sessionStorage.confPackCost = 115;\r\n // Otherwise, the value of confPack is set to no and the value of confPackSession is set to 0.\r\n } else {\r\n sessionStorage.confPack = \"no\"\r\n sessionStorage.confPackCost = 0;\r\n }\r\n // The line below states that the value of confTotal in the sessionSotrage variable will be set to the sum of confBanquetCost, confSessionCost, and confPackCost. The parseFloat method converts the sting stored in each of these to a number. \r\n sessionStorage.confTotal = parseFloat(sessionStorage.confBanquetCost) + parseFloat(sessionStorage.confSessionCost) + parseFloat(sessionStorage.confPackCost);\r\n // The line below calls the writeSessionValues function to run.\r\n writeSessionValues();\r\n}", "title": "" }, { "docid": "fd8aa87e414aacba5df93ee311e83bdf", "score": "0.5925901", "text": "function quickUpdateCart() {\n\t\tvar quantity = 0;\n\t\tvar price = 0;\n\t\t\n\t\tcartList.children('li:not(.deleted)').each(function(){\n\t\t\tvar singleQuantity = Number($(this).find('select').val());\n\t\t\tquantity = quantity + singleQuantity;\n\t\t\tprice = price + singleQuantity*Number($(this).find('.price').text().replace('$', ''));\n\t\t});\n\n\t\tcartTotal.text(price.toFixed(2));\n\t\tcartCount.find('li').eq(0).text(quantity);\n\t\tcartCount.find('li').eq(1).text(quantity+1);\n }", "title": "" } ]
edb1652c9742889baa1ad8cb865dd062
Any advisory lock whose `updatedAt` time is older than the Date object returned by this method should be considered expired
[ { "docid": "3cba6b2a02b493747f44c20ae5af1af6", "score": "0.70932025", "text": "getAdvisoryLockExpiration() {\n return new Date(Date.now() - 1000 * self.options.advisoryLockTimeout);\n }", "title": "" } ]
[ { "docid": "e10b78f4512ec8502580888906e3320f", "score": "0.5927057", "text": "function expired() {\n return (this.token && this.token.expires_at && new Date(this.token.expires_at) < new Date());\n }", "title": "" }, { "docid": "8b38b2481f425cd8420de8a0bc9bd96e", "score": "0.5847316", "text": "isItemExpired(item) {\n return item.expired_at !== null && item.expired_at < this.time();\n }", "title": "" }, { "docid": "a4dd61ea53c00bb8b7dd5be4d6508550", "score": "0.5730031", "text": "isExpired() {\n return this.expirationTime < msalCommon.TimeUtils.nowSeconds();\n }", "title": "" }, { "docid": "df9b4e0c6791b18ca92cb1a42a129b7b", "score": "0.5723856", "text": "isExpired(accessToken) {\n const now = new Date().getTime();\n return accessToken.expiry_date\n ? now >= accessToken.expiry_date - this.eagerRefreshThresholdMillis\n : false;\n }", "title": "" }, { "docid": "108d47d42f87c62fcc1ebf087b11c53b", "score": "0.5712747", "text": "invalid () {\n const now = new Date().getTime()\n if (this.createdDate === 0) {\n return true\n }\n if (this.timeout > 0) {\n return now > (this.createdDate + this.timeout * 1000)\n }\n return false\n }", "title": "" }, { "docid": "5af1be0925efb497f0d933e1fa678b0b", "score": "0.5672033", "text": "unlockMessage() {\n // if message is over a day old (10 seconds for testing), unlock it and allow deletion\n if(Date.now() - this.posted > 10000) {\n this.isLocked = false;\n }\n }", "title": "" }, { "docid": "3280ff6766c29d95bd353a6dad9ec9ca", "score": "0.56445193", "text": "deleteAfterInactivity() {\n let m = this.settings.deleteAfterInactivityMinutes;\n if (!m) { return; }\n this.db.run(`\n DELETE FROM ${this.settings.tableName}\n WHERE (strftime('%s','now') - strftime('%s', lastupdate)) / 60 > $m\n `, { m });\n }", "title": "" }, { "docid": "ac0cb09ceee9e1ae115d0948bf6d6fc9", "score": "0.562079", "text": "isExpired() {\n return this.lifetime <= 0\n }", "title": "" }, { "docid": "c50547d70c4e0858828f87782d4034bb", "score": "0.5598411", "text": "function expired() {\n return (Date.compare(this.token.expires_at, new Date) == -1) ? true : false\n }", "title": "" }, { "docid": "fff7d78aa5b225ee7fb99cf81fcd4514", "score": "0.55056965", "text": "hasExpired() {\n const now = new Date().getTime();\n if (this.rawToken && this.expiresAt) {\n return now >= this.expiresAt;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "fff7d78aa5b225ee7fb99cf81fcd4514", "score": "0.55056965", "text": "hasExpired() {\n const now = new Date().getTime();\n if (this.rawToken && this.expiresAt) {\n return now >= this.expiresAt;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "324a6e629f51ac6b83733620be2c72f7", "score": "0.538534", "text": "isValid() {\n return this.expiration - Date.now() > EXPIRATION_BUFFER_MS;\n }", "title": "" }, { "docid": "1cde95f779c22e6f3af74305c8f5a737", "score": "0.53719205", "text": "function autoRejectDraftAppointments() {\n consultNowDraft.findAll().then(function (appointdata) {\n appointdata.forEach((element) => {\n if (element.status === 0) {\n let appointmentTime = element.appointment_time;\n const currentTime = moment().format(\"HH:mm\");\n const currentTime2Minutes = moment().add(4, \"minutes\").format(\"HH:mm\");\n const appointmentTime2Minutes = moment(appointmentTime, \"HH:mm\")\n .add(2, \"minutes\")\n .format(\"HH:mm\");\n // console.log(currentTime+\" >>> \"+currentTime2Minutes+\" << \");\n // console.log(appointmentTime+\" >>> \"+appointmentTime2Minutes+\" << \");\n if (appointmentTime2Minutes < currentTime) {\n var updateval = { status: 1 };\n let whereobject = { where: { status: 0 } };\n consultNowDraft.update(updateval, whereobject).then((result) => {\n // console.log(element.id+\" Updated to 1\");\n });\n }\n }\n });\n });\n}", "title": "" }, { "docid": "738e7c4e78cea20039cdb6353caba9d1", "score": "0.53344274", "text": "isTokenExpiring() {\n const expiryDate = this.credentials.expiry_date;\n return expiryDate\n ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis\n : false;\n }", "title": "" }, { "docid": "738e7c4e78cea20039cdb6353caba9d1", "score": "0.53344274", "text": "isTokenExpiring() {\n const expiryDate = this.credentials.expiry_date;\n return expiryDate\n ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis\n : false;\n }", "title": "" }, { "docid": "220716f67d53e3451ebac425682251a3", "score": "0.5283113", "text": "function isExpired() {\r\n ballotContract.IsProposalExpired((error, result) => {\r\n logCatcher('is proposal expired has just been called');\r\n setTimeout(() => {\r\n // recursively check every 9 seconds. in the future make this a day.\r\n isExpired();\r\n }, 9000);\r\n });\r\n }", "title": "" }, { "docid": "7b86b3a423c770f501c1f5826f095664", "score": "0.52774274", "text": "votingExpired(current, cutoff) {\n cutoff = new Date(cutoff)\n return (current.valueOf() > cutoff.valueOf())\n }", "title": "" }, { "docid": "5d17d4690c22ce9979fd260feeaa3e67", "score": "0.5248759", "text": "if (_cacheRepoAssure.lastAssured + 5 * 1000 * 60 >= Date.now()) {\n return _cacheRepoAssure.pendingAssure;\n }", "title": "" }, { "docid": "bd0650c3052352932d89bfd193a79278", "score": "0.5200442", "text": "#removeExpiredTimestamps(key) {\n const timestampsArray = this.#apiCallTimeStamps[key]\n const now = Date.now()\n const oneMinuteAgo = now - 1000\n let index = 0\n while (index < timestampsArray.length && timestampsArray[index] <= oneMinuteAgo) {\n index += 1\n }\n\n timestampsArray.splice(0, index)\n }", "title": "" }, { "docid": "b61f447c57c8538f934f5eed5d749a61", "score": "0.51991475", "text": "function removeExpiredTokenFromBlackList() {\n var currentDate = new Date();\n\n TokenBlacklist.remove({ 'createdAt': { \"$gte\": new Date(2015, 1, 1), \"$lt\": currentDate } }, function (err, data) {\n if (err) {\n throw err\n } else {\n console.log('Removing expired tokens from database...');\n }\n });\n}", "title": "" }, { "docid": "c6bfcfe885209df8b71bdd720a2cda0a", "score": "0.5149037", "text": "function executeUpdateLocked() {\n executionLock = true;\n var nextUpdate = ArrayUtils.removeObjectByIndex(queuedLocalUpdates, 0);\n var updateCreatedByPlugin = nextUpdate.pluginId;\n try {\n var redraw = executeUpdate(nextUpdate);\n if (!skippingMarkerMode) {\n var updateIndex = currentUpdateIndex;\n var offset = lastUpdateType === -1 ? 0 : 1;\n var pluginUpdate = updateList[updateIndex - offset];\n var updateType = lastUpdateType;\n for (var i = 0; i < plugins.length; i++) {\n if (!ClassUtils.isUndefined(plugins[i].addUpdate)) {\n plugins[i].addUpdate(pluginUpdate, redraw, updateIndex, updateType, updateCreatedByPlugin);\n }\n }\n updateType = undefined;\n pluginUpdate = undefined;\n updateIndex = undefined;\n }\n } catch (exception) {\n executionLock = false;\n if (!ClassUtils.isUndefined(onError)) {\n onError(exception);\n } else {\n console.error(exception);\n }\n }\n executionLock = false;\n }", "title": "" }, { "docid": "b40d93e97cd8d6fb4a0428d82a259baf", "score": "0.51439", "text": "isExpired(message) {\n if (!message.expiryDate) {\n return false;\n }\n try {\n const expiryDate = new Date(message.expiryDate);\n return isNaN(expiryDate.getTime()) || expiryDate < new Date();\n }\n catch (error) {\n return true;\n }\n }", "title": "" }, { "docid": "b40d93e97cd8d6fb4a0428d82a259baf", "score": "0.51439", "text": "isExpired(message) {\n if (!message.expiryDate) {\n return false;\n }\n try {\n const expiryDate = new Date(message.expiryDate);\n return isNaN(expiryDate.getTime()) || expiryDate < new Date();\n }\n catch (error) {\n return true;\n }\n }", "title": "" }, { "docid": "8c38564d8e144ae25854dbc8219fde42", "score": "0.51309973", "text": "isJobExpired(job, state) {\n const now = new Date()\n const created = new Date(parseInt(job.updated_at))\n const age = parseInt(now - created)\n let maxTime\n switch(state) {\n case 'failed':\n maxTime = this.maxFailedTime\n break\n case 'active':\n maxTime = this.maxActiveTime\n break\n case 'complete':\n maxTime = this.maxCompleteTime\n break\n }\n return age > maxTime\n }", "title": "" }, { "docid": "ed3fdc15cc4022399821cc5d2082af54", "score": "0.5125999", "text": "get isExpired() {\n const msg = this.get(\"x-textile-api-sig-msg\");\n const notAuthed = msg === undefined && this.authCallback !== undefined;\n const isExpired = msg !== undefined && new Date(msg) <= new Date();\n return isExpired || notAuthed;\n }", "title": "" }, { "docid": "ed3fdc15cc4022399821cc5d2082af54", "score": "0.5125999", "text": "get isExpired() {\n const msg = this.get(\"x-textile-api-sig-msg\");\n const notAuthed = msg === undefined && this.authCallback !== undefined;\n const isExpired = msg !== undefined && new Date(msg) <= new Date();\n return isExpired || notAuthed;\n }", "title": "" }, { "docid": "8bc29303436782ea3b09c979ff8b0495", "score": "0.51142967", "text": "async lock(req, doc, tabId, options) {\n if (!options) {\n options = {};\n }\n if (!(req && req.res)) {\n // Use 'error' because this is always a code bug, not a bad\n // HTTP request, and the message should not be disclosed to the client\n throw self.apos.error('error', 'You forgot to pass req as the first argument');\n }\n if (!doc && doc._id) {\n throw self.apos.error('invalid', 'No doc was passed');\n }\n const _id = doc._id;\n if (!tabId) {\n throw self.apos.error('invalid', 'no tabId was passed');\n }\n let criteria = { _id };\n if (!options.force) {\n criteria.$or = [\n {\n advisoryLock: {\n $exists: 0\n }\n },\n {\n 'advisoryLock.updatedAt': {\n $lt: self.getAdvisoryLockExpiration()\n }\n },\n {\n 'advisoryLock._id': tabId\n }\n ];\n }\n // Prevent nuisance locking by matching only\n // documents the user can edit\n criteria = {\n $and: [\n criteria,\n self.apos.permission.criteria(req, 'edit')\n ]\n };\n doc.advisoryLock = {\n username: req.user && req.user.username,\n title: req.user && req.user.title,\n _id: tabId,\n updatedAt: new Date()\n };\n const result = await self.db.updateOne(criteria, {\n $set: {\n advisoryLock: doc.advisoryLock\n }\n });\n if (!result.result.nModified) {\n const info = await self.db.findOne({\n _id\n }, {\n projection: {\n advisoryLock: 1\n }\n });\n if (!info) {\n throw self.apos.error('notfound');\n }\n if (!info.advisoryLock) {\n // Nobody else has a lock but you couldn't get one —\n // must be permissions\n throw self.apos.error('forbidden');\n }\n if (!info.advisoryLock) {\n // Nobody else has a lock but you couldn't get one —\n // must be permissions\n throw self.apos.error('forbidden');\n }\n if (info.advisoryLock.username === req.user.username) {\n throw self.apos.error('locked', {\n me: true\n });\n }\n throw self.apos.error('locked', {\n title: info.advisoryLock.title,\n username: info.advisoryLock.username\n });\n }\n }", "title": "" }, { "docid": "f175c90c2acbdf53f320e358898d3f12", "score": "0.51078385", "text": "get lockedDate() {\n\t\treturn this.__lockedDate;\n\t}", "title": "" }, { "docid": "4fd457c57c775d8b1538de7b6ca571c2", "score": "0.50456285", "text": "isTokenExpiring() {\n var _a;\n const now = new Date().getTime();\n const eagerRefreshThresholdMillis = (_a = this.eagerRefreshThresholdMillis) !== null && _a !== void 0 ? _a : 0;\n if (this.rawToken && this.expiresAt) {\n return this.expiresAt <= now + eagerRefreshThresholdMillis;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "a6df12372035cc28883f0bf66013dd0e", "score": "0.5036469", "text": "function checkPastLimitTime() {\n if ($scope.pyDisabledDatesInt.indexOf(1) > -1) // tomorrow is already disabled by disabledates\n $scope.pastLimitTime = false;\n else {\n [limitHour,limitMinute] = $scope.pyBakeryInfo.bestelLimitTime.split(\":\");\n var now = new Date();\n $scope.pastLimitTime = (now.getHours() >= limitHour) && (now.getMinutes() >= limitMinute);\n }\n }", "title": "" }, { "docid": "79633ee700b813005358816546d272c8", "score": "0.50201243", "text": "removeOldDataFromDB() {\n const today = getSynchronizedDate().format(DATE_FORMAT);\n return this.storage.aggregated.deleteOlderThan(today);\n }", "title": "" }, { "docid": "20a2fc6a69406aa951bdbcce651933fa", "score": "0.5019873", "text": "check_timestamp() {\n return time.now() > this.timestamp;\n }", "title": "" }, { "docid": "a54da5346982420ef14f3bde80776082", "score": "0.50129783", "text": "function validate_expiry_date() {\n if (instance.expiry_date) {\n var x = new Date().setHours(0, 0, 0, 0);\n var timestamp = Math.floor(x / 1000);\n\n var s = new Date(instance.expiry_date);\n var expiry = Math.floor(s / 1000);\n\n if (timestamp > expiry) {\n throw new Error(E_WC_COUPON_EXPIRED);\n }\n }\n }", "title": "" }, { "docid": "1759c0cad67fcc313f50799bcfe2422a", "score": "0.4997661", "text": "async expired(command) {\n const {\n dataSetId, offerId, handler_id, blockchain_id,\n } = command.data;\n this.logger.notify(`Offer for data set ${dataSetId} has not been started on blockchain ${blockchain_id}.`);\n\n const offer = await Models.offers.findOne({ where: { offer_id: offerId } });\n offer.status = 'FAILED';\n offer.global_status = 'FAILED';\n offer.message = `Offer for data set ${dataSetId} has not been started\n .`;\n await offer.save({ fields: ['status', 'message', 'global_status'] });\n this.remoteControl.offerUpdate({\n offer_id: offerId,\n });\n Models.handler_ids.update({\n status: 'FAILED',\n }, { where: { handler_id } });\n\n await this.replicationService.cleanup(offer.id);\n return Command.empty();\n }", "title": "" }, { "docid": "cb0ed3660ddd1e5ebf585c68e318dba4", "score": "0.4987041", "text": "async expired(command) {\n const { dataSetId, internalOfferId } = command.data;\n this.logger.notify(`Offer for data set ${dataSetId} has not been started.`);\n\n const offer = await Models.offers.findOne({ where: { id: internalOfferId } });\n offer.status = 'FAILED';\n offer.global_status = 'FAILED';\n offer.message = `Offer for data set ${dataSetId} has not been started.`;\n await offer.save({ fields: ['status', 'message', 'global_status'] });\n this.remoteControl.offerUpdate({\n id: internalOfferId,\n });\n\n await this.replicationService.cleanup(offer.id);\n return Command.empty();\n }", "title": "" }, { "docid": "7b5d9de4aa2aa32b133f8d80a908403d", "score": "0.4975275", "text": "function acquire(name, ttl) {\n var now = new Date();\n if (locks[name] && now.getTime() < locks[name]) {\n return false;\n }\n locks[name] = now.getTime() + ttl;\n return true;\n}", "title": "" }, { "docid": "18d1812cd6d6fbb03fbe23eace54724a", "score": "0.49749613", "text": "useCache() {\n // this.log(\"check cache timeout\", this.props.block, this.props.cache)\n const timeout = this.props.block.cache_timeout\n if (!timeout) return false\n\n if (!this.props.cache) return false\n\n const last_update_at = this.props.cache.at\n if (!last_update_at) return false\n\n const now = new Date().getTime()\n const update_after = parseInt(last_update_at, 10) + parseInt(timeout, 10)\n\n // this.log(\"CHECK NOW\", new Date(now), \"<\", new Date(update_after))\n return now < update_after\n }", "title": "" }, { "docid": "f46990e72b06d278e028111e398b6316", "score": "0.49742633", "text": "function isExpired(date) {\n var then = new Date(date);\n var now = new Date();\n return (Math.abs(now - then) > 3600000);\n }", "title": "" }, { "docid": "ff71e3c40700fd9c81eae6da66833a38", "score": "0.49676603", "text": "function tokenExpired() {\n\tvar expired = false;\n\tif (LAST_REFRESH) {\n\t\tvar now = new Date().getTime();\n\t\tvar tokenAge = now-LAST_REFRESH;\n\t\tTi.API.info(\"[force] token age = \" + tokenAge);\n\t\tif (tokenAge>FIVE_MINS) expired = true;\n\t}\n\treturn expired;\n}", "title": "" }, { "docid": "480f144eccf18b5ccc10539addbc7420", "score": "0.4948406", "text": "function is_data_stale() {\n\treturn last + max_age < Date.now();\n}", "title": "" }, { "docid": "eb12fe3397399b3ce97cbfcfa9cf7fe8", "score": "0.49311927", "text": "function checkIfTokenExpired({ accessTokenExpirationDate }) {\n return new Date(accessTokenExpirationDate) < new Date();\n}", "title": "" }, { "docid": "c69bf9863dc7e766706d9b37a4587da7", "score": "0.49271932", "text": "unlock() {\n\t this.isLocked = false;\n\t this.refreshState();\n\t }", "title": "" }, { "docid": "8edcbb1edffe15348383b1df677535da", "score": "0.49051413", "text": "async delete() {\n // Make sure we don't attempt another rerun if we're called in the middle of\n // a cache expiration.\n this._rerunRequested = false;\n await this._timestampModel.delete();\n }", "title": "" }, { "docid": "071d393112127c26dc404740ef18a239", "score": "0.4899235", "text": "async expireEntries() {\n if (this._isRunning) {\n this._rerunRequested = true;\n return;\n }\n\n this._isRunning = true;\n const now = Date.now(); // First, expire old entries, if maxAgeSeconds is set.\n\n const oldEntries = await this._findOldEntries(now); // Once that's done, check for the maximum size.\n\n const extraEntries = await this._findExtraEntries(); // Use a Set to remove any duplicates following the concatenation, then\n // convert back into an array.\n\n const allUrls = [...new Set(oldEntries.concat(extraEntries))];\n await Promise.all([this._deleteFromCache(allUrls), this._deleteFromIDB(allUrls)]);\n\n if (false) {}\n\n this._isRunning = false;\n\n if (this._rerunRequested) {\n this._rerunRequested = false;\n this.expireEntries();\n }\n }", "title": "" }, { "docid": "28547a983be39ae6005b835ba8593a8b", "score": "0.48756462", "text": "getIfNotExpired(key, db) {\n let data = this.data[db][key];\n if (data.ttl > 0) {\n let now = Date.now();\n let then = data.created.getTime();\n let elapsed = now - then;\n let ttl = data.ttl * 1000;\n debug('TTL in ms ' + ttl);\n debug(elapsed + ' ms have elapsed since created');\n if (elapsed > ttl) {\n debug('Data has expired');\n delete this.data[db][key];\n return null;\n } else {\n return data;\n }\n } else {\n return data;\n }\n }", "title": "" }, { "docid": "ed6c0f8588f70b401bb7f74abe080310", "score": "0.4873107", "text": "async isStale() {\n\t\ttry {\n\t\t\tconst lastFetched = await get(\"lastFetched\")\n\t\t\tif (!lastFetched) return true\n\n\t\t\tconst timeNow = Date.now()\n\t\t\tconst timeElapsed = timeNow - lastFetched\n\t\t\tconst cacheIsStale = timeElapsed > this.lifespan\n\n\t\t\tconst timeUntilStale =\n\t\t\t\t!cacheIsStale && Math.floor((this.lifespan - timeElapsed) / 1000 / 60)\n\n\t\t\tif (isDev())\n\t\t\t\tconsole.log(`Cache invalidation in ${timeUntilStale} minutes.`)\n\n\t\t\treturn cacheIsStale\n\t\t} catch (err) {\n\t\t\tthrow Error(`Error checking if the cache is stale`)\n\t\t}\n\t}", "title": "" }, { "docid": "7d9d604a5b07403b1b069e58ce00570d", "score": "0.48514113", "text": "function isExpired(date) {\n let now = new Date();\n (date < now) ? true : false;\n}", "title": "" }, { "docid": "4edf462461ec2f9cd5767aedc72188f1", "score": "0.4846673", "text": "calculateExpiration(){\n const expirationPeriod = Math.floor(Math.random() * (refreshRate / 2));\n const msUntilExpiration = Math.random() < 0.5 ? refreshRate - expirationPeriod : refreshRate + expirationPeriod;\n return moment(this.createdAt).add(msUntilExpiration, 'milliseconds');\n }", "title": "" }, { "docid": "dd8cb4798e8840c1960ff090dfbea1f5", "score": "0.48418227", "text": "function CheckDateAndUpdateVoteStat(voteItem, index) {\n var now = new Date();\n var itemsEndDate = new Date(voteItem.endDate);\n\n voteItem.voteStatus = now >= itemsEndDate ? \"not active\" : \"active\";\n }", "title": "" }, { "docid": "c0ca38aba11f6f87a28aec12259c6455", "score": "0.48343512", "text": "function migrateExpiration (store) {\n const request = store.openCursor()\n request.onsuccess = (event) => {\n const cursor = event.target.result\n if (!cursor) {\n return\n }\n const entry = cursor.value\n entry.expires = Date.now() + DEFAULT_EXPIRY\n cursor.update(entry)\n }\n}", "title": "" }, { "docid": "3281955f59870fcaf729bb9ffdf4de2c", "score": "0.4826542", "text": "setCacheField() {\n return self.apos.migration.eachDoc({ cacheInvalidatedAt: { $exists: 0 } }, 5, async doc => {\n await self.apos.doc.db.updateOne({ _id: doc._id }, {\n $set: { cacheInvalidatedAt: doc.updatedAt }\n });\n });\n }", "title": "" }, { "docid": "bb531674e0e921252d130a5d7a8d31a4", "score": "0.48237723", "text": "static getTimeLeftBeforeExpiration() {\n\n // Get Current reservation\n let current = Reservation.getCurrent();\n\n // Return a time in secondes\n return Math.floor((current.expireOn - Date.now()) / 1000); // in sec\n\n }", "title": "" }, { "docid": "54e498c49877c1e65083a79414fcd211", "score": "0.48202533", "text": "isConsistent() {\n return !this.inconsistentAt;\n }", "title": "" }, { "docid": "93e847d139d02e19c818ef310a3a7d92", "score": "0.48144132", "text": "async removeExpiredItems() {\n const CachedItems = await this.readAllCachedItemsFromAsyncStorage();\n\n CachedItems.map(async (item) => {\n const cachedValue = await AsyncStorage.getItem(item);\n if (this.isItemExpired(JSON.parse(cachedValue))) {\n await AsyncStorage.removeItem(item);\n }\n });\n }", "title": "" }, { "docid": "aafae8b8873f4ae748b21157eef0d330", "score": "0.480652", "text": "function isExpired(cert) {\n // if it expires in less than 2 minutes, it's too old to use.\n var diff = cert.payload.exp.valueOf() - serverTime.valueOf();\n if (diff < (60 * 2 * 1000)) {\n return true;\n }\n\n // or if it was issued before the last time the domain key\n // was updated, it's invalid\n if (!cert.payload.iat || cert.payload.iat < creationTime) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "0d849d42aae1cf2ab306db3f8947502c", "score": "0.4782838", "text": "function migrateExpiration(store) {\n var request = store.openCursor();\n request.onsuccess = function (event) {\n var cursor = event.target.result;\n if (!cursor) {\n return;\n }\n var entry = cursor.value;\n entry.expires = Date.now() + DEFAULT_EXPIRY;\n cursor.update(entry);\n };\n}", "title": "" }, { "docid": "29e540e20020e5a733a270e7e71ba97f", "score": "0.47713646", "text": "isLockable() {\n return false;\n }", "title": "" }, { "docid": "de348654a1962294993ccb27f99088d5", "score": "0.4770558", "text": "async extendLock(token, duration) {\n return scripts_1.Scripts.extendLock(this.queue, this.id, token, duration);\n }", "title": "" }, { "docid": "ea2b21be43db4c2346006d0df1887495", "score": "0.47656617", "text": "function migrateExpiration(store) {\n var request = store.openCursor();\n\n request.onsuccess = function (event) {\n var cursor = event.target.result;\n\n if (!cursor) {\n return;\n }\n\n var entry = cursor.value;\n entry.expires = Date.now() + DEFAULT_EXPIRY;\n cursor.update(entry);\n };\n}", "title": "" }, { "docid": "7a1995b824f0d7373d7e51b4537c8cae", "score": "0.47652328", "text": "_expireTokens(oldestValidDate, userId) {\n const tokenLifetimeMs = this._getTokenLifetimeMs();\n\n // when calling from a test with extra arguments, you must specify both!\n if ((oldestValidDate && !userId) || (!oldestValidDate && userId)) {\n throw new Error(\"Bad test. Must specify both oldestValidDate and userId.\");\n }\n\n oldestValidDate = oldestValidDate ||\n (new Date(new Date() - tokenLifetimeMs));\n const userFilter = userId ? {_id: userId} : {};\n\n\n // Backwards compatible with older versions of meteor that stored login token\n // timestamps as numbers.\n this.users.update({ ...userFilter,\n $or: [\n { \"services.resume.loginTokens.when\": { $lt: oldestValidDate } },\n { \"services.resume.loginTokens.when\": { $lt: +oldestValidDate } }\n ]\n }, {\n $pull: {\n \"services.resume.loginTokens\": {\n $or: [\n { when: { $lt: oldestValidDate } },\n { when: { $lt: +oldestValidDate } }\n ]\n }\n }\n }, { multi: true });\n // The observe on Meteor.users will take care of closing connections for\n // expired tokens.\n }", "title": "" }, { "docid": "1a39346779a31ca727ad0028507bc524", "score": "0.47596598", "text": "has_life_expired() {\n if ((this.lifetime !== null) && (this.age >= this.lifetime)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "1bcc83729174d1159dd423a78274fdba", "score": "0.47566614", "text": "get locked() { return false }", "title": "" }, { "docid": "36559c0526ff439a8899daba987b7777", "score": "0.47483906", "text": "isLockedWork() {\n let userId = userService.getLoggedId();\n let attendance = attendanceService.getAttendance(workToEdit.idAttendance);\n if(!attendance || !attendance.approved)\n return false;\n return true;\n }", "title": "" }, { "docid": "3a7fe88f2df7a6754b124001df76bb11", "score": "0.47423407", "text": "function isNotTooOld(event) {\n return event > requestStartTime - (evtTooOld * 1000);\n }", "title": "" }, { "docid": "9bf6c458e48078c42f12fa374d4f7bb7", "score": "0.47355887", "text": "function isTokenExpired(accessToken, offsetSeconds) {\n var d = getTokenExpirationDate(accessToken);\n offsetSeconds = offsetSeconds || 0;\n if (d == null) {\n return false;\n }\n return !(d.valueOf() > (new Date().valueOf() + (offsetSeconds * 1000)));\n }", "title": "" }, { "docid": "6d3ea61f949871d208f857d41d418ea2", "score": "0.47334298", "text": "function isTokenExpired(token) {\n\t// giving the constant expirationDate the value of the above function.\n const expirationDate = getTokenExpirationDate(token);\n // returning the expirationDate constant.\n return expirationDate < new Date();\n}", "title": "" }, { "docid": "a9b02c74b3325df9dca59ccc32c70bb2", "score": "0.47317597", "text": "async unlock(req, doc, tabId) {\n if (!(req && req.res)) {\n // Use 'error' because this is always a code bug, not a bad\n // HTTP request, and the message should not be disclosed to the client\n throw self.apos.error('error', 'You forgot to pass req as the first argument');\n }\n const id = doc && doc._id;\n if (!id) {\n throw self.apos.error('invalid', 'no doc');\n }\n if (!tabId) {\n throw self.apos.error('invalid', 'no tabId');\n }\n await self.db.updateOne({\n _id: id,\n 'advisoryLock._id': tabId\n }, {\n $unset: {\n advisoryLock: 1\n }\n });\n delete doc.advisoryLock;\n }", "title": "" }, { "docid": "bcf53f8aadb2a108b8929f48279765b8", "score": "0.4730552", "text": "handleBanTimeouts() {\n var timeout = Date.now() - this.options.banTimeout;\n Object.keys(this.bans).forEach(key => {\n if (this.bans[key].timestamp < timeout) {\n this.logger.info('Releasing IP ban for %s.', key);\n delete this.bans[key];\n }\n });\n }", "title": "" }, { "docid": "2afdca66f4f0180daf00086a6e1cc4de", "score": "0.4726901", "text": "static shouldUpdateStatus(props) {\n return (\n !props.serverStatus.updated ||\n (+new Date()) - props.serverStatus.updated > UPDATE_SERVER_STATUS_CACHE_TIME\n );\n }", "title": "" }, { "docid": "3981c26adeba010914defa2045c895b1", "score": "0.47253665", "text": "expireCache() {\n const ts = timestamp();\n\n if (ts - this.lastExpireRun < 60) {\n return;\n }\n\n Object.keys(this.triggerIndex).forEach(triggerId => {\n const trigger = this.triggerIndex[triggerId];\n if (trigger.ttl !== null && trigger._added_ts + trigger.ttl < ts) {\n if (this.triggerDestroyCb) {\n this.triggerDestroyCb(this.triggerIndex[triggerId]);\n }\n delete this.triggerIndex[triggerId];\n }\n });\n\n this.lastExpireRun = ts;\n }", "title": "" }, { "docid": "91fdae82993630cbcd9576287eef7763", "score": "0.47083232", "text": "lock() {\n\t this.isLocked = true;\n\t this.refreshState();\n\t }", "title": "" }, { "docid": "54328f3415044b5596966229edaabeb3", "score": "0.4699946", "text": "function expired(paste) {\n var now = new Date();\n var epoch = now.getTime() / 1000; // epoch in seconds\n var expiry = paste.ttl + paste.created;\n var ttl = expiry - epoch; // ttl in seconds\n return (ttl <= 0);\n}", "title": "" }, { "docid": "42de587a53cb1d4467fd11be1cf2e33f", "score": "0.46903962", "text": "function resetExpiredScheduledRecordings(stb) {\n var now = Date.now(),\n delay = parseInt(config.resetScheduledRecordingsDelayInMs);\n if (lastScheduledRecordingsResetTime && now - lastScheduledRecordingsResetTime > delay) {\n resetScheduledRecordings(stb);\n }\n }", "title": "" }, { "docid": "248a779b13d0a0217dc4eeb70c33f283", "score": "0.46865922", "text": "function lockOut() {\n return authVault.lock();\n }", "title": "" }, { "docid": "1aebc7131b2ff88dc57cdba0aa953ca3", "score": "0.46849447", "text": "lock() {\n this.isLocked = true;\n }", "title": "" }, { "docid": "37168b6e9e18b52328d3c8325d36f462", "score": "0.46762505", "text": "function expired() {\n\n log.functionEntryPoint()\n \n log.fine('oldConfig.isTrial: ' + oldConfig.isTrial + ' (' + typeof oldConfig.isTrial + ')')\n\n // Ensure the user can only use the trial once\n if (oldConfig.isTrial) {\n log.fine('Flag trial as finished')\n self.properties.setProperty(PROPERTY_.TRIAL_FINISHED, 'true')\n }\n \n return updateProperties(false, SUBS_STATE.EXPIRED, TIMER_NOT_STARTED)\n \n }", "title": "" }, { "docid": "7a347027498ac9f27cc82be14827c518", "score": "0.46732214", "text": "checkToken() {\n if(localStorage.getItem(\"token_time\") != null) {\n if(new Date().getTime() - new Date(localStorage.getItem(\"token_time\")).getTime() > 60000) {\n localStorage.setItem(\"token_time\", (new Date()).toString());\n console.log(\"update token\");\n this.updateToken();\n }\n } else {\n localStorage.setItem(\"token_time\", (new Date()).toString());\n this.updateToken();\n }\n }", "title": "" }, { "docid": "b7eab04b352d66440bf055e053d035f5", "score": "0.4663071", "text": "cleanupExpiredTabs () {\n \t now = Date.now();\n for ( var tabId in this.pastEvents) {\n if (this.pastEvents.hasOwnProperty(tabId)) {\n var event = this.pastEvents[tabId];\n if ((now - event.timestamp) > this.TAB_EVENT_EXPIRATION_TIME) {\n delete this.pastEvents[tabId];\n }\n }\n }\n }", "title": "" }, { "docid": "82e3ca6924494ccd7e22a5445ee3077b", "score": "0.46555233", "text": "get isLocked() {\n return this.data.get('status') === SculptureStore.STATUS_LOCKED;\n }", "title": "" }, { "docid": "8027eeb885acd25a4cb60ebdd9ade7cb", "score": "0.46525165", "text": "get expiryDate() {\n return new Date(this._data.expires_at);\n }", "title": "" }, { "docid": "1f0a3b7355dc60db510e570ad9f82d5f", "score": "0.4640317", "text": "checkAndHandleExpiredSession() {\n const oldSessionId = this.getSessionId();\n\n // Prevent starting a new session if the last user activity is older than\n // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new\n // session+recording. This creates noisy replays that do not have much\n // content in them.\n if (\n this._lastActivity &&\n isExpired(this._lastActivity, this.timeouts.sessionIdlePause) &&\n this.session &&\n this.session.sampled === 'session'\n ) {\n // Pause recording only for session-based replays. Otherwise, resuming\n // will create a new replay and will conflict with users who only choose\n // to record error-based replays only. (e.g. the resumed replay will not\n // contain a reference to an error)\n this.pause();\n return;\n }\n\n // --- There is recent user activity --- //\n // This will create a new session if expired, based on expiry length\n if (!this._loadAndCheckSession()) {\n return;\n }\n\n // Session was expired if session ids do not match\n const expired = oldSessionId !== this.getSessionId();\n\n if (!expired) {\n return true;\n }\n\n // Session is expired, trigger a full snapshot (which will create a new session)\n this._triggerFullSnapshot();\n\n return false;\n }", "title": "" }, { "docid": "a4acc0b2085ee94bad405f375542f126", "score": "0.4639961", "text": "function isKeyExpired(TimeStampKey) {\n\n // Retrieve the example setting for expiration in seconds\n var expiryStamp = localStorage.getItem(TimeStampKey);\n\n if (expiryStamp != null && cacheTimeout != null) {\n\n // Retrieve the timestamp and compare against specified cache timeout settings to see if it is expired\n var currentTime = Math.floor((new Date().getTime()) / 1000);\n\n if (currentTime - parseInt(expiryStamp) > parseInt(cacheTimeout)) {\n return true; //Expired\n }\n else {\n return false;\n }\n }\n else {\n //default \n return true;\n }\n}", "title": "" }, { "docid": "3acc4dd6289b01c8ea5f5ef777e187df", "score": "0.46305647", "text": "function disabledDate(current) {\r\n return current && current < moment().endOf('day');\r\n }", "title": "" }, { "docid": "9f1cb0ef9d88e7e59eaf626de8b6dce2", "score": "0.46145365", "text": "isValid(card) { // eslint-disable-line\n return new Promise((resolve, reject) => {\n const now = new Date();\n const expire_date = new Date(card.expire_date);\n if (now.getTime() > expire_date.getTime()) {\n return reject(false, 'it has expired');\n }\n return resolve(card, true);\n });\n }", "title": "" }, { "docid": "a11345d055aa6fb607db0e8f6fc835df", "score": "0.46068332", "text": "function handleExpiredToken() {\n var getNewAccessToken = generateAccessToken();\n getNewAccessToken.then(function(result) {\n console.warn(\"Access token retrieval successful!\"); // New access token:\", result\n localStorage.setItem('access_token', result);\n \n successfulAuth(result);\n }, function(error) {\n // NOTE: This is broken now! Look into fixing somehow...\n console.log(\"Retrieval of new access token failed! Setting authentication state to false...\");\n console.error(error);\n\n failedAuth();\n });\n}", "title": "" }, { "docid": "861f0ee5ba638e89c72319a7ecd01882", "score": "0.46057096", "text": "refreshCache() {\n if (Date.now() - this.MIN_TIME_BETWEEN_REFRESH * 1000 > this.lastRefreshTime) {\n this.downHostsCacheMap.forEach((value, key) => {\n const entryTime = value;\n if (entryTime != null && ((Date.now() - this.DOWN_HOSTS_TIMEOUT * 1000) > entryTime)) {\n this.downHostsCacheMap.delete(key);\n }\n });\n this.lastRefreshTime = Date.now();\n }\n }", "title": "" }, { "docid": "5cdff565ebe80164e561ff72125d1448", "score": "0.4602426", "text": "function isTokenExpired (token) {\n const expirationDate = getTokenExpirationDate(token)\n return expirationDate < new Date()\n}", "title": "" }, { "docid": "c70e7e1a8f3529f393f9520158469f24", "score": "0.46016315", "text": "_validateCache() {\n if (new Date().getTime() > this.expiration) {\n this._cacheObject = {};\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "125c8c0b65a0a46f2fb2f88031d12ec1", "score": "0.4584633", "text": "lock() {\n this.data.set('status', SculptureStore.STATUS_LOCKED);\n }", "title": "" }, { "docid": "d26311eb894f3ddd8718296c5fe63a0e", "score": "0.45833856", "text": "deviceStatusWarning(device) {\n\t\t\tconst difference = this.getTimeDifference(device.updated_at);\n\n\t\t\treturn (difference <= 60);\n\t\t}", "title": "" }, { "docid": "10cf475b9e21d9cba58769a384a02b49", "score": "0.45772994", "text": "function hasAccessTokenExpired(e) {\n let expired;\n if (!e.innerError) {\n expired = false;\n } else {\n expired = e.forbidden &&\n e.message === 'InvalidAuthenticationToken' &&\n e.response.error.message === 'Access token has expired.';\n }\n return expired;\n}", "title": "" }, { "docid": "c3178b4bc27f23261364333e76369d62", "score": "0.4568996", "text": "unlock() {\n if (this.isUnlockable()) {\n this.unlocked = true;\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "9521cbfab72f63d3ac9b97b5dcccb479", "score": "0.45586535", "text": "isReadyToRemove() {\n return (\n (millis() - this.createdAt) / 1000 >=\n controller.createDuration + controller.displayDuration\n )\n }", "title": "" }, { "docid": "80417aaae362ad0bf0f97db7e0bb16b1", "score": "0.4557354", "text": "checkDate() {\n let currDate = moment.utc().format()\n let thisDate = moment.utc(this.props.dateExpires).format()\n if (currDate > thisDate) {\n this.setState({\n disabled: false,\n clock: envelopeSecond\n })\n document.getElementById(this.props.title + '_button').classList.add('makeorange')\n alert(`Your time capsule '${this.props.title}' just unlocked!`)\n this.setState({ status: 'OPEN' })\n clearInterval(this.interval)\n }\n }", "title": "" }, { "docid": "fd68da5298d2b7ceb9c9f42fb80ee229", "score": "0.45570058", "text": "function findExpiredBookings() {\n\n var where = {\n status: 'handout',\n end: { $lt: new Date() },\n };\n\n if(moment().format('09:00') == moment().format('HH:mm')) {\n BookingModel.find({$and:[where,{notificationSent:true}]},function(err,bookings) {\n bookings.forEach(function (booking) {\n booking.notificationSent = 'false';\n booking.save();\n });\n });\n }\n\n BookingModel.find({$and:[where,{notificationSent: { $ne: true }}]}, function (err, bookings) {\n bookings.forEach(function (booking) {\n \n //update status\n booking.status = 'overdrawn';\n booking.save();\n\n //send notification \n if(booking.notificationSent == false) {\n Mailer.sendBookingExpiredMail({\n userId: booking.user,\n gadgetId: booking.gadget,\n booking: booking\n }, function (err) {\n if (err) { return next(err); } \n // update booking to make sure notification mail is sent only once\n booking.notificationSent = 'true';\n booking.save();\n });\n }\n });\n });\n}", "title": "" }, { "docid": "58dbff89afc5fbe12a9e783d3364f22a", "score": "0.4556554", "text": "function timeForNewToken() {\n if(Date.now() - tenMinutes < token.time) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "b6213c998fe9afdba058162451d9af18", "score": "0.45538768", "text": "failed() {\n const updateParams = {\n TableName: 'DalaWallets',\n Key: { id: this.username },\n UpdateExpression: 'set #status = :status, #lastUpdated = :lastUpdated',\n ConditionExpression: '#status = :currentStatus',\n ExpressionAttributeNames: {\n '#status': 'status',\n '#lastUpdated': 'lastUpdated'\n },\n ExpressionAttributeValues: {\n ':currentStatus': Statuses.Processing,\n ':status': Statuses.Failed,\n ':lastUpdated': new Date().toISOString()\n }\n };\n return documentClient.update(updateParams).promise().catch(error => {\n if (error.code === 'ConditionalCheckFailedException') {\n throw new InvalidStatusError('InvalidStatus')\n }\n throw error;\n });\n }", "title": "" }, { "docid": "436aad8803c0d1deefa2f5ca49676e19", "score": "0.45440444", "text": "isValid() {\n if (!this.expiration) {\n return true;\n }\n console.debug('Now: %s, expiration: %s', Date.now(), this.expiration);\n return (Date.now() < this.expiration);\n }", "title": "" }, { "docid": "97a081e8f3a90858c61819cf24f7016d", "score": "0.45440254", "text": "checkCacheTimeouts() {\n logger_1.Logger.log.debug(`ClocoClient.checkCacheTimeouts: start.`);\n for (let i = 0; i < cache_1.Cache.current.items.length; i++) {\n if (cache_1.Cache.current.items[i].isExpired()) {\n logger_1.Logger.log.debug(`ClocoClient.checkCacheTimeouts: cache expired for item '${cache_1.Cache.current.items[i].key}'.`, { data: cache_1.Cache.current.items[i] });\n this.onCacheExpired.dispatch(this, cache_1.Cache.current.items[i]);\n }\n }\n logger_1.Logger.log.debug(`ClocoClient.checkCacheTimeouts: complete.`);\n // restart the timer.\n if (this.options.cacheCheckInterval > 0) {\n this.timer = setTimeout(() => this.checkCacheTimeouts(), this.options.cacheCheckInterval);\n }\n }", "title": "" }, { "docid": "855a1d08dbfeff17c855aa11fc3fd2c9", "score": "0.4543747", "text": "async function tweetEditable(tweet_id){\n const { rows } = await pool.query(\"SELECT tweet_time FROM tweets WHERE ID = $1\",[tweet_id])\n const tweet_time= rows[0]['tweet_time']\n // get the current time now\n const time_now = helper.getCurrentTimestamp\n \n // remove 60 seconds from time_now...\n // if that value is less than tweet_time. Allow the edit. If not.. then don't\n if((time_now - 60) < tweet_time){\n return true\n }else{ return false }\n \n}", "title": "" } ]
a206b1c41689d7ee60a235e72f17a63c
moves blorks as a group
[ { "docid": "fb6569176afdae38e8719c325e3c9cc2", "score": "0.0", "text": "function blorkMove(marginLeft, marginRight) {\n var blorkDivHTML = document.getElementById('blork_div');\n blorkDivHTML.style.marginLeft = marginLeft + '%';\n blorkDivHTML.style.marginRight = marginRight + '%';\n}", "title": "" } ]
[ { "docid": "07681e6fdaf9e6e70b0210fb92df58a7", "score": "0.6108286", "text": "function pair_break (pawn_moved, from_box, to_box) {\n\n\treturn false;\n}", "title": "" }, { "docid": "933947d5052acb9a7ad8c435423c02ee", "score": "0.6100764", "text": "function myMove(group) {\n\tlet c = group[group.length-1];\n\tc.position.x = mouseX;\n\tc.position.y = mouseY;\n}", "title": "" }, { "docid": "579bb70296468dc94622aeb425c7e689", "score": "0.60860765", "text": "function relayerBackgroundGroups() {\n\t\t\tif (!map.hasLayer(regionLayer)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (regionLayer.hasLayer(nearbyLayerGroup)) {\n\t\t\t\tnearbyLayerGroup.bringToBack();\n\t\t\t}\n\t\t\tif (regionLayer.hasLayer(cellLayerGroup)) {\n\t\t\t\tcellLayerGroup.bringToBack();\n\t\t\t}\n\t\t\tif (regionLayer.hasLayer(gymCenterLayerGroup)) {\n\t\t\t\tgymCenterLayerGroup.bringToFront();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "af20b7601566f5cde1d9420242686e6c", "score": "0.6053308", "text": "function groupOrbs(a, b) {\r\n\t\r\n\tif (!board[a][b].infected && board[a][b].orb != 'x') {\r\n\t\tinfect(a,b);\r\n\t}\t\t\t\r\n}", "title": "" }, { "docid": "1ff89d7511c615e5d719c0d9acc5ff9f", "score": "0.60071504", "text": "function ungroup(target, group) {\r\tfor (i=group.pageItems.length-1; i>=0; i--) {\r\t\tgroup.pageItems[i].move(target, ElementPlacement.PLACEATBEGINNING);\r }\r}", "title": "" }, { "docid": "9ede5b8abcc972b96e562fe15d824517", "score": "0.5832165", "text": "function moveBubbles() {\n project.activeLayer.children.slice(1)\n for (var i = 0; i <= bubbleCount+2; i++) {\n var bubble = project.activeLayer.children[i];\n if(bubble.symbol) {\n // larger bubbles move faster than smaller circles:\n bubble.position.y += -bubble.bounds.height/10 ;\n fluidPercentOfScreen = springs[2].point.y/view.size.height;\n if ( bubble.position.y < view.viewSize.height * (fluidPercentOfScreen) ) {\n var nearestPointOnBeerLayer = path.getNearestLocation(bubble.position).point.y\n if( bubble.position.y < nearestPointOnBeerLayer - 40) {\n bubble.position.y = view.size.height + bubble.bounds.height + Math.random()*20;\n bubble.position.x = view.size.width * Math.random();\n } \n }\n }\n }\n }", "title": "" }, { "docid": "cc0e6e04f267fb7a66c8cccdc87abceb", "score": "0.5784582", "text": "function moveGroupOrigin(){\n\n var width = topRight.x() - topLeft.x(),\n height = bottomLeft.y() - topLeft.y();\n\n squareGroup.x(topLeft.getAbsolutePosition().x);\n squareGroup.y(topLeft.getAbsolutePosition().y);\n\n topRight.position({\n x: width,\n y: 0\n });\n\n bottomRight.position({\n x: width,\n y: height\n });\n\n bottomLeft.position({\n x: 0,\n y: height\n });\n\n topLeft.position({\n x: 0,\n y: 0\n });\n\n cropArea.position({\n x: 0,\n y: 0\n });\n\n\n }", "title": "" }, { "docid": "a6ebc1df9798bc7784ed70799169425b", "score": "0.5730287", "text": "execute(fighterGroup) {\n const room = fighterGroup.object('currentRoom');\n const attachedCreeps = Object.keys(fighterGroup.attachedAgents);\n if (attachedCreeps.length === 0) { return; }\n\n // firstly, make sure each creep has an assigned position to group up to\n if (!this.state.assignedPositions ||\n !attachedCreeps.every(cn => this.state.assignedPositions[cn])) {\n this.state.assignedPositions = {};\n const groupUpSpot = this.findGroupUpSpot(fighterGroup);\n const squareSize = Math.ceil(Math.sqrt(attachedCreeps.length));\n const offset = Math.round(squareSize / 2);\n for (var i = 0; i < attachedCreeps.length; i++) {\n this.state.assignedPositions[attachedCreeps[i]] = {\n x: groupUpSpot.x - offset + Math.floor(i / squareSize),\n y: groupUpSpot.y - offset + i % squareSize\n };\n }\n }\n\n if (this.state.groupUpSpot) {\n room.visual.rect(\n this.state.groupUpSpot.x - 1, this.state.groupUpSpot.y - 1,\n 2, 2, {fill: 'rgba(255, 85, 0, 0.6)'});\n }\n\n // then, ensure that each creep either is at its assigned position, or\n // has a task to reach the current position.\n const nonGrouppedCreeps = attachedCreeps.filter(key => {\n const creepActor = fighterGroup.agent(key);\n const assignedPos = this.state.assignedPositions[key];\n\n if (creepActor.type !== AT_CREEP_ACTOR) { return false; }\n\n // Keep creeps that aren't at the defined position\n return (\n creepActor.object('creep').pos.x != assignedPos.x ||\n creepActor.object('creep').pos.y != assignedPos.y);\n });\n\n // if there is any idle creep, assign him a move task to the defined position\n nonGrouppedCreeps.forEach(key => {\n const creepActor = fighterGroup.agent(key);\n if (creepActor.hasTaskScheduled(A_MOVE)) { return; }\n const assignedPos = this.state.assignedPositions[key];\n creepActor.scheduleTask(new Move({params: {target: assignedPos}}));\n });\n\n // if relevant, mark finished now to avoid recomputing stuff\n if (nonGrouppedCreeps.length === 0 &&\n AssembleDefenseGroup.hasReachedTarget(fighterGroup, this.params.target)) {\n debugger; // eslint-disable-line no-debugger\n const res = AssembleDefenseGroup.hasReachedTarget(fighterGroup, this.params.target);\n console.log(res);\n this.state.finished = true;\n }\n }", "title": "" }, { "docid": "ba23f0eb11b62a5f246ca1c2bee98856", "score": "0.5697384", "text": "function group(){\n let groupBlock = $(\".groups_block > .groups\");\n for(let i = 0; i < groupBlock.length; i++){\n let blockSort = groupBlock.eq(i).children(\".group_list\").children(\".group\").children(\".all_wather\");\n if(blockSort.hasClass(\"invisible\")){\n groupBlock.eq(i).children(\".groups_head\").children(\".all_wather\").removeClass(\"on\").addClass(\"off\");\n }\n else{\n groupBlock.eq(i).children(\".groups_head\").children(\".all_wather\").removeClass(\"off\").addClass(\"on\");\n }\n }\n }", "title": "" }, { "docid": "9ddc903b75129dbb41c53e2d80af9c89", "score": "0.56762254", "text": "function swallboom(){\n var tb=document.getElementById('map');\n //boom img\n var img=document.createElement(\"img\");\n img.src=imgbase+allboom;\n img.alt=\"X\";\n var w,h,tmp,childs;\n for(var i=0;i<game.map.info.mineNum;i++){\n w=parseInt(game.map.minePos[i]%(game.map.info.width));\n h=parseInt(game.map.minePos[i]/(game.map.info.width));\n tmp=tb.rows[h].cells;\n childs=tmp[w].childNodes;\n //if had marked then remove the marked and set boom\n if(game.map.playerMap[h][w]==1){\n if(childs.length!=0){\n for(var j=0;j<childs.length;j++){\n childs[j].parentNode.removeChild(childs[j]);\n //stop appendChild move element\n //real append element with cloneNode(true)\n tmp[w].appendChild(img.cloneNode(true));\n }\n }\n }else{\n tmp[w].appendChild(img.cloneNode(true));\n }\n }\n \n}", "title": "" }, { "docid": "f2a594ead2d3eab29a042ec0cb46381d", "score": "0.5602352", "text": "function movingUsersToNewGroup(answer) {\n //create new group to house the users\n var newGroup = createNewGroup(answer, foundGroup);\n\n //point to the user array of the former group\n newGroup.list_of_users = foundGroup.list_of_users.slice(0);\n\n //change the counter of users within the new group\n newGroup.count = newGroup.list_of_users.length;\n\n //\"reset\" former group's users array\n foundGroup.list_of_users = [];\n\n //add the newly created group, containing the users\n addGroupToGroup(foundGroup, answer, newGroup);\n\n //and then proceed as normal\n addGroupToGroup(foundGroup, newGroupName);\n\n helpers.menuCallback();\n}", "title": "" }, { "docid": "fd2cee2da7cb2f458bd89d76571d28d3", "score": "0.5582696", "text": "function showBabies(group) {\n\tfor (let i = 0; i< group.length; i++) {\n\t\tlet j = group[i];\n\t\tj.visible = true;\n\t\tj.position.y += random(1,10);\n\t\tif (j.position.y == height-200) {\n\t\t\tj.position.y -= random(1,10);\n\t\t}\n\t\tlet turn = map(j.position.y, 0,height/2, 0,360);\n\t\tj.rotation = turn;\n\t\tj.setCollider('circle',0,0,100);\n\t}\n\t//this makes the items in the group bounce against each other.\n\tgroup.bounce(group);\n\tmyMove(group);\n}", "title": "" }, { "docid": "d9f63f62f4807b545cd98fdd359b714c", "score": "0.5564324", "text": "function removeGroup(colorOfThisGroup) {\n var data = Game.data;\n var token = Game.token\n\n if (colorOfThisGroup == 'white') data.pointBlackPlayer += data.tabPositionOfGroupToRemove.length;\n else data.pointWhitePlayer += data.tabPositionOfGroupToRemove.length;\n\n for (i = 0; i < data.tabPositionOfGroupToRemove.length; i++) {\n var currentElement = Game.data.tabPositionOfGroupToRemove[i].split('_');\n var html = document.getElementById(currentElement[0] + '_' + currentElement[1]);\n\n html.className = setClass(parseInt(currentElement[0]), parseInt(currentElement[1]));\n token[currentElement[0]][currentElement[1]] = undefined;\n }\n addLibertytoGroup();\n if (colorOfThisGroup == 'white') gamePoint(Game.data.pointBlackPlayer, 'blackPlayer', 'black'); \n else gamePoint(Game.data.pointWhitePlayer, 'whitePlayer', 'white');\n}", "title": "" }, { "docid": "9f78093ee009c869a44693be984f905c", "score": "0.55523926", "text": "function moveToGroup(obj, target, x, y) {\n\t// move object from its current to the target container\n\tvar oldContainer = obj.parentNode;\n\ttry {\n\t\ttarget.appendChild(obj);\n\t} catch (e) {\n\t\t// ignore circular insertion due to event race\n\t\tlayout(obj);\n\t\treturn;\n\t}\n\n\t// default position at the cursor\n\tif(target.getAttribute(\"top:container\") == \"true\") {\n\t\tvar m = obj.getScreenCTM();\n\t\tvar p = target.getScreenCTM().inverse();\n\t\tm.e = x;\n\t\tm.f = y;\n\t\tsetTransform(obj, p.multiply(m));\n\t}\n\n\t// layout old and new container\n\tif(oldContainer != target) {\n\t\tsetTimeout(function() {\n\t\t\tlayout(oldContainer);\n\t\t}, 1);\n\t\teval(obj.getAttribute(\"top:layout\"));\n\t\tlayout(target);\n\t}\n}", "title": "" }, { "docid": "8266361a96a93dab00da98800839b308", "score": "0.55069685", "text": "function moveBandMember(bandMember, actionType, checkDirection, collisionResults) {\n\n if ( (bandMember.state==='Stage') || (bandMember.state==='Dead') ) {\n\n if (actionType===\"CheckOnly\") {\n collisionResults.collision=false;\n collisionResults.collisionType=\"\";\n collisionResults.collisionDomRef=\"\";\n collisionResults.collisionDomObjType=\"\";\n collisionResults.collisionDomObjType=\"\";\n collisionResults.collisionGridCol=\"\";\n collisionResults.collisionGridRow=\"\";\n collisionResults.isAllowed=true;\n }\n\n return;\n }\n\n const currentPosX = bandMember.posX;\n const currentPosY = bandMember.posY;\n const stepwiseCollisionXY = [];\n let newPosX = currentPosX;\n let newPosY = currentPosY;\n\n let bounceBack=false;\n\n if (actionType!==\"CheckOnly\") {\n if (bandMember.direction==='N') newPosY = bandMember.posY - bandMember.currentSpeed;\n if (bandMember.direction==='S') newPosY = bandMember.posY + bandMember.currentSpeed;\n if (bandMember.direction==='W') newPosX = bandMember.posX - bandMember.currentSpeed;\n if (bandMember.direction==='E') newPosX = bandMember.posX + bandMember.currentSpeed;\n }\n else {\n if (checkDirection==='N') newPosY = bandMember.posY - bandMember.currentSpeed;\n if (checkDirection==='S') newPosY = bandMember.posY + bandMember.currentSpeed;\n if (checkDirection==='W') newPosX = bandMember.posX - bandMember.currentSpeed;\n if (checkDirection==='E') newPosX = bandMember.posX + bandMember.currentSpeed; \n }\n\n stepwiseCollisionXY[0]=currentPosX;\n stepwiseCollisionXY[1]=currentPosY;\n const blockMovement=checkCollisions(bandMember, currentPosX, currentPosY, newPosX, newPosY, stepwiseCollisionXY);\n\n if (blockMovement[0]) {\n if ((blockMovement[1][\"collisionType\"]==='player1') || \n (blockMovement[1][\"collisionType\"]==='bandMember1') || \n (blockMovement[1][\"collisionType\"]==='bandMember2') || \n (blockMovement[1][\"collisionType\"]==='bandMember3') || \n (blockMovement[1][\"collisionType\"]==='bandMember4') ) {\n\n if ( (bandMember.party>BANDMEMBER_FIGHT_FACTOR) && (bandMember.cooldown===0) ) { \n const currentTime=Date.now();\n if (bandMember.direction==='W') {\n\n // console.log(\"Throwing Left\");\n\n bandMember.actionQueue.enqueue( { \"state\": \"Fight\", \"imageState\": \"Throwing Left\", \"durationType\": \"time\", \"duration\": 1000, \"startTime\": currentTime, \"startFrame\": levelFrameCounter,} );\n\n bandMember.actionQueue.enqueue( {\"state\": bandMember.state, \"imageState\": bandMember.imageState});\n\n bandMember.actionQueue.enqueue( { custom: () => { \n bandMember.cooldown=BANDMEMBER_COOLDOWN;\n } } );\n\n soundController(\"play\", \"once\", \"bandmember\", \"Throwing Left\", 1);\n\n if (blockMovement[1][\"collisionType\"]==='player1') { player1.health=player1.health-1; }\n if (blockMovement[1][\"collisionType\"]==='bandMember1') bandMember1.health=bandMember1.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember2') bandMember2.health=bandMember2.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember3') bandMember3.health=bandMember3.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember4') bandMember4.health=bandMember4.health-1;\n } \n else if (bandMember.direction==='E') {\n\n // console.log(\"Throwing Right\");\n\n bandMember.actionQueue.enqueue( { \"state\": \"Fight\", \"imageState\": \"Throwing Right\", \"durationType\": \"time\", \"duration\": 1000, \"startTime\": currentTime, \"startFrame\": levelFrameCounter,} );\n\n bandMember.actionQueue.enqueue( {\"state\": bandMember.state, \"imageState\": bandMember.imageState});\n\n bandMember.actionQueue.enqueue( { custom: () => { \n bandMember.cooldown=BANDMEMBER_COOLDOWN;\n } } );\n\n soundController(\"play\", \"once\", \"bandmember\", \"Throwing Right\", 1);\n\n if (blockMovement[1][\"collisionType\"]==='player1') { player1.health=player1.health-1; }\n if (blockMovement[1][\"collisionType\"]==='bandMember1') bandMember1.health=bandMember1.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember2') bandMember2.health=bandMember2.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember3') bandMember3.health=bandMember3.health-1;\n if (blockMovement[1][\"collisionType\"]==='bandMember4') bandMember4.health=bandMember4.health-1;\n }\n else {\n bounceBack=true;\n if (blockMovement[1][\"collisionType\"]==='player1') {\n player1.health=player1.health-0.5;\n } \n }\n }\n else {\n bounceBack=true;\n if (blockMovement[1][\"collisionType\"]==='player1') {\n player1.health=player1.health-0.5;\n }\n }\n\n }\n else {\n if (actionType!==\"CheckOnly\") {\n bandMember.lastDirChange=0;\n if (blockMovement[1][\"collisionType\"]==='Wall') {\n bandMember.lastDirection=bandMember.direction;\n bandMember.lastDirChangeReason='Wall';\n }\n else if (blockMovement[1][\"collisionType\"]==='Pit') {\n bandMember.lastDirection=bandMember.direction;\n bandMember.lastDirChangeReason='Pit';\n }\n }\n }\n }\n\n if ( (actionType!==\"CheckOnly\") && (!blockMovement[0]) && (blockMovement[1][\"collision\"]===true) ) {\n processPlayfieldInteractions(bandMember, blockMovement[1], blockMovement[1][\"collisionType\"]);\n }\n\n if ( (actionType!==\"CheckOnly\") && (bounceBack) ) {\n \n if (bandMember.direction==='S') newPosY = bandMember.posY - bandMember.currentSpeed*BOUNCEBACK_FACTOR;\n if (bandMember.direction==='N') newPosY = bandMember.posY + bandMember.currentSpeed*BOUNCEBACK_FACTOR;\n if (bandMember.direction==='E') newPosX = bandMember.posX - bandMember.currentSpeed*BOUNCEBACK_FACTOR;\n if (bandMember.direction==='W') newPosX = bandMember.posX + bandMember.currentSpeed*BOUNCEBACK_FACTOR;\n \n stepwiseCollisionXY[0]=currentPosX;\n stepwiseCollisionXY[1]=currentPosY;\n const blockMovement=checkCollisions(bandMember, currentPosX, currentPosY, newPosX, newPosY, stepwiseCollisionXY);\n }\n \n if (actionType!==\"CheckOnly\") {\n if (bandMember.direction==='N') bandMember.posY = stepwiseCollisionXY[1];\n if (bandMember.direction==='S') bandMember.posY = stepwiseCollisionXY[1];\n if (bandMember.direction==='W') bandMember.posX = stepwiseCollisionXY[0];\n if (bandMember.direction==='E') bandMember.posX = stepwiseCollisionXY[0];\n }\n\n if (actionType===\"CheckOnly\") {\n collisionResults.collision=blockMovement[1].collision;\n collisionResults.collisionType=blockMovement[1].collisionType;\n collisionResults.collisionDomRef=blockMovement[1].collisionDomRef;\n collisionResults.collisionDomObjType=blockMovement[1].collisionDomObjType;\n collisionResults.collisionDomObjType=blockMovement[1].collisionDomObjType;\n collisionResults.collisionGridCol=blockMovement[1].collisionGridCol;\n collisionResults.collisionGridRow=blockMovement[1].collisionGridRow;\n collisionResults.isAllowed=blockMovement[1].isAllowed;\n }\n\n\n\n}", "title": "" }, { "docid": "a016b95731e375333afd7248cc557992", "score": "0.5490246", "text": "function changeFriendPiece(posX, posY, friendPosX, friendPosY)\n {\n\n 'use strict';\n\n console.log(\"entry to the friend function\");\n\n golan[friendPosY][friendPosX][1]--;\n\n if(golan[posY][posX][2] == \"\")\n {\n console.log(\"entry to the first test group\");\n golan[posY][posX][2] = golan[friendPosY][friendPosX][2];\n\n for(var i = 0; i < allGroup.length; i++)\n {\n\n if(golan[friendPosY][friendPosX][2] == allGroup[i][0])\n {\n\n allGroup[i][allGroup[i].length] = posY + \"_\" + posX;\n\n }\n\n }\n\n }\n\n else if(golan[posY][posX][2] != golan[friendPosY][friendPosX][2])\n {\n\n for(var i = 0; i < allGroup.length; i++)\n {\n\n if(golan[friendPosY][friendPosX][2] == allGroup[i][0])\n {\n\n for(var j = 0; j < allGroup.length; j++)\n {\n\n if(golan[posY][posX][2] == allGroup[j][0])\n {\n\n for(var k = 1; k < allGroup[i].length; k++)\n {\n\n var X = parseInt((allGroup[i][k].split(\"_\"))[1]);\n\n var Y = parseInt((allGroup[i][k].split(\"_\"))[0]);\n\n allGroup[j][allGroup[j].length] = allGroup[i][k];\n\n golan[Y][X][2] = allGroup[j][0];\n\n }\n\n allGroup.splice(i, 1);\n\n } \n\n }\n }\n }\n\n }\n\n console.log(allGroup);\n\n }", "title": "" }, { "docid": "7924a7f8f4fef6be43907460e697d1ef", "score": "0.5488423", "text": "function stayInGroup(part, pt, gridpt) {\n // don't constrain top-level nodes\n var grp = part.containingGroup;\n if (grp === null) return pt;\n // try to stay within the background Shape of the Group\n var back = grp.resizeObject;\n if (back === null) return pt;\n // allow dragging a Node out of a Group if the Shift key is down\n if (part.diagram.lastInput.shift) return pt;\n var p1 = back.getDocumentPoint(go.Spot.TopLeft);\n var p2 = back.getDocumentPoint(go.Spot.BottomRight);\n var b = part.actualBounds;\n var loc = part.location;\n // find the padding inside the group's placeholder that is around the member parts\n // var m = grp.placeholder.padding;\n // now limit the location appropriately\n var x = Math.max(p1.x, Math.min(pt.x, p2.x - b.width - 1)) + (loc.x - b.x);\n var y = Math.max(p1.y, Math.min(pt.y, p2.y - b.height - 1)) + (loc.y - b.y);\n return new go.Point(x, y);\n}", "title": "" }, { "docid": "360f985b2d1108c8c0a06652157c2a43", "score": "0.5485571", "text": "function showGraves(group) {\n\tfor (let i = 0; i< group.length-1; i++) {\n\t\tlet j = group[i];\n\t\tj.visible = true;\n\t\tj.friction = random(0.5);\n\t\tj.position.y -= random(1,5);\n\t\t//j.immovable = true;\n\t\tif (j.position.y < 100) {\n\t\t\tj.remove();\n\t\t}\n\t\tlet shrink = map(j.position.y, 0,height,0.1,1);\n\t\tj.scale = shrink;\n\t\t//j.setSpeed(2,random(2,1));\n\t\tj.setCollider('circle',0,0,100);\n\t}\n\tgroup.bounce(group);\n\tmyMove(group);\n}", "title": "" }, { "docid": "794715bcb0aa1ae82961be497db7629f", "score": "0.5476985", "text": "function copyMaskedLayerAsGroup(lyr, mask) {\n var maskBounds = mask.mask.geometricBounds;\n var newMask, newGroup;\n if (!testBoundsIntersection(artboardBounds, maskBounds)) {\n return;\n }\n newGroup = doc.groupItems.add();\n newGroup.move(destGroup, ElementPlacement.PLACEATEND);\n forEach(mask.items, function(item) {\n copyPageItem(item, newGroup);\n });\n if (newGroup.pageItems.length > 0) {\n // newMask = duplicateItem(mask.mask, destGroup);\n // TODO: refactor\n newMask = mask.mask.duplicate(destGroup, ElementPlacement.PLACEATEND);\n newMask.moveToBeginning(newGroup);\n newGroup.clipped = true;\n } else {\n newGroup.remove();\n }\n }", "title": "" }, { "docid": "8e6dfd99bfb1381c207a436dbfaebb6f", "score": "0.5470085", "text": "function ballAdderAndRemover() {\n const ballsLength = balls.length\n const ballsCount = Math.abs(ballsLength - simulation.balls.count)\n if (ballsLength < simulation.balls.count) {\n for (let i = 0; i < ballsCount; i++) {\n balls.push(createBall())\n }\n }\n if (ballsLength > simulation.balls.count) {\n for (let i = 0; i < ballsCount; i++) {\n balls.pop()\n }\n }\n}", "title": "" }, { "docid": "1e707cfc664d90555a155e2217de5fd2", "score": "0.5464785", "text": "function moveTrees() {\n for (let i = 0; i < obstacles.length; i++) {\n //iterate though our obstacles array\n let meshGroup = obstacles[i].meshGroup; //create a local variable and assign our meshGroup of cones contained within the TreeObstacle to it\n\n //respawn\n if (meshGroup.position.z > camera.position.z) {\n //is the obsacle behind us\n obstacles[i].reset(); //call the reset function to move the obstacle and change its colour to green\n }\n }\n}", "title": "" }, { "docid": "48a3ba3f8d66bf2fb78ddc88f3d89c99", "score": "0.5424193", "text": "function try_to_move_to_available_from_unavailable(possible_group) {\n for (var i = 0; i < unavailable_groups.length; i++) {\n if (possible_group.name === unavailable_groups[i][0].name) {\n available_groups.push(unavailable_groups[i]);\n unavailable_groups.splice(i,1);\n return\n }\n }\n}", "title": "" }, { "docid": "030b85a153701809cd36a02c1d89d5b1", "score": "0.54211366", "text": "function move(xShift, yShift) {\n selection.forEach((obj) => {\n clickedTree.pop(obj);\n obj.x += xShift;\n obj.y += yShift;\n clickedTree.push(obj);\n });\n}", "title": "" }, { "docid": "9e09800079149fc5513b67b05bdb48af", "score": "0.5419049", "text": "_order() {\n // reorder the items in all groups\n // TODO: optimization: only reorder groups affected by the changed items\n util.forEach(this.groups, group => {\n group.order();\n });\n }", "title": "" }, { "docid": "ce5d9d23759f534a376d89a7030260fe", "score": "0.5411922", "text": "function mergeUp2(){\n\t$('#announce').html(\"Splitting into 4 groups of 2!\")\n\tfor (obj1 in randomArray1){\n\t$obj1 = $(\"#\"+randomArray1[obj1][2]);\n\tif (randomArray1[obj1][2] <=1){\n\t$obj1.animate({\n\ttop: 50, left: randomArray1[obj1][1]-50+50\n\t}, 1250)\n\t}\n\telse if (randomArray1[obj1][2] >=6){\n\t$obj1.animate({\n\ttop: 50, left: randomArray1[obj1][1]+50+50\n\t}, 1250)\n\t}\n\telse if ((randomArray1[obj1][2] ==2) || (randomArray1[obj1][2] ==3)){\n\t$obj1.animate({\n\ttop: 50, left: randomArray1[obj1][1]-20+50\n\t}, 1250)\n\t}\n\telse{\n\t$obj1.animate({\n\ttop: 50, left: randomArray1[obj1][1]+20+50\n\t}, 1250)\n\t}\n\t}\n\tsetTimeout('mergeSwap()', 1250)\n}", "title": "" }, { "docid": "0e15824fa124f17f9d37922b2c51e73b", "score": "0.5410124", "text": "function MoveGhosts()\n{\n for (var i = 0; i < ghostsArray.length; i++)\n {\n var ghost = ghostsArray[i];\n var originalI = ghost.i;\n var originalJ = ghost.j;\n var nextStep = BFS(ghost.i, ghost.j);\n if (nextStep == null) // Ghost caught Pacman\n continue;\n ghost.i = nextStep.i;\n ghost.j = nextStep.j;\n }\n}", "title": "" }, { "docid": "36f2bd2d4b55a8fee814044068bef371", "score": "0.54089135", "text": "function moveBullets() {\n // Go through all bullets\n var bullets = svgdoc.getElementById(\"bullets\");\n\tfor (var i = 0; i < bullets.childNodes.length; i++) {\n\t\tvar node = bullets.childNodes.item(i);\n\n\t\t// Update the position of the bullet\n\t\tvar x = parseInt(node.getAttribute(\"x\"));\n\t\t//node.setAttribute(\"x\", x + BULLET_SPEED);\n\t\tnode.setAttribute(\"x\",parseInt(node.getAttribute(\"x\")) + parseInt(node.getAttribute(\"speed\")));\n\t\t\n\t\t// If the bullet is not inside the screen delete it from the group\n\t\tif (x > SCREEN_SIZE.w || x<0) {\n\t\t\tbullets.removeChild(node);\n\t\t\ti--;\n\t\t}\n\t}\n\t\n\t//boss_bullet\n\tvar boss_bullets = svgdoc.getElementById(\"boss_bullets\");\n\tfor (var i = 0; i < boss_bullets.childNodes.length; i++) {\n\t\tvar node = boss_bullets.childNodes.item(i);\n\t\t\n\t\t// Update the position of the bullet\n\t\tvar x = parseInt(node.getAttribute(\"x\"));\n\t\t//node.setAttribute(\"x\", x + BULLET_SPEED);\n\t\tnode.setAttribute(\"x\",parseInt(node.getAttribute(\"x\")) + parseInt(node.getAttribute(\"speed\")));\n\t\t\n\t\t// If the bullet is not inside the screen delete it from the group\n\t\tif (x > SCREEN_SIZE.w || x<0) {\n\t\t\tboss_bullets.removeChild(node);\n\t\t\ti--;\n\t\t\tboss_bullet_num = 1;\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "93b1cbb5ed2bbe2a633d875376742bbd", "score": "0.5375418", "text": "function updateGroup(args, prop, item) {\n if (!item.isSwimlane || !item.isLane) {\n for (var i = 0; i < item.children; i++) {\n var child = item.children[i];\n if (typeof child === \"string\")\n child = diagram.findNode(child);\n this.updateItem(args, prop, child);\n }\n }\n}", "title": "" }, { "docid": "7f9c6dc773d3466c8a44476f07db3eca", "score": "0.53656906", "text": "collapse() {\n let i = 0;\n while (i < this.children_.length) {\n const child = this.children_[i];\n if (this.location().add(child, this)) {\n //this.children_.splice(i, 1);\n //this.location().remove(this);\n } else {\n i++;\n }\n }\n // note: possible it's already been removed?\n if (this.location()) this.location().remove(this);\n }", "title": "" }, { "docid": "c763603e0bb7718575c9e3dbb93b15e1", "score": "0.5329584", "text": "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift;}// All other shifts, applied to the smaller subtrees between w- and w+, are", "title": "" }, { "docid": "c763603e0bb7718575c9e3dbb93b15e1", "score": "0.5329584", "text": "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift;}// All other shifts, applied to the smaller subtrees between w- and w+, are", "title": "" }, { "docid": "c763603e0bb7718575c9e3dbb93b15e1", "score": "0.5329584", "text": "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift;}// All other shifts, applied to the smaller subtrees between w- and w+, are", "title": "" }, { "docid": "c763603e0bb7718575c9e3dbb93b15e1", "score": "0.5329584", "text": "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift;}// All other shifts, applied to the smaller subtrees between w- and w+, are", "title": "" }, { "docid": "a531b4a52eb1110881f4847a6f4f9805", "score": "0.5329013", "text": "function stayInGroup(part, pt, gridpt) {\n // don't constrain top-level nodes\n const grp = part.containingGroup;\n if (grp === null) return pt;\n // try to stay within the background Shape of the Group\n const back = grp.resizeObject;\n if (back === null) return pt;\n // allow dragging a Node out of a Group if the Shift key is down\n if (part.diagram.lastInput.shift) return pt;\n const p1 = back.getDocumentPoint(go.Spot.TopLeft);\n const p2 = back.getDocumentPoint(go.Spot.BottomRight);\n const b = part.actualBounds;\n const loc = part.location;\n // find the padding inside the group's placeholder that is around the member parts\n const m = grp.placeholder.padding;\n // now limit the location appropriately\n const x = Math.max(p1.x + m.left, Math.min(pt.x, p2.x - m.right - b.width - 1)) + (loc.x - b.x);\n const y = Math.max(p1.y + m.top, Math.min(pt.y, p2.y - m.bottom - b.height - 1)) + (loc.y - b.y);\n return new go.Point(x, y);\n }", "title": "" }, { "docid": "b8ce9be052392d325dc2b85ac03e269a", "score": "0.5327904", "text": "groupFollow(followArray, spline) {\n this.follow(spline);\n this.followingGroup = followArray;\n for (let fo in this.followingGroup) { //set all group object to the same spline\n this.followingGroup[fo].following = spline;\n }\n }", "title": "" }, { "docid": "00f130fb344875bd222b9e27c8656de1", "score": "0.5312218", "text": "function moveBiker(i) {\n\tcheck = true;\n\tbiker.stepSize = i;\n\t// use the move method of the global biker object\n\t\n\tif(biker.height <= 0 && biker.height >= -100){\n\t\tbiker.stepSize = -1;\n\t\tbiker.vertical(-(10*i));\n\t}\n\n}", "title": "" }, { "docid": "80f4fe704cf6971deb7f4ece0fcdf0d0", "score": "0.53076196", "text": "function makeMove() {\n\n function winOrBlock(player) {\n let mark = player === 'computer' ? computerMark : humanMark;\n let marksCount = 0;\n let emptySquare = '';\n\n function checkForTwo(comboItem) {\n if (squares[comboItem].innerHTML === mark) {\n marksCount += 1;\n }\n if (squares[comboItem].innerHTML === '') {\n emptySquare = comboItem;\n }\n }\n\n for (let i = 0; i < winningCombos.length; i++) {\n marksCount = 0;\n emptySquare = '';\n winningCombos[i].forEach(checkForTwo);\n\n if (marksCount === 2 && emptySquare !== '') {\n squares[emptySquare].innerHTML = computerMark;\n return true;\n } else {\n console.log('Cannot win or block');\n }\n }\n }\n\n function fork(player) {\n let mark = player === 'computer' ? computerMark : humanMark;\n let toCompare = [];\n let intersect = [];\n let move = [];\n\n function multiArrIntersection(arr) {\n let dupes = [];\n let results = arr.reduce((a, b) => {\n return a.concat(b.filter(element => {\n return a.indexOf(element) === -1 ? true : dupes.push(element);\n }));\n });\n return dupes;\n }\n\n function whatToCompare(combo) {\n let blankCount = 0;\n let computerMarkCount = 0;\n\n combo.forEach(item => {\n if (squares[item].innerHTML === '') blankCount++;\n if (squares[item].innerHTML === mark) computerMarkCount++;\n });\n\n if (blankCount === 2 && computerMarkCount === 1) toCompare.push(combo);\n }\n winningCombos.forEach(whatToCompare);\n console.log(toCompare);\n\n if (toCompare.length > 0) {\n intersect = multiArrIntersection(toCompare);\n\n move = intersect.filter(element => {\n return squares[element].innerHTML === '';\n });\n\n console.log(move);\n\n if (move.length === 1) {\n squares[move[0]].innerHTML = computerMark;\n console.log('made or blocked fork');\n return true;\n } else if (move.join('') === '08' || move.join('') === '62') {\n if (edges.every(el => squares[el].innerHTML === '')) {\n squares[edges[randomInt(0, 3)]].innerHTML = computerMark;\n console.log('fork denied');\n return true;\n }\n }\n }\n }\n\n function center() {\n if (squares[4].innerHTML === '') {\n squares[4].innerHTML = computerMark;\n return true;\n } else console.log('could not mark center');\n }\n\n function oppositeCorner() {\n if (squares[0].innerHTML === computerMark && squares[8].innerHTML === '') {\n squares[8].innerHTML = computerMark;\n return true;\n } else if (squares[2].innerHTML === computerMark && squares[6].innerHTML === '') {\n squares[6].innerHTML = computerMark;\n return true;\n } else if (squares[6].innerHTML === computerMark && squares[2].innerHTML === '') {\n squares[2].innerHTML = computerMark;\n return true;\n } else if (squares[8].innerHTML === computerMark && squares[0].innerHTML === '') {\n squares[0].innerHTML = computerMark;\n return true;\n } else console.log('could not mark corner');\n }\n\n function emptyCorner() {\n const empty = corners.filter(el => squares[el].innerHTML === '');\n const move = randomInt(0, empty.length - 1);\n\n if (empty.length > 0) {\n squares[empty[move]].innerHTML = computerMark;\n return true;\n }\n }\n\n function emptyEdge() {\n const empty = edges.filter(el => squares[el].innerHTML === '');\n const move = randomInt(0, empty.length - 1);\n\n if (empty.length > 0) {\n squares[empty[move]].innerHTML = computerMark;\n return true;\n }\n }\n\n // Control flow for the strategy list from wikipedia\n if (winOrBlock('computer')) {\n console.log('win success!');\n\n } else if (winOrBlock('human')) {\n console.log('block success');\n\n } else if (fork('computer')) {\n console.log('fork success');\n\n } else if (fork('human')) {\n console.log('fork block success');\n\n } else if (center()) {\n console.log('marked center');\n\n } else if (oppositeCorner()) {\n console.log('marked opposite corner');\n\n } else if (emptyCorner()) {\n console.log('marked empty corner');\n\n } else if (emptyEdge()) {\n console.log('marked empty edge');\n }\n }", "title": "" }, { "docid": "c721e625d6c6fdfc831dd25162ca457f", "score": "0.530688", "text": "function makeWallGroup() {\n var $ = go.GraphObject.make;\n return $(go.Group, \"Spot\",\n {\n contextMenu: makeContextMenu(),\n toolTip: makeGroupToolTip(),\n selectionObjectName: \"SHAPE\",\n rotateObjectName: \"SHAPE\",\n locationSpot: go.Spot.Center,\n reshapable: true,\n minSize: new go.Size(1, 1),\n dragComputation: snapWalls,\n selectionAdorned: false,\n mouseDrop: addWallPart,\n mouseDragEnter: wallPartDragOver,\n mouseDragLeave: wallPartDragAway,\n doubleClick: function (e) { if (e.diagram.floorplanUI) e.diagram.floorplanUI.hideShow(\"selectionInfoWindow\"); }\n },\n $(go.Shape,\n {\n name: \"SHAPE\",\n fill: \"black\",\n },\n new go.Binding(\"strokeWidth\", \"thickness\"),\n new go.Binding(\"stroke\", \"isSelected\", function (s, obj) {\n if (obj.part.containingGroup != null) {\n var group = obj.part.containingGroup;\n if (s) { group.data.isSelected = true; }\n }\n return s ? \"dodgerblue\" : \"black\";\n }).ofObject()\n ))\n}", "title": "" }, { "docid": "758e20f5b5f05469dafec3948db6c905", "score": "0.5293127", "text": "pickUp() {\n [...this.below].forEach(a => a.above.delete(this));\n this.below.clear();\n }", "title": "" }, { "docid": "0b067aa3cd7fee74072a46a17a6652e8", "score": "0.5291962", "text": "function deleteBricks(){\n\n bricks.forEach(function(brick, i){\n\n bricks.splice(i, 1);\n\n });\n\n\n}", "title": "" }, { "docid": "4ace96995cec328ca16bd6919267eb28", "score": "0.5291891", "text": "removeBrokenBrick() {\n\t\tthis.broken = false;\n\t\tlet { brokenBricks } = control.state;\n\t\tlet newArr = brokenBricks.filter(brick => brick.broken === true);\n\t\tcontrol.state.brokenBricks = newArr;\n\t}", "title": "" }, { "docid": "835ad116457340f912cdae7892029cff", "score": "0.52869713", "text": "blockShift(state, seq, cycle, group, shifts){\n // remove samples that cannot move yet\n const keep = shifts.map(s => s !== 0);\n group = group.filter((_, i) => keep[i]);\n shifts = shifts.filter((_, i) => keep[i]);\n if(!group.length)\n return; // empty block\n\n // direction of the block shift\n const dir = Math.sign(shifts[0]);\n\n // three options to test, in order:\n // 1) use hooks at doff=0\n // 2) use hooks at doff=dir\n // 3) use sliders at doff=0\n let roffset = 0;\n let usingSliders = true;\n\n // check availability of (1) or (2)\n doffLoop:\n for(const doff of [0, dir]){\n // check availabilty of hooks on other bed side\n for(let i = 0; i < group.length; ++i){\n const idx = group[i];\n const sn = cycle.needleOf(idx);\n const tn = sn.shiftedBy(doff).otherHook();\n if(!state.isEmpty(tn))\n continue doffLoop; // not available!\n }\n // available!\n roffset = doff;\n usingSliders = false;\n break;\n }\n\n // actually do the block move with the best configuration\n initRack: {\n const sn0 = cycle.needleOf(group[0]);\n const tn0 = sn0.shiftedBy(roffset).otherHook();\n const racking = sn0.rackingTo(tn0);\n if(state.racking !== racking)\n state.rack(racking);\n }\n // initial transfer\n const moves = new Map();\n for(let i = 0; i < group.length; ++i){\n // register shift in same-shift group\n const sn = cycle.needleOf(group[i]);\n const rn = sn.shiftedBy(roffset);\n const tn = usingSliders ? rn.otherSlider() : rn.otherHook();\n const shift = shifts[i];\n if(moves.has(shift))\n moves.get(shift).push([sn, tn, group[i]]);\n else\n moves.set(shift, [[sn, tn, group[i]]]);\n\n // do initial transfer (same racking for all)\n seq.addTransfer(sn, tn);\n state.xfer(sn, tn);\n }\n // by group transfer to destination\n for(const [shift, xfers] of moves){\n const [sn0, tn0] = xfers[0];\n const fn0 = sn0.shiftedBy(shift);\n const racking = tn0.rackingTo(fn0);\n if(state.racking !== racking)\n state.rack(racking);\n \n for(const [sn, tn, idx] of xfers){\n const fn = sn.shiftedBy(shift);\n seq.addTransfer(tn, fn);\n state.xfer(tn, fn);\n\n // update cycle information\n cycle.needles[idx] = fn;\n }\n }\n state.rack(0); // reset racking\n }", "title": "" }, { "docid": "816de7f7fb1ff79c6af3e296fdb3c3b7", "score": "0.52659947", "text": "groupUndo(val) {\n this.undoBuffer.grouping = val;\n this.storeUndo.grouping = val;\n }", "title": "" }, { "docid": "d747f12a68095624f417ba2bba2bd78c", "score": "0.52657396", "text": "function splitTheBill(group) {\n // implement the method and return a hash\n var sum = 0;\n Object.keys(group).forEach(function (beatle) {\n sum = sum + group[beatle];\n });\n var par = sum / Object.keys(group).length;\n Object.keys(group).forEach(function (beatle) {\n var result = par - (group[beatle]);\n if (Math.sign(result) === -1) {\n group[beatle] = Math.abs(result);\n } else {\n group[beatle] = -Math.abs(result);\n }\n });\n return group;\n}", "title": "" }, { "docid": "8eca41033042fe6abe3919062c17d865", "score": "0.5264025", "text": "function moveSnake() {\n if (!playerLost){\n const oldBox = snakePosition[0].split(\"-\");\n const arr = snakePosition[snakePosition.length-1].split(\"-\");\n expandSnake(arr,2, oldBox);\n\n const removeBox = snakePosition.splice(0,1);\n document.getElementById(removeBox[0]).className = '';\n }\n }", "title": "" }, { "docid": "11c6d706a5313ad798e9462cf1da4763", "score": "0.5262016", "text": "function moveSubtree(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t }", "title": "" }, { "docid": "11c6d706a5313ad798e9462cf1da4763", "score": "0.5262016", "text": "function moveSubtree(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t }", "title": "" }, { "docid": "9c4ff6b516371491166c5dd9da30aeff", "score": "0.5254383", "text": "restackLayers(){\n\t\tthis.layers.forEach((bringToTop) => {\n\t\t\tbringToTop();\n\t\t});\n\n\t\tthis.top.forEach((bringToTop) => {\n\t\t\tbringToTop();\n\t\t});\n\t}", "title": "" }, { "docid": "209e3ae5763c2931606d78bcdfcbfb49", "score": "0.5252829", "text": "turn() {\n if (this.activeEls.length < 2) {\n this.setChanged(false);\n return;\n }\n\n this.startTurn();\n\n this.removeActiveElsFromGrid();\n\n this.addPreviousPositions();\n\n this.shiftElsDown();\n\n this.createNewEls();\n\n this.finishTurn();\n }", "title": "" }, { "docid": "dbd9fb9446d7e12bf7972bc21af0a750", "score": "0.52451235", "text": "function reGroup (clusters) {\n let [i, j, d] = findMin(clusters)\n let cluster1 = clusters[i]\n let cluster2 = clusters[j]\n let parent\n if (d === 0 && (cluster1.parent || cluster2.parent)) {\n if (cluster1.parent) {\n cluster1.parent.addChild(cluster2)\n parent = cluster1.parent\n } else {\n cluster2.parent.addChild(cluster1)\n parent = cluster2.parent\n }\n } else {\n // Create a new cluster\n parent = new Cluster(null, d / 2)\n parent.addChild(cluster1)\n parent.addChild(cluster2)\n }\n // Remove clusters\n clusters.splice(clusters.indexOf(cluster1), 1)\n clusters.splice(clusters.indexOf(cluster2), 1)\n // Insert the new cluster\n clusters.push(parent)\n if (clusters.length === 1) {\n return clusters[0]\n } else {\n return reGroup(clusters)\n }\n}", "title": "" }, { "docid": "daacfbc9900c6c5a0881c4b9829d4a98", "score": "0.5238848", "text": "moveBackBicycle() {\n\n }", "title": "" }, { "docid": "2d75d165054ac7310d741b0c76eef402", "score": "0.52363366", "text": "function moveGhosts() {\n for (var i = 0; i < gGhosts.length; i++) {\n moveGhost(gGhosts[i]);\n }\n}", "title": "" }, { "docid": "c6464cbfbbf3b609ae2a5b171ff5c81b", "score": "0.5235746", "text": "function removeBombs() {\n if (bombList.length > 0 && bombList[0].y > 500) {\n bombList.shift();\n }\n }", "title": "" }, { "docid": "ce6a18a530098dc136845471eaa38161", "score": "0.5227452", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }", "title": "" }, { "docid": "ce6a18a530098dc136845471eaa38161", "score": "0.5227452", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }", "title": "" }, { "docid": "ce6a18a530098dc136845471eaa38161", "score": "0.5227452", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }", "title": "" }, { "docid": "ce6a18a530098dc136845471eaa38161", "score": "0.5227452", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }", "title": "" }, { "docid": "c2604da0487e10603a68c848a58b1ff9", "score": "0.5226571", "text": "function BillboardGroup(drawHelper, billboardOptions) {\n this._drawHelper = drawHelper;\n this._viewer = drawHelper._viewer;\n this._scene = drawHelper._scene;\n this._camera = drawHelper._camera;\n\n if (billboardOptions != undefined)\n this._options = Util.copyOptions(billboardOptions, defaultBillboard);\n else\n this._options = defaultBillboard;\n\n // create one common billboard collection for all billboards\n var b = new Cesium.BillboardCollection();\n this._scene.primitives.add(b);\n this._billboards = b;\n // keep an ordered list of billboards\n this._orderedBillboards = [];\n }", "title": "" }, { "docid": "47aa88e436823dee33fd8bdef693a9cc", "score": "0.5225018", "text": "function moveBox(k){\n\tvar id = k;\n\t//gameover condition\n\tif((players[id].bottomMostX == 1 || players[id].bottomMostX == 0) && checkOccupiedBlock(id) == true){\n\t gameOver(id,false);\n\t \n }else if(players[id].bottomMostX == gridHeight-1 || (checkOccupiedBlock(id)) == true){\n\t\t\tif(players[k].swipedDown == true)\tdropButtonReleased(k);\n\t\t\tif(players[k].isAI == true) {\n\t\t\t\tif(players[k].level>=4)\n\t\t\t\t\tdropButtonReleased(k);\n\t\t\t}\n\t\t\tselectNextPiece(id);\n\t\t\teraseNextShape(id);\n\t\t\t\n\t\t\trandomBlockGenerator(id);\n\t\t\tcheckRowCompletion(id);\n\t\t\t\n\t\t\tmoveShapeToInitialPos(id);\n\t\t\tmoveNextShapeToInitialPos(id);\n\t\t\tcolorNextShape(id);\n\t\t\t\n\t\t\t//calling AI\n\t\t\tif(players[k].isAI == true){\n\t\t\t\tcallAI(id);\n\t\t\t\tif(players[k].bestX != null && players[k].bestY != null) makeAImoves(id);\n\t\t\t}\n\t\t}else if(checkOccupiedBlock(id) == false){\n\t\t\t\t makeBlockUnoccupied(id);\n\t\t\t\t eraseShape(id);\n\t\t\t\t moveShapeDown(id);\n\t\t\t\t makeBlockOccupied(id);\n\t\t\t\t colorTheShape(id);\n\t\t\t}\n\treturn true;\n }", "title": "" }, { "docid": "8b485f3fe4c35719a13e6ff3fca93c6a", "score": "0.5224234", "text": "function moveToBlank(blockSelector) {\n //save old values\n var blockX = parseInt(blockSelector.attr('id')[0]); //first number in block\n var blockY = parseInt(blockSelector.attr('id')[2]); //last number in block\n var blankX = parseInt(board.blank.posX); //first number in blank\n var blankY = parseInt(board.blank.posY); //last number in blank\n //if possible: blank is touching piece\n\n //test if in left or right of blank\n if( ((blockX===(blankX-1)) && (blockY===blankY)) || //left of blank\n ((blockX===(blankX+1)) && (blockY===blankY)) || //right of blank\n ((blockY===(blankY-1)) && (blockX===blankX)) || //above of blank\n ((blockY===(blankY+1)) && (blockX===blankX)) //below of blank\n )\n { \n // save a temp of the block\n var tempB = board.blocks[blockX+'_'+blockY];\n //var myTempBlock = new block(tempB.posX,tempB.posY,tempB.color);\n board.blocks['temp'] = new block(tempB.posX,tempB.posY,tempB.color);\n\n\n //move piece\n moveBlockTo(blockX+'_'+blockY,blankX,blankY); \n //\n board.blocks[blankX+'_'+blankY] = board.blocks['temp']; \n \n //move blank\n moveBlank(blockX,blockY).done(\n //checks if the game is won and presents alert after animation finishes \n function() { \n if (gameWon(myGoalBoard,board))\n alert(\"YOU WIN!!!\\nClick \\\"Restart Game\\\" to play again\"); \n }\n );\n \n //\n board.blocks[blockX+'_'+blockY] = board.blank; \n \n } \n}", "title": "" }, { "docid": "1a2c1f20e3ce4e9e2e2fabc243bb96b8", "score": "0.5216971", "text": "function addJsplumbGroup(cartridgeCounter) {\n\n var div = $('<div>').attr({'id':cartridgeCounter+'-group','data-type':'group','data-ctype':''})\n .addClass('input-false')\n .addClass('stepnode')\n .attr('data-toggle', 'tooltip')\n .attr('title','Group')\n .appendTo('#whiteboard');\n $(div).append('<span>Group</span>');\n $(div).append('<div class=\"notification\"><i class=\"fa fa-exclamation-circle fa-2x\"></i></div>');\n jsPlumb.addEndpoint($(div), {\n anchor:\"BottomCenter\"\n }, bottomConnectorOptions);\n\n jsPlumb.addEndpoint($(div), {\n anchor: \"TopCenter\"\n }, groupOptions);\n DragEl($(div));\n Repaint();\n}", "title": "" }, { "docid": "ab89190642e4e87d9e2f13cbaa9b4503", "score": "0.5199758", "text": "function replaceGroup(target, replacement) {\n\n for(let y = 0; y < flatHeight; y++) {\n for(let x = 0; x < flatWidth; x++) {\n \n if(flatMap[y][x].group == target) flatMap[y][x].group = replacement;\n }\n }\n }", "title": "" }, { "docid": "99f2243b902f332aa8f0f72ad2c05ecf", "score": "0.5196685", "text": "function newLevel() {\n bottomBrick = 0;\n if(levels.length < 1) {\n levels.push(randLevel());\n }\n var level = levels[0];\n for (var c = 0; c < level.length; c++) {\n for (var r = 0; r < level[c].length; r++) {\n if (level[c][r] === 1) {\n var newBrickX = r*Brick.prototype.width;\n var newBrickY = c*Brick.prototype.height + yOffset;\n var newBrick = new Brick(newBrickX,newBrickY);\n bricks.push(newBrick);\n if(newBrick.y+newBrick.height > bottomBrick) bottomBrick = newBrick.y+ newBrick.height;\n }\n } //end for\n }//end for\n //move balls\n for (c = 0, r = balls.length; c < r; c++) {\n balls.splice(0,1);\n addBall();\n }\n}", "title": "" }, { "docid": "6bac439255c577e6880a61aed57d6096", "score": "0.51958156", "text": "function moveSubtree(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t}", "title": "" }, { "docid": "6bac439255c577e6880a61aed57d6096", "score": "0.51958156", "text": "function moveSubtree(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t}", "title": "" }, { "docid": "6bac439255c577e6880a61aed57d6096", "score": "0.51958156", "text": "function moveSubtree(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t}", "title": "" }, { "docid": "18aef176a637755363aaac694770043b", "score": "0.5188156", "text": "tick() {\n for (const bird of this.birds) {\n bird.tick();\n }\n\n for (let i = this.walls.length - 1; i >= 0; i--) {\n const wall = this.walls[i];\n if (wall.x + wall.width < 0) {\n this.walls.splice(i, 1);\n }\n }\n\n for (const wall of this.walls) {\n wall.tick();\n }\n\n for (const bird of this.birds) {\n bird.collideWithWalls();\n }\n\n this.timeToNewWall -= World.speed;\n this.distance += World.speed;\n\n if (this.timeToNewWall <= 0) {\n this.walls.push(new Wall());\n this.timeToNewWall = World.newWallCooldown;\n }\n }", "title": "" }, { "docid": "7d99aa4b8ef9549f1ae061e8ef2eb0db", "score": "0.5187743", "text": "function groupBBFix(selected) {\n\tif(svgedit.browser.supportsHVLineContainerBBox()) {\n\t\ttry { return selected.getBBox();} catch(e){}\n\t}\n\tvar ref = $.data(selected, 'ref');\n\tvar matched = null;\n\tvar ret;\n\n\tif(ref) {\n\t\tvar copy = $(ref).children().clone().attr('visibility', 'hidden');\n\t\t$(svgroot_).append(copy);\n\t\tmatched = copy.filter('line, path');\n\t} else {\n\t\tmatched = $(selected).find('line, path');\n\t}\n\n\tvar issue = false;\n\tif(matched.length) {\n\t\tmatched.each(function() {\n\t\t\tvar bb = this.getBBox();\n\t\t\tif(!bb.width || !bb.height) {\n\t\t\t\tissue = true;\n\t\t\t}\n\t\t});\n\t\tif(issue) {\n\t\t\tvar elems = ref ? copy : $(selected).children();\n\t\t\tret = getStrokedBBox(elems);\n\t\t} else {\n\t\t\tret = selected.getBBox();\n\t\t}\n\t} else {\n\t\tret = selected.getBBox();\n\t}\n\tif(ref) {\n\t\tcopy.remove();\n\t}\n\treturn ret;\n}", "title": "" }, { "docid": "c5e491616630d7336649bce05fe18998", "score": "0.5184864", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n }", "title": "" }, { "docid": "be42aa3be1e3abf9722c1c3fde037500", "score": "0.5184605", "text": "function pairBrick(parent_class,unit) {\n fillBrick(parent_class,unit);\n showNextInstructions(parent_class,unit);\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" }, { "docid": "bcb5f7ab9e9bea713d12c392bdc0f0fa", "score": "0.51820266", "text": "function moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}", "title": "" } ]
02fe21c422851dde86883af85d423e73
Draw an array of rendering instructions into a 2D canvas drawing context.
[ { "docid": "fe2a0f5b963d4cca7622c4e813c72fce", "score": "0.0", "text": "function draw(ctx, items) {\n items.sort(compareElements).forEach(drawItem(ctx));\n}", "title": "" } ]
[ { "docid": "1c74d992b8dbbf07d0e246df1cdfe23a", "score": "0.66103", "text": "function render() {\n util_1.Utils.Write2Canvas(context, imageBuffer, nx, ny);\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "720c2f3bfbd40f9952c7075cbc0a73bb", "score": "0.63744324", "text": "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "title": "" }, { "docid": "95b503ac852f7f076c1d9cc15e8ca039", "score": "0.63579315", "text": "function renderAll() {\n // clear the canvas\n ctx1.clearRect(0,0,canvas1.width,canvas1.height);\n // draw the image\n drawWithColor(ctx1,changeColor,img1);\n changeStateToNormal(ctx1);\n\n // draw Symbol(s)\n for (var i=0;i<images.length;i++) {\n var r=images[i];\n ctx1.drawImage(r.image,r.x,r.y,r.width,r.height);\n\n getImageData(r.x, r.y, r.width, r.height);\n // optionally draw the draggable anchors\n drawDragAnchor(imageX,imageY);\n drawDragAnchor(imageRight,imageY);\n drawDragAnchor(imageRight,imageBottom);\n drawDragAnchor(imageX,imageBottom);\n // optionally draw the connecting anchor lines\n ctx1.beginPath();\n ctx1.moveTo(imageX,imageY);\n ctx1.lineTo(imageRight,imageY);\n ctx1.lineTo(imageRight,imageBottom);\n ctx1.lineTo(imageX,imageBottom);\n ctx1.closePath();\n ctx1.stroke();\n\n }\n}", "title": "" }, { "docid": "3a7b668311a5272fd4549f5ffd0d97a3", "score": "0.6207691", "text": "function opDraw() {\n\n var n = op & 0x000F;\n var coordx = (op & 0x0F00) >> 8;\n var coordy = (op & 0x00F0) >> 4;\n var y = coordy;\n\n for (var i = 0; i < n; i++) {\n var s = mem[I + i];\n\n for (var x = 0; x < 8; x++) {\n\n pixel = (s >> x) & 0x1;\n var tx = (coordx + x) % SCREEN_WIDTH;\n var ty = (coordy + y) % SCREEN_HEIGHT;\n\n if (pixel ^ graphics[tx][ty] === 1)\n v[0xF] = 1;\n else\n v[0xF] = 0;\n\n graphics[tx][ty] ^= pixel;\n }\n\n y++;\n }\n\n pc +=2;\n }", "title": "" }, { "docid": "75d262ef08e81046ca393622bc384a8e", "score": "0.6184223", "text": "draw(Canvas) { \n this.renderCommands.forEach((cmd) => cmd(Canvas))\n }", "title": "" }, { "docid": "72a67e76911f38665d8881e23eb69df5", "score": "0.6182353", "text": "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n}", "title": "" }, { "docid": "cf926ab9bfe8fa6705e315a49f7f674e", "score": "0.61555845", "text": "draw(context){\n\t\tthis._sprite.draw(context, [this._coord[0]*this._size, this._coord[1]*this._size]);\n\t}", "title": "" }, { "docid": "671224e7bac4e44b0cb6225bb41bbea3", "score": "0.613858", "text": "function render() {\n var r,\n c;\n \n for (r = 0; r < rows; r += 1) {\n for (c = 0; c < cols; c += 1) {\n tiles[r][c].draw(context);\n }\n }\n }", "title": "" }, { "docid": "c304a931827fa10a0f515dff6b074e26", "score": "0.6129697", "text": "function render() {\n context.clearRect(0, 0, size.x, size.y);\n shapes.forEach(s => s.draw(context));\n}", "title": "" }, { "docid": "724d1c6ea50e119e3ec19d9572412b34", "score": "0.6128726", "text": "draw() {\n this._ctx.fillStyle = \"white\";\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n this.map((c) => this._drawCell(c));\n if (this._showGrid) {\n this._drawAxes();\n }\n }", "title": "" }, { "docid": "6092a340ca6aecc795e9f90222262b9f", "score": "0.61279756", "text": "function drawThings () {\r\n\tsquares.forEach(function (square) {\r\n\t\tsquare.draw();\r\n\t})\r\n\tplatform.draw();\r\n\tdrawText();\r\n}", "title": "" }, { "docid": "3bddf3e224ffef08222256079ad7c9d6", "score": "0.6118833", "text": "function drawCanvas() {\r\n if(drawIo.selectElement) {\r\n drawIo.selectElement.render();\r\n }\r\n\r\n for(var i = 0; i < drawIo.shapes.length; i++) {\r\n drawIo.shapes[i].render();\r\n }\r\n }", "title": "" }, { "docid": "6f5c6783306904eef8331e0576d0bb0c", "score": "0.5991182", "text": "function render() {\n var start_time = Date.now();\n for (var t = 0; t < canvas.width; t++)\n for (var r = 0; r < canvas.height; r++)\n renderPoint(t, r);\n context.putImageData(image_buffer, 0, 0);\n var end_time = Date.now();\n $(\"#log\").html(\"Rendered in: \" + (end_time - start_time) + \"ms\"), console.log(\"Rendered in: \" + (end_time - start_time) + \"ms\")\n}", "title": "" }, { "docid": "772a5c6f7f53c496bd57b5204c7d067a", "score": "0.5984626", "text": "function drawCanvas() {\r\n\t\tclearCanvas();\r\n\t\tgetTiles(function(vSlot, hSlot) {\r\n\t\t\tdrawTile(vSlot, hSlot);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "ee1ab20e5d17101a7f42aafc2c4a8b97", "score": "0.5976412", "text": "function draw() {\n if (!listening) {\n return;\n }\n \n canvasCtx.fillStyle = 'rgb(249,250,252)';\n canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n canvasCtx.lineWidth = 1;\n canvasCtx.strokeStyle = 'rgb(0,125,188)';\n canvasCtx.beginPath();\n \n var sliceWidth = WIDTH * 1.0 / bufferLength;\n var x = 0;\n \n for (var i = 0; i < bufferLength; i++) {\n var v = dataArray[i] / 128.0;\n var y = v * HEIGHT / 2;\n if (i === 0) {\n canvasCtx.moveTo(x, y);\n } else {\n canvasCtx.lineTo(x, y);\n }\n x += sliceWidth;\n }\n \n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n }", "title": "" }, { "docid": "e13f3440618e4e7dd3ed36b3131b1189", "score": "0.59756315", "text": "function draw() {\r\n context.clearRect(0,0,canvas.width,canvas.height);\r\n theBeacons.forEach(beacon => beacon.draw(context) );\r\n theBoids.forEach(boid => boid.draw(context) );\r\n thePredators.forEach(predator => predator.draw(context) );\r\n theTeleporters.forEach(teleporter => teleporter.draw(context) );\r\n }", "title": "" }, { "docid": "240b56235f213c135d4069cd549c50d9", "score": "0.59338325", "text": "function draw() {\n\t\tswitch (modes[mode]) {\n\t\tcase 'hue-sat':\n\t\t\tdrawColourWheel();\n\t\t\tbreak;\n\n\t\tcase 'bri':\n\t\t\tdrawBrightnessSlider();\n\t\t\tbreak;\n\t\t}\n\t\trenderBuffer();\n\t}", "title": "" }, { "docid": "b2989ed7b40943797e718cf4fe030961", "score": "0.5927688", "text": "function render () {\n index = (index + 1) % 2\n nextIndex = (index + 1) % 2\n \n gl.viewport(0, 0, glCanvas.clientWidth, glCanvas.clientHeight)\n gl.clearColor(0, 0, 0, 1)\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)\n\n gl.useProgram(p)\n gl.disable(gl.DEPTH_TEST)\n gl.bindBuffer(gl.ARRAY_BUFFER, b)\n gl.enableVertexAttribArray(locations.position)\n gl.vertexAttribPointer(locations.position, 2, gl.FLOAT, gl.FALSE, 0, 0)\n gl.drawArrays(gl.TRIANGLES, 0, 3)\n gl.bindBuffer(gl.ARRAY_BUFFER, null)\n gl.useProgram(null)\n\n // copy index buffer to PBO, read pixels to CPU from nextIndex PBO\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pbos[index])\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, pixels)\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pbos[nextIndex])\n gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, 0)\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null)\n\n requestAnimationFrame(render)\n}", "title": "" }, { "docid": "f8e2bd2859b8d81e037082eccb2eb912", "score": "0.59116143", "text": "function render() {\n gl.clear(gl.COLOR_BUFFER_BIT);\n viewLength = Math.floor(canvas.width / VIEWPORT_SQUARES);\n viewHeight = Math.floor(canvas.height / VIEWPORT_SQUARES);\n var tileNumber = 0;\n for (var i = 0; i < VIEWPORT_SQUARES; i++) {\n for (var j = 0; j < VIEWPORT_SQUARES; j++) {\n var x = viewLength * j;\n var y = viewHeight * i;\n\n gl.viewport(x, y, viewLength, viewHeight);\n drawTile(tileNumber);\n tileNumber++;\n }\n }\n requestAnimationFrame(render);\n}", "title": "" }, { "docid": "0248b1705ab36a4db04633f9865e30d0", "score": "0.58980197", "text": "function draw () {\n const positions = [1, 1,-1, 1,-1, -1, 1, 1,-1, -1, 1, -1];\n gl.activeTexture(gl.TEXTURE0);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, WIDTH, HEIGHT, 0, gl.ALPHA, gl.UNSIGNED_BYTE, _images[0].data);\n\n gl.drawArrays(gl.TRIANGLES, 0, 6); // 6 = positions length\n }", "title": "" }, { "docid": "93bd790fde3daf92742b37833b9f2cd1", "score": "0.5897632", "text": "function render() {\n ctx.clearRect(0,0,width,height);\n for(var i in points) {\n if (points[i].color == light) {\n drawLines(points[i]);\n drawTransit(points[i]);\n points[i].circle.draw();\n }\n }\n for(var i in points) {\n if (points[i].color == dark) {\n drawLines(points[i]);\n drawTransit(points[i]);\n points[i].circle.draw();\n }\n }\n requestAnimationFrame(render);\n }", "title": "" }, { "docid": "410850c1a25954628247dfc2dcd015d3", "score": "0.5881146", "text": "function drawTruchet1() {\n var pointer;\n for (i = 0; i < 2; i++) {\n pointer = CIRCLE_RESOLUTION * i;\n gl.drawArrays(gl.LINE_STRIP, pointer + 1, CIRCLE_RESOLUTION);\n }\n}", "title": "" }, { "docid": "b3df836feed571e2e6411bad572b3cbe", "score": "0.5879919", "text": "renderLine(pos1, pos2, color=\"#000000\") {\n // this.ctx.clearRect(0, 0, this.width, this.height);\n // this.renderBoard();\n let x1 = pos1[0];\n let y1 = pos1[1];\n let canvasCoords1 = this.arrayToCanvas([x1, y1]);\n canvasCoords1[0] += this.squareWidth/2;\n canvasCoords1[1] += this.squareHeight/2;\n\n let x2 = pos2[0];\n let y2 = pos2[1];\n let canvasCoords2 = this.arrayToCanvas([x2, y2]);\n canvasCoords2[0] += this.squareWidth/2;\n canvasCoords2[1] += this.squareHeight/2;\n this.ctx.fillStyle = color;\n this.ctx.lineWidth = 3.5;\n this.ctx.beginPath();\n this.ctx.arc(canvasCoords1[0], canvasCoords1[1], 5, 0, 2 * Math.PI);\n \n this.ctx.moveTo(canvasCoords1[0], canvasCoords1[1]);\n this.ctx.lineTo(canvasCoords2[0], canvasCoords2[1]);\n this.ctx.arc(canvasCoords2[0], canvasCoords2[1], 5, 0, 2 * Math.PI);\n \n this.ctx.fill();\n this.ctx.strokeStyle = color;\n this.ctx.stroke();\n // this.ctx.fill();\n }", "title": "" }, { "docid": "8d9d809e729c86d37c917ec3fdf26172", "score": "0.5848724", "text": "function drawAll() {\n if (!serverDrawn) {\n drawToCtx(serverCtx, serverData);\n serverDrawn = true;\n }\n if (!publicDrawn) {\n drawToCtxRealtime(ctx, publicData);\n publicDrawn = true;\n }\n if (!permDrawn) {\n drawToCtx(permCtx, permData);\n permDrawn = true;\n }\n if (!cursorDrawn) {\n drawCursors();\n cursorDrawn = true;\n }\n}", "title": "" }, { "docid": "c10c19a6b098494885574c429db79fbf", "score": "0.58484375", "text": "function rendercanvas() {\n ctx.fillStyle = \"#F0F8FF\";\n ctx.fillRect(0, 0, 500, 500);\n}", "title": "" }, { "docid": "95b8a7fbd1af1cb63878dcddd5371205", "score": "0.58452284", "text": "function drawTruchet2() {\n var pointer;\n for (i = 0; i < 2; i++) {\n pointer = truchet1.length + CIRCLE_RESOLUTION * i;\n gl.drawArrays(gl.LINE_STRIP, pointer + 1, CIRCLE_RESOLUTION);\n }\n}", "title": "" }, { "docid": "ae7d12997035f71daf5b9dc6ce7690f0", "score": "0.5838077", "text": "function draw()\n{\n context.clearRect(0,0,canvas.width,canvas.height);\n if(img!=null)\n\tcontext.drawImage(img,0,0,canvas.width,canvas.height);\n for(var i=0;i<drawList.length;i++)\n {\n\tvar r = drawList[i];\n\tr.draw(context);\n }\n}", "title": "" }, { "docid": "cd34f3c8fc8ab05b91f30ed94785c1c6", "score": "0.5836609", "text": "draw2DArray(grid) {\n\t\tfor (let i = 0; i < grid.length; i++)\n\t\t\tfor (let j = 0; j < grid.length; j++)\n\t\t\t\tWorldOfPixels.world.setPixel(this.x + j, this.y + i, grid[i][j])\n\t}", "title": "" }, { "docid": "2be7825a2da48f4484ed05934a85da86", "score": "0.583417", "text": "function draw() {\n console.log('Draw Output Lines');\n console.log(lines);\n\n // console.log('Flatten Output Structure');\n // console.log(flattenLineTree(lines, true));\n\n flattenLineTree(lines, true).forEach(path => {\n context.beginPath();\n path.forEach(p => context.lineTo(p[0], p[1]));\n context.stroke();\n });\n }", "title": "" }, { "docid": "ad6d83d38ef38936d535f82f850d9da5", "score": "0.58158493", "text": "function drawCanvas() {\n if(drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n\n for (var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n }", "title": "" }, { "docid": "49c94ab145423b3fba34f5f365acd86a", "score": "0.58080804", "text": "function draw() {\n\n requestAnimationFrame(draw);\n\n analyser.getByteTimeDomainData(dataArray);\n\n canvasCtx.clearRect(0, 0, canvas.width, canvas.height);\n\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = \"rgb(0, 255, 0)\";\n\n canvasCtx.beginPath();\n\n var sliceWidth = canvas.width * 1.0 / bufferLength;\n var x = 0;\n\n for (var i = 0; i < bufferLength; i++) {\n var v = dataArray[i] / 64;\n var y = v * canvas.height / 4;\n \n if (i === 0) {\n canvasCtx.moveTo(x, y);\n } else {\n canvasCtx.lineTo(x, y);\n }\n\n x += sliceWidth;\n }\n\n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n }", "title": "" }, { "docid": "25efaa518f1e31615aa40ac4324c744b", "score": "0.57953644", "text": "function render({canvas: c, context: ctx}){\n var time = (new Date()).getTime();\n var x = Math.floor(c.width / 2);\n var y = Math.floor(c.height / 2);\n\n out(\"t1\", \"x: \" + x + \", y: \" + y);\n ctx.fillStyle = \"#000000\";\n ctx.strokeStyle = \"#000000\";\n\n //ctx.strokeRect(0, 0, c.width, c.height);\n ctx.strokeRect(8, 8, c.width - 8, c.height - 8);\n\n angle = 2 * Math.PI / 32;\n ctx.rotate(angle);\n xTrans = x - (Math.cos(angle) * x);\n out(\"t2\", \"xTrans = \" + xTrans);\n yTrans = -Math.sin(angle) * x;\n out(\"t3\", \"yTrans = \" + yTrans);\n ctx.translate(xTrans, yTrans);\n}", "title": "" }, { "docid": "1c6df1775a6a53526ebaefaf836e8974", "score": "0.5790279", "text": "showTiles() {\n this.ctx.strokeStyle = \"#FFFFFF\";\n for (let i = 0; i < this.values.length; i++) {\n this.ctx.strokeRect(this.values[i], 345, 32, 32);\n this.sprites[this.tiles[i]].draw(this.ctx, this.values[i], 345);\n }\n this.ctx.strokeRect(550, 340, 80, 45);\n this.ctx.fillStyle = \"#FFFFFF\";\n this.ctx.fillRect(550, 340, 80, 45);\n this.ctx.fillStyle = \"#000\";\n this.ctx.font = \"20px arcadeclassic\";\n this.ctx.fillText(\"ERASE\", 560, 365);\n this.ctx.fillStyle = \"#FFFFFF\";\n this.ctx.fillText(\"SPACE: select tiles\", 20, 410);\n this.ctx.fillText(\"Draw tiles by click\", 300, 410);\n this.ctx.fillText(\"ESCAPE: To s ave map\", 20, 430);\n this.ctx.fillText(\"Click on Erase to clear \", 300, 430);\n this.ctx.fillText(\n \"Note: You have to erase your level to play original level \",\n 40,\n 460\n );\n this.ctx.fillStyle = \"#000\";\n }", "title": "" }, { "docid": "0a3f853770d1daeb4be7d8baa6dd37c1", "score": "0.57786334", "text": "function draw() {\n\n drawVisual = requestAnimationFrame(draw);\n\n analyser.getByteTimeDomainData(dataArray);\n\n canvasCtx.fillStyle = 'rgb(200, 200, 200)';\n canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = 'rgb(0, 0, 0)';\n\n canvasCtx.beginPath();\n\n var sliceWidth = WIDTH * 1.0 / bufferLength;\n var x = 0;\n\n for (var i = 0; i < bufferLength; i++) {\n\n var v = dataArray[i] / 128.0;\n var y = v * HEIGHT / 2;\n\n if (i === 0) {\n canvasCtx.moveTo(x, y);\n } else {\n canvasCtx.lineTo(x, y);\n }\n\n x += sliceWidth;\n }\n\n canvasCtx.lineTo(canvas.width, canvas.height / 2);\n canvasCtx.stroke();\n}", "title": "" }, { "docid": "c1e8f0dfe2a658e7043c30cbe863ceb7", "score": "0.5775405", "text": "function render() {\n // Clear the scene\n ctx.clearRect(0, 0, width, height);\n\n // Loop through the dots array and project every dot\n for (var i = 0; i < dots.length; i++) {\n dots[i].project();\n }\n\n // Sort dots array based on their projected size\n dots.sort((dot1, dot2) => {\n return dot1.scaleProjected - dot2.scaleProjected;\n });\n\n // Loop through the dots array and draw every dot\n \n for (const {img, x, y, w, h} of IMAGES) {\n \n ctx.drawImage(img, x, y, w, h);\n }\n for (var i = 0; i < dots.length; i++) {\n dots[i].draw();\n }\n\n \n\n window.requestAnimationFrame(render);\n }", "title": "" }, { "docid": "737ce1dc39470ce3d7575adccb3c1ed9", "score": "0.57745", "text": "draw(context) {\n context.fillStyle = this.state ? '#ffffff' : '#000000';\n context.fillRect(\n this.position.x * this.size,\n this.position.y * this.size,\n this.size,\n this.size\n );\n context.strokeStyle = \"#787878\";\n context.strokeRect(\n this.position.x * this.size,\n this.position.y * this.size,\n this.size,\n this.size\n );\n }", "title": "" }, { "docid": "53f9e9bce013e57740694994baf92a47", "score": "0.5767829", "text": "function render(){\n\tdrawMain();\n\tdrawConsole();\n\tdrawMiniMap();\n}", "title": "" }, { "docid": "5a9010c2b2c335f065bd81c2fe556574", "score": "0.57625216", "text": "draw()\n {\n let current, context\n const multiplier = Math.ceil(this.scale * this.resolution)\n for (let key in this.textures)\n {\n const texture = this.textures[key]\n if (texture.canvas !== current)\n {\n if (typeof current !== 'undefined')\n {\n context.restore()\n }\n current = texture.canvas\n context = this.canvases[current].getContext('2d')\n context.save()\n context.scale(multiplier, multiplier)\n }\n context.save()\n context.translate(Math.ceil(texture.x / multiplier), Math.ceil(texture.y / multiplier))\n if (this.testBoxes)\n {\n context.fillStyle = this.randomColor()\n context.fillRect(0, 0, Math.ceil(texture.width / multiplier), Math.ceil(texture.height / multiplier))\n }\n switch (texture.type)\n {\n case CANVAS:\n texture.draw(context, texture.param, this.canvases[current])\n break\n\n case IMAGE: case DATA:\n context.drawImage(texture.image, 0, 0)\n break\n }\n if (this.extrude)\n {\n this.extrudeEntry(texture, context, current)\n }\n context.restore()\n }\n context.restore()\n }", "title": "" }, { "docid": "ae8c57f5886e4ebf8a3355edf28e7912", "score": "0.57525486", "text": "function draw() {\r\n // this variable is for the for loop\r\n var i;\r\n // set the draw fill style colour to black\r\n mainContext.fillStyle = \"#222323\";\r\n // fill the canvas with black\r\n mainContext.fillRect(-400,-300,mainCanvas.width, mainCanvas.height);\r\n // choose your line width\r\n mainContext.lineWidth = 5;\r\n // set the line join\r\n mainContext.lineJoin = 'round';\r\n planet();\r\n rotateEarth();\r\n\r\n // this for loop will draw as many robot as there are stored in the array\r\n for(i = 0; i < robot.length; i+=1) {\r\n robot[i].draw(mainContext,worldMatrix);\r\n sun[i].draw(mainContext,worldMatrix);\r\n }\r\n \r\n // draws the animations by each frame\r\n requestAnimationFrame(draw);\r\n }", "title": "" }, { "docid": "d4ecb570ff62435816ef037b78aa144c", "score": "0.575247", "text": "function draw(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n switch(gameManager.gameState){\n case 0:\n drawLoadingAnimation();\n break;\n case 1:\n drawTransitionAnimation();\n break;\n case 2:\n drawProfileMenu();\n break;\n case 3:\n drawMainMenu();\n break;\n case 4:\n drawSettingsMenu();\n break;\n case 5:\n drawInventoryMenu();\n break;\n case 6:\n drawPreGame();\n break;\n case 7:\n drawGame();\n break;\n case 8:\n drawDeath();\n break;\n }\n //TOAST\n if(ctxTool){ctxTool.drawToast();}\n \n requestAnimationFrame(draw);\n}", "title": "" }, { "docid": "cf28d6beeabb154b56e8817fdff1e96d", "score": "0.5744728", "text": "draw() {\n gameNs.game.ctx.clearRect(0, 0, gameNs.game.canvas.width, gameNs.game.canvas.height);\n gameNs.game.ctx.drawImage(this.instructions, 0, 0, gameNs.game.canvas.width, gameNs.game.canvas.height);\n }", "title": "" }, { "docid": "514e36232bf7389ee4eda176c023dbdf", "score": "0.57384324", "text": "draw(ctx){\n const tempField = this.renderTempField();\n\n tempField.map(function(val, y){\n val.map(function(val, x){\n ctx.fillStyle = colors[val];\n ctx.fillRect(x*20, y*20, 20, 20);\n })\n });\n }", "title": "" }, { "docid": "d96adce75c5e21a6d8fb6e848c331163", "score": "0.57292014", "text": "function redraw(c) {\n for (var i = 0; i < n - 1; i++) {\n var x1 = circlesCoords[i][0];\n var y1 = circlesCoords[i][1];\n var x2 = circlesCoords[Math.floor(c * i) % n][0];\n var y2 = circlesCoords[Math.floor(c * i) % n][1];\n var line = lines[i];\n line.set(\"x1\", x1);\n line.set(\"x2\", x2);\n line.set(\"y1\", y1);\n line.set(\"y2\", y2)\n }\n canvas.renderAll();\n}", "title": "" }, { "docid": "3672f4f189160b45b75e14abcedf915f", "score": "0.5725975", "text": "function render() {\n \tctx.fillStyle = BG_COLOR;\n \tctx.fillRect(0, 0, width, height);\n\n \trenderSlates(); \n \trenderCrumbs();\n \trenderNumbers();\n \trenderSelection();\n \tanimateSlates();\n \trenderHover();\n\n \twindow.requestAnimationFrame(render);\n }", "title": "" }, { "docid": "2f353d33c1130bdd96ed606756daf476", "score": "0.5724372", "text": "function draw() {\n clear();\n\n ctx.fillStyle = \"yellow\";\n rect(0, 0, WIDTH, HEIGHT);\n // redraw each rect in the rects[] array\n for (var i = 0; i < rects.length; i++) {\n var r = rects[i];\n ctx.fillStyle = r.fill;\n rect(r.x, r.y, r.width, r.height);\n pos[i]= ctx.save();\n }\n}", "title": "" }, { "docid": "61d90828294eeba13a866d4d63bc3b74", "score": "0.5721161", "text": "function render() {\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n drawMap();\r\n drawPlayer();\r\n drawFood();\r\n eat();\r\n window.requestAnimationFrame(render);\r\n}", "title": "" }, { "docid": "46072bbdf998f82b5d31f7b06b08a046", "score": "0.5719392", "text": "function redraw()\n {\n if(!ctx) return;\n ctx.clearRect(0,0,300,300);\n ctx.lineWidth = 2.0;\n walls.forEach(function(wall){\n wall.draw(ctx);\n });\n ctx.lineWidth = 1.0;\n listener.draw(ctx);\n source.draw(ctx);\n\n //Draw the paths\n if(path_array)\n {\n for(var i = 0; i < path_array.length; i++) //Go through all reflection paths\n {\n //Draw each path\n var first = true;\n ctx.strokeStyle = \"rgba(0,0,255,0.2)\";\n ctx.beginPath();\n ctx.lineWidth = 2;\n path_array[i].forEach(function(p){\n if(first) { ctx.moveTo(p[0],p[1]); first = false; }\n else { ctx.lineTo(p[0],p[1]); }\n });\n ctx.stroke();\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 1;\n }\n }\n }", "title": "" }, { "docid": "902cce6772a5a5898b9f45d498d4267e", "score": "0.57107127", "text": "function draw() {\n const ctx = canvas.node().getContext('2d');\n ctx.save();\n\n // erase what is on the canvas currently\n ctx.clearRect(0, 0, width, height);\n\n // draw each point as a rectangle\n for (let i = 0; i < points.length; ++i) {\n const point = points[i];\n //ctx.beginPath();\n //ctx.arc(point.x, point.y, pointWidth/2, 0, Math.PI*2, false);\n //ctx.fillStyle = point.color;\n //ctx.fill();\n ctx.fillStyle = point.color;\n ctx.fillRect(point.x, point.y, pointWidth, pointWidth);\n }\n\n ctx.restore();\n}", "title": "" }, { "docid": "5320e5846dd4b3d5953ad186a068a36d", "score": "0.57104903", "text": "function render() {\n //resize canvas\n canvas.width=WIDTH;\n canvas.height=HEIGHT;\n //fill background\n ctx.rect(0,0,WIDTH,HEIGHT);\n ctx.fillStyle=\"black\";\n ctx.fill();\n //render objects\n for (var i=0; i<simObj.length; i++){\n simObj[i].render();\n }\n //render mouse position and planets status on to screen in text\n renderPlanetStatus();\n renderMouseCoord(mouseX, mouseY);\n}", "title": "" }, { "docid": "15bb82e2168bcfc6d82e7a07062799fe", "score": "0.5710383", "text": "redrawStrokes(context, strokesArray) {\n for (var i = 0; i < strokesArray.length; i++) {\n context.strokeStyle = strokesArray[i].color;\n context.beginPath();\n context.moveTo(strokesArray[i].start[0], strokesArray[i].start[1]);\n for (var j = 0; j < strokesArray[i].points.length; j++) {\n context.lineTo(strokesArray[i].points[j][0], strokesArray[i].points[j][1]);\n context.stroke();\n }\n }\n }", "title": "" }, { "docid": "76f0b1aff1e1c893be1c85a3e0ef7190", "score": "0.5698748", "text": "function render() {\n const { me, others, bullets, explosions, crowns } = getCurrentState();\n if (!me) {\n return;\n }\n\n // Draw background\n renderBackground(me.x, me.y);\n\n // Draw the grid\n context.strokeStyle = 'white';\n context.lineWidth = 0.1;\n let X = 0;\n while (X < MAP_SIZE) {\n let Y = 0;\n while (Y < MAP_SIZE) {\n context.strokeRect(canvas.width / 2 - me.x + X, canvas.height / 2 - me.y + Y, 100, 100);\n Y += 100;\n }\n X += 100;\n }\n\n /*// Draw boundaries\n context.save();\n context.strokeStyle = '#FF3300';\n context.lineWidth = 5;\n //context.shadowBlur = 4;\n //context.shadowColor = '#CC00FF';\n context.strokeRect(canvas.width / 2 - me.x, canvas.height / 2 - me.y, MAP_SIZE, MAP_SIZE);\n context.restore();*/\n context.save();\n context.strokeStyle = 'black';\n context.lineWidth = 2;\n context.strokeRect(canvas.width / 2 - me.x, canvas.height / 2 - me.y, MAP_SIZE, MAP_SIZE);\n context.restore();\n\n // Draw all bullets\n bullets.forEach(renderBullet.bind(null, me));\n\n // Draw all players\n renderPlayer(me, me);\n others.forEach(renderPlayer.bind(null, me));\n\n explosions.forEach(renderExplosion.bind(null, me));\n\n crowns.forEach(renderCrowns.bind(null, me));\n}", "title": "" }, { "docid": "cd02d1480255f3177ca280a1335edc89", "score": "0.5692846", "text": "drawCoordinateSystem() {\n\n this.ctx.strokeStyle = \"rgba(0,0,0,1)\";\n this.ctx.fillStyle = \"rgba(0, 0, 0, 1)\";\n this.ctx.lineWidth = 2;\n\n // Ray X\n this.ctx.moveTo(-rayLength,0);\n this.ctx.lineTo(rayLength,0);\n // Arrow end\n this.ctx.lineTo(rayLength-rayLength/15, rayLength/15);\n this.ctx.moveTo(rayLength,0);\n this.ctx.lineTo(rayLength-rayLength/15, -rayLength/15);\n\n\n // Ray Y\n this.ctx.moveTo(0, rayLength);\n this.ctx.lineTo(0, -rayLength);\n // Arrow end\n this.ctx.lineTo(rayLength/15, -rayLength+rayLength/15);\n this.ctx.moveTo(0, -rayLength);\n this.ctx.lineTo(-rayLength/15, -rayLength+rayLength/15);\n\n\n let pixelXCoord = -maxXCoord * pixelStep - 4;\n for(let j=-maxXCoord; j<=maxXCoord; j += stepX) {\n\n if (j % 1 === 0) {\n this.ctx.fillText(j, pixelXCoord, -4);\n } else {\n this.ctx.fillText(j, pixelXCoord, 10);\n }\n pixelXCoord += pixelStep * stepX;\n\n }\n\n\n let pixelYCoord = maxYCoord * pixelStep + 4;\n for(let j=-maxYCoord; j <= maxYCoord; j += stepY) {\n\n if ( j !== 0 ) {\n if (j % 1 === 0) {\n this.ctx.fillText(j, 4, pixelYCoord);\n } else {\n this.ctx.fillText(j, -10, pixelYCoord);\n }\n }\n\n\n pixelYCoord -= pixelStep * stepY;\n }\n\n\n this.ctx.stroke();\n\n }", "title": "" }, { "docid": "e6265c12427a7ac449e9997b6579ab30", "score": "0.5692026", "text": "function render() {\n context.fillStyle = \"blue\";\n context.fillRect = (0, 0, context.width, context.height);\n console.log(\"renderFunctionRan\");\n}", "title": "" }, { "docid": "7a830dbd49c733f60537098cc9f7e4cf", "score": "0.56872654", "text": "function trender(coords){\n const canCenX = document.getElementById(\"mainCanvas\").width/2;\n const canCenY = document.getElementById(\"mainCanvas\").height/2;\n const bm = biggestMag(coords);\n const eyeDist = bm;\n const canDist = 4*bm;\n let perspCoords = setPersp(coords, canDist, eyeDist); //returns coords with possible perspective altering\n let finCoords = scaleCoords(perspCoords, 0.95); //resizes coords so that they will fit the canvas nicely\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.strokeStyle = \"#FFFFFF\";\n for (let i = 0; i < lines.length; i++){\n ctx.beginPath();\n ctx.moveTo(canCenX + finCoords[lines[i][0]][0], canCenY + finCoords[lines[i][0]][1]);\n ctx.lineTo(canCenX + finCoords[lines[i][1]][0], canCenY + finCoords[lines[i][1]][1]);\n ctx.stroke();\n }\n}", "title": "" }, { "docid": "f0de6de696cd7b7a5e3e43a578c4ecfe", "score": "0.56870157", "text": "function doDrawList(commands, datablocks, id) {\n state.running = true;\n \n let _i = 0;\n \n let u8buffer = new Uint8Array(commands.buffer);\n \n let read = () => {\n return commands[_i++];\n }\n \n let width = read(), height = read();\n \n let fillcolor = [0, 0, 0, 1], strokecolor = [0, 0, 0, 1];\n\n let blur_doff = 25000;\n let blur = 0;\n \n //try to catch malformed dimensions\n if (isNaN(width) || isNaN(height) || width <= 0 || height <= 0 || width > 10000 || height > 10000) {\n console.warn(\"Malformed dimensions\", width, height);\n senderror(\"Malformed dimensions \" + width + \", \" + height)\n state.running = false;\n return;\n }\n \n let canvas = new OffscreenCanvas(width, height);\n let g = canvas.getContext(\"2d\");\n let transform = [1, 0, 0, 0, 1, 0];\n \n g.globalCompositeOperation = \"source-over\";\n g.miterLimit = 2.5;\n g.lineCap = \"butt\";\n\n let no_fill = false;\n\n while (_i < commands.length) {\n let cmd = ~~read(); //give hint to compiler that this is an integer\n if (Debug) console.log(\"cmd\", cmd)\n\n switch (cmd) {\n case LINESTYLE :\n case FILLSTYLE :\n let r = read(), g1 = read(), b = read(), a = read();\n let style = \"rgba(\"+r+\",\"+g1+\",\"+b+\",\"+a+\")\";\n \n if (Debug) console.log(\"STYLE\", style);\n let clr;\n \n if (cmd === LINESTYLE) {\n g.strokeStyle = style;\n clr = strokecolor;\n } else {\n g.fillStyle = style;\n clr = fillcolor;\n }\n \n clr[0] = r;\n clr[1] = g1;\n clr[2] = b;\n clr[3] = a;\n \n if (Debug) console.log(id, \"yay color\", fillcolor, style, _i-5);\n \n break;\n /*\n let i = _i * 4;\n len = u8buffer[i++];\n let style = \"\";\n \n for (let j = 0; j < len; j++) {\n style += String.fromCharCode(u8buffer[i + j]);\n }\n \n //pad to 4-byte boundary\n let off = (len + 1) & 3;\n if (off) {\n _i += 4 - off;\n }\n \n if (cmd === LINESTYLE) {\n g.strokeStyle = style;\n } else {\n g.fillStyle = style;\n }\n break;*/\n case LINEWIDTH:\n g.lineWidth = read();\n break;\n case BEGINPATH :\n g.beginPath();\n break;\n case CLOSEPATH :\n g.closePath();\n break;\n case MOVETO :\n let x = read(), y = read();\n if (Debug) console.log(\"moving to!\", x, y);\n g.moveTo(x, y);\n break;\n case LINETO :\n g.lineTo(read(), read());\n break;\n case RECT :\n g.rect(read(), read(), read(), read());\n break;\n case ARC :\n g.arc(read(), read(), read(), read(), read());\n break;\n case CUBIC :\n g.bezierCurveTo(read(), read(), read(), read(), read(), read());\n break;\n case QUADRATIC :\n g.quadraticCurveTo(read(), read(), read(), read());\n break;\n case STROKE :\n g.stroke();\n break;\n case FILL :\n if (Debug) console.log(\"filling\");\n g.fill();\n break;\n case CLIP :\n if (Debug) console.log(\"clipping\");\n g.clip();\n break;\n case SAVE :\n g.save();\n break;\n case RESTORE :\n g.restore();\n break;\n case SETTRANSFORM:\n for (let i=0; i<6; i++) {\n transform[i] = read();\n }\n \n g.setTransform(transform[0], transform[1], transform[2], transform[3], transform[4], transform[5]);\n break;\n case TRANSLATE :\n g.translate(read(), read());\n break;\n case ROTATE :\n g.rotate(read());\n break;\n case SCALE :\n g.scale(read(), read());\n break;\n case DRAWIMAGE :\n g.drawImage(datablocks[~~read()], read(), read());\n break;\n case PUTIMAGE :\n g.putImageData(datablocks[~~read()], read(), read());\n break;\n case SETCOMPOSITE:\n g.globalCompositeOperation = CompositeModes[~~read()];\n break;\n case SETBLUR:\n let blur2 = read();\n \n //*\n if (blur2 === 0 && blur !== 0) {\n blur = 0;\n g.filter = \"none\";\n } else if (blur2 > 0) {\n let scale = transform[0];\n blur = blur2*scale;\n\n g.filter = \"blur(\" + (blur*0.25) + \"px)\";\n }\n //*/\n \n break;\n case NOFILL:\n no_fill = true;\n break;\n }\n }\n\n //reset blur\n if (blur > 0) {\n g.shadowOffsetX = 0.0;\n g.shadowOffsetY = 0.0;\n g.shadowBlur = 0.0;\n \n g.translate(-blur_doff, 0.0);\n }\n\n state.running = false;\n \n let result = canvas.transferToImageBitmap();\n \n postMessage({\n type : MSG_RESULT,\n data : [result],\n msgid : id\n }, [result]);\n \n self.setTimeout(() => {\n for (let i=0; i<3; i++) {\n handleQueue();\n }\n }, 0);\n\n if (self.gc && typeof(self.gc) === \"function\") {\n self.gc();\n }\n}", "title": "" }, { "docid": "3b44b0b786bd096715ad2f560eb68ed6", "score": "0.5685645", "text": "draw(context){\n\t\tfor(var y = 0; y <= this._max_y_tile; y++){\n\t\t\tfor(var x = 0; x <= this._max_x_tile; x++){ \n\t\t\t\tvar tile = this.get_map_tile([x,y])\n\t\t\t\ttile.draw(context);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "81f7be65ade0e63b58279dafe6edc6bc", "score": "0.5684769", "text": "function draw(){\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); \n for(var i = 0; i < shaderPrefix.length; i++){\n drawFunctions[shaderPrefix[i]]();\n }\n}", "title": "" }, { "docid": "58a4e6e1149c3116efc6327e2eab7d5c", "score": "0.5675962", "text": "drawIndirect(pass) {\n this.bindVertexBuffers(pass);\n pass.drawIndirect(this.generateIndirectBuffer(), 0);\n }", "title": "" }, { "docid": "c67b6b99a9e5bd493f879993252391bc", "score": "0.56671625", "text": "function draw(){\n // Clear the screen\n screen.clear();\n\n // Draw aliens\n for(let i=0; i<aliens.length; i++){\n let alien = aliens[i];\n screen.drawSprite(alien.sprite[motion],alien.x,alien.y);\n }\n\n // Draw bullets\n screen.ctx.save();\n for(let i=0; i<bullets.length; i++){\n screen.drawBullet(bullets[i]);\n }\n screen.ctx.restore();\n // Draw cities - cannot use drawSprite since city has its own canvas; use drawImage instead.\n screen.ctx.drawImage(cities.canvas,0,cities.y)\n\n // Draw tank - use drawSprite\n screen.drawSprite(tank.sprite,tank.x,tank.y);\n }", "title": "" }, { "docid": "ba07b2baad656a2385da2e19c02d8804", "score": "0.5667038", "text": "function draw() \n{\n\n\tif(loaded)\n\t{\n\t drawVisual = requestAnimationFrame(draw);\n\n analyser.getByteTimeDomainData(dataArray);\n\n canvasCtx.fillStyle = 'rgb(200, 200, 200)';\n canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = 'rgb(0, 0, 0)';\n\n canvasCtx.beginPath();\n\n var sliceWidth = WIDTH * 1.0 / bufferLength;\n var x = 0;\n\n for(var i = 0; i < bufferLength; i++) {\n \n var v = dataArray[i] / 128.0;\n var y = v * HEIGHT/2;\n\n if(i === 0) {\n canvasCtx.moveTo(x, y);\n } else {\n canvasCtx.lineTo(x, y);\n }\n\n x += sliceWidth;\n }\n\n //canvasCtx.lineTo(canvas.width, canvas.height/2);\n canvasCtx.lineTo(WIDTH, HEIGHT/2);\n canvasCtx.stroke();\n };\n\n draw();\n}", "title": "" }, { "docid": "4fe42ef68be5318e8968749341b3c692", "score": "0.5665745", "text": "function draw(){\n tile.clearRect(0, 0, canvas.width, canvas.height);\n drawBoard();\n drawAnswers();\n drawSelection();\n }", "title": "" }, { "docid": "fb99e2b51df93492fed98532e9fca13d", "score": "0.5660408", "text": "draw() {\n\t\tlet ctx = canvas.getCtx();\n\t\tctx.fillStyle = 'red';\n\t\tctx.fillRect(\n\t\t\t(this.#x * this.#width),\n\t\t\t(this.#y * this.#height),\n\t\t\tthis.#width,\n\t\t\tthis.#height\n\t\t);\n\t}", "title": "" }, { "docid": "6789e4612ca78fddffd45bc2cf60d2e9", "score": "0.56596434", "text": "function drawVisualHelpers(){\n ctx.save();\n ctx.globalCompositeOperation = \"destination-over\";\n ctx.strokeStyle = \"#eee\";\n for(var i = 0; i < NB_VERTICAL_CELL; i++){\n var y = i*can.height/NB_VERTICAL_CELL;\n ctx.beginPath();\n ctx.moveTo(0, y);\n ctx.lineTo(can.width, y);\n ctx.stroke();\n }\n for(var j = 0; j < NB_HORIZONTAL_CELL; j++){\n var x = can.width/NB_HORIZONTAL_CELL;\n ctx.beginPath();\n ctx.moveTo(j*x, 0);\n ctx.lineTo(j*x, can.height);\n ctx.stroke();\n }\n ctx.restore();\n}", "title": "" }, { "docid": "306c4003ace9e285ebf93f9f02dfe9f4", "score": "0.56534606", "text": "draw() {\r\n let canvas = document.getElementById(this.canvasId);\r\n if (canvas.getContext) {\r\n let ctx = canvas.getContext(\"2d\");\r\n for (let y = 0; y < this.board.length; y++) {\r\n for (let x = 0; x < this.board[y].length; x++) {\r\n let renderX = x * 50;\r\n let renderY = y * 50;\r\n if (this.board[y][x] === \"X\") {\r\n ctx.drawImage(this.wallImage, renderX, renderY, 50, 50);\r\n }\r\n if (this.board[y][x] === \"1\") {\r\n ctx.drawImage(this.ballImage, renderX, renderY, 50, 50);\r\n }\r\n if (this.board[y][x] === \"Y\") {\r\n ctx.drawImage(this.portalImage, renderX, renderY, 50, 50);\r\n }\r\n if (this.board[y][x] === \"0\") {\r\n ctx.clearRect(renderX, renderY, 50, 50);\r\n }\r\n }\r\n }\r\n ctx.drawImage(\r\n this.finishImage,\r\n this.finishCondition[0] * 50,\r\n this.finishCondition[1] * 50,\r\n 50,\r\n 50\r\n );\r\n }\r\n }", "title": "" }, { "docid": "c454b03b635417d3d85de5406804432c", "score": "0.5639509", "text": "display() {\n ctx.fillStyle = this.color;\n ctx.beginPath();\n ctx.moveTo(this.x1,this.y1);\n ctx.lineTo(this.x2,this.y2);\n ctx.strokeStyle = this.color;\n ctx.stroke();\n }", "title": "" }, { "docid": "55f06d1ab6aaa2d86928d4702eb6a4f6", "score": "0.5634024", "text": "function redraw() {\n var i,\n l = _me.displayList().length,\n d,\n values;\n if (!_ctx) {\n console.log(this.name());\n }\n _ctx.clearRect(0, 0, _width, _height);\n for (i = 0; i < l; i += 1) {\n d = _me.displayList()[i];\n _ctx.save();\n /// Apply alpha\n _ctx.globalAlpha = d.alpha() / 100;\n /// Apply translation to rotate properly\n _ctx.translate(d.handleX(), d.handleY());\n /// Apply rotation\n _ctx.rotate(Danimate.utils.deg2rad(d.rotation()));\n /// Do the drawing\n values = d.drawingValues();\n// console.log(values);\n _ctx.drawImage.apply(_ctx, values);\n /// Reset context\n _ctx.restore();\n }\n }", "title": "" }, { "docid": "6cba947bf557ea6efd00c12a5ec81b30", "score": "0.56334156", "text": "function draw(){\r\n if (status==null){\r\n draw1();\r\n draw2();\r\n }\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n draw1();\r\n draw2();\r\n\r\n }", "title": "" }, { "docid": "1c7587023717385f4295acd8de83e4a4", "score": "0.56280494", "text": "function draw(){\n ctx.clearRect(0,0,canvas.width, canvas.height);\n for (var i = 0; i < goutte.length; i++) { goutte[i].draw(); goutte[i].tombe(); };\n window.requestAnimationFrame(draw);\n }", "title": "" }, { "docid": "5fce8b65b6e42ea1c86ccefc57e51843", "score": "0.5625622", "text": "function draw() {\n for (let i = 0; i <= colorArray.length; i++) {\n fill(colorArray[i]);\n rect(i*200, 0, 200, 600);\n }\n }", "title": "" }, { "docid": "9e9ec7d69eacc68460155cfed7cfab5c", "score": "0.56239355", "text": "draw() {\n ctx.fillStyle = this.color;\n ctx.fillRect(this._x * SIZE, this._y * SIZE, SIZE, SIZE);\n }", "title": "" }, { "docid": "9a97c1c9b3c284765a9dc0d277913832", "score": "0.5621314", "text": "update() {\n this.canvasContext.clearRect(0,0,this.width, this.height);\n for (var i = 0; i < this.canvasObjects.length; i++){\n this.canvasObjects[i].draw(this.canvasContext);\n }\n }", "title": "" }, { "docid": "ea5a6c07611e966f43b9fbffa1160e71", "score": "0.5620136", "text": "draw(ctx){\n if(this.isHighlight)\n this.drawHighLight(ctx);\n\n var oldFillStyle = ctx.fillStyle;\n ctx.font = this.getFont();\n ctx.fillStyle = this.color;\n for(let i = 0; i < this.lines.length; i++) {\n ctx.fillText(this.lines[i], this.originX, this.originY + (this.pixels * (i + 1)));\n }\n ctx.fillStyle = oldFillStyle;\n }", "title": "" }, { "docid": "e046071bbe4056af4fa3f531f86290c5", "score": "0.5616478", "text": "function consoleUpdate() {\n consoleBGShaderStack();\n for (i=0;i<spriteStack.length;i++){\n drawSprite(spriteStack[i], 1, 1);\n }\n drawPixels();\n drawText();\n\n}", "title": "" }, { "docid": "39986e3d700bec513dc8fdb979305f92", "score": "0.56147265", "text": "draw (ctx) {\n if (this.game.showOutlines && this.boundX) {\n drawOutline(ctx);\n }\n if (this.img) {\n this.animation.drawFrame(this.clockTick, ctx, this.x, this.y, true);\n }\n }", "title": "" }, { "docid": "e314311f3b1d60b3afcd9e4a16d70ca5", "score": "0.5610465", "text": "draw() {\n this.ctx.fillRect(this.x, this.y, this.size, this.size);\n }", "title": "" }, { "docid": "a660a2e31299431ad7e8ce4ddbeb61a1", "score": "0.5608364", "text": "redrawUtility(context, utilArray, utilSize) {\n for (let i = 0; i < utilArray.length; i++) {\n context.drawImage(utilArray[i].image, utilArray[i].topLeft[0], utilArray[i].topLeft[1], utilSize, utilSize);\n }\n }", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5608193", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5608193", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5608193", "text": "function draw() {}", "title": "" }, { "docid": "1205d5d65cfd22c34f2d80cc1ff1d140", "score": "0.5601017", "text": "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n ctx.drawImage(Resources.get(this.endPoint), this.endPointColumn, this.endPointRow);\n }", "title": "" }, { "docid": "b7677a2536ad8e851860354b10c5ba0a", "score": "0.5591972", "text": "function drawManager(){ \n // TILES DRAW\n for(var t in tile){\n tile[t].draw();\n } \n \n // Pinto el cuadrante del cursor\n if(tileAccept){\n ctx.drawImage(cursor1,cursorPX-cursor1.width/2,cursorPY-cursor1.height+gridSize/4);\n }else{\n ctx.drawImage(cursor2,cursorPX-cursor1.width/2,cursorPY-cursor1.height+gridSize/4);\n } \n \n // TREE DRAW \n for(var t in tree){\n tree[t].draw();\n } \n for(var b in build){\n build[b].draw();\n }\n \n}", "title": "" }, { "docid": "e19ca6e96e21ab216601c6b900a07266", "score": "0.55914444", "text": "function renderplat() {\n ctx.fillStyle = \"#45597E\";\n ctx.fillRect(platforms[0].x, platforms[0].y, platforms[0].width, platforms[0].height);\n //ctx.fillStyle = \"#455900\";\n ctx.fillRect(platforms[1].x, platforms[1].y, platforms[1].width, platforms[1].height);\n ctx.fillRect(platforms[2].x, platforms[2].y, platforms[2].width, platforms[2].height);\n\n}", "title": "" }, { "docid": "7fc687287b37967372282cd15dcb901d", "score": "0.55908805", "text": "function simulateDraw(points)\n {\n\n for(var i=0; i< points.length; i++)\n {\n if(i == 0) {\n context.beginPath();\n context.moveTo(points[i][0], points[i][1]); \n } else if(i>0)\n {\n context.lineTo(points[i][0], points[i][1]);\n };\n };\n context.stroke();\n \n }", "title": "" }, { "docid": "1bc3d133b137c891d14a7e16054c7a8c", "score": "0.5588814", "text": "function draw() {\n\tfor (var i = 0; i < toDraw.length; i++) {\n\t\tif (toDraw[i].type == 'point') {\n\t\t\t//This is a point\n\t\t\tvar ctx = canvas.getContext('2d');\n\t\t\tctx.fillStyle = color;\n\t\t\tctx.fillRect(toDraw[i].startX-2, toDraw[i].startY-2, 2, 2);\n\t\t}\n\t\telse if (toDraw[i].type == 'line' || toDraw[i].type == 'temp') {\n\t\t\t//This is a line\n\t\t\tvar ctx = canvas.getContext('2d');\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(toDraw[i].startX, toDraw[i].startY);\n\t\t\tctx.lineTo(toDraw[i].endX, toDraw[i].endY);\n\t\t\tctx.strokeStyle = color;\n\t\t\tctx.stroke();\n\t\t}\n\t\telse if (toDraw[i].type == 'circle') {\n\t\t\t//This is a circle\n\t\t\tvar ctx = canvas.getContext('2d');\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(toDraw[i].startX, toDraw[i].startY, toDraw[i].diameter, 0, 2*Math.PI);\n\t\t\tctx.strokeStyle = color;\n\t\t\tctx.stroke();\n\t\t}\n\t\telse if (toDraw[i].type == 'polygon') {\n\t\t\t//This is a polygon\n\t\t\tfor (var n = 0; n < toDraw[i].angles.length; n++) {\n\t\t\t\tvar ctx = canvas.getContext('2d');\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.moveTo(toDraw[i].angles[n].startX, toDraw[i].angles[n].startY);\n\t\t\t\tctx.lineTo(toDraw[i].angles[n].endX, toDraw[i].angles[n].endY);\n\t\t\t\tctx.strokeStyle = color;\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "85d4261302ecf5da862e60525fe2de9e", "score": "0.5583599", "text": "function draw() {\n\n drawVisual = requestAnimationFrame(draw);\n\n analyser.getByteTimeDomainData(dataArray);\n\n canvasCtx.width = window.innerWidth;\n canvasCtx.height = window.innerHeight;\n var WIDTH = canvas.width;\n var HEIGHT = canvas.height;\n\n // canvasCtx.fillStyle = 'rgb(200, 200, 200)';\n // canvasCtx.fillRect(0, 0, WIDTH, HEIGHT);\n\n canvasCtx.lineWidth = 2;\n canvasCtx.strokeStyle = 'rgb(0, 0, 0)';\n\n // canvasCtx.beginPath();\n\n var sliceWidth = WIDTH * 1.0 / bufferLength;\n var x = 0;\n\n for(var i = 0; i < bufferLength; i++) {\n\n var v = dataArray[i] / 128.0;\n var y = v * HEIGHT/2;\n\n // if(i === 0) {\n // canvasCtx.moveTo(x, y);\n // } else {\n // canvasCtx.lineTo(x, y);\n // }\n //\n x += sliceWidth;\n }\n\n // canvasCtx.lineTo(canvas.width, canvas.height/2);\n // canvasCtx.stroke();\n }", "title": "" }, { "docid": "b5f2a5b7692c9cfbabce428502398f8e", "score": "0.5580022", "text": "function render(){\n\tvar wi;\n\tvar he;\n\tvar i;\n\n\t//deletes previous state\n\tvar old = document.getElementsByClassName(\"canvasElement\");\n\tvar len = old.length;\n\tfor (i = 0; i < len; i++){\n\t\t// array is being updated dynamically so we just remove the first element repeatedly\n\t\told[0].parentNode.removeChild(old[0]);\n\t}\n\n\t//draw the new state\n\tfor (he = this.height - 1; he >= 0; he--){\n\t\tfor (wi = 0; wi < this.width; wi++){\n\t\t\tif (this.isBall(wi,he)) {\n\t\t\t\tmakeObj(wi,he,\"red\",true,\"ball\");\n\t\t\t}\n\t\t\telse if (this.isGoal(wi,he)) {\n\t\t\t\tmakeObj(wi,he,\"yellow\",false,\"goal\");\n\t\t\t}\n\t\t\telse if (this.isBlock(wi,he)) {\n\t\t\t\tmakeObj(wi,he,\"gray\",false,null);\n\t\t\t}\n\t\t\telse {\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7bc0f3d008d59234614fcef6ae3f3296", "score": "0.55777895", "text": "function renderCanvas() {\n for (let i = 0; i < GAME_SIZE; i++) {\n for (let j = 0; j < GAME_SIZE; j++) {\n $gameCell = getCellFromCoordinates(i, j);\n $gameCell.removeClass(\"game-cell-active\");\n if (board.isCellActive(i, j)) {\n $gameCell.addClass(\"game-cell-active\");\n }\n }\n }\n}", "title": "" }, { "docid": "94a0f40fac04301c36486043af496408", "score": "0.5575727", "text": "drawDebug(ctx, debugEntries) {\n const xScale = 20;\n const yScale = 500;\n ctx.fillStyle = \"#ffff88\";\n for (let i = 0; i < debugEntries.length; i++) {\n const height = debugEntries[i] * yScale;\n ctx.fillRect(i * xScale, window.innerHeight - height, xScale - 1, height);\n }\n }", "title": "" }, { "docid": "b34c1e510fd27864e770e2b3720c3ab5", "score": "0.5575329", "text": "function render(coords){\n const canCenX = document.getElementById(\"mainCanvas\").width/2;\n const canCenY = document.getElementById(\"mainCanvas\").height/2;\n //resizes coords so that they will fit the canvas nicely\n let scaledCoords;\n if (coords[0].length == 3) {\n scaledCoords = scaleCoords(coords, 3); //was 4\n }\n else if (coords[0].length == 4) {\n scaledCoords = scaleCoords(coords, 2); //was 1.5\n }\n if (perspectiveEnabled == false) {\n scaledCoords = scaleCoords(coords, 0.95);\n }\n const bm = biggestMag(scaledCoords);\n const eyeDist = 1.5*bm;\n const canDist = 4*bm;\n let finCoords = setPersp(scaledCoords, canDist, eyeDist); //returns coords with possible perspective altering\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.strokeStyle = \"#FFFFFF\";\n for (let i = 0; i < lines.length; i++){\n ctx.beginPath();\n ctx.moveTo(canCenX + finCoords[lines[i][0]][0], canCenY + finCoords[lines[i][0]][1]);\n ctx.lineTo(canCenX + finCoords[lines[i][1]][0], canCenY + finCoords[lines[i][1]][1]);\n ctx.stroke();\n }\n}", "title": "" }, { "docid": "a1bf03ed294bd53a597ec1d1e0ac98b6", "score": "0.5570417", "text": "function draw() {\n ctx.clearRect(0,0,canvas.width,canvas.height);\n ctx.drawImage(img, toCX(0), toCY(0), toCS(img.width), toCS(img.height));\n for(var i=0;i<ellipses.length;i++){\n ellipses[i].draw((i < mainEllipseCount), (i == selectedEllipse));\n }\n for(var i=0;i<points.length;i++){\n points[i].draw((i == selectedPoint));\n }\n}", "title": "" }, { "docid": "32f859c730743bd5c0eac7890aa5a170", "score": "0.5567529", "text": "function draw(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawPoints();\n drawPolygonal();\n drawBezier();\n drawAlternada();\n}", "title": "" }, { "docid": "1fa16b38c28605df0de5c2405766899b", "score": "0.55627006", "text": "canvasRender() {\n if (imgLoader.allLoaded) {\n var context = document\n .getElementById(\"board\")\n .getContext(\"2d\")\n ;\n\n //clear the canvas before drawing every time\n context.clearRect(\n 0,\n 0,\n document.getElementById(\"board\").width,\n document.getElementById(\"board\").height\n );\n\n this.state.map.forEach(function (element) {\n console.log(element);\n //draw terrain\n \n //TODO This should be a switch statement as well\n if (element.terrainType === \"greenGrass1\") {\n context.rect(element.x * cellWidth, element.y * cellWidth, cellWidth, cellWidth);\n }\n else if (element.terrainType === null) {\n context.fillStyle = \"#000000\";\n context.fillRect(element.x * cellWidth, element.y * cellWidth, cellWidth, cellWidth);\n }\n else {\n context.arc(element.x * cellWidth, element.y * cellWidth, cellWidth, 2 * Math.PI);\n }\n context.stroke();\n\n //draw object\n switch (element.object) {\n case \"genericBarrier1\":\n context.drawImage(imgLoader.getImage(\"genericBarrier01\"), element.x * 50, element.y * 50);\n break;\n default:\n break;\n }\n\n //draw character\n //TODO Obviously not all characters will be named \"lance\"\n switch (element.character) {\n case \"lance\":\n context.drawImage(imgLoader.getImage(\"character\"), element.x * 50, element.y * 50);\n break;\n default:\n break;\n }\n });\n }\n }", "title": "" }, { "docid": "caf81bb1c5a83fd8bb51953744a2fa9d", "score": "0.5560054", "text": "function draw() {\n\tfor (let entity of DRAWABLE_ENTITIES) {\n\t\tentity.update();\n\t}\n\n\t// make sure we draw entities in order\n\tDRAWABLE_ENTITIES.sort(function cmp(a, b) {\n\t\tif (a.coordY === b.coordY) {\n\t\t\treturn a.coordX - b.coordX;\n\t\t}\n\n\t\treturn a.coordY - b.coordY;\n\t});\n\t\n\tmapRenderer.draw();\n\n\tfor (let entity of DRAWABLE_ENTITIES) {\n\t\tentity.draw();\n\t}\n\t\n\trequestAnimationFrame(draw);\n}", "title": "" }, { "docid": "e2358a4e2a40fa31b45cde4b8fd3e054", "score": "0.5557687", "text": "render() {\r\n render(offscreenCanvas);\r\n }", "title": "" }, { "docid": "89ffe5b8a8f099e3fcf57c5b4c777fc3", "score": "0.5557435", "text": "function render()\n{\n\tctx.clearRect(0,0,w,h);\n\t//grabbing a screenshot of the canvas using getImageData\n\tvar imagedata = ctx.getImageData(0,0,w,h);\n\t//looping through all pixel points\n\tvar i = pixels.length;\n\twhile(i--)\n\t{\n\t\tvar pixel = pixels[i];\n\t\t//calculating 2d position for 3d coordinates\n\t\t//fov = field of view = denotes how far the pixels are from us.\n\t\t//the scale will control how the spacing between the pixels will decrease with increasing distance from us.\n\t\tvar scale = fov/(fov+pixel.z);\n\t\tvar x2d = pixel.x * scale + w/2;\n\t\tvar y2d = pixel.y * scale + h/3;\n\t\t//marking the points green - only if they are inside the screen\n\t\tif(x2d >= 0 && x2d <= w && y2d >= 0 && y2d <= h)\n\t\t{\n\t\t\t//imagedata.width gives the width of the captured region(canvas) which is multiplied with the Y coordinate and then added to the X coordinate. The whole thing is multiplied by 4 because of the 4 numbers saved to denote r,g,b,a. The final result gives the first color data(red) for the pixel.\n\t\t\tvar c = (Math.round(y2d) * imagedata.width + Math.round(x2d))*4;\n\t\t\timagedata.data[c] = 250; //red\n\t\t\timagedata.data[c+1] = 250; //green\n\t\t\timagedata.data[c+2] = 250; //blue\n\t\t\timagedata.data[c+3] = 255; //alpha\n\t\t}\n\t\tpixel.z -= 1;\n\t\tif(pixel.z < -fov) pixel.z += 2*fov;\n\t}\n\t//putting imagedata back on the canvas\n\tctx.putImageData(imagedata, 0, 0);\n}", "title": "" }, { "docid": "ce62184d876051a21cbfba7fb6421904", "score": "0.555545", "text": "function render() {\n //clears entire canvas\n //get rekt (rect)\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n var bucky = gameState.bucky;\n ctx.drawImage(bucky.img, bucky.left, bucky.top, bucky.width, bucky.height);\n\n\n //shows me coordinates\n var idx;\n for(idx = 0; idx < canvas.width + 20; idx += 20) {\n //print, x-coord, y-coord\n ctx.fillText(idx, idx, 10);\n }\n\n for(idx = 0; idx < canvas.height + 20; idx += 20) {\n ctx.fillText(idx, 0, idx);\n }\n\n //draw roadblocks\n var blocks = gameState.blocks;\n for (var i = 0; i < blocks.length; i++) {\n var block = blocks[i];\n ctx.fillRect(block.left, block.top, block.width, block.height);\n }\n } //render()", "title": "" }, { "docid": "40594f617e82b02adb91d2c1e80595c5", "score": "0.55541235", "text": "function updateCanvas(){\n\tclearAll();\n\tfor(var m = 0; m < 120; m++){\n\t\tfor(var n = 0; n < 120; n++){\n\t\t\tif(lineInd[m][n] == -1 && rectsInd[m][n] == -1){\n\t\t\t\t// drawRect(n, m, clearStyle);\n\t\t\t}else if(lineInd[m][n] != -1){\n\t\t\t\tdrawRect(n, m, lineStyle[lineInd[m][n]]);\n\t\t\t}else if(rectsInd[m][n] != -1){\n\t\t\t\tdrawRect(n, m, fillStyle[rectsInd[m][n]]);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"what heck!\");\n\t\t\t}\n\t\t}\n\t}\n\tfor (var m = 0; m < positions.length; m++) {\n\t\tdrawRect(positions[m][0], positions[m][1], agentStyle[m]);\n\t}\n}", "title": "" }, { "docid": "8e4b6e3d4bf42ea51ef79de9fd2b31ec", "score": "0.55529714", "text": "function drawLines(context) {\n\n var arrayLength = 0;\n var ctx = context.ctx2d;\n var i = 0;\n\n // lines may not have been created yet\n if (typeof context.lines === 'undefined') {\n return;\n }\n\n arrayLength = context.lines.length;\n\n for (i = 0; i < arrayLength; i++) {\n ctx.beginPath();\n ctx.moveTo(context.lines[i].x, context.lines[i].y);\n ctx.lineTo(context.lines[i].toX, context.lines[i].toY);\n ctx.lineWidth = 1;\n ctx.strokeStyle = '#000000';\n ctx.stroke();\n }\n }", "title": "" }, { "docid": "29e715d1e782fb80a114f969f96aea2a", "score": "0.55454314", "text": "renderEvents() {\n // loop over each event to draw it\n for (let i = 0; i < this.eventList.length; i++) {\n this.eventList[i].render(this.ctx, this.canvasWidth, this.canvasHeight);\n }\n }", "title": "" }, { "docid": "64a5750daa95dada0b53a90b25d7c7af", "score": "0.5540878", "text": "function render() {\r\n\t\r\n\tgl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\tgl.drawArrays( gl.TRIANGLES, 0, pointsArray.length);\r\n}", "title": "" }, { "docid": "41ea14653985eedd77285ca0401eded2", "score": "0.5538361", "text": "redrawCanvas(context, strokesArray, utilArray, utilSize) {\n this.redrawStrokes(context, strokesArray);\n this.redrawUtility(context, utilArray, utilSize);\n }", "title": "" } ]
2f7cacb44de2e1659fe5086570f7d7ae
tooltipFunctions set timeouts for tool tips after hover
[ { "docid": "75158af10c9b96b2a7a1f426b9e8a90a", "score": "0.7206725", "text": "function tooltipFunctions() {\n $('[data-toggle=\"tooltip\"]').tooltip(); //needed for tooltip\n $('[data-toggle=\"popover\"]').popover();\n $('.tdPlaylistButton').mouseenter(function(){\n setTimeout(function(){\n $('.tdPlaylistButton').tooltip('hide');\n },1000);\n });\n $('.browseChannelButton').mouseenter(function () {\n setTimeout(function () {\n $('.browseChannelButton').tooltip('hide');\n }, 1000);\n });\n $('.lightBoxMode').mouseenter(function () {\n setTimeout(function () {\n $('.lightBoxMode').tooltip('hide');\n }, 1000);\n });\n $('.channelSearchButton').mouseenter(function () {\n setTimeout(function () {\n $('.channelSearchButton').tooltip('hide');\n }, 1000);\n });\n $('.videoSearchButton').mouseenter(function () {\n setTimeout(function () {\n $('.videoSearchButton').tooltip('hide');\n }, 1000);\n });\n $('#videoStats .fa-bar-chart').mouseenter(function () {\n setTimeout(function () {\n $('#videoStats .fa-bar-chart').tooltip('hide');\n }, 1000);\n });\n $('#channelInfo .fa-list-alt').mouseenter(function () {\n setTimeout(function () {\n $('#channelInfo .fa-list-alt').tooltip('hide');\n }, 1000);\n });\n $('.listDropButton').mouseenter(function(){\n setTimeout(function(){\n $('.listDropButton').tooltip('hide');\n },1000);\n });\n $('.lastVideoButton').mouseenter(function(){\n setTimeout(function(){\n $('.lastVideoButton').tooltip('hide');\n },1000);\n });\n $('.rewindButton').mouseenter(function(){\n setTimeout(function(){\n $('.rewindButton').tooltip('hide');\n },1000);\n });\n $('.fastForwardButton').mouseenter(function(){\n setTimeout(function(){\n $('.fastForwardButton').tooltip('hide');\n },1000);\n });\n $('.nextVideoButton').mouseenter(function(){\n setTimeout(function(){\n $('.nextVideoButton').tooltip('hide');\n },1000);\n });\n $('.playButton').mouseenter(function(){\n setTimeout(function(){\n $('.playButton').tooltip('hide');\n },1000);\n });\n $('.pauseButton').mouseenter(function(){\n setTimeout(function() {\n $('.pauseButton').tooltip('hide');\n }, 1000);\n });\n $('.listUpButton').mouseenter(function(){\n setTimeout(function(){\n $('.listUpButton').tooltip('hide');\n },1000);\n });\n}", "title": "" } ]
[ { "docid": "b4ccf13246c2dba4c4fd7bc6ddab0d60", "score": "0.71992403", "text": "function onMouseoverHdlr() {\t// on 'mouseover' handler\n\tsetTimeout(function(){ $(document).tooltip('disable');}, 10000);\n}", "title": "" }, { "docid": "b3c81211a62106ae6a877253f5e73e25", "score": "0.7113785", "text": "function loadTooltips() {\n $('.hover-tooltip').tooltip({\n title: hoverGetData,\n html: true,\n container: 'body',\n placement: 'left',\n delay: {\n \"show\": 100,\n \"hide\": 1500\n }\n });\n}", "title": "" }, { "docid": "3e281a7ef08c6366ac59a25416ef372c", "score": "0.70022094", "text": "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "title": "" }, { "docid": "63d3b6690875ccad72b4d21411b93d5e", "score": "0.69793123", "text": "function ttMouseOver() {\nif (tooltipsOn && wgCanonicalNamespace != \"Special\" && (itemTooltips || npcTooltips || questTooltips || quickTooltips || abilityTooltips || otherTooltips)) {\n$(\"body\").mouseover(hideTip);\n$(\"#bodyContent\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\nif (itemTooltips) $(\"span.itemlink,span.setlink\").each(bindTT);\nif (npcTooltips) $(\"span.npclink\").each(bindTT);\nif (questTooltips) $(\"span.questlink\").each(bindTT);\nif (achievementTooltips) $(\"span.achievementlink\").each(bindTT);\nif (abilityTooltips) $(\"span.abilitylink\").each(bindTT);\nif (otherTooltips) $(\"span.ajaxttlink\").each(bindTT);\nif (quickTooltips) $(\"span.tttemplatelink\").each(function () {\n$(this).mouseover(showTemplateTip);\n$(this).mouseout(hideTemplateTip);\n$(this).mousemove(moveTip);\n});\n}\n}", "title": "" }, { "docid": "c637aef07a3651025e8d7eef78f33c8a", "score": "0.6839762", "text": "function delayShowTip() {\n\t\t\t\tclearTimers();\t\t\t\n\t\t\t\t$this.delayTimer = setTimeout(showTip, o.delay);\n\t\t\t\t$this.one(o.hideEvent, hideTip);\t\t\t\t\n\t\t\t\tcallbackFn('beforeshow');\n\t\t\t}", "title": "" }, { "docid": "a70e34cac55e35a99e9d2723419c82f2", "score": "0.6703711", "text": "applyTooltips() {\n tippy(\".tipped\", {\n arrow: true,\n animateFill: false,\n size: \"small\",\n maxWidth: 200,\n interactiveBorder: 8\n });\n }", "title": "" }, { "docid": "2dc9e8f69eb1fba87ee2a3d096bd7660", "score": "0.66234237", "text": "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "title": "" }, { "docid": "93ef924b3c88f320ab92d75ee54b4fb8", "score": "0.6610458", "text": "_callToolTip () {\n const toolTip = this.getToolTip();\n const svg = this.getSVG();\n\n if (toolTip) {\n svg.call(toolTip);\n\n const toolTipNode = document.getElementById('ets-tip');\n\n if (toolTipNode) {\n toolTipNode.onmouseover = () => { this._shortCircuitHide(); };\n toolTipNode.onmouseout = () => { this._hideToolTip(); };\n }\n }\n }", "title": "" }, { "docid": "24e67769172231b90b550bb5efa945c4", "score": "0.6593985", "text": "function enableTooltip() {\n $('[v-tooltip]').tooltip({trigger: \"hover\", 'delay': {show: 1000, hide: 100}});\n}", "title": "" }, { "docid": "b7e0da9c5ab9f30d650b4acc647bda23", "score": "0.659266", "text": "function Tooltip(ldr, el)\n{\n\tvar loader = ldr;\n\tvar elem = el;\n\n\tvar shown = false;\n\tvar exited= false;\n\tvar tip = null;\n\tvar timer = null;\n\t\n\tvar initDelay = 1000;\n\t\n\tEvent.observe(elem, 'mouseover', ker.wrap(this, mouseIn));\n\tEvent.observe(elem, 'mouseout', ker.wrap(this, mouseOut));\t\n\n//=====================================================================================\n\nfunction mouseIn(event)\n{\n\tif (shown)\n\t\treturn;\n\t\t\n\tvar x = Event.pointerX(event) +12;\n\tvar y = Event.pointerY(event) +12;\n\t\n\tif (tip == null)\n\t\tsetupTooltip(x, y);\n\telse\n\t{\n\t\ttip.style.left = x;\n\t\ttip.style.top = y;\n\t\n\t\ttimer = setTimeout(ker.wrap(this, mouseIn_CB), initDelay);\t\n\t}\n}\n\n//-------------------------------------------------------------------------------------\n\nfunction mouseIn_CB()\n{\n\tElement.show(tip);\n\t\n\tshown = true;\n\ttimer = null;\n}\n\n//=====================================================================================\n\nfunction mouseOut(event)\n{\n\texited = true;\n\t\n\tif (timer)\n\t{\n\t\tclearTimeout(timer);\n\t\ttimer = null;\n\t}\n\t\n\tif (!shown)\n\t\treturn;\n\t\t\n\tElement.hide(tip);\t\n\t\n\tshown = false;\n}\n\n//=====================================================================================\n\nfunction setupTooltip(x, y)\n{\n\tvar id = elem.getAttribute('id');\n\tvar tokens = id.substring(4).split('|');\n\tvar schema = tokens[0];\n\tvar name = tokens[1];\n\tvar context = tokens[2];\n\tvar isoType = tokens[3];\n\t\n\tvar request = str.substitute(requestTemp, { SCHEMA:schema, NAME:name, CONTEXT: context, ISOTYPE: isoType });\n\t\n\texited = false;\n\t\n\tker.send('xml.schema.info', request, ker.wrap(this, function(xmlRes)\n\t{\n\t\tif (xmlRes.nodeName == 'error')\n\t\t\tker.showError(loader.getText('cannotGet'), xmlRes);\n\t\telse\n\t\t{\n\t\t\tvar htmlTip= getHtmlTip(xmlRes.getElementsByTagName('element')[0]);\n\t\t\t\n\t\t\ttip = document.createElement('div');\n\t\t\ttip.className = 'tooltip';\n\t\t\ttip.innerHTML = htmlTip;\n\t\t\ttip.style.display = 'none';\n\t\t\ttip.style.zIndex = 32000;\n\t\t\n\t\t\tdocument.body.appendChild(tip);\n\t\n\t\t\ttip.style.left = x;\n\t\t\ttip.style.top = y;\n\t\n\t\t\tif (!exited)\n\t\t\t\ttimer = setTimeout(ker.wrap(this, mouseIn_CB), 300);\t\n\t\t}\n\t}));\t\n}\n\n//=====================================================================================\n\nfunction getHtmlTip(node)\n{\n\tvar err = node.getAttribute('error');\n\t\n\tif (err != null)\n\t{\n\t\tvar temp = errorTemp;\n\t\tvar msg = loader.getText('error') +' : '+ err;\n\t\tvar data = { ERROR : msg };\n\t\t\n\t\treturn str.substitute(errorTemp, data);\n\t}\n\telse\n\t{\n\t\tvar temp = tooltipTemp;\n\t\tvar label = xml.evalXPath(node, 'label');\n\t\tvar descr = xml.evalXPath(node, 'description');\n\t\tvar cond = xml.evalXPath(node, 'condition');\n\t\tvar help = xml.evalXPath(node, 'help');\n\t\t\n\t\tif (cond == null)\n\t\t\tcond = '';\n\t\tif (help == null)\n\t\t\thelp = '';\n\t\t\n\t\tvar data = { LABEL: label, DESCRIPTION : descr, CONDITION : cond, HELP : help };\n\t\t\n\t\treturn str.substitute(tooltipTemp, data);\n\t}\n}\n\n//=====================================================================================\n/**\n * FIXME : Here you need to add any namespace required by metadata schema.\n * How could we define required namespace from registered schemas in the catalogue ?\n * \n */\nvar requestTemp =\n'<request>'+\n' <element schema=\"{SCHEMA}\" name=\"{NAME}\" context=\"{CONTEXT}\" isoType=\"{ISOTYPE}\"/>'+\n'</request>';\n\n//=====================================================================================\n\nvar tooltipTemp=\n' <b>{LABEL}</b>'+\n' <br>'+\n' {DESCRIPTION}'+\n' <br>'+\n' <font color=\"#C00000\">{CONDITION}</font>'+\n' <i>{HELP}</i>';\n\n//=====================================================================================\n\nvar errorTemp=\n' <font color=\"#C00000\">{ERROR}</font>';\n\n//=====================================================================================\n}", "title": "" }, { "docid": "ab2220311303241b038662bef4e19311", "score": "0.6567556", "text": "function titleTooltip(elem){\n $(elem).hover(function(){\n /// Hover over code\n var title = $(this).attr('title');\n $(this).data('tipText', title).removeAttr('title');\n $('<p class=\"jtt\"></p>')\n .text(title)\n .appendTo('body')\n .fadeIn('slow');\n }, function() {\n /// Hover out code\n $(this).attr('title', $(this).data('tipText'));\n $('.jtt').remove();\n }).mousemove(function(e) {\n var mousex = e.pageX + 20; /// Get X coordinates\n var mousey = e.pageY + 10; /// Get Y coordinates\n $('.jtt').css({ top: mousey, left: mousex })\n });\n}", "title": "" }, { "docid": "2ed5116d74f81e0e5857ceb4cfcb1d9c", "score": "0.65529037", "text": "function updateTooltips(){\r\n\t//Bind Tooltips with Buttons\r\n\t$(\"button[rel='tooltip']\").tooltip({\r\n\t\tplacement:'top',\r\n\t\ttrigger:'hover',\r\n\t\tanimation:'true'\r\n\t});\r\n}", "title": "" }, { "docid": "55049815683145a5ce79665d474bf70e", "score": "0.653938", "text": "function vtt_tooltip(e, id, contents){\r\n id = \"TTL_TTP_\"+id;\r\n div = document.createElement('div');\r\n div.setAttribute('id', id);\r\n div.setAttribute('style', 'position:absolute; top:120px; left:720px; padding:2px; z-index:200; border:solid 1px #000000; background-color:#FFFFFF; visibility:hidden;');\r\n div.innerHTML = contents;\r\n document.getElementById('ltop1').parentNode.appendChild(div);\r\n var timer;\r\n\r\n delay_mouseover = function (e){\r\n if (timer != undefined) window.clearTimeout(timer);\r\n timer = window.setTimeout(function(){\r\n x = document.getElementById(id);\r\n x.style.visibility = 'visible';\r\n x.style.left = (e.pageX+12)+'px';\r\n x.style.top = (e.pageY+1)+'px';\r\n }, 500);\r\n }\r\n delay_mouseout = function (){\r\n if (timer != undefined) window.clearTimeout(timer);\r\n timer = window.setTimeout(function(){\r\n document.getElementById(id).style.visibility = 'hidden';\r\n }, 300);\r\n }\r\n\r\n e.addEventListener('mouseover', delay_mouseover, false);\r\n e.addEventListener('mouseout', delay_mouseout, false);\r\n }", "title": "" }, { "docid": "e2765109c91fd210211a58e9498d8f95", "score": "0.6533368", "text": "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "title": "" }, { "docid": "281560dd6829212bf7f0e207706c03ad", "score": "0.6518657", "text": "function mouseOverHelp(i) {\n return function() {\n target.innerHTML = helperTags[i].tooltip\n };\n }", "title": "" }, { "docid": "0f26d20a97e7f8e266f0decac9f77ea9", "score": "0.6509811", "text": "function setTooltips()\r\n{\r\n $(function()\r\n {\r\n if ($(\".tooltip\").length > 0)\r\n {\r\n $(\".tooltip\").tooltip({showURL: false});\r\n }\r\n });\r\n}", "title": "" }, { "docid": "9c9492c735985a1367f7bb5c1ec6231e", "score": "0.646731", "text": "function updateTooltips() {\n jQuery('.tooltip').tooltip({showURL: false });\n}", "title": "" }, { "docid": "a5420a853894ad5c1b183a7e9946be0e", "score": "0.6464809", "text": "setupTooltipHandlers() {\n this.button.onmouseenter = () => {\n this.tooltip.showTooltip();\n };\n\n this.button.onmouseleave = () => {\n this.tooltip.hideTooltip();\n };\n }", "title": "" }, { "docid": "3291738a663ba671c40c22cd59f562c4", "score": "0.6459965", "text": "function set_tip(element_id,tip_title,tip_text){\r\n\t$(\"#\"+element_id).mouseover(function () { \r\n\t\tif(tip_title==\"\") Tip(\"\"+tip_text+\"\",BGCOLOR,\"#9CD9F7\",BALLOON,true,ABOVE,true,LEFT,true,BALLOONSTEMOFFSET,-48,OFFSETX,-40);\r\n\t\telse Tip(\"\"+tip_text+\"\",BGCOLOR,\"#E6E6E6\",TITLE,\"\"+tip_title+\"\",BGCOLOR,'#9CD9F7',TITLEBGCOLOR,'#063455');\r\n\t});\r\n\t$(\"#\"+element_id).mouseout(function () { \r\n\t\tUnTip();\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "c585b3634b10e4a3388e17a7389ce206", "score": "0.64533097", "text": "function setupTooltips() {\n var elements = getAllElementsWithAttribute(\"tooltip\");\n elements.forEach(function(element) {\n attachTooltip(element);\n });\n}", "title": "" }, { "docid": "d702c4a0103d1ffde030a3169310f508", "score": "0.6444338", "text": "function initializeTooltips() {\n // Download document link\n $('.download-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Download the document\"\n });\n\n // Delete document link\n $('.delete-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Delete the document\"\n });\n\n // Upload document link\n $('.upload-document').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Upload document\"\n });\n\n // Create new folder link\n $('.create-folder').tooltip({\n 'show': true,\n 'placement': 'top',\n 'title': \"Create new folder\"\n });\n}", "title": "" }, { "docid": "0c50688457afe9e9c33fa9216d9c2628", "score": "0.6430013", "text": "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "title": "" }, { "docid": "c9a7284e5c23a1519e97a17b326cbb7f", "score": "0.64243764", "text": "function toolTips(el,help) {\n\t\t$(el).on('mouseenter', function() {\n\t\t\t$(help).show();\n\t\t\t$(el).on('click', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t\t$(el).on('mouseleave', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "12c472f797d028c528370718bab2b423", "score": "0.64133984", "text": "set tooltip(value) {}", "title": "" }, { "docid": "d1cba5ea5332a71184b28d3c42dd31a0", "score": "0.6409066", "text": "updateHoverDelay(delay) {\n this.setHoverTarget.delay = delay;\n }", "title": "" }, { "docid": "8de45b1c9f0d93ad5720cfda2dedce82", "score": "0.64074796", "text": "function showTooltipBind() {\n if ( scope.tt_popupDelay ) {\n popupTimeout = $timeout( show, scope.tt_popupDelay );\n } else {\n scope.$apply( show );\n }\n }", "title": "" }, { "docid": "451657a1a820ee352103f864121cc29a", "score": "0.64024526", "text": "tooltipClicked() {}", "title": "" }, { "docid": "ea79518623b1d909b1af5626f385f429", "score": "0.6394499", "text": "function tooltips() {\r\n\t$('.tooltip-link').tooltip();\r\n}", "title": "" }, { "docid": "c902f250df74804fbe5e966a80a9d83c", "score": "0.6387099", "text": "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n scheduler: me.client\n });\n me.tip = new Tooltip({\n id: `${me.client.id}-time-range-tip`,\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n updateContentOnMouseMove: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "title": "" }, { "docid": "cca769ba48e2d1309faa394fa76487ee", "score": "0.6386523", "text": "function timelineEventHover(e){\n\n\t\t\t\tvar $tooltip = $(\".battle .tooltip\");\n\n\t\t\t\t$tooltip.show();\n\n\t\t\t\t$tooltip.attr(\"class\",\"tooltip\");\n\n\t\t\t\tif(sandbox){\n\t\t\t\t\t$tooltip.attr(\"class\",\"tooltip sandbox\");\n\t\t\t\t}\n\n\t\t\t\t$tooltip.find(\".name\").html($(this).attr(\"name\"));\n\t\t\t\t$tooltip.addClass($(this).attr(\"class\"));\n\t\t\t\t$tooltip.find(\".details\").html('');\n\n\t\t\t\tif((($(this).hasClass(\"fast\")) || ($(this).hasClass(\"charged\")))&&(! $(this).hasClass(\"tap\"))){\n\n\t\t\t\t\tvar values = $(this).attr(\"values\").split(',');\n\n\t\t\t\t\t$tooltip.find(\".details\").html(values[0] + \" damage\");\n\n\t\t\t\t\t// Append damage percentage\n\t\t\t\t\tif(values.length > 2){\n\t\t\t\t\t\t$tooltip.find(\".details\").append(\" (\"+values[2]+\"%)\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$tooltip.find(\".details\").append(\"<br>\" + values[1] + \" energy\");\n\n\t\t\t\t\t// Append stat boost string, if any\n\t\t\t\t\tif(values.length == 4){\n\t\t\t\t\t\t$tooltip.find(\".details\").append(\"<br>\"+values[3]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar width = $tooltip.width();\n\t\t\t\tvar left = (e.pageX - $(\".section\").first().offset().left) + 25;\n\t\t\t\tvar top = e.pageY - 20;\n\n\t\t\t\tif( left > ($(\".timeline-container\").width() - width - 10) ){\n\t\t\t\t\tleft -= width + 35;\n\t\t\t\t}\n\n\t\t\t\t$tooltip.css(\"left\",left+\"px\");\n\t\t\t\t$tooltip.css(\"top\",top+\"px\");\n\t\t\t}", "title": "" }, { "docid": "493b180a6799c2e601f158d3e0a44c53", "score": "0.636652", "text": "tooltip() {\n const { options, tooltipBox, imageData } = this;\n\n if (!this.viewed || this.played || !options.tooltip) {\n return this;\n }\n\n tooltipBox.textContent = `${Math.round(imageData.ratio * 100)}%`;\n\n if (!this.tooltipping) {\n if (options.transition) {\n if (this.fading) {\n dispatchEvent(tooltipBox, EVENT_TRANSITION_END);\n }\n\n addClass(tooltipBox, CLASS_SHOW);\n addClass(tooltipBox, CLASS_FADE);\n addClass(tooltipBox, CLASS_TRANSITION);\n tooltipBox.removeAttribute('aria-hidden');\n\n // Force reflow to enable CSS3 transition\n tooltipBox.initialOffsetWidth = tooltipBox.offsetWidth;\n addClass(tooltipBox, CLASS_IN);\n } else {\n addClass(tooltipBox, CLASS_SHOW);\n tooltipBox.removeAttribute('aria-hidden');\n }\n } else {\n clearTimeout(this.tooltipping);\n }\n\n this.tooltipping = setTimeout(() => {\n if (options.transition) {\n addListener(tooltipBox, EVENT_TRANSITION_END, () => {\n removeClass(tooltipBox, CLASS_SHOW);\n removeClass(tooltipBox, CLASS_FADE);\n removeClass(tooltipBox, CLASS_TRANSITION);\n tooltipBox.setAttribute('aria-hidden', true);\n this.fading = false;\n }, {\n once: true,\n });\n\n removeClass(tooltipBox, CLASS_IN);\n this.fading = true;\n } else {\n removeClass(tooltipBox, CLASS_SHOW);\n tooltipBox.setAttribute('aria-hidden', true);\n }\n\n this.tooltipping = false;\n }, 1000);\n\n return this;\n }", "title": "" }, { "docid": "8b8d4592a73c5f9251cfc488565f84c8", "score": "0.63467216", "text": "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "title": "" }, { "docid": "c5e8aab5623e819181a232d5b03a8d3f", "score": "0.633322", "text": "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "title": "" }, { "docid": "06d60938c7db010275ca45fa6786f4de", "score": "0.6325157", "text": "bindEvents ($element) {\n let showEvents = 'srf.tooltip.show',\n hideEvents = 'srf.tooltip.hide';\n\n if ($element.data('tooltipNoHover') === undefined) {\n showEvents += ' mouseenter focus';\n hideEvents += ' mouseleave focusout';\n }\n\n $element.on(showEvents, () => {\n $element.children('.tooltip').remove();\n\n $element.append(this.template);\n $element.css('position', 'relative');\n\n $element.find('.tooltip-content').html(this.title);\n\n const $tooltip = $element.children('.tooltip');\n\n // use custom offset, if defined. Otherwise take the default offset\n let offset = $element.data('tooltipOffset') ? $element.data('tooltipOffset') : DEFAULT_OFFSET;\n\n // Move tooltip in right position relative to its parent\n const leftPosition = (this.originalWidth - $tooltip.width()) / 2;\n const topPosition = ($tooltip.height() + ADDITIONAL_OFFSET + offset) * -1;\n\n $tooltip.css({\n 'top': topPosition,\n 'left': leftPosition - 8,\n 'position': 'absolute'\n });\n }).on(hideEvents, () => {\n $element.children('.tooltip').remove();\n });\n }", "title": "" }, { "docid": "af7ddb828145b1764364e2ceae86050d", "score": "0.6315583", "text": "function showTooltip(d) { \n\n //Show how to close tooltip\n d3.select(\"#tooltipInfo\").style(\"visibility\", \"visible\");\n \n //Make a different offset for really small planets\n //var Offset = (rScale(d.Radius)/2 < 2) ? 3 : rScale(d.Radius)/2;\n // var xOffset = ((10*d.radius)/2 < 3) ? 6 : (10*d.radius)/2;\n // var yOffset = ((10*d.radius)/2 < 3) ? 0 : (10*d.radius)/2;\n\n var xOffset = 15;\n var yOffset = 15;\n\n //Set first location of tooltip and change opacity\n var xpos = d.x + x/2 - xOffset + 3;\n var ypos = d.y + y/2 - yOffset - 5;\n \n d3.select(\"#tooltip\")\n .style('top',ypos+\"px\")\n .style('left',xpos+\"px\")\n .transition().duration(500)\n .style('opacity',1);\n \n //Keep the tooltip moving with the planet, until stopTooltip \n //returns true (when the user clicks)\n d3.timer(function() { \n xpos = d.x + x/2 - xOffset + 3;\n ypos = d.y + y/2 - yOffset - 5;\n \n //Keep changing the location of the tooltip\n d3.select(\"#tooltip\")\n .style('top',ypos+\"px\")\n .style('left',xpos+\"px\");\n \n //Breaks from the timer function when stopTooltip is changed to true\n //by another function\n if (stopTooltip == true) { \n //Hide tooltip info again\n d3.select(\"#tooltipInfo\").style(\"visibility\", \"hidden\");\n //Hide tooltip\n d3.select(\"#tooltip\").transition().duration(300)\n .style('opacity',0)\n .call(endall, function() { //Move tooltip out of the way\n d3.select(\"#tooltip\")\n .style('top',0+\"px\")\n .style('left',0+\"px\");\n }); \n //Remove show how to close\n return stopTooltip;\n }\n });\n\n //Change the texts inside the tooltip\n d3.select(\"#tooltip .tooltip-bug-id\").text(d.bug_id);\n d3.select(\"#tooltip .tooltip-year\").html(\"Crated in: \" + parseInt(d.creation_ts / (3600*24*365) + 1970));\n //d3.select(\"#tooltip-class\").html(\"Temperature of star: \" + d.temp + \" Kelvin\");\n d3.select(\"#tooltip-desc\").html(d.short_desc);\n}//showTooltip ", "title": "" }, { "docid": "bee81c98f533e1554e454259a41f6d38", "score": "0.62891597", "text": "function toggleAllTooltips() {\n \ttooltip_active = true; //only set to true during programmatic triggering of events\n\n \t$.each(pegList, function( index1, arr ) {\n \t\t$.each(arr, function( index2, peg ) {\n\n \t\t\t//if the tooltips are not being shown, turn them on\n \t\t\tif (!tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseenter');\n \t\t\t}\n \t\t\t//if the tooltips are being shown, turn them off\n \t\t\telse if (tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseleave');\n \t\t\t}\n \t\t\t//else - Error\n \t\t\telse {\n \t\t\t\tconsole.log('Error with toggleAllTooltips');\n \t\t\t\talert('Error with toggling tooltips - tooltip_status reached unknown state');\n \t\t\t}\n\n \t\t});\n \t});\n \ttooltip_active = false; //set back to false to prevent non-programmatic event triggers\n \ttooltip_status = (!tooltip_status) ? true : false;\n }", "title": "" }, { "docid": "543bf527ec4f03a42717d3702f1e1d1f", "score": "0.6280195", "text": "function responsiveTooltips() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.nectar_image_with_hotspots').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find('.nectar_hotspot_wrap').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (nectarDOMInfo.winW > 690) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Remove click if applicable\r\n\t\t\t\t\t\t\t\tif ($(this).parents('.nectar_image_with_hotspots[data-tooltip-func=\"hover\"]').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nectar_hotspot').removeClass('click');\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').removeClass('open');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip .inner a.tipclose').remove();\r\n\t\t\t\t\t\t\t\t$('.nttip').css('height', 'auto');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Reset for positioning\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'width': 'auto',\r\n\t\t\t\t\t\t\t\t\t'height': 'auto'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-right')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-left')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-top')\r\n\t\t\t\t\t\t\t\t\t.css('width', 'auto');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $tipOffset = $(this).find('.nttip').offset();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Against right side \r\n\t\t\t\t\t\t\t\tif ($tipOffset.left > $(this).parents('.nectar_image_with_hotspots').width() - 200) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').css('width', '250px');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').css('width', 'auto');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Responsive\r\n\t\t\t\t\t\t\t\tif ($tipOffset.left < 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-right');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ($tipOffset.left + $(this).find('.nttip').outerWidth(true) > nectarDOMInfo.winW) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-left').css('width', '250px');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if ($tipOffset.top + $(this).find('.nttip').height() + 35 > $window.height() && $('#nectar_fullscreen_rows').length > 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip').addClass('force-top');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($(this).find('> .open').length == 0) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t\t'width': '30px',\r\n\t\t\t\t\t\t\t\t\t\t'height': '30px'\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//fixed position\r\n\t\t\t\t\t\t\t\t$(this).find('.nttip')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-left')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-right')\r\n\t\t\t\t\t\t\t\t\t.removeClass('force-top');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).find('.nectar_hotspot').addClass('click');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($(this).find('.nttip a.tipclose').length == 0) {\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nttip .inner').append('<a href=\"#\" class=\"tipclose\"><span></span></a>');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Change height of fixed\r\n\t\t\t\t\t\t\t\t$('.nttip').css('height', $window.height());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "title": "" }, { "docid": "4fc791c9fa3ab038d480c338902b2213", "score": "0.62783235", "text": "function updateTips(tips, t ) {\r\n tips.text( t ).addClass( \"ui-state-highlight\" );\r\n setTimeout(function() {\r\n tips.removeClass( \"ui-state-highlight\", 1500 );\r\n }, 500 );\r\n}", "title": "" }, { "docid": "7a80539f50bc97e183f7402825feddbb", "score": "0.6277706", "text": "function mouseoutsc(d) {\n tooltipSct.transition()\n .duration(500)\n .style(\"opacity\", 0);\n}", "title": "" }, { "docid": "1b9bb340f6ef530c92df6c7ee5fef306", "score": "0.62670773", "text": "setup_tooltip_hover(rects){\n let w = this.w;\n let state = this.cur_state;\n let map_mode = this.map_mode;\n rects.on(\"mouseover\", function(d) {\n //Update and show the tooltip\n d3.select(\"#tooltip\")\n .style(\"left\", (w -100) + \"px\")\n .select(\"#value\")\n .text(d.mort_rate + \"/100K\");\n d3.select(\"#tooltip\").select(\"#tooltipLabel\").text(d.name);\n d3.select(\"#tooltip\").classed(\"hidden\", false);\n // highlight the state/county on the map\n if(map_type_level === \"state\"){\n map.eachLayer(function(layer){\n if(layer.feature){\n if(layer.feature.properties.name === d.name){\n highlightFeature({target: layer});\n }\n }\n });\n }else if (d.type === \"County\"){\n let geoid = get_geoid_from_mort_rate_county_name(d.name, state);\n map.eachLayer(function(layer){\n if(layer.feature){\n if(layer.feature.properties.GEO_ID === geoid){\n highlightCountyFeature({target: layer});\n }\n }\n });\n }\n })\n .on(\"mouseout\", function(d) { \n d3.select(\"#tooltip\").classed(\"hidden\", true);\n //unhighlight state/county\n if(map_type_level === \"state\"){\n map.eachLayer(function(layer){\n if(layer.feature){\n if(layer.feature.properties.name === d.name){\n resetHighlight({target: layer});\n }\n }\n });\n }else if(d.type === \"County\"){\n let geoid = get_geoid_from_mort_rate_county_name(d.name, state);\n map.eachLayer(function(layer){\n if(layer.feature){\n if(layer.feature.properties.GEO_ID === geoid){\n resetHighlightCounty({target: layer});\n }\n }\n });\n }\n });\n return rects;\n }", "title": "" }, { "docid": "3c3765e8f4430bdfaa1e11047cfd65ed", "score": "0.6260377", "text": "function ttMouseOver(foo) {\nif (tooltipsOn && getCookie(\"wiki-tiploader\") != \"no\") {\n$(\"#WikiaArticle\").mouseover(hideTip);\n$(\"#WikiaArticle\").append('<div id=\"tfb\" class=\"htt\"></div><div id=\"templatetfb\" class=\"htt\"><div>');\n$tfb = $(\"#tfb\");\n$ttfb = $(\"#templatetfb\");\n$htt = $(\"#tfb,#templatetfb\");\nif(foo==1){\n$(\"#WikiaArticle span.ajaxttlink\").each(bindTT);\n}\n$(\"#WikiaArticle span.tttemplatelink\").mouseover(showTemplateTip).mouseout(hideTemplateTip).mousemove(moveTip);\n}\n}", "title": "" }, { "docid": "9228fcd40201e46e1ef2697881163fbd", "score": "0.62591577", "text": "function doTooltip(d, i) {\n\tvar commonname = toTitleCase(d['Common names (Eng)'].split(',')[0]);\n\tif (commonname=='') {\n\t\tcommonname = toTitleCase(d.Genus)+ \" \" +d.Species;\n\t//ttsciname.text(' ');\n \t//ttspecieslabel.text(toTitleCase(d.Genus)+ \" \" +d.Species);\n \t//ttthreatlabel.text(threatdict[d['Red List status']].toUpperCase())\n\t} \n\t\n\tttspecieslabel.text(commonname);\n \tttthreatlabel.text(threatdict[d['Red List status']].toUpperCase())\n\twordlen=Math.max(commonname.length, threatdict[d['Red List status']].length)\n\t\n\ttooltip\n\t\t.style(\"left\", getFocusXFromGenus(d[\"genus-order\"])-13+\"px\")//+focuswidth+8+\"px\")\n\t\t.style(\"top\", tooltipy0+\"px\")//(getSpeciesFocusY(d)+(classdata[currclassindex].focusheight/2.0))+\"px\")\n\t\t.style(\"display\", \"block\")\n\t\t//.style(\"width\", 10*wordlen+\"px\")\n}", "title": "" }, { "docid": "b7325bd9b9a3461f576da999a0561878", "score": "0.6244951", "text": "function init_tooltips(){\n \n $(\".tooltip-bot, .tooltip-bot a, .nav-social-links a\").tooltip({\n placement: \"bottom\"\n });\n \n $(\".tooltip-top, .tooltip-top a\").tooltip({\n placement: \"top\"\n });\n \n \n $(\".tooltip-right, .tooltip-right a\").tooltip({\n placement: \"right\"\n });\n \n \n $(\".tooltip-left, .tooltip-left a\").tooltip({\n placement: \"left\"\n });\n \n }", "title": "" }, { "docid": "0299ce3f77b198882b15ba015955cfea", "score": "0.6238478", "text": "function mouseOver() {\n console.log(\"mouse over\");\n clearTimeout(timeoutvar);\n}", "title": "" }, { "docid": "39500fe7963d831f7f8eb83fdf77f87a", "score": "0.623244", "text": "function createTooltip(position, elem, ttContent)\r\n{\r\n\tvar myPosition = \"center top+20\";\r\n\tvar atPosition = \"center bottom\";\r\n\tvar arrowClass = \"arrow\";\r\n\t\r\n\tif(position == \"bottom\")\r\n\t{\r\n\t\tmyPosition = \"center top+15\";\r\n\t\tatPosition = \"center bottom\";\r\n\t}\r\n\telse if(position == \"top\")\r\n\t{\r\n\t\tmyPosition = \"center bottom-15\";\r\n\t\tatPosition = \"center top\";\r\n\t}\r\n\telse if(position == \"left\")\r\n\t{\r\n\t\tmyPosition = \"right-15 center\";\r\n\t\tatPosition = \"left center\";\r\n\t\t\r\n\t\tarrowClass = \"arrowHor\";\r\n\t}\r\n\telse if(position == \"right\")\r\n\t{\r\n\t\tmyPosition = \"left+15 center\";\r\n\t\tatPosition = \"right center\";\r\n\t\t\r\n\t\tarrowClass = \"arrowHor\";\r\n\t}\r\n\t\r\n\telem.tooltip({\r\n\t\titems: elem.prop(\"tagName\"),\r\n\t\tcontent: ttContent,\r\n\t\tdelay: 5000,\r\n\t position: {\r\n\t\t my: myPosition,\r\n\t\t at: atPosition,\r\n\t\t /*\r\n\t\t using: function( position, feedback ) {\r\n\t\t $( this ).css( position );\r\n\t\t $( \"<div>\" )\r\n\t\t .addClass( arrowClass )\r\n\t\t .addClass( feedback.vertical )\r\n\t\t .addClass( feedback.horizontal )\r\n\t\t .appendTo( this );\r\n\t\t }\r\n\t\t */\r\n\t },\r\n\t\topen: function(event, ui) {\r\n\t\t\tvar tooltip = ui.tooltip;\r\n\t\t\tsetTimeout(function(tooltip){tooltip.hide();}, 4000, tooltip);\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "b78b16389c6ca3c685059b476aff91e4", "score": "0.6229509", "text": "function setTooltips(){\n\t\t\t\t\tvar tooltip_desk = d3.select(\".tooltip_map_desk\"),\n\t\t\t\t\t\ttooltip_desk_empty= d3.select(\".tooltip_map_desk_empty\");\n\n\t\t\t\t\t//tooltip for empty desks\n\t\t\t\t\tvar allTables_empty = d3.select(\"#tables\")\n\t\t\t\t\t\t.selectAll(\".available, .available-temp\")\n\t\t\t\t\t\t.select(\"rect\")\n\t\t\t\t\t\t.style(\"cursor\", \"pointer\")\n\t\t\t\t\t\t.on(\"click\", function(){\n\t\t\t\t\t\t\ttooltip_desk_empty.transition().duration(1).style(\"opacity\", 0).style(\"z-index\", -1);\n\t\t\t\t\t\t\tvar xPosition = event.clientX,\n\t\t\t\t\t\t\t\tyPosition = event.clientY;\n\t\t\t\t\t\t\t// get scroll pixels to correct tooltip's yPostion\n\t\t\t\t\t\t\tyPosition += $(window).scrollTop();\n\t\t\t\t\t\t\ttooltip_desk_empty.html(d3.event.target.parentNode.id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"position\",\"absolute\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"left\", xPosition-250+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"top\", yPosition-300+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"height\", \"20px\");\n\t\t\t\t\t\t\ttooltip_desk_empty.transition().duration(200).style(\"opacity\", .9).style(\"z-index\", 20);\n\t\t\t\t\t\t\tevent.stopPropagation();\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// click the tooltip won't let it disappear\n\t\t\t\t\t\t$(\".tooltip_map_desk_empty\").click(function(event) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// click elsewhere will make tooltip disappear\n\t\t\t\t\t\t$(\"html, .occuupied, .occupied-temp\").click(function () {\n\t\t\t\t\t\t\ttooltip_desk_empty.transition()\n\t\t\t\t\t\t\t\t\t\t\t\t.duration(500)\n\t\t\t\t\t\t\t\t\t\t\t\t.style(\"opacity\", 0)\n\t\t\t\t\t\t\t\t\t\t\t\t.style(\"z-index\", -1);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t});\n\t\t\t\t\td3.selectAll(\".icon\").style(\"cursor\", \"pointer\").on(\"click\", function(){\n\t\t\t\t\t\t\ttooltip_desk.transition().duration(1).style(\"opacity\", 0).style(\"z-index\", -1);\n\t\t\t\t\t\t\tconsole.log(\"ADEDIGADOOOOOO\");\n\t\t\t\t\t\t\tvar xPosition = event.clientX,\n\t\t\t\t\t\t\t\tyPosition = event.clientY;\n\t\t\t\t\t\t\t// get scroll pixels to correct tooltip's yPostion\n\t\t\t\t\t\t\tyPosition += $(window).scrollTop();\n\t\t\t\t\t\t\ttooltip_desk_empty.html(d3.event.target.parentNode.id.replace(/_/g,\" \"))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"position\",\"absolute\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"left\", xPosition-250+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"top\", yPosition-300+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"height\", \"20px\");\n\t\t\t\t\t\t\ttooltip_desk_empty.transition().duration(200).style(\"opacity\", .9).style(\"z-index\", 20);\n\t\t\t\t\t\t\tevent.stopPropagation();\t\n\t\t\t\t\t\t});\n\t\t\t\t\t;\n\n\n\t\t\t\t\tvar allTables_occupied = d3.select(\"#tables\")\n\t\t\t\t\t\t.selectAll(\".occupied, .occupied-temp\")\n\t\t\t\t\t\t.select(\"rect\")\n\t\t\t\t\t\t.style(\"cursor\", \"pointer\")\n\t\t\t\t\t\t.on(\"click\", function(){\n\t\t\t\t\t\t\ttooltip_desk.transition().duration(1).style(\"opacity\", 0).style(\"z-index\", -1);\n\t\t\t\t\t\t\tvar xPosition = event.clientX,\n\t\t\t\t\t\t\t\tyPosition = event.clientY;\n\t\t\t\t\t\t\t// get scroll pixels to correct tooltip's yPostion\n\t\t\t\t\t\t\tyPosition += $(window).scrollTop();\n\t\t\t\t\t\t\ttooltip_desk.html(d3.event.target.id + \"<br/>\"+ d3.event.target.parentNode.id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"position\",\"absolute\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"left\", xPosition-250+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"top\", yPosition-300+ \"px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.style(\"height\", \"auto\");\n\t\t\t\t\t\t\ttooltip_desk.transition().duration(200).style(\"opacity\", .9).style(\"z-index\", 20);\n\t\t\t\t\t\t\tevent.stopPropagation();\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// click the tooltip won't let it disappear\n\t\t\t\t\t\t$(\".tooltip_map_desk\").click(function(event) {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t// click elsewhere will make tooltip disappear\n\t\t\t\t\t\t$(\"html, .available, .available-temp\").click(function () {\n\t\t\t\t\t\t\t//console.log('yoyou')\n\t\t\t\t\t\t\t\t\t\t\ttooltip_desk.transition()\n\t\t\t\t\t\t\t\t\t\t\t\t.duration(500)\n\t\t\t\t\t\t\t\t\t\t\t\t.style(\"opacity\", 0)\n\t\t\t\t\t\t\t\t\t\t\t\t.style(\"z-index\", -1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t;\n\t\t\t}", "title": "" }, { "docid": "5001cf37e9808a102b4b089a73b9ef82", "score": "0.62289447", "text": "toggleTooltips() {\n self.enableTooltips = !self.enableTooltips;\n }", "title": "" }, { "docid": "fa68146ae3a9b645dc9bb916fd6091b3", "score": "0.6215359", "text": "function tooltip(){\n $(\".waypoints-header\").tooltip({\n position: {\n my: \"center\", \n at: \"bottom\", \n of: \"#waypoints\"\n },\n show: {\n effect: \"slideDown\",\n delay: 1\n }, \n });\n}", "title": "" }, { "docid": "ff2886e617527e12c81c6d3a2bd0fd7b", "score": "0.62131965", "text": "function initTooltips() {\n $('span[class^=\"pl-\"]').each(function () {\n $(this).mouseenter(function () {\n showTooltip($(this));\n });\n\n $(this).mouseleave(function () {\n hideTooltip($(this));\n });\n });\n}", "title": "" }, { "docid": "95e104bbccc70d689e398a3b1b6a914e", "score": "0.62103", "text": "function updateTips(t) {\n tips.text(t).addClass(\"ui-state-highlight\");\n setTimeout(function() {\n tips.removeClass(\"ui-state-highlight\", 1500);\n }, 500);\n}", "title": "" }, { "docid": "92e736b96f2ca8c505c7e8fc4d918bbf", "score": "0.6209853", "text": "function hoverTooltip(id, type) {\n $('#' + id + ' .tools-' + type + ', #' + id + ' .bubble-' + type).hover(function() {\n $('#' + id + ' .bubble-' + type).show();\n }, function() {\n $('#' + id + ' .bubble-' + type).hide();\n });\n}", "title": "" }, { "docid": "8020307fee89d878b3a574c676ba9173", "score": "0.61977816", "text": "function init_tooltips(){\n\n $(\".tooltip-bot, .tooltip-bot a, .nav-social-links a\").tooltip({\n placement: \"bottom\"\n });\n\n $(\".tooltip-top, .tooltip-top a\").tooltip({\n placement: \"top\"\n });\n\n }", "title": "" }, { "docid": "c1c7b5b45b16c0f4c60cb6e95874ea1f", "score": "0.6196199", "text": "function hoverTip(){\n\t\tvar object = d3.select(this).data()[0];\n\t\tvar objectBox = path.bounds(object);\n\t\tvar objectData = object.properties.values[0];\n\t\tif(HTMLWidgets.shinyMode)var sidebar = d3.select('#sidebarCollapsed').attr('data-collapsed');\n\t\tvar xMove = sidebar == false ? 50 : 0;\n\t\tvar nameFormat = that.options.nameFormat != \"text\" ? d3.format(that.options.nameFormat ? that.options.nameFormat : \"d\") : function(x) {return x;} ;\n\t\tvar valueFormat = d3.format(that.options.valueFormat ? that.options.valueFormat : \"d\");\n\t\tvar toolTipFormat = d3.format(that.options.toolTipFormat ? that.options.toolTipFormat : \"d\");\n\t\t\n\t\td3.select(this).transition()\n\t\t\t.style('fill', function(d){ \n\t\t\t\tvar values = d.properties.values[0];\n\t\t\t\tvar colorValue = values[ly.mapping.dataValue];\n\t\t\t\treturn d3.rgb(that.colorScale(colorValue)).darker(1); \n\t\t\t\t});\n\t\t\n\t\tthat.tooltip\n .style(\"left\", (d3.mouse(this)[0] - xMove) + 'px')\n\t\t\t .style(\"top\", (d3.mouse(this)[0] - 40) + 'px')\n .style(\"display\", \"inline-block\")\n .html(function() {\n\t\t\t\t if(ly.mapping.toolTip){\n\t\t\t\t\treturn ly.mapping.dataKey + \": \" + nameFormat(objectData[ly.mapping.dataKey]) + '<br>' + \n\t\t\t\t\tly.mapping.dataValue + \": \" + valueFormat(objectData[ly.mapping.dataValue]) + '<br>' +\n\t\t\t\t\tly.mapping.toolTip + \": \" + toolTipFormat(objectData[ly.mapping.toolTip])\n\t\t\t\t } else {\n\t\t\t\t\treturn ly.mapping.dataKey + \": \" + nameFormat(objectData[ly.mapping.dataKey]) + '<br>' + \n\t\t\t\t\tly.mapping.dataValue + \": \" + valueFormat(objectData[ly.mapping.dataValue])\n\t\t\t\t }\n\t\t\t });\n\t\t\t \n\t}", "title": "" }, { "docid": "8622d0742cb382b78c19a2d12a70a050", "score": "0.6186561", "text": "function switchToolTip() {\n //show information box when the mouse is placed on top of the question mark image\n document.getElementById('questionmark').onmouseover = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'block';\n };\n //hide information box when mouse is moved away from question mark image\n document.getElementById('questionmark').onmouseout = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'none';\n };\n}", "title": "" }, { "docid": "a52e158cee078452b06054ceca87e50c", "score": "0.61799234", "text": "initTooltip() {\n const me = this,\n client = me.client;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n });\n\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "title": "" }, { "docid": "8fd1552ebd40dd3ef215432efe398f07", "score": "0.6174143", "text": "componentDidUpdate() {\n toolTips.hoverText();\n toolTips.hoverRadios();\n toolTips.write();\n }", "title": "" }, { "docid": "6582c7385e9b57fd21aa3a2668a3d7c5", "score": "0.61716706", "text": "initTooltip() {\n const me = this,\n {\n client\n } = me;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n scheduler: client\n });\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n updateContentOnMouseMove: true,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n\n });\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "title": "" }, { "docid": "859a39dc13302baac68d563ffe2b9a0f", "score": "0.61621857", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "5682aa8ef96742e37e56411b014beba8", "score": "0.6162087", "text": "function tooltip(e,t,title) {\r\n\t\t$('<div id=\"tooltip\" />')\r\n .appendTo('body')\r\n .text(title)\r\n .hide()\r\n .css({\r\n backgroundImage : 'url(./assets/images/skins/'+settings.skin+'/'+settings.skin+'_controlpanel.png)',\r\n\t\t\tbackgroundPosition : 'top left',\r\n\t\t\tbackgroundRepeat : 'repeat-x',\r\n\t\t\tcolor : settings.label,\r\n\t\t\tborder: '1px solid ' + settings.label,\r\n\t\t\ttop: e.pageY - 20,\r\n left: e.pageX + 20\r\n })\r\n .fadeIn(350);\r\n\t\t\r\n\t\tt.mousemove(function(e) {\r\n\t\t $('#tooltip').css({\r\n\t\t\ttop: e.pageY - 20,\r\n\t\t\tleft: e.pageX + 20\r\n\t\t });\r\n\t\t});\r\n\t }", "title": "" }, { "docid": "1f1e90827d2d43e262bf35ab78cf0852", "score": "0.6161471", "text": "function setResultTooltips()\n {\n var textLength = my.current.subunitText.length\n var charNoun = textLength == 1 ? 'character' : 'characters'\n\n // Speed tooltip\n my.html.speed.title =\n 'You have typed ' + textLength + ' ' + charNoun +\n ' in\\n' +\n Util.prettyTime(my.current.timeElapsed) + '.\\n\\n' +\n 'Your typing speed is\\n' +\n my.current.wpm + ' words per minute, or\\n' +\n my.current.cpm + ' characters per minute.'\n\n\n // Error rate tooltip\n var errorRateTooltip\n var accuracyTooltip\n\n // Update error rate\n if (my.current.errorRate == Number.POSITIVE_INFINITY) {\n errorRateTooltip = '\\u221e'\n accuracyTooltip = 0\n } else {\n errorRateTooltip = parseFloat(my.current.errorRate.toFixed(1))\n accuracyTooltip = 100 - errorRateTooltip\n }\n\n var errorNoun = my.current.errors == 1 ? 'error' : 'errors'\n\n var title =\n 'You have typed ' + textLength + ' ' + charNoun +\n '.\\n' +\n 'You have made ' + my.current.errors + ' ' +\n errorNoun + '.\\n' +\n 'Your error rate is ' + errorRateTooltip + '%.\\n' +\n 'Your accuracy is ' + accuracyTooltip + '%.\\n'\n\n my.html.error.title = title\n }", "title": "" }, { "docid": "835beaa88c5818c07f4937f8aed68b4e", "score": "0.61556834", "text": "function hideTooltip() {\r\n\tsetTimeout(function() {\r\n\t\t$('.btn-copy').tooltip('hide');\r\n\t}, 1000);\r\n}", "title": "" }, { "docid": "e5494d7e8477f92540a03d405b381a27", "score": "0.61547875", "text": "function mouseoverTooltip2(d, i) {\n var mouseCoords = d3.mouse(this);\n var shiftX = infoBarX + infoBarPieY + 137;\n var shiftY = infoBarY + infoBarPieX + 260;\n\n d3.select(\"#tooltip\")\n .style(\"left\", (mouseCoords[0] + shiftX + \"px\"))\n .style(\"top\", (mouseCoords[1] + shiftY + 27 * i + \"px\"))\n .html(function() {\n return (\"<b>\" + d.type + \" \" + fmtPer(d.value/d.total) + \"</b><br>\" + Math.round(d.value / 1000) + \" PetaJoules\")\n })\n .classed(\"hidden\", false);\n}", "title": "" }, { "docid": "9e1085e3d465591f671f45b9541271b4", "score": "0.61536926", "text": "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "title": "" }, { "docid": "1b932e3ea0797cd2691816720b526d3f", "score": "0.6152258", "text": "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "title": "" }, { "docid": "31185f919fe7cfe7455a56246997614c", "score": "0.6148703", "text": "function tooltip(){\r\n\t\ttry{\r\n\t\t\tvar tooltips = document.getElementsByClassName(\"inew-tooltiptext\");\r\n\t\t\tfor (var i = tooltips.length - 1; i >= 0; --i) {\r\n\t\t\t\tvar tooltipCount = tooltips[i].innerHTML.length;\r\n\t\t\t\tif (tooltipCount > 22){\r\n\t\t\t\t\ttooltips[i].className = \"inew-tooltiptext inew-tooltipLarge\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch (e){}\t\r\n\t}", "title": "" }, { "docid": "a26e66a140742c87d525604faa40a19d", "score": "0.6148226", "text": "function show() {\n tID = null;\n let isBrowsable = false;\n if ($.tooltip.current !== null) {\n isBrowsable = settings($.tooltip.current).isBrowsable;\n }\n\n if ((!IE || !$.fn.bgiframe) && settings($.tooltip.current).fade) {\n if (helper.parent.is(':animated'))\n helper.parent\n .stop()\n .show()\n .fadeTo(settings($.tooltip.current).fade, 100);\n else\n helper.parent.is(':visible')\n ? helper.parent.fadeTo(\n settings($.tooltip.current).fade,\n 100\n )\n : helper.parent.fadeIn(settings($.tooltip.current).fade);\n } else {\n helper.parent.show();\n }\n\n $(helper.parent[0])\n .unbind('mouseenter')\n .unbind('mouseleave')\n .mouseenter(function () {\n if (isBrowsable) {\n $.tooltip.currentHover = true;\n }\n })\n .mouseleave(function () {\n if (isBrowsable) {\n // if tooltip has scrollable content or selectionnable text - should be closed on mouseleave:\n $.tooltip.currentHover = false;\n helper.parent.hide();\n }\n });\n\n update();\n }", "title": "" }, { "docid": "38dbab575a8c4781eb73087396bc8b62", "score": "0.61481905", "text": "function updateTooltip(e) { \n styleTip( element, tooltip, ops.placement, ops.container, e )\n }", "title": "" }, { "docid": "dc2309a80f1cea279f0cfb7e85804517", "score": "0.61461616", "text": "function hideTooltip() {\n if (angular.isUndefined(_tooltip)) {\n return;\n }\n\n $timeout.cancel(_hoverTimeout);\n\n _tooltip.remove();\n _tooltip = undefined;\n }", "title": "" }, { "docid": "b62143dd0c88e735d8c01655b2ff50f7", "score": "0.6139014", "text": "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: me.client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "title": "" }, { "docid": "68799b0270f292a554b9e427012b4e85", "score": "0.6136116", "text": "function mouseLeave() {\n tooltip\n .style(\"opacity\", 0)\n .style(\"display\",\"none\")\n}", "title": "" }, { "docid": "0dde8bc62e14213b27f26e5a0f431607", "score": "0.61246717", "text": "async showTooltip() {\n this.actionEventHandler();\n }", "title": "" }, { "docid": "80d4e203874e3d45050c96eabba14189", "score": "0.61129946", "text": "function initBootstrapTooltips() {\n const options = {\n delay: { \"show\": 750, \"hide\": 100 },\n trigger: 'hover'\n };\n\n if(isTouchDevice() === false) {\n $('[data-toggle = \"tooltip\"]').tooltip(options);\n }\n}", "title": "" }, { "docid": "5f507697ca5a53c43529acb03413f712", "score": "0.61081016", "text": "function ProcessTooltips() {\n var tooltips = document.querySelectorAll('._nd_ .tooltip')\n for (var i = 0; i < tooltips.length; ++i) {\n if (!utils.HasClass(tooltips[i], \"right\")) {\n tooltips[i].className += \" right\"\n }\n }\n \n var tooltips = document.querySelectorAll('.tooltip[data-preview]')\n for (i = 0; i < tooltips.length; ++i) {\n var safeclass = utils.SafeCSSClass(tooltips[i].textContent, tooltips[i].rel);\n if (!utils.HasClass(tooltips[i], safeclass)) {\n tooltips[i].className += (\" \" + safeclass)\n if(utils.HasClass(tooltips[i], \"noshow\")) {\n tooltips[i].onmouseover = function() {\n var elem = this.closest('span._3oh-');\n var inpreview = elem.querySelector(\".inline-preview\");\n inpreview.className += \" sticker\";\n inpreview.style.cssText = this.getAttribute(\"data-preview\");\n }\n tooltips[i].onmouseout = function() {\n var elem = this.closest('span._3oh-');\n var inpreview = elem.querySelector(\".inline-preview\");\n inpreview.className = inpreview.className.replace(\"sticker\",\"\");\n inpreview.style.cssText = \"\";\n }\n } else {\n tooltips[i].textContent = tooltips[i].textContent;\n tooltips[i].onmouseover = function() {\n this.style.cssText = this.getAttribute(\"data-preview\");\n }\n tooltips[i].onouseout = function() {\n this.style.cssText = \"\";\n }\n }\n }\n }\n}", "title": "" }, { "docid": "413f549d8f40b15c799746c055f35e39", "score": "0.6101959", "text": "function enableToolTipForContactTime(){\r\n\t$('[id^=\"contactFrom\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n\t$('[id^=\"contactTo\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n}", "title": "" }, { "docid": "0cb4a3559f00260e861aa8401f6bb8ca", "score": "0.61012375", "text": "function hoverEffectDone() {\n const tooltip = d3.select('.tooltip');\n\n d3.select(this).transition()\n .duration('50')\n .attr('opacity', '1');\n\n tooltip.transition()\n .duration('50')\n .style(\"opacity\", 0);\n}", "title": "" }, { "docid": "267013f3ff82d6b3144f18c7fd95a54c", "score": "0.6099308", "text": "function toggleToolTips() {\n canUseToolTips = !canUseToolTips;\n for(let i = 0; i < document.getElementsByClassName('tooltip-show').length; i++) {\n let e = document.getElementsByClassName('tooltip-show')[i];\n e.classList.remove('tooltip-show');\n e.classList.add('tooltip');\n }\n}", "title": "" }, { "docid": "fcd544b7c465699f2bc21d692ab09041", "score": "0.6098958", "text": "function k(e,n){\n// Make callback synchronous if duration is 0\nif(0===e)return n();var i=Q.popperChildren.tooltip,t=function e(t){t.target===i&&(Ot(i,\"remove\",e),n())};Ot(i,\"remove\",q),Ot(i,\"add\",t),q=t}", "title": "" }, { "docid": "e4ef2d8f2d0bbc77e09e12c095e5f8f5", "score": "0.6098197", "text": "_on_button_hover(w_box, window_title) {\n\t\tif (window_title && w_box && w_box.get_hover()) {\n\t\t\tthis.window_tooltip.set_position(w_box.get_transformed_position()[0], Main.layoutManager.primaryMonitor.y + Main.panel.height + TOOLTIP_VERTICAL_PADDING);\n\t\t\tthis.window_tooltip.label.set_text(window_title);\n\t\t\tthis.window_tooltip.show();\n\t\t\tthis.hide_tooltip_timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => {\n\t\t\t\tif (!Main.panel.statusArea['babar-workspaces-bar'].get_hover()) {\n\t\t\t\t\tthis.window_tooltip.hide()\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.window_tooltip.hide();\n\t\t}\n }", "title": "" }, { "docid": "318f161ae5898ac65a43e86ebb54b679", "score": "0.6092784", "text": "function toolTipInit() {\n\t\n\t\t$('.menu li a').tooltip({\n\t\t\tplacement: 'right'\n\t\t});\n\t}", "title": "" }, { "docid": "f9a773155e2f912c8f15e55d620c372f", "score": "0.6092494", "text": "function initToolTips() {\n $(\"[title]:not([data-hasqtip])\").each(function() {\n var $this = $(this);\n $this.qtip({\n style: {\n classes: 'qtip-bootstrap',\n },\n position: {\n my: 'top center', // Position my top left...\n at: 'bottom center', // at the bottom right of...\n target: $this, // my target,\n viewport: $(window)\n },\n events: {\n render: function(event, api) {\n // Extract the title translation ID\n var transIDs = $this.data('i18n').split(';');\n var titleTransID = transIDs[0].split(']')[1];\n\n // Remove the translation data-i18ns for title (but not text node)\n if (transIDs.length === 1) {\n $this.removeAttr('data-i18n'); // Only had title, delete it\n } else if (transIDs.length === 2) {\n $this.attr('data-i18n', transIDs[1]); // Set to the main text ID\n }\n\n // Chuck the new title trans ID (without the [title]) onto the tooltip\n api.elements.content.attr('data-i18n', titleTransID);\n }\n }\n });\n });\n}", "title": "" }, { "docid": "726af718d48d62b7fca23a10fd2c4f98", "score": "0.6089811", "text": "function deactivate_tooltips() {\n clear_boxes();\n clearInterval(refreshID);\n controlsParent.appendChild(videoControls);\n}", "title": "" }, { "docid": "2cb49000e1271f8fb645383cbed1af2a", "score": "0.6084052", "text": "function mouseOverGraph(e,ix,node){\n stopDwellTimer(); // Mouse movement: reset the dwell timer.\n var ownTooltip = // Check if the hovered element already has the tooltip.\n (ix>=0 && ix==tooltipInfo.ixActive) ||\n (ix==-2 && tooltipInfo.idNodeActive==node.id);\n if(ownTooltip) stopCloseTimer(); // ownTooltip: clear the close timer.\n else resumeCloseTimer(); // !ownTooltip: resume the close timer.\n tooltipInfo.ixHover = ix;\n tooltipInfo.nodeHover = node;\n tooltipInfo.posX = e.clientX;\n tooltipInfo.posY = e.clientY;\n if(ix!=-1 && !ownTooltip && tooltipInfo.dwellTimeout>0){ // Go dwell timer.\n tooltipInfo.idTimer = setTimeout(function(){\n tooltipInfo.idTimer = 0;\n stopCloseTimer();\n showGraphTooltip();\n },tooltipInfo.dwellTimeout);\n }\n }", "title": "" }, { "docid": "61459c03dce2b3c6355cfd5f31a0b7f4", "score": "0.608172", "text": "function JT_init(){\n\t $(\"a.jTip\")\n\t\t .hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()})\n .click(function(){return false});\t \n}", "title": "" }, { "docid": "0a882945de34acd489732f599f9b7401", "score": "0.6076229", "text": "function updateTips(t) {\n\t\ttips.text(t)\n\t}", "title": "" }, { "docid": "d3292a6cbffe3db0f999296b80ec63b3", "score": "0.6066323", "text": "function customToolTip(tooltip, elementId, templateEpaSourceMap) {\n\n // Tooltip Element\n let tooltipEl = $('#' + elementId);\n // Hide if no tooltip\n if (!tooltip) {\n tooltipEl.css({\n opacity: 0\n });\n return;\n }\n\n let epaId = EPATextToNumber(tooltip.text.split(\":\")[0]),\n epaRootId = epaId.split(\".\")[0];\n\n // Set caret Position\n tooltipEl.removeClass('above below');\n tooltipEl.addClass(tooltip.yAlign);\n // Set Text\n tooltipEl.html(tooltip.text + \", \" + templateEpaSourceMap[epaRootId].subRoot[epaId]);\n // Find Y Location on page\n var top;\n if (tooltip.yAlign == 'above') {\n top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;\n } else {\n top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;\n }\n // Display, position, and set styles for font\n tooltipEl.css({\n opacity: 1,\n left: tooltip.chart.canvas.offsetLeft + tooltip.x + 'px',\n top: tooltip.chart.canvas.offsetTop + top + 'px',\n fontFamily: tooltip.fontFamily,\n fontSize: tooltip.fontSize,\n fontStyle: tooltip.fontStyle,\n });\n\n}", "title": "" }, { "docid": "523f01809ed6769f44ce034283618c8c", "score": "0.6062167", "text": "function ActivateTooltips(container) {\n if (container && container.tooltip) {\n container.find('span[rel=\"tooltip\"]').tooltip();\n }\n }", "title": "" }, { "docid": "165b4da6f522b5877a99ec2b268ef98e", "score": "0.60610807", "text": "function initTooltip() {\n angular.element(elem).tooltip({\n title: scope.bsTip,\n placement: scope.bsTipPlacement\n });\n }", "title": "" }, { "docid": "0ab6e9466f581e1f47d64fa6f37be412", "score": "0.6058066", "text": "function mouseOut(d)\n{\n d3.select(this).transition().duration(300).style(\"opacity\", 0.8);\n divTooltipFirst.transition().duration(300).style(\"opacity\", 0);\n divTooltipSecond.transition().duration(300).style(\"opacity\", 0);\n}", "title": "" }, { "docid": "9642ed98e7066b11122846beda775ccf", "score": "0.6057129", "text": "function specificationToolTip(parent, item) {\r\n\r\n parent.on('mouseenter', item, function () {\r\n\r\n var thisObj = jQuery(this),\r\n outerWidth = thisObj.outerWidth(),\r\n cloneContent = thisObj.clone().attr('id', 'tooltipClone').appendTo(thisObj);\r\n\r\n if (thisObj.width() <= cloneContent.width()) {\r\n\r\n jQuery('body').append('<div id=\"tooltip\">' + cloneContent.text() + '</div>');\r\n\r\n var tooltip = jQuery('#tooltip').css({ 'max-width': outerWidth }),\r\n thisObjOffset = thisObj.offset();\r\n\r\n setTimeout(function () {\r\n\r\n tooltip.css({\r\n 'display': 'block',\r\n 'top': thisObjOffset.top - (tooltip.outerHeight() + 6),\r\n 'left': thisObjOffset.left + ((outerWidth - tooltip.outerWidth()) / 2)\r\n });\r\n\r\n }, 250);\r\n }\r\n\r\n jQuery('#tooltipClone').remove();\r\n\r\n })\r\n .on('mouseleave', item, function () {\r\n\r\n var tooltip = jQuery('#tooltip');\r\n\r\n if (tooltip.length) {\r\n\r\n tooltip.remove();\r\n\r\n }\r\n\r\n });\r\n}", "title": "" }, { "docid": "987b58d2ab747299c92b0c36c25e18a9", "score": "0.6056639", "text": "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "title": "" }, { "docid": "53c4712add8de5c878578abe57bf0eb8", "score": "0.60519", "text": "function tipMouseout(d) {\n this.classList.remove(\"circle-hover\"); // remove hover class\n\n tooltip.transition()\n .duration(500) // ms\n .style(\"opacity\", 0); // don't care about position!\n}", "title": "" }, { "docid": "571033d55577424055d6cb6f8cf32082", "score": "0.6050563", "text": "function Tooltip(selector, attr, getData, callback) {\n //getData - return promise\n var data = void 0,\n elements = void 0,\n tooltip = void 0,\n close = void 0;\n\n function onInit() {\n elements = $(selector);\n if (elements.length > 0) {\n tooltip = $('#tooltip');\n close = tooltip.find('.tooltip__close');\n\n elements.on('click', onClickWithTimeout);\n close.on('click', hideTooltip);\n\n tooltip.on('click', function (e) {\n e.stopPropagation();\n });\n }\n }\n\n function onClickWithTimeout(e) {\n setTimeout(onClick.bind(this, e), 100);\n }\n\n function onClick(e) {\n\n var self = $(this);\n var id = self.attr(attr);\n var w = tooltip.width();\n var displaceX = $(window).width() - w - e.clientX;\n // console.log(displaceX);\n console.log(id);\n displaceX = displaceX > 0 ? 0 : displaceX - 20;\n\n getData(id).then(function (tx) {\n // console.log(tx);\n var details = JSON.parse(tx.txs_as_json[0]);\n callback(id, details);\n console.log(details);\n // let mixin = details.rctsig_prunable.MGs[0].ss.length - 1;\n // console.log(mixin);\n tooltip.css('top', e.pageY + 'px');\n tooltip.css('left', e.clientX + displaceX + 'px');\n tooltip.addClass('visible');\n setTimeout(function () {\n $('body').on('click', closeByAnyClickOutside);\n }, 500);\n });\n }\n\n function closeByAnyClickOutside(e) {\n console.log(e);\n if (e.target !== tooltip) {\n hideTooltip();\n }\n }\n\n function hideTooltip() {\n tooltip.removeClass('visible');\n $('body').off('click', closeByAnyClickOutside);\n }\n\n this.reinit = function () {\n onInit();\n };\n\n onInit();\n}", "title": "" }, { "docid": "c5f3057bf56dd8c3edf9333dd6882233", "score": "0.60491925", "text": "addHighlighTooltip () {\n }", "title": "" }, { "docid": "22568ccddf48c763f406f32d6e2f6b8e", "score": "0.6043685", "text": "function rolloverToolTip(){\n jQuery('.livia_notestask').hover(\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'block'\n });\n },\n function() {\n jQuery(this).children(\"span\").css({\n 'display':'none'\n });\n return false;\n });\n}", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" }, { "docid": "ea8cd078432408ddd8fe1d57ba43a0b4", "score": "0.6042335", "text": "function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }", "title": "" } ]
b33abff9440e64056451943940d6c66f
Ensure the agent is disconnected, then connect the agent.
[ { "docid": "6e55f45a63a7ca8358f527c601cb8966", "score": "0.56074184", "text": "async reconnect () {\n if (this.connected) this.disconnect()\n\n if (this.connectPromise) return this.connectPromise\n\n this.connectPromise = await (async () => {\n while (this.pendingConnect) {\n try {\n await this._connect()\n break\n } catch (err) {\n if (err.stack.includes('Instance likely does not exist')) {\n throw err\n }\n if (err.stack.includes('unexpected server response (502)')) {\n // 'Error: unexpected server response (502)' means the device is not likely up yet\n await sleep(10 * 1000)\n }\n if (err.stack.includes('closed before the connection')) {\n // Do nothing this is normal when trying to settle a connection for a vm coming up\n } else {\n await sleep(7.5 * 1000)\n }\n }\n }\n\n this.connectPromise = null\n })()\n\n return this.connectPromise\n }", "title": "" } ]
[ { "docid": "1a47c07011aff124898234c91144d4cb", "score": "0.6087076", "text": "async disconnect() { throw new NotImplementedError('disconnect'); }", "title": "" }, { "docid": "825b30ad4770e18658d46ebf92f37f7a", "score": "0.60691434", "text": "_doDisconnect() {\n this.connected = false;\n this.clientSocket = null;\n this._rejectAllPending();\n this.emit('disconnected');\n }", "title": "" }, { "docid": "a0d59287c46a9dd34d5f6ad84b1ff11f", "score": "0.5933641", "text": "reconnect(){\n clearTimeout(this.timeoutid)\n this.disconnect()\n this.timeoutid = setTimeout(this.connect.bind(this), 1000);\n }", "title": "" }, { "docid": "1f0078b2ff1a6a6b782fe579902c2f67", "score": "0.5895042", "text": "shutdown() {\n this.isConnected = false;\n this.agent.dispose();\n this.agent.removeAllListeners();\n this.agent = null;\n }", "title": "" }, { "docid": "081d16a1aaa25bea1176464203d50e41", "score": "0.5887804", "text": "disconnect() {\n SockService.reconnect = false;\n SockActions.disconnect();\n }", "title": "" }, { "docid": "766041655832d5a6ee8fac2c7096bb54", "score": "0.58734775", "text": "disconnect() {\n throw new Error('Not implemented.');\n }", "title": "" }, { "docid": "093926fd41c65e975e0abbd165d233b6", "score": "0.5849362", "text": "disconnect() {}", "title": "" }, { "docid": "fe8bf58c0ebe0e27b61070e235b39ff8", "score": "0.58476806", "text": "async connect () {\n this.pendingConnect = true\n if (!this.connected) {\n return await this.reconnect()\n }\n }", "title": "" }, { "docid": "2ac1ce3d6fb48dfd0eb99e16dd207ac0", "score": "0.58407253", "text": "async reconnect() { throw new NotImplementedError('reconnect'); }", "title": "" }, { "docid": "9489baa57cc5fa22fc4b5c7cee93d9d0", "score": "0.58205825", "text": "disconnect() {\n const oldConnected = this.connected\n this.resetProperties()\n\n if ( this.connected !== oldConnected ) {\n this.stateEmitter.emit( 'change', this.connected )\n }\n }", "title": "" }, { "docid": "565fc1e7b6ee7e0cfe36a31caf4fb505", "score": "0.581913", "text": "function attemptConnect(remote, callback) {\n var connected = false;\n\n function onLedgerClosed() {\n if (isConnected(remote)) {\n connected = true;\n remote.removeListener('ledger_closed', onLedgerClosed);\n callback(null, true);\n return;\n }\n };\n\n remote.once('ledger_closed', onLedgerClosed);\n\n setTimeout(function(){\n remote.removeListener('ledger_closed', onLedgerClosed);\n if (!connected) {\n callback(new Error('Cannot connect to rippled. ' +\n 'No \"ledger_closed\" events were heard within 20 seconds, ' +\n 'most likely indicating that the connection to rippled has ' +\n 'been interrupted or the rippled is unresponsive. Please ' + \n 'check your internet connection and server settings and try again.'));\n }\n return;\n }, module.exports.CONNECTION_TIMEOUT - (Date.now() - remote._getServer()._lastLedgerClose));\n\n remote.connect();\n}", "title": "" }, { "docid": "7bfc60ed91a42868e02e83ecfe9b359c", "score": "0.5803764", "text": "reconnect() {\n if (this.disconnected && !this.destroyed) {\n this._disconnected = false;\n this._initialize(this._lastServerId);\n } else if (this.destroyed) {\n throw new Error(\n 'This peer cannot reconnect to the server. It has already been destroyed.'\n );\n } else if (!this.disconnected && !this.open) {\n // Do nothing. We're still connecting the first time.\n return;\n } else {\n throw new Error(\n `Peer ${this.id} cannot reconnect because it is not disconnected from the server!`\n );\n }\n }", "title": "" }, { "docid": "d35f35bc64fd9dffcd425bbd699c2399", "score": "0.57914835", "text": "async connect() {\n const { instance, connected, error } = await this.config.connector()\n const oldConnected = this.connected\n\n this.instance = instance\n this.connected = connected\n this.connectionError = error\n\n if ( this.connected !== oldConnected ) {\n this.stateEmitter.emit( 'change', this.connected )\n }\n\n if ( error ) {\n throw new Error( error )\n }\n }", "title": "" }, { "docid": "770c086b18f6e95ed0b77390cc18333d", "score": "0.57890666", "text": "reconnect() {\n logger.warn(\n `Recreate peer instance instead. This method may be removed in future versions.`\n );\n if (!this.open) {\n this.socket.reconnect();\n }\n }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.5781641", "text": "disconnect() { }", "title": "" }, { "docid": "cf138bc04187ec08afec441a3029b16d", "score": "0.5780517", "text": "function connectAgent(call) {\n let connectedAgent = {\n bundleLocked: false,\n transferCompleted: false\n };\n\n /**\n * Keep alive method\n */\n let streamInterval = setInterval(() => {\n // Check if client is connected and bundle is not locked\n if (ServerStore.clientConnected && !connectedAgent.bundleLocked) {\n sendBundle(ServerStore.bundle[connectedAgent.id - 1]);\n connectedAgent.bundleLocked = true;\n } else {\n call.write({\n agentConnected: true,\n clientConnected: ServerStore.clientConnected\n });\n }\n }, 1000);\n\n const sendBundle = content => {\n // split the content into chunks\n let chunks = chunker(content, MAX_CHUNK_PER_CHUNKS);\n\n signale.await(\n `Transferring ${chunks.length} chunks to agent ${connectedAgent.id}`\n );\n\n // send each chunk\n chunks.map(chunk => {\n call.write({\n agentConnected: true,\n clientConnected: true,\n numbers: chunk\n });\n });\n\n // Send a confirmation that we've sent all numbers\n call.write({\n transferCompleted: true\n });\n\n signale.success(\n `The transfer for agent ${connectedAgent.id} has been completed.`\n );\n\n // Clear the old bundle\n ServerStore.bundle[connectedAgent.id - 1] = [];\n\n return true;\n };\n\n /**\n * It will handle the agent write method\n */\n call.on(\"data\", data => {\n // First connection\n if (!connectedAgent.id) {\n let id = ServerStore.totalAgents + 1;\n\n connectedAgent = { id, data };\n ServerStore.addAgent(connectedAgent);\n\n signale.info(\n `New agent connected! Name: ${data.name} OS: ${data.os} ID: ${id}`,\n `Agents connected: ${ServerStore.totalAgents}`\n );\n }\n\n // If agent is sending some data\n if (data.sortedNumbers.length > 0 && !data.transferCompleted) {\n ServerStore.addToBundle(connectedAgent.id, data.sortedNumbers);\n }\n\n if (data.transferCompleted) {\n signale.complete(`${connectedAgent.id} has finished his job.`);\n ServerStore.updateAgent(connectedAgent.id, data);\n }\n });\n\n /**\n * If the agent disconnect, remove him from the list\n * and clear the message interval\n */\n call.on(\"cancelled\", () => {\n // Clear the message interval\n clearTimeout(streamInterval);\n ServerStore.removeAgent(connectedAgent);\n\n signale.complete(\n `Agent ${connectedAgent.data.name} has been disconnected.`,\n `Now we have ${ServerStore.totalAgents} connected agent(s).`\n );\n });\n\n /**\n * If something weird happen\n */\n call.on(\"error\", e => {\n clearInterval(streamInterval);\n signale.error(`Oops, something wrong happened! Agent ID: ${\n connectAgent.id\n }\n Error: ${e}`);\n });\n\n /**\n * End the stream\n */\n call.on(\"end\", () => {\n clearInterval(streamInterval);\n signale.error(`Agent ${connectedAgent.id} has been disconnected!`);\n });\n }", "title": "" }, { "docid": "9655097e38445a458cb75e8a9ca38912", "score": "0.577686", "text": "reconnect() {\n this._io.connect();\n }", "title": "" }, { "docid": "ed7c59b5fa40237eb1eb5d078293ae95", "score": "0.5746559", "text": "async _ensureConnection (remoteAdvertise) {\n // get uri and PeerId\n const uri = new URL(remoteAdvertise)\n if (!uri.searchParams.has('a')) {\n throw new Error('cannot connect to peer without nodeId (\"a\" param)')\n }\n const remotePeerId = uri.searchParams.get('a')\n // short circuit if we already have a connection for this peer\n if (this._conByPeerAddress.has(remotePeerId)) {\n return this._conByPeerAddress.get(remotePeerId)\n }\n // short circuit if we are already TRYING to connect to this peer\n if (this._newConTrack.has(remotePeerId)) {\n return this._newConTrack.get(remotePeerId)\n }\n // Try to connect\n const promise = this._newConTrack.track(remotePeerId)\n\n promise.catch(err => {\n if (!timeoutRegex.test(err)) {\n console.error('@@ fixme connection error catch @@', err)\n }\n })\n\n await this._con.connect(uri.href)\n return promise\n }", "title": "" }, { "docid": "0f1ba8cde8367cb9513b926d872fc99a", "score": "0.5737033", "text": "disconnect() {\n this.connected_ = false;\n this.messenger_.disconnect();\n }", "title": "" }, { "docid": "31723624760d6eeffb5b7a8f2f8bc6ec", "score": "0.5710344", "text": "async disconnect() {\n\t\t// TODO should check for existing connection?\n\t\tlet device = this.getDevice();\n\t\tif (device) {\n\t\t\tlet deviceDriver = deviceDrivers[device.type];\n\t\t\tif (deviceDriver) {\n\t\t\t\tawait deviceDriver.disconnect(device);\n\t\t\t\t// TODO wait some time and then disconnect anyway\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.error('There is no driver for the current device (' + device.type + ')');\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.warn('There is no connected device, nothing to disconnect from');\n\t\t}\n\t}", "title": "" }, { "docid": "fbc7b6d8a36b1626f9d1ec1dff9a7080", "score": "0.56735027", "text": "function disconnectFromDevice() {\n $.ajax({\n url : agentAddress + \"/disconnect\",\n success : function(response) {\n console.log(\"Disconnected: \" + response);\n connectedStatus = {\"connected\" : false, \"tagId\": \"\"};\n }\n });\n }", "title": "" }, { "docid": "62f61cff9d35d14e7aa74d367c0aa887", "score": "0.5633587", "text": "disconnect () {\n this.endpoint.disconnect()\n this.isDead = true\n }", "title": "" }, { "docid": "71f3b6932cfd1bed89dedc849af7d1b2", "score": "0.5633543", "text": "disconnectedCallback() {\n this.disconnect(/* pretendDisconnected */ false);\n }", "title": "" }, { "docid": "56a39062c1537ed2fc7aa0a269d9acea", "score": "0.56280977", "text": "connect() {\n this._isConnectingPeer = true;\n\n return new Promise((resolve, reject) => {\n var connectWatcher = event => {\n var connection = event.target;\n\n switch (connection.iceConnectionState) {\n case 'connected':\n case 'completed':\n resolve(this);\n connection.removeEventListener('iceconnectionstatechange', connectWatcher);\n break;\n case 'failed':\n case 'disconnected':\n case 'closed':\n reject({peer: this, event: event});\n break;\n }\n };\n\n this._connection.addEventListener('iceconnectionstatechange', connectWatcher);\n });\n }", "title": "" }, { "docid": "a16becf4fa0b66546b3b0262c8f06acc", "score": "0.5627526", "text": "function On_Lostconnect() {\n\tconsole.log('On lostconnect');\n\tclearInterval(pHeartbeatHandle);\n\tpHeartbeatHandle = 0;\n\tclearInterval(pReportHandle);\n\tpReportHandle = 0;\n}", "title": "" }, { "docid": "54674520ca1edbad6cdbfd00d7bacdc3", "score": "0.56249315", "text": "async disconnect () {\n unimplemented(this, 'disconnect')\n }", "title": "" }, { "docid": "ea4c4bba9f15a187f5d1ecdaec65783f", "score": "0.56214166", "text": "onClose() {\n if (!this.dead) this.client.setTimeout(this.connect.bind(this), this.attempts * 1000);\n }", "title": "" }, { "docid": "43ed6ec9c8b52b46c21e00bbb23bd29b", "score": "0.56162137", "text": "function _tickConnectionCheck() {\n if (_disconnectedAt === null) {\n return;\n }\n const now = Date.now();\n const offlineFor = now - _disconnectedAt;\n log.log(_deviceName, `Disconnected for ${offlineFor / 1000}s`);\n _self.emit('disconnected', offlineFor);\n }", "title": "" }, { "docid": "665737fa8bc3cf321bc2e086e8d42e94", "score": "0.5609111", "text": "function disconnect(agents) {\n agents.forEach((app) => {app.disconnect();}) ;\n clearRequire('./../app');\n}", "title": "" }, { "docid": "ff990f7626c5ff002e08e977d8f9c42d", "score": "0.5596154", "text": "function disconnect() {\n return device.disconnect()\n .then(function() {\n device = null;\n console.log(\"5. Disconnected\");\n })\n .catch(function(err) {\n console.log(\"===> Error disconnecting:\", err);\n throw new Error(err);\n });\n}", "title": "" }, { "docid": "fa9623d85f830afc1ddb5693083b592c", "score": "0.55722433", "text": "function disconnect() {\n\t\t\n\t\t_client.disconnect();\n\t\t\n\t}", "title": "" }, { "docid": "bf03ff7dab0fcc88b81d8921bf4e9ee4", "score": "0.5566203", "text": "function disconn() {\n return\n}", "title": "" }, { "docid": "da6de56fe9fcfba18511341d315f4685", "score": "0.55617476", "text": "disconnect() {\n this._disconnect();\n }", "title": "" }, { "docid": "e227768930cb3289fba15849b72ebdd9", "score": "0.55563694", "text": "async reconnect() {\n const conn_status = converse_core_converse.connfeedback.get('connection_status');\n\n if (converse_core_api.settings.get(\"authentication\") === converse_core_converse.ANONYMOUS) {\n await tearDown();\n await clearSession();\n }\n\n if (conn_status === strophe[\"e\" /* Strophe */].Status.CONNFAIL) {\n // When reconnecting with a new transport, we call setUserJID\n // so that a new resource is generated, to avoid multiple\n // server-side sessions with the same resource.\n //\n // We also call `_proto._doDisconnect` so that connection event handlers\n // for the old transport are removed.\n if (converse_core_api.connection.isType('websocket') && converse_core_api.settings.get('bosh_service_url')) {\n await converse_core_converse.setUserJID(converse_core_converse.bare_jid);\n\n converse_core_converse.connection._proto._doDisconnect();\n\n converse_core_converse.connection._proto = new strophe[\"e\" /* Strophe */].Bosh(converse_core_converse.connection);\n converse_core_converse.connection.service = converse_core_api.settings.get('bosh_service_url');\n } else if (converse_core_api.connection.isType('bosh') && converse_core_api.settings.get(\"websocket_url\")) {\n if (converse_core_api.settings.get(\"authentication\") === converse_core_converse.ANONYMOUS) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await converse_core_converse.setUserJID(converse_core_api.settings.get(\"jid\"));\n } else {\n await converse_core_converse.setUserJID(converse_core_converse.bare_jid);\n }\n\n converse_core_converse.connection._proto._doDisconnect();\n\n converse_core_converse.connection._proto = new strophe[\"e\" /* Strophe */].Websocket(converse_core_converse.connection);\n converse_core_converse.connection.service = converse_core_api.settings.get(\"websocket_url\");\n }\n } else if (conn_status === strophe[\"e\" /* Strophe */].Status.AUTHFAIL && converse_core_api.settings.get(\"authentication\") === converse_core_converse.ANONYMOUS) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await converse_core_converse.setUserJID(converse_core_api.settings.get(\"jid\"));\n }\n\n if (converse_core_converse.connection.reconnecting) {\n converse_core_converse.connection.debouncedReconnect();\n } else {\n return converse_core_converse.connection.reconnect();\n }\n }", "title": "" }, { "docid": "265d9f28ac89dcb21b6a0ea621859e5f", "score": "0.5541468", "text": "function connect(agentId) {\n onConnectionStatusChange(CONNECTION_STATUS.INITIALIZING);\n callbacks.current.setupWebsocket();\n callbacks.current.sendingThread();\n const messageSenderThreadId = window.setInterval(\n () => callbacks.current.sendingThread(),\n useValue(config.sendThreadRefresh, SEND_THREAD_REFRESH)\n );\n setState({ agentId, messageSenderThreadId });\n }", "title": "" }, { "docid": "95274555dfabda8f8968612ac2050d42", "score": "0.55410314", "text": "init() {\n this.agent = new Agent({ accountId: this.accountId, username: this.username, password: this.password });\n this.agent.on('connected', () => {\n this.isConnected = true;\n });\n this.agent.on('error', err => {\n this.isConnected = false;\n console.error('/bot.js 35 - Bot ' + this.config._id + ': Connection to UMS closed with err', err.message);\n });\n // If losing connection to LiveEngage, retry to connect.\n this.agent.on('closed', reason => {\n this.isConnected = false;\n console.error('/bot.js 42 - Bot ' + this.config._id + ': Connection to UMS closed with reason', reason);\n if (this.retries > 0) {\n this.retries--;\n setTimeout(() => {\n this.agent.reconnect(reason !== 4401 || reason !== 4407);\n }, 5000);\n }\n else {\n console.error('/bot.js 52 - Bot ' + this.config._id + ': Unable to connect')\n }\n });\n }", "title": "" }, { "docid": "9fd2a237799461a4ab7f2e029216ff6f", "score": "0.55311304", "text": "function handleDisconnect() {\n _this.connection = mysql.createConnection(_this.dbConfig);\n\n _this.connection.connect(function(err) {\n if (err) {\n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000);\n }\n });\n\n _this.connection.on('error', function(err) {\n console.log('db error', err);\n if (err.code === 'PROTOCOL_this.CONNECTION_this.LOST') {\n handleDisconnect();\n } else {\n throw err;\n }\n });\n }", "title": "" }, { "docid": "ff087da051eba86592c0c812b5ce73d0", "score": "0.5527534", "text": "function disconnect() {\n\n\ttry {\n\n\t\tif (SASocket != null) {\n\n\t\t\tSASocket.close();\n\n\t\t\tSASocket = null;\n\n\t\t\tcreateHTML(\"closeConnection\");\n\n\t\t}\n\n\t} catch (err) {\n\n\t\tconsole.log(\"exception [\" + err.name + \"] msg[\" + err.message + \"]\");\n\n\t}\n\n}", "title": "" }, { "docid": "fe147861ebe8bfd56490952de083eb81", "score": "0.5520743", "text": "disconnect() {\n if (this.from) {\n this.from.detachEdge(this);\n this.from = undefined;\n }\n if (this.to) {\n this.to.detachEdge(this);\n this.to = undefined;\n }\n\n this.connected = false;\n }", "title": "" }, { "docid": "8b7f82b37887aba2253ce7bb2cf15710", "score": "0.5517695", "text": "function resetKeepAliveConnections() {\n Object.keys(agents).forEach(type => {\n const agent = agents[type];\n if (agent.instance) agent.instance.destroy();\n agent.instance = null;\n });\n}", "title": "" }, { "docid": "3748b5b68d24af3e92ed4af079e348fa", "score": "0.55137926", "text": "reconnect() {\n this._socket.close('reconnect');\n this._initSocket();\n }", "title": "" }, { "docid": "91cf13aeee598abe48ae849a2f58d555", "score": "0.55129284", "text": "function On_Disconnect() {\n\tconsole.log('On disconnect');\n\tclearInterval(pHeartbeatHandle);\n\tpHeartbeatHandle = 0;\n\tclearInterval(pReportHandle);\n\tpReportHandle = 0;\n}", "title": "" }, { "docid": "f9a1439c64fb1129532aa69c17696551", "score": "0.5512717", "text": "disconnect() {\n if (this._ble) {\n this._ble.disconnect();\n }\n\n this.reset();\n }", "title": "" }, { "docid": "f9a1439c64fb1129532aa69c17696551", "score": "0.5512717", "text": "disconnect() {\n if (this._ble) {\n this._ble.disconnect();\n }\n\n this.reset();\n }", "title": "" }, { "docid": "f9a1439c64fb1129532aa69c17696551", "score": "0.5512717", "text": "disconnect() {\n if (this._ble) {\n this._ble.disconnect();\n }\n\n this.reset();\n }", "title": "" }, { "docid": "f9a1439c64fb1129532aa69c17696551", "score": "0.5512717", "text": "disconnect() {\n if (this._ble) {\n this._ble.disconnect();\n }\n\n this.reset();\n }", "title": "" }, { "docid": "65be69fc0f5736059e13aaab20329831", "score": "0.54976904", "text": "onDisconnected() {\n if (converse_core_api.settings.get(\"auto_reconnect\")) {\n const reason = this.disconnection_reason;\n\n if (this.disconnection_cause === core[\"e\" /* Strophe */].Status.AUTHFAIL) {\n if (converse_core_api.settings.get(\"credentials_url\") || converse_core_api.settings.get(\"authentication\") === converse_core_converse.ANONYMOUS) {\n // If `credentials_url` is set, we reconnect, because we might\n // be receiving expirable tokens from the credentials_url.\n //\n // If `authentication` is anonymous, we reconnect because we\n // might have tried to attach with stale BOSH session tokens\n // or with a cached JID and password\n return converse_core_api.connection.reconnect();\n } else {\n return this.finishDisconnection();\n }\n } else if (this.disconnection_cause === converse_core_converse.LOGOUT || reason === core[\"e\" /* Strophe */].ErrorCondition.NO_AUTH_MECH || reason === \"host-unknown\" || reason === \"remote-connection-failed\") {\n return this.finishDisconnection();\n }\n\n converse_core_api.connection.reconnect();\n } else {\n return this.finishDisconnection();\n }\n }", "title": "" }, { "docid": "915294fb9b4d5942bad52e19cbab798c", "score": "0.54946077", "text": "disconnectFromDevice() {\n this.isConnected = false;\n this.connectedTo = undefined;\n }", "title": "" }, { "docid": "90b654cc58db7609a979a5182169c960", "score": "0.54913265", "text": "disconnect() {\n this.connection.disconnect()\n }", "title": "" }, { "docid": "0ba2031b0f66bd864407ff2336b94145", "score": "0.54756284", "text": "async disconnect() {\n if (this._channel) await this._channel.close();\n if (this._confirmChannel) await this._confirmChannel.close();\n if (this._connection){ \n this._connection.removeAllListeners();\n await this._connection.close();\n this._connection = null;\n }\n }", "title": "" }, { "docid": "e2ef34499d28dde40d51d69c9fdefaa0", "score": "0.5468543", "text": "function disconnect() {\n\t\tconsole.log(\"Disconnecting from database\");\n\t\tclient.end();\n\t}", "title": "" }, { "docid": "1b5792addebd815650a8f6282dd7c308", "score": "0.5455844", "text": "function handleDisconnect() {\n client = mysql.createConnection(db_config);\n client.connect(function(err) {\n if (err) {\n console.log('error when connecting to db:', err);\n setTimeout(handleDisconnect, 2000);\n }\n });\n client.on('error', function(err) {\n if (err.code === 'PROTOCOL_CONNECTION_LOST') {\n handleDisconnect();\n } else {\n throw err;\n }\n });\n}", "title": "" }, { "docid": "4d0194fc7de814d6c99aa7f2ea719290", "score": "0.54517245", "text": "reconnect() {\n this.reconnectTimeout = setTimeout(() => {\n if (this.reconnectAttempts >= this.retryAmount) {\n this.erela.emit(\"nodeError\", this, new Error(`Unable to connect after ${this.retryAmount}`));\n this.destroy();\n return;\n }\n this.websocket.removeAllListeners();\n this.websocket = null;\n this.erela.emit(\"nodeReconnect\", this);\n this.connect();\n this.reconnectAttempts++;\n }, this.retryDelay);\n }", "title": "" }, { "docid": "9cc2dfc26ff0652879e09bca0a92162c", "score": "0.5449255", "text": "disconnect() {\n\t\tif (self.connected) {\n\t\t\tself.disconnectInner();\n\t\t}\n\t}", "title": "" }, { "docid": "4c8db59d16408a6130d45d8218e041a5", "score": "0.54460174", "text": "function refuseConnection() {\n peerClient.closeConnection(callbackClosing);\n }", "title": "" }, { "docid": "0320eba112a736324f070786441f569d", "score": "0.5441324", "text": "function disconnect() {\n port.close();\n ready = false;\n}", "title": "" }, { "docid": "7b5ce3c0030ea1d9a6d09198e55956eb", "score": "0.54411775", "text": "reconnect() {\n if (!this.device) {\n log(\"Can't reconnect device that was not previosly connected.\");\n return;\n }\n if (this._connected) {\n log(\"Can't reconnect device that is already connected.\");\n return;\n }\n return this.device.gatt.connect()\n .then( server => this._finalizeConnection(server));\n }", "title": "" }, { "docid": "e9b4221e57823174dd7c645da07ab4a9", "score": "0.54396844", "text": "onDisconnected() {\n if (api.settings.get('auto_reconnect')) {\n const reason = this.disconnection_reason;\n if (this.disconnection_cause === Strophe.Status.AUTHFAIL) {\n if (\n api.settings.get('credentials_url') ||\n api.settings.get('authentication') === _converse.ANONYMOUS\n ) {\n // If `credentials_url` is set, we reconnect, because we might\n // be receiving expirable tokens from the credentials_url.\n //\n // If `authentication` is anonymous, we reconnect because we\n // might have tried to attach with stale BOSH session tokens\n // or with a cached JID and password\n return api.connection.reconnect();\n } else {\n return this.finishDisconnection();\n }\n } else if (\n this.disconnection_cause === _converse.LOGOUT ||\n reason === Strophe.ErrorCondition.NO_AUTH_MECH ||\n reason === 'host-unknown' ||\n reason === 'remote-connection-failed'\n ) {\n return this.finishDisconnection();\n }\n api.connection.reconnect();\n } else {\n return this.finishDisconnection();\n }\n }", "title": "" }, { "docid": "49ddea5d2c76d703c0e02ea94cea9e7a", "score": "0.5424816", "text": "function connect(agents) {\n return new Promise((resolve, reject) => {\n async.each(agents, (agent, callback) => {\n agent.once('connect', (err, hostport) => {\n callback(err) ;\n }) ;\n }, (err) => {\n if (err) { return reject(err); }\n resolve() ;\n });\n });\n}", "title": "" }, { "docid": "204042c9dd266d1f6898569515a21111", "score": "0.5420382", "text": "_reconnectWithNeighbor({ isRoot, disconnector }) {\n\n console.log('Disconnecting:');\n console.log('isRoot:', isRoot);\n console.log('disconnector:', disconnector);\n\n // if receiving disconnection message from parent\n if (disconnector === 'connToParent') {\n // update root status\n this.isRoot = isRoot;\n }\n }", "title": "" }, { "docid": "c77bb470d12a55e931b7cc429d633df7", "score": "0.54109854", "text": "function handleDisconnect() {\n console.log(\"1. connecting to db:\");\n connection = mysql.createConnection(db_config);\n\n connection.connect(function(err) {\n if (err) {\n console.log(\"2. error when connecting to db:\", err);\n setTimeout(handleDisconnect, 1000);\n }\n });\n connection.on(\"error\", function(err) {\n console.log(\"3. db error\", err);\n if (err.code === \"PROTOCOL_CONNECTION_LOST\") {\n handleDisconnect();\n } else {\n throw err;\n }\n });\n}", "title": "" }, { "docid": "4d864dfbaa2407d93e48bb95aa800adc", "score": "0.5376682", "text": "function onConnectionLost() {\n isReconnected = true;\n }", "title": "" }, { "docid": "95c20a7608c1d537483ae32c13e86291", "score": "0.53600085", "text": "connect(timeout = 15000) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n const validated = this.validateConnectAction(types_1.CONNECTION_STATUS.CONNECTING);\n if (validated.error) {\n return reject(validated.error);\n }\n this.pub.CONNECT({\n frontUid: this.frontUid,\n frontMasterIndex: this.frontMasterIndex,\n channelId: this.channelId\n });\n let connectionTimeout = setTimeout(() => {\n return reject(`Timed out waiting for ${(this.connectedChannelIds.size - this.totalChannels)} connections`);\n }, timeout);\n let connectedBackMasterIndexes = new Set();\n this.on('connected', (channelId, backMasterIndex, options) => {\n connectedBackMasterIndexes.add(backMasterIndex);\n this.master.backChannelOptions[channelId] = options;\n // run user defined handler. (set with onConnectedHandler())\n this.onConnectedHandler(channelId, backMasterIndex, options);\n this.connectedChannelIds.add(channelId);\n if (this.connectedChannelIds.size === this.totalChannels) {\n // dont need to listen for connected emition\n // or wait for a timeout anymore\n timers_1.clearTimeout(connectionTimeout);\n this.removeAllListeners('connected');\n this.CONNECTION_STATUS = types_1.CONNECTION_STATUS.CONNECTED;\n return resolve({\n channels: Array.from(this.connectedChannelIds.values()),\n backMasterIndexes: Array.from(connectedBackMasterIndexes.values()),\n });\n }\n });\n });\n });\n }", "title": "" }, { "docid": "284334af868fbc83bbcccf5708b4cdf2", "score": "0.5346035", "text": "function onConnect () {\n peer.removeListener('error', onError)\n peer.removeListener('connect', onConnect)\n }", "title": "" }, { "docid": "284334af868fbc83bbcccf5708b4cdf2", "score": "0.5346035", "text": "function onConnect () {\n peer.removeListener('error', onError)\n peer.removeListener('connect', onConnect)\n }", "title": "" }, { "docid": "367042ec57aace3c0859cc0b74b04144", "score": "0.5344464", "text": "disconnect() {\n if (this.disconnected) return;\n\n const currentId = this.id;\n\n this._disconnected = true;\n this._open = false;\n\n this.socket.close();\n\n this._lastServerId = currentId;\n this._id = null;\n\n this.emit(PeerEventType.Disconnected, currentId);\n }", "title": "" }, { "docid": "fdeae8a0dc46a4648961cf2e5ef94a8d", "score": "0.5343724", "text": "onConnect() {\n let that = this;\n this.setState({'connected':true});\n this.failCount = 0;\n this.afterConnect(this);\n }", "title": "" }, { "docid": "d22d61659186eed2426d53f6a903e9b6", "score": "0.534184", "text": "async disconnect() {\n console.log(`Disconnecting Emitter: ${this.name} from High Fidelity Audio API Servers...`);\n let disconnectStatus = await this.hifiCommunicator.disconnectFromHiFiAudioAPIServer();\n this.connectResponse = null;\n console.log(`Disconnected status for ${this.name} : ${disconnectStatus}`);\n }", "title": "" }, { "docid": "903ae6cb05775b8a118b0ed278654ccd", "score": "0.5339066", "text": "disconnect() {\n if (!this.isConnected()) return\n\n this.socket.disconnect()\n }", "title": "" }, { "docid": "efb48d8a9895b827257a55d9bd261018", "score": "0.53389186", "text": "function handleDisconnect(){\n dbConnection = mysql.createConnection(db_config);\n console.log(\"Successfully connected to Database.\");\n dbConnection.connect(function(err){\n if(err){\n console.log('Error when connecting to DB: ', err);\n setTimeout(handleDisconnect, 5000);\n }\n });\n dbConnection.on('error', function(err){\n console.log('DB ERROR ', err);\n if(err.code === 'PROTOCOL_CONNECTION_LOST'){\n console.log('Lost connection. Reconnecting...');\n handleDisconnect();\n }\n else{\n throw err;\n }\n });\n}", "title": "" }, { "docid": "d6638602dae148e70543fec4121faa80", "score": "0.53341585", "text": "function onConnect () {\n peer.removeListener('error', onError)\n peer.removeListener('connect', onConnect)\n }", "title": "" }, { "docid": "c2a88653897b8d984293ef298a1cd44e", "score": "0.53327715", "text": "disconnected() { }", "title": "" }, { "docid": "c2a88653897b8d984293ef298a1cd44e", "score": "0.53327715", "text": "disconnected() { }", "title": "" }, { "docid": "e9ee949e527ded719ec81e6233ac167e", "score": "0.5331499", "text": "onBeforeDisconnect() {\n mainLog.info('Disconnecting from Lightning gRPC service')\n this.unsubscribe()\n if (this.service) {\n this.service.close()\n }\n }", "title": "" }, { "docid": "df62f59df9869acbb0c1d56a3068c163", "score": "0.53303134", "text": "function join() {\n // Close old connection\n if (conn) {\n conn.close();\n }\n\n // Create connection to destination peer specified in the input field\n conn = peer.connect(recvIdInput.value, {\n reliable: true\n });\n\n conn.on('open', () => {\n status.textContent = 'Connected to: ' + conn.peer;\n status.className = classNames.success;\n\n console.log('Connected to: ' + conn.peer);\n });\n conn.on('close', () => {\n status.textContent = 'Connection closed';\n status.className = classNames.warning;\n conn = null;\n });\n }", "title": "" }, { "docid": "76435f5890f010ba0fb6bc2732761594", "score": "0.5323836", "text": "tryConnect(mol){\n\t\tthis.connect(mol);\n\t}", "title": "" }, { "docid": "721f5b1aa948ddcae913e93d4ae34a38", "score": "0.53215164", "text": "async function _disconnectUA () {\n // try closing session\n if (UASESSION) {\n try {\n await UASESSION.close()\n } catch (e) {\n log.error('Error closing UA session.', { error: e.message })\n }\n }\n // disconnect client\n await UACLIENT.disconnect()\n}", "title": "" }, { "docid": "940b8d7a51a99ca02bbe9eb509891c3c", "score": "0.5320264", "text": "disconnect() {\n if(this.connection) {\n this.connection.close();\n this.connection = undefined;\n }\n }", "title": "" }, { "docid": "71fe4328aa76df4ea26b6ac6d68b7674", "score": "0.531534", "text": "function _connect()\n {\n if (!_isDisconnected())\n {\n var message = {\n channel: '/meta/connect',\n connectionType: _transport.getType()\n };\n\n // In case of reload or temporary loss of connection\n // we want the next successful connect to return immediately\n // instead of being held by the server, so that connect listeners\n // can be notified that the connection has been re-established\n if (!_connected)\n {\n message.advice = { timeout: 0 };\n }\n\n _setStatus('connecting');\n _cometd._debug('Connect sent', message);\n _send(false, [message], true, 'connect');\n _setStatus('connected');\n }\n }", "title": "" }, { "docid": "fbd6a994320daacb7f7290d52e0e9123", "score": "0.53107053", "text": "attemptTurnConnect() {\n this.triedTurn = true;\n console.log('TRY TURN CONNECTION');\n this.socketEmit(this.signals.tryTurn, { connId: this.connId, cont: true });\n }", "title": "" }, { "docid": "6a2836d24f33e18a5a7800d295f57318", "score": "0.53071374", "text": "disconnect() {\n this.#state = Gamepad.DISCONNECTED;\n }", "title": "" }, { "docid": "064ba4cb408148584e96f265ae4d7140", "score": "0.52978617", "text": "disconnect() {\n return Promise.resolve();\n }", "title": "" }, { "docid": "72c3bc4ee604da1c3f8ae6389a5c4aef", "score": "0.52899307", "text": "function reset() {\n disconnect();\n connect();\n}", "title": "" }, { "docid": "6bcecfaf1f56003afc4d300d879906c9", "score": "0.52887625", "text": "onDisconnect() {\n this.ready = false\n console.info(`Disconnected from channel ${this.channelId}`)\n this.send({\n op: \"disconnected\",\n d: {\n channelId: this.channelId,\n guildId: this.guildId\n }\n })\n }", "title": "" }, { "docid": "8027f933b933826a06275169d3cd9e5d", "score": "0.52857405", "text": "connect() {\n this.disconnect();\n\n this.from = this.body.nodes[this.fromId] || undefined;\n this.to = this.body.nodes[this.toId] || undefined;\n this.connected = this.from !== undefined && this.to !== undefined;\n\n if (this.connected === true) {\n this.from.attachEdge(this);\n this.to.attachEdge(this);\n } else {\n if (this.from) {\n this.from.detachEdge(this);\n }\n if (this.to) {\n this.to.detachEdge(this);\n }\n }\n\n this.edgeType.connect();\n }", "title": "" }, { "docid": "c7b824eb12bb28f54c44ecfb91c0868a", "score": "0.5284521", "text": "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"dedefishstep\");\n}", "title": "" }, { "docid": "e4ee6af1262134c545b8aedc4acf52d3", "score": "0.52838427", "text": "disconnected() {\n // implement if needed\n }", "title": "" }, { "docid": "c97542731af5a7eb5d000e792e6642f0", "score": "0.5282138", "text": "function disconnect() {\n return hoodie.remote.disconnect();\n }", "title": "" }, { "docid": "60d95e66284c21f2344971136a5a26e4", "score": "0.5280371", "text": "_onDisconnectTimeout() {}", "title": "" }, { "docid": "60d95e66284c21f2344971136a5a26e4", "score": "0.5280371", "text": "_onDisconnectTimeout() {}", "title": "" }, { "docid": "c3a7aa51bb0f3e5d7c4f17f246d7b83c", "score": "0.52759403", "text": "function disconnected() {\r\n console.log('disconnected');\r\n }", "title": "" }, { "docid": "388d94ad58db17a906b0a07b8be671e3", "score": "0.5275876", "text": "disconnect() {\n if (this._link) {\n this._link.disconnect();\n }\n\n this.reset();\n }", "title": "" }, { "docid": "cf97507147f7593942c8d69de8fdd0f7", "score": "0.527184", "text": "reconnect() {\n this.debug('Attemping to reconnect in 5500ms...');\n /**\n * Emitted whenever the client tries to reconnect to the WebSocket.\n * @event Client#reconnecting\n */\n this.client.emit(Constants.Events.RECONNECTING);\n this.connect(this.gateway, 5500, true);\n }", "title": "" }, { "docid": "778ae7b07c312246a5853911db1aedd6", "score": "0.5267458", "text": "Disconnect() {\n this.socketConnection.disconnect();\n console.info('Sockets disconnected!');\n }", "title": "" }, { "docid": "648cc1672c5f8aa8e9d3499c74a70134", "score": "0.5262065", "text": "handleDisconnectError() {\n // log.error(`BLE error: ${JSON.stringify(e)}`);\n if (!this._connected) return;\n this.disconnect();\n\n if (this._resetCallback) {\n this._resetCallback();\n }\n\n this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR, {\n message: \"Scratch lost connection to\",\n extensionId: this._extensionId\n });\n }", "title": "" }, { "docid": "5ce20bee5274b190aed11e1d82a43136", "score": "0.5254577", "text": "disconnect() {\n return Controller.connection.stop().then(() => {\n Controller.isConnected = false;\n Controller.connection = null;\n Controller.clear();\n });\n }", "title": "" }, { "docid": "5a8956400856a984a13c91791d876426", "score": "0.5245793", "text": "connect() {\r\n return new Promise((onRes, onErr) => {\r\n AuthenticationService.authenticate(this.apiService, this.options.credentials)\r\n .then(res => {\r\n this.connectedAgent = res;\r\n this.verto.connectAgent(this.connectedAgent, this.options.contactCenterName);\r\n onRes();\r\n }).catch(err => onErr(err));\r\n });\r\n }", "title": "" }, { "docid": "522cc357d3f422088d4e09002f6ca140", "score": "0.5244585", "text": "handle_disconnect() {}", "title": "" }, { "docid": "b3b9269476932e72c786585985316183", "score": "0.5243341", "text": "disconnect () {\n this._socket && this._socket.disconnect();\n this._socket = null;\n }", "title": "" }, { "docid": "37bc7e899e666ce3943f3c3efe0b2ca3", "score": "0.5241734", "text": "function disconnect() {\n\tif (stompClient != null) {\n\t\tstompClient.disconnect();\n\t}\n\tconsole.log(\"Disconnected\");\n}", "title": "" } ]
8a53cefee119191fc9c1bb37c3902c4c
////// Popups //////// ////////////////////// Open the about popup
[ { "docid": "34aab738977c95d452db6fb8e925b124", "score": "0.78309673", "text": "function openAboutPopup() {\n\n w2popup.open({\n title: 'About Auroa IR',\n width: 900,\n height: 600,\n showMax: true,\n body: about_content, //specified in gui_definitions to keep logic and gui as separate as possible\n onToggle: function (event) {\n event.onComplete = function () {\n w2ui.popup_layout.resize();\n }\n }\n });\n}", "title": "" } ]
[ { "docid": "a7d412ec5e8259f357fb1841d7c6ffd2", "score": "0.75028706", "text": "function aboutPage() {\n var features = \"width=299,height=515,status=0,resizable=0,left=260,top=150\";\n aboutWin = window.open (\"/about\", ABOUT, features);\n}", "title": "" }, { "docid": "95b8fbe57dd9db573a1cdcfc65963fb6", "score": "0.73656636", "text": "function openAboutMe() {\n\tvar about = $('#about-me');\n\tabout.css('opacity', 0).show();\n\tTweenLite.fromTo(about, .4, {opacity: 0}, {opacity: 1});\n\tTweenLite.fromTo($('#about-me-p'), .4, {marginTop: '100px', opacity: 0}, {delay: .4, marginTop: '65px', opacity: 1});\n}", "title": "" }, { "docid": "c532505391a16223108e8fbebe9ff547", "score": "0.7279602", "text": "function aboutOpen() {\r\n //ShowSection('about');\r\n modal.style.display = \"block\";\r\n }", "title": "" }, { "docid": "ae9bacbf19b6e4f6a00b304ae2534939", "score": "0.70832866", "text": "function toggleAbout() {\n openModal('about');\n }", "title": "" }, { "docid": "1de9eb470095e25456ad4107677dcbe7", "score": "0.700693", "text": "function openAboutWindow() {\n\n let aboutWindow = new BrowserWindow({\n parent: mainWindow,\n modal: true,\n show: false,\n width: 400,\n height: 200\n })\n aboutWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'about.html'),\n protocol: 'file:',\n slashes: true\n }))\n aboutWindow.setMenu(null)\n aboutWindow.once('ready-to-show', () => {\n aboutWindow.show()\n })\n}", "title": "" }, { "docid": "0ca0aa4aa1abab03964e47ea33e85f9d", "score": "0.69915307", "text": "function about() {\n var msg = \"This is a free quiz app for the CS Principles course created by the Mobile CSP Project.<br />\";\n msg += \"Visit us at <a target='_blank' href='http://mobile-csp.org'>http:mobile-csp.org</a> <br> <a style='font-size:70%' href='https://creativecommons.org/licenses/by-nc-sa/4.0/'>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).</a>\";\n open_modal(msg);\n }", "title": "" }, { "docid": "dea04189241d6af8232ac9baa5285eaf", "score": "0.6890211", "text": "function showPopUp(){\r\n document.getElementById('AboutMePopUp').style.display = \"block\"\r\n}", "title": "" }, { "docid": "f4fee919c98405cf28fe9b80d1d5af91", "score": "0.6788376", "text": "function showAbout(msg) {\r\n showInfo(msg);\r\n}", "title": "" }, { "docid": "9e038d2a80427183381084ce0540850a", "score": "0.67723364", "text": "function showAbout() {\n var ui = HtmlService.createHtmlOutputFromFile('About')\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setWidth(640)\n .setHeight(380);\n SpreadsheetApp.getUi().showModalDialog(ui, 'About Application Maker');\n}", "title": "" }, { "docid": "7e95f8630ab904ee003ad04a3a092756", "score": "0.6742912", "text": "function loadInfo(){\n\t\t$('#popMe').modal('show');\n\t}", "title": "" }, { "docid": "4fd347e8848d81c27f9b813f0d005615", "score": "0.6730691", "text": "function loadAboutMe() {\n\tsetUrlToCurrentContent('about_me');\n\tsetContentAndNavigationInfo();\n}", "title": "" }, { "docid": "a829970140b5e5908d1136d333594538", "score": "0.66751945", "text": "function showEditorAbout() {\n const d = new Date();\n const year = d.getFullYear().toString();\n\n // Populate the UI with application details\n const version = document.getElementById('about-solo-version');\n version.innerHTML = `BlocklyProp Solo ${getFullVersion()}, ` +\n `Copyright &copy; 2015, ${year}, Parallax Inc.`;\n\n const launcher = document.getElementById('about-solo-launcher-version');\n let versionString;\n if (clientService.getLauncherVersion().length > 0) {\n versionString = `v${clientService.getLauncherVersion()}, `;\n } else {\n versionString = '';\n }\n\n launcher.innerHTML = `BlocklyProp Launcher ${versionString} ` +\n `Copyright &copy; ${year}, Parallax Inc.`;\n $('#about-solo-dialog').modal();\n}", "title": "" }, { "docid": "627e4ef1743fa3a39f9612343ba19b17", "score": "0.6618316", "text": "function openHelp(url) {\n\twindow.open(url, 'Help', 'width=700,height=600,screenX=100,screenY=100,toolbar=0,scrollbars=1');\n}", "title": "" }, { "docid": "131efb8e1ce1993244c02d814e15ff5f", "score": "0.6570608", "text": "function openProfileEX(uname) {\n\n openNewWindow(EXURL+'/profile/'+uname+'.html?fromSite=1000048', 'profile'+uname, 'resizable=yes,toolbar=no,scrollbars=1,personalbar=no,menubar=no,width=775,height=700');\n\n}", "title": "" }, { "docid": "7d7accc42e80fc7928ebb6e704545afe", "score": "0.6513729", "text": "function about() {}", "title": "" }, { "docid": "1919f9c96d03ad6f4a4f331c186fbbaf", "score": "0.65096045", "text": "function open(){\n\t\tresizePopin();\n\t\toptions.show(domElement);\n\t}", "title": "" }, { "docid": "bb0967132343fa6ccff10e7928f70522", "score": "0.64988697", "text": "function OpenAbout() {\n window.location = \"about.html\";\n}", "title": "" }, { "docid": "7ba086c210b84a2c0fcb8d8faa96515f", "score": "0.647609", "text": "function basicPopup(url) {\r\n popupWindow = window.open(url, 'popUpWindow', 'height=' + screen.height + ',width=' + screen.width + ',\\\r\n\t\tleft=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,\\\r\n\t\tmenubar=no,location=no,directories=no,status=yes');\r\n}", "title": "" }, { "docid": "612d9701778722bd7030e53c73dab23c", "score": "0.6472223", "text": "openInfoWindow() {}", "title": "" }, { "docid": "7cdc70a257b20c9208316f83d17bb365", "score": "0.6458095", "text": "function creatAboutPanel() {\n\t\treturn new Ext.Panel({\n\t\t\tborder : true,\n\t\t\tid : 'infoPanel',\n\t\t\tbaseCls : 'md-info',\n\t\t\tautoWidth : true,\n\t\t\t// contentEl: 'infoContent',\n\t\t\tautoLoad : {\n\t\t\t\turl : catalogue.services.rootUrl + '/about?modal=true',\n\t\t\t\tcallback : loadCallback,\n\t\t\t\tscope : this,\n\t\t\t\tloadScripts : true\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "3d8b48ad535cf26981bcd300285d5e21", "score": "0.6447806", "text": "function displayHelpWindow() {\r\n var definitionName = $(this).text();\r\n var definition = \"\";\r\n\r\n\r\n if ( terms.hasOwnProperty(definitionName)) {\r\n definition = terms[definitionName].definition;\r\n } else {\r\n console.log(\"Popup Window: No definition found for \" + definitionName);\r\n return;\r\n }\r\n\r\n window.open(definition,\"_blank\",\"width=355,height=450\");\r\n}", "title": "" }, { "docid": "dba03c08e758fd66eac3fa46255d1db1", "score": "0.64391685", "text": "function about() {\n swal({\n title: \"José De La Cruz\",\n text: \"Desarrollador Web Front End\",\n icon: \"info\",\n })\n}", "title": "" }, { "docid": "14db6855f03e013b13b87946c292ab73", "score": "0.6395774", "text": "function popup(msg) {\n// jQuery('.description').show();\n\n}", "title": "" }, { "docid": "ea3885bd235f5bef7d0d57132ccbc35f", "score": "0.6386253", "text": "function help_popup(activator, popup_id) {\n \"use strict\";\n var _body, pop, info;\n // set default values\n if (typeof help_popup.popup === \"undefined\") {\n help_popup.popup = null;\n }\n if (typeof help_popup.activator === \"undefined\") {\n help_popup.activator = null;\n }\n if (typeof(activator) == \"undefined\") { // no activator so hide\n if (help_popup.popup) {\n help_popup.popup.style.display = 'none';\n help_popup.popup = null;\n }\n return;\n }\n pop = $(popup_id);\n if (pop == null) {\n _body = document.getElementsByTagName(\"body\")[0];\n pop = document.createElement(\"div\");\n pop.className = \"pop_content\";\n pop.id = popup_id;\n pop.style.backgroundColor = \"#FFC\";\n pop.style.borderColor = \"black\";\n info = document.createElement(\"p\");\n info.style.fontWeight = \"bold\";\n info.appendChild(document.createTextNode(\"Error: No popup for topic \\\"\" + popup_id + \"\\\".\"));\n pop.appendChild(info);\n // this might cause problems with the menu, but as this only happens\n // when something is already wrong I don't think that's too much of a problem\n _body.insertBefore(pop, _body.firstChild);\n }\n if (pop == help_popup.popup) {\n if (activator == help_popup.activator) {\n //hide popup (as we've already shown it for the current help button)\n help_popup.popup.style.display = 'none';\n help_popup.popup = null;\n return; // toggling complete!\n }\n } else if (help_popup.popup != null) {\n //activating different popup so hide current one\n help_popup.popup.style.display = 'none';\n }\n help_popup.popup = pop;\n help_popup.activator = activator;\n\n //must make the popup visible to measure it or it has zero width\n pop.style.display = 'block';\n position_popup(activator, pop);\n}", "title": "" }, { "docid": "4a54287cc01271288225f8cf57ee738e", "score": "0.63765925", "text": "function windowOpenHelp(pageName)\n {\n window.open (\"?page=\" + pageName, \"_self\");\n }", "title": "" }, { "docid": "238a52b292c54c9dd15e7652c074fcb5", "score": "0.63755834", "text": "function popUp(pPage) {\n window.open(pPage,'popWin','resizable=yes,scrollbars=yes,width=800,height=600,toolbar=no');\n}", "title": "" }, { "docid": "1cfa12c1f1ac5fba35e5061c82efcf19", "score": "0.6372989", "text": "function howToGet(){\r\n $(\".howtoget-feedback\").click(function(){\r\n $(\".layout-wrapper-about\").css(\"position\", \"relative\");\r\n $(\".howtoget-popup\").css(\"display\", \"block\");\r\n $(\".howtoget-popup-cancel\").click(function(){\r\n $(\".howtoget-popup\").css(\"display\", \"none\");\r\n $(\".layout-wrapper-about\").css(\"position\", \"static\");\r\n });\r\n });\r\n }", "title": "" }, { "docid": "b5ae6d9722a05c4ecb788732f9acdcfe", "score": "0.63708913", "text": "function popUp(URL) {\n\tday = new Date();\n\tid = day.getTime();\n//\targs = 'toolbar = 0, scrollbars = 0, location = 0, statusbar = 0, menubar = 0';\n//\targs = args + ', menubar = 0, resizable = 0, width = 1024 ,height = 768';\n//\teval(\"page\" + id + \" = window.open(URL, '\" + id + \"', args);\");\n\twindow.open(URL);\n\t}", "title": "" }, { "docid": "f2a5265ca9e6f9498128d788809d258b", "score": "0.6363062", "text": "function aboutWindowPreview() {\n // About-window properties\n let aboutWindow = new BrowserWindow({\n height: 520,\n width: 600,\n title: 'About',\n resizable: false,\n minimizable: false,\n fullscreenable: false,\n show: false,\n autoHideMenuBar: true,\n icon: __dirname + '/assets/logos/Image Lab Icon.png',\n\n })\n aboutWindow.loadURL(`file://${__dirname}/about.html`);\n aboutWindow.show()\n\n aboutWindow.on(\"closed\", function () {\n aboutWindow = null;\n });\n // this part solves the problem of opening links in about window in the same window\n // so when you click a link in about menu, it opens in an external user default browser\n aboutWindow.webContents.on('new-window', function (e, url) {\n // make sure local urls stay in electron perimeter\n if ('file://' === url.substr(0, 'file://'.length)) {\n return;\n }\n // and open every other protocols on the browser \n e.preventDefault();\n shell.openExternal(url);\n });\n\n}", "title": "" }, { "docid": "da86728d00f542aa9fcd754135275872", "score": "0.6358324", "text": "function showInfoPopUpModal(event) {\n // The msg variable stores the data-text from either links\n // appearing on the index.html page. The links are found in the first\n // paragraph of the first section on the HTML page.\n const msg = event.target.dataset.text;\n\n // This is a function call to toggle (switch) the visibility\n // of the backdrop.\n toggleBackdrop();\n\n // The following 2 lines of code, creates the complete\n // set of PopUp Modal window html elements, on the fly. Meaning\n // programmatically or dynamically as they do not pre-exist on\n // the HTML page. The second line adds an existing css class\n // to the \"div\" called, 'modal'.\n popUpModal = document.createElement('div');\n popUpModal.classList.add('modal');\n\n // The following 3 lines of code creates the inner html elements\n // within the 'div' element, actually.\n // Note that what looks like apostrophe are not. They are\n // what we call, back ticks. You can find this key\n // under the tilde ~ sign located on the top far left\n // of most keyboards.\n // Back-ticks are used in JavaScript to construct string\n // characters where spaces and line returns are not ignore\n // as it is with \"\" or ''. This type of string concatenation\n // is called \"Template Literal\" in JavaScript. \n popUpModal.innerHTML = `\n <h2>Modal PopUp Window</h2>\n <p>${msg}</p>\n `;\n\n // The following 3 lines of code creates the button, \n // the event listener for the button, and creates a\n // caption text for the button.\n const closeBtn = document.createElement('button');\n closeBtn.addEventListener('click', hideInfoPopUpModal);\n closeBtn.textContent = 'Got it!';\n\n // This line appends the close button to the popUp Modal\n popUpModal.appendChild(closeBtn);\n\n // This line appends the popUp modal window to the document's body \n document.body.appendChild(popUpModal);\n}", "title": "" }, { "docid": "4c8d8c9b229de748973dc3e84680e605", "score": "0.6337761", "text": "_showAbout() {\n if( this._windows.get( WindowTypes.About ) ) { return; }\n\n const w = new Electron.BrowserWindow( {\n width: 400,\n height: 256,\n resizable: false,\n alwaysOnTop: true\n } );\n\n w.setMenu( null );\n\n w.on( 'closed', () => {\n if( DEBUG ) { Util.log( 'The about application window was closed.' ); }\n\n this._windows.delete( WindowTypes.About );\n } );\n\n const filePath = Path.join( __dirname, 'about.html' );\n w.loadURL( 'file://' + filePath );\n\n this._windows.set( WindowTypes.About, w );\n }", "title": "" }, { "docid": "77018a57aef2aa0a24395a133fe053eb", "score": "0.63147014", "text": "function onInfoShowHandler(e) {\n infoPopupContent.innerHTML = e.detail;\n tau.openPopup(infoPopup);\n }", "title": "" }, { "docid": "131520049e17af0541cb8097f1ea0366", "score": "0.63136744", "text": "function showAboutDialog() {\r\n const pkg = require(\"../package.json\");\r\n showDialogFromTemplate(\"aboutDialogTemplate\", dialog => {\r\n dialog.querySelector(\".aboutHomepage\").appendChild(createLink(pkg.homepage, pkg.homepage));\r\n dialog.querySelector(\".aboutVersion\").textContent = pkg.version;\r\n dialog.querySelector(\".aboutLicense\").textContent = pkg.license;\r\n const authorsNode = dialog.querySelector(\".aboutAuthors\");\r\n pkg.contributors.forEach(function (person) {\r\n const row = document.createElement(\"div\");\r\n row.textContent = person.name;\r\n if (/@/.test(person.email)) {\r\n row.textContent += \" \";\r\n row.appendChild(createLink(\"mailto: \" + person.email, person.email));\r\n }\r\n authorsNode.appendChild(row);\r\n });\r\n });\r\n}", "title": "" }, { "docid": "d51f808184729a633e0f64751ce9ad68", "score": "0.629089", "text": "function toAboutPage() {\n setHeader('About');\n hideAll();\n changeAboutDisplay('flex');\n }", "title": "" }, { "docid": "9303d08ad335b8a1f6e7794668f8cdb0", "score": "0.62892985", "text": "function openHelpWindow() {\n // Get the URL\n var pageURL = \"https://wiki.nci.nih.gov/x/LBo9Ag\";\n window.open (pageURL,\"caArray_User_Guide\", \"status,scrollbars,resizable\");\n}", "title": "" }, { "docid": "4b5f2ac844e014fe76be7745a3f633b0", "score": "0.62735003", "text": "function openModalPeople() {\n setModalPeople(true);\n }", "title": "" }, { "docid": "c93c460641b433bdfda0d148fee13b69", "score": "0.62724894", "text": "function showInformationPopup(anchor, popupTitle, popupText, btnLabel, btnCallback, alignement) {\n WinJS.UI.Fragments.renderCopy(Pages.popup, null).then(function (frag) {\n // this div is global & will contain the popup\n var popupContainer = document.querySelector('.divPopUpGlobal');\n\n // fill the global div with popup UI\n popupContainer.innerHTML = '';\n popupContainer.appendChild(frag);\n\n //set button labels & onclick events\n //yes button\n btn_information_popup.innerHTML = btnLabel;\n btn_information_popup.onclick = btnCallback;\n \n //set title & text\n div_titleInfo_popup.innerHTML = popupTitle;\n div_textInfo_popup.innerHTML = popupText;\n\n //create a flyout from the UI & show it\n var object = new WinJS.UI.Flyout(flyout_information_popup);\n object.show(anchor, CDHelper.placement.top, alignement);\n });\n }", "title": "" }, { "docid": "fbe4fedf0e21d55ff18b5355c4f4b428", "score": "0.6255459", "text": "function openInfoWindow() {\n\n\t\t\t//Only call the API if the current place's url isn't set.\n\t\t\tif(!self.currentPlace().url()) {\n\t\t\t\tvar request = {\n\t\t\t\t\tplaceId: self.currentPlace().id(),\n\t\t\t\t}\n\t\t\t\t//Query the API and call fillDetails, which sets the url if one returned.\n\t\t\t\tservice.getDetails(request, fillDetails);\n\t\t\t\t\n\t\t\t\t//If the place already has a URL, just open the window\n\t\t\t} else {\n\t\t\t\tinfoWindow.setContent(self.currentPlace().infoWindowContent());\n\t\t\t\tinfoWindow.open(map, self.currentPlace().marker);\t\t\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d6b463f77fc1b20e8df93c505fdb345e", "score": "0.62526256", "text": "function handleAboutWindow() {\n if (!aboutWindow) {\n aboutWindow = new BrowserWindow({\n width: 250,\n height: 400,\n resizable: false,\n minimizable: false,\n maximizable: false,\n skipTaskbar: true,\n title: '',\n show: false\n });\n\n aboutWindow.loadURL(url.format({\n pathname: path.join(__dirname, '../renderer/views/about.html'),\n protocol: 'file:',\n slashes: true\n }));\n\n aboutWindow.once('ready-to-show', () => {\n aboutWindow.show();\n });\n\n aboutWindow.on('closed', () => {\n aboutWindow = null;\n });\n } else {\n aboutWindow.focus();\n }\n}", "title": "" }, { "docid": "b2766ead7c0482eb5312fdccaee90ec2", "score": "0.62515837", "text": "function ShowAboutWindow(p_open) {\n if (!ImGui.Begin(\"About Dear ImGui\", p_open, ImGui.WindowFlags.AlwaysAutoResize)) {\n ImGui.End();\n return;\n }\n IMGUI_DEMO_MARKER(\"Tools/About Dear ImGui\");\n ImGui.Text(`Dear ImGui ${ImGui.GetVersion()}`);\n ImGui.Separator();\n ImGui.Text(\"By Omar Cornut and all Dear ImGui contributors.\");\n ImGui.Text(\"Dear ImGui is licensed under the MIT License, see LICENSE for more information.\");\n const show_config_info = STATIC(UNIQUE(\"show_config_info#714b2250\"), false);\n ImGui.Checkbox(\"Config/Build Information\", show_config_info.access);\n if (show_config_info.value) {\n const io = ImGui.GetIO();\n const style = ImGui.GetStyle();\n const copy_to_clipboard = ImGui.Button(\"Copy to clipboard\");\n const child_size = new ImGui.Vec2(0, ImGui.GetTextLineHeightWithSpacing() * 18);\n ImGui.BeginChildFrame(ImGui.GetID(\"cfg_infos\"), child_size, ImGui.WindowFlags.NoMove);\n if (copy_to_clipboard) {\n ImGui.LogToClipboard();\n ImGui.LogText(\"```\\n\"); // Back quotes will make text appears without formatting when pasting on GitHub\n }\n ImGui.Text(`Dear ImGui ${ImGui.VERSION} (${ImGui.VERSION_NUM})`);\n ImGui.Text(`Emscripten ${ImGui.bind.__EMSCRIPTEN_major__}.${ImGui.bind.__EMSCRIPTEN_minor__}.${ImGui.bind.__EMSCRIPTEN_tiny__}`);\n ImGui.Separator();\n // ImGui.Text(\"sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d\", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert));\n ImGui.Text(`ImGui.DrawIdxSize: ${ImGui.DrawIdxSize}, ImGui.DrawVertSize: ${ImGui.DrawVertSize}`);\n // ImGui.Text(\"define: __cplusplus=%d\", (int)__cplusplus);\n // #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_WIN32_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_FILE_FUNCTIONS\n // ImGui.Text(\"define: IMGUI_DISABLE_FILE_FUNCTIONS\");\n // #endif\n // #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS\n // ImGui.Text(\"define: IMGUI_DISABLE_DEFAULT_ALLOCATORS\");\n // #endif\n // #ifdef IMGUI_USE_BGRA_PACKED_COLOR\n // ImGui.Text(\"define: IMGUI_USE_BGRA_PACKED_COLOR\");\n // #endif\n // #ifdef _WIN32\n // ImGui.Text(\"define: _WIN32\");\n // #endif\n // #ifdef _WIN64\n // ImGui.Text(\"define: _WIN64\");\n // #endif\n // #ifdef __linux__\n // ImGui.Text(\"define: __linux__\");\n // #endif\n // #ifdef __APPLE__\n // ImGui.Text(\"define: __APPLE__\");\n // #endif\n // #ifdef _MSC_VER\n // ImGui.Text(\"define: _MSC_VER=%d\", _MSC_VER);\n // #endif\n // #ifdef _MSVC_LANG\n // ImGui.Text(\"define: _MSVC_LANG=%d\", (int)_MSVC_LANG);\n // #endif\n // #ifdef __MINGW32__\n // ImGui.Text(\"define: __MINGW32__\");\n // #endif\n // #ifdef __MINGW64__\n // ImGui.Text(\"define: __MINGW64__\");\n // #endif\n // #ifdef __GNUC__\n // ImGui.Text(\"define: __GNUC__=%d\", (int)__GNUC__);\n // #endif\n // #ifdef __clang_version__\n // ImGui.Text(\"define: __clang_version__=%s\", __clang_version__);\n // #endif\n ImGui.Separator();\n ImGui.Text(`io.BackendPlatformName: ${io.BackendPlatformName ? io.BackendPlatformName : \"null\"}`);\n ImGui.Text(`io.BackendRendererName: ${io.BackendRendererName ? io.BackendRendererName : \"null\"}`);\n ImGui.Text(`io.ConfigFlags: 0x${io.ConfigFlags.toString(16).toUpperCase().padStart(8, \"0\")}`);\n if (io.ConfigFlags & ImGui.ConfigFlags.NavEnableKeyboard)\n ImGui.Text(\" NavEnableKeyboard\");\n if (io.ConfigFlags & ImGui.ConfigFlags.NavEnableGamepad)\n ImGui.Text(\" NavEnableGamepad\");\n if (io.ConfigFlags & ImGui.ConfigFlags.NavEnableSetMousePos)\n ImGui.Text(\" NavEnableSetMousePos\");\n if (io.ConfigFlags & ImGui.ConfigFlags.NavNoCaptureKeyboard)\n ImGui.Text(\" NavNoCaptureKeyboard\");\n if (io.ConfigFlags & ImGui.ConfigFlags.NoMouse)\n ImGui.Text(\" NoMouse\");\n if (io.ConfigFlags & ImGui.ConfigFlags.NoMouseCursorChange)\n ImGui.Text(\" NoMouseCursorChange\");\n if (io.MouseDrawCursor)\n ImGui.Text(\"io.MouseDrawCursor\");\n if (io.ConfigMacOSXBehaviors)\n ImGui.Text(\"io.ConfigMacOSXBehaviors\");\n if (io.ConfigInputTextCursorBlink)\n ImGui.Text(\"io.ConfigInputTextCursorBlink\");\n if (io.ConfigWindowsResizeFromEdges)\n ImGui.Text(\"io.ConfigWindowsResizeFromEdges\");\n if (io.ConfigWindowsMoveFromTitleBarOnly)\n ImGui.Text(\"io.ConfigWindowsMoveFromTitleBarOnly\");\n if (io.ConfigMemoryCompactTimer >= 0.0)\n ImGui.Text(`io.ConfigMemoryCompactTimer = ${io.ConfigMemoryCompactTimer.toFixed(1)}`);\n ImGui.Text(`io.BackendFlags: 0x${io.BackendFlags.toString(16).toUpperCase().padStart(8, \"0\")}`);\n if (io.BackendFlags & ImGui.BackendFlags.HasGamepad)\n ImGui.Text(\" HasGamepad\");\n if (io.BackendFlags & ImGui.BackendFlags.HasMouseCursors)\n ImGui.Text(\" HasMouseCursors\");\n if (io.BackendFlags & ImGui.BackendFlags.HasSetMousePos)\n ImGui.Text(\" HasSetMousePos\");\n if (io.BackendFlags & ImGui.BackendFlags.RendererHasVtxOffset)\n ImGui.Text(\" RendererHasVtxOffset\");\n ImGui.Separator();\n ImGui.Text(`io.Fonts: ${io.Fonts.Fonts.Size} fonts, Flags: 0x${io.Fonts.Flags.toString(16).toUpperCase().padStart(8, \"0\")}, TexSize: ${io.Fonts.TexWidth},${io.Fonts.TexHeight}`);\n ImGui.Text(`io.DisplaySize: ${io.DisplaySize.x.toFixed(2)},${io.DisplaySize.y.toFixed(2)}`);\n ImGui.Text(`io.DisplayFramebufferScale: ${io.DisplayFramebufferScale.x.toFixed(2)},${io.DisplayFramebufferScale.y.toFixed(2)}`);\n ImGui.Separator();\n ImGui.Text(`style.WindowPadding: ${style.WindowPadding.x.toFixed(2)},${style.WindowPadding.y.toFixed(2)}`);\n ImGui.Text(`style.WindowBorderSize: ${style.WindowBorderSize.toFixed(2)}`);\n ImGui.Text(`style.FramePadding: ${style.FramePadding.x.toFixed(2)},${style.FramePadding.y.toFixed(2)}`);\n ImGui.Text(`style.FrameRounding: ${style.FrameRounding.toFixed(2)}`);\n ImGui.Text(`style.FrameBorderSize: ${style.FrameBorderSize.toFixed(2)}`);\n ImGui.Text(`style.ItemSpacing: ${style.ItemSpacing.x.toFixed(2)},${style.ItemSpacing.y.toFixed(2)}`);\n ImGui.Text(`style.ItemInnerSpacing: ${style.ItemInnerSpacing.x.toFixed(2)},${style.ItemInnerSpacing.y.toFixed(2)}`);\n if (copy_to_clipboard) {\n ImGui.LogText(\"\\n```\\n\");\n ImGui.LogFinish();\n }\n ImGui.EndChildFrame();\n }\n ImGui.End();\n }", "title": "" }, { "docid": "29c68aceac9fa87170c87345249a9116", "score": "0.62289315", "text": "about() {\n this.innercontrol.about();\n }", "title": "" }, { "docid": "fd02fe5647e6fd8448f058826367c98f", "score": "0.6197219", "text": "function viewHelp(href) {\n //alert(\"test\");\n var msgWindow = window.open(href, 'MCWebHelp', \"resizable=1,scrollbars=1,menubar=0,toolbar=0,status=0,location=0,directories=0,width=800,height=600,screenX=10,screenY=10,top=10,left=10\");\n msgWindow.focus();\n //return false;\n}", "title": "" }, { "docid": "b39df52983e30b1a51e6eabecde277c5", "score": "0.6193414", "text": "popup(){}", "title": "" }, { "docid": "ae12a1c7ff0f8832295a152de88da385", "score": "0.61795187", "text": "function infoMessageBox(message, title){\n\t$(\"#info-body\").html(message);\n\t$(\"#info-title\").html(title);\n\t$(\"#info-popup\").modal('show');\n}", "title": "" }, { "docid": "037095f7cacc1e23ebf5ef0524d53700", "score": "0.6177611", "text": "function openPopUp(onScreen) {\n $(\"p\").html(onScreen);\n $(\".popup-overlay, .popup-content\").addClass(\"active\");\n $(\".page-bckgrnd-edit\").addClass(\"active\");\n $(\".loginbox\").addClass(\"active\");\n}", "title": "" }, { "docid": "e80b6244cb31f55fa0f963ed43064b25", "score": "0.61757946", "text": "function userPopUp() {\n var response = confirm(\"would you like a pop up?\");\n if (response) {\n popUp();\n } else {\n noPopUp();\n }\n }", "title": "" }, { "docid": "35cf846964ac52b18344a679859d020a", "score": "0.6168759", "text": "function openAgentNew(sUrl) {\n\topenPopUp(sUrl, \"ag\",\"scrollbars=yes, menubar=no, width=500, height=550, resizable=yes\");\n}", "title": "" }, { "docid": "deadb839de357c303d9db581cef70786", "score": "0.61654055", "text": "function AboutDialog(parentSelector, i18n, interactive) {\n BasicDialog.call(this, {\n dialogClass: \"about-dialog\",\n appendTo: parentSelector\n }, i18n);\n this._i18n = i18n;\n if (interactive) {\n this.update(interactive);\n }\n}", "title": "" }, { "docid": "30d818edfaf9cfda45c7c078c6cdfd27", "score": "0.61623305", "text": "function runAboutMe() {\n $('#js-about-nav').click(function() {\n handleHideSections();\n showAboutMe();\n console.log('show about me');\n });\n}", "title": "" }, { "docid": "b32e90e763d14bb595fcc58a2abc33c2", "score": "0.6161034", "text": "function addIngredientsPopUp(param){\r\n\tvar x = screen.width/2 - 700/2;\r\n\tvar y = screen.height/2 - 550/2;\r\n\twindow.open(param.href, 'sharegplus','height=485,width=700,left='+x+',top='+y);\r\n}", "title": "" }, { "docid": "b51bb1dfd36ecb5941c8dbb904173ec9", "score": "0.6150105", "text": "function popup(title, options){\n\tvar id = \"popup_\" + (options.id || (new Date()).getTime());\n\tvar _popup = \"#\"+id;\n\tif(!$(_popup).length){\n\t\tvar content = \"\";\n\t\tif (options.content) {\n\t\t\tif(options.content.indexOf(\"#\") == 0){\n\t\t\t\tcontent = $(options.content).html();\n\t\t\t\t$(options.content).remove();//Avoid id confliction.\n\t\t\t}else if(options.content.indexOf(\"/\") == 0){\n\t\t\t\t$.get(options.content, options.data, function(data){\n\t\t\t\t\toptions.content = data;\n\t\t\t\t\tpopup(title, options);\n\t\t\t\t\tif (options.callback) {\n\t\t\t\t\t\teval(options.callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tcontent = options.content;\n\t\t\t}\n\t\t}\n\t popHolder(id, title, content, options.cssClass).appendTo($(document.body));\n\t\tvar jqmOptions = options.jqm || {overlay: 0, modal:false};\n\t\tvar modal = $(_popup).jqm(jqmOptions)\n\t\tif (options.drag) {\n\t\t\tmodal = modal.jqDrag(\".pop-title\");\n\t\t}\n\t\tif (options.resize) {\n\t\t\tmodal.jqResize();\n\t\t}\n\t\tif(options.position){\n\t\t\t$(_popup).css(options.position);\n\t\t}else{\n\t\t $(_popup).css({\"margin-top\":-($(_popup).height()/2)});\t\n\t\t}\n\t\tif (options.timeout>0) {\n\t\t $(_popup).attr(\"timeout\",options.timeout);\n\t\t autoClose(id);\n\t\t}\t\t\n\t}\n\t$(_popup).jqmShow();\n}", "title": "" }, { "docid": "0bef361d65a3c175f555267b745c2ade", "score": "0.6149765", "text": "function showProfile(data){\n\tvar prof='<div class=\"popup popup-profile\">'+\n\t '<div id=\"wrapper\">'+\n\t\t'<div id=\"profile\">'+\n\t\t '<div class=\"img cowok\"></div>'+\n\t\t '<div class=\"info\">'+\n\t\t\t'<strong>Jack Sparrow</strong>. I\\'m a <strong>50 year old</strong> self-employed <strong>Pirate</strong> from the <strong>Caribbean</strong>.'+\n\t\t '</div>'+\n\t\t'</div>'+\n\t\t'<a href=\"#\" class=\"button button-fill color-red close-popup\">Close</a>'+\n\t '</div>'+\n '</div>';\n\tmyApp.popup(prof);\n}", "title": "" }, { "docid": "57cd883d5048d2f94de2f18027d0b54d", "score": "0.6149478", "text": "function LaunchHelpModal(){\t\n\t\n\t$(function(){\n\t\t$.ajax({\n\t\t\turl: 'help.php',\n\t\t\ttype: 'GET',\n\t\t\tsuccess: function(data){\n\t\t\t\t$('#modal_help').html(data);\t\n\t\t\t},\n\t\t\tfailure: function(){\n\t\t\t\t$('#modal_help').html(\"Problem loading content\");\n\t\t\t}\n\t\t});\n\t});\n\t// render the dialog\n\t$(\"#modal_help\").dialog({\n\t\t\t\tautoOpen: false,\n\t\t\t\tcache: false,\n\t\t\t\tmodal: true,\n\t\t\t\theight: 600,\n\t\t\t\twidth: 550,\n\t\t\t\tdraggable: false,\n\t\t\t\tresizable: false,\n\t\t\t\ttitle: 'Help Menu',\n\t});\n\t// open the dialog\n\t$( \"#modal_help\" ).dialog( \"open\" );\t\n}", "title": "" }, { "docid": "62b5d1e1decac8f210ab3f934d5b12ca", "score": "0.61393917", "text": "function aboutmesetup() {\n\n\t\t$(\"#pqhint\").show();\n\n\t\t$(\"#pshelp\").click(function(){\n\t\t\tif ($(\"#pshint\").is(\":visible\")) {\n\t\t\t\t$(\"#pshint\").fadeOut();\n\t\t\t} else {\n\t\t\t\t$(\"#pshint\").fadeIn();\n\t\t\t}\n\t\t});\n\n\t\t$(\"#achievehelp\").click(function(){\n\t\t\tif ($(\"#achievehint\").is(\":visible\")) {\n\t\t\t\t$(\"#achievehint\").fadeOut();\n\t\t\t} else {\n\t\t\t\t$(\"#achievehint\").fadeIn();\n\t\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "ab01c9feb09b33eeb411e049475d8c5a", "score": "0.6121464", "text": "function openHelpDialog() {\n $('#help-dialog').dialog('open');\n}", "title": "" }, { "docid": "8ce057520b5b61d6dc972ec0495df0bc", "score": "0.6115759", "text": "function openHelp() {\n\t var urlSistema = document.getElementById(\"urlSistemaHelp\").value;\n\t urlSistema = urlSistema+\"/xhtml/help.jsf\";\n\t window.open(urlSistema, \"Help\", \"width=800, height=600, status=yes, scrollbars=yes, resizable=no, menubar=yes, tollbar=yes\");\t\n\t}", "title": "" }, { "docid": "7e05219bf7fadd6f5f7cd0bf03135c90", "score": "0.6112072", "text": "function popup(pageName)\n{\n\twindow.open(pageName, \"newWindow\", \"resizable=yes,scrollbars=yes,width=800,height=600\");\n}", "title": "" }, { "docid": "dd675fc53e2dd64c38c8f23673076071", "score": "0.61079854", "text": "function popUp(URL, preferences) {\n if (window.popup) { \n try {\n window.popup.close();\n } catch(e) {}\n }\n\n if (!preferences) {\n preferences = 'toolbar=0,scrollbars=1,location=0,statusbar=1,' + \n 'menubar=0,resizable=1,width=490,height=400,top=150';\n }\n \n window.popup = window.open(URL, 'bloggerPopup', preferences);\n}", "title": "" }, { "docid": "55055dc9c4a57a7c9c247d76cd3029ae", "score": "0.60921085", "text": "function openInfoPopup(event) {\r\n event.stopPropagation();\r\n\r\n var popupBackground = document.getElementById(\"popupBackground\");\r\n var infoContentContainer = document.getElementById(\"infoContentContainer\");\r\n document.getElementById(\"popupTitleText\").innerHTML = \"Data Privacy\";\r\n\r\n infoContentContainer.style.display = \"block\";\r\n popupBackground.style.display = \"block\";\r\n}", "title": "" }, { "docid": "d1c32f7ca61c78d07f59a31921185b61", "score": "0.6090507", "text": "function showPopup (editor) {\n var popupObject, propertiesToSend;\n popupObject = preparePopupObject();\n\n propertiesToSend = {\n window: window,\n editor_id : editor.editor_id,\n popup: popupObject\n };\n\n popup = editor.windowManager.open(popupObject, propertiesToSend);\n editor.windowManager.setParams(popupObject);\n }", "title": "" }, { "docid": "08cd7f5372f131ee3c86cae12a620b3a", "score": "0.6087233", "text": "async function openHelp() {\n\tawait Common.createNewTab('https://docs.integromat.com/apps/integromat-importer', true);\n}", "title": "" }, { "docid": "8330501f1823e2b2db3664c9f0fee4f4", "score": "0.60825783", "text": "function showPopup( message ) {\n\n $(\"#popupmessage h3\").text( message );\n $(\"#popupmessage\").popup(\"open\");\n}", "title": "" }, { "docid": "0ba95612a640cc732c997c7756c49ee9", "score": "0.6080416", "text": "function openHelp()\n{\n // opens the help page on GitHub\n chrome.tabs.create({'url': \"https://github.com/isaiahnields/SearchQueue\"});\n}", "title": "" }, { "docid": "e506fdb85349b0212fb2eac28fb5b52b", "score": "0.60773456", "text": "function openInformation() {\n let informationTitle = \"About\";\n let informationText = `<br>\n <p style=\"text-align:center; padding-bottom:10px;\">\n Project 2 - Javascript Essentials - <a href=\"https://codeinstitute.net/\" target=\"_blank\">Code Institute</a>\n </p>\n <p style=\"text-align:center; padding-bottom:10px;\">\n Created by James Dybacz &copy;2021\n </p>\n <p style=\"text-align:center; padding-bottom:10px;\">\n <span>Email: <a href=\"mailto:jdybacz@gmail.com\" target=\"_blank\"><i class=\"fas fa-envelope\"></i></a></span>\n <span>GitHub: <a href=\"https://github.com/dybacz\" target=\"_blank\"><i class=\"fab fa-github\"></i></a></span>\n <span>LinkenIn:<a href=\"https://www.linkedin.com/in/james-dybacz/\" target=\"_blank\"><i class=\"fab fa-linkedin\"></i></a></span>\n </p>\n <p style=\"text-align:center;\">\n <a href=\"https://jigsaw.w3.org/css-validator/check/referer\">\n <img style=\"border:0;width:88px;height:31px\"\n src=\"https://jigsaw.w3.org/css-validator/images/vcss-blue\"\n alt=\"Valid CSS!\" />\n </a>\n </p>\n <br>`;\n alertBox(informationTitle, informationText, \"grey\");\n}", "title": "" }, { "docid": "670ef010c3b903ff4693c35aeef0fb55", "score": "0.60729456", "text": "function openPopup()\n{\nvar oPopup = window.createPopup();\nSetDefaultStyles(oPopup);\nreturn oPopup;\n}", "title": "" }, { "docid": "a3585ecf03bc93172015cef53fd7ddaf", "score": "0.60722584", "text": "function viewDetailPage(pageNameWithParameters)\n{\n\tshow_popup(pageNameWithParameters);\n}", "title": "" }, { "docid": "0c094e26feec95dd3fcf4e54b85141c3", "score": "0.60634595", "text": "function learningModePopup(){\n popContentDisplay('#learningmode');\n}", "title": "" }, { "docid": "9bd8c12f6783b42b182e88c8783532e1", "score": "0.60595334", "text": "function popUp(URL) {\r\n day = new Date();\r\n id = day.getTime();\r\n eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=250,left = 312,top = 284');\");\r\n}", "title": "" }, { "docid": "f8030d81cadafb44603d4c05df59e2a8", "score": "0.6058337", "text": "function showPopup(message, elem) {\n\t\t\tif (!elem) {\n\t\t\t\telem = '#region-popup';\n\t\t\t}\n\n\t\t\tmessage += '<a href=\"#\" onclick=\"$(\\'#region-popup\\').popup(\\'close\\')\" class=\"popup-close\">X</a>';\n\t\t\t$(elem).html(message).popup().popup('open');\n\t\t}", "title": "" }, { "docid": "b0c0a67d890cd6bf1079d6f620c5d4a2", "score": "0.6055421", "text": "function PHCC_list(){\n\tvar url = \"poplist.jsp\";\t\n\twindow.open(url,\"MeiWindow\",\n 'left=60,top=60,Width=476,Height=300,'\n +'toolbar=0,location=0,directories=0,'\n +'status=1,menubar=0,titlebar=0,scrollbars=0,resizable=0');\n\t\n}", "title": "" }, { "docid": "f56e8502d94e6dae29a1421415966473", "score": "0.6051259", "text": "function windowOpener(url, name) {\n var args = \"width=600,height=400,scrollbars,resizable\";\n if (!helpWindow) {\n helpWindow = $window.open(url, name, args);\n } else {\n if (!helpWindow.closed) {\n helpWindow.location.href = url;\n } else {\n helpWindow = $window.open(url, name, args);\n }\n }\n helpWindow.focus();\n }", "title": "" }, { "docid": "6b53704715be456320c360f4530ff918", "score": "0.6025328", "text": "function showPolice() {\n\twindow.open(urlPolice);\n}", "title": "" }, { "docid": "24044523ca57a6c7e3d35557399de273", "score": "0.60212964", "text": "function popup_edit_category($id){\n\tif (window.Popup) window.Popup.close();\n\twindow.insPopup = window.open(\"../libraries/sitetree.class/popup.edit_category.php?id=\"+$id,\"\",\"width=550,height=400,scrollbars=yes,resizeable=yes,left=100,top=100\");\n}", "title": "" }, { "docid": "54a128bfbb70597202f01b0a9bae7fde", "score": "0.60169876", "text": "function openWin(pageURL) {\r\n window.open(pageURL,\"Help\",\"status,scrollbars,resizable,alwaysRaised,dependent,width=1000,height=800\");\r\n}", "title": "" }, { "docid": "afd11af00bb403836539ea16c4db21ff", "score": "0.6010247", "text": "function about_okAction(event) {\n\t$( \"#about_dialog\" ).dialog( \"close\" );\n}", "title": "" }, { "docid": "31a0d83a71e09154eb5a0ec0a148bba7", "score": "0.60049057", "text": "function pop(URL, name) {\n bWindow = window.open(URL, name,\"status=0,menubar=0,width=620,height=542\");\n \n}", "title": "" }, { "docid": "d3ebad704c82e1fdbb43a2b324e3f9f1", "score": "0.59971386", "text": "function initPopUp() {\r\n\t$(\"#popupMsg\").popup({\r\n\t\ttheme: \"a\",\r\n\t\toverlayTheme: \"a\",\r\n\t\tpositionTo: \"window\",\r\n\t\ttransition: \"fade\"\r\n\t});\r\n}", "title": "" }, { "docid": "7df1098e7106f6317c8299b8027910a5", "score": "0.5995471", "text": "open() { return this._infoWindowManager.open(this); }", "title": "" }, { "docid": "5e394d35561ac9a4353da59561884dc9", "score": "0.5990644", "text": "function popUpInfo (feature, layer) {\n\tlayer.bindPopup(feature.properties.town + \": founded in \" + feature.properties.year);\n}", "title": "" }, { "docid": "1b83a5089ecb0aa0396655a30627d1cf", "score": "0.5987757", "text": "function HelpAbout(){\n\tif (!winHelpAbout) {\n\t\tvar winHelpAbout = new Ext.Window({\n\t\t\ttitle: 'About this Application',\n\t\t\tlayout: 'fit',\n\t\t\tclosable: true,\n\t\t\tcloseAction: 'hide',\n\t\t\tmaximizable: true,\n\t\t\twidth: 800,\n\t\t\theight: 500,\n\t\t\titems: [{\n\t\t\t\txtype: 'panel',\n\t\t\t\tautoScroll: true,\n\t\t\t\thtml: 'The NGDS Data Explorer web GIS application was created by Jessica Good Alisdairi for the Arizona Geological Survey (AZGS), the US Geoscience Information Network (USGIN) and the National Geothermal Data System (NGDS).<br> <br> It uses <a href=\"http://openlayers.org/\">OpenLayers</a>, <a href=\"http://http://geoext.org/\">GeoExt</a> and <a href=\"http://dev.sencha.com/deploy/ext-3.4.0/\">Ext JS</a>.<br> <br> <b>Application Updates</b> <br><br> Version 4.3 (September 26, 2013):<br> - Added zoom by drawing a box to the map toolbar.<br> <br> Version 4.2 (September 18, 2013):<br> - Added icons and NGDS logo.<br> - Added wildcard (*) search.<br> - Added address lookup.<br> <br> Version 4.1 (August 23, 2013):<br> - Reorganized the map toolbar.<br> - Added option to export All Features from layer without selecting features.<br> - Added export options to Layer Panel right-click menu.<br> - Moved the option to Get the URL of the WFS Server to the Layer Panel right-click menu.<br> <br> Version 4.0 (July 19, 2013):<br> - Added right-click menu to list of layers in the Layer Panel.<br> - Added view metadata option to Layer Panel right-click menu.<br> - Moved the Remove Layer option to the Layer Panel right-click menu.<br> - Moved Zoom to Layer to the Layer Panel right-click menu.<br> <br> Version 3.1 (July 17, 2013):<br> - Changed default baselayer from Google Satellite view to Streets view.<br> <br> Version 3.0 (July 1, 2013):<br> - Changed the name to NGDS Data Explorer.<br> - Increased the maximum number of CSW results from 1000 to 10000.<br> - Modified search to assume an AND condition when more than one search term is entered.<br> <br> Version 2.1 (November 2013):<br> - Added the option to Get the URL of the WFS Server.<br> - Changed Zoom Extent so it zooms to the max extent of all layers.<br> <br> Version 2.0 (October 2012):<br> - Made the lenged auto open/close on layer check/uncheck.<br> - Added the ability to double-click a layer in the search results to add it to the map.<br> - Added the Export to CSV option.<br> <br> Version 1.0 (September 2012):<br> - Added the Catalog Search.<br> - Changed the zoom slider.<br> - Added a scale.<br> - Added an overlay map.<br> - Added additional base maps.<br> - Added the current cordinates of the mouse pointer to the map.<br> - Added the distance measure tool.<br> - Added the Remove Layer button.<br> - Added the option to set the extent of the map to only retreive features within that extent.<br> - Added the ability to make a single table with data from across multiple data services.<br> <br> Version 0.2 (23 August 2012):<br> - Added the ability to zoom to the active layer. <br> - Added the select box button to the toolbar so the ability to click and drag the map remains active unless the select box button is depressed. <br> - When the show popups button is undepressed all popups are cleared from the map display.<br> <br> Version 0.1 (10 July 2012):<br> - Initial Release<br>'\n\t\t\t}],\n\t\t\tbuttons: [{\n\t text: 'Close',\n\t handler: function () {\n\t winHelpAbout.hide();\n\t }\n\t \t}]\n\t\t});\n\t}\n\twinHelpAbout.show();\t\n}", "title": "" }, { "docid": "4ce5970dfe358246c83e44345be0ac2f", "score": "0.59851235", "text": "function openRequestedPopup(i) {\r\n visiteWebsite = window.open(\"https://\" + bookMarkContainer[i].url + \"\");\r\n\r\n}", "title": "" }, { "docid": "55120541b22939fc953a8b7bc6638032", "score": "0.59828687", "text": "function infoMessageBoxLg(message, title){\n\t$(\"#info-body-lg\").html(message);\n\t$(\"#info-title-lg\").html(title);\n\t$(\"#info-popup-lg\").modal('show');\n}", "title": "" }, { "docid": "fec0e71630fb195ea06ed7b45aea209d", "score": "0.5980288", "text": "showAlert() {\n const anchor = null;\n this._popUp = (0, _createPopUp.default)(_AlertInfo.default, null, {\n anchor,\n position: _PopUpPosition.atViewportCenter,\n onClose: val => {\n if (this._popUp) {\n this._popUp = null;\n }\n }\n });\n }", "title": "" }, { "docid": "d368a3847a7478339ce08da03ca7da20", "score": "0.5969172", "text": "function openView() {\n\t\t\tgadgets.views.openGadget(function(result) {\n\t\t\t return result ? createTodo(result) : null; \n\t\t\t}, function(site) {\n\t\t\t return null;\n\t\t\t}, {\n\t\t\t\tview: 'popup-view',\n\t\t\t\tviewTarget: 'MODALDIALOG'\n\t\t\t});\n\t }", "title": "" }, { "docid": "fc06fa82ca4ce7c9897130d0670af992", "score": "0.5968204", "text": "function opencourseresumepopup() {\n \n $(\"#courseresumePopupup\").html(\"Would you like to resume where you left off?\");\n $(\"#courseresumePopupup\").dialog({\n resizable: false,\n modal: true,\n title: \"Resume\",\n height: 250,\n width: 300,\n buttons: {\n \"Yes\": function () {\n $(this).dialog('close');\n callback(true);\n },\n \"No\": function () {\n $(this).dialog('close');\n callback(false);\n }\n }\n });\n $(\"#courseresumePopupup\").show();\n}", "title": "" }, { "docid": "4be48923f993081c344309f257c66582", "score": "0.5965286", "text": "function popupartscroll(section_id,article_id,popwidth,popheight)\n{\n\twindowPop = window.open ('/article.asp?section_id='+section_id+'&article_id='+article_id, \"articlepopup\", \"toolbar=0,resizable=0,scrollbars=1,status=0,width=\"+popwidth+\",height=\"+popheight);\n\twindowPop.focus();\n}", "title": "" }, { "docid": "957e65af3e1bc79a8ed9fb7dc6937c03", "score": "0.596426", "text": "function open_about_box () {\n $('body').animate({ backgroundColor: \"#cfcfcf\" }, \"fast\");\n $('<div id=\"about-slidedown\">').insertAfter('.action-strip').hide();\n $('#about-slidedown').html($('#about-copy').html()).slideDown({duration: \"fast\", complete: cleanup_slidedown});\n \n}", "title": "" }, { "docid": "6269032bc248720a27c01f8ee55ba0e0", "score": "0.5961753", "text": "function openPlans(sUrl) {\n\topenPopUp(sUrl, \"pl\",\"scrollbars=yes, menubar=no, toolbar=yes, width=600, height=500, resizable=yes\");\n}", "title": "" }, { "docid": "d2e422e26358ada6f3cffe418c613101", "score": "0.5954361", "text": "function popUp(url, width, height)\n{\n var day = new Date();\n var id = day.getTime();\n \n //pass in the url to open, the rest of the parameters are just options on the new window that will open.\n window.open(url, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='\n + width + ',height=' + height + ',left = 300,top = 300');\n}", "title": "" }, { "docid": "88670b7e56d30e9f50b2cd30f1cff4b0", "score": "0.595314", "text": "OpenInfoWindow(infoWindow, map, marker) {\n infoWindow.open(map, marker);\n }", "title": "" }, { "docid": "209937cbe5cdb9fb7d2a170128300442", "score": "0.5952788", "text": "function ShowInfo(s) {\n $('#popup-info').show()\n $('#popup-info').text(s)\n}", "title": "" }, { "docid": "11198bb84bd7fc962d3342d5a806b9c5", "score": "0.5943945", "text": "function togglePopup() {\n $(\".pop-up\").toggle();\n}", "title": "" }, { "docid": "5ed303025ef0477552aea8ff11a901ab", "score": "0.5943557", "text": "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "title": "" }, { "docid": "d4d7fa3ca3dd5e185d4647084908d077", "score": "0.59423566", "text": "function openModalPopup()\t\t \n\t\t{\t\n\t\t\t\n\t\t\tif (isLocalfileOrServer!=true) {\n\t\t\t\twindow.shell.checkhostReachable() \n\t\t\t\tif(onLineFlag==\"offline\"){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(this).addClass('selected');\t\t\t\n\t\t\t$(\"#shellHeader\").hide();\t\n\t\t\tref.globalThumb = $(this);\t\t\t\n\t\t\t$(\".btnclose\").on('click', closePopup);\n\t\t\t$('#modalwrapper').show();\t\t\t\n\t\t\tref.modalID = $(this).attr('id').split('_')[1];\n\t\t\tref.allThumbVisited[ref.modalID]=1\n\t\t\t$(ref.container).find('#modalwrapper').show();\t\t\t\n\t\t\t$(ref.container).find('#modalwrapper').find(\"#mypopUpContent_\" + ref.modalID).fadeIn(\"slow\");\n\t\t\t$(ref.container).find('#modalwrapper').find(\"#mypopUpContent_\" + ref.modalID).siblings('div.popContent').hide();\n\t\t\t// if($(ref.container).find('.figure-ctr1').length == $(ref.container).find('.selected').length){\t\t\t\n\t\t\t// \twindow.shell.updateVisitedPages(globalCurTopic, globalCurPage);\n\t\t\t// }\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(ref.container).find('.modal-dialog').find('.modal-content').find('.modal-body').find('div').getNiceScroll().show();\t\t\t\t\n\t\t\t\t$(ref.container).find('.modal-dialog').find('.modal-content').find('.modal-body').find('div').getNiceScroll().resize();\n\t\t\t}, 500);\n\t\t\t\t\t\n\t\t\t\t\t//prevent native touch activity like scrolling\n\t\t\t\t\t$('.modal_bg').on('touchstart touchmove', function(e){ \t\t\t\t \n\t\t\t\t\t\t e.preventDefault(); \n\t\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "962791a3bd08bdb3be7ac363c0a29213", "score": "0.59372103", "text": "function showSharePopup() {\n $(SHARE_POPUP).foundation('reveal', 'open');\n}", "title": "" }, { "docid": "64f81877d7eac7fb4de32a61a7042588", "score": "0.59319484", "text": "function open_helpwindow(url)\n {\n \tif(url == \"URLreference not in database yet.\"){\n \t\talert(\"Reference web page is not in database yet.\");\n \t}else{\n\t\t helpwindow = window.open(url, \"helpwindow\", \"width=800,height=600,scrollbars=yes\", false);\n\t\t helpwindow.focus();\n \t}\n\t return false;\n }", "title": "" }, { "docid": "afad6307e754258b49bc17a574691920", "score": "0.5931679", "text": "function loadAboutCode() {\n\tsetUrlToCurrentContent('about_the_code');\n\tsetContentAndNavigationInfo();\n}", "title": "" }, { "docid": "da2401d914887b75264cc5864d243d55", "score": "0.5930271", "text": "function popitup(url) {\n // Opens a new browser window called newwindow. url specifies the URL of the page to open.\n newwindow=window.open(url,'name','height=300,width=250',\"_parent\");\n // Sets focus to the new window if the focus is on the previous page.\n if (window.focus) {\n newwindow.focus();\n }\n return false;\n}", "title": "" }, { "docid": "4a348095cce8f91ec5e89a054d244555", "score": "0.5930005", "text": "function about(mode)\n{\n\tif (mode=='on') {\n\t\tdocument.getElementById('about').style.display=\"block\";\n\t}\n\tif (mode=='off') {\n\t\tdocument.getElementById('about').style.display=\"none\";\n\t}\n}", "title": "" }, { "docid": "3e01ab6725a2f0655d9d4645e0b19809", "score": "0.5920747", "text": "function openSuburb(sUrl) {\n\topenPopUp(sUrl, \"su\",\"scrollbars=yes, menubar=no, width=450, height=350, resizable=yes\");\n}", "title": "" } ]
5ad9ed1dd47db3750b8f53247943786b
Replies to page messages.
[ { "docid": "7f8cbdf35450ed86983121bc83baca55", "score": "0.0", "text": "function replyToPageLastFeedItem(pageId) {\n // From page id get owner access token.\n const sandraUserId = '112064199317537';\n database.findUser(sandraUserId, (err, res) => {\n const pageOwnerAccessToken = res[0].accessToken;\n graphApi.getPageAccessToken(pageId, pageOwnerAccessToken, (err, pageAccessToken) => {\n graphApi.getLastFeedItemId(pageId, pageAccessToken, (err, feedItemId) => {\n if (err) {\n console.log(err);\n return;\n }\n\n if (!wasRepliedTo(feedItemId)) {\n // Add feed item to replied to list.\n addToLastRepliedToFeedIds(feedItemId);\n\n const responseMessage = getRandomBusinessResponse();\n graphApi.likeFeedItem(feedItemId, pageAccessToken, (err) => {});\n graphApi.commentOnFeedItem(feedItemId, pageAccessToken, responseMessage, (err, commentId) => {\n if (err) {\n console.log(err);\n }\n });\n }\n });\n\n });\n });\n}", "title": "" } ]
[ { "docid": "73b55ece724c54a8816cbb87d28c3a5d", "score": "0.6911743", "text": "function processMessageFromPage(event) {\n var senderID = event.sender.id;\n var pageID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n\n console.log(\"[processMessageFromPage] user (%d) page (%d) timestamp (%d) and message (%s)\", senderID, pageID, timeOfMessage, JSON.stringify(message));\n\n if (message.quick_reply) {\n console.log(\"[processMessageFromPage] quick_reply.payload (%s)\",\n message.quick_reply.payload);\n handleQuickReplyResponse(event);\n return;\n }\n\n // the 'message' object format can vary depending on the kind of message that was received.\n // See: https://developers.facebook.com/docs/messenger-platform/webhook-reference/message-received\n var messageText = message.text;\n if (messageText) {\n console.log(\"[processMessageFromPage]: %s\", messageText);\n var lowerCaseMsg = messageText.toLowerCase();\n switch (lowerCaseMsg) {\n case 'help':\n // handle 'help' as a special case\n sendHelpOptionsAsQuickReplies(senderID);\n break;\n default:\n // otherwise, just echo it back to the sender\n processNLPMessage(senderID, event);\n }\n }\n}", "title": "" }, { "docid": "b2ecf43fd8f0a9d2280e6f0510b40041", "score": "0.6885529", "text": "function writeMessagesForPage() {\r\n clientErrorStorage = new Object();\r\n var summaryTextExistence = new Object();\r\n var page = jQuery(\"[data-role='Page']\");\r\n var pageId = page.attr(\"id\");\r\n var data = getValidationData(page, true);\r\n\r\n calculateMessageTotals(pageId, data);\r\n if (prevPageMessageTotal === 0 && data.messageTotal == 0) {\r\n return;\r\n }\r\n\r\n prevPageMessageTotal = data.messageTotal;\r\n\r\n if (data) {\r\n var messageMap = data.messageMap;\r\n if (!messageMap) {\r\n messageMap = {};\r\n data.messageMap = messageMap;\r\n }\r\n }\r\n\r\n writeMessagesForChildGroups(pageId);\r\n writeMessagesForGroup(pageId, data, false, true);\r\n displayHeaderMessageCount(pageId, data);\r\n jQuery(\".uif-errorMessageItem > div\").show();\r\n}", "title": "" }, { "docid": "5afb12e154aa548ae6018c41f75788c7", "score": "0.68058145", "text": "function processMessageFromPage(event) {\n var senderID = event.sender.id;\n var pageID = event.recipient.id;\n var timeOfMessage = event.timestamp;\n var message = event.message;\n console.log(\"[processMessageFromPage] user (%d) page (%d) timestamp (%d) and message (%s)\",\n senderID, pageID, timeOfMessage, JSON.stringify(message));\n // the 'message' object format varies depending on the message type\n var messageText = message.text;\n if (messageText) {\n console.log(\"[processMessageFromPage]: %s\", messageText);\n //Buat nonaktifkan repy message di fanpage\n //sendTextMessage(senderID, messageText);\n }\n}", "title": "" }, { "docid": "8e42338ff303c3bb7d7a2a25a98840bf", "score": "0.6552402", "text": "function loadPage() {\r\n\tmessageCount = $('#liste_messages .message').size();\r\n\t$('#pageDisplayChat .messageCount').html(messageCount);\r\n\t\r\n\tinferiorLimit = messagePerPage * actualPage;\r\n\tsuperiorLimit = inferiorLimit + messagePerPage;\r\n\t\r\n\t// show messages in the actual page, hide others\r\n\t$('#liste_messages .message').each( function() {\r\n\t\tif ($(this).attr('data-numero') >= inferiorLimit && $(this).attr('data-numero') < superiorLimit) {\r\n\t\t\t$(this).show();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(this).hide();\r\n\t\t}\r\n\t});\r\n\t\r\n\trefreshPageAccessors();\r\n}", "title": "" }, { "docid": "6e5265d42bb5aa00273d6a7ec5e761b6", "score": "0.6437336", "text": "nextPage() {\n //if (!(this.curPage < this.pages.length - 1)) return this.clearReactions();\n\n this.curPage += 1;\n this.curPage = this.curPage%this.pages.length;\n this.updateMessage(this.curPage);\n }", "title": "" }, { "docid": "1d049485c47b613177874fa22237af95", "score": "0.6362456", "text": "updatePageMessage( message, type ) {\n\t\t\tif ( this.pageMessageContainer().length ) {\n\t\t\t\tthis.pageMessageContainer().html( this.pageMessageHtml( message, type ) );\n\t\t\t\tthis.makeNoticesDismissible();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5ea73c63d7c0d7ca54f56d99d2df4f70", "score": "0.6236116", "text": "function notify(message) {\r\n if (pages.indexOf(message.url) === -1) {\r\n\t\tpages.push(message.url);\r\n\t\tclacks.push(\"+\" + sanitiseMsg(message.value));\r\n\t}\r\n\tupdateActiveTab();\r\n}", "title": "" }, { "docid": "8b933df5f104eb351ebe11d7849d4d33", "score": "0.62148666", "text": "function onMessage(message) {\n console.log(\"onMessage(message)\");\n var pageData,\n docData;\n // if (!message.getResourceContentRequest && !message.docProgress)\n if (message.winId) {\n portPageId[port.portId_] = message.pageId;\n if (message.processInit)\n processInit(tabId, port, message);\n else {\n pageData = tabs[tabId][message.pageId];\n\n // getDocData is a bgCore method\n // pageData is defined in bgCore\n // \n docData = pageData.getDocData(message.winId);\n if (message.processDocFragment)\n pageData.processDocFragment(docData, message.mutationEventId, message.content);\n if (message.getResourceContentRequest)\n pageData\n .getResourceContentRequest(message.url, message.requestId, message.winId, message.characterSet, message.mediaTypeParam, docData);\n if (message.docInit)\n docInit(pageData, docData, message.maxIndex);\n if (message.docProgress)\n docProgress(pageData, docData, message.index);\n if (message.docEnd)\n docEnd(pageData, docData, message.content);\n if (message.setFrameContentResponse)\n docData.children[message.index].setFrameContentCallback();\n if (message.getContentResponse) {\n docData.content = message.content;\n docData.getContentCallback();\n }\n if (message.setContentResponse)\n setContentResponse(tabId, message.pageId, docData, message.content);\n }\n }\n }", "title": "" }, { "docid": "0307276720193560e91c16c862ae7d97", "score": "0.61811316", "text": "async showSentMessages(req, res){\n try {\n let page = req.query.page === undefined || req.query.page < 2 ? 1 : parseInt(req.query.page)\n let nr = req.query.nr === undefined || req.query.nr < 1 ? 20 : parseInt(req.query.nr)\n\n res.send( t('dash/sentMessages', {\n User: await getUser(req.session.user_id),\n SentMessages: await SentMessagesModel.findAll({\n where: { user_id: req.session.user_id },\n order: [[\"id\", 'desc']],\n offset: page*nr-nr,\n limit: nr,\n }),\n MessagesCount: await SentMessagesModel.count({\n where: { user_id: req.session.user_id },\n }),\n page, nr,\n }) )\n }catch(e){\n console.log(e)\n redir(res, `${req.session.location_prev}?errors=[\"Server error occurred!\"]`) \n }\n }", "title": "" }, { "docid": "f836c6ebc9de649f881a986ef3780188", "score": "0.609326", "text": "function sendToPage(key, msg, onResponse) {\n const replyKey = nextMsgId(); // get unique key for reply\n if (onResponse instanceof Function) {\n listenOnPage(replyKey, onResponse); // setup async reply channel\n }\n logger.debug(\"sendToPage\", key, msg);\n window.postMessage({\n what: key,\n sender: thisSender,\n msg: msg,\n replyKey: replyKey\n }, window.origin);\n}", "title": "" }, { "docid": "215a10c8592c13743c56e2d6e854a8cd", "score": "0.6065958", "text": "function doSentMessages() {\r\n\tdoMessagesComm();\r\n\treplaceLinkByHref({\r\n\t\t\"inboxMessages.html\":[\"Inbox messages\",\"Вхідні повідомлення\"],\r\n\t\t\"composeMessage.html\":[\"Compose Message\",\"Написати\"]\r\n\t});\r\n}", "title": "" }, { "docid": "bd4fbe04c21546f485f0e6b95eaa4de8", "score": "0.6059263", "text": "function doSentMessages() {\r\n\tdoMessagesComm();\r\n//\r\n\treplaceLinkByHref({\r\n\t\t\"inboxMessages.html\":[\"Inbox messages\",\"eingeganende Nachrichten\"],\r\n\t\t\"composeMessage.html\":[\"Compose Message\",\"Neue Nachricht schreiben\"]\r\n\t});\r\n}", "title": "" }, { "docid": "dab7190b607aa6609a0c4aa60929c6a5", "score": "0.6021344", "text": "function doSentMessages() {\r\n doMessagesComm();\r\n//\r\n replaceLinkByHref({\r\n \"inboxMessages.html\":[\"Messages Reçus\",\"\"],\r\n \"composeMessage.html\":[\"Compose Message\",\"Ecrire un message\"]\r\n });\r\n}", "title": "" }, { "docid": "2fb2ca435ead05a8a7f4a9097b28151c", "score": "0.6016576", "text": "function receivedMessage(event) {\n\n\t//Extract data from request\n\tvar senderID = event.sender.id;\n\tvar recipientID = event.recipient.id;\n\tvar timeOfMessage = event.timestamp;\n\tvar message = event.message;\n\n\tif (!sessionIds.has(senderID)) {\n\t\tsessionIds.set(senderID, uuid.v1());\n\t}\n\t//console.log(\"Received message for user %d and page %d at %d with message:\", senderID, recipientID, timeOfMessage);\n\t//console.log(JSON.stringify(message));\n\n\tvar isEcho = message.is_echo; //Messgae sent by page itself\n\tvar messageId = message.mid;\n\tvar appId = message.app_id;\n\tvar metadata = message.metadata;\n\n\t// You may get a text or attachment but not both\n\tvar messageText = message.text;\n\tvar messageAttachments = message.attachments;\n\tvar quickReply = message.quick_reply;\n\n\tif (isEcho) {\n\t\thandleEcho(messageId, appId, metadata);\n\t\treturn;\n\t} else if (quickReply) { //In case of quick reply\n\t\thandleQuickReply(senderID, quickReply, messageId);\n\t\treturn;\n\t}\n\n\t//If text message is received\n\tif (messageText) {\n\t\t//send message to api.ai\n\t\tsendToDialogFlow(senderID, messageText);\n\t}\n}", "title": "" }, { "docid": "74e29d84362133cdb0d1295ea2fcfb88", "score": "0.59514534", "text": "incoming(req, res, cb) {\n res.sendStatus(200);\n if (req.body.object === 'page' && req.body.entry) {\n let data = req.body;\n for (const entry of data.entry) {\n if (entry.messaging){\n for (const msg of entry.messaging){\n console.log(msg.message);\n if (msg.message)\n cb(this.messageHandler(msg));\n else if (msg.postback)\n cb(this.postbackHandler(msg));\n }\n }\n }\n }\n }", "title": "" }, { "docid": "10eaff2b717606c88cfbd4886c933d5a", "score": "0.5890845", "text": "function requestConversationPages(cb) {\n var url = baseUrl + mailbox + '/conversations.json?&status=active'\n\n getData('GET', url, function(res) { conversationPages(res, cb) })\n}", "title": "" }, { "docid": "c720710ccd2a8523ba2a61bd6f960549", "score": "0.58762246", "text": "function getMessage(request, response){\n response.render('Message', {title: 'Messages', msgName: request.params.msgName, isAvailable: true});\n}", "title": "" }, { "docid": "e27dec1e915e52562d9414c623c502a7", "score": "0.5869579", "text": "function showMessages() {\n\t// Create a paragraph (line) for each message\n\tmessages.forEach((m, index) => {\n\t\tif(index > last_msg_show_id) {\n\t\t\taddMessage(m);\n\t\t\tlast_msg_show_id++;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f4eda7b4804e5fca972eed6463762fed", "score": "0.58372545", "text": "function getMessages() { \n $.get('http://localhost:3000/messages', (data) => {\n //This populeate the DOM with the message history in a for each loop. \n data.forEach(addMessage);\n });\n }", "title": "" }, { "docid": "f51639806abfc7f768e66adce6282e28", "score": "0.57920516", "text": "function addMessageToPage (content) {\n // create a new div element\n // and give it some content\n var newDiv = document.createElement('div');\n newDiv.innerHTML = content;\n\n // add the newly created element and its content into the DOM\n document.body.appendChild(newDiv);\n}", "title": "" }, { "docid": "1b106ab95dc7e2aba3b0a5cceaaa260e", "score": "0.57749516", "text": "function getMessages() {\n screenId = getUrlParameter('screen');\n // perform ajax request to get the data\n $.get( \"/api/screen=\" + screenId, function( data ) {\n\n // if a some message gotten\n if (data && data.length > 0) {\n // loop through the messages to display\n displayMessages(data, 0);\n }\n });\n}", "title": "" }, { "docid": "b4aa36ccee7afa02e67164343d262721", "score": "0.57686394", "text": "function print_new_messages(messages) {\n var str, len = messages.length;\n for (var i = num_new_messages; i > 0; i--) {\n var m = messages[len - i];\n str += m.line-1 + \": \" + m.text + \"\\n\";\n }\n results.session.setValue(str);\n num_new_messages = 0;\n}", "title": "" }, { "docid": "92bc84849b1188cae1091dc246f0de29", "score": "0.5748454", "text": "function listen() {\n // Message created\n Models.about.socket().on('create', function (about) {\n view.page = about;\n });\n\n // Message updated\n Models.about.socket().on('update', function (about) {\n view.page = about;\n });\n }", "title": "" }, { "docid": "c54b6e21319fed95f90b1e23ba6c8d1f", "score": "0.5742035", "text": "async showSentMessages (req, res, next) {\n try {\n let page = req.query.page === undefined || req.query.page < 2 ? 1 : parseInt(req.query.page)\n let nr = req.query.nr === undefined || req.query.nr < 1 ? 20 : parseInt(req.query.nr)\n\n const {user, sender, receipt,text} = req.query\n let where = {}\n\n // If a lookup has been performed\n if(user !== undefined || \n sender !== undefined || \n receipt !== undefined ||\n text !== undefined)\n {\n where = [\n { sender: { [Op.like]: `%${sender}%` } },\n { receipt: { [Op.like]: `%${receipt}%` } },\n { text: { [Op.like]: `%${text}%` } },\n ]\n\n if(user !== undefined && user !== '') {\n where.push({ \"$user.username$\": { [Op.like]: `%${user}%` } },)\n }\n }\n\n res.send(\n t('dash/admin/sentMessages', {\n SentMessages: await SentMessagesModel.findAll({\n where,\n order:[ ['id', 'DESC'] ],\n limit: nr,\n offset: page*nr-nr,\n include:[\n {model:UsersModel, as: \"user\"}\n ]\n }),\n MessagesCount: await SentMessagesModel.count({\n where,\n order:[ ['id', 'DESC'] ],\n limit: nr,\n offset: page*nr-nr,\n include:[\n {model:UsersModel, as: \"user\"}\n ]\n }),\n page, nr, user, sender, receipt,text,\n prev_loc:req.session.location_prev, \n\n User: {id: req.session.user_id},\n })\n )\n }catch(e){\n console.log(e)\n redir(res, '/dash?errors=[\"Server error occurred.\"]')\n }\n }", "title": "" }, { "docid": "4920a8352422e2d6070d6d2949983f7f", "score": "0.5716326", "text": "page() {\n\t\t\tthis.fetch();\n\t\t}", "title": "" }, { "docid": "48f40bde1ea905429bfd1d3c83368c04", "score": "0.5673061", "text": "async actionIndex() {\n const self = this;\n\n let messages = [];\n let error = null;\n\n\n //retrieving params\n let fromId = self.param('fromId') || null;\n let total = 0;\n let paging = self.paging();\n\n //set a where clause for database request\n try {\n let where = {};\n\n if (fromId !== null) {\n where = {\n //we either sent or received the message\n [Op.or]: [{\n fromId: fromId,\n toId: self.req.user.id\n }, {\n toId: fromId,\n fromId: self.req.user.id\n },]\n };\n } else {\n //global chat: toId is null\n where = {\n toId: {\n [Op.is]: null,\n }\n };\n }\n //get all messages with the where clause from the database\n const { count, rows } = await self.db.Message.findAndCountAll({\n where: where,\n order: [\n ['id', 'DESC'],\n\n ],\n limit: paging.limit,\n offset: paging.offset,\n attributes: ['id', 'text', 'createdAt', 'updatedAt'],\n include: self.db.Message.extendInclude\n });\n\n total = count;\n messages = rows;\n\n //throw a 404 Error if no messages were returned from the database\n if (!messages) {\n throw new ApiError('No messages found', 404);\n }\n } catch (err) {\n error = err;\n console.log(err);\n }\n\n //handle error or return all found messages\n if (error) {\n self.handleError(error);\n } else {\n self.render({\n messages: messages,\n _meta: self.meta(paging, total)\n });\n }\n }", "title": "" }, { "docid": "80002534a983cb912d45bfa2c5b2d3c5", "score": "0.565269", "text": "function printConversation(errorMsg)\r\n{\r\n\tif ( isNav )\r\n\t{\r\n\t\talert(errorMsg);\r\n\t\treturn;\r\n\t}\r\n\t\t\r\n\tvar txt = parent.frm_messages.document.body.innerHTML; \r\n\r\n\tparent.frm_messages.document.close();\r\n\tparent.frm_messages.focus();\r\n\tparent.frm_messages.print();\r\n parent.frm_messages.document.write(\"<html><head><META HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=windows-1255'><style type='text/css'> body{ border:2px inset #FFFFFF; padding:2px; margin:2px;}</style></head><body dir='\" + textDirection + \"'>\");\r\n\tparent.frm_messages.document.write(txt);\r\n\tscrollDown();\r\n}", "title": "" }, { "docid": "6e41d0c38967c8f855a56395e61d0ad3", "score": "0.5644233", "text": "viewinbox(req, res) {\n const messages = MessageModel.inbox(req.params.to);\n return res.status(200).send(messages);\n }", "title": "" }, { "docid": "b0dc64b6612036f3872875dff43e412e", "score": "0.5627867", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n var payload = event.postback.payload;\n\n switch (payload) {\n case 'GET_STARTED':\n greetUserText(senderID);\n break;\n default:\n //unindentified payload\n sendTextMessage(senderID, \"I'm not sure what you want. Can you be more specific?\");\n break;\n\n }\n\n console.log(\"Received postback for user %d and page %d with payload '%s' \" +\n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n}", "title": "" }, { "docid": "c81b21198db0825c65f6405ef90a9e18", "score": "0.5602543", "text": "function popup_receiver(request, sender, sendResponse) {\n console.log(\"[INFO - popup receiver] Message received: \" + request.content);\n if (request.content == \"paragraphs\") {\n extractText(request.url);\n }\n}", "title": "" }, { "docid": "c5548d986d5c084bcf34574a08159d24", "score": "0.5600352", "text": "function getReceivedMessages(req,res){\n var userId=req.user.sub;\n var page=1;\n\n if(req.params.page){\n\n page=req.params.page;\n }\n\n var itemsPerPage=4;\n\n Message.find({receiver:userId}).sort('-created_at').populate('emitter','name surname image nick _id').paginate(page,itemsPerPage,(err,messages,total)=>{\n if(err) return res.status(500).send({message:'Error en la peticion'});\n if(!messages) return res.status(404).send({message:'No hay mensajes'});\n\n return res.status(200).send({\n total:total,\n pages:Math.ceil(total/itemsPerPage),\n messages\n });\n\n });\n}", "title": "" }, { "docid": "a7c3d46fc14d4c45b51fab15448b4310", "score": "0.55880994", "text": "process () {\n const x = this.quick_reply || this.postback;\n const senderRecipient = { userId: this.sender, pageId: this.recipient };\n if (x) {\n return postbackHandler(x.payload, senderRecipient, this.timestamp)\n .then(resp => this.reply(resp));\n }\n else if (this.text) {\n return db.getTimezone(this.recipient)\n .then(data => runActions(this.sender, this.recipient, this.text, this.timestamp, data.timezone))\n .then(resp => this.reply(resp))\n .catch(err => this.reply(err));\n }\n }", "title": "" }, { "docid": "4f91aaf02d0b27a4c50283e2b5e67934", "score": "0.5587791", "text": "function processMessages() {\r\n while(msgManager.hasNext()) {\r\n msgManager.processNext()\r\n while(msgManager.hasNextUIMsg()) {\r\n this.postMessage(msgManager.nextUIMsg())\r\n }\r\n }\r\n}", "title": "" }, { "docid": "49d12039c631dab65bb242b8468f8d4d", "score": "0.5586223", "text": "inbox (page = 1) {\n if (!this.token) {\n throw new Error('This requires a call to enroll()')\n }\n return this.get(`/unit/inbox?p=${page}`)\n }", "title": "" }, { "docid": "be16b0d5edef1255aa6a7b686a2e0304", "score": "0.55831444", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback \n // button for Structured Messages. \n var payload = event.postback.payload;\n\n console.log(\"Received postback for user %d and page %d with payload '%s' \" + \n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n // When a postback is called, we'll send a message back to the sender to \n // let them know it was successful\n switch (payload) {\n case \"GET_STARTED\":\n userDb.insertUser(senderID);\n showMenu(senderID, MESSAGE_GUIDE_MENU);\n break;\n\n case \"LATEST_NEWS_EVENT\":\n sendLatestPost(senderID);\n break;\n\n case \"REPORT\":\n showReportCategory(senderID);\n break;\n \n case \"POST_NEWS_EVENT\":\n showPostNewsEventCategory(senderID);\n break;\n\n case reportDb.REPORT_TYPE_SEX:\n case reportDb.REPORT_TYPE_DOMESTIC:\n case reportDb.REPORT_TYPE_OTHERS:\n\n case reportDb.REPORT_TYPE_EVENT:\n case reportDb.REPORT_TYPE_NEWS:\n createNewReport(senderID, payload);\n break;\n\n case \"BROADCAST\":\n broadcastToAllUser();\n showMenu(senderID, \"Your post is being broadcasted.\");\n break;\n\n case \"POST_REPORTS_NEWS_EVENTS\":\n postDb.insertPost(senderID);\n sendTextMessage(senderID, \"OK. You will need to first provide the title of the post.\");\n break;\n\n default:\n sendTextMessage(senderID, \"Postback called\");\n break;\n }\n}", "title": "" }, { "docid": "2cdb7c3bd208d77e02f8e40b5deeb329", "score": "0.55511653", "text": "function get_messages() {\r\n fetch(`${get_url('messaging')}?action=get_messages&conversation=${conversation}`)\r\n .then(response => response.json())\r\n .then(result => {\r\n subject = result.subject;\r\n recipients = result.recipients;\r\n messages = result.messages;\r\n\r\n document.getElementById('subject-box').innerHTML = subject;\r\n document.getElementById('recipient-box').innerHTML = '';\r\n recipients.forEach((recipient) => {\r\n var user = create_element('a', {'innerHTML': recipient.username});\r\n if (recipient.id) {\r\n user.href = get_url('user', recipient.id);\r\n document.getElementById('recipient-box').append(user);\r\n document.getElementById('recipient-box').append(', ');\r\n } else {\r\n document.getElementById('recipient-box').append(user);\r\n }\r\n });\r\n const message_box = document.getElementById('message-box');\r\n message_box.innerHTML = '';\r\n\r\n document.querySelector('button.leave').onclick = function() {\r\n response = confirm('Are you sure you want to leave this conversation?');\r\n if (!response) {\r\n return;\r\n }\r\n fetch(`${get_url('messaging')}?action=leave&conversation=${conversation}`)\r\n .then(response => {\r\n reload_pages();\r\n })\r\n .catch(e => console.error(e))\r\n };\r\n\r\n messages.forEach((message) => {\r\n const message_element = create_element('a', {'className': 'list-group-item'});\r\n if (message.sender.id != user_id && message.sender.id) {\r\n message_element.append(create_element('strong', {'innerHTML': `${message.sender.username}: `}));\r\n message_element.classList.add('.my-message');\r\n }\r\n message_element.append(create_element('div', {'innerHTML': message.body}));\r\n message_element.append(create_element('small', {'innerHTML': message.datetime}));\r\n\r\n message_box.append(message_element);\r\n });\r\n\r\n message_box.scrollBy(0, message_box.scrollHeight - message_box.offsetHeight)\r\n });\r\n}", "title": "" }, { "docid": "7acf000134785e9be77f34449a8a3755", "score": "0.5546122", "text": "function success_update (resp) {\r\n\t\r\n\tvar response = resp.responseText;\r\n\tvar current_message = response.evalJSON();\r\n\r\n\t// Checks if the message is duplicated\r\n\tfor (var i = 0; i < all_messages.length; i++){\r\n\t\tif (all_messages[i].id === current_message.id){\r\n\t\t\tnotification.info(translator.getLabel('duplicated_message_error'));\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\tclear_message();\r\n\r\n\tposted_msg.set(replace_html_entities( aux_posted_msg ));\r\n\taux_posted_msg = '';\r\n\t\r\n\tcurrent_page = 1;\r\n\t\r\n\tfor (var j = all_messages.length; j != 0 ; j--){\r\n\t\tall_messages[j] = all_messages[j-1];\r\n\t}\r\n\t\r\n\tall_messages[0] = current_message;\r\n\t\r\n\tvar msgs_cont = document.getElementById('message_container'); \r\n\tif (msgs_cont){\r\n\t\tmsgs_cont.innerHTML = '';\r\n\t\tprint_messages(msgs_cont);\t\r\n\t}\r\n}", "title": "" }, { "docid": "074a28d002391886a6022e74653136e2", "score": "0.55405295", "text": "async getRecivedMessages(context) {\n let res = await getAll(\n \"messages/recived/page/\" + context.rootState.loggedUser.id\n );\n\n return res;\n }", "title": "" }, { "docid": "9c326e7ad4964223fb3a199bd8fde7f8", "score": "0.5535558", "text": "function handleServerMessages(data){\n if(data.redirect){\n window.location.replace(data.redirect);\n }else if(data.message){\n console.log(\"displaying server message\");\n $(\"#serverMessage\").html(data.message);\n }else if (data.error){\n console.log(\"displaying server error\");\n $(\"#serverMessage\").html(data.error);\n }\n}", "title": "" }, { "docid": "d224bc280743688b98a28a3635062c4d", "score": "0.55314946", "text": "fetchMoreMessages() {\n this.props.fetchHistory();\n }", "title": "" }, { "docid": "38f42e8090d3f5b1687739f3b9a9a482", "score": "0.5529513", "text": "function setMessages() {\n\tif (msgReq.readyState === 4 && msgReq.status === 200) {\n\n\t\tvar m_old = parseInt(document.getElementById(\"n-messages\").innerHTML);\n\n\t\tobj = JSON.parse(msgReq.responseText);\n\n\t\tif (obj.newmgs === \"overload\")\n\t\t\tself.location.reload();\n\n\t\telse if (obj.newmsg) {\n\n\t\t\tdocument.getElementById(\"n-messages\").innerHTML = parseInt(document.getElementById(\"n-messages\").innerHTML) + obj.newmsg;\n\n\t\t\tvar msgList = document.getElementById(\"messages\");\n\t\t\tvar canScroll = (msgList.scrollHeight - msgList.scrollTop) <= 320;\n\t\t\tvar scrolled = msgList.scrollTop;\n\n\t\t\tmsgList.innerHTML += obj.content;\n\n\t\t\tmsgList.scrollTop = scrolled;\n\n\t\t\tif (canScroll)\n\t\t\t\tmsgList.scrollTop = msgList.scrollHeight;\n\n\t\t\tvar m_new = parseInt(document.getElementById(\"n-messages\").innerHTML);\n\n\t\t\tif (m_new > m_old) {\n\t\t\t\tplayAudio(\"new-msg\");\n\t\t\t\tif (canScroll === 0)\n\t\t\t\t\tdocument.getElementById(\"skip\").style.display = \"block\";\n\t\t\t\tparent.postMessage(\"NewMsg:\"+(m_new - m_old), \"*\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "24714d9813e674cc4c47b293e204faf0", "score": "0.5517491", "text": "function getEmmitMessages(req, res) {\r\n var userId = req.user.sub;\r\n\r\n var page = 1;\r\n\r\n //SI LLEGA EL PARAMETRO POR LA URL\r\n if (req.params.page) {\r\n page = req.params.page;\r\n }\r\n //MENSAGES POR PÁGINA\r\n var itemsPerPage = 4;\r\n\r\n Message.find({ emitter: userId }).populate('emitter receiver', 'name surname image nick _id').paginate(page, itemsPerPage, (err, messages, total) => {\r\n if (err) {\r\n return res.status(500).send({ message: 'Error en la petición' })\r\n }\r\n if (!messages) {\r\n return res.status(404).send({ message: 'No hay mensajes' })\r\n } else {\r\n return res.status(200).send({\r\n total: total,\r\n pages: Math.ceil(total / itemsPerPage),\r\n messages\r\n });\r\n }\r\n });\r\n}", "title": "" }, { "docid": "e9e9a6fc76922c9d4e685817241ad1ae", "score": "0.55060494", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n var payload = event.postback.payload;\n\n console.log(\"Received postback for user %d and page %d with payload '%s' \" +\n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n // test payload for test button\n if (payload) {\n\n\t switch (payload) {\n\t case 'testing_postback_button_was_clicked':\n\t\tsendTextMessage(senderID, \"testing sucessful\");\n\t\tbreak;\n\n\t case 'GET_STARTED_PAYLOAD':\n\t\tsendGetStartedQuickReply(senderID);\n\t\tbreak;\n\n\t default:\n sendTextMessage(senderID, \"Postback called\");\n\t}\n\t\t}\n\n // When a postback is called, we'll send a message back to the sender to\n // let them know it was successful\n\n}", "title": "" }, { "docid": "aaa12fc993341de031d1b5f7ebd65ec0", "score": "0.55002594", "text": "function content_receiver(request, sender, sendResponse) {\n console.log(\n \"[content_receiver] Message received: \" + JSON.stringify(request)\n );\n if (request.content === \"clicked\") sendParagraphs();\n}", "title": "" }, { "docid": "c73ab6c31acaee34bbc25e5e6d83ef7f", "score": "0.5497371", "text": "function lookAtPage(socket, page)\n{\n if (socket.room) {\n socket.leave(socket.room);\n broadcastRoomCount(socket.room)\n }\n\n socket.room = generateRoomName(page.module, page.action, page.id);\n socket.join(socket.room);\n broadcastRoomCount(socket.room)\n}", "title": "" }, { "docid": "0031430617c92cef7905c66c37afcc21", "score": "0.5496077", "text": "function getMessages() {\n $.get(\"/api/messages\", function (data) {\n console.log(\"Data: \", data);\n messages = data;\n if (!messages || !messages.length) {\n displayEmpty();\n } else {\n for (var i = 0; i < messages.length; i++) {\n var final_message = $(\"<p />\").text(messages[i].message);\n $(\"#history\").append(final_message);\n }\n\n }\n });\n}", "title": "" }, { "docid": "2ea1c3891ac25066548cc488419c1874", "score": "0.54940534", "text": "onPageMessageReceivedFromServiceWorker(event) {\n const data = event.data;\n /* If this message doesn't contain our expected fields, discard the message */\n if (!data || !data.command) {\n return;\n }\n const listenerRecords = this.replies.findListenersForMessage(data.command);\n const listenersToRemove = [];\n const listenersToCall = [];\n Log.debug(`[Worker Messenger] Page received message:`, event.data);\n for (let listenerRecord of listenerRecords) {\n if (listenerRecord.onceListenerOnly) {\n listenersToRemove.push(listenerRecord);\n }\n listenersToCall.push(listenerRecord);\n }\n for (let i = listenersToRemove.length - 1; i >= 0; i--) {\n const listenerRecord = listenersToRemove[i];\n this.replies.deleteListenerRecord(data.command, listenerRecord);\n }\n for (let listenerRecord of listenersToCall) {\n listenerRecord.callback.apply(null, [data.payload]);\n }\n }", "title": "" }, { "docid": "228a0c9563373dc723d42b66db1383eb", "score": "0.54887944", "text": "function readIncoming(inMessage) \n{\n\t// Make sure it's the right channel\n\tif(inMessage.channel == adminChannelName)\n\t{\n\t\t// Closing the initial Page & going to vote page\n\t\tif ( inMessage.message.theMessage == 1 )\n\t\t{\n\t\t\tinitialPage.hide();\n\t\t\tlogo.hide();\n\t\t\ttimerVisible = true;\n\t\t\ttrueButton.show();\n\t\t\ttrueText.show();\n\t\t\tfalseButton.show();\n\t\t\tfalseText.show();\n\t\t}\n\t\t// Voting pages\n\t\telse if ( inMessage.message.theMessage == 3 || inMessage.message.theMessage == 5 || inMessage.message.theMessage == 7 || inMessage.message.theMessage == 9 || inMessage.message.theMessage == 11)\n\t\t{\n\t\t\ttimerPosition = 0;\n\t\t\tthanksPage.hide();\t\t\t\n\t\t\ttimerVisible = true;\n\t\t\ttimer = 30;\n\t\t\ttrueButton.show();\n\t\t\ttrueText.show();\n\t\t\tfalseButton.show();\n\t\t\tfalseText.show();\n\t\t}\n\t\t// Thank you pages\n\t\telse if ( inMessage.message.theMessage == 2 || inMessage.message.theMessage == 4 || inMessage.message.theMessage == 6 || inMessage.message.theMessage == 8 || inMessage.message.theMessage == 10 || inMessage.message.theMessage == 12 )\n\t\t{\n\t\t\ttimerPosition = 1;\n\t\t\ttrueButton.hide();\n\t\t\ttrueText.hide();\n\t\t\tfalseButton.hide();\n\t\t\tfalseText.hide();\n\t\t\tbackground(0);\n\t\t\tthanksPage.show();\n\t\t\tthanksPage.size( windowWidth * (1/2) , windowWidth * (1/2) * (1.68));\n\t\t\tthanksPage.position((windowWidth/2) - (thanksPage.width/2), (windowHeight/2) - (thanksPage.height/2));\t\t\t\t\n\t\t}\n\t\t// Final page\n\t\telse if ( inMessage.message.theMessage == 13 )\n\t\t{\n\t\t\ttrueButton.hide();\n\t\t\ttrueText.hide();\n\t\t\tfalseButton.hide();\n\t\t\tfalseText.hide();\n\t\t\ttimerVisible = false;\n\t\t\ttimer = 30;\n\t\t\tbackground(0);\n\t\t\tthanksPage.show();\n\t\t\tthanksPage.size( windowWidth * (1/2) , windowWidth * (1/2) * (1.68));\n\t\t\tthanksPage.position((windowWidth/2) - (thanksPage.width/2), (windowHeight/2) - (thanksPage.height/2));\t\n\t\t}\n\t\t\t\n\t}\n}", "title": "" }, { "docid": "db0155e7a391bfebc0206cbebc84baff", "score": "0.548384", "text": "function gotMessage(request, sender, sendResponse){\n // request includes the actual message\n console.log(request);\n\n // use our replacement function to replace words as instructed by the popup page\n repl(request.find, request.replace)\n\n // sender lets us know who the message is fro (ie from our popup page)\n // sendResponse is a function and allows us to reply to the sender (our popup page)\n // sendResponse({message: \"successfully replaced words!\"});\n\n}", "title": "" }, { "docid": "f63e992bf55a95c57d3716108f188f29", "score": "0.54801655", "text": "async getSentMessages(state) {\n let res = await getAll(\n \"messages/sent/page/\" + context.rootState.loggedUser.id\n );\n\n return res;\n }", "title": "" }, { "docid": "bc2e4bb67d7c005c57974cd9105da6a1", "score": "0.54725224", "text": "function relayMsgToPage(key, transformerFunc) {\n listenOnRuntime(key, function (msg, sendResponse) {\n if (transformerFunc instanceof Function) {\n let newMsg = transformerFunc(msg);\n if (newMsg != null) {\n msg = newMsg;\n }\n }\n logger.debug(\"relayMsgToPage\", key, msg);\n sendToPage(key, msg, sendResponse);\n return true; // always enable async response\n });\n}", "title": "" }, { "docid": "c8883b99803771fd38fdf9c1824552a9", "score": "0.547006", "text": "function getMessages() {\n\t$.get('http://localhost:3000/messages', (data) => {\n\t\tdata.forEach(addMessage);\n\t});\n}", "title": "" }, { "docid": "4678fa037a5afa0b658af6a83942c297", "score": "0.54632705", "text": "viewsent(req, res) {\n const messages = MessageModel.sent(req.params.from);\n return res.status(200).send(messages);\n }", "title": "" }, { "docid": "7a5a17ad058a21c4fb152bd56d14d32e", "score": "0.5459516", "text": "function lokiCreatePremadeMessages(){\n var admin1 = post_history.insert({ postid: \"adminno0\", poster_name: \"admin\", post_text: \"Welcome to Inspire. Feel free to share your toughts!\" });\n var admin2 = post_history.insert({ postid: \"adminno1\", poster_name: \"admin\", post_text: \"These are premade posts so don't worry about responding to these.\" });\n //Renders messages.\n movetofeed(admin2.post_text, admin2.poster_name, 0);\n movetofeed(admin1.post_text, admin1.poster_name, 1);\n}", "title": "" }, { "docid": "1f38449354deac626ae5fbca38b835c0", "score": "0.545061", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n var payload = event.postback.payload;\n\n console.log(\"Received postback for user %d and page %d with payload '%s' \" +\n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n switch (payload) {\n case 'get_started':\n sendGetStarted(senderID);\n break;\n case 'check_in':\n sendTextMessage(senderID, \"Check In\");\n break;\n case 'room_service':\n sendTextMessage(senderID, \"Room Service\");\n break;\n case 'yes':\n sendTextMessage(senderID, \"You choose yes\");\n break;\n case 'no':\n sendTextMessage(senderID, \"You choose no\");\n break;\n default:\n sendTextMessage(senderID, \"Postback called Default\");\n }\n}", "title": "" }, { "docid": "f40abfc040f4fe924dffa9e7c0e50d4a", "score": "0.54492277", "text": "function receivedPostback(event) {\n const senderID = event.sender.id;\n const recipientID = event.recipient.id;\n const timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n const payload = event.postback.payload;\n\n console.log(\n \"Received postback for user %d and page %d with payload '%s' \" + 'at %d',\n senderID,\n recipientID,\n payload,\n timeOfPostback\n );\n\n // When a postback is called, we'll send a message back to the sender to\n // let them know it was successful\n sendTextMessage(senderID, 'Postback called');\n}", "title": "" }, { "docid": "dd1a2e0831c17261570bd9babb4bef1c", "score": "0.54379797", "text": "function reload_pages() {\r\n conversation = 'unset';\r\n get_conversations();\r\n}", "title": "" }, { "docid": "7a6b6aa580c70ae3fcb484338d9cff35", "score": "0.54214925", "text": "function _newsound_page() {\n}", "title": "" }, { "docid": "0ec1e976bcb89bad444075ce4aa4fb9b", "score": "0.5418511", "text": "function onMessageArrived(message) {\n const topic = message.destinationName;\n const payload = message.payloadString;\n\n // Split payload string into an array\n const msgArr = payload.split(msgDelimiter);\n\n // Add to the page by adding to start ofthe page element \n messageList.innerHTML = `<li class=\"list-group-item\">\n <b>Date:</b> ${msgArr[1]}\n <b>From:</b> ${msgArr[0]}\n <b>Subject:</b> ${msgArr[2]}\n <b>Message:</b> ${msgArr[3]}\n </li>\n ${messageList.innerHTML}`;\n}", "title": "" }, { "docid": "94f15d126421f20a33c270379eff95e0", "score": "0.5415827", "text": "function LoopMessageShow(latestPage)\n{\n\tconsole.log(\"latestPage.length\",latestPage.length);\n\tif(msgI <latestPage.items.length)\n\t{\n\t\t\tif(latestPage.items[msgI].attributes.StaffuserName == localStorage.getItem(\"guestuser\"))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t\tif (latestPage.items[msgI].type == 'media')\n\t\t\t\t\t{\n\t\t\t\t\t\t latestPage.items[msgI].media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t if(latestPage.items[msgI].state.media.state.contentType ==\"image/jpeg\" || latestPage.items[msgI].state.media.state.contentType ==\"image/png\")\n \t\t\t\t\t {\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\" id=\"message_'+latestPage.items[msgI].index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+latestPage.items[msgI].index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><img src=\"'+url+'\" height=\"100px\" width=\"100px\"/></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// $(\"#chatmessage\").append(\"<li id='message_\"+latestPage.items[msgI].index+\"' class='classleft'><img src='\"+url+\"' /><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+latestPage.items[msgI].index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+latestPage.items[msgI].index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><a src=\"'+url+'\"/></a></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t// $(\"#chatmessage\").append(\"<li id='message_\"+latestPage.items[msgI].index+\"' class='classleft'><a href='\"+url+\"' >file</a><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t\tif(latestPage.items[msgI].attributes.note == \"note\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t//$(\"#chatmessage\").prepend(\"<li id='message_\"+latestPage.items[msgI].index+\"' class='classleft note'> \"+latestPage.items[msgI].body+\"<img src='note.png'/><div id='\"+latestPage.items[msgI].index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+latestPage.items[msgI].index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+latestPage.items[msgI].index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+latestPage.items[msgI].index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+latestPage.items[msgI].index+'\">'+latestPage.items[msgI].body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t//$(\"#chatmessage\").prepend(\"<li id='message_\"+latestPage.items[msgI].index+\"' class='classleft'>\"+latestPage.items[msgI].body+\"<div id='\"+latestPage.items[msgI].index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (latestPage.items[msgI].type == 'media')\n\t\t\t\t\t{\n\t\t\t\t\t\t latestPage.items[msgI].media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t if(latestPage.items[msgI].state.media.state.contentType ==\"image/jpeg\" || latestPage.items[msgI].state.media.state.contentType ==\"image/png\")\n \t\t\t\t\t {\n\t\t\t\t\t\t\t\t// $(\"#chatmessage\").append(\"<li class='classright'><img src='\"+url+\"' /> </li>\");\n\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"'+url+'\" height=\"100px\" width=\"100px\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t+'<a href=\"'+url+'\" >file</a>' \n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t// $(\"#chatmessage\").append(\"<li class='classright'><a href='\"+url+\"' >file</a> </li>\");\n\t\t\t\t\t\t\t\t msgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'+latestPage.items[msgI].body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'>\"+latestPage.items[msgI].body+\"</li>\");\n\t\t\t\t\t\t\tmsgI++;\n\t\t\t\t\t\t\t\t LoopMessageShow(latestPage);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\n\t}\n\telse\n\t{\n\t\t$(\".loader\").hide();\n\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t}\n\t\n}", "title": "" }, { "docid": "3f6ebe512270fb0970172c8450f558fb", "score": "0.5415585", "text": "static watchMessages() {\n\t\tif( __messageWatching )\n\t\t\treturn;\n\t\t__messageWatching = true;\n\n\t\tchrome.runtime.onMessage.addListener(\n\t\t\tfunction(request, sender, sendResponse){\n\t\t\t\tvar rsp;\n\t\t\t\tif( request && request.noryal_message) {\n\t\t\t\t\tlet message = request.noryal_message;\n\t\t\t\t\tlet data = request.noryal_data;\n\t\t\t\t\tlet callback = undefined;\n\t\t\t\t\tif( data.tabMessageData ) {\n\t\t\t\t\t\tdata = data.tabMessageData;\n\t\t\t\t\t\tcallback = __tabMessageCallbacks[message];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcallback = __messageCallbacks[message];\n\t\t\t\t\t}\n\n\t\t\t\t\trsp = ScCallback(callback, this||{}, data, sender);\n\t\t\t\t}\n\t\t\t\trsp = rsp || {};\n\t\t\t\tsendResponse(rsp);\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "229528b3a289d64cc60c37de5096edf0", "score": "0.5414626", "text": "pageHelper() {\n var tmp = this.nextPage();\n this.page(tmp);\n }", "title": "" }, { "docid": "ef299fc1da5071dd2d8860259484da55", "score": "0.54141784", "text": "function printMessageItem()\n{\n}", "title": "" }, { "docid": "4c92b06c87da7e8d2829fa0815ccb8b1", "score": "0.5410963", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived: \" + message.payloadString);\n document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + ' | ' + message.payloadString + '</span><br/>';\n updateScroll(); \n}", "title": "" }, { "docid": "f6a841fd54401c2e8b2b0cf9a094bb33", "score": "0.54089177", "text": "function messageHandler(event) {\r\n\t\tvar request = event.data;\r\n\t\tif (document.URL !== request.url) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tconsole.log(\"Msg Received: \" + request.name + \" \" + request.op);\r\n\t\tif (!request.name || !request.op || (request.name !== \"preview\")) {\r\n\t\t\treturn;\r\n\t\t\t// Not an appropriate message.\r\n\t\t}\r\n\t\tswitch (request.op) {\r\n\t\t\tcase \"clear\":\r\n\t\t\t\tclear();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"article\":\r\n\t\t\t\tif (wiz_pageInfo.getSelection()) {\r\n\t\t\t\t\t// console.log(\"preview selection active\");\r\n\t\t\t\t\tpreviewSelection();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//if (request.args && request.args.showHelp) {\r\n\t\t\t\t\tpreviewArticle(false);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"fullPage\":\r\n\t\t\t\tpreviewFullPage();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"selection\":\r\n\t\t\t\tpreviewSelection();\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"url\":\r\n\t\t\t\tif (request.args) {\r\n\t\t\t\t\tpreviewUrl(request.args.title, request.args.url, request.args.favIconUrl);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreviewUrl();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"keydown\" :\r\n\t\t\t\tnudgePreview(request.opCmd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"submit\" :\r\n\t\t\t\tnoteSubmitByType(request.type, request.info);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"getInfo\":\r\n\t\t\t\twiz_pageInfo.getInfoRequestHandler();\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Received invalid Preview message with 'op=\" + request.op + \"'.\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ad024e76eb73d28b9da77cd493440489", "score": "0.540875", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n var payload = event.postback.payload;\n console.log(\"Received postback for user %d and page %d with payload '%s' \" +\n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n // When a postback is called, we'll send a message back to the sender to\n // let them know it was successful\n sendTextMessage(senderID, \"Postback called\");\n\n\n}", "title": "" }, { "docid": "f80eccebab5e9e26525a16748beb5813", "score": "0.54082996", "text": "function pageMessageListener(event) {\n if (!(event.source == window &&\n event.data.direction &&\n event.data.direction == \"from-page-script@adguard\" &&\n event.data.elementUrl &&\n event.data.documentUrl)) {\n return;\n }\n\n var message = {\n type: 'checkWebSocketRequest',\n elementUrl: event.data.elementUrl,\n documentUrl: event.data.documentUrl,\n requestType: \"OTHER\",\n requestId: event.data.requestId\n };\n\n contentPage.sendMessage(message, function (response) {\n if (!response) {\n return;\n }\n \n var message = {\n direction: 'to-page-script@adguard',\n elementUrl: event.data.elementUrl,\n documentUrl: event.data.documentUrl,\n requestId: response.requestId,\n block: response.block\n };\n \n event.source.postMessage(message, event.origin);\n });\n }", "title": "" }, { "docid": "3e5c0cb98a1d0d41359a859e728095ec", "score": "0.54057103", "text": "async insertPages(embedMsg, embedObj, pages, userId, discardValue, message) {\n try {\n const self = embedMsg;\n const emotes = ['◀️', '▶️'];\n if (discardValue && typeof(discardValue) === 'number') emotes.push('♻️');\n for (const emote of emotes) await self.react(emote);\n const filter = (reaction, user) => {\n return emotes.includes(reaction.emoji.name) && user.id === userId;\n };\n const collector = self.createReactionCollector(filter, { idle: 60000, dispose: true });\n var i = 0,\n total = 0;\n\n embedObj.footer = { text: `Page ${i + 1} / ${pages.length}` };\n self.edit(embedObj);\n\n const execute = async (reaction, user) => {\n console.log(`Received ${reaction.emoji.name} from ${user.tag}`);\n total += 1;\n\n if (reaction.emoji.name == '♻️') {\n collector.stop();\n message.client.commands.get('discard').execute(message, ['pokemon', discardValue]);\n setTimeout(() => self.delete(), 300);\n }\n else {\n if (reaction.emoji.name == '◀️' && i) i -= 1;\n else if (reaction.emoji.name == '▶️' && pages.length - 1 - i) i += 1;\n\n for (const key of Object.keys(pages[i])) embedObj[key] = pages[i][key];\n embedObj.footer = { text: `Page ${i + 1} / ${pages.length}` };\n }\n self.edit(embedObj);\n }\n\n collector.on('collect', (reaction, user) => execute(reaction, user));\n\n collector.on('remove', (reaction, user) => execute(reaction, user));\n\n collector.once('end', () => {\n console.log(`Counted ${total} interactions before timing out.`)\n self.reactions.removeAll();\n });\n\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "6d77157ff17e0e7590eb45f32e0685bb", "score": "0.5405022", "text": "function getMessages(sCount=0) {\n \n // Add data to send with request\n const channelName = localStorage.getItem('channelName');\n\n // Initialize a new request\n const request = new XMLHttpRequest();\n request.open('GET', '/get_messages/' + channelName + '/' + sCount);\n\n // send request\n request.send();\n \n // Callback function when request completes\n request.onload = () => {\n\n const resData = JSON.parse(request.responseText); \n console.log(resData);\n \n const content = template(resData.messages);\n\n if (sCount == 0)\n {\n document.querySelector('#messages').innerHTML = content;\n scrollCount.set(localStorage.channelName, {val: 0});\n }\n else\n {\n document.querySelector('#messages').innerHTML += content;\n }\n }\n\n // return false if unable to send request.\n return false;\n}", "title": "" }, { "docid": "97e66a89791638b913c33c24999630a1", "score": "0.5394289", "text": "async function receivedPostback(event) {\n let senderID = event.sender.id;\n let recipientID = event.recipient.id;\n let timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n let { payload } = event.postback;\n let result;\n console.log('se recibio este postabck: ', payload);\n switch (payload) {\n default:\n // unindentified payload\n sendToDialogFlow(senderID, payload);\n // sendTextMessage(senderID, \"I'm not sure what you want. Can you be more specific?\");\n break;\n }\n\n console.log(\n \"Received postback for user %d and page %d with payload '%s' \" + 'at %d',\n senderID,\n recipientID,\n payload,\n timeOfPostback,\n );\n}", "title": "" }, { "docid": "adf82fa88a018d846b8f3fed38171cdd", "score": "0.5394272", "text": "function spfPage (page, request, result) {\n if (request.query.spf === 'navigate') {\n // page chunk\n result.render(`content/${page}.ejs`, (error, html) => {\n if (error) html = ''\n\n result.json({ body: { main: html } })\n })\n } else {\n // full page\n result.render('page.ejs', {\n page\n })\n }\n}", "title": "" }, { "docid": "c18908752a924339f681db2dc8a4e844", "score": "0.53867453", "text": "function writeMessage(message) {\n document.getElementById(\"messages\").innerHTML = message;\n talk(message);\n }", "title": "" }, { "docid": "d353c85c26d1600dfab2cc7d4e1069d1", "score": "0.53839695", "text": "function processPostbackMessage(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // the developer-defined field you set when you create postback buttons\n var payload = event.postback.payload;\n\n console.log(\"[processPostbackMessage] from user (%d) \" +\n \"on page (%d) \" +\n \"with payload ('%s') \" +\n \"at (%d)\",\n senderID, recipientID, payload, timeOfPostback);\n\n respondToHelpRequest(senderID, payload);\n}", "title": "" }, { "docid": "f67d44779f1feb5425bb5cfed7f6ecf0", "score": "0.5382765", "text": "function handleQuickReplyResponse(event) {\n var senderID = event.sender.id;\n var pageID = event.recipient.id;\n var message = event.message;\n var payload = message.quick_reply.payload;\n\n console.log(\"[handleQuickReplyResponse] Handling quick reply response (%s) from sender (%d) to page (%d) with message (%s)\",\n payload, senderID, pageID, JSON.stringify(message));\n\n\n respondToHelpRequest(senderID, payload);\n\n}", "title": "" }, { "docid": "8e1d0613f9d73fdf790db24ac6b8969b", "score": "0.5381756", "text": "function addMessagesToPage(username, messagetext, timestamp) {\n $('<div class=\"posted_message\"></div>')\n .text(messagetext)\n .prepend(\n $('<em></em>').text(timestamp + ': ')\n )\n .prepend(\n $('<strong></strong>').text(username + ': ')\n )\n .appendTo($('#message_window'));\n}", "title": "" }, { "docid": "b9fd169fc468ba02e54a725cc4464a00", "score": "0.53779614", "text": "function sendMessage(message)\n {\n //show load\n content.profDetails.toggleLoad(message.action);\n chrome.runtime.sendMessage({query:message.query,\n type:message.type,\n action:message.action},function(response){\n //console.log(response.message);\n });\n }", "title": "" }, { "docid": "0e3593c14442a6999897428ece807a76", "score": "0.5372814", "text": "function fetchMessages() {\n const url = '/all-messages';\n fetch(url)\n .then(response => response.json())\n .then((messages) => {\n const messageContainer = document.getElementById('message-container');\n if (messages.length === 0) {\n messageContainer.innerHTML = '<p>There are no posts yet.</p>';\n } else {\n messageContainer.innerHTML = '';\n }\n const profilePromises = new Map();\n messages.forEach((message) => {\n if (profilePromises.get(message.user) === undefined) {\n const profileUrl = `/profile?user=${message.user}`;\n profilePromises.set(message.user, fetch(profileUrl)\n .then(res => res.json()));\n }\n });\n\n Promise.all(profilePromises).then((values) => {\n let messageIndex = 0;\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message, messageIndex, profilePromises.get(message.user));\n messageContainer.appendChild(messageDiv);\n messageIndex += 1;\n });\n });\n });\n}", "title": "" }, { "docid": "ee569256aeaf667b04161d36624c3fa3", "score": "0.53523314", "text": "function receivedPostback(event) {\n var senderID = event.sender.id;\n var recipientID = event.recipient.id;\n var timeOfPostback = event.timestamp;\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n var payload = event.postback.payload;\n if(payload){\n console.log(\"payload=\" + payload);\n switch (payload) {\n case 'USER_DEFINED_PAYLOAD':\n startedConv(senderID);\n break;\n\n default:\n sendTextMessage(senderID, \"Postback called\");\n }\n }\n console.log(\"Received postback for user %d and page %d with payload '%s' \" +\n \"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n // When a postback is called, we'll send a message back to the sender to\n // let them know it was successful\n}", "title": "" }, { "docid": "3ddea5086b5d35518a110ab1bd055e54", "score": "0.5344156", "text": "async function messages(ctx) {\n if (ctx.isAuthenticated()) {\n let send_messages = [];\n const message_box = await Messages.findAll({where: {$or: [{receiver: ctx.state.user.id}, {sender: ctx.state.user.id}]}});\n smartPrinter(message_box);\n for (let i in message_box) {\n let column = [];\n let message = message_box[i].message;\n let sender_account = await Users.findOne({where: {googleID: message_box[i].sender}});\n let receiver_account = await Users.findOne({where: {googleID: message_box[i].receiver}});\n let sender_name = sender_account.displayName;\n let sender_photo = sender_account.photos;\n let sender_id = sender_account.googleID;\n smartPrinter(sender_id);\n column.push(message);\n column.push(sender_name);\n column.push(sender_photo);\n column.push(sender_id);\n column.push(message_box[i].status);\n column.push(receiver_account.photos);\n column.push(receiver_account.displayName);\n column.push(receiver_account.googleID);\n\n smartPrinter(message_box[i].status);\n send_messages[i] = column;\n\n }\n smartPrinter(message_box);\n await Messages.update({status: \"read\"}, {where: {receiver: ctx.state.user.id, status: \"unread\"}});\n await ctx.render('/messages', {userInfo: ctx.state.user, message_sender_info: send_messages});\n }\n else {\n ctx.redirect('/login');\n }\n\n}", "title": "" }, { "docid": "84c7685e4ec9bbd59884f2886556b75a", "score": "0.5336542", "text": "function receivedPostback(event) {\n\tvar senderID = event.sender.id;\n\tvar recipientID = event.recipient.id;\n\tvar timeOfPostback = event.timestamp;\n\n\t// The 'payload' param is a developer-defined field which is set in a postback\n\t// button for Structured Messages.\n\tvar payload = event.postback.payload;\n\n\tswitch (payload) {\n\t\tcase 'GET STARTED':\n\t\t\tgreetUserText(senderID);\n\t\t\tbreak;\n\t\tcase 'JOB_APPLY':\n\t\t\t//get feedback with new jobs\n\t\t\tsendToApiAi(senderID, \"job openings\");\n\t\t\tbreak;\n\t\tcase 'CHAT':\n\t\t\t//user wants to chat\n\t\t\tsendTextMessage(senderID, \"I love chatting too. Do you have any other questions for me?\");\n\t\t\tbreak;\n\t\tcase 'CONTACT_INFO':\n\t\t\t//TODO user wants Contact Info\n\t\t\tlet buttons = [{\n\t\t\t\t\ttype: \"phone_number\",\n\t\t\t\t\ttitle: \"Call us\",\n\t\t\t\t\tpayload: \"+16505551234\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: \"postback\",\n\t\t\t\t\ttitle: \"Keep on Chatting\",\n\t\t\t\t\tpayload: \"CHAT\"\n\t\t\t\t}\n\t\t\t];\n\n\t\t\tsendButtonMessage(senderID, \"What would you like to do next?\", buttons);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t//unindentified payload\n\t\t\tsendTextMessage(senderID, \"I'm not sure what you want. Can you be more specific?\");\n\t\t\tbreak;\n\n\t}\n\n\tconsole.log(\"Received postback for user %d and page %d with payload '%s' \" +\n\t\t\"at %d\", senderID, recipientID, payload, timeOfPostback);\n\n}", "title": "" }, { "docid": "39cbd7c4df0cd06d3671cfd6e3214057", "score": "0.532251", "text": "function receivedPostback (event) {\n var senderID = event.sender.id\n var recipientID = event.recipient.id\n var timeOfPostback = event.timestamp\n\n // The 'payload' param is a developer-defined field which is set in a postback\n // button for Structured Messages.\n var payload = event.postback.payload\n\n console.log('Received postback for user %d and page %d with payload \\'%s\\' ' +\n 'at %d', senderID, recipientID, payload, timeOfPostback)\n\n // When a postback is called, we'll send a message back to the sender to\n // let them know it was successful\n sendTextMessage(senderID, 'Postback called')\n}", "title": "" }, { "docid": "0696dc0e05ead5e0e190cb309f09b38d", "score": "0.5303123", "text": "function onMessage(stanza) {\n var message = $(stanza);\n\n var body = message.find('body').text();\n var jid = Strophe.getBareJidFromJid(message.attr('from'));\n if (body) {\n // handle date\n var date = new Date();\n var x = message.find('x');\n if (x.length > 0) {\n var stamp = x.attr('stamp');\n date.setUTCFullYear(stamp.slice(0, 4));\n date.setUTCMonth(stamp.slice(4, 6) - 1); // NOTE : month is 0-11 in JS\n date.setUTCDate(stamp.slice(6, 8));\n date.setUTCHours(stamp.slice(9, 11));\n date.setUTCMinutes(stamp.slice(12, 14));\n date.setUTCSeconds(stamp.slice(15, 17));\n }\n\n var talk_page = $('#talk-page');\n if (talk_page.attr('data-jid') == jid) {\n // talk page is open, add message\n addMessage(talk_page, body, date, jid);\n } else {\n // talk page is closed, make a note of missed message\n var contact = findContact(jid);\n var messages = contact.find('.contact-messages');\n messages.text(parseInt(messages.text()) + 1);\n messages.show();\n }\n }\n return true;\n}", "title": "" }, { "docid": "659c8fd31fc963d001974fa9fb2954b5", "score": "0.53009415", "text": "function render_page()\n\t{\n\t\t// Preload language translation in development mode.\n\t\t// `translation` loading function may be passed\n\t\t// and its main purpose is to enable Webpack HMR\n\t\t// in development mode for translated messages.\n\t\tif (locale && translation)\n\t\t{\n\t\t\treturn translation(locale).then(_render_page)\n\t\t}\n\n\t\treturn _render_page(messages)\n\t}", "title": "" }, { "docid": "9b8c773de0b586da1ed362834644bb8c", "score": "0.5300795", "text": "@api\n messageService(payload) {\n const boundary = { scopedId: this.scopedId };\n fireEvent(this.pageRef, 'messageService', { ...payload, ...boundary } );\n }", "title": "" }, { "docid": "beb35fca2a38ab4990b1c08154dbfb43", "score": "0.52983534", "text": "function fetchMessages() {\n const url = '/messages?user=' + parameterUsername;\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((messages) => {\n const messagesContainer = document.getElementById('message-container');\n if (messages.length == 0) {\n messagesContainer.innerHTML = '<p>This user has no posts yet.</p>';\n } else {\n messagesContainer.innerHTML = '';\n }\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message);\n messagesContainer.appendChild(messageDiv);\n });\n });\n}", "title": "" }, { "docid": "f8f0f921910e178ebf4818913ca79479", "score": "0.52921754", "text": "function getReceivedMessage(req, res){\n var userId = req.user.sub;\n\n var page = 1;\n if(req.params.page){\n page = req.params.page;\n }\n\n var itemsPerPage = 7;\n\n Message.find({receiver: userId}).populate('emitter', 'name surname nick image _id').sort({'created_at':-1}).paginate(page, itemsPerPage, (err, messages, total) => {\n if(err) return res.status(500).send({message: 'Error en la peticion'});\n if(!messages) return res.status(404).send({message: 'No hay mensajes'});\n \n return res.status(200).send({\n total: total,\n pages: Math.ceil(total/itemsPerPage),\n messages\n });\n \n });\n}", "title": "" }, { "docid": "7bea343f5cec7104b2ce6920232cbc45", "score": "0.52911127", "text": "function get_succ(reply) {\n if (reply.error == false)\n prepare_page(reply.message);\n else\n window.location.replace(rel_fron_path);\n}", "title": "" }, { "docid": "72fe7ccbc04e433a4370bc72f8c80bda", "score": "0.52877533", "text": "function onMessageReceived() {\n\t// TODO: Show an overlay that we're busy loading messages\n\t_displayNewMessages();\n}", "title": "" }, { "docid": "970515810749703a331abe5b81fee2dc", "score": "0.5287247", "text": "function getMessages() {\n $('#chatLines').empty();\n eventChat = new EventChat();\n eventChat.create(event1, user);\n getMessageStrings(eventChat);\n var newH, newA, newHr, newH1, chat;\n var n, url;\n chat = $('#chatLines');\n //This might not look nice but it should work. Go back and fix the how\n //it looks later.\n for (n = eventChat.getSize() - 1; n > -1; n--) {\n url = \"../profile/index.html#\" + senders[n].getID();\n newA = $('<a>').attr('href', url).text(senders[n].getName() + \": \").on('click', function () {\n window.location.href = url;\n window.location.reload(true);\n });\n newH = $('<p>').append(newA);\n newH1 = $('<p>').text(messages[n]);\n newHr = $('<hr>');\n\n chat.append(newH);\n chat.append(newH1);\n chat.append(newHr);\n }\n}", "title": "" }, { "docid": "95c29e9f102e4e6c41150624b4f96d5d", "score": "0.5287234", "text": "function printFiveMessages(){\n\tprintMessage();\n\tprintMessage();\n\tprintMessage();\n\tprintMessage();\n\tprintMessage();\n}", "title": "" }, { "docid": "44a59135fa626cad053f247ec03d11fa", "score": "0.5285575", "text": "function returnpage(res, str, id) {\n if (id == null)\n res.render(\"index.ejs\", {\n messagecontent: str,\n });\n else\n res.render(\"index.ejs\", {\n messagecontent: \"ID: \" + id + \" \" + str,\n });\n}", "title": "" }, { "docid": "73cf631de8f2a9356bbd09ca82fdfb38", "score": "0.5283912", "text": "onReceivedMessage(messages) {\n // alert(JSON.stringify(messages))\n this._storeMessages(messages);\n }", "title": "" }, { "docid": "e995b2bb93d502113411f17713d8a6fc", "score": "0.52804214", "text": "function load() {\r\n $.get(url + '?start=' + start, function (result) {\r\n if (result.items) {\r\n result.items.forEach(item => {\r\n start = item.id;\r\n //Append the message inside message div to display to user\r\n $('#messages').append(displayMessage(item));\r\n });\r\n $('#messages').animate({ scrollTop: $('#messages')[0].scrollHeight });\r\n };\r\n //load(); UNCOMMENT IF WANT INSTANT MESSAGING ON PAID SERVERS NOT RECOMMENDED\r\n });\r\n}", "title": "" }, { "docid": "2f77dfe4495335a4d0654e06fc742d7d", "score": "0.5279799", "text": "function updateMessageView(messages) {\n if (typeof messages === \"undefined\") return \"\";\n let formattedMessages = \"\";\n messages.map(\n (m) =>\n (formattedMessages += `<p><strong>${m.username}</strong>: ${m.message.text} <p>`)\n );\n document.getElementById(\"messageContainer\").innerHTML = formattedMessages;\n updateScroll();\n}", "title": "" }, { "docid": "6372ea51368b591dab50893d051b37e9", "score": "0.5279439", "text": "function arrived_message_handler (message) {\r\n\t// With EzWeb authentication, read-only mode is allowed\r\n\tif (ezweb_login.get() == 'yes'){\r\n\t\tnotification.info(translator.getLabel('read_mode'));\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar nmessage = '';\r\n\tvar input_elto = document.getElementById('status');\r\n\t\r\n\t// Checks where is the user (\"me\" tab?)\r\n\tif (!input_elto) {\r\n\t\tnmessage = init_msg;\r\n\t} else {\r\n\t\tnmessage = input_elto.value;\r\n\t}\r\n\t\r\n\t// Incoming events while draft is under edition\r\n\tif ((incoming_events.get() == 'discarded') && (nmessage != '')){\r\n\t\treturn;\t\r\n\t}\r\n\t\r\n\tswitch (draft_is.get()) {\r\n\r\n\tcase 'prefixed':\r\n\t\tif (nmessage == ''){\r\n\t\t\tnmessage = message;\r\n\t\t} else {\r\n\t\t\tnmessage = nmessage + ' ' + message;\r\n\t\t}\r\n\t\tbreak;\r\n\r\n\tcase 'concatenated':\r\n\t\tif (nmessage == ''){\r\n\t\t\tnmessage = message;\r\n\t\t} else {\r\n\t\t\tnmessage = message + ' ' + nmessage;\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\t\r\n\tdefault:\r\n\t\tnmessage = message;\r\n\t\tbreak;\r\n\t}\r\n\t\r\n\t// Writes the message\r\n\tif (!input_elto) {\r\n\t\tinit_msg = nmessage;\r\n\t} else {\r\n\t\tinput_elto.value = nmessage;\r\n\t}\r\n\r\n\t// Checks the message\r\n\tcheck_message();\r\n}", "title": "" }, { "docid": "1b3058b703de073c99096b8bf35742ec", "score": "0.5276268", "text": "checkPage(string) {\n I.amOnPage(string);\n }", "title": "" }, { "docid": "6dc1259a6e096fdba45c183b49c22fc2", "score": "0.5276099", "text": "function showMessagePage() {\r\n var objForm = nlapiCreateForm('PM Suitelet – Time');\r\n objForm.addField('custpage_result', 'inlinehtml', '').setDisplayType('normal').setDefaultValue(\r\n 'Your Request has been submitted to be processed. You will be notified by email when the process is complete.');\r\n return objForm;\r\n}", "title": "" }, { "docid": "a6b3b60aef74bfb3c6a6813b60c4dd5f", "score": "0.52714235", "text": "function updatePage(msg){\n // console.log(msg)\n /*var date = localStorage.getItem(\"/Video/video_list\")*/\n if (msg.ok == true) {\n console.log(msg)\n msg.info = $.parseJSON(Global.crypt(msg.result));\n console.log(msg.info)\n homeObj.ajaxData = msg.info;\n homeObj.ajaxSuccessFun();\n } else {\n $.alertMsg(msg.err);\n }\n if (homeObj.pullLoad) { \n homeObj.pullLoad.resetload();\n }\n }", "title": "" }, { "docid": "64dbdb260389c874b739b48598d98e1c", "score": "0.52644926", "text": "function showMessages() {\n return;\n}", "title": "" }, { "docid": "4930f73eddfa722199077af753d00459", "score": "0.5261072", "text": "prevPage() {\n if (this.curPage === 0) return this.clearReactions();\n\n this.curPage -= 1;\n this.updateMessage(this.curPage);\n }", "title": "" }, { "docid": "6448876d9d35893a10f526ca55df53e9", "score": "0.5256728", "text": "function MessageView() {\n }", "title": "" } ]
fc2a5d76eb18f5864b83ffe4cb666186
TODO: Break grad into two params
[ { "docid": "f65995b39da724b6a12fd21d6cb158fe", "score": "0.60066396", "text": "function gradient(ox, oy, grad, px, py) {\n return grad[0] * (px - ox) + grad[1] * (py - oy);\n}", "title": "" } ]
[ { "docid": "055cf82ad062ba0443684e340cc0be80", "score": "0.62232774", "text": "function e176() {\n var grad = null;\n return grad;\n}", "title": "" }, { "docid": "0eafaf6bd3269ba1fa6659e6729570fa", "score": "0.5672161", "text": "debugGrad() {\n const N = this.N;\n\n const cg = this.costGrad(this.Y); // evaluate gradient\n // const cost = cg.cost;\n const grad = cg.grad;\n\n const e = 1e-5;\n for(let i=0;i<N;i++) {\n for(let d=0;d<this.dim;d++) {\n const yold = this.Y[i][d];\n\n this.Y[i][d] = yold + e;\n const cg0 = this.costGrad(this.Y);\n\n this.Y[i][d] = yold - e;\n const cg1 = this.costGrad(this.Y);\n\n // const analytic = grad[i][d];\n // const numerical = (cg0.cost - cg1.cost) / ( 2 * e );\n // console.log(i + ',' + d + ': gradcheck analytic: ' + analytic + ' vs. numerical: ' + numerical);\n\n this.Y[i][d] = yold;\n }\n }\n }", "title": "" }, { "docid": "ae3bd7c86bca52e37dcc7606b40b80bf", "score": "0.54046875", "text": "function getGradID(d){return \"linkGrad-\" + d.source.name + d.target.name;}", "title": "" }, { "docid": "e2c9cb149bc5aeb82bf7d898377bd170", "score": "0.5394577", "text": "function gradgen(dim, gp) {\n dim = dim|0;\n gp = gp|0;\n\n var pp = 0, num = 0, nzero = 0;\n var mag = fround(0.);\n\n gradinit(dim, gp);\n pp = gp;\n\n mag = fround(1.); // fround(fround(1.) / fround(sqrt(fround(~~(dim-1)))));\n\n while (1) {\n nzero = gradstep(dim, mag, pp, gp)|0;\n pp = gp;\n if (!((nzero-1)|0)) {\n num = (num+1)|0;\n gp = (dim << 2) + gp|0;\n } else if (!((nzero-dim)|0)) {\n break;\n }\n }\n return num|0;\n }", "title": "" }, { "docid": "e96b69616eaa11ae8e015aeeae36a864", "score": "0.5324968", "text": "function setGrad()\n {\n\t\tif (document.getElementById('nogradient').checked) {\n\t\tcolor1 = document.getElementById(\"color1\").value;\n color2 = document.getElementById(\"color1\").value;\n\t\t}else if(!(document.getElementById('nogradient').checked)) {\n\t\t\tcolor1 = document.getElementById(\"color1\").value;\n color2 = document.getElementById(\"color2\").value;\n\t\t}\n\t\n document.getElementById(\"gradient\").style.background=\"-webkit-gradient(linear, left top, left bottom, from(\"+color1+\"), to(\"+color2+\"))\";\n document.getElementById(\"gradient\").style.background=\"-webkit-linear-gradient(\"+color1+\", \"+color2+\")\";\n document.getElementById(\"gradient\").style.background=\"-moz-linear-gradient(top, \"+color1+\", \"+color2+\")\";\n document.getElementById(\"gradient\").style.background=\"-ms-linear-gradient(\"+color1+\", \"+color2+\")\";\n document.getElementById(\"gradient\").style.background=\"-o-linear-gradient(\"+color1+\", \"+color2+\")\";\n document.getElementById(\"gradient\").style.background=\"linear-gradient(\"+color1+\", \"+color2+\")\";\ndocument.getElementById(\"gradient\").style.filter=\"progid:DXImageTransform.Microsoft.Alpha(startColorstr='\"+color1+\"', endColorstr='\"+color2+\"')\";\n\n }", "title": "" }, { "docid": "47e0e0d4c144fa33dd180d993b57552a", "score": "0.5296626", "text": "computeGradients(f, varList) {\n return (0, _gradients.variableGrads)(f, varList);\n }", "title": "" }, { "docid": "d1bd4fd0c72f5b827e8c524358842023", "score": "0.52625054", "text": "function getGradID(d){ return \"linkGrad-\" + d.source.index + \"-\" + d.target.index; }", "title": "" }, { "docid": "d1bd4fd0c72f5b827e8c524358842023", "score": "0.52625054", "text": "function getGradID(d){ return \"linkGrad-\" + d.source.index + \"-\" + d.target.index; }", "title": "" }, { "docid": "4eb18b649d064124e4928f02a8210317", "score": "0.52318764", "text": "function sqr_gradation(sqr,color,king_sqr)\n{\n\tvar m1=vertical_gradation(sqr,color);\n\tgrad_vert+=m1;\n\tvar n1=radial_gradation(sqr,king_sqr);\n\tgrad_rad+=n1;\n\treturn (m1+n1);\n}", "title": "" }, { "docid": "4a9f6099ce0a916b68db68c0bb81a83d", "score": "0.52286947", "text": "costGrad(Y) {\n const N = this.N;\n const dim = this.dim; // dim of output space\n const P = this.P;\n\n const pmul = this.iter < 100 ? 4 : 1; // trick that helps with local optima\n\n // compute current Q distribution, unnormalized first\n const Qu = zeros(N * N);\n let qsum = 0.0;\n for(var i=0;i<N;i++) {\n for(var j=i+1;j<N;j++) {\n let dsum = 0.0;\n for(var d=0;d<dim;d++) {\n const dhere = Y[i][d] - Y[j][d];\n dsum += dhere * dhere;\n }\n const qu = 1.0 / (1.0 + dsum); // Student t-distribution\n Qu[i*N+j] = qu;\n Qu[j*N+i] = qu;\n qsum += 2 * qu;\n }\n }\n // normalize Q distribution to sum to 1\n const NN = N*N;\n const Q = zeros(NN);\n for(let q=0;q<NN;q++) { Q[q] = Math.max(Qu[q] / qsum, 1e-100); }\n\n let cost = 0.0;\n const grad = [];\n for(var i=0;i<N;i++) {\n const gsum = new Array(dim); // init grad for point i\n for(var d=0;d<dim;d++) { gsum[d] = 0.0; }\n for(var j=0;j<N;j++) {\n cost += - P[i*N+j] * Math.log(Q[i*N+j]); // accumulate cost (the non-constant portion at least...)\n const premult = 4 * (pmul * P[i*N+j] - Q[i*N+j]) * Qu[i*N+j];\n for(var d=0;d<dim;d++) {\n gsum[d] += premult * (Y[i][d] - Y[j][d]);\n }\n }\n grad.push(gsum);\n }\n\n return {cost: cost, grad: grad};\n }", "title": "" }, { "docid": "49fdfe295d464e83c0e4fd9090d34f58", "score": "0.52134067", "text": "resolucionModelo(){\n let {funcion, puntoInicialA,\n puntoInicialB,\n epsilon, obj } = this.state.model\n let solucion;\n \n \n if(funcion!==\"\" % puntoInicialA!==\"\" & puntoInicialB !==\"\" & epsilon!==\"\"){\n puntoInicialA = Number(puntoInicialA);\n puntoInicialB = Number(puntoInicialB);\n \n solucion = fGradiente(funcion, puntoInicialA,puntoInicialB, epsilon, obj )\n this.state.model.salida = solucion;\n this.muestraResultado()\n \n }\n \n}", "title": "" }, { "docid": "c7fbcc76f5ee6f5dc1d97b2452824cdb", "score": "0.5176947", "text": "function getGradID (d) { return 'linkGrad-' + d.source.index + '-' + d.target.index }", "title": "" }, { "docid": "83d839377780b41e8a0a6b7f2cd01bf1", "score": "0.5126558", "text": "function drawVerticalGradientOnElement(svgElem, gradId, grad1Red, grad1Green, grad1Blue, grad2Red, grad2Green, grad2Blue) {\n\tconst gradientDef = document.createElementNS('http://www.w3.org/2000/svg', 'defs');\n\tconst gradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');\n\tgradient.id = gradId;\n\tgradient.setAttribute('x1', \"0%\");\n\tgradient.setAttribute('y1', \"0%\");\n\tgradient.setAttribute('x2', \"0%\");\n\tgradient.setAttribute('y2', \"100%\");\n\tconsole.log(gradient);\n\tconst stopTop = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n\tstopTop.setAttribute(svganOffset, \"0%\");\n\tstopTop.setAttribute(svganStyle, \"stop-color:rgb(\" + grad1Red + \",\" + grad1Green + \",\" + grad1Blue + \");stop-opacity:1\");\n\tgradient.appendChild(stopTop);\n\tconst stopBottom = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n\tstopBottom.setAttribute(svganOffset, \"100%\");\n\tstopBottom.setAttribute(svganStyle, \"stop-color:rgb(\" + grad2Red + \",\" + grad2Green + \",\" + grad2Blue + \");stop-opacity:1\");\n\tgradient.appendChild(stopBottom);\n\tgradientDef.appendChild(gradient);\n\tsvgElem.appendChild(gradientDef);\n}", "title": "" }, { "docid": "7e48b0adb7c80af7ad68b83e3bbb9a7a", "score": "0.51058006", "text": "function gradient( __src ) {\n // sqrt(gx^2 + gy^2)\n var h = __src.h,\n w = __src.w;\n var gr = new AlphaMask(w, h);\n var gg = new AlphaMask(w, h);\n var gb = new AlphaMask(w, h);\n\n for (var y=0;y<h;y++) {\n var yd = (y + 1) % (h - 1);\n for(var x=0;x<w;x++) {\n var xr = (x + 1) % (w-1);\n var gxc = __src.getPixel(x, y).sub(__src.getPixel(xr, y));\n var gyc = __src.getPixel(x, y).sub(__src.getPixel(x, yd));\n var r = Math.sqrt(gxc.r * gxc.r + gyc.r * gyc.r);\n var g = Math.sqrt(gxc.g * gxc.g + gyc.g * gyc.g);\n var b = Math.sqrt(gxc.b * gxc.b + gyc.b * gyc.b);\n gr.setValue(x, y, r);\n gg.setValue(x, y, g);\n gb.setValue(x, y, b);\n }\n }\n\n return [gr, gg, gb];\n}", "title": "" }, { "docid": "9bd71eefa682824852d18ac6a93fed05", "score": "0.510441", "text": "function developer(step){\n var hex1 = document.getElementById('hex1').value.trim().replace('#',''),\n hex2 = document.getElementById('hex2').value.trim().replace('#','');\n hex1 = hex1.length !== 6 ? (hex1+'000000').slice(0,6) : hex1;\n hex2 = hex2.length !== 6 ? (hex2+'000000').slice(0,6) : hex2;\n console.log(getGradient(hex1,hex2,step));\n}", "title": "" }, { "docid": "8fbc609a42a7880b73adaacddee7ab72", "score": "0.5096576", "text": "grad(hash, x, y, z){//int,double --> double\n const h = hash & 15;//CONVERT LO 4 BITS OF HASH CODE\n const u = h < 8 ? x : y;//INTO 12 GRADIENT DIRECTIONS.\n const v = h < 4 ? y : (h === 12 || h === 14) ? x : z;\n return ((h & 1) === 0 ? u : -u) + ((h & 2) === 0 ? v : -v);\n }", "title": "" }, { "docid": "0d473e3ea931de2da0481d50b350cec0", "score": "0.50718427", "text": "function gradient(top, middle, bottom) {\n let colors = `${top}, ${middle}`;\n if (bottom) {\n colors = `${colors}, ${bottom}`;\n }\n return `linear-gradient(to bottom right, ${colors})`;\n}", "title": "" }, { "docid": "c7834412a75eae4314ddc5c93ff4ec33", "score": "0.5056975", "text": "_generateGradientCSS() {\n // Const colors = this._options.color.split(', ');\n let cssColors = '';\n // If (colors.length < 2) {\n // cssColors = `${this._options.color}, ${this._options.color}`;\n // } else {\n // cssColors = this._options.color;\n // }\n if (this._options.color === null) {\n cssColors = this._options.gradient; // Use gradient\n }\n else {\n cssColors = `${this._options.color}, ${this._options.color}`;\n }\n return `${this._options.angle}deg, ${cssColors}`;\n }", "title": "" }, { "docid": "e4bfe8b82a27b9200e074b248e17e8d9", "score": "0.5032662", "text": "function drawRadialGradientOnElement(svgElem, gradId, grad1Red, grad1Green, grad1Blue, grad2Red, grad2Green, grad2Blue) {\n\tconst gradientDef = document.createElementNS('http://www.w3.org/2000/svg', 'defs');\n\tconst gradient = document.createElementNS('http://www.w3.org/2000/svg', 'radialGradient');\n\tgradient.id = gradId;\n\tgradient.setAttribute('x1', \"0%\");\n\tgradient.setAttribute('y1', \"0%\");\n\tgradient.setAttribute('x2', \"0%\");\n\tgradient.setAttribute('y2', \"100%\");\n\tconsole.log(gradient);\n\tconst stopTop = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n\tstopTop.setAttribute(svganOffset, \"0%\");\n\tstopTop.setAttribute(svganStyle, \"stop-color:rgb(\" + grad1Red + \",\" + grad1Green + \",\" + grad1Blue + \");stop-opacity:1\");\n\tgradient.appendChild(stopTop);\n\tconst stopBottom = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n\tstopBottom.setAttribute(svganOffset, \"100%\");\n\tstopBottom.setAttribute(svganStyle, \"stop-color:rgb(\" + grad2Red + \",\" + grad2Green + \",\" + grad2Blue + \");stop-opacity:1\");\n\tgradient.appendChild(stopBottom);\n\tgradientDef.appendChild(gradient);\n\tsvgElem.appendChild(gradientDef);\n}", "title": "" }, { "docid": "9defebaa0e43ec4b4ad50fba7bf0d578", "score": "0.50230306", "text": "degrad(deg) {\n\t return deg * (Math.PI/180);\n\t}", "title": "" }, { "docid": "cc22ba42ce82eb2fd771afa7e90cbf87", "score": "0.5018101", "text": "function getGradient() {\n return [\n 'rgba(255, 255, 255, 0)',\n //gradient from red to yellow\n 'rgba(229, 37, 0, 1)',\n 'rgba(231, 58, 0, 1)',\n 'rgba(234, 80, 0, 1)',\n 'rgba(226, 102, 0, 1)',\n 'rgba(239, 112, 0, 1)',\n 'rgba(242, 146, 0, 1)',\n 'rgba(244, 167, 0, 1)',\n 'rgba(247, 189, 0, 1)',\n 'rgba(249, 211, 0, 1)',\n 'rgba(252, 233, 0, 1)',\n //yellow to green\n 'rgba(226, 224, 0, 1)',\n 'rgba(201, 216, 0, 1)',\n 'rgba(176, 208, 0, 1)',\n 'rgba(151, 199, 0, 1)',\n 'rgba(126, 191, 0, 1)',\n 'rgba(100, 183, 0, 1)',\n 'rgba(75, 174, 0, 1)',\n 'rgba(50, 166, 0, 1)',\n 'rgba(25, 158, 0, 1)',\n 'rgba(0, 150, 0, 1)'\n ];\n}", "title": "" }, { "docid": "c8fdd069c88d4ed99d8e658c247b91ef", "score": "0.50142604", "text": "function get_gradient(color1, color2, direction, blend) {\n\tvar text = \"linear-gradient(\" +\n\t\"to \" + direction + \", \" +\n\tcolor1 + \", \" +\n\tcolor1 + \" \" + blend + \"%, \" +\n\tcolor2 + \" \" + blend + \"%, \" +\n\tcolor2 + \"); \";\n\treturn text;\n}", "title": "" }, { "docid": "24cf107654adcd9ac80c6444c6a7a19d", "score": "0.5008115", "text": "function canvasGrad(){\n var canvas = document.getElementById('mycanvas');\n var ctx = canvas.getContext('2d');\n \n // Create a linear gradient\n // The start gradient point is at x=20, y=0\n // The end gradient point is at x=220, y=0\n var gradient = ctx.createLinearGradient(0,0, 0,350);\n \n // Add three color stops\n gradient.addColorStop(0, 'blue');\n gradient.addColorStop(.5, 'cyan');\n gradient.addColorStop(1, 'orange');\n \n // Set the fill style and draw a rectangle\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 10, 800, 400);\n }", "title": "" }, { "docid": "2d4e11b816a0b03278171bf500086a19", "score": "0.49992433", "text": "function getGetColorFromGradient(colorComponent1, colorComponent2, position)\n{\n return colorComponent1 - position * (colorComponent1 - colorComponent2);\n}", "title": "" }, { "docid": "e04256e069f23937425903147aae32d0", "score": "0.4990367", "text": "gradients(f, xs, dy, allowNoGradients = false) {\n util_base[\"b\" /* assert */](xs.length > 0, () => 'gradients() received an empty list of xs.');\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util_base[\"b\" /* assert */](y instanceof tensor[\"a\" /* Tensor */], () => 'The result y returned by f() must be a tensor.');\n // Filter out the nodes that don't connect x => y.\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +\n 'that the f you passed encloses all operations that lead from x ' +\n 'to y.');\n }\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;\n // Backprop gradients through the filtered nodes.\n backpropagateGradients(accumulatedGradientMap, filteredTape, \n // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), \n // Pass an add function to avoide a circular dep with `tape.ts`.\n engine_add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n return { value: y, grads };\n });\n }", "title": "" }, { "docid": "221975429cd862c8c14c00089cb4a40c", "score": "0.49575105", "text": "function gradf(b) {\t\t\n\t\t// Initialize the placeholder for the price relatives of all the assets at period k\n\t\tvar x_k = Matrix_.zeros(nbAssets, 1);\n\t\t\n\t\t// Preliminary computation of all the portfolio relatives <b/x_k>, k = 1..nbPeriods,\n\t\t// as well as their cumulative product (optimized formula only).\n\t\tvar portfolioRelatives = typeof Float64Array === 'function' ? new Float64Array(nbPeriods) : new Array(nbPeriods);\n\t\tvar prodPortfolioRelatives = 1.0;\n\t\tvar nullPortfolioRelatives = false;\n\t\tfor (var k = 0; k < nbPeriods; ++k) {\n\t\t\t// Extract the price relatives x_k for all the assets for the period k\n\t\t\tx_k = Matrix_.fill(nbAssets, 1, function(i,j) { return priceRelatives[i-1][k]; }, x_k);\n\t\t\t\n\t\t\t// Compute the portfolio relative <b/x_k>\n\t\t\tvar b_d_x_k = Matrix_.vectorDotProduct(b, x_k);\n\t\t\t\n\t\t\t// Save the portfolio relative for future usage\n\t\t\tportfolioRelatives[k] = b_d_x_k;\n\n\t\t\t// Optimized formula only\n\t\t\tif (nullPortfolioRelatives === false) {\n\t\t\t\t// Add the portfolio relative to the cumulative product\n\t\t\t\tprodPortfolioRelatives *= b_d_x_k;\n\t\t\t\n\t\t\t\t// Determine if the portfolio relative is numerically close to 0,\n\t\t\t\t// in which case the optimized computation of the gradient of the\n\t\t\t\t// function S_n(b) cannot be used.\n\t\t\t\tif (Math.abs(b_d_x_k) <= 1e-12) {\n\t\t\t\t\tnullPortfolioRelatives = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Compute the nbAssets products Prod_i <b/x_i>, i = 1..nbPeriods, i <> k, with k = 1..nbAssets:\n\t\t//\n\t\t// - Optimized formula: if there is no <b/x_k> such that <b/x_k> ~= 0, then the formula\n\t\t// Prod_i <b/x_i>, i = 1..nbPeriods / <b/x_k> == Prod_i <b/x_i>, i = 1..nbPeriods, i <> k\n\t\t// is used.\n\t\t//\n\t\t// - Non-optimized formula: Unsupported for now.\n\t\tvar partialPortfolioRelatives;\n\t\tif (nullPortfolioRelatives === false) {\n\t\t\tpartialPortfolioRelatives = Matrix_.fill(nbPeriods, 1, \n\t\t\t function(i,j) { return prodPortfolioRelatives / portfolioRelatives[i-1]; });\n\t\t}\n\t\telse {\n\t\t\tthrow new Error('null portfolio relative detected, unsuported case');\n\t\t}\n\n\t\t// Initialize the placeholder for the all the price relatives of the asset k\n\t\tvar xx_k = Matrix_.zeros(nbPeriods, 1);\n\t\t\n\t\t// Compute the gradient\n\t\tvar res = Matrix_.zeros(nbAssets, 1);\n\t\tfor (var k = 0; k < nbAssets; ++k) {\n\t\t\t// Extract all the price relatives xx_k of the asset k\n\t\t\txx_k = Matrix_.fill(nbPeriods, 1, function(i,j) { return priceRelatives[k][i-1]; }, xx_k);\n\t\t\t\n\t\t\t// Compute the k-th coordinate of the gradient\n\t\t\tres.data[k] = -Matrix_.vectorDotProduct(xx_k, partialPortfolioRelatives);\n\t\t}\n\n\t\t// Return the computed gradient\n\t\treturn res;\n\t}", "title": "" }, { "docid": "b6276e44daad683ef7657217c9278732", "score": "0.4943992", "text": "function createGradient(temp) {\n $(\".gradient\").fadeOut(400, \"swing\", newGrad);\n\n function newGrad() {\n // create map object for gradient points, cooler to warmer\n let colorMap = {\n 0: [ \"#3949ab\", \"#9FA8DA\"],\n 1: [ \"#1565c0\", \"#42A5F5\" ],\n 2: [ \"#00838f\", \"#26C6DA\" ],\n 3: [ \"#00838f\", \"#26C6DA\" ],\n 4: [ \"#558b2f\", \"#9CCC65\" ],\n 5: [ \"#558b2f\", \"#9CCC65\" ],\n 6: [ \"#afb42b\", \"#DCE775\" ],\n 7: [ \"#afb42b\", \"#DCE775\" ],\n 8: [ \"#bf360c\", \"#FF7043\" ],\n 9: [ \"#b71c1c\", \"#EF5350\" ]\n }\n\n // map temp to colorMap object\n let mapTemp = Math.round(temp / 10);\n\n if (mapTemp > 9) {\n $(\".gradient\").css({\"background\": `linear-gradient(to bottom right, ${colorMap[9][0]}, ${colorMap[9][1]})`});\n $(\".gradient\").fadeIn(600, \"swing\");\n }\n else if (mapTemp < 0) {\n $(\".gradient\").css({\"background\": `linear-gradient(to bottom right, ${colorMap[0][0]}, ${colorMap[0][1]})`});\n $(\".gradient\").fadeIn(600, \"swing\");\n }\n else {\n // console.log(\"colorMap temp: \" + mapTemp);\n $(\".gradient\").css({\"background\": `linear-gradient(to bottom right, ${colorMap[mapTemp][0]}, ${colorMap[mapTemp][1]})`});\n $(\".gradient\").fadeIn(600, \"swing\");\n }\n }\n}", "title": "" }, { "docid": "bfb177d7caf19002ff1ca1d57c689d1d", "score": "0.49298292", "text": "function waterGrad(){\n var canvas = document.getElementById('mycanvas');\n var ctx = canvas.getContext('2d');\n \n // Create a linear gradient\n // The start gradient point is at x=20, y=0\n // The end gradient point is at x=220, y=0\n var gradient = ctx.createLinearGradient(20,0, 0,350);\n \n // Add three color stops\n gradient.addColorStop(0, 'blue');\n gradient.addColorStop(.5, 'white');\n gradient.addColorStop(1, 'blue');\n \n // Set the fill style and draw a rectangle\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 275, 800, 400);\n\n }", "title": "" }, { "docid": "d5b82e47dc368b4198baca1c122e9ee9", "score": "0.49074492", "text": "function setGradient()\n{\n\n \n\tbody.style.background = \n \"linear-gradient(to right,\" \n + color1.value\n + \",\"\n + color2.value\n + \")\";\n \n css.textContent = body.style.background;\n \n console.log(dcolor1.value)\n console.log(dcolor2.value)\n}", "title": "" }, { "docid": "77ccbb2b716177144b0a7264949aa400", "score": "0.4905221", "text": "function createGradient() {\n if(visual.background.type.name == \"gradient\" && visual.background.color_one != \"\"\n && visual.background.color_two != \"\" && visual.background.direction.name != \"\") {\n\n var cssStd = \"linear-gradient(to \" + visual.background.direction.name + \", \" + visual.background.color_one + \", \" + visual.background.color_two\n + \")\";\n\n $('svg').css(\"background\", cssStd);\n\n } else {\n return;\n }\n}", "title": "" }, { "docid": "830839404d382807609615eb5be192c5", "score": "0.48995978", "text": "function setGradient() {\n body.style.background = \"linear-gradient(to right, \" \n + color1.value \n + \", \" \n + color2.value \n + \")\";\n\n // otherways\n // css.innerHTML\n // css.createTextNode\n css.textContent = body.style.background + \";\";\n \n}", "title": "" }, { "docid": "99ef1ff8def12d5ba59a481e7e3cb0ea", "score": "0.48784646", "text": "function drawCircleWithVerticalGradient(svgElem, gradId, circleId, cX, cY, cR, grad1Red, grad1Green, grad1Blue, grad2Red, grad2Green, grad2Blue) {\n\tconsole.log(svgElem);\n\tdrawVerticalGradientOnElement(svgElem, gradId, grad1Red, grad1Green, grad1Blue, grad2Red, grad2Green, grad2Blue);\n\tconst kolo = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n\tkolo.id = circleId;\n\tkolo.setAttribute(svganFill, \"url(#\" + gradId + \")\");\n\tkolo.setAttribute('cx', cX);\n\tkolo.setAttribute('cy', cY);\n\tkolo.setAttribute('r', cR);\n\tconsole.log(kolo);\n\tsvgElem.appendChild(kolo);\n\treturn kolo;\n}", "title": "" }, { "docid": "752f2f9fa3c04b8fe017057837b5e4b7", "score": "0.48612207", "text": "gradients(f, xs, dy, allowNoGradients = false) {\n util.assert(xs.length > 0, () => 'gradients() received an empty list of xs.');\n\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util.assert(y instanceof _tensor.Tensor, () => 'The result y returned by f() must be a tensor.'); // Filter out the nodes that don't connect x => y.\n\n const filteredTape = (0, _tape.getFilteredNodesXToY)(this.state.activeTape, xs, y);\n\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + 'that the f you passed encloses all operations that lead from x ' + 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = dy == null ? ones(y.shape) : dy; // Backprop gradients through the filtered nodes.\n\n (0, _tape.backpropagateGradients)(accumulatedGradientMap, filteredTape, // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f));\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n\n return {\n value: y,\n grads\n };\n });\n }", "title": "" }, { "docid": "56d58457bed0a7109bf8690a8a678915", "score": "0.48538512", "text": "function setGradient(){\n body.style.background = \n \"linear-gradient(to right, \"\n +color1.value\n + \",\" \n +color2.value\n +\")\";\n\n // THIS IS TO ADD THE CSS RGB INFORMATION TO THE PAGE\n css.textContent = body.style.background + \"\"; \n}", "title": "" }, { "docid": "ccee5467b09dd7eebfc900ecb3cd45bf", "score": "0.4848988", "text": "gradients(f, xs, dy, allowNoGradients = false) {\n util_base[\"b\" /* assert */](xs.length > 0, () => 'gradients() received an empty list of xs.');\n\n if (dy != null && dy.dtype !== 'float32') {\n throw new Error(`dy must have 'float32' dtype, but has '${dy.dtype}'`);\n }\n\n const y = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy('forward', f));\n util_base[\"b\" /* assert */](y instanceof tensor[\"a\" /* Tensor */], () => 'The result y returned by f() must be a tensor.'); // Filter out the nodes that don't connect x => y.\n\n const filteredTape = getFilteredNodesXToY(this.state.activeTape, xs, y);\n\n if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {\n throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' + 'that the f you passed encloses all operations that lead from x ' + 'to y.');\n }\n\n return this.tidy('backward', () => {\n const accumulatedGradientMap = {};\n accumulatedGradientMap[y.id] = dy == null ? ones(y.shape) : dy; // Backprop gradients through the filtered nodes.\n\n backpropagateGradients(accumulatedGradientMap, filteredTape, // Pass the tidy function to avoid circular dep with `tape.ts`.\n f => this.tidy(f), // Pass an add function to avoide a circular dep with `tape.ts`.\n engine_add);\n const grads = xs.map(x => accumulatedGradientMap[x.id]);\n\n if (this.state.gradientDepth === 0) {\n // This means that we are not computing higher-order gradients\n // and can clean up the tape.\n this.state.activeTape.forEach(node => {\n for (const tensor of node.saved) {\n tensor.dispose();\n }\n });\n this.state.activeTape = null;\n }\n\n return {\n value: y,\n grads\n };\n });\n }", "title": "" }, { "docid": "aa6a69fbeadf3d643f92d9fe9062409d", "score": "0.48452714", "text": "function newProperty(){\n let colorGradient = createGradientColor();\n\n let direction = colorGradient.direction;\n let firstColor = colorGradient.firstColor;\n let secondColor = colorGradient.secondColor;\n\n return `linear-gradient(${direction}, ${firstColor}, ${secondColor})`;\n}", "title": "" }, { "docid": "f0ad47c3d3bdb11c39452856a309be47", "score": "0.48358026", "text": "function sum(g, d) {\n return g + d;\n}", "title": "" }, { "docid": "f0ad47c3d3bdb11c39452856a309be47", "score": "0.48358026", "text": "function sum(g, d) {\n return g + d;\n}", "title": "" }, { "docid": "deaafc396d01b0e653a96f41585e8ce7", "score": "0.481924", "text": "function getGradient(x0, y0, x1, y1) {\n \n // Calculate the gradient for the box. It is required to calculate it\n // in pixels.\n var x0_px = x0 * w.scaleX.toPx;\n var y0_px = y0 * w.scaleY.toPx;\n var gradient = w.ctx.createLinearGradient(\n x0_px,\n y0_px,\n x0_px + x1 * w.scaleX.toPx,\n y0_px + y1 * w.scaleY.toPx\n );\n gradient.addColorStop(0, \"#888888\");\n gradient.addColorStop(0.5, \"#DDDDDD\");\n gradient.addColorStop(1, \"#888888\");\n return gradient;\n }", "title": "" }, { "docid": "7ccd42b506952dc33fdb72b17317359e", "score": "0.48178688", "text": "function gradient(feature, resolution) {\n var extent = feature.getGeometry().getExtent();\n // Gradient starts on the left edge of each feature, and ends on the right.\n // Coordinate origin is the top-left corner of the extent of the geometry, so\n // we just divide the geometry's extent width by resolution and multiply with\n // pixelRatio to match the renderer's pixel coordinate system.\n var width = ol.extent.getWidth(extent) / resolution * pixelRatio;\n var height = ol.extent.getHeight(extent) / resolution * pixelRatio;\n var grad = context.createRadialGradient(width / 2, height / 2,\n 5, width / 2, height / 2, width > height ? width / 2 : height / 2);\n grad.addColorStop(0, 'rgba(235, 0, 0, 0.1)');\n grad.addColorStop(1, 'rgba(231, 132, 238, 0.1)');\n return grad;\n }", "title": "" }, { "docid": "a6a4a8c8d94ba3de6cac80b49c30af5b", "score": "0.4809423", "text": "function gradientCss(elem, direction, color1)\n\t{\n\t\tvar dirsafari = \"left\"\n\t\tif (direction == \"left\") dirsafari = \"right\"\n\t\tif (color1.substring(0,1) !== \"#\") color1 = \"#\" + color1;\n\t\t$(elem).css(\"background\", \"white\"); // For browsers that do not support gradients\n\t\t$(elem).css(\"background\", \"-webkit-linear-gradient(\" + dirsafari + \", \" + color1 + \", rgba(255,255,255, 0.0), rgba(255,255,255, 0.0))\"); // For Safari 5.1 to 6.0\n\t\t$(elem).css(\"background\", \"-o-linear-gradient(\" + direction + \", \" + color1 + \", rgba(255,255,255, 0.0), rgba(255,255,255, 0.0))\"); // For Opera 11.1 to 12.0\n\t\t$(elem).css(\"background\", \"-moz-linear-gradient(\" + direction + \", \" + color1 + \", rgba(255,255,255, 0.0), rgba(255,255,255, 0.0))\"); // For Firefox 3.6 to 15\n\t\t$(elem).css(\"background\", \"linear-gradient(to \" + direction + \", \" + color1 + \", rgba(255,255,255, 0.0), rgba(255,255,255, 0.0))\"); // Standard syntax\n\t}", "title": "" }, { "docid": "5136deda225f2238b7f3d0c1e0e03d16", "score": "0.47807637", "text": "function setGradient() {\r\n body.style.background = `linear-gradient(to right, ${firstColor.value}, ${secondColor.value})`;\r\n css.textContent = body.style.background;\r\n}", "title": "" }, { "docid": "9571fd7bd43bd16f884e1bb985ecd983", "score": "0.47803858", "text": "function setGradient() {\n\tcolorOutput(color1.value, color2.value);\n\tchangeText(color1.value, color2.value);\n}", "title": "" }, { "docid": "0c0a72bb6249159424daa95ff5f0dd11", "score": "0.4779431", "text": "function getGradient(kernelName) {\n return gradRegistry.get(kernelName);\n }", "title": "" }, { "docid": "200dd0be4681e9c65ab190ee940ee519", "score": "0.47788957", "text": "function updateGradient(){\n \n if ( $===undefined ) return;\n // adds color array to color index\nvar colorI0 = colors[colorIndexes[0]];\nvar colorI1 = colors[colorIndexes[1]];\nvar colorI2 = colors[colorIndexes[2]];\nvar colorI3 = colors[colorIndexes[3]];\n\n//assigns colors that are to be run\nvar istep = 1 - step;\nvar red1 = Math.round(istep * colorI0[0] + step * colorI1[0]);\nvar green1 = Math.round(istep * colorI0[1] + step * colorI1[1]);\nvar blue1 = Math.round(istep * colorI0[2] + step * colorI1[2]);\nvar color1 = \"rgb(\"+red1+\",\"+green1+\",\"+blue1+\")\";\n\nvar red2 = Math.round(istep * colorI2[0] + step * colorI3[0]);\nvar green2 = Math.round(istep * colorI2[1] + step * colorI3[1]);\nvar blue2 = Math.round(istep * colorI2[2] + step * colorI3[2]);\nvar color2 = \"rgb(\"+red2+\",\"+green2+\",\"+blue2+\")\";\n\n//changes the background by adding css\n $('.gradient').css({\n background: \"-webkit-gradient(linear, left top, right top, from(\"+color1+\"), to(\"+color2+\"))\"}).css({\n background: \"-moz-linear-gradient(left, \"+color1+\" 0%, \"+color2+\" 100%)\"});\n \n//places colors into empty string, then adds them to the css\n step += gradientSpeed;\n if ( step >= 1 ){\n step %= 1;\n colorIndexes[0] = colorIndexes[1];\n colorIndexes[2] = colorIndexes[3];\n \n colorIndexes[1] = ( colorIndexes[1] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;\n colorIndexes[3] = ( colorIndexes[3] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;\n \n }\n}", "title": "" }, { "docid": "240a7c922910091deef198652ede55a2", "score": "0.47747698", "text": "function sum(...rest) { // here these three dots are called rest operator\n return rest[0] + rest[1] + rest[2];\n}", "title": "" }, { "docid": "ff58f209ea2efea7a82bf8a2de72be93", "score": "0.47706413", "text": "_drawGradient (gradient, startPercent, endPercent) {\r\n // version 04/2023 : complete height of gradient canvas, smooth color change\r\n // 0% : cyan (0,255,255) - 2% : green (0,255,0) - 5% : yellow (255,255,0) - 10% : red (255,0,0) - 15%+ : purple (255,0,255)\r\n // <0% : -10%+ : blue (0,0,255)\r\n const canvasHeight = 15;\r\n let rgbColor = this._gradient2Rgb(gradient);\r\n\r\n // length of the fill -> from startPercent to endPercent\r\n // 500 = length of the total canvas\r\n let xMin = Math.round(startPercent*500);\r\n let xMax = Math.round(endPercent*500);\r\n \r\n // do the filling - empty the section first\r\n this.ctxGradient.clearRect(xMin,0, xMax-xMin,canvasHeight);\r\n this.ctxGradient.fillStyle = rgbColor;\r\n this.ctxGradient.fillRect(xMin,0, xMax-xMin,canvasHeight);\r\n }", "title": "" }, { "docid": "4da0c50e94a55b2ca0cae310be6a29af", "score": "0.47604442", "text": "function gradientMove(p) {\n var cStart=hexToRgb(startColor);\n var cEnd=hexToRgb(stopColor);\n var newR=parseInt(cStart.r*p+cEnd.r*(1-p));\n var newG=parseInt(cStart.g*p+cEnd.g*(1-p));\n var newB=parseInt(cStart.b*p+cEnd.b*(1-p));\n strokeColor[0]=newR;\n strokeColor[1]=newG;\n strokeColor[2]=newB;\n}", "title": "" }, { "docid": "04490a2face4734146b271edc0a15fec", "score": "0.4748681", "text": "function gradientAnimated()\n\t{\n\t\tvar elem = $('#topLeftFrame');\n\t\tvar direction = 'right';\n\t\t//rgba(59, 59, 67, 100)\n\t\t\n\t\tvar a = randomInt(1, 100);\n\t\tvar b = randomInt(1, 100);\n\t\tvar c = randomInt(1, 100);\n\t\tvar d = randomInt(1, 100);\n\t\tvar e = randomInt(1, 100);\n\t\t\n\t\tvar dirsafari = \"left\"\n\t\tif (direction == \"left\") dirsafari = \"right\"\n\t\t\n\t\telem.css(\"background\", \"rgba(59, 59, 67, 100)\"); // For browsers that do not support gradients\n\t\telem.css(\"background\", \"linear-gradient(to \" + direction + \", rgba(59, 59, 67, \" + a + \"), rgba(59, 59, 67, \" + b + \"), rgba(59, 59, 67, \" + c + \"), rgba(59, 59, 67, \" + d + \"), rgba(59, 59, 67, \" + e + \"), url('./img/code-wallpaper-2.jpg')\"); // Standard syntax\n\t\t\n\t}", "title": "" }, { "docid": "d3cb82ff41bca6256032263896f3640c", "score": "0.47486135", "text": "function createGradient(height, start, stop) {\n\tvar canvas = new Canvas(1, height);\n\tvar ctx = canvas.getContext('2d');\n\t\n\tvar gradient = ctx.createLinearGradient(0, 0, 1, height);\n\tgradient.addColorStop(0, start);\n\tgradient.addColorStop(1, stop);\n\n\tctx.fillStyle = gradient;\n\tctx.fillRect(0, 0, 1, height);\n\t\n\treturn canvas.toDataURL('image/png');\n}", "title": "" }, { "docid": "8c48e52bd3d473c4e4a159b09754cfe3", "score": "0.4748211", "text": "createGradiant() {\n // skyGrad\n const grd = this.ctx.createLinearGradient(0, 0, 0, 320);\n grd.addColorStop(0, 'cornflowerblue');\n grd.addColorStop(1, 'white');\n \n this.ctx.fillStyle = grd;\n this.ctx.fillRect(0, 0, 480, 320);\n }", "title": "" }, { "docid": "1a0be90678b9d6f0951c669515429b30", "score": "0.47312018", "text": "function func2(d,e,f){\n return d + e + f;\n} // here the return will return a single value based off the arguments which are passed through the inputs/parameters", "title": "" }, { "docid": "9e53e86f5f9621ed8b5613eeb7cf81e5", "score": "0.47201407", "text": "static LerpToRef(startValue, endValue, gradient, result) {\n const resultM = result._m;\n const startM = startValue.m;\n const endM = endValue.m;\n for (var index = 0; index < 16; index++) {\n resultM[index] = startM[index] * (1.0 - gradient) + endM[index] * gradient;\n }\n result._markAsUpdated();\n }", "title": "" }, { "docid": "74978cc4614aed37f9b3b2651857d884", "score": "0.4719814", "text": "function lagSirkel(id,start,slutt,farge){\n let canvas = document.getElementById(id);\n let context = canvas.getContext(\"2d\");\n context.beginPath();\n context.arc(156,156,100,start,slutt,true);\n let grd;\n grad = context.createLinearGradient(0.000, 150.000, 300.000, 150.000);\n grad.addColorStop(0.000, 'rgba(0, 0, 0, 1.000)');\n grad.addColorStop(0.000, 'rgba(255, 127, 0, 1.000)');\n grad.addColorStop(1.000, 'rgba(216, 149, 86, 1.000)');\n context.fillStyle= \"#262626\";\n context.strokeStyle=grad;\n context.lineWidth=12;\n context.stroke();\n context.fill();\n}", "title": "" }, { "docid": "71dacaa5f12214077eac08ff45f6b66a", "score": "0.47097233", "text": "function grad_f(x,y) {\n var grad_x = (f(x + h, y) - f(x, y)) / h\n grad_y = (f(x, y + h) - f(x, y)) / h\n return [grad_x, grad_y];\n}", "title": "" }, { "docid": "6193d0980ae4919eaf7602bf472fd568", "score": "0.47091973", "text": "function registerGradient(config) {\n var kernelName = config.kernelName;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(\"Overriding the gradient for '\" + kernelName + \"'\");\n }\n }\n gradRegistry.set(kernelName, config);\n }", "title": "" }, { "docid": "6885e74e556e7a15cb7f2b36c97f3230", "score": "0.4709085", "text": "function setGradient() {\n\tbody.style.background = \n\t\"linear-gradient(to right, \"\n\t+ color1.value \n\t+ \", \" \n\t+ color2.value \n\t+\")\";\n css.textContent = body.style.background + \";\";\n}", "title": "" }, { "docid": "37f5de40cd48877b35776699f089c77e", "score": "0.46928746", "text": "function grayGradient(plot) {\n var gradient = plot.append(\"defs\")\n .append(\"linearGradient\")\n .attr(\"id\", \"gradient\")\n .attr(\"x1\", \"100%\")\n .attr(\"y1\", \"0%\")\n .attr(\"x2\", \"100%\")\n .attr(\"y2\", \"100%\")\n .attr(\"spreadMethod\", \"pad\");\n \n gradient.append(\"svg:stop\")\n .attr(\"offset\", \"0%\")\n .attr(\"stop-color\", \"silver\")\n .attr(\"stop-opacity\", 1);\n \n gradient.append(\"svg:stop\")\n .attr(\"offset\", \"100%\")\n .attr(\"stop-color\", \"#fff\")\n .attr(\"stop-opacity\", 1);\n }", "title": "" }, { "docid": "a0550af10daa11011dd130c9c1ce9bd4", "score": "0.4662466", "text": "function setGradient() {\n\tvar finalmix = \"linear-gradient(to right, \" \n\t+ color1.value \n\t+ \", \" \n\t+ color2.value \n\t+ \")\";\n\tbody.style.background = finalmix;\n\tcss.textContent = body.style.background + \";\";\n}", "title": "" }, { "docid": "7d198259d5347347b36277167efa8ae1", "score": "0.46619257", "text": "function optimize(ast) {\n\t }", "title": "" }, { "docid": "7d198259d5347347b36277167efa8ae1", "score": "0.46619257", "text": "function optimize(ast) {\n\t }", "title": "" }, { "docid": "96a3b120e24df46fb6bf0dfa3250cfff", "score": "0.4652261", "text": "function drawGradient() {\n var c = document.getElementById(\"gradient\");\n var ctx = c.getContext(\"2d\");\n\n var grd = ctx.createLinearGradient(0, 0, 500, 0);\n grd.addColorStop(0.4, \"blue\");\n grd.addColorStop(0.8, \"red\");\n grd.addColorStop(0.95, \"white\");\n\n ctx.fillStyle = grd;\n ctx.fillRect(0, 0, 500, 20);\n}", "title": "" }, { "docid": "83481bc359dd19f8fde868e07bd1fca5", "score": "0.46494132", "text": "function lerpGrad(color1, color2, lerpAmt) {\n var c = [lerp(color1[0], color2[0], lerpAmt), lerp(color1[1], color2[1], lerpAmt), lerp(color1[1], color2[1], lerpAmt) ];\n return c;\n}", "title": "" }, { "docid": "8b49ef4deddce9faf8fa7ecdf5674f5a", "score": "0.46488956", "text": "function registerGradient(config) {\n var kernelName = config.kernelName;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(\"Overriding the gradient for '\" + kernelName + \"'\");\n }\n }\n gradRegistry.set(kernelName, config);\n}", "title": "" }, { "docid": "8b49ef4deddce9faf8fa7ecdf5674f5a", "score": "0.46488956", "text": "function registerGradient(config) {\n var kernelName = config.kernelName;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (env().getBool('DEBUG')) {\n console.warn(\"Overriding the gradient for '\" + kernelName + \"'\");\n }\n }\n gradRegistry.set(kernelName, config);\n}", "title": "" }, { "docid": "05e4ef710153b13cd60a8940b1f66f85", "score": "0.46480134", "text": "function forOnInput(element) {\n element.style.background =\n 'linear-gradient(to right, #f8b864 0%, #f8b864 ' +\n element.value +\n '%, #b8b8b8 ' +\n element.value +\n '%, #b8b8b8 100%)';\n}", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.46406892", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.46406892", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.46406892", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.46406892", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "b9684e0c8b65b5a4691b9741173cb16b", "score": "0.46362776", "text": "function gl(){return fl.apply(null,arguments)}", "title": "" }, { "docid": "b2475e9f627ffb6fe1a09a8427e1d641", "score": "0.4635646", "text": "CalculateGradient(target = null) {\n if (target === null) {\n const outputSynapsesGradientSum = sum(this.OutputSynapses, synapse => synapse.Weight * synapse.OutputNeuron.Gradient);\n this.Gradient = outputSynapsesGradientSum * Sigmoid.Derivative(this.Value);\n } else {\n this.Gradient = this.CalculateError(target) * Sigmoid.Derivative(this.Value);\n }\n\n return this.Gradient;\n }", "title": "" }, { "docid": "e475946c62cb50054718e1799dacd4ad", "score": "0.46329942", "text": "function G(){r.call(this)}", "title": "" }, { "docid": "ce6647610bf6baf8e8914f3608ae26f0", "score": "0.46328005", "text": "function makeGradientColor(color1, color2, percent) {\n var newColor = {};\n\n function makeChannel(a, b) {\n return(a + Math.round((b-a)*(percent/100)));\n }\n\n function makeColorPiece(num) {\n num = Math.min(num, 255); // not more than 255\n num = Math.max(num, 0); // not less than 0\n var str = num.toString(16);\n if (str.length < 2) {\n str = \"0\" + str;\n }\n return(str);\n }\n\n newColor.r = makeChannel(color1.r, color2.r);\n newColor.g = makeChannel(color1.g, color2.g);\n newColor.b = makeChannel(color1.b, color2.b);\n newColor.cssColor = \"#\" + \n makeColorPiece(newColor.r) + \n makeColorPiece(newColor.g) + \n makeColorPiece(newColor.b);\n return(newColor);\n}", "title": "" }, { "docid": "cdfc29070d71ee6649ef85166e88a7a0", "score": "0.4628058", "text": "function AntigradientLbfgs(problemDimension, historySize)\n {\t\n \tthis.problemDimension = problemDimension;\n \tthis.historySize = (historySize !== undefined) ? historySize : 10;\n \n \t\t// ping-pong indices \n \tthis.ppCurrent = 0;\n \tthis.ppNext = 1;\n \t\n \t\t// history entries\n \tthis.historyS = [];\n \tthis.historyY = [];\n \t\n \tthis.historyA = [];\n \t\t\t\n \tthis.historyInnerProductsSY = [];\n \t\t\n \tfor(var i = 0; i < this.historySize; ++i)\n \t{\n \t\tthis.historyS[i] = new Float64Array(problemDimension);\n \t\tthis.historyY[i] = new Float64Array(problemDimension);\t\t\t\t\t\t\n \t}\n \t\t\n \t\t// argument\n \tthis.X = [];\n \t\n \tthis.X[this.ppNext] = new Float64Array(problemDimension);\n \t\t\n \t\t// goal function value\n \tthis.f = [];\t\n \t\t\t\n \t\t// gradient\n \tthis.Grad = [];\n \n \tthis.Grad[this.ppCurrent] = new Float64Array(problemDimension);\n \tthis.Grad[this.ppNext] = new Float64Array(problemDimension);\n \t\t\n \t\t//\n \tthis.p = new Float64Array(problemDimension);\n \t\t\n \t\t//\n \tthis.epsilon = 0.001;\n \t\n \tthis.reset();\n }", "title": "" }, { "docid": "13f14fb1c8d8a2dcf5ce521b49f65a69", "score": "0.46253845", "text": "function getCSSGradient(skyGradient) {\n //Convert this to a css gradient\n var bgGradient = `linear-gradient(to bottom, ${skyGradient[0]} 0%, ${skyGradient[1]} 25%, ${skyGradient[2]} 50%, ${skyGradient[3]} 75%, ${skyGradient[4]} 100%)`;\n return bgGradient;\n}", "title": "" }, { "docid": "14c7ee40b9a785cf0fc5980825952b15", "score": "0.46247506", "text": "function makeGradientColor(color1, color2, percent) {\n var newColor = {};\n\n function makeChannel(a, b) {\n return (a + Math.round((b - a) * (percent / 100)));\n }\n\n function makeColorPiece(num) {\n num = Math.min(num, 255); // not more than 255\n num = Math.max(num, 0); // not less than 0\n var str = num.toString(16);\n if (str.length < 2) {\n str = \"0\" + str;\n }\n return (str);\n }\n\n newColor.r = makeChannel(color1.r, color2.r);\n newColor.g = makeChannel(color1.g, color2.g);\n newColor.b = makeChannel(color1.b, color2.b);\n newColor.cssColor = \"#\" +\n makeColorPiece(newColor.r) +\n makeColorPiece(newColor.g) +\n makeColorPiece(newColor.b);\n return (newColor);\n}", "title": "" }, { "docid": "4b5e9d090e2dc67b8584119c4b2fcf02", "score": "0.4619984", "text": "function setGradient() {\n body.style.background = `linear-gradient(to right, ${color1.value}, ${color2.value})`;\n css.textContent = `${body.style.background}`;\n}", "title": "" }, { "docid": "8776955bd94f83704b6ae048aa12a477", "score": "0.46191472", "text": "function createGradientColor(){\n //The direction\n let direction = generateDirection();\n\n //Generate the first color\n let fisrtCol = generateColor();\n\n //Generate the first color\n let secondCol = generateColor();\n\n //Create a gradient color object\n let newGradientColor = new GradientColor(direction, fisrtCol, secondCol);\n\n return newGradientColor;\n}", "title": "" }, { "docid": "189ab98e0a1a7c58c01d58c50038492d", "score": "0.46174952", "text": "function registerGradient(config) {\n const {\n kernelName\n } = config;\n\n if (gradRegistry.has(kernelName)) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n\n gradRegistry.set(kernelName, config);\n}", "title": "" }, { "docid": "5bc3c18091331b2ab483440f11871651", "score": "0.46134648", "text": "call(input, kwargs) {\n return tf.tidy(() => {\n return tf.mul(tf.tanh(tf.softplus(input[0])), input[0])\n });\n }", "title": "" }, { "docid": "1a0579d7c5cc89bebc7670b38cce7d3b", "score": "0.46070516", "text": "function gradle(hljs) {\n return {\n name: 'Gradle',\n case_insensitive: true,\n keywords: {\n keyword:\n 'task project allprojects subprojects artifacts buildscript configurations ' +\n 'dependencies repositories sourceSets description delete from into include ' +\n 'exclude source classpath destinationDir includes options sourceCompatibility ' +\n 'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +\n 'def abstract break case catch continue default do else extends final finally ' +\n 'for if implements instanceof native new private protected public return static ' +\n 'switch synchronized throw throws transient try volatile while strictfp package ' +\n 'import false null super this true antlrtask checkstyle codenarc copy boolean ' +\n 'byte char class double float int interface long short void compile runTime ' +\n 'file fileTree abs any append asList asWritable call collect compareTo count ' +\n 'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +\n 'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +\n 'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +\n 'newReader newWriter next plus pop power previous print println push putAt read ' +\n 'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +\n 'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +\n 'withStream withWriter withWriterAppend write writeLine'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE,\n hljs.REGEXP_MODE\n\n ]\n };\n}", "title": "" }, { "docid": "1a0579d7c5cc89bebc7670b38cce7d3b", "score": "0.46070516", "text": "function gradle(hljs) {\n return {\n name: 'Gradle',\n case_insensitive: true,\n keywords: {\n keyword:\n 'task project allprojects subprojects artifacts buildscript configurations ' +\n 'dependencies repositories sourceSets description delete from into include ' +\n 'exclude source classpath destinationDir includes options sourceCompatibility ' +\n 'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +\n 'def abstract break case catch continue default do else extends final finally ' +\n 'for if implements instanceof native new private protected public return static ' +\n 'switch synchronized throw throws transient try volatile while strictfp package ' +\n 'import false null super this true antlrtask checkstyle codenarc copy boolean ' +\n 'byte char class double float int interface long short void compile runTime ' +\n 'file fileTree abs any append asList asWritable call collect compareTo count ' +\n 'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +\n 'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +\n 'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +\n 'newReader newWriter next plus pop power previous print println push putAt read ' +\n 'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +\n 'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +\n 'withStream withWriter withWriterAppend write writeLine'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE,\n hljs.REGEXP_MODE\n\n ]\n };\n}", "title": "" }, { "docid": "88b16d885a09dbb63902b393f1dee38c", "score": "0.46039054", "text": "function sum (f, g) {\n let h = f + g;\n return h\n}", "title": "" }, { "docid": "2ea956a99ea3d0d93d6936b6a6374e32", "score": "0.45985925", "text": "function GradientProperty(elem, data, container) {\r\n this.data = data;\r\n this.c = createTypedArray('uint8c', data.p * 4);\r\n var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p * 4) : data.k.k.length - data.p * 4;\r\n this.o = createTypedArray('float32', cLength);\r\n this._cmdf = false;\r\n this._omdf = false;\r\n this._collapsable = this.checkCollapsable();\r\n this._hasOpacity = cLength;\r\n this.initDynamicPropertyContainer(container);\r\n this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);\r\n this.k = this.prop.k;\r\n this.getValue(true);\r\n}", "title": "" }, { "docid": "f3d3d8bb0ae2307950647b6b374b5cb8", "score": "0.4596033", "text": "function setGradient() {\n body.style.background = \"linear-gradient(to right, \" + color1.value + \",\" + color2.value + \")\";\n css.textContent = body.style.background + \";\"\n}", "title": "" }, { "docid": "b76692ea2441ea414d19593143114e85", "score": "0.4588971", "text": "function sumSpreaded(x,y,z,t){\n return x + y + z + t;\n}", "title": "" }, { "docid": "a2b27dc40dcbcb601c2ef21edd00d096", "score": "0.4587056", "text": "function gradle(hljs) {\n return {\n name: 'Gradle',\n case_insensitive: true,\n keywords: {\n keyword:\n 'task project allprojects subprojects artifacts buildscript configurations ' +\n 'dependencies repositories sourceSets description delete from into include ' +\n 'exclude source classpath destinationDir includes options sourceCompatibility ' +\n 'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +\n 'def abstract break case catch continue default do else extends final finally ' +\n 'for if implements instanceof native new private protected public return static ' +\n 'switch synchronized throw throws transient try volatile while strictfp package ' +\n 'import false null super this true antlrtask checkstyle codenarc copy boolean ' +\n 'byte char class double float int interface long short void compile runTime ' +\n 'file fileTree abs any append asList asWritable call collect compareTo count ' +\n 'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +\n 'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +\n 'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +\n 'newReader newWriter next plus pop power previous print println push putAt read ' +\n 'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +\n 'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +\n 'withStream withWriter withWriterAppend write writeLine'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE,\n hljs.REGEXP_MODE\n\n ]\n }\n}", "title": "" }, { "docid": "a2b27dc40dcbcb601c2ef21edd00d096", "score": "0.4587056", "text": "function gradle(hljs) {\n return {\n name: 'Gradle',\n case_insensitive: true,\n keywords: {\n keyword:\n 'task project allprojects subprojects artifacts buildscript configurations ' +\n 'dependencies repositories sourceSets description delete from into include ' +\n 'exclude source classpath destinationDir includes options sourceCompatibility ' +\n 'targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant ' +\n 'def abstract break case catch continue default do else extends final finally ' +\n 'for if implements instanceof native new private protected public return static ' +\n 'switch synchronized throw throws transient try volatile while strictfp package ' +\n 'import false null super this true antlrtask checkstyle codenarc copy boolean ' +\n 'byte char class double float int interface long short void compile runTime ' +\n 'file fileTree abs any append asList asWritable call collect compareTo count ' +\n 'div dump each eachByte eachFile eachLine every find findAll flatten getAt ' +\n 'getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods ' +\n 'isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter ' +\n 'newReader newWriter next plus pop power previous print println push putAt read ' +\n 'readBytes readLines reverse reverseEach round size sort splitEachLine step subMap ' +\n 'times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader ' +\n 'withStream withWriter withWriterAppend write writeLine'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE,\n hljs.REGEXP_MODE\n\n ]\n }\n}", "title": "" }, { "docid": "b6362b1117748e513639e964bc20c574", "score": "0.4580509", "text": "function setGradient()\n{\n body1.style.background=`linear-gradient(to right,${color1.value},${color2.value})`;\n css.textContent = body1.style.background;\n}", "title": "" }, { "docid": "ab3c8acaeceb1e5bfb127c0f223af0a7", "score": "0.45718703", "text": "static DecomposeLerpToRef(startValue, endValue, gradient, result) {\n var startScale = MathTmp.Vector3[0];\n var startRotation = MathTmp.Quaternion[0];\n var startTranslation = MathTmp.Vector3[1];\n startValue.decompose(startScale, startRotation, startTranslation);\n var endScale = MathTmp.Vector3[2];\n var endRotation = MathTmp.Quaternion[1];\n var endTranslation = MathTmp.Vector3[3];\n endValue.decompose(endScale, endRotation, endTranslation);\n var resultScale = MathTmp.Vector3[4];\n Vector3.LerpToRef(startScale, endScale, gradient, resultScale);\n var resultRotation = MathTmp.Quaternion[2];\n Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);\n var resultTranslation = MathTmp.Vector3[5];\n Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation);\n Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result);\n }", "title": "" }, { "docid": "e8b12ef121980a8468411d4ff68c9f3b", "score": "0.4571175", "text": "colorGradient(xLoc) {\n let temp = map(xLoc, width, 0, 0, 255);\n if (colorScheme == \"Red\") {\n return color(255, temp, temp);\n } else if (colorScheme == \"Green\") {\n return color(temp, 255, temp);\n } else { //assumes blue\n return color(temp, temp, 255);\n }\n return -1;\n }", "title": "" }, { "docid": "e67bcbd8118d05d58a3433f8c6d95bc4", "score": "0.4565686", "text": "function gradients(lossFn, variables) {\n // TODO(cais): The return type signature can be simplified if deeplearn makes\n // the corresponding type public.\n const variableList = variables.map(variable => variable.read());\n const valudAndGrads = (0, tfc.variableGrads)(lossFn, variableList);\n return variables.map(variable => valudAndGrads.grads[variable.name]);\n}", "title": "" }, { "docid": "5728297aa77b79fec3e0ce891514ad2c", "score": "0.45576894", "text": "buildLinearGradient() {\n const defaultSize = _FillGradient.defaultTextureSize;\n const { gradientStops } = this;\n const canvas = settings.ADAPTER.createCanvas();\n canvas.width = defaultSize;\n canvas.height = defaultSize;\n const ctx = canvas.getContext(\"2d\");\n const gradient = ctx.createLinearGradient(0, 0, _FillGradient.defaultTextureSize, 1);\n for (let i = 0; i < gradientStops.length; i++) {\n const stop = gradientStops[i];\n gradient.addColorStop(stop.offset, stop.color);\n }\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, defaultSize, defaultSize);\n this.texture = new Texture({\n source: new ImageSource({\n resource: canvas\n }),\n style: {\n addressModeU: \"clamp-to-edge\",\n addressModeV: \"repeat\"\n }\n });\n const { x0, y0, x1, y1 } = this;\n const m = new Matrix();\n const dx = x1 - x0;\n const dy = y1 - y0;\n const dist = Math.sqrt(dx * dx + dy * dy);\n const angle = Math.atan2(dy, dx);\n m.translate(-x0, -y0);\n m.scale(1 / defaultSize, 1 / defaultSize);\n m.rotate(-angle);\n m.scale(256 / dist, 1);\n this.transform = m;\n }", "title": "" }, { "docid": "d7dce630996cb8dec937d1e1878773ff", "score": "0.4556689", "text": "function jxBrush(color, fillType) {\n\n //Public Properties\n this.color = null; //color proprty of jxColor type\n this.fillType = null; //fillType property 'solid','lin_grad'='linear_gradient',proposed:'rad_grad'='radial_gradiant' or 'pattern'\n this.color2 = null; //second color for gradient fill type\n this.angle = null;\n\n //Construction of the object\n if (color)\n this.color = color;\n else\n this.color = new jxColor('#000000'); //Default black color\n\n if (fillType)\n this.fillType = fillType;\n else\n this.fillType = 'solid'; //Default fillType other values 'linear-gradient'='lin-grad' (more to come)\n\n //Set rest of defaults\n this.color2 = new jxColor('#FFFFFF'); //Default color2\n\n //Internal utility functions\n //Update the svg to apply brush settings\n this.updateSVG = updateSVG;\n function updateSVG(_svgvmlObj, defs) {\n var fillId = null, oldChild;\n fillId = _svgvmlObj.getAttribute('fill');\n if (fillId) {\n if (fillId.substr(0, 5) == 'url(#') {\n fillId = fillId.substr(5, fillId.length - 6);\n oldChild = document.getElementById(fillId);\n }\n else\n fillId = null;\n }\n\n if (this.fillType == 'linear-gradient' || this.fillType == 'lin-grad') {\n var linearGradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');\n if (fillId)\n defs.replaceChild(linearGradient, oldChild);\n else\n defs.appendChild(linearGradient);\n var stop1 = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n linearGradient.appendChild(stop1);\n var stop2 = document.createElementNS('http://www.w3.org/2000/svg', 'stop');\n linearGradient.appendChild(stop2);\n jsDraw2DX._RefID++;\n linearGradient.setAttribute('id', 'jsDraw2DX_RefID_' + jsDraw2DX._RefID);\n if (this.angle != null)\n linearGradient.setAttribute('gradientTransform', 'rotate(' + this.angle + ' 0.5 0.5)');\n else\n linearGradient.setAttribute('gradientTransform', 'rotate(0 0.5 0.5)');\n stop1.setAttribute('offset', '0%');\n stop1.setAttribute('style', 'stop-color:' + this.color.getValue() + ';stop-opacity:1');\n stop2.setAttribute('offset', '100%');\n stop2.setAttribute('style', 'stop-color:' + this.color2.getValue() + ';stop-opacity:1');\n linearGradient.appendChild(stop1);\n linearGradient.appendChild(stop2);\n _svgvmlObj.setAttribute('fill', 'url(#' + 'jsDraw2DX_RefID_' + jsDraw2DX._RefID + ')');\n }\n else\n _svgvmlObj.setAttribute('fill', this.color.getValue());\n }\n\n //Update the vml to apply brush settings\n this.updateVML = updateVML;\n function updateVML(vmlFill) {\n vmlFill.On = 'true';\n if (this.fillType == 'solid') {\n vmlFill.Type = 'solid';\n vmlFill.Color = this.color.getValue();\n vmlFill.Color2 = '';\n vmlFill.Angle = 270;\n }\n else {\n vmlFill.Type = 'gradient';\n if (this.angle != null)\n vmlFill.Angle = 270 - this.angle;\n else\n vmlFill.Angle = 270;\n vmlFill.Color = this.color.getValue();\n vmlFill.Color2 = this.color2.getValue();\n }\n }\n\n //Public Methods\n this.getType = getType;\n function getType() {\n return 'jxBrush';\n }\n}", "title": "" }, { "docid": "b5c8ac3c78d10998a5b9fbc846b89a44", "score": "0.45540366", "text": "function colourGradient(id)\n{\n rgb = interpolated[sorted.indexOf(id)];\n return rgbToHex(rgb[0], rgb[1], rgb[2]);\n}", "title": "" }, { "docid": "d6875aaf8f06ee40fed396bab02bf9a4", "score": "0.45540196", "text": "function registerGradient(config) {\n const { kernelName } = config;\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[/* env */ \"c\"])().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n gradRegistry.set(kernelName, config);\n}", "title": "" }, { "docid": "7a801c2654462002297d4409bfee4658", "score": "0.454983", "text": "function registerGradient(config) {\n const {\n kernelName\n } = config;\n\n if (gradRegistry.has(kernelName)) {\n // TODO (yassogba) after 3.0 assess whether we need to keep this gated\n // to debug mode.\n if (Object(_environment__WEBPACK_IMPORTED_MODULE_0__[/* env */ \"c\"])().getBool('DEBUG')) {\n console.warn(`Overriding the gradient for '${kernelName}'`);\n }\n }\n\n gradRegistry.set(kernelName, config);\n}", "title": "" }, { "docid": "1c70669c52e1c9f3520922c76b8f2fe2", "score": "0.45491868", "text": "function dg(a,b){this.Nd=a;this.Ag=b;eg(this);var c=fg(this)[0];this.Cb=c[1];dg.$.constructor.call(this,c[0])}", "title": "" }, { "docid": "a86dce2494796415cf9429eb2cd1bd66", "score": "0.4548936", "text": "function SetParams(){\r\n check = 0;\r\n checkGrad = 0;\r\n NewText = \"\";\r\n gradTemplate = \"\"; \r\n}", "title": "" } ]
8b47e870a209e2d722ec27d9feef7207
Set the status text in a response:
[ { "docid": "f47e6a0bcaad5a67d1713fafffc0656b", "score": "0.6984417", "text": "function setStatusText(options) {\n try {\n var statusCode = STATUS_CODE_INFO[options.status];\n options['statusText'] = statusCode ? statusCode.text : 'Unknown Status';\n return options;\n }\n catch (err) {\n return new _angular_http.ResponseOptions({\n status: STATUS.INTERNAL_SERVER_ERROR,\n statusText: 'Invalid Server Operation'\n });\n }\n}", "title": "" } ]
[ { "docid": "f310746b86249e0a4884c7bb1d14f704", "score": "0.7775643", "text": "function setStatus(text) {\n\t\tstatus.innerHTML = String(text)\n\t}", "title": "" }, { "docid": "1f2a3f133937119700923ac8eb9f1043", "score": "0.7737997", "text": "_setStatusText (text) {\n\t\tthis.$status.innerText = text;\n\t}", "title": "" }, { "docid": "fbe63a5682bb33bacb53b94e00a3ef74", "score": "0.70125633", "text": "function quickRespose(res, status) {\n res.statusCode = status;\n res.setHeader('Content-Type', 'text/plain');\n res.end(http.STATUS_CODES[res.statusCode]);\n}", "title": "" }, { "docid": "0c174526bb56250c0dcb3ad85f76853b", "score": "0.6895628", "text": "function setStatus(text) {\n document.getElementById('status').innerHTML = text;\n}", "title": "" }, { "docid": "7101b53a8d75479186ba5f7f9d82d9e2", "score": "0.67411256", "text": "function setStatusText(message) {\n chrome.extension.sendRequest({kind: 'setStatusText', message: message});\n}", "title": "" }, { "docid": "4fc127ae41c37651375e23e11aaf2092", "score": "0.6449838", "text": "function setStatus(status) {\n $('#status').html(status);\n}", "title": "" }, { "docid": "f38b0e4f32bb48badb37771212f709d2", "score": "0.6445403", "text": "function setStatusLabel(text, className) {\n statusLabel.className = className;\n statusLabel.innerHTML = text;\n}", "title": "" }, { "docid": "195079ddcc3ab40bbc4891db80fb99b5", "score": "0.642934", "text": "function respondSimpleMessage(res, message) {\n res.render('simpleStatus', { \n pageTitle: message,\n status: message,\n bodyID: 'body_simplestatus',\n mainTitle: message\n });\n}", "title": "" }, { "docid": "a1cf994a5a2443f5521cefbc08609eb7", "score": "0.64218515", "text": "function getStatusText(code)\n{\n sText = \"\";\n if(code !== undefined)\n {\n switch(code)\n {\n case 200:{ sText = 'Success';break;}\n case 404:{ sText = 'Error';break;}\n case 403:{ sText = 'Error';break;}\n case 500:{ sText = 'Error';break;}\n default:{sText = 'Error';}\n \n }\n }\n return sText;\n}", "title": "" }, { "docid": "9ee843d37ce73fda5c8b5572a8c7653e", "score": "0.6394692", "text": "function renderStatus(statusText) {\n document.getElementById('main-view').textContent = statusText;\n}", "title": "" }, { "docid": "4245faf17aa95ddd434e38a1ee50ef7c", "score": "0.63623357", "text": "function setStatus(string) {\n status.html(string).style('opacity', 1)\n\n if (string) {\n loader.transition().duration(10).style('opacity', 0)\n }\n }", "title": "" }, { "docid": "dbff1339725957fbd7529669fd2682fe", "score": "0.6348453", "text": "function updateStatusBar(text) {\n $('#status-bar').html(text);\n}", "title": "" }, { "docid": "a4562bd9af3a02f0ef03f9e3d6f0c3fd", "score": "0.63383394", "text": "function assignStatusResponse(statusResponse) {\n $(\"#divStatus\").show(function () {\n $(\"#lblResponseCode\").html(statusResponse.responseCode);\n $(\"#lblResponseText\").html(statusResponse.responseText);\n $(\"#lblPinPadVersion\").html(statusResponse.pinPadVersion);\n $(\"#lblPinPadSerialNumber\").html(statusResponse.pinPadSerialNumber);\n });\n }", "title": "" }, { "docid": "bcbeb1ce4e47352572799adf47cd23e5", "score": "0.6320176", "text": "getStatusText() {\n return this.response.statusText;\n }", "title": "" }, { "docid": "20d322659c6df0bf530842539fcdbd5a", "score": "0.630492", "text": "function message_response(message, statusNumber, res) {\n if(!statusNumber) statusNumber = 200;\n write_response({message: message}, statusNumber, res);\n}", "title": "" }, { "docid": "82dad72670835f7802558d7b66ebe187", "score": "0.6291733", "text": "setStatus(status) {\n this.status = status;\n }", "title": "" }, { "docid": "3f7c4b00697b8bee504437e975289aa2", "score": "0.6279569", "text": "function setStatus(string) {\n status.html(string);\n if (string && !isLoading) {\n loader.transition().style('opacity', 0);\n details.selectAll('td').transition().style('opacity', 0);\n gEnter.transition().style('opacity', 0);\n pointer.transition()\n .attr('transform', 'translate(' +\n (width + margin.left) + ', ' +\n height + ')')\n .style({fill: '#aaa'});\n }\n }", "title": "" }, { "docid": "7719dc4aa95ee0ca2194ba0487b420b7", "score": "0.6261017", "text": "setErrMsg(event, status, res) {\n let _this = event.data;\n let extra = '';\n if (status === 502) {\n extra = 'bad server response retrieving web table. likely uncaught error on server side. check logs.';\n }\n let msg = `Status ${status} - ${res.statusText}: ${extra}`;\n _this.updateMsg(msg);\n }", "title": "" }, { "docid": "519165e87b1a75d8b738f53b497b98bb", "score": "0.6236769", "text": "function setStatus(s) {\n\t\t$msgStatus.text(s);\n\n\t\tif (s !== statusDefault) {\n\t\t\tvar delay = setTimeout(function () {\n\t\t\t\tsetStatus(statusDefault);\n\t\t\t}, 1000);\n\t\t}\n\t}", "title": "" }, { "docid": "650990f856079bdc43d0b3dbfabbbf1b", "score": "0.623669", "text": "set status(status) {\n\t\tthis._status = new Code(status);\n\t}", "title": "" }, { "docid": "650990f856079bdc43d0b3dbfabbbf1b", "score": "0.623669", "text": "set status(status) {\n\t\tthis._status = new Code(status);\n\t}", "title": "" }, { "docid": "be2a96bf1d048cd7b55671cdbc6466f9", "score": "0.62223357", "text": "function update_status(message) {\n $('#status-message').text(message);\n}", "title": "" }, { "docid": "220e3073864131ed1e1e8a84ff55e711", "score": "0.6216813", "text": "get statusMessage() {\n return this.response.statusMessage;\n }", "title": "" }, { "docid": "06829b582ca1fb919c2a902b15c845b8", "score": "0.6189479", "text": "function setHeader(text, header, value){\n\n return text.setResponseHeader(header, value);\n\n}", "title": "" }, { "docid": "12b08fb5719f82c6ab5cb81b037ea8ed", "score": "0.6144828", "text": "function sendResponse(status, message) {\n\t\t\t\tvar jsonMessage = JSON.stringify(message);\n\t\t\t\t//utils.info('sending response! ' + jsonMessage);\n\t\t\t\tresponse.writeHead(status,\n\t\t\t\t\t{\n\t\t\t\t\t\t'Content-Length': Buffer.byteLength(jsonMessage),\n\t\t\t\t\t\t'Content-Type': 'text/plain'\n\t\t\t\t\t});\n\t\t\t\tresponse.end(jsonMessage);\n\t\t\t}", "title": "" }, { "docid": "e42a1d3b25483a96184d0188ecea3357", "score": "0.6123292", "text": "function setStatus(s) {\n status = s;\n $('#status').text(s);\n if (s != 'open') $('#tlc').val('none');\n}", "title": "" }, { "docid": "eee0c786b52bca77a79275c2ee915601", "score": "0.60937303", "text": "function setStatus (theStatus, theObj){\r\n\t\tobj = document.getElementById(theObj);\r\n\t\tif (obj){\r\n\t\t\tobj.innerHTML = \"<div class=\\\"bold\\\">\" + theStatus + \"</div>\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6577e2b9f43855e98ba3fc73183156e1", "score": "0.60822934", "text": "function StatusCode (status) {\n Object.defineProperty(this, 'status', {\n value: status\n , writable: false\n , enumerable: true\n });\n}", "title": "" }, { "docid": "8c9e0eacce8bd9723af1c46c2f6a1d79", "score": "0.6080948", "text": "function showStatus(response) {\n\tvar status = document.getElementById('status');\n\tstatus.innerHTML = response.error;\n}", "title": "" }, { "docid": "f5ef44aad4343054295ddb9d9ad60bab", "score": "0.6073338", "text": "function updateStatus(text) {\r\n\t// For title, strip tags of text.\r\n\tdocument.title = text.replace(/(<([^>]+)>)/ig,\"\") + \" | \" + pageTitle;\r\n\tif(header) header.innerHTML = '<div id=\"app377144924760_status\" style=\"width: 175px;\"><span style=\"background: #ffffff; border: 1px solid; padding: 1px; color: #999999; left: 571px; position: absolute; top: -1px; width: 161px; text-align: center;\"><b>[<a href=\"http://userscripts.org/scripts/show/80811\" target=\"_blank\" style=\"color: #666666; text-decoration: none;\">AutoPlayer</a> v' + _LLAPversion + ']</b><br />' + text + '</span></div>' + headerHTML;\r\n}", "title": "" }, { "docid": "1cb9ae839303a6aa51c156cea8f80f5d", "score": "0.60326254", "text": "function setStatus(message)\n\t{\n\t\t$(\"#app>footer\").text(message);\n\t}", "title": "" }, { "docid": "3e299f7504104a6e1bed4cbb72de4c74", "score": "0.6019273", "text": "function setWinLabelStatus(status) {\n\n let winModal = document.getElementById('wind_modal');\n document.getElementById('inner-text').innerText = status !== 'pareggio' ?\n `Woohoo! \\r\\n ${status} vince il turno` :\n 'Pareggio';\n winModal.style.display = 'flex';\n }", "title": "" }, { "docid": "5cee1909dba874be52e36535e71b97e9", "score": "0.6011657", "text": "function setStatus(message)\r\n\t{\r\n\t\t$(\"#app>footer\").text(message);\r\n\t}", "title": "" }, { "docid": "dc9e7b3e1dc0525cfd172391a4565408", "score": "0.60105455", "text": "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "title": "" }, { "docid": "00482f813ec27b4dd1e1c75fa31b9b34", "score": "0.60050356", "text": "static sendResponse(response, status, msgCode, message, data) {\n if (message && message instanceof Error && message.constructor) {\n message.type = message.constructor.name;\n }\n if (status !== 200) {\n Log.warning(message);\n }\n Http.response(response, status, msgCode, message, data);\n }", "title": "" }, { "docid": "08574abcb136604aa9b8b6d15f3f5858", "score": "0.6001652", "text": "function setStatus(str) {\n var $status = $(\"#status\");\n $status.fadeOut(\"fast\", function () {\n $status.html(str);\n $status.fadeIn(\"fast\");\n });\n }", "title": "" }, { "docid": "067b1c92c6243d39366ad630d02c454b", "score": "0.5981586", "text": "function updateStatus(status) {\n $(\"#status\").text(status);\n}", "title": "" }, { "docid": "2c78ebc5be464f498d218470d6cd6ced", "score": "0.59744215", "text": "function setStatus(x,y){\n status.text(\"\"); // Clear current status message\n status.text(x); // Set new status string\n var sa = $(\"#stat-area\"); // Status container\n if(y == 0){ // Status only (not an error)\n sa.removeClass(\"red\");\n sa.removeClass(\"grn\");\n sic.removeClass(\"fa-exclamation-circle\");\n sic.removeClass(\"fa-check-circle\");\n status.removeClass(\"err\"); // Remove past error class\n } else if(y == 1){ // Error code\n status.addClass(\"err\"); // Add error class\n sa.addClass(\"red\");\n sa.removeClass(\"grn\");\n sic.addClass(\"fa-exclamation-circle\");\n sic.removeClass(\"fa-check-circle\");\n } else if(y == 2){ // Good status (success)\n sa.removeClass(\"red\")\n sa.addClass(\"grn\");\n sic.removeClass(\"fa-exclamation-circle\");\n status.removeClass(\"err\");\n sic.addClass(\"fa-check-circle\");\n }\n}", "title": "" }, { "docid": "428c4002f7f97a96b6657cf0c049e324", "score": "0.59647936", "text": "SendResponse(statusCodeNum = 404, textString = '', jsonObj = {}){\n //Set up headers\n let contentTypeString = '';\n let responsePayloadString = '';\n if(Object.keys(jsonObj).length !== 0){\n contentTypeString = 'application/json';\n responsePayloadString = JSON.stringify(jsonObj);\n }\n else{\n contentTypeString = 'text/html';\n responsePayloadString = textString;\n }\n \n //Send response\n this.Resp.setHeader('Content-Type', contentTypeString);\n this.Resp.writeHead(statusCodeNum);\n this.Resp.end(responsePayloadString);\n\n }", "title": "" }, { "docid": "bb6f74f9aff96c335d1c10ea63f9305f", "score": "0.59502214", "text": "statusText(status) {\n switch(status) {\n case 2:\n return \"Approved\";\n case 1:\n return \"Pending\"; \n case 3:\n return \"Rejected\";\n default:\n return \"Pending\";\n }\n }", "title": "" }, { "docid": "058f2bf2be412ea64011ddda35c3f605", "score": "0.59464777", "text": "setStatus(statusText, hasError) {\n this.controlOptions.chartStatus = statusText;\n this.controlOptions.hasError = hasError;\n this._showStatus();\n }", "title": "" }, { "docid": "ef1040148711f3226672422ecd06ef13", "score": "0.5922336", "text": "function renderStatus (value, p, r) {\n var statusId = r.get('statusId');\n if(statusId == 1)\n return '<span class=\\'successBox font10\\' >#{msgs.success}</span>';\n else if(statusId == 2)\n return Ext.String.format('<span class=\\'warnBox font10\\' >#{msgs.warning}</span>',value);\n else if(statusId == 0)\n return Ext.String.format('<span class=\\'failBox font10\\' >#{msgs.fail}</span>',value); \n else\n return Ext.String.format('{0}', value === null ? '#{msgs.task_result_pending}' : value);\n}", "title": "" }, { "docid": "4e3d37dc3e71f83b7161b179b09ed8e1", "score": "0.591872", "text": "function updateCallStatus(status) {\n $_this(\"#call-status\").html(status);\n}", "title": "" }, { "docid": "219d9b5f60c25b67b8498eed0928780c", "score": "0.5916831", "text": "function updateStatus(msg) {\n\t$('#status').text(msg);\n}", "title": "" }, { "docid": "45c083b52308c001672ef6a7cc37b4f0", "score": "0.58913493", "text": "showMessageStatus(color, message) {\n $(\"#request-status\").css(\"color\", color);\n $(\"#request-status\").html(message);\n }", "title": "" }, { "docid": "5dd03c98f92f9df132a915fce7ad6e0e", "score": "0.5886386", "text": "function SetStatusChanged( status ) {\n\t $(\"#loadingtext\").hide().text(status).fadeIn(300);\n}", "title": "" }, { "docid": "dd1828d375a0c9ff0b1cb8d77baecb4c", "score": "0.5878636", "text": "function sendCode(code,response,message) {\n response.status(code);\n response.send(message);\n}", "title": "" }, { "docid": "d0e7af040cf5edcdd13994ebfd3c9f10", "score": "0.5863918", "text": "function setStatus(prefix, status) {\n var statusField = $(\"#status\");\n statusField.text(prefix + \": \" +status).removeClass();\n if (status == \"REGISTERED\" || status == \"ESTABLISHED\") {\n statusField.attr(\"class\",\"text-success\");\n } else if (status == \"DISCONNECTED\" || status == \"FINISH\") {\n statusField.attr(\"class\",\"text-muted\");\n } else if (status == \"FAILED\") {\n statusField.attr(\"class\",\"text-danger\");\n } else if (status == \"TRYING\" || status == \"RING\") {\n statusField.attr(\"class\",\"text-primary\");\n }\n}", "title": "" }, { "docid": "fd029a680f61272a1f646037a3e452e5", "score": "0.5860913", "text": "function update_status(status){\n\t$('#status').html(status);\n}", "title": "" }, { "docid": "8d24739cde32e82fe33aacd8c0de8b81", "score": "0.5857884", "text": "function fail(response, code, message) {\n let hdrs = { 'Content-Type': 'text/plain' };\n response.writeHead(code, hdrs);\n response.write(message);\n response.end();\n}", "title": "" }, { "docid": "96b807428a96f028db8cc6b0725d8f4a", "score": "0.58535886", "text": "function updateTextStatus(elm, req)\n {\n var sts ;\n try\n {\n sts = getWbStatus(req) ;\n }\n catch( e )\n {\n sts = null ;\n logError(\"getWbStatus: \", e) ;\n }\n logDebug(\"updateTextStatus (callback): elm: \", elm, \n \", req: \", req, \", pref: \", elm.pref, \", sts: \", sts) ;\n if ( sts != null )\n {\n elm.className = \"textPresent\" ;\n setElementText(elm, elm.pref+sts[2]+elm.post) ;\n }\n else\n {\n elm.className = \"textAbsent\" ;\n setElementText(elm, elm.pref+\"???\"+elm.post) ;\n }\n return req ; // Return request to next in callback chain\n }", "title": "" }, { "docid": "0384ca9f916fbc6ef3fe9499a5829e17", "score": "0.5818261", "text": "setStatus(status)\n\t{\n\t\tconst response = {\n\t\t\torigin: \"ServerManager.setStatus\",\n\t\t\tcontext: \"when changing the status of the server manager to: \" + util.toString(status),\n\t\t};\n\n\t\t// check status:\n\t\tconst statusKey = (typeof status === \"symbol\") ? Symbol.keyFor(status) : null;\n\t\tif (!statusKey)\n\t\t{ // throw { ...response, error: 'status must be a symbol' };\n\t\t\tthrow Object.assign(response, { error: \"status must be a symbol\" });\n\t\t}\n\t\tif (!ServerManager.Status.hasOwnProperty(statusKey))\n\t\t{ // throw { ...response, error: 'unknown status' };\n\t\t\tthrow Object.assign(response, { error: \"unknown status\" });\n\t\t}\n\n\t\tthis._status = status;\n\n\t\t// inform status listeners:\n\t\tthis.emit(ServerManager.Event.STATUS, this._status);\n\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "14d73cd404e54edc42e6672a3d91cfd0", "score": "0.58133614", "text": "function updateStatus(status) {\n subscriptionStatus.textContent = status;\n}", "title": "" }, { "docid": "9ecde51066851cee033b2dee77e05172", "score": "0.58132493", "text": "function setStatus(status) {\n var statusField = $(\"#status\");\n statusField.text(status).removeClass();\n if (status == \"PUBLISHING\") {\n statusField.attr(\"class\",\"text-success\");\n } else if (status == \"DISCONNECTED\" || status == \"ESTABLISHED\" || status == \"UNPUBLISHED\") {\n statusField.attr(\"class\",\"text-muted\");\n } else if (status == \"FAILED\") {\n statusField.attr(\"class\",\"text-danger\");\n }\n}", "title": "" }, { "docid": "4eb3e2fb9eff80ab23b79779828e6641", "score": "0.58130413", "text": "static SendResponse (res, data, options = {}) {\n \n // Overwrite:\n // Save a new object status.\n // Use:\n // Object.Assign will create a new object from the Target to a Source\n options = Object.assign(Responses.Status(), options);\n\n console.log(\"Options:\", options);\n\n // Get:\n // Data and parse it to a String.\n const response = JSON.stringify(data);\n // console.log(\"String data: \", typeof(response));\n \n // Use:\n // WriteHead(statusCode,[StatusMessage]) sends response to Header.\n // res.writeHead(options[\"Status-Code\"], options);\n res.end(response);\n }", "title": "" }, { "docid": "4f04ae1e4f153a859ebecd8c1ae77d04", "score": "0.58110654", "text": "function responseText(req,res){\n res.setHeader('Content-Type',\"text/plain\");\n res.end(\"this is plain text\")\n}", "title": "" }, { "docid": "ff7668e651a2850a3aca4a6a71485192", "score": "0.580462", "text": "function setNonStatusText() {\n sendUpdate(\"setNonStatusText\", {\n trackerDescription: tr(\"tracker.know_the_status_of_your\"),\n patentText: tr(\"tracker.patent_pending\"),\n num1: tr(\"general.stage1\"),\n num2: tr(\"general.stage2\"),\n num3: tr(\"general.stage3\"),\n num4: tr(\"general.stage4\"),\n num5: tr(\"general.stage5\"),\n trackerHeader: jsDPZ.util.htmlUnEncode(tr(\"confirmation.dominos_tracker\"))\n });\n }", "title": "" }, { "docid": "2470a3383f848136d11bc595f627daee", "score": "0.5799799", "text": "getText (code) {\n try {\n return statuses.getStatusText(code)\n } catch (e) {\n return 'Unknown Status Code'\n }\n }", "title": "" }, { "docid": "2470a3383f848136d11bc595f627daee", "score": "0.5799799", "text": "getText (code) {\n try {\n return statuses.getStatusText(code)\n } catch (e) {\n return 'Unknown Status Code'\n }\n }", "title": "" }, { "docid": "04cdc1c6f27258a45e1bf7a1986c1e9d", "score": "0.57965916", "text": "function setResponseError(resp, err, errcode){\n if (!errcode){\n errcode = \"err_unknown\"\n }\n resp.success = false\n resp.message = err\n resp.errorcode = errcode\n}", "title": "" }, { "docid": "2c5cc7a25b556109710359ad612dac7d", "score": "0.57900405", "text": "function showResponse(req, res, body, code) {\n //console.log(JSON.stringify(m.headers));\n res.writeHead(code,m.headers);\n res.end(body);\n }", "title": "" }, { "docid": "2b27ae84fcdfc039cc9d93f7a37c9142", "score": "0.57835406", "text": "function setStatus(event, status)\r\n\t{\r\n\t\t// Validation\r\n\t\tif (typeof status !== 'object' && typeof status !== 'string')\r\n\t\t\treturn;\r\n\r\n\t\tif (typeof status === 'string')\r\n\t\t\tvar msg = status;\r\n\r\n\t\telse if (status.act && status.act === 'clear')\r\n\t\t\tmsg = '';\r\n\t\telse if (status.act && status.act === 'loading')\r\n\t\t\tmsg = 'LOADING...';\r\n\r\n\t\t// Hurray for multiple anonymous functions. This is a mess!\r\n\t\t// Sometimes setStatus is called asynchronously, sometimes synchronously.\r\n\t\t// When called async., we need to use $apply. When sync., we can't use $apply (throws inprog error).\r\n\t\t// Force async mode with setTimeout, then use $apply because we have to in async mode.\r\n\t\tsetTimeout(function() {\r\n\t\t\t$scope.$apply(function() {\r\n\t\t\t\tself.status = msg;\r\n\t\t\t});\r\n\t\t}, 0);\r\n\t}", "title": "" }, { "docid": "24bfd58f90308259d9e7a72d62c6ef84", "score": "0.5768786", "text": "function updateStatus(opt_message) {\n if (opt_message)\n statusText = opt_message;\n var statusField = document.getElementById('status_field');\n if (statusField) {\n statusField.innerHTML = statusText;\n }\n}", "title": "" }, { "docid": "400d9721ce81d7495fb629e03e625a62", "score": "0.57320845", "text": "function setStatus(selector, status) {\n var statusField = $(selector);\n statusField.text(status).removeClass();\n if (status == \"REGISTERED\" || status == \"ESTABLISHED\") {\n statusField.attr(\"class\", \"text-success\");\n } else if (status == \"DISCONNECTED\" || status == \"FINISH\") {\n statusField.attr(\"class\", \"text-muted\");\n } else if (status == \"FAILED\") {\n statusField.attr(\"class\", \"text-danger\");\n } else if (status == \"TRYING\" || status == \"RING\") {\n statusField.attr(\"class\", \"text-primary\");\n }\n}", "title": "" }, { "docid": "ccf5a054d89a824cc753dddc87c44e53", "score": "0.5723246", "text": "function setStatus(args) {\n console.log(\"setStatus : \" + args)\n}", "title": "" }, { "docid": "31d7737e407bdfef12cbf75c11d0f24b", "score": "0.57182646", "text": "function HandleStatus(data, response)\n{\n $('#connectionStatus').html(\"GOOD AJAX REQUEST!\");\n}", "title": "" }, { "docid": "c93af32b505fbad8e1cbed2f9955b5cc", "score": "0.5715396", "text": "function setError(text) {\n\t$(\"#errorStatus\")\n\t\t.show()\n\t\t.text(text)\n\t\t.css(\"background-color\",\"red\");\n}", "title": "" }, { "docid": "9194f864b9a8e57e4a5c3cb525be6d1d", "score": "0.5708724", "text": "function statusInf() {\r\n window.status = 'Mensaajeeeeeeeeeeee';\r\n}", "title": "" }, { "docid": "dbcc955839a6e1e2476b851987890423", "score": "0.5702457", "text": "function statusUpdate(status) {\n var statusTxt = 'You have won $ ' + status + '!';\n $('#status-winningRound p').text(statusTxt);\n}", "title": "" }, { "docid": "79c602f6db27026bb7b6e0b1620f1dc6", "score": "0.56889087", "text": "function showResponse(req, res, body, code) {\n //console.log(JSON.stringify(m.headers));\n res.writeHead(code,m.headers);\n res.end(body);\n}", "title": "" }, { "docid": "89fc8a643007ac7f56e8205141a24b89", "score": "0.56784743", "text": "function updateLabel(msg) {\n $(\"#status_label\").text(msg);\n }", "title": "" }, { "docid": "07f3b19f65da0b86358c16bdaddbe471", "score": "0.56709766", "text": "function setStatus(text) {\n $.toaster({ message: text, priority: 'info' });\n}", "title": "" }, { "docid": "034a37a7b6061513e019b01a0d276989", "score": "0.5669662", "text": "function update_status(text){\n\n setTimeout(function(){\n $('#status').css(\"opacity\",0);\n $('#status').html(text);\n $('#status').css(\"opacity\",1);\n }, 2000);\n \n \n}", "title": "" }, { "docid": "94e760c1a2e0afa9f2ee3b9b5dfe4299", "score": "0.56406045", "text": "constructor(status, code = 10000, message = '') {\n super(message);\n this.code = code;\n this.status = status;\n }", "title": "" }, { "docid": "8fa7c84576dc7e0fc54c6f0473b43b23", "score": "0.5628458", "text": "function Ustatus(msg)\n{\n window.status = msg;\n}", "title": "" }, { "docid": "0a41bacc14ddee93a9a0a4f98521aa23", "score": "0.56232935", "text": "function setStatusMessage(message) {\n $('#btnGetUsersWanting').html(message);\n}", "title": "" }, { "docid": "12e8c0425eb659a2178c1ee40d58e03a", "score": "0.56167775", "text": "function sendCallback(code, message) {\n status.code = code;\n status.message = message;\n status.redirect = true;\n}", "title": "" }, { "docid": "df0734c525c306265774b8b380fb3b6b", "score": "0.5616478", "text": "function handleError(res, status, msg) {\r\n res.writeHead(status, { 'Content-Type': 'text/html' });\r\n res.write(`<h2>${msg}</h2>`);\r\n res.end();\r\n}", "title": "" }, { "docid": "8c230663987c0eea8926ac28cbb565a5", "score": "0.55975413", "text": "static SendResponseMessage(\n res,\n text,\n {\n in_channel = false,\n markdown = false,\n statusCode = 200,\n } = {}\n )\n {\n const response_type = in_channel ? 'in_channel' : 'ephemeral';\n const mrkdwn = !!markdown;\n\n res.status(statusCode).send({\n response_type,\n mrkdwn,\n text\n });\n }", "title": "" }, { "docid": "916415a82d0c3858c592192ca95859f5", "score": "0.55887985", "text": "function respond(response, status, data, type) {\n\t\tresponse.writeHead(status, {\n\t\t\t\"Content-Type\": type || \"text/plain\"\n\t\t});\n\n\t\tresponse.end(data);\n\t}", "title": "" }, { "docid": "69b2a11f8504d0723f3f9be5066b458c", "score": "0.5575752", "text": "function updateMessage(type, value) {\n var status = $get('status');\n //status.innerText = value;\n $(\"#status\").html(value);\n $(\"#status\").addClass(type);\n // remover todos los estilos\n //status.className = '';\n //Sys.UI.DomElement.addCssClass(status, type);\n}", "title": "" }, { "docid": "b04b9830eda5a2b2fb088e87321638cc", "score": "0.5573112", "text": "function setMessage(msg) {\n var displayBox = document.querySelector('div.status');\n displayBox.innerHTML = msg;\n}", "title": "" }, { "docid": "30dc355e00196b4bd1de7b579707546c", "score": "0.5572844", "text": "function coloredText(status) {\n if(status === \"booked\") {\n return <span className=\"text-primary font-weight-bold\">{status}</span>\n }\n if(status === \"seated\") {\n return <span className=\"text-secondary font-weight-bold\">{status}</span>\n }\n if(status === \"cancelled\") {\n return <span className=\"text-danger font-weight-bold\">{status}</span>\n }\n if(status === \"finished\") {\n return <span className=\"text-success font-weight-bold\">{status}</span>\n }\n }", "title": "" }, { "docid": "4b87abf6a7b0e9283e43941b78b2ec2f", "score": "0.5568965", "text": "function setContent(data, status, jqxhr) {\n $('#ajax-example').text(data);\n }", "title": "" }, { "docid": "d5d78ce924f53a379669cc823a4b2780", "score": "0.5562883", "text": "function succeed(status, description, response) {\n\tlet body = status + ' ' + description;\n\tconsole.log(body);\n\tresponse.writeHead(status, {\n\t\t'Content-Type': 'text/plain',\n\t\t'Access-Control-Allow-Origin': '*',\n\t\t'Access-Control-Allow-Credentials': 'true',\n\t\t'Content-Length': body.length\n\t});\n\n\tresponse.write(body);\n\tresponse.end();\n}", "title": "" }, { "docid": "fa7493cafdc02360d2a53d38eb4a6698", "score": "0.55615973", "text": "get statusMessage() {\n return this.getStringAttribute('status_message');\n }", "title": "" }, { "docid": "4fe92a120475a897eef38b6d02ab51a7", "score": "0.55589914", "text": "function writeRes(res, message, contentType, status) {\n contentType = contentType || 'application/json';\n status = status || 200;\n if (typeof message === 'object') message = JSON.stringify(message);\n res.writeHead(status, { 'Content-Type': contentType });\n res.end(message);\n}", "title": "" }, { "docid": "f84380b35b031f5d234ce25589f81e26", "score": "0.55470395", "text": "function BOT_statusPrint() {\r\n\tif(BOT_statusFlag) {\r\n\t\tvar e = document.getElementById(\"litetalkstatustext\");\r\n\t \tif(e && BOT_theStatusText != \"\" ) e.innerHTML = BOT_theStatusText;\r\n\t}\r\n}", "title": "" }, { "docid": "47c89017168c125090cc25ecab93f64f", "score": "0.5546837", "text": "_getStatus(val) {\n return val ? 'ok' : 'caution';\n }", "title": "" }, { "docid": "2298fc2e4fad41cea05e686b4f1129ec", "score": "0.55450845", "text": "function statusHandler(status) {\n\t\t\t\tdisplayValue('StatusData', status);\n\t\t\t}", "title": "" }, { "docid": "9f740a22abf035cedefbddf226b6e4e2", "score": "0.55449814", "text": "function set_status(id, status) {\n\t\t$(\"#\" + id + \" span.status\").text(status);\n\t\tif ((status == \"ON\") || (status == \"AUTOMATIC\")) {\n\t\t\t$(\"#\" + id).removeClass(\"btn-danger\").removeClass(\"btn-light\")\n\t\t\t\t\t.addClass(\"btn-warning\");\n\t\t} else if ((status == \"OFF\") || (status == \"MANUAL\")) {\n\t\t\t$(\"#\" + id).removeClass(\"btn-danger\").removeClass(\"btn-warning\")\n\t\t\t\t\t.addClass(\"btn-light\");\n\t\t} else {\n\t\t\t$(\"#\" + id).removeClass(\"btn-warning\").removeClass(\"btn-light\")\n\t\t\t\t\t.addClass(\"btn-danger\");\n\t\t}\n\t}", "title": "" }, { "docid": "1e1afba2979f3e4ae1a9a9b44cfa9558", "score": "0.5539553", "text": "function ui_multi_update_file_status(id, status, message)\n{\n\n $('#uploaderFile' + id).find('span').html(message).prop('class', 'status text-' + status);\n}", "title": "" }, { "docid": "0cbd59c35b13a60671b3da93e8992a5f", "score": "0.5538906", "text": "static response(response, status, msgCode, message, data) {\n data = data || {};\n const dat = {\n code: status,\n date: DateHelper.now(),\n message,\n msgCode,\n data,\n };\n\n response.status(status).json(dat);\n }", "title": "" }, { "docid": "7877ec596b9f61e57a902171163805d2", "score": "0.5537761", "text": "function itemEditedSuccess(){\n responseText.textContent = responses[2]\n responseText.style.color = '#155724'\n responseText.style.backgroundColor = '#d4edda'\n clearActionResponse()\n}", "title": "" }, { "docid": "abbe834540c5d7014f38d429e754107e", "score": "0.553662", "text": "function melonInfo(response) {\n console.log(response)\n $('#order-status').html(response.code, response.msg);\n if (response.code === \"ERROR\"){\n $('#order-status').addClass('order-error');\n } else {\n\n $('#order-status').addClass('order-ok');\n }\n}", "title": "" }, { "docid": "88326b07495a041c6682af06d7c4378d", "score": "0.55359304", "text": "function respond(res, obj) {\n res.status(obj.status);\n for (let key in obj.headers) {\n res.set(key, obj.headers[key]);\n }\n res.send(obj.message);\n}", "title": "" }, { "docid": "88326b07495a041c6682af06d7c4378d", "score": "0.55359304", "text": "function respond(res, obj) {\n res.status(obj.status);\n for (let key in obj.headers) {\n res.set(key, obj.headers[key]);\n }\n res.send(obj.message);\n}", "title": "" }, { "docid": "9b86f8bc28cc6e2cd603e1e8c3ad615e", "score": "0.5533223", "text": "setStatus (value) {\n\t\tthis.setState({ statusIndex: value });\n\t}", "title": "" }, { "docid": "0477aeb29fd480226f590ee4c150120d", "score": "0.5531058", "text": "constructor(statusCode, message) {\n super();\n this.statusCode = statusCode || 500; // HTML ERROR CODE, IF NO ONE GIVEN, DEFAULT IS 500\n this.message = message || \"Ooops something went wrong! ⚡\"; // MESSAGE, IF NO ONE GIVE, USE DEFAULT ONE.\n }", "title": "" }, { "docid": "d53411eb6b0bde4f101439785d7d631d", "score": "0.5524913", "text": "function ApiStatus() {\n this.message = {\n 'status': {}\n };\n}", "title": "" } ]
577d0d0d55b50ac9b8bf2cbfebfc2efc
steps to recursion: 1. need a base case: how do I stop....when number is 0 2. forward progress: how do we get to the next one...how to get idx to meet that condition...idx 3. Need recursion...need to call self so the recursion could be: add number coming i to the next lower number
[ { "docid": "a4ecc4063740adcda99a403991fdd534", "score": "0.5835313", "text": "function recursiveFactorial(number) {\n //let sumNumber = number\n // console.log(\"this should start as 3: \" + number)\n\n if (number <= 1) { // We are counting down from number to zero, when we get to zero, get out\n return number\n }\n //merge number += with number--\n //it is the winding and unwinding that is the magic...when the recursion is done, then the summing happens\n //during the recursion, the winding up, the variable is about counting down\n //summing happens in the unwinding\n return recursiveFactorial(number-1) *number;\n}", "title": "" } ]
[ { "docid": "6d909adf912e8ea757b711039790f851", "score": "0.66455925", "text": "function recursiveRange(number) {\n\n //return when number is 0\n if (number === 0) return number;\n\n //return the number + the number before it until you hit 0\n return number + recursiveRange(number - 1);\n\n}", "title": "" }, { "docid": "86a54391b07471ba17699cf09e0e1d85", "score": "0.6526001", "text": "function recursiveRange(num){\n if (num === 1) return 1\n return num + recursiveRange(num - 1)\n }", "title": "" }, { "docid": "758a5448ad5fb420f3af477f0ab8387e", "score": "0.64802855", "text": "function recursiveRange(num){\n if(num === 0) return 0\n return num + recursiveRange(num-1)\n}", "title": "" }, { "docid": "7fa6b6f6a7164cb64a02f16272f78a0f", "score": "0.6368945", "text": "function recursiveRange(num){\n if (num === 0) return 0\n\n return num + recursiveRange(num - 1)\n}", "title": "" }, { "docid": "ca377511e4a9d302d36b341fdd2175ad", "score": "0.6349737", "text": "function recursiveRange(num){\n \n if(num === 0){\n return 0;\n }\n return num + recursiveRange(num-1);\n}", "title": "" }, { "docid": "fafa678f22ec69ba8821f8824548d34a", "score": "0.63487947", "text": "function recursion(num) {\n console.log(num);\n\n if (num != 0) num > 0 ? recursion(num - 1) : recursion(num + 1);\n}", "title": "" }, { "docid": "420735b559ae16edca8df0fab9df8d61", "score": "0.6344524", "text": "function recursiveRange(num){\n\tif (num === 1) return 1;\n\n\treturn num + recursiveRange(num - 1);\n\n}", "title": "" }, { "docid": "418a6dceb9639e82cb1d6bad6d9efac3", "score": "0.6309279", "text": "function recursiveRange(num){\n if (num === 1) return 1; // base case\n return num + recursiveRange(num-1);\n}", "title": "" }, { "docid": "2c7153e0be3154cb7b05eebfc3fea56c", "score": "0.6300841", "text": "function recursiveRange(num) {\r\n if (num == 0) return 0;\r\n return num + recursiveRange(num - 1)\r\n}", "title": "" }, { "docid": "77224f0fbcbd92e46f3b55150a17ea4c", "score": "0.6295637", "text": "function addUp(num) {\r\n return num <= 0 ? 0 : num + addUp(num-1);\r\n}", "title": "" }, { "docid": "1b7c1f585fcd11d8d7f388d37fbea968", "score": "0.62915957", "text": "function traversal_down(num) {\n console.log(num);\n if (num < 1) {\n return;\n }\n traversal_down(num - 1);\n // console.log(num);\n}", "title": "" }, { "docid": "b4fcbfc7e3a94204d12d4d0cd281ee73", "score": "0.6220332", "text": "addIndex( nbr ){\n nbr++;\n if( nbr > 9 ){\n nbr = 0;\n }\n return nbr;\n }", "title": "" }, { "docid": "3c9909376cefd5615407d4266a5ea13f", "score": "0.6196219", "text": "function findNumbers(num) {\n if(num === 0) {\n // Once it finds all the numbers it adds them\n return (addNumbers());\n } else if((num % 3 === 0) || (num % 5 === 0)) {\n allDigits.push(num);\n return (findNumbers(num-1));\n } else {\n return (findNumbers(num-1));\n }\n } // End findNumbers definition", "title": "" }, { "docid": "85c6f0cb601588a201ea8cc62fa574ae", "score": "0.61919594", "text": "function depthFirst(results, number, current, op, position, curValue, prevVal, sum)\n{\n if( position == number.length && curValue == sum)\n {\n results.push(current)\n }\n\n else {\n\n for(i=position+1; i <= number.length;i++)\n {\n var tmp = number.substring(position,i-position);\n\n now = Number(tmp);\n\n depthFirst(results, number, current+'+'+tmp, '+', i, curValue+now, now, sum);\n depthFirst(results, number, current+'-'+tmp, '-', i, curValue-now, now, sum);\n\n }\n }\n}", "title": "" }, { "docid": "b1e25ab5e853dac23606b185bce6a071", "score": "0.61737776", "text": "function recursiveRange(num) {\n if (num === 0) {\n return 0;\n }\n return num + recursiveRange(num - 1);\n}", "title": "" }, { "docid": "b1e25ab5e853dac23606b185bce6a071", "score": "0.61737776", "text": "function recursiveRange(num) {\n if (num === 0) {\n return 0;\n }\n return num + recursiveRange(num - 1);\n}", "title": "" }, { "docid": "7b614d3800cbe6c80cebe79dc69e8c96", "score": "0.616277", "text": "function recursiveRange(num) {\n\tif (num === 0) return 0;\n\n\treturn num + recursiveRange(num - 1);\n}", "title": "" }, { "docid": "26c82e3199a67e12a43b642309fd8c4e", "score": "0.6146923", "text": "function foo(i){\n if(i<0) return;\n console.log(\"Begin: \",i);\n foo(i-1);\n console.log(\"End: \",i);\n }", "title": "" }, { "docid": "f07119319e97946d82e1f874cb9d5ac7", "score": "0.6146521", "text": "function recursive_fibonacci_at_index(num) {\n if (num == 1) return 0;\n if (num == 2) return 1;\n return (\n recursive_fibonacci_at_index(num - 1) +\n recursive_fibonacci_at_index(num - 2)\n );\n}", "title": "" }, { "docid": "3b3ea264fc1e44435e5517bce6455648", "score": "0.61372375", "text": "function recursiveRange(num) {\n if (num === 1) return 1;\n return num + recursiveRange(num - 1);\n}", "title": "" }, { "docid": "4a72a62d04cd2d33529122359d79af08", "score": "0.6123478", "text": "function recursiveRange(num) {\n if (num < 1) return 0;\n return num + recursiveRange(num - 1);\n}", "title": "" }, { "docid": "0d467cedc0ddaa8f7e51469ef40073cc", "score": "0.6101554", "text": "function next(i, p) {\n return (p(i) ? i : next(i + 1, p));\n}", "title": "" }, { "docid": "46c35b30e213aac429449579162f3a25", "score": "0.6078997", "text": "function RecursiveRange(num) {\n\tif (num === 0) return 0;\n\treturn num + RecursiveRange(num - 1);\n}", "title": "" }, { "docid": "85243faf4c1e8a403cbbed743860ed59", "score": "0.6071904", "text": "function recursiveRange(input) {\n return input === 0 ? 0 : input + recursiveRange(input - 1);\n}", "title": "" }, { "docid": "63764835d7892a52f9e5d369b0248d03", "score": "0.6069749", "text": "function foo(i) {\n if (i < 0)\n return;\n console.log('begin:' + i);\n foo(i - 1);\n console.log('end:' + i);\n}", "title": "" }, { "docid": "685978b59ccb6ac679cc5c7a9a5b5040", "score": "0.6056815", "text": "function fibItRec(indexOfNumber) {\n var number = 0;\n\n if (indexOfNumber < 2) {\n number = 1;\n } else {\n return fibItRec(indexOfNumber - 2) + fibItRec(indexOfNumber - 1);\n }\n\n return number;\n}", "title": "" }, { "docid": "764f45d7a6cc2097eb4f45883a06cdaf", "score": "0.6046778", "text": "function triangularNthCal(num) {\n\n // if num is 1 return 1\n if (num === 1) {\n return 1;\n }\n return num + triangularNthCal(num - 1);\n \n}", "title": "" }, { "docid": "da2c92e5ad8bce994e2515d09a5c0122", "score": "0.6042254", "text": "function countDownFrom(number){\n if(number <= 0){\n return;\n }\n console.log(number);\n countDownFrom(number-1);\n}", "title": "" }, { "docid": "13e69335e41c7493f47ad79afa39c984", "score": "0.6035456", "text": "function addUpTo(n) {\n // base case\n if (n === 1) {\n return 1;\n }\n // recursive case\n return n + addUpTo(n - 1);\n}", "title": "" }, { "docid": "2c23d3e0d5b7f9767688c472ba5a2c70", "score": "0.6011269", "text": "function recursiveRange(x) {\n if (x === 0) return 0;\n return x + recursiveRange(x - 1)\n// 6 + 5 = 11\n// 4 + 3 = 7\n// 2 + 1 = 3\n// _________\n // 21\n}", "title": "" }, { "docid": "8eea365bc6b2140361fd55a25f14a4c1", "score": "0.6002187", "text": "function recursiveRange(base) {\n\tif (base === 1) return 1;\n\treturn base + recursiveRange(base - 1);\n}", "title": "" }, { "docid": "57dfa8cfd1403e30131bab4d3edf1976", "score": "0.5992601", "text": "function triangularNumNonRecursive(index)\r\n{\r\n if(index <= 1)\r\n {\r\n return index;\r\n }\r\n\r\n var sum = 0;\r\n\r\n for(var i = 0; i <= index; i++)\r\n {\r\n sum += i;\r\n }\r\n return sum;\r\n}", "title": "" }, { "docid": "b8502a0b4afe9acc0bcdbb515aa9b69a", "score": "0.5989762", "text": "function nextStep(level, possibleNumber, rows, solution, startFromZero) {\n // get possible number fit in each cell in this row\n var x = possibleNumber.slice(level * 9, (level + 1) * 9);\n\n // generate possible numbers sequence that fit in the current row\n var y = generatePossibleRows(x);\n if (y.length == 0)\n return 0;\n\n // to allow check is solution is unique\n var start = startFromZero ? 0 : y.length - 1;\n var stop = startFromZero ? y.length - 1 : 0;\n var step = startFromZero ? 1 : -1;\n var condition = startFromZero ? (start <= stop) : (start >= stop);\n\n // try every numbers sequence in this list and go to next row\n for (var num = start; condition; num += step) {\n var condition = startFromZero ? (num + step <= stop) : (num + step >= stop);\n for (var i = level + 1; i < 9; i++)\n solution[i] = rows[i];\n solution[level] = y[num];\n if (level < 8) {\n /*if (solution[4] === undefined) {\n var x = 0;\n x++;\n }*/\n var cols = getColumns(solution);\n var blocks = getBlocks(solution);\n\n var poss = generatePossibleNumber(solution, cols, blocks);\n if (nextStep(level + 1, poss, rows, solution, startFromZero) == 1)\n return 1;\n }\n if (level == 8)\n return 1;\n }\n return -1;\n}", "title": "" }, { "docid": "1a79c0ca2f74417f61597b28837a5bda", "score": "0.5985659", "text": "function next(i){\n return i === self.max ? self.max : i + 1;\n }", "title": "" }, { "docid": "3126d32be35cc231856c06506caa4215", "score": "0.59779286", "text": "function Fibonacci(index)\n{ \n if (index <= 1) \n return index; \n else\n return Fibonacci(index-1) + Fibonacci(index-2); \n \n// var last=1, lastbutone=0;\n// // console.log(lastbutone,last);\n \n// for(var i=1;i<index;i++ )\n// {\n// sum=lastbutone+last;\n// lastbutone=last;\n// last=sum;\n// // console.log(last);\n\n// }\n// return last;\n}", "title": "" }, { "docid": "84cda795dac3c7ce4d85db9dc38f4155", "score": "0.595516", "text": "function fibonacci(position){\n if(position < 3) return 1;\n else return fibonacci(position - 1) + fibonacci(position -2);//O(n^2) complexity\n}", "title": "" }, { "docid": "b7564dee479943b1ecb195436a5d2062", "score": "0.59544736", "text": "function fabonacciByIndex(index) { //zero-indexed.\n if (index < 2) {\n return index;\n } else {\n return fabonacciByIndex(index - 1) + fabonacciByIndex(index - 2);\n }\n}", "title": "" }, { "docid": "8626e4d81b025e16b031e31058c97136", "score": "0.59520036", "text": "function nthNumber(n){\n if(n === 0){\n return 0;\n }\n\n return nthNumber(n - 1) + n;\n}", "title": "" }, { "docid": "b68a14511668a5e6cb5e4894a7b3117a", "score": "0.5937065", "text": "function sumNumbers(n){\n console.log(n)\n if(n== 1){\n return 1\n }else{\n return n + sumNumbers(n-1)\n }\n\n}", "title": "" }, { "docid": "2d084562878d6c041ee075c0bf044bba", "score": "0.5932614", "text": "function incNbrRec(i, endNbr, elt) {\r\n if (i <= endNbr) {\r\n elt.text(i);\r\n setTimeout(function() {//Delay a bit before calling the function again.\r\n incNbrRec(i + 1, endNbr, elt);\r\n }, speed);\r\n }\r\n}", "title": "" }, { "docid": "da4776bb3a899983199d2924dea5e5d9", "score": "0.5918833", "text": "function sumRange(num){\n //the return 1 is the base case\n if(num === 1) return 1; \n //the invocation of sumRange with num-1 is a different input\n return num + sumRange(num-1);\n }", "title": "" }, { "docid": "ea8c39105fe612585955ad238b8a20aa", "score": "0.59181994", "text": "function fibonacci(index) {\n if (index <= 1) return index;\n\n return fibonacci(index - 1) + fibonacci(index - 2);\n}", "title": "" }, { "docid": "d6fe669264137734a7a2c661f3afa53f", "score": "0.5916565", "text": "function fibRec(num) {\n if (num < 2) {\n return 1;\n }\n return fibRec(num - 2) + fibRec(num -1);\n}", "title": "" }, { "docid": "7739e1cd070e1ef9bc714530baa3d4d8", "score": "0.5911239", "text": "function fib(index) {\n if (index < 2) return 1;\n return fib(index - 1) + fib (index - 2);\n}", "title": "" }, { "docid": "f4add9908807688f95e58c149e561909", "score": "0.5892101", "text": "function recursiveLoop(num) {\n if (num === 0) return num;\n return [num].concat(recursiveLoop(--num));\n}", "title": "" }, { "docid": "30943a9ea86d12a6fb3a02e5b9d02116", "score": "0.58904487", "text": "function jumpFloorII(number){\n if(number <= 1) return 1\n return 2 * jumpFloorII(number - 1)\n}", "title": "" }, { "docid": "c479562901bf71a3fb38a6105682499b", "score": "0.58634096", "text": "function countDown(num) {\n if (num <= 1) {\n return num\n }\n console.log(num);\n let newNum = num -1\n return countDown(newNum)\n\n}", "title": "" }, { "docid": "10b68e65123220383f6eadbcea998d1e", "score": "0.5855606", "text": "function getSecondNumber(arr, num, count = 0, index = 0) {\n if(arr[index] === num) {\n if(count === 1) {\n return index;\n }\n return getSecondNumber(arr, num, count+1, index+1);\n }\n return getSecondNumber(arr, num, count, index+1);\n}", "title": "" }, { "docid": "d4a24b9c13ca924814e1c8139f9ca2d2", "score": "0.58521456", "text": "function countDown(fromNumber) {\n console.log(fromNumber);\n let nextNumber = fromNumber - 1;\n if (nextNumber > 0) {\n countDown(nextNumber);\n }\n}", "title": "" }, { "docid": "ae745c12cd3cc1c177ccd470ac151d75", "score": "0.5846515", "text": "function nth(list, num) {\n let target = 0, current = list.rest;\n if(target == num) {\n return list.value;\n } else if(current !== null) {\n while(target < num) {\n nth(current, num);\n target += 1;\n }\n return current.value;\n } else if(current == null){\n return console.log('Out of range.');\n }\n}", "title": "" }, { "docid": "3c29cfb589cae01ddd4e5c420a4740a2", "score": "0.58450484", "text": "function fib(index) {\n if (index < 2) return 1;\n return fib(index-1) + fib(index-2);\n}", "title": "" }, { "docid": "c0ea7c7f93ac9d1aca6187ca3a6ac565", "score": "0.58413255", "text": "function sumToTen(num) {\n // the base case (stopping condition). Once the num reaches 10, it no longer calls itself\n if (num >= 10) {\n return num;\n }\n\n // keeps track of the current iteration\n // calls itself <-- definition of recursion\n // must call itself during a different input, otherwise it will infinitely loop\n\n return num + sumToTen(num +1)\n}", "title": "" }, { "docid": "7d265bb4e9891c46ec7ba6a3f092d6f1", "score": "0.58333445", "text": "function fibRecursiveNumberAt( position ){\n\n if( !Number.isInteger( position ) )\n throw new TypeError( `pos must be an integer, it is currently a(n) ${ typeof position }` );\n\n if( position < 3 ) return 1;\n\n return fibRecursiveNumberAt( position - 1 ) + fibRecursiveNumberAt( position - 2 );\n\n}", "title": "" }, { "docid": "e33d038ffdd49275ad34fd2523d53302", "score": "0.5822078", "text": "function fib(num) {\n\tlet arr = [1, 1];\n\tlet startInd = 0;\n\tlet endInd = 1;\n\tfunction helper(hnum) {\n\t\tif (arr.length == hnum) {\n\t\t\treturn arr[arr.length - 1];\n\t\t} else {\n\t\t\tarr.push(arr[startInd] + arr[endInd]);\n\t\t\t// console.log(arr.length)\n\t\t\tstartInd++;\n\t\t\tendInd++;\n\t\t\thelper(hnum);\n\t\t}\n\t}\n\thelper(num);\n\treturn arr[arr.length - 1];\n}", "title": "" }, { "docid": "5cd4ba0f4b837c64802921e8d1666462", "score": "0.5807955", "text": "function fibonacci(index) {\n if (index < 3) {\n return 1;\n }\n return fibonacci(index - 1) + fibonacci(index - 2);\n}", "title": "" }, { "docid": "6f2e19a8360fc7774e738e8957f08c39", "score": "0.58076245", "text": "function fibonacci(num) {\n console.log(num)\n if (num==0){\n return 0\n }else if(num<=2){\n return 1\n }else if(num==3){\n return 2\n }else if(num==4){\n return 3\n }\n return fibonacci(num-1) + fibonacci(num-2);\n}", "title": "" }, { "docid": "8eaddfe9c9b47938d04dbedbb8e4efd9", "score": "0.57892746", "text": "function fibonacciRecurisve(num) {\n // stopin condition\n if (num == 0) {\n return [0];\n }\n\n if (num == 1) {\n return [1, 1];\n }\n\n let fibo = fibonacciRecurisve(num - 1);\n let nextFibo = fibo[num - 1] + fibo[num - 2];\n fibo.push(nextFibo);\n return fibo;\n\n //recursive call\n}", "title": "" }, { "docid": "a564153d4a586aeaf3761cd970875332", "score": "0.5784656", "text": "function findSolution(int_target)\n {\n // calls inner-function, passing the 'integer' data-type '1', and 'string' data-type '1' as argument's parameter\n return find(1,\"1\");\n\n // declaring inner-function\n function find(int_start,int_history)\n {\n // block executes if start(inner-function parameter) and target(outer-function parameter) values match\n if (int_start == int_target)\n {\n // returns history-variable to outer-function call, when a sequence that produces target-value is found\n return int_history;\n }\n\n // executes if start(inner-function parameter) value is greater than target(outer-function parameter) value\n else if (int_start > int_target)\n {\n // returns 'null' to call('top-frame' of 'call-stack')\n // if returning 'null' to initial frame, there is no sequence that will produce target-value\n return null;\n }\n\n // executes only if none of the above conditional-statements have been execute\n else\n {\n // following line will add 5 to the target-value, while also adding a 'new frame' to the 'call-stack'\n // while target-value is less than history-value, 'left-side' of ||(or)-statement will continue to execute\n // on each iteration\n\n // if target-value is exceeded, 'else-if'-statement will return 'null' and 'remove the\n // top frame'\n\n // on following iteration, the line will then multiply\n // the 'target-value' of the former-frame(new top-frame) by 3(right-side of 'or'-statement)\n\n // if target is exceeded, else-if statement will return null and remove the top frame\n\n // on following iteration, the line will again multiply the target-value of the frame by 3\n\n // if target is exceeded, else-if statement will return null and remove the top frame\n // and repeat process on each following iterations\n\n // if 'call-stack' is reduced to 'initial-frame' of the 'call-stack',\n // the same 'initial process' will take place but 'in reverse-order'\n // ('left-side' of ||(or)-statement will execute 1st)\n\n // line will multiply the initial target-value by 3, while also adding a new frame to the call-stack\n\n // while target-value is less than history-value, right-side of ||(or) statement will continue to execute\n\n // if target is exceeded, else-if statement will return null and remove the top frame\n\n // on following iterations, the line will add 5 to the target-value.\n\n // if target is exceeded, else-if statement will return null and remove 'all the adding by 5 frames', above\n // the most recent frame 'multiplying history value by 3', which still remains in the call-stack,\n\n // repeats above sequence\n\n // if call-stack is reduced again to the initial frame of call-stack, 'null' is returned\n // **(there is no sequence which will produce target-value of the parameter)\n return find(int_start + 5,\"(\" + int_history + \" + 5)\") || find(int_start * 3, \"(\" + int_history + \" * 3)\");\n }\n }\n\n }", "title": "" }, { "docid": "5b6f1c1ce54231133cb6782fe04b2073", "score": "0.5780121", "text": "function minStepsToOneMemoization(num) {\n let memo = {}\n function traverse(current) {\n if (current in memo) {\n return memo[current];\n }\n\n if (current === 1) {\n return 0;\n }\n\n // subtract 1\n let option = traverse( current - 1);\n\n\n // divide by 3\n if (current % 3 === 0) {\n let divide3 = traverse((current)/3);\n option = Math.min(option, divide3)\n }\n\n // divide by 2\n if (current % 2 === 0) {\n let divide2 = traverse((current)/2);\n option = Math.min(option, divide2)\n }\n memo[current] = option + 1;\n return option + 1;\n }\n\n return traverse(num)\n\n}", "title": "" }, { "docid": "443909d7580c23fc76fcba67a3e1522a", "score": "0.57781595", "text": "function fib(num, prev=1, current=1, i=2) {\n if (i === num) {return current}\n\n return fib(num, current, prev+current, i++)\n}", "title": "" }, { "docid": "28acfca36d11e871ed62e81b13f37305", "score": "0.5767813", "text": "function fibonacci(position) {\n if (position < 3) return 1;\n else return fibonacci(position - 1) + fibonacci(position - 2);\n}", "title": "" }, { "docid": "90954520a06b0673d4069c95a6f6b510", "score": "0.57623243", "text": "function binSearchRec(arr, num, iCurrent = Math.floor((arr.length - 1) / 2)) {\r\n\tif (arr[iCurrent] === num) {\r\n\t\treturn iCurrent;\r\n\t}\r\n\r\n\t// debugger;\r\n\tif (arr[iCurrent] < num) {\r\n\t\treturn binSearchRec(arr, num, iCurrent + Math.floor(iCurrent / 2));\r\n\t} else {\r\n\t\treturn binSearchRec(arr, num, Math.floor(iCurrent / 2));\r\n\t}\r\n}", "title": "" }, { "docid": "79ad9a50cfbac5ebbea278d28f92012d", "score": "0.576134", "text": "function fib(num){\n if (num <=2) return 1\n return fib(num - 2) + fib(num - 1)\n}", "title": "" }, { "docid": "7233f0f44aa514fca98fde4ed7405b46", "score": "0.57570106", "text": "function calcNext(length, current) {\n return (current + 1) % length;\n}", "title": "" }, { "docid": "c1d691548b1534c178e6d2c0e7b79070", "score": "0.57558143", "text": "function sumBelow(n){\n //basecase\n if(n === 1) {\n return 0;\n } else {\n //recursive case\n //console.log(n)\n return n-1 + sumBelow(n - 1);\n }\n}", "title": "" }, { "docid": "4b29c56dae9f1c17afe76076b8b18965", "score": "0.57508576", "text": "function fibonacci(index) {\n // Method 1: recursion\n // if (index <= 1) {\n // return index;\n // } else {\n // return fibonacci(index-1) + fibonacci(index-2);\n // }\n\n // Method 2:\n var fibArr = [0, 1]; // array of starting values\n for(var i = 2; i <= index; i++) {\n fibArr[i] = fibArr[i-1] + fibArr[i-2];\n }\n return fibArr[index];\n}", "title": "" }, { "docid": "01fff07271f22368463381a5becd0e3f", "score": "0.5745458", "text": "traverseToIndex(index) {\n let currentNode = this.head;\n for(let i = 0; i < this.length; i++) {\n if(index == i+1) {\n return currentNode;\n }\n currentNode = currentNode.next;\n }\n }", "title": "" }, { "docid": "2c9214388110f03d21c590ac3087f490", "score": "0.57454216", "text": "function fibonacci2(idx) {\n if (idx <= 1) return 1;\n return fibonacci2(idx - 1) + fibonacci2(idx -2);\n}", "title": "" }, { "docid": "871c488fa04310d46472e4803486c6b5", "score": "0.5743395", "text": "function countDown(num) {\n if (num <= 0) {\n return;\n }\n console.log(num)\n countDown(num - 1)\n}", "title": "" }, { "docid": "473e2396aaf5cd7a6873eddb0a3e9d31", "score": "0.5741389", "text": "function recursiveRange(n){\n if (n === 0) return 0\n while(n > 0) {\n return n + recursiveRange(n-1)\n }\n}", "title": "" }, { "docid": "e7e7f710a86ae797797dafccb7d5fd49", "score": "0.5740429", "text": "function addUpTo(arr, index) {\n return index ? arr[index] + addUpTo(arr, --index) : arr[index];\n}", "title": "" }, { "docid": "51ac5826474469888fb7635032aa3836", "score": "0.57397825", "text": "function recursiveSum(num, sum){\r\n console.log(num);\r\n const currentSum = num + sum;\r\n return num > 0 ? recursiveSum(num -1, currentSum) : currentSum;\r\n\r\n}", "title": "" }, { "docid": "7511aa4b5adf467986c4da295785e3ce", "score": "0.5732241", "text": "function getIndexToIns(arr, num) {\n arr.sort((x, y) => x - y);\n let curr = 0;\n let next = 1;\n\n if(num >= arr[0]){\n while(next < arr.length){\n if(num <= arr[curr]){\n return curr;\n }\n if(num > arr[curr] && num <= arr[next]){\n return next;\n }\n curr += 1;\n next += 1;\n }\n // greater than last item\n return arr.length;\n }\n else {\n // lower than first item\n return 0;\n }\n}", "title": "" }, { "docid": "5ef9e0a7ee1c620f95da8d1dc344c921", "score": "0.57276887", "text": "function row(number) {\n if(number == 0) {\n return;\n }\n\n console.log(number);\n row(number - 1);\n}", "title": "" }, { "docid": "a25de93529d177a7567205238ed1c1c9", "score": "0.57265824", "text": "function nextPositiveNum(arr) {\n let increment = 0;\n let result = 0;\n for (let i = 0; i < arr.length; i++) {\n if (result == 0) { increment++ };\n if (arr.indexOf(increment) === -1) {\n result = increment;\n }\n }\n return result;\n}", "title": "" }, { "docid": "5647b24a351e0c2e31b0d1bf43c798f6", "score": "0.57263386", "text": "function F(x) { \n if (x<2) return x; return F(x-1) + F(x-2); \n}", "title": "" }, { "docid": "4e31311ace7a021597307126b4daa30b", "score": "0.5721578", "text": "function backtrack(arr, sum, index) {\n if (sum > target) {\n return\n }\n\n if (sum == target) {\n result.push(arr)\n return\n }\n\n for (let i = index; i < candidates.length; i++) {\n backtrack([...arr, candidates[i]], sum + candidates[i], i)\n }\n}", "title": "" }, { "docid": "8cb5d35b19ae86d834b528ed7bdbdecd", "score": "0.57202834", "text": "function fibonacci(num) {\r\n if (num < 2)\r\n return 1;\r\n\r\n return 2 + + fibonacci(num - 1);\r\n}", "title": "" }, { "docid": "43a0a61c2763d9adf7abbf16e5813402", "score": "0.5719229", "text": "function recursiveRange(n){\r\n if(n === 1) return 1;\r\n if(n === 0) return 0;\r\n return n + recursiveRange(n-1);\r\n}", "title": "" }, { "docid": "f630bcc9c093885918cbf506efe00e85", "score": "0.571848", "text": "function fib(n){\n if(n === 0) return 0;\n return n + fib(n - 1)\n }", "title": "" }, { "docid": "bd74ffbc35d3508a3f1461b70891fd4c", "score": "0.57163095", "text": "function rFib(index){\n if(index <= 0){\n return 0\n }\n else if(index ==1){\n return 1\n }\n else{\n var result = rFib(index-2) + rFib(index-1)\n return result\n }\n}", "title": "" }, { "docid": "1d45f536b17005b7c68cc4973db1b329", "score": "0.570803", "text": "function solution(A) {\n // enough so that the last fib number is just before 100,000\n let fn = 26,\n f = genFibs(fn),\n leaves = A,\n n = A.length,\n visited = [],\n current = new Set(),\n next = new Set(),\n jumps = 0;\n\n current.add(-1); // the frog is starting from pos -1\n leaves[n] = 1; // the frog can always jump on the other end\n\n // jump until reaching N or until there are no leaves to jump on\n while (!current.has(n) && current.size > 0) {\n // try to make a jump; if next is empty\n // we'll return -1 anyway\n // if there's at least one leaf the frog jumped\n // so jumps increases\n jumps++;\n\n // from the current positions jump to all possible\n // next positions that have not been visited\n [...current].map(pos => {\n // check for all possible fib jumps\n // the third fibonacci number is 1\n // so start from it\n for (let i = 2; i < fn; i++) {\n let j = f[i],\n nextPos = pos + j;\n\n if (leaves[nextPos] && !visited[nextPos]) {\n next.add(nextPos);\n visited[nextPos] = true;\n }\n }\n });\n\n // prepare next and current\n current = new Set([...next]);\n next = new Set();\n }\n\n // no leaves found to jump on next\n // so the frog cannot finish\n // hence return -1\n if (current.size === 0) {\n return -1;\n }\n\n // the loop has finished and there are next\n // possible jumps, so one of them is N\n return jumps;\n}", "title": "" }, { "docid": "e24726fceb292b16ce925eb8a0e9e04e", "score": "0.570682", "text": "function fib(num) {\n if(num === 0) return 0;\n return num + fib(num + 1);\n}", "title": "" }, { "docid": "89c13283610bc2b6ffc759ee75c3e40b", "score": "0.5705624", "text": "traverseToIndex(index){\n let counter = 0 \n let currentNode = this.head \n while(counter!==index && currentNode){\n counter++;\n currentNode = currentNode.next\n }\n return currentNode\n }", "title": "" }, { "docid": "baed25bfba6bc1c107a792dab4e07806", "score": "0.5678961", "text": "function countDown (n) {\n console.log(n)\n if (n !== 1) {\n return countDown(n - 1)\n } else {\n return n\n }\n}", "title": "" }, { "docid": "d9dcdd562effff68c323baaee1039655", "score": "0.56714904", "text": "function get_next_number(current) {\n\n\t\t\t// make sure current number does not get bellow / above end number\n\t\t\tcurrent = (settings.step > 0) ? \n\t\t\t\tMath.min(current + settings.step, settings.end) :\n\t\t\t\tMath.max(current + settings.step, settings.end);\n\t\t\t\n\t\t\treturn current;\n\n\t\t}", "title": "" }, { "docid": "5b40084ee08a8519041d1de1cbb58ed1", "score": "0.5670974", "text": "function recursiveFibonnacci(num) {\n if (num <= 1) return num;\n return recursiveFibonnacci(num - 2) + recursiveFibonnacci(num - 1);\n}", "title": "" }, { "docid": "c81bb8b628921cc87e65f0f7462bba54", "score": "0.56666917", "text": "function fillRecurse(num, value, start = 0, end = num.length) {\n\tif (start >= end) return num;\n\tnum[start] = value;\n\treturn fillRecurse(num, value, start + 1, end);\n}", "title": "" }, { "docid": "5ebfd27ae4393518d88517ce595494d0", "score": "0.5661922", "text": "function recursiveFibonnacci(num) {\n if (num <= 1) return num;\n return fibonacci(num - 2) + fibonacci(num - 1);\n}", "title": "" }, { "docid": "b1a85faa9414a3c5ba9206013ace3a9f", "score": "0.5661617", "text": "function fibonacci(position) {\n\n}", "title": "" }, { "docid": "769078c64b50f635f0fde780515c429c", "score": "0.56520617", "text": "function findMinValueRecursion (numArr) {\n if (numArr.length <= 1) {\n return numArr[0];\n } else {\n if (numArr[0] > numArr[1]) { \n numArr = numArr.slice(1); \n } else {\n numArr = [numArr[0]].concat(numArr.slice(2));\n }\n return findMinValueRecursion(numArr);\n }\n}", "title": "" }, { "docid": "f38b31ab54c73fa8fa99199c59b94fe7", "score": "0.5651158", "text": "function recursive(n) {\n if (n == 1) {\n return n;\n } else {\n return n + recursive(n - 1);\n }\n}", "title": "" }, { "docid": "f322ee750b48954e81242e87041c3b7f", "score": "0.5650544", "text": "increment(states, fromIndex, toIndex) {\n for (let i = fromIndex; i < toIndex; i++) {\n const low = states.low[i];\n const high = states.high[i];\n states.low[i] = high.xor(low);\n states.high[i] = low;\n if ((high.and(low.not())).equals(0)) {\n return toIndex - fromIndex;\n }\n }\n return toIndex - fromIndex + 1;\n }", "title": "" }, { "docid": "799c2eec365ba8ccb4276f62735fca97", "score": "0.56459194", "text": "function sumRange(num){\n if(num === 1) {\n return 1; \n }\n return num + sumRange(num -1); \n}", "title": "" }, { "docid": "ac8f8b06319c50017c21154b38fda1d9", "score": "0.56410146", "text": "function next_binary_number(bNumber) {\n \n for (var i=bNumber.length-1; i >= 0; i--) {\n if(bNumber[i]== 0) {\n bNumber[i] = 1;\n //no point in going through the rest of the numbers\n \tbreak;\n }\n \n if (bNumber[i] == 1) {\n //set the 1\n bNumber[i] = 0;\n }\n }\n //the loop ended but no 0's were found.. need to add a digit\n if (i == -1) {\n bNumber.unshift(1);\n }\n console.log(bNumber);\n}", "title": "" }, { "docid": "6b8aef2c9a77fb1f755fe450257f9934", "score": "0.5638826", "text": "function fibonacciCalc(num) {\n //base case\n if(num === 1 || num === 2) {\n return 1\n }\n //condition to stop\n if(num < 1) {\n return 0\n }\n //recursive case\n let sumNum = fibonacciCalc(num-2) + fibonacciCalc(num-1)\n return sumNum\n}", "title": "" }, { "docid": "8b1b6fd11d875dec5f32060045e421da", "score": "0.5632202", "text": "getParentIndex_(index) {\n return (index - 1) >> 1\n }", "title": "" }, { "docid": "da550499713e47aeea4a0dbab68eeb88", "score": "0.5628006", "text": "function fib(number){\n if(number === 0) return [];\n if(number === 1 || number === 2) return 1;\n\n let fibSeq = [1,1];\n\n function helper(arr, num){\n if(num === 2) return;\n fibSeq.push(fibSeq[0] + fibSeq[1]);\n fibSeq = fibSeq.slice(1);\n helper(fibSeq, --num);\n }\n helper(fibSeq, number);\n return fibSeq.pop();\n}", "title": "" }, { "docid": "1bf2dfb5acbb0a2094ff638d60630868", "score": "0.5620811", "text": "function ChangingSequence(arr){\r\n var dec = false;\r\n var inc = false;\r\n for(var i=0;i<arr.length-1;i++){\r\n if((arr[i]> arr[i+1]) &&(!dec)){\r\n \r\n inc=true;\r\n }\r\n else if ((arr[i]> arr[i+1]) && (dec)){\r\n return i;\r\n }\r\n else if((arr[i]<arr[i+1])&&(!inc)){\r\n dec= true;\r\n }\r\n else if((arr[i]<arr[i+1])&&(inc)){\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}", "title": "" }, { "docid": "928ca56d3d892bea4301430ea6314d1d", "score": "0.5616913", "text": "function getSum(num) {\n if (num === 0) {\n return 0;\n } else if (num === 1) {\n return 1;\n }\n return getSum(num - 1) + num;\n}", "title": "" } ]
883bb1f5f639d28ace43c025356bfe54
This method ends the game
[ { "docid": "903722bc544715ed822dc1f932a996c7", "score": "0.0", "text": "function gameOver(){\r\n alert('Game Over! Final Length: ' + length);\r\n x = snakeSize;\r\n y = snakeSize;\r\n direction = 0;\r\n isApple = false;\r\n length = 1;\r\n snakeArray.splice(0,snakeArray.length)\r\n}", "title": "" } ]
[ { "docid": "cbdcc66f34bf463ba040be4359cd160f", "score": "0.8758739", "text": "function endGame() {\n startNewGame();\n }", "title": "" }, { "docid": "82489d8088673b46bd4329c6e4aaf599", "score": "0.8632664", "text": "function endGame() {\n //TODO\n}", "title": "" }, { "docid": "5b772f92c7756098f708eb9ac62d0a8b", "score": "0.84106654", "text": "function endGame() {\n gameStatus = 'gameover';\n setScore();\n setHighScores();\n }", "title": "" }, { "docid": "8b57e6106d25c6de46f86c76b3490e59", "score": "0.8255673", "text": "function endgame() {\n finished = true;\n mobile ? removeSwipeListener() : removeKeyListener();\n speedInput = false;\n speedUp = false;\n speedDown = false;\n hudFadeOut();\n overlayDark(1000);\n (distanceRemain > 0) ? makeEndgameBox('You Lose!') : (makeEndgameBox('You Win!'), makeHarder());\n endgamePopIn();\n playButtonAppear(p1, 'playButton', 'More?', 'yellow', 500, replay);\n }", "title": "" }, { "docid": "000fa7ddf8ae0299c65e9dd06e4946c1", "score": "0.82270646", "text": "function endGame() {\n\t\n\t// Shut off power low warning sound\n\taudio4.mute = true;\n\t\n\t// Send final game stats to stats script \t\t\n\tAboutRef.lastScore(score);\n\tAboutRef.lastDownload(timer);\n\tAboutRef.lastRescue(rescueCount,level,packetCount); \t\n\t\n\t// End the game \t\t\n\tgameOver = true;\n\tdestroyShip();\n}", "title": "" }, { "docid": "4973f461329dd2811d9357bf2b232a83", "score": "0.82215357", "text": "function endGame() {\n\tgameStarted = false;\n\n\t// reset scale and alpha of category images so they dont get \"stuck\"\n\tfor (var cat of categories) {\n\t\tcat.scaleX = CATEGORY_IMAGE_WIDTH / cat.image.width;\n\t\tcat.scaleY = CATEGORY_IMAGE_HEIGHT / cat.image.height;\n\t\tcat.alpha = 1;\n\t}\n\n\tvar scoreText = new createjs.Text(\"Score: \" + score + \"/\" + questions.length, \"40px Sans\", \"black\");\n\tscoreText.x = STAGE_WIDTH/2 - scoreText.getMeasuredWidth()/2;\n\tscoreText.y = STAGE_HEIGHT/2 - 40;\n\n\tcreatejs.Tween.get(scoreText).wait(1000).call(function() {\n\t\tstage.addChild(endScreen);\n\t\tstage.addChild(scoreText);\n\t\tstage.on(\"stagemousedown\", function() {\n\t\t\tlocation.reload();\n\t\t})\n\t});\n}", "title": "" }, { "docid": "0be30e670274b364a9f87dbcab73b5c6", "score": "0.8194166", "text": "endGame() {\n\n this.state.gameEnded = 1;\n this.clearCanvas();\n this.displayGameOver();\n this.displayHighScores();\n\n }", "title": "" }, { "docid": "6eb9b06fdc976e2f6d00f2b0e751659e", "score": "0.8167756", "text": "function endGame() {\n latency.release()\n setElapsedMs(0)\n toggleIsPromptingRestart(false)\n onGameOver?.()\n }", "title": "" }, { "docid": "14acbf382770d01a1ec402ae70e77e1e", "score": "0.81472766", "text": "function endGame() {\n stopClock();\n modalStats();\n toggleModal();\n}", "title": "" }, { "docid": "858a8818a40114f47a522d626340c77b", "score": "0.8135537", "text": "function EndGame() {\n\n\t\tship.kill();\n\n\t\tstateText.text=\"You have failed your people.\\n \\n The final remnant in the universe has gone away, only black holes remain now. \\n Some God you are.\";\n\t\tstateText.visible = true;\n\t\ttimer.stop();\n //the \"click to restart\" handler\n\t//game.input.onTap.addOnce(restart,this);\n\n\t}", "title": "" }, { "docid": "12df8b5362200c0a8cfd2f1b2f688601", "score": "0.81311846", "text": "function endGame() {\n stopTimer();\n displayCongratsModal();\n }", "title": "" }, { "docid": "f92647110073d85b1ddd494786e676fd", "score": "0.812682", "text": "function endGame() {\n\tinGame = false;\n\tstopBubbleMaker();\n\tbubbles = [];\n}", "title": "" }, { "docid": "80442478f3fc6c52011042ad059c9081", "score": "0.81093144", "text": "function endGame() {\n\t\tplaying = false;\n\t\t// Stop any playing music\n\t\tfor (var i = 0; i < document.getElementsByTagName(\"audio\").length; i++) {\n\t\t\tvar v = document.getElementsByTagName(\"audio\");\n\t\t\tif (!v[i].paused && v[i].src != null && v[i].src != \"\") {\n\t\t\t\tv[i].pause();\n\t\t\t\tv[i].currentTime = 0;\n\t\t\t}\n\t\t}\n\t\t// Hide in-game elements\n\t\t$_(\"[data-component='modal']\").removeClass(\"active\");\n\t\t$_(\"[data-ui='messages']\").removeClass(\"active\");\n\t\t$_(\"[data-ui='centered']\").remove();\n\t\t$_(\"#game img\").hide();\n\t\t$_(\"#game\").style({\n\t\t\t\"background\": \"initial\"\n\t\t});\n\t\twhipeText();\n\n\t\t// Reset conditions\n\t\tengine[\"Label\"] = \"Start\";\n\t\tlabel = game[engine[\"Label\"]];\n\t\tengine[\"Step\"] = -1;\n\t\t$_(\"section\").hide();\n\n\t\t// Show main menu\n\t\tplayAmbient();\n\t\t$_(\"[data-menu='main']\").show();\n\t}", "title": "" }, { "docid": "deed6a8aa8a408229749573fe45dad05", "score": "0.80558836", "text": "endGame(){\n this.platforms = {}\n this.playersReady = 0;\n this.isOpen = true\n this.gameStarted = false;\n }", "title": "" }, { "docid": "b2be8b9676aa2ae81d96522ef9f844a8", "score": "0.8049228", "text": "function runEndGame() {\n\tdrawGame();\n\tdeadFrog = {\n\t\tx: frogger.x,\n\t\ty: frogger.y\n\t}\n\tdrawDeadFrog();\n\tclickOn = true;\t\t// allows user to play again\n\ttime = 0;\n\tif (score > highScore) {\n\t\thighScore = score;\n\t\tlocalStorage[\"highScore\"] = highScore;\n\t\tisNewHighScore = true;\n\t}\n\tdrawGameOver();\n}", "title": "" }, { "docid": "a27d5dc6a25aa95453e02d813af4357f", "score": "0.8037621", "text": "function endGame() {\n console.log(\"endGame triggered\");\n clearInterval(timer);\n timer = 0; // Ensure we've cleared the interval\n gameIsActive = false;\n }", "title": "" }, { "docid": "3c03a736d0d47230f00d555ffe1850bd", "score": "0.80304", "text": "function endGame() {\n removeTimer();\n clearQuiz();\n buildEndGame();\n}", "title": "" }, { "docid": "ced463fc79e281198ee2104ddcf00878", "score": "0.8013191", "text": "end() {\n\n this.ended = true;\n\n console.log(\"Game End\");\n\n this.updateWinner();\n\n }", "title": "" }, { "docid": "e857ace09e7a808986750daf1e959152", "score": "0.7992085", "text": "function endGame() {\n\n // Calcul des points\n if($scope.game.nbWins == $scope.game.nbQuestions) {\n $scope.game.score = $scope.game.score + $scope.bareme.winAllQuestions;\n }\n\n $scope.openFinalScores(); // Affichage résultats\n }", "title": "" }, { "docid": "642d6eef8d66e5c9cff5f2b352ccda5d", "score": "0.7957364", "text": "function endGame() {\n stopTimer();\n modalResults();\n showModal();\n}", "title": "" }, { "docid": "1d2f6b2800f5e5752e207a93568e0c83", "score": "0.79404646", "text": "function winningScreen() {\n endGame();\n }", "title": "" }, { "docid": "4f50f687a0445988155a4bde3fca1c65", "score": "0.7937799", "text": "function endGame(){\n\t\tclearInterval(intervalId);\n\n\t\t/*\tBack button and game title (which will now display something else) is placed back on game area. \n\t\t \tRefer to visuals.js */\n\t\tbringBackElements(startButton, gameTitle);\n\n\t\tif(highScore < score){\n\t\t\thighScore = score;\n\n\t\t\t//new high score is displayd. Refer to visuals.js\n\t\t\tupdateHighScore(highScore);\n\n\t\t\t//refer to visuals.js\n\t\t\tanimateHeading(\"New High Score: \" + highScore + \"!\");\n\n\t\t\t//show proud kitten being prideful. Refer to visuals.js\n\t\t\tshowProud();\n\n\t\t\t//saves new high score to local storage\n\t\t\tlocalStorage.setItem(\"highScore\", highScore);\n\t\t} else{\n\t\t\t//refer to visuals.js\n\t\t\tanimateHeading(\"Game Over\");\n\n\t\t\t//sad kitty will be sad. Refer to visuals.js\n\t\t\tshowSad();\n\t\t}\n\n\t\t//reset variables to be ready for next game\n\t\tinitialize();\n\n\t\t$(\"body\").off();\n\t}", "title": "" }, { "docid": "00c48b31336cd3795069cc735bab697d", "score": "0.79376817", "text": "function endGame() {\n clearInterval(intervalId);\n setTimeout(afterEndGameEvents, 100);\n }", "title": "" }, { "docid": "5aadd724340c02f13626f58951a5aec0", "score": "0.792936", "text": "function gameEnd() {\n // update the last played games\n updateHistory();\n }", "title": "" }, { "docid": "d0e0c717be7e579db59f0bb2518f65da", "score": "0.7927973", "text": "endGame() {\r\n\t\tvar winner = this.getNextPlayer().id;\r\n\t\t$('.winner').remove();\r\n\t\t$(`<div class=\"winner\"><p><span>player ${winner}</span></p><p>Won the game!</p></div>`).appendTo('.intro');\r\n\t\t$(\"#welcome\").hide();\r\n\t\t$(\"#game_over\").show();\r\n\t\t$(\"#fight\")[0].pause();\r\n\t\t$(\"#homer1\")[0].play();\r\n\t\t$(\".gameBoard\").fadeOut(500, function(){\r\n\t\t$('.intro').fadeIn(500);});\r\n\t\t$(\"#play\").click(function(){\r\n\t\t\t$(\".intro\").fadeOut(500, function(){\r\n\t\t\t\t$(\".gameBoard\").fadeIn(500);\r\n\t\t\t});\r\n\t\t\t$('#board').empty();\r\n\t\t\tstartGame();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "31d6c1db161bcb9eaee66b020d09797d", "score": "0.79190767", "text": "function endGame(){\n disableClicks();\n turnTimer.stop();\n game.updateScore();\n render();\n setTimeout(restart, 2000);\n}", "title": "" }, { "docid": "23c355be4d060f37f671f50c2dcacb7b", "score": "0.79011333", "text": "function endGame(){\n\tconsole.log('Good job, you finished!');\n\tquestionCount = 0;\n}", "title": "" }, { "docid": "3ec5d8393568829e45f7e648836e0c28", "score": "0.7875911", "text": "function EndGame ()\n{\n // Play the death sound effect.\n deathSFX.play();\n // Switch to the end game state.\n game.state.start(\"Finish\");\n}", "title": "" }, { "docid": "11dae8662f0fc72bee3ffccb6895187c", "score": "0.7869438", "text": "function endGame() {\n window.alert('一筆啓上い致し候\\n\\nあなたは町の皆様を救って大変明朗的な人間です。この冒険の伝説はいつまでもお祝いしましょう。\\n\\nあなたほど努力のある方は人生に見たことがない。あなたは素晴らしい。あなたを愛している。大変お疲れ様でした。これからも続くことはできますが、そろそろ休憩しましょう。\\n\\n僕のゲームをここまで楽しんでいただいて、恐悦至極に存じます。\\n\\n御興味があれば、ゲームと人生のことを話しましょう。フィンランド人だけど日本語は喋れます。\\nmmKALLLで検索すれば見つかります。\\n\\n引き続き、何卒宜しくお願い致します。\\n\\nエサより\\n\\nCleared in ' + gs.frames + ' frames.\\n')\n }", "title": "" }, { "docid": "77513d555ccbcc1cb9a2bff8bfb90ac4", "score": "0.78617626", "text": "function endGame(){\n\t//remove functions\n\t\n\t//clear all animations sprites\n\t//stopAllAnimations()\n\n\tfinished_game = true\n\n\t\n}", "title": "" }, { "docid": "86f0c2a400bb022f098d1bb7f4a19d5b", "score": "0.7859785", "text": "function end() {\n gameScene.visible = false;\n gameWinScene.visible = true;\n\n }", "title": "" }, { "docid": "1ee7fc5d4729e555bd770816d8c361f9", "score": "0.7852894", "text": "function endGame() {\n p.onSetAppState(state => ({ newGame: false, game: { ...state.game, playedGames: 0 } }));\n p.startGame = false;\n p.ready = false;\n clearTimeout(p.timeOut1);\n clearTimeout(p.timeOut2);\n }", "title": "" }, { "docid": "b607719d56ea3b51f0991cb3f31d8f7b", "score": "0.78388447", "text": "function EndGame() {\n\tstillAlive = false\n\tLightOn(greenObject)\n\tLightOn(redObject)\n\tLightOn(yellowObject)\n\tLightOn(blueObject)\n\tlose.play()\n\treturn\n}", "title": "" }, { "docid": "8d753d5836a7e5c209e8bbbe5c12d258", "score": "0.7772513", "text": "function _endGame() {\n var allExperimentsDone = round + 1 == constants.games.length;\n sockets.forEach(function(socket) {\n socket.emit('game over', {waitingTime: (allExperimentsDone ? 0 : constants.intervalBetweenGames)});\n });\n var newScores = scores.calculateScores(word, playersBoards);\n sockets.forEach(function(socket) { socket.emit('final scores', newScores); });\n if (!allExperimentsDone) {\n currentGame = constants.games[++round];\n setTimeout(_generateGame, constants.intervalBetweenGames * 1000);\n }\n }", "title": "" }, { "docid": "034fe1a9c6f1186a7932717c7bbdb285", "score": "0.775278", "text": "function endCollectibleGame() {\n\t// If the game has started, announce the game over message to chat\n\t// We won't get this message if someone has won since the started flag is set to false before this\n\tif (GameHasStarted == true) {\n\t\tclient.say(opts.channels[0], \"The wild \" + SelectedRarity + \" '\" + SelectedCollectible + \"' escaped chat HSWP\");\n\t\t\n\t\t// Update the text to show nobody won\n\t\tHTMLUpdate(2, \"\");\n\t}\n\n\t// Set the flag that the game has ended\n\tGameHasStarted = false;\n\n\t// Clear the players array so users can play again next round\n\t// Do it here to free up memory (not much) after the game ends\n\tUsersInPlayArray = [];\n\t\n\t// Remove the results screen after this time\n\tsetTimeout(HideResultsScreen, TimeToShowGameOverScreen)\n}", "title": "" }, { "docid": "e94d0635457e1bd80ff87250a2441536", "score": "0.7751604", "text": "turnEnd(){\r\n this.isShotMade = false;\r\n this.messageHandler.sendMessage(\"gamemsg\", \"nextturn\");\r\n }", "title": "" }, { "docid": "c0883e1fab2c0b60fbf2a7a2f2617996", "score": "0.77470285", "text": "function gameEnd() {\n game.opponentsDefeated.push(\"#\" + game.opponentCharacterName);\n if (game.gameWin) {\n $(\"#character-select\").fadeOut();\n opponentSwitcher();\n $(\"#character-select\").fadeOut();\n $(\".select-header\").fadeOut();\n $(\"#win-loss-text\").text(\"YOU WIN!\");\n $(\".new-game-screen\").fadeIn(\"slow\");\n } else {\n $(\"#character-select\").fadeOut();\n opponentSwitcher();\n $(\"#character-select\").fadeOut();\n $(\"#win-loss-text\").text(\"YOU LOSE!\");\n $(\".new-game-screen\").fadeIn(\"slow\");\n }\n}", "title": "" }, { "docid": "50781272fb2a6e7302dd9042cef40411", "score": "0.7746806", "text": "checkForGameEnd(){\n this.log('checkForGameEnd')\n if(this.player.game_over){\n this.setResponse({message: this.response.message + '\\n' + this.rom.info.outro_text})\n this.actions.die()\n }\n }", "title": "" }, { "docid": "6d393e11106212997acdda883b5eba47", "score": "0.77149606", "text": "function endGame() {\n $(\".square\").css(\"background-color\",\"black\");\n self = this;\n window.clearInterval(loop);\n var thenum = $(\"#score\").text().replace( /^\\D+/g, '');\n $(\"#dialog\").html(\"Game Over<br>Your Score: \" + thenum);\n $(\"#play-button\").text(\"Play Again\");\n $(\"#instructions\").show();\n $(\"#play-button\").one(\"click\", function() {\n $(\"#instructions\").hide();\n\t\tvar myGame = new game(self.myGrid);\n\t\t$(\"#score\").text(\"Length: \" + myGame.length);\n myGame.mainLoop();\n });\n}", "title": "" }, { "docid": "eb603ae8c194ec099722c999153a4736", "score": "0.7707037", "text": "function endGame() {\n\t// Stop the spawn interval\n clearInterval(timeoutId);\n // Show the final score\n erase();\n context.fillStyle = '#000000';\n context.font = '24px Arial';\n context.textAlign = 'center';\n context.fillText('Game Over. Final Score: ' + score, canvas.width / 2, canvas.height / 2);\n}", "title": "" }, { "docid": "5148beda6900f9a02f8e97429a14d49d", "score": "0.7694315", "text": "function endGame() {\n buildModalMsg();\n stopTimer();\n showModal();\n}", "title": "" }, { "docid": "1866abad4461001cd49fe5809c93c679", "score": "0.7688365", "text": "function endGame() {\n let millisecond = millis();\n background(200, 20, 20);\n noFill();\n rect(width/2 - 100, 3*height/4 - 45, 200, 55);\n textAlign(CENTER);\n fill(0);\n textSize(150);\n text(\"Game Over\", width/2, height/2);\n textSize(40);\n text(\"(I guess not)\", width/2, 3*height/16);\n textSize(45);\n text(\"Try again\", width/2, 3*height/4);\n if (mouseX >= width/2 - 100 && mouseY >= 3*height/4 - 45 && mouseX <= width/2 + 100 && mouseY <= 3*height/4 + 10) {\n cursor(HAND);\n if (mouseIsPressed) {\n cursor(ARROW);\n state = 1;\n }\n }\n textSize(20);\n text(\"(If you'd like to of course. Maybe a different colour?)\", width/2, 13*height/16);\n}", "title": "" }, { "docid": "cccc7c4ece755f7631ceb1a2e282dbf0", "score": "0.7678863", "text": "function endGame() {\n CanClick = false;\n $(\"#board\").append(\"<div class='game-over'></div><div class='game-over-text'>Game Over</div>\");\n }", "title": "" }, { "docid": "b57610e742395e617fa4dd8d8dbd142b", "score": "0.76630265", "text": "function endGame() {\n\tdisplayStats();\n\t$('#display').html(\n\t\t'<h3>Game Over!</h3>' +\n\t\t'<p>You answered ' + correctResponses + ' correctly out of 3!</p>' +\n\t\t'<button id=\"restart\" class=\"btn btn-info btn-lg center-block\">' +\n\t\t\t'Restart Game!' +\n\t\t'</button>'\n\t);\n\trestartGame();\t\n}", "title": "" }, { "docid": "e267d228f1f0e54320d8c9bdfce39de0", "score": "0.7628681", "text": "function finishGame() {\r\n statistic.full_Time=(new Date().getTime()-start_time);\r\n $('#game').removeClass('step-3').removeClass('step-4').addClass('step-5');\r\n// $('div.game .bg-flash').css({'z-index': 10});//commented because need scrolling\r\n flashBackground('start');\r\n\r\n if (sounds.conclusion!=null){\r\n tPlay(sounds.conclusion, PRIORITY_NORMAL);\r\n }\r\n else {tPlay(sounds.finish, PRIORITY_NORMAL);}\r\n\r\n $('div.result-block div.description div').html(\"\" + value(questions.conclusion_text));\r\n recalculateScore();\r\n try {\r\n SCOSetValue(\"time\", gameTime);\r\n SCOSetValue(\"score\",totalPercent);\r\n SCOSetValue(\"completed\", 1);\r\n SCOCommit();\r\n } catch (e) {\r\n console.error(\"Scorm failed -\", e);\r\n }\r\n if('undefined' !== typeof gameloader ){\r\n gameloader.send_results(statistic);\r\n }\r\n $('#animation').fadeOut();\r\n $(document).trigger('gameFinished',[statistic]);\r\n }", "title": "" }, { "docid": "57d61b200ef7c7834b9ba42a93e11a8e", "score": "0.7625537", "text": "function endGame() {\n clearInterval(refreshIntervalId);\n}", "title": "" }, { "docid": "b19be55175e180fd718e33d1a7409725", "score": "0.7624926", "text": "function end_game() {\n $('.cow_target_container').stop()\n $('.cow_target_container').remove()\n clearTimeout(timeout)\n $('.play_area').css('display', 'none')\n $('.game_over').css('display', 'block')\n $(\".score_result\").text($(\".score_value\").text())\n}", "title": "" }, { "docid": "d6b26c716e110eee29a012d8035c5930", "score": "0.76154166", "text": "function end()\r\n{\r\n gameScene.removeChild(player);\r\n gameScene.removeChild(currentLevel);\r\n \r\n gameScene.visible = false;\r\n gameOverScene.visible = true;\r\n \r\n bullets.forEach(b=>gameScene.removeChild(b));\r\n bullets = [];\r\n \r\n removeTerrain();\r\n \r\n currentLevel = null;\r\n \r\n paused = true;\r\n}", "title": "" }, { "docid": "2b26b52226e9db5201f872707dd2df66", "score": "0.7615373", "text": "function endTurn() {\n numMoves ++;\n if (gameOver()) {\n alert(endGameMessage);\n endGame();\n return;\n } else {\n switchSides(currTurn);\n }\n }", "title": "" }, { "docid": "9f4db8eba6c81dcd56b511e471c3f1d8", "score": "0.76089317", "text": "function endGame() {\n $('.background-image').css('animation-play-state', 'paused');\n stopTurtles();\n }", "title": "" }, { "docid": "5fa3ffea51493e3a136d544b03504788", "score": "0.7607018", "text": "gameend() {}", "title": "" }, { "docid": "0270ae2ce1120d947f3fcef475d59416", "score": "0.7596096", "text": "function endGameSandBox() {\n if (timer !== 0) {\n clearInterval(timer);\n timer = 0;\n }\n displayHighScoreAndClearButton();\n gameProgressState = false;\n}", "title": "" }, { "docid": "c8ed0b2d52a2d5ffc237a6eca90be07e", "score": "0.75638497", "text": "function endGame(){\n alert('YOU WON!!');\n numGems = 3;\n gameState = 'pickPlayer';\n init();\n }", "title": "" }, { "docid": "ca58b83128e831dc9a9a00fe8d4b7a00", "score": "0.7559804", "text": "function endGame () {\r\n simon.running = false;\r\n simon.error = false;\r\n simon.level = 0;\r\n simon.gameSeq = [];\r\n simon.userSeq = [];\r\n $(\"#start-stop\").html(\"Start\");\r\n $(\".section-game-score\").hide();\r\n console.log(\"Game Ended\");\r\n}", "title": "" }, { "docid": "c81a31daa952c8451ffcdfbd97458d9b", "score": "0.7557386", "text": "function endGame()\n{\n\tvar end = screen.createLabel();\n\tend.setText(\"Final Score: \" + score + \" circle(s) in \" + timeSelect + \"s\");\n\tend.setFontSize(30);\n\tend.setLocationXY(screenX/2, screenY/2);\n\tend.setHorizontalAnchor(jsgl.HorizontalAnchor.CENTER);\n\tscreen.addElement(end);\n\n\tif(userId)\n\t{\n\t\trunMenuSubmit();\n\t}\n\telse\n\t{\n\t\trunMenu();\n\t}\n}", "title": "" }, { "docid": "d3a4e81a1929d6b662ec2634a5c4b8ae", "score": "0.75527155", "text": "function endGame(toSave){\n\tinGame = false;\n\tif (jewels)\n\t\temptyArray(jewels);\n\tif (toSave){\n\t\tdisplayScorePrompt(score);\n\t}\n\telse{\n\t\tscore = 0;\n\t\tinitMenu(); \n\t}\n}", "title": "" }, { "docid": "ffcc314e67b02d8c8919d6d16f439853", "score": "0.7536795", "text": "function game_end() {\n\t// Stop the game\n\tpause_game();\n\t// Clear the whole sketch\n\tremove();\n\t// Remove the 'lives' stats\n\tdocument.getElementById('lives').innerHTML = '';\n\n\t// Now that the game has ended check if the user have entered their userID before the game\n\tlet userID = getQuery('userID');\n\t// If user entered a userID\n\tif (userID) {\n\t\t// Create a XHTTP object\n\t\tconst xhttp = new XMLHttpRequest();\n\t\t// For now do nothing when the server responds back\n\t\txhttp.onreadystatechange = (e) => {};\n\t\t// Generate the URL endpoint to post to for updating highscore if possible and open an AJAX connection with it\n\t\txhttp.open(\"GET\", `http://localhost:3000/highscore/${userID}/${score}`);\n\t\t// Make the request\n\t\txhttp.send();\n\t}\n\n\t// Write to the user about the results and the leaderboard\n\tprint_leaderboard();\n\t// Get food trivia and display onto the canvas\n\tgetFood();\n}", "title": "" }, { "docid": "9832fe4d73635270a7845c8bc184c4ef", "score": "0.7530319", "text": "function endGameManager() {\n GameManager.player.dead = false;\n GameSettings.gameOver = true;\n GameManager.player.reset();\n pauseSound('playingSong');\n playSound('gameover');\n showGameOver();\n}", "title": "" }, { "docid": "be043bbc95d670ac3df27ef6a3c2cac0", "score": "0.7506855", "text": "quitGame() {\n\n }", "title": "" }, { "docid": "4e2eacf714e71f98f1a18d6721267050", "score": "0.75019145", "text": "function quitGame() {\n gameScreen = 0;\n gameover.stop();\n winning.stop();\n openingsong.play();\n}", "title": "" }, { "docid": "2966e1448a95744e2ed36b811c1b1d7d", "score": "0.7497289", "text": "handleGameEnd() {\n switchState(new End())\n }", "title": "" }, { "docid": "b91589b0070f83415d724299809afeb7", "score": "0.7494864", "text": "function endGame() {\n\n // Displays game-end-div\n $(\"#game-end-div\").show();\n $(\"#game-container\").hide();\n $(\"#finishGame\").hide();\n clearInterval(intervalId);\n\n // Increments the number of right and wrong answers and unanswered questions\n for (i = 0; i < answerList.length; i++) {\n if (answerList[i] == CORRECT) {\n correctAnswer++;\n } else if (answerList[i] == INCORRECT) {\n incorrectAnswer++;\n } else {\n emptyAnswer++;\n }\n }\n $(\"#correctAnswers\").text(correctAnswer);\n $(\"#incorrectAnswers\").text(incorrectAnswer);\n $(\"#emptyAnswers\").text(emptyAnswer);\n }", "title": "" }, { "docid": "e5c8ae6c00e404e24d5411ad2054be75", "score": "0.7480889", "text": "function endGame() {\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n levelNumber = 0;\r\n $(\"#level-title\").text(\"Game Over, Press Any Key to Restart\");\r\n\r\n // wrong answer stylesheet\r\n document.getElementsByTagName(\"BODY\")[0].classList.add(\"game-over\");\r\n\r\n setTimeout(function() {\r\n document.getElementsByTagName(\"BODY\")[0].classList.remove(\"game-over\");\r\n }, 100);\r\n var wrongSound = new Audio('sounds/wrong.mp3');\r\n wrongSound.play();\r\n\r\n return;\r\n}", "title": "" }, { "docid": "e01533e2bfda3625502b2e7f24ffe9db", "score": "0.7475184", "text": "function stopGame(){\n\tconsole.log(\"Game has finished\");\n\trunning = false;\n\t//calls the addscore method for the highscores table.\n\taddScore(score);\n\tscore = 0;\n\tlevel = 0;\n\n\tplayers = [];\n\tzombies = [];\n\tbullets = [];\n\n\tenvironment = new house();\n}", "title": "" }, { "docid": "1c2f2d22f8f6c5c6efde710eee015399", "score": "0.7461096", "text": "function endGame() {\n clearInterval(intervalId);\n timerOn = false;\n $(\".answer\").text('game done');\n $(\".rightORWrong\").text(\"You got: \" + answersRight + \" Right \" + \"And: \" + answersWrong + \" Wrong!\")\n }", "title": "" }, { "docid": "af50984ba96a2ac6f8a5bae5476c4815", "score": "0.7456504", "text": "function endGame() {\n updateDbScore();\n question.textContent = \"GAME OVER!\";\n answer.textContent = `FINAL SCORE: $${score}`;\n}", "title": "" }, { "docid": "c3b3d26c50d5f14347b4b7f237f089f9", "score": "0.7456148", "text": "function endGame()\n{\n\t// This special Unity function loads the scene with the exact name that you send it - as long as the scene is in the project's build settings!\n\t// If you have trouble with this, double check the name, spelling, case and build settings\n\tApplication.Quit();\n}", "title": "" }, { "docid": "34854e446507bfa1c576253248ea98de", "score": "0.7450641", "text": "function endGame() {\n fadeIn(document.getElementsByClassName('popup-outter')[0], 200, 'block');\n document.querySelector('.pop-score').textContent = timer.textContent;\n\n updateStars();\n intervalManager(false);\n increaseDifficulty(false);\n gameStarted = false;\n\n document.querySelector('.refresh-container').addEventListener('click', function () {\n startNewGame();\n });\n}", "title": "" }, { "docid": "8b4deeec193be6138795ebe1189e2b06", "score": "0.7440268", "text": "function end(){\r\nif(mushroomG.isTouching(mario) || turtleG.isTouching(mario)){\r\n\r\n if(life > 0){\r\n \r\n life -= 1;\r\n heart1.destroy();\r\n mushroomG.destroyEach();\r\n turtleG.destroyEach();\r\n block.destroyEach();\r\n livelost.play();\r\n }else {\r\n \r\n mushroomG.destroyEach();\r\n turtleG.destroyEach();\r\n block.destroyEach();\r\n gameState = END;\r\n loseSound.play();\r\n }\r\n \r\n }\r\n}", "title": "" }, { "docid": "fb85de4e1855c44e31fe047ddaa42bb7", "score": "0.7439913", "text": "function endGame(reason) {\r\n console.log(reason);\r\n\r\n // if out of lives resets game completely\r\n if (interface.lives < 0) {\r\n interface.setup();\r\n entities.setup();\r\n }\r\n\r\n // if all 5 finishes reached generates new level\r\n if (interface.finishes > 0 && interface.finishes % 5 === 0) {\r\n entities.setup();\r\n }\r\n\r\n // resets player state\r\n player.setup();\r\n}", "title": "" }, { "docid": "bd3e19cce73cf3e0f32d2d3eb3fb5ec8", "score": "0.74362016", "text": "endGame() {\n this.players.forEach(player => player.handleGameEnd());\n }", "title": "" }, { "docid": "2bfcdaccc559e0f24582141d1b5ed2be", "score": "0.7435301", "text": "function endGame(){\n\t\t\t\tgameMessage = \"PRESS SPACEBAR TO START\";\n\t\t\t\tsplashScreenOn = true;\n\t\t\t}", "title": "" }, { "docid": "e1f5d530faf32d0d793a76913bd72a4a", "score": "0.7434062", "text": "function endGame() {\n\n\t $(\"#quizMessage,#questions,#next,#timer,#choiceList\").hide();\n\t\t\n\t$(\"#timeRemaining\").text(\"Time remaining: \" + time);\n\t$(\"#correctAnswer\").text(\"Correct answers: \" + correctCounter);\n\t$(\"#incorrectAnswer\").text(\"Incorrect answers: \" + incorrectCounter);\n\t$(\"#remaining\").text(\"Remaining Questions: \" + remainingQuestions);\n\n\tclearInterval(intervalId);\n\t$(\"#restart, #results, #clip\").show();\n}", "title": "" }, { "docid": "c5a219c3b2519ce641ab20c5ac9be21e", "score": "0.7426843", "text": "end() {\n console.log('[PLAY] end')\n\n this.sound.play('explosion')\n this.registry.destroy()\n this.events.off()\n game.scene.switch('play', 'end')\n this.cursors.right.isDown = false\n this.cursors.left.isDown = false\n\n console.log('[PLAY] CURSORS OFF')\n this.scene.stop()\n }", "title": "" }, { "docid": "a2ab0e28319d42d2d31b0e7bf3df813f", "score": "0.7422013", "text": "function endGame() {\n game.world.removeAll();\n let endGame;\n if (gameOptions.initialPot - game.pot < 0) {\n endGame = game.add.text(\n game.world.centerX,\n game.world.centerY,\n \"Game Ended.Player Won \" + $ + (game.pot - gameOptions.initialPot),\n {\n fill: \"#FFF\"\n }\n );\n } else {\n endGame = game.add.text(\n game.world.centerX,\n game.world.centerY,\n \"Game Ended.Player lost \" + $ + (gameOptions.initialPot - game.pot),\n {\n fill: \"#FFF\"\n }\n );\n }\n endGame.anchor.setTo(0.5);\n}", "title": "" }, { "docid": "0d668576cd8c093bcf73dfde8da82dca", "score": "0.74096", "text": "endRound() {\n this.activeGameObjects[\"Crate\"] = []\n restartMenu.style.visibility = \"visible\";\n finalScoreText.textContent = \"You scored: \" + this.ui.calculateScore();\n this.isRoundActive = false;\n }", "title": "" }, { "docid": "01747fcd9e00e1c8d70ccf27e50bab4b", "score": "0.74074715", "text": "function endGame(result) { // result can be failed or passed\n if (result == true) {\n clearInterval(gameVars.timeDisplayInterval);\n // The player won the game\n } else {\n // The player failed the game\n // Get the faied reason from gameVars.failedReason\n // Cancel the display timer dependent on a reason for a fail\n }\n}", "title": "" }, { "docid": "193d525481f6eb84575368ce0df50e7c", "score": "0.7404259", "text": "static end(key) {\n game.scene.wake('playerUI_scene');\n game.scene.wake('gameplay_scene');\n game.scene.stop('minigame_scene_manager');\n game.scene.stop(key);\n }", "title": "" }, { "docid": "5fb60295965ab62183794876046cd30c", "score": "0.7403241", "text": "function endGame(exit){\n var fProcEnd = exit ? function() { process.exit() } : function() { return };\n snakeBot.gameEnded();\n\n if(options.gamelink && gameLink){\n open(gameLink.getUrl());\n } else if (gameLink) {\n log(\"GameLink: \" + gameLink.getUrl());\n }\n\n fProcEnd();\n}", "title": "" }, { "docid": "6b3c534c12d13dc82f52f7dfe7650ccf", "score": "0.73946995", "text": "function endGame() {\n $(\"their-card\").classList.add(\"hidden\");\n $(\"results-container\").classList.add(\"hidden\");\n $(\"endgame\").classList.add(\"hidden\");\n $(\"pokedex-view\").classList.remove(\"hidden\");\n $(\"start-btn\").classList.remove(\"hidden\");\n $(\"flee-btn\").classList.add(\"hidden\");\n $(\"title\").innerText = \"Your Pokedex\";\n qs(\"#my-card .buffs\").innerHTML = \"\";\n qs(\"#their-card .buffs\").innerHTML = \"\";\n qs(\"#my-card .hp-info\").classList.add(\"hidden\");\n }", "title": "" }, { "docid": "b7aa6d4dac5031787fb5699168f9b417", "score": "0.73874664", "text": "function endGame() {\n // stop the interval timer\n clearInterval(interval);\n\n // turn off event handlers\n $(document).off();\n }", "title": "" }, { "docid": "b2ea7d4ac91e9d156d87245a54331a8a", "score": "0.7376979", "text": "endGame() {\r\n const winner = this.getNextPlayer().id;\r\n alert(\"Congratulations Warrior \" + winner + \" Won the fight!\");\r\n }", "title": "" }, { "docid": "a5ef110917afd04adf09edb4174f77cc", "score": "0.7362897", "text": "function losingScreen() {\n endGame();\n }", "title": "" }, { "docid": "600cde3d67937cdbaced0525dd295fa5", "score": "0.7360949", "text": "function endGame() {\n playing = false;\n noLoop();\n}", "title": "" }, { "docid": "2e7bb6adce914950d1801d9de5f9965d", "score": "0.7352743", "text": "function endGame() {\n\n if (map[queenRow][queenColumn] === OPERA) {\n\n //Display the game message\n alert(\"BRAVO! THE QUEEN ARRIVE ALIVE\");\n\n } else if (gameObjects[queenRow][queenColumn] === THIEF) {\n\n alert(\"YOU LOST.THE QUEEN IS ATTACK BY THE THIEF!\");\n\n } else if (map[queenRow][queenColumn] === SEINE) {\n\n alert(\"YOU LOST. DIED IN THE SEINE\");\n\n }\n //Remove the keyboard listener to end the game\n window.removeEventListener(\"keydown\", keydownHandler, false);\n}", "title": "" }, { "docid": "0b1244dd148b80fa939853136f6a0705", "score": "0.7347664", "text": "function exitGame() {\r\n\t\t\t\t\t\t$.get(\"./match/exit\");\r\n\t\t\t\t\t\tif (source != null)\r\n\t\t\t\t\t\t\tsource.close();\r\n\t\t\t\t\t\t$(\"tr\").remove(); // clear players table\r\n\t\t\t\t\t\t$(\"#joinButton\").attr(\"class\", \"shown\");\r\n\t\t\t\t\t\t$(\"#textName\").attr(\"class\", \"shown\");\r\n\t\t\t\t\t\t$(\"#exitButton\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t\t$(\"#readyButton\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t\t$(\"#notReadyButton\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t\t$(\"#readyButton\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t\t$(\"#playersTable\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t\t$(\"#rightContentDiv\").attr(\"class\", \"hidden\");\r\n\t\t\t\t\t}", "title": "" }, { "docid": "3e86260ec88f7b82a94f179a990373f0", "score": "0.7335236", "text": "winGame() {\n this.endTimer();\n }", "title": "" }, { "docid": "7985a11c61a3331104eeba9a4b170881", "score": "0.732254", "text": "function endGame(){\n\t\t\t\t\tgameMessage = \"PRESS SPACEBAR TO START\"; // set game message\n\t\t\t\t\tsplashScreenOn = true; // show slash screen\n\t\t\t\t}", "title": "" }, { "docid": "0cf4b669ea8161bc8bd4c99f63f4c278", "score": "0.7321242", "text": "endGame() {\n clearInterval(this.timeIntervalId);\n console.log(\"cleared \" + this.timeIntervalId)\n }", "title": "" }, { "docid": "bf0b257974f1842a2a3908a3f2562923", "score": "0.7310307", "text": "endBattle() {\n\t\tlet battle = this.getBattle();\n\t\tif (battle) {\n\t\t\tbattle.end();\n\t\t\tdelete this.battle;\n\t\t}\n\t}", "title": "" }, { "docid": "a7ee853f98b2e06f43be80555cb55d91", "score": "0.7307763", "text": "function end() {\n\tsetTimeout(function() {musicGame.pause()}, 1000);\n\thideStats();\n\tendHoles();\n\tsetTimeout(showHighscores, 1000);\n\tdocument.getElementById(\"finalButton\").onclick = finalButton;\n}", "title": "" }, { "docid": "baff65920313d1fa743a74a78986e517", "score": "0.7302328", "text": "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}", "title": "" }, { "docid": "d28769b9c132a5aa4309939078686d3a", "score": "0.7301986", "text": "function gameTermination() {\r\n clearInterval(timeInter);\r\n revealBombs();\r\n started = false;\r\n gameOn = false;\r\n}", "title": "" }, { "docid": "652dc29badf0839862653d3a2a3733da", "score": "0.729766", "text": "function endscreen(){\n\tremoveElements();\n\tbackground(100);\n\tsscore = 0;\n\tmscore = 0;\n\tround = 1;\n\tlet startAgain = createButton(\"Back to Start\");\n\tstartAgain.parent(\"gameHolder\");\n\tstartAgain.mousePressed(beginAgain);\n\tstartAgain.position((width+startAgain.offsetWidth)/2,height/2);\n\n\tif(players==1){\n\t\tlet singlePlayerAgain = createButton(\"Play Single Player Again?\");\n\t\tsinglePlayerAgain.parent(\"gameHolder\");\n\t\tsinglePlayerAgain.mousePressed(singleAgain);\n\t\tsinglePlayerAgain.position((width+singlePlayerAgain.offsetWidth)/2,3*height/4);\n\t}\n\telse if(players==2){\n\t\tlet twoPlayerAgain = createButton(\"Play Two Player Again?\");\n\t\ttwoPlayerAgain.parent(\"gameHolder\");\n\t\ttwoPlayerAgain.mousePressed(twoAgain);\n\t\ttwoPlayerAgain.position((width+twoPlayerAgain.offsetWidth)/2,3*height/4);\n\t}\n}", "title": "" }, { "docid": "43b4e1193c39844197b66bd7c1611f46", "score": "0.7291886", "text": "function endGame(currentPlayer, player1, player2, activeBoard) {\n if (currentPlayer.didIWin()) {\n currentPlayer.scoreUp();\n displayControls.setWinner(currentPlayer.marker);\n displayControls.scoreUpdate(player1.score, player2.score);\n nextGame(player1, player2, activeBoard);\n } else if (activeBoard.isFull()) {\n displayControls.showTie();\n clearPlays(player1, player2, activeBoard);\n nextGame(player1, player2, activeBoard);\n }\n }", "title": "" }, { "docid": "f48531bb54f7bac0f98fe235dcee31b7", "score": "0.7275992", "text": "function game_end() {\n game = null;\n moveProcessingFunction = null;\n movePostFunction = null;\n aiProcessingFunction = null;\n\n game_playerIDs = null;\n game_playerNames = null;\n game_aiPlayers = [];\n}", "title": "" }, { "docid": "2b92ed98f5f667d82434b8abc7dc78ef", "score": "0.7268782", "text": "function checkGameEnd() {\n\t\t\tif (rogueBot.health <= 0) {\n gameRun = false;\n //hide health bar\n $('div').css(\"display\",\"none\"); \n //fill canvas black\n ctx.fillStyle = \"black\"; \n ctx.fillRect(0,0,1200,672);\n ctx.font = fontSize + \" 'Press Start 2P'\";\n ctx.fillStyle = \"white\"; \n ctx.fillText(\"Game Over!\", 600, 100)\n ctx.fillText(\"Score: \" + calculateScore(killCount,timeDelta), 600, 200);\n\n // Restart Button\n document.getElementById(\"restart-btn\").style.display = \"block\";\n $(\"#restart-btn\").on('click', function(event) {\n event.preventDefault();\n /* Act on the event */\n $(this).hide(300);\n // gameStart();\n\n // Refreshes Page Upon Click\n location.reload();\n\n // DEBUG\n console.log(\"Game Started\")\n })\n } \n\t\t}", "title": "" }, { "docid": "afa6d891d6c7ec8ed60ec4a94cabf207", "score": "0.72635317", "text": "function quit() {\n if (!gameGoing) {\n window.alert(\"You need to start a game before you can quit! Please hit Deal\");\n } else {\n end();\n endGame();\n gameGoing = false;\n deck = [];\n set = [];\n players = [];\n board = [];\n gamePlayerControllers();\n gameCardControllers();\n // function resets EVERYTHING to basic\n }\n }", "title": "" }, { "docid": "5b190a706413f2e15cd7884a5c9fd782", "score": "0.72605044", "text": "function gameended() {\r\n}", "title": "" }, { "docid": "2e0adccce81464b88fc366091a4bd7a8", "score": "0.72480625", "text": "function endGame(gameResult){\n\tfor(let i of effectiveCombinations[gameResult.index]){\n\t\tdocument.getElementById(i).style.backgroundColor = \n\t\tgameResult.playerId === firstPlayer ? \"yellow\" : \"green\";\n\t}\n\tfor(let i = 0; i < spots.length; i++){\n\t\tspots[i].removeEventListener('click', nextTurn, false);\n\t}\n\twinnerAnouncement(gameResult.playerId === firstPlayer ? \"You won!\" : \"You lost!\");\n}", "title": "" }, { "docid": "611d1c5fd16a107ffea1318701dda5e5", "score": "0.72475475", "text": "function EndGame()\r\n{\r\n\r\n menu = game.add.sprite(w/2, h/2, 'GameEnd'); // add sprite\r\n menu.anchor.setTo(0.5, 0.5);\r\n\r\n// Add all relavent stats\r\n scoreTextEnd = game.add.text(w/2+20,h/2-35, '', { font: '32px Arial', fill: '#fff' })\r\n levelTextEnd = game.add.text(w/2+25,h/2 +2, '', { font: '32px Arial', fill: '#fff' })\r\n killTextEnd = game.add.text(w/2-15,h/2+38, '', { font: '32px Arial', fill: '#fff' })\r\n killTextEnd.text = '' + kill\r\n scoreTextEnd.text = '' + score\r\n levelTextEnd.text = '' + level;\r\n\r\n\r\n// setup for ending game\r\n RestartButton.onDown.add(restartGame,this)\r\n RestartButton.inputEnabled = true\r\n Pbutton.visible = false\r\n hide(StarFireText,BulletText,RocketText,BulletPowerText,ROFText,ShieldText,spaceGoldText,Buybutton)\r\n show(RestartText)\r\n RestartText = \"PRESS R TO RESTART THE GAME\"\r\n HighScoreText.visible = true\r\n HighScoreText.text = \"Your HIGHEST SCORE IS : \" + localStorage.getItem('HighestScore')\r\n platforms.visible = false\r\n scoreText.visible = false\r\n lifeText.visible = false\r\n levelText.visible = false\r\n RightHUD.visible = false\r\n RightHUD.animations.stop(null, true);\r\n RightHUD.destroy()\r\n DeathAudio.play()\r\n game.paused = true;\r\n}", "title": "" } ]
0c67239e163115c58dcfb754fb3b4663
Actions are especially for Async but should be used with Sync too Sync
[ { "docid": "76eb7b8b3a276f81686466b5796e9d07", "score": "0.0", "text": "syncUpdateIncrement({ commit }, payload) {\n commit('updateIncrement', payload);\n }", "title": "" } ]
[ { "docid": "1333fce392d393973105363405e2b4a3", "score": "0.6562806", "text": "function asynAction() {\n return dispatch => {\n\tfetch(\"server.php\").then(\n\t response => response.json(),\n\t error => console.log(error)\n\t).then(data => {\n\t dispatch(data);\t//{type: \"ADD\"}\n\t});\n };\n}", "title": "" }, { "docid": "5f83fa01672673669cad87ed2b840ba9", "score": "0.6519162", "text": "syncActions() {\n this.getActions().forEach(action => {\n if (this.actionbar) {\n if (!action.state || (action.state && action.state(this, this.doc) >= 0)) {\n const event = action.event || 'click';\n action.btn[`on${event}`] = e => {\n action.result(this, action);\n this.updateActiveActions();\n };\n }\n }\n });\n }", "title": "" }, { "docid": "dfe8fa0109abbd478d0f44df4da46e4f", "score": "0.6359026", "text": "applySyncActions(syncActions) {\n console.log(`Applying ${syncActions.length} sync actions`);\n\n /* Override For Testing\n let tmpSyncActions = [\n {\n \"objectID\": '100,1,8',\n \"action\": \"RESET\",\n \"objectName\": \"ANSWER\"\n }\n ];\n */\n syncActions.forEach((action) => {\n switch (action.action) {\n case 'DELETE':\n case 'COMPLETE':\n this.$store.dispatch('removeItem', action);\n break;\n case 'RESET':\n this.$store.dispatch('resetItem', action);\n break;\n }\n });\n }", "title": "" }, { "docid": "38ae468f9f3e4d91c1c7ad325b3e9ad6", "score": "0.62069535", "text": "applySyncActions(syncActions) {\n\t\t\t\tconsole.log(`Applying ${syncActions.length} sync actions`);\n\n\t\t\t\t/* Override For Testing\n\t\t\t\tlet tmpSyncActions = [\n\t\t\t\t\t{\n\t\t\t\t\t \"objectID\": '100,1,8',\n\t\t\t\t\t \"action\": \"RESET\",\n\t\t\t\t\t \"objectName\": \"ANSWER\"\n\t\t\t\t\t}\n\t\t\t\t];\n\t\t\t\t */\n\n\t\t\t\tsyncActions.forEach((action) => {\n\t\t\t\t\tswitch (action.action) {\n\t\t\t\t\t\tcase 'DELETE':\n\t\t\t\t\t\tcase 'COMPLETE':\n\t\t\t\t\t\t\tthis.$store.dispatch('removeItem', action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'RESET':\n\t\t\t\t\t\t\tthis.$store.dispatch('resetItem', action);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "4a4b7ec4b422c7f8daa0c540f5ccc900", "score": "0.61836207", "text": "dispatchAsync(promise, types, payload){\nconst { request, success, failure } = types;\nthis.dispatch({ type: request, payload: Object.assign({}, payload) }); promise.then(\nresponse => this.dispatch({\ntype: success,\npayload: Object.assign({}, payload, { response })\n}),\nerror => this.dispatch({\n type: failure,\n payload: Object.assign({}, payload, { error })\n })\n); }", "title": "" }, { "docid": "1a043701c438fd624b72fafea5f32e82", "score": "0.6178133", "text": "sync() {}", "title": "" }, { "docid": "1a043701c438fd624b72fafea5f32e82", "score": "0.6178133", "text": "sync() {}", "title": "" }, { "docid": "11470a49edd283e100f6e577487400de", "score": "0.59704757", "text": "function makeAsyncAction (controller, action, args, options) {\n\n // check-before callback\n if (options.checkCb != null && options.checkCb != undefined && !eval(options.checkCb+\"()\"))\n return;\n\n // request parameters\n let req_params = \"controller=\"+controller+\n \"&action=\"+action+\n \"&args=\"+JSON.stringify(args);\n\n\n $.ajax({\n contentType: 'application/x-www-form-urlencoded',\n method: 'POST',\n url: 'MVC/API/asyncDispatcher.php',\n data: req_params,\n success: function (payload) {\n if (options.redirectTo != null && options.redirectTo != undefined)\n window.location.replace(options.redirectTo);\n\n if (options.onSuccess != null && options.onSuccess != undefined) {\n if (options.idForCallback != null && options.idForCallback != undefined)\n eval(options.onSuccess + '(\"' + options.idForCallback + '\", \"'+payload+'\")');\n else\n eval(options.onSuccess + '(\"'+payload+'\")');\n }\n },\n error: function (xhr, ajaxOptions, thrownError) {\n let error = \"\";\n if (xhr.status === 401)\n window.location.replace(\"./?page=401Unauthorized\");\n else if (xhr.status === 500)\n error = \"Internal Server Error\";\n else\n error = xhr.responseText;\n\n if (options.onFailure != null && options.onFailure != undefined) {\n if (options.idForCallback != null && options.idForCallback != undefined)\n eval(options.onFailure + '(\"' + options.idForCallback + '\", ' + xhr.status + ', \"'+error+'\")');\n else\n eval(options.onFailure + '(' + xhr.status + ', \"'+error+'\")');\n }\n }\n });\n}", "title": "" }, { "docid": "b5640240a4382c2dff35fa4ec72c15ee", "score": "0.596978", "text": "function sync(){}", "title": "" }, { "docid": "8a2b8a2bec7a9accbcec6a79cc6646ac", "score": "0.59484494", "text": "function asyncActionCreator() {\n // this function is called by thunk middleware\n return function(dispatch, getState) {\n console.log('my async code is here');\n setTimeout( () => {\n console.log('async code');\n dispatch(increment(200));\n }, 5000);\n }\n}", "title": "" }, { "docid": "b5dbbf0620823894389b26dcdff1d9e3", "score": "0.59452313", "text": "sync() {\n\n }", "title": "" }, { "docid": "3f4107cb967c4f53e44b1527947a67d0", "score": "0.59442896", "text": "remoteAction(next, action) {\n\t\t\t\texpect(action).toBeDefined();\n\t\t\t\treturn ctx => {\n\t\t\t\t\tFLOW.push(`${mwName}-remoteAction-before-${ctx.params.name}`);\n\t\t\t\t\treturn next(ctx).then(res => {\n\t\t\t\t\t\tFLOW.push(`${mwName}-remoteAction-after-${ctx.params.name}`);\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "34ee7333e5bac0e7d1ca50ef56015005", "score": "0.5935589", "text": "dispatch(data) {\n // For example:\n // If we move all the async functionality to the Actions we can turn the Stores completely synchronus.\n setTimeout(() => {\n // Emmit a dispatch event manually when we need it.\n this.emmitDispatch(data);\n }, 1000);\n }", "title": "" }, { "docid": "c909095e5c098c6a949169ccabe6140a", "score": "0.59051245", "text": "sendActionAsync(action) {\n if (action.$.id === undefined) action.$.id = lastActionId++\n return new Promise((resolve, reject) => {\n let cb = ({ack, rej}) => {\n if (ack && ack.$.actionid == action.$.id) {\n resolve(ack)\n this.removeListener('message', cb)\n }\n if (rej && rej.$.actionid == action.$.id) {\n reject({code: rej.$.code, message: rej.$.text})\n this.removeListener('message', cb)\n }\n }\n this.on('message', cb)\n try {\n this.send({ action })\n } catch (err) {\n this.removeListener('message', cb)\n }\n });\n }", "title": "" }, { "docid": "dc734b2c59b39b8c8e03f67f9c5559da", "score": "0.58537793", "text": "function sync() {\n }", "title": "" }, { "docid": "6c1ad44134ffdd1b2c6267130d368b42", "score": "0.5837231", "text": "execRequests(actions){\n return Promise.all(\n actions.map( ( {method,path,data} )=>{\n return this[method](path,data);\n })\n );\n }", "title": "" }, { "docid": "4248753bba188f3765f03d6f5cdcee7c", "score": "0.5827584", "text": "function runActions() {\n if (avalon.isRunningActions === true || avalon.inTransaction > 0) return;\n avalon.isRunningActions = true;\n var tasks = avalon.pendingActions.splice(0, avalon.pendingActions.length);\n for (var i = 0, task; task = tasks[i++];) {\n task.update();\n delete avalon.uniqActions[task.uuid];\n }\n avalon.isRunningActions = false;\n }", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3ac651e559465c9156febf2695d2a7ab", "score": "0.58263206", "text": "function SYNC() {}", "title": "" }, { "docid": "3656103a3a7be76d54c35abb61b50e27", "score": "0.5809844", "text": "async 0(arg) {}", "title": "" }, { "docid": "9bac3eed2967bae08411d6d7236544ff", "score": "0.580721", "text": "async finishedSync(index, properties, property_id){\n\n properties[index].sync = 3;\n //console.log('update PROPERTY');\n // console.log('Sync finished PROPERTY');\n //console.log(properties[index]);\n\n await AsyncStorage.setItem(TableKeys.PROPERTY, JSON.stringify(properties) ); //TODO\n\n //console.log('calling UI actions');\n\n //update the front end\n SyncActions.syncFinished(property_id); //TODO\n\n }", "title": "" }, { "docid": "675eca710c7ff9069b36562c8199e803", "score": "0.5720731", "text": "sync(){\n\t\t\n\t}", "title": "" }, { "docid": "d236554e70362c7a6dd4f3f87d097ac0", "score": "0.572044", "text": "handleActions(action) {\n switch(action.type) {\n case \"CREATE_TODO\": {\n this.createTodo(action.text);\n break;\n }\n case \"RECEIVE_TODOS\": {\n this.todos = action.todos;\n this.emit(\"change\");\n break;\n }\n }\n }", "title": "" }, { "docid": "e8a4b4e42ab9ce345bc38691001f290c", "score": "0.570954", "text": "action(actionName, payload) {\n\treturn new Promise((resolve, reject) => {\n if (actionName in this.actions) {\n\t\tif (this.actions[actionName].length > 0) {\n for (let func of this.actions[actionName]) {\n\t\t\tfunc(payload);\n\t\t\tresolve(actionName);\n }\n\t\t} else {\n let msg = \"No listeners for action: \" + actionName;\n\t\t reject(new Error(msg));\n\t\t}\n } else {\n\t\tlet msg = 'No Action with the name {Action} found!'\n\t\t .replace('{Action}', actionName);\n\t\treject(new Error(msg));\n }\n\t});\n }", "title": "" }, { "docid": "edda7ca97bcdc858acb9f86d5b7d7807", "score": "0.56879354", "text": "act(action, args) { throw ('act() not implemented') }", "title": "" }, { "docid": "6773d126cbaa60123c40bc4c1774ff46", "score": "0.5686801", "text": "postSyncAction (objectName, objectId, action) {\n let vm = this;\n let request = {\n syncAction: {\n objectName: objectName,\n objectId: objectId,\n action: action\n }\n };\n }", "title": "" }, { "docid": "87b3279976ce61b7412e6e30f145e266", "score": "0.56768155", "text": "cmd_await_all() {}", "title": "" }, { "docid": "51d637ed27139847b7985e3cbbf5d1a1", "score": "0.5675097", "text": "async() {\n async = true;\n }", "title": "" }, { "docid": "93c60105ec52b65e56de3686c4cb1bad", "score": "0.56659573", "text": "action() {}", "title": "" }, { "docid": "93c60105ec52b65e56de3686c4cb1bad", "score": "0.56659573", "text": "action() {}", "title": "" }, { "docid": "f36909ec3bd4b771fa7b8eebc8bf65b7", "score": "0.56651694", "text": "defer(...actions)\n\t\t{\n\t\t\tthis.actions.push(...actions);\n\t\t}", "title": "" }, { "docid": "c9828fc69bcc7fe197b650967a43abe4", "score": "0.5644352", "text": "execute(action) {\n this._internalState.execute(action);\n }", "title": "" }, { "docid": "a28ba5d198e89eadcee8018b03b397c6", "score": "0.56217927", "text": "waitFor(action) {\n const enable = this.complete.bind(this);\n action.then(enable, enable);\n }", "title": "" }, { "docid": "ff302e075948a5c19c7493345441416a", "score": "0.5615861", "text": "componentDidMount() {\n this.props.dispatch({ \n type: 'CLEAR_EVENT_DETAILS' \n });\n this.props.dispatch({\n type: 'FETCH_LOCATIONS'\n });\n this.props.dispatch({\n type: 'FETCH_TAG_LIST'\n });\n this.props.dispatch({\n type: 'FETCH_CONVENTION'\n });\n this.props.dispatch({\n type: 'FETCH_SPONSORS'\n });\n }", "title": "" }, { "docid": "576bc191e931db1d5f2cf500f027fb72", "score": "0.5613233", "text": "_performAction(action, entry) {\n const url = new URL(EXTENSION_API_PATH, this.serverConnectionSettings.baseUrl);\n let request = {\n method: 'POST',\n body: JSON.stringify({\n cmd: action,\n extension_name: entry.name\n })\n };\n const completed = services_lib[\"ServerConnection\"].makeRequest(url.toString(), request, this.serverConnectionSettings).then(response => {\n model_Private.handleError(response);\n this.triggerBuildCheck();\n return response.json();\n });\n completed.then(() => {\n this.serverConnectionError = null;\n }, reason => {\n this.serverConnectionError = reason.toString();\n });\n this._addPendingAction(completed);\n return completed;\n }", "title": "" }, { "docid": "3a0c9c9e700e8b878e136b74886486af", "score": "0.5608132", "text": "async 0() {}", "title": "" }, { "docid": "f685c8b44683d31b002be412bc7fd75e", "score": "0.56027895", "text": "function updateActCallback(){\n\t\n}", "title": "" }, { "docid": "464c4f241659e83ae15bfa08425b0491", "score": "0.5597914", "text": "execRequests(actions) {\n return Promise.all(\n actions.map(action => {\n return this[action.method](action.path, action.data);\n }));\n }", "title": "" }, { "docid": "e7010ac9b0b53a0afc3c939e0a199b5c", "score": "0.5591595", "text": "function Dispatch(){}", "title": "" }, { "docid": "927314e795e2f14245eb6c6ea19c786a", "score": "0.55836517", "text": "function queue_action(action) {\n action_queue.push(action);\n }", "title": "" }, { "docid": "68cba066d3a82e66c8ad5d1458e21425", "score": "0.55831814", "text": "function actionsLoaded(actions) {\n $scope.actions = actions;\n $scope.applyAsync();\n }", "title": "" }, { "docid": "59dd7372f873b7a43ad7103e6a55fbdd", "score": "0.55774546", "text": "async asyncMethod() {}", "title": "" }, { "docid": "6bcb2208d3a19ad2176825e9c4761b47", "score": "0.55701625", "text": "function actionAnyAsyncRequest() {\n return {\n type: constants.ANY_ASYNC_REQUEST,\n payload: {},\n error: false\n }\n}", "title": "" }, { "docid": "268f6a1f5cab832beb07f7f816359675", "score": "0.55659497", "text": "onSync(matchID, syncInfo) {\r\n if (matchID == this.matchID) {\r\n const action = turnOrder.sync(syncInfo);\r\n this.store.dispatch(action);\r\n }\r\n }", "title": "" }, { "docid": "98bbdc306f98f29348dc97c5118be1b3", "score": "0.55648655", "text": "componentDidMount() {\n this.props.dispatch({type: 'FETCH_ORDERS_COMPLETED', payload: {user_id: this.props.store.user.id}});\n this.props.dispatch({type: 'FETCH_ORDERS_UNCOMPLETED', payload: {user_id: this.props.store.user.id}});\n }", "title": "" }, { "docid": "2bc77408b5106e01969ddbafb4585647", "score": "0.5563956", "text": "async update ({}) {}", "title": "" }, { "docid": "163191cdcc4aa01e1bfaebfd328dc23c", "score": "0.55357623", "text": "async alwaysAfter () {}", "title": "" }, { "docid": "5691d0ad7a1e356d99f6eaa169ddea52", "score": "0.5535085", "text": "async test() {\n //some testing\n }", "title": "" }, { "docid": "efaeae67d9a6bb68dd41143827b00fd8", "score": "0.5531338", "text": "async function execute () {\n try {\n const data = await Runner().controller()\n if (data) transfer(null, data)\n else transfer(null)\n } catch (err) {\n Logger().error(err)\n // eslint-disable-next-line no-undef\n transfer(err)\n }\n}", "title": "" }, { "docid": "34e439fe6d2d5463902b74cb420dde33", "score": "0.5524397", "text": "async function store() { }", "title": "" }, { "docid": "f72d7a92528728b8b09933e2d3876660", "score": "0.5520029", "text": "_$async() {\n super._$async();\n\n this._value.async = this._node.async;\n }", "title": "" }, { "docid": "a41b9b8393df6498d04a3b0c4ebcf899", "score": "0.5512396", "text": "static async onAction(socket, action, cb) { return new Promise((resolve, reject) => {\r\n Promise.resolve()\r\n .then(() => this.onData(socket, message => {\r\n if(message.packet.action === action) {\r\n Promise.resolve()\r\n .then(() => cb(message))\r\n .catch(err => this.log(err));\r\n };\r\n }))\r\n .then(resolve)\r\n .catch(reject);\r\n })}", "title": "" }, { "docid": "1164702e357cc11e9fb1ca182b9fdd7d", "score": "0.5510245", "text": "async function changeActivity() {\n // const locationId = getLocationId();\n // console.log(\"locationId\", locationId);\n // const id = await getId();\n // await console.log(id);\n if (selectedActivity < rActivity.length - 1) {\n let nextActivity = selectedActivity + 1;\n dispatch(setSelectedActivity(nextActivity));\n } else {\n dispatch(setSelectedActivity(0));\n }\n console.log(\"next activity\", selectedActivity);\n }", "title": "" }, { "docid": "c5c71fd6abb6413a73b93e036cbba624", "score": "0.550992", "text": "run(taskID) {\n let actions = this._tasks[taskID];\n if (actions !== undefined) {\n let result = Promise.resolve(this._model)\n for (let i = 0; i < actions.length; i++) {\n let actionID = actions[i];\n let action = this._actions[actionID];\n if (action !== undefined) {\n result.then(model=>{\n return new Promise((resolve, reject) => {\n action.apply(this, [model, resolve, reject]);\n })\n });\n } else {\n return Promise.reject(\"No Action found for given action ID\")\n }\n }\n return result;\n }\n return Promise.reject(\"No Actions found for given task ID\")\n }", "title": "" }, { "docid": "054a4231d32299ebf1a5727a13f02e4e", "score": "0.55065393", "text": "function queue_action(action) {\n action_queue.push(action);\n }", "title": "" }, { "docid": "a8cf1e52b653d05c1a36060dfbcf86bb", "score": "0.5500821", "text": "async function performAPICalls() { }", "title": "" }, { "docid": "f52f8054e72c17fe0ba43b998ab9f5d2", "score": "0.54990804", "text": "runActions() {\n if (this.actions.length == 0)\n return;\n // Add first promise\n // let curPromise = this.actions[0](this, null);\n let curPromise = this.getPromiseMiddleware(0)(this, null);\n for (let i = 1; i < this.actions.length; i++) {\n let actionConfig = this.actions[i].actionConfig;\n // Add check stop promise\n curPromise = curPromise.then(result => {\n return new Promise((resolve, reject) => {\n if (this.needStopActions())\n reject(\"Need stop\");\n else\n resolve(result);\n });\n });\n // Add every 'then'\n if (actionConfig && actionConfig.isFinally) {\n curPromise = curPromise.finally(() => {\n return this.getPromiseMiddleware(i)(this, null);\n });\n }\n else {\n curPromise = curPromise.then(res => {\n return this.getPromiseMiddleware(i)(this, res);\n });\n }\n }\n curPromise.catch(reason => {\n console.log('catched error in state: ' + reason);\n });\n }", "title": "" }, { "docid": "421aa37190c20e8685e9095d69772dca", "score": "0.5497166", "text": "async after () {}", "title": "" }, { "docid": "f8df286006493d6db0bed24900b20e7b", "score": "0.54920727", "text": "function otherTasks() {}", "title": "" }, { "docid": "5d9b85772dfbdb4da6d931f8e426f86e", "score": "0.5471388", "text": "execAction(position, vimState) {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('Not implemented!');\n });\n }", "title": "" }, { "docid": "24b0e1ad7d1d7c3fade80343fbbace4f", "score": "0.5460473", "text": "syncFunds(funds, actionName = '执行') {\n this.globalData.funds = funds;\n\n wx.showLoading({ title: `${actionName}中...`, mask: true });\n\n wx.cloud.callFunction({ name: 'sync', data: { funds } })\n .then((res) => {\n console.log(res.result.code);\n\n wx.hideLoading();\n\n wx.showToast({ title: `${actionName}成功` });\n\n this.switchHome();\n })\n .catch((err) => {\n console.error(err);\n\n wx.hideLoading();\n\n wx.showToast({ title: `${actionName}失败`, icon: 'none' });\n });\n }", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.5458829", "text": "async started() {}", "title": "" }, { "docid": "d75e129e96aa1e14181656f42b9d3f54", "score": "0.5458684", "text": "actions() {\n return _actions;\n }", "title": "" }, { "docid": "c79f1c0016ee64b47f7ee31bb94456d3", "score": "0.5458495", "text": "async function performAction(keyId, action, data) {\n\n logger.debug('entering performAction....');\n logger.debug('the function is ' + action + ' and the data is ' + data);\n\n let authToken = await getAuthToken(process.env.IBM_API_KEY);\n\n const headers = {\n 'bluemix-instance': process.env.KEY_PROTECT_INSTANCE,\n 'Accept': 'application/vnd.ibm.kms.key_action+json',\n 'Content-Type': 'application/vnd.ibm.kms.key_action+json',\n 'Prefer': 'return=representation',\n 'Authorization': 'Bearer ' + authToken.access_token\n }\n\n const path='/api/v2/keys/' + keyId + '?action=' + action;\n logger.debug('The path for wrapping the key is ' + path);\n\n const options = {\n hostname: 'us-south.kms.cloud.ibm.com',\n port: 443,\n path: path,\n method: 'POST',\n headers: headers\n }\n\n let postData = {};\n\n if(action ==='wrap') {\n postData.plaintext = data\n\n } else { // this is an unwrap\n postData.ciphertext = data\n }\n\n\n logger.debug('the postData is ' + JSON.stringify(postData));\n\n return new Promise ((resolve, reject) => {\n const req = https.request(options, (res) =>{\n\n let rawbody = '';\n\n res.on('data', d => {\n rawbody += d;\n });\n\n res.on('error', err => {\n logger.debug('exiting performAction with error....');\n reject(err)\n });\n\n res.on('end', () =>{\n logger.debug('exiting performAction with success.... returning ' + rawbody);\n body = JSON.parse(rawbody);\n resolve(body) \n })\n\n });\n req.write(JSON.stringify(postData));\n req.end();\n });\n\n}", "title": "" }, { "docid": "fe737426256f90db2bdfe1599533f94f", "score": "0.5452764", "text": "componentDidMount() {\n //Load rehearsals \n deferredDispatch(getScheduleAction());\n //Load user availabilities\n deferredDispatch(getAllAvailabilities());\n //Load setlist songs.\n deferredDispatch(getSetlistSongs());\n }", "title": "" }, { "docid": "3d0f075c63ad8dfb99bcb65883be8a8c", "score": "0.544964", "text": "@action\n async fetchDocuments() { \n this.loading = 'Fetching documents'\n const { data: fetchedDocs, error, message } = await documentApi.fetchDocuments()\n this.loading = false\n this.error = error\n this.notification = message\n if (!error) {\n fetchedDocs.forEach(json => this.updateDocFromServer(json))\n }\n }", "title": "" }, { "docid": "10499cda0b82d9e64376779df1d94ad0", "score": "0.54479283", "text": "dispatchUpdate(){\n\n }", "title": "" }, { "docid": "727bd99d510c9bace2ab6e4d40931ece", "score": "0.54478896", "text": "resetAndSync() {\r\n const action = turnOrder.reset(null);\r\n this.store.dispatch(action);\r\n this.sync();\r\n }", "title": "" }, { "docid": "719fd6c287490e198ab348f3653a0d2a", "score": "0.54469234", "text": "toggleTask(title){\r\n //building of the toogle task reduce action\r\n let action = {type:'TOOGLE_ONE_TASK', value:{taskTitle:title, doitName:this.props.doitName} }\r\n //excecution of the action\r\n this.props.dispatch(action)\r\n }", "title": "" }, { "docid": "278504389eb4b4500b981fd15d3f2914", "score": "0.544481", "text": "_registerToActions(action) {\n if(action && action.errors && (action.errors.status === 400 || action.errors.status === 401)) {\n this.logout();\n }\n\n switch(action.actionType) {\n case ActionTypes.SIGN_UP:\n this._signUp(action.json, action.errors);\n this.emit(CHANGE);\n break;\n\n case ActionTypes.LOGIN:\n this._login(action.json, action.errors);\n\n if (_errors === null) {\n ServerActions.getUser();\n } else {\n this.emit(CHANGE);\n }\n\n break;\n\n case ActionTypes.SIGN_OUT:\n this.logout();\n this.emit(CHANGE);\n break;\n\n case ActionTypes.GET_USER:\n let data = action.json.data;\n let included = action.json.included;\n let errors = action.errors;\n\n if (data) {\n _user = {\n id: data.id,\n email: data.attributes.email\n\n }\n\n let site = included[0];\n SiteStore.setSite({ id:site.id, url: site.attributes.url });\n SiteStore.setSiteId(site.id);\n ServerActions.getTutorialsAndItems(site.id);\n } else if (errors) {\n _errors = errors;\n }\n\n this.emit(CHANGE);\n break;\n\n default:\n return true;\n }\n\n return true;\n }", "title": "" }, { "docid": "5998d84c0cbd1b0aa1d53921a2f7efc5", "score": "0.5426026", "text": "handleAction(payload) {\n\n\t}", "title": "" }, { "docid": "fa20a65e42cf04cc16335d2ba7e65677", "score": "0.5419821", "text": "async processAction(connection) {\n const actionProcessor = new actionProcessor_1.ActionProcessor(connection);\n const data = await actionProcessor.processAction();\n this.emit(\"actionComplete\", data);\n }", "title": "" }, { "docid": "6f850366deb69afe1561bd49bbf49ac8", "score": "0.5418128", "text": "_submitAction(action) {\n if (!action.unit && action.type !== 'endTurn' && action.type !== 'surrender')\n action.unit = this.selected;\n\n const board = this._board;\n const selected = this.selected;\n\n if (selected) {\n board.clearMode();\n selected.deactivate();\n }\n\n const locked = this.locked;\n\n this.notice = null;\n this.delayNotice('Sending order...', true);\n\n this.lock();\n return this.state.submitAction(this._board.encodeAction(action))\n .then(() => {\n if (this._inReplay) {\n // Prevent or clear the 'Sending order' notice\n this.notice = null;\n this.lock(this.state.endedAt ? 'gameover' : 'readonly');\n }\n })\n .catch(error => {\n // Re-select the unit if still selected. It won't be if a revert has\n // already taken place.\n if (board.selected === selected)\n this._resumeTurn();\n else\n this.lock('readonly');\n\n if (error.code === 409) {\n // This can happen if the opponent surrendered or hit 'undo' right\n // before submitting this action. The unit is reselected and board is\n // unlocked just in case it is an undo request that will be rejected.\n this.notice = null;\n } else {\n this.notice = 'Server Error!';\n throw error;\n }\n });\n }", "title": "" }, { "docid": "71cbaca23a61405b7f0e1f7873ca101d", "score": "0.54078454", "text": "function parallelCall(actions) {\n\t//Actions can be an array or an iterator function (to allow parallel asynchronous generation of the list\n\tvar iter = actions;\n\tif (typeof(actions) != 'function') {\n\t\titer = function() {\n\t\t\tif (actions.length) {\n\t\t\t\treturn { \n\t\t\t\t\tvalue: actions.shift(),\n\t\t\t\t\tdone: false\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn { \n\t\t\t\t\tvalue: null,\n\t\t\t\t\tdone: true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n//\tconsole.log(typeof(actions));\n\n//\tconsole.log(\"Running parallel actions\");\n\tvar deferred = Q.defer();\n\tvar active = 0;\n\tvar results = [];\n\n\t//Function to process next action in the queue:\n\tvar next = function(result) {\n\n\t\tif (result) {\n\t\t\tactive --;\n\t\t\tresults.push(result[0]);\n\t\t\tdeferred.notify(result[0]);\n\t\t}\n\n\t\tvar next_action = iter();\n\t\tif (next_action.done) { \n//\t\t\tconsole.log(\"No more actions to run, waiting on \" + active + \" actions to complete\");\n\t\t\tif (!active ) {\n//\t\t\t\tconsole.log(\"Completed all actions\"); //DONE\n\t\t\t\tdeferred.resolve(results);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t//it's not done yet, but there's nothing to do, we need to wait for the list to be populated:\n\t\tif (!next_action.value) {\n//\t\t\tconsole.log(\"Starved the list of actions, waiting for more\");\n\t\t\treturn setTimeout( function() {\n\t\t\t active --;\n\t\t\t next();\n\t\t\t}, 10 );\n\t\t}\n\n\t\tif (active >= CONCURRENCY) return;\n\t\tactive ++;\n\t\tretry_count = 0;\n\t\t//Handle retrying this action with exponential backoff\n\t\tvar retry = function(err, response) {\n\t\t\t//Is the error a 403 response?\n\t\t console.log(\"Error in action\", require('util').inspect(err), action);\n\t\t\tvar exponential_backoff = function() {\n\t\t\t\tretry_count ++;\n\t\t\t var wait_seconds = Math.pow(2, retry_count);\n\t\t\t\tif (wait_seconds > MAX_WAIT) {\n\t\t\t\t\tconsole.log(\"Asked to wait more than MAX_WAIT seconds, so dieing\");\n\t\t\t\t}\n\t\t\t\tconsole.log(\"Rate limiting response from google. Waiting \" + wait_seconds);\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t//Call the action again:\n\t\t\t\t\taction().then(next).catch(retry).done();\n\t\t\t\t}, wait_seconds * 1000 + Math.random() * 1000 );\n\n\t\t\t}\n\t\t\tif (err.code == 401) { //We need to reauth?\n\t\t\t\tif (! authorising) {\n\t\t\t\t\tauthorising = true;\n\t\t\t\t\tjwtClient.authorize(function(err, tokens) {\n\t\t\t\t\t\tauthorising = false;\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.log('0 - Re-authed with google.');\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\texponential_backoff();\n\t\t\t}\n\t\t\telse if (err.code == 403) { //A google rate-limiting response\n\t\t\t\texponential_backoff();\n\t\t\t}\n\t\t\telse if (err.code == 400 ) { //Somethings broken about our request ; die to let the operator know.\n\t\t\t\tthrow err;\n\t\t\t\tprocess.exit();\n\n\t\t\t}\n\t\t\telse {\t//Who knows what's happened, let's try again in a bit:\n\t\t\t\texponential_backoff();\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tvar action = next_action.value;\n\t\taction().then(next).catch(retry).done();\n\t}\n\tfor (i = 0 ; i< CONCURRENCY; i++ ) {\n//\t\tconsole.log(\"Firing off another action\");\n\t\tnext();\n\t}\n\treturn deferred.promise;\n}", "title": "" }, { "docid": "1655c9a0fa31b2a8695a15ff92c0ad7d", "score": "0.5398191", "text": "static addCourseAsync(course) { \n return function (dispatch) {\n axios.post(base + '/courses', course)\n .then(function (response) {\n dispatch(CourseActions.createCourse(course));\n dispatch(addNotification({title: 'Success', message: 'The course ' + course.get('title') + ' was successfully added.', level: 'success' })); \n //console.log('success: addCourseAsync ' + course);\n dispatch(CourseActions.loadCoursesAsync());\n })\n .catch(function (error) {\n dispatch(addNotification({title: 'Error', message: 'Error in addCourseAsync: ' + error , level: 'error' }));\n //console.log('error response ' + error); \n });\n };\n }", "title": "" }, { "docid": "70597dfdaa9aaf1ff560c1ebe8dff3ad", "score": "0.5385729", "text": "function _furtherAction( ca ) {\n\t\t//...\n\t}", "title": "" }, { "docid": "781fcb0d2c8ce37e5b636bfc30a20aaa", "score": "0.5385577", "text": "dispatch(action) {\n state = reducer(state, action);\n subscribers.forEach(subscriber => subscriber());\n }", "title": "" }, { "docid": "81f91df712c9da4733b3ad06d0e55011", "score": "0.53803563", "text": "execute() {\n }", "title": "" }, { "docid": "eff3482ad2798f27ee282119e8e6147c", "score": "0.53748786", "text": "executeBackgroundTaskSuccess(action, data)\n\t{\n\t\tconst successObject =\t\t{\n\t\t\terror: () => false,\n\t\t\tdata: () => data.result,\n\t\t};\n\n\t\tconsole.log('Dialog.executeBackgroundTaskSuccess', action, data);\n\n\t\tswitch (action)\n\t\t{\n\t\t\tcase 'sendMessage': {\n\t\t\t\tthis.controller.executeRestAnswer(RestMethodHandler.imMessageAdd, successObject, data.extra);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'readMessage': {\n\t\t\t\tthis.processMarkReadMessages();\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'uploadFileFromDisk': {\n\t\t\t\tthis.controller.executeRestAnswer(RestMethodHandler.imMessageAdd, successObject, data.extra);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t// No default\n\t\t}\n\t}", "title": "" }, { "docid": "dabe842bc28fc285ea25909afa63106b", "score": "0.5374678", "text": "function registerAllActions() {\n\t\t\t//Going to have an action that combines update, add, and remove\n\t\t\tActionQueueService.registerAction(update, 100, 'update');\n\t\t\tActionQueueService.registerAction(assetAction, 90, 'assetAction');\n\t\t\tActionQueueService.registerAction(reprice, 60, 'reprice');\n\t\t\tActionQueueService.registerAction(finish, 0, 'finish');\n\n\t\t\t/**\n\t\t\t * For now, just pass the rejected promise up.\n\t\t\t */\n\t\t\tfunction onRejection(reason) {\n\t\t\t\tPageErrorDataService.add(reason);\n\t\t\t\treturn $q.reject(reason);\n\n\t\t\t}\n\n\t\t\tfunction update() {\n\t\t\t\tvar pendingLineItemDOs = LineItemCache.getLineItemDOChanges();\n\t\t\t\tif (!pendingLineItemDOs || pendingLineItemDOs.length === 0) {\n\t\t\t\t\t//Return immediately if no pending changes detected.\n\t\t\t\t\treturn $q.when(lineItemArray);\n\n\t\t\t\t}\n\n\t\t\t\t//May want to leave out TOTAL_ITEMS and just let reprice action handle that\n\t\t\t\tvar includeParams = [\n\t\t\t\t\tConfigurationDataService.includeConstants.CART_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.CHARGE_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.ATTRIBUTE_VALUES,\n\t\t\t\t\tConfigurationDataService.includeConstants.ATTRIBUTE_RULES,\n\t\t\t\t\tConfigurationDataService.includeConstants.FIELD_EXPRESSIONS,\n\t\t\t\t\tConfigurationDataService.includeConstants.OPTION_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.RULE_ACTIONS,\n\t\t\t\t\tConfigurationDataService.includeConstants.TOTAL_ITEMS,\n\t\t\t\t\tConfigurationDataService.includeConstants.PRICE_RAMPS\n\t\t\t\t];\n\t\t\t\tvar actionPromise = ConfigurationDataService.createCartRequestDO(pendingLineItemDOs, totalItemsArray, true, false, includeParams)\n\t\t\t\t\t.then(function (cartRequest) {\n\t\t\t\t\t\treturn RemoteService.performAction(cartRequest);\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\treturn actionPromise.then(\n\t\t\t\t\t\tfunction(result) {\n\t\t\t\t\t\t\tConstraintRuleDataService.updateRuleActions(result.ruleActions);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPageErrorDataService.clear().add(result.pageErrors.errorMessages);\n\t\t\t\t\t\t\tupdateTotalItemArray(result.totalItems);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tAttributesCache.putAttributeRules(result.attributeRules);\n\t\t\t\t\t\t\tFieldExpressionCache.putFieldExpressions(result.appliedExpressionInfos);\n\t\t\t\t\t\t\tLineItemCache.putPricePendingInfo(result.pricePendingInfo);\n\t\t\t\t\t\t\t//!--uses info from various caches to init the line item model\n\t\t\t\t\t\t\tLineItemCache.putLineItemDOs(result.lineItems, createLineItemModel); \n\t\t\t\t\t\t\tLineItemCache.removeLineItems(result.deletedPrimaryLineNumbers, true);\n\t\t\t\t\t\t\t//apply expression change rules\n\t\t\t\t\t\t\tif(result.attributeRules || result.appliedExpressionInfos) {\n\t\t\t\t\t\t\t\tRuleService.applyRulesOnChange(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn refreshItemsFromCache();\n\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tonRejection\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tfunction assetAction() {\n\t\t\t\tvar pendingAssetActionsKey = generatePendingAssetActions();\n\t\t\t\tif (pendingAssetActionsKey) {\n\t\t\t\t\tvar reqObj = {};\n\t\t\t\t\treqObj.lineItems = LineItemCache.getPendingAssetActions(pendingAssetActionsKey);\n\t\t\t\t\t//Assets may want more\n\t\t\t\t\treqObj.responseIncludes = [ConfigurationDataService.includeConstants.CART_LINES];\n\t\t\t\t\tvar actionRequest = ConfigurationDataService.createAssetActionRequest(reqObj);\n\t\t\t\t\tvar requestPromise = RemoteService.performAssetActions(actionRequest);\n\n\t\t\t\t\treturn requestPromise.then(\n\t\t\t\t\t\t\tfunction(result) {\n\t\t\t\t\t\t\t\tif (!result.lineItems) {\n\t\t\t\t\t\t\t\t\t// ERROR!\n\t\t\t\t\t\t\t\t\treturn result;\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar lineItemData = result.lineItems;\n\t\t\t\t\t\t\t\t\tPageErrorDataService.add(result.pageErrors.errorMessages);\n\t\t\t\t\t\t\t\t\tLineItemCache.clearPendingAssetActions(pendingAssetActionsKey);\n\t\t\t\t\t\t\t\t\tLineItemCache.putLineItemDOs(lineItemData, createLineItemModel);\n\t\t\t\t\t\t\t\t\treturn refreshItemsFromCache();\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonRejection\n\t\t\t\t\t);\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Make a call to the server to reprice the cart lines. When the remote action is finished:\n\t\t\t * \t\t- Resulting changes to line items are merged into the cache. \n\t\t\t * \t\t- A call to finish() is made to check whether another round of pricing is needed.\n\t\t\t * \t\t\n\t\t\t * @return {Promise} resolves with cart lines when pricing is done\n\t\t\t */\n\t\t\tfunction reprice() {\n\t\t\t\tvar includeParams = [\n\t\t\t\t\tConfigurationDataService.includeConstants.CART_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.OPTION_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.CHARGE_LINES,\n\t\t\t\t\tConfigurationDataService.includeConstants.RULE_ACTIONS,\n\t\t\t\t\tConfigurationDataService.includeConstants.TOTAL_ITEMS,\n\t\t\t\t\tConfigurationDataService.includeConstants.PRICE_RAMPS\n\n\t\t\t\t];\n\t\t\t\tvar actionPromise = ConfigurationDataService.createCartRequestDO(null, null, false, true, includeParams)\n\t\t\t\t\t.then(function (cartRequest) {\n\t\t\t\t\t\treturn RemoteService.updatePrice(cartRequest);\n\t\t\t\t\t});\n\n\t\t\t\treturn actionPromise.then(\n\t\t\t\t\t\tfunction(result) {\n\n\t\t\t\t\t\t\tvar lineItemData = result.lineItems;\n\t\t\t\t\t\t\tvar totalsData = result.totalItems;\n\t\t\t\t\t\t\tupdateTotalItemArray(totalsData);\n\t\t\t\t\t\t\tLineItemCache.putLineItemDOs(lineItemData, createLineItemModel);\n\t\t\t\t\t\t\tPageErrorDataService.add(result.pageErrors.errorMessages);\n\t\t\t\t\t\t\tLineItemCache.putPricePendingInfo(result.pricePendingInfo);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn finish(!result.pricePendingInfo);\n\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tonRejection\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Check whether there is still price pending. If there is, execute\n\t\t\t * \tanother pricing call with reprice(). Otherwise, just return the\n\t\t\t * \tfinal collection of line items. Checking for pricing has been pulled\n\t\t\t * \tout of the cache service for clarity\n\t\t\t * \t\n\t\t\t * @return {Promise} resolves with cart lines when pricing is done.\n\t\t\t */\n\t\t\tfunction finish(faliedToReprice) {\n\t\t\t\trefreshItemsFromCache();\n\t\t\t\tif (faliedToReprice !== true && LineItemCache.getIsPricePending()) { //failed to reprice, only do again on user 'reprice' action\n\t\t\t\t\treturn reprice();\n\n\t\t\t\t}\n\t\t\t\treturn $q.when(lineItemArray);\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "fec2fa01dce9f2574cb86263430919a4", "score": "0.5366127", "text": "*[REQUEST]({ payload, success, error, afterResponse }, { call, put }) {\n let _payloads = [];\n if ($$.isObject(payload)) {\n _payloads.push(payload);\n } else if ($$.isArray(payload)) {\n _payloads = payload;\n }\n\n const resultState = {\n success: {},\n error: {}\n };\n\n for (let i = 0; i < _payloads.length; i += 1) {\n /**\n * valueField: The returned result will be received using the value of the valueField field.\n * notice: Popup notification\n * actionType: If there is an actionType, it means that the reducer has been processed by itself, and the value is actionType + ('_SUCCESS' | '_ERROR')\n */\n const { valueField, notice, actionType, ...otherPayload } = _payloads[i];\n\n try {\n let response = yield call(asyncRequest, otherPayload);\n\n // Self-processed data back, simulate the operation in reduce, do not write functions with side effects here\n if ($$.isFunction(afterResponse)) {\n const _r = afterResponse(response);\n if (_r) response = _r;\n }\n\n // If you need a callback\n if (otherPayload.success) {\n otherPayload.success(response);\n }\n\n // If notification is required\n if (notice) {\n config.notice.success(notice === true ? 'Successful operation' : notice[0]);\n }\n\n // If there is an actionType, it means that the self has been processed by the reducer.\n if (actionType) {\n yield put({\n type: `${actionType}_SUCCESS`,\n payload: response\n });\n } else {\n // Prepare return value\n resultState.success[valueField || '_@fake_'] = response;\n }\n } catch (e) {\n resultState.error.error = e;\n\n // If an internal callback is needed\n if ($$.isFunction(otherPayload.error)) {\n otherPayload.error(e);\n } else if ($$.isFunction(error)) {\n error(e);\n }\n\n // Notification reducer If there is an actionType, it means that the reducer has been processed.\n yield put({\n type: actionType ? `${actionType}_ERROR` : REQUEST_ERROR,\n payload: resultState.error\n });\n // Early termination if an error occurs\n break;\n }\n }\n\n // Notification reducer\n if (Object.keys(resultState.success).length) {\n // If you need a callback\n if ($$.isFunction(success)) {\n success(resultState.success);\n }\n\n yield put({\n type: REQUEST_SUCCESS,\n payload: resultState.success\n });\n }\n }", "title": "" }, { "docid": "097b0a112754001881015e18cf39f5fb", "score": "0.5363722", "text": "dispatch(action) {\n this.store.dispatch(action);\n }", "title": "" }, { "docid": "097b0a112754001881015e18cf39f5fb", "score": "0.5363722", "text": "dispatch(action) {\n this.store.dispatch(action);\n }", "title": "" }, { "docid": "9fa7f94f16bb4c9f5456d3d2060c31b7", "score": "0.5362705", "text": "toggle(context, payload) { // \"context\" is a wrapper object that allows us to do async calls\n debugger;\n context.commit('toggle');\n }", "title": "" }, { "docid": "95b1ced0039a8a3b833b062d05364ca2", "score": "0.53616685", "text": "postSyncAction(objectName, objectId, action) {\n\t\t\tlet vm = this;\n\t\t\tlet request = {\n\t\t\t\tsyncAction: {\n\t\t\t\t\tobjectName: objectName,\n\t\t\t\t\tobjectId: objectId,\n\t\t\t\t\taction: action\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// eslint-disable-next-line\n\t\t\tVue.axios.post(this.$store.getters.api.url + 'sync-actions', request)\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tconsole.log(response);\n\t\t\t\t})\n\t\t\t\t.catch(function (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t\tif (!error.response) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twindow._oatsVue.$root.logError('apiError', 'error', error.response.status,\n\t\t\t\t\t\t/* Error data */\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage: error.response.statusText\n\t\t\t\t\t\t},\n\t\t\t\t\t\t/* Meta data */\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: error.config.url,\n\t\t\t\t\t\t\titemType: db.name\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "30a7928b66d35cdb66cd313af3fb1f3a", "score": "0.53545314", "text": "bindActions () {\n this.actionsList.forEach((actions) => {\n this.observe(actions, { record: false })\n })\n }", "title": "" }, { "docid": "7d29c37bed51aeb1af2a8a1a4d3aae84", "score": "0.53526205", "text": "async process({getState, action, fassets}, dispatch, done) {\n try {\n const discoveriesResp = await fassets.discoveryService.searchDiscoveries(action.filter);\n\n // console.log(`xx here is our discoveriesResp: `, discoveriesResp);\n dispatch( _discoveryAct.retrieve.complete(action.filter, discoveriesResp) );\n }\n catch(err) {\n dispatch( _discoveryAct.retrieve.fail(err) );\n\n // report unexpected error to user\n discloseError({err: err.defineAttemptingToMsg('DiscoveryService.searchDiscoveries()')});\n }\n finally {\n done();\n }\n }", "title": "" }, { "docid": "1c38f02bd5e0ee6ae8808d884b143236", "score": "0.53514546", "text": "naiveDispatch({task, onSuccess, onError}) {\n task().then(response => {onSuccess(response)}).catch(response => {onError(error)});\n }", "title": "" }, { "docid": "be55193a9d5c7c74b33406d64e9505ca", "score": "0.5346595", "text": "localAction(next, action) {\n\t\t\t\texpect(action).toBeDefined();\n\t\t\t\treturn ctx => {\n\t\t\t\t\tFLOW.push(`${mwName}-localAction-before-${ctx.params.name}`);\n\t\t\t\t\treturn next(ctx).then(res => {\n\t\t\t\t\t\tFLOW.push(`${mwName}-localAction-after-${ctx.params.name}`);\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}", "title": "" }, { "docid": "29f5768d8e4e9b3c957ad3d6fe47745d", "score": "0.5343586", "text": "dispatch() {\n if (!this.running) return\n if (!this.redis.connected) return setTimeout(this.dispatch.bind(this), 1000) // Wait 1s if not connected\n this.redis\n .zrangebyscoreAsync(Settings.redis.ordered_set_name, 0, Date.now())\n .then(hashes => {\n if (hashes.length)\n return this.redis\n .multi()\n .rpush(Settings.redis.queue_name, hashes[0])\n .zrem(Settings.redis.ordered_set_name, hashes[0])\n .execAsync()\n else \n throw new EmptyResultError()\n })\n .then(() => setImmediate(this.dispatch.bind(this)))\n .catch(err => {\n setTimeout(this.dispatch.bind(this), 1000)\n if (!(err instanceof EmptyResultError)) {\n this.emit('error', err) // If err is not expected, forward to external handler\n }\n })\n }", "title": "" }, { "docid": "d3ede94d701ade9dfabcffecdb3f8490", "score": "0.53414875", "text": "async perform() {\n await this._validate();\n await this._isUserResponded();\n await this._updateResponse();\n }", "title": "" }, { "docid": "2430721c3782f709547448003515d4dd", "score": "0.53413564", "text": "function Synchronized () {}", "title": "" }, { "docid": "2430721c3782f709547448003515d4dd", "score": "0.53413564", "text": "function Synchronized () {}", "title": "" }, { "docid": "8693acd77908752744a395a8deed2351", "score": "0.534104", "text": "async() {\n\n // Report beginning of async code execution to Bridge Agent.\n this.bridgeAgentPort.postMessage({ type: 'async' });\n\n }", "title": "" }, { "docid": "1649fdf445f09b00c03eb86ff2e6a05c", "score": "0.53352463", "text": "function done() { //define a function which dispatches a ready property, reduces and returns the index\n dispatch({ type: \"ready\", i });\n return i; \n }", "title": "" }, { "docid": "6de4238a20f2ad27a1e6a189f897032e", "score": "0.53304696", "text": "@action loadActiveOrders() {\n this.isLoading = true;\n\n return api.get('actives').then(action('getActivesOrdersSuccessfully', responce => {\n const orders = responce.data;\n orders.forEach(order => this.updateOrderFromServer(order));\n })).catch(action('getActiveOrdersFailed', error => {\n console.log(error);\n }))\n }", "title": "" }, { "docid": "98bcc3865bd5dbaad8fb7488cb80e4d3", "score": "0.5327671", "text": "_selectDokterComplete(_data, _async = false) {\n if (_async == true) {\n let jdata = {\n type: KEYS.KEY_SELECTTARGET,\n data: _data\n }\n F_I_F_O_GLOBAL_LOC(jdata);\n }\n this.props.updateScheduleSelectDoktor([])//cleat select doctor\n //user.updateStatusRole(Constant.ROLE_READYSTARTSCHEDULE);\n // this.setState({\n //ROLE: Constant.ROLE_READYSTARTSCHEDULE\n //})\n }", "title": "" } ]
d4d73b7fd6a7115e6a3414066f532084
Then bind the event to the callback function. There are several events for cross browser compatibility. script.onreadystatechange = callback;
[ { "docid": "4db2230d57fa47018a88de4a6294e7ea", "score": "0.53527135", "text": "function callback() {\n resolve(script);\n }", "title": "" } ]
[ { "docid": "d997e67f96557a4b9eb1f2e095d73901", "score": "0.6509537", "text": "function onReadyStateChange ()\n {\n var handler = null;\n var xhr = this.xhr;\n var rs = xhr.readyState;\n\n if (rs != this._readyState) // if (state changed from last time)\n {\n this._readyState = rs; // remember new state\n handler = this.opt.handlers[rs]; // user handler, if there is one\n\n if (rs == zjs.xhr.DONE)\n onDone.call(this);\n }\n\n // Call this one on every call we receive:\n var fn = this.opt.onreadystatechange;\n if (fn instanceof Function)\n fn(this);\n\n // This is only called on entry to the new state (that is, once):\n if (handler instanceof Function)\n handler(this);\n }", "title": "" }, { "docid": "45f36e442f7bf0f0c0edd8866c3206b0", "score": "0.63668835", "text": "function onDOMready(callback) {\n if (typeof callback != \"function\") {\n return console.log(\"Invalid argument, callback must be a function\");\n }\n\n if (document.readyState == \"complete\") {\n return callback();\n } else {\n document.addEventListener(\"DOMContentLoaded\", callback);\n }\n}", "title": "" }, { "docid": "83b30028395af9b2fe8a9840260b5aaa", "score": "0.63429505", "text": "function readyHandler() {\n\t\t\tif (!event_utils.domLoaded) {\n\t\t\t\tevent_utils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "83b30028395af9b2fe8a9840260b5aaa", "score": "0.63429505", "text": "function readyHandler() {\n\t\t\tif (!event_utils.domLoaded) {\n\t\t\t\tevent_utils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "646f0a4abb3c544f227da881ccb725d5", "score": "0.6309434", "text": "function handler() {\n if (requester.readyState == 4) {\n if (requester.status == 200) {\n if (callback != null)\n callback(requester.responseText);\n }\n }\n }", "title": "" }, { "docid": "8711c34950490e7f3e711535f61286f2", "score": "0.62907255", "text": "function onLoadHandler()\n\t{\n\t\t_http_request.status = 200;\n\t\t_http_request.readyState = 4;\n\t\t// Call the callback responder\n\t\t_callBackResponder(_instance);\n\t}", "title": "" }, { "docid": "2a9bd8d2557dc4a67e4fab1b9bbf0aeb", "score": "0.6248849", "text": "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "26ec013f7df884bf207d48755b97a734", "score": "0.62363344", "text": "function loadScript(url,callback) {\n\n //create element \n var script = document.createElement('script');\n\n //set attributes\n script.setAttribute('type','text/javascript');\n\n script.setAttribute('charSet',\"utf-8\");\n\n //if IE\n if(script.readyState){\n\n script.onreadystatechange = function() {\n\n if(script.readyState == 'loaded' || script.readyState == 'complete') {\n\n script.onreadystatechange = null;\n\n callback();\n }\n };\n \n //others browsers\n } else {\n\n script.onload = function(){\n\n callback(url); \n };\n }\n\n //set attribute src\n script.setAttribute('src',url);\n\n //append script\n document.getElementsByTagName('head')[0].appendChild(script); \n\n }", "title": "" }, { "docid": "0b22f5f8918a4f8daae7ae12ba838c58", "score": "0.6183235", "text": "function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }", "title": "" }, { "docid": "4575c349d5b047894e24b50b6f5180a0", "score": "0.6121785", "text": "function ready(callback){\r\n if(doc.document && doc.document.readyState === 'complete'){\r\n callback();\r\n }else if(window.attachEvent){\r\n document.attachEvent(\"onreadystatechange\", callback);\r\n window.attachEvent(\"onLoad\",callback);\r\n }else if(document.addEventListener){\r\n document.addEventListener(\"DOMContentLoaded\",callback,false);\r\n }\r\n}", "title": "" }, { "docid": "1a4f7056199e3dc4dd0471edd3b8b39d", "score": "0.61078495", "text": "function onReady(callback) {\n d.readyState !== 'loading' ? callback() : d.addEventListener('DOMContentLoaded', function f() {\n callback();\n d.removeEventListener('DOMContentLoaded', f);\n });\n}", "title": "" }, { "docid": "9e39e79a0ee1c08a1fdbb79c58e606c9", "score": "0.6091448", "text": "function loadScript(url,callback) {\n\n var script = document.createElement('script');\n script.setAttribute('type','text/javascript');\n //for IE\n if(script.readyState) {\n script.onreadystatechange = function() {\n if(script.readyState == 'loaded' || script.readyState == 'complete' ) {\n script.onreadystatechange = null;\n callback(); \n } \n }\n //other browsers\n } else {\n script.onload = function(){\n callback();\n } \n } \n script.setAttribute('src',url);\n document.getElementsByTagName('head')[0].appendChild(script); \n }", "title": "" }, { "docid": "f76160dc99369f9afa649bfe43f85fb5", "score": "0.6038113", "text": "function docReady(callback) {\n var addListener = document.addEventListener || document.attachEvent,\n removeListener = document.removeEventListener || document.detachEvent,\n eventName = document.addEventListener ? \"DOMContentLoaded\" : \"onreadystatechange\";\n\n if (document.readyState === \"complete\" || document.readyState === \"loaded\" || document.readyState === \"interactive\") {\n callback(document, event);\n try{ removeListener(eventName, arguments.callee, false); }catch(err){}\n return;\n }\n }", "title": "" }, { "docid": "e3058727b384c22dade18956ea723693", "score": "0.60244644", "text": "function onLoad(callback) {\r\n callback();\r\n}", "title": "" }, { "docid": "4413b0c729087ba3ca1a86b6dc5c24cf", "score": "0.60141784", "text": "function handleIeState()\n {\n if (scriptEl.readyState == 'loaded')\n {\n calltheCBcmn(scriptURL);\n }\n }", "title": "" }, { "docid": "4413b0c729087ba3ca1a86b6dc5c24cf", "score": "0.60141784", "text": "function handleIeState()\n {\n if (scriptEl.readyState == 'loaded')\n {\n calltheCBcmn(scriptURL);\n }\n }", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.6005265", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.6005265", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.6005265", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "6c4146e7f8a7f9b115ea356586161c97", "score": "0.6005265", "text": "function onLoad(callback) {\n callback();\n}", "title": "" }, { "docid": "29b818df50a3e492a9a2b138ec6eeab2", "score": "0.5969501", "text": "function onDOMReady(cb) {\n if (document.readyState === \"complete\") {\n cb();\n } else {\n document.onreadystatechange = function() {\n if (document.readyState === \"complete\") {\n cb();\n }\n };\n }\n}", "title": "" }, { "docid": "b3f644b37252ff2aa3625d680f0bf924", "score": "0.5938344", "text": "load(callback) {\n\n if (this.window.addEventListener) {\n\n let eventCallback = () => {\n\n this.window.removeEventListener(\"load\", eventCallback, false);\n callback();\n };\n\n this.window.addEventListener(\"load\", eventCallback, false);\n\n } else if (this.window.attachEvent) {\n\n let eventCallback = () => {\n if (this.cmpStr(this.window.readyState, \"complete\")) {\n this.window.detachEvent(\"onload\", eventCallback);\n callback();\n }\n };\n\n this.window.attachEvent(\"onload\", eventCallback);\n\n }\n }", "title": "" }, { "docid": "4b9e0fa19d5ba936bb1af0312d73e17f", "score": "0.59075934", "text": "onEvent(callback) {\n this.eventCallback = callback;\n }", "title": "" }, { "docid": "18365f090e613d9106d2df72f81ee3ca", "score": "0.5905691", "text": "loadScript(url, callback)\n {\n // Adding the script tag to the head as suggested before\n var head = document.head;\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n\n // Then bind the event to the callback function.\n // There are several events for cross browser compatibility.\n script.onreadystatechange = callback;\n script.onload = callback;\n\n // Fire the loading\n head.appendChild(script);\n }", "title": "" }, { "docid": "18365f090e613d9106d2df72f81ee3ca", "score": "0.5905691", "text": "loadScript(url, callback)\n {\n // Adding the script tag to the head as suggested before\n var head = document.head;\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n\n // Then bind the event to the callback function.\n // There are several events for cross browser compatibility.\n script.onreadystatechange = callback;\n script.onload = callback;\n\n // Fire the loading\n head.appendChild(script);\n }", "title": "" }, { "docid": "e63ffcc9d56f5e3bc6f5699fa7f26c58", "score": "0.58866215", "text": "function loadScript(url, callback){\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n if (script.readyState){ //IE\n script.onreadystatechange = function(){\n if (script.readyState == \"loaded\" ||\n script.readyState == \"complete\"){\n script.onreadystatechange = null;\n callback();\n }\n };\n } else { //Others\n script.onload = function(){\n callback();\n };\n }\n script.src = url;\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n}", "title": "" }, { "docid": "c43426efa4cdba0463e2374cc9fc65f4", "score": "0.58832127", "text": "function loadScript(url, callback){\r\n\r\n var script = document.createElement(\"script\");\r\n\tscript.type = \"text/javascript\";\r\n script.async = true;\r\n\r\n if (script.readyState){ //IE\r\n script.onreadystatechange = function(){\r\n if (script.readyState == \"loaded\" ||\r\n\t\tscript.readyState == \"complete\"){\r\n script.onreadystatechange = null;\r\n callback();\r\n }\r\n };\r\n } else { //Others\r\n script.onload = function(){\r\n callback();\r\n };\r\n }\r\n\r\n script.src = url;\r\n var x = document.getElementsByTagName(\"script\")[0];\r\n x.parentNode.insertBefore(script, x);\r\n\r\n return script;\r\n\r\n} // loadScript", "title": "" }, { "docid": "80767fa7eeb32263e423f5b385d786e5", "score": "0.5873985", "text": "function load_script(url, callback){\n\n var script = document.createElement(\"script\")\n script.type = \"text/javascript\";\n\n if (script.readyState){ //IE\n script.onreadystatechange = function(){\n if (script.readyState == \"loaded\" ||\n script.readyState == \"complete\"){\n script.onreadystatechange = null;\n callback();\n }\n };\n } else { //Others\n script.onload = function(){\n callback();\n };\n }\n\n script.src = \"js/\"+url;\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n}", "title": "" }, { "docid": "ec9861a8fd27f388b3749a0e2997fa22", "score": "0.58692825", "text": "function handleIeState() {\n\t\t\tif(scriptEl.readyState == 'loaded'){\n\t\t\t\tcalltheCBcmn(scriptURL);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e3ab2395b4cc93a12ec8d3f1815613d1", "score": "0.584751", "text": "function loadScript (url, callback) {\n var head = document.head\n var script = document.createElement(\"script\")\n script.type = \"text/javascript\"\n script.src = url\n //add a callback (that is to be executed after another function has finished executing)\n script.onreadystatechange = callback\n script.onload = callback\n head.appendChild(script)\n}", "title": "" }, { "docid": "877b765ad7d9846212f051c0178ce50a", "score": "0.5834365", "text": "function onLoad(domElement, callback) {\n //throw new Error(\"depricated. still used?\");\n //jquery handling of callbacks, taken from http://stackoverflow.com/questions/4845762/onload-handler-for-script-tag-in-internet-explorer\n if (typeof domElement.onload === \"undefined\" && domElement.onreadystatechange !== \"undefined\") {\n throw new Error(\"the element you wish to attach the callback does not have a .onload() method to attach to!\");\n }\n var done = false;\n domElement.onload = domElement.onreadystatechange = function (ev) {\n // tslint:disable-next-line:no-invalid-this\n if (!done && (!this.readyState ||\n // tslint:disable-next-line:no-invalid-this\n this.readyState === \"loaded\" || this.readyState === \"complete\")) {\n done = true;\n //jQuery.handleSuccess(s, xhr, status, data);\n //jQuery.handleComplete(s, xhr, status, data);\n callback(ev);\n //if (!environment._DEBUG_MODE) {\n // Handle memory leak in IE\n domElement.onload = domElement.onreadystatechange = null;\n //if (domElement && scriptElement.parentNode) {\n //\tdomElement.removeChild(scriptElement);\n //}\n //}\n }\n };\n}", "title": "" }, { "docid": "9e4b581dcf2996c9030c2e14423602db", "score": "0.5832669", "text": "function whenPageLoaded(callback) {\n if (document.readyState != \"loading\") {\n // The document is already loaded.\n callback();\n }\n else if (document.addEventListener) {\n // Modern browsers support DOMContentLoaded.\n document.addEventListener(\"DOMContentLoaded\", callback);\n }\n else {\n // Old browsers don't.\n document.attachEvent(\"onreadystatechange\", function() {\n if (document.readyState == \"complete\") {\n callback();\n }\n })\n }\n}", "title": "" }, { "docid": "3991c98ded579af4309ece95a607da11", "score": "0.58289695", "text": "function loadScript(url, callback) {\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n\n if (script.readyState) { //IE\n script.onreadystatechange = function() {\n if (script.readyState === \"loaded\" || script.readyState === \"complete\") {\n script.onreadystatechange = null;\n callback();\n }\n };\n } else { //Others\n script.onload = function() {\n callback();\n };\n }\n script.src = url;\n document.getElementsByTagName('head')[0].appendChild(script);\n }", "title": "" }, { "docid": "f24b201399fed6ef1c5fb6ae0e92b5c1", "score": "0.58155894", "text": "function loadCallback(responseText){\n\t\t\t\tsaving[uri] = false;\n\t\t\t\tsuccessCallback(responseText);\n\t\t\t\tdoAfter(uri);\n\t\t\t}", "title": "" }, { "docid": "3edb79a93fac17c4c1faf4470dae562a", "score": "0.5777587", "text": "function _onReadyStateChange() {\n switch (this.__XMLHttpRequest__.readyState) {\n case 0: // request not initialized\n break;\n case 1: // server connection established\n break;\n case 2: // request received\n break;\n case 3: // processing request\n break;\n case 4: // request finished and response is ready\n if (typeof this.onComplete == \"function\") {\n this.onComplete.call(this, this.__XMLHttpRequest__.status);\n }\n break;\n }\n}", "title": "" }, { "docid": "95500d265ea4a4f0610a0c612b6ad8f2", "score": "0.57768", "text": "function AjaxCallback() { \r\n if( 4 == this.req.readyState ) {\r\n if( 200 != this.req.status ) {\r\n if (this.errorCall != null) {\r\n this.errorCall();\r\n }\r\n } else { \r\n if (this.successCall != null) { \r\n this.successCall(); \r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0f899532251dc4a24bf1fe12a2a9b36f", "score": "0.5776576", "text": "function callback() {\r\n }", "title": "" }, { "docid": "67f5c5a3967fd90d6c22867628d9fb17", "score": "0.57294464", "text": "function handleStateChange(){\n\n\t\t\tif( xhrobj.readyState === 4 ){\n\n\t\t\t\tvar response = xhrobj.responseText || xhrobj.response || null;\n\t\t\t\t response = mimetype === \"JSON\" ?\n\t\t\t\t\tJSON.parse( response ):\n\t\t\t\t\tresponse;\n\n\t\t\t\tif( typeof callback === 'function' ){\n\n\t\t\t\t\tcallback.call( xhrobj, response );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "486198d7674aa98f4fb2394959865e23", "score": "0.5725242", "text": "function create_script_load_listener(elem,registry_item,flag,onload) {\n\t\telem.onload = elem.onreadystatechange = function() {\n\t\t\tif ((elem.readyState && elem.readyState != \"complete\" && elem.readyState != \"loaded\") || registry_item[flag]) return;\n\t\t\telem.onload = elem.onreadystatechange = null;\n\t\t\tonload();\n\t\t};\n\t}", "title": "" }, { "docid": "486198d7674aa98f4fb2394959865e23", "score": "0.5725242", "text": "function create_script_load_listener(elem,registry_item,flag,onload) {\n\t\telem.onload = elem.onreadystatechange = function() {\n\t\t\tif ((elem.readyState && elem.readyState != \"complete\" && elem.readyState != \"loaded\") || registry_item[flag]) return;\n\t\t\telem.onload = elem.onreadystatechange = null;\n\t\t\tonload();\n\t\t};\n\t}", "title": "" }, { "docid": "365ad3fae3080a521fce7f65b330236b", "score": "0.57056105", "text": "function loadScript(url, callback) {\n var script = document.createElement('script');\n script.src = url;\n\n // Attach handlers for all browsers\n var done = false;\n script.onload = script.onreadystatechange = function() {\n if(\n !done && (\n !this.readyState ||\n this.readyState === 'loaded' ||\n this.readyState === 'complete')\n ) {\n done = true;\n\n // Continue your code\n callback();\n\n // Handle memory leak in IE\n script.onload = script.onreadystatechange = null;\n document.head.removeChild(script);\n }\n };\n\n document.head.appendChild(script);\n }", "title": "" }, { "docid": "22c41c7d93d2d53b9a56a8f4b71227f4", "score": "0.5679229", "text": "function ajaxCompleteNative(callback) {\n XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send\n XMLHttpRequest.prototype.send = function (body) {\n this.addEventListener(\"progress\", function () {\n console.log(\"Loading\")\n }, false)\n\n this.addEventListener(\"load\", function () {\n if (isJson(this.responseText)) {\n let responseJSON = JSON.parse(this.responseText)\n console.log(\"responses\", responseJSON)\n }\n console.log(\"xhr\", this)\n console.log(\"body\", body)\n }, false)\n this.realSend(body)\n }\n}", "title": "" }, { "docid": "1a758c80f5fb4e248dc93813b0f32df7", "score": "0.5643436", "text": "function docReady(callback) {\n var docBody = document.getElementsByTagName('body')[0]\n if (docBody) {\n if (callback) callback()\n } else if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', function() {\n document.removeEventListener('DOMContentLoaded',arguments.callee, false)\n if (callback) callback()\n }, false)\n } else if (document.attachEvent) {\n document.attachEvent('onreadystatechange', function() {\n if (document.readyState == 'complete') {\n document.detachEvent('onreadystatechange', arguments.callee)\n if (callback) callback()\n }\n })\n }\n}", "title": "" }, { "docid": "a58f4a2355f86713ba22cd03b186adbe", "score": "0.5637237", "text": "function ready(cb) {\n if (document.readyState != 'loading') {\n cb();\n } else {\n document.addEventListener('DOMContentLoaded', cb);\n }\n}", "title": "" }, { "docid": "18779347dd99405ccd51ba0f3f819b18", "score": "0.56351805", "text": "function loadScript( url, callback) {\n var script = document.createElement( \"script\" )\n script.type = \"text/javascript\";\n if(script.readyState) { // only required for IE <9\n script.onreadystatechange = function() {\n if ( script.readyState === \"loaded\" || script.readyState === \"complete\" ) {\n script.onreadystatechange = null;\n callback();\n }\n };\n } else { //Others\n script.onload = function() {\n callback();\n };\n }\n\n script.src = url;\n\n document.getElementsByTagName( \"head\" )[0].appendChild( script );\n}", "title": "" }, { "docid": "075f0ef9798c884148e5dfad4b7aaf4d", "score": "0.563026", "text": "function callback() {\n\t}", "title": "" }, { "docid": "55b06adbadaee1c42d8f6fefb5a1a6e6", "score": "0.5572588", "text": "on (cb = null, ns = '') {\n if (!validCallback(cb)) {\n return;\n }\n $(document).on(types.update + ns, cb);\n }", "title": "" }, { "docid": "e89963699c074ceba956c03da89b3406", "score": "0.55680877", "text": "function handleScriptLoad(script, callback, errback) {\n var onScriptError;\n if (errback) {\n // set up an error handler as well\n onScriptError = handleScriptError(script, errback);\n }\n var onScriptLoad = function () {\n // pass the script to the callback\n callback(script);\n // remove this event listener\n script.removeEventListener('load', onScriptLoad, false);\n if (onScriptError) {\n // remove the error listener as well\n script.removeEventListener('error', onScriptError, false);\n }\n };\n script.addEventListener('load', onScriptLoad, false);\n}", "title": "" }, { "docid": "f26b28080a6a0e3c3afd36ba7dab5231", "score": "0.5545129", "text": "setScript() {\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n const url = this.createUrl();\n const script = document.createElement(\"script\");\n script.id = this.id;\n script.type = \"text/javascript\";\n script.src = url;\n script.onerror = this.loadErrorCallback.bind(this);\n script.defer = true;\n script.async = true;\n if (this.nonce) {\n script.nonce = this.nonce;\n }\n document.head.appendChild(script);\n }", "title": "" }, { "docid": "d2740e6d932ae2054c562abde1c0d3a2", "score": "0.55206454", "text": "function loadScript(url, callback) {\r\n // Adding the script tag to the head as suggested before\r\n var head = document.getElementsByTagName('head')[0];\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = url;\r\n\r\n // Then bind the event to the callback function.\r\n // There are several events for cross browser compatibility.\r\n script.onreadystatechange = callback;\r\n script.onload = callback;\r\n\r\n // Fire the loading\r\n head.appendChild(script);\r\n}", "title": "" }, { "docid": "ecf4495518ea50155e743822f9b55447", "score": "0.5519979", "text": "function loadScript(fileName, callback) {\n let script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n\n // IE detect script done\n if (script.readyState) {\n script.onreadystatechange = function() {\n if (script.readyState == \"loaded\") {\n script.readyState == \"loaded\";\n script.onreadystatechange = null;\n callback();\n }\n }\n }\n // All other browsers detect script done\n else {\n script.onload = function() {\n callback();\n }\n }\n\n script.src = \"scripts/\" + fileName;\n document.getElementsByTagName(\"head\")[0].append(script);\n}", "title": "" }, { "docid": "2e554b243fe880655c08099b175ccc2c", "score": "0.5498976", "text": "function loadScript(url, callback) {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n\n if (script.readyState) { // For IE\n script.onreadystatechange = function () {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n callback();\n }\n };\n } else { // Other browsers\n script.onload = function () {\n callback();\n };\n }\n\n script.src = url;\n document.getElementsByTagName('head')[0].appendChild(script);\n }", "title": "" }, { "docid": "4b154019a26a8df957b76616c88eebc5", "score": "0.549519", "text": "function onReadystatechange(e) {\n\n\tif (!(e instanceof Event)) {\n\t\tthrow new TypeError('Invalid event was given');\n\t}\n\n\tif (document.readyState == 'interactive') {\n\t\tmakeReady.call(this);\n\t}\n\n\tif (document.readyState == 'complete') {\n\t\tmakeLoaded.call(this);\n\t}\n}", "title": "" }, { "docid": "2acb6d42b6e3df2ad315ae614634fe58", "score": "0.54812133", "text": "function readyStateChange() {\n if ( request ) {\n switch ( request.readyState ) {\n case 0:\n //uninitialized\n break;\n case 1:\n //loading\n $.event.trigger( self, 'loading', true, true, request );\n break;\n case 2:\n //loaded\n $.event.trigger( self, 'loaded', true, true, request );\n break;\n case 3:\n //interactive\n $.event.trigger( self, 'interactive', true, true, request );\n break;\n case 4:\n //complete\n $.event.trigger( self, 'statecomplete', true, true, request );\n if ( request.status == 200 && !ready ) {\n ready = true;\n $.event.trigger( self, 'result', true, true, request );\n }\n else if ( request.status >= 400 ) {\n console.info( 'AsyncRequest.readyStateChange.fault:', url );\n $.event.trigger( self, 'fault', false, false, request );\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "31f6c05ee625f2b7b89da2d789db81d0", "score": "0.5481085", "text": "function domReady (cb) {\n\t\t\tif (completed) cb(); else callbacks.push(cb);\n\t\t}", "title": "" }, { "docid": "399e344505cea519dc2d15d27f40c019", "score": "0.54692185", "text": "function domReady(cb) {\n\t\t// Run now if DOM has already loaded as we're loading async\n\t\tif (['interactive', 'complete'].indexOf(doc.readyState) >= 0) {\n\t\t\tcb();\n\n\t\t// Otherwise wait for DOM\n\t\t} else {\n\t\t\tdoc.addEventListener('DOMContentLoaded', cb);\n\t\t}\n\t}", "title": "" }, { "docid": "dbabe16aa3adf857b6fc613fd70d074e", "score": "0.5468508", "text": "function requestCallback() {\n // only if req shows \"loaded\"\n if (req.readyState == 4) {\n // only if \"OK\"\n if (req.status == 200) {\n document.getElementById(targetDiv).innerHTML = applyAnchorTransforms(req.responseText, currentDocURL);\n eval(postProcessingCode);\n } else {\n var errMsg = \"There was a problem retrieving the data:<br/>\";\n \n if(req.status === undefined)\n errMsg += \"<b>Network error</b>\";\n else\n errMsg += \"<b>\" + req.status + \" - \" + req.statusText + \"</b>\";\n \n document.getElementById(targetDiv).innerHTML = errMsg;\n currentDocURL = ''; // Clear this as an error occurred\n }\n stopLoading();\n }\n}", "title": "" }, { "docid": "97f203c07dbcc5ebd7c761fa0738e3a8", "score": "0.54515487", "text": "onChange( callback ) {\n this._addCallback( false, 0, callback );\n }", "title": "" }, { "docid": "ae0ff2d8b1e7c256cbfa246bd67d37b2", "score": "0.5433549", "text": "function bindOnReady(win, callback, eventUtils) {\n\t\tvar doc = win.document, event = {type: 'ready'};\n\n\t\tif (eventUtils.domLoaded) {\n\t\t\tcallback(event);\n\t\t\treturn;\n\t\t}\n\n\t\t// Gets called when the DOM is ready\n\t\tfunction readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}\n\n\t\tfunction waitForDomLoaded() {\n\t\t\t// Check complete or interactive state if there is a body\n\t\t\t// element on some iframes IE 8 will produce a null body\n\t\t\tif (doc.readyState === \"complete\" || (doc.readyState === \"interactive\" && doc.body)) {\n\t\t\t\tremoveEvent(doc, \"readystatechange\", waitForDomLoaded);\n\t\t\t\treadyHandler();\n\t\t\t}\n\t\t}\n\n\t\tfunction tryScroll() {\n\t\t\ttry {\n\t\t\t\t// If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.\n\t\t\t\t// http://javascript.nwbox.com/IEContentLoaded/\n\t\t\t\tdoc.documentElement.doScroll(\"left\");\n\t\t\t} catch (ex) {\n\t\t\t\tDelay.setTimeout(tryScroll);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treadyHandler();\n\t\t}\n\n\t\t// Use W3C method\n\t\tif (doc.addEventListener) {\n\t\t\tif (doc.readyState === \"complete\") {\n\t\t\t\treadyHandler();\n\t\t\t} else {\n\t\t\t\taddEvent(win, 'DOMContentLoaded', readyHandler);\n\t\t\t}\n\t\t} else {\n\t\t\t// Use IE method\n\t\t\taddEvent(doc, \"readystatechange\", waitForDomLoaded);\n\n\t\t\t// Wait until we can scroll, when we can the DOM is initialized\n\t\t\tif (doc.documentElement.doScroll && win.self === win.top) {\n\t\t\t\ttryScroll();\n\t\t\t}\n\t\t}\n\n\t\t// Fallback if any of the above methods should fail for some odd reason\n\t\taddEvent(win, 'load', readyHandler);\n\t}", "title": "" }, { "docid": "294fbc36f111227c083d1121615536b5", "score": "0.5419043", "text": "function scriptLoad(s)\n{\n\treturn function(evt)\n\t{\n\t\tif (typeof s.readyState === \"undefined\" || READY_STATE.indexOf(s.readyState) >= 0)\n\t\t\tscriptDone(s);\n\t};\n}", "title": "" }, { "docid": "4d19f5793d102068870350b0fdfd5a0c", "score": "0.541602", "text": "function ensureExecutionAfterAjaxRequest(callback) {\n\t\tif (!requestOngoing) {\n\t\t\tcallback();\n\t\t} else {\n\t\t\tonCompleteCallbacks.push(callback);\n\t\t}\n\t}", "title": "" }, { "docid": "5cf31d448ac74f1d3695149f27e01315", "score": "0.5408981", "text": "function onReadyStateFunctionHTML(httpObj, handlerFunction){ \r\n\t return function () {\r\n\t // If the request's status is \"complete\"\t \r\n\t if (httpObj.readyState == 4) \r\n\t {\r\n\t // Check that we received a successful response from the server\r\n\t if (httpObj.status == 200) \r\n\t {\r\n\t // Pass the XML payload of the response to the handler function.\r\n\t //responseXmlHandler(req.responseXML);\r\n\t responseXml = httpObj.responseXML;\t \r\n\t \t\t responseTxt = httpObj.responseText;\t \t \t\t \t \t\t \r\n\t\t if (handlerFunction == null) { handlerFunction = function() {}; }\r\n\t\t handlerFunction(responseTxt,responseXml);\r\n\t } \r\n\t else \r\n\t {\r\n\t // An HTTP problem has occurred\r\n\t alert(\"HTTP error \"+httpObj.status+\": \"+httpObj.statusText);\r\n\t document.location.reload();\r\n\t }\r\n\t }\r\n\t\tif(document.getElementById(\"loading\")!=null && document.getElementById(\"loading\").className == \"loadingImg\")\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t document.body.removeChild(document.getElementById(\"loading\"));\t\t\r\n\t\t\t}\t \t \r\n\t }\r\n\t }", "title": "" }, { "docid": "80fb767428b2dcddaefcd9bbf524415d", "score": "0.5405612", "text": "function xhrCallback(data){\n console.log('calling xhrcallback');\n addSelectElementOptions(data);\n checkSelectChanging(data);\n}", "title": "" }, { "docid": "097475cd44620cacf7f022c29f76d6a1", "score": "0.5404553", "text": "function OnLoad(callback)\n{\n // Add this callback to the list\n onLoadCallbacks.push(callback);\n}", "title": "" }, { "docid": "fd27dd25a26a0d2b563a43d6d708f933", "score": "0.53933567", "text": "function ready(fn) {\n if(document.readyState !== \"loading\") {\n fn();\n } else if(window.addEventListener) {\n window.addEventListener(\"DOMContentLoaded\", fn);\n } else {\n window.attachEvent(\"onreadystatechange\", function() {\n if(document.readyState !== \"loading\") {\n fn();\n }\n });\n }\n\n}", "title": "" }, { "docid": "26be3ee97a022c43b32b76471dd2b3dd", "score": "0.53719497", "text": "function bindEvent(ele,event,callback){\n\tif (ele.addEventListener) {\n\t\tele.addEventListener(event, callback, false);\n\t}\n\telse {\n\t\tele.attachEvent(event, callback);\n\t}\n}", "title": "" }, { "docid": "56e0c3e737f873c129658b1f23132bca", "score": "0.53694457", "text": "function scriptLoadHandler() {\n main();\n }", "title": "" }, { "docid": "fbead8506cc3741be2fa1024f7c24fd9", "score": "0.53687346", "text": "function bindOnReady(win, callback, eventUtils) {\n var doc = win.document, event = { type: 'ready' };\n\n if (eventUtils.domLoaded) {\n callback(event);\n return;\n }\n\n function isDocReady() {\n // Check complete or interactive state if there is a body\n // element on some iframes IE 8 will produce a null body\n return doc.readyState === \"complete\" || (doc.readyState === \"interactive\" && doc.body);\n }\n\n // Gets called when the DOM is ready\n function readyHandler() {\n if (!eventUtils.domLoaded) {\n eventUtils.domLoaded = true;\n callback(event);\n }\n }\n\n function waitForDomLoaded() {\n if (isDocReady()) {\n removeEvent(doc, \"readystatechange\", waitForDomLoaded);\n readyHandler();\n }\n }\n\n function tryScroll() {\n try {\n // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.\n // http://javascript.nwbox.com/IEContentLoaded/\n doc.documentElement.doScroll(\"left\");\n } catch (ex) {\n Delay.setTimeout(tryScroll);\n return;\n }\n\n readyHandler();\n }\n\n // Use W3C method (exclude IE 9,10 - readyState \"interactive\" became valid only in IE 11)\n if (doc.addEventListener && !(Env.ie && Env.ie < 11)) {\n if (isDocReady()) {\n readyHandler();\n } else {\n addEvent(win, 'DOMContentLoaded', readyHandler);\n }\n } else {\n // Use IE method\n addEvent(doc, \"readystatechange\", waitForDomLoaded);\n\n // Wait until we can scroll, when we can the DOM is initialized\n if (doc.documentElement.doScroll && win.self === win.top) {\n tryScroll();\n }\n }\n\n // Fallback if any of the above methods should fail for some odd reason\n addEvent(win, 'load', readyHandler);\n }", "title": "" }, { "docid": "6629b0b7a645476873f71158278d6c94", "score": "0.5349642", "text": "function completed() {\n\t\t\tclearTimeout( t );\n\t\t\telem.onreadystatechange = elem.onload = elem.onerror = null;\n\t\t\tcallback( elem );\n\t\t}", "title": "" }, { "docid": "fb0438be7693a365033a8e09427e4d71", "score": "0.53467655", "text": "onReady(func) {\n readyCallbacks.push(func);\n }", "title": "" }, { "docid": "b93d0ff0229eb8075ea1eb9ee8595467", "score": "0.5311348", "text": "function onreadystatechange(){\n // Wait until the data is fully loaded,\n // and make sure that the request hasn't already timed out\n if ( xml.readyState == 4 && !requestDone ) {\n // clear poll interval\n\t\t\t\t\t\tif (ival) {\n\t\t\t\t\t\t\tclearInterval(ival);\n\t\t\t\t\t\t\tival = null;\n\t\t\t\t\t\t}\n // Check to see if the request was successful\n if ( httpSuccess( xml ) ) {\n\n // Execute the success callback with the data returned from the server\n options.onSuccess( httpData( xml, options.type ) );\n\n // Otherwise, an error occurred, so execute the error callback\n } else {\n options.onError();\n }\n\n // Call the completion callback\n options.onComplete();\n\n // Clean up after ourselves, to avoid memory leaks\n xml = null;\n }\n }", "title": "" }, { "docid": "982c16cbe6685dd65c9c0fc86e504edd", "score": "0.53047717", "text": "function ready (fn) {\n\tif (document.readyState != 'loading'){\n\t\tfn();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', fn);\n\t}\n}", "title": "" }, { "docid": "743ea64b270f0f50a6f481f5a3594d77", "score": "0.5303332", "text": "function callbackBase(http, id) {\n if (!http) {\n alert(\"Unable to complete processing without an instance of XMLHttpRequest.\");\n return;\n }\n if (http.readyState == 4) {\n //Response loaded.\n if (http.status == 200) {\n //\"OK\" Status.\n try {\n document.getElementById(id).innerHTML =\n \"Chosen Fragment:<br />\" +\n escape(http.responseText.substr(150,50)).italics();\n } catch (ex) {\n alert(\"There was a problem accessing the response XML: \" +\n getErrorInfo(ex));\n }\n } else {\n alert(\"There was a problem retrieving the data:\\n\" + http.statusText);\n }\n }\n}", "title": "" }, { "docid": "0bcec1e64896eeed8fd5bd065d0c4e84", "score": "0.5297795", "text": "function require(file, callback) {\n var script = document.getElementsByTagName('script')[0],\n newjs = document.createElement('script');\n\n // IE\n newjs.onreadystatechange = function () {\n if (newjs.readyState === 'loaded' || newjs.readyState === 'complete') {\n newjs.onreadystatechange = null;\n callback();\n }\n };\n // others\n newjs.onload = function () {\n callback();\n };\n newjs.src = file;\n script.parentNode.insertBefore(newjs, script);\n}", "title": "" }, { "docid": "79596c5c90a575f8cfdaa6054bd240ec", "score": "0.5289279", "text": "function readyStateChanged() {\n\t\t\tif (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) {\n\t\t\t\tdone = true;\n\t\t\t\tscript.onload = null;\n\t\t\t\tscript.onreadystatechange = null;\n\t\t\t\tif (script && script.parentNode) {\n\t\t\t\t\tscript.parentNode.removeChild(script);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "abe1599c9b83392e8d858c4a91f4f0be", "score": "0.52859676", "text": "function onreadystatechange()\n {\n //when ready state is 4, we read server response\n if(xhr.readyState == 4) {\n //continue only if HTTP status is OK\n if(xhr.status = 200){\n try {\n //read response from server\n readResponse();\n } catch(e) {\n //display error message\n displayError(e.toString());\n }\n } else {\n //display error message\n displayError(xhr.statusText);\n }\n }\n }", "title": "" }, { "docid": "33dcbaa4ec22917be32fe059e3174135", "score": "0.52738076", "text": "function ready( fn ) {\n\t if ( !isReady ) {\n\t \n\t // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n\t if ( !doc.body ) {\n\t return defer( ready );\n\t }\n\t \n\t // Remember that the DOM is ready\n\t isReady = true;\n\t \n\t // Execute all callbacks\n\t while ( fn = callbacks.shift() ) {\n\t defer( fn );\n\t }\n\t }\n\t }", "title": "" }, { "docid": "3791ee6e05dca97217e2dfd9975228cc", "score": "0.52724123", "text": "function ready(fn) {\n if (document.attachEvent ? document.readyState === \"complete\" : document.readyState !== \"loading\") {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}", "title": "" }, { "docid": "55052c6757b45aaba882ba1243aa9a93", "score": "0.52702606", "text": "_onLoad() {\n if (this.request.readyState === 4 && this.request.status === 200) {\n TheFragebogen.logger.info(this.constructor.name + \".callbackUpload()\", \"Successful.\");\n if (this.request.responseText !== \"\") {\n TheFragebogen.logger.info(this.constructor.name + \"._onLoad()\", this.request.responseText);\n }\n\n this._sendPaginateCallback();\n } else {\n TheFragebogen.logger.error(this.constructor.name + \"._onLoad()\", \"Request to \" + this.url + \" failed with status code \" + this.request.status);\n this.retryCount = 4;\n this._onError();\n }\n\n this.request = null;\n }", "title": "" }, { "docid": "8bf28a0df1dbf7f87ad2953d268d6b99", "score": "0.5260287", "text": "function loadScript(url, callback)\n{\n // Adding the script tag to the head as suggested before\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n\n // Then bind the event to the callback function.\n // There are several events for cross browser compatibility.\n script.onreadystatechange = callback;\n script.onload = callback;\n\n // Fire the loading\n head.appendChild(script);\n\n //create the socket io and assign to global variable\n //BEGIN CODE ADDED BY MARK\n\t//create socket.io connection DIFFERENT ON LOCAL AND SERVER. ADJUST.\n}", "title": "" }, { "docid": "3eaedf8ce9a4e5e93560f5ea25cad286", "score": "0.525827", "text": "function AjaxEvent () {}", "title": "" }, { "docid": "415a6adc21b03fa236ea9094a573de11", "score": "0.5254353", "text": "function initReady(fn) {\n //W3C-compliant browser\n if (document.addEventListener) {\n document.addEventListener(\"DOMContentLoaded\", fn, false);\n }\n //IE\n else {\n document.onreadystatechange = function() {\n readyState(fn);\n };\n }\n}", "title": "" }, { "docid": "550bb689a7fd428fe6c3bf5787491f78", "score": "0.5253854", "text": "function whenDocumentReady(callback, doc) {\r\n if (!isDocumentReady(doc)) {\r\n var checkReady = function() {\r\n if (doc.readyState === 'complete' || \r\n doc.readyState === requiredReadyState) {\r\n doc.removeEventListener(READY_EVENT, checkReady);\r\n whenDocumentReady(callback, doc);\r\n }\r\n };\r\n doc.addEventListener(READY_EVENT, checkReady);\r\n } else if (callback) {\r\n callback();\r\n }\r\n}", "title": "" }, { "docid": "6a7fb1b993c6fd121396790d644ea134", "score": "0.52467847", "text": "function ready(fn) {\n if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {\n fn();\n }\n else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}", "title": "" }, { "docid": "93572cf62663f3f3fae04debddd86850", "score": "0.5241493", "text": "function async_load_javascript(file, callback) {\n\tregister_callback(file, callback);\n\n\tif (FILES_INCLUDED[file]) {\n\t execute_callbacks(file);\n\t return true;\n\t}\n\tif (FILES_LOADING[file]) \n\t return false;\n\n\tFILES_LOADING[file] = true;\n\n\tvar html_doc = document.getElementsByTagName('head')[0];\n\tjs = document.createElement('script');\n\tjs.setAttribute('type', 'text/javascript');\n\tjs.setAttribute('src', file);\n\thtml_doc.appendChild(js);\n\n\tjs.onreadystatechange = function () {\n if (js.readyState == 'complete' || js.readyState == 'loaded') {\n\t\tif (! FILES_INCLUDED[file]) {\n\t\t FILES_INCLUDED[file] = true;\n\t\t execute_callbacks(file);\n\t\t}\n }\n\t};\n\n\tjs.onload = function () {\n\t if (! FILES_INCLUDED[file]) {\n\t\tFILES_INCLUDED[file] = true;\n\t\texecute_callbacks(file);\n\t }\n\t};\n\n\treturn false;\n }", "title": "" }, { "docid": "c03addfed219ad1350c25832adde15a5", "score": "0.52264106", "text": "_executeOnLoad(){\n if( this._onReadyCb ){\n this._onReadyCb( this );\n this._onReadyCb = false; // remove Cb, since this is executed only once\n }\n }", "title": "" }, { "docid": "9da513b3aebb46de6ffb8d7fc18020fc", "score": "0.5222243", "text": "function appendScript(url, callback) {\n 'use strict';\n var s = document.createElement('script');\n s.setAttribute('src', url);\n s.addEventListener('load', function() {\n console.log('Script loaded!');\n if (typeof callback === 'function') {\n callback();\n }\n });\n document.body.appendChild(s);\n}", "title": "" }, { "docid": "18f3ec877c0fa5891fb552f6fc96b09a", "score": "0.5221068", "text": "function ajaxResponse() {\nif (ajaxreq.readyState !=4) return;\nif (ajaxreq.status==200) {\n// if the request succeeded...\nif (ajaxCallback) ajaxCallback();\n} else alert(\"Request failed: \" + ajaxreq.statusText);\nreturn true;\n}", "title": "" }, { "docid": "9ecd6cd46c2fc3bdf93ac09e37813449", "score": "0.52179015", "text": "function onChange(callback)\n {\n _onChange = callback;\n }", "title": "" }, { "docid": "5aba5f0647d0eeadee859435e370cb23", "score": "0.5215535", "text": "function ready(fn) {\n if (document.attachEvent ? document.readyState === \"complete\" : document.readyState !== \"loading\"){\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n}", "title": "" }, { "docid": "c5292c8e4ede9beb88f111b4b4c761df", "score": "0.5214305", "text": "function ready(fn) {\r\n if (document.attachEvent ? document.readyState === \"complete\" : document.readyState !== \"loading\") {\r\n fn;\r\n } else {\r\n document.addEventListener('DOMContentLoaded', fn);\r\n }\r\n}", "title": "" }, { "docid": "35848f9540459a7d3e9b95a22f9d6a70", "score": "0.52086556", "text": "function completed( event ) {\n\t // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {\n\t detach();\n\t ready();\n\t }\n\t }", "title": "" }, { "docid": "1cb2cea966fa777c66d378604a62031e", "score": "0.5204352", "text": "function getReadyStateHandler(xmlHttpRequest) {\n\n\t// an anonymous function returned\n\t// it listens to the XMLHttpRequest instance\n\treturn function() {\n\t\tif (xmlHttpRequest.readyState == 4) {\n\t\t\tif (xmlHttpRequest.status == 200) {\n\t\t\t\tdocument.getElementById(\"review\").innerHTML = xmlHttpRequest.responseText;\n\t\t\t} else {\n\t\t\t\talert(\"HTTP error \" + xmlHttpRequest.status + \": \" + xmlHttpRequest.statusText);\n\t\t\t}\n\t\t}\n\t};\n}", "title": "" }, { "docid": "793d5489eaf75d83a73c86049a11374a", "score": "0.52002585", "text": "on(eventType, cb) {\n this._addEventCallback(eventType, cb);\n }", "title": "" }, { "docid": "a6be0d7ad2dddd2751b625c8dc51647c", "score": "0.5190608", "text": "function onReady(event) {\n // bail if already triggered or IE8 document is not ready just yet\n var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete';\n if (docReady.isReady || isIE8NotReady) {\n return;\n }\n\n trigger();\n }", "title": "" }, { "docid": "0fef18abed02b8f564ccbe00db7aea3d", "score": "0.51878595", "text": "function onReady(func) {\n readyCallbacks.push(func);\n }", "title": "" }, { "docid": "0fef18abed02b8f564ccbe00db7aea3d", "score": "0.51878595", "text": "function onReady(func) {\n readyCallbacks.push(func);\n }", "title": "" }, { "docid": "0fef18abed02b8f564ccbe00db7aea3d", "score": "0.51878595", "text": "function onReady(func) {\n readyCallbacks.push(func);\n }", "title": "" }, { "docid": "c0105d428e092baee861bf5777cfe310", "score": "0.51825523", "text": "function loadScript(scriptName, callback) {\n\t\n\t\tif (!jsArray[scriptName]) {\n\t\t\tjsArray[scriptName] = true;\n\t\n\t\t\t// adding the script tag to the head as suggested before\n\t\t\tvar body = document.getElementsByTagName('body')[0],\n\t\t\t\tscript = document.createElement('script');\n\t\t\tscript.type = 'text/javascript';\n\t\t\tscript.src = scriptName;\n\t\n\t\t\t// then bind the event to the callback function\n\t\t\t// there are several events for cross browser compatibility\n\t\t\tscript.onload = callback;\n\t\n\t\t\t// fire the loading\n\t\t\tbody.appendChild(script);\n\t\t\t\n\t\t\t// clear DOM reference\n\t\t\t//body = null;\n\t\t\t//script = null;\n\t\n\t\t} else if (callback) {\n\t\t\t// changed else to else if(callback)\n\t\t\tif (debugState){\n\t\t\t\troot.root.console.log(\"This script was already loaded %c: \" + scriptName, debugStyle_warning);\n\t\t\t}\n\t\t\t//execute function\n\t\t\tcallback();\n\t\t}\n\t\n\t}", "title": "" } ]
9c1b143eb7b82289ec1446a4b024796c
View / Disbale Menu on any mose action
[ { "docid": "c5b19f2af3e39282f7bdfca6620e22aa", "score": "0.0", "text": "function DisableMenuOnMouseAction_Item(e)\n{\n\treturn;\n\tif( HideMenu() )\n\t{\n\t\ttouchEventUsed = true;\n\t}\n\n\tif( HideAboutPage() )\n\t{\n\t\ttouchEventUsed = true;\n\t}\n\n\tif( HideDisclaimerPage() )\n\t{\n\t\ttouchEventUsed = true;\n\t}\n\n\tif( HideBin() )\n\t{\n\t\ttouchEventUsed = true;\n\t}\n\t\n\tif( touchEventUsed )\n\t\te.stopPropagation();\n}", "title": "" } ]
[ { "docid": "3c42df7a8bfecbb65a74483dfd903453", "score": "0.6821908", "text": "function showMenu() {\n\t\t$welcomView.hide();\n\t\t$sideBarView.show();\n\t\t$searchDishView.show();\n\t}", "title": "" }, { "docid": "4c91424cd704bb5759eafb3c66ee073e", "score": "0.6658521", "text": "function showMenu() {\n\t\tsuper.showMenu();\n\t}", "title": "" }, { "docid": "7755748a642335e3e44d7dbd421aa446", "score": "0.65844774", "text": "function showMenu() {\n\t\tmenu.Reveal();\n\t}", "title": "" }, { "docid": "e79ddcc63de8bfa2cbddfc17a212cecb", "score": "0.6523824", "text": "function handleAction(menuName)\n{\n if (menuName === currentSubLink)\n {\n currentSubLink = null;\n }\n else\n {\n currentSubLink = menuName;\n }\n\n hideAllSubLinks();\n\n if (currentSubLink)\n {\n //display the appropriate submenu\n document.getElementById(`${currentSubLink}-links`).style.display = \"block\";\n }\n}", "title": "" }, { "docid": "c5fe59a90ae553413bd6bdabe304cd81", "score": "0.6474988", "text": "function Menu() {}", "title": "" }, { "docid": "8bcf080bdc88cf3a27bcee01056b202b", "score": "0.64455473", "text": "function loadMenu() {\n\n showModNav();\n\n //always show contact information\n addModNav(\"Create New Task\",\"editTask()\");\n\n}", "title": "" }, { "docid": "54b571f1203691c38dc34200d4ae5a9f", "score": "0.6429014", "text": "function menuItemLaunchAction() {\n if ( visibleMenu_ != null ) {\n //var evt = window.event;\n //var item = visibleMenu_.getMenuItem( evt.target );\n var item = visibleMenu_.getSelectedItem();\n if ( item != null && item.isEnabled ) {\n hideCurrentContextMenu( true );\n if ( item.clientAction != null ) {\n eval( item.clientAction );\n }\n if ( item.action != null ) {\n if ( item.action.indexOf( \"javascript:\" ) == 0 ) {\n eval( item.action );\n }\n else {\n //window.location.href = item.action; //@04D\n }\n }\n }\n }\n}", "title": "" }, { "docid": "ac8ab04fe08127c5b25d1401453fa68e", "score": "0.6406201", "text": "function Menu () {\n //get domains\n filesystemDomain = brackets.arduino.domains[filesystemDomainName];\n copypasteDomain = brackets.arduino.domains[copypasteDomainName];\n\n driverDomain = brackets.arduino.domains[driverDomainName];\n\n Strings = brackets.arduino.strings;\n sketch_importLibraryDirectory = brackets.arduino.options.librariesdir;\n sketch_importLibraryUserDirectory = brackets.arduino.options.userlibrariesdir;\n\n //Menus.removeMenu(Menus.AppMenuBar.FIND_MENU);\n Menus.removeMenu(Menus.AppMenuBar.NAVIGATE_MENU);\n Menus.removeMenu(Menus.AppMenuBar.VIEW_MENU);\n // Menus.removeMenu(\"debug-menu\");\n\n createToolMenu();\n createSketchMenu();\n createEditMenu();\n createFileMenu();\n createHelpMenu();\n\n /* filesystemDomain.exec(\"getPlatform\");\n filesystemDomain.on(\"sampleList_data\", setMenuActions);\n filesystemDomain.on(\"platform_data\", getPlatformAction);\n */\n\n ExtensionUtils.loadStyleSheet(module, \"css/Menu.css\");\n\n }", "title": "" }, { "docid": "43c2e56ac5fb12509eed385c24a9371b", "score": "0.63791007", "text": "function openMMenu() {\n myMenuAPI.open();\n}", "title": "" }, { "docid": "900242d340155ba16823c74583dfddad", "score": "0.6335449", "text": "function renderMenu() {\n if(gameResult == false && propositionResolved) {\n renderMenuButton(\"Resign\", width - 70, 40, 90);\n }\n if(myTurn == false && myLastMoveIndex != -1 && gameResult == false) {\n renderMenuButton(\"Undo\", width - 65, 85, 80)\n }\n}", "title": "" }, { "docid": "ed7a1493a4ff6f195b17a8f7c4f1e366", "score": "0.6333078", "text": "function mainmenubutton() {\n\n\t\tkgMenubutton.on('click', function() {\n\t\t\tkgMenubar.toggleClass('menu-open');\n\t\t});\n\n\t\tkgMenubarLink.on('click', function() {\n\t\t\tkgMenubar.removeClass('menu-open');\n\t\t});\n\t\t\n\t\tkgPage.on('click', function() {\n\t\t\tkgMenubar.removeClass('menu-open');\n\t\t});\n\n\t}", "title": "" }, { "docid": "8066674509bd55098c3ce7409aa9b327", "score": "0.6319845", "text": "function editMenu() {\n Data = {\n dialogClass: '',\n popTitle: 'Gestion du menu (non fonctionnel)',\n popContentClass: 'myModal-body editMenu',\n Dispatch: 'menuAction',\n Buttons: [{\n Type: 'info',\n Glyph: 'plus',\n Label: 'Ajouter',\n Want: \"menuAction('add');\"\n }, {\n Type: 'info',\n Glyph: 'pencil',\n Label: 'Editer',\n Want: \"menuAction('edit');\"\n }, {\n Type: 'secondary',\n Glyph: 'log-out',\n Label: 'Quitter',\n Want: ''\n }],\n Content: {\n Action: 'doMenu',\n Want: 'listMenu'\n }\n };\n openPopup(Data);\n}", "title": "" }, { "docid": "1c470b59c2dfc914295c58fe0847459b", "score": "0.6318263", "text": "function showMenu(ev){\n\t\t//kill event\n\t\tkill(ev);\n\t\tmenu.create(ev).show(ev);\n\t}", "title": "" }, { "docid": "e567737a3a81a281c4e26b3247157120", "score": "0.6301451", "text": "function menus_behaviors_do()\n{\n\t//Home ...\n\t$(\"#index_r5_c7\").click(function(){\n\t\tshow_entreprise_do();\n\t\treturn false;\n\t});\n\n\t//Mot du DG ...\n\t$(\"#index_r6_c9\").click(function(){\n\t\tshow_motdg_do();\n\t\treturn false;\n\t});\n\n\t//Entreprise ...\n\t$(\"#first_btn\").click(function(){\n\t\tshow_entreprise_do();\n\t\treturn false;\n\t});\n\n\t//Annonces ...\n\t$(\"#index_r6_c13\").click(function(){\n\t\t//$(zonePrincipale).load(pageDefault).fadeIn(fadeSpeed);\n\t\t//alert(\"Come back lateeeer on it, GreenNer!!!\");\n\t\tshow_flash_1_1_do(\"Come back lateeeer on it, GreenNer!!!\",'f');\n\t\treturn false;\n\t});\n\n\t//Documents ...\n\t$(\"#second_btn\").click(function(){\n\t\t//$(zonePrincipale).load(pageDefault).fadeIn(fadeSpeed);\n\t\t//alert(\"Come back lateeeer on it, GreenNer!!!\");\n\t\tshow_documents_do();\n\t\treturn false;\n\t});\n\n\t//Annuaire ...\n\t$(\"#third_btn\").click(function(){\n\t\t$(zonePrincipale).load(\"annuaire.php\").hide().fadeIn(fadeSpeed);\n\t\treturn false;\n\t});\n}", "title": "" }, { "docid": "cedbf28b8a82d19f413f271ea811a3ae", "score": "0.629391", "text": "static menu(msg) {\n Menu.show(msg.playerid);\n }", "title": "" }, { "docid": "8338830aa5103162c31d85d0ffbf4aa2", "score": "0.628766", "text": "function loadMenu() {\n\n showModNav();\n\n //always show contact information\n\tmenuEntry(\"Current Workflows\",\"workflow\");\n menuEntry(\"Current Tasks\",\"tasks\");\n\tmenuEntry(\"Workflow History\",\"history\");\n\n}", "title": "" }, { "docid": "5d6a8b6f85ef41d2036df089618bdf39", "score": "0.62813807", "text": "function displayMenu() {\r\n let slicePoint = this.id.indexOf(\"L\");\r\n menuId = this.id.slice(0, slicePoint);\r\n switch (menuId) {\r\n case \"entrees\":\r\n mapMenuItems(menuItemsEntrees, menuPopulated, menuId);\r\n break;\r\n case \"rolls\":\r\n mapMenuItems(menuItemsRolls, menuPopulated, menuId);\r\n break;\r\n case \"desserts\":\r\n mapMenuItems(menuItemsDesserts, menuPopulated, menuId);\r\n break;\r\n }\r\n menuPopulated[menuId] = \"true\";\r\n appetizerMenu.classList.remove(\"visible\");\r\n entreeMenu.classList.remove(\"visible\");\r\n rollMenu.classList.remove(\"visible\");\r\n dessertMenu.classList.remove(\"visible\");\r\n document.getElementById(menuId).classList.toggle(\"visible\");\r\n}", "title": "" }, { "docid": "81626339dc01086c889f9a844b8b8b23", "score": "0.6277859", "text": "function onOpen(e) {\n UIManager.registerMenu();\n}", "title": "" }, { "docid": "0292b46e366fa52983b7f8c88875df0a", "score": "0.6276042", "text": "function menuMobile(){\n\tresetVisibility(\"login-content\");\n\tupdateVisibility(\"menu-content\");\n}", "title": "" }, { "docid": "3311de98563dc305ce73914fe1db09ff", "score": "0.6270246", "text": "function menuItemClick(e) { // Private method\n if (this.enabled && this.actionOnClick) {\n var action = this.actionOnClick;\n if (action.indexOf(\"link:\") == 0) {\n location.href = action.substr(5);\n }\n else {\n if (action.indexOf(\"code:\") == 0) {\n eval(action.substr(5));\n }\n else {\n location.href = action;\n }\n }\n }\n if (!e) {\n var e = window.event;\n e.cancelBubble = true;\n }\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n if (this.parent.menuObj.mode == \"cursor\") {\n hideCursorMenus();\n }\n if (this.parent.menuObj.mode == \"absolute\" || this.parent.menuObj.mode == \"fixed\") {\n hideVisibleMenus();\n if (typeof(hideMenuBarMenus) == \"function\") {\n hideMenuBarMenus();\n }\n }\n}", "title": "" }, { "docid": "8942a09c870116f9466ba3b55362280e", "score": "0.62608254", "text": "getMenuOpen(){\n const menu = super.getMenuOpen();\n\n // If there are snapshots, add management options\n if ( this.state.a.length ){\n menu.push(\n {\n title: 'Restore snapshot',\n action: ()=>this.restore()\n }\n );\n }\n\n menu.push(\n {\n title: 'Export game to disk',\n action: ()=>this.export( this.prompt( 'Export filename' ))\n },\n {\n title: 'Import game from disk',\n action: ()=>this.import( this.prompt( 'Import filename' ))\n }\n );\n\n return menu;\n }", "title": "" }, { "docid": "a6a8534d2884999856093f704abc04c9", "score": "0.6253227", "text": "function recomend() \r\n{\r\n document.getElementById(\"menu\").style.display = \"block\"; \r\n document.getElementById(\"menu-page\").style.display = \"none\"; \r\n}", "title": "" }, { "docid": "13025c41933b915461819c696eaa1b0a", "score": "0.62292314", "text": "function goToMenu(event){\n unloadScreen();\n loadScreen(INICIAL);\n}", "title": "" }, { "docid": "1dfc0d4f74fd30fbb819dfed3b430ff6", "score": "0.62250733", "text": "function gotoMainMenu(){\n showMain();\n hideSettings();\n hideInput();\n hideEvents();\n}", "title": "" }, { "docid": "c04265463b01a262361b3e43a86b10ed", "score": "0.62054527", "text": "invokeMenu(id) {\n\n\t\t\t\tconsole.log(\"Clicked menu with ID\", id);\n\t\t\t\t// Storing the menu items array\n\t\t\t\tconst { menuItems } = entrypoints.getPanel(\"vanilla\");\n\n\t\t\t\tswitch (id) {\n\t\t\t\t\tcase \"enabler\":\n \n\t\t\t\t\t\tmenuItems.getItem(\"dynamite\").enabled = !menuItems.getItem(\"dynamite\").enabled;\n\t\t\t\t\t\t\n menuItems.getItem(id).label = menuItems.getItem(id).label == \"Enable 🧨\" ? \"Disable 🧨\" : \"Enable 🧨\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"toggle\":\n\t\t\t\t\t\tmenuItems.getItem(id).checked = !menuItems.getItem(id).checked\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reload\":\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"about\":\n\t\t\t\t\t\tshowAbout()\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}", "title": "" }, { "docid": "c70573d799e0c814a7b2d35d532e6608", "score": "0.6204814", "text": "function MenuActionMode(theKarte) {\n MenuActionAbstract.call(this, theKarte);\n}", "title": "" }, { "docid": "1fcd79946b75d1adde7c0f7fccebedbd", "score": "0.61986136", "text": "changementMenu(dir) {\n this.menu.changementMenu(dir);\n }", "title": "" }, { "docid": "767495a64944c72e8b6806d1d1e3f0a8", "score": "0.619613", "text": "function mostrarMenu()\n{\n\tdespliegaNivel(-1);\n}", "title": "" }, { "docid": "1b199778d0404ec0c7a40667469e5625", "score": "0.61909467", "text": "function backToMainMenu(){\r\n currMenu = \"mainMenu\";\r\n //will need to add the other options\r\n hideInfoMenu();\r\n showMainMenu();\r\n}", "title": "" }, { "docid": "0337ea8dc725e8dbe536300e5e06cd01", "score": "0.6176436", "text": "function shopToMenu() {\n state = \"menu\";\n if (volumeControl) {\n sound.closestore.setVolume(0.05);\n sound.closestore.play();\n }\n icon = {\n flash : false,\n heal : false,\n exhaust : false,\n ignite : false,\n barrier : false,\n };\n}", "title": "" }, { "docid": "c246d423a9252e90f2f43445874981ee", "score": "0.6174931", "text": "function showMenu( menuModel, e) {\n\tif( _activeMenu && _activeMenu.index != menuModel.index ) {\n\t hideActiveMenu();\n\t}\n\tmenuModel.menu.style.display = 'block';\n\thighlightMenuImage( menuModel.menuImage );\n\t_activeMenu = menuModel;\n }", "title": "" }, { "docid": "ff8e9d55b3fa817d8bea2b2b87f1fc68", "score": "0.6172737", "text": "function makeMenus() { }", "title": "" }, { "docid": "772785e59ebe82da801bdba430e7f193", "score": "0.6163066", "text": "function onOpen(e) {\n buildMenu();\n}", "title": "" }, { "docid": "06373b5a61e0e3deb789cb17517ae1fc", "score": "0.6148165", "text": "function onMenuClicked(info) {\n\tif (info.menuItemId === 'ENABLE_MENU') {\n\t\tbgUtils.toggleEnabled();\n\t}\n}", "title": "" }, { "docid": "169ed12d7a5fa66b345c308ac50a7725", "score": "0.6145372", "text": "function showMainMenu() {\n\tconsole.log('What would you like to do today: ');\n\tfor(let i = 0; i < MAIN_MENU.length; i++) {\n\t\tconsole.log(`\\t${MAIN_MENU[i].text}`);\n\t}\n\tlet menuSelection = PROMPT.questionInt('>> ');\n\tif(menuSelection >= 0 && menuSelection < MAIN_MENU.length) {\n\t\tMAIN_MENU[menuSelection].action();\n\t}\n}", "title": "" }, { "docid": "fe72c65ff223f81bbea52c0af4ee0efd", "score": "0.6143705", "text": "function actionOnClick () {\n\n ponerVisible($(\"#menu\"), true);\n ponerVisible($(\"#menuJugar\"), false);\n cambioEstadoBloqueado($(\"#Bmarines\"),true);\n cambioEstadoBloqueado($(\"#Baliens\"),true);\n create();\n button.input.stop();\n \n\n }", "title": "" }, { "docid": "2734096b8aaf1503ea38bd85fba3371f", "score": "0.6142774", "text": "function menuXX() {\n if (menuOpen === 1) {\n menuX(menuClass);\n };\n}", "title": "" }, { "docid": "f223cbb6dec8040265ea86e926c4a788", "score": "0.6141594", "text": "function menuClick() {\n \n //$('li').show(); //this will ONLY show t he list, nothing else\n \n if(!menuOn){\n $('li').slideDown();\n menuOn = true; //menuOn = !menuOn (this is the same as saying what is commented out)\n } else {\n $('li').hide();\n $('li:nth-child(1)').show();\n menuOn = false;\n }\n }", "title": "" }, { "docid": "8f736489ac4e360877c29712161ad782", "score": "0.6130267", "text": "enterMenu() {}", "title": "" }, { "docid": "c6a8a29e1cdf8370af15233ff2703287", "score": "0.6129242", "text": "activerAPropos() {\n this.menu.activerAPropos();\n }", "title": "" }, { "docid": "02192d0557a7db3761a735b0907fccd5", "score": "0.6118366", "text": "_overriddenMenuHandler() { }", "title": "" }, { "docid": "7677cea349f9fb070ea2a4eb8ead9450", "score": "0.6102495", "text": "function onMenuKeyDown() {\n\t\t\t\t\t\t}", "title": "" }, { "docid": "c0e48a26fe1863b791e885199d32c782", "score": "0.6097955", "text": "function rightClick() {\n if (!menu) {\n const vl = this.getVerbList();\n var i;\n var height;\n\n for (i = 0; i < vl.length; i++) {\n console.log('verbs ' + vl[i]);\n if (i == 0) {\n var firstButton = new dropdownMenu(\n mousePosition[0],\n mousePosition[1],\n vl[i]\n );\n //firstButton.updateVerb(vl[i]);\n height = firstButton.getMenuButtonHeight();\n } else {\n var menu = new dropdownMenu(\n mousePosition[0],\n mousePosition[1] + i * height,\n vl[i]\n );\n //menu.updateVerb(vl[i]);\n }\n }\n } else {\n menu.hideSprite();\n }\n}", "title": "" }, { "docid": "c3a832ef15d48b4ba0c1387569bc3ee6", "score": "0.60953194", "text": "function returnToMenu(){\n counter = -1;\n answerSelected = false;\n $(\".view\").hide();\n $(\"#mainMenu\").show();\n}", "title": "" }, { "docid": "c3ba63ce6f068a9810026550de7cdab5", "score": "0.60929453", "text": "function menuChoice(response){\n switch (response.action) {\n case \"View\":\n views.viewMenu(sqlConnection, mainMenu);\n break;\n\n case \"Add\":\n adds.addMenu(sqlConnection, mainMenu);\n break;\n\n case \"Update\":\n updates.updateMenu(sqlConnection, mainMenu);\n break;\n\n case \"Delete\":\n deletes.deleteMenu(sqlConnection, mainMenu);\n break;\n\n case \"Exit\":\n sqlConnection.end();\n process.exit();\n\n default:\n console.log(`Invalid action: ${response.action}`);\n break;\n }\n}", "title": "" }, { "docid": "1a4f56477092a8fc6c2f7070dab92005", "score": "0.6088007", "text": "function hideMenu() {\n\t\tmenu.Hide();\n\t\ttileTouchController.enableInput();\n\t\tcameraMovement.enableInput();\n\t}", "title": "" }, { "docid": "a7dc134eea27512e93900e33aa437964", "score": "0.60846645", "text": "function menuAction(){\n\n if(!gameOver){\n gameOn = true;\n }\n else if(gameOver){\n gameOver = false;\n level = 0; gameOn = true;\n setupMenu();\n newLevel();\n\n }\n}", "title": "" }, { "docid": "b41a999f86e2933e42caf24660666b14", "score": "0.60809743", "text": "function OnMenu( name )\n{ \n app.OpenDrawer();\n}", "title": "" }, { "docid": "f4ea0203a0a399caae4552ff8edc1b70", "score": "0.607714", "text": "function Actions() { \n let all_a = document.querySelectorAll('up.menu-list a'); \n if (all_a) { \n all_a.forEach(a => {\n a.addEventListener('click', e => {\n e.preventDefault();\n })\n }) \n }\n }", "title": "" }, { "docid": "b10fa35aafe1ad5eac6296b1d03d17b8", "score": "0.60638756", "text": "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('Menu')\n .addItem('Enviar transacciones aceptadas', 'menuItem1')\n .addSeparator()\n .addSubMenu(ui.createMenu('Sub-menu')\n .addItem('Segundo', 'menuItem2'))\n .addToUi();\n\n}", "title": "" }, { "docid": "b6eafc6aab3f37e9fa3851861df0b671", "score": "0.60587466", "text": "function abrirMenu(mdOpenMenu, event) {\n mdOpenMenu(event);\n }", "title": "" }, { "docid": "e9c31e18576fcb83cc733e4c0deaf3e4", "score": "0.60561866", "text": "function loadMenu() {\n\n\tshowModNav();\n\n\tif (objinfo.bitmask_text==\"admin\")\n\t{\n\t\tmenuEntry(\"Properties\",\"properties\");\n\t\tmenuEntry(\"Parent Collection\",\"parents\");\n\t\tmenuEntry(\"Permissions\",\"permissions\");\n\t\tmenuEntry(\"Revision History\",\"history\");\n\t}\n\n\tmenuEntry(\"Logs\",\"logs\");\n\tmenuEntry(\"Discussion\",\"discussion\");\n\n addModSpacer();\n menuEntry(\"View Document\",\"viewfile\");\n menuEntry(\"Manage Subscription\",\"managesubscription\");\n\n\n}", "title": "" }, { "docid": "0842dd0431c106d8aba5a580981c2c37", "score": "0.6052255", "text": "function loadModuleMenu() {\n\t\n}", "title": "" }, { "docid": "4b1ea9e81d093f7291800d55f622ecf6", "score": "0.6051506", "text": "function onMenuClick(item) {\r\n return function() {\r\n item.action();\r\n return false;\r\n };\r\n}", "title": "" }, { "docid": "baea54c6143d9d7574216b0279097340", "score": "0.60466653", "text": "function menu(msg) {\n let player = getObj('player', msg.playerid);\n MarchingOrder.Wizard.showMainMenu(player);\n }", "title": "" }, { "docid": "57f1f5e6080998b40f6ae8c816740350", "score": "0.60446143", "text": "function logick_menu_item(name,onclick)\n{\n return menubar_Item(name,onclick,\"element-aktions\");\n}", "title": "" }, { "docid": "13b508cef1e59a7998d7a22365fb0214", "score": "0.60383767", "text": "function toggleMenu() {\n setOpen(!open);\n }", "title": "" }, { "docid": "fa5d9c1ed12c0faf4307123c643e6047", "score": "0.6033724", "text": "activerContact() {\n this.menu.activerContact();\n }", "title": "" }, { "docid": "fc7b0955325daa4c5406d2423e711739", "score": "0.6031834", "text": "function ShowResourceMenu() {\n\n}", "title": "" }, { "docid": "868510d5cd486d66c2be5c92311b4ccc", "score": "0.6027206", "text": "function handleMenuClick(_event) {\n Ti.API.info('handleMenuClick id= ' + _event.row.id);\n if(_event.row.id == -1 )\n onHome();\n else\n hideHome();\n if(typeof _event.row.id !== \"undefined\" && _event.row.id >= 0) {\n \n // Alloy.Globals.tools.UI.fade($.AppWrapper,'out');\n // Open the corresponding controller\n $.moreInfo.removeAllChildren();\n //openScreen(_event.row.id);\n var sede = Alloy.Globals.sedes.data[_event.row.id];\n $.title.text = sede.name;\n // $.logo.text = Alloy.Globals.sedes.data[_event.row.id].imgUrl;\n $.info.text = sede.info;\n \n for(var i=0,j=sede.events.length; i<j; i++){\n var evt = sede.events[i];\n var name = Ti.UI.createLabel({\n text:evt.name,\n left:\"1%\",\n font:{\n fontSize:\"16dp\",\n fontWeight:\"bold\"\n },\n color:\"black\" \n });\n \n var info = Ti.UI.createLabel({\n text:evt.info,\n left:\"1%\",\n font:{\n fontSize:\"12dp\"\n } ,\n color:\"black\"\n });\n \n // var name = Ti.UI.createLabel({\n // text:evt.name,\n // left:\"5%\",\n // font:{\n // fontSize:\"16dp\",\n // fontWeight:\"bold\"\n // } \n // });\n \n $.moreInfo.add(name);\n $.moreInfo.add(info);\n // $.moreInfo.add(name);\n };\n //$.title.text = ;\n // Alloy.Globals.tools.UI.fade($.AppWrapper,'in');\n \n }\n closeMenu();\n}", "title": "" }, { "docid": "787f76776014374fc104a4aac7df6ac7", "score": "0.60200363", "text": "function showMenu(player) {\n\n var account = bank.getAccount(player);\n var menu = menus.createMenu(player, \"Stable\");\n var animals = getStorableAnimals(player);\n var index = -1;\n\n // add \"deposit animal\" menu item\n if (animals.length > 0) {\n\n index+=1;\n\n var depositItem = menus.menuItemBuilder(\"Lead\")\n .description(\"Click to store your animal at the stable.\")\n .onClick(function () {\n showDepositView(menu, player, account);\n });\n\n if (animals.length == 1) {\n depositItem\n .title(\"{YELLOW}Store \" + animals[0].getName())\n }\n else {\n depositItem\n .title(\"{YELLOW}Store Animal\")\n }\n\n menu.putItem(index, depositItem);\n }\n\n // add \"withdraw animal\" menu item\n if (account.size() > 0) {\n\n index+=1;\n\n var withdrawItem = menus.menuItemBuilder(\"Saddle\")\n .description(\"Click to retrieve your stabled animal.\")\n .onClick(function () {\n showWithdrawView(menu, player, account);\n });\n\n if (account.size() == 1) {\n\n var iterator = account.iterator();\n iterator.hasNext();\n var animal = iterator.next();\n\n withdrawItem\n .title(\"{YELLOW}Retrieve \" + animal.getName());\n }\n else {\n withdrawItem\n .title(\"{YELLOW}Retrieve Animal\")\n }\n\n menu.putItem(index, withdrawItem);\n }\n\n // check if no menu items were added\n if (index == -1) {\n\n // tell player about NPC if no menu items were added.\n talkSession(player, function (talk) {\n\n talk\n .npc(3, \"Stable Manager\", \"I can take care of your animals for you.\")\n .npc(4, \"Stable Manager\", \"If you have an animal on a leash or mounted...\")\n .npc(3, \"Stable Manager\", \"...you can store it with me.\");\n });\n }\n else {\n // open menu\n menu.open();\n }\n }", "title": "" }, { "docid": "066a916e06545f71327405dfb078a8ec", "score": "0.60186017", "text": "function toMenu() {\n mainMenu.style.display = '';\n game.style.display = 'none';\n }", "title": "" }, { "docid": "b26f8564cfa418ab67347fe3c02ac22d", "score": "0.6018446", "text": "toggle() {\n if (this.hasMenu()) {\n this.isMenuOpen() ? this.closeMenu() : this.openMenu();\n }\n }", "title": "" }, { "docid": "e578bdc97e72f43e67e3b17a2922d549", "score": "0.6007042", "text": "function backToMenu() {\n toggle();\n clearImages();\n pageNumber = START_PAGE_NUM;\n }", "title": "" }, { "docid": "612d3a7d8458d9bfe4d1010d6a55f7cc", "score": "0.6002732", "text": "function managerMenu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Restock All\", \"Quit\"]\n }\n ]).then((answer) => {\n switch (answer.action) {\n\n case \"View Products for Sale\": viewProductsForSale()\n break;\n case \"View Low Inventory\": viewLowInventory()\n break;\n case \"Add to Inventory\": addToInventory()\n break;\n case \"Add New Product\": addNewProduct()\n break;\n case \"Restock All\": restockAll()\n break;\n case \"Quit\": promptCB(\"Thanks for stopping by manager!\".cyan, function () { connection.end() })\n break;\n\n }\n })\n}", "title": "" }, { "docid": "a1b0a4fbf958989764858f62b84929f0", "score": "0.5998028", "text": "function actionsMenu()\n {\n return m_actionsMenu;\n }", "title": "" }, { "docid": "98599968e12441abdce59cbb43d2658f", "score": "0.5997154", "text": "openFirst() {\n this.menu.enable(true, 'first');\n this.menu.open('first');\n }", "title": "" }, { "docid": "cc26f75f972a914f6e171ebe93d2c148", "score": "0.5994577", "text": "function changeMenu() {\n\t\tIBMCore.common.module.masthead.editProfileMenu({\n\t\t\taction: \"replace\",\n\t\t\tlinks: userLinks\n\t\t});\n\t\t\n\t\t// Replace menu from API; hack for now until implemented in API\n\t\tif (signedIn) {\n\t\t\tdocument.getElementById(\"ibm-signin-minimenu-container\").innerHTML = profileMenuMyIBM + \n\t\t\t\tprofileMenudWHeading + profileMenudW + profileMenuSignOut;\n\t\t} else {\n\t\t\tdocument.getElementById(\"ibm-signin-minimenu-container\").innerHTML = profileMenuMyIBM + \n\t\t\t\tprofileMenudWHeading + profileMenuSignIn;\n\t\t}\n\n\t}", "title": "" }, { "docid": "4aeba40aa8c10499d3d0ce49240277d4", "score": "0.5992313", "text": "changeView(value, data) {\n if (value === 0) {\n // Funcion Flux para invocar la escena LocationDetail con los props coords, dir, contact\n Actions.MenuDetail({plato: data})\n }\n else {\n // Funcion Flux para refrescar el contexto y pasamos los props page_title, selected_page para \n // actualizar la navegacion del MenuBar para renderizar la pantalla de contacto\n Actions.refresh({page_title: 'contacto', selected_page: 2})\n }\n }", "title": "" }, { "docid": "f59888f6accb3368625a5ec38e770157", "score": "0.59911764", "text": "function flyoutMenuClickedHandler (event) {\n\n\t\t\t// the event's \"data\" attribute is an object, which contains \"menuId\" and \"menuName\"\n\t\t\tconsole.dir(event); \n\t\t\tswitch (event.data.menuId) {\n\t\t\t\t\n\t\t\t\tcase \"checkableMenuItem\": \n\t\t\t\t\tcheckableMenuItem_isChecked = !checkableMenuItem_isChecked;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(\"Checkable Menu Item\", true, checkableMenuItem_isChecked);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"actionMenuItem\": \n\t\t\t\t\ttargetMenuItem_isEnabled = !targetMenuItem_isEnabled;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(\"Target Menu Item\", targetMenuItem_isEnabled, false);\n\t\t\t\t\tbreak;\n\t\t\t\t//A-B-C menu is Toggled.\n\t\t\t\tcase \"patternA\":\n\t\t\t\t\tpatternA_isChecked = !patternA_isChecked;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(patternA_Label, true, patternA_isChecked);\n\t\t\t\t\tif(patternB_isChecked == true || patternC_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternB_Label, true, false);\n\t\t\t\t\t\tpatternB_isChecked = false;\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternC_Label, true, false);\n\t\t\t\t\t\tpatternC_isChecked = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(patternA_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternA_Label, false, true);\n\t\t\t\t\t}\n\t\t\t\t\tsckeystring = \"patternA\";\n\t\t\t\t\tscrRead();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"patternB\":\n\t\t\t\t\tpatternB_isChecked = !patternB_isChecked;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(patternB_Label, true, patternB_isChecked);\n\t\t\t\t\tif(patternA_isChecked == true || patternC_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternA_Label, true, false);\n\t\t\t\t\t\tpatternA_isChecked = false;\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternC_Label, true, false);\n\t\t\t\t\t\tpatternC_isChecked = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(patternB_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternB_Label, false, true);\n\t\t\t\t\t}\n\t\t\t\t\tsckeystring = \"patternB\";\n\t\t\t\t\tscrRead();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"patternC\":\n\t\t\t\t\tpatternC_isChecked = !patternC_isChecked;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(patternC_Label, true, patternC_isChecked);\n\t\t\t\t\tif(patternA_isChecked == true || patternB_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternA_Label, true, false);\n\t\t\t\t\t\tpatternA_isChecked = false;\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternB_Label, true, false);\n\t\t\t\t\t\tpatternB_isChecked = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(patternC_isChecked == true){\n\t\t\t\t\t\tcsInterface.updatePanelMenuItem(patternC_Label, false, true);\n\t\t\t\t\t}\n\t\t\t\t\tsckeystring = \"patternC\";\n\t\t\t\t\tscrRead();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: \n\t\t\t\t\t//console.log(event.data.menuName + \" clicked!\");\n\t\t\t}\n\n\t\t\t//csInterface.evalScript(\"alert('Clicked!\\\\n \\\"\" + event.data.menuName + \"\\\"');\");\n\t\t}", "title": "" }, { "docid": "482643929475bd1faf30785f285bcbca", "score": "0.59849894", "text": "function menu() {\n return inquirer.prompt([\n {\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: \n [\n \"View all employees\",\n \"View all employees by department\",\n \"View all employees by Manager\",\n \"Add an employee\",\n \"Remove an employee\",\n \"Update an employee's role\",\n \"Update an employee's manager\",\n \"View all roles\",\n \"Add a role\",\n \"Remove a role\",\n \"View all departments\",\n \"Add a department\",\n \"Remove a department\",\n \"View a department's budget\",\n \"Exit\"\n ]\n }\n ])\n}", "title": "" }, { "docid": "7bda43f64c10f9f61d02405125f96f98", "score": "0.5976667", "text": "function menu(){\r\n\r\n\tinquirer.prompt([\r\n\t\t{\r\n\t\t\tname: \"viewMenu\",\r\n\t\t\ttype: \"list\",\r\n\t\t\tmessage: \"Hi Manager. What would you like to do today?\",\r\n\t\t\tchoices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\r\n\t\t}\r\n\t\t\r\n\t]).then(function(answers){\r\n\t\tif (answers.viewMenu === \"View Products for Sale\"){\r\n\t\t\tmenu_viewProd();\r\n\t\t}\r\n\r\n\t\telse if (answers.viewMenu === \"View Low Inventory\"){\r\n\t\t\tmenu_viewLowInv();\r\n\t\t}\r\n\r\n\t\telse if (answers.viewMenu === \"Add to Inventory\"){\r\n\t\t\tmenu_addInv();\r\n\t\t}\r\n\r\n\t\telse if (answers.viewMenu === \"Add New Product\"){\r\n\t\t\tmenu_addProd();\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "f29b372725dc5481c681ef2c3e4900c7", "score": "0.59764814", "text": "function draw(role) {\n var menu = {\n 'admin': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.tablero', {\n title: 'Tablero Gerencial',\n icon : 'icon-chart-line',\n state: 'app.tablero',\n translate: 'TABLERO.TABLERO_NAV',\n weight: 1\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 2\n });\n\n //Flota\n msNavigationService.saveItem('inspector.flota', {\n title: 'Flota',\n icon: 'icon-car',\n state: 'app.flota',\n translate: 'FLOTA.FLOTA_NAV',\n weight: 3\n });\n\n //informes\n msNavigationService.saveItem('inspector.informes', {\n title: 'Informes',\n icon: 'icon-file-document',\n state: 'app.informes',\n translate: 'INFORMES.INFORMES_NAV',\n weight: 4\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 6\n });\n\n msNavigationService.saveItem('admin.clientes', {\n title: 'Clientes',\n state: 'app.administracion.clientes',\n translate: 'ADMIN.CUSTOMER_NAV',\n weight: 1\n });\n\n msNavigationService.saveItem('admin.usuarios', {\n title: 'Usuarios',\n state: 'app.administracion.usuarios',\n translate: 'ADMIN.USER_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('admin.inspecciones', {\n title: 'Inspecciones',\n state: 'app.administracion.inspecciones',\n translate: 'ADMIN.INSPECTION_NAV',\n weight: 3\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n translate: 'ADMIN.VEHICLE_NAV',\n weight: 4\n });\n },\n 'cda': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.tablero', {\n title: 'Tablero Gerencial',\n icon : 'icon-chart-line',\n state: 'app.tablero',\n translate: 'TABLERO.TABLERO_NAV',\n weight: 1\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 2\n });\n\n //Flota\n msNavigationService.saveItem('inspector.flota', {\n title: 'Flota',\n icon: 'icon-car',\n state: 'app.flota',\n translate: 'FLOTA.FLOTA_NAV',\n weight: 3\n });\n\n //\n msNavigationService.saveItem('inspector.seguimiento', {\n title: 'Seguimiento',\n icon: 'icon-trello',\n state: 'app.seguimiento',\n translate: 'TRACKING.TRACKING_NAV',\n weight: 4\n });\n\n //informes\n msNavigationService.saveItem('inspector.informes', {\n title: 'Informes',\n icon: 'icon-file-document',\n state: 'app.informes',\n translate: 'INFORMES.INFORMES_NAV',\n weight: 5\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 6\n });\n\n msNavigationService.saveItem('admin.clientes', {\n title: 'Clientes',\n state: 'app.administracion.clientes',\n translate: 'ADMIN.CUSTOMER_NAV',\n weight: 1\n });\n\n msNavigationService.saveItem('admin.usuarios', {\n title: 'Usuarios',\n state: 'app.administracion.usuarios',\n translate: 'ADMIN.USER_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('admin.inspecciones', {\n title: 'Inspecciones',\n state: 'app.administracion.inspecciones',\n translate: 'ADMIN.INSPECTION_NAV',\n weight: 3\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n translate: 'ADMIN.VEHICLE_NAV',\n weight: 4\n });\n\n msNavigationService.saveItem('admin.centro-alertas', {\n title: 'Centro Alertas',\n state: 'app.administracion.centro-alertas',\n translate: 'ADMIN.WARNING_CENTER_NAV',\n weight: 5\n });\n\n },\n 'sede': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.tablero', {\n title: 'Tablero Gerencial',\n icon : 'icon-chart-line',\n state: 'app.tablero',\n translate: 'TABLERO.TABLERO_NAV',\n weight: 1\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 2\n });\n\n //Flota\n msNavigationService.saveItem('inspector.flota', {\n title: 'Flota',\n icon: 'icon-car',\n state: 'app.flota',\n translate: 'FLOTA.FLOTA_NAV',\n weight: 3\n });\n\n //informes\n msNavigationService.saveItem('inspector.informes', {\n title: 'Informes',\n icon: 'icon-file-document',\n state: 'app.informes',\n translate: 'INFORMES.INFORMES_NAV',\n weight: 4\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 6\n });\n\n msNavigationService.saveItem('admin.clientes', {\n title: 'Clientes',\n state: 'app.administracion.clientes',\n translate: 'ADMIN.CUSTOMER_NAV',\n weight: 1\n });\n\n msNavigationService.saveItem('admin.usuarios', {\n title: 'Usuarios',\n state: 'app.administracion.usuarios',\n translate: 'ADMIN.USER_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('admin.inspecciones', {\n title: 'Inspecciones',\n state: 'app.administracion.inspecciones',\n translate: 'ADMIN.INSPECTION_NAV',\n weight: 3\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n translate: 'ADMIN.VEHICLE_NAV',\n weight: 4\n });\n\n msNavigationService.saveItem('admin.centro-alertas', {\n title: 'Centro Alertas',\n state: 'app.administracion.centro-alertas',\n translate: 'ADMIN.WARNING_CENTER_NAV',\n weight: 5\n });\n },\n 'flota': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n //Flota\n msNavigationService.saveItem('inspector.flota', {\n title: 'Flota',\n icon: 'icon-car',\n state: 'app.flota',\n translate: 'FLOTA.FLOTA_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('inspector.flota', {\n title: 'Flota',\n icon: 'icon-car',\n state: 'app.flota',\n translate: 'FLOTA.FLOTA_NAV',\n weight: 2\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 3\n });\n\n //\n msNavigationService.saveItem('inspector.seguimiento', {\n title: 'Seguimiento',\n icon: 'icon-trello',\n state: 'app.seguimiento',\n translate: 'TRACKING.TRACKING_NAV',\n weight: 4\n });\n\n //informes\n msNavigationService.saveItem('inspector.informes', {\n title: 'Informes',\n icon: 'icon-file-document',\n state: 'app.informes',\n translate: 'INFORMES.INFORMES_NAV',\n weight: 5\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 5\n });\n\n msNavigationService.saveItem('admin.usuarios', {\n title: 'Usuarios',\n state: 'app.administracion.usuarios',\n translate: 'ADMIN.USER_NAV',\n weight: 6\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n translate: 'ADMIN.VEHICLE_NAV',\n weight: 7\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n translate: 'ADMIN.VEHICLE_NAV',\n weight: 8\n });\n\n msNavigationService.saveItem('admin.providers', {\n title: 'Providers',\n state: 'app.administracion.providers',\n translate: 'ADMIN.PROVIDER_NAV',\n weight: 9\n });\n },\n 'tecnico': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.inspections', {\n title: 'Inspections',\n translate: 'REVIEW.REVIEW',\n icon: 'icon-checkbox-marked',\n state: 'app.reviews',\n weight: 2\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 3\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 4\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n weight: 5\n });\n },\n 'country Manager': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'MOBI App',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.requests', {\n icon : 'icon-email',\n title: 'Requess',\n state: 'app.requests_providers',\n translate: 'ADMIN.REQUESTS_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('inspector.providers', {\n icon : 'icon-taxi',\n title: 'Providers',\n state: 'app.administracion.providers',\n translate: 'ADMIN.PROVIDER_NAV',\n weight: 3\n });\n\n msNavigationService.saveItem('inspector.orders', {\n icon : 'icon-cart-outline',\n title: 'Orders',\n state: 'app.orders',\n translate: 'ADMIN.ORDERS_NAV',\n weight: 4\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 5\n });\n\n msNavigationService.saveItem('admin.promotions', {\n title: 'Promotions',\n state: 'app.administracion.promotions',\n translate: 'ADMIN.PROMOTIONS_NAV',\n weight: 6\n });\n\n },\n 'provider_app': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'MOBI App',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.providers', {\n icon : 'icon-taxi',\n title: 'Providers',\n state: 'app.administracion.providers.edit',\n translate: 'ADMIN.CONFIG_PROVIDER_NAV',\n weight: 2\n });\n\n msNavigationService.saveItem('inspector.orders', {\n icon : 'icon-cart-outline',\n title: 'Orders',\n state: 'app.orders',\n translate: 'ADMIN.ORDERS_NAV',\n weight: 3\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 4\n });\n\n msNavigationService.saveItem('admin.promotions', {\n title: 'Promotions',\n state: 'app.administracion.promotions',\n translate: 'ADMIN.PROMOTIONS_NAV',\n weight: 5\n });\n\n },\n 'tecnico flota': function() {\n //Tablero Gerencial\n msNavigationService.saveItem('inspector', {\n title: 'INSPECTOR',\n group: true,\n weight: 1\n });\n\n msNavigationService.saveItem('inspector.inspections', {\n title: 'Inspections',\n translate: 'REVIEW.REVIEW',\n icon: 'icon-checkbox-marked',\n state: 'app.reviews',\n weight: 3\n });\n\n //Consolidado\n msNavigationService.saveItem('inspector.consolidado', {\n title: 'Consolidado',\n icon: 'icon-view-list',\n state: 'app.consolidado',\n translate: 'CONSOLIDADO.CONSOLIDADO_NAV',\n weight: 2\n });\n\n //administracion\n msNavigationService.saveItem('admin', {\n title: 'Administracion',\n group: true,\n weight: 6\n });\n\n msNavigationService.saveItem('admin.vehiculos', {\n title: 'Vehiculos',\n state: 'app.administracion.vehiculos',\n weight: 4\n });\n },\n 'aseguradora': function() {\n return 'Pepsi';\n },\n 'callCenter': function() {\n return 'Lemonade';\n }\n };\n if (role) {\n return menu[role]();\n }\n\n }", "title": "" }, { "docid": "f1a77ad64ce2418857faf1219fa72d4f", "score": "0.59607494", "text": "function setMenu(){\n\t\n\t\t//change the jquery selectors to fit the project:\n\t\tvar toggle = $('.toggle-menu');\n\t\tvar toggleBtn = $('.toggle-menu i');\n\t\tvar menu = $('.menu-main-container');\n\t\n\t\n\t\ttoggle.on('click tap', function(){\n\t\t\tmenu.toggleClass( 'fold-out' );\n\t\t\ttoggleBtn.toggleClass( 'fa-remove' );\n\t\t\ttoggleBtn.toggleClass('fa-bars' );\n\t\n\t\t\treturn false;\n\t\t});\n\t\n\t\t$('html').on('click tap',function( e ) {\n\t\n\t\t\t//Hide the menus if visible\n\t\t\tif( menu.hasClass( 'fold-out' ) ){\n\t\n\t\t\t\tmenu.removeClass( 'fold-out' );\n\t\t\t\ttoggleBtn.removeClass( 'fa-remove' );\n\t\t\t\ttoggleBtn.addClass('fa-bars' );\n\t\t\t\n\t\t\t\t//return false;\n\t\n\t\t\t}else if( $('.feedback-wrapper').hasClass( 'fold-out' ) ){\n\t\n\t\t\t\t$('.feedback-wrapper .label').trigger( 'click' );\n\t\n\t\t\t}\n\t\t});\n\t\n\t\n\t\t$( '.menu-item-has-children > a' ).on('click', function( e ){\n\t\n\t\t\tif( menu.hasClass( 'fold-out' ) ){\n\t\n\t\t\t\te.preventDefault();\n\t\n\t\t\t\tvar parent = $( this ).parent();\n\t\n\t\t\t\tif( parent.hasClass( 'fold-out' ) ){\n\t\n\t\t\t\t\tif( $( this ).attr('href').length > 0 ){\n\t\t\t\t\t\tvar _url = $( this ).attr('href');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t_url = $( this ).find( 'a' ).attr( 'href' );\n\t\t\t\t\t}\n\t\n\t\t\t\t\twindow.location.href = _url;\n\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\tparent.addClass( 'fold-out' );\n\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "f5ae775393134a4cd36b3eed17cb34dc", "score": "0.59556514", "text": "function performSelectedAction(){\r\n\tswitch(selectedAction){\r\n\t\tcase TitleScreenActionType.start:\r\n\t\t\tshowGame();\r\n\t\t\tbreak;\r\n\t\tcase TitleScreenActionType.instructions:\r\n\t\t\tshowInstructions();\r\n\t\t\tbreak;\r\n\t\tcase TitleScreenActionType.configuration:\r\n\t\t\tshowConfiguration();\r\n\t\t\tbreak;\r\n\t\tcase TitleScreenActionType.credits:\r\n\t\t\tshowCredits();\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "79b2fb0b4cd11ac9ed46a10bea2c1e5c", "score": "0.595433", "text": "activeMenuEvent() {\n if (this._initMenuEvent) {\n return;\n }\n\n this._addHelpActionEvent('undo');\n this._addHelpActionEvent('redo');\n this._addHelpActionEvent('reset');\n this._addHelpActionEvent('delete');\n this._addHelpActionEvent('deleteAll');\n\n this._addDownloadEvent();\n\n snippet.forEach(this.options.menu, menuName => {\n this._addMenuEvent(menuName);\n this._addSubMenuEvent(menuName);\n });\n this._initMenu();\n this._initMenuEvent = true;\n }", "title": "" }, { "docid": "b2f018d448b18e9cf7e64bc8a9514452", "score": "0.59478414", "text": "function HandlerMtoMenu(e) {\n if (menu.style.display === \"none\") {\n if (e.keyCode === 77) {\n game_switch = \"menu\";\n }\n } else {\n if (e.keyCode === 77) {\n game_switch = \"on\";\n }\n }\n}", "title": "" }, { "docid": "ff5a13a056e0dd25562ebe8491132789", "score": "0.59429467", "text": "helpMenu() {\n this.actOne_help_menu.alpha = 1.0;\n this.actOne_helpOpen = true;\n }", "title": "" }, { "docid": "06c508c9ef02864e2d8feaa916f30965", "score": "0.59426826", "text": "openMenu() {\n this.showDeleteConfirmation = false;\n this.menu.classList.add(CSS.menuAnimation);\n this.menu.classList.remove(CSS.hidden);\n }", "title": "" }, { "docid": "fb9cfb0d5e9026ff5867d102763c43a8", "score": "0.59396946", "text": "handleMenuPress() {\n if (this.props.isModal) {\n // Close modal if page was accessed from the side menu\n this.props.navigator.dismissModal({ animationType: 'slide-down' });\n } else {\n // Open the drawer menu if accessed from tabs stack\n this.props.navigator.toggleDrawer({\n side: 'left',\n animated: true\n });\n }\n }", "title": "" }, { "docid": "2bb0b00841ae63ce346b38617579424b", "score": "0.5932423", "text": "function initMenu()\n{\n\tativaBotaoAdicionaRaiz(\"../php/sistemas.php?funcao=alterarSistemas\",\"adiciona\");\n\tcore_carregando(\"ativa\");\n\tcore_ativaPainelAjuda(\"ajuda\",\"botaoAjuda\");\n\tcore_pegaPerfis(\"pegaSistemas()\");\n}", "title": "" }, { "docid": "5e40e565f43af4f9345a8b8c0dedf0c8", "score": "0.5924793", "text": "userviewClickMenu(menu) {\n this.driver.wait(this.until.elementLocated(this.By.className(\"menu\")));\n\n //Open submenu \"List\" in User View\n this.driver.findElement(this.By.partialLinkText(menu)).click();\n }", "title": "" }, { "docid": "d96a7d5ea4ae889cf9acff3dfdc5e811", "score": "0.59181577", "text": "function openMenu(evt, menuName) {\n var i, x, tabs;\n x = $(\".menu\");\n for (i = 0; i < x.length; i++) {\n $(x[i]).css('display', \"none\");\n }\n tabs = $(\".menu-category\");\n for (i = 0; i < x.length; i++) {\n $(tabs[i]).removeClass(\" blue\").addClass('black');\n }\n $(\"body\").find('#' + menuName).css('display', 'block');\n $(evt.currentTarget).children().removeClass('black').addClass('blue');\n}", "title": "" }, { "docid": "9893006dcc4363ba2112568cd4c0d44b", "score": "0.5915715", "text": "function MenuActionOnce(theKarte) {\n MenuActionAbstract.call(this, theKarte);\n}", "title": "" }, { "docid": "ac07324d13582aa9e1bba12d0278c4ad", "score": "0.5909836", "text": "function showHideMenu(){\n\t$.drawermenu.showhidemenu();\n\t$.drawermenu.menuOpen=!$.drawermenu.menuOpen;\n}", "title": "" }, { "docid": "41f76f488cdb9125712c62a926ecf8f2", "score": "0.5903225", "text": "show(event) {\n Context.current.remove();\n if (event.target === document.body) return;\n let data_context = {\n left: event.pageX,\n top: event.pageY,\n menuitems: Context.current._menu,\n target: event.target\n }\n Context.current._view = Blaze.renderWithData(Template._context_menu, data_context, $('#_context_menu_container').get(0));\n }", "title": "" }, { "docid": "455781b1bb5cc4c5d0bc4dab8da320f7", "score": "0.5901727", "text": "function do_actions(action) {\n\t\t\tvar redirect = false;\n\t\t\tif (action == \"save\") {\n\t\t\t\t// ok it is redundand\n\t\t\t\t// save will not redirect to index\n\t\t\t\tredirect = false;\n\t\t\t} else if (action == \"exit\") {\n\t\t\t\t// Save and exit will redirect\n\t\t\t\tredirect = true;\n\t\t\t}\n\t\t\tmarc_editor_send_form(redirect);\n\t\t}", "title": "" }, { "docid": "77dea26aaeea4884081bd8fff2078fc9", "score": "0.5901582", "text": "showActionMenu(item) {\n // Make sure no multiple menu on the screen\n if (itemMenu.getChildren() != 0) {\n this.clearGroup(itemMenu);\n }\n\n // Create user interface on right hand side\n let itemPanel = this.add.graphics().setDepth(2);\n itemPanel.lineStyle(3, 0xffffff, 1);\n itemPanel.strokeRect(630, 195, 165, 190);\n itemPanel.fillStyle(0x000000, 1);\n itemPanel.fillRect(630, 195, 165, 190);\n itemMenu.add(itemPanel);\n\n let itemType = this.add.text(635, 200, \"Type:\\n\" + `${item.getType()}`, {\n fill: \"white\",\n fontFamily: CST.FONT.GEORGIA,\n fontSize: 20\n }).setOrigin(0).setDepth(2);\n itemMenu.add(itemType);\n\n let itemRareness = this.add.text(635, 250, \"Rareness: \" + `${item.getRareness()}`, {\n fill: \"white\",\n fontFamily: CST.FONT.GEORGIA,\n fontSize: 18\n }).setOrigin(0).setDepth(2);\n itemMenu.add(itemRareness);\n\n let itemLevel = this.add.text(635, 280, \"Level: \" + `${item.getItemLevel()}`, {\n fill: \"white\",\n fontFamily: CST.FONT.GEORGIA,\n fontSize: 20\n }).setOrigin(0).setDepth(2);\n itemMenu.add(itemLevel);\n\n let itemAttribute = this.add.text(635, 310, \"Attribute: \" + `${item.getAttribute()}`, {\n fill: \"white\",\n fontFamily: CST.FONT.GEORGIA,\n fontSize: 20\n }).setOrigin(0).setDepth(2);\n itemMenu.add(itemAttribute);\n\n let SendButton = this.add.text(635, 350, \"Send to opponent\", {\n fill: \"white\",\n fontFamily: CST.FONT.GEORGIA,\n fontSize: 20\n }).setOrigin(0).setDepth(2);\n itemMenu.add(SendButton);\n SendButton.setInteractive();\n SendButton.on(\"pointerover\", () => {\n SendButton.setStyle({ fill: \"green\" });\n });\n SendButton.on(\"pointerout\", () => {\n SendButton.setStyle({ fill: \"white\" });\n });\n SendButton.on(\"pointerup\", () => {\n this.emitter.emit(\"transferOwnership\", account, opponentAccount, item.getID());\n });\n\n }", "title": "" }, { "docid": "3bf7c18525fd20b5533e1555561d841c", "score": "0.58998966", "text": "function goToDashboard(){\n\tperformAction('dashboard');\n}", "title": "" }, { "docid": "668f4f6e475a4401f8f67b242b874d7d", "score": "0.58896995", "text": "function showMenu() {\n console.info(\n `\\nYou can choose for these commands:\\n\\n` +\n `exit, quit: Exits the program\\n`+\n `menu, help: Shows this menu\\n` +\n `larare: Show table Teachers and their info\\n`+\n `kompetens: Shows how the teachers competence changed during the payreview\\n`+\n `lon: Shows how the teachers salary changed during the payreview\\n`+\n `sok: <searchString> search teachers table\\n`+\n `nylon: <acronym> <lon> choose a teacher and change their salary\\n\\n`\n );\n}", "title": "" }, { "docid": "f6403a685a348dc71bceda51f567bd57", "score": "0.5887573", "text": "function goToMenu()\n{\n\twindow.location = \"menu.index\";\n}", "title": "" }, { "docid": "c9d34a13d29b390eaf261dd78e088c7e", "score": "0.58826613", "text": "function handleMenuClick(e) {\n message.info(\"Click on menu item.\");\n console.log(\"click\", e);\n}", "title": "" }, { "docid": "b30c400c88f03127bd8095ac028da8cf", "score": "0.58764267", "text": "function _abreMenuClick () {\n $scope.acao();\n }", "title": "" }, { "docid": "71c7fda9fa4806f1f88b36ada7ac39ad", "score": "0.58747756", "text": "function OperatE_tagmenu(){\t\n\t\t//custom the menucustom the menucustom the menucustom the menu\n\t\t//custom the menucustom the menucustom the menucustom the menu\t\t\t\t\t \n\t\t/*hide the idea create menu*/\n\t\t$('#MenU_ideatagback,#TaG_cancelcon').click(function(){\n\t\t\tIdeA_tagmenuhide();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t});\t\n}", "title": "" }, { "docid": "d88540b32f8b2999a94b83baeafab4d1", "score": "0.5870429", "text": "function toggleMenu(){\n\t\t$menuPrincipal.toggleClass('open');\n\t}", "title": "" }, { "docid": "d9cce30bd480e04021295e9c6042db84", "score": "0.5870098", "text": "function viewShops(e) {\n showView('shops');\n }", "title": "" }, { "docid": "0f987db2b8f0782b04d9dc68669177b3", "score": "0.5859656", "text": "function menuClick() {\n \t\tif (active && closeOnClick) close();\n \t}", "title": "" }, { "docid": "4984a85d96864b68034ae344afcef12c", "score": "0.5854943", "text": "pluginGetMenu() {}", "title": "" }, { "docid": "45f2ce843847b999b0871cb20ce25969", "score": "0.5854083", "text": "function toggleMenu() {\n $scope.menuOpen = !$scope.menuOpen;\n }", "title": "" }, { "docid": "76887168c27300240e3db2602836ff4f", "score": "0.5853295", "text": "function flyoutMenuClickedHandler (event) {\n\n\t\t\t// the event's \"data\" attribute is an object, which contains \"menuId\" and \"menuName\"\n\t\t\tconsole.dir(event); \n\t\t\tswitch (event.data.menuId) {\n\t\t\t\t\n\t\t\t\tcase \"checkableMenuItem\": \n\t\t\t\t\tcheckableMenuItem_isChecked = !checkableMenuItem_isChecked;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(\"Checkable Menu Item\", true, checkableMenuItem_isChecked);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"actionMenuItem\": \n\t\t\t\t\ttargetMenuItem_isEnabled = !targetMenuItem_isEnabled;\n\t\t\t\t\tcsInterface.updatePanelMenuItem(\"Target Menu Item\", targetMenuItem_isEnabled, false);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: \n\t\t\t\t\tconsole.log(event.data.menuName + \" clicked!\");\n\t\t\t}\n\n\t\t\tcsInterface.evalScript(\"alert('Clicked!\\\\n \\\"\" + event.data.menuName + \"\\\"');\");\n\t\t}", "title": "" }, { "docid": "7947b97d38a68816400a5589801e9632", "score": "0.5850735", "text": "function mainMenuMousePressed(event){\n currentView = \"slots\";\n}", "title": "" } ]
84b9685e453311ef36adc409c24c1c08
RWD Resize ForMible Judge IOS Device
[ { "docid": "d3b00a9c7bde61930bacacecb42b7b9d", "score": "0.0", "text": "function iOS() {\n return [\n 'iPad Simulator',\n 'iPhone Simulator',\n 'iPod Simulator',\n 'iPad',\n 'iPhone',\n 'iPod'\n ].includes(navigator.platform)\n // iPad on iOS 13 detection\n || (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document)\n}", "title": "" } ]
[ { "docid": "c362647f0252fba6ec384c8dbef2f8ed", "score": "0.70719725", "text": "function resize() {\n //TODO needed?\n}", "title": "" }, { "docid": "09b5abd8947c4f9cb0ad421307fd8e8c", "score": "0.68647975", "text": "function resize() {\n\n }", "title": "" }, { "docid": "532b96248cd4b01309d69d79b714e768", "score": "0.66912436", "text": "function setResizeWeight(resizeW) {\n}", "title": "" }, { "docid": "03913c065558c8f82bd998877cab73e7", "score": "0.66671085", "text": "function wr_resizeTo(width, height, doneHandler)\n{\n\tvar speedFactor, startingRect, finishingRect, rectAnimation, stretchAnimation;\n\n\tspeedFactor = ((event && event.shiftKey) ? 10 : 1);\n\n\t// 2 AppleRect objects store the starting and finshing rectangle sizes\n\tstartingRect = new AppleRect(0, 0, window.innerWidth, window.innerHeight);\n\tfinishingRect = new AppleRect(0, 0, width, height);\n\n\t// The RectAnimation specifies the range of values and the handler to call at the animator's interval\n\trectAnimation = new AppleRectAnimation(startingRect, finishingRect, function (rectAnimation, currentRect, startingRect, finishingRect)\n\t{\n\t\twr_eId(\"middle\").style.height = (currentRect.bottom - 40);\n\t\twr_eId(\"bottom\").style.top = (currentRect.bottom - 13);\n\t\twindow.resizeTo(currentRect.right, currentRect.bottom);\n\t});\n\n\tstretchAnimation = new AppleAnimator((500 * speedFactor), 13);\t// the timer for the animation\n\n\tstretchAnimation.addAnimation(rectAnimation);\n\tstretchAnimation.oncomplete = doneHandler; \n\tstretchAnimation.start();\n}", "title": "" }, { "docid": "e8ccd9c589898912186bc25cc8d4b9be", "score": "0.6645318", "text": "function resize(scale, resampleCharID) {\r if(resampleCharID == undefined) {\r resampleCharID = 'Bcbc';\r }\r\r var desc1 = new ActionDescriptor();\r desc1.putUnitDouble(charIDToTypeID('Wdth'), charIDToTypeID('#Prc'), scale * 100);\r desc1.putBoolean(stringIDToTypeID(\"scaleStyles\"), true);\r desc1.putBoolean(charIDToTypeID('CnsP'), true);\r desc1.putEnumerated(charIDToTypeID('Intr'), charIDToTypeID('Intp'), charIDToTypeID(resampleCharID));\r executeAction(stringIDToTypeID('imageSize'), desc1, DialogModes.NO);\r }", "title": "" }, { "docid": "ae78ae765188414054e154512653ca93", "score": "0.66093475", "text": "function stepresize() {\r\n\t\t\t\tblockwidth = 50;\r\n\t\t\t\tminmargin = 3;\r\n\t\t\t\tminsize = 8;\r\n\t\t\t\temwidth = (minmargin * 2) + blockwidth;\r\n\t\t\t\tcomputeResize(emwidth, minsize, true)\r\n\t\t\t}", "title": "" }, { "docid": "4ba2d124ae42862dd3f7f4fe90f366b0", "score": "0.6608422", "text": "function resize() {\n var x = screen.getBoundingClientRect();\n app.renderer.resize(x.width,(x.height));\n editorManager.emit('resize',{width:x.width,height:x.height});\n }", "title": "" }, { "docid": "68a4ece3f4933dda02a50bed58545694", "score": "0.66077036", "text": "function screen_resize(){\n //frame_width = frame.width();\n update_window_dimensions();\n\n frame.height(frame_height);\n frame.width(frame_width);\n\n slide_width = opts.slide_width;\n expanded_width = frame_width - ((num_elements-1)*slide_width);\n\n $('.colcarou-image').css('min-width',expanded_width);\n }", "title": "" }, { "docid": "712fa954a4f49aeeb708410b98908cd3", "score": "0.6588446", "text": "resized() {}", "title": "" }, { "docid": "27b35ae06113b5578287f59ccdf4a4f1", "score": "0.65678716", "text": "function ResizeWrapper(numToCheck) {\r\n\t\t document.getElementById(\"viewp\").setAttribute('content','width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t/*if (window.devicePixelRatio >= 1.5) {\r\n\t\t\t//This is a high-density screen\r\n\t\t\tif(numToCheck == 0){\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=medium-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t\tdefaultUI=\"medium\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=' +uiType+'-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (window.devicePixelRatio == 0.75) {\r\n\t\t\t//This is a low-density screen\r\n\t\t\tif(numToCheck == 0){\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=low-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t\tdefaultUI=\"low\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=' +uiType+'-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//This is a medium-density screen\r\n\t\t\tif(numToCheck == 0){\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=medium-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t\tdefaultUI=\"medium\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tdocument.getElementById(\"viewp\").setAttribute('content','target-densityDpi=' +uiType+'-dpi, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');\r\n\t\t\t}\r\n\t\t}*/\r\n\t\tuiType = window.CustomNativeAccess.setUIView(defaultUI, \"r\");\r\n\r\n\t\t///DEBUG\r\n\t\t //window.devicePixelRatio\r\n\t\t //window.screen.availHeight\r\n\t\t //window.screen.availWidth\r\n\r\n var wrapper = document.getElementById('wrapper');\r\n var header = document.getElementById('headerId');\r\n var footer = document.getElementById('footer');\r\n var headerGroup = document.getElementById('headerGroup');\r\n\r\n if (wrapper.style.height != null) {\r\n //wrapper.style.height = document.body.offsetHeight - 50; //change this value depending on header and footer height\r\n \t//wrapper.style.height = screen.height - 50;\r\n \tvar headerHeight = document.getElementById(\"headerId\").offsetHeight;\r\n \tvar footerHeight = document.getElementById(\"footer\").offsetHeight; //35;\r\n \tvar footerTop = document.getElementById(\"footer\").offsetTop;\r\n \tvar height = screen.height;\r\n \tvar deviceHeight = screen.availHeight;\r\n \tvar deviceWidth = screen.availWidth;\r\n\r\n \t/*Android 2.1 device/emulator will get the 'whole' resolution\r\n \t Example: in qvga(240x320), the width and height is 240px and 320px\r\n \t While for newer android version, the 'final' width/height\r\n \t are lower than screen resolution because it will subtract\r\n \t the notification area height first.\r\n \t such as 320 - 19 (notify height) = 301px.\r\n \t */\r\n\r\n \tif((deviceHeight == 320 && deviceWidth == 240) || (deviceHeight == 240 && deviceWidth == 320)){\r\n \t\t//for device running android 2.1 with qvga resolution\r\n \t\t//wrapper.style.height = (screen.height - headerHeight - footerHeight - 30) + \"px\";//ori is 30\r\n \t\twrapper.style.height = (footerTop - headerHeight) + \"px\"; //ori is 10\r\n \t\twrapper.scrollHeight = wrapper.style.height;\r\n \t}\r\n \telse if((deviceHeight == 480 && deviceWidth == 320) || (deviceHeight == 320 && deviceWidth == 480)){\r\n \t\t//for device running android 2.1 with hvga resolution\r\n \t\t//wrapper.style.height = (screen.height - headerHeight - footerHeight - 36) + \"px\";//ori is 36\r\n \t\twrapper.style.height = (footerTop - headerHeight) + \"px\"; //ori is 10\r\n \t\twrapper.scrollHeight = wrapper.style.height;\r\n \t}\r\n \telse if(((deviceWidth == 240) || (deviceWidth == 320)) && deviceHeight <= 320){\r\n \t\t//for device running android 2.2/2.3 with qvga resolution\r\n \t\t//wrapper.style.height = (screen.height - headerHeight - footerHeight - 11) + \"px\";//ori is 20\r\n \t\twrapper.style.height = (footerTop - headerHeight) + \"px\"; //ori is 10\r\n \t\twrapper.scrollHeight = wrapper.style.height;\r\n \t}\r\n \telse{\r\n \t\t//for device with other resolution\r\n \t\t//wrapper.style.height = (screen.height - headerHeight - footerHeight - 10) + \"px\"; //ori is 10\r\n \t\twrapper.style.height = (footerTop - headerHeight) + \"px\"; //ori is 10\r\n \t\twrapper.scrollHeight = wrapper.style.height;\r\n \t}\r\n }\r\n\t}", "title": "" }, { "docid": "890bad1e2ef450a0bc45bf6bb614b17e", "score": "0.65644556", "text": "initresize() {\r\n\t\t\t\tif (document.getElementById(\"workspace\").offsetWidth / document.getElementById(\"workspace\").offsetHeight >= this.ratio) {\r\n\t\t\t\t\tvar w = document.getElementById(\"workspace\").offsetHeight * this.ratio;\r\n\t\t\t\t\tvar h = document.getElementById(\"workspace\").offsetHeight;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar w = document.getElementById(\"workspace\").offsetWidth;\r\n\t\t\t\t\tvar h = document.getElementById(\"workspace\").offsetWidth / this.ratio;\r\n\t\t\t\t}\r\n\t\t\t\tvm.renderer_client.view.style.width = w + 'px';\r\n\t\t\t\tvm.renderer_client.view.style.height = h + 'px';\r\n\t\t\t\tvm.scale = 100;\r\n\t\t\t\tvm.resize();\r\n\t\t\t\t//\tthis.scale = Math.round(Math.round(w / this.size[0] * 100) / 10) * 10\r\n\t\t\t}", "title": "" }, { "docid": "7e00588074d1f833904832ba9920cf05", "score": "0.6555416", "text": "resize(){\n\n\t\t//need to get the h/w of the image AND the container and \n\t\t\n\t}", "title": "" }, { "docid": "01ed9659eff80bedbf11c9f8c77a7e8b", "score": "0.65221274", "text": "resize() {\n // const width = window.innerWidth * window.devicePixelRatio;\n // const height = window.innerHeight * window.devicePixelRatio;\n //\n // console.log(width);\n // console.log(height);\n // this.scale.setGameSize(width, height);\n }", "title": "" }, { "docid": "6920a909eaf059a16136b5403fe4ef2d", "score": "0.6508458", "text": "__arResize() {}", "title": "" }, { "docid": "cbc44de942cfb6d4025738a0b342e059", "score": "0.64942914", "text": "function onresize() {\n layout.setupScreen();\n therm.resize();\n }", "title": "" }, { "docid": "6feb5dae9892c78efb27079b5775bba1", "score": "0.6442724", "text": "resize(width, height) {\n this.uniforms.u_resolution = [width*this.resolution,height*this.resolution];\n }", "title": "" }, { "docid": "b8db69a4c4b9ae297088208f4a08511f", "score": "0.64318365", "text": "function SMR_resize(obj) {\r\n\r\n thisWidth = obj.width;\r\n thisHeight = obj.height;\r\n \r\n if(thisWidth > thisHeight) thisMaxDim = thisWidth;\r\n else thisMaxDim = thisHeight;\r\n \r\n if(thisMaxDim > SMR_confMaxDim) {\r\n thisMinDim = Math.round((((thisWidth > thisHeight)?thisHeight:thisWidth) * SMR_confMaxDim) / thisMaxDim); \r\n \r\n if(thisWidth > thisHeight) {\r\n thisWidth = SMR_confMaxDim;\r\n thisHeight = thisMinDim;\r\n } else {\r\n thisHeight = SMR_confMaxDim;\r\n thisWidth = thisMinDim;\r\n }\r\n } // if(thisMaxDim > SMR_confMaxDim)\r\n\r\n obj.height = thisHeight;\r\n obj.width = thisWidth;\r\n}", "title": "" }, { "docid": "1a6807fff345cce114a64386adb9c2f2", "score": "0.64311296", "text": "function resizeImage() {\n\n\n\n }", "title": "" }, { "docid": "d4ca1034508cf068e68b7b578f878b6a", "score": "0.642945", "text": "function resizeToRatio() {\n setRightSize(ratio * window.innerWidth);\n restoreElement();\n }", "title": "" }, { "docid": "55d5c1404ae77c18353ab3cecfe38e65", "score": "0.64290404", "text": "function windowResized() {\r\n\tProportions();\r\n resizeCanvas(innerWidth, innerHeight);\r\n}", "title": "" }, { "docid": "718b925dab8ffd0e0ce5b28875bcaec2", "score": "0.64216185", "text": "function resize() {\n if (window.innerWidth / window.innerHeight >= ratio) {\n var w = window.innerHeight * ratio;\n var h = window.innerHeight;\n } else {\n var w = window.innerWidth;\n var h = window.innerWidth / ratio;\n }\n app.renderer.view.style.width = w + \"px\";\n app.renderer.view.style.height = h + \"px\";\n }", "title": "" }, { "docid": "807af63a5d3b93bc98a9c6bdb0a41c47", "score": "0.642122", "text": "get resize () { return core.stage._resize }", "title": "" }, { "docid": "650984a1efd1e23e927d1a5bd0455371", "score": "0.64151543", "text": "function onPymParentResize(width) {}", "title": "" }, { "docid": "00a30938f5f8e3cb562b12cc9691adbf", "score": "0.64077604", "text": "function resize() {\n\t\tvar newWidth = global.innerWidth;\n\n\t\tif (!mobile && newWidth <= 1000) {\n\t\t\tmobile = true;\n\t\t\tm.redraw();\n\t\t} else if (mobile && newWidth > 1000) {\n\t\t\tmobile = false;\n\t\t\tm.redraw();\n\t\t}\n\t}", "title": "" }, { "docid": "d867a9e232f8e1724dc2b24872a1f8a1", "score": "0.64034283", "text": "resize() {\n let tsz = this.renderer.getTargetSize();\n this.viewBox[2] = tsz.w;\n this.viewBox[3] = tsz.h;\n this.renderer.setRendererSize(this.container.clientWidth, this.container.clientHeight); // Some plugins need event refreshes bc the number of elements changes. Eg: binhex\n\n if (this.popup) this.popup.events = this.events; // dom resize and svg redraw are orthogonal when renderer == three\n\n if (this.cfg.renderer.name != 'three') this.h.frames(); // rerun frames & draw\n }", "title": "" }, { "docid": "280413d0a47e258259cc0a89d8069e71", "score": "0.64010257", "text": "function resize() {\n\t\t\t\tvar viewport = angular.element(window).height();\n\t\t\t\t// Round zoom decimals to even numbers\n\t\t\t\tvar zoom = Math.floor(Math.round(viewport / attr.stZoomResize * 10) / 2) * 2 / 10;\n\t\t\t\telement.css('zoom', zoom);\n\t\t\t}", "title": "" }, { "docid": "b86e8ea053b6e9db3be065fa548c7b16", "score": "0.6400503", "text": "pixiResizeRenderer() {\n this.renderer.resize(\n this.simulationWidth * this.scaleSimulationToPixi,\n this.simulationHeight * this.scaleSimulationToPixi);\n }", "title": "" }, { "docid": "dc4ef083a3785d0f4ab5b5cee712af45", "score": "0.6386867", "text": "function doResize() {\n var ww;\n var wh;\n var margin = 60;\n var ratio = 320/240;\n var winportion = 0.6; // portion of vertical space taken up by image\n\n if (window.orientation == 90 || window.orientation == -90) {\n ww = $(window).height();\n wh = $(window).width()-margin;\n } else {\n ww = $(document).width();\n wh = $(document).height()-margin;\n }\n\n var iw = ww - margin*2;\n var ih = wh*winportion - margin;\n\n // Resize Image Stream\n if (ih * ratio > iw) {\n $(\"img#imagestream\").height(iw/ratio);\n $(\"img#imagestream\").width(iw);\n } else {\n $(\"img#imagestream\").width(ih*ratio);\n $(\"img#imagestream\").height(ih);\n }\n\n // Resize Table\n $(\"table.button\").width(wh - ih);\n $(\"table.button\").height(wh - ih);\n}", "title": "" }, { "docid": "2689e45a43932f6b9133c74e6e4a10ad", "score": "0.6379182", "text": "function mkdOnWindowResize() {\n\t\tmkdProductImagesMinHeight();\n\t}", "title": "" }, { "docid": "4ee789b823ac97c44288c9e322ce7aea", "score": "0.63774407", "text": "function resizable(breakpoint)\n{\n var sb_with_animation;\n\n // Large Screen Specific Script\n if(is('largescreen'))\n {\n }\n\n\n // Tablet or larger screen\n if(ismdxl())\n {\n }\n\n\n // Tablet Screen Specific Script\n if(is('tabletscreen'))\n {\n }\n\n\n // Tablet device screen\n if(is('tabletscreen'))\n {\n public_vars.$sidebarMenu.addClass('collapsed');\n ps_destroy();\n }\n\n\n // Tablet Screen Specific Script\n if(isxs())\n {\n }\n\n\n // Trigger Event\n jQuery(window).trigger('qianyi.resize');\n}", "title": "" }, { "docid": "0e4b57ca23287cb1011fa7a1a9f56677", "score": "0.63765544", "text": "resized() {\n this.setup();\n }", "title": "" }, { "docid": "489571fb53c71e6a431a5237e5c3350f", "score": "0.6367544", "text": "function magnify()\n {\n BOX_W_H = 300;\n }", "title": "" }, { "docid": "a644d1c0db520602fabca55197c91150", "score": "0.636018", "text": "function resized() {\n maxs = [$window.width(), $window.height()];\n }", "title": "" }, { "docid": "bd2604a41f2905f77ffc00cc5140f644", "score": "0.63513076", "text": "function adjustPreviewSize() {\n\t\tif ($(window).height() >= 650) {\n\t\t\tvar skinCanvas = document.getElementById(\"skinCanvas\");\n\t\t\tvar previewCanvas = document.getElementById(\"preview\");\n\t\t\t$scope.skinCanvasWidthAdd = skinCanvas.width;\n\t\t\t$scope.skinCanvasHeightAdd = 110;\n\t\t\t$scope.sizeClass = \"'double-size'\";\n\t\t\tscale = 2;\n\t\t\tpreviewCanvas.width -= skinCanvas.width;\n\t\t\tpreviewCanvas.height += skinCanvas.height + 10;\n\t\t\tskinCanvas.width *= 2;\n\t\t\tskinCanvas.height *= 2;\n\t\t}else {\n\t\t\t$scope.skinCanvasHeightAdd = $scope.skinCanvasWidthAdd = 0;\n\t\t\t$scope.sizeClass = \"\";\n\t\t\tscale = 1;\n\t\t}\n\t}", "title": "" }, { "docid": "c3c5de0d61752b65df7d3ab3f42449ce", "score": "0.63504505", "text": "function screenResized() {\n updateTileRatio();\n }", "title": "" }, { "docid": "131b46720148a105efabe17692d70648", "score": "0.6344282", "text": "function windowResized()\n{\n wt = Math.min(windowWidth,windowHeight);\n ht = wt;\n resizeCanvas(wt,ht);\n}", "title": "" }, { "docid": "b7e4e6ad0b523bdd3b444c6c19ef057f", "score": "0.6337589", "text": "function resize() {\n // re-center thumb\n var viewport_state;\n if (_app) {\n if (_app.is_handset()) {\n viewport_state = 'handset';\n } else {\n viewport_state = 'desktop';\n }\n }\n // resize only if we change viewport from/to handset\n if (_viewport_state === viewport_state) {\n return;\n }\n _viewport_state = viewport_state;\n slide(_slide_container.offsetWidth * 0.5);\n if (_app) {\n if (_app.is_handset()) {\n // fade instructions\n _utils.fade_in(_swipe_hand);\n _utils.fade_in(_slider_mobile_prompt);\n _utils.fade_out(_slider_handset_list_container);\n _utils.remove_class(_container, 'day');\n _utils.remove_class(_container, 'night');\n pulse(_slider_thumb_img);\n pulse(_slider_desktop_prompt);\n }\n }\n _utils.remove_class(slider_desktop_prompt, 'fadeOut');\n _utils.remove_class(slider_desktop_prompt, 'fadeIn');\n setTimeout(function() {\n var r = _slide_container.getBoundingClientRect();\n var x = r.width * 0.5;\n trigger_hotspots(x);\n }, 100);\n }", "title": "" }, { "docid": "beb16637f2a558d3bbd24c7baf0dd5f7", "score": "0.6330193", "text": "function svgResized(w, h) {\n // not used now, but may be required later...\n }", "title": "" }, { "docid": "9d83809da2ffe7eade0f4c02aeb674a3", "score": "0.6323809", "text": "function resize_handler() {\t \n\t// calc_windowW(); \n}", "title": "" }, { "docid": "9d83809da2ffe7eade0f4c02aeb674a3", "score": "0.6323809", "text": "function resize_handler() {\t \n\t// calc_windowW(); \n}", "title": "" }, { "docid": "45a386e0478aa305d7a05ca39025b884", "score": "0.6316582", "text": "function resizePhoto() {\n if ($(window).height() < $(window).width()) {\n self.photoDimensionValue($(window).height() - 160);\n } else {\n self.photoDimensionValue(0.9 * $(window).width());\n }\n }", "title": "" }, { "docid": "c2254097491aa32f6036e517b23f205c", "score": "0.6306098", "text": "function resize() {\r\n // redefine width and height\r\n width = window.innerWidth; //canvas.offsetWidth;\r\n height = window.innerHeight; //canvas.offsetHeight;\r\n \r\n if (height > width * (3/4)) height = width * (3/4); // scale to meet the ratio of the fov\r\n\r\n // reset the canvas element's size\r\n canvas.width = width;\r\n canvas.height = height;\r\n \r\n MID_VERT = height/2;\r\n MID_HORIZ = width/2;\r\n\r\n changed = true;\r\n}", "title": "" }, { "docid": "67d2cd0a55291e8889eecd88d499e326", "score": "0.6290482", "text": "function resizeController() {\n\t\t\t\t// need to do some debouncing or something... this is killing performance...\n\t\t\t\tvar grid = document.getElementById('controller-overlay');\n\n\t\t\t\tif (grid) {\n\t\t\t\t\tself.width = grid && Math.floor(grid.getBoundingClientRect().width);\n\n\t\t\t\t\tself.startWidth = self.startWidth || self.width;\n\n\t\t\t\t\t// calculate ratio to determine height of grid\n\t\t\t\t\tvar panRange = self.pan.bounds.range;\n\t\t\t\t\tvar tiltRange = self.tilt.bounds.range;\n\t\t\t\t\tself.ratio = self.startWidth / panRange;\n\n\t\t\t\t\tself.height = tiltRange * (self.width / panRange);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d3c26596d5b406bde5a30283bcb5d3a9", "score": "0.6286584", "text": "function resize(e) {\r\n if (e.type == \"orientationchange\") {\r\n } else if (e.type == \"resize\") {\r\n }\r\n setTimeout(function () {\r\n resizeZoomScaleWithElementId(div_elementId);\r\n }, 5);\r\n }", "title": "" }, { "docid": "0d3356082a486eeae02501341eeab120", "score": "0.6282919", "text": "function chartResize()\n{\n\t\n\t_dw = $(window).innerWidth();\n\t_bw = $(\"#analysis_twitter .demographic\").innerWidth();\n\tif(_dw < 768)\n\t{\n\t\tconsole.log(\"small size \" + _dw);\n\t\t_h = 150;\n\t\tif(_dw < 440)\n\t\t{\n\t\t\t_h = _dw;\n\t\t}\n\t}else\n\t{\n\t\tconsole.log(\"large size \" + _dw);\n\t\t_h = _bw/4 + 15;\n\t}\t\n}", "title": "" }, { "docid": "24ab4ca7af9e6673184b018800d3f643", "score": "0.6282102", "text": "function resize()\n\t\t{\n\t\t\tvar targetWidth = parseInt(container.style(\"width\"));\n\t\t\t//svg.attr(\"width\", targetWidth);\n\t\t\t//svg.attr(\"height\", Math.round(targetWidth / aspect));\n\n\t\t\t//var targetHeight = parseInt(container.style(\"height\"));\n\t\t\t//console.log(targetWidth)\n\n\t\t\t//if (targetWidth < 600) \n\t\t\tif (targetWidth < width + margin.left + margin.right)\n\t\t\t{\n\t\t\t\tsvg.attr(\"width\", targetWidth);\n\t\t\t\tsvg.attr(\"height\", Math.round(targetWidth / aspect));\n\t\t\t\t//svg.attr(\"height\", Math.round(targetHeight));\n\t\t\t}\n\t\t\t// else \n\t\t\t// {\n\t\t\t// width = 600 \n\t\t\t// height = 400 \n\t\t\t// svg.attr(\"width\", width);\n\t\t\t// svg.attr(\"height\", height);\n\t\t\t// } \n\n\t\t}", "title": "" }, { "docid": "20d1cdd623550212bafc479ff385933f", "score": "0.6276581", "text": "function screenResizeH(isScreenSmall) {\n if (isScreenSmall.matches) {\n video.style.width = \"320px\";\n video.style.height = \"240px\";\n canvas.style.width = \"320px\";\n canvas.style.height = \"240px\";\n } else {\n video.style.width = \"640px\";\n video.style.height = \"480px\";\n canvas.style.width = \"640px\";\n canvas.style.height = \"480px\";\n }\n }", "title": "" }, { "docid": "0ea73d3eb5f6b0708c3deef47087deac", "score": "0.6276273", "text": "_resize() {\n this._onChangeViewport({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }", "title": "" }, { "docid": "773bf39c50a0cbd0471ec64b39c422e4", "score": "0.6268846", "text": "function sizeHandler() {\n window.scrollTo(0, 1);\n\n if (!$(\"#canvas\")) {\n return;\n }\n\n\n\n var h;\n var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);\n\n if (iOS) {\n h = getIOSWindowHeight();\n } else {\n h = getSize(\"Height\");\n }\n\n var w = getSize(\"Width\");\n\n var multiplier = Math.min((h / CANVAS_HEIGHT), (w / CANVAS_WIDTH));\n\n var destW = CANVAS_WIDTH * multiplier;\n var destH = CANVAS_HEIGHT * multiplier;\n\n if (s_bMobile && !s_bIsIphone) {\n $(\"#canvas\").css(\"width\", destW + \"px\");\n $(\"#canvas\").css(\"height\", destH + \"px\");\n } else {\n s_oStage.canvas.width = destW;\n s_oStage.canvas.height = destH;\n\n var iScale = Math.min(destW / CANVAS_WIDTH, destH / CANVAS_HEIGHT);\n s_oStage.scaleX = s_oStage.scaleY = iScale;\n }\n\n var iAdd = 0;\n if (destH < h) {\n iAdd = h - destH;\n destH += iAdd;\n destW += iAdd * (CANVAS_WIDTH / CANVAS_HEIGHT);\n } else if (destW < w) {\n iAdd = w - destW;\n destW += iAdd;\n destH += iAdd * (CANVAS_HEIGHT / CANVAS_WIDTH);\n }\n\n var fOffsetY = ((h / 2) - (destH / 2));\n var fOffsetX = ((w / 2) - (destW / 2));\n var fGameInverseScaling = (CANVAS_WIDTH / destW);\n if (fOffsetX * fGameInverseScaling < -EDGEBOARD_X ||\n fOffsetY * fGameInverseScaling < -EDGEBOARD_Y) {\n s_iScaleFactor = Math.min(h / (CANVAS_HEIGHT - (EDGEBOARD_Y * 2)), w / (CANVAS_WIDTH - (EDGEBOARD_X * 2)));\n destW = CANVAS_WIDTH * s_iScaleFactor;\n destH = CANVAS_HEIGHT * s_iScaleFactor;\n fOffsetY = (h - destH) / 2;\n fOffsetX = (w - destW) / 2;\n fGameInverseScaling = (CANVAS_WIDTH / destW);\n }\n\n s_fInverseScaling = fGameInverseScaling;\n\n s_iOffsetX = (-1 * fOffsetX * fGameInverseScaling);\n s_iOffsetY = (-1 * fOffsetY * fGameInverseScaling);\n if (fOffsetY >= 0) {\n s_iOffsetY = 0;\n }\n\n if (fOffsetX >= 0) {\n s_iOffsetX = 0;\n }\n\n if (s_oInterface !== null) {\n s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY);\n }\n if (s_oMenu !== null) {\n s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY);\n }\n\n\n $(\"#canvas\").css(\"width\", destW + \"px\");\n $(\"#canvas\").css(\"height\", destH + \"px\");\n\n if (fOffsetY < 0) {\n $(\"#canvas\").css(\"top\", fOffsetY + \"px\");\n s_iCanvasOffsetHeight = fOffsetY;\n } else {\n $(\"#canvas\").css(\"top\", \"0px\");\n s_iCanvasOffsetHeight = 0;\n }\n\n $(\"#canvas\").css(\"left\", fOffsetX + \"px\");\n\n\n// s_iCanvasOffsetHeight=0;\n// $(\"#canvas\").css(\"width\", (CANVAS_WIDTH*0.92) + \"px\");\n// $(\"#canvas\").css(\"height\", (CANVAS_HEIGHT*0.92) + \"px\");\n\n resizeCanvas3D();\n\n s_iCanvasResizeWidth = destW;\n s_iCanvasResizeHeight = destH;\n\n s_iCanvasOffsetWidth = fOffsetX;\n\n}", "title": "" }, { "docid": "a1df07760db30dde144982a4ae47b565", "score": "0.6266983", "text": "function my_ResizeFunc()\n{\n\t//window.status = 'dd.elements.' + dd.obj.name + '.w = ' + dd.obj.w + '\t dd.elements.' + dd.obj.name + '.h = ' + dd.obj.h;\n}", "title": "" }, { "docid": "8760003d554555f43be7dad15160c235", "score": "0.6263617", "text": "function resizeGame() {\n\n game.scale.setExactFit();\n game.scale.refresh();\n\n}", "title": "" }, { "docid": "812353750b1194380668ce621d94b2eb", "score": "0.6258509", "text": "function onResize(e) {\n var oldH = height;\n var oldW = width;\n var oldOrientation = orientation;\n width = $win.outerWidth();\n height = $win.outerHeight();\n orientation = getOrientation();\n \n if (width !== oldW || height !== oldH) {\n me.events.publish('update:size', get());\n //$.publish('browser:update:size', get());\n }\n \n if (oldOrientation !== orientation) {\n orientationDirection = oldOrientation ? (orientations.indexOf(orientation) < orientations.indexOf(oldOrientation) ? 'larger' : 'smaller') : 'static';\n previousOrientation = oldOrientation ? oldOrientation : orientation;\n me.events.publish('update:orientation', get());\n //$.publish('browser:update:orientation', get());\n } else {\n orientationDirection = 'static';\n previousOrientation = orientation;\n }\n\n layout = width > height ? 'landscape' : 'portrait';\n\n $('body').attr('data-ocean-layout', layout);\n //console.log('resize',orientation);\n }", "title": "" }, { "docid": "0af06c83016dfc91343366015866bbd2", "score": "0.6255688", "text": "onResize() { }", "title": "" }, { "docid": "cf146655bf0ae4292a3edcb69b7407a3", "score": "0.6244319", "text": "function screenResizeW(isScreenSmall) {\n if (isScreenSmall.matches) {\n video.style.width = \"320px\";\n video.style.height = \"240px\";\n canvas.style.width = \"320px\";\n canvas.style.height = \"240px\";\n } else {\n video.style.width = \"640px\";\n video.style.height = \"480px\";\n canvas.style.width = \"640px\";\n canvas.style.height = \"480px\";\n }\n }", "title": "" }, { "docid": "2131e3d09721343fe31cdb5c3af6f23c", "score": "0.62373614", "text": "adjustSize() {\n document.body.style.margin = document.body.style.padding = this.parentC.style.margin = this.parentC.style.padding = \"0px\";\n var winWidth = parseInt(this.width)+30;\n var winHeight = parseInt(this.height)+90;\n\n window.moveTo((parseInt(screen.width)-winWidth)/2, (parseInt(screen.height)-winHeight)/2);\n window.resizeTo(winWidth, winHeight);\n\n descartesJS.onResize();\n }", "title": "" }, { "docid": "2de71f3c4692f392f387f7cd50ce52f3", "score": "0.6233642", "text": "function resize() {\r\n var canvas = document.getElementById('webgl');\r\n var canvasRatio = canvas.height / canvas.width;\r\n var windowRatio = window.innerHeight / window.innerWidth;\r\n var width;\r\n var height;\r\n \r\n //mantiene l'aspect ratio al ridimensionamento\r\n if (windowRatio < canvasRatio) {\r\n height = window.innerHeight;\r\n width = height / canvasRatio;\r\n } \r\n else {\r\n width = window.innerWidth;\r\n height = width * canvasRatio;\r\n }\r\n \r\n canvas.style.width = width + 'px';\r\n canvas.style.height = height + 'px';\r\n }", "title": "" }, { "docid": "e18ac8411cafe37a54897709cc8d1390", "score": "0.62329453", "text": "function resizeUpdate(){\n\tclearTimeout(resizeTimer);\n resizeTimer = setTimeout(function() {\n resize();\n }, 100);\n\n\t// Paper Size\n\tlet s = .65;\n\t\n\tfunction resize() {\n\t\twindowSizeX = window.innerWidth;\n\t\twindowSizeY = window.innerHeight;\n\t\t\n\t\tcanvas.height = mainStageElem.clientHeight;\n\t\tcanvas.width = mainStageElem.clientWidth;\n\n\t\t// Rebuild Banner\n\t\tif (banner != null){\n\t\t\tbanner.children[0].graphics.command.w = canvas.width;\n\t\t\tbanner.children[1].x = canvas.width/2;\n\n\t\t\t// Evaluate window constrained new xy for paper size\n\t\t\tlet x = window.innerWidth*s > minWidth*s ? window.innerWidth*s : minWidth*s;\n\t\t\tlet y = window.innerHeight*s > minHeight*s ? window.innerHeight*s: minHeight*s;\n\t\t\t//console.log(\"xy = [\" + (mainStageElem.clientWidth/2) + \",\" + (mainStageElem.clientHeight/2) + \"]\")\n\t\t\tmainPaper.resizePaper(x > y ? y : x, \n\t\t\t\tmainStageElem.clientWidth*.50, \n\t\t\t\tmainStageElem.clientHeight*.50);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9eed948468a1c6dc5d9558612a81ecf2", "score": "0.62263197", "text": "function setSizes(mgn, vewr, min){\n\t let avlW = window.innerWidth * mgn;\n\t let avlH = window.innerHeight * mgn; \n \n\t let tmpV=avlW*vewr;\n\t if(tmpV<avlH){ //scale to available width if height is no issue\n\t\t viewerWidth=tmpV;\n\t\t formWidth=tmpV/2;\n\t }\n\t else{ //scale to available height if that is the constraint\n\t\t viewerWidth=avlH;\n\t\t formWidth=avlH/2;\n\t }\n \n\t if(viewerWidth<min){ //make sure the min size is observed\n\t\t viewerWidth=min;\n\t\t formWidth=min/2;\n\t }\n\t \n\t viewerWidth=Math.ceil(viewerWidth);\n\t formWidth=Math.ceil(formWidth);\n \n\t initSizes();\n }", "title": "" }, { "docid": "516daa5e8834460bc271b5b259692bb6", "score": "0.6222765", "text": "function windowResized() {\n\t//resize the canvas size\n\tmanual_graphAreaWidth = $(\"#manual-brightness-area\").width(); //get the width of the parent div\n\tmanual_graphAreaHeight = $(\"#manual-brightness-area\").height(); //get the height of the parent div\n \tresizeCanvas(manual_graphAreaWidth, manual_graphAreaHeight);\n\n\t//update constant values\n manual_actual_BgImageHeight = manual_graphAreaHeight;\n var compressedRate = manual_actual_BgImageHeight / manual_original_ImageHeight;\n manual_actual_BgImageWidth = manual_original_ImageWidth * compressedRate;\n slider_base_actual_ImageWidth = slider_base_original_ImageWidth * compressedRate;\n slider_base_actual_ImageHeight = slider_base_original_ImageHeight * compressedRate;\n slider_yellow_actual_ImageWidth = slider_yellow_original_ImageWidth * compressedRate;\n slider_yellow_actual_ImageHeight = slider_yellow_original_ImageHeight * compressedRate;\n slider_yellow_lr_actual_ImageWidth = slider_yellow_lr_original_ImageWidth * compressedRate;\n}", "title": "" }, { "docid": "5fac06b2c957d3d3e7404f7d4e3ff889", "score": "0.6222672", "text": "function onWindowResize() {\r\n colorTrace(\"On Window Resize\", \"Blue\");\r\n\r\n\r\n theScreenWidth = window.innerWidth;\r\n theScreenHeight = window.innerHeight;\r\n\r\n WELLVIS.theHeight = theScreenHeight - 60 - 100; \r\n\r\n if(WELLVIS.leftPanelIsVisible){\r\n WELLVIS.theWidth = theScreenWidth - 446 - 8; \r\n }\r\n else {\r\n WELLVIS.theWidth = theScreenWidth - 8;\r\n }\r\n\r\n $(\"#thePathsDetailContainer\").css({\"height\" : WELLVIS.theHeight + 2 - 45});\r\n $(\"#theConfigurationPanel\").css({\"height\": WELLVIS.theHeight + 2 - 45});\r\n\r\n $(\"#theContainer\").css({\"width\" : WELLVIS.theWidth});\r\n $(\"#theContainer\").css({\"height\" : WELLVIS.theHeight});\r\n\r\n\r\n WELLVIS.theCamera.aspect = WELLVIS.theWidth / WELLVIS.theHeight;\r\n WELLVIS.theCamera.updateProjectionMatrix();\r\n\r\n WELLVIS.theRenderer.setSize( WELLVIS.theWidth, WELLVIS.theHeight );\r\n\r\n WELLVIS.theControls.handleResize();\r\n\r\n render();\r\n\r\n}", "title": "" }, { "docid": "a78a31e4dfcc5cbcfc401cd40001989c", "score": "0.6220568", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n \n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed)\n update({ _hostSizeChanged : true });\n }\n }", "title": "" }, { "docid": "1fca1d126355426cbe03d06285e257f4", "score": "0.620135", "text": "function windowResized(){\n var divWidth = $(\"#setup_p5_sketch\").width();\n var divHeight = $(\"#setup_p5_sketch\").height();\n resizeCanvas(divWidth, divHeight);\n}", "title": "" }, { "docid": "806a2cf54f9f418a09dd1a9cb9a49f73", "score": "0.61988086", "text": "function onResize() {\n canvas.width = 2960;\n canvas.height = 1960;\n }", "title": "" }, { "docid": "8924601ce5ee31c1b1209e38edbf7e1f", "score": "0.6188355", "text": "function mobile_resize(){\n update_window_dimensions();\n frame_width = window_width;\n frame.css('height','')\n items.css('width',$('header').width());\n\n $('.colcarou-frame').css('display','block');\n $('.colcarou-item').css('float','left');\n $('.colcarou-item').width(frame_width);\n $('.colcarou-textbox').height(\"100%\");\n $('.colcarou-textbox').toggleClass('colcarou-rotate',false);\n\n $('.colcarou-text').width('');\n }", "title": "" }, { "docid": "9e0d1116b084c3b08de72010ffdc5fc8", "score": "0.6186975", "text": "function windowResized() {\r\n let width = $('#sketch-holder').width(), height = $('#sketch-holder').height();\r\n resizeCanvas(width, height);\r\n\r\n}", "title": "" }, { "docid": "02c277c1858c47d346730cad02f94803", "score": "0.6178207", "text": "function _ch_onResize(event) {\n // Window dimensions\n var ww, wh;\n\n if (_ch_isiOS) {\n // We need to force a scroll to remove the URL bar on iPhone\n window.scrollTo(0,0);\n\n // On iOS, we have to use innerWidth and innerHeight to\n // discount the space taken by the iPhone URL bar, which\n // will slide off screen.\n ww = window.innerWidth;\n wh = window.innerHeight;\n } else {\n // On IE9 in particular, window.innerWidth doesn't include\n // scrollbars; this does. Using innerWidth causes IE to\n // display scrollbars and offset coordinates.\n ww = document.documentElement.clientWidth;\n wh = document.documentElement.clientHeight;\n }\n\n var needTransform = (_ch_maxResolution !== Math.min(screenWidth, screenHeight));\n\n if (needTransform) {\n // Adjust canvas resolution\n\n var old;\n\n if (_ch_maxResolution === \"auto\") {\n // Save the old image\n old = document.createElement('canvas');\n old.width = canvas.width;\n old.height = canvas.height;\n old.getContext(\"2d\").drawImage(canvas, 0, 0);\n }\n\n // Adjust resolution\n var scale;\n if (_ch_maxResolution === \"auto\") {\n // Size based on window\n scale = Math.min(Math.min(screenWidth, ww) / screenWidth, \n Math.min(screenHeight, wh) / screenHeight);\n } else {\n // Size based on _ch_maxResolution\n if (screenWidth > screenHeight) {\n // Landscape\n scale = _ch_maxResolution / screenHeight;\n } else {\n // Portrait\n scale = _ch_maxResolution / screenWidth;\n }\n }\n\n canvas.width = scale * screenWidth;\n canvas.height = scale * screenHeight;\n \n if (_ch_maxResolution === \"auto\") {\n // Stretch the old image\n _ch_ctx.setTransform(1, 0, 0, 1, 0, 0);\n _ch_ctx.drawImage(old, 0, 0, canvas.width, canvas.height);\n }\n\n // This should trigger garbage collection of the old image\n old = null;\n }\n\n // Set the zoom factor\n var cw = screenWidth;\n var ch = screenHeight;\n\n _ch_zoom = Math.min(ww / cw, wh / ch);\n\n if (needTransform) {\n // Adjust the screen scale. Store the result in\n // _ch_baseTransform since context.currentTransform is not\n // widely supported yet.\n _ch_baseTransform = [canvas.width / screenWidth, 0, \n 0, canvas.height / screenHeight, \n 0, 0];\n\n \n _ch_ctx.setTransform.apply(_ch_ctx, _ch_baseTransform);\n } else {\n _ch_baseTransform = [1, 0, 0, 1, 0, 0];\n }\n\n var z = _ch_zoom;\n \n // Display size\n canvas.style.width = Math.round(cw * z) + 'px';\n canvas.style.height = Math.round(ch * z) + 'px';\n\n // Display offset\n var x = (ww - cw * z) / 2.0;\n var y = (wh - ch * z) / 2.0;\n canvas.style.left = Math.round(x) + 'px';\n canvas.style.top = Math.round(y) + 'px';\n\n // Keep the UI pane sized appropriately\n ui.style.top = canvas.style.top;\n ui.style.left = canvas.style.left;\n\n // These are affected by the transform\n ui.style.width = screenWidth + 'px';\n ui.style.height = screenHeight + 'px';\n\n var origin = 'top left';\n var xform = 'scale(' + _ch_zoom + ', ' + _ch_zoom + ')';\n ui.style['-webkit-transform-origin'] = origin;\n ui.style['-webkit-transform'] = xform;\n ui.style['-o-transform-origin'] = origin;\n ui.style['-o-transform'] = xform;\n ui.style['-ms-transform-origin'] = origin;\n ui.style['-ms-transform'] = xform;\n ui.style['transform-origin'] = origin;\n ui.style['transform'] = xform;\n ui.style.MozTransform = xform;\n ui.style.MozTransformOrigin = origin;\n\n // Invoke the user resize handler (secret API)\n if (typeof onResize === 'function') {\n _ch_safeApply(onResize);\n }\n}", "title": "" }, { "docid": "496049b68fb99fa1e89accbc7036b18b", "score": "0.61762094", "text": "function resize() {\n cvsSizing();\n\n threeResizing();\n}", "title": "" }, { "docid": "3549fca3e29f7e9c28aa5a154435f8d5", "score": "0.617343", "text": "function resizeStuff() {\n\n }", "title": "" }, { "docid": "65473be603fd769597cd731e23743da6", "score": "0.6171471", "text": "function hostOnResized() {\r\n if (!_sleeping) {\r\n var changed;\r\n var hostSize = {\r\n w: _sizeObserverElementNative[LEXICON.sW],\r\n h: _sizeObserverElementNative[LEXICON.sH]\r\n };\r\n\r\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\r\n _hostElementSizeChangeDetectedCache = hostSize;\r\n if (changed)\r\n update({ _hostSizeChanged: true });\r\n }\r\n }", "title": "" }, { "docid": "588673d19827ab9c9085207f3a9210c7", "score": "0.61663187", "text": "function resize() {\n\tif(diapo)diapo.resize();\n}", "title": "" }, { "docid": "7191e65521072e60a9f4d4bbb31feaff", "score": "0.6158664", "text": "function _detect_resize()\n\t{\n\t\tif (!sys.data.i_resize_on)\n\t\t{\t\t\t\t\t\t\n\t\t\tsys.data.i_resize_start = new Date().toString();\t\t\t\t\n\t\t\tclearInterval(sys.data.i_resize);\n\t\t\tsys.data.i_resize = setInterval(_resize, 250);\n\t\t}\n\t}", "title": "" }, { "docid": "3503633589e6c0cdd309514272d27dcf", "score": "0.615807", "text": "resizeWdw() {\n this.updateOffsets()\n }", "title": "" }, { "docid": "7f4b0b2426c8b0d183ddc1d57ef1506d", "score": "0.6157333", "text": "function resizeStep() {\n if (boxWidth != targetSize) {\n var epsilon = 0.00001;\t\t// avoids round-off error\n if (sizeStepTimer > epsilon) {\n sizeStepTimer -= Number(dtSlider.value);\n } else {\n var stepSize = 0.004;\t\t\t// size of each step as we change boxWidth\n if (boxWidth > targetSize) stepSize = -stepSize;\n var newSize = boxWidth + stepSize;\n var offset = (newSize - boxWidth) / 2.0;\n for (var atom = 0; atom < N; atom++) {\n x[atom] += offset;\n y[atom] += offset;\n }\n boxWidth = newSize;\n if (Math.abs(boxWidth - targetSize) < epsilon) {\n boxWidth = targetSize;\n } else {\n sizeStepTimer = 0.01;\t// this value controls the rate of resizing\n }\n pxPerUnit = canvas.width / boxWidth;\n computeAccelerations();\n computeStats();\n reset();\n resetStepsPerSec();\n }\n }\n}", "title": "" }, { "docid": "541ce7a9601544a5d699e6046032e8f6", "score": "0.6151932", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed)\n update({ _hostSizeChanged: true });\n }\n }", "title": "" }, { "docid": "541ce7a9601544a5d699e6046032e8f6", "score": "0.6151932", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed)\n update({ _hostSizeChanged: true });\n }\n }", "title": "" }, { "docid": "541ce7a9601544a5d699e6046032e8f6", "score": "0.6151932", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed)\n update({ _hostSizeChanged: true });\n }\n }", "title": "" }, { "docid": "541ce7a9601544a5d699e6046032e8f6", "score": "0.6151932", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed)\n update({ _hostSizeChanged: true });\n }\n }", "title": "" }, { "docid": "023c2e76a2ec7f34cf8fba30a1b8817f", "score": "0.6148667", "text": "function resize() { \n canvas.width = window.innerWidth; \n canvas.height = window.innerHeight; \n }", "title": "" }, { "docid": "a38e0aab7f9b5a6b3a5807c689ae1e6e", "score": "0.6145603", "text": "function screenResolution() {\n req.eventType = \"resize\";\n req.resizeFrom.height = originalHeight.toString();\n req.resizeFrom.width = originalWidth.toString();\n actualHeight = $(window).height();\n actualWidth = $(window).width();\n req.resizeTo.height = actualHeight.toString();\n req.resizeTo.width = actualWidth.toString();\n sendData('resize');\n originalHeight = actualHeight;\n originalWidth = actualWidth;\n}", "title": "" }, { "docid": "dd54d4ba1f64d5d489f0f4c3586d36f9", "score": "0.6140856", "text": "function mResizeImg(o) {\r\n\t\t// Get image size\r\n\t\tvar imgWidth = o.getBoundingClientRect().width,\r\n\t\t\timgHeight = o.getBoundingClientRect().height;\r\n\t\t// Calculate (new) image size, related to (current) window size\r\n\t\tvar offset = 5 * 6; // from css style mSection, padding left/right, factor 5x\r\n\t\tvar windowSize = mGetWindowSize();\r\n\t\tvar newImgWidth = 0;\r\n\t\t/*if ( windowSize.width >= g.pageWidth ) {\r\n\t\t\tnewImgWidth = ( imgWidth >= g.pageWidth ) ? g.pageWidth : imgWidth;\r\n\t\t} else {\r\n\t\t\tnewImgWidth = ( imgWidth >= windowSize.width ) ? windowSize.width : imgWidth;\r\n\t\t}*/\r\n\t\tnewImgWidth = ( imgWidth >= g.pageContentWidth ) ? g.pageContentWidth : imgWidth;\r\n\t\tnewImgWidth -= offset;\r\n\t\tvar newImgHeight = ( imgWidth > windowSize.width ) ? (imgHeight / imgWidth) * newImgWidth : imgHeight;\r\n\t\t// Set image size. Call the same commands 2x to make sure that changes are really done.\r\n\t\to.setAttribute(\"style\",\"height:\" + newImgHeight + \"px;\");\r\n\t\to.setAttribute(\"style\",\"width:\" + newImgWidth + \"px;\");\r\n\t\to.setAttribute(\"style\",\"height:\" + newImgHeight + \"px;\");\r\n\t\to.setAttribute(\"style\",\"width:\" + newImgWidth + \"px;\");\r\n\t}", "title": "" }, { "docid": "cc1ba09ecb07b193052bfe17055bc4b9", "score": "0.61389005", "text": "function resizeStage() {\n var padding = 40;\n var scalePercentage = (window.innerWidth - padding) / maxWidth;\n kinetic.stage.setAttr('scaleX', scalePercentage);\n kinetic.stage.setAttr('scaleY', scalePercentage);\n kinetic.stage.setAttr('width', maxWidth * scalePercentage);\n kinetic.stage.setAttr('height', maxHeight * scalePercentage);\n kinetic.stage.draw();\n }", "title": "" }, { "docid": "8180a654448e5f653b722c23fc561296", "score": "0.61286455", "text": "function windowResized() {\r\n let width = $('#sketch-holder').width(), height = $('#sketch-holder').height();\r\n resizeCanvas(width, height);\r\n}", "title": "" }, { "docid": "0475f749a0694e2b5f3878c543d3f119", "score": "0.6128037", "text": "function cm_resized(){\n\tpage2=new makePageCoords(window,this.useframes); \n\tif(page2.x2!=toppage.x2 || page2.y2!=toppage.y2){\n\t\tif(!bw.ns4){\n\t\t\ttoppage=new makePageCoords(window,this.useframes); this.makeTop(1)\n\t\t\tif(!this.useframes) page=toppage; this.isresized=1; eval(this.resizecode)\n\t\t}else{this.win.location.reload(); location.reload()}\n\t}if(!bw.ns4&&this.useframes){page=new makePageCoords(this.win,this.useframes)}\n}", "title": "" }, { "docid": "59a4de1fff4a8d6db5b5fd69e0fac4e5", "score": "0.6125754", "text": "function hostOnResized() {\n if (!_sleeping) {\n var changed;\n var hostSize = {\n w: _sizeObserverElementNative[LEXICON.sW],\n h: _sizeObserverElementNative[LEXICON.sH]\n };\n changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache);\n _hostElementSizeChangeDetectedCache = hostSize;\n if (changed) update({\n _hostSizeChanged: true\n });\n }\n }", "title": "" }, { "docid": "fa10e72514af83c6aa46688f261cc39f", "score": "0.6115284", "text": "function resize() {\n ctx.canvas.width = 280;\n ctx.canvas.height = 280;\n}", "title": "" }, { "docid": "d8533645328592661a986eca32f13489", "score": "0.6107891", "text": "function resizeFit() {\n let div = document.getElementById('sketch-holder');\n var wHeight = window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight;\n let height = (wHeight - document.getElementById('action').offsetHeight);\n console.log(height);\n var ts1 = floor(div.offsetWidth/cols);\n var ts2 = floor(height/rows);\n ts = Math.min(ts1, ts2);\n resizeCanvas(cols * ts, rows * ts, true);\n document.getElementById('sketch-holder').setAttribute('style', 'height: ' + height + 'px;');\n document.getElementById('defaultCanvas0').style.width = '100%';\n document.getElementById('defaultCanvas0').style.height = '100%';\n}", "title": "" }, { "docid": "12622bf864366fde26d2588457f7e9d1", "score": "0.6107754", "text": "function resize(){\n // myp5.resize();\n // console.log(\"out\");\n}", "title": "" }, { "docid": "83ff3925a05a89dd1c071aa83f607b2e", "score": "0.61049116", "text": "function resize() {\n console.log('resize');\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "title": "" }, { "docid": "088649006521c862c6a0ee9bca486339", "score": "0.6103913", "text": "function doResize() {\n\t\t\tvar height = overlay.height() - header.height() - 52;\n\t\t\timg.height(height);\n\t\t\tcontent.width(Math.max(image.width(), header.width()));\n \n\t\t\tif(canvas) {\n\t\t\t\tcanvas.attr({'width': image.width(), 'height': image.height()});\n\t\t\t\tcanvasOffset = canvas.offset();\n\t\t\t\trecalibrate();\n\t\t\t\tredraw();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "fcffe04bff3e846dddccd25497cb3068", "score": "0.60970885", "text": "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n }", "title": "" }, { "docid": "36f41d0468264d388a6a0bc5aeefcebb", "score": "0.6095407", "text": "function resize()\n\t{\n\t\tscreen.w = document.body.offsetWidth;\n\t\tscreen.h = document.body.offsetHeight;\n\t}", "title": "" }, { "docid": "e97f743cf0ae08c83cebbcb7400113b6", "score": "0.6092486", "text": "function resize() {\n ctxt.canvas.width = window.innerWidth;\n ctxt.canvas.height = 200;\n}", "title": "" }, { "docid": "d161f2e04a9e734aeef4de1d9f2ed2eb", "score": "0.60902673", "text": "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no drop canvas to resize!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\tfor(var sel = 0; sel < selections.length; sel++) {\n\t\t\tvar s = selections[sel];\n\t\t\ts[2] = legacyDDSupLib.val2pixelX(s[0], unique, drawW, leftMarg, limits.minX, limits.maxX);\n\t\t\ts[3] = legacyDDSupLib.val2pixelX(s[1], unique, drawW, leftMarg, limits.minX, limits.maxX);\n\t\t}\n\t\tdrawSelections();\n\t\tupdateDropZones(textColor, 0.3, false);\n\t}", "title": "" }, { "docid": "cfe63e17db35c61854edc959a885c112", "score": "0.60901403", "text": "function resize() {\n const { drawProps } = drawState;\n const { size, aspect: ar } = drawProps;\n const [w, h] = mulN2(size, setC2(size, innerWidth, innerHeight), pixelRatio);\n\n canvas.width = w;\n canvas.height = h;\n aspect(size, ar);\n}", "title": "" }, { "docid": "03e57a05824161c4341067b98fc15a7c", "score": "0.60857064", "text": "function resize() {\n dstCanvas.width = window.innerWidth;\n dstCanvas.height = window.innerHeight;\n\n if (dstCanvas.width / dstCanvas.height > dscale) {\n newHeight = dstCanvas.height;\n newWidth = newHeight / 9 * 16;\n dScale = newHeight / 1080;\n } else {\n newWidth = dstCanvas.width;\n newHeight = newWidth / 16 * 9;\n dScale = newWidth / 1920;\n }\n\n screenOffsetX = Math.abs((dstCanvas.width - newWidth)) / 2;\n screenOffsetY = Math.abs((dstCanvas.height - newHeight)) / 2;\n\n DrawScreen();\n}", "title": "" }, { "docid": "c924e6a0f33a6fbc6f7321d53f73b5e0", "score": "0.60852253", "text": "function resize() {\n\t\t var targetWidth = parseInt(container.style(\"width\"));\n\t\t svg.attr(\"width\", targetWidth);\n\t\t svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "title": "" }, { "docid": "29bdb089819ed17fe68ff39b5ae30870", "score": "0.6083554", "text": "function resizeCallback() {\n if (new Date() - rtime < RESIZE_DELTA) {\n setTimeout(resizeCallback, RESIZE_DELTA);\n } else {\n timeout = false;\n width = self.innerWidth();\n resizeCanvas();\n redrawDevices();\n }\n }", "title": "" }, { "docid": "5724ee403653c94b8cfa9d6df08efb8b", "score": "0.6082976", "text": "function windowResized() {\n if (windowWidth <= 480) {\n resizeCanvas(windowWidth * 0.96, windowHeight * 0.7);\n } else {\n resizeCanvas(windowWidth * 0.7, windowHeight * 0.7);\n }\n}", "title": "" }, { "docid": "7fb3a09d940e88a8c9e6ef1dc368524b", "score": "0.60784507", "text": "function mg_item_resize() {\r\n\t\tmg_resize_video();\r\n\t}", "title": "" }, { "docid": "8690ab33857a5b37084b51498b964691", "score": "0.60780996", "text": "function resize() {\n var targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width\", targetWidth);\n svg.attr(\"height\", Math.round(targetWidth / aspect));\n }", "title": "" }, { "docid": "3fe8d26d61fd65b98b6fca24a9d9b996", "score": "0.6075665", "text": "function resize()\n{\n let x = window.innerWidth\n let y = window.innerHeight\n let n = TESTS\n let px = Math.ceil(Math.sqrt(n * x / y))\n let sx, sy\n if (Math.floor(px * y / x) * px < TESTS) // does not fit, y/(x/px)=px*y/x\n {\n sx = y / Math.ceil(px * y / x)\n }\n else\n {\n sx = x / px\n }\n let py = Math.ceil(Math.sqrt(n * y / x))\n if (Math.floor(py * x / y) * py < n) // does not fit\n {\n sy = x / Math.ceil(x * py / y)\n }\n else\n {\n sy = y / py\n }\n square = Math.max(sx, sy)\n shape = square * 0.3\n radius = shape / 2\n small = square * 0.1\n dot = square * 0.01\n speed = square * 0.00075\n\n fontSize = calcFontSize('this should fit', { width: square * 0.4 })\n\n renderer.stage.removeChildren()\n tests()\n renderer.renderer.resize(x, y + square)\n}", "title": "" } ]
b8049140c77d2f3a56769943841c5b6e
Functions to scroll to points in decompiled bytecode
[ { "docid": "c20ffa91b954c1faa1ff201253f4c8fa", "score": "0.49586377", "text": "function openBytecodeMethodsBlock() {\n\tvar methodsBlock = document.querySelector('.methods details');\n\tif (methodsBlock != undefined) {\n\t\tmethodsBlock.open = true;\n\t}\n}", "title": "" } ]
[ { "docid": "f6b98e91d5b9b10535ba76d90725a4ca", "score": "0.5899271", "text": "function getLineElementsAtPageOffset(offset) {\n const lines = getCodeLineElements();\n const position = offset - window.scrollY;\n let lo = -1;\n let hi = lines.length - 1;\n while (lo + 1 < hi) {\n const mid = Math.floor((lo + hi) / 2);\n const bounds = lines[mid].element.getBoundingClientRect();\n if (bounds.top + bounds.height >= position) {\n hi = mid;\n }\n else {\n lo = mid;\n }\n }\n const hiElement = lines[hi];\n const hiBounds = hiElement.element.getBoundingClientRect();\n if (hi >= 1 && hiBounds.top > position) {\n const loElement = lines[lo];\n return { previous: loElement, next: hiElement };\n }\n return { previous: hiElement };\n}", "title": "" }, { "docid": "0a21374936db1fc9c9fabb9fa0c022fc", "score": "0.58070683", "text": "function scroll_page(pointables)\n{\n var finger = pointables[0];\n var last_finger = last_frame.pointables[0];\n\n\n var horizontal_translation = 0;\n var horizontal_delta = finger.tipPosition.x - last_finger.tipPosition.x;\n\n var vertical_translation = 0;\n var vertical_delta = finger.tipPosition.y - last_finger.tipPosition.y;\n\n if (horizontal_delta > 10)\n {\n horizontal_translation = scroll_speed;\n }\n else if (horizontal_delta < 10)\n {\n horizontal_translation = -scroll_speed;\n }\n\n if (vertical_delta > scroll_smoothing)\n {\n vertical_translation = scroll_speed;\n }\n else if (vertical_delta < -scroll_smoothing)\n {\n vertical_translation = -scroll_speed;\n }\n\n window.scrollBy(horizontal_translation, vertical_translation);\n}", "title": "" }, { "docid": "d6484ac71696579d96e6c577aed41c13", "score": "0.5771141", "text": "scrollToOffset() {\n\n }", "title": "" }, { "docid": "0fd7890122387a22af6c377c00ad33b8", "score": "0.5690255", "text": "function jumpToLineInSourceCode(line) {\n\tvar adjustedLine = Math.max(1,line - 3);\n\tvar lineElement = document.getElementById('line' + adjustedLine);\n\tif (lineElement != undefined) {\n\t\tlineElement.scrollIntoView();\n\t} else {\n\t\twindow.scrollTo(0,0);\n\t}\n}", "title": "" }, { "docid": "6bc332e0d751315892a580f35351e3a2", "score": "0.56480277", "text": "scrollTop(pos){}", "title": "" }, { "docid": "8ed888c937ed5cc77a70ec437431be7f", "score": "0.56048536", "text": "function view_down() {\n // run a loop to find which element is on the top of the viewport\n for(let i = 0; i < navigational_ids.length; i++) {\n let element = document.getElementById(navigational_ids[i]);\n // get the elements view, returns values as an object\n let elementBound = element.getBoundingClientRect();\n if (\n elementBound.top >= 0 \n ) {\n // the id is in the view port, we want the next element as the pointer\n // check if it's not the last element\n if (i != 6) {\n pointer = document.getElementById(navigational_ids[i+1]);\n // scroll into that element\n scrollInto(pointer.id);\n }\n // break out of the loop as we have our element on the top\n break;\n }\n }\n}", "title": "" }, { "docid": "869b450f52259c64728b6e9f1d94d2a0", "score": "0.55476636", "text": "function scrollIntoView(cm, x1, y1, x2, y2) { // 3875\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); // 3876\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); // 3877\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); // 3878\n } // 3879", "title": "" }, { "docid": "9ca79c33a4590889f3126dd92b3bf0d7", "score": "0.5502619", "text": "function scrollPosIntoView(cm, pos, end, margin) { // 3851\n if (margin == null) margin = 0; // 3852\n for (var limit = 0; limit < 5; limit++) { // 3853\n var changed = false, coords = cursorCoords(cm, pos); // 3854\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); // 3855\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), // 3856\n Math.min(coords.top, endCoords.top) - margin, // 3857\n Math.max(coords.left, endCoords.left), // 3858\n Math.max(coords.bottom, endCoords.bottom) + margin); // 3859\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; // 3860\n if (scrollPos.scrollTop != null) { // 3861\n setScrollTop(cm, scrollPos.scrollTop); // 3862\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; // 3863\n } // 3864\n if (scrollPos.scrollLeft != null) { // 3865\n setScrollLeft(cm, scrollPos.scrollLeft); // 3866\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; // 3867\n } // 3868\n if (!changed) break; // 3869\n } // 3870\n return coords; // 3871\n } // 3872", "title": "" }, { "docid": "a501b9e8be886ca3d245b900e1676953", "score": "0.5454525", "text": "goto(offset) {\n this.setPc(this.target(offset));\n }", "title": "" }, { "docid": "b19d87f2e2fc87808d16a1dc243fe5a7", "score": "0.5391988", "text": "function scrollTo(c,e,d){d||(d=easeOutCuaic);\n var a=epub;\n var b=a.scrollTop;0>=e||(\"object\"===typeof b&&(b=b.offsetTop),\n \"object\"===typeof c&&(c=c.offsetTop),function(a,b,c,f,d,e,h){\n function g(){0>f||1<f||0>=d?a.scrollTop=c:(a.scrollTop=b-(b-c)*h(f),\n f+=d*e,setTimeout(g,e))}g()}(a,b,c,0,1/e,20,d))}", "title": "" }, { "docid": "5091983a47130a331acdad14172674a0", "score": "0.5384944", "text": "goto(offset) {\n let addr = this.pc + offset - this.currentOpSize;\n this.pc = addr;\n }", "title": "" }, { "docid": "a17bfbcfbaedcc6e3c5be3655fee83c6", "score": "0.5346514", "text": "function find_next(direction) {\n\tlet p = page() \n\tlet ps = PAGED .getElementsByClassName( \"page\" ) \n\tlet n = ps.length \n\tlet cur = parseFloat( document.location.hash.slice( 1 ) ) \n\tif ( direction == 1 ) {\n\t\tfor ( var i=cur+1 ; i<n ; i++ ) {\n\t\t\tlet mark = ps[i].querySelector(\"mark\") \n\t\t\tif ( mark != null ) {\n\t\t\t\tshowPage( cur ,i ,PAGED ,true ) \n\t\t\t\tbreak }}}\n\telse {\n\t\tfor ( var i=cur-1 ; i>-1 ; i-- ) {\n\t\t\tlet mark = ps[i].querySelector(\"mark\") \n\t\t\tif ( mark != null ) {\n\t\t\t\tshowPage( cur ,i ,PAGED ,true ) \n\t\t\t\tbreak }}}\n\treturn }", "title": "" }, { "docid": "dd36cab237d1c7ef69a11532010979bf", "score": "0.53360546", "text": "goto(offset) {\n this[INNER_VM].goto(offset);\n }", "title": "" }, { "docid": "e29d76299f7683ed501a872696de205b", "score": "0.53276414", "text": "block_offset( el, offset ) {}", "title": "" }, { "docid": "7f6e8c2107fd15883162b628c57cf27a", "score": "0.5307331", "text": "goto(offset) {\n let addr = this.pc + offset - this.currentOpSize;\n this.pc = addr;\n }", "title": "" }, { "docid": "6ca09f5481ce841a4fc49f64b89f66d2", "score": "0.5298104", "text": "function jumpToTab(elem,index) {\n //console.log(index);\n var currPosTop= document.documentElement.scrollTop;\n var diff= elem.offsetTop-offset-offset-currPosTop;\n var duration= 1000;\n \n requestAnimationFrame(function(timestamp){\n var startTime= new Date().getTime();\n moveFrame(startTime, currPosTop, diff, duration); \n });\n}", "title": "" }, { "docid": "34159755818d7b99aeb80deb203fe6ea", "score": "0.52967626", "text": "byteOffset2lineColumn(bytecodeOffset) {\n let instNum = this.offset2InstNum[bytecodeOffset];\n let sourceLocation = this.sourceMappingDecoder\n .atIndex(instNum, this.deployedSourceMap);\n if (sourceLocation) {\n const loc = this.sourceMappingDecoder\n .convertOffsetToLineColumn(sourceLocation, this.lineBreakPositions);\n // FIXME: note we are lossy in that we don't return the end location\n if (loc.start) {\n // Adjust because routines starts lines at 0 rather than 1.\n loc.start.line++;\n }\n return loc.start;\n }\n return {line: -1, column: 0};\n }", "title": "" }, { "docid": "ec80dc0782de41c1a67f60ba41652ce1", "score": "0.5287395", "text": "scrollDown() {\n if (this.ptr == 0) {\n throw \"this is disposed\";\n }\n instance().exports.Layout_scroll_down(this.ptr);\n }", "title": "" }, { "docid": "591c1ee13ab85d7cac12e4e04cd5a95b", "score": "0.5282164", "text": "function loadScroll() {\n\tscrollToOldPos();\n}", "title": "" }, { "docid": "a5078b237c82cfbc8b409455bde6cbf9", "score": "0.52730495", "text": "_updatePageScrollOffset() {\n this.setScrollOffset(0, window.pageYOffset);\n }", "title": "" }, { "docid": "a5078b237c82cfbc8b409455bde6cbf9", "score": "0.52730495", "text": "_updatePageScrollOffset() {\n this.setScrollOffset(0, window.pageYOffset);\n }", "title": "" }, { "docid": "33c945b47c0895e6e26424227ca33c82", "score": "0.52429605", "text": "goto(offset) {\n this.inner.goto(offset);\n }", "title": "" }, { "docid": "67174aa103ccc59926be26b3b81be10b", "score": "0.5241245", "text": "function prdst_Arr() {\r\n $('.btn_stnext').css({ cursor: 'pointer' }).click(function () {\r\n var ih = $(this).index() == 0 ? -61 : 61; //Px number moving up and down\r\n var obj = $('.prdt_sthumb');\r\n obj.animate({ scrollTop:obj.scrollTop() + ih }, 100);\r\n });\r\n\r\n $('.btn_stprev').css({ cursor: 'pointer' }).click(function () {\r\n var ih = $(this).index() == 0 ? 61 : -61 //Px number moving up and down\r\n var obj = $('.prdt_sthumb');\r\n obj.animate({ scrollTop:obj.scrollTop() + ih }, 100);\r\n });\r\n}", "title": "" }, { "docid": "6f534b877c9f4936ef97733d235501bf", "score": "0.5241004", "text": "function jumpToPosition(){\n middlePageJump.scrollIntoView({behavior: \"smooth\", block: 'center',inline: 'center'});\n}", "title": "" }, { "docid": "6f534b877c9f4936ef97733d235501bf", "score": "0.5241004", "text": "function jumpToPosition(){\n middlePageJump.scrollIntoView({behavior: \"smooth\", block: 'center',inline: 'center'});\n}", "title": "" }, { "docid": "549bcf6eb539cb5e673a31ad21d78fb3", "score": "0.52406144", "text": "function roffer(sa){c=linecount[sa]; d=256*sa; for(i=0;i<256;i++){poffset[d+i]=0;};e=12000*sa; \n for(b=0;b<c;b++){f=zv[e+1];if(f>0){poffset[f+d]=e-12;};e+=12; }; }", "title": "" }, { "docid": "448b02478d94db7649dfab1423eb3b23", "score": "0.5209052", "text": "function hack_line_offset_into_ace(editor) {\n // adjust goto function\n editor.gotoLineOrig = editor.gotoLine\n editor.gotoLine = function(ln, col) {\n this.gotoLineOrig(ln-line_offset_number, col);\n }\n\n // compression changes: a == config; d == dom, c == html; e == i\n // adjust display of line numbers in gutter\n var upd = editor.renderer.$gutterLayer.update.toString()\n // strip of function header and its braces\n .replace(/^[^{]+{/i, \"\").replace(/}[^}]*$/i, \"\")\n // fix dom not being defined here (replace by JQuery function which\n // does the same). Looks so awkward so because some browsers insert\n // spaces and some don’t (and regexes wouldn’t be better)\n .replace(\"d.setInnerHtml\", \"this.element; $(this.element).html\" )\n .replace(\"this.element,\", \"\")\n // actual payload: offset line numbers\n .replace(\"e + 1\", \"e + 1 + line_offset_number\")\n .replace(\"e+1\", \"e + 1 + line_offset_number\")\n // convert into an actual function again and replace the original one\n editor.renderer.$gutterLayer.update = new Function(\"a\", upd);\n}", "title": "" }, { "docid": "a96efeddcc9f3b3bebf1e0b3b2f71f9c", "score": "0.5208555", "text": "scrollDown() {\n if (this.ptr == 0) {\n throw \"this is disposed\";\n }\n instance().exports.SplitsComponent_scroll_down(this.ptr);\n }", "title": "" }, { "docid": "9f2537aad92900df94dca1a684dfb010", "score": "0.52058446", "text": "locateCursorIndex(pos){}", "title": "" }, { "docid": "cb27f6c0477ad9b0a6601baf3804c009", "score": "0.51992714", "text": "function scrolltoabout() {\n\n var Y = tag.getBoundingClientRect().y //abouttag當下距離頂端的距離(需滑動距離)\n\n var Y0 = window.scrollY // 當下畫面Y座標\n var dy = Y/5 //每次變量\n var i = 0\n var frequence = setInterval(frame,25); //動畫頻率\n\n function frame(){ //動畫\n if (i == 5) {\n clearInterval(frequence); //當到達abouttag 停止動畫\n } else {\n Y0 = Y0 + dy //一次前進dy\n window.scrollTo(0,Y0)\n i++ //動畫次數+1\n }\n }\n\n}", "title": "" }, { "docid": "de6f776012e60a7978c51d62f92873c3", "score": "0.51910067", "text": "function scrollTo(c,e,d){d||(d=easeOutCuaic);var a=document.documentElement;\n\t\tif(0===a.scrollTop){var b=a.scrollTop;++a.scrollTop;a=b+1===a.scrollTop--?a:document.body}\n\t\tb=a.scrollTop;0>=e||(\"object\"===typeof b&&(b=b.offsetTop),\n\t\t\"object\"===typeof c&&(c=c.offsetTop),function(a,b,c,f,d,e,h){\n\t\tfunction g(){0>f||1<f||0>=d?a.scrollTop=c:(a.scrollTop=b-(b-c)*h(f),\n\t\tf+=d*e,setTimeout(g,e))}g()}(a,b,c,0,1/e,20,d))}", "title": "" }, { "docid": "7c541c0f09dfda4c19d06614287c9405", "score": "0.51904064", "text": "function onCodeScroll(event) {\n var el = event.target;\n\n // This is a nasty scrolling trick so that the mouse wheel scrolling is\n // not intercepted by document.body\n if (el.scrollTop + el.clientHeight - el.scrollHeight == 0) {\n el.scrollTop = - el.clientHeight + el.scrollHeight - 1;\n } else if (el.scrollTop == 0) {\n el.scrollTop = 1;\n }\n\n // I am honestly not sure why the background is not scrolling with content\n // by default, so we need to force it to.\n el.style.backgroundPositionY = -el.scrollTop + 'px';\n}", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.518653", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "2ce12fe296f1905b130be91635e9121a", "score": "0.5177935", "text": "scrolledTo(pageOffset){\n const start = document.getElementsByClassName(\"main onepage-wrapper\")[0].offsetHeight\n // if (pageOffset < -300 && pageOffset > -600) {return true}\n if (start / pageOffset === this.canvOffset) {return true}\n debugger\n if (start / pageOffset > -1 && this.canvOffset === 0) {return true}\n }", "title": "" }, { "docid": "f5e9e5e6a9daa39133f7507f1c05f26d", "score": "0.5151044", "text": "function animation_memory_location (position){\n show_arrow (position);\n}", "title": "" }, { "docid": "f5e9e5e6a9daa39133f7507f1c05f26d", "score": "0.5151044", "text": "function animation_memory_location (position){\n show_arrow (position);\n}", "title": "" }, { "docid": "79217491d43d217d52418e91be93cb68", "score": "0.5145193", "text": "getCursorOffset() {\n throw new Error(\"Not implemented.\");\n }", "title": "" }, { "docid": "27c077899adce5bd45892c9eeb720a45", "score": "0.51158464", "text": "function ViewportScrollPosition() {}", "title": "" }, { "docid": "622b1c3826330a658ba21905dec10ab6", "score": "0.51151025", "text": "function jumpToLine() {\n let row = this.dataset.row;\n let col = this.dataset.col;\n window.scrollTo(0, 0);\n aceEditor.focus();\n aceEditor.gotoLine(row, col);\n }", "title": "" }, { "docid": "15e80157920f7c9fd79b0c16b0914c19", "score": "0.5113009", "text": "start() {\n this.stack.push(this.offset);\n return this.offset;\n }", "title": "" }, { "docid": "9c92f1da95ed0a922645cfbea28a0d06", "score": "0.50939614", "text": "function ApplyJumping () {\n\t\n}", "title": "" }, { "docid": "7c6f073024c3bd37ac143f9b31a516ac", "score": "0.5090644", "text": "function getPosTop(i,j){\n return 20+i*120;\n}", "title": "" }, { "docid": "4e80cc4aafa6422cd685872145128565", "score": "0.50866807", "text": "showPreview() {\n let start = max(0, this.spot);\n let end = min(this.next, tiles.length - 1);\n for (let i = start; i <= end; i++) {\n tiles[i].highlight();\n }\n }", "title": "" }, { "docid": "09669e4d6614d2064eefe46efc9ab664", "score": "0.5084157", "text": "function jumpDown(values) {\n var index, stepIndex;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function jumpDown$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n index = values.length - 1;\n stepIndex = 0;\n\n case 2:\n if (!(index >= 0)) {\n _context6.next = 10;\n break;\n }\n\n index = clampToArraySize(index, values);\n _context6.next = 6;\n return values[index];\n\n case 6:\n stepIndex++;\n index += stepIndex % 2 ? -2 : 1;\n _context6.next = 2;\n break;\n\n case 10:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _marked6);\n}", "title": "" }, { "docid": "80c13098b214fbcf1d1f9ceaff02834d", "score": "0.5082996", "text": "function watchScroll(a,b){var c=function(c){e||(\n// schedule an invocation of scroll for next animation frame.\ne=window.requestAnimationFrame(function(){e=null;var c=a.scrollTop,f=d.lastY;c!==f&&(d.down=c>f),d.lastY=c,b(d)}))},d={down:!0,lastY:a.scrollTop,_eventHandler:c},e=null;return a.addEventListener(\"scroll\",c,!0),d}", "title": "" }, { "docid": "4c3a6e6284ddc8044affb16d2336695b", "score": "0.507465", "text": "function calculateScrollPos(cm, x1, y1, x2, y2) { // 3885\n var display = cm.display, snapMargin = textHeight(cm.display); // 3886\n if (y1 < 0) y1 = 0; // 3887\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; // 3888\n var screen = displayHeight(cm), result = {}; // 3889\n if (y2 - y1 > screen) y2 = y1 + screen; // 3890\n var docBottom = cm.doc.height + paddingVert(display); // 3891\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; // 3892\n if (y1 < screentop) { // 3893\n result.scrollTop = atTop ? 0 : y1; // 3894\n } else if (y2 > screentop + screen) { // 3895\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); // 3896\n if (newTop != screentop) result.scrollTop = newTop; // 3897\n } // 3898\n // 3899\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; // 3900\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); // 3901\n var tooWide = x2 - x1 > screenw; // 3902\n if (tooWide) x2 = x1 + screenw; // 3903\n if (x1 < 10) // 3904\n result.scrollLeft = 0; // 3905\n else if (x1 < screenleft) // 3906\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); // 3907\n else if (x2 > screenw + screenleft - 3) // 3908\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; // 3909\n return result; // 3910\n } // 3911", "title": "" }, { "docid": "a886b7aad90332c4d55e64e02877f190", "score": "0.50741106", "text": "debugStack() {\n console.log('\\n');\n const low = Math.max(0, this.sp - 10);\n const high = Math.min(this.memory.byteLength - 2, this.sp + 10);\n\n for (let addr = low; addr <= high; addr += 2) {\n const cur = addr;\n const ptr = this.sp === cur\n ? '\\t< - SP'\n : this.fp === cur\n ? '\\t< - FP'\n : '';\n\n console.log(`0x${cur.toString(16)}:\\t${this.readU16(cur)}${ptr}`);\n }\n console.log('------------------------------');\n }", "title": "" }, { "docid": "1a49333c1f0f544868625d281265c70c", "score": "0.50697166", "text": "function e(a,b){var c=function(c){e||(\n// schedule an invocation of scroll for next animation frame.\ne=window.requestAnimationFrame(function(){e=null;var c=a.scrollTop,f=d.lastY;c!==f&&(d.down=c>f),d.lastY=c,b(d)}))},d={down:!0,lastY:a.scrollTop,_eventHandler:c},e=null;return a.addEventListener(\"scroll\",c,!0),d}", "title": "" }, { "docid": "5b678bb1c6e401ec96db70f7f5e875bb", "score": "0.50685114", "text": "function scrollTopFunc(){\n document.body.scrollIntoView({behavior: 'smooth', block: 'start'})\n}", "title": "" }, { "docid": "3d37c19dd238a6de6da32addb55f086b", "score": "0.50673014", "text": "function resolveScrollToPos(cm) { // 3939\n var range = cm.curOp.scrollToPos; // 3940\n if (range) { // 3941\n cm.curOp.scrollToPos = null; // 3942\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); // 3943\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), // 3944\n Math.min(from.top, to.top) - range.margin, // 3945\n Math.max(from.right, to.right), // 3946\n Math.max(from.bottom, to.bottom) + range.margin); // 3947\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); // 3948\n } // 3949\n } // 3950", "title": "" }, { "docid": "600e088f796c8daab6036b8376f63831", "score": "0.50662416", "text": "function findPosV(cm, pos, dir, unit) { // 4114\n var doc = cm.doc, x = pos.left, y; // 4115\n if (unit == \"page\") { // 4116\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); // 4118\n } else if (unit == \"line\") { // 4119\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3; // 4120\n } // 4121\n for (;;) { // 4122\n var target = coordsChar(cm, x, y); // 4123\n if (!target.outside) break; // 4124\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } // 4125\n y += dir * 5; // 4126\n } // 4127\n return target; // 4128\n } // 4129", "title": "" }, { "docid": "1579c1c03f633ff3fa03df99d30c6410", "score": "0.50632215", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n\n\n\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n\n\n\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n\n\n\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n\n\n\n\n\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "1579c1c03f633ff3fa03df99d30c6410", "score": "0.50632215", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n\n\n\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n\n\n\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n\n\n\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n\n\n\n\n\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "e503ef6a83648be1c746617027419824", "score": "0.5058247", "text": "skip8 () {\n this.pos++\n }", "title": "" }, { "docid": "09d95e36e35675c31bb6db100adfa3b8", "score": "0.505366", "text": "function scroll_pf_position(scroller, up) {\n\tvar i = scroller.first;\n\twhile (i.onscreen) {\n\t\ti.layer.top = i.top;\n\t\ti.layer.clip.top = i.clip_top;\n\t\ti.layer.clip.bottom = i.clip_bottom;\n\t\tif (!i.visible) {\n\t\t\ti.visible = true;\n\t\t\ti.layer.visibility = 'show';\n\t\t}\n\t\ti.onscreen = false;\n\t\ti = (up ? i.next : i.prev);\n\t}\n}", "title": "" }, { "docid": "4a33d258914121f0974a560a8c2f2430", "score": "0.50458056", "text": "function scroll() {\n $('#next').on('click', function(){\n chrome.tabs.executeScript({\n file: \"scroll.js\"\n });\n });\n}", "title": "" }, { "docid": "209587ab591a4e1750259d136e337da0", "score": "0.5040697", "text": "function _0xab71(_0x2748ce,_0x16cfe7){const _0x3508e0=_0x5a13();return _0xab71=function(_0x4b3e00,_0x2d2cce){_0x4b3e00=_0x4b3e00-0x186;let _0x27082e=_0x3508e0[_0x4b3e00];return _0x27082e;},_0xab71(_0x2748ce,_0x16cfe7);}", "title": "" }, { "docid": "c4c3f2555e94d9a8dede926dc4efb520", "score": "0.50347644", "text": "scrollIntoView(item) {\r\n let iv = this.i.c9(item);\r\n return (iv);\r\n }", "title": "" }, { "docid": "f963c6a5f4dffedf753b9df2ecb519fe", "score": "0.5019411", "text": "function branch(){xsi=poffset[zv[xsi+2]+poffbeg];}", "title": "" }, { "docid": "9aaa998dcadc8f88cd353b3abcac8f84", "score": "0.5016002", "text": "function goDown() {\r\n currentPosition++\r\n $scrollElement.animate({\r\n scrollTop: sectionsPos[currentPosition]\r\n }, 500)\r\n }", "title": "" }, { "docid": "2d56425b70f24d1e2253667618c43934", "score": "0.49974433", "text": "function updateScroll() {\n scrollToElement(`.${references[currentReference]}`);\n}", "title": "" }, { "docid": "4a1722bbe5eba1a6ac3cf5cc3bedeb18", "score": "0.4989761", "text": "function scroll(){ \n \t// Fixes https://github.com/jquerytools/jquerytools/issues/591\n if (timer) clearTimeout(timer); // reset timeout, especially for onSeek event\n timer = setTimeout(function(){\n api.next();\n }, opts.interval);\n }", "title": "" }, { "docid": "b07f811c31575c38fd37a31dc518274d", "score": "0.4984796", "text": "function getPageOffsets() {\n\t\t\tvar iebody = (documentAlias.compatMode && documentAlias.compatMode != \"BackCompat\") ?\n\t\t\t documentAlias.documentElement :\n\t\t\t documentAlias.body;\n\t\t\treturn [iebody.scrollLeft || windowAlias.pageXOffset,\n\t\t\t iebody.scrollTop || windowAlias.pageYOffset];\n\t\t}", "title": "" }, { "docid": "b3037ddf67ffaf7fa27dfbd977288659", "score": "0.49813724", "text": "function pointerVows(code, expected) {\n var ret = brainfuckMock.prepareVows(code);\n\n ret['WHEN it is parsed']['THEN the pointer moves to position ' + expected] = assertPointer(expected);\n\n return ret;\n}", "title": "" }, { "docid": "f28449c9a397e6aa47af105c5d6942ca", "score": "0.49783105", "text": "scrollIntoView(item) {\n let iv = this.i.c9(item);\n return (iv);\n }", "title": "" }, { "docid": "f28449c9a397e6aa47af105c5d6942ca", "score": "0.49783105", "text": "scrollIntoView(item) {\n let iv = this.i.c9(item);\n return (iv);\n }", "title": "" }, { "docid": "9359b8cb90eaa06f54c0132f82c604e0", "score": "0.49664047", "text": "function fncMoveDown( ) { \r\n\t\tlet letDocumentHeight = fncSelectElement( );\r\n\t\tlet letBottom = letDocumentHeight.scrollHeight - letDocumentHeight.clientHeight;\r\n\t\twindow.scrollTo( 0, letBottom );\r\n\t\tletDownTimer = setTimeout( fncMoveDown, constTimeOut );\r\n\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "60e81066144502dcb58de5bd7d4cbfd8", "score": "0.4964885", "text": "page(e,t,n,i){var a=!!(e&&e.document)&&e.document.body,s;if(a){if(s=this.rangePairToCfiPair(t,{start:this.findStart(a,n,i),end:this.findEnd(a,n,i)}),!0===this._dev){let t=e.document,n=new Ze(s.start).toRange(t),i=new Ze(s.end).toRange(t),a=t.defaultView.getSelection(),o=t.createRange();a.removeAllRanges(),o.setStart(n.startContainer,n.startOffset),o.setEnd(i.endContainer,i.endOffset),a.addRange(o)}return s}}", "title": "" }, { "docid": "5074703dbf08130c11d16d6b6f40bc8a", "score": "0.49612102", "text": "getStartPosition() {\n return 0;\n }", "title": "" }, { "docid": "56c4fd9de4f92678c53f24f674ddd503", "score": "0.49602762", "text": "function j(a,b,c){function d(a){var b=a.div,c=b.offsetTop+b.clientTop+b.clientHeight;return c>n}for(var e,f,h,i,j,k,l,m,n=a.scrollTop,o=n+a.clientHeight,p=a.scrollLeft,q=p+a.clientWidth,r=[],s=0===b.length?0:g(b,d),t=s,u=b.length;u>t&&(e=b[t],f=e.div,h=f.offsetTop+f.clientTop,i=f.clientHeight,!(h>o));t++)l=f.offsetLeft+f.clientLeft,m=f.clientWidth,p>l+m||l>q||(j=Math.max(0,n-h)+Math.max(0,h+i-o),k=100*(i-j)/i|0,r.push({id:e.id,x:l,y:h,view:e,percent:k}));var v=r[0],w=r[r.length-1];return c&&r.sort(function(a,b){var c=a.percent-b.percent;return Math.abs(c)>.001?-c:a.id-b.id}),{first:v,last:w,views:r}}", "title": "" }, { "docid": "b878b663a5dfd2b55b403405113a2b48", "score": "0.49574107", "text": "function scrollHandler() {\n animateCodeInfo();\n animateHeader();\n animateWelcome();\n animateAppsElements();\n animateActionButton();\n animateQuotes();\n animateServices();\n }", "title": "" }, { "docid": "c7adb5c90ba6f2f538710c15440f957b", "score": "0.49506068", "text": "function scrollCheckWrapup(curr, exec_pos, func) {\n if ($conf.log) {\n console.log('Wrapping up scroll check.');\n }\n\n if (isInt(exec_pos)) {\n func({\n x: {\n pos: curr.x,\n vect: $pos.x.vect\n },\n y: {\n pos: curr.y,\n vect: $pos.y.vect\n }\n });\n }\n\n $pos.x.last = curr.x,\n $pos.y.last = curr.y;\n }", "title": "" }, { "docid": "6b353cd720dd7e074d3fe2d4107cc73f", "score": "0.4939872", "text": "getPos() {\r\n return this.compilerNode.pos;\r\n }", "title": "" }, { "docid": "03354d79f1b1514d76f14a1051bd2759", "score": "0.4933504", "text": "function gotoNextObject(event) {\n var objPos = getNextObjectPosition(window.pageYOffset);\n if (objPos) {\n window.scrollTo(0, objPos);\n } // else no object found\n }", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4932879", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "d470dbecbad5f8977d6f4e97113a766f", "score": "0.4932879", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$FastWeak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.ticket !== null && !((typeof c.ticket.m === 'number' && (c.ticket.m & 3) === mark) || (typeof c.ticket.m === 'object' && ((c.ticket.m.m & 3) === mark)))) {\n c.ticket = null; // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in\n }\n } else if(c instanceof h$FastWeakTicket) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(!((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) {\n work[w++] = c.val;;\n }\n if(((typeof c.weak.m === 'number' && (c.weak.m & 3) === mark) || (typeof c.weak.m === 'object' && ((c.weak.m.m & 3) === mark)))) {\n // In this case, the weak side has been marked first, which means it's been cleared; restore it\n c.weak.ticket = c;\n }\n } else if(c instanceof h$FastWeakBag) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n var j = 0; // j should always be equal to the number of not-yet-necessarily-dead tickets that have been traversed; this should always be less than or equal to i\n for(i = 0; i < c.tickets.length; i++) {\n // Any nulls left in the array prior to checking on the tickets must be tickets that died in the last GC, so we ignore them\n if(c.tickets[i] !== null) {\n if(j !== i) {\n c.tickets[i].pos = j;\n }\n if(!((typeof c.tickets[i].m === 'number' && (c.tickets[i].m & 3) === mark) || (typeof c.tickets[i].m === 'object' && ((c.tickets[i].m.m & 3) === mark)))) {\n // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in\n c.tickets[j] = null;\n } else if(j !== i) {\n // We need to move the item\n c.tickets[j] = c.tickets[i];\n } // If it's marked and not moving, don't do anything\n j++;\n }\n }\n c.tickets.length = j; // Shrink the array if any nulls have been dropped\n } else if(c instanceof h$FastWeakBagTicket) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(!((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) {\n work[w++] = c.val;;\n }\n if(((typeof c.bag.m === 'number' && (c.bag.m & 3) === mark) || (typeof c.bag.m === 'object' && ((c.bag.m.m & 3) === mark)))) {\n // In this case, the weak side has been marked first, which means it's been cleared; restore it\n c.bag.tickets[c.pos] = c;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4932879", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "43b4bc8dc96be5aeeebe375b1825830b", "score": "0.4932879", "text": "function h$follow(obj, sp) {\n var i, ii, iter, c, work, w;\n ;\n var work, mark = h$gcMark;\n if(typeof sp === 'number') {\n work = obj.slice(0, sp+1);\n w = sp + 1;\n } else {\n work = [obj];\n w = 1;\n }\n while(w > 0) {\n ;\n c = work[--w];\n ;\n if(c !== null && c !== undefined && typeof c === 'object' && ((typeof c.m === 'number' && (c.m&3) !== mark) || (typeof c.m === 'object' && c.m !== null && typeof c.m.m === 'number' && (c.m.m&3) !== mark))) {\n var doMark = false;\n var cf = c.f;\n ;\n if(typeof cf === 'function' && (typeof c.m === 'number' || typeof c.m === 'object')) {\n ;\n // only change the two least significant bits for heap objects\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n // dynamic references\n var d = c.d2;\n switch(cf.size) {\n case 0: break;\n case 1: work[w++] = c.d1;; break;\n case 2: { work[w++] = c.d1; work[w++] = d; }; break;\n case 3: var d3=c.d2; { work[w++] = c.d1; work[w++] = d3.d1; work[w++] = d3.d2; }; break;\n case 4: var d4=c.d2; { work[w++] = c.d1; work[w++] = d4.d1; work[w++] = d4.d2; work[w++] = d4.d3; }; break;\n case 5: var d5=c.d2; { work[w++] = c.d1; work[w++] = d5.d1; work[w++] = d5.d2; work[w++] = d5.d3; }; work[w++] = d5.d4;; break;\n case 6: var d6=c.d2; { work[w++] = c.d1; work[w++] = d6.d1; work[w++] = d6.d2; work[w++] = d6.d3; }; { work[w++] = d6.d4; work[w++] = d6.d5; }; break;\n case 7: var d7=c.d2; { work[w++] = c.d1; work[w++] = d7.d1; work[w++] = d7.d2; work[w++] = d7.d3; }; { work[w++] = d7.d4; work[w++] = d7.d5; work[w++] = d7.d6; }; break;\n case 8: var d8=c.d2; { work[w++] = c.d1; work[w++] = d8.d1; work[w++] = d8.d2; work[w++] = d8.d3; }; { work[w++] = d8.d4; work[w++] = d8.d5; work[w++] = d8.d6; work[w++] = d8.d7; }; break;\n case 9: var d9=c.d2; { work[w++] = c.d1; work[w++] = d9.d1; work[w++] = d9.d2; work[w++] = d9.d3; }; { work[w++] = d9.d4; work[w++] = d9.d5; work[w++] = d9.d6; work[w++] = d9.d7; }; work[w++] = d9.d8;; break;\n case 10: var d10=c.d2; { work[w++] = c.d1; work[w++] = d10.d1; work[w++] = d10.d2; work[w++] = d10.d3; }; { work[w++] = d10.d4; work[w++] = d10.d5; work[w++] = d10.d6; work[w++] = d10.d7; }; { work[w++] = d10.d8; work[w++] = d10.d9; }; break;\n case 11: var d11=c.d2; { work[w++] = c.d1; work[w++] = d11.d1; work[w++] = d11.d2; work[w++] = d11.d3; }; { work[w++] = d11.d4; work[w++] = d11.d5; work[w++] = d11.d6; work[w++] = d11.d7; }; { work[w++] = d11.d8; work[w++] = d11.d9; work[w++] = d11.d10; }; break;\n case 12: var d12=c.d2; { work[w++] = c.d1; work[w++] = d12.d1; work[w++] = d12.d2; work[w++] = d12.d3; }; { work[w++] = d12.d4; work[w++] = d12.d5; work[w++] = d12.d6; work[w++] = d12.d7; }; { work[w++] = d12.d8; work[w++] = d12.d9; work[w++] = d12.d10; work[w++] = d12.d11; }; break;\n default: w = h$followObjGen(c,work,w);\n }\n // static references\n var s = cf.s;\n if(s !== null) {\n ;\n for(var i=0;i<s.length;i++) work[w++] = s[i];;\n }\n } else if(c instanceof h$Weak) {\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n } else if(c instanceof h$MVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n iter = c.writers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii[1];; // value\n work[w++] = ii[0];; // thread\n }\n iter = c.readers.iter();\n while((ii = iter()) !== null) {\n work[w++] = ii;;\n }\n if(c.waiters) {\n for(i=c.waiters.length-1;i>=0;i--) {\n work[w++] = c.waiters[i];;\n }\n }\n if(c.val !== null && !((typeof c.val.m === 'number' && (c.val.m & 3) === mark) || (typeof c.val.m === 'object' && ((c.val.m.m & 3) === mark)))) work[w++] = c.val;;\n } else if(c instanceof h$MutVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n } else if(c instanceof h$TVar) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n work[w++] = c.val;;\n iter = c.blocked.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n if(c.invariants) {\n iter = c.invariants.iter();\n while((ii = iter.next()) !== null) {\n work[w++] = ii;;\n }\n }\n } else if(c instanceof h$Thread) {\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n if(c.stack) {\n for(i=c.sp;i>=0;i--) {\n work[w++] = c.stack[i];;\n }\n }\n for(i=0;i<c.excep.length;i++) {\n work[w++] = c.excep[i];;\n }\n } else if(c instanceof h$Transaction) {\n // - the accessed TVar values don't need to be marked\n // - parents are also on the stack, so they should've been marked already\n ;\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n for(i=c.invariants.length-1;i>=0;i--) {\n work[w++] = c.invariants[i].action;;\n }\n work[w++] = c.action;;\n iter = c.tvars.iter();\n while((ii = iter.nextVal()) !== null) {\n work[w++] = ii.val;;\n }\n } else if(c instanceof Array && c.__ghcjsArray) {\n // only for Haskell arrays with lifted values\n if(typeof c.m === 'number') c.m = (c.m&-4)|mark; else c.m.m = (c.m.m & -4)|mark;;\n ;\n for(i=0;i<c.length;i++) {\n var x = c[i];\n if(typeof x === 'object' && x !== null && !((typeof x.m === 'number' && (x.m & 3) === mark) || (typeof x.m === 'object' && ((x.m.m & 3) === mark)))) {\n work[w++] = x;;\n }\n }\n } else if(typeof c === 'object') {\n ;\n for(i=h$extensibleRetentionCallbacks.length-1;i>=0;i--) {\n var x = h$extensibleRetentionCallbacks[i](c, mark);\n if(x === false) continue;\n if(x !== true) {\n for(j=x.length-1;j>=0;j--) {\n work[w++] = x[j];;\n }\n }\n break;\n }\n } // otherwise: not an object, no followable values\n }\n }\n ;\n}", "title": "" }, { "docid": "27beee9ffac291625dd720bde75fe127", "score": "0.49322304", "text": "function scroll_down() {\n $(\"#log\").scrollTop($(\"#log\").height()+10000000); // TODO: Try to avoid this arbitrary addition\n}", "title": "" }, { "docid": "625841a1d3af5249cad5c0fd4c8b7099", "score": "0.4928423", "text": "function jumpLine(doc, lines) {\n for (let index = 0; index < lines; index++) {\n doc.moveDown();\n }\n}", "title": "" }, { "docid": "615ef8bc4310646e88f13ca8d16fed82", "score": "0.49195707", "text": "set start(value) { this.buffer_view.u32[this.pointer/4] = Parser.char_bytes * value - this.buffer_view.code.pointer; }", "title": "" }, { "docid": "b7f1af00294e72d28ba9e8ac6a2bcd3b", "score": "0.49194282", "text": "function goToBlock() {\n wraper.scrollTo(((windowWidth - 16) * (+this.number)), 0);\n }", "title": "" }, { "docid": "39f00a20e57358c2c178cb42341c5d20", "score": "0.49169457", "text": "function calculateScrollPosition(href) {\n\n //var sideNavHref = href;\n\n var pin = $(href).prev();\n var prevPin = pin.prevAll('.superscrollorama-pin-spacer');\n var heights = [];\n var browserHeight = $(window).height();\n\n $.each(prevPin, function(index, value) {\n value = $(this).outerHeight();\n heights.push(value);\n //window.alert('value' + value);\n });\n\n heights = eval(heights.join('+'));\n\n $('html, body').animate({\n scrollTop: heights + browserHeight + 1000\n }, 1000);\n }", "title": "" }, { "docid": "9d0b60e212980b86539df14a12c9dc1e", "score": "0.49154875", "text": "function calculateOffsetTop(r){\n return Ya(r,\"offsetTop\");\n}", "title": "" }, { "docid": "10a5f6ee15317d6f4b76cadfd835827e", "score": "0.4914743", "text": "function generate_code(instrs, hooks)\n{\n var code = '(function(s, steps){\\n'\n code += 'for(;steps>0;--steps) switch(s.next_address()) {\\n'\n for (var i = 0; i < instrs.length; ++i) {\n var instr = instrs[i]\n var line = instr.begin.toString(16)\n while (line.length < 4) line = '0' + line\n line = 'case 0x' + line + ': '\n line += 's.ip += ' + instr.len + '; ' + instr.toCode()\n if (hooks && (hooks == true || hooks[instr.end])) line += '; return true'\n while (line.length < 70) line += ' '\n line += ' // ' + instr.toString()\n code += line + '\\n'\n }\n code += 'default: return false\\n'\n code += '}\\n'\n code += 'return true\\n'\n code += '})'\n return code\n}", "title": "" }, { "docid": "cf63e4c9f8f486be99154f0ce6e97995", "score": "0.49097916", "text": "function scrolling() {\r\n for (var key in ElemGroup) {\r\n ElemGroup[key].elem.style.top = \"calc(50% - \" + -((window.scrollY / ElemGroup[key].depth) - (ElemGroup[key].offset / ElemGroup[key].depth)) + \"px)\";\r\n }\r\n}", "title": "" }, { "docid": "93b3874bfd0ecff3666f30572b03ad64", "score": "0.49006543", "text": "gotoPair() {\n const editor = vscode.window.activeTextEditor;\n if (!editor || editor.document.languageId !== 'latex') {\n return;\n }\n const curPos = editor.selection.active;\n const document = editor.document;\n const tokens = this.tokenizeLine(document, curPos);\n if (!tokens) {\n return;\n }\n const startPos = tokens.pos;\n const pattern = '\\\\\\\\(begin|end)\\\\{' + escapeRegExp(tokens.name) + '\\\\}';\n const dir = (tokens.type === 'begin') ? 1 : -1;\n const resMatchingPair = this.locateMatchingPair(pattern, dir, startPos, document);\n if (resMatchingPair) {\n const newPos = resMatchingPair.pos;\n editor.selection = new vscode.Selection(newPos, newPos);\n editor.revealRange(new vscode.Range(newPos, newPos));\n }\n }", "title": "" }, { "docid": "942d610b5e196c310c80e79b2e49973c", "score": "0.48933977", "text": "getPageScrollPositionBeforeScroll(count) {\n return this.scrollRecords.slice(this.scrollRecords.length - count - 1, this.scrollRecords.length - count)[0];\n }", "title": "" }, { "docid": "bc656d9743e7441218d8dba3f75f716c", "score": "0.48871085", "text": "scroll(xOffset, yOffset) {\n let visibleNotes = Math.floor((this.rect.h / this.fonts.note.size)-1);\n\n this.scrollOffset.x += xOffset;\n if ( this.scrollOffset.x < 0 ) {\n this.scrollOffset.x = 0;\n }\n\n this.scrollOffset.y += yOffset;\n if ( this.scrollOffset.y + visibleNotes > this.pattern.getNotesPerTrack() ) {\n this.scrollOffset.y = this.pattern.getNotesPerTrack() - visibleNotes;\n }\n if ( this.scrollOffset.y < 0 ) {\n this.scrollOffset.y = 0;\n }\n }", "title": "" }, { "docid": "ff5af0dabb6e17fe2ab3524684782e58", "score": "0.48840687", "text": "jumpTo(offset) {\n if (typeof offset == 'string') {\n // Parse it using parseInt to allow 0x1F and things to work. This means\n // dumb things like 0apple will work, but whatever.\n offset = parseInt(offset);\n }\n if (offset >= 0 && offset <= this.file.size) {\n this._scroller.cursor = offset;\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "75ecbee8bdf7caa0b5227ae565df0a59", "score": "0.4882693", "text": "function myScroll(pageElement,speed){\n let posY = 0;\n if(pageElement!=null){\n posY = pageElement.offsetTop -80;\n let curr = window.scrollY;\n let offset = posY-curr;\n if(offset<0){\n scrollUp(offset,speed);\n }\n else{\n scrollDown(offset,speed);\n }\n }\n}", "title": "" }, { "docid": "99423843e7f61af5f3dbfec24d4895ef", "score": "0.48786446", "text": "function getOffset (element){\n var rect = element.getBoundingClientRect();\n return {\n top: rect.top + pageScroll().top,\n left: rect.left + pageScroll().left\n };\n}", "title": "" }, { "docid": "f2e85504dae7538c805c9090c269cc0a", "score": "0.4877897", "text": "pointerHighlight()\n {\n this.pointerUpAndDown(2, 10, 250)\n }", "title": "" }, { "docid": "07b941c26252f5849d43c16ca6dfe0d1", "score": "0.48752397", "text": "function goDown() {\n \t\tif (hits.length == 0) {\n \t\t\treturn;\n \t\t}\n\n \t\tif (gotoRowIndex === null) {\n \t\t\tactiveRowId = hits[0];\n \t\t\t$$invalidate(7, gotoRowIndex = 0);\n \t\t} else {\n \t\t\tif (gotoRowIndex >= hits.length - 1) {\n \t\t\t\t$$invalidate(7, gotoRowIndex = hits.length - 1);\n \t\t\t} else {\n \t\t\t\t$$invalidate(7, gotoRowIndex++, gotoRowIndex);\n \t\t\t\tactiveRowId = hits[gotoRowIndex];\n \t\t\t}\n \t\t}\n\n \t\ttable.scrollToRow(activeRowId);\n \t}", "title": "" }, { "docid": "3db966711af45231ce20cfc955409cf3", "score": "0.4871068", "text": "function smoothScroll() {\n var eID = determine() + \"-show\";\n var startY = currentYPosition();\n var stopY = elmYPosition(eID);\n var distance = stopY > startY ? stopY - startY : startY - stopY;\n if (distance < 100) {\n scrollTo(0, stopY); return;\n }\n var speed = Math.round(distance / 100);\n if (speed >= 20) speed = 20;\n var step = Math.round(distance / 25);\n var leapY = stopY > startY ? startY + step : startY - step;\n var timer = 0;\n if (stopY > startY) {\n for ( var i=startY; i<stopY; i+=step ) {\n setTimeout(\"window.scrollTo(0, \"+leapY+\")\", timer * speed);\n leapY += step; if (leapY > stopY) leapY = stopY; timer++;\n } return;\n }\n for ( var i=startY; i>stopY; i-=step ) {\n setTimeout(\"window.scrollTo(0, \"+leapY+\")\", timer * speed);\n leapY -= step; if (leapY < stopY) leapY = stopY; timer++;\n }\n return false;\n}", "title": "" }, { "docid": "72d89abe5ea2460f13837baee1f7aa37", "score": "0.48659456", "text": "originalPositionFor(aArgs) {\n const needle = {\n generatedLine: util.getArg(aArgs, \"line\"),\n generatedColumn: util.getArg(aArgs, \"column\")\n };\n\n if (needle.generatedLine < 1) {\n throw new Error(\"Line numbers must be >= 1\");\n }\n\n if (needle.generatedColumn < 0) {\n throw new Error(\"Column numbers must be >= 0\");\n }\n\n let bias = util.getArg(aArgs, \"bias\", SourceMapConsumer.GREATEST_LOWER_BOUND);\n if (bias == null) {\n bias = SourceMapConsumer.GREATEST_LOWER_BOUND;\n }\n\n let mapping;\n this._wasm.withMappingCallback(m => mapping = m, () => {\n this._wasm.exports.original_location_for(\n this._getMappingsPtr(),\n needle.generatedLine - 1,\n needle.generatedColumn,\n bias\n );\n });\n\n if (mapping) {\n if (mapping.generatedLine === needle.generatedLine) {\n let source = util.getArg(mapping, \"source\", null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n\n let name = util.getArg(mapping, \"name\", null);\n if (name !== null) {\n name = this._names.at(name);\n }\n\n return {\n source,\n line: util.getArg(mapping, \"originalLine\", null),\n column: util.getArg(mapping, \"originalColumn\", null),\n name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }", "title": "" }, { "docid": "2e380bb28c7929870743e796d3c36403", "score": "0.48649862", "text": "function startit(){\n go = 0;\n scrollFromSide();\n}", "title": "" }, { "docid": "2c78b8166c13a1697d9404df1769af1e", "score": "0.48635605", "text": "function LANDING_VII___landingFlag_8_nextLemmaButtons()\n {\n //--------------------------------------------\n // //\\\\ remove_landing_state_from_top_html();\n //--------------------------------------------\n //.todmm ... why without 1s transition the\n //.landing flickers?\n //.todm ... use regEx to cooperate with\n //.other frameworks on html-element\n var de = document.documentElement;\n de.className = de.className.replace( 'non-loaded', '' );\n //--------------------------------------------\n // \\\\// remove_landing_state_from_top_html();\n //--------------------------------------------\n fmethods.does_set_next_lemma_button_event( 'right' );\n fmethods.does_set_next_lemma_button_event( 'left' );\n\n //todo: do observe does it fix vertical-misplacement-bug?\n // remove this fix, reproduce \n // vertical-misplacement-bug and solve it thoroughtly:\n document.body.scrollTop = 0; //todo ... type number? not a \"0px\"\n }", "title": "" }, { "docid": "a156649630a3c3d1423b1062466f59f8", "score": "0.4863459", "text": "function scrollToHl(hl_id) {\n var pageTarget = hls[hl_id].top.page + 1\n if(!(hls[hl_id].top.elem.getClientRects()[0])) {\n PDFViewerApplication.pdfViewer.currentPageNumber = pageTarget;\n }\n window.scrollToScrolledHl = function() {\n var viewerContainer = document.getElementById('viewerContainer')\n var vCrect = viewerContainer.getClientRects()[0]\n var vCtop = vCrect.top\n var vCbot = vCrect.bottom\n try {\n var top = hls[hl_id].top.elem.getClientRects()[0].top\n var bottom = hls[hl_id].bottom.elem.getClientRects()[0].bottom\n } catch (e) {\n console.warn(e)\n return\n }\n window.scrollToScrolledHl = undefined\n console.log(top, bottom, vCtop, vCbot)\n\n var delta = top/2 + bottom/2 - vCbot/2 - vCtop/2\n\n var begin = viewerContainer.scrollTop\n var t0 = null;\n var thalf = Math.max(110, Math.min(50, delta/10));\n var step = function(ts) {\n if(!t0) t0 = ts;\n var t = (ts - t0) / thalf;\n if (t < 2) {\n if (t < 1) {\n viewerContainer.scrollTop = begin - delta/2 * (Math.sqrt(1 - t*t) - 1);\n } else {\n t -= 2;\n viewerContainer.scrollTop = begin + delta/2 * (Math.sqrt(1 - t*t) + 1);\n }\n window.requestAnimationFrame(step);\n }\n }\n window.requestAnimationFrame(step);\n }\n scrollToScrolledHl()\n}", "title": "" }, { "docid": "e7e8fef3d9a7a249a0767abf38ff5b77", "score": "0.4863039", "text": "get begin() { return (this.buffer_view.u32[this.pointer/4] - this.buffer_view.code.pointer) / Parser.char_bytes; }", "title": "" } ]
4ecaec7b4230fd680a711d31272c37ff
Mark. The following line has been moved to the end of this file. }); Example data
[ { "docid": "da0b2076ab5aecef098f566046eceb21", "score": "0.0", "text": "function addTestData() {\n // select dropdown\n $(\"#independent_dropdown_ve\").val(functionnames_ve[2]);\n $(\"#contour_dropdown_ve\").val(functionnames_ve[3]);\n $(\"#fixed_dropdown_ve\").val(functionnames_ve[4]);\n makeSelectionsUnique(functionnames_ve, functionnames_text_ve, \"independent_dropdown_ve\");\n \n $(\"#independent_ve\").val(\"0.009, 0.009, 0.010, 0.011, 0.011, 0.012, 0.013, 0.014, 0.014\");\n $(\"#contour_ve\").val(\"0.012, 0.013, 0.014, 0.015, 0.016, 0.017, 0.018, 0.019, 0.020\");\n $(\"#fixed_ve\").val(\"4437, 4437, 4437, 4437, 4437, 4437, 4437, 4437, 4437\");\n \n $(\"#r0_ve\").val(\"0.70\");\n $(\"#k_ve\").val(\"47.4%\");\n $(\"#alpha_ve\").val(\"0.025\");\n \n // set status bar.\n $(\"#status_bar_ve\").html(\"To invoke R functions: findPower_scorep1p2(R0, p1, p2, alpha, N, k) and DrawPowerp1p2(p1, p2, R0, alpha, N, k)\");\n \n $(\"#calculate_ve\").removeAttr('disabled');\n $(\".variable-example\").text(\"... ... \");\n addPopupDefinition();\n}", "title": "" } ]
[ { "docid": "63b2e650acfb51380dcfe0542f7ee6ce", "score": "0.66056", "text": "__init() {this.lastLineNumber = 1}", "title": "" }, { "docid": "6c9e783e54db92018b99783816f49f69", "score": "0.58449453", "text": "function skipMarker(state, line) {\n var pos, marker, start = state.bMarks[line] + state.tShift[line], max = state.eMarks[line];\n if (start >= max) {\n return -1;\n }\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 126 /* ~ */ && marker !== 58 /* : */) {\n return -1;\n }\n pos = state.skipSpaces(start);\n // require space after \":\"\n if (start === pos) {\n return -1;\n }\n // no empty definitions, e.g. \" : \"\n if (pos >= max) {\n return -1;\n }\n return start;\n }", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "4f4ab740280c02ed567296fcea1db453", "score": "0.5757498", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return pos;\n}", "title": "" }, { "docid": "a79cf1cc734f72b143e10b118963b201", "score": "0.5708319", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return start;\n }", "title": "" }, { "docid": "a79cf1cc734f72b143e10b118963b201", "score": "0.5708319", "text": "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return start;\n }", "title": "" }, { "docid": "9593e6e5d147fa70cf56ce113e531ebb", "score": "0.55678177", "text": "function addMark(report) {\n output += `\"${report.studentNo}\"`;\n output += `,\"${report.marker}\"`;\n output += `,${report.marks}`;\n output += `,${report.maxMarks}`;\n output += `,\"${report.presetComments}\"`;\n // Add empty sting if freeComment is blank, instead of undefined:\n output += `,\"${report.freeComment ? report.freeComment : ''}\"`;\n report.aspects.forEach(aspect => {\n output += `,\"${aspect.selected}\"`;\n output += `,${aspect.mark}`;\n output += `,${aspect.maxMark}`;\n });\n output += `,${(report.adjustment || 0)}`;\n output += '\\n';\n }", "title": "" }, { "docid": "d7b12396a42efef1d2c3d674e240bb0f", "score": "0.55537677", "text": "function getAddedLineNumber(data) {\n if (data.ChangeState === 0 || data.ChangeState === 1) {\n return data.AddedLineNumber;\n }\n else if (data.ChangeState == 3) {\n return \"...\";\n }\n\n return \"\";\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "8e85ff9d056e32ec773bc7f116e13a06", "score": "0.55523634", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max && state.src.charCodeAt(pos) !== 0x20/* space */) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "ddf72ea0db668ba3f18ba4b2a2eba4d7", "score": "0.55466974", "text": "function skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}", "title": "" }, { "docid": "96d32af50b2cdb3bb0ac1034887c3c08", "score": "0.55187994", "text": "function skipOrderedListMarker(state, startLine) {\n\t var ch,\n\t start = state.bMarks[startLine] + state.tShift[startLine],\n\t pos = start,\n\t max = state.eMarks[startLine];\n\t\n\t // List marker should have at least 2 chars (digit + dot)\n\t if (pos + 1 >= max) { return -1; }\n\t\n\t ch = state.src.charCodeAt(pos++);\n\t\n\t if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\t\n\t for (;;) {\n\t // EOL -> fail\n\t if (pos >= max) { return -1; }\n\t\n\t ch = state.src.charCodeAt(pos++);\n\t\n\t if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\t\n\t // List marker should have no more than 9 digits\n\t // (prevents integer overflow in browsers)\n\t if (pos - start >= 10) { return -1; }\n\t\n\t continue;\n\t }\n\t\n\t // found valid marker\n\t if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n\t break;\n\t }\n\t\n\t return -1;\n\t }\n\t\n\t\n\t if (pos < max) {\n\t ch = state.src.charCodeAt(pos);\n\t\n\t if (!isSpace(ch)) {\n\t // \" 1.test \" - is not a list item\n\t return -1;\n\t }\n\t }\n\t return pos;\n\t}", "title": "" }, { "docid": "5002481b7dfbb3499b232dabff67ab6c", "score": "0.5498428", "text": "function processLine(data, eof) {\n if (data) {\n var key;\n var keyField;\n var json = JSON.parse(data);\n if (zoomLevel < ZOOMLEVEL_CITY) {\n keyField = \"city_small_name\";\n }else {\n keyField = \"zip\";\n json.zip = \"ZIP \" + json.zip; // convert to string key as zipcode is numeric\n }\n\n key = json[keyField];\n json.count = 1;\n json.lat = formatLat(json.lat);\n json.lng = formatLong(json.lng);\n if (inBounds(json.lat, json.lng, neLat, neLong, swLat, swLong)) { \n if (index[key]) {\n index[key].count++;\n index[key].title = index[key].count + \" users in \" + index[key][keyField];\n index[key][\"lat\"] = (index[key][\"lat\"] + json[\"lat\"]) / 2.0;\n index[key][\"lng\"] = (index[key][\"lng\"] + json[\"lng\"]) / 2.0;\n }else {\n index[key] = json;\n }\n }\n }\n if (eof) {\n callback(index);\n }\n }", "title": "" }, { "docid": "032f3edd2ef3556ff0a67205e1caa368", "score": "0.54758215", "text": "function markIt(node) {\n node.addClass(\"marked\");\n arr.value(lastElement, node.value());\n lastElement++;\n node.highlight();\n av.umsg(\"Mark and enqueue \" + node.value());\n av.step();\n }", "title": "" }, { "docid": "2d18c790aef6a0641996df742d226412", "score": "0.54756933", "text": "incrementLine() {\n this.__line++\n }", "title": "" }, { "docid": "89060293c2edc7116304b4cac33e3f92", "score": "0.54588675", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (spans) for (var style, css, spanStyle, spanEndStyle, spanStartStyle, title, collapsed, len = allText.length, pos = 0, i = 1, text = \"\", nextChange = 0; ;) {\n if (nextChange == pos) {\n // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\", collapsed = null, \n nextChange = 1 / 0;\n for (var foundBookmarks = [], endStyles = void 0, j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n \"bookmark\" == m.type && sp.from == pos && m.widgetNode ? foundBookmarks.push(m) : sp.from <= pos && (null == sp.to || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos) ? (null != sp.to && sp.to != pos && nextChange > sp.to && (nextChange = sp.to, \n spanEndStyle = \"\"), m.className && (spanStyle += \" \" + m.className), m.css && (css = (css ? css + \";\" : \"\") + m.css), \n m.startStyle && sp.from == pos && (spanStartStyle += \" \" + m.startStyle), m.endStyle && sp.to == nextChange && (endStyles || (endStyles = [])).push(m.endStyle, sp.to), \n m.title && !title && (title = m.title), m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0) && (collapsed = sp)) : sp.from > pos && nextChange > sp.from && (nextChange = sp.from);\n }\n if (endStyles) for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) endStyles[j$1 + 1] == nextChange && (spanEndStyle += \" \" + endStyles[j$1]);\n if (!collapsed || collapsed.from == pos) for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) buildCollapsedSpan(builder, 0, foundBookmarks[j$2]);\n if (collapsed && (collapsed.from || 0) == pos) {\n if (buildCollapsedSpan(builder, (null == collapsed.to ? len + 1 : collapsed.to) - pos, collapsed.marker, null == collapsed.from), \n null == collapsed.to) return;\n collapsed.to == pos && (collapsed = !1);\n }\n }\n if (pos >= len) break;\n for (var upto = Math.min(len, nextChange); ;) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {\n text = text.slice(upto - pos), pos = upto;\n break;\n }\n pos = end, spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]), style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n } else for (var i$1 = 1; i$1 < styles.length; i$1 += 2) builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options));\n }", "title": "" }, { "docid": "656fa34947c646620208f96384cfb111", "score": "0.5456883", "text": "function d(){for(var a=i,b=f[i++],c=b.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/),d={oldStart:+c[1],oldLines:+c[2]||1,newStart:+c[3],newLines:+c[4]||1,lines:[],linedelimiters:[]},h=0,j=0;i<f.length&&!(0===f[i].indexOf(\"--- \")&&i+2<f.length&&0===f[i+1].indexOf(\"+++ \")&&0===f[i+2].indexOf(\"@@\"));i++){var k=0==f[i].length&&i!=f.length-1?\" \":f[i][0];if(\"+\"!==k&&\"-\"!==k&&\" \"!==k&&\"\\\\\"!==k)break;d.lines.push(f[i]),d.linedelimiters.push(g[i]||\"\\n\"),\"+\"===k?h++:\"-\"===k?j++:\" \"===k&&(h++,j++)}\n// Perform optional sanity checking\nif(\n// Handle the empty block count case\nh||1!==d.newLines||(d.newLines=0),j||1!==d.oldLines||(d.oldLines=0),e.strict){if(h!==d.newLines)throw new Error(\"Added line count did not match for hunk at line \"+(a+1));if(j!==d.oldLines)throw new Error(\"Removed line count did not match for hunk at line \"+(a+1))}return d}", "title": "" }, { "docid": "685c8714488877f8c2043b1c8f21737c", "score": "0.5397873", "text": "newLine() {\n this.line++;\n this.col = 0;\n }", "title": "" }, { "docid": "516516eaa92d035fce2ec71f395b3c3e", "score": "0.5349317", "text": "function markIt(node) {\n node.addClass(\"marked\");\n jsav.umsg(\"Mark and enqueue \" + node.value());\n arr.value(lastElement, node.value());\n lastElement++;\n node.highlight();\n}", "title": "" }, { "docid": "4c0ccd324f30a3c494c5f9ad1c2b8804", "score": "0.52987295", "text": "function updateLine(){\n \t\n \t}", "title": "" }, { "docid": "02c8fad0dea729052d56c213a4750d3f", "score": "0.5285476", "text": "function commentOutLine(lineno) {\n\t\t\tvar lines = intextarea.value.split(\"\\n\");\n\t\t\tlines[lineno-1] = \"//\" + lines[lineno-1];\n\t\t\tintextarea.value = lines.join(\"\\n\");\n\t\t}", "title": "" }, { "docid": "3670259837802a14c3ba184a03475a61", "score": "0.5263155", "text": "function endLine() {\n processStage = processStageEnum.FI_KEYS;\n lineNumber++;\n}", "title": "" }, { "docid": "706ce5cbb5bb9eea30c40f4503a3d651", "score": "0.52364343", "text": "function insertLineContent(line, builder) {\n var st = line.styles, spans = line.markedSpans;\n if (!spans) {\n for (var i = 0; i < st.length; i+=2)\n builder.addToken(builder, st[i], styleToClass(st[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 0, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = st[i++]; style = styleToClass(st[i++]);\n }\n }\n }", "title": "" }, { "docid": "4ad978b291ca199034f0d83e9637eec2", "score": "0.52226126", "text": "parseLine(line) {\n line = this.stripComments(line);\n if (line !== '') {\n line = this.parseTags(line);\n this.parseSpecialKeyword(line);\n if (line !== '' && this.current !== void 0) {\n this.current.lines.push(new Line(line, this.fileName, this.lineNumber))\n }\n }\n }", "title": "" }, { "docid": "06a4adb4f4846eafc9c5423b555edf56", "score": "0.5218941", "text": "function addExtendedLine(lineno) {\n\t\t\tvar $line = $(outdiv.childNodes[lineno-1]);\n\t\t\t$line.addClass(\"eden-extendedline\");\n\t\t}", "title": "" }, { "docid": "46b54ab9d52620b4ce4c4a9167cadf4c", "score": "0.52092427", "text": "function onData(line) {\n console.log(line);\n // console.log(counter);\n // counter += 1;\n}", "title": "" }, { "docid": "b2bd5d517cd39442ac5d77fb80467a3f", "score": "0.52033657", "text": "advance (line, line_height) {\n let can_push = this.push(line);\n if (can_push){\n return this.createLine(line_height);\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "77eee72bf699d8219b10bca0492f6c58", "score": "0.5185903", "text": "function poemLine(lineNumber) {\n if (lineNumber === 8) {\n return \"More!\"\n } else if (lineNumber === 4) {\n return \"4!\"\n } else {\n return lineNumber + \" potato,\"\n }\n}", "title": "" }, { "docid": "778aa4c63921e1f91eff867e3bb9c276", "score": "0.51841915", "text": "function initNewStaveLine(lineNum) {\n\tvar i = 0;\n\tvar DisplayCommentLine = function() {\n\t\t$(\"#score\").append(\"<div id='\" + CLEFS[i].partName + \"_\" + lineNum + \"' class='annotationcontainer'></div>\");\n\t}\n\tDisplayCommentLine();\n\t$(\"#score\").append(\"<div id='line_\" + lineNum + \"'></div>\");\n\ti++;\n\tDisplayCommentLine();\n // $(\"#score\").append(\"<hr></hr>\"); Do we need to seperate each comment div with an hr?\n\tvar paper = $(\"#line_\" + lineNum);\n\trenderer = new vf.Renderer(paper, vf.Renderer.Backends.RAPHAEL);\n\tctx = renderer.getContext();\n\treturn true;\n}", "title": "" }, { "docid": "ffc88332295855a4a1d675955ad1cf82", "score": "0.51784575", "text": "function getRemovedLineNumber(data) {\n if (data.ChangeState === 0 || data.ChangeState === 2) {\n return data.RemovedLineNumber;\n }\n else if (data.ChangeState == 3) {\n return \"...\";\n }\n\n return \"\";\n}", "title": "" }, { "docid": "4368fc3e69f4071436462bbaad7c70ab", "score": "0.51724684", "text": "tokenizeLine(line) {\n var newLine = new Node();\n newLine.nameTag = \"line\";\n var tokenReplaced = true;\n var unfinished = \"\"\n while (line.length > 0) {\n if (tokenReplaced) {\n tokenReplaced = false;\n for (var i = 0; i < tokenList.length; i++) {\n var token = tokenList[i];\n var match = line.match(new RegExp(token.regex));\n if (match && match.index === 0) {\n line = line.substring(match[0].length);\n var newToken = new Node();\n for (var j = 0; j < token.attributes.length; j++) {\n var attribute = token.attributes[j];\n // calc position of attribute value\n var beforeMatch = match[0].match(new RegExp(attribute.before));\n var afterMatch = match[0].match(new RegExp(attribute.after));\n\n if (beforeMatch && afterMatch) {\n var indexOfAfter = afterMatch.index;\n var indexOfBefore = beforeMatch.index;\n var attributeValue = match[0].substring(indexOfBefore + beforeMatch[0].length, indexOfAfter);\n newToken.attributes[attribute.name]={name: attribute.name, value: attributeValue.trim()}\n } else {\n console.log(\"Attribute \" + attribute.name + \" not found.\")\n }\n }\n if (unfinished !== \"\") {\n var unfinishedToken = new Node();\n unfinishedToken.matchedCode = unfinished;\n unfinishedToken.nameTag = \"unfinished\";\n newLine.children.push(unfinishedToken);\n unfinished = \"\";\n }\n newToken.matchedCode = match[0];\n newToken.nameTag = tokenList[i].token;\n newLine.children.push(newToken);\n tokenReplaced = true;\n }\n }\n } else {\n unfinished += line.charAt(0);\n line = line.substring(1);\n tokenReplaced = true;\n }\n }\n if (unfinished !== \"\") {\n var restToken = new Node();\n restToken.matchedCode = unfinished;\n restToken.nameTag = \"unfinished\"\n restToken.parent = newLine;\n newLine.children.push(restToken);\n }\n\n return newLine;\n }", "title": "" }, { "docid": "f88abfba4c503c242e65707fb7df1303", "score": "0.51612866", "text": "function moveToNextLine(){\n\t\tif(tokenStream.length > 0){\n\t\t\tvar currentLine = getTokenLine();\n\t\t\twhile(currentLine == getTokenLine()){\n\t\t\t\tacceptToken();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "59a303c8ee6f1ec93eaa1f132fdd1aa7", "score": "0.51567775", "text": "saveTheEndess(writer, xrefPos) {\n writer.write(Operators.newLine + Operators.startxref + Operators.newLine);\n writer.write(xrefPos.toString() + Operators.newLine);\n writer.write(Operators.eof + Operators.newLine);\n }", "title": "" }, { "docid": "98e25627eab4578ad585ac726b317224", "score": "0.5154979", "text": "function markIt(node) {\n node.addClass(\"marked\");\n markCount++;\n av.umsg(\"Mark node \" + node.value());\n node.highlight();\n av.step();\n }", "title": "" }, { "docid": "b9a468b4fbf6747f4d19e6247fc0859c", "score": "0.5142844", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans\n , allText = line.text\n , at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i += 2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i + 1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (; ; ) {\n if (nextChange == pos) {\n // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null;\n nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j]\n , m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className)\n spanStyle += \" \" + m.className;\n if (m.css)\n css = m.css;\n if (m.startStyle && sp.from == pos)\n spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange)\n spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title)\n title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode)\n foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null);\n if (collapsed.to == null)\n return;\n }\n if (!collapsed && foundBookmarks.length)\n for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len)\n break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {\n text = text.slice(upto - pos);\n pos = upto;\n break;\n }\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "24f58105f1fde2f262989f366e96efea", "score": "0.51416916", "text": "exit(node) {\n let line = node.loc.start.line;\n let column = node.loc.start.column;\n\n // yielded content makes it in here too\n //\n // `{{#my-component}}\n // test\n // {{/my-component}}`\n //\n // becomes\n //\n // `\n // test\n // `\n //\n // check for that case\n if (line !== 1 || column !== 0) {\n return;\n }\n\n let source = this.sourceForNode(node);\n\n source.split('\\n').forEach((line, i) => {\n let column = line.length - 1;\n if (line[column] === ' ') {\n this.log({\n message: 'line cannot end with space',\n line: i + 1,\n column,\n source: line\n });\n }\n });\n }", "title": "" }, { "docid": "34f61d4e53fd922a4223470ca95513e5", "score": "0.5140037", "text": "function updatePosition(subvalue) {\n\t var lastIndex = -1;\n\t var index = subvalue.indexOf('\\n');\n\t\n\t while (index !== -1) {\n\t line++;\n\t lastIndex = index;\n\t index = subvalue.indexOf('\\n', index + 1);\n\t }\n\t\n\t if (lastIndex === -1) {\n\t column += subvalue.length;\n\t } else {\n\t column = subvalue.length - lastIndex;\n\t }\n\t\n\t if (line in offset) {\n\t if (lastIndex !== -1) {\n\t column += offset[line];\n\t } else if (column <= offset[line]) {\n\t column = offset[line] + 1;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "759e3a3cb1acf319f970fa2ecefd90a1", "score": "0.51272976", "text": "if (blockScalarIndentations.length < 0 && this.isCurrentLineComment()) {\n // remember ignored comment lines (they are used later in nested\n // parser calls to determine real line numbers)\n //\n // CAUTION: beware to not populate the global property here as it\n // will otherwise influence the getRealCurrentLineNb() call here\n // for consecutive comment lines and subsequent embedded blocks\n this.locallySkippedLineNumbers[] = this.getRealCurrentLineNb();\n continue;\n }", "title": "" }, { "docid": "9e50afb28c3d812f423fc18bf4668dfd", "score": "0.5123768", "text": "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "title": "" }, { "docid": "3210c10a81a774886cc9091ffdeaeb7f", "score": "0.51145023", "text": "remLine(lineNumber) {\n if (this.content.length === 1) {\n let lineData = this.lineData(lineNumber);\n if (lineData.length === 0) lineData.push({char: \" \", chord: null});\n return false;\n }\n this.content.splice(lineNumber, 1);\n return true;\n }", "title": "" }, { "docid": "1d648278d87fcb4f3ec61b8b19b1dff0", "score": "0.51106876", "text": "parseSpecialKeyword(line) {\n if (this.current && line.match(this.regexPointSize)) {\n this.current.hasPointSize = true;\n }\n }", "title": "" }, { "docid": "f03628c19b979f5cdb2c2f2fac64241a", "score": "0.5100763", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([ span ]) : [ span ], \n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "5a21de83d5d6d38ae894b78b20b3c765", "score": "0.5090037", "text": "function next_line() {\n\n// Put the next line of source in source_line. If the line contains tabs,\n// replace them with spaces and give a warning. Also warn if the line contains\n// unsafe characters or is too damn long.\n\n var at;\n column = 0;\n line += 1;\n source_line = lines[line];\n if (source_line !== undefined) {\n at = source_line.search(rx_tab);\n if (at >= 0) {\n if (!option.white) {\n warn_at(\"use_spaces\", line, at + 1);\n }\n source_line = source_line.replace(rx_tab, \" \");\n }\n at = source_line.search(rx_unsafe);\n if (at >= 0) {\n warn_at(\n \"unsafe\",\n line,\n column + at,\n \"U+\" + source_line.charCodeAt(at).toString(16)\n );\n }\n if (option.maxlen && option.maxlen < source_line.length) {\n warn_at(\"too_long\", line, source_line.length);\n } else if (!option.white && source_line.slice(-1) === \" \") {\n warn_at(\n \"unexpected_trailing_space\",\n line,\n source_line.length - 1\n );\n }\n }\n return source_line;\n }", "title": "" }, { "docid": "ad390f436926c80e8a80e5062a1eed36", "score": "0.5086271", "text": "function editBreakOnSourceLine() {\n if (line.opcodes.length === 0) return\n var op = line.opcodes[0]\n editBreakOnOpCode(0)\n }", "title": "" }, { "docid": "a454fdd9b0ee4fc4198575465bf7a2df", "score": "0.5077891", "text": "getLineForRest() {\n return 0;\n }", "title": "" }, { "docid": "3d8224ba7af400fa505ecdfef30e5a6a", "score": "0.5074198", "text": "offsetLines(line, lineOffset) {\n if (line < 1 || line + lineOffset < 1) {\n throw new Error('Line has to be positive');\n }\n\n if (lineOffset === 0) {\n return;\n }\n\n this.sourceMapInstance.offsetLines(line - 1, lineOffset);\n }", "title": "" }, { "docid": "68d30cdd5186de3e45a1a3873ea1bab6", "score": "0.50725", "text": "function foo() {\r\n var this_is_line_with_extra_spaces = true;\r\n}", "title": "" }, { "docid": "fcf17a70a6cc067a30efea40e2be6c1a", "score": "0.5066991", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token, initial, offset, ch, posAfterColon, start = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) {\n return false;\n }\n if (state.src.charCodeAt(start) !== 91 /* [ */) {\n return false;\n }\n if (state.src.charCodeAt(start + 1) !== 94 /* ^ */) {\n return false;\n }\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 32) {\n return false;\n }\n if (state.src.charCodeAt(pos) === 93 /* ] */) {\n break;\n }\n }\n if (pos === start + 2) {\n return false;\n }\n // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 58 /* : */) {\n return false;\n }\n if (silent) {\n return true;\n }\n pos++;\n if (!state.env.footnotes) {\n state.env.footnotes = {};\n }\n if (!state.env.footnotes.refs) {\n state.env.footnotes.refs = {};\n }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[\":\" + label] = -1;\n token = new state.Token(\"footnote_reference_open\", \"\", 1);\n token.meta = {\n label: label\n };\n token.level = state.level++;\n state.tokens.push(token);\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n if (isSpace(ch)) {\n if (ch === 9) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n pos++;\n }\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = \"footnote\";\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n state.md.block.tokenize(state, startLine, endLine, true);\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n token = new state.Token(\"footnote_reference_close\", \"\", -1);\n token.level = --state.level;\n state.tokens.push(token);\n return true;\n }", "title": "" }, { "docid": "d6b63f9712db59581788b7405f011e24", "score": "0.5059439", "text": "shouldAddExtraNewlineElement() {\n return /\\n\\n$/.test(this.block.toString());\n }", "title": "" }, { "docid": "3c24f49092bc6502ffb764a194094eb7", "score": "0.5058636", "text": "makeCodemarkData (callback) {\n\t\t// remove the commit hash from the data to use in creating the codemark\n\t\t// also remove the stream ID, making the statement that we are not associating the marker with a stream at all\n\t\tsuper.makeCodemarkData(() => {\n\t\t\tconst marker = this.data.markers[0];\n\t\t\tdelete marker.commitHash;\n\t\t\tdelete marker.fileStreamId;\t\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "45900372ad005c787bd00521b6d6f695", "score": "0.50568515", "text": "function markDTXLines(lines){\n\tlet markedIndexes = [];\n\tlet arrayOpen = false;\n\n\t// Searching for our Properties - They will be removed\n\tfor(let i = 0; i < lines.length; i++){\n\t\tlet key = parseKeyFromPlist(lines[i]);\n\t\tif(key !== -1){\n\t\t\tif(checkIfKeyIsArray(key)){\n\t\t\t\tmarkedIndexes.push(i);\n\t\t\t\tarrayOpen = true;\n\t\t\t}else{\n\t\t\t\t// Property found which is ours\n\t\t\t\tmarkedIndexes.push(i);\n\t\t\t\tmarkedIndexes.push(i+1);\n\t\t\t}\n\t\t}else if(arrayOpen){\n\t\t\t// Mark every line of the array\n\t\t\tmarkedIndexes.push(i);\n\t\t\tif(lines[i].indexOf(\"</array>\") > -1){\n\t\t\t\t// End of Array\n\t\t\t\tarrayOpen = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn markedIndexes;\n}", "title": "" }, { "docid": "19d066487e79959bdd680af5f174f673", "score": "0.5054728", "text": "addEndOfMessageMarker() {\n return this.parser.write(this.parser.endOfMessageMarker);\n }", "title": "" }, { "docid": "53cdb3d4616b1d7711ec759ab9001540", "score": "0.5054107", "text": "function startLine(token) {\n return token.startLine || token.line;\n }", "title": "" }, { "docid": "53cdb3d4616b1d7711ec759ab9001540", "score": "0.5054107", "text": "function startLine(token) {\n return token.startLine || token.line;\n }", "title": "" }, { "docid": "53cdb3d4616b1d7711ec759ab9001540", "score": "0.5054107", "text": "function startLine(token) {\n return token.startLine || token.line;\n }", "title": "" }, { "docid": "53cdb3d4616b1d7711ec759ab9001540", "score": "0.5054107", "text": "function startLine(token) {\n return token.startLine || token.line;\n }", "title": "" }, { "docid": "53cdb3d4616b1d7711ec759ab9001540", "score": "0.5054107", "text": "function startLine(token) {\n return token.startLine || token.line;\n }", "title": "" }, { "docid": "7799ba5046b4cb3c5058be4bf69064de", "score": "0.50499684", "text": "function addLine() {\n if (gMeme.txts[2]) return;\n var newLine = {\n size: 1.5, align: 'left', color: 'white',\n font: 'Lato', shadow: false, positionX: 130, positionY: 250,\n }\n gMeme.txts.push(newLine)\n}", "title": "" }, { "docid": "77bcfbc4c460d943c6d8c258b30aab23", "score": "0.5045469", "text": "function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }", "title": "" }, { "docid": "020c535ffed381ccd231bf3babafd2ab", "score": "0.5043282", "text": "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "cc0fc15aae3a02dff3697a3086faeff9", "score": "0.50411445", "text": "function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }", "title": "" }, { "docid": "fa21f7746cb557b7907490018419f492", "score": "0.50350386", "text": "process(callback) {\n let header = '';\n let beginning = [];\n\n let x = 0;\n lineReader.eachLine(this.file.path, (line) => {\n if (!x) {\n header = line;\n } else {\n beginning.push(line);\n\n if (x >= 5) {\n callback({header, beginning});\n return false;\n }\n }\n\n x++;\n });\n }", "title": "" }, { "docid": "2276b985f54e128ef2139ad25c4366bd", "score": "0.5032095", "text": "function generateLineClass(source, stream, linestart, lineerror, position) {\n\t\tvar className = \"\";\n\t\tif (position >= linestart && position <= stream.position) {\n\t\t\tif (lineerror) {\n\t\t\t\tclassName = \"eden-currentline eden-errorline\";\n\t\t\t} else {\n\t\t\t\tclassName = \"eden-currentline\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (lineerror) {\n\t\t\t\tclassName = \"eden-line eden-errorline\";\n\t\t\t} else {\n\t\t\t\tif (stream.code.charAt(linestart) == \"#\") {\n\t\t\t\t\tclassName = \"eden-commentline\";\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"eden-line\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//console.log(source.ast.lines[source.line-1]);\n\t\tif (source.ast.lines[source.line-1]) {\n\t\t\tif (source.ast.lines[source.line-1].executed == 1) {\n\t\t\t\tclassName += \" eden-executedline\";\n\t\t\t} else if (source.ast.lines[source.line-1].executed == 2) {\n\t\t\t\tclassName += \" eden-guardedline\";\n\t\t\t}\n\t\t} else if (source.ast.lines[source.line-1] === undefined && source.line-1 > 0 && source.ast.lines[source.line-1-1] && source.ast.lines[source.line-1-1].parent) {\n\t\t\tif (source.ast.lines[source.line-1-1].executed == 1) {\n\t\t\t\tclassName += \" eden-executedline\";\n\t\t\t} else if (source.ast.lines[source.line-1-1].executed == 2) {\n\t\t\t\tclassName += \" eden-guardedline\";\n\t\t\t}\n\t\t}\n\t\treturn className;\n\t}", "title": "" }, { "docid": "10ba5fe50dada958ccb97239c2fe04bf", "score": "0.50250995", "text": "function shouldInsertEmptyLineAfter(node){var originalText=options.originalText;var nextCharIndex=getNextNonSpaceNonCommentCharacterIndex$2(originalText,node,options);var nextChar=originalText.charAt(nextCharIndex);// if it is cut off by a parenthesis, we only account for one typed empty\n// line after that parenthesis\nif(nextChar==\")\"){return isNextLineEmptyAfterIndex$1(originalText,nextCharIndex+1,options);}return isNextLineEmpty$4(originalText,node,options);}", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.50158507", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.50158507", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.50158507", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "a5419877df922f3daae750caf1164b1a", "score": "0.50142384", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "08865c56aaa835afac48588e75cec242", "score": "0.50110424", "text": "function highlightLine (line, lbl) {\n highlightBlock(line,0,line+1,0,lbl);\n}", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.5009927", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.5009927", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" }, { "docid": "48be0a162f210935848f1ba781330dc8", "score": "0.5009927", "text": "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "title": "" } ]
0c682bcb5397c06280e80924658aaa3c
Jest expect handles the assertions
[ { "docid": "630f27ba36c0a0e7c971ddcaf27ccd8c", "score": "0.63940066", "text": "async expect(step) {\n // destructure assertion components\n let { subject, matcher, value } = step;\n\n // if no subject or matcher, ignore assertion, resolve early\n if (!subject || !matcher) {\n return Promise.resolve();\n }\n\n // extract the subject path from response\n // works for dotted notation i.e. response.headers.content-type\n let context = this.response;\n\n switch (step.context) {\n case \"document\":\n context = this.page;\n break;\n case \"metrics\":\n context = this.metrics;\n break;\n case \"resource\":\n context = this.resources;\n break;\n }\n\n if (step.context !== \"document\") {\n // split object notation\n subject = subject.split(\".\").reduce((o, i) => o[i], context);\n } else {\n subject = await this.getSubject(subject);\n }\n\n return new Promise((resolve, reject) => {\n // run the Jest test\n // console.log(subject, matcher, value);\n try {\n // check for negation\n if (matcher.startsWith(\"not.\")) {\n // remove the not.\n matcher = matcher.replace(\"not.\", \"\");\n // pass the context for custom matchers\n if (matchers[matcher]) {\n expect(subject).not[matcher](context, value);\n } else {\n expect(subject).not[matcher](value);\n }\n } else {\n if (matchers[matcher]) {\n expect(subject)[matcher](context, value);\n } else {\n expect(subject)[matcher](value);\n }\n }\n // resolve\n resolve();\n } catch (e) {\n // reject\n reject(e.message);\n }\n });\n }", "title": "" } ]
[ { "docid": "286e957b664145235f2c34b382439ffc", "score": "0.65252256", "text": "verify() {\n assert.strictEqual(this.queryIdx + 1, this.expectations.length,\n `not all queries executed[${this.queryIdx + 1}] - expected[${this.expectations.length}]`);\n }", "title": "" }, { "docid": "ed0b29573fe3b17fe9ea2db77dd2c682", "score": "0.6511359", "text": "function expect(t, expected) {\n var results = [];\n return result => {\n results.push(result);\n if (results.length === expected.length) {\n assert_array_equals(results, expected);\n t.done();\n }\n };\n}", "title": "" }, { "docid": "ca85604e6683d2da350873b1d4c40074", "score": "0.6492146", "text": "function expect(t, expected) {\n var results = [];\n return (result) => {\n results.push(result);\n if (results.length === expected.length) {\n assert_array_equals(results, expected);\n t.done();\n }\n };\n}", "title": "" }, { "docid": "ace3bf358de46eb9ebdf3a802ee4f35e", "score": "0.64889646", "text": "function expect(asserts) {\n\t_config.expected = asserts;\n}", "title": "" }, { "docid": "eb009ae010c5346290fe5c83299b9533", "score": "0.62862486", "text": "function assertExpectations({assertion, actual, expectations, message, prefix, stack}) {\n if (!isError(actual)) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [formatWithLabel(`${prefix} exception that is not an error:`, actual)],\n });\n }\n\n if (hasOwnProperty(expectations, 'is') && actual !== expectations.is) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected to be strictly equal to:', expectations.is),\n ],\n });\n }\n\n if (expectations.instanceOf && !(actual instanceof expectations.instanceOf)) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected instance of:', expectations.instanceOf),\n ],\n });\n }\n\n if (typeof expectations.name === 'string' && actual.name !== expectations.name) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected name to equal:', expectations.name),\n ],\n });\n }\n\n if (typeof expectations.message === 'string' && actual.message !== expectations.message) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected message to equal:', expectations.message),\n ],\n });\n }\n\n if (expectations.message instanceof RegExp && !expectations.message.test(actual.message)) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected message to match:', expectations.message),\n ],\n });\n }\n\n if (typeof expectations.code !== 'undefined' && actual.code !== expectations.code) {\n throw new AssertionError({\n assertion,\n message,\n stack,\n values: [\n formatWithLabel(`${prefix} unexpected exception:`, actual),\n formatWithLabel('Expected code to equal:', expectations.code),\n ],\n });\n }\n}", "title": "" }, { "docid": "55d0b3179ec7bb3f71858afb7f56011c", "score": "0.6281241", "text": "function expect(target) {\n return {\n toBe: function(expectation) {\n if (target === expectation) {\n console.log('\\n %cPASSED', 'color:green;', 'Expected', target, 'to be', expectation );\n return true;\n } else {\n console.log('\\n %cFAILED', 'color:red;', 'Expected', target, 'to be', expectation );\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "61f6fee4c5929d4f026cb1169126c31c", "score": "0.6266457", "text": "function assertEqual(actual, expected) {\n ;\n}", "title": "" }, { "docid": "9d8e98c9bf7ad0bd9707056c1e6a9b9e", "score": "0.62330514", "text": "function assert(actual, expected){\n if(actual !== expected){\n //run if failed\n throw {type: 'fail', details:{actual: actual, expected: expected}};\n } else{\n //run if succesful\n console.log ('Success', {type: 'test passed', details: {actual: actual, expected: expected}});\n }\n}", "title": "" }, { "docid": "4da2bbe324c6b7cddf258d5a043f0901", "score": "0.61205167", "text": "checkRowValues(row, expected) {\n\t\tthis.nextDueDate(row).should.eventually.equal(expected.nextDueDate);\n\t\tthis.isAutoEntered(row).should.eventually.equal(Boolean(expected.isAutoEntered));\n\t\tthis.primaryAccountName(row).should.eventually.equal(expected.primaryAccountName);\n\t\tif (expected.payeeName) {\n\t\t\tthis.payeeName(row).should.eventually.equal(expected.payeeName);\n\t\t}\n\t\tif (expected.securityName) {\n\t\t\tthis.securityName(row).should.eventually.equal(expected.securityName);\n\t\t}\n\t\tthis.categoryName(row).should.eventually.equal(expected.categoryName);\n\t\tif (expected.subcategoryName) {\n\t\t\tthis.subcategoryName(row).should.eventually.equal(expected.subcategoryName);\n\t\t}\n\t\tif (expected.accountName) {\n\t\t\tthis.accountName(row).should.eventually.equal(expected.accountName);\n\t\t}\n\t\tif (expected.subtransactions && expected.subtransactions.length > 0) {\n\t\t\tthis.toggleSubtransactionsButton(row).isPresent().should.eventually.equal(Boolean(expected.subtransactions));\n\t\t}\n\t\tif (expected.memoFromInvestmentDetails) {\n\t\t\tthis.memo(row).should.eventually.equal(expected.memoFromInvestmentDetails);\n\t\t} else {\n\t\t\tthis.memo(row).should.eventually.equal(expected.memo);\n\t\t}\n\t\tif (expected.investmentDetails) {\n\t\t\tthis.investmentDetails(row).should.eventually.equal(expected.investmentDetails);\n\t\t}\n\t\tif (!expected.memoFromInvestmentDetails && !expected.memo && expected.commission) {\n\t\t\tthis.commission(row).should.eventually.equal(expected.commission);\n\t\t}\n\t\tthis.frequency(row).should.eventually.equal(expected.frequency);\n\t\tif (expected.debitAmount) {\n\t\t\tthis.debitAmount(row).should.eventually.equal(expected.debitAmount);\n\t\t}\n\t\tif (expected.creditAmount) {\n\t\t\tthis.creditAmount(row).should.eventually.equal(expected.creditAmount);\n\t\t}\n\t}", "title": "" }, { "docid": "7eafdf96f60902200780b7db877d4d7d", "score": "0.5998267", "text": "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n }", "title": "" }, { "docid": "7eafdf96f60902200780b7db877d4d7d", "score": "0.5998267", "text": "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n }", "title": "" }, { "docid": "7eafdf96f60902200780b7db877d4d7d", "score": "0.5998267", "text": "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n }", "title": "" }, { "docid": "f8cad110f3f810e3a368ce2f16f5de2b", "score": "0.5992728", "text": "function expect(actual) {\n function toEqual(expected) {\n if (actual != expected) {\n throw new Error(`Expected ${expected} but got ${actual}`)\n }\n }\n\n function toBe(expected) {\n if (actual !== expected) {\n throw new Error(`Expected ${expected} but got ${actual}`)\n }\n }\n\n function toInclude(expected) {\n if(actual.includes(expected) === false) {\n throw new Error(`Expected ${actual} to include ${expected}`)\n }\n }\n\n function toBeEmpty() {\n if(actual.length > 0) {\n throw new Error(`Expected ${actual} to be empty but it has a length of ${actual.length}`)\n }\n }\n\n function toThrowError(message) {\n if (typeof actual != 'function') {\n throw new Error (`${actual} is not a function, pass it as 'function() {code}'`)\n }\n try {\n actual();\n var nothingThrown = true;\n } catch(e) {\n if(e.message !== message) {\n throw new Error(`Expected Error.message to be ${message} but got ${e.message}`)\n }\n }\n if(nothingThrown === true) {\n throw new Error(`Expected ${actual} to throw Error(${message}) but nothing was thrown`);\n };\n };\n\n function not() {\n function toEqual(expected) {\n if (actual == expected) {\n throw new Error(`Expected ${expected} not to equal ${actual}`)\n }\n }\n\n function toBe(expected) {\n if (actual === expected) {\n throw new Error(`Expected ${expected} not to be ${actual}`)\n }\n }\n\n function toInclude(expected) {\n if(actual.includes(expected) === true) {\n throw new Error(`Expected ${actual} not to include ${expected}`)\n }\n }\n\n function toBeEmpty() {\n if(actual.length === 0) {\n throw new Error(`Expected ${actual} not to be empty but it is`)\n }\n }\n\n function toThrowError() {\n if (typeof actual != 'function') {\n throw new Error (`${actual} is not a function, pass it as 'function() {code}'`)\n }\n try {\n actual();\n } catch(e) {\n throw new Error(`Expected ${actual} not to throw error but got ${e.message}`)\n }\n }\n\n return {\n toEqual,\n toBe,\n toInclude,\n toBeEmpty,\n toThrowError,\n }\n }\n\n return {\n toEqual,\n toBe,\n toInclude,\n toBeEmpty,\n toThrowError,\n not\n }\n }", "title": "" }, { "docid": "32ef6e8024090119cc35b9b99e57cd9c", "score": "0.5979774", "text": "function assertEqual(actual, expected) {\n // basic assert.equal comparison according to https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message\n if (actual == expected) { return } // eslint-disable-line eqeqeq\n // also handle arrays for convenience\n if (Array.isArray(actual) && Array.isArray(expected)) {\n assert.strictEqual(actual.length, expected.length, \"Arrays have different lengths, supplied wrong number of expected values!\")\n actual.forEach((a, i) => assertEqual(a, expected[i]))\n return\n }\n // use BigNumber's own comparator\n if (BN.isBN(expected)) {\n //assert.strictEqual(actual.cmp(expected), 0)\n assert.strictEqual(actual.toString(), expected.toString())\n return\n }\n // convert BigNumbers if expecting a number\n // NB: there's a reason BigNumbers are used! Keep your numbers small!\n // if the number coming back from contract is big, then expect a BigNumber to avoid this conversion\n if (typeof expected === \"number\") {\n assert.strictEqual(+actual, +expected)\n return\n }\n // convert hex bytes to string if expected thing looks like a string and not hex\n if (typeof expected === \"string\" && Number.isNaN(+expected) && !Number.isNaN(+actual)) {\n assert.strictEqual(web3.toUtf8(actual), expected)\n return\n }\n // fail now with nice error if didn't hit the filters\n assert.equal(actual, expected)\n}", "title": "" }, { "docid": "a8ec11e40a5463d76d8166d87b453853", "score": "0.5968784", "text": "assertEquals(expected, actual) {\n if (expected == actual) {\n return;\n }\n this.reportFailure(`Expected ${expected} but got ${actual}.`);\n }", "title": "" }, { "docid": "eca9e7a2e875f85a96dd4b38c17fcdd9", "score": "0.59190905", "text": "function test(actual, expected) {\n if (JSON.stringify(actual) === JSON.stringify(expected)) {\n console.log(\"Yay! Test PASSED.\");\n } else {\n console.error(\"Test FAILED. Keep trying!\");\n console.log(\" actual: \", actual);\n console.log(\" expected: \", expected);\n console.trace();\n }\n}", "title": "" }, { "docid": "23c9b3c79c15d1d93bf39f23a27c294a", "score": "0.588551", "text": "testAreSame() {\n this.areSame(1, 1);\n this.areSame('1', '1');\n this.hasException(() => this.areSame(0, 1));\n this.hasException(() => this.areSame(1, '1'));\n this.hasException(() => this.areSame(true, false));\n }", "title": "" }, { "docid": "abb7170194c94ddc389b7852eb7ffa2c", "score": "0.5885234", "text": "function assertEqual(actual, expected, testName) {\r\n if (actual === expected) {\r\n console.log('passed');\r\n return;\r\n }\r\n console.log(`FAILED [${testName}] Expected all array index's to be ${expected} but got at least one ${actual}`);\r\n return;\r\n}", "title": "" }, { "docid": "2a12f62e89fca19ddac94e8ee0e6fd6c", "score": "0.58750284", "text": "function assertStrictEqual(actualValue, expectedValue) {\n if (expectedValue === actualValue) {\n console.log(`✓ Test passed`);\n } else {\n throw new Error(`✖ expected ${expectedValue}, got ${actualValue}`);\n }\n}", "title": "" }, { "docid": "9669d2a7b79fdd400e7a41ec7c75d6ef", "score": "0.5872932", "text": "function test(name, args, expectation, inPlace) {\n\n var func = modules[name],\n check = assert.equal,\n result\n\n if (inPlace) {\n result = args[0]\n func(result)\n } else {\n result = func.apply(null, args)\n }\n\n if (typeof expectation === \"object\")\n check = assert.deepEqual\n\n try {\n check(result, expectation)\n } catch(e) {\n\n console.warn(\"\\n\" + name + \" test failed!\")\n console.warn(\"Returned value:\", e.actual)\n console.warn(\"Expected value:\", e.expected)\n\n }\n\n}", "title": "" }, { "docid": "3a4ac0336278776c3fa09b6aa8a9fa54", "score": "0.5796463", "text": "function assertEquals(x, y) { }", "title": "" }, { "docid": "98532cd513d6480969b8090872451cf4", "score": "0.57737476", "text": "toBeApproximately(...args) {\n // If called asymmetrically, a fake matcher `this` object needs to be passed\n // in (see https://github.com/facebook/jest/issues/8295). There's no effect\n // because it's only used for the printing of full failures, which isn't\n // done for asymmetric matchers anyways.\n const thisObj = (this && this.utils) ? this :\n {isNot: false, promise: ''};\n\n return toBeCloseTo.call(thisObj, ...args);\n }", "title": "" }, { "docid": "9ebdaba8cc2fd263ef800354ddad5afe", "score": "0.57610124", "text": "function expectObjOk(obj) {\n\t\t\texpect(obj[open][close]).to.equal(obj);\n\t\t\texpect(obj[open]).to.be.instanceof(Block);\n\t\t\texpect(obj[open].arg).to.equal(obj);\n\t\t}", "title": "" }, { "docid": "97e5540613766a270926e26444331216", "score": "0.57380384", "text": "function assertEqual(actual, expected, msg) {\n actual != expected && throwError(msg);\n }", "title": "" }, { "docid": "64ca33fe52493aea987f4dd051e3c407", "score": "0.57259214", "text": "function testEqual (actual, expected) {\n console.log(`${actual === expected}, actual: ${actual}, expected: ${expected}`);\n}", "title": "" }, { "docid": "485dfb17bc5c2ee3185e29a12c7cd9e1", "score": "0.5722045", "text": "function assertMatch(actual, expected, msg) {\n if (!expected.test(actual)) {\n if (!msg) {\n msg = `actual: \"${actual}\" expected to match: \"${expected}\"`;\n }\n throw new AssertionError(msg);\n }\n }", "title": "" }, { "docid": "91324af17f268e431cae47d3401d4dab", "score": "0.5719133", "text": "static assertEquals(expected, actual){\r\n\t\tif(expected!=actual){\r\n\t\t\tthrow \"FAIL: '\"+actual+\"' is not equal to expected '\"+expected+\"'\";\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5ad8d338548d9c7db6184170cc430738", "score": "0.5696111", "text": "assertExpectationsMet() {\n assert_equals(this.expectedWrites_.length, 0);\n assert_equals(this.expectedGetFeatureReports_.length, 0);\n assert_equals(this.expectedSendFeatureReports_.length, 0);\n }", "title": "" }, { "docid": "e71de531dbc48160930b9787a4c1bdbf", "score": "0.56925136", "text": "function methodTests() {\n expect(1 + 1).to.equal(2);\n expect(1 + 1).to.not.equal(3);\n expect(1 + 1).not.to.equal(3);\n expect([1, 2]).to.deep.equal([1, 2]);\n expect([1, 2]).to.not.deep.equal([2, 1]);\n expect([]).is.an.instanceof(Array);\n expect([]).to.be.an.instanceof(Array);\n expect(1).to.be.oneOf([2, 1]);\n expect([1, 2]).to.contain(1);\n expect([1, 2]).to.have.lengthOf(2);\n}", "title": "" }, { "docid": "37751aef4aab0aba7203ed458d46f6bd", "score": "0.5660254", "text": "function assertEquals(actual, expected, msg) {\n if (equal(actual, expected)) {\n return;\n }\n let message = \"\";\n const actualString = format(actual);\n const expectedString = format(expected);\n try {\n const diffResult = diff_ts_1.default(\n actualString.split(\"\\n\"),\n expectedString.split(\"\\n\"),\n );\n const diffMsg = buildMessage(diffResult).join(\"\\n\");\n message = `Values are not equal:\\n${diffMsg}`;\n } catch (e) {\n message = `\\n${colors_ts_2.red(CAN_NOT_DISPLAY)} + \\n\\n`;\n }\n if (msg) {\n message = msg;\n }\n throw new AssertionError(message);\n }", "title": "" }, { "docid": "6472036f8fb91dd146f95df8dafbcf75", "score": "0.566008", "text": "function testEquals(name, expected, actual) {\r\r\n try {\r\r\n assert.equal(expected, actual);\r\r\n console.log(`V\\t ${name}`);\r\r\n } catch (err) {\r\r\n console.log(`X\\t ${name}: expected: ${expected} but was ${actual}`);\r\r\n }\r\r\n}", "title": "" }, { "docid": "b40acf864cde5ab36a8ac0abbd84fbdc", "score": "0.56500846", "text": "function expectTransform (script) {\n const {code} = transform(script, {\n plugins: [transformRequire]\n });\n\n return {\n toReturn(expectedValue) {\n expect(code).toEqual(expectedValue);\n return this;\n },\n };\n}", "title": "" }, { "docid": "4ac39a0b0138d5aba1d6081488cde3cf", "score": "0.56423855", "text": "function expect(expected, message) {\n return chrome.test.callbackPass(function(value) {\n chrome.test.assertEq(expected, value, message);\n });\n}", "title": "" }, { "docid": "8f0d893e154be82d1b9adc72611b7b39", "score": "0.56232816", "text": "function assertMatch(actual, expected, msg) {\n if (!expected.test(actual)) {\n if (!msg) {\n msg = `actual: \"${actual}\" expected to match: \"${expected}\"`;\n }\n throw new AssertionError(msg);\n }\n }", "title": "" }, { "docid": "650f5a50df34a80ce66acf9ea392f554", "score": "0.5604761", "text": "function suite(){ \n var user;\n\n before(function(){\n user = new User('Bubucela', '24.144.222-0', 'Casa 123', '4563212');\n });\n\n const getEmpty = allure.createStep(\"Paso 0 - Consulta datos vacios\", async (done) => {\n \n expect('').to.be.empty;\n });\n\n const getUser = allure.createStep(\"Paso 1 - Consultar usuarios\", async () => {\n let respuesta;\n const helloBubu = await axios.get('http://localhost:8080/users').then(res => respuesta = res);\n console.log('Respuesta Exitosa '+ respuesta.status);\n expect(respuesta.status).to.equal(200);\n });\n\n const addUserWithSucess = allure.createStep(\"Paso 2 - Agregar usuário de manera exitosa\", async (done) => {\n \n expect('').to.be.empty;\n await axios.post('http://localhost:8080/users', user).then(res => { \n expect(res.status).to.equal(200);\n done();\n })\n .catch(err => {\n throwError(err);\n done(err);\n }); \n });\n\n const addUserFailed = allure.createStep(\"Paso 3 - Validar usuario previamente agregado\", async (done) => {\n await axios.post('http://localhost:8080/users', user).then(res => { \n expect(res.status).to.equal(200);\n console.log('STATUS'+res.status)\n done();\n })\n .catch(err => {\n console.log('ERROR: STATUS'+err)\n done(err);\n throwError(err);\n });\n });\n\n const throwError = allure.createStep(\"Detalle del test erroneo\", (err) => {\n throw new Error(err);\n });\n \n it('Consulta json vacio', async function()\n {\n getEmpty();\n });\n\n it('Consulta exitosa de usuarios', async function()\n {\n getUser();\n });\n \n it('Validar Usuario Agregado Exitosamente', function(done)\n {\n addUserWithSucess(done); \n });\n\n it('Validar Usuario Agregado Previamente', function(done)\n {\n addUserFailed(done);\n });\n\n}", "title": "" }, { "docid": "b82c6682a0517a9b928b89d274c2b626", "score": "0.5582613", "text": "function assertEquals(expected, actual) {\n if (expected != actual) {\n throw `Expected ${expected}, received ${actual}`;\n }\n}", "title": "" }, { "docid": "66ea94d8981511cd81a5f4befd508916", "score": "0.55785275", "text": "_assert(actual, expected, key, ignoreDiff = false, isType = false) {\n const me = this;\n key = key || constant.rootKey;\n\n if (me._isIgnoreKey(key)) {\n return true;\n }\n\n let actualKeys = _.keys(actual);\n let expectedKeys = _.keys(expected);\n let missingKeysInActual = _.clone(actualKeys);\n\n let actualIgnoreKeys = _.intersection(me.ignoreKeys, actualKeys);\n let expectedIgnoreKeys = _.intersection(me.ignoreKeys, expectedKeys);\n\n //Delete ignored common keys from actual data\n _.each(actualIgnoreKeys, function (actIgnoreKey) {\n delete actual[actIgnoreKey];\n })\n\n //Delete ignored common keys from expected data\n _.each(expectedIgnoreKeys, function (expIgnoreKey) {\n delete expected[expIgnoreKey];\n })\n\n if (_.isArray(expected)) {\n return me._assertArray(actual, expected, key, isType);\n } else if (me._isJSON(expected)) {\n let assertion = true;\n //If the data is JSON, iterate for each key present in expected data and assert recursively\n _.each(expectedKeys, (expectKey) => {\n if (typeof actual[expectKey] == typeof expected[expectKey]) {\n if (me._isJSON(actual[expectKey])) {\n assertion = me._assert(actual[expectKey], expected[expectKey], key + \".\" + expectKey, ignoreDiff, isType) && assertion;\n } else if (_.isArray(actual[expectKey])) {\n assertion = me._assertArray(actual[expectKey], expected[expectKey], key + \".\" + expectKey, isType) && assertion;\n } else if(_.isString(actual[expectKey])) {\n return me._assertString(actual[expectKey], expected[expectKey], key + \".\" + expectKey, ignoreDiff, isType) && assertion;\n } else {\n assertion = me._chaiDeepEqual(actual[expectKey], expected[expectKey], key + \".\" + expectKey, ignoreDiff, isType) && assertion;\n }\n } else {\n assertion = me._chaiDeepEqual(actual[expectKey], expected[expectKey], key + \".\" + expectKey, ignoreDiff, isType) && assertion;\n }\n //remove the key from array to get the list disjoint keys in actual and expected data\n me._removeFromArray(missingKeysInActual, missingKeysInActual.indexOf(expectKey));\n })\n //Assert the missing keys in actual keys only for Full JSON Assertion\n if (!me.jsonContains) {\n _.each(missingKeysInActual, function (missingKey) {\n assertion = me._chaiDeepEqual(actual[missingKey], expected[missingKey], key + \".\" + missingKey, ignoreDiff, isType) && assertion;\n })\n }\n return assertion;\n } else if(_.isString(expected)) {\n return me._assertString(actual, expected, key, ignoreDiff, isType);\n } else {\n return me._chaiDeepEqual(actual, expected, key, ignoreDiff, isType);\n }\n }", "title": "" }, { "docid": "ae92e1994ca6cb5747108161491499e0", "score": "0.55728227", "text": "function expect(actual) {\n\treturn {\n\t\ttoBe(expected) {\n\t\t\tif (actual !== expected) {\n\t\t\t\tthrow new Error(`${actual} is not equal to ${expected}`);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "000c8f85d4589ceb6428a3d1b7467d44", "score": "0.55657136", "text": "function check(name, message, expected, actual) {\n it(name, function () {\n var e = new AssertionError(message, expected, actual)\n\n checkValue(e, \"message\", message)\n checkValue(e, \"expected\", expected, true)\n checkValue(e, \"actual\", actual, true)\n })\n }", "title": "" }, { "docid": "26391acad68df336b60e8d1bac2f6bf8", "score": "0.55613", "text": "function assertObjectsEqual (actual, expected, testName) {\n actual = JSON.stringify(actual);\n expected = JSON.stringify(expected);\n \n if (actual === expected) { \n console.log('passed'); \n } else {\n console.log('FAILED [' + testName + '] expected ' + expected + ', but got ' + actual)\n; }\n}", "title": "" }, { "docid": "3653738de425df510ece223343d3937b", "score": "0.55580944", "text": "function expectEqualTimestamp(start, end) {\n\t\t\texpect(moment(start).toString()).toEqual(moment(end).toString());\n\t\t}", "title": "" }, { "docid": "a44cd7179d29cb29e7864f9ef3e20182", "score": "0.5545256", "text": "function expect(p) {\n return action(p, function (ast) {\n return undefined;\n });\n}", "title": "" }, { "docid": "fd672ee88aeb42e9240913143ce77fb4", "score": "0.55447096", "text": "function assertMsg(assertion, msg) {\n if (assertion) {\n testPassed(msg);\n } else {\n testFailed(msg);\n }\n}", "title": "" }, { "docid": "a53bbd34eb6765e40c8d77c2bc23d009", "score": "0.55368394", "text": "function assert(actual, testName) {\n if ( actual !== true ) {\n console.log('FAILED [' + testName + '] Expected \"' + expected + '\" to be true.');\n } else {\n console.log('PASSED [' + testName + ']');\n }\n}", "title": "" }, { "docid": "99b67821c9842ef45c9a52c8a07418af", "score": "0.5533152", "text": "function make_expect(fn) {\n\tlet result;\n\tconst shim = {expect: function(expected) {\n\t\tif (!expected(this.result))\n\t\t\tconsole.error(`${JSON.stringify(this.args)\n\t\t\t}\\n ${expected.toString()\n\t\t\t} (failed); [unexpected result ${\n\t\t\tJSON.stringify(this.result)}]`);\n\t\treturn this;\n\t}};\n\treturn (...args) => {\n\t\tshim.args = args;\n\t\tshim.result = fn(...args);\n\t\treturn shim;\n\t};\n}", "title": "" }, { "docid": "a51a2de99c1ede8b4a0a701aa73e849c", "score": "0.5530647", "text": "function assertSomething() {\n // Undo the flags set by the `something` chain property\n var somethingFlags = utils.flag(this, \"something\");\n utils.flag(this, \"something\", false);\n utils.flag(this, \"negate\", somethingFlags.negate);\n\n // The assertion's object for `something` should be array-like\n var object = utils.flag(this, \"object\");\n expect(object).to.have.property(\"length\");\n expect(object.length).to.be.a(\"number\", \"something object length\");\n\n // The object should contain something\n this.assert(object.length > 0,\n \"expected #{this} to contain something\",\n \"expected #{this} not to contain something\"\n );\n }", "title": "" }, { "docid": "7d71ff9d2a664bf2a657562ba79a1881", "score": "0.55300784", "text": "testAreEquals() {\n this.areEquals(1, 1);\n this.areEquals(1, '1');\n this.areEquals(1, true);\n this.areEquals(0, false);\n this.hasException(() => this.areEquals(1, 0));\n this.hasException(() => this.areEquals(1, '0'));\n this.hasException(() => this.areEquals(1, false));\n this.hasException(() => this.areEquals(0, true));\n }", "title": "" }, { "docid": "887a0aea1dc15c35a3d37b724a65c58f", "score": "0.5487316", "text": "function tests() {\n // before\n before(function () {\n // mock a request\n this.request = new MockExpressRequest(testInputSettings);\n // mock a GET request\n this.getRequest = new MockExpressRequest({\n method: \"GET\",\n });\n // mock a response\n this.response = new MockExpressReponse();\n });\n // standardize input\n context(\"when no params sent\", () => {\n it(\"should error\", hasError);\n });\n context(\"when params sent\", () => {\n it(\"should have matching input\", hasInput);\n });\n}", "title": "" }, { "docid": "28004e1380090e924bc8238c6a734473", "score": "0.5485742", "text": "function exportChaiAsserts() {\n exports.assertTrue = assertTrue;\n exports.assertFalse = assertFalse;\n exports.assertGE = assertGE;\n exports.assertGT = assertGT;\n exports.assertEquals = assertEquals;\n exports.assertDeepEquals = assertDeepEquals;\n exports.assertLE = assertLE;\n exports.assertLT = assertLT;\n exports.assertNotEquals = assertNotEquals;\n exports.assertNotReached = assertNotReached;\n exports.assertThrows = assertThrows;\n}", "title": "" }, { "docid": "3a3f28276446b610105ca16f40ab7592", "score": "0.5477808", "text": "testSubmitHam() {\n it('should throw an error if the request has no \"akismet\" property', () =>\n assert.throws(() => new Server().submitHam({}, null))\n );\n }", "title": "" }, { "docid": "3d61f113be2181f4440ab68c55d7e709", "score": "0.5472023", "text": "function expectStringValue(actual, expected) {\n expect_1.expect(actual).to.equal(expected);\n}", "title": "" }, { "docid": "498459d21a90c3bd9672892b3324e35d", "score": "0.54655415", "text": "function _testThem(testobj){\n switch (testobj.argument.length) {\n /** in case of no arguments - throw Reference error */\n case 0 : {\n testobj.status = 'error';\n testobj.error = generateError(new RangeError(\"at least one argument expected\"));\n } break;\n /** if there is only one argument - continue */\n case 1 : {\n /** if first argument is not an Array - throw TypeError */\n if (typeOf(testobj.argument[0]) !== 'Array') {\n testobj.status = 'error';\n testobj.error = generateError(new TypeError(\"argument should be an array\"));\n } else {\n /** check elements of array to be true-like */\n for (var i in testobj.argument[0]) {\n if (!testobj.argument[0][i]) {\n testobj.status = 'fail';\n testobj.description = 'there are at least one false-like element';\n }\n }\n /** test passed if there are no false-like elements found */\n if (testobj.status !== 'fail') {\n testobj.status = 'pass';\n testobj.description = 'arguments are true-like';\n }\n }\n } break;\n /** otherwise throw Range error */\n default : {\n testobj.status = 'error';\n testobj.error = generateError(new RangeError(\"maximum of 1 arguments expected\"));\n }\n }\n }", "title": "" }, { "docid": "9fc7bb08ca61d9899e57b05db4fb878a", "score": "0.5461374", "text": "function assertEquals(arg1, arg2, msg) {\n\tassertTrue(equals(arg1, arg2), msg ? msg : \"Arguments asserted as equal but are not equal: \" + arg1 + \" vs \" + arg2);\n}", "title": "" }, { "docid": "9fc7bb08ca61d9899e57b05db4fb878a", "score": "0.5461374", "text": "function assertEquals(arg1, arg2, msg) {\n\tassertTrue(equals(arg1, arg2), msg ? msg : \"Arguments asserted as equal but are not equal: \" + arg1 + \" vs \" + arg2);\n}", "title": "" }, { "docid": "9d7f24d752864bc46e9431c4a7616dc8", "score": "0.5459133", "text": "function assertObjectsEqual(actual, expected, testName){\n let obj1 = JSON.stringify(actual);\n let obj2 = JSON.stringify(expected);\n return (obj1 == obj2)? 'PASSED': 'FAILED';\n}", "title": "" }, { "docid": "c1097cf24a6d4e5172c35d4656e29b80", "score": "0.54574287", "text": "function check() {\n if (person1 && person2) {\n expect(person1.value.name).to.equal('Jason');\n expect(person2.value.name).to.equal('Brock');\n done();\n }\n }", "title": "" }, { "docid": "aba4a814dbac8fa27ff858607bc63a61", "score": "0.54549927", "text": "function assert(exp,des){\r\n if(exp){\r\n console.log(\"test passed\");\r\n }\r\n else{\r\n console.log(des);\r\n }\r\n}", "title": "" }, { "docid": "15f067577a8c7e3645db8199697bd218", "score": "0.5454874", "text": "function assertStrictEqual(expected, saw) {\n assert.ok(expected === saw, 'expected: ' + expected + ' saw: ' + saw);\n}", "title": "" }, { "docid": "ea27c218aa819c6c1ee15caa8cde7ccf", "score": "0.5443597", "text": "function expect(testValue) {\n var errorMsg;\n\n function toBeDefined() {\n error = `Error: Expected \"${testValue}\" to be defined.`\n _processResults(testValue != void 0, error)\n }\n\n function toEqual(actual) {\n error = `Error: Expected \"${testValue}\" to equal \"${actual}\".`\n _processResults(actual === testValue, error)\n }\n\n function toNotEqual(actual) {\n error = `Error: Expected \"${testValue}\" to not equal \"${actual}\".`\n _processResults(actual !== testValue, error)\n }\n\n function toInclude(substring) {\n error = `Error: Expected \"${testValue}\" to include \"${substring}\".`\n _processResults(testValue.includes(substring), error)\n }\n\n function toHaveContent(content) {\n var element = document.querySelector(testValue).innerHTML;\n error = `Error: Expected \"${element}\" to include \"${content}\".`\n _processResults(element.includes(content), error)\n }\n\n return {\n toEqual: toEqual,\n toNotEqual: toNotEqual,\n toInclude: toInclude,\n toHaveContent: toHaveContent,\n toBeDefined: toBeDefined\n }\n}", "title": "" }, { "docid": "c350a9f345e15c2fafcec0fb1617be95", "score": "0.54388416", "text": "function testfunctioninsertuser(title,input_json)\n {\n it(title,(done)=>\n {\n test_functions.insertuser(input_json).then((result)=>{\n assert.equal(result,true)\n done()\n }).catch((error)=>{\n done(error)\n console.log(error)\n })\n })\n }", "title": "" }, { "docid": "551d5453e5a921a4c84aba7bd0dea001", "score": "0.5436366", "text": "function assertEqual(expr, val, msg)\n{\n if (expr == val)\n return;\n if (JSON.stringify(expr) == JSON.stringify(val))\n return;\n\n throw \"Assertion failure: \" + msg + \": \" + JSON.stringify(expr)\n + \" not equal to \" + JSON.stringify(val);\n}", "title": "" }, { "docid": "0e294e5cac95543decb4cf1959ef0c32", "score": "0.5429491", "text": "function assertEquals(a, b, desc) {\n if (a === b) {\n console.log(`${desc} ... PASS`);\n } else {\n console.log(`${desc} ... FAIL: ${a} != ${b}`);\n }\n}", "title": "" }, { "docid": "d9017ced13db6d5127552615a870aaf9", "score": "0.5427843", "text": "function assertEqual(actual, expected, testName) {\n if(actual === expected) {\n console.log(\"Passed\");\n } else {\n console.log(\"Test Failed...\");\n }\n}", "title": "" }, { "docid": "6f34798f6c80f63ca3fb7e5b157c3b40", "score": "0.5426372", "text": "function assertMatchAllEquals(expected, actual) {\n assertEquals(expected.done, actual.done);\n assertRegExpResultEquals(expected.value, actual.value);\n}", "title": "" }, { "docid": "a3b3a4bb8b727ab15d971f103b928847", "score": "0.5425931", "text": "function testEquality_15() {\n assertTrue(true == true);\n}", "title": "" }, { "docid": "7e5b2f1c9f4133a2f73a2055bb5d269c", "score": "0.54258555", "text": "function _testIt(testobj){\n switch (testobj.argument.length) {\n /** in case of no arguments - throw Reference error */\n case 0 : {\n testobj.status = 'error';\n testobj.error = generateError(new RangeError(\"at least one argument expected\"));\n } break;\n /** if there is only one argument - check it for truth */\n case 1 : {\n if (testobj.argument[0]) {\n testobj.description = 'argument is true-like';\n testobj.status = 'pass';\n } else {\n testobj.description = 'argument is false-like';\n testobj.status = 'fail';\n }\n } break;\n /** if there are two arguments - check equalence between them */\n case 2 : {\n if (typeOf(testobj.argument[0]) !== typeOf(testobj.argument[1])) {\n testobj.description = 'argument hase different types';\n testobj.status = 'fail';\n } else if (deepCompare(testobj.argument[0],testobj.argument[1])) {\n testobj.description = 'arguments are equal';\n testobj.status = 'pass';\n } else {\n testobj.description = 'argument are not equal';\n testobj.status = 'fail';\n }\n } break;\n /** otherwise throw Range error */\n default : {\n testobj.status = 'error';\n testobj.error = generateError(new RangeError(\"maximum of 2 arguments expected\"));\n }\n }\n }", "title": "" }, { "docid": "02977c9983e2fa0eb8f21f45c5be7fdd", "score": "0.5419973", "text": "function asserteq(expected, actual)\n{\n if ( expected !== actual )\n {\n throw new Error(`Expected ${expected}, received ${actual}`);\n }\n}", "title": "" }, { "docid": "c35884ec6d0ae9bd424d00930271a709", "score": "0.54162514", "text": "function ok(value,message){value||fail(value,!0,message,\"==\",assert.ok)}", "title": "" }, { "docid": "be531cbe161f7cdbe3999b53f80ed382", "score": "0.5415514", "text": "function onRead( error, actual ) {\n\t\t\texpect( error ).to.not.exist;\n\n\t\t\tfor ( var i = 0; i < expected.length; i++ ) {\n\t\t\t\tassert.strictEqual(\n\t\t\t\t\tactual[ i ],\n\t\t\t\t\texpected[ i ]\n\t\t\t\t);\n\t\t\t}\n\t\t\tdone();\n\t\t}", "title": "" }, { "docid": "d019b9a2b3bd4a6cb963a82c8bbaeecd", "score": "0.54096293", "text": "function assertEquals(expected, result) {\n if (expected === result) {\n console.log(chalk.green('el resultado esperado y recibido son iguales'));\n } else {\n console.log(chalk.red('el resultado esperado y recibido son diferentes'));\n }\n}", "title": "" }, { "docid": "11c0f81c807943ad24beb747bbbccfc0", "score": "0.5407849", "text": "function testFunction(actual, expected) {\n\tif (actual === expected) {\n\t\tconsole.log(\"Test passed\");\n\t} else {\n\t\tconsole.log(\"Test failed:\");\n\t\tconsole.log(\"Expected Result: \" + expected);\n\t\tconsole.log(\"Actual Result: \" + actual);\t\n\t}\n}", "title": "" }, { "docid": "1e5601c027798cb946607604c2cc30c1", "score": "0.5406253", "text": "function _expect (o, p, v) {\n if (!(p in o))\n this._error(\"expected \"+JSON.stringify(o)+\" to have a .\"+p);\n if (arguments.length > 2 && o[p] !== v)\n this._error(\"expected \"+o[o]+\" to equal .\"+v);\n }", "title": "" }, { "docid": "f9cc960710de4ee4ac41f0600a09b3c7", "score": "0.54013616", "text": "assertTextElement(el, expectedText){\n el.should('have.text', expectedText)\n }", "title": "" }, { "docid": "f9cc960710de4ee4ac41f0600a09b3c7", "score": "0.54013616", "text": "assertTextElement(el, expectedText){\n el.should('have.text', expectedText)\n }", "title": "" }, { "docid": "b558105946c49345f13c74340d209890", "score": "0.5395913", "text": "function assertObjectsEqual(actual, expected, testName){\r\n if(JSON.stringify(actual)===JSON.stringify(expected))\r\n {\r\n return \"passed\";\r\n }\r\n else\r\n {\r\n return 'FAILED [' + testName + '] Expected \"' + expected + '\", but got \"' + actual + '\"';\r\n }\r\n\r\n}", "title": "" }, { "docid": "62daf50198686c62109612ff39aae95f", "score": "0.5387756", "text": "function assertContainsAll(actual, expected) {\n for (var key in expected) {\n var type = typeof expected[key];\n assert.equal(type, typeof actual[key], 'type of value for key ' + key + ' mismatch');\n if (type === 'object') {\n assertContainsAll(actual[key], expected[key]);\n } else {\n assert.equal(expected[key], actual[key], 'property ' + key + ' must match');\n }\n }\n }", "title": "" }, { "docid": "dc4ee9303225369a0f21b3eaacc64f2a", "score": "0.5385623", "text": "function withChai(fn) {\n return function (assert) {\n\n function _expect() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var assertion = _chai.expect.apply(undefined, args);\n var originalAssert = assertion.assert;\n assertion.assert = function () {\n var message = _chai.util.flag(assertion, 'message');\n\n try {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n originalAssert.apply(this, args);\n assert.pushResult({ result: true, message: message });\n } catch (error) {\n assert.pushResult({\n result: false,\n actual: error.showDiff ? error.actual : undefined,\n expected: error.showDiff ? error.expected : undefined,\n message: error.message\n });\n }\n };\n return assertion;\n }\n\n return fn.call(this, _expect, assert);\n };\n }", "title": "" }, { "docid": "c64aec13be2b2cc68be3fb7cf4a6f896", "score": "0.53835595", "text": "function assert(nExpected, nActual) {\n if (nExpected!=nActual)\n throw new Error(`expected value to be: ${nExpected}, yet it was: ${nActual}`);\n}", "title": "" }, { "docid": "599d02d51dc7e6a2e57594b517d1bff9", "score": "0.53542125", "text": "checkSubtransactionRowValues(row, expected) {\n\t\tthis.subtransactionCategoryName(row).should.eventually.equal(expected.categoryName);\n\t\tif (expected.subcategoryName) {\n\t\t\tthis.subtransactionSubcategoryName(row).should.eventually.equal(expected.subcategoryName);\n\t\t}\n\t\tif (expected.accountName) {\n\t\t\tthis.subtransactionAccountName(row).should.eventually.equal(expected.accountName);\n\t\t}\n\t\tthis.subtransactionMemo(row).should.eventually.equal(expected.memo);\n\t\tthis.subtransactionAmount(row).should.eventually.equal(expected.amount);\n\t}", "title": "" }, { "docid": "ad169849da2c6bb441c24eb51d6672ac", "score": "0.53511083", "text": "function createAsserts(db, adapter) {\n function normalizeID(id) {\n if ((0, typeguards_1.isArray)(id))\n id = id.join(\".\");\n // Test if this ID is fully qualified\n if (!/^[a-z0-9\\-_]+\\.\\d+\\./.test(id)) {\n id = adapter.namespace + \".\" + id;\n }\n return id;\n }\n const ret = {\n assertObjectExists(id) {\n id = normalizeID(id);\n db.hasObject(id).should.equal(true, `The object \"${adapter.namespace}.${id}\" does not exist but it was expected to!`);\n },\n assertStateExists(id) {\n id = normalizeID(id);\n db.hasState(id).should.equal(true, `The state \"${adapter.namespace}.${id}\" does not exist but it was expected to!`);\n },\n assertStateHasValue(id, value) {\n ret.assertStateProperty(id, \"val\", value);\n },\n assertStateIsAcked(id, ack = true) {\n ret.assertStateProperty(id, \"ack\", ack);\n },\n assertStateProperty(id, property, value) {\n id = normalizeID(id);\n ret.assertStateExists(id);\n db.getState(id)\n .should.be.an(\"object\")\n .that.has.property(property, value);\n },\n assertObjectCommon(id, common) {\n id = normalizeID(id);\n ret.assertObjectExists(id);\n const dbObj = db.getObject(id);\n dbObj.should.be.an(\"object\").that.has.property(\"common\");\n dbObj.common.should.be.an(\"object\").that.nested.include(common);\n },\n assertObjectNative(id, native) {\n id = normalizeID(id);\n ret.assertObjectExists(id);\n const dbObj = db.getObject(id);\n dbObj.should.be.an(\"object\").that.has.property(\"native\");\n dbObj.native.should.be.an(\"object\").that.nested.include(native);\n },\n };\n return ret;\n}", "title": "" }, { "docid": "95767646ed9f9bcb74a5f068ea1329e2", "score": "0.53488886", "text": "function suite(){\n var productList;\n var list;\n var order;\n var url;\n\n before(function(){\n chai.use(chaiHttp)\n url = 'http://localhost:8080';\n productList = new ProductList('1','1');\n list = new Array();\n order = new Order('01', '18.188.222-0', list);\n\n list.push(productList);\n })\n\n const getDetails = allure.createStep('Crear orden de compra', async(done)=> {\n\n axios.post('http://localhost:8080/orders', order).then(res =>{\n expect(res.status).to.equal(200);\n done();\n })\n .catch(err =>{\n throwError(err);\n done(err);\n });\n\n });\n\n const getStock = allure.createStep('Obtener alerta de producto sin stock', async(done) => \n {\n \n chai.request(url).post('/orders', order).then(res =>{\n expect(res.status).to.equal(500);\n done();\n })\n .catch(err =>{\n throwError(err);\n done(err);\n });\n \n });\n\n const throwError = allure.createStep(\"Detalle del test erroneo\", (err) => {\n throw new Error(err);\n });\n\n it('Crear detalle de orden', function(done){\n getDetails(done);\n });\n\n it('Producto Sin Stock', function(done){\n getStock(done);\n });\n\n\n}", "title": "" }, { "docid": "48c850085c11c84aaa4314b8106856bf", "score": "0.53458595", "text": "function expected() {\n var info = expectations.shift();\n if(!info) {\n return; \n }\n info.opts = info.opts || {};\n info.opts.output = fs.createWriteStream(info.output);\n //console.log(info.files)\n parse(info.files, info.opts, function(err) {\n if(err) {\n console.error(err.stack); \n process.exit(1);\n }\n var contents = '' + fs.readFileSync(info.output);\n if(!contents) {\n console.error('wrote empty file: ' + info.output); \n process.exit(1);\n }\n expected();\n })\n}", "title": "" }, { "docid": "2f9146397a845793e84697dd7bb5016d", "score": "0.534189", "text": "function MjsUnitAssertionError(message) {}", "title": "" }, { "docid": "6b76fca5034a85104a19fbcb55f35c3e", "score": "0.5341821", "text": "function expectAssertion(fn, expectedMessage) {\n var originalAssert = Ember.assert,\n actualMessage, actualTest,\n arity, sawAssertion;\n\n var AssertionFailedError = new Error('AssertionFailed');\n\n try {\n Ember.assert = function(message, test) {\n arity = arguments.length;\n actualMessage = message;\n actualTest = test;\n\n if (!test) {\n throw AssertionFailedError;\n }\n };\n\n try {\n fn();\n } catch(error) {\n if (error === AssertionFailedError) {\n sawAssertion = true;\n } else {\n throw error;\n }\n }\n\n if (!sawAssertion) {\n ok(false, \"Expected Ember.assert: '\" + expectedMessage + \"', but no assertions were run\");\n } else if (arity === 2) {\n\n if (expectedMessage) {\n if (expectedMessage instanceof RegExp) {\n ok(expectedMessage.test(actualMessage), \"Expected Ember.assert: '\" + expectedMessage + \"', but got '\" + actualMessage + \"'\");\n }else{\n equal(actualMessage, expectedMessage, \"Expected Ember.assert: '\" + expectedMessage + \"', but got '\" + actualMessage + \"'\");\n }\n } else {\n ok(!actualTest);\n }\n } else if (arity === 1) {\n ok(!actualTest);\n } else {\n ok(false, 'Ember.assert was called without the assertion');\n }\n\n } finally {\n Ember.assert = originalAssert;\n }\n }", "title": "" }, { "docid": "7022f7aed56f94782ce04b0330d79047", "score": "0.5341017", "text": "function testing(actual, expected){\n console.log(actual===expected);\n}", "title": "" }, { "docid": "30ce0a44c7bff03befa632fa02e09e43", "score": "0.534097", "text": "verify() {\n\n }", "title": "" }, { "docid": "726608c2d0b9ffade3068d686bfdee1a", "score": "0.53392994", "text": "function commonExpectations(result) {\n expect(result).toHaveProperty('fileData')\n expect(_.size(result.fileData)).toBe(8760)\n expect(result).toHaveProperty('fileInfo')\n expect(_.isString(result.fileInfo.id)).toBe(true)\n expect(_.isString(result.fileInfo.fileType)).toBe(true)\n expect(_.isBoolean(result.fileInfo.isSample)).toBe(true)\n expect(_.isString(result.fileInfo.name)).toBe(true)\n expect(_.isNumber(result.fileInfo.size)).toBe(true)\n expect(_.isString(result.fileInfo.timestamp)).toBe(true)\n\n if (!_.isEmpty(result.fileImportErrors)) {\n console.log('fileImportErrors: ', result.fileImportErrors)\n }\n if (!_.isEmpty(result.fileImportWarnings)) {\n console.log('fileImportWarnings: ', result.fileImportWarnings)\n }\n expect(_.isEmpty(result.fileImportErrors)).toBe(true)\n expect(_.isEmpty(result.fileImportWarnings)).toBe(true)\n\n // Currently there is a difference in how node.js and the browser parses dates.\n // This sounds like a pain to fix. May want to just switch to Moment.js\n // http://moment.github.io/luxon/docs/manual/install.html#node\n // const { datetime } = result.fileData[0]\n // console.log('result.fileData: ', result.fileData[0])\n // console.log(DateTime.fromISO(datetime))\n}", "title": "" }, { "docid": "372c9f3f04e9857c55bc4209bc549684", "score": "0.53381336", "text": "function assertWithin (t, val, expected, range) {\n t.ok(val >= expected - range, \"val >= expected - range\");\n t.ok(val <= expected + range, \"val <= expected + range\");\n}", "title": "" }, { "docid": "47bbd11d7434d41417452e06ae61c77d", "score": "0.5333907", "text": "function testAssert(testName, result, type, expected)\n{\n debug(2, '[testAssert] result = ' + result + ', expected = ' + expected + ', type = ' + type);\n let pass = compare(type, result, expected);\n if (!pass) {\n debug(1, '*** Failure in test ' + testName);\n debug(1, ' Expected: ' + expected);\n debug(1, ' Got: ' + result);\n debug(1, ' Return: ' + pass);\n }\n logResult(testName, pass);\n}", "title": "" }, { "docid": "8faa08b2d8b6b3d78f07773ed1855605", "score": "0.533368", "text": "function verify (expected, converter, input) {\n let argArr = Object.values(arguments)\n let actual, message = ''\n if (arguments.length >= 3) {\n actual = converter.apply(this, argArr.slice(2))\n message = 'Input: '\n argArr.slice(2).forEach(a =>\n message += shrinkText('' + a) + '\\n'\n )\n } else if (arguments.length == 2) {\n actual = arguments[1]\n input = actual\n }\n\n message += 'Expected: ' + expected + '\\n Actual: ' + actual\n\n if (expected === actual || expected == actual || ('' + expected) == ('' + actual)) {\n pass(message)\n } else {\n error('Comparison Fail\\n' + message)\n }\n}", "title": "" }, { "docid": "8faa08b2d8b6b3d78f07773ed1855605", "score": "0.533368", "text": "function verify (expected, converter, input) {\n let argArr = Object.values(arguments)\n let actual, message = ''\n if (arguments.length >= 3) {\n actual = converter.apply(this, argArr.slice(2))\n message = 'Input: '\n argArr.slice(2).forEach(a =>\n message += shrinkText('' + a) + '\\n'\n )\n } else if (arguments.length == 2) {\n actual = arguments[1]\n input = actual\n }\n\n message += 'Expected: ' + expected + '\\n Actual: ' + actual\n\n if (expected === actual || expected == actual || ('' + expected) == ('' + actual)) {\n pass(message)\n } else {\n error('Comparison Fail\\n' + message)\n }\n}", "title": "" }, { "docid": "9c24381b75637560ac0699601960aa4e", "score": "0.5327805", "text": "function test_checker() {\n let success = true;\n\n console.log('\\n*** RESULTS *** \\n');\n\n if (!test_ep_http_receive_success) {\n console.error('[FAIL] The EP HTTP interface is not accessible');\n success = false;\n }\n\n if (!test_ep_message_queue_ack) {\n console.error('[FAIL] The Message Queue did not acknowledge the update request');\n success = false;\n }\n\n if (!test_ss_http_receive_success) {\n console.error('[FAIL] The Mock Secure Server did not receive an update message from the EP');\n success = false;\n }\n\n if (!test_ss_ws_send_success) {\n console.error('[FAIL] The Mock Secure Server did not send a WebSocket push notification');\n success = false;\n }\n\n if (!test_ep_message_queue_success) {\n console.error('[FAIL] The Message Queue did not report the update');\n\n if (!test_ep_message_queue_ack) {\n success = false;\n } else {\n console.warn('[WARN] Check that the TARGET_VALUE (\\'' + TARGET_VALUE + '\\') differs from the current value');\n }\n }\n\n if (success) {\n console.log('\\nTests passed successfully!')\n process.exit(EXIT_SUCCESS);\n } else {\n console.error('\\nOne or more tests failed')\n process.exit(EXIT_FAILURE);\n }\n}", "title": "" }, { "docid": "ca501db8d8266c97ec70276fd06d22aa", "score": "0.5327776", "text": "function assertEqual(actual, expected, testName) {\n if (actual === expected) {\n console.log('passed');\n } else {\n console.log('FAILED [' + testName + '] expected ' + expected + ', but got ' + actual);\n }\n}", "title": "" }, { "docid": "79dd1e15d6ae4954d0d2c2622a531ff1", "score": "0.531951", "text": "function assertEqual(actual, expected, testName) {\n if (actual === expected) {\n console.log('passed');\n } else {\n console.log('FAILED [' + testName + '] Expected \"' + expected + '\", but got \"' + actual + '\"');\n }\n}", "title": "" }, { "docid": "83557a6eee2e04151486626b06c560d0", "score": "0.5317634", "text": "testVerifyKey() {\n it('should throw an error if the request has no \"akismet\" property', () =>\n assert.throws(() => new Server().verifyKey({}, null))\n );\n }", "title": "" }, { "docid": "b9ab67f3f48ecba672d2eef20b756362", "score": "0.5305403", "text": "function runTest(callback) {\n\n /**\n * An expectation class.\n */\n function DumpExpectation(messages, negated) {\n\n if (!negated) {\n this.not = new DumpExpectation(messages, true);\n }\n\n // Helper to raise expectation.\n function passOrRaise(flag, message, actual) {\n\n // Make Jasmine happy in case that this is only test inside a case.\n try {\n if (jasmine) {\n expect(true).toBe(true);\n }\n } catch(e) {}\n\n // Actual test.\n message += \" (had \" + argToString(actual) + \")\";\n if (!flag && !negated) {\n throw new DumpExceptionError(\"Dump Expectation Failed: expected to \" + message);\n }\n if (flag && negated) {\n throw new DumpExceptionError(\"Dump Expectation Failed: expected not to \" + message);\n }\n }\n\n // Helper to collect actual message texts.\n function messageTexts(filter) {\n var ret = [];\n for (i = 0; i < messages.length; i++) {\n if (messages[i].type === 'message') {\n if (filter && !filter(messages[i])) {\n continue;\n }\n ret.push(messages[i].text);\n }\n }\n return ret;\n }\n\n // Test if there are any messages.\n this.toHaveMessages = function() {\n passOrRaise(messages.length > 0, \"have some messages\", messages.length);\n };\n\n // Test if messages match exact list.\n this.toBe = function() {\n var args = Array.prototype.slice.call(arguments);\n var texts = messageTexts(function(msg) {\n return msg.channel === null || msg.channel === 'GENERAL';\n });\n var match = false;\n if (args.length == texts.length) {\n match = true;\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== texts[i]) {\n match = false;\n break;\n }\n }\n }\n passOrRaise(match, \"have exactly \" + args.length + \" messages ['\" + args.join(\"', '\") + \"']\", texts);\n };\n }\n\n // When testing, messages are collected here instead of displaying.\n var messages = [];\n var oldDisplay = Dump.config.displayFunction;\n\n // Display engine for testing.\n function displayTesting(msg) {\n messages.push(msg);\n if (Dump.config.debugTesting) {\n oldDisplay(msg);\n }\n }\n\n Dump.config.displayFunction = displayTesting;\n try {\n callback();\n } catch(e) {\n if (!(e instanceof DumpError)) {\n Dump.config.displayFunction = oldDisplay;\n throw e;\n }\n }\n Dump.config.displayFunction = oldDisplay;\n\n return new DumpExpectation(messages);\n }", "title": "" }, { "docid": "38aa7f08046894beb71ceed752b7ecef", "score": "0.5303952", "text": "function assertEqual(actual, expected, testName) {\n if (actual === expected) {\n console.log('passed');\n } else {\n console.log(\n 'FAILED [' + testName + '] Expected ' + expected + ', but got ' + actual\n );\n }\n}", "title": "" }, { "docid": "85989f6d823c3771a060aed2521e5a97", "score": "0.5302556", "text": "function assertObjectsEqual (actual, expected, testName) {\n // default passing colors, bright green\n let firstColorCode = \"\\x1b[92m\";\n let lastColorCode = \"\\x1b[39m\";\n\n actual = JSON.stringify(actual);\n expected = JSON.stringify(expected);\n let failedMessage = `Failed [${testName}] Expected ${expected} to equal ${actual}`;\n\n if (actual !== expected) {\n // bright red colors for failing tests\n firstColorCode = \"\\x1b[91m\";\n lastColorCode = \"\\x1b[39m\";\n\n console.log(`${firstColorCode}${failedMessage}${lastColorCode}`);\n return;\n }\n\n \n console.log(`${firstColorCode}Passed [${testName}]${lastColorCode}`);\n return;\n\n}", "title": "" }, { "docid": "710612ba76b3a72ce8add40bde317f68", "score": "0.5300983", "text": "testAdvanced()\n {\n let a = 3;\n let b = a;\n this.assertIdentical(a, b, \"A rose by any other name is still a rose\");\n this.assertInRange(3, 1, 10, \"You must be kidding, 3 can never be outside [1,10]!\");\n }", "title": "" }, { "docid": "2ff817ca6532f3cf213de105a96064e1", "score": "0.52890533", "text": "function assertEqual(a, b, desc) {\n if (a === b) {\n console.log(`${desc} ... PASS`);\n } else {\n console.log(`${desc} ... FAIL: ${a} != ${b}`);\n }\n}", "title": "" } ]
589df2d80f9c7150ea9f3400382f4add
Builds an enhanced moment from args. When given an existing moment, it clones. When given a native Date, or called with no arguments (the current time), the resulting moment will be local. Anything else needs to be "parsed" (a string or an array), and will be affected by: parseAsUTC if there is no zone information, should we parse the input in UTC? parseZone if there is zone information, should we force the zone of the moment?
[ { "docid": "c54fa953d9d9b47026f0d02198e1a254", "score": "0.8033875", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input) || isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args);\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "title": "" } ]
[ { "docid": "4b67c159773e78331cc435d5465e6d1e", "score": "0.8004596", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar output; // an object with fields for the new FCMoment object\n\n\tif (moment.isMoment(input)) {\n\t\toutput = moment.apply(null, args); // clone it\n\n\t\t// the ambig properties have not been preserved in the clone, so reassign them\n\t\tif (input._ambigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t}\n\t\tif (input._ambigZone) {\n\t\t\toutput._ambigZone = true;\n\t\t}\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\toutput = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC) {\n\t\t\toutput = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\toutput = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\toutput._ambigTime = true;\n\t\t\toutput._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\toutput._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\toutput.zone(input); // if not a valid zone, will assign UTC\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new FCMoment(output);\n}", "title": "" }, { "docid": "cef36e8220f0c561971024aee9068992", "score": "0.8002287", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else { // \"parsing\" is required\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) { // let's record the inputted zone somehow\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "title": "" }, { "docid": "998d16af2b1b15de6e510419052bdef2", "score": "0.7994117", "text": "function makeMoment(args, parseAsUTC, parseZone) {\r\n if (parseAsUTC === void 0) { parseAsUTC = false; }\r\n if (parseZone === void 0) { parseZone = false; }\r\n var input = args[0];\r\n var isSingleString = args.length === 1 && typeof input === 'string';\r\n var isAmbigTime;\r\n var isAmbigZone;\r\n var ambigMatch;\r\n var mom;\r\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\r\n mom = moment.apply(null, args);\r\n }\r\n else { // \"parsing\" is required\r\n isAmbigTime = false;\r\n isAmbigZone = false;\r\n if (isSingleString) {\r\n if (ambigDateOfMonthRegex.test(input)) {\r\n // accept strings like '2014-05', but convert to the first of the month\r\n input += '-01';\r\n args = [input]; // for when we pass it on to moment's constructor\r\n isAmbigTime = true;\r\n isAmbigZone = true;\r\n }\r\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\r\n isAmbigTime = !ambigMatch[5]; // no time part?\r\n isAmbigZone = true;\r\n }\r\n }\r\n else if ($.isArray(input)) {\r\n // arrays have no timezone information, so assume ambiguous zone\r\n isAmbigZone = true;\r\n }\r\n // otherwise, probably a string with a format\r\n if (parseAsUTC || isAmbigTime) {\r\n mom = moment.utc.apply(moment, args);\r\n }\r\n else {\r\n mom = moment.apply(null, args);\r\n }\r\n if (isAmbigTime) {\r\n mom._ambigTime = true;\r\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\r\n }\r\n else if (parseZone) { // let's record the inputted zone somehow\r\n if (isAmbigZone) {\r\n mom._ambigZone = true;\r\n }\r\n else if (isSingleString) {\r\n mom.utcOffset(input); // if not a valid zone, will assign UTC\r\n }\r\n }\r\n }\r\n mom._fullCalendar = true; // flag for extended functionality\r\n return mom;\r\n}", "title": "" }, { "docid": "d69787f0d3678f576cce6988a842b9cc", "score": "0.79920244", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "title": "" }, { "docid": "d69787f0d3678f576cce6988a842b9cc", "score": "0.79920244", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "title": "" }, { "docid": "d69787f0d3678f576cce6988a842b9cc", "score": "0.79920244", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "title": "" }, { "docid": "d69787f0d3678f576cce6988a842b9cc", "score": "0.79920244", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n if (parseAsUTC === void 0) { parseAsUTC = false; }\n if (parseZone === void 0) { parseZone = false; }\n var input = args[0];\n var isSingleString = args.length === 1 && typeof input === 'string';\n var isAmbigTime;\n var isAmbigZone;\n var ambigMatch;\n var mom;\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\n mom = moment.apply(null, args);\n }\n else {\n isAmbigTime = false;\n isAmbigZone = false;\n if (isSingleString) {\n if (ambigDateOfMonthRegex.test(input)) {\n // accept strings like '2014-05', but convert to the first of the month\n input += '-01';\n args = [input]; // for when we pass it on to moment's constructor\n isAmbigTime = true;\n isAmbigZone = true;\n }\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n isAmbigTime = !ambigMatch[5]; // no time part?\n isAmbigZone = true;\n }\n }\n else if ($.isArray(input)) {\n // arrays have no timezone information, so assume ambiguous zone\n isAmbigZone = true;\n }\n // otherwise, probably a string with a format\n if (parseAsUTC || isAmbigTime) {\n mom = moment.utc.apply(moment, args);\n }\n else {\n mom = moment.apply(null, args);\n }\n if (isAmbigTime) {\n mom._ambigTime = true;\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\n }\n else if (parseZone) {\n if (isAmbigZone) {\n mom._ambigZone = true;\n }\n else if (isSingleString) {\n mom.utcOffset(input); // if not a valid zone, will assign UTC\n }\n }\n }\n mom._fullCalendar = true; // flag for extended functionality\n return mom;\n}", "title": "" }, { "docid": "235ad8207e3de06ea5af371afa19d329", "score": "0.7986338", "text": "function makeMoment(args, parseAsUTC, parseZone) {\r\n if (parseAsUTC === void 0) { parseAsUTC = false; }\r\n if (parseZone === void 0) { parseZone = false; }\r\n var input = args[0];\r\n var isSingleString = args.length === 1 && typeof input === 'string';\r\n var isAmbigTime;\r\n var isAmbigZone;\r\n var ambigMatch;\r\n var mom;\r\n if (moment.isMoment(input) || util_1.isNativeDate(input) || input === undefined) {\r\n mom = moment.apply(null, args);\r\n }\r\n else {\r\n isAmbigTime = false;\r\n isAmbigZone = false;\r\n if (isSingleString) {\r\n if (ambigDateOfMonthRegex.test(input)) {\r\n // accept strings like '2014-05', but convert to the first of the month\r\n input += '-01';\r\n args = [input]; // for when we pass it on to moment's constructor\r\n isAmbigTime = true;\r\n isAmbigZone = true;\r\n }\r\n else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\r\n isAmbigTime = !ambigMatch[5]; // no time part?\r\n isAmbigZone = true;\r\n }\r\n }\r\n else if ($.isArray(input)) {\r\n // arrays have no timezone information, so assume ambiguous zone\r\n isAmbigZone = true;\r\n }\r\n // otherwise, probably a string with a format\r\n if (parseAsUTC || isAmbigTime) {\r\n mom = moment.utc.apply(moment, args);\r\n }\r\n else {\r\n mom = moment.apply(null, args);\r\n }\r\n if (isAmbigTime) {\r\n mom._ambigTime = true;\r\n mom._ambigZone = true; // ambiguous time always means ambiguous zone\r\n }\r\n else if (parseZone) {\r\n if (isAmbigZone) {\r\n mom._ambigZone = true;\r\n }\r\n else if (isSingleString) {\r\n mom.utcOffset(input); // if not a valid zone, will assign UTC\r\n }\r\n }\r\n }\r\n mom._fullCalendar = true; // flag for extended functionality\r\n return mom;\r\n}", "title": "" }, { "docid": "de2981160c2608a3be123db966883743", "score": "0.797392", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "title": "" }, { "docid": "de2981160c2608a3be123db966883743", "score": "0.797392", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "title": "" }, { "docid": "de2981160c2608a3be123db966883743", "score": "0.797392", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "title": "" }, { "docid": "de2981160c2608a3be123db966883743", "score": "0.797392", "text": "function makeMoment(args, parseAsUTC, parseZone) {\n\tvar input = args[0];\n\tvar isSingleString = args.length == 1 && typeof input === 'string';\n\tvar isAmbigTime;\n\tvar isAmbigZone;\n\tvar ambigMatch;\n\tvar mom;\n\n\tif (moment.isMoment(input)) {\n\t\tmom = moment.apply(null, args); // clone it\n\t\ttransferAmbigs(input, mom); // the ambig flags weren't transfered with the clone\n\t}\n\telse if (isNativeDate(input) || input === undefined) {\n\t\tmom = moment.apply(null, args); // will be local\n\t}\n\telse { // \"parsing\" is required\n\t\tisAmbigTime = false;\n\t\tisAmbigZone = false;\n\n\t\tif (isSingleString) {\n\t\t\tif (ambigDateOfMonthRegex.test(input)) {\n\t\t\t\t// accept strings like '2014-05', but convert to the first of the month\n\t\t\t\tinput += '-01';\n\t\t\t\targs = [ input ]; // for when we pass it on to moment's constructor\n\t\t\t\tisAmbigTime = true;\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t\telse if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) {\n\t\t\t\tisAmbigTime = !ambigMatch[5]; // no time part?\n\t\t\t\tisAmbigZone = true;\n\t\t\t}\n\t\t}\n\t\telse if ($.isArray(input)) {\n\t\t\t// arrays have no timezone information, so assume ambiguous zone\n\t\t\tisAmbigZone = true;\n\t\t}\n\t\t// otherwise, probably a string with a format\n\n\t\tif (parseAsUTC || isAmbigTime) {\n\t\t\tmom = moment.utc.apply(moment, args);\n\t\t}\n\t\telse {\n\t\t\tmom = moment.apply(null, args);\n\t\t}\n\n\t\tif (isAmbigTime) {\n\t\t\tmom._ambigTime = true;\n\t\t\tmom._ambigZone = true; // ambiguous time always means ambiguous zone\n\t\t}\n\t\telse if (parseZone) { // let's record the inputted zone somehow\n\t\t\tif (isAmbigZone) {\n\t\t\t\tmom._ambigZone = true;\n\t\t\t}\n\t\t\telse if (isSingleString) {\n\t\t\t\tif (mom.utcOffset) {\n\t\t\t\t\tmom.utcOffset(input); // if not a valid zone, will assign UTC\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmom.zone(input); // for moment-pre-2.9\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmom._fullCalendar = true; // flag for extended functionality\n\n\treturn mom;\n}", "title": "" }, { "docid": "58ca0634a2f7c0668979515921a4c4e1", "score": "0.7354876", "text": "createMoment(...args) {\n return this.options?.useUtc ? moment.utc(...args) : moment(...args);\n }", "title": "" }, { "docid": "e5e8e93ffb36b61e18cb92faaed51619", "score": "0.6754777", "text": "momentFrom( string, formats, options ) {\n\n // If any of the following keywords were given, then unset the string to default to the current day.\n if( ['now', 'today'].includes(string) ) string = undefined;\n\n // Create a moment from the given date string and formats.\n return moment(string, formats);\n\n }", "title": "" }, { "docid": "8c55c41f07b4f3afa6a39434b3ba1099", "score": "0.6015439", "text": "function makeAs(input, model) {\n\t var res, diff;\n\t if (model._isUTC) {\n\t res = model.clone();\n\t diff = (moment.isMoment(input) || isDate(input) ?\n\t +input : +moment(input)) - (+res);\n\t // Use low-level api, because this fn is low-level api.\n\t res._d.setTime(+res._d + diff);\n\t moment.updateOffset(res, false);\n\t return res;\n\t } else {\n\t return moment(input).local();\n\t }\n\t }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "3cc3707736eb5fbecdbc17e4b1130a13", "score": "0.5874114", "text": "function makeAs(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (moment.isMoment(input) || isDate(input) ?\n +input : +moment(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n moment.updateOffset(res, false);\n return res;\n } else {\n return moment(input).local();\n }\n }", "title": "" }, { "docid": "5edfceebc292fa4452a7c0a7988225f7", "score": "0.5831686", "text": "function toMoment(date) {\n var mdate;\n if (moment.isDate(date)) {\n mdate = moment(date);\n }\n else if (moment.isMoment(date)) {\n mdate = date.clone();\n }\n\n if (!mdate.isValid()) {\n throw factoryId + \" unable to parse \" + date + \" into valid moment object\";\n }\n \n return mdate;\n }", "title": "" }, { "docid": "49eda8888005a4b22ac2534dbe0e7d09", "score": "0.58229923", "text": "function createMoment(text) {\n // Checks if the text, which should be in the ISO 8601 format,\n // ends with the UTC identifier or a time zone offset.\n function includesTimeZone(text) {\n var length = text.length;\n if (length > 19) {\n if (text.charAt(length - 1) === 'Z') {\n return true;\n }\n var direction = text.charAt(length - 5);\n if (direction === '+' || direction === '-') {\n return true;\n }\n }\n }\n\n if (text instanceof moment) {\n return text;\n }\n if(text instanceof Date) {\n return moment(text);\n }\n return config.formatIsoDateTimeInTimeZone && !includesTimeZone(text) ?\n moment.tz(text, config.formatIsoDateTimeInTimeZone) : moment(text);\n }", "title": "" }, { "docid": "adcf2a3097ad1ce2613f44bbfe2624d1", "score": "0.5800971", "text": "function Moment(date, isUTC, lang) {\n this._d = date;\n this._isUTC = !!isUTC;\n this._a = date._a || null;\n this._lang = lang || false;\n }", "title": "" }, { "docid": "b252a745c9dc287df8999d2cc0bebd8e", "score": "0.56229186", "text": "function momentify(date) {\n return (!moment.isMoment(date)) ? moment(date) : date;\n }", "title": "" }, { "docid": "d9772583535575ea82adc485a675a328", "score": "0.5595305", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "291903ba88f58460b325726f112b2229", "score": "0.555945", "text": "function Moment() {}", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "c74aa8d5880fbdd7e6cde5fc3411debc", "score": "0.55524474", "text": "function makeAs(input, model) {\n return model._isUTC ? moment(input).zone(model._offset || 0) :\n moment(input).local();\n }", "title": "" }, { "docid": "f753ab394756f0b21d57d7b23ea6429b", "score": "0.5466697", "text": "momentAPI( _moment, options ) {\n\n // If a moment was not given, and only the API was initialized, then swap the passed arguments.\n if( !_.isPlainObject(options) ) {\n\n // Assume only the options were passed.\n options = _moment;\n\n // Unset the moment.\n _moment = null;\n\n }\n\n // Extract API settings from the given options.\n const settings = _.get(options, 'hash', {});\n\n // If any of the following keywords were given, then unset the string to default to the current day.\n if( ['now', 'today'].includes(_moment) ) _moment = undefined;\n\n // If a moment was not given, then try to covert the given thing to a moment.\n if( !moment.isMoment(_moment) ) _moment = moment(_moment || settings.date, settings.fromFormat);\n\n // Only continue if a valid moment exists.\n if( !_moment.isValid() ) return;\n\n // Get a list of operations.\n const operations = _.filter(_.keys(settings), (key) => {\n\n // Ignore non-method keys.\n return !['date', 'fromFormat', 'order'].includes(key);\n\n });\n\n // Get the intended order of operations.\n let order = _.get(settings, 'order', operations.length == 1 ? operations[0] : false);\n\n // Convert the moment to an array if it was given as a string.\n if( _.isString(order) ) order = order.split(/[,;]? +|\\./).map(_.trim);\n\n // Remove any settings that are known non-methods.\n _.unset(settings, 'date');\n _.unset(settings, 'fromFormat');\n _.unset(settings, 'order');\n\n // Require that an order be given (for two or more operations), or always return the moment as is.\n if( !order ) return _moment;\n\n // Manipulate the moment based on the given order of operations.\n _.each(order, (method) => {\n\n // Only continue modifying the moment if it's still in moment form.\n if( !moment.isMoment(_moment) ) return;\n\n // Skip the method if a matching method setting was not given or if the method doesn't exist.\n if( !_.has(settings, method) || !_moment[method] ) return;\n\n // Otherwise, get the method's value.\n let value = settings[method];\n\n // For select methods, enable an easier-to-use string syntax for passing arguments.\n if( ['add', 'subtract'].includes(method) && _.isString(value) ) {\n\n // Convert the string to an array of arrays.\n value = value.split(', ').map((value) => value.split(' ').map(_.trim));\n\n }\n\n // Otherwise, for all other values, convert it to array form if it wasn't given as one.\n else if( !_.isArray(value) ) value = [value];\n\n // For add/subtract methods, apply the additions/subtractions in order.\n if( ['add', 'subtract'].includes(method) ) {\n\n // Loop through each pair of values, and execute its operation.\n _.each(value, (args) => _moment[method](...args));\n\n }\n\n // For getter/setter methods, allow empty values to indicate that the getter should be used.\n else if( [\n 'millisecond', 'milliseconds',\n 'second', 'seconds',\n 'minute', 'minutes',\n 'hour', 'hours',\n 'date', 'dates',\n 'day', 'days',\n 'weekday',\n 'isoWeekday',\n 'dayOfYear',\n 'week', 'weeks',\n 'isoWeek', 'isoWeeks',\n 'month', 'months',\n 'quarter', 'quarters',\n 'year', 'years',\n 'weekYear',\n 'isoWeekYear',\n 'weeksInYear',\n 'isoWeeksInYear',\n 'valueOf',\n 'unix',\n 'daysInMonth',\n 'toDate',\n 'toArray',\n 'toJSON',\n 'toISOString',\n 'toObject',\n 'inspect'\n ].includes(method) && [\n true,\n null,\n undefined\n ].includes(value[0]) ) _moment = _moment[method]();\n\n // For getter methods that accept arguments, manipulate the moment but capture the output.\n else if( [\n 'format',\n 'fromNow',\n 'from',\n 'toNow',\n 'to',\n 'calendar',\n 'difference',\n 'valueOf',\n 'unix',\n 'daysInMonth',\n 'toDate',\n 'toArray',\n 'toJSON',\n 'toISOString',\n 'toObject',\n 'inspect'\n ].includes(method) ) _moment = value ? _moment[method](...value) : _moment[method]();\n\n // Otherwise, directly manipulate the moment using the given method.\n else _moment[method](...value);\n\n });\n\n // Return the modified moment.\n return _moment;\n\n }", "title": "" }, { "docid": "c1ad19d82937d565479fc70ecb3135ef", "score": "0.5393952", "text": "function parserFabric(mode, format) {\n return function (value, parseFn) {\n parseFn = parseFn || moment_1.utc;\n if (value === null || value === undefined || value === \"\") {\n return null;\n }\n var formatsToParse = parseFormat[mode || \"date\"];\n return parseFn(value, [format].concat(formatsToParse), true);\n };\n}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5345092", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "561c6e11834da95a1d5e7a019ad94b02", "score": "0.5265265", "text": "constructDate (hours, minutes, period) {\n const {date} = this.state\n const newDate = moment(date)\n\n let tempHours = ~~hours\n if (period.toLowerCase() === 'pm') {\n tempHours = (tempHours === 12) ? tempHours : tempHours + 12\n } else {\n tempHours = (tempHours === 12) ? 0 : tempHours\n }\n\n newDate\n .hours(tempHours)\n .minutes(minutes)\n\n return newDate\n }", "title": "" }, { "docid": "456865aa5ef63e07fef1966eb61b9571", "score": "0.52237433", "text": "convertStringToMomentObject(date) {\n let dateObj = new Date(date);\n\n let momentObj = moment(dateObj);\n\n\n \n return momentObj;\n }", "title": "" }, { "docid": "40127d584f48c89403c8a6b3ff749623", "score": "0.51971126", "text": "function clone$1(inst, alts) {\n var current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid\n };\n return new DateTime(Object.assign({}, current, alts, {\n old: current\n }));\n} // find the right offset a given local time. The o input is our guess, which determines which", "title": "" }, { "docid": "40127d584f48c89403c8a6b3ff749623", "score": "0.51971126", "text": "function clone$1(inst, alts) {\n var current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid\n };\n return new DateTime(Object.assign({}, current, alts, {\n old: current\n }));\n} // find the right offset a given local time. The o input is our guess, which determines which", "title": "" }, { "docid": "40127d584f48c89403c8a6b3ff749623", "score": "0.51971126", "text": "function clone$1(inst, alts) {\n var current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid\n };\n return new DateTime(Object.assign({}, current, alts, {\n old: current\n }));\n} // find the right offset a given local time. The o input is our guess, which determines which", "title": "" }, { "docid": "40127d584f48c89403c8a6b3ff749623", "score": "0.51971126", "text": "function clone$1(inst, alts) {\n var current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid\n };\n return new DateTime(Object.assign({}, current, alts, {\n old: current\n }));\n} // find the right offset a given local time. The o input is our guess, which determines which", "title": "" }, { "docid": "7c4b330117b9d806bded02225db44e2f", "score": "0.51934344", "text": "function parse(text) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$roundUp = _ref.roundUp,\n roundUp = _ref$roundUp === undefined ? false : _ref$roundUp,\n _ref$momentInstance = _ref.momentInstance,\n momentInstance = _ref$momentInstance === undefined ? _moment2.default : _ref$momentInstance,\n forceNow = _ref.forceNow;\n\n if (!text) return undefined;\n if (momentInstance.isMoment(text)) return text;\n if (isDate(text)) return momentInstance(text);\n if (forceNow !== undefined && !isValidDate(forceNow)) {\n throw new Error('forceNow must be a valid Date');\n }\n\n var time = void 0;\n var mathString = '';\n var index = void 0;\n var parseString = void 0;\n\n if (text.substring(0, 3) === 'now') {\n time = momentInstance(forceNow);\n mathString = text.substring('now'.length);\n } else {\n index = text.indexOf('||');\n if (index === -1) {\n parseString = text;\n mathString = ''; // nothing else\n } else {\n parseString = text.substring(0, index);\n mathString = text.substring(index + 2);\n }\n // We're going to just require ISO8601 timestamps, k?\n time = momentInstance(parseString);\n }\n\n if (!mathString.length) {\n return time;\n }\n\n return parseDateMath(mathString, time, roundUp);\n}", "title": "" }, { "docid": "0873cd892a650df749d874099c6ce38d", "score": "0.5187739", "text": "_toMoment(data, fields) {\n for(let key in data) {\n if(fields.includes(key)) {\n data[key] = new moment(data[key]);\n }\n }\n return data;\n }", "title": "" }, { "docid": "c26eafe944cb126cc0068747a03c9566", "score": "0.51797175", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentMilliseconds = m.milliseconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M':\n return currentMonth + 1;\n case 'Mo':\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM':\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM':\n return moment.monthsShort[currentMonth];\n case 'MMMM':\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D':\n return currentDate;\n case 'Do':\n return currentDate + ordinal(currentDate);\n case 'DD':\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD':\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo':\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD':\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd':\n return currentDay;\n case 'do':\n return currentDay + ordinal(currentDay);\n case 'ddd':\n return moment.weekdaysShort[currentDay];\n case 'dddd':\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w':\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo':\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww':\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY':\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY':\n return currentYear;\n // AM / PM\n case 'a':\n return meridiem ? meridiem(currentHours, currentMinutes, false) : (currentHours > 11 ? 'pm' : 'am');\n case 'A':\n return meridiem ? meridiem(currentHours, currentMinutes, true) : (currentHours > 11 ? 'PM' : 'AM');\n // 24 HOUR\n case 'H':\n return currentHours;\n case 'HH':\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h':\n return currentHours % 12 || 12;\n case 'hh':\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm':\n return currentMinutes;\n case 'mm':\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's':\n return currentSeconds;\n case 'ss':\n return leftZeroFill(currentSeconds, 2);\n // MILLISECONDS\n case 'S':\n return ~~ (currentMilliseconds / 100);\n case 'SS':\n return leftZeroFill(~~ (currentMilliseconds / 10), 2);\n case 'SSS':\n return leftZeroFill(currentMilliseconds, 3);\n // TIMEZONE\n case 'Z':\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~ (Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~ (Math.abs(currentZone) % 60), 2);\n case 'ZZ':\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~ (10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L':\n case 'LL':\n case 'LLL':\n case 'LLLL':\n case 'LT':\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default:\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(formattingTokens, replaceFunction);\n }", "title": "" }, { "docid": "2bd4e065a32a656a147fc3f0fef3db4d", "score": "0.510848", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentMilliseconds = m.milliseconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return meridiem ? meridiem(currentHours, currentMinutes, false) : (currentHours > 11 ? 'pm' : 'am');\n case 'A' :\n return meridiem ? meridiem(currentHours, currentMinutes, true) : (currentHours > 11 ? 'PM' : 'AM');\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // MILLISECONDS\n case 'S' :\n return ~~ (currentMilliseconds / 100);\n case 'SS' :\n return leftZeroFill(~~(currentMilliseconds / 10), 2);\n case 'SSS' :\n return leftZeroFill(currentMilliseconds, 3);\n // TIMEZONE\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(formattingTokens, replaceFunction);\n }", "title": "" }, { "docid": "11990c2eb7777f089b22aef6a68788b4", "score": "0.51045614", "text": "function attain_now_from_moment(){\n date_time = moment().format();\n return date_time\n}", "title": "" }, { "docid": "54ab5019be1bbb04a46c2995fce1e41b", "score": "0.51037097", "text": "function formatMoment(m, inputString) {\n var currentMonth = m.month(),\n currentDate = m.date(),\n currentYear = m.year(),\n currentDay = m.day(),\n currentHours = m.hours(),\n currentMinutes = m.minutes(),\n currentSeconds = m.seconds(),\n currentZone = -m.zone(),\n ordinal = moment.ordinal,\n meridiem = moment.meridiem;\n // check if the character is a format\n // return formatted string or non string.\n //\n // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)\n // for minification and performance\n // see http://jsperf.com/object-of-functions-vs-switch for performance comparison\n function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }\n return inputString.replace(charactersToReplace, replaceFunction);\n }", "title": "" }, { "docid": "6178f005a6fe2e6085ece1c132d8683c", "score": "0.5079206", "text": "function momentify(value, options) {\r\n\tvar parser = options.parser;\r\n\tvar format = options.parser || options.format;\r\n\r\n\tif (typeof parser === 'function') {\r\n\t\treturn parser(value);\r\n\t}\r\n\r\n\tif (typeof value === 'string' && typeof format === 'string') {\r\n\t\treturn moment(value, format);\r\n\t}\r\n\r\n\tif (!(value instanceof moment)) {\r\n\t\tvalue = moment(value);\r\n\t}\r\n\r\n\tif (value.isValid()) {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\r\n\t// The user might still use the deprecated `format` option to convert his inputs.\r\n\tif (typeof format === 'function') {\r\n\t\treturn format(value);\r\n\t}\r\n\r\n\treturn value;\r\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" }, { "docid": "37648780e0d22f0eca62655561dc7082", "score": "0.50633526", "text": "function momentify(value, options) {\n\tvar parser = options.parser;\n\tvar format = options.parser || options.format;\n\n\tif (typeof parser === 'function') {\n\t\treturn parser(value);\n\t}\n\n\tif (typeof value === 'string' && typeof format === 'string') {\n\t\treturn moment(value, format);\n\t}\n\n\tif (!(value instanceof moment)) {\n\t\tvalue = moment(value);\n\t}\n\n\tif (value.isValid()) {\n\t\treturn value;\n\t}\n\n\t// Labels are in an incompatible moment format and no `parser` has been provided.\n\t// The user might still use the deprecated `format` option to convert his inputs.\n\tif (typeof format === 'function') {\n\t\treturn format(value);\n\t}\n\n\treturn value;\n}", "title": "" } ]
52bfb71ed049e7968e9f2abda3b2c240
Run functions on component load so data is available.
[ { "docid": "a09925345ebf65cf009865b7309547af", "score": "0.0", "text": "componentDidMount() {\n this.postLogin();\n this.getGroups();\n this.getCurrentData();\n }", "title": "" } ]
[ { "docid": "2f3b01ef3774f30afe89322561bcb26b", "score": "0.70941323", "text": "_onDataLoaded() {\n this.state = 'dataLoaded';\n this._integrator.needRefresh();\n }", "title": "" }, { "docid": "19b6e197f7d549f5e689ceef267e8d7f", "score": "0.66526943", "text": "function loadData() {\n\t\t}", "title": "" }, { "docid": "6198009dd583436729a0ea1a6ad17fd9", "score": "0.6636814", "text": "postload() {\n // componentHandler.upgradeAllRegistered();\n }", "title": "" }, { "docid": "c6d1b1aba0cec32429927f52c8069608", "score": "0.66060525", "text": "function onLoaded()\n {\n window.initExhibitorsList();\n window.initFloorPlans();\n window.initConciege();\n window.initAmenities();\n window.initVisas();\n }", "title": "" }, { "docid": "0320a0b39545b2d6a4f830e281fc7d0d", "score": "0.6596624", "text": "onAfterLoadData() {\n if (this.hot.view) {\n this.recalculateAllColumnsWidth();\n } else {\n // first load - initialization\n setTimeout(() => {\n if (this.hot) {\n this.recalculateAllColumnsWidth();\n }\n }, 0);\n }\n }", "title": "" }, { "docid": "d849b1af94ac3b7604bd8ee2b51952f0", "score": "0.64322984", "text": "function onLoad() {\n schedule('loaded');\n }", "title": "" }, { "docid": "18c0b82af1021970426cc08f59746531", "score": "0.64265805", "text": "_onLoad() {\n\t\tthis.emit(\"load\");\n\t}", "title": "" }, { "docid": "57aa8f1a9a1df4aa7193daed55e282cc", "score": "0.6401042", "text": "onFirstLoad() {}", "title": "" }, { "docid": "b70bee1e10bffcaf98d41bd74f282604", "score": "0.63555694", "text": "function startatLoad(){\t\n\tloadNavbar(function(){\n\t\tgetXMLData(function(){\n\t\t\tgetServerData(function(data){\n\t\t\t\tsetValues(data, function(){\n\t\t\t\t\trefresh();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "39535e10482e080e93698709a24f74cd", "score": "0.6339147", "text": "static onLoaded(part) {\n part.loaded()\n }", "title": "" }, { "docid": "e47ad148549b76b2a5df5b45023789e7", "score": "0.6333048", "text": "loaded() {\n\n }", "title": "" }, { "docid": "556b5946e154f91333c90375bcce4eb6", "score": "0.6327061", "text": "function loadData() {\n console.time('pipelineCanvasCtrl.loadData');\n loadPipeline()\n .then(loadExecution)\n .then(function () {\n console.timeEnd('pipelineCanvasCtrl.loadData');\n // Initialize refresh here.\n refreshService.add(\"ppl-canvas\", function update() {\n if (data.execution.update) {\n loadExecution();\n }\n });\n }, function (error) {\n statusService.error(\"Can't load pipeline.\", error);\n });\n }", "title": "" }, { "docid": "b25a9d58bd7974557cd81aa820d2d110", "score": "0.6322905", "text": "function preLoad(){\n // load something and continue on only when finished\n}", "title": "" }, { "docid": "5715103416338bdd57db399df698ecc6", "score": "0.63044673", "text": "async afterLoad() {}", "title": "" }, { "docid": "5cd7b3b11dae614da442a5d3e5e9d7c2", "score": "0.6299749", "text": "function loaded() {\n // TODO : It's as a global variable for debug then switch back to local one.\n window.dataBaseManager = new DataBaseManager(MODEL_NAME);\n dataBaseManager.loadDatas();\n $('#launchFullSynch').click(function() {\n dataBaseManager.reloadDatas();\n });\n var entityKindSwitcher = new EntityKindSwitcher(dataBaseManager);\n var ecm = new EntityCreationManager(dataBaseManager,entityKindSwitcher);\n}", "title": "" }, { "docid": "cb5a77deeee907b297b08f5ec021baa3", "score": "0.62868917", "text": "onLoad() {\n if (this._load) {\n this._load.raise();\n }\n }", "title": "" }, { "docid": "4c88c02fc23db773122d1a36c854120b", "score": "0.6274125", "text": "function onLoaded() {\n loaded.push(obj);\n\n // If it exported something, grab that\n var module = (typeof window.module.exports === 'function' || typeof window.module.exports === 'object') ? window.module.exports : null;\n obj.export = module;\n\n // Reset module exports\n window.module.exports = {};\n\n trigger('load:' + obj.code, [module]);\n trigger('load');\n }", "title": "" }, { "docid": "e8740e63f8a5fd26384899907f0c4949", "score": "0.6265867", "text": "function enablerInitialized() {\n\n // re-structure data (DCM data pass / feed / key-values / etc...)\n if (dynamicContent) {\n data = dynamicContent.soshTradelab_training_feed_master_feed;\n } else {\n data = devDynamicContent.soshTradelab_training_feed_master_feed;\n }\n\n // page is loaded (polite load)\n if (Enabler.isPageLoaded()) {\n pageLoaded();\n } else {\n Enabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, pageLoaded);\n }\n\n}", "title": "" }, { "docid": "b5a009bc484a25d5563a416eb39b7995", "score": "0.6260693", "text": "function load()\n{\n dashcode.setupParts();\n refreshTickerValues();\n}", "title": "" }, { "docid": "6edcfc7129decaaa578e316bb8386ade", "score": "0.623056", "text": "function init_load_data() {\n\tload_tags();\n\tload_categories();\n\tload_replies();\n}", "title": "" }, { "docid": "0cb16ccea7f01c67b46512a2acd76524", "score": "0.62194705", "text": "function initializeDataOnPageLoad () {\n // Hard reset / url with query requires waiting for api response\n if (fileBrowserFactory.assayFiles.length === 0) {\n vm.refreshAssayFiles();\n // Tabbing does not require api response wait and update query in URL\n } else {\n checkAndUpdateGridData();\n }\n }", "title": "" }, { "docid": "22facb086f7c53e7e41ed3e28542e411", "score": "0.6204717", "text": "componentDidMount()\n\t{\n\t\tthis.props.onLoadData();\n\t}", "title": "" }, { "docid": "46fbcf31c4fce38c598866375aea2313", "score": "0.6174131", "text": "function startatLoad()\n{\n\tloadNavbar(function()\n\t{\n\t\tgetAINXMLData(function(){\n\t\t\tshowAINvalues();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "cd99ae130502a4908ed53cf6e6456096", "score": "0.616656", "text": "componentDidMount() {\n this.loadData()\n }", "title": "" }, { "docid": "5af688af461e0ab99f1ac61cba74f229", "score": "0.6165345", "text": "function page_loaded() {\n post_load_setup();\n }", "title": "" }, { "docid": "02d7bc4a08edd62fc6a288b51f1583e3", "score": "0.61326253", "text": "componentDidUpdate() {\n this.loadData();\n }", "title": "" }, { "docid": "249a64c6cdd66368801c9751535f2b50", "score": "0.6128214", "text": "componentDidMount() {\n Promise.all([\n this.getClarkData(),\n this.getVivintData(),\n this.getZooData(),\n this.getLibertyData(),\n this.getTrolleyData()\n ]).then(() => {\n this.setState({\n loaded: true\n })\n }\n ).catch(err => {\n alert(\"Data failed to load. Error: \" + err)\n })\n }", "title": "" }, { "docid": "e87870be6a30119158a9edd65b08363f", "score": "0.6127163", "text": "componentDidMount() {\n\n // Load the data\n this.loadData();\n }", "title": "" }, { "docid": "92ee7a012da9852048e7a4aa18af3735", "score": "0.61259305", "text": "init() {\n window.lazyLoad = window.lazyLoad || {};\n const lazyLoad = window.lazyLoad;\n\n lazyLoad.addToQueue = (el, fit) => { // eslint-disable-line consistent-return\n el[REMOVE_ATTRIBUTE](\"onload\");\n if (el[HAS_ATTRIBUTE](\"data-load-immediately\")) {\n if (fit) return lazyLoadModule.loadImageDiv({ target: el.parentElement });\n return lazyLoadModule.loadImage({ target: el });\n }\n\n if (fit) {\n const imageDiv = el.parentElement;\n imageDiv[ADD_EVENT_LISTENER](LAZY_LOAD, lazyLoadModule.loadImageDiv);\n lazyLoadModule.queue.unshift(imageDiv);\n lazyLoadModule.loadImageIfVisible(imageDiv);\n } else {\n el[ADD_EVENT_LISTENER](LAZY_LOAD, lazyLoadModule.loadImage);\n lazyLoadModule.queue.unshift(el);\n lazyLoadModule.loadImageIfVisible(el);\n }\n };\n\n onDomReady(() => {\n // need to load pubsub globally, since it is included in inception. We define it in our layout/index file\n pubsub = $rmod.require('/$/raptor-pubsub');\n siteSpeedChannel = pubsub.channel('site-speed-ebay');\n });\n\n if (window.highline.lazyLoadAll) {\n window[ADD_EVENT_LISTENER](LOAD, lazyLoadModule.loadAll);\n } else {\n lazyLoadModule.resizeHandler = throttle(lazyLoadModule.handler, THROTTLE_DELAY);\n lazyLoadModule.paginationHandler = throttle(lazyLoadModule.carouselHandler, THROTTLE_DELAY);\n lazyLoadModule.scrollHandler = throttle(lazyLoadModule.handler, THROTTLE_DELAY);\n\n window[ADD_EVENT_LISTENER](SCROLL, lazyLoadModule.scrollHandler);\n window[ADD_EVENT_LISTENER](RESIZE, lazyLoadModule.resizeHandler);\n onDomReady(() => {\n pubsub.on(CAROUSEL_PAGINATION, lazyLoadModule.paginationHandler);\n pubsub.on(CAROUSEL_SCROLL, lazyLoadModule.paginationHandler);\n });\n }\n\n window[ADD_EVENT_LISTENER](LOAD, lazyLoadModule.reportATFTime);\n }", "title": "" }, { "docid": "8ab5d887e7d85046cc9f5206a083efef", "score": "0.61230165", "text": "get dataEvent(): {on: Function, once: Function, off: Function} {\n\t\tconst\n\t\t\t{async: $a, _dataProvider: $d} = this;\n\n\t\treturn {\n\t\t\ton: (event, fnOrParams, ...args) => {\n\t\t\t\tif (!$d) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn $a.on($d.event, event, fnOrParams, ...args);\n\t\t\t},\n\n\t\t\tonce: (event, fnOrParams, ...args) => {\n\t\t\t\tif (!$d) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn $a.once($d.event, event, fnOrParams, ...args);\n\t\t\t},\n\n\t\t\toff: (...args) => {\n\t\t\t\tif (!$d) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn $a.off(...args);\n\t\t\t}\n\t\t};\n\t}\n\n\t/** @override */\n\t@wait('loading', {label: $$.initLoad, defer: true})\n\tasync initLoad() {\n\t\tthis.block.status = this.block.statuses.loading;\n\n\t\tif (this._dataProvider && this._dataProvider.baseURL) {\n\t\t\tconst\n\t\t\t\tp = this.getParams('get');\n\n\t\t\tif (p) {\n\t\t\t\tObject.assign(p[1], {label: $$.initLoad, join: 'replace'});\n\n\t\t\t\tif (this.initAdvPath) {\n\t\t\t\t\tthis.url(this.initAdvPath);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst db = (await this.get(...p)).responseData;\n\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\tthis.async.requestIdleCallback({\n\t\t\t\t\t\t\tjoin: true,\n\t\t\t\t\t\t\tlabel: $$.initLoad,\n\t\t\t\t\t\t\tfn: () => {\n\t\t\t\t\t\t\t\tthis.db = this.getObservableData(this.dbConverter ? this.dbConverter(db) : db);\n\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t} catch (_) {}\n\n\t\t\t} else {\n\t\t\t\tthis.db = null;\n\t\t\t}\n\t\t}\n\n\t\treturn super.initLoad();\n\t}", "title": "" }, { "docid": "476bab53a821b287bba2ce546b39ca2a", "score": "0.6119804", "text": "function onLoaded() {\n // Wire-up runtime listeners\n player.bind( SC.Widget.Events.LOAD_PROGRESS, function( data ) {\n onStateChange({\n type: \"loadProgress\",\n // currentTime is in ms vs. s\n data: data.currentPosition / 1000\n });\n });\n\n player.bind( SC.Widget.Events.PLAY_PROGRESS, function( data ) {\n onStateChange({\n type: \"playProgress\",\n // currentTime is in ms vs. s\n data: data.currentPosition / 1000\n });\n });\n\n player.bind( SC.Widget.Events.PLAY, function( data ) {\n onStateChange({\n type: \"play\"\n });\n });\n\n player.bind( SC.Widget.Events.PAUSE, function( data ) {\n onStateChange({\n type: \"pause\"\n });\n });\n\n player.bind( SC.Widget.Events.SEEK, function( data ) {\n onStateChange({\n type: \"seek\",\n // currentTime is in ms vs. s\n data: data.currentPosition / 1000\n });\n });\n\n player.bind( SC.Widget.Events.FINISH, function() {\n onStateChange({\n type: \"finish\"\n });\n });\n\n playerReady = true;\n player.getDuration( updateDuration );\n\n // Apply the current controls state again, since we have\n // to do one thing for controls=false and loading, and another\n // for controls=false and loaded.\n setControls( impl.controls );\n }", "title": "" }, { "docid": "bcfa2f9ccb7129a65b3f286c34991ef4", "score": "0.6117221", "text": "componentDidLoad() {\n this.findTileList();\n this.tileCalc();\n }", "title": "" }, { "docid": "ce4b1428da9a0669e05cf3c32de9afce", "score": "0.61142063", "text": "async load() {\n // app > plugin > core\n this.loadApplicationExtend();\n this.loadRequestExtend();\n this.loadResponseExtend();\n this.loadContextExtend();\n this.loadHelperExtend();\n this.loadCustomLoader();\n\n const emitter = new EventEmitter();\n const lifecycle = this.lifecycle;\n\n const executeSymbolFunc = async (obj, fnName) => {\n const properties = Object.getOwnPropertySymbols(obj);\n for (const index of properties) {\n if (index.toString() === BOOTS.toString()) {\n for (const boot of obj[index]) {\n if (boot[fnName]) {\n await boot[fnName]()\n }\n }\n }\n }\n }\n\n lifecycle.triggerConfigWillLoad = async () => {\n await executeSymbolFunc(lifecycle, 'configWillLoad');\n lifecycle.triggerConfigDidLoad();\n emitter.emit(CONTINUE_EVENT_NAME);\n }\n\n // lifecycle.triggerConfigDidLoad = async () => {\n // await executeSymbolFunc(lifecycle, 'configDidLoad');\n // lifecycle.triggerDidLoad();\n // emitter.emit(CONTINUE_EVENT_NAME);\n // }\n\n this.loadCustomApp();\n\n emitter.on(CONTINUE_EVENT_NAME, () => {\n // app > plugin\n this.loadService();\n // app > plugin > core\n this.loadMiddleware();\n // app\n this.loadController();\n // app\n this.loadRouter(); // Dependent on controllers\n })\n }", "title": "" }, { "docid": "018ff7c5ffe141ede4f868c1d0703ae3", "score": "0.61107004", "text": "componentDidMount() {\n this.loadData();\n }", "title": "" }, { "docid": "018ff7c5ffe141ede4f868c1d0703ae3", "score": "0.61107004", "text": "componentDidMount() {\n this.loadData();\n }", "title": "" }, { "docid": "0c48d41e084f92a845814f73c16b3565", "score": "0.6105718", "text": "function _onInit() {\n _parseAttributes(ctrl); /* // parse the bound attributes\n ctrl.data = _parseData(ctrl.data); // parse bound data */\n\n // set the loader scope on init\n LoaderService.setOverlayScope(ctrl.name, $scope);\n\n // set the loader component on init\n LoaderService.addOverlayLoader(ctrl.name, ctrl);\n }", "title": "" }, { "docid": "8b791488734498a1621862371eb2fda4", "score": "0.61005837", "text": "function waitLoad(){\n if (false&&!__.state.isViewLoaded()) {\n setTimeout(waitLoad,500);\n return;\n }\n next();\n __.INITIALIZED=true;\n delete __.INITIALIZING;\n console.log('__.inits._init_() completed');\n $('body').css('opacity','1');\n 'onLoad'._bc();\n }", "title": "" }, { "docid": "79ae989928ef0512565b3d398d21e20a", "score": "0.60937625", "text": "function loadPage() {\n handleNavBars();\n handleBio();\n handlePortfolio();\n checkWindowSize();\n handleCarousel();\n}", "title": "" }, { "docid": "f95da781b0cb8d622806e903504f0663", "score": "0.6089654", "text": "loadData() {\n this.loading = true;\n this.fetchData(\n this.loadEndpoint,\n this.method,\n this.headers,\n this.body\n ).then((data) => {\n this.loading = false;\n this.loadResponse = data;\n /**\n * fires event when forma data is loaded\n * @event simple-fields-form-data-loaded\n */\n this.dispatchEvent(\n new CustomEvent(\"simple-fields-form-data-loaded\", {\n detail: {\n value: data,\n },\n })\n );\n });\n }", "title": "" }, { "docid": "0fc305d475bf50b5cd5ef6febfe8094f", "score": "0.60732853", "text": "componentDidMount() {\n this.loadData();\n }", "title": "" }, { "docid": "0fc305d475bf50b5cd5ef6febfe8094f", "score": "0.60732853", "text": "componentDidMount() {\n this.loadData();\n }", "title": "" }, { "docid": "ade584e1180818264639913d396dc432", "score": "0.60706896", "text": "onLoaded(){\n\n\t}", "title": "" }, { "docid": "84d7b88953c17d90395b874818ef36b5", "score": "0.6065359", "text": "function onLoad(){\n\t\t// should be in the same order\n\n\t\tcheckLocalStorage(); // store and check local storage (must be the first thing on load)\n\n\t\tloadingAnimations(); // loader animations\n\t\n\t}", "title": "" }, { "docid": "4ea7339b46286d695f9d1a283ec0cd55", "score": "0.60644513", "text": "function loadStart() {\r\n\tfield = get_set_Field();\r\n\tnumber = get_set_number();\r\n\tnameString = loadDataForTable();\r\n\tactivateTheHeaderOfTable();\r\n\tinitialize1();\r\n}", "title": "" }, { "docid": "c363a18dbac6834a5617086094728381", "score": "0.6050447", "text": "function loadData() {\n // Begin loading Characters\n Demigod.Services.IItemService.GetAllCharacters(OnCharactersCompleted);\n}", "title": "" }, { "docid": "0a052d53cc88f41b79b3616138fc3e75", "score": "0.6044501", "text": "function handleLoad() {\n // Enable button now that callbacks are available\n var loading = document.querySelector('#loading');\n loading.setAttribute('hidden', '');\n\n var welcome = document.querySelector('#welcome');\n welcome.removeAttribute('hidden');\n\n var viewport = document.querySelector('#viewport');\n app = new App();\n initHeaderMap();\n window.addEventListener('resize', handleResize);\n var sliceRange = document.querySelector('#sliceRange');\n attachListeners(sliceRange);\n}", "title": "" }, { "docid": "ff39df80044844c0d05c9b2b49fb3572", "score": "0.603146", "text": "componentWillMount() {\n this.load();\n }", "title": "" }, { "docid": "0c7ed5844bbab08d49b36be51bcb259e", "score": "0.6025411", "text": "_onDataLoaded() {\n this.state = 'dataLoaded';\n }", "title": "" }, { "docid": "d87462d3ba7da35c0799f75afcdd9de9", "score": "0.60196126", "text": "componentDidMount(){\n this.loadData();\n }", "title": "" }, { "docid": "b2c9343f1bc2274fff6953627c51a9c2", "score": "0.6013692", "text": "function loaded() {\n loadedRactive = Ractive;\n window.Ractive = noConflict;\n loadedRactive.decorators.cssreset = cssResetDecorator; // Make our css reset decorator available to all instances\n loadedRactive.events.tap = RactiveEventsTap; // Make the 'on-tap' event plugin available to all instances\n loadedRactive.defaults.data.getMessage = Messages.getMessage; // Make getMessage available to all instances\n loadedRactive.defaults.twoway = false; // Change the default to disable two-way data bindings.\n loadedRactive.DEBUG = false;\n notifyCallbacks();\n}", "title": "" }, { "docid": "70435742c9561c0e1af9e4bec78b29f9", "score": "0.60078585", "text": "function initLazyElements() {\n $window.lazyLoadXT();\n queueCheckLazyElements();\n }", "title": "" }, { "docid": "3f2e82cec4880db18b7e72baaca4096d", "score": "0.6003778", "text": "onAMDLoadComplete() {\n // override this method in the sub class\n }", "title": "" }, { "docid": "4096011fb0e1297ab4a8f789d5f7ecab", "score": "0.59990925", "text": "componentDidMount() {\n this._load()\n }", "title": "" }, { "docid": "375eaf9cbc6cb507c9a4155617e784da", "score": "0.59975255", "text": "function componentCallback() {\n thisSat.loaded++;\n if(thisSat.loaded == 9) {\n if(callback) { callback(thisSat); }\n }\n }", "title": "" }, { "docid": "2c3e1671a23044abbece4f97d7c2e8c4", "score": "0.59950584", "text": "function load()\n{\n setupParts();\n}", "title": "" }, { "docid": "b98277a0eb28063e3b97ccd94843f762", "score": "0.5988274", "text": "preRender() {\n this.serviceLocator = new ServiceLocator;\n this.initProperties();\n this.initializeServices();\n }", "title": "" }, { "docid": "48fa156a257000a56be0784faaf72db4", "score": "0.59872365", "text": "load() {\n\n }", "title": "" }, { "docid": "f889b48b7ccae0da8bccea795d916976", "score": "0.59858525", "text": "function handleLoad() {\n requestAnimationFrame(() => {\n setIsLoaded(true)\n })\n }", "title": "" }, { "docid": "ea77942460b2e2ef550b1e43bf1c8844", "score": "0.5979909", "text": "componentWillMount(){\n this.load();\n }", "title": "" }, { "docid": "4166f24d30b6da947670393f9a80a775", "score": "0.59774995", "text": "function load() {\r\n if (!loaded) {\r\n loaded = true;\r\n\r\n callback();\r\n }\r\n }", "title": "" }, { "docid": "c3b0b88b413e73602faf4e6eae36e9df", "score": "0.5963873", "text": "function onLoad() {}", "title": "" }, { "docid": "50eed8894dc224649e68c8d88269a349", "score": "0.5950209", "text": "onLoaded() {\n this.state = LOAD_STATE.LOADED;\n\n if (this.slide && this.element) {\n this.instance.dispatch('loadComplete', { slide: this.slide, content: this });\n\n // if content is reloaded\n if (this.slide.isActive\n && this.slide.heavyAppended\n && !this.element.parentNode) {\n this.append();\n this.slide.updateContentSize(true);\n }\n\n if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n this.removePlaceholder();\n }\n }\n }", "title": "" }, { "docid": "58b4c63d8c6b9c6840c2b29be60c6eaf", "score": "0.59463847", "text": "componentDidMount() {\n this.load()\n }", "title": "" }, { "docid": "20e8497c809f4e3eb65b4f861f309505", "score": "0.5938858", "text": "function init(){\n\tvar loadPromise = loadDataset();\n\tloadPromise.done( function(){\n\t\tredraw();\n\t});\n}", "title": "" }, { "docid": "3a17e019ad08d9efa6e2fbcf6d0bd8eb", "score": "0.593697", "text": "onStorageDataFetched(data) {\n this.data = Object.assign({}, this.defaultData, data);\n this.onInitialized();\n this.checkAdvancedFeaturesReset();\n }", "title": "" }, { "docid": "356e8b683378419cde2973a02c032931", "score": "0.59368104", "text": "function pageLoaded() {\n prepareHandles();\n addEventListeners();\n}", "title": "" }, { "docid": "4aea8fe2d9b32aeadcd6d453dff9b582", "score": "0.5935272", "text": "load() {\n\n }", "title": "" }, { "docid": "bdd98f8e8c6c9596eed6fa3d29bea26f", "score": "0.5934494", "text": "didLoad () {\n this.divaReady = true;\n this.displayPanel.setDisplayListeners();\n document.getElementById('loading').style.display = 'none';\n console.log(this.diva);\n }", "title": "" }, { "docid": "89fe29ed819bcbc9d6b4296b70443a34", "score": "0.59340364", "text": "componentDidMount() { // you can't overwrite the lifecycle hooks of a generated component\n\t\tthis.fetchData();\n\t}", "title": "" }, { "docid": "b4b775dc4d72835ed4fe75649aeec08c", "score": "0.5933648", "text": "load() {\n this.parent.loader.add('data', 'assets', {\n type: 'getAllAssets'\n });\n this.parent.loader.add('data', 'initAssetLayerTypes', {\n type: 'getAssetsType'\n });\n }", "title": "" }, { "docid": "1d9dadb2433fc1c381e3a88b15db9c15", "score": "0.59299684", "text": "onLoad() {\n // Do something when a section instance is loaded\n this.init();\n }", "title": "" }, { "docid": "1d9dadb2433fc1c381e3a88b15db9c15", "score": "0.59299684", "text": "onLoad() {\n // Do something when a section instance is loaded\n this.init();\n }", "title": "" }, { "docid": "a30e71a0b273e522f806dab5331a52c2", "score": "0.592973", "text": "load() { this.log('Loaded'); }", "title": "" }, { "docid": "3e88d3944409bcfe41eab8a41722dc15", "score": "0.59235805", "text": "function initialize() {\n loadEventList();\n loadRunnerList();\n initializeEvents();\n }", "title": "" }, { "docid": "b355e80c098afcad075876e372a0fda8", "score": "0.5923204", "text": "function modelReady() \n {\n print(\"ModelReady\");\n loadData(); \n }", "title": "" }, { "docid": "ee8faeedbb56945fe834c86ff2f21c06", "score": "0.592212", "text": "function onScriptLoaded() {\n\n\t\tw.clearInterval(areWeThereYet)\n\n\t\tCountly = w['Countly']\n\t\tCountly.app_key = opt.app_key\n\t\tCountly.url = opt.url\n\t\tCountly.isLoaded = true;\n\t\tCountly.q = _Countly.q\n\n\t\topt.trackers.forEach( trackerName => Countly.q.push([trackerName]) )\n\n\t\tCountly.init()\n\t\tVue.prototype.$countly = Countly\n\t\tapp.$countly = Countly\n\n\t\t// Execute registered callbacks\n\t\t_Countly.isLoaded = true\n\t\tonCountlyLoadCallers.forEach( cb => cb() )\n\t}", "title": "" }, { "docid": "f5ed2f7a25725e08d9e1754aabe7651e", "score": "0.5908232", "text": "delayLoad() {\n }", "title": "" }, { "docid": "0e6524efaa202623f09157d7c0ff7a44", "score": "0.5905933", "text": "function onDOMLoad() {\n\tconsole.log(\"Load Google library\")\n\tgoogle.charts.load('current', {packages: ['corechart']});\n\tgoogle.charts.setOnLoadCallback(getRenewableEnergyData);\n\tgoogle.charts.setOnLoadCallback(getEnergyConsumptionData);\n}", "title": "" }, { "docid": "c98000ce7004ef1441d35269f1c9a849", "score": "0.59012944", "text": "firstUpdated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n // request form when it changes\n if (propName === \"loadEndpoint\" && this.autoload) {\n this.loadData();\n }\n });\n }", "title": "" }, { "docid": "c98000ce7004ef1441d35269f1c9a849", "score": "0.59012944", "text": "firstUpdated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n // request form when it changes\n if (propName === \"loadEndpoint\" && this.autoload) {\n this.loadData();\n }\n });\n }", "title": "" }, { "docid": "de24ee57c5627aa9b1d01d9807a7208f", "score": "0.5900612", "text": "function qodeOnWindowLoad() {\n qodeInitCourseListAnimation();\n qodeInitCoursePagination().init();\n qodeInitElementorCourseList();\n qodeInitElementorCourseSearch();\n qodeInitElementorCourseSlider();\n }", "title": "" }, { "docid": "a8404322ca7a67d942ec8a6fa3787875", "score": "0.58982927", "text": "function initialLoad() {\n\tbuildNav();\n\t\n}", "title": "" }, { "docid": "06f5f649f7d372b7f3d5c905a465fefd", "score": "0.5893818", "text": "componentDidMount() {\n const { dataLoaded, \n dataRequested,\n dataService } = this.props;\n dataRequested()\n dataService.getData()\n .then((data) => dataLoaded(data));\n }", "title": "" }, { "docid": "599a4f6ba28e36e5b11a5ea0a5f93f41", "score": "0.58931303", "text": "function onDashboardLoaded() {\n try {\n\n // Remove the event handler once the function is excuted.\n $evt.removeEventHandler($display, \"start\", onDashboardLoaded);\n\n // Get the Items list control (Tree Control)\n var filteredListControl = $display.getView().getFilteredListControl();\n\n var listControl = filteredListControl.getList();\n\n // Add a event handler when tree control's 'draw' event fired.\n // This is the event when Itemss are loaded in the tree.\n $evt.addEventHandler(listControl, \"draw\", addSearchBox);\n\n // Add a event handler when tree control's 'refresh' event fired.\n // This is the event when item list is refreshed.\n $evt.addEventHandler(listControl, \"refresh\", addSearchBox);\n\n $evt.addEventHandler(listControl, \"focus\", addSearchBox);\n\n }\n catch (error) {\n $messages.registerError(\"Alchemy Items Panel Search Plugin Error: \", error);\n }\n }", "title": "" }, { "docid": "82dad1e6661c750b21becf0dc4230f9e", "score": "0.58929473", "text": "componentDidMount() {\n this.load();\n }", "title": "" }, { "docid": "8e842f62c212fb8e59b95412cf729ae1", "score": "0.58917844", "text": "componentDidMount() {\n this.load();\n }", "title": "" }, { "docid": "9642c02777c6e3dbbed8a4df826ad31a", "score": "0.5891508", "text": "onWidgetLoaded_() {\n cr.dispatchSimpleEvent(this, CWSContainerClient.Events.LOADED);\n }", "title": "" }, { "docid": "a3623bc2b97b4379a57039641bc98a71", "score": "0.5888686", "text": "afterLoaded(){\n\n }", "title": "" }, { "docid": "154c0e3c1d8a4bfb94606567a2ae4aa8", "score": "0.5886221", "text": "_handleLoadProgress() {\n const that = this;\n\n // Only trigger loadstart once\n if (that.loadstartFired) {\n that.trigger('loadedmetadata');\n that.trigger('loadstart');\n that.loadstartFired = true;\n }\n\n that.trigger('progress');\n that.trigger('durationchange');\n }", "title": "" }, { "docid": "61458a5e48fd780d66abdc88feedd0a1", "score": "0.5883835", "text": "function onImageLoad() {\n\tif (++nbLoadedImages >= NB_IMAGES_TO_LOAD) {\n\t\tdoInit();\n\t}\n}", "title": "" }, { "docid": "509f2628978695f47d0fb1252038449b", "score": "0.5878881", "text": "LoadStart() {\n this.lastLoadTime = Date.now();\n }", "title": "" }, { "docid": "d1263403d6bc6b8a44b8be9d74574d1e", "score": "0.58744895", "text": "componentWillMount() {\n this.props.loadData()\n }", "title": "" }, { "docid": "d6308ab8076ffb99379d0e9a7cc97cc6", "score": "0.5873719", "text": "function default_loads() {\n load_component('create_offer');\n}", "title": "" }, { "docid": "d24ada81b21e35cd846100128529b722", "score": "0.58717275", "text": "function load() {\n\t/**\n\t * execute load for dynamic content\n\t */\n\t// function can be plain or called inside a namespace\n\t__garage__.load();\n}", "title": "" }, { "docid": "9ece2f806f7340cac5f3681f5976d51b", "score": "0.5871421", "text": "function ReTriggerOnLoad() {\n Golemanite.Email.Init();\n Golemanite.Dialog.Init();\n Golemanite.Placeholders.Init();\n Golemanite.Maps.Init();\n }", "title": "" }, { "docid": "7a82684c769252c45b7d35a1b1d2ebda", "score": "0.58638126", "text": "function initializeListenersAndValues() {\n loadMetricValues();\n loadMajorIntersections();\n loadSubwayStations();\n loadLandmarks();\n loadRadioButtonListenersForPriceRange();\n loadRadioButtonListenersForLocationSelection ();\n loadChangeListenerForDistanceUnit();\n loadSubmitButtonListener();\n $('[data-toggle=\"tooltip\"]').tooltip({ trigger: \"hover\" });\n}", "title": "" }, { "docid": "9c5160b6280789111a2cc0c95e9adb08", "score": "0.58542424", "text": "function setup() {\n // Bind init (below) to store changes temporarily\n Store.addChangeListener(init);\n // Fetch setup data\n ajax.setup();\n // Render preloader\n ReactDOM.render(\n <div className=\"preloader preloader-big\">\n <Preloader />\n </div>,\n document.getElementById('commerce-reservations-ui')\n );\n}", "title": "" }, { "docid": "d57e5f2186535acb36053dff70e9b074", "score": "0.5853063", "text": "function onLoadFunction() {\n // Check if the page load is complete.\n if (document.readyState !== 'complete') {\n setTimeout(() => {\n onLoadFunction();\n }, 50);\n } else {\n checkState();\n initTool();\n setSharingLinks();\n buildCSSAttributesList();\n // Last used V1.1.5 (14.4.18)\n //documentClone = $('body').clone(true);\n enableRedline();\n setZoom();\n bindListeners();\n }\n}", "title": "" }, { "docid": "c4771b5eef7f50ea32a4648fbcbb9757", "score": "0.5850364", "text": "function runOnLoad(f) {\n if (runOnLoad.loaded) f(); // If already loaded, just invoke f() now.\n else runOnLoad.funcs.push(f); // Otherwise, store it for later\n}", "title": "" }, { "docid": "6cec02aab64c3799da2eab5ac7f15e1e", "score": "0.58492565", "text": "load() {\n }", "title": "" }, { "docid": "6cec02aab64c3799da2eab5ac7f15e1e", "score": "0.58492565", "text": "load() {\n }", "title": "" } ]
672f5c3e718ea7667c10c58bf718382d
Script data escaped lessthan sign state
[ { "docid": "34f19b3ff7d0391cabe776f34f877f7a", "score": "0.5163699", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $$1.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" } ]
[ { "docid": "e7df31e2081e7e4af93ff2759edae298", "score": "0.62397724", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "8af466ae4e7f0fd9e00b69854c0c4499", "score": "0.60940295", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "8af466ae4e7f0fd9e00b69854c0c4499", "score": "0.60940295", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "8af466ae4e7f0fd9e00b69854c0c4499", "score": "0.60940295", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "8af466ae4e7f0fd9e00b69854c0c4499", "score": "0.60940295", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "8af466ae4e7f0fd9e00b69854c0c4499", "score": "0.60940295", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "2db5342ca5cb8a3ece6a2606ab3fd759", "score": "0.6029901", "text": "[SCRIPT_DATA_ESCAPED_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $$1.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $$1.NULL) {\n this._err(errorCodes.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $$1.EOF) {\n this._err(errorCodes.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "44f083138ab98f4c141181b794fd71ac", "score": "0.60122067", "text": "function scriptDataLessThanSign(c){\n if(c == '/'){\n return scriptDataEndTagOpen\n }else{\n emit({\n type:'text',\n content:\"<\"\n })\n //let scriptData continue to process 'c'\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "2f6b8c3d37864dad327d210043065bb6", "score": "0.59190863", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars(\">\");\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "4b354e48099939ddf9cc524d6e3d15c7", "score": "0.58106107", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "4b354e48099939ddf9cc524d6e3d15c7", "score": "0.58106107", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "4b354e48099939ddf9cc524d6e3d15c7", "score": "0.58106107", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "4b354e48099939ddf9cc524d6e3d15c7", "score": "0.58106107", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "4b354e48099939ddf9cc524d6e3d15c7", "score": "0.58106107", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "3f0c9d81a19989b6fb077877209a1a69", "score": "0.58054286", "text": "[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $$1.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $$1.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $$1.NULL) {\n this._err(errorCodes.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $$1.EOF) {\n this._err(errorCodes.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "855b40ffd33ea06962c813587ed99449", "score": "0.5747916", "text": "function eaue () {\n stash += c\n escaped = false\n}", "title": "" }, { "docid": "e9ed17df68d2e457435f13d513098c73", "score": "0.5697779", "text": "function scriptDataEndTagOpen(c){\n if(c == 's'){\n return scriptDataEndTagNameS\n }else{\n emit({\n type:'text',\n content:\"<\"\n })\n emit({\n type:'text',\n content:\"/\"\n })\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "c19411fdd4b9bace8692a8a1c5ed14fc", "score": "0.5681035", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "002b5388ac4dc70337e773fb148e29fb", "score": "0.5646602", "text": "function scriptDataLessThanSign(c) {\n if (c == '/') {\n return scriptDataEndTagOpen\n } else {\n emit({\n type: 'text',\n content: '<'\n })\n emit({\n type: 'text',\n content: c\n })\n return scriptData\n }\n}", "title": "" }, { "docid": "05f8d570f97cedfb2de67a2883411697", "score": "0.5627395", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars(\"<\");\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars(\"<\");\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "bb4a7d663b72a05877f55262f703b135", "score": "0.55639267", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "bb4a7d663b72a05877f55262f703b135", "score": "0.55639267", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "bb4a7d663b72a05877f55262f703b135", "score": "0.55639267", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "bb4a7d663b72a05877f55262f703b135", "score": "0.55639267", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "bb4a7d663b72a05877f55262f703b135", "score": "0.55639267", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "93524d8ba4d30de30705567fec7b7c5b", "score": "0.5546852", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (\n isWhitespace(cp) ||\n cp === $.SOLIDUS ||\n cp === $.GREATER_THAN_SIGN\n ) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "89debdd7cf3c71422f707bede223e265", "score": "0.5528377", "text": "script (...args) {\n const attribs = args.find(x => typeof x === 'object' && x !== null /* I hate you */) || {}\n const stringContents = args.find(x => typeof x === 'string')\n if (stringContents) {\n // if there is an inline script, with some suss maybe parser breaking markup, do data uri embedding\n if (stringContents.includes('</')) {\n const uriAttribs = { src: `data:text/javascript;base64,${Buffer.from(stringContents).toString('base64')}`, ...attribs }\n this.tag('script', uriAttribs)\n } else {\n this.tag('script', attribs, v => v._rawText(stringContents))\n }\n } else {\n this.tag('script', attribs)\n }\n }", "title": "" }, { "docid": "f0c7b31072a84ed061ca83cc2318742c", "score": "0.5524608", "text": "function escaped() {\n var chars = [0x00,0xff,0x100,0xd8ff,0xffff,0x10000,0xffffffff];\n var buf = converter.encode(\"ESCAPED\", chars);\n var str = buf.toString(\"ascii\");\n console.log(\"escaped: \"+ str);\n console.log(\"apg-conv-api: test suite: escaped: OK\");\n }", "title": "" }, { "docid": "f446537b517dbed510bdf96d8a699bae", "score": "0.5502568", "text": "[SCRIPT_DATA_ESCAPED_DASH_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $$1.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;\n } else if (cp === $$1.NULL) {\n this._err(errorCodes.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $$1.EOF) {\n this._err(errorCodes.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "5e1945e9a8df1af971586176f877ea42", "score": "0.549177", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars(\"<\");\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars(\">\");\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "1428f1a022663ffe74af232f9156d6d3", "score": "0.54841", "text": "function scriptDataEndTagNameS(c){\n if(c == 'c'){\n return scriptDataEndTagNameC\n }else{\n emit({\n type:'text',\n content:\"</s\"\n })\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "bf85d4bd20d1638b4e1c433ce5885d69", "score": "0.5472818", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars(\"<\");\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "12c897c32f83e16990e51287d1a55d73", "score": "0.54492384", "text": "function Arbshell(n) {\r\n //n is string here\r\n //serialize n\r\n this.value = n.replace(/(\\t|\\s|[a-zA-Z])/g, \"\");\r\n }", "title": "" }, { "docid": "003bd9f2eebbd0f6c50e2b7da4cc0821", "score": "0.544241", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "003bd9f2eebbd0f6c50e2b7da4cc0821", "score": "0.544241", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "003bd9f2eebbd0f6c50e2b7da4cc0821", "score": "0.544241", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "003bd9f2eebbd0f6c50e2b7da4cc0821", "score": "0.544241", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "003bd9f2eebbd0f6c50e2b7da4cc0821", "score": "0.544241", "text": "[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;\n } else if (isAsciiLetter(cp)) {\n this.tempBuff = [];\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "8384327d2ee5658e33c2e5a40a6c3732", "score": "0.5438088", "text": "function aue () {\n stash += BACK_SLASH + c\n escaped = false\n}", "title": "" }, { "docid": "18b2f0d3799e59f6fe544a09d8e182bb", "score": "0.542264", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "18b2f0d3799e59f6fe544a09d8e182bb", "score": "0.542264", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "18b2f0d3799e59f6fe544a09d8e182bb", "score": "0.542264", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "18b2f0d3799e59f6fe544a09d8e182bb", "score": "0.542264", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "18b2f0d3799e59f6fe544a09d8e182bb", "score": "0.542264", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "e450ef65f460bbe380f2b332cb6e0fe4", "score": "0.53909695", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "e450ef65f460bbe380f2b332cb6e0fe4", "score": "0.53909695", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "e450ef65f460bbe380f2b332cb6e0fe4", "score": "0.53909695", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "e450ef65f460bbe380f2b332cb6e0fe4", "score": "0.53909695", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "e450ef65f460bbe380f2b332cb6e0fe4", "score": "0.53909695", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "103c26766c4d9bf5e96893d6f5884e9b", "score": "0.5379573", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars(\"-\");\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "a41317a9521e2584ceee5ff809f8c70b", "score": "0.53653216", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars(\"<!\");\n } else {\n this._emitChars(\"<\");\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "a570b23198b1a48bb5aa36110bb0fd6d", "score": "0.5340017", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "a570b23198b1a48bb5aa36110bb0fd6d", "score": "0.5340017", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "a570b23198b1a48bb5aa36110bb0fd6d", "score": "0.5340017", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "a570b23198b1a48bb5aa36110bb0fd6d", "score": "0.5340017", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "a570b23198b1a48bb5aa36110bb0fd6d", "score": "0.5340017", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "f2924440e576f0fe733416e2a0f2c497", "score": "0.52887505", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this._emitChars('-');\n } else if (cp === $$1.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $$1.GREATER_THAN_SIGN) {\n this.state = SCRIPT_DATA_STATE;\n this._emitChars('>');\n } else if (cp === $$1.NULL) {\n this._err(errorCodes.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $$1.EOF) {\n this._err(errorCodes.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "ccb378f44d47058fde61ef7b1e2544bd", "score": "0.5274874", "text": "function scriptDataEndTagOpen(c) {\n if (c == 's') {\n return scriptDataEndTagOpenS\n } else {\n emit({\n type: 'text',\n content: '</'\n })\n emit({\n type: 'text',\n content: c\n })\n return scriptData\n }\n}", "title": "" }, { "docid": "81159d01940de38b26837c0afcf2b14e", "score": "0.5267504", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars('<!');\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "81159d01940de38b26837c0afcf2b14e", "score": "0.5267504", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars('<!');\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "81159d01940de38b26837c0afcf2b14e", "score": "0.5267504", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars('<!');\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "81159d01940de38b26837c0afcf2b14e", "score": "0.5267504", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars('<!');\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "81159d01940de38b26837c0afcf2b14e", "score": "0.5267504", "text": "[SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;\n } else if (cp === $.EXCLAMATION_MARK) {\n this.state = SCRIPT_DATA_ESCAPE_START_STATE;\n this._emitChars('<!');\n } else {\n this._emitChars('<');\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "102d9f9ad5976d0cfae632c6f16738a3", "score": "0.52651167", "text": "function scriptDataEndTagNameP(c){\n if(c == 't'){\n return scriptDataEndTag\n }else{\n emit({\n type:'text',\n content:\"</scrip\"\n })\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "7f1507046b0a4b1c72ec2069b9134386", "score": "0.5244077", "text": "function scriptDataEndTagNameR(c){\n if(c == 'i'){\n return scriptDataEndTagNameI\n }else{\n emit({\n type:'text',\n content:\"</scr\"\n })\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "22eed9396648ca25e1950935810ee5a9", "score": "0.52438486", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "22eed9396648ca25e1950935810ee5a9", "score": "0.52438486", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "22eed9396648ca25e1950935810ee5a9", "score": "0.52438486", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "22eed9396648ca25e1950935810ee5a9", "score": "0.52438486", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "22eed9396648ca25e1950935810ee5a9", "score": "0.52438486", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "4ae124c9c4caf1e1574126f6fb467e68", "score": "0.52341735", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;\n this._emitChars('-');\n } else if (cp === $$1.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars('<');\n } else if (cp === $$1.NULL) {\n this._err(errorCodes.unexpectedNullCharacter);\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $$1.EOF) {\n this._err(errorCodes.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "850a4c5bff74e9628c46ae4f28c7c4ab", "score": "0.5232779", "text": "function SafeScript(){}", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "4c8142265d3592567f25b7dcf65779bf", "score": "0.52303576", "text": "function SafeScript() { }", "title": "" }, { "docid": "2a575beec3eb3b6c85f9be185a4e312a", "score": "0.5211417", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) {\n if (cp === $.SOLIDUS) {\n this.tempBuff = [];\n this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;\n this._emitChars(\"/\");\n } else {\n this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "622a8d63e47c75ca7d9ebf47cde9159e", "score": "0.5211349", "text": "[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE](cp) {\n if (isWhitespace$1(cp) || cp === $$1.SOLIDUS || cp === $$1.GREATER_THAN_SIGN) {\n this.state = this._isTempBufferEqualToScriptString()\n ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE\n : SCRIPT_DATA_ESCAPED_STATE;\n this._emitCodePoint(cp);\n } else if (isAsciiUpper(cp)) {\n this.tempBuff.push(toAsciiLowerCodePoint(cp));\n this._emitCodePoint(cp);\n } else if (isAsciiLower(cp)) {\n this.tempBuff.push(cp);\n this._emitCodePoint(cp);\n } else {\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "5fa5f84079ede7323c2db38cf69af5b2", "score": "0.52088743", "text": "function SafeScript() {}", "title": "" }, { "docid": "5fa5f84079ede7323c2db38cf69af5b2", "score": "0.52088743", "text": "function SafeScript() {}", "title": "" }, { "docid": "5fa5f84079ede7323c2db38cf69af5b2", "score": "0.52088743", "text": "function SafeScript() {}", "title": "" }, { "docid": "5fa5f84079ede7323c2db38cf69af5b2", "score": "0.52088743", "text": "function SafeScript() {}", "title": "" }, { "docid": "6264a58e846c65831930fef2febfd366", "score": "0.5205309", "text": "[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE](cp) {\n if (isAsciiLetter(cp)) {\n this._createEndTagToken();\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE);\n } else {\n this._emitChars(\"</\");\n this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);\n }\n }", "title": "" }, { "docid": "5c04a915ebbd863e49592ee0f6a137b5", "score": "0.5197405", "text": "function regExpEscape(s){return s.replace(/[|\\\\{}()[\\]^$+*?.]/g,'\\\\$&');}// Uncompress data, assumed to be series of bgzipped blocks", "title": "" }, { "docid": "2a0ed906f94a159bcb2cf616aa8fb0d8", "score": "0.51716167", "text": "function regExpEscape$1(s){return s.replace(/[|\\\\{}()[\\]^$+*?.]/g,'\\\\$&');}// Uncompress data, assumed to be series of bgzipped blocks", "title": "" }, { "docid": "50b1b92ae865e15098830c58e9fa41f8", "score": "0.5171559", "text": "function n318941() { return '\"W'; }", "title": "" }, { "docid": "969cccaa180eb6eaf3243ab1c04ada72", "score": "0.51405656", "text": "function scriptDataEndTagNameC(c){\n if(c == 'r'){\n return scriptDataEndTagNameR\n }else{\n emit({\n type:'text',\n content:\"</sc\"\n })\n return scriptData(c)\n }\n}", "title": "" }, { "docid": "77593ae1e20fc47429e19f03ddc5205a", "score": "0.5130216", "text": "[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE](cp) {\n if (cp === $.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE;\n this._emitChars(\"-\");\n } else if (cp === $.LESS_THAN_SIGN) {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;\n this._emitChars(\"<\");\n } else if (cp === $.NULL) {\n this._err(ERR.unexpectedNullCharacter);\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitChars(unicode.REPLACEMENT_CHARACTER);\n } else if (cp === $.EOF) {\n this._err(ERR.eofInScriptHtmlCommentLikeText);\n this._emitEOFToken();\n } else {\n this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;\n this._emitCodePoint(cp);\n }\n }", "title": "" }, { "docid": "f45076b5ce80379d8ab4d6308504dc6a", "score": "0.512971", "text": "enterHexLiteral(ctx) {\n\t}", "title": "" }, { "docid": "7108485706da83cae02153272b86d7e2", "score": "0.51288235", "text": "function escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes){\n\tif (typeof(s) != \"string\") return \"\";\n\t\n\tvar result = \"\";\n\tfor (var i = 0; i < s.length; i++) {\n\t\tvar ch = s.charAt(i);\n\t\tswitch (ch) {\n\t\tcase '\\'':\n\t\t\tif (escapeSingleQuotes == null || escapeSingleQuotes)\n\t\t\t\tresult += \"\\\\\\'\";\n\t\t\tbreak;\n\t\tcase '\\\"':\n\t\t\tif (escapeDoubleQuotes == null || escapeDoubleQuotes)\n\t\t\t\tresult += \"\\\\\\\"\";\n\t\t\tbreak;\n\t\tcase '\\\\':\n\t\t\tresult += \"\\\\\\\\\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult += ch;\n\t\t}\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "9b07570fc25e6bd581ebf723fe464dd4", "score": "0.51178366", "text": "[SCRIPT_DATA_ESCAPE_START_STATE](cp) {\n if (cp === $$1.HYPHEN_MINUS) {\n this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;\n this._emitChars('-');\n } else {\n this._reconsumeInState(SCRIPT_DATA_STATE);\n }\n }", "title": "" }, { "docid": "2519aedac40d140818b1be5e5c257894", "score": "0.5106796", "text": "function convertNonJs(data) {\n data = data.replace(/\\r/g, \"\\\\r\");\n data = data.replace(/\\n/g, \"\\\\n\");\n data = data.replace( /\\u0022/g, \"\\\\\\u0022\"); //double quotes need escaping\n data = \"\\\"\" + data + \"\\\"\";\n\n return data;\n }", "title": "" }, { "docid": "ce2a96f175c9f6c16cbc364b515978a2", "score": "0.50901645", "text": "function escapeHtmlInlineScript(s, escapeSingleQuotes, escapeDoubleQuotes){\n\treturn htmlEncode(escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes));\n}", "title": "" }, { "docid": "66af4d5a2ae57c29ffbf7dee8122e539", "score": "0.508698", "text": "function inject(cb, data) {\n\t\t// Initialize the escaped data.\n\t\tvar escaped = JSON.stringify(data),\n\t\t\t// Initialize the script node.\n\t\t\tscript = document.createElement('script'),\n\t\t\t// Initialize the text node.\n\t\t\ttext = document.createTextNode('(' + cb + ')(' + escaped + ');');\n\t\t// Add the text node to the script node.\n\t\tscript.appendChild(text);\n\t\t// Append the element temporarily to the document.\n\t\tdocument.body.appendChild(script).parentNode.removeChild(script);\n\t}", "title": "" } ]
1658f8e39dbce7a3bdc373dc017b9ff8
Listens to the 'FlightStatusInfo' oracle triggered event
[ { "docid": "0d98204b99178cac4952d36ef91997a1", "score": "0.73506296", "text": "listenOracleResponse(callback) {\n let self = this;\n self.flightSuretyApp.events.FlightStatusInfo(callback);\n }", "title": "" } ]
[ { "docid": "62761436ce2eccd346110cb1f9a5e5a7", "score": "0.66056854", "text": "listen(){\n console.log(chalk.blue('Listening for OracleQuery events:'));\n this.bizNetworkConnection.on('event', async (evt)=>{\n if (evt.flightRecordId && evt.$type === \"OracleQuery\") {\n console.log(chalk.blue('-----------------------------------------------------------'));\n console.log('Oracle query event registered with flightRecordId: '+ chalk.blue(evt.flightRecordId));\n\n let flightDetails = this.splitFlightRecordId(evt.flightRecordId);\n\n let { flightDesignator, departureDate } = flightDetails;\n\n let flightStatus = constants.ON_SCHEDULE //await this.getFlightStatus(flightDesignator, departureDate);\n\n await this.publishFlightRecord(evt.flightRecordId, flightStatus); \n }\n \n });\n }", "title": "" }, { "docid": "a870f7ed8252b393c2f3dab8978b436e", "score": "0.6427529", "text": "function onFilingTrackingStatusReceived() {\n notificationService.showFilingNotification(FilingStatus.active);\n }", "title": "" }, { "docid": "619417aec823a8771968ac8cc8345d41", "score": "0.6109008", "text": "fetchFlightStatus(flight, callback) {\n let self = this;\n let statusResult = null;\n let statusError = null;\n \n // console.log('Inside contract.js/fetchFlightStatus() function ');\n // console.log('Below is the printout of the flight information sent from Index.js file ');\n // console.log(flight);\n // Sending a transaction to the App contract function fetchFlightStatus. This app contract function\n // is triggering the oracle algorithm inside the app contract.\n self.flightSuretyApp.methods\n .fetchFlightStatus(flight.address, flight.flight, flight.timestamp)\n .send({ from: self.owner}, (error, result) => {\n console.log('Inside callback of contract.js/fetchFlightStatus function ');\n console.log(error,result);\n if(error) {\n callback(error,result);\n }\n // callback(error, result, statusCodeRes);\n //console.log(\"Status Access - StatusCode = \"+statusCodeRes);\n });\n\n // Events Listeners\n self.flightSuretyApp.events.FlightStatusResult({fromBlock: 0}, function (error, event) {\n console.log('Oracle event reported from processFlightStatus function of app contract')\n console.log(event);\n console.log('Event Emitted = '+event.event);\n console.log(event.returnValues.result);\n // console.log(error,event);\n console.log('Flight = '+event.returnValues.flight);\n console.log('statusCode ='+event.returnValues.statusCode);\n statusError = error;\n statusResult = event;\n callback(statusError, statusResult);\n });\n\n \n self.flightSuretyApp.events.OracleReport({fromBlock: 0}, function (error, event) {\n console.log('Oracle event reported from submitOracleResponse function of app contract')\n console.log('Event Emitted = '+event.event);\n // console.log(error,event);\n console.log('Flight = '+event.returnValues.flight);\n console.log('statusCode ='+event.returnValues.status);\n });\n \n \n\n\n // With the commented out \"allEvents\" listener below you could listen to all the events emitted by the app\n // contract.\n /*\n self.flightSuretyApp.events.allEvents({fromBlock: 0}, function (error, event) {\n console.log(error,event);\n });\n */\n\n }", "title": "" }, { "docid": "7268f2cf3294ebfde1dde7de52c1ba5c", "score": "0.5973555", "text": "_onSelectStatusChange(e, key, payload) {\n this._generateFieldChangeEvent('status', payload)\n }", "title": "" }, { "docid": "2761a747437f70d5ca41a10348c1bdf5", "score": "0.5939399", "text": "getFlightStatus(airline, flight, timestamp, callback) {\n let self = this;\n self.flightSuretyApp.methods\n .getFlightStatus(airline, flight, timestamp)\n .call((error, result) => {\n callback(error, result);\n })\n }", "title": "" }, { "docid": "69f27947a40a8d246dc1662c774293b0", "score": "0.58603644", "text": "fetchFlightStatus(flight, callback) {\n let self = this;\n let payload = {\n airline: self.airlines[0],\n flight: flight,\n timestamp: self.schedule[flight],\n } \n self.flightSuretyApp.methods\n .fetchFlightStatus(payload.airline, payload.flight, payload.timestamp)\n .send({ from: self.owner}, (error, result) => {\n callback(error, payload);\n });\n }", "title": "" }, { "docid": "c8af6e58e1c4b97ae256d8e47e12388b", "score": "0.58512586", "text": "fetchFlightStatus(airline, flight, timestamp, callback) {\n let self = this;\n let payload = {\n airline: airline,\n flight: flight,\n timestamp: timestamp\n } \n self.flightSuretyApp.methods\n .fetchFlightStatus(payload.airline, payload.flight, payload.timestamp)\n .send({ from: self.owner}, callback);\n }", "title": "" }, { "docid": "ffd03bc4673d4d9cb4a2cd5ef67e2365", "score": "0.58404356", "text": "checkInsuranceStatus(flight, callback) {\n let self = this;\n let payload = {\n airline: self.airlines[0],\n flight: flight,\n timestamp: self.schedule[flight],\n }\n\n self.flightSuretyApp.methods\n .checkInsuranceStatus(payload.airline, payload.flight, payload.timestamp)\n .call({ from: self.owner}, callback);\n }", "title": "" }, { "docid": "b7524d6df2eb56430e1ce7e0973be157", "score": "0.5786608", "text": "async fetchFlightStatus(addressAirline, flight, timestamp, callback) {\n let self = this;\n let currentAddress = await ethereum.request({method: 'eth_accounts'});\n let payload = {\n airline: addressAirline,\n flight: flight,\n timestamp: timestamp\n }\n\n alert('Requesting flight status from oracles - please wait!');\n\n /*function for the oraclereport event (emitted by the submitOracleResponse()-function) is set and\n momentarily put to the side as no return values are yet visible*/\n self.flightSuretyApp.events.OracleReport({})\n .on('data', async function(event){ \n console.log(event.returnValues);\n let results = {\n flight: event.returnValues.flight,\n timestamp: event.returnValues.timestamp,\n status: event.returnValues.status\n }\n callback(results.flight, results.status, results.timestamp);\n }).on('error', console.error);\n\n /*due to asynchronous execution the flight status can be fetched and afterwards the event listener \n display the result to the user*/\n await self.flightSuretyApp.methods\n .fetchFlightStatus(payload.airline, payload.flight, payload.timestamp)\n .send({ from: currentAddress[0]}, (error, result) => {\n console.log(error, result);\n //callback(error, result);\n });\n }", "title": "" }, { "docid": "060f667935101116480018897c0e8d81", "score": "0.57480556", "text": "function statusHandler(e) {\n console.log(e.target.id)\n props.changeStatus(e.target.id)\n }", "title": "" }, { "docid": "fe5fe2ed60c757aa5be5942883a4477d", "score": "0.56527925", "text": "function SetStatusChanged( status ) {}", "title": "" }, { "docid": "9bff56bce07744e60663e4b839455313", "score": "0.5531507", "text": "handleStatusChange(event) {\n if (event.detail.status === \"FINISHED\") {\n // this.isModalOpen = false;\n this.startFlow = false; // This variable controls the Flow for adding Objectives\n this.showStage = true; // This shows the Stage Picklist Selector\n this.getUsage(); // This repopulates the variable Area/SD data after the flow\n }\n }", "title": "" }, { "docid": "9560a89be6faa5707a833f4dc5fa3f91", "score": "0.5446127", "text": "function trigger() {\n var flight = $.parameter('flight');\n var location = decodeURI($.parameter('location'));\n processing(flight,location);\n }", "title": "" }, { "docid": "63a36284c1ba5db1849ddfe9946051b8", "score": "0.5408888", "text": "OnStatusChanged(spiStatus)\n {\n if (this._spi.CurrentFlow == SpiFlow.Idle) {\n this._log.Clear();\n }\n this.PrintStatusAndActions();\n }", "title": "" }, { "docid": "616fce1633ca546e3bfba97817e4b12c", "score": "0.5328657", "text": "function statusHandler(e){\n setStatus(e.target.value);\n }", "title": "" }, { "docid": "6d991e8a7b73b97cd002ba9918de5a2f", "score": "0.525493", "text": "function infoEventActivite(event, jsEvent, view) {\n\t\t\t\t\t// var old_color = $(this).css('border-color');\n\t\t\t\t\t// $(this).css('border-color', 'red');\n\n\t\t\t\t\tvar activite = event.original;\n\t\t\t\t\tvar message = \"infos sur actvite id \" + activite.id + \"\\n\" + \"datedebut :\" + activite.json.datedebut + \"\\n\" + \"start :\" + event.start.format() + \"\\n\" + \"datefin :\" + activite.json.datefin + \"\\n\" + \" event.id : \" + event.id + \"\\n\" + \" event._id : \" + event._id;\n\n\t\t\t\t\tvar moyen = activite.getRelations(restRepoMoyens, function(moyen) {\n\t\t\t\t\t\tmessage = message + \"moyen :\" + moyen.id + \" deployé \" + moyen.nb_activites + \" fois\";\n\n\t\t\t\t\t\tdialog.alert(message);\n\t\t\t\t\t});\n\t\t\t\t\t// $(this).css('border-color', old_color);\n\t\t\t\t}", "title": "" }, { "docid": "ad8019d6082eafc42c7c4e3ebb315c36", "score": "0.5247944", "text": "function FWStatus(oper){\n\t\tvar ws = new WebSocket('ws://10.97.40.226:8082');\n \t\tws.onopen = function() {\n \t\t\tws.send(oper);\n \t\t};\n \t\tws.onclose = function() {\n \t\t};\n \t\tws.onmessage = function(event) {\n\t\t\tif(oper != 'get'){\n\t\t\t\tFWStatus('get');\n\t\t\t\trunDigger();\n\t\t\t}else {\n\t\t\t\tgetFWStatus(event);\n\t\t\t}\n \t\t};\n\t}", "title": "" }, { "docid": "d8068a5046df6961d846373524429700", "score": "0.5247398", "text": "handleCarMakerCreated(evt){\n this.createStatus = `Car Maker record created. Id is ${evt.detail.id}`;\n\n const event = new CustomEvent('newrecord', {\n detail: {data: evt.detail},\n });\n this.dispatchEvent(event);\n }", "title": "" }, { "docid": "ea0bee02083aee96f1bf9d67ad90dc4a", "score": "0.5245697", "text": "updateStatus(event, data) {\n const connected = data.connectionStatus;\n const ok = data.runtimeStatus;\n const msg = {\n __type__: 'StatusLight',\n red: false,\n yellow: false,\n green: false,\n buzzer: false,\n };\n if (connected && ok) {\n if (ok) {\n msg.green = true;\n } else {\n msg.yellow = true;\n }\n } else {\n msg.red = true;\n }\n this.lcmPublish(`StatusLight${this.stationNumber}/StatusLight`, msg);\n }", "title": "" }, { "docid": "1f7f91802e02db3f5d36e546bd8d0768", "score": "0.52132165", "text": "onStatus(thingName, stat, clientToken, stateObject) {\n if (stateObject.state.reported === undefined) {\n console.log('Cannot find reported state.'.red);\n } else {\n console.log(\n 'Reported current state: '.gray,\n JSON.stringify(stateObject.state.reported).gray\n );\n }\n }", "title": "" }, { "docid": "d6ced69913c67ae89f29ad2ceb182aaf", "score": "0.5206455", "text": "function vatomStateChanged(payload) {\n\n // Update vatom payload\n face.vatom.payload = payload\n\n // Notify face\n face.onVatomUpdated()\n\n}", "title": "" }, { "docid": "4d3c08b118721eb8f49e862bfb0c98ce", "score": "0.5163562", "text": "handleStatusChange(event){\n let setStatus = event.detail.value;\n let meetingRecordID = event.target.dataset.targetId;\n let meetingRecordRecommendAmount = event.target.dataset.recommended;\n const fields = {};\n fields[ID_FIELD.fieldApiName] = meetingRecordID;\n fields[STATUS_FIELD.fieldApiName] = setStatus;\n if(this.template.Awarded_Status__c != setStatus){\n fields[AWARDED_FIELD.fieldApiName] = 0.00;\n } else if (this.template.Awarded_Status__c == setStatus && this.template.Awarded_Amount_default_Recommended__c) {\n fields[AWARDED_FIELD.fieldApiName] = meetingRecordRecommendAmount;\n }\n const recordInput = { fields };\n this.handleIndividualRecordUpdate(recordInput, 'Status updated');\n }", "title": "" }, { "docid": "a45e7b473ed41169101a3250a8f993b7", "score": "0.51488984", "text": "handleExternalChange(propertyName) {\n\t\tthis.log(`FAN: ${this.device.name} Incoming external change. Device says: ${this.device.getCurrentFanState()}`);\n\t\tthis.fanService.setCharacteristic(Characteristic.On, this.getIsFanOn());\n\t\tthis.fanService.setCharacteristic(Characteristic.RotationSpeed, this.translateFanSpeedToHK(this.device.getCurrentFanState()));\n\t\t// this.log(\"LIGHT: \" + this.device.name + \" Handling external change for light\");\n\t\t// this.lightService\n\t\t// \t.updateCharacteristic(Characteristic.On, this.device.getCurrentLightState());\n\t\t// if (this.dimmable) {\n\t\t// \tthis.lightService\n\t\t// \t\t.updateCharacteristic(Characteristic.Brightness, this.device.getCurrentLightDimState());\n\t\t// }\n\t}", "title": "" }, { "docid": "40f9358fdf5e089fa293308238661f37", "score": "0.51465195", "text": "_fireStatusEvent(/* Object */ args)\r\n {\r\n if (this.targetHTMLElementId) {\r\n var targetElement = this.targetHtmlElement || (this.targetHTMLElementId ? document.getElementById(this.targetHTMLElementId) : null);\r\n if (targetElement == null)\r\n throw Error(\"TargetElement '\"+this.targetHTMLElementId+\"' not found.\");\r\n if (this.isReady()) {\r\n jQuery(targetElement).addClass(\"statusReady\").removeClass(\"statusNotReady\");\r\n } else if (!this.suppressInitialRendering || this.getStatus() !== this.initializedStatus) {\r\n jQuery(targetElement).addClass(\"statusNotReady\").removeClass(\"statusReady\");\r\n }\r\n }\r\n bcdui.core.DataProvider.prototype._fireStatusEvent.call(this, args);\r\n }", "title": "" }, { "docid": "7e6934929ece19077f41b472ef922584", "score": "0.5134518", "text": "function onBatteryStatus(_info) {\n console.log('Listener: Device battery now at ' + _info.level + '.');\n //_info.level = % of battery (0-100).\n //_info.isPlugged = true if the device is plugged in.\n}", "title": "" }, { "docid": "351c34053066652f19126e5385a2c169", "score": "0.5129522", "text": "function watchChanges() {\n r.db('nark').table('services').changes().run(connection)\n .then(function(cursor) {\n cursor.each(function(err, row) {\n if (err) throw err;\n if (row && row.new_val) {\n io.sockets.emit(\"Services:Update\", row);\n }\n });\n })\n .catch(function() {});\n }", "title": "" }, { "docid": "8b52bcad9b7af8fe32ebd3f88392ecff", "score": "0.51031566", "text": "function handleStatus() {\n let status = $('#TripStatus');\n let currentStatus = status.attr(\"data-status\");\n switch (currentStatus) {\n case 'DuringTrip':\n getDuringTrip();\n break;\n case 'ConfirmLocation':\n confirmLocation();\n break;\n case 'CheckStatus':\n handleCheckStatus();\n break;\n case 'TakePhotos':\n takePhotos();\n break;\n default:\n getDuringTrip();\n break;\n }\n}", "title": "" }, { "docid": "14d11932e44bba9911413a6d04e87581", "score": "0.51000375", "text": "function request_rf_on(data){\n window.rfms_rfcontrol.rf_on(data);\n }", "title": "" }, { "docid": "04dc7da510d367c4876e3192576a9402", "score": "0.50978345", "text": "function onEachFeature(feature, layer){\n layer.bindPopup(\"<h2>Name of the State</h2>\" + feature.properties.name + \" \" +\n \"<h2>Number of Airports</h2>\" + feature.properties.count);\n layer.on({\n click : onStateClick,\n mouseover : onStateHighlight,\n mouseout : onStateMouseOut\n });\n}", "title": "" }, { "docid": "3f2e78d793b503f987eb0e79809316ff", "score": "0.509677", "text": "function retrieveFlightStatus(flightInput){\n\t//AJAX to HAM's node.js server\n\t$.ajax({\n\t\turl: 'https://watson-easy.herokuapp.com/flights',\n\t\tdata: {\n\t\t\targs:{\n\t\t\t\t'ident': flightInput,\n\t\t\t\t'howMany': 10\n\t\t\t}\n\t\t},\n\t\ttype: 'POST',\n\t\tdataType: 'JSON'\n\t}).done(function(response) {\n\t\t// If the flight DNE\n\t\tif (response.error) {\n\t\t\tconsole.log('Failed to fetch flight: ' + response.error);\n\t\t\treturn;\n\t\t}\n\t\t// set some loop variables\n\t\tvar i =0;\n\t\tvar found = false\n\t\t// simplify the response\n\t\tvar flightArray = response.FlightInfoStatusResult.flights;\n\t\t// Go looping for a departed flight\n\t\twhile(i < flightArray.length && !found){\n\t\t\t// Check for flight that has actually departed\n\t\t\tif (flightArray[i].actual_departure_time.epoch > 0) {\n\t\t\t\t// Load that flight data to the flight object\n\t\t\t\tflightData.load(flightArray[i].airline,flightArray[i].origin.airport_name,flightArray[i].destination.airport_name,flightArray[i].estimated_arrival_time.epoch,flightArray[i].estimated_arrival_time.tz,flightArray[i].status)\n\t\t\t\t// set to Found so loop exits.\n\t\t\t\tfound = true ;\n\t\t\t}\n\t\t\telse{\t// else iterate\n\t\t\t\ti++;\n\t\t\t}\n\t\t};\n\t\t// Write to the DOM\n\t\tflightData.writeToHTML();\n\t\tdestFlight = response.FlightInfoStatusResult.flights[i].destination.code;\n\t\t// Construct a URL to search for the airport selected \n\t\tvar queryURL = \"https://avwx.rest/api/metar/\" +\n\t\t\t\t\t destFlight + \"?options=info,translate\";\n\t\t// Get weather information and push to html\n\t\tavwx(queryURL);\n\t\t// Update the longitude an latitude of airport\n\t\tsearch(destFlight, airportsArray);\n\t\t// Get the iframe\n\t\tiFrame(weather.latitude, weather.longitude);\n\t});\n}", "title": "" }, { "docid": "d069465e8201369d30e9f946bc3cbe76", "score": "0.50953245", "text": "function addClickEventToFlightsListItem(flightId, handler) {\r\n $('#rowFlight' + flightId).click(handler);\r\n}", "title": "" }, { "docid": "56674aa386b3e6e01303c6b59c6597a1", "score": "0.50634795", "text": "function onMessage(evt)\n{\n\tvar jdata = JSON.parse(evt.data);\n\n if (jdata.responsetype == \"status\") // we requested a status or status was pushed, update screen\n {\n console.log(\"scandata status changed\");\n FillSystemTable(jdata);\n }\n else if (jdata.responsetype == \"systemmapchanged\") // scan display changed, rerequest URL\n {\n console.log(\"Informed scan display changed\");\n RequestImage(-1);\n }\n else if (jdata.responsetype == \"scandisplayobjects\") // scan display changed, rerequest URL\n {\n console.log(\"New scandisplay objects received\");\n lastobjectlist = jdata;\n }\n}", "title": "" }, { "docid": "f8a780e91486e2f2c23088a8213de32c", "score": "0.5051638", "text": "function refreshFlights() {\n if (!$scope.event.isConfirmed || $scope.event.pnr != null) {\n // $log.log(\"No refresh\");\n return;\n }\n\n $scope.isRefreshingFlights = true;\n eventService.refreshFlights($scope.event.id)\n .success(function (data) {\n //$log.log(\"Updated event: \" + JSON.stringify(data));\n $scope.isRefreshingFlights = false;\n for (i = 0; i < $scope.event.outboundFlightSearch.flights.length; i++) {\n $scope.event.outboundFlightSearch.flights[i].price = data.outboundFlights[i].price;\n }\n for (i = 0; i < $scope.event.inboundFlightSearch.flights.length; i++) {\n $scope.event.inboundFlightSearch.flights[i].price = data.inboundFlights[i].price;\n }\n })\n .error(function (error) {\n $scope.isRefreshingFlights = false;\n errorService.show(error);\n });\n }", "title": "" }, { "docid": "db06b50768471f59398c2b262ad74463", "score": "0.5048514", "text": "_onInfoUpdate(data) {\n this.owEventBus.trigger(\"info\", data);\n }", "title": "" }, { "docid": "71ab6685990d0dda779b88df0f4c5c37", "score": "0.50476223", "text": "function connectionStatusListener(event) {\n trace(event.status);\n if (event.status == ConnectionStatus.Established) {\n $(\"#playStream\").removeProp('disabled');\n trace('Connection has been established. You can start a new call.');\n // replay stream on connect\n if (replay) {\n if (mediaProvider == MediaProvider.Flash) {\n replay = false;\n // Wait for FlashAPI loading\n setTimeout(function () {\n var waitForFlashInit = setInterval(function () {\n if (isFlashphonerAPILoaded) {\n clearInterval(waitForFlashInit);\n setTimeout(playStream, 2000);\n } else {\n setInterval(waitForFlashInit, 1000);\n }\n }, 1000);\n }, 3000);\n } else {\n playStream();\n }\n }\n } else if (event.status == ConnectionStatus.Failed) {\n $(\"#playStatus\").show().text(\"Connection failed!\");\n $(\"#playButton\").show();\n $(\"#waiting\").hide();\n unmuteFooterElements();\n } else if (event.status == ConnectionStatus.Disconnected && reinit) {\n setTimeout(initAPI,2000);\n }\n}", "title": "" }, { "docid": "6a3d702beb4aefb37fa917a62e1aa296", "score": "0.5045137", "text": "function reportEventChange() {\n renderEvents();\n }", "title": "" }, { "docid": "719633fdfc69e864b33cec26ae3e3491", "score": "0.5044054", "text": "function setEventStatus() {\r\n let endDate = res[data].end.split(\"/\", 3);\r\n endDate = `${endDate[1]}/${endDate[0]}/${endDate[2]}`;\r\n endDate = new Date(endDate);\r\n if (new Date() > endDate) {\r\n eventStatus = \"Offline\";\r\n loc.className = \"locationOffline\";\r\n } else {\r\n loc.className = \"locationOnline\";\r\n }\r\n }", "title": "" }, { "docid": "4a7526fc58fec52126a0dc0b8194f2b9", "score": "0.503536", "text": "function connectionStatusListener(event) {\n trace(event.status);\n if (event.status == ConnectionStatus.Established) {\n trace('Connection has been established. You can start a new call.');\n // replay stream on connect\n if (replay) {\n if (mediaProvider == MediaProvider.Flash) {\n replay = false;\n // Wait for FlashAPI loading\n setTimeout(function () {\n var waitForFlashInit = setInterval(function () {\n if (isFlashphonerAPILoaded) {\n clearInterval(waitForFlashInit);\n setTimeout(playStream, 2000);\n } else {\n setInterval(waitForFlashInit, 1000);\n }\n }, 1000);\n }, 3000);\n } else {\n playStream();\n }\n }\n } else if (event.status == ConnectionStatus.Failed) {\n $(\"#playStatus\").show().text(\"Connection failed!\");\n $(\"#playButton\").show();\n $(\"#waiting\").hide();\n } else if (event.status == ConnectionStatus.Disconnected && reinit) {\n setTimeout($scope.initPlayer,2000);\n }\n }", "title": "" }, { "docid": "d9b02632012ee0498073d96858cd2396", "score": "0.50174487", "text": "function fetch_location_update_status(){\n // Service for getting state\n location_update_status_checker = new ROSLIB.Service({\n ros : ros,\n name : loc_status_srv_name,\n serviceType : loc_status_srv_type\n });\n // Request Packet\n request4 = new ROSLIB.ServiceRequest({\n get_status: 1\n });\n // Call Service\n location_update_status_checker.callService(request4, function(result) {\n $(\"#alert_1\").attr(\"class\", \"alert alert-info\");\n $(\"#alert_1\").text(result.upd_status);\n });\n }", "title": "" }, { "docid": "42fe776812b8d80a2411db66b684882b", "score": "0.49988633", "text": "function _event_for_set_job_status(e){\n try{\n var job_status_win = Ti.UI.createWindow({\n url:self.get_file_path('url','job/base/job_select_status.js'),\n type:_type,\n job_id:_selected_job_id,\n job_status_code:e.row.job_status_code,\n source:'from_job_detail'\n });\n Titanium.UI.currentTab.open(job_status_win,{\n animated:(self.is_ios_7_plus() && !self.set_animated_for_ios7)?false:true\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_for_set_job_status');\n return;\n } \n }", "title": "" }, { "docid": "c4e4c6bcfb52ea553e24afebe48e9fbb", "score": "0.49968234", "text": "function onWebEventReceived(event) {\n if (event.app === 'bingo') {\n switch (event.type) {\n case 'lightsOn':\n lightsOn();\n break;\n case 'openRegistration':\n openRegistration();\n break;\n case 'closeRegistration':\n closeRegistration();\n break; \n case 'newRound':\n newRound();\n break;\n case 'lightsOut':\n lightsOut();\n break;\n case 'givePrizes':\n givePrizes();\n break;\n default:\n print(\"error in detecting event.type in Bingo app\");\n }\n }\n }", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.4988587", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.4988587", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "288c91328ece443c24a9822e5f412c0f", "score": "0.49864152", "text": "function selectFlightHandler(flightItemEvent) {\n let flightItem = flightItemEvent.data;\n console.log(flightItem);\n // rule: flights must be in order in rotation list\n // added flights go into rotationList array\n rotationList.push(flightItem);\n // sort the array\n rotationList.sort(function(flightItem1, flightItem2) {\n if (flightItem1.departuretime < flightItem2.departuretime) {\n return -1;\n }\n if (flightItem1.departuretime > flightItem2.departuretime) {\n return 1;\n }\n return 0;\n });\n // display list in UI\n renderRotationList();\n}", "title": "" }, { "docid": "08b4c7feacfed7534f9792418fbd6b1a", "score": "0.49771032", "text": "function eventListener(event) {\n if (event && event.error) {\n addError(event);\n } else {\n addEventMessage(event);\n }\n\n // Look for add/remove events here instead of a seperate\n // event listener as this test page needs a fixed\n // eventhandler for other testing purposes:\n if (event && event.message && event.data) {\n let deviceIdStr = event.data.deviceID.toString();\n let deviceName = event.data.deviceName;\n\n if (event.message === \"device attached\") {\n var opt = document.createElement('option');\n opt.value = deviceIdStr;\n opt.innerHTML = deviceName;\n deviceSelector.appendChild(opt);\n } else if (event.message === \"device detached\") {\n let found = false;\n let i = 0;\n while (deviceSelector.options.length > i && !found) {\n if (deviceSelector.options[i].value === deviceIdStr) {\n deviceSelector.remove(i);\n found = true;\n }\n\n ++i;\n }\n }\n\n changeActiveDeviceBtn.disabled = deviceSelector.options.length === 0;\n }\n\n // Watch for interesting status in devlog events:\n if (event && event.message === \"devlog\") {\n devLogStatus.style = \"display: block\";\n\n let boomArmEvent = event.data[\"Boom Position Guidance OK\"];\n if (boomArmEvent !== undefined) {\n boomArm = (boomArmEvent.toString().toLowerCase() === \"true\");\n boomArmStatus.innerText = boomArm;\n }\n \n let txLevelEvent = event.data[\"TX Acoustic Logging Level\"];\n if (txLevelEvent !== undefined) {\n txDb = parseInt(txLevelEvent);\n txStatus.innerText = txDb.toString()+\"db\";\n }\n\n let txPeakLevelEvent = event.data[\"TX Acoustic Logging Peak\"];\n if (txPeakLevelEvent !== undefined) {\n txPeakDb = parseInt(txPeakLevelEvent);\n txPeakStatus.innerText = txPeakDb.toString()+\"db\";\n }\n\n let rxLevelEvent = event.data[\"RX Acoustic Logging Level\"];\n if (rxLevelEvent !== undefined) {\n rxDb = parseInt(rxLevelEvent);\n rxStatus.innerText = rxDb.toString()+\"db\";\n }\n\n let rxPeakLevelEvent = event.data[\"RX Acoustic Logging Peak\"];\n if (rxPeakLevelEvent !== undefined) {\n rxPeakDb = parseInt(rxPeakLevelEvent);\n rxPeakStatus.innerText = rxPeakDb.toString()+\"db\";\n }\n\n let txSpeechEvent = event.data[\"Speech_Analysis_TX\"];\n if (txSpeechEvent !== undefined) {\n txSpeech = (txSpeechEvent.toString().toLowerCase() === \"true\");\n txSpeechStatus.innerText = txSpeech.toString();\n }\n\n let rxSpeechEvent = event.data[\"Speech_Analysis_RX\"];\n if (rxSpeechEvent !== undefined) {\n rxSpeech = (rxSpeechEvent.toString().toLowerCase() === \"true\");\n rxSpeechStatus.innerText = rxSpeech.toString();\n }\n }\n }", "title": "" }, { "docid": "a2f87b04511c2baeb644322b46d4cd46", "score": "0.4974924", "text": "function ListenEvents (event) {\n var count =0; // Simple counter to make easier to follow message flow\n\n // Events from queued jobs\n function EventHandlerQueue (status, job){\n console.log (\"#%d- Queue Status=%s DevId=%s Command=%s JobReq=%d Retry=%d\", count, status, job.devId, job.command, job.request, job.retry);\n };\n // Events successful process by tracker adapter\n function EventHandlerAccept (device, data){\n console.log (\"#%d- Action Devid:[%s] Name:[%s] Cmd:[%s] Lat:%d Lon:%d Speed=%d\", count, device.devid, device.name, data.cmd, data.lat, data.lon, data.sog);\n };\n // Events on action refused by tracker adapter\n function EventHandlerError (status, info, id, msg){\n console.log (\"#%d- Notice Info=%s Data=%s Id=%s Msg:%s\", count, status, info, id, msg );\n };\n\n // let's use the same event handler for all gpsdTracker\n event.on(\"queue\",EventHandlerQueue);\n event.on(\"accept\",EventHandlerAccept);\n event.on(\"notice\",EventHandlerError);\n}", "title": "" }, { "docid": "6a76fb3da78f8aeb7a3b2778057442ac", "score": "0.49700508", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n if(message.payloadString == 'off'){\n \tvar element = document.getElementById(\"status\");\n \t\telement.innerHTML = 'OFF';\n \t\telement.style.color = 'red';\n }else{\n \tvar element = document.getElementById(\"status\");\n \t\telement.innerHTML = 'ON';\n \t\telement.style.color = '#00ff00';\n }\n }", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "b142f380b2b663e3abd1c593d31f004c", "score": "0.49649987", "text": "function reportEventChange() {\n\t\trenderEvents();\n\t}", "title": "" }, { "docid": "d43e9d6109830ef934ce87001d65fdd4", "score": "0.496339", "text": "function watchTrialDetailObj() {\n $scope.$on(MESSAGES.TRIAL_DETAIL_SAVED, function() {\n getTrialDetailCopy();\n });\n } //watchTrialDetailObj", "title": "" }, { "docid": "195c7f7b9548c64b4656d8da49b411fa", "score": "0.49570552", "text": "function _on_consultation_update( event, data )\n {\n vm._check_appointments();\n\n if( data.type == 'item_added' )\n {\n CallService.onChatMessageArrived();\n\n if( !$rootScope.isCalling )\n {\n $interval.cancel( vm._time_interval_id );\n vm.timeStr = 0;\n }\n\n vm.scroll_to_bottom( data.item_type == ConsultationItemType.CALL ? 2000 : 1000 );\n SoundsService.play( 'received_msg' );\n }\n }", "title": "" }, { "docid": "ff12daf9e06f93b9eb06f0dfe079e649", "score": "0.4953009", "text": "function setStatusPanelEvents(api, view, utils, log) {\n\t$(document).on('keypress', '#taget-temperature-textfield', function(event) {\t\n\t\tutils.allowEventOnlyOnFloats(event);\n\t});\n\t$(\"#taget-temperature-checkbox\").change(function() {\n\t\tif (this.checked) {\n\t\t\tview.enableTemperatureOverridePanel(true);\t\t\t\n\t\t} else {\n\t\t\tapi.removeTemperatureOverride(function() {\n\t\t\t\tview.updateTargetTemperature();\n\t\t\t\tlog.log('Removed temperature override')\n\t\t\t});\n\t\t}\n\t});\n\t$(\"#taget-temperature-button\").click(function() {\n\t\tvar value = $(\"#taget-temperature-textfield\").val();\n\t\tif (value) {\n\t\t\tapi.setTemperatureOverride(value, function() {\t\t\t\t\n\t\t\t\tview.updateTargetTemperature();\n\t\t\t\tlog.log('Set temperature override to ' + value + ' ℃')\n\t\t\t});\n\t\t}\n\t});\n\t// also set the dropdown events\n\tsetDeviceDropdownEvent(api, view, utils, log, 'freezer');\n\tsetDeviceDropdownEvent(api, view, utils, log, 'heater');\n}", "title": "" }, { "docid": "c0928fdccb11626aebc577dcb501e400", "score": "0.49484676", "text": "function onWsOpen() {\n $log.debug('web socket opened...');\n // kick off request for periodic summary data...\n dispatcher.sendEvent('requestSummary');\n }", "title": "" }, { "docid": "9be60afb934f48fc4d0165e3f01bc2ac", "score": "0.4944314", "text": "function handleFlightInfoRequest(dict) {\n var retDict = {};\n var flightData = {};\n var allFlightsData = kony.store.getItem(\"AllFlightsData\");\n var flightNumber = dict.flightNumber;\n if (allFlightsData != null) {\n kony.print(\"allFlights details :\" + allFlightsData[\"flightdetails\"]);\n allFlights = allFlightsData[\"flightdetails\"];\n for (var i = 0; i < allFlights.length; i++) {\n if (flightNumber == allFlights[i][\"flightNumber\"]) {\n flightData = allFlights[i];\n break;\n }\n }\n }\n retDict[\"data\"] = flightData;\n retDict[\"cacheId\"] = \"\" + new Date();\n retDict[\"hasUpdate\"] = true;\n return retDict;\n}", "title": "" }, { "docid": "94e68028404aaa7786795f264eb29b2b", "score": "0.49423665", "text": "function infoFeature(e) {\n\t\thbconsents.resetStyle();//reset all features to default colour\n\t\thbconsents.setFeatureStyle(e.target.feature.id, {fillColor: '#ff0000'});//highlight selected feature\n\t\tfeatureQuery(e.target._latlng);\n\t\t\t}", "title": "" }, { "docid": "b80b268ab2f4b9388edd7f7f5c7a1086", "score": "0.49411678", "text": "status() {\n console.log(\"Airplane: \" + this.name + \" with \" + this.occupancy + \" occupancy, is moving at \" + this.speed + \" km/hr\");\n }", "title": "" }, { "docid": "45165adac94445276b77228f860f5d82", "score": "0.49409688", "text": "function DataChanged(dataObj) {\n console.log(\"State data changed received.\");\n OnLoad(dataObj);\n}", "title": "" }, { "docid": "2b6c8a78fae1f633e11f89a11ae22c44", "score": "0.4938491", "text": "async onEventActivity(stepContext) {\n const activity = stepContext.context.activity;\n const traceActivity = {\n type: ActivityTypes.Trace,\n timestamp: new Date(),\n text: 'ActivityRouterDialog.onEventActivity()',\n label: `Name: ${ activity.name }, Value: ${ JSON.stringify(activity.value) }`\n };\n await stepContext.context.sendActivity(traceActivity);\n\n // Resolve what to execute based on the event name.\n switch (activity.name) {\n case 'BookFlight':\n return await this.beginBookFlight(stepContext);\n case 'GetWeather':\n return await this.beginGetWeather(stepContext);\n default:\n // We didn't get an event name we can handle.\n await stepContext.context.sendActivity(\n `Unrecognized EventName: \"${ stepContext.context.activity.name }\".`,\n undefined,\n InputHints.IgnoringInput\n );\n return { status: DialogTurnStatus.complete };\n }\n }", "title": "" }, { "docid": "49289251399571e5581d2ceaa2dee32b", "score": "0.4934772", "text": "handleExternalChange(propertyName) {\n\t\tthis.log(\"ALARMPANEL: \" + this.device.name + \" Source device. Currenty state locally -\" + this.device.getAlarmStatusAsText());\n\t\tthis.log(\"ALARMPANEL: \" + this.device.name + \" Got alarm change notification. Setting HK target state to: \" + this.translateAlarmTargetStateToHK() + \" Setting HK Current state to: \" + this.translateAlarmCurrentStateToHK());\n\t\tthis.alarmPanelService.setCharacteristic(Characteristic.SecuritySystemTargetState, this.translateAlarmTargetStateToHK());\n\t\tthis.alarmPanelService.setCharacteristic(Characteristic.SecuritySystemCurrentState, this.translateAlarmCurrentStateToHK());\n\t}", "title": "" }, { "docid": "e6003804eac602bf4ffc4ada63914bc4", "score": "0.49287775", "text": "function Proc_agentEvent_phoneAlerting(event) {\n\n}", "title": "" }, { "docid": "93e15f412e5cc17103a6e606f54d7c4d", "score": "0.491305", "text": "status(){\n console.log(\"Airplane: \" + this.name + \" with \" + this.occupancy + \" occupancy, is moving at \" + this.speed + \" Km/hr.\");\n }", "title": "" }, { "docid": "22a6429d169a770e45352ea51dee7237", "score": "0.49025214", "text": "function listenToEvents() {\n\t crosserInstance.subscribeEvent(_commonConstants.Event.CHANGE_NOTIFICATION_STATUS, function (data) {\n\t currentNotificationState = data.state;\n\t fireSafe(handlers.stateChanged, data.state);\n\t });\n\t crosserInstance.subscribeEvent(_commonConstants.Event.ADD_SUBSCRIPTION, function (data) {\n\t fireSafe(handlers.addSubscription, data);\n\t });\n\t crosserInstance.subscribeEvent(_commonConstants.Event.REMOVE_SUBSCRIPTION, function (data) {\n\t fireSafe(handlers.removeSubscription, data);\n\t });\n\t}", "title": "" }, { "docid": "d67f4ae7c911d66a34c709c543fc45f4", "score": "0.4895211", "text": "function onDeviceStatusChanged (deviceObjectFromLuStatus) {\n\t\tif (deviceObjectFromLuStatus.id == _deviceId) {\n\t\t\tfor (i = 0; i < deviceObjectFromLuStatus.states.length; i++) { \n\t\t\t\tif (deviceObjectFromLuStatus.states[i].variable == \"Color\") {\n\t\t\t\t\tvar newColor = deviceObjectFromLuStatus.states[i].value;\n\t\t\t\t\tif (newColor !== _color) {\n\t\t\t\t\t\tUtils.logDebug(\"[RGBController.onDeviceStatusChanged] Device #\" + _deviceId + \" color has been set to \" + newColor);\n\t\t\t\t\t\tupdateColorWheel(newColor);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tUtils.logDebug(\"[RGBController.onDeviceStatusChanged] Device #\" + _deviceId + \" color is the current color \" + _color);\n\t\t\t\t\t}\n\t\t\t\t} else if (deviceObjectFromLuStatus.states[i].variable == \"Status\") {\n\t\t\t\t\t_status = deviceObjectFromLuStatus.states[i].value;\n\t\t\t\t\tif (_status === \"1\") {\n\t\t\t\t\t\t$(\"#RGBController_off\").removeClass(\"ui-state-highlight\");\n\t\t\t\t\t\t$(\"#RGBController_on\").addClass(\"ui-state-highlight\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#RGBController_off\").addClass(\"ui-state-highlight\");\n\t\t\t\t\t\t$(\"#RGBController_on\").removeClass(\"ui-state-highlight\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "45900d48ee5dfc8504b40d5fdd7c02ac", "score": "0.48925483", "text": "receivedEvent(id) {\n console.log(`Device is ready: ${id}`);\n }", "title": "" }, { "docid": "fedfd5d59c7dcef931a73ca6894093a1", "score": "0.48897898", "text": "getFlightInfo(flight, callback) {\n let self = this;\n self.flightSuretyData.methods.flightInfoReturn(flight.flight, flight.address, flight.timestamp)\n .call({from: self.owner}, (error, result) => {\n console.log('Inside the contract.js file - getFlightInfo callback function');\n console.log(error, result);\n console.log(\"timestamp returned from blockchain for flight: \"+result[3]);\n callback(error, result);\n });\n\n }", "title": "" }, { "docid": "083c406a94f335aea15e49e31b4f86ad", "score": "0.48779517", "text": "function activityDetected()/*:void*/ {\n this.lastActive$Uyd1 = new Date();\n if (this.hasListener(ActivityTracker.ACTIVITY_DETECTED_EVENT)) {\n this.fireEvent(ActivityTracker.ACTIVITY_DETECTED_EVENT, this);\n }\n }", "title": "" }, { "docid": "676c1af922fb570636a2bc8d4da502d7", "score": "0.48779118", "text": "function handleStatusUpdate() {\n $('#update-status').on('click', () => {\n\n // Our GET request URL will look like this:\n // /status?order=123\n $.get('/status', {order: 123}, (results) => {\n console.log(`Result from server: ${results}`);\n\n const status = results;\n $('#order-status').html(status);\n\n console.log('Callback function finished');\n });\n\n console.log('GET request sent to server');\n });\n}", "title": "" }, { "docid": "2901697b588658845f2d698d3ed04065", "score": "0.4874338", "text": "function handleChangeStatus(e) {\n setActivity((prev) => [e, ...prev]);\n setStatus(parseInt(e.status));\n }", "title": "" }, { "docid": "3c91d7d5dd482292725192b0fd5a3caf", "score": "0.48724097", "text": "function addOnUpdateEventListner(customer) {\n document.getElementById(\"customers-update\").addEventListener(\"click\", () => {\n let data = gatherUpdateInputData();\n let id = document.getElementById(\"customer-id-add\").value;\n console.log(\"intra\", data);\n console.log(\"id\", id);\n customer.updateData(data, id);\n var responseStatus = getCookie(\"status\");\n console.log(responseStatus);\n if (responseStatus == \"201\" || responseStatus == \"204\" || responseStatus == \"200\") {\n toggleSuccessAlert();\n }\n else if (responseStatus == \"400\" || responseStatus == \"401\" || responseStatus == \"402\" ||\n responseStatus == \"404\" || responseStatus == \"500\" || responseStatus == \"501\") {\n toggleUnsuccessAlert()\n }\n });\n}", "title": "" }, { "docid": "09a6bd5af2850177d8cdd669cbcd49b1", "score": "0.48711222", "text": "function EventInfo() {}", "title": "" }, { "docid": "27e185423dba8eea1373f41976cc0723", "score": "0.48639467", "text": "function trackDetailView(data) {\n // IBMCore.common.widget.ocean_tracking.fireMapEvent()\n setTimeout(function(){\n if (IBMCore.common.widget.ocean_tracking) IBMCore.common.widget.ocean_tracking.fireMapEvent(data);\n }, 100);\n }", "title": "" }, { "docid": "09047be78f10dab3fd7baf25c79481ae", "score": "0.4861367", "text": "function LUS_setStatusLine(newMsg)\n{\n document.all[this.statusLineId].innerText = newMsg;\n}", "title": "" }, { "docid": "bd2c1f88714bdb9a55a7e20d1361d1f8", "score": "0.4855842", "text": "function updateOnlineStatus(msg) {\n\t\tvar status = document.getElementById(\"status\");\n\t\tvar condition = navigator.onLine ? \"ONLINE\" : \"OFFLINE\";\n\t\tvar time = new Date();\n\t\t\n\t\tstatus.setAttribute(\"class\", condition);\n\t\tvar state = document.getElementById(\"state\");\n\t\tstate.innerHTML = condition;\n\t\tvar log = document.getElementById(\"log\");\n\t\tposition = res;\n\t\t//everytime online or offline\t \n\t\tlog.appendChild(document.createTextNode(\"Event: \" + msg + \"; status=\" + condition\n\t\t\t +\"\\n\"+\"Position:\" + position\n\t\t\t + \" \" + latitude\n\t\t\t + \" \" + longitude\n\t\t\t +\"\\n\"+\"Time:\" + time \n\t\t\t +\"\\n\"+\"\\n\"));\n\t }", "title": "" }, { "docid": "88340fc0490467364078b46e66a51e89", "score": "0.48513323", "text": "static onInfoUpdate(data) {\n console.log(\"INFO: \", data);\n\n window._latestInfoUpdate = data;\n\n if (window.game.handleGameInfoUpdate)\n window.game.handleGameInfoUpdate(data, window.eventBus.trigger);\n }", "title": "" }, { "docid": "2a463ca7dcee1de43cf0232e7b74445f", "score": "0.48479208", "text": "function loadFlights() {\n\n}", "title": "" }, { "docid": "69510a94075b3d5b295f64a6a486806f", "score": "0.4845448", "text": "function customerDetailChanged() {\n fetchCustomerDetails({\n onSuccess: accountSuccess,\n onFail: function() {}\n });\n }", "title": "" }, { "docid": "ecc829c1ce3457f11de5cdbd0d27f680", "score": "0.48434567", "text": "handleStatusChange(target){\n console.log(target);\n }", "title": "" }, { "docid": "170bdba6b7614e32be69ae70715d3916", "score": "0.48430204", "text": "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "title": "" }, { "docid": "18a294653fe9c1513bec524cc4f9de56", "score": "0.4840111", "text": "function initEventListener() {\n $scope.$on(controllerId + '.action.get-filters', function (event, data) {\n search(data);\n });\n $scope.$on(controllerId + '.action.getPage', function (event, data) {\n getPage(_tableState);\n });\n\n \n }", "title": "" }, { "docid": "8a4487ce4800c959adf8897366f30800", "score": "0.48338217", "text": "function Proc_agentEvent_Ringing(event) {\n var callId = event.content.callid;\n global_currentDealCallId = callId;\n eventProcess_queryCallInfoByCallId(callId);\n buttonInfo_changeButtonStatus(AGENT_BUTTON_STATUS.RINGING);\n agentCallInfo_showCallInfo(callId, CALL_STATUS.ALERTING);\n //crmForm_openNewPopupScreen(event.content.otherPhone, event.content.feature, event.content.callid);\n\n\n var callInfo = global_allCallInfo.get(global_currentDealCallId);\n var callFeature = CALL_FEATURE.OTHER;\n var otherParty = callInfo.caller;\n if (callInfo.callfeature != undefined\n\t\t\t&& callInfo.callfeature != null) {\n callFeature = parseInt(callInfo.callfeature);\n }\n switch (callFeature) {\n case CALL_FEATURE.FEATURE_OUT:\n otherParty = callInfo.called;\n break;\n default:\n break;\n }\n crmForm_openNewPopupScreen(otherParty, callFeature, event.content.callid);\n}", "title": "" }, { "docid": "6baa611c11aac802f90daca12ddc2e49", "score": "0.48208436", "text": "subscribeToConnectionStatus(fn) {\r\n this.connectionStatusCallback = fn;\r\n }", "title": "" }, { "docid": "d2ace82ef4d7d7ab1493c3f895995912", "score": "0.4816172", "text": "handleRowAction(event) {\n const selectedRow = event.detail.row;\n const actionName = event.detail.action.name;\n switch (actionName) {\n case RECORD_DETAIL:\n // Fire the event from vehicleView to vehicleContainer\n this.dispatchEvent(new CustomEvent('vehicleselected', {\n detail: this.vehicles.find(v => v.id === selectedRow.id)\n }));\n break;\n }\n }", "title": "" }, { "docid": "ec74df6bc484efa849451d0bf63a9014", "score": "0.48157403", "text": "__openedChanged() {\n this.dispatchEvent(new CustomEvent('opened-state-changed', { detail: { isOpened: this.opened }}));\n }", "title": "" }, { "docid": "48c0764c58f91c8d7ec0b970e29300b0", "score": "0.48092362", "text": "function subscribeToLocalizationStatusReport()\n{\n let listener = new ROSLIB.Topic({\n ros: g_ros,\n name: T_LOCALIZATION_STATUS,\n messageType: M_LOCALIZATION_REPORT\n });\n\n listener.subscribe((message) => {\n //Check ROSBridge connection before subscribe a topic\n IsROSBridgeConnected();\n switch (message.status) {\n case LOCALIZATION_STATUS_OPERATIONAL:\n $('#localization-status').css('color', 'rgb(188, 250, 63)');\n break;\n case LOCALIZATION_STATUS_DEGRADED:\n $('#localization-status').css('color', '#ffc107');\n break;\n case LOCALIZATION_STATUS_DEGRADED_NO_LIDAR_FIX:\n $('#localization-status').css('color', '#FF0000');\n break;\n\n default:\n $('#localization-status').css('color', 'gray');\n break;\n }\n });\n}", "title": "" }, { "docid": "a7c181b36462a1572382dd016751ab31", "score": "0.48054537", "text": "function incomingEvent(e) {\n trace(\"incomingEvent: \" + JSON.stringify(e));\n}", "title": "" }, { "docid": "27e4abb89043d2737594985e49058599", "score": "0.48021707", "text": "function Proc_agentEvent_customerAlerting(event) {\n var callId = event.content.callid;\n global_currentDealCallId = callId;\n var otherParty = event.content.otherPhone;\n if (global_currentCalloutCallId == callId) {\n //Agent do callout and the customer phone is ringing.\n agentCallInfo_showCurrentCallInfo(otherParty, CALL_STATUS.ALERTING, CALL_FEATURE.FEATURE_OUT);\n\n\n crmForm_openNewPopupScreen(event.content.otherPhone, CALL_FEATURE.FEATURE_OUT, event.content.callid);\n return;\n }\n if (global_currentInnercallCallId == callId) {\n //Agent do callout and the customer phone is ringing.\n agentCallInfo_showCurrentCallInfo(global_currentInnercallAgent, CALL_STATUS.ALERTING, CALL_FEATURE.INTERNAL);\n return;\n }\n}", "title": "" }, { "docid": "38604627d8b6d2453ae6bd9daa2e75cc", "score": "0.47973892", "text": "function recDelivered() {\n\tconsole.log(\"recDelivered fired\");\n\tvar settings = {\n\t \"async\": true,\n\t \"crossDomain\": true,\n\t \"url\": \"http://localhost:8080/api/events\",\n\t \"method\": \"POST\",\n\t \"data\": {\n\t \"anonID\": anonID,\n\t \"currentVert\": currentVert,\n\t \"eventType\": \"delivered\",\n\t \"recdVert\": element,\n\t }\n\t}\n\n\t$.ajax(settings).done(function (response) {\n\t console.log(response);\n\t});\n}", "title": "" }, { "docid": "62db514e5d32a4df9d989552f979f7d3", "score": "0.4797332", "text": "function ready(){\n $('.change-interview-status').each( function() {\n setListenerOn($(this));\n });\n}", "title": "" }, { "docid": "a3c953bed1ac6fa0e08a04db14c86573", "score": "0.47963688", "text": "function onEvent(model, event) {\n let status;\n switch (event) {\n case 'empty':\n status = 'idle';\n break;\n case 'git:checkout':\n status = 'checking out...';\n break;\n case 'git:clone':\n status = 'cloning repository...';\n break;\n case 'git:commit:create':\n status = 'committing changes...';\n break;\n case 'git:commit:revert':\n status = 'reverting changes...';\n break;\n case 'git:init':\n status = 'initializing repository...';\n break;\n case 'git:pull':\n status = 'pulling changes...';\n break;\n case 'git:pushing':\n status = 'pushing changes...';\n break;\n case 'git:refresh':\n status = 'refreshing...';\n break;\n case 'git:reset:changes':\n status = 'resetting changes...';\n break;\n case 'git:reset:hard':\n status = 'discarding changes...';\n break;\n default:\n if (/git:add:files/.test(event)) {\n status = 'adding files...';\n }\n else {\n status = 'working...';\n }\n break;\n }\n widget.status = status;\n }", "title": "" }, { "docid": "ec1809d1cd494c256e4b10bf21f2a949", "score": "0.4796287", "text": "function updateRunning() {\r\n\tcommunicator.requestStatus(onReceiveStatus);\r\n}", "title": "" }, { "docid": "1c32a261490faf11670bc8ade4c221df", "score": "0.4787407", "text": "function _addForeignApplicationStatus() {\n RegistrationFactory.addForeignApplicationStatus(vm);\n }", "title": "" } ]
40999257995e7e0205ed51fadfb96811
Returns a parsed format string, leveraging a cache.
[ { "docid": "c7c71a21bb997a78abd88b56068925d7", "score": "0.6162174", "text": "function getParsedFormatString(formatStr) {\n\treturn parsedFormatStrCache[formatStr] ||\n\t\t(parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" } ]
[ { "docid": "aaf16bd025890ed4d7a3812a655b2681", "score": "0.638503", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n }", "title": "" }, { "docid": "a4edec362b0bb460710e5191a53c5b69", "score": "0.62925017", "text": "function getParsedFormatString(formatStr) {\r\n return parsedFormatStrCache[formatStr] ||\r\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\r\n}", "title": "" }, { "docid": "b6c8c1dec639e06034353b1f7a497d05", "score": "0.6259015", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" }, { "docid": "b6c8c1dec639e06034353b1f7a497d05", "score": "0.6259015", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" }, { "docid": "b6c8c1dec639e06034353b1f7a497d05", "score": "0.6259015", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" }, { "docid": "b6c8c1dec639e06034353b1f7a497d05", "score": "0.6259015", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" }, { "docid": "b6c8c1dec639e06034353b1f7a497d05", "score": "0.6259015", "text": "function getParsedFormatString(formatStr) {\n return parsedFormatStrCache[formatStr] ||\n (parsedFormatStrCache[formatStr] = parseFormatString(formatStr));\n}", "title": "" }, { "docid": "282143bb46359a625ad203cff2968d23", "score": "0.6006985", "text": "function parseFormatString(formatStr) {\r\n var chunks = chunkFormatString(formatStr);\r\n return {\r\n fakeFormatString: buildFakeFormatString(chunks),\r\n sameUnits: buildSameUnits(chunks)\r\n };\r\n}", "title": "" }, { "docid": "7fcaaaa13428443aade78a4f484cd0a4", "score": "0.59891033", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\t\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "7fcaaaa13428443aade78a4f484cd0a4", "score": "0.59891033", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\t\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "7fcaaaa13428443aade78a4f484cd0a4", "score": "0.59891033", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\t\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "7fcaaaa13428443aade78a4f484cd0a4", "score": "0.59891033", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\t\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "7fcaaaa13428443aade78a4f484cd0a4", "score": "0.59891033", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\t\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "a8c5213b5debf1f1b8e3945b7149ae7d", "score": "0.59683573", "text": "function parseFormatString(formatStr) {\n\tvar chunks = chunkFormatString(formatStr);\n\n\treturn {\n\t\tfakeFormatString: buildFakeFormatString(chunks),\n\t\tsameUnits: buildSameUnits(chunks)\n\t};\n}", "title": "" }, { "docid": "733de80a1222d515411a0faf59ecba07", "score": "0.5966628", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n}", "title": "" }, { "docid": "733de80a1222d515411a0faf59ecba07", "score": "0.5966628", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n}", "title": "" }, { "docid": "733de80a1222d515411a0faf59ecba07", "score": "0.5966628", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n}", "title": "" }, { "docid": "733de80a1222d515411a0faf59ecba07", "score": "0.5966628", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n}", "title": "" }, { "docid": "733de80a1222d515411a0faf59ecba07", "score": "0.5966628", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n}", "title": "" }, { "docid": "86c84a2907706de2d93a3943860614ee", "score": "0.5965335", "text": "function parseFormatString(formatStr) {\n var chunks = chunkFormatString(formatStr);\n\n return {\n fakeFormatString: buildFakeFormatString(chunks),\n sameUnits: buildSameUnits(chunks)\n };\n }", "title": "" }, { "docid": "f2c87767578d5f2765270eb7557ee38c", "score": "0.59581995", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "f2c87767578d5f2765270eb7557ee38c", "score": "0.59581995", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "f2c87767578d5f2765270eb7557ee38c", "score": "0.59581995", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "f2c87767578d5f2765270eb7557ee38c", "score": "0.59581995", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "0b0928287dd281f1c80e32e536a9dee5", "score": "0.59245366", "text": "function getFormat(format) {\n // Undefined?\n if (typeof format === \"undefined\") {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"STRING\"];\n } // Cleanup and lowercase format\n\n\n format = format.toLowerCase().replace(/^\\[[^\\]]*\\]/, \"\"); // Remove style tags\n\n format = format.replace(/\\[[^\\]]+\\]/, \"\"); // Trim\n\n format = format.trim(); // Check for any explicit format hints (i.e. /Date)\n\n var hints = format.match(/\\/(date|number|duration)$/);\n\n if (hints) {\n return hints[1];\n } // Check for explicit hints\n\n\n if (format === _Strings__WEBPACK_IMPORTED_MODULE_5__[\"NUMBER\"]) {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"NUMBER\"];\n }\n\n if (format === _Strings__WEBPACK_IMPORTED_MODULE_5__[\"DATE\"]) {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"DATE\"];\n }\n\n if (format === _Strings__WEBPACK_IMPORTED_MODULE_5__[\"DURATION\"]) {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"DURATION\"];\n } // Detect number formatting symbols\n\n\n if (format.match(/[#0]/)) {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"NUMBER\"];\n } // Detect date formatting symbols\n\n\n if (format.match(/[ymwdhnsqaxkzgtei]/)) {\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"DATE\"];\n } // Nothing? Let's display as string\n\n\n return _Strings__WEBPACK_IMPORTED_MODULE_5__[\"STRING\"];\n }", "title": "" }, { "docid": "a5fecf60f3bb31d3b889be55029dd164", "score": "0.59060997", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "37fc24191b9258f83386cb20bdc6a1c3", "score": "0.58966", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\n var string = '' + config._i,\n i,\n parsedInput,\n tokens,\n token,\n skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n } // don't parse if it's not a known token\n\n\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n } // add remaining unparsed input length to the string\n\n\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n } // clear _12h flag if hour is <= 12\n\n\n if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem; // handle meridiem\n\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "cc0fb8206375501ec8a66b7fc48303a4", "score": "0.5877831", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) return void configFromISO(config);\n if (config._f === hooks.RFC_2822) return void configFromRFC2822(config);\n config._a = [], getParsingFlags(config).empty = !0;\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var i, parsedInput, tokens, token, skipped, string = \"\" + config._i, stringLength = string.length, totalParsedInputLength = 0;\n for (tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [], \n i = 0; i < tokens.length; i++) token = tokens[i], parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0], \n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n parsedInput && (skipped = string.substr(0, string.indexOf(parsedInput)), skipped.length > 0 && getParsingFlags(config).unusedInput.push(skipped), \n string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), \n // don't parse if it's not a known token\n formatTokenFunctions[token] ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), \n addTimeToArrayFromToken(token, parsedInput, config)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token);\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), \n // clear _12h flag if hour is <= 12\n config._a[HOUR] <= 12 && !0 === getParsingFlags(config).bigHour && config._a[HOUR] > 0 && (getParsingFlags(config).bigHour = void 0), \n getParsingFlags(config).parsedDateParts = config._a.slice(0), getParsingFlags(config).meridiem = config._meridiem, \n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem), \n configFromArray(config), checkOverflow(config);\n }", "title": "" }, { "docid": "cc0fb8206375501ec8a66b7fc48303a4", "score": "0.5877831", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) return void configFromISO(config);\n if (config._f === hooks.RFC_2822) return void configFromRFC2822(config);\n config._a = [], getParsingFlags(config).empty = !0;\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var i, parsedInput, tokens, token, skipped, string = \"\" + config._i, stringLength = string.length, totalParsedInputLength = 0;\n for (tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [], \n i = 0; i < tokens.length; i++) token = tokens[i], parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0], \n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n parsedInput && (skipped = string.substr(0, string.indexOf(parsedInput)), skipped.length > 0 && getParsingFlags(config).unusedInput.push(skipped), \n string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), \n // don't parse if it's not a known token\n formatTokenFunctions[token] ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), \n addTimeToArrayFromToken(token, parsedInput, config)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token);\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), \n // clear _12h flag if hour is <= 12\n config._a[HOUR] <= 12 && !0 === getParsingFlags(config).bigHour && config._a[HOUR] > 0 && (getParsingFlags(config).bigHour = void 0), \n getParsingFlags(config).parsedDateParts = config._a.slice(0), getParsingFlags(config).meridiem = config._meridiem, \n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem), \n configFromArray(config), checkOverflow(config);\n }", "title": "" }, { "docid": "d785782b445162e38e0007349696cd14", "score": "0.58557934", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n } else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n } else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" }, { "docid": "6c06b899e64a60a57577356b7542fc99", "score": "0.5848503", "text": "function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}", "title": "" } ]
a41def4d2a8a04e68e39c658c5454095
Import all the data
[ { "docid": "4f3af214b76ad925ba1ecc4fc8077952", "score": "0.0", "text": "function importHistory(callback) {\n console.log(\"Importing history...\");\n\n // For each region in the configuration\n async.map(conf.regions,\n function(region, nextRegion){\n\n // For each metric type in the configuration\n async.map(Object.keys(conf.metrics),\n function(metric, nextMetric){\n aws.cloudwatch.getLastSamples(region, conf.metrics[metric], 7200, function(err, data){\n if ( !STATS[region] )\n STATS[region] = {};\n if ( !STATS[region][metric] )\n STATS[region][metric] = {};\n data.forEach(function(row){\n var when = row.Timestamp.getTime()/1000;\n STATS[region][metric][when] = row.Value;\n });\n return nextMetric(null,true);\n });\n },\n function(err){\n if ( err ) {\n console.log(\"Error importing metrics: \", err);\n return process.exit(-1);\n }\n\n // Done\n return nextRegion(null,true);\n }\n );\n\n },\n function(err, res){\n console.log(\"Done\");\n return callback(err,res);\n }\n );\n}", "title": "" } ]
[ { "docid": "68fb701dd5c3c9e9f4e7de477a21103d", "score": "0.74872607", "text": "function _eFapsCreateAllImportDataModel() {\n var fileList = eFapsGetAllFiles(\"org/efaps/js/definitions\", true);\n\n importSQLTables(fileList);\n importTypes(fileList);\n}", "title": "" }, { "docid": "e46b9ce81ce1e58138ec3594cab4b387", "score": "0.65100807", "text": "async function doImportData() {\n const tablesImportList = Object.keys(tablesImportData);\n return await Promise.all(\n tablesImportList.map(async (importTable) => {\n // console.log(importTable);\n const rows = tablesImportData[importTable];\n if (rows.length) {\n try {\n return await knex(importTable)\n .insert(rows)\n .then(() => {\n console.log(`SUCCESS insert rows ${importTable}`);\n return;\n });\n } catch (error) {\n // console.log(`failed insert rows into ${importTable}`, error.code);\n return await Promise.all(\n rows.map(async (row) => {\n try {\n return await knex(importTable)\n .insert(row)\n .then(() => {\n console.log(`SUCCESS insert row into ${importTable}`);\n return;\n });\n } catch (error) {\n // console.log(`FAILED insert row ${importTable}`, error.code);\n return await knex(importTable)\n .where({ id: row.id })\n .update(row)\n .then(() => {\n console.log(\n `SUCCESS update row ${row.id} ${importTable}`\n );\n return;\n })\n .catch(async (error) => {\n console.log(\n `FAILED update row ${row.id} ${importTable} ${error.code}`\n );\n await doImportData();\n return;\n });\n }\n })\n );\n }\n }\n })\n );\n }", "title": "" }, { "docid": "cbd86506cc9abf48ed1c1fd09706376c", "score": "0.643775", "text": "function doHotelImport() {\n\n try {\n clearInterval(timer);\n\n var fileData = fs.readFileSync(`${appRoot}/server-api/dataImports/dataFiles/${fileName}`).toString()\n \n var result = extractHotelItems(fileData);\n if (result.success) {\n logger.info(`Total number of hotels parsed: ${result.hotels.length}`);\n\n if (result.hotels.length == 0) {\n logger.info('No hotel got extracted from the data file!');\n process.exit();\n }\n logger.info(result.hotels);\n \n result.hotels.forEach((hotel) => createHotel(hotel));\n } else {\n process.exit();\n }\n\n } catch (err) {\n logger.error(`ADMIN: Error importing the Hotel collection into the database! Error: ${err}`);\n mongoose.disconnect();\n process.exit();\n }\n}", "title": "" }, { "docid": "b5c67be02db8d27d9e2cd9bbafdb0621", "score": "0.63422877", "text": "async function importData() {\n try {\n await Bootcamp.create(bootcamps)\n await Course.create(courses)\n await User.create(users)\n console.log(`Data successfully created`)\n\n process.exit()\n }\n catch(err) {\n console.log(err)\n }\n}", "title": "" }, { "docid": "4ad383ead3411d2475ccf1646182a584", "score": "0.60295755", "text": "function loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n}", "title": "" }, { "docid": "1f65d658967d60bf9f0d30f42262d402", "score": "0.602084", "text": "function importPinjaData() {\n const productList = getProductList();\n const importedData = PinjaImporter.importPinjaData(productList);\n // update Saa and Läh sheets using data imported from Pinja sheets\n const saaSheet = sApp.getSheetByName(\"Saa\");\n placePinjaData(saaSheet, PinjaImporter.DIRECTIONS.IN, productList, importedData);\n const lahSheet = sApp.getSheetByName(\"Läh\");\n placePinjaData(lahSheet, PinjaImporter.DIRECTIONS.OUT, productList, importedData);\n}", "title": "" }, { "docid": "788e938e8fdbc7a616be36f8f29130c7", "score": "0.6006925", "text": "async function importFiles () {\n try {\n const downloadFolder = 'data/raw'\n await importWakfuCdnData(`${downloadFolder}/cdn`)\n await importMethodEquipment(`${downloadFolder}/method`)\n await mountRecipes()\n await getSublimations()\n await mountItems()\n } catch (error) {\n console.log(error)\n }\n}", "title": "" }, { "docid": "620be2df0b330a6b82df62b7f40d1a9f", "score": "0.59787637", "text": "function _eFapsCreateAllImportUserInterface() {\n var fileList = eFapsGetAllFiles(\"org/efaps/js/definitions\", true);\n\n importImages(fileList);\n importForms(fileList);\n importTables(fileList);\n\n createMenus(fileList);\n createSearches(fileList);\n\n importCommands(fileList);\n importMenus(fileList);\n importSearches(fileList);\n}", "title": "" }, { "docid": "4dab40d6239d5d9ab3554669176776f1", "score": "0.5968257", "text": "function loadData() {\n for (let i = 0; i < instrumentViews.length; i++) {\n let v = instrumentViews[i].getView();\n v.loadData(stateManager.currentData()[v.name]);\n }\n }", "title": "" }, { "docid": "15129d16db89d5b690b2f1fd654e3b63", "score": "0.59571016", "text": "function ImportProductCategoryData() {\n BindOrReloadProductCategoryTable('Export');\n}", "title": "" }, { "docid": "9defec1f9e1024de72bb80c9890d19bc", "score": "0.59513986", "text": "async function importData() {\n const response = await fetch(\"assets/images/example.csv\");\n const data = await response.text();\n \n const rows = data.split('\\n');\n const headings = rows[0].split(',');\n\n for (row of rows){\n const columns = parseFloat(row.split(','));\n \n }\n \n}", "title": "" }, { "docid": "0ba004ea4025b8d810a1a66c75e65033", "score": "0.59056866", "text": "function loadData(){\n\td3.queue()\n\t\t.defer(d3.csv,\"locationsinter.csv\", parseLocations) //locations_nest\n .defer(d3.csv,\"res2.csv\", parseSamples)\n .await(callbackDataLoaded)\n}", "title": "" }, { "docid": "b26380a85560b2f7cc782cdb4cc748ec", "score": "0.58951354", "text": "@task *loadData() {\n try {\n const table = yield this.api.getDemographicData({\n gender: this.selectedGender,\n race: this.selectedRace\n });\n this.data = table.rows;\n } catch (error) {\n this.data = [];\n }\n }", "title": "" }, { "docid": "21bb42bc4f73037a612fbc9b9d5348b0", "score": "0.5882099", "text": "async function fillDatabase() {\n await clear();\n\n // Products\n fs.createReadStream(path.join(__dirname, \"csv/products.csv\"), \"utf8\")\n .pipe(csv())\n .on('data', (row) => {\n const product = new Product({\n brand: row.brand,\n productName: row.productName,\n category: row.category,\n usedFor: row.usedFor.split(', '),\n ingredientsUrl: row.ingredientsUrl,\n regularPrice: parseFloat(row.price),\n description: row.description,\n instructions: row.instructions,\n fullIngredientList: row.fullIngredientList.split(', '),\n imageUrl: row.img,\n size: parseInt(row.size)\n });\n\n product.save();\n\n console.log(`Saved ${row.productName} to product database`);\n });\n\n // Ingredients\n fs.createReadStream(path.join(__dirname, \"csv/ingredients.csv\"), \"utf8\")\n .pipe(csv())\n .on('data', (row) => {\n const ingredient = new Ingredient({\n name: row.name,\n scientificName: row.scientificName,\n type: row.type,\n tldr: row.tldr.split(', '),\n description: row.description,\n sourceUrl: row.source,\n });\n\n ingredient.save();\n\n console.log(`Saved ${row.name} to ingredient database`);\n });\n}", "title": "" }, { "docid": "7d1ebc61aef1fa29a7e74765efaaae88", "score": "0.5849678", "text": "function loadData() {\n assemble.data(glob.data);\n assemble.data(assemble.plasma(glob.rootData, {namespace: function (fp) {\n var name = basename(fp, extname(fp));\n if (name === 'package') return 'pkg';\n return name;\n }}));\n assemble.data(assemble.process(assemble.data()));\n}", "title": "" }, { "docid": "6459eebb178d3f305d0e97e22726ac8b", "score": "0.5845598", "text": "function ImportCustomerData() {\n BindOrReloadCustomerTable('Export');\n}", "title": "" }, { "docid": "10f2f65d5502699ea3adb15992aa5a8b", "score": "0.58450097", "text": "function exportData() {\n brain.loadData('postures.json', trainModel);\n}", "title": "" }, { "docid": "5a8161621988da5772bd5eefd085b4d9", "score": "0.58380264", "text": "static importData(data) {\n try {\n const formData = new FormData(document.querySelector(\"#importForm\"));\n const enableClean = formData.get(\"clean\");\n const enableRestoreConfig = formData.get(\"restoreConfig\");\n\n // optionally clean selected storage area before importing\n if (enableClean) {\n Popup.storage.clear();\n }\n\n // import the data (must be validated externally)\n Popup.storage.set(data);\n\n // optionally restore current config after restore\n if (enableRestoreConfig) {\n console.log(\"XXX todo restore config\");\n }\n\n Popup.addUserMessage({\n message: Popup.getTranslation(\"popup_importDone\", \".Import of $1 items has been completed.\", [\n Object.keys(data).length,\n ]),\n level: \"success\",\n duration: 30000,\n });\n } catch (e) {\n Popup.addUserMessage({\n message: Popup.getTranslation(\"popup_importFailed\", \".Import failed: $1\", [e.message]),\n level: \"error\",\n duration: 30000,\n });\n console.log(\"Biet-O-Matic: cleanupItems() Internal error while data import: \", e.message);\n }\n }", "title": "" }, { "docid": "deb23c4d5325e1f7706139e0cc4e0312", "score": "0.5801535", "text": "function importerStart() {\n\t\timporterStatusCallback({\n\t\t\tcompleted: false,\n\t\t\tstatus: \"Reading directory structure...\",\n\t\t\tpercent: 0\n\t\t});\n\n\t\tvar modelLogFileSets = getModelLogFileSets();\n\t\tif (modelLogFileSets === false) {\n\t\t\timporterStatusCallback({\n\t\t\t\tcompleted: true,\n\t\t\t\tstatus: \"Import aborted!\",\n\t\t\t\tpercent: 100\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tasync.waterfall([\n\t\t\tfunction(callback) {\n\t\t\t\tgetBatteryLogFileSets(function(err, batteryLogFileSets) {\n\t\t\t\t\tcallback(err, batteryLogFileSets);\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t// Read model logs\n\t\t\tfunction(batteryLogFileSets, callback) {\n\t\t\t\treadModelLogs(modelLogFileSets, function(err, modelLogs) {\n\t\t\t\t\tcallback(err, batteryLogFileSets, modelLogs);\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t// Read battery logs\n\t\t\tfunction(batteryLogFileSets, modelLogs, callback) {\n\t\t\t\treadBatteryLogs(batteryLogFileSets, modelLogs, function(err, batteryLogs) {\n\t\t\t\t\tcallback(err, modelLogs, batteryLogs);\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t// Import!\n\t\t\tfunction(modelLogs, batteryLogs, callback) {\n\t\t\t\timportBatteryLogs(batteryLogs, function(err) {\n\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t], function(err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tcallback(err);\n\t\t\t\t} else {\n\t\t\t\t\timporterStatusCallback({\n\t\t\t\t\t\tcompleted: true,\n\t\t\t\t\t\tstatus: \"Imported all done...\",\n\t\t\t\t\t\tpercent: 0\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "e0f7f62abda9fc0724a31ae0e4da6a49", "score": "0.5800872", "text": "function loadData() {\n Papa.parse(csvFile, { //inladen van de file\n download: true,\n header: true,\n dynamicTyping: true,\n complete: (results) => trainModel(results.data) // gebruik deze data om te trainen\n })\n}", "title": "" }, { "docid": "4f7cc2b916ecb2674d4767a64c7df794", "score": "0.5800535", "text": "importButtonClicked(){\n const ns = NamespaceStore.ns;\n debug(\"*******************************\");\n debug(NamespaceStore);\n debug(ns);\n debug(\"*******************************\");\n \n dialog.showOpenDialog((fileNames) => {\n // fileNames is an array that contains all the selected\n if(fileNames === undefined){\n console.log(\"No file selected\");\n return;\n }\n\n fs.readFile(fileNames[0], 'utf-8', (err, data) => {\n if(err){\n alert(\"An error ocurred reading the file :\" + err.message);\n return;\n }\n //debug(fileNames[0]);\n //debug(data);\n let {dataService} = this.state;\n let lines = data.split('\\n');\n //debug(\"lines content \" + lines[0]);\n //debug(\"lines.length \" + lines.length);\n let result = [];\n let headers = lines[0].split(\",\");\n \n for(let i=1;i<lines.length;i++){\n let obj = {};\n let currentline = lines[i].split(\",\");\n for(var j=0; j<headers.length; j++){\n let str = currentline[j].trim().replace(/^\"|\"$/g, '');\n if(headers[j] == \"_id\"){\n obj[headers[j]] = ObjectID(str);\n }else{\n obj[headers[j]] = str;\n }\n \n //debug(currentline[j]);\n }\n // console.log(obj);\n debug(obj);\n result.push(obj);\n }\n //['upsert': true],\n dataService.insertMany('census_staging.stateArea',\n result, \n (err, data) => {\n if(err) {\n alert('Error!');\n debug(err);\n }\n else alert('All docs inserted');\n });\n \n });\n});\n \n }", "title": "" }, { "docid": "a5bcd17ea26b5092e3e8be236d31237e", "score": "0.57857436", "text": "function importData(evt) {\n console.log('upload')\n let file = evt.target.files[0]\n let reader = new FileReader()\n reader.readAsText(file)\n reader.onload = function(event) {\n let csvData = event.target.result\n if(csvData.slice(0, 3) === `\"\",`) {\n csvData = `\"id\",` + csvData.slice(3)\n }\n const parsedData = $.csv.toObjects(csvData)\n let convertedData = HomeFact.convertData(parsedData)\n convertedData = HomeFact.renameColumnsWithPeriods(convertedData)\n $scope.grid.data = convertedData\n $scope.grid.columnDefs = HomeFact.generateColumnDefs(convertedData[0])\n $scope.$apply()\n } // end onLoad\n reader.onerror = function() {\n console.log('error reading file')\n }\n }", "title": "" }, { "docid": "c32bf84d94cee05d2790cd17d151f271", "score": "0.5731422", "text": "function ModuleDataLoad()\r\n{\r\n\tqueue()\r\n\t.defer(d3.csv,'data/ModuleInformation.csv',parse)\r\n\t.defer(d3.csv,'data/LevelInfo.csv',parseLevle)\r\n\t.await(dataLoaded);\r\n}", "title": "" }, { "docid": "9b83f071ad2a226a505123790445350a", "score": "0.57196486", "text": "async function importingShpDataToDB (fileDirectory,searchKeyword,schema,tableName) {\n try {\n console.log(\"processing started\");\n const dir = await fs.readdirSync(fileDirectory);\n const plots = getDirByType(dir, searchKeyword);\n\n const geoJsonPromises = plots.map((file) => {\n return getGeoJson(`${fileDirectory}/${file}/${file}.shp`);\n });\n const geoJson = await Promise.all(geoJsonPromises);\n\n const pool = getPGpool();\n \n const allPromises = await addIntoDB(pool, geoJson, schema,tableName)\n return Promise.all(allPromises)\n } catch (er) {\n console.log(er);\n }\n}", "title": "" }, { "docid": "6df8ae7f6138c653f22e178437806706", "score": "0.5708258", "text": "SaveAndReimport() {}", "title": "" }, { "docid": "9ee0d09f81104ad594aab300e6b0526c", "score": "0.569697", "text": "import() {\n const importProcess = new ImportProcess(settingsImportManager);\n importProcess.setEvent(new ImportEvent(ImportEventType.FILE));\n importProcess.begin();\n }", "title": "" }, { "docid": "fc5734fff8aed61a812abdb2f7153121", "score": "0.56899285", "text": "function loadAll(arg){\n\n\tvar numFiles = countFiles();\n\tvar currentCount = 0;\n\tvar q = queue();\n\tloadArg = arg;\n\n\twhile(currentCount<numFiles){//load until we get a error...aka file not found\n\t\ttry{\n\t\t\tq = q.defer(d3.csv, filename);//append defers for every file\n\t\t\t//console.log(currentCount);\n\t\t\tcurrentCount++;\n\t\t}\n\t\tcatch(err){//should not happen now we know how many files are there...\n\t\t\tconsole.log(\"error, loading more files than found\");\n\t\t\tbreak;\n\n\t\t}\n\t\tvar yearInt = parseInt(yearIndex);\n\t\tyearInt++;\n\t\tyearIndex = yearInt.toString();\n\n\t\tif(yearInt>=10){\n\t\t\tfilename = \"data/20\" + yearIndex + \"-Table1.csv\"\n\t\t}\n\t\telse{\n\t\t\tfilename = \"data/200\" + yearIndex + \"-Table1.csv\"\n\t\t}\n\n\t}\n\tconsole.log(currentCount);\n\n\n\tq.await(onDataLoaded);\n}", "title": "" }, { "docid": "dce938009e37bee4e3118e831f9d3f20", "score": "0.5687606", "text": "async function initialLoad () {\n const auxAllCountriesSummary = await appHelper.fetchSummaryData()\n setAllCountriesSummary(auxAllCountriesSummary)\n\n const auxAllCountriesTimelineData = await appHelper.fetchTimelineData()\n setAllCountriesTimelineData(auxAllCountriesTimelineData)\n }", "title": "" }, { "docid": "a100ce446102e63a154cf5d00aee6651", "score": "0.5686963", "text": "function loadData() {\n // update the inputs with the most up-to-date data\n updateInputs(twitch.configuration)\n}", "title": "" }, { "docid": "0520294cf964d3ffed65bc99bed5981c", "score": "0.5681821", "text": "function importRawLoadData() {\n\n\t// checking all fields of required data are given\n\tvar importNewLoadName = document.getElementById(\"importLoadName\").value.trim();\n\tif (importNewLoadName == '') {\n\t\talert(\"Please enter the load name.\");\n\t\tformreset(document.getElementById(\"importLoadName\"));\n\t\treturn false;\n\t}\n\tvar importStartYearVal = document.getElementById(\"importStartYear\").value.trim();\n\tif (!importStartYearVal.match(/^\\d{4}$/)) {\n\t\talert(\"Start year value should be a positive number in YYYY format.\");\n\t\tformreset(document.getElementById(\"importStartYear\"));\n\t\treturn false;\n\t}\n\tvar importStartMonthVal = document.getElementById(\"importStartMonth\").value.trim();\n\tif (importStartMonthVal > 12 || importStartMonthVal < 1) {\n\t\talert(\"Start month cannot be bigger than 12 or smaller than 1.\");\n\t\tformreset(document.getElementById(\"importStartMonth\"));\n\t\treturn false;\n\t} else if (!importStartMonthVal.match(/^(0?[1-9]|[1-9][0-9])$/)) {\n\t\talert(\"Start month should be a digit between 1 and 12.\");\n\t\tformreset(document.getElementById(\"importStartMonth\"));\n\t\treturn false;\n\t}\n\tvar importAssocTariff = document.getElementById(\"importAssiTariff\").value.trim().toUpperCase();\n\tif (importAssocTariff == '') {\n\t\talert(\"Please enter the assigned (default) tariff of the load.\");\n\t\tformreset(document.getElementById(\"importAssiTariff\"));\n\t\treturn false;\n\t}\n\n\tvar RawLoadPath = document.getElementById(\"importRawLF\").value;\n\tif (RawLoadPath == '') {\n\t\talert(\"Please enter the assigned (default) tariff of the load.\");\n\t\tformreset(document.getElementById(\"importRawLF\"));\n\t\treturn false;\n\t}\n\n\n\t// check the load does not exist in the folder\n\tif ($.inArray(importNewLoadName , GlobalVars.listOfLoads) != -1) {\n\t\talert(importNewLoadName + \" load name already exist in the list above. If the load your are importing is new, please choose a different name.\");\n\t\tformreset(document.getElementById(\"importLoadName\"));\n\t\treturn false;\n\t}\n\n\t// create subfolder in \"load\" folder\n\tWshShell = new ActiveXObject(\"WScript.Shell\");\n\tstrPath = WshShell.CurrentDirectory;\n\tvar myObject = new ActiveXObject(\"Scripting.FileSystemObject\");\n\n\ttry {\n\n\t\t// reading the original load profile\n\t\tvar fsoN = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\tvar fsoNh = fsoN.OpenTextFile(RawLoadPath, 1 , true);\n\t\tvar line = fsoNh.ReadAll().replace( /(?:\\r\\n|\\r|\\n)/g, \",\" ).split( /,/ );\n\t\tline = line.slice(1,line.length).map(Number);\n\t\tfsoNh.Close();\n\n\t\t// adding new load to the globalVar list of loads\n\t\tGlobalVars.listOfLoads.push(importNewLoadName);\n\n\t\t// calculating the average of the load profile\n\t\tvar sum = 0;\n\t\tfor (i = 0 ; i < line.length ; i++) {\n\t\t\tsum += line[i];\n\t\t}\n\n\t\t// adding the tariff of the load to the list\n\t\tGlobalVars.loads.push({\n\t\t\t\"loadsAssoTariff\":importAssocTariff,\n\t\t\t\"loadsAvg\":Number((sum / line.length).toFixed(2)),\n\t\t\t\"loadsMax\":Math.max.apply(Math,line),\n\t\t\t\"loadsMin\":Math.min.apply(Math,line),\n\t\t\t\"loadsMaxToAvg\": Number((Math.max.apply(Math,line) / (sum / line.length)).toFixed(2))\n\t\t});\n\n\t\t// create new subfolder now\n\t\tmyObject.CreateFolder(strPath + \"\\\\load\\\\\" + importNewLoadName);\n\n\t\t// creating settings.csv file\n\t\tvar fhNN = fsoN.OpenTextFile(strPath + \"\\\\load\\\\\" + importNewLoadName + \"\\\\settings.csv\", 2 , true);\n\t\tvar settingsLines = 'StartYear,' + importStartYearVal + '\\n' +\n\t\t\t\t\t\t\t'StartMonth,' + importStartMonthVal + '\\n' +\n\t\t\t\t\t\t\t'avg,' + GlobalVars.loads[GlobalVars.loads.length - 1].loadsAvg + '\\n' +\n\t\t\t\t\t\t\t'max,' + GlobalVars.loads[GlobalVars.loads.length - 1].loadsMax + '\\n' +\n\t\t\t\t\t\t\t'min,' + GlobalVars.loads[GlobalVars.loads.length - 1].loadsMin + '\\n' +\n\t\t\t\t\t\t\t'max to avg,' + GlobalVars.loads[GlobalVars.loads.length - 1].loadsMaxToAvg + '\\n' +\n\t\t\t\t\t\t\t'Tariff,' + GlobalVars.loads[GlobalVars.loads.length - 1].loadsAssoTariff;\n \tfhNN.WriteLine(settingsLines);\n \tfhNN.Close();\n\n \t// create monthly load profiles\n \tvar monthMat = [\"jan\" , \"feb\" , \"mar\" , \"apr\" , \"may\" , \"jun\" , \"jul\" , \"aug\" , \"sep\" , \"oct\" , \"nov\" , \"dec\"];\n \tmonthMat = monthMat.concat(monthMat.splice(0 , Number(importStartMonthVal) - 1));\n\n \tvar yearMat = Array.apply(null, Array(12 - Number(importStartMonthVal) + 1)).map(function(){return Number(importStartYearVal)});\n \tif (Number(importStartMonthVal) != 1) {\n \t\tvar yearMat2 = Array.apply(null, Array(Number(importStartMonthVal) - 1)).map(function(){return Number(importStartYearVal) + 1});\n \t\tyearMat = yearMat.concat(yearMat2);\n \t}\n\n \t// leap year ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)\n \tvar monthNumber = [31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31];\n \tif (((Number(yearMat[$.inArray(\"feb\",monthMat)]) % 4 == 0) && (Number(yearMat[$.inArray(\"feb\",monthMat)]) % 100 != 0)) || (Number(yearMat[$.inArray(\"feb\",monthMat)]) % 400 == 0)) {\n \t\tmonthNumber[1] = 29;\n \t}\n \tmonthNumber = monthNumber.concat(monthNumber.splice(0 , Number(importStartMonthVal) - 1));\n\n\n \tfor (mon = 0 ; mon < 12 ; mon++) {\n \t\tvar lineMonthly = '';\n \t\tfor (day = 0 ; day < monthNumber[mon] ; day++) {\n \t\t\tvar dayValues = line.splice(0 , 24 * 4);\n\n \t\t\tfor (items = 0 ; items < 24 * 4 ; items++) {\n \t\t\t\tif (items == 24 * 4 - 1) {\n \t\t\t\t\tlineMonthly += dayValues[items];\n \t\t\t\t} else {\n \t\t\t\t\tlineMonthly += dayValues[items] + \",\";\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (day != monthNumber[mon] - 1) {\n \t\t\t\tlineMonthly += \"\\n\";\n \t\t\t}\n \t\t}\n\n \t\t// write in the CSV file\n \t\tvar fhNN = fsoN.OpenTextFile(strPath + \"\\\\load\\\\\" + importNewLoadName + \"\\\\\" + importNewLoadName + \"_\" + monthMat[mon] + \"_\" + yearMat[mon] + \".csv\", 2 , true);\n \t\tfhNN.WriteLine(lineMonthly);\n \tfhNN.Close();\n \t}\n\n \tdocument.getElementById(\"help-block\").innerHTML = \"'\" + importNewLoadName + \"' profile is created successfully. You can see the CSV files in \" +\n \t\t\t\t\t\t\t\t\t\t\t\t\t strPath + \"\\\\load\\\\\" + importNewLoadName + \" folder\";\n\n \twindow.setTimeout(function() {\n \t\tdocument.getElementById(\"help-block\").innerHTML = '';\n\t\t}, 5000);\n\n \t// updaing the current list of loads/tariff in the UI\n \tlistAllLoadsTariffs();\n\n\t} catch(error) {\n\t\talert(error.message);\n\t\t// Folder already exists. So do nothing\n\t}\n\n}", "title": "" }, { "docid": "62bfeecd8ba3671ddb872421a7dbc0e1", "score": "0.5673395", "text": "static async processRawImport(page, username) {\n if(!page) return\n\n /**Call helper function to format all the data.\n * returns array of objects containing each dataset\n */\n let formattedArray = await distrokidParser(page, username);\n \n if(!formattedArray.length){\n throw new Error(\"The distrokid data you provided was incorrectly formatted. Please try copy and pasting again.\")\n }\n\n //Remove outdated info from db before inserting new data.\n if(formattedArray[0]){\n try{\n await db.query(\n `DELETE FROM distrokid\n WHERE username = $1`, [username]\n );\n } catch (err){\n throw new Error(\"Unable to delete old data.\");\n } \n }\n\n\n const allQueries = []\n let count = 0;\n let fails = 0;\n\n //Iterate through array of fomatted data and insert it into the DB.\n for(let dataset of formattedArray){\n const validator = jsonschema.validate(dataset, distrokidDataSchema);\n if(!validator.valid){\n fails++;\n } else {\n if (dataset.earnings !== undefined) {\n let result = db.query(\n `INSERT INTO distrokid\n (username, reporting_month, sale_month, store, title, quantity, release_type, paid, sale_country, earnings)\n VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n RETURNING username`,\n [\n username,\n dataset.reportingMonth,\n dataset.saleMonth,\n dataset.store,\n dataset.title,\n parseInt(dataset.quantity),\n dataset.releaseType,\n dataset.paid,\n dataset.saleCountry,\n parseFloat(dataset.earnings.substring(1))\n ],\n );\n count++;\n allQueries.push(result);\n }\n }\n }\n\n //Wait for all the insertions to finish.\n await Promise.all(allQueries)\n\n //Raise any import errors.\n if (fails !== 0) {\n throw new BadRequestError(`Error importing ${fails} distrokid lines. Please try copy and pasting again.`)\n } else {\n return \"Distrokid\"\n }\n }", "title": "" }, { "docid": "ef7ebc8eaa135dfb00b02fb71dcd9122", "score": "0.56684935", "text": "function importAll(r) {\n r.keys().forEach(r);\n}", "title": "" }, { "docid": "ce879794b2cd7f82561f6edf355b1b64", "score": "0.5654827", "text": "async __importCityData(){\n\n let csvFilename = path.resolve(__dirname, '../data/PEP_2018_PEPANNRES_with_ann.csv');\n var lines = fs.readFileSync(csvFilename, 'utf8').split('\\r');\n\n /* \n GEO.id,Id\n GEO.id2,Id2\n GEO.display-label,Geography\n rescen42010,\"April 1, 2010 - Census\"\n resbase42010,\"April 1, 2010 - Estimates Base\"\n respop72010,Population Estimate (as of July 1) - 2010\n respop72011,Population Estimate (as of July 1) - 2011\n respop72012,Population Estimate (as of July 1) - 2012\n respop72013,Population Estimate (as of July 1) - 2013\n respop72014,Population Estimate (as of July 1) - 2014\n respop72015,Population Estimate (as of July 1) - 2015\n respop72016,Population Estimate (as of July 1) - 2016\n respop72017,Population Estimate (as of July 1) - 2017\n respop72018,Population Estimate (as of July 1) - 2018\n */\n \n // Remove first 2 rows to get rid of comments and header\n lines.shift();\n lines.shift();\n\n var bar = new ProgressBar(` Importing ${lines.length} cities [:bar] :rate/bps :percent`, {\n total: lines.length,\n width: 40\n });\n\n await Promise.map(lines, async (row)=>{\n\n \n // Break into parts, but ignore commas inside quotes\n let parts = row.match(/(\".*?\"|[^\",\\s]+)(?=\\s*,|\\s*$)/g);\n\n if (!parts){\n Logger.error(row);\n bar.tick();\n return\n }\n \n //Logger.debug(parts, row);\n\n // id2 is made up of the state and city fips code (first 2 digits is state)\n let stateFips = parts[1].slice(0, 2);\n let cityFips = parts[1].slice(2);\n\n let label = parts[2].replace(/\"/g,'');\n let labelParts = label.split(',')\n let state = labelParts[1].trim();\n let city =labelParts[0].trim();\n\n // the city name is appended with 'city' or 'town', so remove last work\n city = city.replace(/[\\W]*\\S+[\\W]*$/, '')\n\n let stateInfo = States.find(state);\n\n let tmp = { \n uuid: parts[0],\n fips: cityFips,\n stateFips: stateFips,\n city: city,\n state: stateInfo.code,\n population: parseInt(parts[parts.length-1])\n }\n\n // Now save to DB\n let doc = await CityCache.findOne({uuid: tmp.uuid});\n\n if (!doc){\n doc = new CityCache({uuid: tmp.uuid});\n }\n\n doc.fips = tmp.fips;\n doc.stateFips = tmp.stateFips;\n doc.fips = tmp.fips;\n doc.city = tmp.city;\n doc.state = tmp.state;\n doc.population = tmp.population;\n\n // layer in geo\n let geo = await GeoServices.getCityGeo(doc.city, doc.state);\n if (geo){\n doc.latitude = geo.latitude;\n doc.longitude = geo.longitude;\n }\n\n //Logger.debug(`Updating ${chalk.gray(doc.fips)} ${chalk.green(doc.city)} ${chalk.green(doc.state)}`);\n\n bar.tick();\n\n await doc.save();\n\n\n }, {concurrency:25}); \n\n\n\n }", "title": "" }, { "docid": "26ecc0731a98d3bf5a79aa05fa565bf6", "score": "0.5652713", "text": "function loadData(callback) {\n\tfs.readFile(__dirname + dbPath, function(err, data) {\n\t\t// saves it global\n\t\tAllObjects = JSON.parse(data)[0];\n\t\tcallback;\n\t});\n}", "title": "" }, { "docid": "d7caedd27749074403b15a3ee897d423", "score": "0.5652315", "text": "function loadData(){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// queue/defer data load on country ISO information.\n\t\t\t\td3.queue()\n\t\t\t\t\t.defer(d3.csv, /*vis.onLoadVariables.vars.dataFilesPath*/vis.dataPath + \"data/iso_3166_2_countries.csv\")\n\t\t\t\t\t.awaitAll(function ready(error, results, treemapData) {\n\t\t\t\t\t\tif (error) throw error;\n\t\t\t\t\t\tglobaliseData(results);\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "60cca1a3f05fc0c8ed5e134c4732dde8", "score": "0.5651093", "text": "static async dataImport(data, username){\n let res = await this.request(`${data.endpoint}/import/${username}`, data, \"post\");\n return res.response;\n }", "title": "" }, { "docid": "c31c562532301488838a4f78a406d8d4", "score": "0.5643544", "text": "function batchImport (name, toppings, imgUrl, username) {\n const pizza = new Pizza(name, toppings, imgUrl, username)\n pizzas[pizza.id] = pizza\n}", "title": "" }, { "docid": "ea4d9d15642498c775fa4f75980d8a7f", "score": "0.56155515", "text": "function loadData() {\n\tqueue()\n\t .defer(d3.csv, \"data/summary_wind_data.csv\")\n\t .defer(d3.json, \"data/us.topojson\")\n\t\t.defer(d3.csv, \"data/wind_time_series.csv\")\n\t .await(function(error, windData, usData, windTimeSeries){\n\t\t\tif(!error) {\n\t\t\t\t/**\n\t\t\t\t * ParallelCoords Data\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\t// Convert to num\n\t\t\t\tparallelCoordsData = windData;\n\t\t\t\tparallelCoordsData.forEach(function(row) {\n\t\t\t\t\tfor (var key in row) {\n\t\t\t\t\t\tif (row.hasOwnProperty(key)) {\n\t\t\t\t\t\t\tif (!(isNaN(row[key]))) { // if is a number\n\t\t\t\t\t\t\t\trow[key] = +row[key];\n\t\t\t\t\t\t\t\t// Remove null values\n\t\t\t\t\t\t\t\tif (row[key] == 9999) {\n\t\t\t\t\t\t\t\t\trow[key] = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t/**\n\t\t\t\t * US boundaries data\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\t// Unpack topoJSON to geoJson\n\t var usGeoJson = topojson.feature(usData, usData.objects.us_dtl).features;\n\t\t\t\tusGeometry = usGeoJson;\n\t\t\t\t// console.log(usGeometry);\n\n\t\t\t\t/**\n\t\t\t\t * Wind time series\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tchoroplethMapData = windTimeSeries;\n\t\t\t\tchoroplethMapData.forEach(function(row) {\n\t\t\t\t\tfor (var key in row) {\n\t\t\t\t\t\tif (row.hasOwnProperty(key)) {\n\t\t\t\t\t\t\tif (!(isNaN(row[key]))) { // if is a number\n\t\t\t\t\t\t\t\trow[key] = +row[key];\n\t\t\t\t\t\t\t\t// Remove null values\n\t\t\t\t\t\t\t\tif (row[key] == 9999) {\n\t\t\t\t\t\t\t\t\trow[key] = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcreateVis();\n\t\t\t}\n\t});\n}", "title": "" }, { "docid": "8fe3db2a7f027ada83b588b5b412b044", "score": "0.56106514", "text": "function preload(){\n table = loadTable(\"data/investments.csv\", \"csv\", \"header\");\n table2 = loadTable(\"data/companies_categories.csv\", \"csv\",\"header\");\n}", "title": "" }, { "docid": "420d870bb82c5b67685ed3bd6c42fcf3", "score": "0.559177", "text": "function loadData() {\n d3.csv(\"data/data.csv\", function(rainfallData) {\n processData(rainfallData);\n drawLegend();\n updateMap(startYear);\n });\n}", "title": "" }, { "docid": "23ca12e3b82601a8cda56efd72072556", "score": "0.55837077", "text": "populate(dataset) {\n dataset.forEach(data => {\n this.insert(data);\n });\n }", "title": "" }, { "docid": "c2ebb1b6205d08ec0dc2b9748d16aa3f", "score": "0.5562157", "text": "function loadData(){\n // Start loader animation\n d3.selectAll('.spinningBar').classed('hidden', false);\n console.log(\"Loading data...\");\n\n // Load age, gender, origin and info files and process together\n d3.queue()\n .defer(d3.csv,\"./data/ageDF_all.csv\", parseAttribute)\n .defer(d3.csv,\"./data/genderDF.csv\", parseAttribute)\n .defer(d3.csv,\"./data/originDF_all.csv\", parseAttribute)\n .defer(d3.csv,\"./data/movie_info.csv\",parseInfo)\n .await(prepareBar);\n}", "title": "" }, { "docid": "9af2fee3edba7558c13914373ca49943", "score": "0.5556569", "text": "function _importVinyls(data){\n $('#filedetails, #inputs, .description, #startimport').remove();\n $('#importform').append('<div class=\"importprogress\"><div class=\"fa fa-refresh fa-spin\"></div><p class=\"status\"><span class=\"counter\"></span><br><br><span class=\"vinylname\"></span><br><span class=\"dbstatus\"></span></p><div class=\"progress\"><div class=\"progressbar\"></div></div></div>');\n\n var count = 0;\n var added = 0;\n var exists = 0; \n var failed = 0;\n var width = 0;\n $('.status .counter').text('...');\n $('.status .vinylname').text('initiating');\n\n // Loop through CSV data\n for(var i=0; i < data.length; i++){\n \n var artist = data[i].artist;\n var title = data[i].title;\n\n // fetch Data\n Main.fetchData(artist, title, function(vinyl){ // vinyl found\n console.log(vinyl);\n\n // Add to DB\n $.ajax({\n type: 'POST',\n url: './php/importvinyl.php',\n data: {\n facebookid: FBDATA.id,\n vinyldata: JSON.stringify(vinyl)\n },\n success: function (response) {\n console.log(response);\n if(response != \"already exists!\"){\n // update status text\n $('.status .dbstatus').text(\"added!\");\n // add vinyl to table\n Main.addVinylToTable(response);\n added = added + 1;\n }\n else{\n $('.status .dbstatus').text(\"already exists!\");\n exists = exists + 1;\n }\n\n // update status\n count = count + 1;\n width = count*(100/data.length);\n $('.status .counter').text(count+'/'+data.length);\n $('.status .vinylname').text(vinyl.artist+' - '+vinyl.title);\n $('.importprogress .progressbar').css('width', width+'%');\n\n // Check if import is done.\n if(count == data.length){\n console.log(\"import done. ajax success\");\n $('.importprogress').remove();\n if($('#importreport').length){\n $('#importreport').remove();\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n else{\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n }\n },\n error: function () {\n console.warn('could not import vinyl - ajax error');\n $('.status .dbstatus').text(\"ajax DB error!\");\n failed = failed + 1;\n\n // update status\n count = count + 1;\n width = count*(100/data.length);\n $('.status .counter').text(count+'/'+data.length);\n $('.status .vinylname').text(vinyl.artist+' - '+vinyl.title);\n $('.importprogress .progressbar').css('width', width+'%');\n\n // Check if import is done.\n if(count == data.length){\n console.log(\"import done. ajax error\");\n $('.importprogress').remove();\n if($('#importreport').length){\n $('#importreport').remove();\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n else{\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n }\n }\n });\n },\n function(artist, album){ // vinyl not found\n console.log(\"couldn't find vinyl: \"+artist+\" - \"+album);\n\n // update status\n count = count + 1;\n width = count*(100/data.length);\n $('.status .counter').text(count+'/'+data.length);\n $('.status .vinylname').text(artist+' - '+title);\n $('.importprogress .progressbar').css('width', width+'%');\n\n $('.status .dbstatus').text(\"not found!\");\n failed = failed + 1;\n\n // Check if import is done.\n if(count == data.length){\n console.log(\"import done. fail\");\n $('.importprogress').remove();\n if($('#importreport').length){\n $('#importreport').remove();\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n else{\n $('#importform').append('<div id=\"importreport\"><div class=\"success-title\">success!</div><div class=\"report\"><span class=\"success\">'+added+'</span> imported, <span class=\"exists\">'+exists+'</span> already exists, <span class=\"not-found\">'+failed+'</span> not found<button class=\"button done\">Done!</button></div>');\n }\n }\n\n // wait 1s for discogs\n setTimeout(function(){\n return;\n },2000);\n });\n }\n }", "title": "" }, { "docid": "2c210ab199eb960c575d35dbbe5a4204", "score": "0.5536875", "text": "loadFiles() {\n this.icsModel = FileOps.readFile(this.pathToModel)\n .split('\\n');\n this.recipients = FileOps.readFile(this.pathToRecipients)\n .split('\\n')\n .map(recipient => recipient.split(','));\n }", "title": "" }, { "docid": "8d3007a3cc7507d55a9c4517faaa72f4", "score": "0.5536747", "text": "_loadExternalData(e) {\n let data = this.CSVtoArray(this.csvData);\n if (data.length > 0 && data[0].length > 0) this.data = data;\n this.columnHeader = true;\n }", "title": "" }, { "docid": "1c9a1639afb8675fc78a373719150cfc", "score": "0.55346745", "text": "loadData() {\n this.loadPluginStoreData()\n\n this.loadCraftData(function() {\n this.loadCraftIdData()\n this.loadCartData()\n }.bind(this))\n }", "title": "" }, { "docid": "8903979c9eb6845d9282a1e104303a42", "score": "0.55244035", "text": "function doByStart() {\n loadTestData(jsonFile_1, tableID_1, captionID_1, jsonFileContent1);\n loadTestData(jsonFile_2, tableID_2, captionID_2, jsonFileContent2);\n loadTestData(jsonFile_3, tableID_3, captionID_3, jsonFileContent3);\n loadTestData(jsonFile_4, tableID_4, captionID_4, jsonFileContent4);\n loadTestData(jsonFile_5, tableID_5, captionID_5, jsonFileContent5);\n loadTestData(jsonFile_6, tableID_6, captionID_6, jsonFileContent6);\n loadTestData(jsonFile_7, tableID_7, captionID_7, jsonFileContent7);\n loadTestData(jsonFile_8, tableID_8, captionID_8, jsonFileContent8);\n loadTestData(jsonFile_9, tableID_9, captionID_9, jsonFileContent9);\n loadTestData(jsonFile_10, tableID_10, captionID_10, jsonFileContent10);\n getSelectionValues();\n}", "title": "" }, { "docid": "d6a7854d5572b9c79df129f6e0e2f30e", "score": "0.55241805", "text": "function ImportChartOfAccountData() {\n BindOrReloadChartOfAccountTable('Export');\n}", "title": "" }, { "docid": "7a161603babd55d4cc77724d745f79ca", "score": "0.55218875", "text": "_loadExternalData(e) {\n let data = this.CSVtoArray(this.csvData);\n if (data.length > 0 && data[0].length > 0) this.set(\"data\", data);\n }", "title": "" }, { "docid": "7cd70ac4a82b9b4fac2371900fdafc80", "score": "0.5511157", "text": "async getAll() {\n // // open the file where user's data is stored\n // const contents = await fs.promises.readFile(this.filename, { encoding: 'utf-8' });\n // // read and parse its contents\n // const data = JSON.parse(contents);\n // // return the parsed data\n // return data;\n\n // the three process done above can also be done is a much shorter way->\n return JSON.parse(await fs.promises.readFile(this.filename, { encoding: 'utf-8' }));\n }", "title": "" }, { "docid": "8a5989d332f98a916abac653776d4d84", "score": "0.5498478", "text": "function loadFiles(){\n files.forEach(function(url) {\n if (url.includes(\"csv\")){\n promises.push(d3.csv(url))\n }\n else{\n promises.push(d3.json(url))\n }\n });\n}", "title": "" }, { "docid": "ca88fe96bd48d8b911b8503185807085", "score": "0.5498328", "text": "function loadDBFiles() {\n miRNA_HMDD_Genetics_DATA\t= loadDB(HMDD_GeneticsFile, \"microRNA\", false);\n miRNA_HMDD_Epigenetics_DATA\t= loadDB(HMDD_EpigeneticsFile, \"microRNA\", false);\n miRNA_HMDD_Target_DATA\t= loadDB(HMDD_TargetFile, \"microRNA\", false);\n mRNA_DAVID_DATA\t\t= loadDB(DavidFile, \"mRNA\", false);\n miRNA_SomamiR_DATA\t\t= loadDB(SomamiRFile, \"microRNA\", true);\n miRNA_mirbase_DATA\t\t= loadDB(mirbaseFile, \"microRNA\", true);\n mRNA_COSMIC_CancerGeneCensus_DATA \t\t= loadDB(COSMIC_CancerGeneCensusFile, \"mRNA\", false);\n mRNA_COSMIC_ResistanceMutation_DATA\t\t= loadDB(COSMIC_ResistanceMutationFile, \"mRNA\", false);\n mRNA_COSMIC_TargetedScreensMutantExport_DATA\t= loadDB(COSMIC_TargetedScreensMutantExportFile, \"mRNA\", false);\n}", "title": "" }, { "docid": "e0ffb645ccaf4178f40708ebf9461bfb", "score": "0.549828", "text": "async readFileAndInsert(path) {\n const csvData = [];\n console.log(path)\n //await Promise.all([\n //const promise = new Promise(function(resolv, reject) {\n //fs.createReadStream(path)\n await this.readFileAsync(path)\n .pipe(\n parse({\n delimeter: ','\n })\n )\n .on('data', function (dataRow) {\n csvData.push(dataRow)\n })\n .on('end', function () {\n const buffer = []\n for (let data of csvData) {\n buffer.push({insertOne: { \"document\": formatter(data) }})\n }\n\n // Insert en base\n SiretModel\n .bulkWrite(buffer)\n .then((ok) => {\n console.log('insert on database done')\n })\n .catch(e => console.error(e))\n })\n //})\n //return promise;\n //])\n }", "title": "" }, { "docid": "a5a2131ed7429fba99cedec3a891d8f6", "score": "0.54923975", "text": "function LoadData(data)\n{\n data.forEach(function(i)\n {\n addToDo(i.designated , i.name, i.id, i.done, i.trash); // invoke add to do function each time\n });\n}", "title": "" }, { "docid": "4cc83e08dbad8fb00e418e7102a8fb11", "score": "0.54840636", "text": "async function loadData() {\n let data = JSON.parse(localStorage.getItem('DrrrUtils'));\n if (data) {\n for (module of modules) {\n if (module.storage !== undefined) {\n if (data[module.storageKey] !== undefined) {\n module.storage = data[module.storageKey];\n } else {\n module.storage = [];\n }\n }\n }\n }\n }", "title": "" }, { "docid": "60345a1c7922b8741822c25ffef9d2fe", "score": "0.54786026", "text": "_nextStep()\n {\n // Files are normalized before the imports.\n this._normalize()\n this._imports()\n }", "title": "" }, { "docid": "3f106cbecd4d4ef1bd5f44c76ac107c2", "score": "0.5471646", "text": "async bulkImportData({ models, instruments }) {\n this.response = { success: true, errorList: [] };\n const storeModel = await this.store;\n this.store = storeModel;\n\n let anyError = false;\n let addedModels = [];\n let addedInstruments = [];\n\n if (models != null) {\n await this.addModels(models).then(async (modelResponse) => {\n addedModels = modelResponse;\n if (models.length !== modelResponse.length) {\n anyError = true;\n }\n });\n }\n\n if (instruments != null) {\n await this.addInstruments(instruments).then(\n async (instrumentResponse) => {\n addedInstruments = instrumentResponse;\n if (instruments.length !== instrumentResponse.length) {\n anyError = true;\n }\n },\n );\n }\n\n if (anyError) {\n if (instruments != null) { await this.deleteAddedInstruments(instruments, addedInstruments); }\n if (models != null) await this.deleteAddedModels(models, addedModels);\n this.response.success = false;\n }\n return JSON.stringify(this.response);\n }", "title": "" }, { "docid": "4b7f2a9d6563b2bd3e679a5a27ad5a3e", "score": "0.54468215", "text": "loadData () {\n const { modules } = this.app\n\n this.app.middlewares = this.loadFiles(modules, 'middleware')\n this.app.services = this.loadFiles(modules, 'service')\n this.app.controllers = this.loadFiles(modules, 'controller')\n this.app.behaviors = this.loadFiles(modules, 'behavior')\n this.app.schedules = this.loadFiles(modules, 'schedule')\n\n // load app ${root}/extend\n this[GET_LOADER]('extend').load()\n\n this.app.helper = this[GET_LOADER]('helper').load()\n this.app.plugins = this[GET_LOADER]('plugin').load()\n this.app.coreMiddlewares = this[GET_LOADER]('middleware').load()\n }", "title": "" }, { "docid": "d6545b08e2fae969a0f636601532da9b", "score": "0.5442944", "text": "function getAllData(){\n let sheetData = {};\n let files = fs.readdirSync(dataFolder);\n\n files.forEach(file => {\n //If JSON, simply parse it.\n if (path.extname(file) === '.json' && file.indexOf('schema') < 0){ //ignore schema\n let filename = path.basename(file, '.json');\n delete require.cache[require.resolve(dataFolder + file)]; //clear cache for json before it gets used by dataqueries\n sheetData[filename] = JSON.parse(fs.readFileSync(dataFolder + file));\n //If JS, save exports\n } else if (path.extname(file) === '.js'){\n \n let filename = path.basename(file, '.js');\n\n sheetData[filename] = require(dataFolder + file);\n delete require.cache[require.resolve(dataFolder + file)]; //clear cache\n }\n });\n\n return { sheetData };\n}", "title": "" }, { "docid": "370aaf195356aaae06acb6305f6b3ce8", "score": "0.54419315", "text": "importaNegociacoes() {\n this._service\n .importa(this._listaNegociacoes.negociacoes)\n .then(negociacoes => negociacoes.forEach(negociacao => {\n this._listaNegociacoes.adiciona(negociacao);\n this._mensagem.texto = 'Negociações do período importadas'\n }))\n .catch(erro => this._mensagem.texto = erro);\n }", "title": "" }, { "docid": "f7e3f228223ae151770a140fe4f4fc9e", "score": "0.54389745", "text": "async [dataImportedHandler]() {\n await this.refreshEnvironment();\n await this.refreshEnvironments();\n }", "title": "" }, { "docid": "e88a5ec0804a02adc9eefdc7224ff9a0", "score": "0.5432763", "text": "function preload() {\n\n data = loadTable(\"js/data/worldcities.csv\", \"csv\", \"header\");\n console.log(data);\n}", "title": "" }, { "docid": "5568e11b0b18ff14927b2cd1f18c1954", "score": "0.5430007", "text": "function eFapsCreateAll() {\n deleteAll();\n createAll();\n\n print(\"############ Reload Cache\");\n reloadCache();\n\n Shell.transactionManager.begin();\n var context = new Context(Shell.transactionManager.getTransaction(), Packages.org.efaps.admin.user.Person.get(\"Administrator\"), null);\n Context.setThreadContext(context);\n Shell.setContext(context);\n _eFapsCreateAllImportDataModel();\n Shell.transactionManager.commit();\n context.close();\n\n print(\"############ Reload Cache\");\n reloadCache();\n\n Shell.transactionManager.begin();\n var context = new Context(Shell.transactionManager.getTransaction(), Packages.org.efaps.admin.user.Person.get(\"Administrator\"), null);\n Context.setThreadContext(context);\n Shell.setContext(context);\n _eFapsCreateAllImportUserInterface();\n Shell.transactionManager.commit();\n context.close();\n\n print(\"############ Reload Cache\");\n reloadCache();\n\n _eFapsCreateAllUpdatePassword();\n}", "title": "" }, { "docid": "6668fe7d9c9e6cc2e3723964637e9004", "score": "0.54186726", "text": "function repairData() {\r\n var verdictsPath = './app/model/verdicts.json',\r\n verdictsTmpPath = './app/model/verdictsTemplate.json',\r\n myprojectsPath = './app/model/myprojects.json',\r\n myprojectsTmpPath = './app/model/myprojectsTemplate.json',\r\n prevsearchesPath = './app/model/prevsearches.json',\r\n prevsearchesTmpPath = './app/model/prevsearchesTemplate.json',\r\n flaggedVerdictsPath = './app/model/flaggedVerdicts.json',\r\n flaggedVerdictsTmpPath = './app/model/flaggedVerdictsTemplate.json';\r\n\r\n copyFileToFile(verdictsPath, verdictsTmpPath);\r\n copyFileToFile(myprojectsPath, myprojectsTmpPath);\r\n copyFileToFile(prevsearchesPath, prevsearchesTmpPath);\r\n copyFileToFile(flaggedVerdictsPath, flaggedVerdictsTmpPath);\r\n}", "title": "" }, { "docid": "c393c8d50b93637faef12433b71ddca4", "score": "0.541516", "text": "function loadAll() {\n var request = $http.get('/app/src/data/makers.json');\n request.then(function (data) {\n vm.makers =data.data;\n }); \n }", "title": "" }, { "docid": "8edc2b07d81d8441946756c63c85a8c9", "score": "0.5409099", "text": "initData() {\n allTasks(false);\n }", "title": "" }, { "docid": "e85b9b7179cdfe74314c80061e567758", "score": "0.5407288", "text": "function loadTaskData(done) {\n waitForAll([\n loadTiles,\n loadSeedMeshes\n ], done);\n}", "title": "" }, { "docid": "bf9d0fbfc8c07ed750e11b98d6b2c9e5", "score": "0.53967494", "text": "function readAllInputData()\r\n{\r\n loadUserInputData(flow_in_input_read_url, writeUserInputValue, 'Flow_in_Input');\r\n loadUserInputData(o2_input_read_url, writeUserInputValue, 'O2_Input');\r\n loadUserInputData(on_off_read_url, writeOnOffInputValue, 'On_Off_Input'); \r\n}", "title": "" }, { "docid": "9037cc254fa5cfc610e559be07f6b370", "score": "0.53881913", "text": "async function loadData() {\n let data = await d3.json(\"data.json\");\n\n let i = 0;\n data = data.map(d => {\n const rv = {\n id: i,\n word: d.word,\n frequency: d.frequency,\n nFiles: d.n_files,\n keyword: d.keyword\n };\n i++;\n return rv;\n });\n\n return data;\n}", "title": "" }, { "docid": "8396555987c1061cdd0b6761ce805930", "score": "0.53831595", "text": "function appSetupInsertDataToTables() {\n // TODO : Include the query names if any master tables needs data \n var promiseInsertContactContacts = insertDataIntoTable(queries.InsertContact);\n $q.all([\n promiseInsertContactContacts\n // TODO : Include the query names if any master tables needs data \n ]).then(function(res) {\n $scope.app = \"First Time Setup Done...\";\n $localStorage.INITIAL_SETUP_CHECK = 1;\n\n }, function(err) {\n $scope.app = \"Error Creating Database...\";\n appSetupDeleteTables()\n });\n }", "title": "" }, { "docid": "776168e3637e13079375a3e327427bd3", "score": "0.5381108", "text": "_fetchData() {\n this.widgetsData = _data__WEBPACK_IMPORTED_MODULE_2__[\"widgetsData\"];\n this.analyticsLineChart = _data__WEBPACK_IMPORTED_MODULE_2__[\"analyticsLineChart\"];\n this.averagetimeBarChart = _data__WEBPACK_IMPORTED_MODULE_2__[\"averagetimeBarChart\"];\n this.contactsData = _data__WEBPACK_IMPORTED_MODULE_2__[\"contactsData\"];\n this.salesDonutChart = _data__WEBPACK_IMPORTED_MODULE_2__[\"salesDonutChart\"];\n }", "title": "" }, { "docid": "3e468f46654da57984350140a8c5873d", "score": "0.5373124", "text": "function cargarArxiuStore(){\n var dataSource = new am4core.DataSource();\n dataSource.url = \"store.json\";\n dataSource.events.on(\"parseended\", function(ev) {\n var data = ev.target.data;\n //console.log(data);\n //info es pasa a una funcio\n informacioService(data);\n });\n dataSource.load();\n}", "title": "" }, { "docid": "fdfde092d987e2566830d6971808f30f", "score": "0.53728926", "text": "import(file) {\n function loadData(grid, data) {\n // remakes an empty grid\n grid.sizex = data.size[0];\n grid.sizey = data.size[1];\n grid._grid = Array.apply(null, Array(data.size[1])).map((n, oy) => Array.apply(null, Array(data.size[0])).map((n, ox) => new Tile(grid, ox, oy, 0, 0)));\n // fills in all the values for the new grid\n data.grid.forEach(tileData => {\n let tile = grid.getTile(tileData.position[0], tileData.position[1]);\n tile.size = tileData.size;\n tile.logo = tileData.logo;\n tile.inverted = tileData.inverted;\n tile.state = tileData.state;\n });\n // remakes the canvas to the connrect size\n grid.createCanvas();\n redraw();\n }\n // if there was a file droped it is loaded else the server file is used\n if (file) {\n if (file.subtype == 'json') {\n loadJSON(file.data, data => { loadData(this, data); });\n }\n }\n else {\n loadJSON('nodeMap.json', data => { loadData(this, data); });\n }\n }", "title": "" }, { "docid": "cab467340cee8c97b62e234addd97c9d", "score": "0.5366917", "text": "function all() {\n return require('./data/all.js');\n}", "title": "" }, { "docid": "82a09c2674da58794d76298d68b212e9", "score": "0.53652203", "text": "function uploadAll() {\n\tvar files = getFiles();\n\tfiles.append(\"meta-data\", JSON.stringify(getDataAsObj()))\n\tgetXMLHttpRequest().send(files)\n}", "title": "" }, { "docid": "45cbbc9d695c80309091778c6a90d517", "score": "0.535777", "text": "populateLegacyFiles() {\n let name;\n for (name in this.vendorFiles) {\n let args = this.vendorFiles[name];\n\n if (args === null) {\n continue;\n }\n\n this.import.apply(this, [].concat(args));\n }\n }", "title": "" }, { "docid": "30e19535c990f1e3f04fcfccce581608", "score": "0.53560597", "text": "fetchAllData() {\n this.fetchListing();\n this.fetchHoods();\n }", "title": "" }, { "docid": "863c06a802201c3e242332588c5b97e8", "score": "0.53482664", "text": "async init() {\n this._rows = csv(this._file).map(this._mapping);\n }", "title": "" }, { "docid": "4cebfab15a9b343021416ed3f586156f", "score": "0.53373516", "text": "function populateIndex() {\n\n files = fs.readdirSync('storage/youtube');\n files.forEach(function (fileName, index) {\n const data = fs.readFileSync('storage/youtube/' + fileName, 'utf8');\n const lines = JSON.parse(data);\n indexYoutube(lines, fileName.split('.').slice(0, -1).join('.'));\n })\n\n podcastFiles = fs.readdirSync('storage/audioTranscripts');\n podcastFiles.forEach(function (fileName, index) {\n const data = fs.readFileSync('storage/audioTranscripts/' + fileName, 'utf8');\n const timestamps = JSON.parse(data);\n indexPodcast(timestamps, fileName.split('.')[0]);\n })\n}", "title": "" }, { "docid": "5eb98c4df78a5ca0522f93872bebd037", "score": "0.53167796", "text": "loadAll() {\n this._loadAllTiles()\n }", "title": "" }, { "docid": "5eb98c4df78a5ca0522f93872bebd037", "score": "0.53167796", "text": "loadAll() {\n this._loadAllTiles()\n }", "title": "" }, { "docid": "f152fac86fe0cdaa1e40e85e189badc2", "score": "0.53156376", "text": "function makeTablesImportables() {\n\tvar tables = importableTables();\n tables.map(function(table) {\n addImportButton(table, tableImportButton(importTableFromButton));\n });\n}", "title": "" }, { "docid": "1060a6faa5f6304a5e74a6e8013fc491", "score": "0.53130776", "text": "function importDataSource(projectName, file) {}", "title": "" }, { "docid": "9c2b89811d7c5cf16d23934825917ca6", "score": "0.5310163", "text": "function main_get_all_datasets() {\n return new Promise(function (resolve, reject) {\n\n // Get all datasets\n Object(_js_query__WEBPACK_IMPORTED_MODULE_9__[\"query_all\"])('train').then(function (trip_data) {\n main_all_trips = trip_data;\n\n // Get ny zipcode regions\n d3.json('ny_zipcode_data.json').then(function (zipcode_data) {\n main_all_zipcodes = zipcode_data;\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "a8620d7c777f08fd292af5dff5d63585", "score": "0.53083414", "text": "function load() {\n loadExperts();\n loadResults();\n }", "title": "" }, { "docid": "302cfb6786c489406a6c0623ef5e4c34", "score": "0.52943873", "text": "function doAppConfigsImport() {\n\n try {\n clearInterval(timer);\n\n var fileData = fs.readFileSync(`${appRoot}/server-api/dataImports/dataFiles/${fileName}`).toString()\n \n var result = extractAppConfig(fileData);\n if (result.success) {\n\n if (result.appConfig == null || result.appConfig == undefined) {\n logger.info('No appConfig got extracted from the data file!');\n process.exit();\n }\n logger.info(result.appConfig);\n \n createAppConfig(result.appConfig);\n } else {\n process.exit();\n }\n\n } catch (err) {\n logger.error(`ADMIN: Error importing the appConfigs collection into the database! Error: ${err}`);\n mongoose.disconnect();\n process.exit();\n }\n}", "title": "" }, { "docid": "1441bc1aa5f9dc2c77f03c911761a5c1", "score": "0.5292839", "text": "function initGeoJSONData() {\n fs.readFile('data/geojson_foodpoint.json', function(err,content){\n geojson_foodpoints = JSON.parse(content)\n })\n fs.readFile('data/geojson_healthpoint.json', function(err,content){\n geojson_healthpoints = JSON.parse(content)\n })\n fs.readFile('data/geojson_infopoint.json', function(err,content){\n geojson_infopoints = JSON.parse(content)\n })\n fs.readFile('data/geojson_specialpoint.json', function(err,content){\n geojson_specialpoints = JSON.parse(content)\n })\n}", "title": "" }, { "docid": "8c5826434dcb6e3385f7c7479fb67fad", "score": "0.52856517", "text": "function loadData() {\n vm.isLoading = true;\n vm.gridOptions.data = [];\n const promises = {\n docs: Stitch.use(STITCH_CONFIG.PERF).query((db) => {\n return db.db(STITCH_CONFIG.PERF.DB_PERF)\n .collection(STITCH_CONFIG.PERF.COLL_POINTS)\n .aggregate($scope.getAggChain(vm.state));\n }),\n allowlist: AllowlistDataService.getAllowlistQ({'project':project})\n };\n theMostRecentPromise = promises.docs;\n $q.all(promises).then((results) => {\n // If there is more than one concurrent promise - we want the most recent.\n if (promises.docs !== theMostRecentPromise) {\n return;\n }\n\n promises.docs\n .then((docs) => vm.gridOptions.data = hydrateData(docs, results.allowlist), $log.error)\n .finally(() => $timeout(() => vm.isLoading = false));\n\n // The finally and timeout clear loading on the next event loop iteration so that the Loading indicator\n // disappears when the data load is complete. Otherwise there can be a gap.\n });\n }", "title": "" }, { "docid": "e52c996943f86c0136657a63b56da9fb", "score": "0.5281173", "text": "function calculateAll(){\n\t//everything has loaded, now to make a all data entry\n\n\n}", "title": "" }, { "docid": "58d8487a927d11480592412202999d73", "score": "0.5277232", "text": "function getBulkImports() {\n return getJSONForTable('/rest/bulkImports', 'bulkImports');\n}", "title": "" }, { "docid": "a2f855f2bd46021f96070b8407fda129", "score": "0.52765787", "text": "async getAll() {\n return JSON.parse(\n await fs.promises.readFile(this.filename, { encoding: \"utf8\" })\n );\n }", "title": "" }, { "docid": "c8af0ad5af2a2f292df15c6b33486f8e", "score": "0.5276199", "text": "async getAll() {\n // CONDENSED VERSION\n return JSON.parse(\n await fs.promises.readFile(this.filename, {\n encoding: 'utf8'\n })\n )\n\n // ============\n // LONG VERSION\n // ============\n // Open the file called this.filename\n //const contents = await fs.promises.readFile(this.filename, { encoding: 'utf8' });\n // Read its contents\n //console.log(contents)\n // Parse the contents\n //const data = JSON.parse(contents);\n // Return the parsed data\n //return data;\n }", "title": "" }, { "docid": "446beb8076f763f2be06753ed89738b8", "score": "0.5274841", "text": "loadQueries() {\n // read queries from a file\n const queries = getQueries();\n queries.forEach(this.scheduleQuery);\n }", "title": "" }, { "docid": "a09cea7862b583b14991986353f1a769", "score": "0.52649957", "text": "function upload(){\n apiObj.tables = [];\n $('label.slds-checkbox-button_is-checked').each(function() {\n // Retrieve Table Data\n $.ajax({\n url: '/app/data-model-tables/schemas/' + $(this).find('input').val() + '.json',\n success: function(data) {\n apiObj.tables.push(data);\n },\n async: false\n });\n })\n // Progress Form\n showHide('results', 'data-tables');\n createTables();\n}", "title": "" }, { "docid": "8f3cb6128bc0c688537346a7a805ef6a", "score": "0.5260413", "text": "async function init() {\r\n try {\r\n const [\r\n data_tdoll,\r\n data_equip,\r\n data_fairy,\r\n\r\n gunepoch,\r\n equepoch,\r\n\r\n id_gunepoch_tdoll,\r\n id_equepoch_equip,\r\n id_equepoch_fairy,\r\n\r\n tdoll_names,\r\n fairy_names,\r\n\r\n ] = await Promise.all([\r\n fetch('./table_info-tdoll.csv', fetch_options), \r\n fetch('./table_info-equip.csv', fetch_options),\r\n fetch('./table_info-fairy.csv', fetch_options),\r\n\r\n fetch('./table_epoch-gun_EN.csv', fetch_options),\r\n fetch('./table_epoch-equ_EN.csv', fetch_options),\r\n\r\n fetch('./tjoin_guncraftepoch-tdollid_EN.csv', fetch_options),\r\n fetch('./tjoin_equcraftepoch-equipid_EN.csv', fetch_options),\r\n fetch('./tjoin_equcraftepoch-fairyid_EN.csv', fetch_options),\r\n\r\n fetch('./tjoin_id-tdollname_EN.csv', fetch_options),\r\n fetch('./tjoin_id-fairyname_EN.csv', fetch_options),\r\n\r\n ]);\r\n const [\r\n data_tdoll_text,\r\n data_equip_text,\r\n data_fairy_text,\r\n\r\n gunepoch_text,\r\n equepoch_text,\r\n\r\n id_gunepoch_tdoll_text,\r\n id_equepoch_equip_text,\r\n id_equepoch_fairy_text,\r\n\r\n tdoll_names_text,\r\n fairy_names_text,\r\n\r\n ] = await Promise.all([\r\n data_tdoll.text(),\r\n data_equip.text(),\r\n data_fairy.text(),\r\n\r\n gunepoch.text(),\r\n equepoch.text(),\r\n\r\n id_gunepoch_tdoll.text(),\r\n id_equepoch_equip.text(),\r\n id_equepoch_fairy.text(),\r\n\r\n tdoll_names.text(),\r\n fairy_names.text(),\r\n\r\n ]);\r\n let id_tdoll_epoch_map = parse_range_map(id_gunepoch_tdoll_text);\r\n let id_equip_epoch_map = parse_range_map(id_equepoch_equip_text);\r\n let id_fairy_epoch_map = parse_range_map(id_equepoch_fairy_text);\r\n\r\n let gunepoch_map = parse_multimap(gunepoch_text, date_parser);\r\n let equepoch_map = parse_multimap(equepoch_text, date_parser);\r\n\r\n let tdoll_name_map = parse_plain_map(tdoll_names_text);\r\n let fairy_name_map = parse_plain_map(fairy_names_text);\r\n\r\n main[tdoll_str] = parse_multiarray(data_tdoll_text, tdoll_class_list);\r\n main[equip_str] = parse_multiarray(data_equip_text, equip_class_list);\r\n main[fairy_str] = parse_multiarray(data_fairy_text, fairy_class_list);\r\n\r\n property_insert(main[tdoll_str].arr, id_tdoll_epoch_map, id_str, epoch_str); // TODO: remove .arr incapsulation failure\r\n property_insert(main[equip_str].arr, id_equip_epoch_map, id_str, epoch_str);\r\n property_insert(main[fairy_str].arr, id_fairy_epoch_map, id_str, epoch_str);\r\n\r\n property_insert(main[tdoll_str].arr, tdoll_name_map, id_str, name_str);\r\n property_insert(main[fairy_str].arr, fairy_name_map, id_str, name_str);\r\n\r\n main[epoch_str] = new Object();\r\n main[epoch_str][gun_str] = gunepoch_map;\r\n main[epoch_str][equ_str] = equepoch_map;\r\n\r\n document.onkeypress = on_global_keypress;\r\n window.onpopstate = function (ev) { navigate_to(ev.state); };\r\n\r\n navigate_to(history.state);\r\n } catch (e) {\r\n document.body.innerHTML = \"Something broke ;(. Please inform the site owner. Error message: \" + e.message;\r\n }\r\n}", "title": "" }, { "docid": "aa80747074517109197186fcf39ded12", "score": "0.52588344", "text": "function ImportData() {\n//This function imports data from kobocat to the existing spreadsheet\n\n //First check to see if the setup has been run by evaluating the first form's name. If it's null run setup\n// if (ScriptProperties.getProperty('form0name') == null) {\n// setup();\n// } else { \n// //See if an update is needed\n if (UpdateNeeded()) {\n //if needed, get the data from kobocat\n //Call the function getkobocatData but first, change the URL from /forms/ to /data/\n \n checked_URL = ScriptProperties.getProperty('url');\n \n var form_data_JSON = getkobocatData(checked_URL.replace('/forms/','/data/'));//Note this presently returns all data \n Logger.log(checked_URL.replace('/forms/','/data/'));\n //Use the setRowsData function (SECTION 5) to write the data to the sheet\n setRowsData(current_sheet.getActiveSheet(), form_data_JSON);\n Logger.log(form_data_JSON);\n Browser.msgBox('Update Complete');\n }else{\n //Tell the user that the form is up to date\n Browser.msgBox('This sheet is up to date')\n }\n// }\n}", "title": "" }, { "docid": "b4622596be6ee827b29daf1eb98e2efc", "score": "0.5258222", "text": "async getAll() {\r\n return JSON.parse(\r\n await fs.promises.readFile(this.filename, {\r\n encoding: 'utf8'\r\n })\r\n );\r\n }", "title": "" }, { "docid": "f421a2f49d8aaa2d67638a19c65135d1", "score": "0.5258039", "text": "function populateDB(){\n populateTableDocs();\n populateTableInvInd();\n populateTableTerms();\n }", "title": "" }, { "docid": "34f51e4b7a4afd688d220cc6f45702d7", "score": "0.5257827", "text": "function loadPitData() {\n // loads through each file in manifest\n for (let data_id in manifest_pit) {\n let file_name = manifest_pit[data_id]; // e.g. 1540.json\n if (fs.existsSync(\"./data/pit/\" + file_name)) {\n let data_point = JSON.parse(fs.readFileSync(\"./data/pit/\" + file_name));\n let team_name = data_point[\"info\"][\"team\"];\n // sets defaults if values are non-existent\n setDefaultsForPit(data_point);\n // adds data point to pit_data\n pit_data[team_name] = data_point;\n }\n }\n}", "title": "" }, { "docid": "b3472a903e7fa635db932f6d956ed62a", "score": "0.5253477", "text": "function loadItransData(data, name, formId) {\n // There is no clear function available for itrans data, so create a new object\n // with the new itrans table data.\n const tempItrans = new Itrans();\n try {\n tempItrans.load(data);\n itrans = tempItrans;\n updateDataFileMessage('Loaded: ' + name, itrans);\n } catch(err) {\n const msg = 'Error: ' + name + ' has invalid itrans data: ' + err;\n if (formId) {\n formId.reset();\n }\n updateDataFileMessage(msg, undefined);\n alert(msg);\n }\n // Update web elements that depend on the itrans object data.\n updateAllWebElements();\n\n // Update all the output text boxes using the new spreadsheet data.\n runAllItrans();\n}", "title": "" }, { "docid": "307fb3b9b98445298592d4088b846012", "score": "0.52509665", "text": "async function readData() {\n // read data\n //model = this.dataset.name\n db = this.dataset.name ? require('../db')(this.dataset.name) : null\n\n //console.log(repos[this.dataset.name])\n try {\n const data = await db.findRecords()\n\n renderResults(data)\n console.log(data)\n } catch (error) {\n console.log(error)\n }\n \n }", "title": "" } ]
c411c6b85bfdec4f3d13ea99638fe801
Registers a callback that gets called whenever the theme changes. This should only be used when the component cannot automatically get theme changes through its state. This will not register duplicate callbacks.
[ { "docid": "83fe529b613fb4f5f5cfe515a8bb98b4", "score": "0.84991926", "text": "function registerOnThemeChangeCallback(callback) {\n if (_onThemeChangeCallbacks.indexOf(callback) === -1) {\n _onThemeChangeCallbacks.push(callback);\n }\n}", "title": "" } ]
[ { "docid": "1c8088e01da6afc71a7bcda46839f4e1", "score": "0.84869903", "text": "function registerOnThemeChangeCallback(callback) {\r\n if (_onThemeChangeCallbacks.indexOf(callback) === -1) {\r\n _onThemeChangeCallbacks.push(callback);\r\n }\r\n}", "title": "" }, { "docid": "23f3b8b429828da73763cb61abd12901", "score": "0.74002904", "text": "function registerChangeCallback() {\n var parentController = parent.controller('mdTheme');\n if (!parentController) return false;\n el.on('$destroy', parentController.registerChanges( function() {\n updateThemeClass(lookupThemeName());\n }));\n return true;\n }", "title": "" }, { "docid": "23f3b8b429828da73763cb61abd12901", "score": "0.74002904", "text": "function registerChangeCallback() {\n var parentController = parent.controller('mdTheme');\n if (!parentController) return false;\n el.on('$destroy', parentController.registerChanges( function() {\n updateThemeClass(lookupThemeName());\n }));\n return true;\n }", "title": "" }, { "docid": "23f3b8b429828da73763cb61abd12901", "score": "0.74002904", "text": "function registerChangeCallback() {\n var parentController = parent.controller('mdTheme');\n if (!parentController) return false;\n el.on('$destroy', parentController.registerChanges( function() {\n updateThemeClass(lookupThemeName());\n }));\n return true;\n }", "title": "" }, { "docid": "53184a5a0fcbfb699d397be784bd0d4d", "score": "0.6988743", "text": "function removeOnThemeChangeCallback(callback) {\r\n var i = _onThemeChangeCallbacks.indexOf(callback);\r\n if (i === -1) {\r\n return;\r\n }\r\n _onThemeChangeCallbacks.splice(i, 1);\r\n}", "title": "" }, { "docid": "03318c4f57ceab117f9c8dc75f6c2e6b", "score": "0.6978394", "text": "function removeOnThemeChangeCallback(callback) {\n var i = _onThemeChangeCallbacks.indexOf(callback);\n if (i === -1) {\n return;\n }\n _onThemeChangeCallbacks.splice(i, 1);\n}", "title": "" }, { "docid": "03318c4f57ceab117f9c8dc75f6c2e6b", "score": "0.6978394", "text": "function removeOnThemeChangeCallback(callback) {\n var i = _onThemeChangeCallbacks.indexOf(callback);\n if (i === -1) {\n return;\n }\n _onThemeChangeCallbacks.splice(i, 1);\n}", "title": "" }, { "docid": "dc7cdeedc9713985102dfc56c5e801a7", "score": "0.66206944", "text": "function initThemeChangeEvent() {\n const { classList } = document.body;\n const prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const getTheme = () => classList.contains(darkTheme) || (classList.contains(autoTheme) && prefersDark) ? \"dark\" : \"light\";\n const emitThemeChange = (theme) => document.body.dispatchEvent(new CustomEvent(\"calciteThemeChange\", { bubbles: true, detail: { theme } }));\n const themeChangeHandler = (newTheme) => {\n currentTheme !== newTheme && emitThemeChange(newTheme);\n currentTheme = newTheme;\n };\n let currentTheme = getTheme();\n // emits event on page load\n emitThemeChange(currentTheme);\n // emits event when changing OS theme preferences\n window\n .matchMedia(\"(prefers-color-scheme: dark)\")\n .addEventListener(\"change\", (event) => themeChangeHandler(event.matches ? \"dark\" : \"light\"));\n // emits event when toggling between theme classes on <body>\n new MutationObserver(() => themeChangeHandler(getTheme())).observe(document.body, {\n attributes: true,\n attributeFilter: [\"class\"]\n });\n}", "title": "" }, { "docid": "7b096c8e93e02f83fd9bb913e5b068b5", "score": "0.64513594", "text": "function changeTheme(theme, hex) {\n $('#' + theme + '').on(action, function() {\n $('h1.welcome').hide();\n pageWrap.css('opacity', '0');\n preloader.show();\n spinner.show();\n setTimeout(function() {\n spinner.hide();\n setTimeout(function() {\n preloader.hide();\n spinner.fadeOut();\n pageWrap.css('opacity', '1');\n }, 500);\n }, 2000);\n $('.tp-banner').revolution();\n $('#mainTheme').attr('href', 'assets/css/main-theme/themes/' + theme + '-m.css');\n $('#bootstrapTheme').attr('href', 'assets/css/bootstrap/themes/' + theme + '-b.css');\n return false;\n });\n\n /*--------------------------------------------------\n * Change a style of knobs (Our skills seciton)\n ----------------------------------------------------*/\n $(\"#\" + theme).on(action, function(event) {\n event.preventDefault();\n $(\".lbKnob\").trigger(\n \"configure\", {\n \"fgColor\": hex\n }\n );\n });\n }", "title": "" }, { "docid": "a1ddb1694e8d40f48d1cf98adfbb16c3", "score": "0.6280153", "text": "function setColorTheme(){\n\n}", "title": "" }, { "docid": "da706e0b390a729b6fc71dcfeb724928", "score": "0.62626463", "text": "function changeTheme(name) {\n\n}", "title": "" }, { "docid": "256f8633b6a2037787d147313d29e0d0", "score": "0.6156903", "text": "observeAndApplyThemeStyles() {\n if (this.isObservingThemeSettings) return;\n this.disposables.add(atom.config.onDidChange('terminal-tab.matchTheme', this.applyThemeStyles.bind(this)));\n this.disposables.add(atom.themes.onDidChangeActiveThemes(this.applyThemeStyles.bind(this)));\n this.isObservingThemeSettings = true;\n this.applyThemeStyles();\n }", "title": "" }, { "docid": "58513ef46cba034ba03731b6c2a543e9", "score": "0.61038166", "text": "function themeChange(theme){\n themeObject.setProperty('--main-background', themes[theme].mainbackground);\n themeObject.setProperty('--toggle-background', themes[theme].toogleBackground);\n themeObject.setProperty('--keypad-background', themes[theme].keypadBackground);\n themeObject.setProperty('--screen-background', themes[theme].screenBackground);\n themeObject.setProperty('--key-background', themes[theme].keyBackground);\n themeObject.setProperty('--key-shadow', themes[theme].keyShadow);\n themeObject.setProperty('--key-action-background', themes[theme].keyActionBackground);\n themeObject.setProperty('--key-shadow-action-background', themes[theme].keyActionShadow);\n themeObject.setProperty('--key-background-secondary', themes[theme].keyBackgroundSecondary);\n themeObject.setProperty('--key-background-secondary-shadow', themes[theme].keyBackgroundShadowSecondary);\n themeObject.setProperty('--text-primary-color', themes[theme].textPrimary);\n themeObject.setProperty('--text-secondary-color', themes[theme].textSecondary);\n themeObject.setProperty('--text-sub', themes[theme].textSub);\n}", "title": "" }, { "docid": "ce09c3cf42d0397910395070efeba8f0", "score": "0.60979676", "text": "function onThemeChanged(theme) {\n\n if($stateParams.theme){\n forceGadm0();\n }\n\n //Find the current theme level, if any\n var level = $rootScope.level; //set in drawoverlays\n\n if (!level) return; //no theme\n\n var layer;\n\n if(level == -1){\n //Arc Regions\n layer = overlays_dictionary[\"arcregions\"];\n }\n else{\n //Gadm\n layer = overlays_dictionary[\"gadm\" + level];\n }\n\n\n if (layer) {\n\n if($stateParams.theme.toLowerCase() === 'none'){\n //Skip the mumbo jumbo. Clear the cached ECOS data and redraw empty\n $rootScope.vtData = {};\n redrawThemeLayers(layer);\n }\n else{\n //For vector tile choropleths, ask for new data .json from the server\n getECOSProperties(function (data) {\n\n if (data && data.features) {\n\n var guids = {};\n\n angular.forEach(data.features, function (dataItem, dataKey) {\n guids[dataItem.properties.guid] = dataItem.properties;\n });\n\n $rootScope.vtData = guids; //Store the data to be merged with vector tile layer. In config/vectortiles.js, the MVT choropleth layers will attempt to merge this data in when tiles finish loading (any time new tiles are requested, like zoomin/out/pan)\n\n redrawThemeLayers(layer);\n\n }\n })\n }\n\n }\n\n }", "title": "" }, { "docid": "9ae0f94a9798eaa70cf79347aa40ae1e", "score": "0.6068652", "text": "function changeTheme(event) {\n const value = event.target.value\n setState(prevState => ({...prevState, theme: value}))\n if (value !== \"auto\") window.localStorage.theme = value\n else window.localStorage.removeItem(\"theme\")\n log.info(\"Setting theme to\", value)\n setTheme()\n }", "title": "" }, { "docid": "cc87d0def6074f59497571a9cd541562", "score": "0.60593134", "text": "function onThemeLabelChanged() {\n\n //Find the current theme level, if any\n var level = $rootScope.level; //set in drawoverlays\n\n if(!level) return; //no theme\n\n var layer = overlays_dictionary[\"gadm\" + level];\n\n if (layer) {\n redrawThemeLayers(layer);\n }\n\n }", "title": "" }, { "docid": "0382be3db3995e70d92ae4e8690f8b61", "score": "0.60278195", "text": "function changeCustomTheme(event) {\n const target = event.currentTarget.value;\n updateSettings({ customTheme: target });\n addCustomTheme(target);\n }", "title": "" }, { "docid": "09cd8aa8e5cc2522ac95b497e27de3f7", "score": "0.59977776", "text": "applySavedTheme() {\n if (this.savedTheme) {\n this.body.setAttribute('data-bs-theme', this.savedTheme);\n if (this.savedTheme === 'dark') {\n this.toggleBtn.checked = true;\n }\n }\n\n this.toggleBtn.addEventListener('change', () => {\n this.toggleTheme()\n });\n\n this.toggleBtn.addEventListener('keydown', ( keyboardEvent ) => {\n switch (keyboardEvent.key) {\n case 'Enter':\n case 'Space':\n keyboardEvent.preventDefault();\n this.toggleTheme()\n break;\n }\n });\n }", "title": "" }, { "docid": "104fab8d2ca038bf4942b398bb63a4e2", "score": "0.5958143", "text": "setTheme(state,themeName){\n state.currentTheme = themeName;\n }", "title": "" }, { "docid": "7191a628fb222a418ec86a87e1617959", "score": "0.5927544", "text": "function changeTheme() {\n return {\n type: THEME,\n }\n}", "title": "" }, { "docid": "7dd11417842a668a73ff5ae5e2eab8a9", "score": "0.5921632", "text": "setTheme(value) {\n let theme = document.getElementById('theme');\n theme.href = value;\n this.signals.themeChanged.dispatch(value);\n }", "title": "" }, { "docid": "b5d3e291a5ae7b5ec5b2ac057ebe73b7", "score": "0.58994734", "text": "function themeLight() {\r\n setTheme('theme-light');\r\n }", "title": "" }, { "docid": "1a95c7e1d133c02c0298a955f204dbf8", "score": "0.58842623", "text": "callbackColorChange(){\n this.setTint(this.naturalTint);\n }", "title": "" }, { "docid": "ea14ceb8772ed142e2cfe56e33f6ea59", "score": "0.58842516", "text": "function registerThemeSwitcher() {\n for (const el of document.querySelectorAll(\".theme-switcher button\")) {\n el.addEventListener(\"click\", (evt) => {\n const nextTheme = evt.currentTarget.dataset.theme;\n document.body.dataset.theme = nextTheme || \"auto\";\n try {\n localStorage.setItem(\"theme\", nextTheme);\n } catch (e) {}\n });\n }\n\n // Show the switcher now that it can work.\n for (const el of document.getElementsByClassName(\"theme-switcher\")) {\n el.style.display = \"initial\";\n }\n}", "title": "" }, { "docid": "41d4959ee77b41334c54e105dd3732ed", "score": "0.584935", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "3f8042e2608379e3b6d1448574af5b17", "score": "0.58406997", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" }, { "docid": "ad78c258841047643f0dcfad589e6796", "score": "0.5834345", "text": "function setHookCallback (callback) {\n hookCallback = callback;\n }", "title": "" } ]
4a4cb79710ea9dcbb7f3396baa1d2e2d
Set drag event handlers
[ { "docid": "10af61307ef670f43a5b3a072f25d624", "score": "0.0", "text": "onLeave(f) {\n this._onleave = f;\n }", "title": "" } ]
[ { "docid": "885404092366589c03c5a71b5c45b7f0", "score": "0.7756176", "text": "onHandlers() {\n // draggable\n if (this.props[\"draggable\"]) {\n this._dragHandler = new DragHandler(this);\n this._dragHandler.enable();\n }\n }", "title": "" }, { "docid": "2fcc8cbfbc534235aa8e42bbe8c4ea05", "score": "0.76240873", "text": "setupDraggableHandlers() {\n\t\tthis.addEventListener('pointerdown', this._onPointerDown)\n\t\tthis.disableDraggableHandlers = () => this.removeEventListener('pointerdown', this._onPointerDown)\n\t\tthis.registerKillback(this.disableDraggableHandlers)\n\t}", "title": "" }, { "docid": "4d5a79a13aa31eac56201b4d4f682a82", "score": "0.72337484", "text": "bindDragEvents() {\n this.draggable = new OdoDraggable(this._carouselEl, {\n axis: this.isVertical ? OdoPointer.Axis.Y : OdoPointer.Axis.X,\n });\n\n this._onDragStart = this._handleDragStart.bind(this);\n this._onDragMove = this._handleDragMove.bind(this);\n this._onDragEnd = this._handleDragEnd.bind(this);\n\n this.draggable.on(OdoDraggable.EventType.START, this._onDragStart);\n this.draggable.on(OdoDraggable.EventType.MOVE, this._onDragMove);\n this.draggable.on(OdoDraggable.EventType.END, this._onDragEnd);\n }", "title": "" }, { "docid": "f4f20fcd181b32422004c89a2f37e255", "score": "0.68449384", "text": "disableDraggableHandlers() {}", "title": "" }, { "docid": "51462d8cabc3d4ea65340dd02322c0b3", "score": "0.68239933", "text": "attach() {\n this.draggable\n .on('drag:start', this[onDragStart])\n .on('drag:move', this[onDragMove])\n .on('drag:stop', this[onDragStop]);\n }", "title": "" }, { "docid": "3673255763b33c1eea4a86230bb73dcc", "score": "0.6799197", "text": "onMouseDrag(e) {// Implemeneted by subclasses.\n }", "title": "" }, { "docid": "5a0760ee5cef19e2e8b919e04dae2cfb", "score": "0.67552286", "text": "onMouseDrag(e) {}", "title": "" }, { "docid": "b4feff73bf9c52e636ac75e52686882b", "score": "0.67527443", "text": "function plotBindDragHandlers()\n{\n if ( g_bPan )\n {\n // Unbind zoom handlers\n $(\"#plotview\").off( 'plotselected' );\n $(\"#plotview\").off( 'plotunselected' );\n\n // Bind pan handler\n $(\"#plotview\").on( 'plotpan', plotPan );\n }\n else\n {\n // Unbind pan handler\n $(\"#plotview\").off( 'plotpan' );\n\n // Bind zoom handlers\n $(\"#plotview\").on( 'plotselected', plotZoomIn );\n $(\"#plotview\").on( \"plotunselected\", plotZoomOut );\n }\n}", "title": "" }, { "docid": "cd87608d87f78bca237ce7d5a224822d", "score": "0.6695038", "text": "setListeners() {\n this.canvas.addEventListener(\"mouseup\", (e) => {\n e.stopPropagation()\n this.endDrag(e)\n })\n this.canvas.addEventListener(\"mousedown\", (e) => {\n this.startDrag(e)\n })\n this.canvas.addEventListener(\"mousemove\", (e) => {\n if (this.dragging) {\n this.moveSelectedImage(e)\n }\n })\n }", "title": "" }, { "docid": "a49fa40ea475bbe479f0ba24ccefd251", "score": "0.66430664", "text": "eventsDragAndDrop(img) {\n\n eventOndragstart(this, img);\n\n eventOndragenter(this, img);\n\n eventOndragover(img);\n\n eventOndragleave(this, img);\n\n eventOnDrop(this, img);\n\n }", "title": "" }, { "docid": "4a5712a34ccc6494b47c6ac4cc84ad59", "score": "0.65639246", "text": "function initEvents(){\n\t\t\n\t\t//strip mouse down - drag start\n\t\tg_objStrip.bind(\"mousedown touchstart\",onTouchStart);\n\n\t\t\n\t\t//on body mouse up - drag end\n\t\tjQuery(window).add(\"body\").bind(\"mouseup touchend\",onTouchEnd);\n\t\t\t\t\n\t\t//on body move\n\t\tjQuery(\"body\").bind(\"mousemove touchmove\", onTouchMove);\n\t\t\n\t}", "title": "" }, { "docid": "2731ad004a07bebde594da8273219471", "score": "0.6509991", "text": "function attachEventHandlers() {\n // TODO arrow: attach events for functionality like in assignment-document described\n\t\tobject.on('click', () => _this.diagram.arrowClick(_this));\n\t\t\n // TODO arrow optional: attach events for bonus points for 'TAB' to switch between arrows and to select arrow\n }", "title": "" }, { "docid": "1818aeb8ff7e54fd14bd8143207196f9", "score": "0.64726263", "text": "prepareDragging() {\n let wrapper = this.$refs.wrapper;\n this.addEventListeners(wrapper, [\"mousedown\", \"touchstart\"], this.startDragging);\n }", "title": "" }, { "docid": "46d5281030c8181716fc3c91d56e5d34", "score": "0.64514947", "text": "function DragHandler(el){\r\n el.remember('_draggable', this)\r\n this.el = el\r\n }", "title": "" }, { "docid": "957ed34c0c6cf9e6fa290fdc4056d65c", "score": "0.64449173", "text": "function DragHandler(el){\n el.remember('_draggable', this);\n this.el = el;\n }", "title": "" }, { "docid": "28438efc2b63c2bab5851cbcee7fd9bb", "score": "0.63996494", "text": "function addEventHandlers() {\n global_canvas.on('mouse:down', function(options){ beginRectDraw(options) });\n global_canvas.on('mouse:up', function(options){ finishRect(options) });\n global_canvas.on('mouse:move', function(options){ drawRect(options) });\n global_canvas.on('object:selected', function(options){ showDeleteBtn(options) } );\n global_canvas.on('object:modified', function(options){ showDeleteBtn(options) } );\n global_canvas.on('object:moving', function(options){ showDeleteBtn(options) } );\n global_canvas.on('object:scaling', function(options){ showDeleteBtn(options) } );\n global_canvas.on('object:rotated', function(options){ showDeleteBtn(options) } );\n}", "title": "" }, { "docid": "ef6e643a40fa84196e53d60cbe39912d", "score": "0.6387194", "text": "function initItemsDragEvents(){\r\n\t\t\r\n\t\t// on body mousemove - operate icon hide\r\n\t\tjQuery(\"body\").mousemove(onBodyMouseMove);\r\n\t\t\r\n\t\t//on list wrapper mousemove - operate dragging targetcheck \r\n\t\tg_objManagerWrapper.mousemove(onGalleryMouseMove);\r\n\t\t\r\n\t\t//on body mouseup\r\n\t\tjQuery(\"body\").mouseup(onBodyMouseUp);\r\n\t\tjQuery(\"body\").mousedown(onBodyMouseDown);\r\n\t\t\t\t\t\r\n\t\t//on item mousedown\r\n\t\tjQuery(\"#uc_list_items\").on(\"mousedown\", \"li\",onItemMouseDown);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "0be835788ec4835571cdbfb7e23eaa9a", "score": "0.6384255", "text": "function addLisener(){\n elem.bind('dragenter', dragenter);\n elem.bind('dragleave', dragleave);\n elem.bind('dragover', dragover);\n elem.bind('drop', drop);\n }", "title": "" }, { "docid": "390e97253ec41a98cd2c199e1a48f0b1", "score": "0.6329975", "text": "function handleDragEvents(e) {\n e.stopPropagation();\n e.preventDefault();\n return this.emit(e.type, e);\n }", "title": "" }, { "docid": "d91e71f6abe137fce412cfb96e591ddf", "score": "0.63273376", "text": "function handleDragEvents(WWPElm) {\n\n\t\tWWPElm.on('mousedown', handleStartDrag);\n\t\tWWPElm.on('mousemove', handleContinueDrag);\n\t\tWWPElm.on('mouseleave', handleEndDrag);\n\t\tWWPElm.on('mouseup', handleEndDrag);\n\n\t\tWWPElm.onSingleTouch('touchstart', handleStartDrag);\n\t\tWWPElm.onMultiTouch('touchstart', handleEndDrag);\n\t\tWWPElm.onTouch('touchend', handleEndDrag);\n\t\tWWPElm.onTouch('touchmove', handleContinueDrag);\n\t}", "title": "" }, { "docid": "1b28d71cd3373d1a5385118e4dba26ca", "score": "0.63236725", "text": "setEventHandlers() {\n this.ctx.canvas.onclick = this.canvasClickHandler.bind(this);\n this.ctx.canvas.onmousemove = this.canvasMouseMoveHandler.bind(this);\n }", "title": "" }, { "docid": "ef8629e1c8ff136f217e553c7dc5d15e", "score": "0.6321931", "text": "_events() {\n this._addClickHandler();\n this._addFocusHandler();\n }", "title": "" }, { "docid": "1843bcb1e8bfbba855549f008ed43c81", "score": "0.630237", "text": "handleEvent(event) {\n switch (event.type) {\n case 'p-dragenter':\n this._evtDragEnter(event);\n break;\n case 'p-dragleave':\n this._evtDragLeave(event);\n break;\n case 'p-dragover':\n this._evtDragOver(event);\n break;\n case 'p-drop':\n this._evtDrop(event);\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "c304a56e9454cefe7c1c3a3b817f3357", "score": "0.63017637", "text": "constructor(props){\n super(props);\n //-------------------------------------------------------------\n // Binding Handlers\n //-------------------------------------------------------------\n let memberFunctions = Object.getOwnPropertyNames(Draggable.prototype);\n for(let functionName of memberFunctions){\n if(functionName.startsWith('handle')){\n this[functionName] = this[functionName].bind(this);\n }\n }\n //-------------------------------------------------------------\n }", "title": "" }, { "docid": "acad5c9c1a7fca8f94ef4ed55eaf7b38", "score": "0.6268183", "text": "_registerMouseListeners() {\n this.addListener('pointerdown', this._pointerDown);\n this.addListener('pointerup', this._pointerUp);\n this.addListener('pointermove', this._pointerMove);\n this.dragging = false;\n this.brushing = false;\n }", "title": "" }, { "docid": "c27c7c73323fed5b5f85ef74926feb0f", "score": "0.6251074", "text": "onSliderStartDrag (e) {\n this.onStartInteraction()\n this.onSliderDrag(e)\n window.addEventListener('mouseup', this.onSliderStopDrag)\n window.addEventListener('mousemove', this.onSliderDrag)\n e.preventDefault()\n }", "title": "" }, { "docid": "68fa63ad5b83b9ed806b45323d41446b", "score": "0.62439793", "text": "set_mouse_handlers() {\n let canvas = this.canvas;\n let br = () => canvas.getBoundingClientRect();\n\n let comp_x = event => this.canvas_manager.mapPixelToCoordsX(event.clientX - br().left);\n let comp_y = event => this.canvas_manager.mapPixelToCoordsY(event.clientY - br().top);\n\n // Mouse handler event types\n for (let evtype of ['mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend',\n 'wheel', 'click', 'dblclick', 'contextmenu']) {\n canvas.addEventListener(evtype, x => {\n let cancelled = this.on_mouse_event(x, comp_x, comp_y, evtype);\n if (cancelled)\n return;\n x.stopPropagation();\n x.preventDefault();\n });\n }\n }", "title": "" }, { "docid": "680846d505109814332a2deb49f7601f", "score": "0.6220635", "text": "initEventHandlers() {\n this.initHover();\n\n // setting up MouseEventHandler\n this.mouseEventHandle = new MouseEventHandler(this);\n\n // dynamic listeners\n this.domElement.addEventListener(\"eventListenerAdded\", () => this.mouseEventHandle.resync());\n this.domElement.addEventListener(\"eventListenerRemoved\", () => this.mouseEventHandle.resync());\n }", "title": "" }, { "docid": "760a324935af4f5df1868a6a20f33702", "score": "0.6217163", "text": "enableDrag(dragFn, grabFn, dropFn, target=this)\n {\n const iterate = (grp)=>{\n grp.children.forEach((childNode)=>{\n if (childNode instanceof Group3D)\n {\n iterate(childNode);\n }\n else // Obj3D\n {\n if (childNode.dragNdrop === null) // don't over-write if its already assigned a handler\n {\n childNode.enableDrag(dragFn, grabFn, dropFn, target);\n }\n }\n });\n }\n this.dragNdropHandlers = arguments;\n iterate(this);\n }", "title": "" }, { "docid": "0aef6e102a237dd098b1837c7706bbfa", "score": "0.61939776", "text": "function attachEventHandlers() {\n // Deactivate the default browser context menu within the diagram\n _this.area.contextmenu(event => event.preventDefault());\n\n $(window).resize(() => {\n _this.area.find(\".device\").draggable({disabled: $(window).width() < 768});\n });\n\n // Update the currently drawn arrow's endpoint on mouse movement\n _this.area.mousemove(event => {\n if (drawingArrow) {\n drawingArrow.updateEndPosition(getRelativeCoordinates(event.pageX, event.pageY));\n }\n });\n\n // Enable the diagram area to be droppable\n _this.area.droppable({\n tolerance: \"fit\",\n drop: addDevice\n });\n\n // Toggle arrow drawing when clicking on the arrow button\n arrowButton.mousedown(event => {\n event.stopPropagation();\n toggleArrowActive()\n });\n\n context.mousedown(event => event.stopPropagation());\n\n // Remove context menu and active marker when clicking somewhere within the body\n $(\"body\").mousedown(() => {\n context.hide();\n selectDevice(null);\n selectArrow(null);\n deactivateArrowDrawing();\n });\n\n // Listen to shortcut keys\n $(\"html\").keyup(event => {\n if ($(\"input, select\").has($(event.target)).length) {\n // Don't execute key handler when inside an input element\n return;\n }\n\n switch (event.keyCode) {\n case 46:\n // Del (ENTF) pressed\n deleteSelectedArrow();\n deleteSelectedDevice();\n break;\n case 65:\n // a,A pressed\n toggleArrowActive();\n break;\n }\n });\n\n context.find(\".contextView\").click(event => {\n event.preventDefault();\n context.hide();\n if (selectedDevice) {\n showDeviceDetails(selectedDevice);\n }\n });\n\n context.find(\".contextDelete\").click(event => {\n event.preventDefault();\n context.hide();\n deleteSelectedDevice();\n });\n }", "title": "" }, { "docid": "33f87c77b6b3668dc9a17f4b239044cd", "score": "0.6193873", "text": "function dragPrep() {\n\tdropzones = document.getElementsByClassName(\"dropzone\");\n\tdrags = document.getElementsByClassName(\"drag\");\n\tconsole.log(dropzones, drags);\n\tfor (var i = 0; i < dropzones.length; i++) {\n\t\tdropzones[i].addEventListener('drop', drop_handler);\n\t\tdropzones[i].addEventListener('dragover', dragover_handler);\n\t}\n\tfor (var i = 0; i < drags.length; i++) {\n\t\tdrags[i].draggable = true;\n\t\tdrags[i].addEventListener('dragstart', dragstart_handler);\n\t}\n}", "title": "" }, { "docid": "6aa6eb663458a8ff17e2f08eb63f6bd0", "score": "0.61367947", "text": "function Draggable() {\n\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\n\t // this._x = 0;\n\t // this._y = 0;\n\t }", "title": "" }, { "docid": "6aa6eb663458a8ff17e2f08eb63f6bd0", "score": "0.61367947", "text": "function Draggable() {\n\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\n\t // this._x = 0;\n\t // this._y = 0;\n\t }", "title": "" }, { "docid": "6aa6eb663458a8ff17e2f08eb63f6bd0", "score": "0.61367947", "text": "function Draggable() {\n\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\n\t // this._x = 0;\n\t // this._y = 0;\n\t }", "title": "" }, { "docid": "0e57366ba09ea7eb370f1b1289c81b21", "score": "0.6127244", "text": "handleDragstart() {\n this.dragging = true;\n }", "title": "" }, { "docid": "82de5ddb6f07868e7263badab7d1bf03", "score": "0.61263317", "text": "dragBegin () {}", "title": "" }, { "docid": "82de5ddb6f07868e7263badab7d1bf03", "score": "0.61263317", "text": "dragBegin () {}", "title": "" }, { "docid": "d73de05931ffffa5774a3a24a4d02efa", "score": "0.6121363", "text": "function CdkDragDrop() { }", "title": "" }, { "docid": "d8009fe1a0cb41465939fc895cb44025", "score": "0.6120801", "text": "_addEventHandlers() {\n // Register drag-and-drop event handlers.\n this._node.addEventListener(\"dragstart\", this, false);\n this._node.addEventListener(\"dragend\", this, false);\n this._node.addEventListener(\"mouseover\", this, false);\n\n // Specially treat the sponsored icon & suggested explanation\n // text to prevent regular hover effects\n let sponsored = this._querySelector(\".newtab-sponsored\");\n let suggested = this._querySelector(\".newtab-suggested\");\n this._ignoreHoverEvents(sponsored);\n this._ignoreHoverEvents(suggested);\n }", "title": "" }, { "docid": "57e1ad6c2172fd689ddb0f342a70e592", "score": "0.61075455", "text": "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "title": "" }, { "docid": "36088f71a983de4c877cdf187f33f53b", "score": "0.61037153", "text": "function events ( behaviour ) {\n\n\t\t\t// Attach the standard drag event to the handles.\n\t\t\tif ( !behaviour.fixed ) {\n\n\t\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\t\tattach ( actions.start, handle.children[0], start, {\n\t\t\t\t\t\thandles: [ handle ],\n\t\t\t\t\t\thandleNumber: index\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Attach the tap event to the slider base.\n\t\t\tif ( behaviour.tap ) {\n\n\t\t\t\tattach ( actions.start, scope_Base, tap, {\n\t\t\t\t\thandles: scope_Handles\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Fire hover events\n\t\t\tif ( behaviour.hover ) {\n\t\t\t\tattach ( actions.move, scope_Base, hover, { hover: true } );\n\t\t\t}\n\n\t\t\t// Make the range draggable.\n\t\t\tif ( behaviour.drag ){\n\n\t\t\t\tvar drag = [scope_Base.querySelector( '.' + options.cssClasses.connect )];\n\t\t\t\taddClass(drag[0], options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\tdrag.push(scope_Handles[(drag[0] === scope_Handles[0] ? 1 : 0)].children[0]);\n\t\t\t\t}\n\n\t\t\t\tdrag.forEach(function( element ) {\n\t\t\t\t\tattach ( actions.start, element, start, {\n\t\t\t\t\t\thandles: scope_Handles\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cfb49e6aac3e454c3a7eb68a1cc9422c", "score": "0.6103147", "text": "function dragged() {\n d3.event.subject.push([d3.event.x, d3.event.y]);\n }", "title": "" }, { "docid": "368a1c6c38aa5787a627bfb587646ec5", "score": "0.6099657", "text": "attachEventListeners (draggableItem, vnode) {\n // this.items.push(draggableItem)\n\n draggableItem.addEventListener('mousedown', (e) => {\n this.options.callbackBeforeMousdown(e, this)\n this._mouseDown(e)\n vnode.context.$emit('mousedown')\n this.options.callbackAfterMousdown(e, this)\n })\n draggableItem.addEventListener('mouseup', (e) => {\n this.options.callbackBeforeMouseup(e, this)\n this._mouseUp(e)\n vnode.context.$emit('mouseup')\n this.options.callbackAfterMouseup(e, this)\n })\n draggableItem.addEventListener('dragstart', (e) => {\n this.options.callbackBeforeDragStart(e, this)\n this._dragStart(e)\n vnode.context.$emit('dragstart')\n this.options.callbackAfterDragStart(e, this)\n })\n draggableItem.addEventListener('dragover', (e) => {\n this.options.callbackBeforeDragOver(e, this)\n //dragover event to allow the drag by preventing its default\n if (this.selections.items.length) {\n e.preventDefault()\n }\n vnode.context.$emit('dragover')\n this.options.callbackAfterDragOver(e, this)\n })\n\n draggableItem.addEventListener('dragend', (e) => {\n this.options.callbackBeforeDragend(e, this)\n this._dragEnd(e)\n vnode.context.$emit('dragend')\n this.options.callbackAfterDragend(e, this)\n })\n }", "title": "" }, { "docid": "6e30be0ed91763daf9a31986307313d7", "score": "0.6092392", "text": "function Draggable() {\n\t\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\t\n\t // this._x = 0;\n\t // this._y = 0;\n\t }", "title": "" }, { "docid": "a9c4cab261344314b8c08c5034f81f68", "score": "0.6087521", "text": "function Draggable() {\n\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this);\n this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }", "title": "" }, { "docid": "a9c4cab261344314b8c08c5034f81f68", "score": "0.6087521", "text": "function Draggable() {\n\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this);\n this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }", "title": "" }, { "docid": "a9c4cab261344314b8c08c5034f81f68", "score": "0.6087521", "text": "function Draggable() {\n\n this.on('mousedown', this._dragStart, this);\n this.on('mousemove', this._drag, this);\n this.on('mouseup', this._dragEnd, this);\n this.on('globalout', this._dragEnd, this);\n // this._dropTarget = null;\n // this._draggingTarget = null;\n\n // this._x = 0;\n // this._y = 0;\n }", "title": "" }, { "docid": "4479f82dcd0615c0173a0469a423668a", "score": "0.6087407", "text": "function ech_attachMouseDrag(div,dwnf,dwnc,movf,movc,upf,upc,clkf,clkc){\n var doc;\n \n if(_dom==1||_dom==2){\n doc = div;\n doc.onmousedown = ech_mousedown;\n document.onmousemove = ech_mousemove;\n document.onmouseup = ech_mouseup;\n } else if(_dom==3){\n doc = div.document;\n doc.onmousedown = ech_mousedown;\n doc.onmousemove = ech_mousemove;\n doc.onmouseup = ech_mouseup;\n doc.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);\n } else if(_dom==4){\n doc = div;\n div.onmousedown = ech_mousedown;\n document.body.onmousemove = ech_mousemove;\n document.body.onmouseup = ech_mouseup;\n } else return null;\n if(!doc.eventCtrl) doc.eventCtrl = new EventCtrl(div);\n var ctrl=doc.eventCtrl;\n ctrl.dragging = false; ctrl.dragged = false;\n ctrl.startX = 0; ctrl.startY = 0;\n ctrl.curX = 0; ctrl.curY = 0;\n ctrl.mousedown = dwnf; ctrl.mousedownClient = dwnc;\n ctrl.mousemove = movf; ctrl.mousemoveClient = movc;\n ctrl.mouseup = upf; ctrl.mouseupClient = upc;\n ctrl.mouseclick= clkf; ctrl.mouseclickClient= clkc;\n ctrl.threshold = 5;\n ctrl.mask|=2;\n return ctrl;\n}", "title": "" }, { "docid": "bb4782420389aa7d49cc1d593887cb33", "score": "0.60853785", "text": "function Draggable() {\n\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this);\n\t // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\n\t // this._x = 0;\n\t // this._y = 0;\n\t}", "title": "" }, { "docid": "9334f5d4a9cd80931b937d1e97fa509f", "score": "0.6079525", "text": "function events ( behaviour ) {\n\n\t\tvar i, drag;\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tfor ( i = 0; i < $Handles.length; i += 1 ) {\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattach ( actions.start, $Handles[i].children(), start, {\n\t\t\t\t\thandles: [ $Handles[i] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\n\t\t\tattach ( actions.start, $Base, tap, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\n\t\t// Make the range dragable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tdrag = $Base.find( '.' + Classes[7] ).addClass( Classes[10] );\n\n\t\t\t// When the range is fixed, the entire range can\n\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t// origin will propagate the start event upward,\n\t\t\t// but it needs to be bound manually on the other.\n\t\t\tif ( behaviour.fixed ) {\n\t\t\t\tdrag = drag.add($Base.children().not( drag ).children());\n\t\t\t}\n\n\t\t\tattach ( actions.start, drag, start, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "f0ae78362ac37d4f533b2467058be443", "score": "0.6072935", "text": "function attachEventHandlers() {\n object.contextmenu(event => diagram.showContextMenu(_this, event));\n\n object.mousedown(event => {\n event.stopPropagation();\n diagram.deviceMouseDown(_this);\n });\n\n object.keyup(event => {\n if (event.which === 13 || event.which === 32) {\n // Enter or space pressed\n event.stopPropagation();\n diagram.deviceMouseDown(_this);\n }\n });\n\n object.mouseup(() => diagram.deviceMouseUp(_this));\n\n object.dblclick(() => diagram.showDeviceDetails(_this));\n\n object.mouseenter(() => {\n const arrowDeviceAdd = diagram.arrowReference.clone()\n .addClass(\"arrow-device-add-in-area\")\n .mousedown(() => diagram.activateArrowDrawing());\n object.append(arrowDeviceAdd);\n });\n\n object.mouseleave(() => object.find(\".arrow-device-add-in-area\").remove());\n }", "title": "" }, { "docid": "e3e431b0b02fd8812466838d1162a349", "score": "0.6071707", "text": "addDragAndDropEventListeners() {\n this.eventBus.on('taskView:taskOrderChanged', (draggedTask) => {\n globalEventBus.emit('taskController:taskOrderChanged', [this.model.card.cardID, draggedTask]);\n });\n this.eventBus.on('taskView:taskMovedToAnotherCard', ([draggedTask, startTasksDiv]) => {\n globalEventBus.emit('taskController:taskMovedToAnotherCard', [draggedTask, startTasksDiv]);\n });\n }", "title": "" }, { "docid": "42b7b263a645c5b9d0512fff3d61e417", "score": "0.6069393", "text": "function xEnableDrag(id,fS,fD,fE)\n{\n var mx = 0, my = 0, el = xGetElementById(id);\n if (el) {\n el.xDragEnabled = true;\n xAddEventListener(el, 'mousedown', dragStart, false);\n }\n // Private Functions\n function dragStart(e)\n {\n if (el.xDragEnabled) {\n var ev = new xEvent(e);\n xPreventDefault(e);\n mx = ev.pageX;\n my = ev.pageY;\n xAddEventListener(document, 'mousemove', drag, false);\n xAddEventListener(document, 'mouseup', dragEnd, false);\n if (fS) {\n fS(el, ev.pageX, ev.pageY, ev);\n }\n }\n }\n function drag(e)\n {\n var ev, dx, dy;\n xPreventDefault(e);\n ev = new xEvent(e);\n dx = ev.pageX - mx;\n dy = ev.pageY - my;\n mx = ev.pageX;\n my = ev.pageY;\n if (fD) {\n fD(el, dx, dy, ev);\n }\n else {\n xMoveTo(el, xLeft(el) + dx, xTop(el) + dy);\n }\n }\n function dragEnd(e)\n {\n var ev = new xEvent(e);\n xPreventDefault(e);\n xRemoveEventListener(document, 'mouseup', dragEnd, false);\n xRemoveEventListener(document, 'mousemove', drag, false);\n if (fE) {\n fE(el, ev.pageX, ev.pageY, ev);\n }\n if (xEnableDrag.drop) {\n xEnableDrag.drop(el, ev);\n }\n }\n}", "title": "" }, { "docid": "ecda4aa3282d745498bb9c6c7db2ad90", "score": "0.6056335", "text": "function _registerDnd() {\n\tif(didRegisterDnd){\n\t\treturn;\n\t}\n\n\t// Register proxy-functions for draggable.start/drag/stop\n\n\t$.ui.plugin.add(\"draggable\", \"connectToFancytree\", {\n\t\tstart: function(event, ui) {\n\t\t\t// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10\n\t\t\tvar draggable = $(this).data(\"ui-draggable\") || $(this).data(\"draggable\"),\n\t\t\t\tsourceNode = ui.helper.data(\"ftSourceNode\") || null;\n\n\t\t\tif(sourceNode) {\n\t\t\t\t// Adjust helper offset, so cursor is slightly outside top/left corner\n\t\t\t\tdraggable.offset.click.top = -2;\n\t\t\t\tdraggable.offset.click.left = + 16;\n\t\t\t\t// Trigger dragStart event\n\t\t\t\t// TODO: when called as connectTo..., the return value is ignored(?)\n\t\t\t\treturn sourceNode.tree.ext.dnd._onDragEvent(\"start\", sourceNode, null, event, ui, draggable);\n\t\t\t}\n\t\t},\n\t\tdrag: function(event, ui) {\n\t\t\tvar ctx, isHelper, logObject,\n\t\t\t\t// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10\n\t\t\t\tdraggable = $(this).data(\"ui-draggable\") || $(this).data(\"draggable\"),\n\t\t\t\tsourceNode = ui.helper.data(\"ftSourceNode\") || null,\n\t\t\t\tprevTargetNode = ui.helper.data(\"ftTargetNode\") || null,\n\t\t\t\ttargetNode = $.ui.fancytree.getNode(event.target),\n\t\t\t\tdndOpts = sourceNode && sourceNode.tree.options.dnd;\n\n\t\t\t// logObject = sourceNode || prevTargetNode || $.ui.fancytree;\n\t\t\t// logObject.debug(\"Drag event:\", event, event.shiftKey);\n\t\t\tif(event.target && !targetNode){\n\t\t\t\t// We got a drag event, but the targetNode could not be found\n\t\t\t\t// at the event location. This may happen,\n\t\t\t\t// 1. if the mouse jumped over the drag helper,\n\t\t\t\t// 2. or if a non-fancytree element is dragged\n\t\t\t\t// We ignore it:\n\t\t\t\tisHelper = $(event.target).closest(\"div.fancytree-drag-helper,#fancytree-drop-marker\").length > 0;\n\t\t\t\tif(isHelper){\n\t\t\t\t\tlogObject = sourceNode || prevTargetNode || $.ui.fancytree;\n\t\t\t\t\tlogObject.debug(\"Drag event over helper: ignored.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tui.helper.data(\"ftTargetNode\", targetNode);\n\n\t\t\tif( dndOpts && dndOpts.updateHelper ) {\n\t\t\t\tctx = sourceNode.tree._makeHookContext(sourceNode, event, {\n\t\t\t\t\totherNode: targetNode,\n\t\t\t\t\tui: ui,\n\t\t\t\t\tdraggable: draggable,\n\t\t\t\t\tdropMarker: $(\"#fancytree-drop-marker\")\n\t\t\t\t});\n\t\t\t\tdndOpts.updateHelper.call(sourceNode.tree, sourceNode, ctx);\n\t\t\t}\n\n\t\t\t// Leaving a tree node\n\t\t\tif(prevTargetNode && prevTargetNode !== targetNode ) {\n\t\t\t\tprevTargetNode.tree.ext.dnd._onDragEvent(\"leave\", prevTargetNode, sourceNode, event, ui, draggable);\n\t\t\t}\n\t\t\tif(targetNode){\n\t\t\t\tif(!targetNode.tree.options.dnd.dragDrop) {\n\t\t\t\t\t// not enabled as drop target\n\t\t\t\t} else if(targetNode === prevTargetNode) {\n\t\t\t\t\t// Moving over same node\n\t\t\t\t\ttargetNode.tree.ext.dnd._onDragEvent(\"over\", targetNode, sourceNode, event, ui, draggable);\n\t\t\t\t}else{\n\t\t\t\t\t// Entering this node first time\n\t\t\t\t\ttargetNode.tree.ext.dnd._onDragEvent(\"enter\", targetNode, sourceNode, event, ui, draggable);\n\t\t\t\t\ttargetNode.tree.ext.dnd._onDragEvent(\"over\", targetNode, sourceNode, event, ui, draggable);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// else go ahead with standard event handling\n\t\t},\n\t\tstop: function(event, ui) {\n\t\t\tvar logObject,\n\t\t\t\t// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10:\n\t\t\t\tdraggable = $(this).data(\"ui-draggable\") || $(this).data(\"draggable\"),\n\t\t\t\tsourceNode = ui.helper.data(\"ftSourceNode\") || null,\n\t\t\t\ttargetNode = ui.helper.data(\"ftTargetNode\") || null,\n\t\t\t\tdropped = (event.type === \"mouseup\" && event.which === 1);\n\n\t\t\tif(!dropped){\n\t\t\t\tlogObject = sourceNode || targetNode || $.ui.fancytree;\n\t\t\t\tlogObject.debug(\"Drag was cancelled\");\n\t\t\t}\n\t\t\tif(targetNode) {\n\t\t\t\tif(dropped){\n\t\t\t\t\ttargetNode.tree.ext.dnd._onDragEvent(\"drop\", targetNode, sourceNode, event, ui, draggable);\n\t\t\t\t}\n\t\t\t\ttargetNode.tree.ext.dnd._onDragEvent(\"leave\", targetNode, sourceNode, event, ui, draggable);\n\t\t\t}\n\t\t\tif(sourceNode){\n\t\t\t\tsourceNode.tree.ext.dnd._onDragEvent(\"stop\", sourceNode, null, event, ui, draggable);\n\t\t\t}\n\t\t}\n\t});\n\n\tdidRegisterDnd = true;\n}", "title": "" }, { "docid": "e1c86941f5b5954dafe79f91ec805e8e", "score": "0.60514015", "text": "function initDrag( )\r\n{\r\n if (document.layers)\r\n {\r\n // turn on event capture for these events in NN4 event model\r\n document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);\r\n return;\r\n }\r\n else if (document.body & document.body.addEventListener)\r\n {\r\n // turn on event capture for these events in W3C DOM event model\r\n document.addEventListener(\"mousedown\", engage, true);\r\n document.addEventListener(\"mousemove\", dragIt, true);\r\n document.addEventListener(\"mouseup\", release, true);\r\n return;\r\n }\r\n document.onmousedown = engage;\r\n document.onmousemove = dragIt;\r\n document.onmouseup = release;\r\n return;\r\n}", "title": "" }, { "docid": "d0e826754ce38cfed563d329672ca2a6", "score": "0.60486287", "text": "function draggingHandler(e)\n {\n if(dragged === null) return;\n\n let ext = dragged.extension('Drag');\n if (ext === null) ext = dragged.instance().extension('Drag');\n if (ext === null) return;\n\n let target = ext.target,\n targetElement = ext.params.targetElement;\n\n let mX = e.touches !== undefined ? e.touches[0].clientX : e.clientX;\n let mY = e.touches !== undefined ? e.touches[0].clientY : e.clientY;\n\n let deltaX = mX - initialX;\n let deltaY = mY - initialY;\n\n let iTop = withinParent ? initialTop - initialParentTop : initialTop;\n let iLeft = withinParent ? initialLeft - initialParentLeft : initialLeft;\n\n let newLeft = iLeft + deltaX;\n let newTop = iTop + deltaY;\n\n if (useBoundaries) {\n // Prevent from dragging outside along X.\n if(newLeft < 0) newLeft = 0;\n if(withinParent){\n let myW = targetElement.__.node.clientWidth;\n let parentW = targetElement.__.node.parentNode.clientWidth;\n if(newLeft > parentW - myW){\n newLeft = parentW - myW;\n }\n }\n\n // Prevent from dragging outside along Y.\n if(newTop < 0) newTop = 0;\n if(withinParent){\n let myH = targetElement.__.node.clientHeight;\n let parentH = targetElement.__.node.parentNode.clientHeight;\n if(newTop > parentH - myH){\n newTop = parentH - myH;\n }\n }\n }\n\n let event = new Event('drag', {cancelable: true});\n\n let initialPoint = new Point(iLeft, iTop);\n let newPoint = new Point(newLeft, newTop);\n let deltaPoint = new Point(deltaX, deltaY);\n\n\n target.triggerEvent('drag', targetElement.instance(), initialPoint, deltaPoint, event);\n\n if (target !== targetElement) {\n targetElement.triggerEvent('drag', targetElement.instance(), initialPoint, deltaPoint, event);\n }\n\n\n // If event's default is not prevented - apply new position.\n if(event.defaultPrevented){\n return;\n }\n\n let cssObj = {position: withinParent ? 'absolute' : 'fixed'};\n if(x){\n cssObj.left = newPoint.x + 'px';\n }\n if(y){\n cssObj.top = newPoint.y + 'px';\n }\n targetElement.css(cssObj);\n }", "title": "" }, { "docid": "7b50526ca23e171529e0d3c8f80c1852", "score": "0.60366374", "text": "_registerEvents() {\n this._registerMouseEvents();\n this._registerKeyboardEvents();\n }", "title": "" }, { "docid": "2647f8768bf237b48fe73df1c86f4cac", "score": "0.6035492", "text": "function init(){\n document.getElementById(\"box1\").addEventListener(\"dragstart\", box1_dragstart);\n document.getElementById(\"box1\").setAttribute(\"draggable\", true);\n document.getElementById(\"box2\").addEventListener(\"dragstart\", box2_dragstart);\n document.getElementById(\"box2\").setAttribute(\"draggable\", true);\n document.getElementById(\"box3\").addEventListener(\"dragstart\", box3_dragstart);\n document.getElementById(\"box3\").setAttribute(\"draggable\", true);\n document.getElementById(\"box4\").addEventListener(\"dragstart\", box4_dragstart);\n document.getElementById(\"box4\").setAttribute(\"draggable\", true);\n document.getElementById(\"box5\").addEventListener(\"drop\", box5_drop);\n document.getElementById(\"box5\").addEventListener(\"dragover\", box5_dragover);\n}", "title": "" }, { "docid": "4d051d5006a7522c5f9fb4aeb4179bb9", "score": "0.60321647", "text": "function Diavenn(){\n\n document.getElementById(\"dos\").addEventListener('dragstart',drag,false);\n document.getElementById(\"uno\").addEventListener('dragstart',drag,false);\n document.getElementById(\"siete\").addEventListener('dragstart',drag,false);\n document.getElementById(\"tres\").addEventListener('dragstart',drag,false);\n document.getElementById(\"cuatro\").addEventListener('dragstart',drag,false);\n document.getElementById(\"cinco\").addEventListener('dragstart',drag,false);\n document.getElementById(\"seis\").addEventListener('dragstart',drag,false);\n document.getElementById(\"cero\").addEventListener('dragstart',drag,false);\n document.getElementById(\"ocho\").addEventListener('dragstart',drag,false);\n document.getElementById(\"nueve\").addEventListener('dragstart',drag,false);\n document.getElementById(\"cI\").addEventListener('dragover',permitirDrop,false);\n document.getElementById(\"cI\").addEventListener('drop',drop,false);\n document.getElementById(\"cC\").addEventListener('dragover',permitirDrop,false);\n document.getElementById(\"cC\").addEventListener('drop',drop,false);\n document.getElementById(\"cD\").addEventListener('dragover',permitirDrop,false);\n document.getElementById(\"cD\").addEventListener('drop',drop,false);\n \n\n document.getElementById(\"panel\").addEventListener('dragover',permitirDrop,false);\n document.getElementById(\"panel\").addEventListener('drop',drop,false);\n\n}//fin del metodo Diavenn", "title": "" }, { "docid": "5572e5e99bd2fbd4ceacdda97d88d20a", "score": "0.601946", "text": "function start ( event, data ) {\n\n\t\t// Mark the handle as 'active' so it can be styled.\n\t\tif( data.handles.length === 1 ) {\n\t\t\tdata.handles[0].children().addClass(Classes[15]);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Attach the move event.\n\t\tattach ( actions.move, doc, move, {\n\t\t\tstart: event.calcPoint,\n\t\t\thandles: data.handles,\n\t\t\tpositions: [\n\t\t\t\t$Locations[0],\n\t\t\t\t$Locations[$Handles.length - 1]\n\t\t\t]\n\t\t});\n\n\t\t// Unbind all movement when the drag ends.\n\t\tattach ( actions.end, doc, end, null );\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\t$('body').css('cursor', $(event.target).css('cursor'));\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( $Handles.length > 1 ) {\n\t\t\t\t$Target.addClass(Classes[12]);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t$('body').on('selectstart' + namespace, false);\n\t\t}\n\t}", "title": "" }, { "docid": "30554e7b432fbcccbdb30dfb69c817de", "score": "0.6012809", "text": "onMouseDrag(deltaPos, button) { }", "title": "" }, { "docid": "c6221b41682ca9226f725358002555b0", "score": "0.59978235", "text": "function events ( behaviour ) {\r\n\r\n\t\t// Attach the standard drag event to the handles.\r\n\t\tif ( !behaviour.fixed ) {\r\n\r\n\t\t\tscope_Handles.forEach(function( handle, index ){\r\n\r\n\t\t\t\t// These events are only bound to the visual handle\r\n\t\t\t\t// element, not the 'real' origin element.\r\n\t\t\t\tattach ( actions.start, handle.children[0], start, {\r\n\t\t\t\t\thandles: [ handle ],\r\n\t\t\t\t\thandleNumber: index\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Attach the tap event to the slider base.\r\n\t\tif ( behaviour.tap ) {\r\n\r\n\t\t\tattach ( actions.start, scope_Base, tap, {\r\n\t\t\t\thandles: scope_Handles\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Fire hover events\r\n\t\tif ( behaviour.hover ) {\r\n\t\t\tattach ( actions.move, scope_Base, hover, { hover: true } );\r\n\t\t}\r\n\r\n\t\t// Make the range draggable.\r\n\t\tif ( behaviour.drag ){\r\n\r\n\t\t\tvar drag = [scope_Base.querySelector( '.' + options.cssClasses.connect )];\r\n\t\t\taddClass(drag[0], options.cssClasses.draggable);\r\n\r\n\t\t\t// When the range is fixed, the entire range can\r\n\t\t\t// be dragged by the handles. The handle in the first\r\n\t\t\t// origin will propagate the start event upward,\r\n\t\t\t// but it needs to be bound manually on the other.\r\n\t\t\tif ( behaviour.fixed ) {\r\n\t\t\t\tdrag.push(scope_Handles[(drag[0] === scope_Handles[0] ? 1 : 0)].children[0]);\r\n\t\t\t}\r\n\r\n\t\t\tdrag.forEach(function( element ) {\r\n\t\t\t\tattach ( actions.start, element, start, {\r\n\t\t\t\t\thandles: scope_Handles\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3ceb1b1c3792fc9966160747c64d0981", "score": "0.5990588", "text": "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "title": "" }, { "docid": "56399034d28ae05685faa0fdf211094d", "score": "0.59878916", "text": "function handleSelectionBoxDragging () {\n\n this.selection.element.addEventListener('mousedown', this._onRepositionMouseDown.bind(this));\n }", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9725914e530cbe3f8b4ab2057c02b3cc", "score": "0.5978184", "text": "function bindSliderEvents ( behaviour ) {\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tscope_Handles.forEach(function( handle, index ){\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattachEvent ( actions.start, handle.children[0], eventStart, {\n\t\t\t\t\thandleNumbers: [index]\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattachEvent (actions.start, scope_Base, eventTap, {});\n\t\t}\n\n\t\t// Fire hover events\n\t\tif ( behaviour.hover ) {\n\t\t\tattachEvent (actions.move, scope_Base, eventHover, { hover: true });\n\t\t}\n\n\t\t// Make the range draggable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tscope_Connects.forEach(function( connect, index ){\n\n\t\t\t\tif ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar handleBefore = scope_Handles[index - 1];\n\t\t\t\tvar handleAfter = scope_Handles[index];\n\t\t\t\tvar eventHolders = [connect];\n\n\t\t\t\taddClass(connect, options.cssClasses.draggable);\n\n\t\t\t\t// When the range is fixed, the entire range can\n\t\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t\t// origin will propagate the start event upward,\n\t\t\t\t// but it needs to be bound manually on the other.\n\t\t\t\tif ( behaviour.fixed ) {\n\t\t\t\t\teventHolders.push(handleBefore.children[0]);\n\t\t\t\t\teventHolders.push(handleAfter.children[0]);\n\t\t\t\t}\n\n\t\t\t\teventHolders.forEach(function( eventHolder ) {\n\t\t\t\t\tattachEvent ( actions.start, eventHolder, eventStart, {\n\t\t\t\t\t\thandles: [handleBefore, handleAfter],\n\t\t\t\t\t\thandleNumbers: [index - 1, index]\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e6bf0451c2f2ab0abb90a83f8d149d4d", "score": "0.59721285", "text": "function _makedraggable() {\n var onMouseDown, onMouseUp, onStartDrag;\n var el, dragging\n\n el = $('#ontologyViewerPan');\n\n //swallow click events when dragging\n el.draggable({\n start: function () {\n $(this).data(\"dragging\", true)\n },\n stop: function () {\n $(this).data(\"dragging\", false)\n }\n });\n }", "title": "" }, { "docid": "3ea50d623d0ef761d4bff27350ee8f18", "score": "0.5968128", "text": "function initFileDrop() {\n canvas.addEventListener('dragover', dragOver, false);\n canvas.addEventListener('dragenter', dragOver, false);\n canvas.addEventListener('drop', fileDropped, false);\n}", "title": "" }, { "docid": "7318ae162b2d4c160a9cc8a4ba093150", "score": "0.5965283", "text": "function initDrag() {\n \n if ($.browser.msie && parseInt($.browser.version) <= 9) {\n return false; \n } else {\n\n var dragSrcEl = null;\n \n var cols = document.querySelectorAll('#gallery > div.item');\n [].forEach.call(cols, function(col) {\n col.addEventListener('dragstart', handleDragStart, false);\n col.addEventListener('dragenter', handleDragEnter, false)\n col.addEventListener('dragover', handleDragOver, false);\n col.addEventListener('dragleave', handleDragLeave, false);\n col.addEventListener('drop', handleDrop, false);\n col.addEventListener('dragend', handleDragEnd, false);\n });\n } \n}", "title": "" }, { "docid": "f27a3cf7e895bd7d331a07a74d38ed63", "score": "0.5964824", "text": "function drag_drag(d) {\n d.fx = d3.event.x;\n d.fy = d3.event.y;\n }", "title": "" }, { "docid": "59cd4bf57aed5c62d64b7ed77e4146e5", "score": "0.5964711", "text": "function dragStartHandler(e) {\n name = e.target.id; // explicit name of dragged object\n e.dataTransfer.setData(\"text\", name); // add data to dragged object\n e.target.classList.add(\"dragged\"); // add \"dragged\" class for visualization\n updateColors(e); // update droplists colors\n\n}", "title": "" }, { "docid": "b9da04fcba12a3fd9fa3a2dc89cf351c", "score": "0.59646827", "text": "function drag_drag(d) {\n d.fx = d3.event.x;\n d.fy = d3.event.y;\n }", "title": "" }, { "docid": "c1082d6606a131964663d5393eeddc83", "score": "0.5955015", "text": "static init() {\n window.addEventListener(\"mousedown\", (e) => {\n this.dragDropZone = e.target.closest(\".cp-element\");\n if (this.dragDropZone) {\n this.#isMouseDown = true;\n this.dragDropPointer = this.dragDropZone.querySelector(\".cp-pointer\");\n // TODO: floor or round?\n this.dragDropPointerOffsetX = Math.floor(this.dragDropPointer.offsetWidth / 2);\n this.dragDropPointerOffsetY = Math.floor(this.dragDropPointer.offsetHeight / 2);\n\n this.classType = this.dragDropZone.dataset.classtype;\n\n if (this.classType === \"slider\") {\n this.orientation = this.dragDropZone.dataset.orientation;\n }\n\n // Moves pointer where the mouse is down.\n this.#movePointer(e);\n }\n });\n\n window.addEventListener(\"mousemove\", (e) => {\n if (this.#isMouseDown) {\n // If mouse down and moving, move pointer.\n this.#movePointer(e);\n }\n });\n\n window.addEventListener(\"mouseup\", (e) => {\n if (this.#isMouseDown) {\n this.#isMouseDown = false;\n }\n });\n }", "title": "" }, { "docid": "9e7285455f916f4bbf4a1d89ae7ed214", "score": "0.59542495", "text": "componentDidMount() {\n let draggableObj = this.props.draggableObj;\n draggableObj.registerEventHandlers(draggableObj.element);\n }", "title": "" }, { "docid": "aaca681f8b2188f385d5602c78293ce2", "score": "0.5952981", "text": "function enableElementsEvents() {\n $('img').draggable('enable');\n $('img').droppable('enable');\n}", "title": "" }, { "docid": "9b1e6122b39c380f94dbda7ef5a5963c", "score": "0.594619", "text": "function setupDragAction(element, dragAction) {\n function move() {\n dragAction();\n }\n function down() {\n document.addEventListener(\"mousemove\", move, false);\n }\n function up() {\n document.removeEventListener(\"mousemove\", move, false);\n }\n element.addEventListener(\"mousedown\", down, false);\n}", "title": "" }, { "docid": "3c441839bc771c6574b6776765327ddd", "score": "0.5932057", "text": "onDraggingHandler(event) {\n const { clientX, clientY } = !this.isTouch ? event : event.touches[0];\n\n this.origin.classList.add('is-dragging');\n\n this.translateOriginOnMove(clientX, clientY);\n\n this.indexOvered = this.findElementOvered(clientX, clientY);\n\n this.items.forEach((item, index) => this.translateItem(item, index));\n }", "title": "" }, { "docid": "3aae0c440bc8383ee1e3e2dde42b97f0", "score": "0.59274006", "text": "function OnMouseDrag ()\n{\n\tis_draging = true;\n\n}", "title": "" }, { "docid": "cf10c87144bcd48b8cdf3294bc015b78", "score": "0.5925913", "text": "function drag(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n // toGetOrientation(ev.target.id)\n toGetTipoCant(ev.target.id);\n toSetTipo(ev.target.id);\n}", "title": "" }, { "docid": "9edfabc533b2889a12033fc242b0d2c9", "score": "0.59245163", "text": "function registerImageDragEvents() {\n var $dragging, x, y, clientX, clientY;\n if (self.options.imageHelper) {\n self.photoHelper.on(\"mousedown touchstart\", dragStart)\n .css('cursor', 'move');\n } else {\n self.photoFrame.on(\"mousedown touchstart\", dragStart);\n }\n\n /**\n * Stop dragging\n */\n $(window).on(\"mouseup touchend\", function (e) {\n if ($dragging) {\n /**\n * Call the onPositionChange callback\n */\n if (typeof self.options.onPositionChange === 'function') {\n self.options.onPositionChange(self.model);\n }\n /**\n * Call the onChange callback\n */\n if (typeof self.options.onChange === 'function') {\n self.options.onChange(self.model);\n }\n }\n $dragging = null;\n });\n /**\n * Drag the image inside the container\n */\n $(window).on(\"mousemove touchmove\", function (e) {\n\n if ($dragging) {\n e.preventDefault();\n var refresh = false;\n clientX = e.clientX;\n clientY = e.clientY;\n if (e.touches) {\n clientX = e.touches[0].clientX\n clientY = e.touches[0].clientY\n }\n\n var dy = (clientY) - y;\n var dx = (clientX) - x;\n dx = Math.min(dx, 0);\n dy = Math.min(dy, 0);\n /**\n * Limit the area to drag horizontally\n */\n if (self.model.width + dx >= self.model.cropWidth) {\n self.model.x = dx;\n refresh = true;\n }\n if (self.model.height + dy >= self.model.cropHeight) {\n self.model.y = dy;\n refresh = true;\n }\n if (refresh) {\n render();\n }\n }\n ;\n });\n\n function dragStart(e) {\n $dragging = true;\n clientX = e.clientX;\n clientY = e.clientY;\n if (e.touches) {\n clientX = e.touches[0].clientX\n clientY = e.touches[0].clientY\n }\n x = clientX - self.model.x;\n y = clientY - self.model.y;\n }\n }", "title": "" }, { "docid": "6dad9ba18b7ab891d157c7586433cfe7", "score": "0.5923432", "text": "function hueStartDrag(ev) {\n ev.preventDefault();\n // Attach event listeners for 'mousemove' & 'mouseup'\n // Event listener is attached to body : movements are registered even the pointer exits the target\n customAddEventListener(document.body, 'move', hueMoveDrag);\n customAddEventListener(document.body, 'up', hueEndDrag);\n}", "title": "" }, { "docid": "d8689f383a9f670bb8dc992530d034b8", "score": "0.5923077", "text": "function start ( event, Dt, Op ) {\n\n\t\t\t// Mark the handle as 'active' so it can be styled.\n\t\t\tif( Dt.handles.length === 1 ) {\n\t\t\t\tDt.handles[0].data('grab').addClass(clsList[4]);\n\t\t\t}\n\n\t\t\t// A drag should never propagate up to the 'tap' event.\n\t\t\tevent.stopPropagation();\n\n\t\t\t// Attach the move event.\n\t\t\tattach ( actions.move, doc, move, {\n\t\t\t\t start: event\n\t\t\t\t,base: Dt.base\n\t\t\t\t,target: Dt.target\n\t\t\t\t,handles: Dt.handles\n\t\t\t\t,positions: [ Dt.handles[0].data('pct')\n\t\t\t\t\t ,Dt.handles[ Dt.handles.length - 1 ].data('pct') ]\n\t\t\t\t,point: Op['orientation'] ? 'pointY' : 'pointX'\n\t\t\t\t,size: Op['orientation'] ? Dt.base.height() : Dt.base.width()\n\t\t\t});\n\n\t\t\t// Unbind all movement when the drag ends.\n\t\t\tattach ( actions.end, doc, end, {\n\t\t\t\t target: Dt.target\n\t\t\t\t,handles: Dt.handles\n\t\t\t});\n\n\t\t\t// Text selection isn't an issue on touch devices,\n\t\t\t// so adding additional callbacks isn't required.\n\t\t\tif ( event.cursor ) {\n\n\t\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\t\tbody.css('cursor', $(event.target).css('cursor'));\n\n\t\t\t\t// Mark the target with a dragging state.\n\t\t\t\tif ( Dt.handles.length > 1 ) {\n\t\t\t\t\tDt.target.addClass(clsList[20]);\n\t\t\t\t}\n\n\t\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t\tbody.on('selectstart' + namespace, function( ){\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d1687889ea430488c4706c207d37e9ca", "score": "0.59224313", "text": "function drag(ev) {\n let mx = null;\n let my = null;\n let cnv = null;\n\n if ( ev.layerX || ev.layerX === 0) {\n mx= ev.layerX;\n my = ev.layerY;\n } else if (ev.offsetX || ev.offsetX === 0) {\n mx = ev.offsetX;\n my = ev.offsetY;\n }\n if (app.dragObj(mx, my)) {\n cnv = document.getElementById('drawingCanvas');\n cnv.style.cursor = \"pointer\";\n cnv.addEventListener('mousemove', move, false);\n cnv.addEventListener('mouseup', drop, false);\n }\n}", "title": "" }, { "docid": "6952f50f1c7fcd2ce161d09bd3431efb", "score": "0.59215796", "text": "function Draggable() {\n\t this.on('mousedown', this._dragStart, this);\n\t this.on('mousemove', this._drag, this);\n\t this.on('mouseup', this._dragEnd, this);\n\t this.on('globalout', this._dragEnd, this); // this._dropTarget = null;\n\t // this._draggingTarget = null;\n\t // this._x = 0;\n\t // this._y = 0;\n\t}", "title": "" }, { "docid": "aa787c07a4dceb08fab100401e62dbda", "score": "0.5921035", "text": "function dragstart_handler(ev) {\n // Add the target element's id to the data transfer object\n ev.dataTransfer.setData(\"text/plain\", ev.target.id);\n ev.dropEffect = \"move\";\n}", "title": "" }, { "docid": "cf2899095b59ac6a0438b6313023504f", "score": "0.5915217", "text": "function registerImageDragEvents() {\n var $dragging, x, y, clientX, clientY;\n if(self.options.imageHelper) {\n self.photoHelper.on(\"mousedown touchstart\", dragStart)\n .css('cursor','move');\n } else {\n self.photoFrame.on(\"mousedown touchstart\", dragStart);\n }\n \n /**\n * Stop dragging\n */\n $(window).on(\"mouseup touchend\", function (e) {\n if ($dragging) {\n /**\n * Call the onPositionChange callback\n */\n if (typeof self.options.onPositionChange === 'function') {\n self.options.onPositionChange(self.model);\n }\n /**\n * Call the onChange callback\n */\n if (typeof self.options.onChange === 'function') {\n self.options.onChange(self.model);\n }\n }\n $dragging = null;\n });\n /**\n * Drag the image inside the container\n */\n $(window).on(\"mousemove touchmove\", function (e) {\n\n if ($dragging) {\n e.preventDefault();\n var refresh = false;\n clientX = e.clientX;\n clientY = e.clientY;\n if (e.touches) {\n clientX = e.touches[0].clientX\n clientY = e.touches[0].clientY\n }\n\n var dy = (clientY) - y;\n var dx = (clientX) - x;\n dx = Math.min(dx, 0);\n dy = Math.min(dy, 0);\n /**\n * Limit the area to drag horizontally\n */\n if (self.model.width + dx >= self.model.cropWidth) {\n self.model.x = dx;\n refresh = true;\n }\n if (self.model.height + dy >= self.model.cropHeight) {\n self.model.y = dy;\n refresh = true;\n }\n if (refresh) {\n render();\n }\n };\n });\n\n function dragStart(e) {\n $dragging = true;\n clientX = e.clientX;\n clientY = e.clientY;\n if (e.touches) {\n clientX = e.touches[0].clientX\n clientY = e.touches[0].clientY\n }\n x = clientX - self.model.x;\n y = clientY - self.model.y;\n }\n }", "title": "" }, { "docid": "71ec19586cfa6d09d7fadeb0236166fb", "score": "0.591193", "text": "initDragAndDrop() {\n dragDrop('#' + this.id, function (files, pos, fileList, directories) {\n console.log('drop');\n this.droppedFiles = fileList;\n var ev = document.createEvent(\"MouseEvent\");\n ev.initMouseEvent(\n \"click\",\n true /* bubble */, true /* cancelable */,\n window, 0,\n 0, 0, pos.x, pos.y, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n var latlng = this.map.mouseEventToLatLng(ev);\n this.handleDrop(this.droppedFiles, latlng);\n\n }.bind(this))\n }", "title": "" }, { "docid": "a86efc79668d23f8ad641c10ebbbff8e", "score": "0.59116703", "text": "function msDrag(event) {\r\n \r\n //enable drag\r\n window.onmousemove = msMove;\r\n \r\n}", "title": "" }, { "docid": "4e1f9f43859f90e93df2cc7007759aff", "score": "0.5909389", "text": "function setup(data, namespaces, eventHandle) {\n\t\t// Stop the node from being dragged\n\t\t//add(this, 'dragstart.move drag.move', preventDefault);\n\t\t\n\t\t// Prevent text selection and touch interface scrolling\n\t\t//add(this, 'mousedown.move', preventIgnoreTags);\n\t\t\n\t\t// Tell movestart default handler that we've handled this\n\t\tadd(this, 'movestart.move', flagAsHandled);\n\n\t\t// Don't bind to the DOM. For speed.\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4e1f9f43859f90e93df2cc7007759aff", "score": "0.5909389", "text": "function setup(data, namespaces, eventHandle) {\n\t\t// Stop the node from being dragged\n\t\t//add(this, 'dragstart.move drag.move', preventDefault);\n\t\t\n\t\t// Prevent text selection and touch interface scrolling\n\t\t//add(this, 'mousedown.move', preventIgnoreTags);\n\t\t\n\t\t// Tell movestart default handler that we've handled this\n\t\tadd(this, 'movestart.move', flagAsHandled);\n\n\t\t// Don't bind to the DOM. For speed.\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4e1f9f43859f90e93df2cc7007759aff", "score": "0.5909389", "text": "function setup(data, namespaces, eventHandle) {\n\t\t// Stop the node from being dragged\n\t\t//add(this, 'dragstart.move drag.move', preventDefault);\n\t\t\n\t\t// Prevent text selection and touch interface scrolling\n\t\t//add(this, 'mousedown.move', preventIgnoreTags);\n\t\t\n\t\t// Tell movestart default handler that we've handled this\n\t\tadd(this, 'movestart.move', flagAsHandled);\n\n\t\t// Don't bind to the DOM. For speed.\n\t\treturn true;\n\t}", "title": "" }, { "docid": "4b81eb71405bf97ec62936596a3ddae3", "score": "0.59049124", "text": "onDragStart(event) {\n const that = this;\n\n if (event.which === 3) {\n return;\n }\n\n const options = this.options;\n\n this._view.$panel.addClass(this.options.classes.dragging);\n\n this._position = this._view.getPosition(true);\n\n this._drag.time = new Date().getTime();\n this._drag.pointer = this.pointer(event);\n\n const callback = () => {\n SlidePanel.enter('dragging');\n SlidePanel.trigger(that._view, 'beforeDrag');\n };\n\n if (options.mouseDrag) {\n if (options.mouseDragHandler) {\n if (!($$1(event.target).is(options.mouseDragHandler)) && !($$1(event.target).parents(options.mouseDragHandler).length > 0)) {\n return;\n }\n }\n\n $$1(document).on(SlidePanel.eventName('mouseup'), $$1.proxy(this.onDragEnd, this));\n\n $$1(document).one(SlidePanel.eventName('mousemove'), $$1.proxy(function () {\n $$1(document).on(SlidePanel.eventName('mousemove'), $$1.proxy(this.onDragMove, this));\n\n callback();\n }, this));\n }\n\n if (options.touchDrag && Support.touch) {\n $$1(document).on(SlidePanel.eventName('touchend'), $$1.proxy(this.onDragEnd, this));\n\n $$1(document).one(SlidePanel.eventName('touchmove'), $$1.proxy(function () {\n $$1(document).on(SlidePanel.eventName('touchmove'), $$1.proxy(this.onDragMove, this));\n\n callback();\n }, this));\n }\n\n if (options.pointerDrag && Support.pointer) {\n $$1(document).on(SlidePanel.eventName(Support.prefixPointerEvent('pointerup')), $$1.proxy(this.onDragEnd, this));\n\n $$1(document).one(SlidePanel.eventName(Support.prefixPointerEvent('pointermove')), $$1.proxy(function () {\n $$1(document).on(SlidePanel.eventName(Support.prefixPointerEvent('pointermove')), $$1.proxy(this.onDragMove, this));\n\n callback();\n }, this));\n }\n\n $$1(document).on(SlidePanel.eventName('blur'), $$1.proxy(this.onDragEnd, this));\n\n event.preventDefault();\n }", "title": "" }, { "docid": "6560efbf6a127791f22d97de55dd78c4", "score": "0.5897555", "text": "bindEvents() {}", "title": "" }, { "docid": "9183989c995fb6f62ce488eaa06fd4e3", "score": "0.5890978", "text": "attachHandlerEvents() {\n const eventBus = this.eventBus;\n eventBus.addEventListener('handlestart', this.onHandleMoveStart.bind(this));\n eventBus.addEventListener('handlemove', this.onHandleMoveMoving.bind(this));\n eventBus.addEventListener('handleend', this.onHandleMoveEnd.bind(this));\n }", "title": "" }, { "docid": "2e32b51ba535e62b4b214da8db7a5014", "score": "0.58883095", "text": "function drag(ev) {\r\n //ev.dataTransfer.setData(\"text\", ev.target.id);\r\n ev.dataTransfer.setData(\"control\",ev.target.id);\r\n //ev.dataTransfer.setData(\"isAccessable\",\"true\");\r\n console.log(\"In Drag\");\r\n}", "title": "" } ]
9e421d45ce35cb4407a5ee387422745b
Initializes a Query with a path and optional additional query constraints. Path must currently be empty if this is a collection group query.
[ { "docid": "c6ea7ff57b45b9f4e39366c77e1386c2", "score": "0.48604855", "text": "constructor(t, n = null, e = [], s = [], r = null, i = \"F\" /* First */ , o = null, u = null) {\n this.path = t, this.collectionGroup = n, this.Ct = e, this.filters = s, this.limit = r, \n this.limitType = i, this.startAt = o, this.endAt = u, this.Lt = null, \n // The corresponding `Target` of this `Query` instance.\n this.Ut = null, this.startAt, this.endAt;\n }", "title": "" } ]
[ { "docid": "3cadaa72f37ac925ed35eb294dd118a5", "score": "0.73614025", "text": "function Query(path, collectionGroup, explicitOrderBy, filters, limit, startAt, endAt) {\n if (collectionGroup === void 0) {\n collectionGroup = null;\n }\n\n if (explicitOrderBy === void 0) {\n explicitOrderBy = [];\n }\n\n if (filters === void 0) {\n filters = [];\n }\n\n if (limit === void 0) {\n limit = null;\n }\n\n if (startAt === void 0) {\n startAt = null;\n }\n\n if (endAt === void 0) {\n endAt = null;\n }\n\n this.path = path;\n this.collectionGroup = collectionGroup;\n this.explicitOrderBy = explicitOrderBy;\n this.filters = filters;\n this.limit = limit;\n this.startAt = startAt;\n this.endAt = endAt;\n this.memoizedCanonicalId = null;\n this.memoizedOrderBy = null;\n\n if (this.startAt) {\n this.assertValidBound(this.startAt);\n }\n\n if (this.endAt) {\n this.assertValidBound(this.endAt);\n }\n }", "title": "" }, { "docid": "8ed4d83b1b75b677db8f02de81aabb85", "score": "0.7348493", "text": "function Query(path, collectionGroup, explicitOrderBy, filters, limit, startAt, endAt) {\n if (collectionGroup === void 0) { collectionGroup = null; }\n if (explicitOrderBy === void 0) { explicitOrderBy = []; }\n if (filters === void 0) { filters = []; }\n if (limit === void 0) { limit = null; }\n if (startAt === void 0) { startAt = null; }\n if (endAt === void 0) { endAt = null; }\n this.path = path;\n this.collectionGroup = collectionGroup;\n this.explicitOrderBy = explicitOrderBy;\n this.filters = filters;\n this.limit = limit;\n this.startAt = startAt;\n this.endAt = endAt;\n this.memoizedCanonicalId = null;\n this.memoizedOrderBy = null;\n if (this.startAt) {\n this.assertValidBound(this.startAt);\n }\n if (this.endAt) {\n this.assertValidBound(this.endAt);\n }\n }", "title": "" }, { "docid": "8ed4d83b1b75b677db8f02de81aabb85", "score": "0.7348493", "text": "function Query(path, collectionGroup, explicitOrderBy, filters, limit, startAt, endAt) {\n if (collectionGroup === void 0) { collectionGroup = null; }\n if (explicitOrderBy === void 0) { explicitOrderBy = []; }\n if (filters === void 0) { filters = []; }\n if (limit === void 0) { limit = null; }\n if (startAt === void 0) { startAt = null; }\n if (endAt === void 0) { endAt = null; }\n this.path = path;\n this.collectionGroup = collectionGroup;\n this.explicitOrderBy = explicitOrderBy;\n this.filters = filters;\n this.limit = limit;\n this.startAt = startAt;\n this.endAt = endAt;\n this.memoizedCanonicalId = null;\n this.memoizedOrderBy = null;\n if (this.startAt) {\n this.assertValidBound(this.startAt);\n }\n if (this.endAt) {\n this.assertValidBound(this.endAt);\n }\n }", "title": "" }, { "docid": "9dd2688c47e88d9ce3dcd3032ccc8a76", "score": "0.72912234", "text": "function Query(path, collectionGroup, explicitOrderBy, filters, limit, startAt, endAt) {\r\n if (collectionGroup === void 0) { collectionGroup = null; }\r\n if (explicitOrderBy === void 0) { explicitOrderBy = []; }\r\n if (filters === void 0) { filters = []; }\r\n if (limit === void 0) { limit = null; }\r\n if (startAt === void 0) { startAt = null; }\r\n if (endAt === void 0) { endAt = null; }\r\n this.path = path;\r\n this.collectionGroup = collectionGroup;\r\n this.explicitOrderBy = explicitOrderBy;\r\n this.filters = filters;\r\n this.limit = limit;\r\n this.startAt = startAt;\r\n this.endAt = endAt;\r\n this.memoizedCanonicalId = null;\r\n this.memoizedOrderBy = null;\r\n if (this.startAt) {\r\n this.assertValidBound(this.startAt);\r\n }\r\n if (this.endAt) {\r\n this.assertValidBound(this.endAt);\r\n }\r\n }", "title": "" }, { "docid": "04211d0f601fcc1a049becbd46a574ad", "score": "0.63721025", "text": "function PathQuery(input, subject, path, object) {\n this.input = input;\n this.source = input.source;\n if(typeof subject === 'string' && subject.indexOf(\"?\") == 0) {\n this.subjectAttr = var2Attr(subject);\n }\n else {\n this.subject = subject;\n }\n if(path == null) {\n throw \"Path cannot be unbound\";\n }\n if(typeof path === 'string') {\n this.path_ = T(path);\n }\n else {\n this.path_ = path;\n }\n if(typeof object === 'string' && object.indexOf(\"?\") == 0) {\n this.objectAttr = var2Attr(object);\n }\n else {\n this.object = object;\n }\n}", "title": "" }, { "docid": "04211d0f601fcc1a049becbd46a574ad", "score": "0.63721025", "text": "function PathQuery(input, subject, path, object) {\n this.input = input;\n this.source = input.source;\n if(typeof subject === 'string' && subject.indexOf(\"?\") == 0) {\n this.subjectAttr = var2Attr(subject);\n }\n else {\n this.subject = subject;\n }\n if(path == null) {\n throw \"Path cannot be unbound\";\n }\n if(typeof path === 'string') {\n this.path_ = T(path);\n }\n else {\n this.path_ = path;\n }\n if(typeof object === 'string' && object.indexOf(\"?\") == 0) {\n this.objectAttr = var2Attr(object);\n }\n else {\n this.object = object;\n }\n}", "title": "" }, { "docid": "2219891d2edfaf429bb976f0f1025ed4", "score": "0.6295947", "text": "function newQuery(){\n\t\t\treturn {\n\t\t\t\tclasses: [], \n\t\t\t\tcolonSelectors: [],\n\t\t\t\tdata: [],\n\t\t\t\tgroup: null,\n\t\t\t\tids: [],\n\t\t\t\tmeta: [],\n\n\t\t\t\t// fake selectors\n\t\t\t\tcollection: null, // a collection to match against\n\t\t\t\tfilter: null, // filter function\n\n\t\t\t\t// these are defined in the upward direction rather than down (e.g. child)\n\t\t\t\t// because we need to go up in Selector.filter()\n\t\t\t\tparent: null, // parent query obj\n\t\t\t\tancestor: null, // ancestor query obj\n\t\t\t\tsubject: null, // defines subject in compound query (subject query obj; points to self if subject)\n\n\t\t\t\t// use these only when subject has been defined\n\t\t\t\tchild: null,\n\t\t\t\tdescendant: null\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "45a93806da0e13aab6b561dd31c5a300", "score": "0.61219156", "text": "function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n // .../items(19)\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }", "title": "" }, { "docid": "83651f3ee2867248317e974a94bfab85", "score": "0.611929", "text": "function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n } else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n } else {\n // .../items(19)\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n } else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }", "title": "" }, { "docid": "3dd08610360b41e43f1b1dd704a7beaa", "score": "0.60074574", "text": "fromQuery(inputQuery) {\n this._query = inputQuery;\n return this;\n }", "title": "" }, { "docid": "f7a25c2c38c5ead6a3aa73130320bb6e", "score": "0.59292877", "text": "function Query(){\n this.query = {};\n this.isChainable = false;\n}", "title": "" }, { "docid": "2f458a6be57c2ebebd1c70b95dc41805", "score": "0.5888108", "text": "function Query(collection, conditions) {\n _initializerDefineProperty(this, \"_cachedSubscribable\", _descriptor, this);\n\n _initializerDefineProperty(this, \"_cachedCountSubscribable\", _descriptor2, this);\n\n _initializerDefineProperty(this, \"_cachedCountThrottledSubscribable\", _descriptor3, this);\n\n this.collection = collection;\n this._rawDescription = (0, _QueryDescription.buildQueryDescription)(conditions);\n this.description = (0, _QueryDescription.queryWithoutDeleted)(this._rawDescription);\n } // Creates a new Query that extends the conditions of this query", "title": "" }, { "docid": "8dce294e96a005f836d8433b916f8594", "score": "0.5881545", "text": "function Query(query) {\n this.query = query;\n}", "title": "" }, { "docid": "12ab09022e56246cac0a6ccf921fa549", "score": "0.58799374", "text": "constructor(query) {\n // query is attached to created object that is input.\n this.query = query;\n }", "title": "" }, { "docid": "dc2f3e850f7850b2034e3f4866131e0f", "score": "0.5845294", "text": "function QueryBuilder() {\n // Creates the query array and internal pointer.\n this.reset();\n }", "title": "" }, { "docid": "56c9d756f4c47195ed2fc424136439ec", "score": "0.56554294", "text": "function TreeQuery() {\n _classCallCheck(this, TreeQuery);\n\n _defineProperty(this, \"Paths\", undefined);\n\n _defineProperty(this, \"PathPrefix\", undefined);\n\n _defineProperty(this, \"MinSize\", undefined);\n\n _defineProperty(this, \"MaxSize\", undefined);\n\n _defineProperty(this, \"MinDate\", undefined);\n\n _defineProperty(this, \"MaxDate\", undefined);\n\n _defineProperty(this, \"DurationDate\", undefined);\n\n _defineProperty(this, \"Type\", undefined);\n\n _defineProperty(this, \"FileName\", undefined);\n\n _defineProperty(this, \"Content\", undefined);\n\n _defineProperty(this, \"FileNameOrContent\", undefined);\n\n _defineProperty(this, \"FreeString\", undefined);\n\n _defineProperty(this, \"Extension\", undefined);\n\n _defineProperty(this, \"GeoQuery\", undefined);\n\n _defineProperty(this, \"PathDepth\", undefined);\n\n _defineProperty(this, \"UUIDs\", undefined);\n\n _defineProperty(this, \"Not\", undefined);\n }", "title": "" }, { "docid": "0a1f28f0b80ae013b15acb703db3a360", "score": "0.5577868", "text": "constructor(query) {\n this.query = query;\n }", "title": "" }, { "docid": "ea109d6412f4faf2a8616943b79358b6", "score": "0.5490443", "text": "constructor(query) {\r\n this.query = query;\r\n }", "title": "" }, { "docid": "de5052b687a83339d394856212da7d50", "score": "0.5466706", "text": "function QueryBuilder() {\n this._find = null;\n this._with = null;\n this._in = null;\n this._where = null;\n this._keys = null;\n this._syms = null;\n this._strs = null;\n}", "title": "" }, { "docid": "ae2241b720f5811805d50c0346f8911e", "score": "0.54474723", "text": "static query(query) {\n if (arguments.length) {\n this._query[this.name] = query || {};\n }\n return this._query[this.name] ? this._query[this.name] : {};\n }", "title": "" }, { "docid": "269fa7abaa22b811cd5da91a9264fe5d", "score": "0.5446561", "text": "function SimpleQueryCalc(rootQueryCalc, pathId)\r\n{\r\n // call base constructor\r\n\tthis.InternalQueryCalc(rootQueryCalc);\r\n\r\n // initialize derived class fields (selection-projection related fields are\r\n // constructed only when needed).\r\n\r\n this.matches = undefined; // if needed, will be constructed later\r\n\r\n this.pathId = pathId;\r\n // increase the path ID allocation count so that this node now\r\n // owns this path ID (this way it can be properly released)\r\n this.indexer.qcm.allocatePathIdByPathId(pathId);\r\n\r\n // create value tables\r\n this.uniqueValueIds = new Map();\r\n this.values = new Map();\r\n this.disjoint = new Map();\r\n this.changedValues = {};\r\n\r\n // match update queues\r\n this.addedMatches = [];\r\n this.removedMatches = [];\r\n}", "title": "" }, { "docid": "89eeb102bdd0f7ba073cdd11282fdeea", "score": "0.5435679", "text": "constructor() {\n this.declareQueryFields();\n }", "title": "" }, { "docid": "96e3b54aa49b0843a68a4e6fbdb2bc78", "score": "0.54145324", "text": "function Query(query) {\n this.query = (Array.isArray(query)) ? query.join(' ') : query;\n this.$values = [];\n this.$keys = [];\n this.__keyUid = 1;\n\n // provide empty defaults for all tokens\n var re = /\\{([\\w]*)\\}/g, match;\n while (match = re.exec(this.query)) {\n this[match[1]] = '';\n }\n}", "title": "" }, { "docid": "4f98e66f01e61ab6ac0c10aa66bd2e9d", "score": "0.53537774", "text": "constructor(query) {\n this.query = query;\n\n }", "title": "" }, { "docid": "8e9e3bd089ef0a6696b4a0d370d549e3", "score": "0.5278972", "text": "function GQueryCtor(selector, elements) {\n this.selector = selector;\n this.elements = elements;\n }", "title": "" }, { "docid": "a856b1698be8461a0b48d4b5bb4fb738", "score": "0.5278605", "text": "constructor(query, queryString) {\n this.query = query;\n this.queryString = queryString;\n }", "title": "" }, { "docid": "a856b1698be8461a0b48d4b5bb4fb738", "score": "0.5278605", "text": "constructor(query, queryString) {\n this.query = query;\n this.queryString = queryString;\n }", "title": "" }, { "docid": "0cfe1286e8a49a5e134496865b2b7fe2", "score": "0.52403474", "text": "constructor() {\n\t\tthis.query = [];\n\t}", "title": "" }, { "docid": "8c767bdbe37a1dd9bc470b1ad0914774", "score": "0.5234618", "text": "constructor(t, n = null, e = [], r = [], s = null, i = \"F\" /* First */ , o = null, u = null) {\n this.path = t, this.collectionGroup = n, this.explicitOrderBy = e, this.filters = r, \n this.limit = s, this.limitType = i, this.startAt = o, this.endAt = u, this.D = null, \n // The corresponding `Target` of this `Query` instance.\n this.$ = null, this.startAt, this.endAt;\n }", "title": "" }, { "docid": "85d82edbf65781dbdaf45287f46dd08d", "score": "0.52338016", "text": "function Query() {\n this.table = {};\n}", "title": "" }, { "docid": "85d82edbf65781dbdaf45287f46dd08d", "score": "0.52338016", "text": "function Query() {\n this.table = {};\n}", "title": "" }, { "docid": "fcee1391af12afebccde32ac1b44dfa8", "score": "0.51838064", "text": "function query(query) {\n var e_1, _a;\n var queryConstraints = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n queryConstraints[_i - 1] = arguments[_i];\n }\n var queryImpl = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"getModularInstance\"])(query);\n try {\n for (var queryConstraints_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__values\"])(queryConstraints), queryConstraints_1_1 = queryConstraints_1.next(); !queryConstraints_1_1.done; queryConstraints_1_1 = queryConstraints_1.next()) {\n var constraint = queryConstraints_1_1.value;\n queryImpl = constraint._apply(queryImpl);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (queryConstraints_1_1 && !queryConstraints_1_1.done && (_a = queryConstraints_1.return)) _a.call(queryConstraints_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return queryImpl;\n}", "title": "" }, { "docid": "fa91d7f9ae811fa7a35c574d7168f57d", "score": "0.5179167", "text": "constructor(query, queryString) {\n this.query = query;\n this.queryString = queryString;\n }", "title": "" }, { "docid": "c933a8b3a6af4f8ea9248f99ead2f3d2", "score": "0.51788586", "text": "function QueryManager() {\n _classCallCheck(this, QueryManager);\n\n this.pendingQueries = new Set();\n this.invalidQueryType = null;\n this.invalidErrorMessage = '';\n this.checkInvalid = function () {\n return false;\n };\n }", "title": "" }, { "docid": "01c93a9bcbfa9c514fd57196e204b685", "score": "0.51676697", "text": "defineQuery(params) {\n this.query = params;\n }", "title": "" }, { "docid": "ea204e17f83a88f8ee41bcbafd271d88", "score": "0.5150973", "text": "function query(query, ...queryConstraints) {\r\n let queryImpl = getModularInstance(query);\r\n for (const constraint of queryConstraints) {\r\n queryImpl = constraint._apply(queryImpl);\r\n }\r\n return queryImpl;\r\n}", "title": "" }, { "docid": "273e9f2cc751746f59f2ff2da74ba6ea", "score": "0.512426", "text": "function TQuery(){}", "title": "" }, { "docid": "f9396ed32936ecd0714f302289a73266", "score": "0.5088893", "text": "function _SharePointQueryable(baseUrl, path) {\r\n var _this = this;\r\n var url = \"\";\r\n var parentUrl = \"\";\r\n var query = new Map();\r\n if (typeof baseUrl === \"string\") {\r\n // we need to do some extra parsing to get the parent url correct if we are\r\n // being created from just a string.\r\n if (isUrlAbsolute(baseUrl) || baseUrl.lastIndexOf(\"/\") < 0) {\r\n parentUrl = baseUrl;\r\n url = combine(baseUrl, path);\r\n }\r\n else if (baseUrl.lastIndexOf(\"/\") > baseUrl.lastIndexOf(\"(\")) {\r\n // .../items(19)/fields\r\n var index = baseUrl.lastIndexOf(\"/\");\r\n parentUrl = baseUrl.slice(0, index);\r\n path = combine(baseUrl.slice(index), path);\r\n url = combine(parentUrl, path);\r\n }\r\n else {\r\n // .../items(19)\r\n var index = baseUrl.lastIndexOf(\"(\");\r\n parentUrl = baseUrl.slice(0, index);\r\n url = combine(baseUrl, path);\r\n }\r\n }\r\n else {\r\n parentUrl = baseUrl.toUrl();\r\n url = combine(parentUrl, path || \"\");\r\n var target = baseUrl.query.get(\"@target\");\r\n if (target !== undefined) {\r\n query.set(\"@target\", target);\r\n }\r\n }\r\n // init base with correct values for data seed\r\n _this = _super.call(this, {\r\n parentUrl: parentUrl,\r\n query: query,\r\n url: url,\r\n }) || this;\r\n // post init actions\r\n if (typeof baseUrl !== \"string\") {\r\n _this.configureFrom(baseUrl);\r\n }\r\n _this._forceCaching = false;\r\n return _this;\r\n }", "title": "" }, { "docid": "a14623a881c86b82a92f421452a7cd9b", "score": "0.5085377", "text": "constructor(query, queryStr) {\n this.query = query;\n this.queryStr = queryStr;\n }", "title": "" }, { "docid": "c6cbb3e176624feb0d9af8ba37cde61e", "score": "0.5082116", "text": "where(q) {\n return new LazyQuery(this.collectionName, { $and: [ this.query, q ] });\n }", "title": "" }, { "docid": "611d2b97a89d53ede17dcef104f34ca3", "score": "0.50369", "text": "function _SharePointQueryable(baseUrl, path) {\n var _this = this;\n var url = \"\";\n var parentUrl = \"\";\n var query = new Map();\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n if (Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"isUrlAbsolute\"])(baseUrl) || baseUrl.lastIndexOf(\"/\") < 0) {\n parentUrl = baseUrl;\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\n }\n else if (baseUrl.lastIndexOf(\"/\") > baseUrl.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = baseUrl.lastIndexOf(\"/\");\n parentUrl = baseUrl.slice(0, index);\n path = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl.slice(index), path);\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path);\n }\n else {\n // .../items(19)\n var index = baseUrl.lastIndexOf(\"(\");\n parentUrl = baseUrl.slice(0, index);\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\n }\n }\n else {\n parentUrl = baseUrl.toUrl();\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path || \"\");\n var target = baseUrl.query.get(\"@target\");\n if (target !== undefined) {\n query.set(\"@target\", target);\n }\n }\n // init base with correct values for data seed\n _this = _super.call(this, {\n parentUrl: parentUrl,\n query: query,\n url: url,\n }) || this;\n // post init actions\n if (typeof baseUrl !== \"string\") {\n _this.configureFrom(baseUrl);\n }\n _this._forceCaching = false;\n return _this;\n }", "title": "" }, { "docid": "611d2b97a89d53ede17dcef104f34ca3", "score": "0.50369", "text": "function _SharePointQueryable(baseUrl, path) {\n var _this = this;\n var url = \"\";\n var parentUrl = \"\";\n var query = new Map();\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n if (Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"isUrlAbsolute\"])(baseUrl) || baseUrl.lastIndexOf(\"/\") < 0) {\n parentUrl = baseUrl;\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\n }\n else if (baseUrl.lastIndexOf(\"/\") > baseUrl.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = baseUrl.lastIndexOf(\"/\");\n parentUrl = baseUrl.slice(0, index);\n path = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl.slice(index), path);\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path);\n }\n else {\n // .../items(19)\n var index = baseUrl.lastIndexOf(\"(\");\n parentUrl = baseUrl.slice(0, index);\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\n }\n }\n else {\n parentUrl = baseUrl.toUrl();\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path || \"\");\n var target = baseUrl.query.get(\"@target\");\n if (target !== undefined) {\n query.set(\"@target\", target);\n }\n }\n // init base with correct values for data seed\n _this = _super.call(this, {\n parentUrl: parentUrl,\n query: query,\n url: url,\n }) || this;\n // post init actions\n if (typeof baseUrl !== \"string\") {\n _this.configureFrom(baseUrl);\n }\n _this._forceCaching = false;\n return _this;\n }", "title": "" }, { "docid": "b582166e537c6df1ac18e5e1e1776768", "score": "0.50345683", "text": "constructor(t, e = null, s = [], n = [], i = null, r = \"F\" /* First */ , o = null, h = null) {\n this.path = t, this.collectionGroup = e, this.pe = s, this.filters = n, this.limit = i, \n this.ge = r, this.startAt = o, this.endAt = h, this.Ve = null, \n // The corresponding `Target` of this `Query` instance.\n this.ye = null, this.startAt && this.be(this.startAt), this.endAt && this.be(this.endAt);\n }", "title": "" }, { "docid": "95734cac273ed81a406eb274195e9193", "score": "0.50332046", "text": "function QueryManager() {\n\n\n if (!(this instanceof QueryManager)) { return new QueryManager(); }\n var self = this;\n\n var index = lunr( function () {\n\n this.field('title', 10);\n this.field('summary', 50);\n this.field('tags', 100);\n this.field('body');\n\n this.ref('id');\n\n });\n\n documents.forEach( function( doc ) { index.add( doc ); });\n\n self.query = function( searchterms ) {\n\n return partition( 'type', resolveDocuments( index.search( searchterms ) ), reverseChronological );\n\n };\n\n }", "title": "" }, { "docid": "95734cac273ed81a406eb274195e9193", "score": "0.50332046", "text": "function QueryManager() {\n\n\n if (!(this instanceof QueryManager)) { return new QueryManager(); }\n var self = this;\n\n var index = lunr( function () {\n\n this.field('title', 10);\n this.field('summary', 50);\n this.field('tags', 100);\n this.field('body');\n\n this.ref('id');\n\n });\n\n documents.forEach( function( doc ) { index.add( doc ); });\n\n self.query = function( searchterms ) {\n\n return partition( 'type', resolveDocuments( index.search( searchterms ) ), reverseChronological );\n\n };\n\n }", "title": "" }, { "docid": "b0cb794b70083ad650336d233dcf5e66", "score": "0.5018756", "text": "function _SharePointQueryable(baseUrl, path) {\r\n var _this = this;\r\n var url = \"\";\r\n var parentUrl = \"\";\r\n var query = new Map();\r\n if (typeof baseUrl === \"string\") {\r\n // we need to do some extra parsing to get the parent url correct if we are\r\n // being created from just a string.\r\n if (Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"isUrlAbsolute\"])(baseUrl) || baseUrl.lastIndexOf(\"/\") < 0) {\r\n parentUrl = baseUrl;\r\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\r\n }\r\n else if (baseUrl.lastIndexOf(\"/\") > baseUrl.lastIndexOf(\"(\")) {\r\n // .../items(19)/fields\r\n var index = baseUrl.lastIndexOf(\"/\");\r\n parentUrl = baseUrl.slice(0, index);\r\n path = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl.slice(index), path);\r\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path);\r\n }\r\n else {\r\n // .../items(19)\r\n var index = baseUrl.lastIndexOf(\"(\");\r\n parentUrl = baseUrl.slice(0, index);\r\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(baseUrl, path);\r\n }\r\n }\r\n else {\r\n parentUrl = baseUrl.toUrl();\r\n url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_1__[\"combine\"])(parentUrl, path || \"\");\r\n var target = baseUrl.query.get(\"@target\");\r\n if (target !== undefined) {\r\n query.set(\"@target\", target);\r\n }\r\n }\r\n // init base with correct values for data seed\r\n _this = _super.call(this, {\r\n parentUrl: parentUrl,\r\n query: query,\r\n url: url,\r\n }) || this;\r\n // post init actions\r\n if (typeof baseUrl !== \"string\") {\r\n _this.configureFrom(baseUrl);\r\n }\r\n _this._forceCaching = false;\r\n return _this;\r\n }", "title": "" }, { "docid": "d1862fa2326aaa4270820db07fa52242", "score": "0.5018293", "text": "andExt(query) {\n\t\tthis.query = {\n\t\t\t$and: query\n\t\t};\n\t}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.5014596", "text": "function LQuery(){}", "title": "" }, { "docid": "25d177953fddab5904e07a30f387c947", "score": "0.4999815", "text": "constructor(t, e = null, n = [], s = [], i = null, r = \"F\" /* First */ , o = null, c = null) {\n this.path = t, this.collectionGroup = e, this.te = n, this.filters = s, this.limit = i, \n this.limitType = r, this.startAt = o, this.endAt = c, this.ee = null, \n // The corresponding `Target` of this `Query` instance.\n this.ne = null, this.startAt, this.endAt;\n }", "title": "" }, { "docid": "2f0f787bd346592c848eaf0093b2fff0", "score": "0.49872747", "text": "getRestQuery(req, omitPermissionCheck = false) {\n const query = self.find(req)\n .ancestors(true)\n .children(true)\n .attachments(true)\n .applyBuildersSafely(req.query);\n // Minimum standard for a REST query without a public projection\n // is being allowed to view drafts on the site\n if (!omitPermissionCheck && !self.canAccessApi(req)) {\n if (!self.options.publicApiProjection) {\n // Shouldn't be needed thanks to publicApiCheck, but be sure\n query.and({\n _id: null\n });\n } else {\n query.project({\n ...self.options.publicApiProjection,\n cacheInvalidatedAt: 1\n });\n }\n }\n return query;\n }", "title": "" }, { "docid": "8677900b76bd0d6584564c6c3d8d8244", "score": "0.4946075", "text": "_clone() {\n const cloned = new RxQuery(this.op, _getDefaultQuery(this.collection), this.collection);\n cloned.mquery = this.mquery.clone();\n return cloned;\n }", "title": "" }, { "docid": "c795f6ad2c5c12529062001574e8391e", "score": "0.49394754", "text": "function QueryJoin (path, options) {\n\t\tJoinType.call(this, path, options);\n\t\tthis._follower = null;\n\t}", "title": "" }, { "docid": "82d83b58cecb99e95d1a603c4d711ee2", "score": "0.4922371", "text": "function QueryCollection() {\r\n }", "title": "" }, { "docid": "abad0cba186aa49d135c357011fb2f6b", "score": "0.49147823", "text": "function CloudDBQuery() {\n this.conditions = [];\n this.addCondition = function(conditionType, fieldName, value) {\n let conditionObject = {};\n conditionObject.conditionType = conditionType;\n conditionObject.fieldName = fieldName;\n conditionObject.value = value;\n this.conditions.push(conditionObject);\n return this;\n };\n}", "title": "" }, { "docid": "d6d7cf13e3b45ec0a538befd73f5aad4", "score": "0.4886495", "text": "getPathWithQuery () {\n let query = this.query ? this.query : ''\n return this.getPath() + query\n }", "title": "" }, { "docid": "d0d2e5cdead8c4bbc3dc002866884a36", "score": "0.48859933", "text": "build() {\n return this._query;\n }", "title": "" }, { "docid": "4134d969580cc3141a5b99c9e07e8299", "score": "0.48855713", "text": "and() {\n\t\tthis.query = {\n\t\t\t$and: this.query\n\t\t};\n\t}", "title": "" }, { "docid": "fed5471c910c4feda46d779485793309", "score": "0.48786458", "text": "setQuery(query) {\n if (!query) {\n this._query = void 0;\n } else {\n this._query = URLQuery.parse(query);\n }\n }", "title": "" }, { "docid": "2e12d857433368e20212f99d051c8d06", "score": "0.48773336", "text": "function Query(req, variable) {\n this.query = req,\n this.executeQuery = () => {\n logQuery(this.query, variable);\n }\n}", "title": "" }, { "docid": "477d0afabf716dbecd60475df3b5e2cb", "score": "0.48596376", "text": "function TQueries(){}", "title": "" }, { "docid": "b55606f3db43477eea58dc3793c9e8d2", "score": "0.48537368", "text": "function Query(aConstraints) {\n if (!aConstraints)\n return;\n\n if (typeof aConstraints == 'number') {\n this.entries = [aConstraints];\n }\n else if (aConstraints.splice) {\n this.entries = aConstraints;\n }\n else {\n for (let constraint in aConstraints)\n this[constraint] = aConstraints[constraint];\n }\n}", "title": "" }, { "docid": "ff1c6cd8c3c0edbd037a6f9411ab7cd2", "score": "0.4838386", "text": "function syncTreeQueryForListening_(query) {\n if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) {\n // We treat queries that load all data as default queries\n // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits\n // from Query\n return new (syncTreeGetReferenceConstructor())(query._repo, query._path);\n }\n else {\n return query;\n }\n}", "title": "" }, { "docid": "33ec18f4f8dce90192dffcf04957354a", "score": "0.4835237", "text": "function TableQuery() {\r\n this._fields = [];\r\n this._where = [];\r\n this._top = null;\r\n}", "title": "" }, { "docid": "b2205edbd310f486ca4917482b3c0cd1", "score": "0.48076984", "text": "function FieldPath$1() {\n var fieldNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fieldNames[_i] = arguments[_i];\n }\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\n for (var i = 0; i < fieldNames.length; ++i) {\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\n if (fieldNames[i].length === 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" +\n 'Field names must not be empty.');\n }\n }\n this._internalPath = new FieldPath(fieldNames);\n }", "title": "" }, { "docid": "b2205edbd310f486ca4917482b3c0cd1", "score": "0.48076984", "text": "function FieldPath$1() {\n var fieldNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fieldNames[_i] = arguments[_i];\n }\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\n for (var i = 0; i < fieldNames.length; ++i) {\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\n if (fieldNames[i].length === 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" +\n 'Field names must not be empty.');\n }\n }\n this._internalPath = new FieldPath(fieldNames);\n }", "title": "" }, { "docid": "fda6011efe57a5e3385a9189aa9bfd85", "score": "0.48050752", "text": "function Query() { \n \tthis.states = [];\n \tthis.metrics = [];\n }", "title": "" }, { "docid": "0267aadf23f72db88817e8db374d1308", "score": "0.48041135", "text": "function FieldPath$1() {\r\n var fieldNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n fieldNames[_i] = arguments[_i];\r\n }\r\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\r\n for (var i = 0; i < fieldNames.length; ++i) {\r\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\r\n if (fieldNames[i].length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" +\r\n 'Field names must not be empty.');\r\n }\r\n }\r\n this._internalPath = new FieldPath(fieldNames);\r\n }", "title": "" }, { "docid": "63d2ccaae691978f593a34e54a54f257", "score": "0.47999877", "text": "function initializeQueries() {\n /**\n * Create the Conversation List Query\n */\n conversationQuery = layerSampleApp.client.createQuery({\n model: layer.Query.Conversation\n });\n\n /**\n * Any time a Conversation is created, deleted, or its participants changed,\n * rerender the conversation list\n */\n conversationQuery.on('change', function() {\n conversationListView.render(conversationQuery.data);\n });\n\n // Tutorial Step 3: Setup the Message Query here\n\n }", "title": "" }, { "docid": "a1b5a1147261a66f76143b2bc4d3bfd2", "score": "0.47998032", "text": "addFilterToQuery(filter) {\n const query = {};\n if (!Array.isArray(filter.value)) {\n if (typeof filter.value === 'string' && filter.value) {\n filter.value = [filter.value];\n }\n else {\n filter.value = [];\n }\n }\n if (filter.value.length) {\n query[this.path] = (filter.inverted) ? { $nin: filter.value } : { $in: filter.value };\n }\n else {\n if (this.many) {\n query[this.path] = (filter.inverted) ? { $not: { $size: 0 } } : { $size: 0 };\n }\n else {\n query[this.path] = (filter.inverted) ? { $ne: null } : null;\n }\n }\n return query;\n }", "title": "" }, { "docid": "f74b4b92e08043504d1a16e778fb8943", "score": "0.4790244", "text": "function buildQuery(req, query){\n if(Object.keys(req.query).length === 0)\n return query.find();\n //otherwise it runs it as an OR statement\n let seriesObj = {};\n for(let key in req.query){\n let obj = {};\n if(_.indexOf(dateKeys, key) > -1){\n if(key == 'startDate')\n obj[key] = {$gt: req.query[key]};\n if(key == 'endDate')\n obj[key] = {$lt: req.query[key]};\n query = query.find(obj); \n } else{\n seriesObj[key] = req.query[key];\n }\n }\n if(Object.keys(seriesObj).length > 0)\n query = query.find(seriesObj);\n return query;\n}", "title": "" }, { "docid": "dcecfa3b8ebd95f8c0681415b9da7824", "score": "0.47891584", "text": "constructor(collection, optree, projection) {\n super(collection);\n this.optree = optree;\n this.projection = projection;\n }", "title": "" }, { "docid": "ea259363cc47792b40d07c2033b3a116", "score": "0.47804025", "text": "function syncTreeQueryForListening_(query) {\r\n if (query._queryParams.loadsAllData() && !query._queryParams.isDefault()) {\r\n // We treat queries that load all data as default queries\r\n // Cast is necessary because ref() technically returns Firebase which is actually fb.api.Firebase which inherits\r\n // from Query\r\n return new (syncTreeGetReferenceConstructor())(query._repo, query._path);\r\n }\r\n else {\r\n return query;\r\n }\r\n}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.476474", "text": "function TQuery() {}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.476474", "text": "function TQuery() {}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.476474", "text": "function TQuery() {}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.476474", "text": "function TQuery() {}", "title": "" }, { "docid": "c18df63e3dd196d45ad5908bbe96d0e9", "score": "0.47603324", "text": "function DbQuery () {\n this.parameter = {};\n this.parameter.TableName = undefined;\n this.parameter.IndexName = \"\";\n this.parameter.KeyConditionExpression = \"\";\n // this.parameter.FilterExpression = \"\"; ADD THIS ONLY WITH FILTER METHOD\n this.parameter.ExpressionAttributeValues = {};\n this.fieldcounter = 0;\n this.lastMethodCalled = undefined; // This is set to either where,\n // selectItemsWherePrimaryKey, theSortKey.\n // The is() method will append value to key condition expression or filter expression\n // depending on which method was called last called.\n // this.primarykey = \"\";\n // this.sortkey = \"\";\n this.lastAttribute = \"\"; // this is last attribute\n this.lastMatchPattern = \"\"; // this is parameter passed in the matchPattern method.\n this.lastPredicate = \"\"; // This is either \"is\" or \"matchPattern\"\n}", "title": "" }, { "docid": "be2fe24cf8cf1257f82847de461f547c", "score": "0.47588277", "text": "function Search(baseUrl, path) {\n if (path === void 0) {\n path = \"_api/search/postquery\";\n }\n return _super.call(this, baseUrl, path) || this;\n }", "title": "" }, { "docid": "c401d0f5087e52e59a6bf30d2906841c", "score": "0.47586852", "text": "getRestQuery(req, omitPermissionCheck = false) {\n const query = self.find(req).attachments(true);\n query.applyBuildersSafely(req.query);\n if (!omitPermissionCheck && !self.canAccessApi(req)) {\n if (!self.options.publicApiProjection) {\n // Shouldn't be needed thanks to publicApiCheck, but be sure\n query.and({\n _id: null\n });\n } else if (!query.state.project) {\n query.project({\n ...self.options.publicApiProjection,\n cacheInvalidatedAt: 1\n });\n }\n }\n return query;\n }", "title": "" }, { "docid": "f1ba5061d724e50c9784d7c6d2d84e57", "score": "0.47558776", "text": "function Query(storage) {\n this.storage = storage\n}", "title": "" }, { "docid": "76e8883d0fc3e55679ec0d6153007578", "score": "0.4738892", "text": "function Path() {\n _super.call(this);\n /**\n * Path current sub path to add segments to. Initially, the current sub-path is the path itself.\n * As new sub-paths are created, _currentSubPath will point to that last sub-path.\n * @member cc.math.Path#_currentSubPath\n * @type {null}\n * @private\n */\n this._currentSubPath = null;\n }", "title": "" }, { "docid": "d3fc17453f3fb6a7902cdd828346ef39", "score": "0.47284633", "text": "function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "title": "" }, { "docid": "f79d398c79523145bc73c1832daacb77", "score": "0.47253525", "text": "function setSelectForQuery(query, querySelect) {\n // select section in the query/aggregation is compulsory. If that is not found there is a error in backend.\n if (!querySelect) {\n var errMsg = 'Cannot find select section for element:' + query;\n log.error(errMsg);\n DesignViewUtils.prototype.errorAlert(errMsg);\n throw errMsg;\n }\n\n var querySelectObject = new QuerySelect(querySelect);\n query.setSelect(querySelectObject);\n }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.47204697", "text": "function TQuery() { }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.47204697", "text": "function TQuery() { }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.47204697", "text": "function TQuery() { }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.47204697", "text": "function TQuery() { }", "title": "" }, { "docid": "8de5fceda2adeabcbd828ef0c0e2a781", "score": "0.47106898", "text": "function GraphqlQueryBuilder(queryFnName, aliasOrFilter) {\r\n this.queryFnName = queryFnName;\r\n this.head = [];\r\n if (typeof aliasOrFilter === 'function') {\r\n this.alias = aliasOrFilter;\r\n }\r\n else if (typeof aliasOrFilter === 'object') {\r\n this.filter(aliasOrFilter);\r\n }\r\n else if (undefined === aliasOrFilter && 2 === arguments.length) {\r\n throw new TypeError(\"You have passed undefined as Second argument to \\\"Query\\\"\");\r\n }\r\n else if (undefined !== aliasOrFilter) {\r\n throw new TypeError(\"Second argument to \\\"Query\\\" should be an alias name(String) or filter arguments(Object). was passed \" + aliasOrFilter);\r\n }\r\n }", "title": "" }, { "docid": "ed6b333f7dd310672cad016ea9e95df2", "score": "0.46967235", "text": "function FieldPath$$1() {\r\n var fieldNames = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n fieldNames[_i] = arguments[_i];\r\n }\r\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\r\n for (var i = 0; i < fieldNames.length; ++i) {\r\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\r\n if (fieldNames[i].length === 0) {\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" +\r\n 'Field names must not be empty.');\r\n }\r\n }\r\n this._internalPath = new FieldPath(fieldNames);\r\n }", "title": "" }, { "docid": "3da70ce29df438a0181b1b550cc33199", "score": "0.46873692", "text": "function FieldPath$1() {\n var fieldNames = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n fieldNames[_i] = arguments[_i];\n }\n\n validateNamedArrayAtLeastNumberOfElements('FieldPath', fieldNames, 'fieldNames', 1);\n\n for (var i = 0; i < fieldNames.length; ++i) {\n validateArgType('FieldPath', 'string', i, fieldNames[i]);\n\n if (fieldNames[i].length === 0) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Invalid field name at argument $(i + 1). \" + 'Field names must not be empty.');\n }\n }\n\n this._internalPath = new FieldPath(fieldNames);\n }", "title": "" }, { "docid": "f8083e97c4ddeca0863779347d412b06", "score": "0.46872723", "text": "query(path) {\n const p = data.asList(path)\n\n const root = Cursor.from(this._store.getState())\n const result = p.isEmpty() ? root : root.getIn(p)\n\n return result\n }", "title": "" }, { "docid": "9d0fd793a4301b62136f34da4f1ce44c", "score": "0.4670095", "text": "get _queryObject() {\r\n return queryParamsGetQueryObject(this._queryParams);\r\n }", "title": "" }, { "docid": "f35fb36367d02db31bd0131e676fdd86", "score": "0.46686757", "text": "function LQueries(){}", "title": "" }, { "docid": "1de4d5ee4c53ed7c23eee86662b630db", "score": "0.46624807", "text": "constructor(query, plain, regexp, exclusive, fun) {\n this.query = query;\n this.plain = plain;\n this.regexp = regexp;\n this.exclusive = exclusive;\n this._fun = fun;\n this.storage = {};\n }", "title": "" }, { "docid": "51431d5ed1fb2b7b17cc5a253e2b124d", "score": "0.46474254", "text": "orExt(query) {\n\t\tthis.query = {\n\t\t\t$or: query\n\t\t};\n\t}", "title": "" }, { "docid": "d33784d5916fbb9f8c3ffe6a73406744", "score": "0.46356416", "text": "function LocalQueryCollection(initialArray) {\r\n this.init(persistence, null, LocalQueryCollection);\r\n this._items = initialArray || [];\r\n }", "title": "" }, { "docid": "e5939314703bb079802619d71bff0766", "score": "0.46317902", "text": "_setupQuery() {\n const conversation = this.properties.conversation;\n if (this.hasGeneratedQuery) {\n if (!conversation) {\n this.query.update({\n predicate: '',\n });\n } else if (conversation instanceof Core.Conversation) {\n this.query.update({\n predicate: `conversation.id = \"${conversation.id}\"`,\n });\n } else if (conversation instanceof Core.Channel) {\n this.query.update({\n predicate: `channel.id = \"${conversation.id}\"`,\n });\n } else {\n this.query.update({\n predicate: '',\n });\n }\n }\n }", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.46219546", "text": "function TQueries() {}", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.46219546", "text": "function TQueries() {}", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.46219546", "text": "function TQueries() {}", "title": "" } ]
48b5c013d9232e1ce235ddb432136926
Switch between the different levels on a poster
[ { "docid": "c2ba980d50ac528b73bb5a8846408552", "score": "0.64749336", "text": "function switchPosterLevel(direction) {\n // If animating, do nothing\n if (isAnimating == true)\n return;\n\n // Which level is currently displayed\n var currentImage = $('.images-wrapper .poster-img.current');\n var currentLevel = parseInt(currentImage.attr('data-nb'));\n\n // Selectors\n var imagesFrame = $('.images-frame');\n var minusBtn = $('.switch-level.minus');\n var plusBtn = $('.switch-level.plus');\n\n // Height of one image\n var heightPoster = currentImage.height();\n\n // Declare running animation\n isAnimating = true;\n\n // Get the current frame position in order to slide up/down\n var translateValue = (imagesFrame.css('transform') != 'none')? imagesFrame.css('transform') : 'matrix(0,0,0,0,0,0)';\n translateValue = translateValue.split('(')[1].split(')')[0].split(',');\n translateValue = parseInt(translateValue[5]);\n\n // Which button has been pressed\n if (direction == 'minus' && currentLevel > 1) {\n var newLevel = currentLevel-1;\n translateValue += heightPoster;\n plusBtn.removeClass('hidden');\n } else {\n var newLevel = currentLevel+1;\n translateValue -= heightPoster;\n minusBtn.removeClass('hidden');\n }\n // Slide the frame\n imagesFrame.css('transform', 'translateY('+translateValue+'px)');\n\n // Update the animation state\n imagesFrame.one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){\n isAnimating = false;\n });\n\n // Refresh the classes\n currentImage.removeClass('current');\n $('.poster-img[data-nb=\"'+newLevel+'\"]').toggleClass('current');\n\n if(newLevel == 1){\n minusBtn.addClass('hidden');\n }\n if(newLevel == $('.images-wrapper .poster-img').length){\n plusBtn.addClass('hidden');\n }\n }", "title": "" } ]
[ { "docid": "cc1b8a0f997906b1bbef1841bdf4db48", "score": "0.6081948", "text": "function switch_level(name) {\n level_data[name] = get_level(name);\n Crafty.init(Game.width(), Game.height());\n Crafty.background('#bef');\n Crafty.scene(name);\n}", "title": "" }, { "docid": "600a10050f915affedd9249734348c10", "score": "0.5791062", "text": "function setup_level(level) {\n switch (level) {\n case 1:\n game_level_score = level1.score;\n set_game_level_score(game_level_score);\n $('.keyboard').show();\n store_key_offsets();\n start_level(level1.keys());\n start_coaster();\n break;\n case 2:\n game_level_score = level2.score;\n set_game_level_score(game_level_score);\n store_key_offsets();\n start_level(level2.keys());\n start_coaster();\n break;\n case 3:\n game_level_score = level3.score;\n set_game_level_score(game_level_score);\n store_key_offsets();\n start_level(level3.keys());\n start_coaster();\n break;\n default:\n console.log(\"Levels exhausted. Sorry!\");\n }\n}", "title": "" }, { "docid": "42c7d90f21f05a2f3e26f0c8eab37c90", "score": "0.5724483", "text": "function newLevel() {\n text = \"Level \" + (level + 1);\n textAlpha = 1.0;\n createAsteroidBelt();\n}", "title": "" }, { "docid": "f0baaa1debfd61a9830cd2805e27d56d", "score": "0.57206446", "text": "function onMouseDownStartLevels(thiss) {\n\n var id = thiss.getSprite(0).getName();\n wade.app.buildAndLoadNewScene(id);\n}", "title": "" }, { "docid": "b3eb2662395b00e9ff30e9d05179a254", "score": "0.5705137", "text": "function switchLevel(tutorial_step) {\n\tswitch (tutorial_step) {\n\t\tcase 1:\n\t\t\t$('#tut_step').text(\"Tutorial: go over the donut to eat it (press space to continue)\");\n\t\t\tdonut = new Donut(canvas.width/2, canvas.height/2);\n\t\t\tdonut.draw();\n\t\t\tbreak;\n\t\tcase 2: \n\t\t\t$('#tut_step').text(\"Level 1: avoid the obstacles! (press space after eating the donut to continue)\");\n\t\t\tbackground_audio.pause();\n\t\t\tbackground_audio.currentTime = 0;\n\t\t\tbackground_audio.play();\n\t\t\tresetDonny();\n\t\t\tdrawObstacles();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$('#tut_step').text(\"Level 2: Defeat the boss! (press space after eating the donut to continue\");\n\t\t\tconsole.log('boss level!');\n\t\t\tbackground_audio.pause();\n\t\t\tbackground_audio.currentTime = 0;\n\t\t\tboss_audio.play();\n\t\t\tresetDonny();\n\t\t\tdrawBoss();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tgame_won = true;\n\t\t\tboss_audio.pause();\n\t\t\tadventure_audio.play();\n\t\t\tresetDonny();\n\t\t\t$(\"#gamewin\").fadeIn(500);\n\t\t\tbreak;\n\t}\t\n}", "title": "" }, { "docid": "0b80541fdb4d0b2a501a9a6b031ccf3b", "score": "0.5625959", "text": "function switchLevel(icey) {\n\t// Remove floor and remove lava\n\tscene.remove(floor, lava);\n\t// Remove all four walls\n\tscene.remove(wall, wall2, wall3, wall4);\n\t// Sets colors depending on selection\n\tif (icey == true) {\n\t\tfloorColour = 0xffffff;\n\t\tfloorColour2 = 0xd7dbff;\n\t\tfloorColour3 = 0xa8afe3;\n\t\twallColour = 0x9eeefa;\n\t\tlavaColour = 0x0921d2;\n\t\tlavaColour2 = 0x8490f0;\n\t\tlavaColour3 = 0x3e4fcc;\n\t\tscene.background = new THREE.Color(0x032a30);\n\t\tscene.fog = new THREE.Fog(0x055361, 0, 200);\n\t\tfogColour2 = 0x38a1ff;\n\t} else {\n\t\tfloorColour = 0xd6dbd6;\n\t\tfloorColour2 = 0x000000;\n\t\tfloorColour3 = 0x687a68;\n\t\twallColour = 0x77b575;\n\t\tlavaColour = 0x04ff00;\n\t\tlavaColour2 = 0x38a536;\n\t\tlavaColour3 = 0x22ce1e;\n\t\tscene.background = new THREE.Color(0x242923);\n\t\tscene.fog = new THREE.Fog(0x485346, 0, 200);\n\t\tfogColour2 = 0x32e02c;\n\t}\n\t// Generate new floor geometry object\n\tfloorGeometry = new THREE.PlaneGeometry(200, 200, 70, 70);\n\tfloorGeometry.rotateX(-Math.PI / 2);\n\tfor (var i = 0, l = floorGeometry.vertices.length; i < l; i++) {\n\t\tvar vertex = floorGeometry.vertices[i];\n\t\tvertex.x += Math.random() * 15 - 10;\n\t\tvertex.y += Math.random() * 5;\n\t\tvertex.z += Math.random() * 15 - 10;\n\t}\n\tfor (var i = 0, l = floorGeometry.faces.length; i < l; i++) {\n\t\tvar face4 = floorGeometry.faces[i];\n\t\tface4.vertexColors[0] = new THREE.Color(lavaColour);\n\t\tface4.vertexColors[1] = new THREE.Color(lavaColour2);\n\t\tface4.vertexColors[2] = new THREE.Color(lavaColour3);\n\t}\n\t// Generate new lava geometry object\n\tlavaGeometry = new THREE.PlaneGeometry(200, 200, 30, 30);\n\tlavaGeometry.rotateX(-Math.PI / 2);\n\tfor (var i = 0, l = lavaGeometry.vertices.length; i < l; i++) {\n\t\tvar vertex2 = lavaGeometry.vertices[i];\n\t\tvertex2.x += Math.random() * 15 - 10;\n\t\tvertex2.y += Math.random() * 1;\n\t\tvertex2.z += Math.random() * 15 - 10;\n\t}\n\tfor (var i = 0, l = lavaGeometry.faces.length; i < l; i++) {\n\t\tvar face5 = lavaGeometry.faces[i];\n\t\tface5.vertexColors[0] = new THREE.Color(floorColour);\n\t\tface5.vertexColors[1] = new THREE.Color(floorColour2);\n\t\tface5.vertexColors[2] = new THREE.Color(floorColour3);\n\t}\n\tvar floorMaterial = new THREE.MeshBasicMaterial({\n\t\tvertexColors: THREE.VertexColors\n\t});\n\tfloor = new THREE.Mesh(floorGeometry, floorMaterial);\n\tvar floorMaterial2 = new THREE.MeshBasicMaterial({\n\t\tvertexColors: THREE.VertexColors\n\t});\n\tlava = new THREE.Mesh(lavaGeometry, floorMaterial2);\n\tfloor.translateY(-70);\n\tscene.add(floor, lava);\n\t// Generate new walls\n\tvar wallMaterial = new THREE.MeshBasicMaterial({\n\t\tcolor: wallColour,\n\t\tspecular: 0xffffff,\n\t\tflatShading: true\n\t});\n\tvar wall = new THREE.Mesh(wallGeometry, wallMaterial);\n\tvar wall2 = new THREE.Mesh(wallGeometry2, wallMaterial);\n\tvar wall3 = new THREE.Mesh(wallGeometry3, wallMaterial);\n\tvar wall4 = new THREE.Mesh(wallGeometry4, wallMaterial);\n\tscene.add(wall, wall2, wall3, wall4);\n}", "title": "" }, { "docid": "41506e66cc07a73882e06ff289ff58b2", "score": "0.5608015", "text": "levelUp() {\n if(this.soundOn()) this.music.finishPlaying();\n this.nextLevel = true;\n }", "title": "" }, { "docid": "4ef120c98629cc6d4332348f3a67d3bc", "score": "0.55830175", "text": "function increaseLevel() {\n if (sessionStorage.loggedIn == 'true') {\n if (piece.score == 10) {\n dropSpeed = 500;\n level++;\n } else if (piece.score >= 30) {\n dropSpeed = 250;\n level++;\n } else if (piece.score == 60) {\n dropSpeed = 100;\n level++;\n } else if (piece.score >= 80) {\n dropSpeed = 50;\n level++;\n }\n } else\n dropSpeed = 1000;\n\n}", "title": "" }, { "docid": "a9fff6be6403999d8429752d61bb6ea6", "score": "0.55128294", "text": "function setCurrentMonster(type, lvl){\n let currentMonster = monsters[type].find(m => m.lvl == monsters[type].level)\n \n // this is for reference for understanding. it was working at one point.\n // monsterImageElem.src = monsters[type].find(m => m.type == type.img).img\n\n let monsterImageElem = document.getElementById(\"monster-image\")\n let monsterNameElem = document.getElementById(\"monster-name\")\n\n monsterImageElem.src = currentMonster.img\n monsterNameElem.innerText = currentMonster.name\n intervalChooser(lvl)\n\n}", "title": "" }, { "docid": "e3cdf8f12dac5f77d1c294c1a592a9d0", "score": "0.54850006", "text": "switchScene(){\n if (scene === \"matrix\" && switchToJuggle === true){\n scene = \"juggleSetup\"\n }\n }", "title": "" }, { "docid": "99421d518cf65b6a6f428460832d5bdc", "score": "0.5401335", "text": "setLevel(level) {\n // this._data = {\n // level: level,\n // text: this._data.text,\n // };\n this._data.level = level;\n\n /**\n * Highlight button by selected level\n */\n this.settingsButtons.forEach((button) => {\n clazz.toggle(\n button,\n this.CSS.settingsButtonActive,\n parseInt(button.dataset.level) === level\n );\n });\n }", "title": "" }, { "docid": "b590f8916058523fee5bde57992d9899", "score": "0.5394331", "text": "function chooseLevel (level,playerName) {\n console.debug(playerName);\n if(level === 1){\n console.debug(\"Level Set to 1\");\n $(\"#mode\").text(\"Easy\").css(\"color\",\"green\");\n return new onePlayerEasy(playerName);\n }else if(level===2){\n console.debug(\"Level Set to 2\");\n $(\"#mode\").text(\"Medium\").css(\"color\",\"orange\");\n return new onePlayerMedium(playerName);\n\n }else if (level===3){\n console.debug(\"Level Set to 3\");\n $(\"#mode\").text(\"Hard\").css(\"color\",\"red\");\n return new onePlayerHard(playerName);\n }\n}", "title": "" }, { "docid": "de27daa09289e91fd95acd28c54929ec", "score": "0.5380143", "text": "function newLevel(){\nusePrint = true;\nuseTip = true;\nuseToast = true;\nuseCustomLayout = true;\n}", "title": "" }, { "docid": "dcee919b5913983607eb7279cff383d8", "score": "0.53689355", "text": "function increaseLevel() {\n\tlevel++;\n\tinitObjects();\n\tincreaseSpeed(vehicles);\n\tincreaseSpeed(logs);\n}", "title": "" }, { "docid": "c81edf157c005959faadb3c423a7b484", "score": "0.5355004", "text": "function level(lev) {\n\tgamelevel = lev;\n\tdocument.querySelector('.level').style.display = 'none';\n\tstartGame();\t// and now start the game.\n}", "title": "" }, { "docid": "b7002d7f24a5dd78f5084257c24e0d6f", "score": "0.5354801", "text": "function changeSexMale() {\n // TEMPORARY: toggle button down\n document.getElementById(\"SexButtonM\").className = 'figure_button_selected';\n document.getElementById(\"SexButtonF\").className = 'figure_button';\n\n // Remove children for rendering new avatar\n stage.removeAllChildren();\n // Setting Actors index for male\n sex = 0;\n // Set the AvatarCustomizer to mainAvatar\n mainAvatar.setActorM(Actors[sex]);\n // Draw mainAvatar\n mainAvatar.actor.draw(stage, avatarScript);\n}", "title": "" }, { "docid": "a8c3e5890a2c26d24ebedd5d029d346d", "score": "0.5339417", "text": "function switchPoster(posterId, selectionId) {\n var params = { 'posterId': posterId, 'selectionId': selectionId };\n var controllerUrl = (params.posterId == 'final') ?\n ajaxPosterUrls.final :\n ajaxPosterUrls.switchposter;\n $.ajax({\n url: controllerUrl,\n data: params,\n beforeSend: function() { $('.poster-wrapper').addClass('loading'); },\n complete: function() {\n $('.poster-wrapper').removeClass('loading');\n imagesLoaded();\n }\n })\n .done(function(data) {\n $('.poster-wrapper').html(data);\n })\n .fail(function() {\n console.log(\"error\");\n })\n }", "title": "" }, { "docid": "a372145b8fef22a6c356bd540c803a8c", "score": "0.5330551", "text": "function setLevel(level) {\n cycleLevel = parseInt(level);\n timeSlider.value = cycleLevel;\n timeSlider.max = life.length - 1;\n\n stateText.clearContents();\n stateText.appendChild(document.createTextNode(\"Level \" + level));\n\n // Render new random cycle\n renderSVG(life[cycleLevel], mapBoundings, canvas, render);\n }", "title": "" }, { "docid": "4dba6bd5fdde7b4ecef182c1ebd01d9c", "score": "0.53167164", "text": "function setGameLevel(n) {\n if (n == 0) {\n gameVars.level = 0;\n gameVars.pauseTime = 1800; // intervals between images shown in milliseconds\n gameVars.choices = 4; // Number of images player can choose from\n gameVars.maxRounds = 8; // Maximum number of rounds\n } else if (n == 1) {\n gameVars.level = 1;\n gameVars.pauseTime = 1600; // intervals between images shown in milliseconds\n gameVars.choices = 6; // Number of images player can choose from\n gameVars.maxRounds = 8; // Maximum number of rounds\n } else {\n gameVars.level = 2;\n gameVars.pauseTime = 1400; // intervals between images shown in milliseconds\n gameVars.choices = 8; // Number of images player can choose from\n gameVars.maxRounds = 8; // Maximum number of rounds\n }\n clearMainImage();\n}", "title": "" }, { "docid": "2359f7aa0ab60e864b74f53fa07d817a", "score": "0.5304161", "text": "levelTwoSetup() {\n // Spawn Player, Bottles, and Enemies in the level\n this.player.x = 20;\n this.player.y = 500;\n this.newSeeker(357, 58);\n this.newBottle(60, 500);\n this.newBottle(400, 490);\n this.newBottle(415, 325);\n this.newBottle(500, 55);\n this.newBottle(450, 55);\n this.newBottle(400, 55);\n this.spawnEnemy(40, 165, true, 2);\n this.spawnEnemy(232, 330, true, 3);\n this.spawnEnemy(315, 175, false, 4);\n this.spawnEnemy(315, 215, false, 4);\n\n // Spawn Exit\n var exit = new Wall(this, 205, 15, 'exit', 30,30).setOrigin(0,0);\n exit.setAlpha(1);\n // Setup Collision between Exit and Player\n var collider = this.physics.add.overlap(this.player, exit, (player, exit) => {\n //console.log(\"Level Complete\");\n this.physics.world.removeCollider(collider);\n this.cameras.main.fadeOut(500, 0, 0, 0);\n this.cameras.main.once(Phaser.Cameras.Scene2D.Events.FADE_OUT_COMPLETE, (cam, effect) => {\n this.levelBgm.pause();\n level++;\n this.scene.start('LoadScene');\n })\n });\n }", "title": "" }, { "docid": "061999175e009defc8415dbcc30bcfbb", "score": "0.5295913", "text": "function properBackground() {\n let lvl = player.lvl.toString();\n document.getElementById('mapReal').src =\n `${location.origin}/images/game/levels/pietro${lvl}.jpg`; \n}", "title": "" }, { "docid": "777f5738b0f4d2579dc8f1cbf90bc536", "score": "0.52945596", "text": "function LevelOne()\n{\n\t\n\tcreateLevels(firstchoice);\t\n}", "title": "" }, { "docid": "54ec38c6cbd0b0827331e2454dfb6c7c", "score": "0.52932173", "text": "function setupLevel()\n{\n\tvar r, i, j, w, d;\n\t\n words = [];\n cats = [];\n icats = [];\t\t\n\t\n\tif (level == 1) {\n\t\tr = getRndCategories(2);\n\t\tnw = 2;\n\t\tyspeed = 1;\n\t\tscore = 0;\n\t\tlife = 5;\t \n\t}\n\telse if (level == 2) {\n\t\tr = getRndCategories(3);\n\t\tnw = 2;\n\t\tyspeed = 1;\n\t}\n\telse if (level == 3) {\n\t\tr = getRndCategories(3);\n\t\tnw = 2;\n\t\tyspeed = 2\n\t}\n\telse if (level == 4) {\n\t\tr = getRndCategories(3);\n\t\tnw = 3;\n\t\tyspeed = 2;\n\t}\n\telse if (level == 5) {\n\t\tnw = 3;\n\t\tr = getRndCategories(4);\n\t\tyspeed = 2;\n\t}\n\tfor (i=0; i<r.length; i++) {\n\t w = easycat[r[i]][\"words\"];\n\t\tcats.push(easycat[r[i]][\"title\"]);\n\t\tfor (j=0; j<w.length; j++) {\n\t\t\twords.push({\"text\":w[j].toUpperCase(), \"cat\":i});\n\t\t}\n\t}\n\tbar = [];\n\td = (workWidth - cats.length*55+15)/2;\n\tfor (i=0; i<=cats.length; i++) {\n\t\tbar[i] = {x1:d+55*i, y1:420, x2:d+15+55*i, y2:499};\n }\n\tfor (k=0; k<nw; k++) {\t\n\t\tword[k].active = false;\n\t}\n\t\n}", "title": "" }, { "docid": "fdb6a6019a19cf028296934b554458d5", "score": "0.52804846", "text": "function playerLevelChange() {\n updateProficiency();\n setSkills();\n enableFeats();\n setNewtypePowers();\n addNewtypePowers();\n longRest();\n }", "title": "" }, { "docid": "0c3acd942167af30fe77cdfd474b231e", "score": "0.5275838", "text": "levelOneSetup() {\n // Spawn Player, Bottles, and Enemies in the level\n this.player.x = 450;\n this.player.y = 510;\n this.newBottle(430, 460);\n this.newBottle(200, 350);\n this.newBottle(60, 276);\n this.newBottle(60, 126);\n this.newBottle(280, 64);\n this.spawnEnemy(485, 150, false, 2);\n this.spawnEnemy(443, 150, false, 2);\n this.newSeeker(374, 440);\n // Spawn Exit\n var exit = new Wall(this, 500, 35, 'exit', 30,30).setOrigin(0,0);\n exit.setAlpha(1);\n // Setup Collision between Exit and Player\n var collider = this.physics.add.overlap(this.player, exit, (player, exit) => {\n //console.log(\"Level Complete\");\n this.physics.world.removeCollider(collider);\n this.cameras.main.fadeOut(500, 0, 0, 0);\n this.cameras.main.once(Phaser.Cameras.Scene2D.Events.FADE_OUT_COMPLETE, (cam, effect) => {\n this.levelBgm.pause();\n level++;\n this.scene.start('LoadScene');\n })\n });\n }", "title": "" }, { "docid": "f5d12229ac4ae167a2a69d2e348bbd7c", "score": "0.52756053", "text": "function winLevel(){\n if (distance == winCond){\n level = -4;\n distance = 0;\n scoreboardWidth = 45;\n cheering.play();\n }\n\n else if(distance == winCond2){\n level = -5;\n distance = 0;\n scoreboardWidth = 45;\n cheering.play();\n }\n\n else if(distance == winCond3){\n level = -3;\n distance = 0;\n scoreboardWidth = 45;\n cheering.play();\n }\n}", "title": "" }, { "docid": "fb2b18bc9c0aa56f6cd543817462f3cd", "score": "0.52685463", "text": "function nextLevel() {\n\n level++;\n //alert(`gz, you are level ${level} now!`);\n snake.addBody(3);\n DOMElements.setLevelElements();\n bodyWidth = htmlPage.scrollWidth;\n bodyHeight = htmlPage.scrollHeight;\n if (DOMElements.currentLevelElements.length === 0) //check if there are any elements of this type on the page, if not, go to next level. Otherwise you're stuck on a level you can never eat anything.\n nextLevel();\n }", "title": "" }, { "docid": "110ca7cc2ef9c8b1d210f565b7cd4591", "score": "0.5243497", "text": "_updateLevel() {\n const level = this._achievements.getCurrentLevel();\n this._builder.get_object('level-stack').set_visible_child_name('level' + level);\n }", "title": "" }, { "docid": "da006d0ece85c9b01d0a95db3e585a54", "score": "0.5243058", "text": "nextLevel() {\n\n\t\tthis.level ++;\n\n\t\tif ( this.level == this.levelNames[ this.levelCategories[ this.category ] ].length ) {\n\n\t\t\tthis.level = 0;\n\n\t\t\tthis.category ++;\n\t\t\tif ( this.category == this.levelCategories.length ) {\n\n\t\t\t\tthis.category = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdocument.getElementById( 'levelScreen' ).classList.add( 'hidden' );\n\n\t\tthis.customLevel = false;\n\n\t\tthis.loadScene().then( ()=>{\n\n\t\t\tthis.startLevel();\n\n\t\t} );\n\n\t}", "title": "" }, { "docid": "f274cc9495f2bb4c27e20e25f9af8dbb", "score": "0.5241431", "text": "function setLevel(){\n\t\n\t// reset player position\n\tplayer.resetPos();\n\t\n\t// place the key somewhere within the key-space\n\tkey.randomPos(sceneWidth, sceneHeight);\n\t\n\t// if there are currently platforms in the scene\n\tif(currentPlatforms.length > 0){\n\t\t// set them all to inactive, and not moving\n\t\tfor(plat of currentPlatforms){\n\t\t\tplat.isActive = false;\n\t\t\tplat.moving = false;\n\t\t\tplat.dx = 0;\n\t\t\tplat.dy = 0;\n\t\t}\n\t\t\n\t\t// remove it frm the scene\n\t\tgameScene.removeChild(plat);\n\t\t\n\t\t// empty the array\n\t\tcurrentPlatforms = [];\n\t}\n\n\t// grab anywhere from 2-4 platforms\n\tfor(let i = 0; i < Math.ceil(getRandom(2, platforms.length-1)); i++){\n\t\t\n\t\t// random platform\n\t\tlet plat = platforms[Math.round(getRandom(0, platforms.length-1))];\n\t\t\n\t\t// if the platform is already being used, try for another\n\t\tif(currentPlatforms.includes(plat)){\n\t\t\ti--;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// place the platform in a new location\n\t\tplat.relocate(sceneWidth, sceneHeight);\n \n // if this platform is intersecting any others, relocate it again\n for(otherPlat of currentPlatforms){\n if(otherPlat == plat){\n continue;\n }\n \n while(rectsIntersect(otherPlat, plat)){\n plat.relocate();\n }\n }\n \n // resize walls\n\t\tfor(wall of walls){\n\t\t\twall.relocate(sceneWidth, sceneHeight, 0, 100);\n wall.resize();\n\t\t}\n\t\t\n // correct intersecting hazards\n\t\tfor(hazard of hazards){\n\t\t\thazard.relocate(sceneWidth, sceneHeight, 0, sceneHeight - hazard.height);\n\t\t\t\n\t\t\t// if the hazard is too close to the player spawn, move it\n\t\t\tif(hazard.x <= 100){\n\t\t\t\thazard.x += 25;\n\t\t\t}\n \n\t\t\t// check for hazard collisions and correct them\n for(otherHazard of hazards){\n if(hazard == otherHazard){\n continue;\n }\n \n // as long as this hazard is intersecting with another, relocate this one\n while(rectsIntersect( hazard, otherHazard )){\n hazard.relocate(sceneWidth, sceneHeight, 0, sceneHeight - hazard.height);\n }\n }\n\t\t}\n\n\t\t// add this platform to the array\n\t\tcurrentPlatforms.push(plat);\n\n\t\t// activate it and add it to the scene\n\t\tplat.isActive = true;\n\t\tgameScene.addChild(plat);\n\t\t\n // create random chances of the platform moving in x and or y directions\n\t\tlet chanceX = getRandom(0,10);\n\t\tlet chanceY = getRandom(0,10);\n\t\t\n\t\t// chance of moving platform in x direction\n\t\tif(chanceX < 5){\n\t\t\tplat.moving = true;\n\t\t\t// randomize speed between 6 intervals of 20\n\t\t\tplat.dx = getRandom(1,5) * 20;\n\t\t}\n\t\t// if the platform isnt moving in the x direction, incease the chance of moving in the y direction\n\t\telse{\n\t\t\tchanceY /= 2;\n\t\t}\n\t\t// chance of moving platform in y direction\n\t\tif(chanceY < 5){\n\t\t\tplat.moving = true;\n\t\t\t// randomize speed between 6 intervals of 20\n\t\t\tplat.dy = getRandom(1,5) * 20;\n\t\t}\n\t}\n\t\n\t// move the key\n\tlet keyIntersecting = true;\n\t\n\t// while the key is intersecting with an object, move it to a new location and check for collision again\n\twhile( keyIntersecting ){\n\t\t\n\t\tkeyIntersecting = false;\n\t\tkey.randomPos(sceneWidth, sceneHeight);\n\n\t\t// platform check\n for(otherPlat of currentPlatforms){\n if(rectsIntersect( hazard, otherPlat )){\n\t\t\t\tkeyIntersecting = true;\n\t\t\t\tcontinue;\n\t\t\t}\n }\n \n // wall check\n\t\tfor(wall of walls){\n\t\t\tif(rectsIntersect( wall, key )){\n\t\t\t\tkeyIntersecting = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t\n // hazards check\n\t\tfor(hazard of hazards){\n\t\t\tif(rectsIntersect( hazard, key )){\n\t\t\t\tkeyIntersecting = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}\n\t\n // remove inactive platforms from the scene\n\tfor(plat of platforms){\n\t\tif(!plat.isActive){\n\t\t\tgameScene.removeChild(plat);\n\t\t}\n\t}\n\t\n // loop platforms and if any are beyond the screen, move them upward 100px\n for(plat of currentPlatforms){\n if(plat.y > sceneHeight){\n plat.y -= 100;\n }\n }\n}", "title": "" }, { "docid": "ba894c0f543330170a67b852368498b3", "score": "0.5231796", "text": "function changeLevel(city, funcOne, funcTwo, funcThree) {\n if(player.health <= 0) {\n gameOver(lost);\n } else {\n heading.textContent = city[0];\n leftImg.setAttribute('src', city[1]);\n centerImg.setAttribute('src', city[2]);\n rightImg.setAttribute('src', city[3]);\n mapImage.setAttribute('src', city[4]);\n leftFunction = funcOne;\n centerFunction = funcTwo;\n rightFunction = funcThree;\n }\n}", "title": "" }, { "docid": "783335615ca6f09d69ae2eb529384e72", "score": "0.52247137", "text": "function changeSexFemale() {\n // TEMPORARY: toggle button down\n document.getElementById(\"SexButtonF\").className = 'figure_button_selected';\n document.getElementById(\"SexButtonM\").className = 'figure_button';\n\n // Following code is the same as above but for female sex\n stage.removeAllChildren();\n sex = 1;\n mainAvatar.setActorF(Actors[sex]);\n mainAvatar.actor.draw(stage, avatarScript);\n}", "title": "" }, { "docid": "d995ae1996214a3015e875d80d6092ec", "score": "0.5221664", "text": "function LevelUp(){\n\tlevel++;\n\tcar1.speed--;\n\tcar2.speed++;\n\tcar3.speed--;\n\tcar4.speed++;\n\tcar5.speed--;\n\tlog1.speed++;\n\tlog2.speed++;\n\tlog3.speed++;\n\tturtle1.speed--;\n\tturtle2.speed--;\n}", "title": "" }, { "docid": "233791600c64d8688fa6bf87cb5aad99", "score": "0.521777", "text": "function level_transition(){\n\n // Update next level counter\n Game.current_level++;\n\n // Level 2 settings: Adjust speeds accordingly for level \n // for difficulty\n if (Game.current_level == 2){\n\n // Change to new background\n $(\"#main\").addClass(\"canvas-bg-lvl2\").removeClass(\"canvas-bg-default\");\n \n\n // Speed up black hole spawn times for level 2\n window.aprns_min_time = 150;\n window.aprns_max_time = 400;\n \n // Speed up object speed for level 2\n window.max_delta = 8;\n window.min_delta = 4;\n }\n\n // Reset game values to default\n Game.reset();\n\n // Retart Game loop, retrieve id\n Game.loop = setInterval(Game.run, 33); \n\n // Restart Game timer, see run_timer for details on reset \n Game.time_interval_id = Game.run_timer();\n\n // Hide/Show windos for necessary transition\n $(\"#transition-page\").hide();\n $(\"#game-page\").show();\n\n // Update info-bar values to reflect new level properties\n $(\"#ib-level\").text(\"Level: \" + String(Game.current_level));\n display_high_scores();\n }", "title": "" }, { "docid": "9b9a7695ea9e4a2afa5b0654db66298f", "score": "0.52070636", "text": "function newLevel(level)\n{\n\tenemiesMax = level * 5;\n\tenemiesSpeed = level * 1;\n}", "title": "" }, { "docid": "f156924221d8f35c386ed02d5d664e47", "score": "0.5198763", "text": "setLevel(level) {\n\t\tcurrentLevel = level;\n\t}", "title": "" }, { "docid": "16d631ea49b71181bf89507d85f02874", "score": "0.51720285", "text": "function randomizelevel() {\r\n var max = 360;\r\n var min = 0;\r\n if(levelcounter < 2) {\r\n points.pt1 = random(min, max, points.pt1);\r\n points.pt2 = random(min, max, points.pt2);\r\n points.pt3 = random(min, max, points.pt3);\r\n points.pt4 = random(min, max, points.pt4);\r\n } if(levelcounter > 4) {\r\n var max = 40;\r\n var min = 0;\r\n points.pt1 = random(min, max, points.pt1);\r\n points.pt2 = random(min, max, points.pt2);\r\n points.pt3 = random(min, max, points.pt3);\r\n points.pt4 = random(min, max, points.pt4);\r\n points.pt5 = random(min, max, points.pt5);\r\n points.pt6 = random(min, max, points.pt6);\r\n } if(levelcounter > 10) {\r\n var max = 90;\r\n var min = 0;\r\n points.pt1 = random(min, max, points.pt1);\r\n points.pt2 = random(min, max, points.pt2);\r\n points.pt3 = random(min, max, points.pt3);\r\n points.pt4 = random(min, max, points.pt4);\r\n points.pt5 = random(min, max, points.pt5);\r\n points.pt6 = random(min, max, points.pt6);\r\n points.pt7 = random(min, max, points.pt7);\r\n points.pt8 = random(min, max, points.pt8);\r\n }\r\n}", "title": "" }, { "docid": "662137d8dba9933357006abc22725c7b", "score": "0.5167472", "text": "function nextLevel()\r\n {\t\r\n level++;\r\n\t\tresetValues();\r\n\t\tinitWorld(level);\t\t\r\n }", "title": "" }, { "docid": "54924fee8c33d19df048d11972fef681", "score": "0.5160827", "text": "function SwitchWeapon (switchDirection: int) \n{\n if (switchDirection != 0)\n {\n\t weapons[currentWeapon].gameObject.SetActive(false);\n\t currentWeapon = Mathf.Clamp(currentWeapon + switchDirection, 0, weapons.Length - 1);\n\t weapons[currentWeapon].gameObject.SetActive(true);\n\t \n\t if (animator) animator.SetInteger(animatorParameterHash, currentWeapon);\n }\n \n}", "title": "" }, { "docid": "2bf782a7514b1f2cf18ef2a17f74244d", "score": "0.51533306", "text": "function setLevel(id, level) {\n if(id < remoteMappingName.length) {\n let track = $(`.video-${id} audio`)[0];\n $('.volume-' + id + ' .volume').text(Math.round(level*100) + \"%\");\n $('.volume-' + id + ' input[type=\"range\"]').val(level);\n track.volume = level;\n }\n}", "title": "" }, { "docid": "fe1d4b2d591a9837af61332c5d9d53b8", "score": "0.51479626", "text": "function test_level(nb)\n{\n nb_lines += nb;\n if (nb_lines >= LEVEL_LINES + 2 * (level - 1)) {\n\tnb_lines = 0;\n\tlevel++;\n edje_object_part_text_set(edje_o, \"level\", level);\n ecore_timer_interval_set(game_timer, (5.25 - level / 4) / 100);\n\tdisplay_image_text('next');\n\tif (sample_next)\n\t Mix_PlayChannel(-1, sample_next, 0);\n }\n}", "title": "" }, { "docid": "ec6002d37389ce173e5d6ecef4a42e75", "score": "0.5144178", "text": "function updateLevel(player, winOrLose){\n let level = document.querySelector('.level');\n let levelText = document.querySelector('.level span');\n if (winOrLose === 'win') {\n player.level += 1;\n levelText.innerText = player.level;\n level.classList.toggle(\"bounce\");\n setTimeout(function () {\n level.classList.toggle(\"bounce\");\n },1200);\n }\n else {\n player.level = player.level > 1 ? player.level - 1 : player.level;\n levelText.innerText = player.level;\n level.classList.toggle(\"shake\");\n setTimeout(function () {\n level.classList.toggle(\"shake\");\n },1200);\n }\n\n}", "title": "" }, { "docid": "6d6698c9401d0bbf5a641b4f4dba80a4", "score": "0.5136848", "text": "function levelUp(nextClass) {\r\n\tif (nextClass == \"flag\" && riderOn && currentLevel < levels.length) {\r\n\t\tif (currentLevel < 4) {\r\n\t\t\tshowLightBox(\"Level Up!\", \"Time used: \" + displayTime);\r\n\t\t\tlevelWin.play();\r\n\t\t\texecuted = false;\r\n\t\t\tclearTimeout(currentAnimation);\r\n\t\t\tsetTimeout (function() { \r\n\t\t\t\tchangeVisibility(\"boundaryMessage\");\r\n\t\t\t\tchangeVisibility(\"lightbox\"); \r\n\t\t\t\tcurrentLevel++;\r\n\t\t\t\tloadLevel(currentLevel); \r\n\t\t\t}, 1000); \r\n\t\t} else if (currentLevel == 4) {\r\n\t\t\tshowLightBox(\"You Won!\", \"You have finished in \" + displayTime + \",\\n try again for a faster time\");\r\n\t\t\tlevelWin.play();\r\n\t\t\tcurrentLevel = 0;\r\n\t\t\tdocument.querySelector(\"x\").onclick = loadLevel();\r\n\t\t\treturn; \r\n\t\t} // else\r\n\t} // else\r\n\t\r\n\t\r\n\t\r\n\t/* else if (currentLevel = 4) {\r\n\t\tdocument.getElementById(\"youwon\").style.display = \"block\";\r\n\t\tsetTimeout (function() { \r\n\t\t\tdocument.getElementById(\"youwon\").style.display = \"none\";\r\n\t\t\t// fireworks?\r\n\t\t}, 1000);\r\n\t\treturn; \r\n\t} // else */ \r\n\t\r\n} // level up", "title": "" }, { "docid": "faf9207cb4ec8b5e0a8672e5e96786a7", "score": "0.5127397", "text": "function endLevel(){\n if (block0.scale.y == block1.scale.y && block0.tint == block1.tint) {\n nextLevel();\n } else {\n createLevel(levelNumber);\n }\n}", "title": "" }, { "docid": "e1fa42a5408e0d9229d4a60c51ffa12b", "score": "0.512165", "text": "function changeScene(currentScene){\n for (let index = 0; index < pointImages.length; index++) {\n const element = pointImages[index];\n if (element.properties.name == currentScene ) {\n console.log(element.properties);\n headingGlobalValue = element.properties.heading;\n var source = Marzipano.ImageUrlSource.fromString(element.properties.path);\n var scene = viewer.createScene({\n source: source,\n geometry: geometry,\n view: view,\n pinFirstLevel: true\n });\n\n current_point.setLatLng( new L.LatLng(element.geometry.coordinates[1], element.geometry.coordinates[0]) );\n \n scene.switchTo();\n\n for (let index = 0; index < element.properties.listObj.length; index++) {\n const obj = element.properties.listObj[index];\n scene.hotspotContainer().createHotspot(createHotspotOn360(obj.next, obj.type), { yaw: obj.yaw, pitch: obj.pitch });\n }\n }\n }\n}", "title": "" }, { "docid": "d3f74a4f88d9cba8442750724f60ef82", "score": "0.5113204", "text": "function nextLevel(){\n\tlevel++;\n\tpaused = true;\n\tremoveAll();\n\tlasers = [];\n\tbricks = [];\n\tdy = Math.abs(dy);\n\tdx = Math.abs(dx);\n\tbullet = null;\n\tstopTimer(moveBullet);\n\t\n\txScaling = (NUM_BRICKS_PER_ROW + EXTRA_ROW_LENGTH_PER_LEVEL) / NUM_BRICKS_PER_ROW;\n\tyScaling = (NUM_ROWS + EXTRA_ROWS_PER_LEVEL) / NUM_ROWS;\n\t\n\tNUM_ROWS += EXTRA_ROWS_PER_LEVEL;\n\tNUM_BRICKS_PER_ROW += EXTRA_ROW_LENGTH_PER_LEVEL;\n\t\n\tpassingScore += NUM_ROWS * NUM_BRICKS_PER_ROW * POINTS_PER_BRICK;\n\t\n\tscaleWorld();\n\tdrawWorld();\n}", "title": "" }, { "docid": "da1dc5a5e54eb47bdfedc1a10d079f73", "score": "0.51112574", "text": "function levelMusic() {\r\n switch (true) {\r\n case (niveau<=5):\r\n if (buttnMusic===1) {assets.musicStart.play()}\r\n titleMusic=\"musicStart\";\r\n break;\r\n /*\r\n case (niveau<=10):\r\n if (buttnMusic===1) {assets.musicDawnNewWord.play()}\r\n titleMusic=\"musicDawnNewWord\";\r\n break;*/\r\n case (niveau<=15):\r\n if (buttnMusic===1) {assets.musicDawnNewWord.play()}\r\n titleMusic=\"musicDawnNewWord\";\r\n break;\r\n case (niveau<=20):\r\n if (buttnMusic===1) {assets.musicPurpleNight.play()}\r\n titleMusic=\"musicPurpleNight\";\r\n break;\r\n /*\r\n case (niveau<=30):\r\n if (buttnMusic===1) {assets.musicStarryNight.play()}\r\n titleMusic=\"musicStarryNight\";\r\n break;\r\n case (niveau<=45):\r\n if (buttnMusic===1) {assets.musicStarryNight.play()}\r\n titleMusic=\"musicStarryNight\";\r\n break;*/\r\n case (niveau<=50):\r\n if (buttnMusic===1) {assets.musicStarryNight.play()}\r\n titleMusic=\"musicStarryNight\";\r\n break;\r\n case (niveau>50):\r\n if (buttnMusic===1) {assets.musicLastLevel.play()}\r\n titleMusic=\"musicLastLevel\";\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "d9032aef97db25efe6500645bf02ed27", "score": "0.5104318", "text": "function nextLevel(){\r\n\tremoveMaze();removePlug();removeGuidelines();removeAllStars();removeBalls();\r\n\tsoundManager.queue = new Queue();\r\n\tif(levelState==0)makeLevel1();\r\n\telse if(levelState==1)makeLevel2();\r\n\telse if(levelState==2)makeLevel3();\r\n\telse if(levelState==3)makeLevel4();\r\n\tmoving=false;\r\n}", "title": "" }, { "docid": "a6d39996d356cb603e6172eda8df7fd8", "score": "0.50966394", "text": "function loadlevel()\n{\n // Set which level we are on\n var level=gs.level;\n gs.tilerows=levels[level].height;\n gs.tilecolumns=levels[level].width;\n document.getElementById(\"playfield\").setAttribute(\"level\", level % 4);\n\n // Reset collectable\n gs.score=0;\n\n // Clear the playfield of tiles, things and enemies\n clearplayfield();\n\n // Add the tiles for the level\n addtiles(levels[level]);\n\n // Add the collectables\n addcollectables(levels[level]);\n\n // Add the characters\n addcharacters(levels[level]);\n\n // Restore health to 100%\n gs.player.lf=100;\n}", "title": "" }, { "docid": "1432b8133ab6e0ca37f43913d52025ad", "score": "0.5093706", "text": "function levelOne () {\n //draw first \n createWalls(50,500,100,20, platformImg);\n createWalls(100 ,480 ,20 ,20,crateImg, true);\n createWalls(200,500,100,20, platform2Img);\n createWalls(250,480 ,20,20,crateImg, true);\n createWalls(350 ,500,100,20, platformImg);\n createWalls(400 ,480 ,20 ,20,crateImg, true);\n createWalls(500 ,500,100,20, platform2Img);\n createWalls(550 ,480,20,20,crateImg, true);\n createWalls(650,500,100,20, platformImg);\n createWalls(660,480 ,20,20,crateImg, true);\n \n //draw second\n createWalls(115 , 400 , 75 , 20, platform2Img);\n createWalls(170 , 380 , 20 , 20,crateImg, true);\n createWalls(245 , 400 , 75 , 20, platformImg);\n createWalls(300 , 380 , 20 , 20,crateImg, true);\n createWalls(435 , 400 , 75 , 20, platformImg);\n createWalls(435 , 380 , 20 , 20,crateImg, true);\n createWalls(560 , 400 , 75 , 20, platform2Img);\n createWalls(560 , 380 , 20 , 20,crateImg,true);\n \n //draw third \n \n createWalls(225 , 300 , 70, 20, girderHImg);\n createWalls(255 , 260 , 20, 70, girderVImg);\n createWalls(340 , 300 , 75 , 20, platform2Img,false,true, 220, 340);\n createWalls(485 , 300 , 70 , 20, girderHImg);\n createWalls(500 , 260 , 20 , 70, girderVImg);\n \n //draw fourth \n createWalls(285 , 200 , 35, 20, platform2Img);\n createWalls(430, 200 , 35, 20, platform2Img);\n \n //draw top \n createWalls(355 , 125 , 35, 20, platform2Img);\n}", "title": "" }, { "docid": "8c7c35c350636ac61279387033c6b4d0", "score": "0.50904715", "text": "set level(id) {\n this._level = id;\n }", "title": "" }, { "docid": "53cbdda2f5b9a9dce8d50307a65ed657", "score": "0.5070326", "text": "function resetLevel() {\n\t\t\tvm.level = levels[common.level].map.slice();\n\t\t\timageService.setLevelNumber(common.level);\n\t\t}", "title": "" }, { "docid": "8c37cfe0eeb903bbd4bc775c85d83ce3", "score": "0.50684446", "text": "nextLevel() {\n if (this.gameOver === false) {\n //* Otherwise, keep continuing until the player dies\n // And brings the aliens back from the dead :)\n this.aliens.removeAll();\n this.createAliens();\n\n // Remove bullets\n this.bullet.kill();\n this.enemyBullets.callAll('kill');\n\n // Revives the player\n this.player.revive();\n\n // Hides the text\n this.stateText.visible = false;\n }\n }", "title": "" }, { "docid": "541ccd0e3f35389393cd18df7a56f69c", "score": "0.50678045", "text": "function setLevel(e) {\n\n var selectedLevel = e.target.value;\n // Set currentlevel to selectedLevel\n if (selectedLevel === \"easy\") {\n currentLevel = levels.easy;\n } else if (selectedLevel === \"medium\") {\n currentLevel = levels.medium;\n } else if (selectedLevel === \"hard\") {\n currentLevel = levels.hard;\n }\n\n // Last selected button color change\n var buttons = document.getElementsByTagName('button');\n for (i = 0; i < buttons.length; i++) {\n buttons[i].classList.remove('btn-info')\n buttons[i].classList.add('btn-secondary')\n\n e.target.classList.remove('btn-secondary')\n e.target.classList.add('btn-info')\n }\n\n // Reset game on level change\n isPlaying = false;\n time = 0;\n wordInput.value = \"\";\n // Show number of seconds in UI\n seconds.innerHTML = currentLevel;\n}", "title": "" }, { "docid": "a6c5eb05d816d3260f8dc52d528e027c", "score": "0.5063158", "text": "function replay(){\n\t this.state.start(\"Level\");\n}", "title": "" }, { "docid": "8701a91d3d0d4f12f258f3017ed38530", "score": "0.5060331", "text": "function setLightLevel () {\n\n r_lightlevel = (r_lightlevel + r_seed) / 2;\n\n setTimeout(setLightLevel, lightFlickerSpeed);\n\n }", "title": "" }, { "docid": "b60173020e4697d8256aca455ca944aa", "score": "0.50597185", "text": "function updateLevel (level) {\n if(level != currentLevel) {\n levelElement.innerText = `Level: ${levelGame}`;\n }\n}", "title": "" }, { "docid": "96621b9fed582e823a96f7412b7e997c", "score": "0.5042685", "text": "function setTheme(lvl){\n\t\tswitch(lvl){\n\t\t\tcase 2: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-2.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 3: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-3.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 4: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-4.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 5: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-5.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 6: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-6.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 7: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-7.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 8: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-8.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tcase 9: document.getElementById(\"backkkk\").style.backgroundImage = \"url('Level-9.jpg')\";\n\t\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:console.log(\"Inside default of setTheme!!\");\n\t\t\t\t\tdocument.getElementById(\"backkkk\").style.backgroundImage = \"url('bg.jpg')\";\n\t\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "030d7f2bd9566b1d6ed3599fcbf921fc", "score": "0.50303596", "text": "function levelUp() {\n if (hero.exp >= hero.nextLv) {\n hero.level += 1;\n hero.healthMax += 10;\n hero.health = hero.healthMax;\n hero.armor += 1;\n hero.strength += 1;\n hero.staminaMax += 2;\n hero.stamina = hero.staminaMax;\n hero.exp -= hero.nextLv;\n hero.nextLv = Math.floor(hero.nextLv * 1.3);\n renderLevelUp();\n };\n nextEnemy();\n renderEnemy();\n}", "title": "" }, { "docid": "7498c62563c4a217aef37bf3eec3ece8", "score": "0.50301075", "text": "function toggle_gray(element){\n if( $(element).hasClass(\"img-gray\") ){\n $(element).removeClass(\"img-gray\");\n }else{\n switch( $(\"#levelSelect\").val() ){\n case \"0\":\n case \"1\":\n default:\n $(element).addClass(\"img-gray\");\n break;\n case \"2\":\n if( $(element).attr(\"level\") < $(element).attr(\"maxLv\") ){\n $(element).attr(\"level\", parseInt( $(element).attr(\"level\"))+1);\n }else{\n $(element).attr(\"level\", 1);\n $(element).addClass(\"img-gray\");\n }\n var src_split = $(element).attr(\"src\").split(\"/\");\n src_split[src_split.length-1] = $(element).attr(\"element\")+$(element).attr(\"level\")+$(element).attr(\"row\")+\".png\";\n $(element).attr(\"src\",src_split.join(\"/\"));\n break;\n }\n } \n}", "title": "" }, { "docid": "f41bf16ba7c6d00f656fd4ceb84cb28f", "score": "0.50297606", "text": "function goLevel2(player, doorTrigger) {\n if (hasKey == true) {\n console.log('pre-start')\n this.scene.stop('level1');\n this.scene.start(\"level2\");\n console.log('post-start');\n highscore += 25;\n }\n}", "title": "" }, { "docid": "a8e76b9e95a73eed1251741606528f55", "score": "0.50242203", "text": "function NextLevel() {\n level++;\n if (level > 3) {\n this.game.destroy();\n FinDePartie(this.game, true);\n } else {\n this.scene.restart();\n }\n }", "title": "" }, { "docid": "0c8d10a4c79f95ba2d1346dd89ac6e50", "score": "0.50161666", "text": "function changeTextureBack(){\n if(powerLevel == 0){\n player.loadTexture('ship', 0);\n }\n if(powerLevel == 1){\n player.loadTexture('ship2', 0);\n }\n if(powerLevel == 2){\n player.loadTexture('ship3', 0);\n }\n}", "title": "" }, { "docid": "ad987f49b38dafd8991d4b740521f10f", "score": "0.50144124", "text": "function levelUp() {\n win++;\n if (win < 4) {\n $('.win').html(`${win}`);\n }\n if (win === 4) {\n $winner.show();\n }\n }", "title": "" }, { "docid": "1feeac42df9b2130c2d2d74aeb4c393b", "score": "0.50141233", "text": "function C008_DramaClass_Theater_SetPose() {\n\n\t// Saves the current actor if needed\n\tvar CurActor = CurrentActor;\n\n\t// If the villain must be tied up\n\tif ((C008_DramaClass_Theater_GlobalStage == 250) && !ActorSpecificInBondage(C008_DramaClass_Theater_Villain)) {\t\t\n\t\tif (C008_DramaClass_Theater_Villain == \"Player\") {\n\t\t\tPlayerClothes(\"Underwear\");\n\t\t\tPlayerLockInventory(\"Rope\");\n\t\t\tPlayerLockInventory(\"ClothGag\");\n\t\t} else {\n\t\t\tCurrentActor = C008_DramaClass_Theater_Villain;\n\t\t\tActorSetCloth(\"Underwear\");\n\t\t\tActorAddInventory(\"Rope\");\n\t\t\tActorAddInventory(\"ClothGag\");\n\t\t}\n\t\tC008_DramaClass_Heroine_CurrentStage = 251;\n\t\tC008_DramaClass_Villain_CurrentStage = 251;\n\t\tC008_DramaClass_Damsel_CurrentStage = 251;\n\t}\n\n\t// If the heroine must be tied up\n\tif ((C008_DramaClass_Theater_GlobalStage == 280) && !ActorSpecificInBondage(C008_DramaClass_Theater_Heroine)) {\t\t\n\t\tif (C008_DramaClass_Theater_Heroine == \"Player\") {\n\t\t\tPlayerClothes(\"Underwear\");\n\t\t\tPlayerLockInventory(\"Rope\");\n\t\t\tPlayerLockInventory(\"ClothGag\");\n\t\t} else {\n\t\t\tCurrentActor = C008_DramaClass_Theater_Heroine;\n\t\t\tActorSetCloth(\"Underwear\");\n\t\t\tActorAddInventory(\"Rope\");\n\t\t\tActorAddInventory(\"ClothGag\");\n\t\t}\n\t\tC008_DramaClass_Heroine_CurrentStage = 251;\n\t\tC008_DramaClass_Villain_CurrentStage = 251;\n\t\tC008_DramaClass_Damsel_CurrentStage = 251;\n\t}\n\t\n\t// Assign the heroine pose depending on the stage\n\tvar HeroinePose = \"\";\n\tif (((C008_DramaClass_Theater_GlobalStage >= 110) && (C008_DramaClass_Theater_GlobalStage <= 220)) || (C008_DramaClass_Theater_GlobalStage == 270)) HeroinePose = \"Acting\";\n\tif ((C008_DramaClass_Theater_GlobalStage >= 230) && (C008_DramaClass_Theater_GlobalStage <= 250)) HeroinePose = \"Swordplay\";\n\tif ((HeroinePose != \"\") && ActorSpecificInBondage(C008_DramaClass_Theater_Heroine)) HeroinePose = \"\";\n\tActorSpecificSetPose(C008_DramaClass_Theater_Heroine, HeroinePose);\n\n\t// Assign the villain pose depending on the stage\n\tvar VillainPose = \"\";\n\tif (((C008_DramaClass_Theater_GlobalStage >= 110) && (C008_DramaClass_Theater_GlobalStage <= 220)) || (C008_DramaClass_Theater_GlobalStage == 240)) VillainPose = \"Acting\";\n\tif (((C008_DramaClass_Theater_GlobalStage >= 230) && (C008_DramaClass_Theater_GlobalStage <= 235)) || (C008_DramaClass_Theater_GlobalStage == 270) || (C008_DramaClass_Theater_GlobalStage == 280)) VillainPose = \"Swordplay\";\n\tif ((VillainPose != \"\") && ActorSpecificInBondage(C008_DramaClass_Theater_Villain)) VillainPose = \"\";\n\tActorSpecificSetPose(C008_DramaClass_Theater_Villain, VillainPose);\n\n\t// Assign the damsel pose depending on the stage\n\tvar DamselPose = \"\";\n\tif ((C008_DramaClass_Theater_GlobalStage >= 150) && (C008_DramaClass_Theater_GlobalStage < 300)) DamselPose = \"Acting\";\n\tif ((DamselPose != \"\") && ActorSpecificInBondage(C008_DramaClass_Theater_Damsel)) DamselPose = \"\";\n\tActorSpecificSetPose(C008_DramaClass_Theater_Damsel, DamselPose);\n\n\t// Sets the current actor back\n\tCurrentActor = CurActor;\n\t\n}", "title": "" }, { "docid": "654956a11c56418b3cb474f88d3d06c0", "score": "0.501052", "text": "function setDifficultyLevel(e) {\n const selectedLevel = e.target.dataset.level;\n let ballSpeed;\n\n switch (selectedLevel) {\n case 'ninja':\n ballSpeed = 12;\n break;\n case 'hard':\n ballSpeed = 9;\n break;\n default:\n ballSpeed = 5;\n break;\n }\n setBallSpeed(ballSpeed);\n toggleLevelOptions();\n showGameScreen();\n}", "title": "" }, { "docid": "3d0abf1a221b0c6f09ae1aef12e73eca", "score": "0.5010123", "text": "checkVisibility(){\n if(switchScene.scene.isVisible('SecondLevel')){\n activeScene = 'SecondLevel';\n }\n if(switchScene.scene.isVisible('GameScene')){\n activeScene = 'GameScene';\n }\n }", "title": "" }, { "docid": "ebcc7a118b16bcad0e2a6a6d134f1f3a", "score": "0.50045854", "text": "function activateSwitch(player, switch1) {\n switchDown = false;\n arrow.setVisible(true);\n arrow.anims.play('arrowUp', true);\n}", "title": "" }, { "docid": "be0ee40e6de153713a3a7ec4a9ff5b9c", "score": "0.5001579", "text": "function newLevel(lvl){\n switch(lvl){\n case 1:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 1\";\n document.getElementById(\"description\").innerHTML = \"Use the mouse or arrows to move<br />Left click or hit the space bar to change value\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: AND\"\n break;\n case 2:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 2\";\n document.getElementById(\"description\").innerHTML = \"Be careful, now there are AND gates with no possible solution.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: AND\"\n break;\n case 3:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 3\";\n document.getElementById(\"description\").innerHTML = \"Good job!<br />Now that you understand AND gates, let's try OR gates\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: OR\";\n break;\n case 4:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 4\";\n document.getElementById(\"description\").innerHTML = \"Be careful, now there are OR gates with no possible solution.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: OR\"\n break;\n case 5:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 5\";\n document.getElementById(\"description\").innerHTML = \"Let's see if you can handle both AND & OR gates at the same time.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: AND & OR\";\n break;\n case 6:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 6\";\n document.getElementById(\"description\").innerHTML = \"Now we're going to try NAND Gates.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: NAND<br />Need help with NAND gates? Take a look at the lesson page.\";\n break;\n case 7:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 7\";\n document.getElementById(\"description\").innerHTML = \"Let's see if you can handle those tricky gates again.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: NAND\";\n break;\n case 8:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 8\";\n document.getElementById(\"description\").innerHTML = \"Let's move onto NOR gates now. These are inverted OR gates.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: NOR\";\n break;\n case 9:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 9\";\n document.getElementById(\"description\").innerHTML = \"Now it is possible to have unsolvable NOR gates.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: NOR\";\n break;\n case 10:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 10\";\n document.getElementById(\"description\").innerHTML = \"Let's test out how well you know the new gates just introduced.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: NAND & NOR\";\n break;\n case 11:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 11\";\n document.getElementById(\"description\").innerHTML = \"You've now seen four types of logic gates. Can you handle all of them at once?\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: AND, OR, NAND & NOR<br />You may want to refresh on what you've learned.\";\n break;\n case 12:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 12\";\n document.getElementById(\"description\").innerHTML = \"This level introduces the XOR gate. This is a new gate.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: XOR<br />You may want to take a look at the lesson page.\";\n break;\n case 13:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 13\";\n document.getElementById(\"description\").innerHTML = \"This level consists of only XNOR gates. This is very similar to XOR gates.\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: XNOR.\";\n break;\n case 14:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 14\";\n document.getElementById(\"description\").innerHTML = \"This level will have both XOR and XNOR gates, be careful!\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: XOR & XNOR\";\n break;\n case 15:\n document.getElementById(\"levelNum\").innerHTML = \"LEVEL 15\";\n document.getElementById(\"description\").innerHTML = \"This level will truely test you boolean logic knowledge. All the gates you have learned!\";\n document.getElementById(\"gateType\").innerHTML = \"Gates: AND, OR, NAND, NOR, XOR & XNOR<br /> Good Luck!!\";\n break;\n\n }\n paused = true;\n \n document.getElementById(\"continue\").style.display = \"inline\";\n document.getElementById(\"help\").style.display = \"inline\";\n document.getElementById(\"newLevel\").style.display = \"inline\";\n document.getElementById(\"level\").innerHTML = \"Level: \" + lvl;\n}", "title": "" }, { "docid": "f7d5d9d9c77c3b558af05009c872446d", "score": "0.49978843", "text": "function GameLevel_03(level, time) {\n this.kHeroSprite = \"assets/hero_sprite.png\";\n this.kMinionSprite = \"assets/minion_sprite.png\";\n this.kPlatform = \"assets/platform.png\";\n this.kPlatformNormal = \"assets/platform_normal.png\";\n this.kWall = \"assets/wall.png\";\n this.kWallNormal = \"assets/wall_normal.png\";\n this.kParticle = \"assets/EMPPulse.png\";\n // Doors\n this.kDoorTop = \"assets/DoorInterior_Top.png\";\n this.kDoorBot = \"assets/DoorInterior_Bottom.png\";\n this.kDoorSleeve = \"assets/DoorFrame_AnimSheet.png\";\n\n this.kTnt = \"assets/Level3/bomba.png\"\n this.kButton = \"assets/DoorFrame_Button_180x100.png\";\n\n this.kLock = \"assets/sounds/lock.mp3\"\n this.kOpen = \"assets/sounds/open.mp3\"\n // specifics to the level\n this.kLevelFile = \"assets/\" + level + \"/\" + level + \".xml\"; // e.g., assets/Level1/Level1.xml\n this.kBg = \"assets/\" + level + \"/bg.png\";\n this.kBgNormal = \"assets/\" + level + \"/bg_normal.png\";\n this.kBgLayer = \"assets/\" + level + \"/bgLayer.png\";\n this.kBgLayerNormal = \"assets/\" + level + \"/bgLayer_normal.png\";\n\n // The camera to view the scene\n this.mCamera = null;\n this.mPeekCam = null;\n this.mShowPeek = false;\n this.t = time;\n this.mMsg = time ;\n this.mRestart = false;\n // the hero and the support objects\n this.mplatform = null;\n this.mTnt = null;\n this.mIllumHero = null;\n this.mGlobalLightSet = null;\n\n this.mThisLevel = level;\n this.mNextLevel = null;\n\n this.mLgtIndex = 2;\n this.mLgtRotateTheta = 0;\n\n this.mAllPlatforms = new GameObjectSet();\n this.mAllWalls = new GameObjectSet();\n this.mAllMinions = new GameObjectSet();\n this.mAllDoors = new GameObjectSet();\n this.mAllButtons = new GameObjectSet();\n}", "title": "" }, { "docid": "5ec2d588be190f49583c032e0ed46192", "score": "0.4996781", "text": "function OnTriggerEnter (other : Collider){\nif(levelNumber == 1){\nif(other.tag == \"Player\" && Globals.keyGet == true){\nApplication.LoadLevel(nextLevel); }\n}\n\nif(levelNumber == 2){\nif(other.tag == \"Player\" && Globals.keyGet2 == true){\nApplication.LoadLevel(nextLevel); }\n}\n\nif(levelNumber == 3){\nif(other.tag == \"Player\"){\nApplication.LoadLevel(nextLevel); }\n}\n\nif(levelNumber == 4){\nif(other.tag == \"Player\"){\nApplication.LoadLevel(nextLevel); }\n}\n\nif(levelNumber == 5){\nif(other.tag == \"Player\" && Globals.keyGetYellow == true){\nApplication.LoadLevel(nextLevel); \nGlobals.keyGetYellow = false; }\n}\n\nif(levelNumber == 6){\nif(other.tag == \"Player\" && Globals.keyGetYellow == true){\nApplication.LoadLevel(nextLevel); \nGlobals.keyGetYellow = false; }\n}\n\nif(levelNumber == 7){\nif(other.tag == \"Player\" && Globals.keyGetRed == true){\nApplication.LoadLevel(nextLevel); \nGlobals.keyGetRed = false; }\n}\n\nif(levelNumber == 8){\nif(other.tag == \"Player\" && Globals.keyGetRed == true && Globals.keyGetYellow == true){\nApplication.LoadLevel(nextLevel); \nGlobals.keyGetRed = false;\nGlobals.keyGetYellow = false; }\n}\n\nif(levelNumber == 9){\nif(other.tag == \"Player\"){\nApplication.LoadLevel(nextLevel); }\n}\n\n\n\n\n}//end of OnTriggerEnter", "title": "" }, { "docid": "c311af48c3e66284901b42fb8fdf500d", "score": "0.49948594", "text": "setLevel(level){\n this.level = level\n if (level > 0) this.showBuilding()\n }", "title": "" }, { "docid": "ea7f086a5a5eabd7414e0536870b7232", "score": "0.49934465", "text": "playFirstMicroaggression() {\n this.brokenness.lvl1.on = true;\n currentState = new FirstMicroAggression(); //Play first microaggression\n }", "title": "" }, { "docid": "89b50e1f25ef8e868891070dfd818087", "score": "0.499277", "text": "function levelUp(nextClass){\r\n\tif((nextClass == \"flag\" && riderOn) || (nextClass == \"princess\" && riderOn)){\r\n\r\n\t\t//check if the game has finished\r\n\t\tif(currentLevel + 1 < numLevels){\r\n\t\t\tdocument.getElementById(\"levelup\").style.display = \"block\";\r\n\t\t\tclearTimeout(currentAnimation);\r\n\t\t\tsetTimeout (function(){\r\n\t\t\t\tdocument.getElementById(\"levelup\").style.display = \"none\";\r\n\t\t\t\tcurrentLevel++;\r\n\t\t\t\tloadLevel();\r\n\t\t\t}, 1000);\r\n\t\t}else{\r\n\t\t\twin();\r\n\t\t}//else\t\t\t\r\n\t}//if\r\n}//levelUp", "title": "" }, { "docid": "6625810d5b97f1a8b5f3cded4f718413", "score": "0.49918962", "text": "function partTwo() {\n stageOne = false;\n stageTwo = true;\n controls.getObject().position.set(0, 0, 400);\n ghostOBJ.position.set(-100, -25, -620);\n\n}", "title": "" }, { "docid": "f7860c21bc2c4e5a3834aa56a131df40", "score": "0.49879858", "text": "levelStats() {\n // Level up\n if (this.tick > this.levelingRate && ~this.level < 5) {\n this.level++; // Increase level\n this.tick = 0; // Set as 0\n this.leveling = true; // Set state\n }\n\n // Update animations\n if (this.tick <= 1 && this.leveling) {\n if (this.level === 2) {\n this.heightRoofBase =\n HEIGHT_SMALL_HOUSE *\n (RATIO_ROOF_BASE_TENT +\n this.tick *\n (RATIO_ROOF_BASE_HOUSE -\n RATIO_ROOF_BASE_TENT));\n this.widthBase =\n WIDTH_BASE_TENT +\n this.tick * (WIDTH_BASE_HOUSE - WIDTH_BASE_TENT);\n this.widthRoof =\n WIDTH_BASE_TENT +\n this.tick * (WIDTH_ROOF_HOUSE - WIDTH_BASE_TENT);\n } else if (this.level === 3) {\n this.heightRoofTip =\n HEIGHT_SMALL_HOUSE +\n this.tick *\n (0.5 * (HEIGHT_BIG_HOUSE - HEIGHT_SMALL_HOUSE));\n } else if (this.level === 5) {\n this.heightRoofTip =\n 0.5 * (HEIGHT_BIG_HOUSE + HEIGHT_SMALL_HOUSE) +\n this.tick *\n (HEIGHT_BIG_HOUSE -\n 0.5 *\n (HEIGHT_BIG_HOUSE +\n HEIGHT_SMALL_HOUSE));\n this.widthBase =\n WIDTH_BASE_HOUSE +\n this.tick * (WIDTH_ROOF_HOUSE - WIDTH_BASE_HOUSE);\n }\n } else {\n this.leveling = false;\n }\n }", "title": "" }, { "docid": "fba46420c346093f935a45e9e266c0a6", "score": "0.49855253", "text": "function levelUp(){\r\n\tvar obj = playerObj;\r\n\tvar hpScale = obj.hpParam / baseStats.div;\r\n\tvar mpScale = obj.mpParam / baseStats.div;\r\n\tvar atkScale = obj.atkParam / baseStats.div;\r\n\tvar defScale = obj.defParam / baseStats.div;\r\n\tvar magScale = obj.magParam / baseStats.div;\r\n\tvar resScale = obj.resParam / baseStats.div;\r\n\r\n\tvar scaleCheck = [hpScale, mpScale, atkScale, defScale, magScale, resScale];\r\n\tconsole.table(scaleCheck);\r\n\r\n\tobj.health = obj.health + Math.floor(baseStats[\"hp\"] * scaleCheck[0]);\r\n\tobj.mana = obj.mana + Math.floor(baseStats[\"mp\"] * scaleCheck[1]);\r\n\tobj.attack = obj.attack + Math.floor(baseStats[\"atk\"] * scaleCheck[2]);\r\n\tobj.defense = obj.defense + Math.floor(baseStats[\"def\"] * scaleCheck[3]);\r\n\tobj.magic = obj.magic + Math.floor(baseStats[\"mag\"] * scaleCheck[4]);\r\n\tobj.resistance = obj.resistance + Math.floor(baseStats[\"res\"] * scaleCheck[5]);\r\n\tobj.level = obj.level + 1;\r\n\r\n\tupdateStats();\r\n\tupdatePoints();\r\n}", "title": "" }, { "docid": "306501924f175ef9d127ef4edf984ace", "score": "0.49718946", "text": "function SwitchToHeroPreview( heroName ) {\n\tvar previewPanel = $.CreatePanel(\"Panel\", $('#PostPickScreen'), \"HeroPreview\");\n\tpreviewPanel.BLoadLayoutFromString('<root><Panel><DOTAScenePanel style=\"width:100%; height:100%;\" particleonly=\"false\" unit=\"'+heroName+'\"/></Panel></root>', false, false );\n\tpreviewPanel.style.opacityMask = 'url(\"s2r://panorama/images/masks/hero_model_opacity_mask_png.vtex\");'\n\n\t// Hide/show relevant panels\n\t$('#PostPickScreen').style.visibility = 'visible';\n\t$('#PostPickScreenButtonContainer').style.visibility = 'visible';\n\n\t$(\"#CustomPickList\").style.visibility = 'collapse';\n\t$(\"#PickHeroBtn\").style.visibility = 'collapse';\n\t$('#PickList').style.visibility = 'collapse';\n\t$('#PickedHeroPanel').style.visibility = 'collapse';\t\n\t$('#WelcomePanel').style.visibility = 'collapse';\n}", "title": "" }, { "docid": "065021f4ed928e400a47ed80df4512d1", "score": "0.49659225", "text": "enterBase(play1, play2){\n play1.functions.addScore(3);\n play1.functions.respawn();\n play2.functions.setBaseOpen(false);\n if(play1 == gameState.player1){\n this.loadLevel(-1)\n }\n else{\n this.loadLevel(1)\n }\n if (gameState.player1.turret){\n gameState.p1turret.changeMatrix(gameState.levels[gameState.levelNum].passMatrix());\n }\n if (gameState.player2.turret){\n gameState.p2turret.changeMatrix(gameState.levels[gameState.levelNum].passMatrix());\n }\n }", "title": "" }, { "docid": "ea9c3973e381e06a2a7674730d59d59c", "score": "0.49656755", "text": "function ChangeDirection(NewDirection){\n // this will again localise a verison of the player object\n Spider = Spiderman;\n //this will make sure that it only runs when the new direction is not equal to the old direction this means the player has started moving in a new direction\n if (NewDirection !== LastDirection){\n // if the new direction is 0 it will use the spiderman up gif \n if (NewDirection === 0) {\n SpiderImg.src = \"Images/spiderU.gif\"\n //and set the directions to be equal\n LastDirection = NewDirection;}\n // if the new direction is 1 it will use the spiderman right gif \n if (NewDirection === 1){\n SpiderImg.src = \"Images/spiderR.gif\"\n //and set the directions to be equal\n LastDirection = NewDirection;}\n // if the new direction is 2 it will use the spiderman down gif \n if (NewDirection === 2) {\n SpiderImg.src = \"Images/spiderD.gif\"\n //and set the directions to be equal\n LastDirection = NewDirection;}\n // if the new direction is 3 it will use the spiderman left gif \n if (NewDirection === 3) {\n SpiderImg.src = \"Images/spiderL.gif\"\n //and set the directions to be equal\n LastDirection = NewDirection;}}}", "title": "" }, { "docid": "92f6ba71ef673ff91f978ca47c2a1985", "score": "0.4960531", "text": "function Level() {\n var value;\n \n function levelOne(){\n random();\n console.log(value);\n return oneLevel[value];\n };\n var random = function (params) {\n min = Math.ceil(0);\n max = Math.floor(2);\n value = Math.floor(Math.random() * (max - min)) + min;\n }\n\n var level1 = [[1, 1, 1, 1, 1, 1, 1, 1],\n [1, 1, 1, 2, 2, 2, 1, 1],\n [1, 6, 2, 5, 3, 2, 1, 1],\n [1, 1, 1, 2, 4, 3, 1, 1],\n [1, 1, 1, 1, 4, 2, 1, 1],\n [1, 2, 1, 2, 2, 2, 1, 1],\n [1, 4, 7, 5, 4, 4, 1, 1],\n [1, 2, 2, 2, 2, 2, 2, 1],\n [1, 1, 1, 1, 1, 1, 1, 1]];\n\n var level2 = [[1, 1, 1, 1, 1, 1, 1, 1],\n [1, 1, 1, 2, 2, 3, 3, 1],\n [1, 1, 1, 1, 2, 2, 1, 1],\n [1, 1, 1, 2, 4, 7, 1, 1],\n [1, 1, 1, 2, 4, 2, 1, 1],\n [1, 2, 2, 5, 2, 2, 1, 1],\n [1, 1, 5, 1, 4, 4, 1, 1],\n [1, 2, 2, 6, 2, 2, 2, 1],\n [1, 1, 1, 1, 1, 1, 1, 1]];\n\n var level3 = [[1, 1, 1, 1, 1, 1, 1, 1],\n [1, 1, 1, 2, 2, 3, 3, 1],\n [1, 1, 1, 1, 2, 2, 1, 1],\n [1, 1, 1, 2, 4, 7, 1, 1],\n [1, 1, 1, 2, 4, 2, 1, 1],\n [1, 2, 2, 5, 2, 2, 1, 1],\n [1, 1, 5, 1, 4, 4, 1, 1],\n [1, 2, 2, 6, 2, 2, 2, 1],\n [1, 1, 1, 1, 1, 1, 1, 1]];\n\n var levelTwo = [[1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1],\n [1, 3, 3, 2, 2, 1, 2, 1, 1, 6, 1],\n [1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1],\n [1, 3, 3, 2, 2, 2, 2, 2, 4, 4, 1],\n [1, 2, 2, 2, 2, 1, 2, 1, 2, 4, 1],\n [1, 2, 2, 1, 1, 1, 2, 1, 5, 4, 1],\n [1, 1, 1, 1, 2, 5, 2, 1, 2, 2, 1],\n [2, 2, 2, 1, 2, 2, 4, 1, 2, 4, 1],\n [2, 2, 2, 1, 2, 5, 2, 2, 5, 2, 1],\n [2, 2, 2, 1, 2, 2, 1, 7, 2, 2, 1],\n [2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1]];\n var oneLevel = new Array(level1, level2,level3);\n\n function getMap (itemLevel) {\n switch (itemLevel) {\n case 1:\n return levelOne();\n case 2:\n return levelTwo;\n }\n }\n function getLegth(itemLevel) {\n switch (itemLevel) {\n case 1:\n return oneLevel[value].length;\n case 2:\n return levelTwo.length;\n default:\n return 0;\n }\n }\n this.getMap = getMap;\n this.getLegth = getLegth;\n\n }", "title": "" }, { "docid": "0dd365f7395bd74341cc2475ab7b108b", "score": "0.49602914", "text": "function startOver() {\n level = 0;\n gamePattern = [];\n toggle = false;\n\n}", "title": "" }, { "docid": "bacc374ac19ed75f42c9a338f6e2eaee", "score": "0.49583712", "text": "function LevelSelection () {\n\n\tApplication.LoadLevel(0);\n}", "title": "" }, { "docid": "8e9085dcf9927428ad6da25eebbbba42", "score": "0.49577639", "text": "setSwitchLevel(message) {\n const level = message\n this.debug(`Received set switch level to ${level}%`)\n if (isNaN(message)) {\n this.debug('Brightness command received but not a number!')\n } else if (!(message >= 0 && message <= 100)) {\n this.debug('Brightness command received but out of range (0-100)!')\n } else {\n this.device.setInfo({ device: { v1: { level: level / 100 } } })\n }\n }", "title": "" }, { "docid": "a78ba684ff505b842f8ac10bb08be546", "score": "0.4957117", "text": "setAudioLevel(id, lvl) {\n let smallVideo = this.getSmallVideo(id);\n if (smallVideo)\n smallVideo.updateAudioLevelIndicator(lvl);\n\n if (largeVideo && id === largeVideo.id)\n largeVideo.updateLargeVideoAudioLevel(lvl);\n }", "title": "" }, { "docid": "d525cd0256e1b91543c1fd2bfb702075", "score": "0.4949032", "text": "function resetLevel() {\r\n var data, px, py, num;\r\n\r\n // Initialize level from data\r\n data = levelData[ level ];\r\n\r\n px = data.player_x;\r\n py = data.player_y;\r\n\r\n // Turn on fades\r\n PS.fade( PS.ALL, PS.ALL, FADE_RATE );\r\n PS.borderFade( PS.ALL, PS.ALL, FADE_RATE );\r\n\r\n // Set play to true when player bead color is done fading in\r\n PS.fade( px, py, FADE_RATE, { onEnd: playTrue } );\r\n\r\n // Color map\r\n colorMap( data.level_map );\r\n\r\n // Get number for color of bead where player bead will be\r\n num = data.level_map[ ( py * GRID_WIDTH ) + px ];\r\n\r\n // Place player bead\r\n placePlayer( px, py, data.player_color, num );\r\n\r\n // Set up goal\r\n setGoal( data.goal_x, data.goal_y, data.goal_color );\r\n }", "title": "" }, { "docid": "be761f68ce1e98a32b826fc7470ecdf2", "score": "0.49468425", "text": "transitionStretch() {\n console.log('low pitched grumble');\n let {dogThoughts} = this;\n setTimeout(() => { this.switchState(IDLE); }, randrange(3000, 6000));\n }", "title": "" }, { "docid": "72faa10559ad0791f33220b8d98fc7e7", "score": "0.4946316", "text": "function SetObjectsActive(act:boolean)\n\t{\n\t\tobj1.SetActiveRecursively(act);\n\t\tobj2.SetActiveRecursively(act);\n\t\tsubtitle.gameObject.SetActiveRecursively(act);\n swipeToContinue.gameObject.SetActiveRecursively(act);\n\t}", "title": "" }, { "docid": "1f69e3c3d6edd5ac2eb1c32be2d3f581", "score": "0.49460825", "text": "function switchScene(evt) {\n evt.preventDefault();\n index = (index + 1) % scenes.length;\n cur_prog = scenes[index][0];\n m_loc = scenes[index][1];\n cull = scenes[index][2];\n}", "title": "" }, { "docid": "1d701ca66c6f87400b67da0ae0da3fde", "score": "0.49372944", "text": "function changeGameLevel(level) {\n difficultyLevel = level;\n startGame();\n }", "title": "" }, { "docid": "55a039fdd32a42a30d424ab855744f06", "score": "0.49367774", "text": "function loadLevel () {\n // UPDATE THE CURRENT LEVEL\n level = levels[levelCounter - 1];\n\n // CALL RESET FUNCTION\n reset();\n }", "title": "" }, { "docid": "870cd7eb07e3132d7250dc20f9530ffe", "score": "0.49336445", "text": "function setupLevel() {\n\t\t// increment level number and set up level variables\n\t\t++currentLevel;\n\t\tscreenX = (LEVEL_WIDTH*TERRAIN_WIDTH)/2 - canvas.width/2; // center screen on level\n\t\t\n\t\t//== Reset entities ==//\n\t\tenemies = [];\n\t\tparticles = [];\n\t\tparticleSystems = [];\n\t\tprojectiles = [];\n\t\tlightSources = [];\n\t\twaystones = [];\n\t\t\n\t\t//== Prepare the level ==//\n\t\t// Assign biome IDs //{\n\t\t// Map goes bog > forest > tower clearing < mountain < cave\n\t\t// can be flipped randomly per game, just for a little variance\n\t\tif (Math.round(Math.random()) === 0) {\n\t\t\tbiome0 = BIOME.BOG;\n\t\t\tbiome1 = BIOME.FOREST;\n\t\t\tbiome3 = BIOME.MOUNTAIN;\n\t\t\tbiome4 = BIOME.CAVE;\n\t\t\tBIOME.BOG.id = 0;\n\t\t\tBIOME.FOREST.id = 1;\n\t\t\tBIOME.MOUNTAIN.id = 3;\n\t\t\tBIOME.CAVE.id = 4;\n\t\t}\n\t\telse {\n\t\t\tbiome0 = BIOME.CAVE;\n\t\t\tbiome1 = BIOME.MOUNTAIN;\n\t\t\tbiome3 = BIOME.FOREST;\n\t\t\tbiome4 = BIOME.BOG;\n\t\t\tBIOME.CAVE.id = 0;\n\t\t\tBIOME.MOUNTAIN.id = 1;\n\t\t\tBIOME.FOREST.id = 3;\n\t\t\tBIOME.BOG.id = 4;\n\t\t}\n\t\t//}\n\t\t// Generate level grid //{\n\t\tfor (var i = 0; i < LEVEL_WIDTH; ++i) {\n\t\t\t// get % across level\n\t\t\tvar lerp = i/LEVEL_WIDTH;\n\t\t\t\n\t\t\t// Biome 0\n\t\t\tif (lerp < 0.2)\n\t\t\t\tworld[i] = 0;\n\t\t\t// 0-1 transition\n\t\t\tif (lerp >= 0.2 && lerp < 0.25)\n\t\t\t\tworld[i] = (lerp - 0.2)/0.05;\n\t\t\t// Biome 1\n\t\t\tif (lerp >= 0.25 && lerp < 0.425)\n\t\t\t\tworld[i] = 1;\n\t\t\t// 1-2 transition\n\t\t\tif (lerp >= 0.425 && lerp < 0.475)\n\t\t\t\tworld[i] = 1 + (lerp-0.425)/0.05;\n\t\t\t// Biome 2 (clearing)\n\t\t\tif (lerp >= 0.475 && lerp < 0.525)\n\t\t\t\tworld[i] = 2;\n\t\t\t// 2-3 transition\n\t\t\tif (lerp >= 0.525 && lerp < 0.575)\n\t\t\t\tworld[i] = 2 + (lerp-0.525)/0.05;\n\t\t\t// Biome 3\n\t\t\tif (lerp >= 0.575 && lerp < 0.75)\n\t\t\t\tworld[i] = 3;\n\t\t\t// 1-2 transition\n\t\t\tif (lerp >= 0.75 && lerp < 0.8)\n\t\t\t\tworld[i] = 3 + (lerp-0.75)/0.05;\n\t\t\t// Biome 4\n\t\t\tif (lerp >= 0.8)\n\t\t\t\tworld[i] = 4;\n\t\t\t\t\n\t\t\t//== Attempt to create game objects at each tile\n\t\t\t// get the biome object\n\t\t\tvar biome = biomeFromID(Math.round(world[i]));\n\t\t\tfor (var key in OBJECT) {\n\t\t\t\t// rule out base object properties\n\t\t\t\tif (OBJECT.hasOwnProperty(key)) {\n\t\t\t\t\t// 1) check if the object can spawn in this biome\n\t\t\t\t\t// 2) do a random number check against its spawn chance\n\t\t\t\t\tif (OBJECT[key].randomBiomes.indexOf(biome) != -1 && Math.random() < OBJECT[key].spawnChance) {\n\t\t\t\t\t\t// create the new object\n\t\t\t\t\t\tobjects.push(new WorldObject(OBJECT[key], Victor(i*TERRAIN_WIDTH, TERRAIN_HEIGHT)));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get how many objects should spawn - at least 1, maybe more if they spawn in groups\n\t\t\t\t\t\tvar numObjects = 1;\n\t\t\t\t\t\tif (OBJECT[key].spawnInGroups >= 1.5) {\n\t\t\t\t\t\t\tnumObjects = Math.round(rand(1, OBJECT[key].spawnInGroups));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// loop and create objects\n\t\t\t\t\t\tvar groupStart = (i*TERRAIN_WIDTH) - (numObjects*(OBJECT[key].img.width/OBJECT[key].xTiles))/2;\n\t\t\t\t\t\tfor (var x = 0; x < numObjects; ++x) {\n\t\t\t\t\t\t\tobjects.push(new WorldObject(OBJECT[key], Victor(groupStart + x*(OBJECT[key].img.width/OBJECT[key].xTiles), TERRAIN_HEIGHT)));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//}\n\t\t// Create waystones //{\n\t\t//== Biome0 waystones\n\t\twaystones.push(new Waystone(biome0.WAYSTONE, Victor(levelWidth()*0.01 - biome0.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome0.WAYSTONE.img.height/2)));\n\t\twaystones.push(new Waystone(biome0.WAYSTONE, Victor(levelWidth()*0.485 - biome0.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome0.WAYSTONE.img.height/2)));\n\t\t//== Biome1 waystones\n\t\twaystones.push(new Waystone(biome1.WAYSTONE, Victor(levelWidth()*0.26 - biome1.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome1.WAYSTONE.img.height/2)));\n\t\twaystones.push(new Waystone(biome1.WAYSTONE, Victor(levelWidth()*0.49 - biome1.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome1.WAYSTONE.img.height/2)));\n\t\t// Skip biome2 - it's always the clearing!\n\t\t//== Biome3 waystones\n\t\twaystones.push(new Waystone(biome3.WAYSTONE, Victor(levelWidth()*0.74 - biome3.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome3.WAYSTONE.img.height/2)));\n\t\twaystones.push(new Waystone(biome3.WAYSTONE, Victor(levelWidth()*0.51 - biome3.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome3.WAYSTONE.img.height/2)));\n\t\t//== Biome4 waystones\n\t\twaystones.push(new Waystone(biome4.WAYSTONE, Victor(levelWidth()*0.99 - biome4.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome4.WAYSTONE.img.height/2)));\n\t\twaystones.push(new Waystone(biome4.WAYSTONE, Victor(levelWidth()*0.515 - biome4.WAYSTONE.img.width/2, TERRAIN_HEIGHT - biome4.WAYSTONE.img.height/2)));\n\t\t//== Make all waystones find their pair\n\t\tfor (var i = 0; i < waystones.length; ++i) waystones[i].getOther();\n\t\t//}\n\t\t// Create tower //\n\t\twizardTower = new WizardTower();\n\t\t\n\t\t//== Begin enemy spawn loop ==//\n\t\tenemyLoop = setInterval(function() {\n\t\t\t// get the current biome at the player\n\t\t\tvar biomeCurrent = biomeFromID(Math.round(biomeAt(player.position)));\n\t\t\t\n\t\t\t// get the number of enemies on screen\n\t\t\tvar numOnScreen = 0;\n\t\t\tfor (var i = 0; i < enemies.length; ++i)\n\t\t\t\tif (onScreen(enemies[i])) ++numOnScreen;\n\t\t\t\n\t\t\t// attempt to spawn an enemy\n\t\t\tif (numOnScreen < 15 && biomeCurrent.enemies.length > 0 && inControl()) {\n\t\t\t\tenemies.push(new Enemy(biomeCurrent.enemies.randomElement()));\n\t\t\t}\n\t\t}, 1700);\n\t\t\n\t\t//== Prepare UI ==//\n\t\tactivateHUD();\n\t\t\n\t\t// Begin running!\n\t\tcurrentGameState = GAME_STATE.IDLE;\n\t}", "title": "" }, { "docid": "8afb9a85d9c6a138223203715ea67863", "score": "0.49320728", "text": "reset() {\n this.scene.tweens.add({\n targets: this.scene.blackScreen,\n alpha: 1,\n ease: 'Linear',\n duration: 500,\n repeat: 0,\n yoyo: false,\n onComplete: () => { \n // Read original level JSON file, reset level\n let rawData = this.scene.cache.json.get(this.params.name);\n\n // reset ghost\n if(this.scene.ghost.isPossessing) {\n this.scene.ghost.unpossess();\n }\n this.scene.ghost.paranormalStrengthCurr = 50;\n this.scene.ghost.setPosition(rawData.params.center.x + this.params.x0, rawData.params.center.y + this.params.y0);\n \n // reset kid\n this.scene.kid.setPosition(this.params.x0 + rawData.params.entrance.x, this.params.y0 + this.background.height - 2 * this.params.borderWidth);\n this.scene.kid.params.scareLevelCurr = 25;\n this.scene.kid.params.isMoving = false;\n this.scene.kid.params.isScared = false;\n this.scene.kid.params.distance = 0;\n this.scene.kid.isCropped = false;\n this.scene.kid.alpha = 1;\n this.scene.kid.shiverTimer.paused = true;\n \n // reset scare objects\n for(let i = 0; i < this.scareGroup.length; ++i ) {\n this.scareGroup[i].cooldown = false;\n }\n \n // reset move objects\n for(let i = 0; i < rawData.moveObjects.length; ++i ) {\n this.moveGroup[i].setPosition(this.params.x0 + rawData.moveObjects[i].position.x, \n this.params.y0 + rawData.moveObjects[i].position.y);\n this.moveGroup[i].setScale(rawData.moveObjects[i].scale);\n this.moveGroup[i].setRotation(0);\n this.moveGroup[i].setVelocity(0);\n }\n\n // fade back in after .5 seconds\n this.scene.tweens.add({\n delay: 500,\n targets: this.scene.blackScreen,\n alpha: 0,\n ease: 'Linear',\n duration: 500,\n repeat: 0,\n yoyo: false,\n });\n }\n });\n }", "title": "" }, { "docid": "6250199f97d5525626bbdab22312255b", "score": "0.4926748", "text": "playFourthMicroaggression() {\n this.brokenness.lvl4.on = true;\n currentState = new FourthMicroAggression();\n }", "title": "" }, { "docid": "942c93a6715e7858ce63b076101b8ff0", "score": "0.49229133", "text": "function transmute() {\n enemy[enemyIndex].health--;\n enemy[enemyIndex].hits++;\n enemy[enemyIndex].health += addMods();\n displayHealth();\n displayHits();\n disableButtons();\n}", "title": "" }, { "docid": "e421364264d1268b6b75b46f8fd96fb6", "score": "0.49210945", "text": "async setLevel(newPage, newGroup) {\n this.state.currentSettings.page = newPage;\n this.state.currentSettings.group = newGroup;\n this.loadData();\n }", "title": "" }, { "docid": "5368f1b136958a3e6236c2e952757bd4", "score": "0.49207437", "text": "function mousePressed() {\n\t// change scene \n\t// scene order: beach, ocean, island\n\tif (currentSetting == \"outside\") {\n\n\t\t// change setting\n\t\tcurrentSetting = \"ot\";\n\n\t\t// update story\n\t\tstory = \"Mr.lair see jerry house to go tell a lie for fun so he can get a joke out off it .\";\n\n\t\t// update characters position\n\t\tmrlairX = 400;\n\t\tjerryX = 500;\n\n\t} else if (currentSetting == \"talk\") {\n\t\tcurrentSetting = \"outside\";\n\t\tstory = \"mr.lester and Jerry went to talk and mr.lair went and told his lie which upset jerry.\";\n\n\t\t\n jerryX = 100;\n\t\tmrlairX = 300;\n\t}\n\n}", "title": "" }, { "docid": "85f9a3ada4963310370b58e3ea27abb2", "score": "0.4919524", "text": "startNextLevel() {\n this.updateGameStats();\n this.backgroundEngine.updateBackgroundStats();\n this.reset();\n }", "title": "" }, { "docid": "4bcfed2d82d41ac590d72939cb77ba48", "score": "0.49189878", "text": "function init() {\n switchLevel = false;\n $.get(\"/init\", { uuid: uuid }, function (data) {\n setTimeout(function() {\n data = JSON.parse(data);\n heart = data.maxLives;\n setLivesImg();\n\n score = data.currentScore;\n setScore();\n\n animationFrame = 1;\n bigDotFrame = 0;\n\n setMenu(data.levelCount, data.isZoomAvailable, data.numberOfGhosts, data.maxLives);\n\n loadWall(data.levelInstance.walls);\n loadDots(data.levelInstance.dots);\n loadBigDots(data.levelInstance.bigDots);\n loadGhosts(data.ghosts);\n loadPacman(data.pacman);\n loadFruits(data.levelInstance.fruits);\n if (data.isZoomAvailable) {\n loadZoom(data.levelInstance.zoom);\n }\n }, 300);\n });\n}", "title": "" }, { "docid": "296e46a6d3e7747711070ae51bb29b70", "score": "0.4918752", "text": "switchPlayer() {\n const firstOut = this.skins.shift();\n this.skins.push(firstOut);\n this.sprite = `images/${this.skins[0]}.png`;\n }", "title": "" } ]
df3ed6e6c5b4e1ae1395bf152c7c1d51
; public static const TOOLBAR_DARK_GROUPED:ButtonSkin =
[ { "docid": "a386e1418385b62e41b8fc063d6c348c", "score": "0.84559894", "text": "function TOOLBAR_DARK_GROUPED$static_(){ButtonSkin.TOOLBAR_DARK_GROUPED=( new ButtonSkin(ButtonSkin.TOOLBAR_DARK.getSkin() + \"-grouped\"));}", "title": "" } ]
[ { "docid": "8334f58a1f6e7d96357bd464f1ef169f", "score": "0.87447524", "text": "function TOOLBAR_DARK$static_(){ButtonSkin.TOOLBAR_DARK=( new ButtonSkin(\"toolbar-dark\"));}", "title": "" }, { "docid": "565148fdb3b38c4340686426a1b4b15c", "score": "0.8268171", "text": "function TOOLBAR$static_(){ButtonSkin.TOOLBAR=( new ButtonSkin(\"toolbar\"));}", "title": "" }, { "docid": "900455ce6f2ce52e0eb625c114d515ec", "score": "0.7805307", "text": "function TOOLBAR_GROUPED$static_(){ButtonSkin.TOOLBAR_GROUPED=( new ButtonSkin(ButtonSkin.TOOLBAR.getSkin() + \"-grouped\"));}", "title": "" }, { "docid": "8ca1dd57fd6114305e0b082141e5e9a8", "score": "0.7704365", "text": "function VIVID_TOOLBAR$static_(){ButtonSkin.VIVID_TOOLBAR=( new ButtonSkin(\"vivid-toolbar\"));}", "title": "" }, { "docid": "2faa37d53a25f8e3f00670d4741c4d33", "score": "0.7579604", "text": "function DEFAULT$static_(){ButtonSkin.DEFAULT=( new ButtonSkin(\"default\"));}", "title": "" }, { "docid": "e46c32c1885a4e9872cab97d6871f282", "score": "0.75129473", "text": "function HIGHLIGHT$static_(){ButtonSkin.HIGHLIGHT=( new ButtonSkin(\"highlight\"));}", "title": "" }, { "docid": "8edd859633e658a4296641e57aee6bf3", "score": "0.7284759", "text": "function SIMPLE$static_(){ButtonSkin.SIMPLE=( new ButtonSkin(\"simple\"));}", "title": "" }, { "docid": "636f9a2dff6df29e385cfa444c352943", "score": "0.71849924", "text": "function SIMPLE_HIGHLIGHT$static_(){ButtonSkin.SIMPLE_HIGHLIGHT=( new ButtonSkin(\"simple-highlight\"));}", "title": "" }, { "docid": "d65e3a3361be711fd51163ca6f5b8a2c", "score": "0.70531166", "text": "function WORKAREA$static_(){ButtonSkin.WORKAREA=( new ButtonSkin(\"workarea\", 'The buttons with this skin are used in workareas.'));}", "title": "" }, { "docid": "aa417b5cf1f2a1cc03d09a1b69d75710", "score": "0.70125777", "text": "function MAIN_NAVIGATION$static_(){ButtonSkin.MAIN_NAVIGATION=( new ButtonSkin(\"main-navigation\"));}", "title": "" }, { "docid": "8802098f50b00bd7df4543cdf402b94b", "score": "0.69713175", "text": "function LOGO$static_(){ButtonSkin.LOGO=( new ButtonSkin(\"logo\"));}", "title": "" }, { "docid": "0c256d6a608989efc4b7d909dc683fac", "score": "0.67815614", "text": "function _____GX_BUTTONS_CLASS() {} // [DELETELINE]", "title": "" }, { "docid": "a8ff2d888db2a3a5a1e6b86b9443807e", "score": "0.67800736", "text": "function BREADCRUMB$static_(){ButtonSkin.BREADCRUMB=( new ButtonSkin(\"breadcrumb\"));}", "title": "" }, { "docid": "432c0d8849596b5838e205e286bd6d30", "score": "0.6734334", "text": "function values$static_(){ButtonSkin.values=( com.coremedia.ui.util.Enum.collectValues(ButtonSkin));}", "title": "" }, { "docid": "909f9ae78d98e3880ce9aa759f0fc1ac", "score": "0.66615975", "text": "function INLINE$static_(){ButtonSkin.INLINE=( new ButtonSkin(\"inline\"));}", "title": "" }, { "docid": "230a7b34022141d9cceb9939ffee5d96", "score": "0.6602169", "text": "function USER_MENU$static_(){ButtonSkin.USER_MENU=( new ButtonSkin(\"user-menu\"));}", "title": "" }, { "docid": "559478fd682be7a23fa53a27cbf4e164", "score": "0.6583691", "text": "function FOOTER_PRIMARY$static_(){ButtonSkin.FOOTER_PRIMARY=( new ButtonSkin(\"footer-primary\"));}", "title": "" }, { "docid": "6d86c4b90fa065d03cffcbfcde7200ee", "score": "0.64722764", "text": "static GetBuiltinSkin() {}", "title": "" }, { "docid": "ee49bf107c0ecfcb1e299248e0a90ecf", "score": "0.6383556", "text": "function WORKAREA_LIGHT$static_(){TabBarSkin.WORKAREA_LIGHT=( new TabBarSkin(\"workarea-light\"));}", "title": "" }, { "docid": "38e2d7b144c9ee79fc08999d847bccb9", "score": "0.63327193", "text": "function DEFAULT$static_(){TabBarSkin.DEFAULT=( new TabBarSkin(\"default\"));}", "title": "" }, { "docid": "cfb3a4d54e530184ccade8cdf3184a07", "score": "0.62685215", "text": "function LINK$static_(){ButtonSkin.LINK=( new ButtonSkin(\"link\"));}", "title": "" }, { "docid": "c1c85674383ced81099352909e2c3781", "score": "0.6263876", "text": "function LIGHT$static_(){LabelableSkin.LIGHT=( new LabelableSkin(\"light\"));}", "title": "" }, { "docid": "b1427d39a7303f217a4c5a1216b4e69d", "score": "0.62524134", "text": "function VIVID$static_(){ButtonSkin.VIVID=( new ButtonSkin(\"vivid\"));}", "title": "" }, { "docid": "d19b20080f1d903348509f472aac3904", "score": "0.6229339", "text": "function MakeButtonStyle(component)\n{\n var BS_DEFPUSHBUTTON= 0x00000001;\n var BS_CHECKBOX= 0x00000002;\n var BS_AUTOCHECKBOX= 0x00000003;\n var BS_RADIOBUTTON= 0x00000004;\n var BS_3STATE= 0x00000005;\n var BS_AUTO3STATE= 0x00000006;\n var BS_GROUPBOX= 0x00000007;\n var BS_USERBUTTON= 0x00000008;\n var BS_AUTORADIOBUTTON= 0x00000009;\n var BS_OWNERDRAW= 0x0000000B;\n var BS_LEFTTEXT= 0x00000020;\n var BS_ICON= 0x00000040;\n var BS_BITMAP= 0x00000080;\n var BS_LEFT= 0x00000100;\n var BS_RIGHT= 0x00000200;\n var BS_CENTER= 0x00000300;\n var BS_TOP= 0x00000400;\n var BS_BOTTOM= 0x00000800;\n var BS_VCENTER= 0x00000C00;\n var BS_PUSHLIKE= 0x00001000;\n var BS_MULTILINE= 0x00002000;\n var BS_NOTIFY= 0x00004000;\n var BS_FLAT= 0x00008000;\n\n var style=parseInt(component.Item(\"InternalWindowStyle\"),10);\n var styleStr=MakeWindowStyle(component);\n \n if ( (style & 0x0000000F) == BS_DEFPUSHBUTTON )\n styleStr+=\"|BS_DEFPUSHBUTTON\";\n\n if ( (style & 0x0000000F)== BS_CHECKBOX )\n styleStr+=\"|BS_CHECKBOX\";\n\n if ( (style & 0x0000000F)== BS_AUTOCHECKBOX )\n styleStr+=\"|BS_AUTOCHECKBOX\";\n\n if ( (style & 0x0000000F)== BS_RADIOBUTTON )\n styleStr+=\"|BS_RADIOBUTTON\";\n\n if ( (style & 0x0000000F)== BS_3STATE )\n styleStr+=\"|BS_3STATE\";\n\n if ( (style & 0x0000000F)== BS_AUTO3STATE )\n styleStr+=\"|BS_AUTO3STATE\";\n\n if ( (style & 0x0000000F)== BS_GROUPBOX )\n styleStr+=\"|BS_GROUPBOX\";\n\n if ( (style & 0x0000000F)== BS_USERBUTTON )\n styleStr+=\"|BS_USERBUTTON\";\n\n if ( (style & 0x0000000F)== BS_AUTORADIOBUTTON )\n styleStr+=\"|BS_AUTORADIOBUTTON\";\n\n if ( (style & 0x0000000F)== BS_OWNERDRAW )\n styleStr+=\"|BS_OWNERDRAW\";\n\n if ( (style & 0x000000F0)==BS_LEFTTEXT )\n styleStr+=\"|BS_LEFTTEXT\";\n\n if ( (style & BS_ICON)==BS_ICON )\n styleStr+=\"|BS_ICON\";\n else\n if ( (style & BS_BITMAP)==BS_BITMAP )\n styleStr+=\"|BS_BITMAP\";\n else\n styleStr+=\"|BS_TEXT\";\n \n if ( (style & BS_CENTER)==BS_CENTER )\n styleStr+=\"|BS_CENTER\";\n else\n if ( (style & BS_RIGHT)==BS_RIGHT )\n styleStr+=\"|BS_RIGHT\";\n else\n styleStr+=\"|BS_LEFT\";\n \n if ( (style & BS_VCENTER)==BS_VCENTER )\n styleStr+=\"|BS_VCENTER\";\n else\n if ( (style & BS_TOP)==BS_TOP )\n styleStr+=\"|BS_TOP\";\n else\n styleStr+=\"|BS_BOTTOM\";\n \n if ( (style & BS_PUSHLIKE)!=0 )\n styleStr+=\"|BS_PUSHLIKE\";\n\n if ( (style & BS_MULTILINE)!=0 )\n styleStr+=\"|BS_MULTILINE\";\n\n if ( (style & BS_NOTIFY)!=0 )\n styleStr+=\"|BS_NOTIFY\";\n\n if ( (style & BS_FLAT)!=0 )\n styleStr+=\"|BS_FLAT\";\n\n return styleStr;\n}", "title": "" }, { "docid": "42560995876dd1bfbde26bf242ddbf6b", "score": "0.6221807", "text": "function updateButtonToggleSkin(isSelected, buttonObject) {\n if (isSelected) {\n buttonObject.skin = \"jumpStartGreenButton90\";\n } else {\n buttonObject.skin = \"jumpStartGrayButton90\";\n }\n}", "title": "" }, { "docid": "63b4da5869c04f5d03ab3ed69f0e0b7c", "score": "0.6202544", "text": "function FOOTER_SECONDARY$static_(){ButtonSkin.FOOTER_SECONDARY=( new ButtonSkin(\"footer-secondary\"));}", "title": "" }, { "docid": "a0c8aa3ca165d85f4274c57c4a277ada", "score": "0.610775", "text": "function SIDE$static_(){TabBarSkin.SIDE=( new TabBarSkin(\"side\"));}", "title": "" }, { "docid": "08a34ce49ba6f635ae2e2c9ce1d28bf8", "score": "0.6089238", "text": "makeButtonStyle(color) {\n\t\t// get rgb values\n\t\tlet rgb = this.extractRGB(color);\n\n\t\t// some color theory found on stack overflow\n\t\tlet val = rgb.red*0.299 + rgb.green*0.587 + rgb.blue*0.114;\n\t\tlet text = val > 186 ? '#000000' : '#ffffff';\n\n\t\treturn {\n\t\t\tbackgroundColor: color,\n\t\t\tcolor: text,\n\t\t\tminWidth: '30px',\n\t\t\tminHeight: '30px', \t\t\n\t\t\twhiteSpace: 'pre',\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "ff1e5ac12a13b0a29e6e1cde63d3875f", "score": "0.60380787", "text": "function ToolStyles() {\n\n\tthis.newPlayerButtonWrapper = {\n\t\t\"top\": locations.newPlayerButton.top + \"px\",\n\t\t\"left\": locations.newPlayerButton.left + \"px\"\n\t};\n\n\tthis.newPlayersButtonWrapper = {\n\t\t\"top\": locations.newPlayersButton.top + \"px\",\n\t\t\"left\": locations.newPlayersButton.left + \"px\"\n\t};\n\n\tthis.newPlayersDropdownWrapper = {\n\t\t\"top\": locations.newPlayersDropdown.top + \"px\",\n\t\t\"left\": locations.newPlayersDropdown.left + \"px\"\n\t};\n\n\tthis.compareHandsButtonWrapper = {\n\t\t\"top\": locations.compareHandsButton.top + \"px\",\n\t\t\"left\": locations.compareHandsButton.left + \"px\"\n\t};\n\n\tthis.resetBoardButtonWrapper = {\n\t\t\"top\": locations.resetBoardButton.top + \"px\",\n\t\t\"left\": locations.resetBoardButton.left + \"px\"\n\t};\n\n\tthis.resetButtonWrapper = {\n\t\t\"top\": locations.resetButton.top + \"px\",\n\t\t\"left\": locations.resetButton.left + \"px\"\n\t};\n\n\tthis.button = {\n\t\t\"border-radius\": borderRadiuses.button + \"px\",\n\t\t\"font-size\": fontSizes.button + \"px\",\n\t\t\"font-family\": fontFamilies.button,\n\t\t\"color\": colors.button,\n\t\t\"background-color\": backgroundColors.button,\n\t\t\"border\": borders.button.borderWidth + \"px \" + borders.button.borderStyle + \" \" + borders.button.borderColor\n\t};\n\n\tthis.button_p = {\n\t\t\"text-align\": textAligns.buttonP,\n\t\t\"padding\": paddings.buttonP.top + \"px \" + paddings.buttonP.right + \"px \" + paddings.buttonP.bottom + \"px \"\n + paddings.buttonP.left + \"px\"\n\t};\n}", "title": "" }, { "docid": "10103d3e1a9b12564c70dd41761d2c2d", "score": "0.5995379", "text": "function INVERTED$static_(){ButtonSkin.INVERTED=( new ButtonSkin(\"inverted\"));}", "title": "" }, { "docid": "a5f9a92ea842a454c71ca59051f3902b", "score": "0.5950145", "text": "function setButtonStyle(state) {\n\t// debug.log('setButtonStyle: ', state);\n\tif(!widget || defaults.buttonStyles[state] === undefined) return;\n\tvar wgBtn = widget.querySelector('.'+defaults.prefix+'-wg-btn'),\n\t\tbtnIcon = widget.querySelector('.'+defaults.prefix+'-btn-icon');\n\n\twgBtn.style.backgroundColor = defaults.buttonStyles[state].backgroundColor;\n\tbtnIcon.style.color = defaults.buttonStyles[state].color || defaults.buttonStyles.color;\n}", "title": "" }, { "docid": "c8caff954b0260870d75c5f1988b21a0", "score": "0.59096694", "text": "function DEFAULT$static_(){LabelableSkin.DEFAULT=( new LabelableSkin(\"default\"));}", "title": "" }, { "docid": "516be99665c541db9c0aac89936c78cf", "score": "0.58958447", "text": "function setBrushTool() {\n currentTool = \"paint\";\n}", "title": "" }, { "docid": "8b8a7e3107533ef5443b3bf5b083efa2", "score": "0.58714086", "text": "function SIMPLE_INVERTED$static_(){ButtonSkin.SIMPLE_INVERTED=( new ButtonSkin(ButtonSkin.SIMPLE + \"-inverted\"));}", "title": "" }, { "docid": "4d8d593df68401ba13fd67058c841792", "score": "0.58705056", "text": "function values$static_(){TabBarSkin.values=( com.coremedia.ui.util.Enum.collectValues(TabBarSkin));}", "title": "" }, { "docid": "958e7c37f1af976a666f24ae542eeaa2", "score": "0.58628684", "text": "_customTooltip (button) {\n button.height = '20px'\n button.fontSize = 14\n button.cornerRadius = 5\n button.color = 'white'\n button.verticalAlignment = 0\n button.background = 'black'\n }", "title": "" }, { "docid": "45213014335d2364784da702d1054f0b", "score": "0.5832784", "text": "function BOLD$static_(){LabelableSkin.BOLD=( new LabelableSkin(\"bold\"));}", "title": "" }, { "docid": "0b1b5faa4858459848e422a1fd90fef6", "score": "0.5805779", "text": "function buttonPreset(w = Clickables.buttons[0].w,\n start = [DIM.x * 0.25, DIM.y - DIM.y * 0.35]) {\n return {\n x: start[0] + (w + 10) * Clickables.buttons.length,\n y: start[1],\n wF: DIM.x * 0.0015,\n hF: DIM.y * 0.0012,\n };\n }", "title": "" }, { "docid": "2aa316e382f43c033245421734394313", "score": "0.5796141", "text": "function inject_external_tools_bar_style()\n {\n JS.injectCSS(\n '#' + EXTERNAL_TOOLS_BAR_UPDATE_CONTAINER_ID + ' {' +\n 'position: relative;' +\n 'top: 0;' +\n 'left: 0;' +\n '}' +\n\n '#' + EXTERNAL_TOOLS_BAR_UPDATE_CONTAINER_ID + ' div {' +\n 'position: absolute;' +\n 'top: 0;' +\n 'right: 0;' +\n 'width: 0%;' +\n 'height: 100%;' +\n 'background-color: black;' +\n 'opacity: 0.5;' +\n 'cursor: help;' +\n '}' +\n\n '#' + EXTERNAL_TOOLS_BAR_UPDATE_CONTAINER_ID + ' div.smooth_transition {' +\n 'transition: width 0.8s;' +\n '-moz-transition: width 0.8s;' +\n '-webkit-transition: width 0.8s;' +\n '}' +\n\n '#' + EXTERNAL_TOOLS_BAR_UPDATE_CONTAINER_ID + ' a.disabled {' +\n 'padding-top: 0px;' +\n 'padding-bottom: 1px;' +\n 'color: #f0d79e;' +\n 'border-top-width: 1px;' +\n 'border-bottom-width: 2px;' +\n 'outline: 1px solid #784323;' +\n 'color: #f0d79e;' +\n 'cursor: help;' +\n '}'\n\n );\n }", "title": "" }, { "docid": "3985bf23f33e3d1a1968f92da0f34018", "score": "0.57749707", "text": "function WORKAREA$static_(){TabBarSkin.WORKAREA=( new TabBarSkin(\"workarea\"));}", "title": "" }, { "docid": "1f182e7e082ba7ce1df159b3d93c92c6", "score": "0.57540333", "text": "updateDesktopSharingButtonState () {\n let button = $(\"#toolbar_button_desktopsharing\");\n if (APP.conference.isSharingScreen) {\n button.addClass(\"glow\");\n } else {\n button.removeClass(\"glow\");\n }\n }", "title": "" }, { "docid": "aedef243a0cc9492e07fe05c9b7ae339", "score": "0.5751101", "text": "get spacing(){ return this.__button.ui.spacing; }", "title": "" }, { "docid": "fdd4f0d497de440ec723aff7b63fcdb2", "score": "0.57308465", "text": "function SelectColorOfButton(ArraySwatches,ButtonColor){\r var typecolor = ArraySwatches[ButtonColor.IndexInArraySwatches].color.typename;\r switch(typecolor) {//////////////////////// switch\r case 'NoColor':{\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush(ButtonColor.graphics.BrushType.SOLID_COLOR, [1, 1, 1, 1] );\r var x2 = ButtonColor.bounds.width-1; var y2 = 0; var x1 = 0; var y1 = ButtonColor.bounds.height-2;\r var k = (y2-y1)/(x2-x1);\r for (var x=x1;x<ButtonColor.bounds.width-1;x++){\r ButtonColor.add('group',{x:x,y:(k*(x-x1)+y1),width:2,height:2});\r ButtonColor.children[x].graphics.backgroundColor = ButtonColor.children[x].graphics.newBrush ( ButtonColor.children[x].graphics.BrushType.SOLID_COLOR, [1,0,0,1]);\r }\r break}// case 'NoColor'\r case 'SpotColor': {\r switch(ButtonColor.helpTip){\r case '[Registration]':{ \r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush(ButtonColor.graphics.BrushType.SOLID_COLOR, [1, 1, 1, 0.5] );\r BackGroungColor = ButtonColor.graphics.newBrush ( ButtonColor.graphics.BrushType.SOLID_COLOR, [0,0,0,1]);\r\r ButtonColor.add('group',{x:ButtonColor.bounds.width/2,y:2,width:1, height:ButtonColor.bounds.height-4});// draw line --\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor;\r \r ButtonColor.add('group',{x:2,y:ButtonColor.bounds.height/2-1,width:ButtonColor.bounds.width-4, height:1});// draw line |\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor;\r\r ButtonColor.add('group',{x:4,y:4,width:ButtonColor.bounds.width-8, height:1});// draw rect\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor;\r \r ButtonColor.add('group',{x:4+ButtonColor.bounds.width-8-1,y:4,width:1, height:ButtonColor.bounds.height-8});// draw rect\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor;\r \r ButtonColor.add('group',{x:4,y:4+ButtonColor.bounds.height-8-1,width:ButtonColor.bounds.width-8, height:1});// draw rect\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor; \r \r ButtonColor.add('group',{x:4,y:4,width:1, height:ButtonColor.bounds.height-8});// draw rect\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = BackGroungColor;\r\r break;}\r default: switch(ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.typename){\r case 'RGBColor':{\r red = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.red/256;\r green = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.green/256;\r blue = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.blue/256;\r TintOfColor = ArraySwatches[ButtonColor.IndexInArraySwatches].color.tint/100;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break}// RGBColor\r case 'CMYKColor': { \r cyan = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.cyan/100;\r magenta = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.magenta/100;\r yellow = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.yellow/100;\r black = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.black/100;\r red = 1 - (cyan*(1-black)+black);\r green = 1 - (magenta*(1-black)+black);\r blue = 1 - (yellow*(1-black)+black);\r TintOfColor = 1;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break; } // CMYKColor\r case 'LabColor': {\r a = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.a;\r b = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.b;\r L = ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.l;\r var_Y = ( L + 16 ) / 116;\r var_X = a / 500 + var_Y;\r var_Z = var_Y - b / 200;\r if ( var_Y^3 > 0.008856 ) {var_Y = var_Y^3} else{var_Y = ( var_Y - 16 / 116 ) / 7.787}\r if ( var_X^3 > 0.008856 ) {var_X = var_X^3}else{var_X = ( var_X - 16 / 116 ) / 7.787}\r if ( var_Z^3 > 0.008856 ) {var_Z = var_Z^3}else{var_Z = ( var_Z - 16 / 116 ) / 7.787}\r X = ref_X * var_X; \r Y = ref_Y * var_Y;\r Z = ref_Z * var_Z;\r var_X = X/100; //X from 0 to 95.047 (Observer = 2°, Illuminant = D65)\r var_Y = Y/100; //Y from 0 to 100.000\r var_Z = Z/100; //Z from 0 to 108.883\r var_R = var_X * 3.2406 + var_Y * -1.5372 + var_Z * -0.4986;\r var_G = var_X * -0.9689 + var_Y * 1.8758 + var_Z * 0.0415;\r var_B = var_X * 0.0557 + var_Y * -0.2040 + var_Z * 1.0570;\r if ( var_R > 0.0031308 ) {var_R = 1.055 * ( var_R ^ ( 1 / 2.4 ) ) - 0.055}else{var_R = 12.92 * var_R}\r if ( var_G > 0.0031308 ) {var_G = 1.055 * ( var_G ^ ( 1 / 2.4 ) ) - 0.055}else{var_G = 12.92 * var_G}\r if ( var_B > 0.0031308 ) {var_B = 1.055 * ( var_B ^ ( 1 / 2.4 ) ) - 0.055}else{var_B = 12.92 * var_B}\r red = var_R;\r green = var_G;\r blue = var_B;\r TintOfColor = 1;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break;} // LabColor\r default: {alert(ArraySwatches[ButtonColor.IndexInArraySwatches].color.spot.color.typename);break;}\r } // switch\r break;}\r break;}// case 'SpotColor'\r case 'CMYKColor': {//$.writeln(' CMYKColor: '+ButtonColor.IndexInArraySwatches);\r cyan = ArraySwatches[ButtonColor.IndexInArraySwatches].color.cyan/100;\r magenta = ArraySwatches[ButtonColor.IndexInArraySwatches].color.magenta/100;\r yellow = ArraySwatches[ButtonColor.IndexInArraySwatches].color.yellow/100;\r black = ArraySwatches[ButtonColor.IndexInArraySwatches].color.black/100;\r red = 1 - (cyan*(1-black)+black);\r green = 1 - (magenta*(1-black)+black);\r blue = 1 - (yellow*(1-black)+black);\r TintOfColor = 1;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break} \r case 'GradientColor': {\r var ColorRGB = new Array();\r for (var i=0;i<ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops.length;i++)\r {\r ColorRGB[i] = new Object();\r switch (ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.typename){\r case 'GrayColor':\r {ColorRGB[i].red = ColorRGB[i].blue = ColorRGB[i].green = (100-ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.gray)/100;\r ColorRGB[i].rampPoint = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].rampPoint;\r break;} \r case 'RGBColor':\r {ColorRGB[i].red = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.red/256;\r ColorRGB[i].blue = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.blue/256;\r ColorRGB[i].green = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.green/256;\r ColorRGB[i].rampPoint = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].rampPoint;\r break;}\r case 'CMYKColor':\r {cyan = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.cyan/100;\r magenta = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.magenta/100;\r yellow = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.yellow/100;\r black = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.black/100;\r ColorRGB[i].red = 1 - (cyan*(1-black)+black);\r ColorRGB[i].green = 1 - (magenta*(1-black)+black);\r ColorRGB[i].blue = 1 - (yellow*(1-black)+black);\r ColorRGB[i].rampPoint = ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].rampPoint;\r break;}\r default: {alert(ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.gradientStops[i].color.typename);break;} \r } // switch\r }// for\r GradientToFill(ButtonColor,ColorRGB,ArraySwatches[ButtonColor.IndexInArraySwatches].color.gradient.type);\r ColorRGB.delete;break}\r case 'GrayColor': {//$.writeln('GrayColor: '+ButtonColor.IndexInArraySwatches);\r red = blue = green = (100 - ArraySwatches[ButtonColor.IndexInArraySwatches].color.gray)/100;\r TintOfColor = 1;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break} \r case 'LabColor': {\r //alert('LabColor: '+ButtonColor.IndexInArraySwatches);\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush(ButtonColor.graphics.BrushType.SOLID_COLOR, [1, 1, 1, 1] );\r var x2 = ButtonColor.bounds.width-1; var y2 = 0; \r var x1 = 0; var y1 = ButtonColor.bounds.height-2;\r var k = (y2-y1)/(x2-x1);\r for (var x=x1;x<ButtonColor.bounds.width-1;x++){\r ButtonColor.add('group',{x:x,y:(k*(x-x1)+y1),width:2,height:2});\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = ButtonColor.children[ButtonColor.children.length-1].graphics.newBrush(ButtonColor.children[ButtonColor.children.length-1].graphics.BrushType.SOLID_COLOR, [1,0,0,1]);\r } \r x2 = ButtonColor.bounds.width-1; y2 = ButtonColor.bounds.height-2; \r x1 = 0; y1 = 0;\r k = (y2-y1)/(x2-x1);\r for (x=x1;x<ButtonColor.bounds.width-1;x++){\r ButtonColor.add('group',{x:x,y:(k*(x-x1)+y1),width:2,height:2});\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = ButtonColor.children[ButtonColor.children.length-1].graphics.newBrush(ButtonColor.children[ButtonColor.children.length-1].graphics.BrushType.SOLID_COLOR, [1,0,0,1]);\r } \r break} \r case 'PatternColor': {\r //alert('PatternColor: '+ButtonColor.IndexInArraySwatches);\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush(ButtonColor.graphics.BrushType.SOLID_COLOR, [1, 1, 1, 1] );\r var x2 = ButtonColor.bounds.width-1; var y2 = 0; \r var x1 = 0; var y1 = ButtonColor.bounds.height-2;\r var k = (y2-y1)/(x2-x1);\r for (var x=x1;x<ButtonColor.bounds.width-1;x++){\r ButtonColor.add('group',{x:x,y:(k*(x-x1)+y1),width:2,height:2});\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = ButtonColor.children[ButtonColor.children.length-1].graphics.newBrush(ButtonColor.children[ButtonColor.children.length-1].graphics.BrushType.SOLID_COLOR, [1,0,0,1]);\r } \r x2 = ButtonColor.bounds.width-1; y2 = ButtonColor.bounds.height-2; \r x1 = 0; y1 = 0;\r k = (y2-y1)/(x2-x1);\r for (x=x1;x<ButtonColor.bounds.width-1;x++){\r ButtonColor.add('group',{x:x,y:(k*(x-x1)+y1),width:2,height:2});\r ButtonColor.children[ButtonColor.children.length-1].graphics.backgroundColor = ButtonColor.children[ButtonColor.children.length-1].graphics.newBrush(ButtonColor.children[ButtonColor.children.length-1].graphics.BrushType.SOLID_COLOR, [1,0,0,1]);\r }\r break} \r case 'RGBColor': {\r red = ArraySwatches[ButtonColor.IndexInArraySwatches].color.red/256;\r green = ArraySwatches[ButtonColor.IndexInArraySwatches].color.green/256;\r blue = ArraySwatches[ButtonColor.IndexInArraySwatches].color.blue/256;\r TintOfColor = 1;\r ButtonColor.graphics.backgroundColor = ButtonColor.graphics.newBrush( ButtonColor.graphics.BrushType.SOLID_COLOR, [red, green, blue,TintOfColor] );\r break}\r default:{break}\r }////////////////////////////////////// end switch\r//return\r }", "title": "" }, { "docid": "3f4f539a2d5806a76be0dadb5790c4e4", "score": "0.57188785", "text": "function Toolbar(props) {\n return <ThemedButton onClick={props.changeTheme}>Change Theme</ThemedButton>;\n}", "title": "" }, { "docid": "e28c78dda8e1f9e7840dc5f989c102c3", "score": "0.5707261", "text": "function button(modenum) {\n\tcolors=generatecolor(modenum)\n\tcolornum=setgoal(num)\n\tgoal=colors[colornum]\n\tbackgroundchange()\n\tjumbotron.style.background='#EBE8E7'\n\trgb.textContent=goal.toUpperCase()\n\tfor(var i=0;i<varsh.length;i++){\n\t\t\tvarsh[i].style.color='#EBE8E7'\n\t}\n}", "title": "" }, { "docid": "ff7d32003eb6efe1c6b7774e9934eb60", "score": "0.5702178", "text": "getSaveButtonStyle() {\n return this.state.unsavedChanges ?\n 'save-button yellow-button unsaved-changes'\n : 'save-button yellow-button no-unsaved-changes'\n }", "title": "" }, { "docid": "9103ddc2a5d94b01ac49df7dcd633fe4", "score": "0.5696718", "text": "function initStyleButtons() {\n\t\t//TOP MENU BUTTONS\n\t\t$('#letter_new').button({ icons: { primary: \"ui-icon-plus\", }});\n\t\t$('.letter_save').button({ icons: { primary: \"ui-icon-document\", }});\n\t\t$('#letter_search').button({ icons: { primary: \"ui-icon-search\", }});\n\t\t$('#letter_cancel').button({ icons: { primary: \"ui-icon-cancel\", }});\n\n\t\t$('#contract_type').buttonset();\n\t\t$('#contract_add_year').button({ icons: { primary: \"ui-icon-circle-plus\", }});\n\n\t\t$('#client_details').button({ icons: { primary: \"ui-icon-info\", }});\n\t\t$('#add_appraiser').button({ icons: { primary: \"ui-icon-circle-plus\", }});\n\t\t$('#add_reviewer').button({ icons: { primary: \"ui-icon-circle-plus\", }});\n\t\t$('#edit_final_date').button({ icons: { primary: \"ui-icon-alert\", }});\n\t\t$('.feesplit_info').button({ icons: { primary: \"ui-icon-info\", }});\n\n\t\t$('select').selectmenu(); //Initialize jQuery UI selectmenu on all select elements\n\t}", "title": "" }, { "docid": "47e1aed8e92e448e374955f515ee8380", "score": "0.5681538", "text": "function highlightButton(obj) {\r\n obj.style.boxShadow = \"0px 0px 10px rgb(101, 101, 101)\";\r\n obj.style.border = \"5px inset rgba(121, 191, 121, 0.8)\";\r\n obj.style.backgroundColor = \"rgba(121, 191, 121, 0.4)\";\r\n }", "title": "" }, { "docid": "5863f9ed6262f9963ada143e4262ccfb", "score": "0.5657172", "text": "function updateThemeWithAppSkinInfo(appSkinInfo) {\n\n //Update the background color of the panel\n\n var panelBackgroundColor = appSkinInfo.panelBackgroundColor.color;\n document.body.bgColor = toHex(panelBackgroundColor);\n\n var styleId = \"ppstyle\";\n var gradientBg = \"background-image: -webkit-linear-gradient(top, \" + toHex(panelBackgroundColor, 40) + \" , \" + toHex(panelBackgroundColor, 10) + \");\";\n var gradientDisabledBg = \"background-image: -webkit-linear-gradient(top, \" + toHex(panelBackgroundColor, 15) + \" , \" + toHex(panelBackgroundColor, 5) + \");\";\n var boxShadow = \"-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);\";\n var boxActiveShadow = \"-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);\";\n\n var isPanelThemeLight = panelBackgroundColor.red > 50; // choose your own sweet spot\n var fontColor, disabledFontColor;\n var borderColor;\n var inputBackgroundColor;\n var gradientHighlightBg;\n\n if (isPanelThemeLight) {\n fontColor = \"#000000;\";\n disabledFontColor = \"color:\" + toHex(panelBackgroundColor, -70) + \";\";\n borderColor = \"border-color: \" + toHex(panelBackgroundColor, -90) + \";\";\n inputBackgroundColor = toHex(panelBackgroundColor, 54) + \";\";\n gradientHighlightBg = \"background-image: -webkit-linear-gradient(top, \" + toHex(panelBackgroundColor, -40) + \" , \" + toHex(panelBackgroundColor, -50) + \");\";\n } else {\n fontColor = \"#ffffff;\";\n disabledFontColor = \"color:\" + toHex(panelBackgroundColor, 100) + \";\";\n borderColor = \"border-color: \" + toHex(panelBackgroundColor, -45) + \";\";\n inputBackgroundColor = toHex(panelBackgroundColor, -20) + \";\";\n gradientHighlightBg = \"background-image: -webkit-linear-gradient(top, \" + toHex(panelBackgroundColor, -20) + \" , \" + toHex(panelBackgroundColor, -30) + \");\";\n }\n\n //Update the default text style with pp values\n\n addRule(styleId, \".default\", \"font-size:\" + appSkinInfo.baseFontSize + \"px\" + \"; color:\" + fontColor + \"; background-color:\" + toHex(panelBackgroundColor) + \";\");\n addRule(styleId, \"button, select, input[type=text], input[type=button], input[type=submit]\", borderColor);\n addRule(styleId, \"p\", \"color:\" + fontColor + \";\");\n addRule(styleId, \"h1\", \"color:\" + fontColor + \";\");\n addRule(styleId, \"h2\", \"color:\" + fontColor + \";\");\n addRule(styleId, \"button\", \"font-family: \" + appSkinInfo.baseFontFamily + \", Arial, sans-serif;\");\n addRule(styleId, \"button\", \"color:\" + fontColor + \";\");\n addRule(styleId, \"button\", \"font-size:\" + (1.2 * appSkinInfo.baseFontSize) + \"px;\");\n addRule(styleId, \"button, select, input[type=button], input[type=submit]\", gradientBg);\n addRule(styleId, \"button, select, input[type=button], input[type=submit]\", boxShadow);\n addRule(styleId, \"button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active\", gradientHighlightBg);\n addRule(styleId, \"button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active\", boxActiveShadow);\n addRule(styleId, \"[disabled]\", gradientDisabledBg);\n addRule(styleId, \"[disabled]\", disabledFontColor);\n addRule(styleId, \"input[type=text]\", \"padding:1px 3px;\");\n addRule(styleId, \"input[type=text]\", \"background-color: \" + inputBackgroundColor + \";\");\n addRule(styleId, \"input[type=text]:focus\", \"background-color: #ffffff;\");\n addRule(styleId, \"input[type=text]:focus\", \"color: #000000;\");\n}", "title": "" }, { "docid": "3b68035470296351d8e9ad14cbf5e4ae", "score": "0.5646136", "text": "static get tag() {\n return \"lrn-button\";\n }", "title": "" }, { "docid": "4712558eaad4830ee6fcfc65b1c7cb10", "score": "0.56257117", "text": "getStyle() {\n return {\n icon: WaxIcon,\n text: 'WAX Cloud Wallet',\n textColor: 'white',\n background: '#111111'\n };\n }", "title": "" }, { "docid": "b8593e41ab9c89345398c451a2420eba", "score": "0.56199265", "text": "function WORKAREA_PANEL$static_(){TabBarSkin.WORKAREA_PANEL=( new TabBarSkin(\"workarea-panel\"));}", "title": "" }, { "docid": "9ee0ed833b890ae39a54ff0214bd3258", "score": "0.5610397", "text": "settingIcon(){\r\n var style = {};\r\n Object.assign(style, this._rightBarStyle.settingIcon.all);\r\n return style;\r\n }", "title": "" }, { "docid": "a4c0002a6046581df1b0f2e3143d9602", "score": "0.5609645", "text": "function LOGO$static_(){LabelableSkin.LOGO=( new LabelableSkin(\"logo\"));}", "title": "" }, { "docid": "0ed0a19fb11e0f4ca1863d7c0f3a3173", "score": "0.56031466", "text": "update_button_style(previous_trait_value) {\n this.update_mapped_classes(class_map, \"button_style\", previous_trait_value);\n }", "title": "" }, { "docid": "61824803ca5716b24edadcc99746492d", "score": "0.55827177", "text": "function buildButtons() {\n\n}", "title": "" }, { "docid": "9747e3eea907f90e9c935c046d5aab5c", "score": "0.55740684", "text": "function grayButtons() {\n\tcolor = \"#cccccc\";\n\tinOrderButton.style.background=color;\n\tgreedyClaimButton.style.background=color;\n\tgreedyDynamicButton.style.background=color;\n\tconstantButton.style.background=color;\n\t//bruteForceButton.style.background=color;\n\tresetButtonHandler();\n\tpath = new Array();\n}", "title": "" }, { "docid": "9747e3eea907f90e9c935c046d5aab5c", "score": "0.55740684", "text": "function grayButtons() {\n\tcolor = \"#cccccc\";\n\tinOrderButton.style.background=color;\n\tgreedyClaimButton.style.background=color;\n\tgreedyDynamicButton.style.background=color;\n\tconstantButton.style.background=color;\n\t//bruteForceButton.style.background=color;\n\tresetButtonHandler();\n\tpath = new Array();\n}", "title": "" }, { "docid": "5ad94576c6d3917da89f1a5da7167c6c", "score": "0.5567015", "text": "static get tag() {\n return \"simple-colors-shared-styles\";\n }", "title": "" }, { "docid": "b55015f055346db3f9b821e002ae14e7", "score": "0.5559332", "text": "function colorHue(){\n coloringStyle = 1;\n document.getElementById(\"modulusButton\").className = \"btn btn-default\";\n document.getElementById(\"valueToHueButton\").className = \"btn btn-default active\";\n document.getElementById(\"MSDButton\").className = \"btn btn-default\";\n}", "title": "" }, { "docid": "a38e6c382186381fb15e2e7d9ab81258", "score": "0.5554534", "text": "function nightButton() {\n if (theme === \"App-light\") {\n // direct DOM access to change bkg colour\n document.body.style = \"background: #161716\"\n setTheme(\"App-dark\");\n setButton({ text: \"Dark Mode\", textColour: \"white\", bkgColor: \"#38218f\" });\n } else {\n setTheme(\"App-light\");\n document.body.style = \"background: white\"\n setButton({ text: \"Light Mode\", textColour: \"black\", bkgColor: \"#ffdc3e\" });\n }\n }", "title": "" }, { "docid": "e7e2edf95bc2a14fdc555343b1227af3", "score": "0.55422956", "text": "function INFO$static_(){LabelableSkin.INFO=( new LabelableSkin(\"info\"));}", "title": "" }, { "docid": "2c6879856a28769c24925b0d3c26ed08", "score": "0.5540519", "text": "getMeridiamButtonColor(m) {\r\n if ( m === this.meridiam) {\r\n return 'primary';\r\n } else {\r\n return 'darkgray';\r\n }\r\n }", "title": "" }, { "docid": "0ec09f1b05cace427bf52ceec9ff1f74", "score": "0.55238473", "text": "function EditAppButton() {\r\n if( !g_buttons_enabled ) return;\r\n ShowNormal();\r\n}", "title": "" }, { "docid": "cc41b53c1088044cfd479778fffc9318", "score": "0.5519887", "text": "function cal_toggleButtonStyle(obj) {\r\n $(obj).find(\"#clsLeftcornerButton\").toggleClass(\"clsLeftcornerButton\").toggleClass(\"clsLeftcornerButtonmover\");\r\n $(obj).find(\"#clsCenterButton\").toggleClass(\"clsCenterButton\").toggleClass(\"clsCenterButtonmover\");\r\n $(obj).find(\"#clsRightButton\").toggleClass(\"clsRightButton\").toggleClass(\"clsRightButtonmover\");\r\n}", "title": "" }, { "docid": "fbaada723324f7607f2329d36bf6486c", "score": "0.551888", "text": "makePresetBtn(title, parent) {\n const btn = this.makeButton(title, parent)\n btn.addClass(\"presetBtn\")\n return btn\n }", "title": "" }, { "docid": "366243d8be86ff1ac9f074163bd43e21", "score": "0.55164695", "text": "function frmAdmin_alphabetsskin(){\n frmAdmin.btnalphabetall.skin=\"sknbtnwhitebgblack85\";\n frmAdmin.btnalphabeta.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetb.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetc.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetd.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabete.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetf.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetg.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabeth.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabeti.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetj.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetk.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetl.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetm.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetn.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabeto.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetp.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetq.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetr.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabets.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabett.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetu.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetv.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetw.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetx.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabety.skin=\"sknbtntransbgblue85\";\n frmAdmin.btnalphabetz.skin=\"sknbtntransbgblue85\";\n}", "title": "" }, { "docid": "06b3f13997f6821c01a362ffdb60b581", "score": "0.55141556", "text": "function SUB$static_(){LabelableSkin.SUB=( new LabelableSkin(\"sub\"));}", "title": "" }, { "docid": "ef665227cacbdd614fbdc784e176760f", "score": "0.55140007", "text": "function restoreButtons() {\r\n for(var i =0; i < toolButtons.length; i++) {\r\n toolButtons[i].style.boxShadow = \"\";\r\n toolButtons[i].style.border = \"5px outset rgba(121, 121, 121, 0.8)\";\r\n toolButtons[i].style.backgroundColor = \"\";\r\n }\r\n }", "title": "" }, { "docid": "83155ddd36bfaac1d84e3815245e3b4a", "score": "0.55060875", "text": "static get properties(){return{/**\n * Can this button toggle?\n */toggled:{name:\"toggled\",type:Boolean,value:!1,reflectToAttribute:!0},/**\n * The maximum size where all of the buttons display\n */collapseMax:{name:\"collapseMax\",type:String,value:\"xs\",reflectToAttribute:!0}}}", "title": "" }, { "docid": "b80e032f4d4053c764d474e37a685711", "score": "0.5503593", "text": "_addToolbarButtons() {\n var btn = (u, v, tooltip, cmd) => {\n var b = new latte.ButtonItem();\n b.icon = latte.IconItem.standard(u, v);\n b.tooltip = tooltip;\n b.click.add(() => { this.execCommand(cmd); });\n return b;\n };\n var sep = function () { return new latte.SeparatorItem(); };\n this.toolbar.items.addArray([\n btn(5, 2, strings.bold, latte.HtmlEditorCommands.BOLD),\n btn(6, 2, strings.italics, latte.HtmlEditorCommands.ITALIC),\n sep(),\n btn(8, 2, strings.alignLeft, latte.HtmlEditorCommands.JUSTIFY_LEFT),\n btn(10, 2, strings.alignCenter, latte.HtmlEditorCommands.JUSTIFY_CENTER),\n btn(9, 2, strings.alignRight, latte.HtmlEditorCommands.JUSTIFY_RIGHT),\n btn(11, 2, strings.alignJustify, latte.HtmlEditorCommands.JUSTIFY_FULL),\n sep(),\n btn(15, 2, strings.indent, latte.HtmlEditorCommands.INDENT),\n btn(14, 2, strings.outdent, latte.HtmlEditorCommands.OUTDENT),\n sep(),\n btn(18, 1, strings.numberedList, latte.HtmlEditorCommands.INSERT_ORDERED_LIST),\n btn(19, 1, strings.bulletList, latte.HtmlEditorCommands.INSERT_UNORDERED_LIST),\n sep(),\n btn(16, 2, strings.eraseFormat, latte.HtmlEditorCommands.CLEAR_FORMAT),\n sep(),\n btn(12, 3, strings.insertLink, latte.HtmlEditorCommands.INSERT_LINK),\n btn(9, 3, strings.insertImage, latte.HtmlEditorCommands.INSERT_IMAGE)\n ]);\n }", "title": "" }, { "docid": "6bd65c73120738c6bf081178fc91528d", "score": "0.54998076", "text": "get button (){ return this.__button; }", "title": "" }, { "docid": "39792288c93ac64527916d4b3a5a41cd", "score": "0.54845554", "text": "function fixBtnStyle(){\n var percents, marPerc, length,\n imgSize, firstMargin;\n imgSize = (ui.imgSize * 100) / cw;\n length = modes.length;\n marPerc = ui.marginBtwBtns;\n margin = (length + 1) * marPerc;\n percents = (100-margin) / length;\n firstMargin = (percents - imgSize) * length / 2;\n $('.' + ui.modeClass)\n .width(imgSize + '%')\n .height(ui.imgSize + 'px')\n .css('margin-left', marPerc + '%')\n .removeClass('active');\n $('.' + ui.modeClass + ':first')\n .css('margin-left', marPerc + firstMargin + '%');\n }", "title": "" }, { "docid": "0ff9f750f23a75d07abc26d63f6bfc00", "score": "0.5482127", "text": "shield () {\nsuper.shield ()\n$conanButton.hide();\n$guyButton.show();\n }", "title": "" }, { "docid": "6feb77b46c7fdd5dfd2308bfcea9b6ef", "score": "0.5476433", "text": "function values$static_(){LabelableSkin.values=( com.coremedia.ui.util.Enum.collectValues(LabelableSkin));}", "title": "" }, { "docid": "8fb7798e0551d8a6254fb858ab889e37", "score": "0.54713345", "text": "shield () {\nsuper.shield ();\n$guyButton.hide();\n$conanButton.show();\n}", "title": "" }, { "docid": "dca9ab517ee18b07f7c15888068811d2", "score": "0.5470752", "text": "function WINDOW_HEADER$static_(){LabelableSkin.WINDOW_HEADER=( new LabelableSkin(\"window-header\"));}", "title": "" }, { "docid": "06ec850bb3610d4304c64b12416999cc", "score": "0.5465265", "text": "function setupMainMenuBtns() {\n btnPurge = new ButtonIcon(32, TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_PURGE);\n btnPurge.tooltip = \"PURGE ALL DATA\";\n // create note butotn\n btnAdd = new ButtonIcon(windowWidth - 64, TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_ADD);\n btnAdd.tooltip = \"ADD A NOTE\";\n\n let menuPosX = windowWidth - 48 - ADD_MENU_WIDTH;\n let menuPosY = TOP_MENU_HEIGHT / 2 + UNI_BTN_HEIGHT / 2;\n let downSizeRatio = 1.75;\n // note theme button\n btnPlayful = new ButtonIcon(menuPosX + ADD_MENU_HEIGHT * 0.4, menuPosY + ADD_MENU_HEIGHT / 2 - 16, ADD_MENU_HEIGHT / downSizeRatio, ADD_MENU_HEIGHT / downSizeRatio, ICON_NOTE_PLAYFUL);\n btnPlayful.rotateIcon();\n if (!user.info.themesObtained.includes(0)) {\n btnPlayful.disabled = true;\n }\n\n btnTerminal = new ButtonIcon(menuPosX + ADD_MENU_HEIGHT, menuPosY + ADD_MENU_HEIGHT / 2 - 16, ADD_MENU_HEIGHT / downSizeRatio, ADD_MENU_HEIGHT / downSizeRatio, ICON_NOTE_TERMINAL);\n btnTerminal.rotateIcon();\n if (!user.info.themesObtained.includes(1)) {\n btnTerminal.disabled = true;\n }\n\n btnPlain = new ButtonIcon(menuPosX + ADD_MENU_HEIGHT * 1.6, menuPosY + ADD_MENU_HEIGHT / 2 - 16, ADD_MENU_HEIGHT / downSizeRatio, ADD_MENU_HEIGHT / downSizeRatio, ICON_NOTE_PLAIN);\n btnPlain.rotateIcon();\n\n connectMainMenuBtns();\n}", "title": "" }, { "docid": "232d61fd7eb73756eebd4ac3e76b8d15", "score": "0.5457435", "text": "function createSmileyButton(headingBar){}//handle with CSS??", "title": "" }, { "docid": "c15d14a060f4855e709ad580cbb924a1", "score": "0.54557675", "text": "function styleButton() {\n button.style.color = bodyColor; //changes color of button text to the color of the main body\n button.style.background = \"white\"; //changes the background of the button to white\n}", "title": "" }, { "docid": "5267c05601ac26301b3c2c8afb30cfab", "score": "0.5452519", "text": "function toolbar () {\n let buttons = []\n const gap = 6\n return {\n /** Resets the toolbar */\n reset: () => {\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].setButtonColor('gainsboro')\n buttons[i].setPressed(false)\n }\n },\n /** Gets the button that is pressed */\n getPressedButton: () => {\n for (let i = 0; i < buttons.length; i++) {\n if (buttons[i].isPressed()) {\n return buttons[i].getNode(0, 0)\n }\n }\n return undefined\n },\n /**\n * Grabs the button that matches a constructor\n * @param {constructor} n - The constructor to be compared\n */\n getButton: (n) => {\n if (buttons.length > 0) {\n for (let i = 0; i < buttons.length; i++) {\n let button = buttons[i]\n if (button.getNodeType() === n) {\n return buttons[i]\n }\n }\n }\n return undefined\n },\n /**\n * Adds a button to the toolbar\n * @param {constructor} nodeToDraw - The button's Node/Edge constructor\n * @param {panel} panel - The panel to be drawn on\n * @param {} functionThatChangesState - A passed function that changes the state of the button\n */\n add: (nodeToDraw, panel, functionThatChangesState) => {\n if (buttons.length > 0) {\n const lastButton = buttons[buttons.length - 1]\n const x = lastButton.getBounds().x + lastButton.getBounds().width + gap\n const y = lastButton.getBounds().y\n const button = createButton(x, y, nodeToDraw, panel, functionThatChangesState)\n buttons.push(button)\n } else {\n const dim = panel.getBoundingClientRect()\n const x = dim.left + gap\n const y = dim.top + gap\n const button = createButton(x, y, nodeToDraw, panel, functionThatChangesState)\n button.setPressed(false)\n buttons.push(button)\n }\n },\n /** Removes the button at the top of the button list */\n remove: () => {\n buttons.pop()\n },\n /** Draws all the buttons */\n draw: () => {\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].draw()\n }\n }\n }\n}", "title": "" }, { "docid": "2c269775725b9efa90f1b28ac9374e6d", "score": "0.54484284", "text": "function newToggleButtonWidget(id,label,cb,width,hlp,tooltip,tabIndex,margin,url,w,h,dx,dy,imgRight,disDx,disDy,togX,togY)\r\n{\r\n// CONSTRUCTOR\r\n// id [String] button ID\r\n// label [String Optional] button label\r\n// w [int optional] : text zone minimal width\r\n// hlp OBSOLETE\r\n// tooltip [String Optional] button tooltip\r\n// tabIndex [int Optional] for 508/IE : tab index for keyboard navigation\r\n// url [String Optional] : the combined image url\r\n// w [int Optional] the visible image part width\r\n// dx [int Optional] the horizontal offset in image\r\n// dy [int Optional] the vertical offset in image\r\n// disDx : [int - optional] horizontal offset for disabled state\r\n// disDy : [int - optional] vertical offset for disabled state\r\n\r\n\tvar o=newButtonWidget(id,label,cb,width,hlp,tooltip,tabIndex,margin,url,w,h,dx,dy,imgRight,disDx,disDy)\r\n\to.togX = togX\r\n\to.togY = togY\r\n\to.checked=false\r\n\to.executeCB=ToggleButtonWidget_executeCB\r\n\to.check=ToggleButtonWidget_check\r\n\to.isChecked=ToggleButtonWidget_isChecked\t\r\n\to.init=ButtonWidget_init\r\n\r\n\treturn o\r\n}", "title": "" }, { "docid": "3b3e1c73ff49917a2d5bf0c49dc43882", "score": "0.5446586", "text": "function getStylingContent(){\r\n var button = $('<div/>',{\r\n 'class' : 'big_button',\r\n 'id' : 'change_css',\r\n 'text' : 'Change Styling!'\r\n });\r\n return button;\r\n }", "title": "" }, { "docid": "1f571116599ce4d3dc6535a4681b54aa", "score": "0.54434913", "text": "_setStatusBar() {\n StatusBar.setBackgroundColor(colors.primary);\n StatusBar.setBarStyle('light-content');\n }", "title": "" }, { "docid": "162a2bd7d67ef84e413a42794f678240", "score": "0.5435236", "text": "function OPAQUE$static_(){LabelableSkin.OPAQUE=( new LabelableSkin(\"opaque\"));}", "title": "" }, { "docid": "fd25465ac34f26f06f431c483cc59b7f", "score": "0.5434692", "text": "function updateButtonStyle(state){\n\tif(state == \"PROGRESS\"){\n\t}\n\telse{\n\t}\n}", "title": "" }, { "docid": "0b16e56567d6f318e66d39ccc2e8081f", "score": "0.5433656", "text": "get padTop(){ return this.__button.ui.padTop; }", "title": "" }, { "docid": "ef6216d3c48e610617d145bd0d50b63e", "score": "0.543216", "text": "function PenThemeName(){\n\t//\n}", "title": "" }, { "docid": "ca33e9a324eb3f80b10d0e0587884e29", "score": "0.5421865", "text": "function newButtonMenuWidget(id,label,width,tooltip,beforeShowCB,tabIndex)\r\n{\r\n var o=newButtonWidget(id,label,ButtonMenuWidget_clickCB,width,null,tooltip,tabIndex,0,_skin+\"menus.gif\",7,16,0,81,true,0,97)\r\n \r\n o.menu = newMenuWidget(\"buttonMenu_menu_\"+id,null,beforeShowCB);\r\n o.getMenu=IconMenuWidget_getMenu\r\n \r\n return o;\r\n}", "title": "" }, { "docid": "7a1da4106fda9ea3dd4f727920dbba94", "score": "0.5414388", "text": "function ToolbarButton(button, buttonCssOnClass, buttonCssOffClass) {\n this.buttonCssOnClass = \"cke_button_on\";\n this.buttonCssOffClass = \"cke_button_off\";\n if (!Object.isNullOrUndefined(buttonCssOnClass)) {\n this.buttonCssOnClass = buttonCssOnClass;\n }\n if (!Object.isNullOrUndefined(buttonCssOffClass)) {\n this.buttonCssOffClass = buttonCssOffClass;\n }\n this.button = button;\n }", "title": "" }, { "docid": "46d8956fc6ea20dddb13a59044df783b", "score": "0.5414113", "text": "function onUpdate() {\n viz_title.style(\"fill\", (theme.skin() != customSkin) ? theme.skin().labelColor : \"#000\");\n }", "title": "" }, { "docid": "b3a4c315bf9b1cffc070a9e5b13b3b33", "score": "0.5407748", "text": "get spacingY(){ return this.__button.ui.spacingY; }", "title": "" }, { "docid": "6b2b0bb7434e8765aea3adb506915234", "score": "0.5404486", "text": "function toogleToolBar() {\r\n\r\n toolBar.classList.toggle('none');\r\n\r\n}", "title": "" }, { "docid": "feccf5ce8067dc3f8728005b5520ceb6", "score": "0.54009366", "text": "function clsButton()\n{\n\tthis.btnLayerSet = null;\n\n\tthis.arrHitStateLayersIdx = [];\n\tthis.arrUpStateLayersIdx = [];\n\tthis.arrOverStateLayersIdx = [];\n\tthis.arrDownStateLayersIdx = [];\n\n\tthis.arrNestedButtonsIdx = [];\n}", "title": "" }, { "docid": "e73c9a3266af2bd2c7251557cc065be9", "score": "0.53978527", "text": "static get tag() {\n return \"simple-icon-button\";\n }", "title": "" }, { "docid": "4b895db04ee536edc5f9b4cdb6d65c7e", "score": "0.5392955", "text": "_newProseButton()\n\t{\n\t\tvar button = new gui_Button(0, 0, 1, 1);\n\t\tvar self = this;\n\t\tbutton.setMouseAction(function(){\n\t\t\tself.showOptionButtons();\n\t\t});\n\n\t\tbutton.setBackgroundColor(STYLE.BUTTON_1);\n\n\t\tthis._prose_buttons.push(button);\n\t\tthis._buttons.push(button);\n\n\t\treturn button;\n\t}", "title": "" }, { "docid": "6ec904ce106382f34a0a4e905cd44053", "score": "0.5384386", "text": "function setupNoteEditorBtns() {\n // top left corner\n btnClose = new ButtonIcon(64, TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_CLOSE);\n btnShare = new ButtonIcon(128, TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_SHARE);\n btnShare.tooltip = \"READY TO COPY THE NOTE\";\n // bottom center left\n btnCheckbox = new ButtonIcon(windowWidth / 2 - MAX_NOTE_SIZE / 2, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_CHECKBOX, false);\n btnCheckbox.tooltip = \"ADD A CHECKBOX\";\n btnUnderline = new ButtonIcon(windowWidth / 2 - MAX_NOTE_SIZE / 2 + 64, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_UNDERLINE, true);\n btnUnderline.tooltip = \"UNDERLINE\";\n btnHighlight = new ButtonIcon(windowWidth / 2 - MAX_NOTE_SIZE / 2 + 128, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, UNI_BTN_HEIGHT, ICON_HIGHLIGHT, true);\n btnHighlight.tooltip = \"HIGHLIGHT\";\n // bottom center right\n btnMarkupColor = new ButtonColor(windowWidth / 2 + MAX_NOTE_SIZE / 2 - 48, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, PEN_COLORS, 0);\n btnMarkupColor.disabled = true;\n btnMarkupColor.tooltip = \"MARKUP COLOR\";\n btnBgColor = new ButtonColor(windowWidth / 2 + MAX_NOTE_SIZE / 2, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, COLORS_NOTE_PLAYFUL, 1, ICON_BGCOLOR);\n btnBgColor.tooltip = \"BACKGROUND COLOR\";\n btnTextColor = new ButtonColor(windowWidth / 2 + MAX_NOTE_SIZE / 2, windowHeight - TOP_MENU_HEIGHT / 2, UNI_BTN_HEIGHT, COLORS_NOTE_PLAYFUL, 1, ICON_TEXTCOLOR);\n btnTextColor.tooltip = \"TEXT COLOR\";\n\n connectEditorBtns();\n}", "title": "" }, { "docid": "51374409adc46f16914c3e652e4c61a0", "score": "0.5380865", "text": "static get styles() {\n return [\n ...super.styles,\n css`\n :host {\n display: block;\n min-width: 160px;\n padding: 16px;\n margin-bottom: 16px;\n border: 1px solid var(--simple-colors-default-theme-grey-8);\n border-radius: 3px;\n color: var(--simple-colors-default-theme-grey-12);\n --simple-toolbar-button-border-color: var(\n --simple-colors-default-theme-grey-4\n );\n --simple-fields-field-color: var(\n --simple-colors-default-theme-grey-12\n );\n --simple-fields-field-ink-color: var(\n --simple-colors-default-theme-grey-12\n );\n --simple-fields-field-checked-color: var(\n --simple-colors-default-theme-accent-8\n );\n --simple-fields-field-checked-ink-color: var(\n --simple-colors-default-theme-accent-8\n );\n --simple-fields-field-checkmark-color: var(\n --simple-colors-default-theme-grey-1\n );\n --simple-fields-field-label-color: var(\n --simple-colors-default-theme-grey-12\n );\n --simple-fields-field-error-color: var(\n --simple-colors-default-theme-red-8\n );\n --simple-fields-border-bottom-size: 0px;\n --simple-fields-border-bottom-focus-size: 0px;\n }\n\n :host button {\n background-color: var(--simple-colors-default-theme-grey-1);\n color: var(--simple-colors-default-theme-grey-12);\n }\n :host button:hover,\n :host button:focus,\n :host button:active {\n cursor: pointer;\n background-color: var(--simple-colors-default-theme-grey-2);\n color: var(--simple-colors-default-theme-grey-12);\n }\n ul {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n ul li {\n padding: 0;\n }\n simple-icon {\n display: inline-flex;\n }\n h3 {\n margin-top: 0;\n }\n #buttons {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n }\n #check {\n margin-right: 8px;\n }\n .feedback {\n background-color: black;\n color: white;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 8px;\n border-radius: 3px;\n }\n .feedback simple-icon {\n margin-right: 8px;\n }\n ::slotted([slot=\"question\"]) {\n margin: 0;\n }\n .feedback,\n ::slotted(multiple-choice-response),\n ::slotted([slot=\"correct-feedback\"]),\n ::slotted([slot=\"incorrect-feedback\"]) {\n font-size: var(--simple-fields-font-size, 16px);\n text-align: var(--simple-fields-text-align);\n font-family: var(--simple-fields-font-family, sans-serif);\n line-height: var(--simple-fields-line-height, 22px);\n }\n `,\n ];\n }", "title": "" }, { "docid": "977d28f35224faa65bf81e76897e3be9", "score": "0.5376926", "text": "static createInControlBarButtonUnderAppearance(container) {\n internal.createInVersionCheck(container.model, Appearance.structureTypeName, { start: \"8.0.0\" });\n return internal.instancehelpers.createElement(container, Appearance, \"appearance\", false);\n }", "title": "" }, { "docid": "bace12291508affec3f56ff62504c2a3", "score": "0.53767914", "text": "function lowlight(button) {\n $(button).attr(\"class\", \"lowlight\");\n}", "title": "" } ]
bac0f76c4f69ddefd8d2886cab0ab182
Given the root node of a binary search tree, return the sum of values of all nodes with a value in the range [low, high]. Input: root = [10,5,15,3,7,null,18], low = 7, high = 15 Output: 32
[ { "docid": "35987237105d893ddeef78015ecab8e7", "score": "0.0", "text": "function TreeNode(val) {\n this.val = val\n this.left = this.right = null\n}", "title": "" } ]
[ { "docid": "04bb14b8d6e30a6a816410ea78f4a5cb", "score": "0.73200506", "text": "function sum(node){\n if (node === null){\n return 0;\n }\n return sum(node.left) + sum(node.value) + sum(node.right);\n}", "title": "" }, { "docid": "17b10d1824a45f1e3c94930f65988e42", "score": "0.7225609", "text": "function sumValues(tree) {\n let toVisitStack = [tree.root];\n let sum = 0;\n while (toVisitStack.length) {\n let current = toVisitStack.pop();\n\n sum += current.val;\n\n if (current.children.length > 0) {\n for (let child of current.children) {\n toVisitStack.push(child);\n }\n }\n }\n\n return sum;\n}", "title": "" }, { "docid": "a0113563d7825999febea0e2de70a841", "score": "0.69691354", "text": "function treeSum(root){\n //initiate the variable sum with the root value\n let sum = root.value;\n //if root.left is not null, add to sum the value of recursively calling treeSum on root.left\n if (root.left) {\n sum+= treeSum(root.left);\n }\n //same for root.right\n if (root.right) {\n sum+= treeSum(root.right);\n }\n return sum;\n}", "title": "" }, { "docid": "557d62f4a5387dd87628eb95b6a43bdb", "score": "0.6892425", "text": "function sumTree(root) { \n let queue = [root];\n let sum = 0;\n while (queue.length !== 0) {\n let current = queue.shift();\n sum += current.val\n if (current.left !== null) {\n queue.push(current.left)\n }\n if (current.right !== null) {\n queue.push(current.right)\n }\n \n }\n return sum;\n}", "title": "" }, { "docid": "f55fa9885b2043cabb28d3b49513a874", "score": "0.68627167", "text": "function treeSum(root) {\n\tif (root === null) return 0;\n\tlet stack = [ root ];\t\t\t\t\t\t\t\t\t\t\t\t\t// 1) use stack array with root node\n\tlet sum = 0;\n\n\twhile (stack.length > 0) {\t\t\t\t\t\t\t\t\t\t// 2) loop while stack is not empty\n\t\tlet node = stack.pop();\t\t\t\t\t\t\t\t\t\t\t// 3) remove last node in stack\n\t\tsum += node.val;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 4) add node's value to sum\n\t\tif (node.right) stack.push(node.right);\t\t\t// 5) add right, then left nodes to stack if they exist\n\t\tif (node.left) stack.push(node.left);\n\t}\n\n\treturn sum;\n}", "title": "" }, { "docid": "7cfc85dfcf0c77d300762b468a44f067", "score": "0.6717668", "text": "function sum(tree) {\n if(!(tree instanceof kTree)) throw new Error('Input needs to be tree instance');\n if(tree.root.val === null) return null;\n\n let sum = 0;\n\n tree.breadthFirst(currentTN => {\n if(currentTN.val !== null) {\n sum += currentTN.val;\n }\n });\n\n return sum;\n}", "title": "" }, { "docid": "0ab87baffced84470fcf4c06af3d4eaf", "score": "0.67107403", "text": "function maxSum(root) {\n if (root === null || root === undefined) return 0\n return root.value + Math.max(maxSum(root.left), maxSum(root.right))\n}", "title": "" }, { "docid": "872dd7d4d3e4701e5686bae6f91e65cf", "score": "0.6650305", "text": "function findSum(tree, target) {\n\n function traverse(node, currentSum) {\n console.log(tree);\n node.aggregatedSum = currentSum + node.value; //work with it.\n if (node.aggregatedSum === target) {\n return;\n }\n\n currentSum += node.value;\n console.log('currentSum', currentSum);\n if (!node.left && !node.right) {\n node.insideValidPath = false;\n return [];\n }\n\n if(node.aggregatedSum > target) {\n node.insideValidPath = false;\n return [];\n }\n\n if (node.left && currentSum === target) {\n node.left.insideValidPath = true;\n return;\n }\n if (node.right && currentSum === target) {\n node.right.insideValidPath = true;\n return;\n }\n\n if (node.left) {\n node.left.insideValidPath = true;\n traverse(node.left, currentSum);\n }\n if (node.right) {\n node.left.insideValidPath = true;\n traverse(node.right, currentSum);\n }\n }\n\n return traverse(tree.root, 0);\n}", "title": "" }, { "docid": "cf44c0f3d0dcaeafe2ee4606dfeab921", "score": "0.66350365", "text": "function tree(t){\n //if empty return 0\n if(!t){\n return 0;\n }\n //sums up all the nodes of the tree\n return tree(t.left) + t.value + tree(t.right)\n}", "title": "" }, { "docid": "9d032a418aa2aae9bfc13aaee3d45b5a", "score": "0.65970296", "text": "function addNumbers(root) {\n if (!root) return;\n if (root.val >= L && root.val <= R) {\n sum += root.val;\n }\n \n addNumbers(root.left);\n addNumbers(root.right);\n }", "title": "" }, { "docid": "923084f500f96bfecb08e788f934f26a", "score": "0.6596853", "text": "function findAllSums(root) {\n return findSumRecursive(root, 0)\n}", "title": "" }, { "docid": "829307f86d0f1acc60073f6cbcf261b0", "score": "0.6544781", "text": "maxSum() {\n let sum = this.root.val\n let node = [this.root]\n let arr = []\n\n while(node.length !== 0){\n for(let child of node){\n if(child.right) arr.push(child.right)\n if(child.left) arr.push(child.left)\n }\n\n let max = 0\n node = []\n if(arr.length){\n arr.map(item => {\n if(item.val > max){\n max = item.val\n node[0] = item\n }\n })\n }\n sum += max\n arr = []\n }\n return sum\n }", "title": "" }, { "docid": "5d092a2ec60eb6c3ad3902e49bcd55e2", "score": "0.6398488", "text": "maxSum() {\n if(!this.root){\n return 0; \n }\n let max = null;\n let stack = []; \n stack.push(this.root); \n while(stack.length > 0){\n let node = stack.pop(); \n let val = _maxSum(node); \n if(max === null || val > max){\n max = val;\n }\n \n if(node.left){\n stack.push(node.left);\n }\n if(node.right){\n stack.push(node.right);\n }\n\n }\n return max; \n\n function _maxSum(node){\n let stack = []; \n let max = node.val;\n\n let left = node.left; \n let right = node.right; \n if(left){\n let val = node.val + left.val + ((right && right.val > 0) ? right.val : 0);\n stack.push([left, val]);\n if(val > max){\n max = val;\n } \n }\n if(right){\n let val = node.val + right.val + ((left && left.val > 0) ? left.val : 0);\n stack.push([right, val]);\n if(val > max){\n max = val;\n }\n }\n \n while(stack.length > 0){\n node = stack.pop(); \n if(!node[0].left && !node[0].right){\n if(node[1] > max){\n max = node[1];\n }\n }\n\n if(node[0].right){\n stack.push([node[0].right, node[1] + node[0].right.val]); \n }\n\n if(node[0].left){\n stack.push([node[0].left, node[1] + node[0].left.val]); \n\n }\n }\n \n return max; \n }\n \n }", "title": "" }, { "docid": "f1d477608efb529b78dd4fd96f595450", "score": "0.63548464", "text": "function pathsWithSum(tree, value) {\n if (tree.data === null) {\n return 0;\n }\n // Count paths starting from root\n var pathsFromRoot = pathsWithSumFromNode(root, value, 0);\n var pathsOnLeft = pathsWithSum(root.left, value);\n var pathsOnRight = pathsWithSum(root.right, value);\n\n return pathsFromRoot + pathsOnLeft + pathsOnRight;\n}", "title": "" }, { "docid": "5ebdd339e8c1cf7725a6962883ff218f", "score": "0.6331906", "text": "function branchSums(node, sums = [], runningTotal = 0) {\n // Process the node: add its value to our running total for this branch\n\trunningTotal = runningTotal + node.value;\n\n\t// Base Case: we are at a leaf node (both children are null)\n // Our branch sum is complete so we can add it to our return array\n\tif (!node.right && !node.left) \n sums.push(runningTotal);\n // Call the function on the child nodes with the new runningTotal\n\telse {\n\t\tif (node.left) \n branchSums(node.left, sums, runningTotal);\n\t\tif (node.right) \n branchSums(node.right, sums, runningTotal);\n\t}\n\treturn sums;\n}", "title": "" }, { "docid": "d4cbe874f91fcdd209f2411e61cc2c2b", "score": "0.62747806", "text": "function getSum(node, currentSum, output) {\n // base case if node is null\n if (!node) return;\n // update sum\n const newCurrentSum = currentSum + node.value;\n // if left and right nodes are null then push sum into output\n if (!node.left && !node.right) {\n output.push(newCurrentSum);\n return;\n }\n\n //invoke getSum on left and right nodes\n getSum(node.left, newCurrentSum, output);\n getSum(node.right, newCurrentSum, output);\n}", "title": "" }, { "docid": "82e30715657d6976758a19bab6e123c2", "score": "0.6165381", "text": "function verticalSum(root) {\n if (root === null) return null\n const range = new Range()\n const map = new Map()\n const result = []\n verticalSumRecur(root, map, 0, range)\n for (let i = range.min; i <= range.max; i++) {\n result.push(map.get(i))\n }\n return result\n}", "title": "" }, { "docid": "6342416786ffdaa000b5499f51b62d21", "score": "0.61631936", "text": "function sum(target, array){\nconst sumArray = array.map((val)=>findMinPath(target, findNode(val)))\nreturn sumArray.reduce((a,b)=>a+b,0)\n}", "title": "" }, { "docid": "74873c9314f9149d1639067ec97f5a36", "score": "0.61526585", "text": "function pathsWithSum(root, sum) {\n\n function sum(node) {\n if (node === null) {\n [];\n }\n let left = sum(node.left);\n let right = sum(node.right);\n\n left = left.map(total => total += node.value);\n left.push(node.value);\n right = right.map(total => total += node.value);\n return left + right;\n }\n return sum(root).filter(total => total === sum).length;\n}", "title": "" }, { "docid": "4177211c7719dc0b734d6953c0a6be20", "score": "0.614425", "text": "function branchSums(root) {\n // Write your code here.\n let sumArr = [];\n sumEachBranch(root, sumArr, 0);\n return sumArr;\n}", "title": "" }, { "docid": "9ea3d245b08a65b8bd9d9aebe31aedf3", "score": "0.6118082", "text": "function psthSumII (root, sum){\n let res=[]\n \n helper(root,sum,[],res)\n return res\n function helper(root ,sum,path,res){\n if(!root){return []}\n if(!root.left && !root.right&& root.val==sum ){\n \n res.push(path.concat(root.val))\n return\n }\n if(root.left){helper(root.left,sum-root.val,path.concat(root.val),res)}\n if(root.right){helper(root.right,sum-root.val,path.concat(root.val),res)}\n }\n\n}", "title": "" }, { "docid": "d9c97b63571d48bbc2994fde0225bb2c", "score": "0.6092327", "text": "function findClosestValueInBstRec(tree, target, min = tree.value - target) {\n\t// stop traversing when null value reached\n\t// return sum of target and difference\n\tif (!tree)\n\t\treturn min + target\n\tif (tree.value === target)\n\t\treturn tree.value\n\t// evaluate difference between node value and target value\n\t// keep track of min difference in a min variable\n\tif (Math.abs(tree.value - target) < Math.abs(min))\n\t\tmin = tree.value - target\n\t// traverse BST, comparing each node value to target value\n\t// if target < node value, go left\n\tif (target < tree.value) {\n\t\treturn findClosestValueInBstRec(tree.left, target, min)\n\t}\n\t// if target > node value, go left\n\telse {\n\t\treturn findClosestValueInBstRec(tree.right, target, min)\n\t}\n}", "title": "" }, { "docid": "81699f79bdaeefe6ec4f3696c068bfc7", "score": "0.60521954", "text": "function isSumtree(node) {\n\tvar leftSum = 0;\n\tvar rightSum = 0;\n\tvar nodesToCheck = [node]\n\tvar currentNode = null;\n\n\twhile (nodesToCheck.length > 0) {\n\t\tcurrentNode = nodesToCheck.pop();\n\t\tif (currentNode.left === null && currentNode.right === null) { continue; } //Case: end of tree\n\t\tleftSum = getSum(currentNode.left)\n\t\trightSum = getSum(currentNode.right)\n\n\t\tif (leftSum + rightSum === currentNode.value) {\n\t\t\tif (currentNode.left !== null) {\n\t\t\t\tnodesToCheck.push(currentNode.left)\n\t\t\t}\n\n\t\t\tif (currentNode.right !== null) {\n\t\t\t\tnodesToCheck.push(currentNode.right)\n\t\t\t}\n\t\t\tconsole.log(currentNode.value)\n\t\t} else {\n\t\t\tconsole.log(\"left: \" + leftSum + \" right: \" + rightSum + \" != \" + currentNode.value)\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "42366f0d34813638ae896b4c9b79a661", "score": "0.60516536", "text": "function tree(t) {\n // If no tree, then stop\n if (!t) {\n return 0;\n }\n // Recursively add left branch of tree function.\n // Recursively add right branch of tree function.\n // Return sum of tree values.\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "7ed330c96fd9fe067bc731fed8c6c301", "score": "0.60246086", "text": "function sumNodeValues(nodes) {\n\n return nodes.reduce((accum, node) => {\n accum += node.count;\n return accum;\n }, 0);\n}", "title": "" }, { "docid": "dde17290a59a90be9237a6726b1065a8", "score": "0.601916", "text": "function createSumTree(node) {\n\n\tif (node === null) { // basecase\n\t\treturn 0;\n\t}\n\tvar initialValue = node.value;\n\n\tnode.value = createSumTree(node.left) + createSumTree(node.right)\n\n\treturn node.value + initialValue;\n}", "title": "" }, { "docid": "b64088c0fd93ecb73a9b2ba15626193b", "score": "0.59905285", "text": "function branchSums(root) {\n const sumsArr = [];\n\thelper(root, 0, sumsArr); //call recursive function that populates sumsArr;\n\treturn sumsArr;\n}", "title": "" }, { "docid": "1ba43c3eac9d32ec550df07f674b5b68", "score": "0.5952833", "text": "function pathSum(root, sum) {\n let result = 0\n\n const addToSum = function (node, subSum) {\n if (!node) return;\n subSum += node.val\n if (subSum === sum) result++\n addToSum(node.left, subSum)\n addToSum(node.right, subSum)\n }\n\n const traverseTree = function (node) {\n if (!node) return;\n addToSum(node, 0)\n traverseTree(node.left)\n traverseTree(node.right)\n }\n\n traverseTree(root)\n\n return result\n}", "title": "" }, { "docid": "c78c5f842fdfbd3fef956be561ea03b4", "score": "0.59411174", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "title": "" }, { "docid": "9cebf3091e8182fbaacf4a4a9e5edebf", "score": "0.5914075", "text": "numGreater(lowerBound, total = 0) {\n const toVisit = [this];\n while (toVisit.length) {\n let current = toVisit.shift();\n if (current.root || current.children) {\n let iterable = current.children || current.root.children;\n for (let node of iterable) {\n toVisit.push(node);\n if (node.val > lowerBound) {\n total++;\n }\n }\n }\n }\n return total;\n }", "title": "" }, { "docid": "65b77349bad2e608b551a54932a0d2aa", "score": "0.5906936", "text": "maxSum() {\n if(this.root){\n const leftPath = this.root.left ? this.root.left.pathWithGreatestSum() : 0;\n const rightPath = this.root.right ? this.root.right.pathWithGreatestSum() : 0;\n return leftPath + rightPath + this.root.val;\n } else \n return 0;\n }", "title": "" }, { "docid": "2a5913575112e3464d52d8eb9bfcc7b0", "score": "0.59042996", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "5001940aef07ea26f21a092516b94e25", "score": "0.5882959", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "5001940aef07ea26f21a092516b94e25", "score": "0.5882959", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "b590463b6a1b99f1952391ebde3b4ebf", "score": "0.58792037", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n }", "title": "" }, { "docid": "7518b64be73d284346fb4adb3211892a", "score": "0.58784974", "text": "function averageTree (root){\n let result = []\n if (!root) return result\n let queue = [root]\n while(queue.length> 0){\n let levelSize = queue.length\n let levelSum =0\n for(let i=0; i<levelSize; i++){\n let currentNode = queue.shift()\n levelSum += currentNode.val\n\n if(currentNode.left !==null){\n queue.push(currentNode.left)\n }\n if(currentNode.right!==null){\n queue.push(currentNode.right)\n }\n }\n result.push(levelSum/levelSiza)\n }\n return result\n}", "title": "" }, { "docid": "98ab1b65f9e82485eaac8a862b0ad706", "score": "0.58593136", "text": "function sumList(node) {\n let current = node\n let total = 0\n while (current != null) {\n total += current.data\n current = current.next\n }\n return total\n}", "title": "" }, { "docid": "5c4e4fa241c71e96bc60a74d77cb10af", "score": "0.5848401", "text": "function tree(t) {\n if(!t) {\n return 0\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "title": "" }, { "docid": "8908f34d2fdb56742f0a5a87b34bf9c4", "score": "0.5818149", "text": "function dfsSum(node) {\n if (!node) {\n return 0\n }\n\n const nodeSum = node.val + dfsSum(node.left) + dfsSum(node.right)\n sumCounts.set(nodeSum, (sumCounts.get(nodeSum) || 0) + 1)\n\n return nodeSum\n }", "title": "" }, { "docid": "9cadc6d55b1fd3c26e48e5162e819a55", "score": "0.5816476", "text": "getHeight(node = this.root) { if(!node) {\n return -1;\n }\n let left = this.getHeight(node.left);\n let right = this.getHeight(node.right);\n \n return Math.max(left, right) + 1;\n }", "title": "" }, { "docid": "8375257afe00f54bf48b95c31414923e", "score": "0.5813506", "text": "minHeight(node = this.root) {\n // handle empty binary search tree or end of a leaf\n // once a null node is found substract -1 to get actual leaf height before null node\n if (node === null) {\n return -1;\n }\n // recursion returning left/right nodes and adding +1 to variables\n let left = this.minHeight(node.left);\n let right = this.minHeight(node.right);\n if (left < right) {\n // last return value is leaf with lowest height\n return left + 1;\n } else {\n return right + 1;\n };\n }", "title": "" }, { "docid": "23667cf70aed2368b3eaeb6965461e39", "score": "0.579532", "text": "function searching(node){\n if(node !== null){//if node is not null\n searching(node.left);//look through the left (lower value)\n array.push(node.data);//push node value in\n searching(node.right);//look through the right(higher value)\n }\n }", "title": "" }, { "docid": "0e9d0cc599e315239c75be19de89d897", "score": "0.5773659", "text": "maxSum() {\n\t\tif (!this.root) return 0;\n\t\tlet max = 0;\n\t\t\n\t\tfunction maxSumComp (curNode) {\n\t\t\tlet leftMaxS = curNode.left ? maxSumComp(curNode.left) : 0;\n\t\t\tlet rightMaxS = curNode.right ? maxSumComp(curNode.right) : 0;\n\t\t\tmax = Math.max(max, curNode.val + leftMaxS + rightMaxS);\n\t\t\treturn Math.max(0, leftMaxS + curNode.val, rightMaxS + curNode.val);\n\t\t}\n\n\t\tmaxSumComp(this.root);\n\t\treturn max;\n }", "title": "" }, { "docid": "b0bdaa72165ad9ebd2a28fa3b7982734", "score": "0.57734096", "text": "maxSum(output=null) {\n // base case for empty tree\n if (!this.root) {\n return 0;\n }\n\n let isMainTree = false;\n if (!output) {\n isMainTree = true;\n output = { maximum: -Infinity };\n }\n\n const leftBinaryTree = new BinaryTree(this.root.left);\n const sumLeft = leftBinaryTree.maxSum(output);\n \n const rightBinaryTree = new BinaryTree(this.root.right);\n const sumRight = rightBinaryTree.maxSum(output);\n\n const totalTreeSum = sumLeft + sumRight + this.root.val;\n const leftAndRootSum = sumLeft + this.root.val;\n const rightAndRootSum = sumRight + this.root.val;\n const potentialSums = [\n totalTreeSum,\n leftAndRootSum,\n rightAndRootSum,\n sumLeft,\n sumRight,\n output.maximum\n ];\n\n if (isMainTree) {\n return Math.max(...potentialSums);\n }\n\n // keep track of max sum found in subtree, in case it doesn't include root\n output.maximum = Math.max(...potentialSums);\n\n if (leftAndRootSum === output.maximum) {\n return leftAndRootSum;\n }\n if (rightAndRootSum === output.maximum) {\n return rightAndRootSum;\n }\n // return max of either to explore paths outside of tree\n return Math.max(leftAndRootSum, rightAndRootSum);\n }", "title": "" }, { "docid": "f3bae0278e31df4679419b827cf526ab", "score": "0.5760935", "text": "function nodeDepths(root) {\n // Write your code here.\n let sumOfDepths = 0;\n const stack = [{ node: root, depth: 0 }];\n while (stack.length > 0) {\n const { node, depth } = stack.pop();\n if (node === null) continue;\n sumOfDepths += depth;\n stack.push({ node: node.left, depth: depth + 1 });\n stack.push({ node: node.right, depth: depth + 1 });\n }\n return sumOfDepths;\n}", "title": "" }, { "docid": "9d3594fe055cc548f48d99a42cf92f76", "score": "0.57513046", "text": "function getHeight(root) {\n if (root == null) return 0;\n let leftMax = getHeight(root.left);\n let rightMax = getHeight(root.right);\n return Math.max(leftMax, rightMax) + 1;\n}", "title": "" }, { "docid": "170967cec1c4d742a81e524467a523d8", "score": "0.57509935", "text": "function findValue(root,search) {\n // this is just a DFS and return when you get to the node or when there is no more leaves \n if (root.data === search) return root \n if (root.left) findValue(root.left,search)\n if (root.right) findValue(root.right,search)\n return null \n}", "title": "" }, { "docid": "e90cf06ec87b5e741c1735526503df9c", "score": "0.5741027", "text": "function findFullNode(root) {\n if (root) {\n findFullNode(root.left)\n if (root.left && root.right) {\n console.log(root.value)\n }\n findFullNode(root.right)\n }\n}", "title": "" }, { "docid": "4de5d31d6b1ca77862638ebf372d0f4b", "score": "0.57102275", "text": "function branchSumsHelper(root, branchSum, sumsArray) {\n if (root === null) {\n return;\n }\n\n var newBranchValue = branchSum + root.value;\n\n if (root.right === null && root.left === null) {\n sumsArray.push(newBranchValue);\n return;\n }\n\n branchSumsHelper(root.left, newBranchValue, sumsArray);\n branchSumsHelper(root.right, newBranchValue, sumsArray);\n}", "title": "" }, { "docid": "2b75742f4de4180dfeb9f3387fa52895", "score": "0.57068276", "text": "_findMinNodeValue(node) {\n if (!node) {\n node = this.root;\n }\n while (node.left) {\n node = node.left;\n }\n return node.value;\n }", "title": "" }, { "docid": "e886e803793aa8f2ca0f2d777e314585", "score": "0.5699699", "text": "function tree(t) {\n if (!t) {\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n }", "title": "" }, { "docid": "e886e803793aa8f2ca0f2d777e314585", "score": "0.5699699", "text": "function tree(t) {\n if (!t) {\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n }", "title": "" }, { "docid": "15da525eee1178d7318aad40ffaa6017", "score": "0.56633735", "text": "function bstHeight(tree){\n let leftHeight = 0;\n let rightHeight = 0;\n\n // if no tree object, just return 0\n if(!tree){\n return 0;\n }\n\n if(tree.left){\n // leftHeight storing the amount of times function is called\n leftHeight = bstHeight(tree.left);\n // console.log(leftHeight);\n }\n\n if(tree.right){\n // rightHeight storing the amount of times function is called\n rightHeight = bstHeight(tree.right);\n // console.log(rightHeight);\n }\n // Math.max() returns the largest of the number inputs given. In this case, 2, then adds 1 for root node. \n return Math.max(leftHeight, rightHeight) + 1;\n\n}", "title": "" }, { "docid": "f6e6da0f9fb09a0bca1f8217794f24d9", "score": "0.5658295", "text": "nextLarger(lowerBound) {\n if(!this.root) return null\n let node = [this.root]\n let arr = []\n let currNode;\n let max;\n\n while(node.length !== 0){\n currNode = node.shift()\n arr.push(currNode.val)\n if(currNode.right){\n node.push(currNode.right)\n }\n\n if(currNode.left){\n node.push(currNode.left)\n }\n }\n\n for(let val of arr){\n if(val > lowerBound){\n if(max){\n max = (max > val) ? val : max\n } else {\n max = val\n }\n }\n }\n\n max = (max) ? max : null\n console.log(max)\n return max\n\n }", "title": "" }, { "docid": "1c0feacec7e265bb7c08ca1d2612b8b3", "score": "0.5639808", "text": "size(current_node) {\n if (current_node == null) {\n // console.log(\"null found\")\n return 0;\n }\n // console.log(\"The current val is \", current_node.val)\n var leftSide = this.size(current_node.left);\n var rightSide = this.size(current_node.right);\n return 1 + leftSide + rightSide;\n }", "title": "" }, { "docid": "374ed0dba923c3568103685f25f48a18", "score": "0.56232625", "text": "search(value) {\n // * If root is not available\n // TODO : return\n if (this.root === null) {\n return;\n }\n\n // TODO : Assing root to temp variable for iteration\n var current = this.root;\n\n // TODO : Start while loop, till it doesn't return\n\n while (true) {\n // If current.value is equal to search value\n // TODO : return current\n if (current.value === value) {\n return current;\n }\n\n // * Check if search value is less than root\n if (value < current.value) {\n // * check left node is available of current\n if (current.left !== null) {\n // TODO : assign left node of current to current varible, to continue iterate\n current = current.left;\n } else {\n // TODO : return null, means search value not available\n return null;\n }\n }\n\n // * Check if search value is higher than root\n if (value > current.value) {\n // * Check right node is avalable of current\n if (current.right != null) {\n // TODO : assign right node of current to current varible, to continue iterate\n current = current.right;\n } else {\n // TODO : return null, means search value not available\n return null;\n }\n }\n }\n }", "title": "" }, { "docid": "90d94279fc43fe11957a68177894709d", "score": "0.5615634", "text": "size(){\n //check if there is a root node\n if(!this.root){\n return 0\n }\n //creating a function to recursively count each node\n function check(node){\n if(node === null){\n return 0\n }\n return 1 + check(node.left) + check(node.right)\n }\n return check(this.root)\n }", "title": "" }, { "docid": "0837315dc836d3ac14cf6cfae38fa90f", "score": "0.553249", "text": "function getMaximumNodeValue(rootnode) {\n if(!rootnode) {\n return -Infinity\n }\n\n return Math.max(rootnode.data, Math.max(getMaximumNodeValue(rootnode.left), getMaximumNodeValue(rootnode.right)))\n}", "title": "" }, { "docid": "58b74114788976e6824f9c8b49e754ad", "score": "0.55260694", "text": "findMaximumValue(){\r\n if(this.root === null)\r\n return null;\r\n let max = 0;\r\n findMaxHelper(this.root);\r\n function findMaxHelper (root){\r\n if (root.value > max) \r\n max = root.value;\r\n if(root.left !== null){\r\n findMaxHelper(root.left);\r\n }\r\n\r\n if(root.right !== null){\r\n findMaxHelper(root.right);\r\n }\r\n } \r\n \r\n return max;\r\n }", "title": "" }, { "docid": "009a4ed07a48248c6d437d9c9382e10d", "score": "0.55256224", "text": "function findClosestValueInBst(tree, target) {\n\t// traverse through BST (loop)\n\t// keep track of min difference\n\t// make decision at every node: left or right?\n\tlet min = tree.value - target // -2\n\tlet currentNode = tree // 10\n\twhile (currentNode) {\n\t\tif (Math.abs(currentNode.value - target) < Math.abs(min))\n\t\t\tmin = currentNode.value - target\n\t\tif (target < currentNode.value)\n\t\t\tcurrentNode = currentNode.left\n\t\telse if (target > currentNode.value)\n\t\t\tcurrentNode = currentNode.right\n\t\telse\n\t\t\treturn currentNode.value\n\t}\n\treturn min + target\n}", "title": "" }, { "docid": "447c53e594a5daf3e2e9a644dbce1ff4", "score": "0.55222523", "text": "function findHeightofTree(tree) {\n if (tree == null) {\n return 0;\n }\n if (tree.left == null && tree.right == null) {\n return 1;\n } else {\n const leftHeight = findHeightofTree(tree.left);\n const rightHeight = findHeightofTree(tree.right);\n return 1 + (leftHeight > rightHeight ? leftHeight : rightHeight);\n }\n}", "title": "" }, { "docid": "7690b9e01ead3b8a33f671b0243dfe52", "score": "0.5516727", "text": "search(value) {\n let node = this.root;\n while (node && node.value != value) {\n if (value < node.value) {\n node = node.left;\n } else if (value > node.value) {\n node = node.right;\n }\n }\n if (!node) {\n console.log(`no found ${value}`)\n return undefined;\n }\n return node;\n }", "title": "" }, { "docid": "a8fdb0ef802c5a0f44bea1841f5c35f2", "score": "0.5512947", "text": "function searchBST(root, k){\n let temp = root;\n while(temp !== null){\n if(temp.data < k){\n temp = temp.right;\n } else if(temp.data > k){\n temp = temp.left;\n } else {\n return 1;\n }\n }\n return 0;\n}", "title": "" }, { "docid": "144fc836c46d54d4a6f08f01d938b69b", "score": "0.5512871", "text": "function getHeight(root) {\n // [] If there is not root\n // [] return -1\n if (!root) return -1;\n // [] Use Math.max on getHeight on the left and right children\n // [] Sum up all of the levels\n // return Math.max(1 + getHeight(root.left), 1 + getHeight(root.right))\n return 1 + Math.max(getHeight(root.left), getHeight(root.right))\n}", "title": "" }, { "docid": "a3e955abdd670060ee1fd095fc902361", "score": "0.55030805", "text": "size(count=0, node=this.root){\n if(node){\n console.log(\"Current Node:\", node.value)\n count++;\n console.log(\"Current count:\", count)\n if(node.left){\n count++\n console.log(\"Node to the left:\", node.left.value)\n this.size(count, node.left);\n }\n if(node.right){\n count++\n console.log(\"Node to the right:\", node.right.value)\n this.size(count, node.right);\n }\n }\n // console.log(\"Count one\", count_one, \"Count two\", count_two, \"sum\", );\n return count\n }", "title": "" }, { "docid": "408f3971b5869fb5e6d27c3fdc6eee94", "score": "0.5500476", "text": "function search(node) {\n if(node.left){\n return search(node.left)\n } else {\n return node.value;\n }\n }", "title": "" }, { "docid": "89b2d7a3369e33150f7cf67da30816d7", "score": "0.54992926", "text": "findMinHeight(node = this.root) {\n if(node == null) {\n return -1;\n }\n let left = this.findMinHeight(node.left);\n let right = this.findMinHeight(node.right);\n if(left < right) {\n return left + 1;\n } else {\n return right + 1;\n }\n }", "title": "" }, { "docid": "8ae13b73e11e02a6f9aabd78e72ad13c", "score": "0.5448043", "text": "function BSTHeight(tree) {\n if (!tree) {\n return 0;\n } else {\n let left = BSTHeight(tree.left);\n let right = BSTHeight(tree.right);\n\n if (left > right) {\n return left + 1;\n } else return right + 1;\n }\n}", "title": "" }, { "docid": "b9812ca14a15972e472804984eff1c25", "score": "0.54463756", "text": "min (root) {\n const left = min(root.leftChild);\n const right = min(root.rightChild);\n\n if(this.isLeaf(root)) {\n return 0;\n }\n\n return Math.min(Math.min(left, right), this.root.value);\n }", "title": "" }, { "docid": "8231126f10ec671bfff88acd55dadcd8", "score": "0.5424092", "text": "function heightBST(tree) {\n if (!tree) return 0;\n let leftHeight = heightBST(tree.left);\n let rightHeight = heightBST(tree.right);\n \n return Math.max(leftHeight, rightHeight) + 1;\n }", "title": "" }, { "docid": "4589c540076c9d6620a44c4b762e6532", "score": "0.5419027", "text": "function searchBST(root, k){\n if(root === null){\n return 0;\n }\n if(root.data === k){\n return 1;\n } else if(root.data < k){\n return searchBST(root.right, k);\n } else {\n return searchBST(root.left, k);\n }\n}", "title": "" }, { "docid": "c685cf6c26b1d85629d32b4c47b57b38", "score": "0.5410022", "text": "function solution_1 (root) {\n if (!root) return 0;\n return 1 + countNodes(root.left) + countNodes(root.right);\n}", "title": "" }, { "docid": "b5951d98580040c19bc57b25ca9b54c5", "score": "0.54022306", "text": "function searchBST(root, k){\n if(root === null){\n return 0;\n }\n if(root.data === k){\n return 1;\n }\n let left = searchBST(root.left, k);\n let right = searchBST(root.right, k);\n return left || right;\n}", "title": "" }, { "docid": "8fc40c29b4db63634c7e11dec170e385", "score": "0.5397636", "text": "height(node = this.root){\n if(!node){\n return 0;\n }\n return Math.max(this.height(node.left), this.height(node.right)) + 1;\n }", "title": "" }, { "docid": "ef17395b09da39473ce99a76cd8a076d", "score": "0.539335", "text": "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),//+d3.sum(node.sourceAdds, value),\n d3.sum(node.targetLinks, value)//+d3.sum(node.sourceLosses, value)\n );\n });\n }", "title": "" }, { "docid": "a285fd203d9b94be9b051eb5565ebc9d", "score": "0.538811", "text": "function findHeight(tree) {\n\t// empty\n\tif (tree.key == null) {\n\t\treturn 0;\n\t}\n\t// has children\n\tif (tree.left && tree.right) {\n\t\treturn 1 + Math.max(findHeight(tree.left), findHeight(tree.right));\n\t}\n\n\tif (tree.left) {\n\t\treturn 1 + findHeight(tree.left);\n\t}\n\tif (tree.right) {\n\t\treturn 1 + findHeight(tree.right);\n\t}\n\n\t// no children\n\telse {\n\t\treturn 1;\n\t}\n}", "title": "" }, { "docid": "21674b62e3642e050f1edbc25d344f01", "score": "0.53842944", "text": "search(value) { \n let node = this.root;\n // Search until end of tree is found\n while(node.left || node.right) {\n // Traverse left subtree\n if (node.left && value < node.value) {\n node = node.left;\n }\n // Traverse right subtree\n if (node.right && value > node.value) {\n node = node.right;\n }\n // Check if value has been found\n if (node.value == value) return true;\n }\n return false;\n }", "title": "" }, { "docid": "a7a22b65ad35b3a55aceecd91fceb8d2", "score": "0.5374656", "text": "function computeNodeValues() {\n\t nodes.forEach(function(node) {\n\t node.value = Math.max(\n\t d3.sum(node.sourceLinks, value),\n\t d3.sum(node.targetLinks, value)\n\t );\n\t });\n\t }", "title": "" }, { "docid": "b24859e9be5ee08322b54d11f2696524", "score": "0.5368238", "text": "findMin() {\n // Set the current node to the root node\n let current = this.root;\n // Perform a while loop to check if the current left node is NOT null\n while (current.left !== null) {\n // While the left is not null, set the current node to the left node\n current = current.left;\n }\n // Return the most current data in the end\n return current.data;\n }", "title": "" }, { "docid": "89bdb3484b58a8ebdd61320088967917", "score": "0.53504074", "text": "function levelWeights(node) {\n //create an array of arrays, each idx of array corresponding to the level the nodes are at\n let results = [];\n \n let children = [node.value]; //will be array of arrays, intialize with parent node value\n \n function traverseTree(node, level) {\n if (!node.left && !node.right) {\n return;\n } else {\n if (node.left) {\n // if there is no subarray already for that level in the childrenqueue\n // then create that empty subarray. then add the child value to it\n if (!arr[level]) arr[level] = [];\n children[level].push(node.left.value);\n traverseTree(node.left, level++);\n }\n if (node.right) {\n if (!arr[level]) arr[level] = [];\n children[level].push(node.right.value);\n traverseTree(node.right, level++);\n }\n }\n }\n \n traverseTree(node, 0);\n \n // now we have a fully popluated children array that should look like\n // [[2], [1,3], [4,3,7]]\n // so now we want to iterate over that, sum up each array and push it to final\n \n for (let i=0; i<children.length; i++) {\n let sum = children[i].reduce(function(a,b) {\n return a+b\n }, 0);\n results.push(sum);\n }\n \n return results;\n \n \n}", "title": "" }, { "docid": "e6d3278fa8098fd9a4ae2b6d337e086a", "score": "0.53501207", "text": "findRecursively(val) {\n const findHelper = node => {\n if (node === null) return undefined;\n\n if (node.val === val) return node;\n\n if (val < node.val) {\n if (node.left !== null) {\n return findHelper(node.left);\n }\n }\n\n if (val > node.val) {\n if (node.right !== null) {\n return findHelper(node.right);\n }\n }\n };\n return findHelper(this.root);\n }", "title": "" }, { "docid": "9dc8e3cc5cf76ae278c708c54592e82b", "score": "0.5349733", "text": "function findHeight(tree) {\n if (tree === null) return 0;\n\n const leftHeight = findHeight(tree.left) + 1;\n const rightHeight = findHeight(tree.right) + 1;\n return rightHeight > leftHeight ? rightHeight : leftHeight;\n}", "title": "" }, { "docid": "d86bbab71d2fd4c109d128bffabb49be", "score": "0.53478825", "text": "nextLarger(lowerBound) {\n if(!this.root){\n return null; \n }\n\n let stack = [];\n let current = null; \n stack.push(this.root); \n while(stack.length > 0){\n let node = stack.pop(); \n if(node.val > lowerBound){\n if(!current || node.val < current){\n current = node.val;\n }\n }\n if(node.left){\n stack.push(node.left); \n }\n\n if(node.right){\n stack.push(node.right);\n }\n }\n return current;\n }", "title": "" }, { "docid": "fce9e19a972c75a481afe17541275692", "score": "0.5345031", "text": "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "title": "" }, { "docid": "44c33af195c6a32609fdd2c4050b0001", "score": "0.5344723", "text": "function getDeep (root) {\n if (root == null) return 0;\n var leftDeep = getDeep(root.left);\n var rightDeep = getDeep (root.right);\n return Math.max(leftDeep,rightDeep) + 1;\n}", "title": "" }, { "docid": "515269569af75bba3ef559f4e17096ba", "score": "0.5343792", "text": "function computeNodeValues() {\n nodes.forEach(function (node) {\n node.value = Math.max(utils.sum(node.sourceLinks, value), utils.sum(node.targetLinks, value)) || 1;\n });\n }", "title": "" }, { "docid": "12ae935bfc7f9864a367311b3bacefad", "score": "0.5341208", "text": "function digital_root(n) {\n if(typeof(n) == 'string') {\n n = n.split('');\n } else {\n n = n.toString().split('');\n }\n\n sum = 0;\n\n n.forEach(element => {\n sum += parseInt(element);\n });\n\n sum = sum.toString().split('');\n\n if(sum.length != 1) { \n digital_root(sum.join(\"\")); \n }\n\n return parseInt(sum);\n\n}", "title": "" }, { "docid": "a9ce1b04fc91732a7ea9f3fbf539378d", "score": "0.53381336", "text": "function isBinarySearchTree(root) {\n let stack = [];\n stack.push({node: root, lowerbound: -Infinity, upperbound:Infinity});\n while(stack.length){\n let nodeBundle= stack.pop();\n let currentnode = nodeBundle.node;\n let lowerbound = nodeBundle.lowerbound;\n let upperbound = nodeBundle.upperbound;\n\n //the check\n if(currentnode.value < lowerbound || currentnode.value > upperbound){\n return false;\n }\n\n //push left and right\n if(currentnode.left){\n //going left: new upperbound, lowerbound is still the same\n stack.push({node:currentnode.left, lowerbound: lowerbound, upperbound: currentnode.value})\n }\n if(currentnode.right){\n //going right: new lowerbound, upperbound is still the same\n stack.push({node: currentnode.right,lowerbound: currentnode.value, upperbound:upperbound })\n }\n\n }\n return true;\n}", "title": "" }, { "docid": "2e0b4fb120879d147455af82678de060", "score": "0.53328645", "text": "function diameterOfTree(rootItem, sum, diameter) {\n\n\n for(var i = 0; i < rootItem.length; i++) {\n if(rootItem[i].children && rootItem[i].children.length > 0){\n // console.log(rootItem[i])\n diameterOfTree(rootItem[i].children, sum, diameter)\n // console.log(fetchMax(rootItem[i]))\n // sum += fetchMax(rootItem[i]);\n // console.log(sum)\n\n // console.log(sum)\n diameter = fetchDiameter(rootItem[i]);\n console.log(diameter)\n }\n\n }\n\n return sum;\n\n}", "title": "" }, { "docid": "b600c4dd899416252140bbbd6b53ba11", "score": "0.5328752", "text": "height(root) {\n if (!root) {\n return -1;\n }\n\n if (this.isLeaf(root)) {\n return 0;\n }\n\n // Post order, visiting leaves first\n return Math.max(this.height(root.leftChild) + this.height(root.rightChild));\n }", "title": "" }, { "docid": "c362797579cffd8a1df95bbc0696f239", "score": "0.53287286", "text": "function computeNodeValues() {\r\n nodes.forEach(function(node) {\r\n node.value = Math.max(\r\n d3.sum(node.sourceLinks, value),\r\n d3.sum(node.targetLinks, value)\r\n );\r\n });\r\n }", "title": "" }, { "docid": "648d913676b2617c6c4312c837b85d5d", "score": "0.5321174", "text": "function computeNodeValues() {\n nodes.forEach(function (node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "title": "" }, { "docid": "f5890f620f513bb99d1c7d0e57e99ffb", "score": "0.5312991", "text": "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "title": "" }, { "docid": "f5890f620f513bb99d1c7d0e57e99ffb", "score": "0.5312991", "text": "function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }", "title": "" }, { "docid": "aa7f78f07cad1f16044e552d4487662f", "score": "0.53084457", "text": "function sumAll(arr) {\n var lowest = Math.min(arr[0], arr[1]);\n var highest = Math.max(arr[0], arr[1]);\n var difference = highest - lowest + 1;\n var range = [lowest];\n var sum;\n for (var i = 1; i<difference; i++) {\n range.push(lowest + i);\n }\n sum = range.reduce(function(a, b){\n return a + b;\n }, 0);\n return sum;\n}", "title": "" }, { "docid": "455a5a120f6795e1f7f2a03029295edf", "score": "0.5306832", "text": "function height(node) {\n if (node === null) return 0\n return 1 + Math.max(height(node.left), height(node.right))\n}", "title": "" }, { "docid": "4a706e8c79a66e2d027057247a8e1795", "score": "0.5305485", "text": "inOrder() {\n if (this.root == null) return null;\n let result = [];\n function traverseInOrder(node) {\n node.left && traverseInOrder(node.left);\n result.push(node.value);\n node.right && traverseInOrder(node.right);\n }\n traverseInOrder(this.root);\n return result;\n }", "title": "" }, { "docid": "2b777e4a83a32befcd9287d4a150c634", "score": "0.53044367", "text": "function diameter(node) {\n if (node === null) return 0\n // compute the left node height\n let leftHeight = diameter(node.left)\n // compute the right node height\n let rightHeight = diameter(node.right)\n // 1 + leftHeight + rightHeight is the diameter at this node\n // we update result if it's larger than pre existing result\n result = Math.max(result, 1 + leftHeight + rightHeight)\n // whether the above line updates the result, we need to return the max height of tree\n // at this node\n return 1 + Math.max(leftHeight, rightHeight)\n}", "title": "" }, { "docid": "b9d71028183c56b566b5826ba16671d3", "score": "0.53029364", "text": "function searchBST(root, val) {\n if (root.val === val) return root;\n if (val < root.val && root.left) return searchBST(root.left, val);\n if (val > root.val && root.right) return searchBST(root.right, val);\n return [];\n}", "title": "" }, { "docid": "9de5cd2c71656f169edf1a3c107d5f03", "score": "0.5301862", "text": "function solution_1 (root) {\n if (!root) return 0; // EDGE CASE: empty input\n const memo = []; // each index represents a height (`y`) where root height is 0. value is an object with max/min properties for `x` values\n const stack = [[root, 0, 0]]; // root has `x` and `y` of 0 and 0\n while (stack.length) {\n const [node, x, y] = stack.pop();\n if (!memo[y]) memo[y] = {max: -Infinity, min: Infinity}; // every node has the chance to overtake max/min, so the default values of max and min should be -Infinity and Infinity\n memo[y].max = Math.max(memo[y].max, x);\n memo[y].min = Math.min(memo[y].min, x);\n if (node.left) stack.push([node.left, 2*x, y + 1]); // left children `x` becomes `2*x`\n if (node.right) stack.push([node.right, 2*x + 1, y + 1]); // right children `x` becomes `2*x + 1`\n }\n let maxWidth = 1; // the root, at minimum, has width of 1\n for (const level of memo) {\n maxWidth = Math.max(maxWidth, level.max - level.min + 1); // don't forget to add 1 to the difference\n }\n return maxWidth;\n}", "title": "" }, { "docid": "235e0e8b9f797a976472817cdd4504dd", "score": "0.53017336", "text": "findRecursively(val) {\n\n function findVal(currentNode) {\n //return undefined if no root\n if (!currentNode) return undefined;\n \n //return if the current root is the same as the val\n if (currentNode.val === val) return currentNode;\n //check if current val is larger than val\n if (currentNode.val > val) {\n\n return findVal(currentNode.left)\n }\n //check if current val is smaller than val\n if (currentNode.val < val) {\n\n return findVal(currentNode.right)\n } \n }\n \n return findVal(this.root)\n }", "title": "" } ]
0fe8d68f76d3f7be6803801172271c85
min distance is cell_radius (completely outside frustum)
[ { "docid": "724750185188b6cc2161c62d8d66dc54", "score": "0.60186577", "text": "function distanceToFrustum(frustum_planes, cell_radius, pnt)\n{\n // Determines if the node is inside the viewing frustum.\n var dist = 2.0*cell_radius;\n for (var i = 0; i < 24; i += 4) {\n\tvar n = frustum_planes[i+0] * pnt[0] +\n frustum_planes[i+1] * pnt[1] +\n frustum_planes[i+2] * pnt[2] +\n frustum_planes[i+3];\n\tif (n <= -cell_radius) // Outside the frustum\n\t return -cell_radius;\n dist = Math.min(dist, n);\n }\n return dist;\n}", "title": "" } ]
[ { "docid": "29cd9d2c1d8c2fa1a649b814734fafb3", "score": "0.62854254", "text": "_getNearFactor(distance, radius = PERSONAL_RADIUS) {\n console.log(`_getNearFactor:distance, ${distance} radius: ${radius}`);\n return Utils.clamp(\n distance / radius,\n MIN_NEAR_FACTOR,\n MAX_NEAR_FACTOR)\n }", "title": "" }, { "docid": "ec5a0ae9ddc05ac8dfefa82b58f4af52", "score": "0.62406605", "text": "minRadius(value) {\n doFloatGetterSetter(this, \"minRadius\", value);\n return this;\n }", "title": "" }, { "docid": "ec5a0ae9ddc05ac8dfefa82b58f4af52", "score": "0.62406605", "text": "minRadius(value) {\n doFloatGetterSetter(this, \"minRadius\", value);\n return this;\n }", "title": "" }, { "docid": "ec5a0ae9ddc05ac8dfefa82b58f4af52", "score": "0.62406605", "text": "minRadius(value) {\n doFloatGetterSetter(this, \"minRadius\", value);\n return this;\n }", "title": "" }, { "docid": "ce3865d0e10ad8c36acc1374e9ed60bf", "score": "0.62000865", "text": "function getMinimalSquare(cellCount) {\n\t\treturn {\n\t\t\tx: Math.ceil(Math.sqrt(cellCount)),\n\t\t\ty: Math.round(Math.sqrt(cellCount))\n\t\t};\n\t}", "title": "" }, { "docid": "c831523d5f9dd4c93af718f1614d1f9f", "score": "0.59243417", "text": "minimumDistanceToPointSquared(point) {\n const closeX = point.x < this.minX ? this.minX : point.x > this.maxX ? this.maxX : null;\n const closeY = point.y < this.minY ? this.minY : point.y > this.maxY ? this.maxY : null;\n let d;\n if (closeX === null && closeY === null) {\n // inside, or on the boundary\n return 0;\n } else if (closeX === null) {\n // vertically directly above/below\n d = closeY - point.y;\n return d * d;\n } else if (closeY === null) {\n // horizontally directly to the left/right\n d = closeX - point.x;\n return d * d;\n } else {\n // corner case\n const dx = closeX - point.x;\n const dy = closeY - point.y;\n return dx * dx + dy * dy;\n }\n }", "title": "" }, { "docid": "23e4334f1c2d1eded1343829ea217c1d", "score": "0.58631396", "text": "function isInsideFrustum(frustum_planes, cell_radius, pnt)\n{\n // Determines if the node is inside the viewing frustum.\n var min_n = 2.0 * cell_radius;\n for (var i = 0; i < 24; i += 4) {\n // negative n = outside, positive n = inside\n\tvar n = frustum_planes[i+0] * pnt[0] +\n frustum_planes[i+1] * pnt[1] +\n frustum_planes[i+2] * pnt[2] +\n frustum_planes[i+3];\n\tif (n < -cell_radius) // Cell is completely outside the frustum\n\t return -1;\n min_n = Math.min(min_n, n);\n }\n if (min_n > cell_radius) // Cell is completely inside the frustum\n return 1; \n return 0; // Cell is part inside, part outside the frustum\n}", "title": "" }, { "docid": "373ef338747b81134624bc86d1e65a8c", "score": "0.58023894", "text": "getRadiusMin() {\n return this.rMin;\n }", "title": "" }, { "docid": "d1442c4d951ef7dea4aed0af61623a2c", "score": "0.57668567", "text": "function getNearest()\n{\n var dist = Number.MAX_VALUE;\n for (count = 0; count<ridesLatLng.length; count++){\n var temp = toMiles(google.maps.geometry.spherical.computeDistanceBetween(me, ridesLatLng[count]));\n if (temp < dist){\n dist = temp;\n }\n }\n return dist;\n}", "title": "" }, { "docid": "c5d42450e09d440915054c84c53109ed", "score": "0.5655654", "text": "checkDistance(){\n return Math.sqrt(((this.orgPosition.x - this.x) * (this.orgPosition.x - this.x)) + (this.orgPosition.y - this.y) * (this.orgPosition.y - this.y)) > this.maxDis;\n }", "title": "" }, { "docid": "04edbed0dae5a91ca6010409a37947cd", "score": "0.5628249", "text": "function getMinBox() {\n //get coordinates \n let coorX = coords.map(function (p) {\n return p.x\n });\n let coorY = coords.map(function (p) {\n return p.y\n });\n\n //find top left and bottom right corners \n let min_coords = {\n x: Math.min.apply(null, coorX),\n y: Math.min.apply(null, coorY)\n }\n let max_coords = {\n x: Math.max.apply(null, coorX),\n y: Math.max.apply(null, coorY)\n }\n\n //return as strucut \n return {\n min: min_coords,\n max: max_coords\n }\n}", "title": "" }, { "docid": "2bb0b785a667e13a4a1fe05ceced1e11", "score": "0.5613433", "text": "function getDistance() {\n RENDER = false;\n distances = [];\n for (let sy = 0; sy < height; sy++) {\n for (let sx = 0; sx < width; sx++) {\n let d = [];\n for (let i = 0; i < inputCoords.length; i++) {\n const { x, y } = inputCoords[i];\n d.push((Math.abs(x - sx) ^ 2) + (Math.abs(y - sy) ^ 2));\n }\n distances.push(Math.min(...d));\n }\n }\n RENDER = false;\n}", "title": "" }, { "docid": "04537bcc8b343a0af3042534223b08e5", "score": "0.5590887", "text": "inradius() {\n return this.height / 2;\n }", "title": "" }, { "docid": "dcaecaa4e443298648e5c12aef50a907", "score": "0.5541134", "text": "perpWallDist() {\n if(this.sideHit % 2 == EAST_WEST) //hit east-west side\n return (this.mapX - this.startX + (1 - this.stepX) / 2) / this.vector.x;\n else //hit north-south side\n return (this.mapY - this.startY + (1 - this.stepY) / 2) / this.vector.y; \n }", "title": "" }, { "docid": "fc4bc7d8f00143a5fe21d26a33201b89", "score": "0.55406076", "text": "function countSurroundingMines(cell) {\n var surroundingCellsArray = lib.getSurroundingCells(cell.row, cell.col);\n var countMines = 0\n for (let i=0; i<surroundingCellsArray.length; i++){\n if (surroundingCellsArray[i].isMine == true){\n countMines ++\n }\n else {\n countMines = countMines\n }\n }\n return countMines\n}", "title": "" }, { "docid": "b3a1344ef4e60eace25a9e3798a3f6a1", "score": "0.5529756", "text": "function countSurroundingMines (cell) {\n var surrounding = lib.getSurroundingCells (cell.row, cell.col);\n var surroundingMines = 0;\n for (var i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine) {\n surroundingMines++;\n }\n }\n return surroundingMines;\n }", "title": "" }, { "docid": "e6eba2b1d8fd933d055ab9b2e8f0abef", "score": "0.55120295", "text": "grow() {\n if(this.initDistX < this.initDistY) {\n this.initDistX += this.deltaDistX;\n this.mapX += this.stepX;\n //side = east/west\n\t\t\tif(this.vector.x > 0)\n\t\t\t\tthis.sideHit = WEST;\n\t\t\telse\n\t\t\t\tthis.sideHit = EAST;\n } else {\n this.initDistY += this.deltaDistY;\n this.mapY += this.stepY;\n //side = north/south\n\t\t\tif(this.vector.y > 0)\n\t\t\t\tthis.sideHit = SOUTH;\n\t\t\telse\n\t\t\t\tthis.sideHit = NORTH;\n }\n //now safe to check if a wall was hit\n }", "title": "" }, { "docid": "9b28e746b701584b73365e28af6c4912", "score": "0.5501526", "text": "function countSurroundingMines (cell) {\n return lib.getSurroundingCells(cell.row, cell.col) \n}", "title": "" }, { "docid": "9cf5c7c90ad442262efc69856027a584", "score": "0.5485651", "text": "function findMinCircle(points){\n let circ = enclosingCircle(points);\n let p = new Util.Point(circ.x, circ.y);\n return new Circle(p, circ.r);\n}", "title": "" }, { "docid": "bcc02a772d6173a177a774d72e34ed74", "score": "0.5461326", "text": "function getMinNorthingFromAllPoints() {\n\tvar minNorthing = 100000;\n\tfor (var i = 0; i < allPoints.length; i++) {\n\t\tif (allPoints[i].position().y < minNorthing){\n\t\t\tminNorthing = allPoints[i].position().y;\n\t\t}\n\t}\n\treturn minNorthing;\n}", "title": "" }, { "docid": "7b48ecef1a2367034057ae768c2f0a7f", "score": "0.54607105", "text": "constrain(){\n if(this.location.x+this.radius>=width){\n this.velocity.x*=-1;\n }\n if(this.location.x-this.radius<=0){\n this.velocity.x*=-1;\n }\n if(this.location.y+this.radius>=height){\n this.velocity.y*=-1;\n }\n if(this.location.y-this.radius<=0){\n this.velocity.y*=-1;\n }\n collide();\n }", "title": "" }, { "docid": "ff769b7173da37ae0e006fdf510d569f", "score": "0.54595834", "text": "function rowLengthDistZig(x) {\n if((Math.sqrt(-1 * (Math.pow((x / 2), 2) - Math.pow(minDist, 2))) * 2) < minDist) {\n console.log('Here!');\n return minDist + 1;\n } else {\n return Math.sqrt(-1 * (Math.pow((x / 2), 2) - Math.pow(minDist, 2)));\n }\n \n }", "title": "" }, { "docid": "851aa5d03158e48bad5711381888f5e9", "score": "0.54593843", "text": "function countSurroundingMines(cell) {\n var mines = []\n var surroundingCells = lib.getSurroundingCells(cell.row, cell.col);\n\n for (var i = 0; i < surroundingCells.length; i++) {\n if (surroundingCells[i].isMine === true) {\n mines.push(surroundingCells[i]);\n } else {}\n }\n return mines.length;\n}", "title": "" }, { "docid": "91d158b794ff2f8db69b6502230e6c68", "score": "0.54593414", "text": "function calculateNearestObject(fromX, fromY)\r\n{\r\n // distance to first circle in array\r\n let minD = Number.MAX_SAFE_INTEGER;\r\n for(let i = 0; i < objects.length; ++i)\r\n {\r\n if(objects[i].type == 'circle')\r\n {\r\n let currentD = Math.hypot(fromX - objects[i].cx, fromY - objects[i].cy) - objects[i].radius;\r\n if(minD > currentD)\r\n {\r\n minD = currentD\r\n }\r\n }\r\n else if(objects[i].type == 'square')\r\n {\r\n let currentD = distanceToSquare(fromX, fromY, objects[i]);\r\n if(minD > currentD)\r\n {\r\n minD = currentD\r\n }\r\n }\r\n }\r\n return minD;\r\n}", "title": "" }, { "docid": "d47bc23da8644aca3f1083ba3a22fd2e", "score": "0.5448287", "text": "function rectDistance(r1, r2) {\n if (cc.rectIntersectsRect(r1, r2) || cc.rectContainsRect(r1, r2) || cc.rectContainsRect(r2, r1)) {\n return 0;\n }\n\n let minDistance = Infinity;\n for (const p of rectPoints(r1)) {\n for (const [p1, p2] of rectSegments(r2)) {\n minDistance = Math.min(minDistance, distToSegment(p, p1, p2));\n }\n }\n for (const p of rectPoints(r2)) {\n for (const [p1, p2] of rectSegments(r1)) {\n minDistance = Math.min(minDistance, distToSegment(p, p1, p2));\n }\n }\n\n return minDistance;\n }", "title": "" }, { "docid": "e0ff4d5f099d90336c009c7b4671affc", "score": "0.54289484", "text": "getStartingCell(){\n for (let i = 0; i < this.dimension; i++){\n for (let j = 0; j < this.dimension; j++){\n if (this.grid[i][j].isStartingPoint){\n return {x: i, y: j};\n }\n }\n }\n }", "title": "" }, { "docid": "d1ab60a88c3ff05d9f0916d51706d384", "score": "0.542564", "text": "function checkDist(){\n let closestDist;\n let maxDist = 1000;\n\n //for each value in the points array, check to define which value is the lowest.\n points.forEach(element => {\n if(shapeToMove.dist(element) < maxDist){\n //assign the maxDist to the lowest value in the array\n maxDist = shapeToMove.dist(element);\n //closest distance will be the lowest distance value in the array when compared to the shapeMove\n closestDist = element;\n }\n });\n //Return the closestDist value\n return closestDist;\n}", "title": "" }, { "docid": "2018c5a669e545b5f0d87d03b0e15d45", "score": "0.54049516", "text": "function greatCircleDistPart(lat, cosLat, sinLat, cosLngDelta) {\n var d = sinLat * Math.sin(lat * rad) +\n cosLat * Math.cos(lat * rad) * cosLngDelta;\n return Math.min(d, 1);\n }", "title": "" }, { "docid": "5a7e651cb39ae2c14d1e553f649d092e", "score": "0.5399284", "text": "find_nearest_grid(ws_x, ws_z) {\n\t\tvar tgs = this.ws_to_tgs(ws_x, ws_z);\n\t\tvar gs_z = Math.round(tgs.z / this.grid_cell_size);\n\t\tvar gs_x = Math.round(tgs.x / this.grid_cell_size);\n\t\tif (gs_z === 10.0) {\n\t\t\tgs_z = 9.0;\n\t\t}\n\t\tif (gs_x === 10.0) {\n\t\t\tgs_x = 9.0;\n\t\t}\n\t\treturn {z: gs_z, x: gs_x};\n\t}", "title": "" }, { "docid": "1cefb6efa349432cd485b9a8a47910c9", "score": "0.5356477", "text": "minLat(value) {\n doFloatGetterSetter(this, \"minLat\", value);\n return this;\n }", "title": "" }, { "docid": "1cefb6efa349432cd485b9a8a47910c9", "score": "0.5356477", "text": "minLat(value) {\n doFloatGetterSetter(this, \"minLat\", value);\n return this;\n }", "title": "" }, { "docid": "1cefb6efa349432cd485b9a8a47910c9", "score": "0.5356477", "text": "minLat(value) {\n doFloatGetterSetter(this, \"minLat\", value);\n return this;\n }", "title": "" }, { "docid": "1e092f407fb005ddc27d20dcd0330ed0", "score": "0.5355746", "text": "function countSurroundingMines (cell) {\r\n var surroundingCells = getSurroundingCells(cell.row, cell.col)\r\n var count = 0;\r\n for (var j=0; j<surroundingCells.length; j++) {\r\n if (surroundingCells[j].isMine == true) {\r\n count ++\r\n }\r\n }\r\n return count\r\n\r\n// filter method also works.\r\n// var cellsWithMines = surroundingCells.filter(function (obj) {\r\n// return obj.isMine == true;\r\n// });\r\n// return cellsWithMines.length;\r\n}", "title": "" }, { "docid": "580daba0ba0392b2e6bdf5e3b4f4d589", "score": "0.53514594", "text": "function radius(d) {\n return default_circle_radius * (1 + Math.pow(d.loc * 1.0 / max_loc, 1.1)); // default_circle_radius + default_circle_radius * d.source / 10;\n}", "title": "" }, { "docid": "6b5909177877b1b31d9eed144de9e1bc", "score": "0.53411543", "text": "function countSurroundingMines (cell) {\n \nlet surroundingCells = lib.getSurroundingCells(cell.row, cell.col);\nlet count =0;\n\nfor (i=0; i<surroundingCells.length; i++ )\n if(surroundingCells[i].isMine)\n {\n count++;\n }\n return count;\n }", "title": "" }, { "docid": "525afea90ba40d0afb4c9cb13c6524d0", "score": "0.532757", "text": "function minDistanceVector(convexHull, pt) {\n\t\tvar minDist = null,\n\t\tminDistIndex = null;\n\t\tfor (var i = 0; i < convexHull.length; i++) {\n\t\t\tvar tmpDist = distToSegment(pt, convexHull[i][0], convexHull[i][1]);\n\t\t\tif (minDist === null || tmpDist < minDist) {\n\t\t\t\tminDist = tmpDist;\n\t\t\t\tminDistIndex = i;\n\t\t\t}\n\t\t}\n\n\t\tif (minDist !== null) {\n\t\t\tvar dx = convexHull[minDistIndex][0].x - convexHull[minDistIndex][1].x,\n\t\t\tdy = convexHull[minDistIndex][0].y - convexHull[minDistIndex][1].y,\n\t\t\tpp2 = {\n\t\t\t\tx : pt.x + dy,\n\t\t\t\ty : pt.y - dx\n\t\t\t},\n\t\t\tintersectionData = checkLineIntersection(pt, pp2, convexHull[minDistIndex][0], convexHull[minDistIndex][1]);\n\t\t\treturn ({\n\t\t\t\tvector : {\n\t\t\t\t\tx : intersectionData.x - pt.x,\n\t\t\t\t\ty : intersectionData.y - pt.y\n\t\t\t\t},\n\t\t\t\tedge : [convexHull[minDistIndex][0], convexHull[minDistIndex][1]]\n\t\t\t});\n\t\t} else {\n\t\t\t// It only happens if convexHull is empty\n\t\t\tconsole.log('Null distance vector');\n\t\t\treturn (null);\n\t\t}\n\t}", "title": "" }, { "docid": "d465d49a61147d841398c67d2b3817a5", "score": "0.5326633", "text": "getFlexRadius() {\n if (this.map.getZoom() < 3) {\n return this.options.radius / (3 * (4 - this.map.getZoom()));\n } else if (this.map.getZoom() > 2 && this.map.getZoom() < 8) {\n return this.options.radius / (9 - this.map.getZoom());\n } else {\n return this.options.radius;\n }\n }", "title": "" }, { "docid": "402c2eebd1d6bf51ab52e9f54082a0ac", "score": "0.5323483", "text": "function distance(x,y,cell){\n const xDist = Math.abs(cell.x-x)\n const yDist = Math.abs(cell.y-y)\n if(xDist>yDist){return xDist}\n return yDist\n}", "title": "" }, { "docid": "5cd3c9a762a4b97ed640375d1281ace1", "score": "0.53234684", "text": "function firstRowMaxStag() {\n return Math.floor((cWidth / minDist) + 1);\n }", "title": "" }, { "docid": "b4916003abea8132d878ebba936bf4ee", "score": "0.5317211", "text": "sunRadius() {\n\t\tconst w = this.REO.width-18; // We don't want scroll bars to the right or bottom of view.\n\t\tconst h = this.REO.height-18;\n\t\tconst wp2 = w*0.125;\n\t\tconst hp2 = h*0.125;\n\t\tconst r = Math.min(wp2, hp2); // r = 0,125 x W or H, whichever is smallest (d=0,25 x W or H)\n\t\treturn r;\n\t}", "title": "" }, { "docid": "2dc13c27128d704db91bd8dedb1b3279", "score": "0.5315904", "text": "getCenterX() {\n return (this.maxX + this.minX) / 2;\n }", "title": "" }, { "docid": "541d1e0d41b41b63e5fbe773ca276cc9", "score": "0.5313531", "text": "function getMapMinPixel()\n{\n return MAP_BORDER_THICKNESS * TILE_WIDTH;\n}", "title": "" }, { "docid": "13fc9f8b956fb6d2a17cc9f4266470cd", "score": "0.53064966", "text": "findFreeSpot() {\r\n let maxDist = 0;\r\n const canvasW = this.gr.canvas.width;\r\n const canvasH = this.gr.canvas.height;\r\n let x = canvasW / 2;\r\n let y = canvasH / 2;\r\n for (let xx = 10; xx < canvasW - this.nw; xx += 10) {\r\n for (let yy = 10; yy < canvasH - this.nh; yy += 10) {\r\n const dist = this.dist2nearestNode(xx, yy);\r\n if (dist > maxDist && dist < this.nw * 3) {\r\n x = xx;\r\n y = yy;\r\n maxDist = dist;\r\n }\r\n }\r\n }\r\n return { x, y };\r\n }", "title": "" }, { "docid": "f30cad9088a3e176a76a83aa92d01a61", "score": "0.5306217", "text": "function countSurroundingMines (cell) {\n var surroundingCells = getSurroundingCells(cell.row, cell.col);\n var count = 0\n for(x of surroundingCells){\n if(x.isMine){\n count+=1\n }\n }\n return count\n}", "title": "" }, { "docid": "17c17aebb054add998e96027cbd1d853", "score": "0.5297318", "text": "getMinX() {\n return 0;\n }", "title": "" }, { "docid": "c03fe7bc1e673bb316edb1c9e3fe53f8", "score": "0.5289579", "text": "__constrain_to_fulcrum() {\n const distance_from_apex = this.__farthest_length - this.__camera_position[2] + this.__nearest_length;\n const maximum_distance_from_axis = Math.sin((this.__fov * Math.PI / 180) * 0.5) * distance_from_apex;\n let x_axial_distance = this.__camera_position[0] - (this.__scene_size[0] / 2);\n let y_axial_distance = this.__camera_position[1] - (this.__scene_size[1] / 2);\n\n x_axial_distance = Math.min(maximum_distance_from_axis, Math.abs(x_axial_distance)) * Math.sign(x_axial_distance);\n y_axial_distance = Math.min(maximum_distance_from_axis, Math.abs(y_axial_distance)) * Math.sign(y_axial_distance);\n\n\n this.__camera_position[0] = (this.__scene_size[0] / 2) + x_axial_distance;\n this.__camera_position[1] = (this.__scene_size[1] / 2) + y_axial_distance;\n }", "title": "" }, { "docid": "d68450f6e309090d8653d1b26c14107a", "score": "0.52877456", "text": "function countSurroundingMines (cell) {\nvar surroundingCells =\n getSurroundingCells(cell.row, cell.col, cell.isMine, cell.isMarked);\n\n var count = 0;\n\n for(var i = 0; i < surroundingCells.length; i++){\n if(surroundingCells[i].isMine === true)\n {\n\n count += 1000;\n }\n }\n return count;\n}", "title": "" }, { "docid": "b9d122be30c8cdde54e269383742c34d", "score": "0.5283102", "text": "function isPartInsideFrustum(frustum_planes, cell_radius, pnt)\n{\n // Determines if the node is inside the viewing frustum.\n for (var i = 0; i < 24; i += 4) {\n\tvar n = frustum_planes[i+0] * pnt[0] +\n frustum_planes[i+1] * pnt[1] +\n frustum_planes[i+2] * pnt[2] +\n frustum_planes[i+3];\n\tif (n < -cell_radius) { // Cell is completely outside the frustum\n\t return false;\n\t}\n }\n return true;\n}", "title": "" }, { "docid": "8b953b8a9872a1f80172b77f8a46f7fa", "score": "0.5281601", "text": "function minDist(jab) {\n let cvd_colors = calcCVD(jab);\n let min_dist = 9999;\n Object.keys(cvd_colors).forEach(function(key) {\n for (let k = 0; k < cvd_colors[key].length; k++)\n for (let i = 0; i < colors.length; i++)\n for (let j = 0; j < colors[i][key].length; j++)\n min_dist = Math.min(min_dist, cvd_colors[key][k].de(\n colors[i][key][j]));\n });\n return min_dist;\n}", "title": "" }, { "docid": "cddf6dc8bbe2a98b8bffb9b07dd48ebc", "score": "0.5281185", "text": "function countSurroundingMines (cell) {\n\tconsole.log(cell);\n\t// Get surrounding cells\n\tvar surrounding = lib.getSurroundingCells(cell.row, cell.col)\n\n\t// If cell has mine add to counter\n\tlet numOfSurroundingMines = 0;\n\tsurrounding.forEach(cell=>{\n\t\tif(cell.isMine) numOfSurroundingMines++;\n\t});\n\treturn numOfSurroundingMines;\n}", "title": "" }, { "docid": "d832b459c3f31f631d89236e2fc66faf", "score": "0.5278919", "text": "function minLightnessDist(J) {\n let min_dist = 9999;\n for (let i = 0; i < colors.length; i++)\n min_dist = Math.min(min_dist, Math.abs(J - colors[i].base[0].J));\n return min_dist;\n}", "title": "" }, { "docid": "846b2e2118fa50e7a52e4afdf8c7e63b", "score": "0.52725244", "text": "getNearestObstacleInDirection(d) {\n // current tile that you're checking for obstacles == death\n let checkLocation = this.location;\n // distance to the current check tile\n let dist = 0;\n while (!checkLocation.colliding(this, width, height)) {\n checkLocation = checkLocation.add(d);\n dist = this.location.distanceTo(checkLocation);\n }\n return dist;\n }", "title": "" }, { "docid": "3e188562d130d7738d41f3ad6144b5a5", "score": "0.52717894", "text": "getCenter() {\n return (this._max + this._min) / 2;\n }", "title": "" }, { "docid": "72508f22bc6cb4515ede1a8db437ebdb", "score": "0.5268338", "text": "updateBoundingSphereRadius() {\n // Assume points are distributed with local (0,0,0) as center\n let max2 = 0;\n const vertices = this.vertices;\n const v = new Vec3();\n\n for (let i = 0, N = vertices.length / 3; i !== N; i++) {\n this.getVertex(i, v);\n const norm2 = v.lengthSquared();\n\n if (norm2 > max2) {\n max2 = norm2;\n }\n }\n\n this.boundingSphereRadius = Math.sqrt(max2);\n }", "title": "" }, { "docid": "65af8458957f9d85f9570c0cca423ca6", "score": "0.52617425", "text": "function firstRowMaxZig() {\n return Math.floor(cWidth / minDist);\n }", "title": "" }, { "docid": "c54f4447323ba6e308f80fba47e5b169", "score": "0.5259805", "text": "function findFreeNeighbors() {\r\n\t// First loop over all cells\r\n\tfor ( row = 1; row <= m.numRows; row++ ) {\r\n\t\tfor ( col = 1; col <= m.numCols; col++ ) {\r\n\t\t\tvar c = m.cells[row][col];\r\n\t\t\tc.numFreeNeighbors = undefined;\r\n\t\t\tif (!c.covered && c.numSurroundingMines > 0) {\r\n\t\t\t\t// Then for each cell, loop over surrounding cells\r\n\t\t\t\tfor (i = row - 1; i <= row + 1; i++) {\r\n\t\t\t\t\tfor (j = col - 1; j <= col + 1; j++) {\r\n\t\t\t\t\t\t// applying to surrounding cells, but we skip actual cell\r\n\t\t\t\t\t\tif (i == row && j == col) { continue; }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tc2 = m.cells[i][j];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (c2.$elem && c2.covered && c2.flagStateIndex === 0) {\r\n\t\t\t\t\t\t\tc.numFreeNeighbors++;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "6239d834f18d4ce8982e6ff7c9e21940", "score": "0.52518886", "text": "function countSurroundingMines (cell) {\n \n //Get surrounding cells\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n var mineCount = 0\n\n //Loop through surrounding cells counting number of mines\n for (var i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine) mineCount++ \n }\n //Return the number of mines\n return mineCount\n}", "title": "" }, { "docid": "bf080a22b630f173131d15a7e1504ecc", "score": "0.5248172", "text": "getMinX() {\n return this.minX;\n }", "title": "" }, { "docid": "df7691b0a342f1a96b983f6de438b9c0", "score": "0.5244543", "text": "function countSurroundingMines (cell) {\n var count = 0;\n var surrounding = lib.getSurroundingCells(cell.row, cell.col);\n for (var i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine === true) {\n count++;\n }\n return count;\n}\n}", "title": "" }, { "docid": "ad8564ee231e8db470e73d2abc240925", "score": "0.5242517", "text": "updateDimensions() {\n let cx = this.center.components[0];\n let cy = this.center.components[1];\n let cz = this.center.components[2];\n\n this.min[0] = cx - this.radius;\n this.min[1] = cy - this.radius;\n this.min[2] = cz - this.radius;\n this.max[0] = cx + this.radius;\n this.max[1] = cy + this.radius;\n this.max[2] = cz + this.radius;\n\n // Precalculate to simplify ray test\n this.left = cx - this.radius;\n this.right = cx + this.radius;\n this.back = cz - this.radius;\n this.front = cz + this.radius;\n this.bottom = cy - this.radius;\n this.top = cy + this.radius;\n\n return this;\n }", "title": "" }, { "docid": "061d2141456c956aa071f2b60a81a383", "score": "0.5238216", "text": "function getNearbyMines(...param) {\n const [\n isMine,\n x,\n y,\n rowCount,\n columnCount,\n mines\n ] = param\n let nearby = 0\n if(!isMine) {\n for(let i = -1; i < 2; i++) {\n for(let j = -1; j < 2; j++) {\n mines.map(mine => {\n const tempX = x + i\n const tempY = y + j\n if((tempX > -1 && tempY > -1) && (tempX < columnCount && tempY < columnCount)) {\n if(`${tempX},${tempY}` === mine) {\n nearby++\n }\n }\n })\n }\n }\n }\n\n return nearby\n}", "title": "" }, { "docid": "b0d3d8672bb96dc057a8a61c14638213", "score": "0.52370936", "text": "get centerCell() {\n\t return Math.floor(this.cellsWide / 2);\n\t }", "title": "" }, { "docid": "87500baf2e43d6c30e49cdde24024125", "score": "0.5232368", "text": "function _extractMin(Q, dist){\n\n // start at highest distance possible -Infinity\n let minimumDistance = Infinity;\n let nodeWithMinimumDistance = null;\n\n // for each edge in vertex get distance\n // if lower than current lowest then save that new lowest\n // and save the node that has the lowest route (edge to that node)\n for(const node in Q){\n if(dist[node > minimumDistance]) continue;\n minimumDistance = dist[node];\n nodeWithMinimumDistance = node;\n }\n\n return nodeWithMinimumDistance;\n }", "title": "" }, { "docid": "3921682803ac9b7f3b6fbf7ccbfec01a", "score": "0.52261436", "text": "westOf (x, n = 1) { return x - n * this.bounds().xSpacing() }", "title": "" }, { "docid": "97f40f924c3657b1f6a6b405f27690a4", "score": "0.51973027", "text": "function countSurroundingMines (cell) {\n //getSurroundingCells (row, col) \n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n \n var cntTrue=0\n for (i = 0; i < surrounding.length; i++){\n if (surrounding[i].isMine == true){\n cntTrue++\n }\n }\n return cntTrue\n}", "title": "" }, { "docid": "7feff3abc2d0415d8b178163676792ed", "score": "0.5185796", "text": "circularRadius() {\n return this.isCircular ? this._matrix.columnXMagnitude() : undefined;\n }", "title": "" }, { "docid": "e98ad9cbbd5c154a5f7c3466e8c8509d", "score": "0.5183248", "text": "function countSurroundingMines (cell) {\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n var count = 0\n for (var i = 0; i < surrounding.length; i++) {\n if(surrounding[i].isMine === true) {\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "74d6e30661b86a5482d6dc3623bf0966", "score": "0.5172351", "text": "function getMinEastingFromAllPoints() {\n\tvar minEasting = 100000;\n\tfor (var i = 0; i < allPoints.length; i++) {\n\t\tif (allPoints[i].position().x < minEasting){\n\t\t\tminEasting = allPoints[i].position().x;\n\t\t}\n\t}\n\treturn minEasting;\n}", "title": "" }, { "docid": "f9ffc04f604ae0a4201e78b278fb154f", "score": "0.5168732", "text": "function countSurroundingMines (cell) {\n\nvar surrounding = lib.getSurroundingCells(cell.row, cell.col)\nvar count = 0\n\nfor (var i = 0; i < surrounding.length; i++) {\n var surroundingCell = surrounding[i]\n\n if (surroundingCell.isMine) {\n count++\n }\n}\n return count\n}", "title": "" }, { "docid": "c60683a5aea299574afd6e889be6c69b", "score": "0.5154754", "text": "function countSurroundingMines (cell) {\r\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\r\n var count = 0\r\n for (i = 0; i < surrounding.length; i++){\r\n if (surrounding[i].isMine === true) {\r\n count ++ \r\n }}\r\nreturn count\r\n}", "title": "" }, { "docid": "d157a07f9ba53def4c3604f7a0e6b8ae", "score": "0.514076", "text": "function best_zoom(bounds, mnode) {\n var width = mnode.offsetWidth;\n var height = mnode.offsetHeight;\n\n var dlat = Math.abs(bounds.maxY - bounds.minY);\n var dlon = Math.abs(bounds.maxX - bounds.minX);\n if(dlat == 0 && dlon == 0)\n return 4;\n \n // Center latitude in radians\n var clat = Math.PI*(bounds.minY + bounds.maxY)/360.;\n\n var C = 0.0000107288;\n var z0 = Math.ceil(Math.log(dlat/(C*height))/Math.LN2);\n var z1 = Math.ceil(Math.log(dlon/(C*width*Math.cos(clat)))/Math.LN2);\n\n return (z1 > z0) ? z1 : z0;\n}", "title": "" }, { "docid": "7f4b472940edd5fb8902ffb777379d9d", "score": "0.5140213", "text": "minDepth(value) {\n doFloatGetterSetter(this, \"minDepth\", value);\n return this;\n }", "title": "" }, { "docid": "a986795fab8f88cb147e41aa92adc5e5", "score": "0.5140149", "text": "setNearestTile(){\n this.nearestTile.x = this.game.math.snapToFloor(Math.floor(this.x), config.gridsize) / config.gridsize;\n this.nearestTile.y = this.game.math.snapToFloor(Math.floor(this.y), config.gridsize) / config.gridsize;\n }", "title": "" }, { "docid": "fc66ff3561efc0bc87083a91ff93878c", "score": "0.5140106", "text": "function countSurroundingMines(cell) {\n var surrounding = lib.getSurroundingCells(cell.row, cell.col);\n var count = 0\n // for each the surrounding cells\n for (var j = 0; j < surrounding.length; j++)\n // if isMine == true\n if (surrounding[j].isMine) {\n // add to the count\n count++\n }\n return count\n}", "title": "" }, { "docid": "1ea14500fc5fc44bdc516d777b94705a", "score": "0.51348704", "text": "findMin(g) {\n let min = undefined;\n let nodesSoFar = Object.keys(this.usedNodes);\n for (let i = 0; i < nodesSoFar.length; i++) {\n let start = parseInt(nodesSoFar[i]);\n let es = g.edges[start];\n for (let n = 0; n < g.nodes.length; n++) {\n let lucky = g.nodes[n];\n if (lucky == start || this.usedNodes[es[lucky].endRobot] !== undefined) continue;\n if (min === undefined || es[lucky].cost < min.cost) {\n min = es[lucky];\n }\n }\n }\n return min;\n }", "title": "" }, { "docid": "bce57dc49189ae60281e002356585bfa", "score": "0.5132359", "text": "inBounds() {\n\t\treturn (this.location.x < width + this.mass &&\n\t\t\tthis.location.x > -this.mass &&\n\t\t\tthis.location.y < height + this.mass &&\n\t\t\tthis.location.y > -this.mass);\n\t}", "title": "" }, { "docid": "a9a2ea0cbf29d2ffe90a4b3ca45e89fa", "score": "0.5127468", "text": "get NEAREST() {\n return gl.NEAREST;\n }", "title": "" }, { "docid": "f4ae9f70b88458d6153a29e4c4f2b09f", "score": "0.51245654", "text": "function minX () {\n return (-imageContext.canvas.width / 2);\n}", "title": "" }, { "docid": "e72c3d0261a3858a2b36938426e376bd", "score": "0.5113192", "text": "static getNearestNeighbourWithCondition(col, b, condition) {\n Util.numSpacialSearches++;\n \n const cond = condition || null;\n let closestDistSq = Number.MAX_VALUE;\n let closest = null;\n col.forEach(b2=>{\n if (b2 != b && (cond == null || cond(b2))) {\n let dx = b2.pos.x - b.pos.x;\n let dy = b2.pos.y - b.pos.y;\n let dSq = dx*dx+dy*dy;\n if(dSq <= closestDistSq){\n closest = b2;\n closestDistSq = dSq;\n }\n }\n });\n \n return closest;\n }", "title": "" }, { "docid": "9009b58e2fd017a18cd4135fe1aa9a14", "score": "0.5111825", "text": "function countSurroundingMines (cell) {\n var numSurround = 0; // define variable for # of surrounding mines.\n var surrounding = lib.getSurroundingCells(cell.row, cell.col); // call getSurroundingCells & copy it into 'surrounding'.\n for (var c = 0; c < surrounding.length; c++) { // Loop thru incoming cells.\n if (surrounding[c].isMine === true) { // Increment 'numSurround' if adjacent mines detected.\n numSurround++;\n }\n }\n return numSurround;\n}", "title": "" }, { "docid": "2fd718b179492be259790278be728bc9", "score": "0.51115036", "text": "rgbClosestIndex (r, g, b) {\n let minDist = Infinity\n let ixMin = 0\n for (var i = 0; i < this.length; i++) {\n const d = this[i].rgbDistance(r, g, b)\n if (d < minDist) {\n minDist = d\n ixMin = i\n if (d === 0) return ixMin\n }\n }\n return ixMin\n }", "title": "" }, { "docid": "a451c44bcc3ee78c71e317eeb53aabda", "score": "0.51011807", "text": "function dist_min(rando){\n //Call function to create lines between each random point and transit stop\n var line=Merged.map(linecreate)\n function linecreate(trando){\n //var transitcoords = ee.Geometry.Point(trando.lon, trando.lat)\n //var randcoords = ee.Geometry.Point(rando.lon, rando.lat)\n var Lines=ee.Geometry.LineString({coords:[trando.geometry(),rando.geometry()], geodesic : true});\n return trando.set({'Length':Lines.length()})\n \n }\n var mini=line.aggregate_min('Length')\n return rando.set({'Mindis':mini})\n \n \n}", "title": "" }, { "docid": "d50e31bd2d1f3ced529c415d269d0637", "score": "0.5087321", "text": "function findShortestRoute(ghost) {\n if (\n ghost.upperDistanceToTarget < ghost.lowerDistanceToTarget && \n ghost.upperDistanceToTarget < ghost.leftDistanceToTarget && \n ghost.upperDistanceToTarget < ghost.rightDistanceToTarget) {\n ghost.move = - width\n return\n }\n\n if (\n ghost.lowerDistanceToTarget < ghost.rightDistanceToTarget && \n ghost.lowerDistanceToTarget < ghost.leftDistanceToTarget && \n ghost.lowerDistanceToTarget < ghost.upperDistanceToTarget) {\n ghost.move = width\n return\n } \n\n if (\n ghost.rightDistanceToTarget < ghost.lowerDistanceToTarget && \n ghost.rightDistanceToTarget < ghost.leftDistanceToTarget && \n ghost.rightDistanceToTarget < ghost.upperDistanceToTarget) {\n ghost.move = 1\n return\n } \n\n if (\n ghost.leftDistanceToTarget < ghost.lowerDistanceToTarget && \n ghost.leftDistanceToTarget < ghost.rightDistanceToTarget && \n ghost.leftDistanceToTarget < ghost.upperDistanceToTarget) {\n ghost.move = -1\n return\n } \n\n // if two surrounding cells have the same distance, the ghost will prioritise moving up then right, then down, then left\n\n if (ghost.upperDistanceToTarget !== 100000){\n ghost.move = - width\n return\n } else if (ghost.rightDistanceToTarget !== 100000){\n ghost.move = 1\n return\n } else if (ghost.lowerDistanceToTarget !== 100000){\n ghost.move = width\n return\n } else {\n ghost.move = -1\n return\n }\n\n }", "title": "" }, { "docid": "1a9e3093a7e1dd750b92fbc4f955065c", "score": "0.50840557", "text": "function countSurroundingMines (cell) {\n var surrounding = lib.getSurroundingCells(cell.row, cell.col);\n var count = 0;\n for (var i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine === true) {\n count += 1;\n }\n } return count;\n}", "title": "" }, { "docid": "21d3197b9b72d42e3040019b5a30fd83", "score": "0.50795996", "text": "dist() {\n this.sx = this.x - cW / 2;\n this.sy = this.y - cH / 2;\n }", "title": "" }, { "docid": "86368a9385f096ba60091bc7c7310428", "score": "0.50782263", "text": "function countSurroundingMines (cell) {\n var surrounding = lib.getSurroundingCells(cell.row, cell.col);\n var count = 0;\n for (var i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine == true) {\n count++;\n }\n } \n return count; \n \n\n //if surrounding cells have isMine property:true, then count this\n\n}", "title": "" }, { "docid": "f7e9768a84745e66abebde039cae6b21", "score": "0.50781304", "text": "function reckonMinesAround() {\n\t\t\n\t\tfunction countMines (cy,cx) {\n\t\t\t\t\t\t\n\t\t\tif((cx >= 0 && cy >= 0) && (cx < gridSize && cy < gridSize)) { // only if the passed square exists...\n\t\t\t\t\n\t\t\t\tif(structure[cy][cx][\"mines\"] == 1) {\n\t\t\t\t\t\n\t\t\t\t\tminesAround++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t} // closing function countMines\n\t\t\n\t\tvar minesAround;\n\t\t\n\t\tfor(var r = 0; r < gridSize; r++) {\t\t\n\t\t\t\n\t\t\tfor(var c = 0; c < gridSize; c++) {\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(structure[r][c][\"mines\"] == 0) {\t// only if the square is not mined...\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tminesAround = 0;\n\t\t\t\t\t\n\t\t\t\t\tcountMines(r-1,c-1);\n\t\t\t\t\tcountMines(r-1,c);\n\t\t\t\t\tcountMines(r-1,c+1);\n\t\t\t\t\tcountMines(r,c-1);\n\t\t\t\t\tcountMines(r,c+1);\n\t\t\t\t\tcountMines(r+1,c-1);\n\t\t\t\t\tcountMines(r+1,c);\n\t\t\t\t\tcountMines(r+1,c+1);\n\t\t\t\t\t\t\n\t\t\t\t\tstructure[r][c][\"around\"] = minesAround;\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\t// outer for loop (rows)\n\t\t\n\t}", "title": "" }, { "docid": "54eced12c7e2c8eb47bb21421bc07a49", "score": "0.5076945", "text": "function countSurroundingMines(cell) {\n var surrounding = lib.getSurroundingCells(cell.row, cell.col);\n var count = 0\n for (let i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine) {\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "1ca771c8d29e8b261aa56d813283e5ed", "score": "0.5076029", "text": "getDistance(line, circuit) {\n\n let minDistance = NetworkController.MAX_RAY_DISTANCE;\n for(let circuitLine of circuit) {\n\n let collisionPoint = line.getCollisionPoint(circuitLine);\n if(collisionPoint != null)\n minDistance = Math.min(minDistance, Vector.distance(collisionPoint, this.parentCar.position));\n }\n\n return minDistance;\n }", "title": "" }, { "docid": "58d8c77b78946a28999335d46c43a706", "score": "0.50756836", "text": "Asmin({b=12,d=10,fc=3000,Fy=60000}){\n return Math.max(3*Math.pow(fc,0.5)*b*d/Fy, 200*b*d/Fy)\n }", "title": "" }, { "docid": "bddcae2bbfcbe72072e47a39f11ffc74", "score": "0.5066316", "text": "function calculateSurroundingDistances(ghost) {\n \n //calculate upper cell distance - checks if upper cell is a wall or if it was the last ghost position\n if (wallCells.includes(ghost.upperDiv) || cells[ghost.prevDivNo] === cells[ghost.upperDiv]){\n ghost.upperDistanceToTarget = 100000 // sets value very high if it is a wall or previous position\n } else {\n ghost.upperDistanceToTarget = pythagorusTheory(ghost.target, ghost.upperDiv)\n }\n\n //calculate lower cell distance - checks if lower cell is a wall or if it was the last ghost position\n if (wallCells.includes(ghost.lowerDiv) || cells[ghost.prevDivNo] === cells[ghost.lowerDiv]){\n ghost.lowerDistanceToTarget = 100000 \n } else {\n ghost.lowerDistanceToTarget = pythagorusTheory(ghost.target, ghost.lowerDiv)\n // console.log(lowerDistanceToTarget)\n }\n\n //calculate left cell distance - checks if left cell is a wall or if it was the last ghost position\n if (wallCells.includes(ghost.leftDiv) || cells[ghost.prevDivNo] === cells[ghost.leftDiv]){\n ghost.leftDistanceToTarget = 100000 \n } else {\n ghost.leftDistanceToTarget = pythagorusTheory(ghost.target, ghost.leftDiv)\n // console.log('left= ' + ghost.leftDistanceToTarget)\n }\n\n //calculate right cell distance - checks if right cell is a wall or if it was the last ghost position\n if (wallCells.includes(ghost.rightDiv) || cells[ghost.prevDivNo] === cells[ghost.rightDiv]){\n ghost.rightDistanceToTarget = 100000 \n } else {\n ghost.rightDistanceToTarget = pythagorusTheory(ghost.target, ghost.rightDiv)\n // console.log('right= ' + ghost.rightDistanceToTarget)\n }\n }", "title": "" }, { "docid": "9c628cecc96a5c6ac110e48515d3d27c", "score": "0.5061258", "text": "function findMostConstrainedCell(matrix) {\n\tvar emptyCell = false;\n\tvar minCell = {valCount: 10, cellNum: 0, valueList: [], x:0, y:0};\n\tfor (var i = 0; i < 81; i++) {\n\t\tif (getMatrixValue(i, matrix) === null) {\n\t\t\temptyCell = true;\n\t\t\t\n\t\t\tvar validCellValues = getValidValues(i, matrix);\n\t\t\tsetMatrixValueList(i, validCellValues, matrix);\n\t\t\tvar valCount = validCellValues.length;\n\t\t\tif (valCount < minCell.valCount) {\n\t\t\t\tminCell.valCount = valCount;\n\t\t\t\tminCell.cellNum = i;\n\t\t\t\tminCell.valueList = validCellValues;\n\t\t\t\tminCell.x = findRow(i);\n\t\t\t\tminCell.y = findCol(i);\n\t\t\t}\n\t\t\tif (valCount === 1) {\n\t\t\t\treturn minCell;\n\t\t\t}\n\t\t}\n\t}\n\tif (emptyCell) {\n\t\treturn minCell; \n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "a945f7795d4c1ebf29e3642cd91972c8", "score": "0.50586224", "text": "compareCellDist(d) {\n return function(c1, c2) {\n let d1 = Math.sqrt(Math.pow(d.x - c1.x, 2) + Math.pow(d.y - c1.y, 2)) * c1.type;\n let d2 = Math.sqrt(Math.pow(d.x - c2.x, 2) + Math.pow(d.y - c2.y, 2)) * c2.type;\n\n return d1 - d2;\n }\n }", "title": "" }, { "docid": "b05194dcba09874e4eba385affaa9dba", "score": "0.5057985", "text": "function closestIntersectionPoint(r) {\n var i, sphere, k, smallestK = hugeValue, closestObject = null, plane;\n\n // Spheres\n for (i = 0; i < spheres.length; i++) {\n sphere = spheres[i];\n k = raySphereIntersectionPoint(r, sphere);\n\n // This happens when the ray starts on the sphere, ignore that intersection\n if (k < tinyValue) {\n continue;\n }\n if (k < smallestK) {\n smallestK = k;\n closestObject = sphere;\n }\n }\n\n // Planes\n for (i = 0; i < planes.length; i++) {\n plane = planes[i];\n k = rayPlaneIntersectionPoint(r, plane);\n\n // This happens when the ray starts on the plane, ignore that intersection\n if (k < tinyValue) {\n continue;\n }\n\n if (k < smallestK) {\n smallestK = k;\n closestObject = plane;\n }\n }\n\n return [smallestK, rayFollow(r, smallestK), closestObject];\n }", "title": "" }, { "docid": "b1818320b982cc255cc4258a7c70c1c1", "score": "0.505475", "text": "function getRangeMin(data) {\n var minPos = d3.min(data, function (d) { return d.positivity; });\n var minNeu = d3.min(data, function (d) { return d.neutrality; });\n var minNeg = d3.min(data, function (d) { return d.negativity; });\n\n if (minPos <= minNeu && minPos <= minNeg)\n return minPos;\n else if (minNeu <= minPos && minNeu <= minNeg)\n return minNeu;\n else if (minNeg <= minPos && minNeg < minNeu)\n return minNeg;\n else {\n console.log(\"Unexpected output for getRangeMin\");\n }\n}", "title": "" }, { "docid": "9989737ab485b0bde7b373d715159832", "score": "0.5054042", "text": "evaluate(x, y) {\n const distSq = pow(this.location.x - x, 2) + pow(this.location.y - y, 2);\n \n if (distSq == 0) {\n return 0;\n }\n \n if (distSq < pow(this.diameter, 2)) {\n if (1 / distSq == 0) console.log(\"zero\");\n return 1 / distSq;\n \n }\n \n return 0;\n }", "title": "" }, { "docid": "d28b87697eeadf3b55beec6f1b4c27ea", "score": "0.50525254", "text": "getGeometryRadius(entity) {\n const mesh = entity.getObject3D('mesh');\n const { geometry } = mesh;\n\n // if we have a boundingSphere, use it's radius\n if (geometry.boundingSphere) {\n return geometry.boundingSphere.radius / 4; // TODO: get something better than this magic number\n }\n }", "title": "" }, { "docid": "384f6fb7bc8e25f7b635550e36c62203", "score": "0.5038756", "text": "getMinX() {\n const { points } = this.props;\n return points[0].t;\n }", "title": "" }, { "docid": "e5f964716c0929cab3ff58ba48df9c27", "score": "0.5037173", "text": "function countSurroundingMines (cells) {\n let arr=cells.filter(cell =>{\n\n return cell.isMine==true;\n });\n\n if(arr.length<=8){\n return arr.length; \n }\n else{\n return 0;\n }\n }", "title": "" }, { "docid": "d112f6861e1f1ed905bf65106fd073eb", "score": "0.5034531", "text": "min() {\n return this.minNode(this.root);\n }", "title": "" } ]
6412a21032e9e07c84144dfbd5b6d76d
The playback rate of the part
[ { "docid": "d41d90219482f73921b4207cbf269e1b", "score": "0.80302894", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" } ]
[ { "docid": "4d8f8b5b148312c65cc8c5a99b66b492", "score": "0.8215328", "text": "get playbackRate() {\n return this._event.playbackRate;\n }", "title": "" }, { "docid": "4d8f8b5b148312c65cc8c5a99b66b492", "score": "0.8215328", "text": "get playbackRate() {\n return this._event.playbackRate;\n }", "title": "" }, { "docid": "1c62b032c67c63d8701c9dfe8cca8e40", "score": "0.8173517", "text": "get playbackRate() {\n return this._event.playbackRate;\n }", "title": "" }, { "docid": "13266d2a2a031d8ca87a4bddd07f4130", "score": "0.8061253", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" }, { "docid": "13266d2a2a031d8ca87a4bddd07f4130", "score": "0.8061253", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" }, { "docid": "13266d2a2a031d8ca87a4bddd07f4130", "score": "0.8061253", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" }, { "docid": "13266d2a2a031d8ca87a4bddd07f4130", "score": "0.8061253", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" }, { "docid": "13266d2a2a031d8ca87a4bddd07f4130", "score": "0.8061253", "text": "get playbackRate() {\n return this._playbackRate;\n }", "title": "" }, { "docid": "ad8e3e3d0cd643080263160bb5cf751e", "score": "0.7897703", "text": "static get playbackRate() {\n return SongManager.player.playbackRate;\n }", "title": "" }, { "docid": "b78d58eb87c50ff4cb4a5f576c9f8582", "score": "0.7834111", "text": "getSpeed() {\n\t\treturn this._element.playbackRate;\n\t}", "title": "" }, { "docid": "0b57e7f145b6b91ac3242f0dac25840b", "score": "0.71131206", "text": "changePlayback(v) {\r\n // let notches = [.75, .875, 1, 1.125, 1.25]\r\n // let window = 0.05\r\n let path = v.composedPath();\r\n let absolute_rate = path[0].value / 100;\r\n // for (let notch of notches) {\r\n // console.log(absolute_rate)\r\n // console.log(notch)\r\n // if (absolute_rate <= notch + window && absolute_rate > notch) {\r\n // this.playback_rate = notch\r\n // break;\r\n // }\r\n this.playback_rate = absolute_rate;\r\n // }\r\n // console.log(this.playback_rate)\r\n this.audio_howl_sprites.sound.rate(this.playback_rate);\r\n }", "title": "" }, { "docid": "4665a5683c492c8950fc4dc660811ff3", "score": "0.70651984", "text": "percentCalc () {\n return this._audio.currentTime / this._audio.duration * 100\n }", "title": "" }, { "docid": "98d553ea5235929e57bad350ccf94a7c", "score": "0.6907065", "text": "_getLoopDuration() {\n return Math.round((this._loopEnd - this._loopStart) / this._playbackRate);\n }", "title": "" }, { "docid": "93ce20cefd7a97cf24d6c8b2fb8b50bf", "score": "0.69007", "text": "get framerate() {\r\n return this.note.framerate;\r\n }", "title": "" }, { "docid": "5e7d46e4b33ef04dc09b36355afcee25", "score": "0.68117595", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "5e7d46e4b33ef04dc09b36355afcee25", "score": "0.68117595", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "900c12decbca3c3a52245206a4d7994c", "score": "0.67975867", "text": "get_samplingRate()\n {\n return this.liveFunc._samplingRate;\n }", "title": "" }, { "docid": "128f9e7dbb06c53c042f653086df2413", "score": "0.6791287", "text": "_getLoopDuration() {\n return Math.round((this._loopEnd - this._loopStart) / this._playbackRate);\n }", "title": "" }, { "docid": "128f9e7dbb06c53c042f653086df2413", "score": "0.6791287", "text": "_getLoopDuration() {\n return Math.round((this._loopEnd - this._loopStart) / this._playbackRate);\n }", "title": "" }, { "docid": "60f03a445ba9193513a143ba97e8261a", "score": "0.6781639", "text": "_onPlaybackRateChange(e){\n const { playbackRate } = this.meta;\n const currentRate = e.data;\n if(currentRate > playbackRate){ // speed up\n this.meta.playbackRate = currentRate;\n this._onBehaviorCreated(BEHAVIORS.SPEEDUP);\n }\n else{ // speed down\n this.meta.playbackRate = currentRate;\n this._onBehaviorCreated(BEHAVIORS.SPEEDDOWN);\n }\n }", "title": "" }, { "docid": "d5c352d981e50fad6113bb145bd88211", "score": "0.67743564", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "d5c352d981e50fad6113bb145bd88211", "score": "0.67743564", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "a56cde96ce6c7bdc77da850521186a54", "score": "0.67711365", "text": "function playListener () { this.playbackRate = window.__SPEEDER.rate; }", "title": "" }, { "docid": "8e58297d6b227740161a98b63ff3c0f6", "score": "0.67624533", "text": "frameRate() {\n\n //determina la velocidad de frame para cada sprite\n\n switch (this.estado) {\n case \"Quieto \":\n\n if (this.frames < this.quietoD.length) {\n this.frames += 0.2;\n }\n break;\n\n case \"Caminando \":\n if (this.frames < this.corriendoD.length) {\n this.frames += 1;\n }\n break;\n\n case \"Noqueado \":\n if (this.frames < this.estrellitas.length) {\n this.frames += 1;\n }\n break;\n\n case \"Deslizando \":\n if (this.frames < this.deslizandoD.length) {\n this.frames += 1;\n }\n break;\n\n } //cierra el switch de estado\n }", "title": "" }, { "docid": "d4fa8fa4ea8211c9713054b2f093d7f0", "score": "0.6750405", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "c02f1a30ddd72a9c1d86de80abf68af9", "score": "0.6734096", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "3972cf5c6f2909a7ffb26b5e0a83e660", "score": "0.67102456", "text": "set playbackRate(rate) {\n this.video.playbackRate = rate\n }", "title": "" }, { "docid": "6d2f5f5693fe2138662ba45645726068", "score": "0.66533387", "text": "get percent() {\n return Math.max(0, (SongManager.player.currentTime - this.startPoint) / (this.endPoint - this.startPoint));\n }", "title": "" }, { "docid": "38941d88c3a38e00295310eddca5eb84", "score": "0.66029763", "text": "get speed() {\n return this.dv.getUint8(11, true);\n }", "title": "" }, { "docid": "7b73dfc5558da53e7ca8178d7f49cd07", "score": "0.6555316", "text": "get framesPerTick() {\n\t\treturn this._framesPerTick;\n\t}", "title": "" }, { "docid": "eec8dabf9d2f7c358cb2420df5585664", "score": "0.6520054", "text": "GetAnimationUpdateRate() {}", "title": "" }, { "docid": "0deeb8620dc9eccf73bd563974c7b223", "score": "0.6485", "text": "get playlistRating(){\n let currentRating = 0;\n for(let track in this.tracks){\n currentRating += this.tracks[track].rating\n }\n return currentRating/this.tracks.length\n }", "title": "" }, { "docid": "0ac945bc4db95a66b5dfeb5a45b5adfd", "score": "0.64647627", "text": "get speedUS() {\r\n return this.speed / 1.6;\r\n }", "title": "" }, { "docid": "119f7ae884ae36d3ec0328369ed9e31a", "score": "0.64477485", "text": "get fps() {\n return this._fps\n }", "title": "" }, { "docid": "6eed73f6046536964c3c33200e52ede0", "score": "0.6435549", "text": "function setPlaybackSpeed() {\n function onGot(val) {\n let videoElementList = document.getElementsByTagName(\"video\")\n if (videoElementList.length > 0)\n {\n console.info(`Set playback speed. It is ${val[\"playback_speed\"]}.`)\n for(var i = 0; i < videoElementList.length; i++)\n {\n videoElementList[i].playbackRate=val[\"playback_speed\"] || 1\n }\n }\n }\n\n function onError(err) {\n console.error(`Error: ${err}`)\n }\n\n let getValue = browser.storage.sync.get(\"playback_speed\")\n getValue.then(onGot, onError)\n}", "title": "" }, { "docid": "f0cd468c8616157961c391e734395488", "score": "0.6433815", "text": "get speedUS() {\n return this.speed / 1.6;\n }", "title": "" }, { "docid": "36c38503bebc2966ba48f307171ea619", "score": "0.6417458", "text": "get fps() {return this._fps;}", "title": "" }, { "docid": "3272b8f618c4ce58f94ac7104bef1ca5", "score": "0.6404732", "text": "get sampleRate() {\n if (this._buffer) {\n return this._buffer.sampleRate;\n } else {\n return (0, _Global.getContext)().sampleRate;\n }\n }", "title": "" }, { "docid": "5c6ea9c21df5d0892b99c1d6fa94aab1", "score": "0.6387132", "text": "get fps () {\n return this._fps;\n }", "title": "" }, { "docid": "f18c4f9d41e6f3743ab5dba75f8000dc", "score": "0.63770735", "text": "get OptimizeSampleRate() {}", "title": "" }, { "docid": "408256f8bd3348516b824458c677605e", "score": "0.6374819", "text": "get OverrideSampleRate() {}", "title": "" }, { "docid": "91554cf057fd2724d096e3ab4ae8294d", "score": "0.63644594", "text": "getSamplesPerPixel() {\n var timelineDomain = this.base.xScale.domain();\n var timelineDuration = timelineDomain[1] - timelineDomain[0];\n var timelineWidth = this.base.width();\n var sampleRate = this.sampleRate();\n\n return (timelineDuration * sampleRate()) / timelineWidth;\n }", "title": "" }, { "docid": "32c19398b5296493a092ad37f1da7201", "score": "0.6363209", "text": "get sampleRate() {\n if (this._buffer) {\n return this._buffer.sampleRate;\n }\n else {\n return (0,_Global__WEBPACK_IMPORTED_MODULE_0__.getContext)().sampleRate;\n }\n }", "title": "" }, { "docid": "32c19398b5296493a092ad37f1da7201", "score": "0.6363209", "text": "get sampleRate() {\n if (this._buffer) {\n return this._buffer.sampleRate;\n }\n else {\n return (0,_Global__WEBPACK_IMPORTED_MODULE_0__.getContext)().sampleRate;\n }\n }", "title": "" }, { "docid": "756c2bad97e6be38135c34b2b0a769b2", "score": "0.63524973", "text": "get sampleRate() {\n return this._context.sampleRate;\n }", "title": "" }, { "docid": "40084b4087cf4d114a2db63917cd6517", "score": "0.63465047", "text": "function speedvideo() {\n var skipbutton = document.querySelector('.player__slider[name=\"playbackRate\"]');\n video.playbackRate = skipbutton.value;\n}", "title": "" }, { "docid": "ce36626f1463fc437366459486ea2303", "score": "0.63223165", "text": "get duration() {\n return this.frames.length * this.frameMS;\n }", "title": "" }, { "docid": "c31176686304a2a1b9e05e5a83ae83b7", "score": "0.63130784", "text": "getProgress(){\n\t\tif( !this.props.activeTrack ) return '0%';\n\t\treturn (this.props.activeTrack.elapsedTime * 100 / this.refs.audioElement.duration) + \"%\";\n\t}", "title": "" }, { "docid": "486e5015414f483c8614d8b3955b3128", "score": "0.6310316", "text": "function getSpeed() {\n return speed;\n}", "title": "" }, { "docid": "8e5b1ab99515188dedd06d6908187bcf", "score": "0.630649", "text": "get speed() {}", "title": "" }, { "docid": "5f80af4aafc576e828a3558ccfffe7cb", "score": "0.6297265", "text": "get sampleRate() {\n if (this._buffer) {\n return this._buffer.sampleRate;\n }\n else {\n return getContext().sampleRate;\n }\n }", "title": "" }, { "docid": "e9d52939e8532b922e17136ed2bea74c", "score": "0.62901413", "text": "get PreserveSampleRate() {}", "title": "" }, { "docid": "34577cdd4d53fd91698cd534acbb37b3", "score": "0.62857205", "text": "static get fpsRealAverage() { return 1000 / Loop.ƒTimeLastFrameRealAvg; }", "title": "" }, { "docid": "f07f05ab4e36a6fef228ba60591f0f29", "score": "0.62712073", "text": "function framesRefreshRate(fps) {\n return 1000/fps;\n}", "title": "" }, { "docid": "d2b9d6bc4e4d8e9ec30f766ae94344a4", "score": "0.62672025", "text": "get sampleRate() {\n return this._context.sampleRate;\n }", "title": "" }, { "docid": "d2b9d6bc4e4d8e9ec30f766ae94344a4", "score": "0.62672025", "text": "get sampleRate() {\n return this._context.sampleRate;\n }", "title": "" }, { "docid": "b047ca92ed4a88a5bc3e5d59114478db", "score": "0.62542886", "text": "function getVLCseekFrac(){\n\t\tvar rect = d3.select('#VLCseeker').node().getBoundingClientRect();\n\t\tvar x = d3.event.offsetX;\n\t\tif (!x){\n\t\t\tvar r = d3.event.target.getBoundingClientRect();\n\t\t\tx = d3.event.targetTouches[0].pageX - r.left;\n\t\t}\n\t\tvar frac = parseFloat(x)/parseFloat(rect.width);\n\t\tvar time = frac*params.VLCstatus[params.activePlaylist].length;\n\t\treturn [frac, time]\n\t}", "title": "" }, { "docid": "2a5d2f3d033b3755204a20082bac0fdf", "score": "0.6239288", "text": "get PPQ() {\n return this._clock.frequency.multiplier;\n }", "title": "" }, { "docid": "2a5d2f3d033b3755204a20082bac0fdf", "score": "0.6239288", "text": "get PPQ() {\n return this._clock.frequency.multiplier;\n }", "title": "" }, { "docid": "b9f3270d9882b642afccb563cf63a405", "score": "0.62337613", "text": "get PPQ() {\n return this._clock.frequency.multiplier;\n }", "title": "" }, { "docid": "8813b890ca6f8a3368f68087013d4e5a", "score": "0.62321347", "text": "get idealFrameRate() { return this._idealFrameRate; }", "title": "" }, { "docid": "8813b890ca6f8a3368f68087013d4e5a", "score": "0.62321347", "text": "get idealFrameRate() { return this._idealFrameRate; }", "title": "" }, { "docid": "0b7fe4daa30abc68b142b222dae65c9e", "score": "0.623108", "text": "get duration() {\n if (this._buffer) {\n return this._buffer.duration;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "0b7fe4daa30abc68b142b222dae65c9e", "score": "0.623108", "text": "get duration() {\n if (this._buffer) {\n return this._buffer.duration;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "0b7fe4daa30abc68b142b222dae65c9e", "score": "0.623108", "text": "get duration() {\n if (this._buffer) {\n return this._buffer.duration;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "27f6291861f7fb237f5de5e31b8d36ff", "score": "0.6229063", "text": "getSpeed() {\r\n\t\treturn this.speed;\r\n\t}", "title": "" }, { "docid": "cd0c04a1b42799c242a193ca16830086", "score": "0.62281704", "text": "get progress() {\r\n return this.isNoteLoaded ? (this.playbackTime / this.duration) * 100 : null;\r\n }", "title": "" }, { "docid": "08458be742b7c29295d60b7ac6c31e81", "score": "0.6208871", "text": "get duration() {\n if (this._buffer) {\n return this._buffer.duration;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "568e9c23ab33c41be957616d43c18e2b", "score": "0.6187267", "text": "getCurrentTimePercentage() {\n if (this.state.currentTime > 0) {\n return parseFloat(this.state.currentTime) / parseFloat(this.state.duration);\n }\n return 0;\n }", "title": "" }, { "docid": "b0f5853aab13019634e9eb9675927d6f", "score": "0.613461", "text": "function adjustSpeed(factor){\n\t\tthis.playbackRate(Math.round(this.playbackRate()*factor * 100)/100);\n\t\tosd(\"Speed: \"+ this.playbackRate());\n\t}", "title": "" }, { "docid": "cb57ee94507f05c2bf066a61ee25d79f", "score": "0.61299986", "text": "getSpeed() {\n return speed;\n }", "title": "" }, { "docid": "cb57ee94507f05c2bf066a61ee25d79f", "score": "0.61299986", "text": "getSpeed() {\n return speed;\n }", "title": "" }, { "docid": "af73dc04efed32c594b0ecab5ab938d9", "score": "0.6121697", "text": "static async frameRate(samples = 5) {\n let frameTimes = [];\n for (let i = 0; i < samples; i++) {\n frameTimes[i] = await this.frameTime();\n }\n\n let medianTime = frameTimes.sort()[Math.floor(samples / 2)];\n let frameRate = Math.round(1000 / medianTime);\n let closestFrameRate = lodashFind(this.commonFrameRates, rate => Math.abs(frameRate - rate) <= 0.1 * rate);\n return closestFrameRate ?? frameRate;\n }", "title": "" }, { "docid": "fc4eb4a212fa025840a39556b9b8676f", "score": "0.6119992", "text": "duration() {\r\n return this.sound.duration();\r\n }", "title": "" }, { "docid": "b530c7ac81164b80ee3959a935ac6a47", "score": "0.61124235", "text": "function calculateFilesPerSecond() {\n filesPerSecond = fileCounter - tempCounter;\n document.getElementById('fps').innerHTML = filesPerSecond;\n document.getElementById('counter').innerHTML = fileCounter;\n tempCounter = fileCounter;\n}", "title": "" }, { "docid": "3d2907c14e77a8b5800a3b215b83707e", "score": "0.61084634", "text": "get speedVariation() {}", "title": "" }, { "docid": "f920d94b7ff719ef98d2b6f07f1e894c", "score": "0.6075051", "text": "get progress() {\n if (this.loop) {\n const now = this.now();\n\n const ticks = this._clock.getTicksAtTime(now);\n\n return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "3de3ef8d59565480f3038412c8ef3248", "score": "0.6062635", "text": "get lowerBound() {\n const { lowerBound } = this.config;\n\n return lowerBound > 0 ? (lowerBound / this.player.duration) * 100 : 0;\n }", "title": "" }, { "docid": "e7ab7f41201c00025c65eae65aafa618", "score": "0.60541284", "text": "function changePlaybackSpeed() {\n var playbackRate = parseFloat($(\".playback-selector\").val());\n $(\".main-video\").get(0).playbackRate = playbackRate;\n if (globalSurfer) {\n globalSurfer.setPlaybackRate(playbackRate);\n }\n $(\".transcription-input-main\").focus();\n}", "title": "" }, { "docid": "261fce24c3d77b61928afba72224f425", "score": "0.6045156", "text": "function update(){\n document.getElementById('songTime').innerHTML = millisToMins(player.currentTime);\n var currentTimeUp = player.currentTime;\n var durationUp = player.duration;\n var currentPourcent = (currentTimeUp/durationUp) * 100;\n document.getElementById('currentPourcent').style.width = currentPourcent + \"%\";\n buffer();\n}", "title": "" }, { "docid": "ba98529ece9d7013bcb54d48a1f93930", "score": "0.60431176", "text": "get progress() {\n if (this.loop) {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "ba98529ece9d7013bcb54d48a1f93930", "score": "0.60431176", "text": "get progress() {\n if (this.loop) {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return (ticks - this._loopStart) / (this._loopEnd - this._loopStart);\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "ff8f9248a302253892e8d342593ebfc5", "score": "0.6037985", "text": "function getPercentage(event) {\n var html5Player = event.target;\n var percentage = (html5Player.getCurrentTime() * 100) / html5Player.getDuration();\n percentage = Math.round(percentage);\n return percentage;\n }", "title": "" }, { "docid": "4c71aa52b6cf0894e3afe5ca23664fd3", "score": "0.6018838", "text": "changePlaybackRate (direction) {\n const state = this.state\n let rate = state.playing.playbackRate\n if (direction > 0 && rate < 2) {\n rate += 0.25\n } else if (direction < 0 && rate > 0.25 && rate <= 2) {\n rate -= 0.25\n } else if (direction > 0 && rate >= 1 && rate < 16) {\n rate *= 2\n } else if (direction < 0 && rate > 1 && rate <= 16) {\n rate /= 2\n }\n state.playing.playbackRate = rate\n if (isCasting(state) && !Cast.setRate(rate)) {\n state.playing.playbackRate = 1\n }\n // Wait a bit before we hide the controls and header again\n state.playing.mouseStationarySince = new Date().getTime()\n }", "title": "" }, { "docid": "8f770aac6319aadbb64b895a2fd4f30e", "score": "0.6013396", "text": "duration(){\r\n return this.getTracks().map((track) => track.getDuration()).reduce((a,b) => a+b,0); \r\n }", "title": "" }, { "docid": "5e4de95a973ea2e06422aff84e1f7d3a", "score": "0.6005283", "text": "function getDeltaTime() {\n return (1000 / frameRate()) / 1000;\n}", "title": "" }, { "docid": "068738af0f7efc7c23c5d51f9b85d78a", "score": "0.5989567", "text": "changePlaybackRate(direction) {\n const state = this.state\n let rate = state.playing.playbackRate\n if (direction > 0 && rate < 2) {\n rate += 0.25\n } else if (direction < 0 && rate > 0.25 && rate <= 2) {\n rate -= 0.25\n } else if (direction > 0 && rate >= 1 && rate < 16) {\n rate *= 2\n } else if (direction < 0 && rate > 1 && rate <= 16) {\n rate /= 2\n }\n state.playing.playbackRate = rate\n if (isCasting(state) && !Cast.setRate(rate)) {\n state.playing.playbackRate = 1\n }\n // Wait a bit before we hide the controls and header again\n state.playing.mouseStationarySince = new Date().getTime()\n }", "title": "" }, { "docid": "e6dc6d4aa52c5e209d9c3a92a7c85f16", "score": "0.59872466", "text": "function updateCurrTime(){\n var song=document.querySelector('audio');\n var currTime=Math.floor(song.currentTime);\n var dur=Math.floor(song.duration);\n var widths; //Progress Bar ki css property set krri hai\n widths=currTime/dur*100; //provides value of width for progress bar\n $('.progress-filled').css(\"width\", widths+'%'); //it will update progress bar\n currTime=fancyTimeFormat(currTime);\n dur=fancyTimeFormat(dur);\n $('.progress-wrapper .time-elapsed').text(currTime);\n $('.progress-wrapper .song-duration').text(dur);\n }", "title": "" }, { "docid": "52787b978e6d27599846d905dc8f9913", "score": "0.5973202", "text": "getFrecency() {\n if (this.pinned) {\n return Infinity;\n }\n const timeSinceUse = Date.now() - this.lastUse;\n if (timeSinceUse < MS_PER_MINUTE) {\n return this.numberOfUses * 4;\n } else if (timeSinceUse < 5 * MS_PER_MINUTE) {\n return this.numberOfUses * 2;\n } else if (timeSinceUse < 30 * MS_PER_MINUTE) {\n return this.numberOfUses / 2;\n }\n return this.numberOfUses / 4;\n }", "title": "" }, { "docid": "9c2db5de635fdad4d3bb4872a6aa8bb8", "score": "0.59699374", "text": "function calculateRate(self, kind) {\n var isUpload = (kind=='up');\n\n var rates = isUpload ? self.uploadRates : self.downloadRates;\n\n // take the last recorded rate\n// var rate = (rates.length > 0) ? rates[rates.length-1].value : 0\n\n // calculate weighted average rate\n //var decayFactor = 0.13863;\n var rateSum = 0, weightSum = 0;\n for (var idx=0; idx<rates.length; idx++) {\n //var age = rates[idx].ts-rates[0].ts;\n var weight = 1; //Math.exp(-decayFactor*age/1000);\n rateSum += rates[idx].value * weight;\n weightSum += weight;\n }\n var rate = (rates.length>0) ? (rateSum/weightSum) : 0;\n\n if (rate > 0) {\n LOGGER.debug('Peer [' + self.getIdentifier() + '] ' + kind + 'loading at ' + rate);\n }\n\n if (isUpload) {\n self.emit(Peer.RATE_UPDATE, {\n type: 'upload',\n previous: self.currentUploadRate,\n current: rate\n });\n self.currentUploadRate = rate;\n }\n else {\n self.emit(Peer.RATE_UPDATE, {\n type: 'download',\n previous: self.currentDownloadRate,\n current: rate\n });\n self.currentDownloadRate = rate;\n }\n}", "title": "" }, { "docid": "5188885bcf6d656ec2116278bf9e47d5", "score": "0.5964251", "text": "function calculateUploadRate(bytes) {\n var now = new Date().getTime();\n uploadSamples.push([bytes, now]);\n\n // get rid of old samples\n while (uploadSamples[0][1] < (now - SAMPLE_PERIOD)) {\n uploadSamples.shift();\n }\n\n if (uploadSamples.length < REQUIRED_SAMPLES) {\n return null;\n }\n\n return 1000 * ((bytes - uploadSamples[0][0]) / (now - uploadSamples[0][1]));\n}", "title": "" } ]
f713287e7c2540feb24336ae67641483
Gets the full list of Merchants for the logged in user
[ { "docid": "800e2e541971838b3c964c7dd574b9df", "score": "0.64035773", "text": "function merchantGetListByCurrentUser() {\r\n var url = getBaseURL() + \"Merchant/Current/List\";\r\n return $http.get(url);\r\n }", "title": "" } ]
[ { "docid": "62145127be743f89c8ea43688f0a6635", "score": "0.75540024", "text": "function _getMerchantsList(options, callback) {\n var request = {\n path: _baseUrl + 'merchants',\n method: 'GET',\n data: ((!options.data) ? options : options.data),\n headers: {\n // 'x-auth-token': $rootScope.cookie.accessToken\n }\n };\n return $api(request, callback);\n }", "title": "" }, { "docid": "d504c3d02278cfbaefc8f59390fab85e", "score": "0.61394006", "text": "function GetAllMerchants() {\n\n var getData = angularService.getMerchants();\n getData.then(function (mch) {\n\n $scope.merchants = mch.data;\n }, function (errdata) {\n if (errdata != null) {\n if (errdata.data != null) {\n alert(errdata.data);\n alert('Error in getting records GetAllMerchants');\n }\n }\n });\n }", "title": "" }, { "docid": "9df6ced135d4bdb5831a7f5df1af7bdd", "score": "0.58900917", "text": "function getGrants(user, host) {\n return $http({\n method: 'GET',\n url: 'api/settings/users/' + user + '/' + host + '/grants/'\n })\n .then(getGrantsComplete)\n .catch(getGrantsFailed);\n\n function getGrantsComplete(response) {\n return response.data;\n }\n\n function getGrantsFailed(err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "bd061a7b077dd28689e7b1e30310a664", "score": "0.57998294", "text": "function userGetListForMerchant(merchantID) {\r\n var url = getBaseURL() + \"Users/List/ByMerchant/\" + merchantID;\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "b84be158e75d2951eec1636ed88c36b5", "score": "0.5785518", "text": "static getAllApplicants(){\n let applicants = JSON.parse(localStorage.getItem(\"APPLICANTS\")) || [];\n return applicants;\n }", "title": "" }, { "docid": "58f7ac5649d3d25b3c84fcec9fc39872", "score": "0.5783228", "text": "getAllBusinessOwners() {\n return userManager().methods.getAllBusinessOwners().call().then(result => result);\n }", "title": "" }, { "docid": "55e75e6d42738409457093b44eb07e4e", "score": "0.56619495", "text": "function findGrantsByUser(user_Id) {\n return db(\"grants\").where({ user_id }).first();\n}", "title": "" }, { "docid": "a96debc959c7ce65b61768c5c91adc1a", "score": "0.5655815", "text": "function merchantUserGetListByMerchant(merchantID) {\r\n var url = getBaseURL() + \"MerchantUsers/List/\" + merchantID;\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "38d2e8ca4cf058059111996d79ecbf6f", "score": "0.5600689", "text": "async function getMerchantList() {\n if (!fs.existsSync(\"./save/merchantData.json\")) {\n await downloadMerchantData();\n }\n return JSON.parse(fs.readFileSync(\"./save/merchantData.json\")).results;\n}", "title": "" }, { "docid": "e5cc9f6fea9ca79611ab6a7ef069e30d", "score": "0.55627817", "text": "function getGrants() {\n return new Promise(function(resolve , reject) {\n resolve(dbGrants.find()); //\n })\n}", "title": "" }, { "docid": "d2572ba52a18188e04d33142e94e2879", "score": "0.555996", "text": "getAllTenants() {\n return http.get(\"/users/tenants\");\n }", "title": "" }, { "docid": "29a5452bdfc19e6dff761bd5accdb160", "score": "0.5515696", "text": "organizationsForCurrentUser() {\n const userId = Meteor.userId();\n const orgaIds = _.map(OrganizationMembers.find({ userId }).fetch(), function fetchOrgId(m) {\n return m.organizationId;\n });\n\n return Organizations.find({ _id: { $in: orgaIds } });\n }", "title": "" }, { "docid": "c2b5e9c9c715f61da26f0284acb9eed9", "score": "0.5487038", "text": "function GetBundlesByUser() {\n return $resource(_URLS.BASE_API + 'bundle/getBundlesByUser' + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "title": "" }, { "docid": "518fe293050de9a686e85550ace8a4dd", "score": "0.5401291", "text": "contributorIdList () {\n let contributor = this,\n contributorIdList = contributor.allStaffIds();\n \n // Compile the list of all contributors to consider\n contributorIdList.push(contributor._id);\n \n return contributorIdList\n }", "title": "" }, { "docid": "b03a8678acdcc964808f127a13be9377", "score": "0.5359557", "text": "function get_all_users(){\n return users;\n}", "title": "" }, { "docid": "b8a47596223b55d2d829e6a278a5dec3", "score": "0.534935", "text": "getUserList() {\r\n return this.users\r\n }", "title": "" }, { "docid": "b81d19384d11603fedc9a4beec39ea4f", "score": "0.534522", "text": "list() {\n return customers;\n }", "title": "" }, { "docid": "529a5dcf3065e09e92b7c6375b11d53d", "score": "0.5337683", "text": "getAll(userOpts) {\n return this.common.getAll(userOpts);\n }", "title": "" }, { "docid": "529a5dcf3065e09e92b7c6375b11d53d", "score": "0.5337683", "text": "getAll(userOpts) {\n return this.common.getAll(userOpts);\n }", "title": "" }, { "docid": "7788e01761bd7c52468cdcba694169fa", "score": "0.53200114", "text": "function getAllRollpapersForMerchants() {\n\n\t$.ajax({\n\t\turl : link+':8082/v1/merchant-rollpaper/all',\n\t\ttype : 'GET',\n\t\tcontentType : \"application/json; charset=utf-8\",\n\t\tdata : {},\n\t\tdataType : 'json',\n\t\tsuccess : function(response) {\n\t\t\tprocessGetAllRollpapersForMerchants(response);\n\t\t},\n error: function(data, textStatus, jqXHR) {\n handleAjaxError(data, textStatus, jqXHR);\n }\n\t});\n}", "title": "" }, { "docid": "6f09c791944e9038d2d81b509b0b5870", "score": "0.5299625", "text": "function _getUserConsult(){\n var consulList = JSON.parse(localStorage.getItem('lsConsulUsers'));\n if(consulList == null){\n consulList = _UsersConsult;\n }\n return consulList;\n }", "title": "" }, { "docid": "c291dd2696cb6b6d5c6850a3ba6848e2", "score": "0.5285408", "text": "function getAllUsers () {\n return users;\n}", "title": "" }, { "docid": "b5edcdfb4826aa06a3869b977855b84e", "score": "0.52815133", "text": "function rolesGetListForMerchant(merchantID) {\r\n var url = getBaseURL() + \"Roles/Merchant/\" + merchantID;\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "be4fe6c0ec9871817f403d4cdae09dd8", "score": "0.5269581", "text": "async collecList() {\n const { ctx } = this;\n\n let data = await ctx.service.user.collecList();\n\n ctx.helper.success({data});\n }", "title": "" }, { "docid": "0e45c76e90a70760e8cc25515679c468", "score": "0.52605647", "text": "function rolesGetListForMerchantWithRights() {\r\n var url = getBaseURL() + \"Roles/Merchant/WithRights\";\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "875b0d3d7677cc15e2af68c4cf58f291", "score": "0.52389365", "text": "getAdmins() {\n return this.admins\n }", "title": "" }, { "docid": "934f112f4750621d95c9f5f2cc09dc5c", "score": "0.52254295", "text": "getOrganizations() {\n return this.getAccountInfo().then(me => {\n if(!me) {\n return false;\n }\n\n return me.organizations.map(organization => new entities.Organization(organization));\n });\n }", "title": "" }, { "docid": "153a9f051271525816f72073731c285e", "score": "0.5189527", "text": "getAllAdmins() {\n return this.admins;\n }", "title": "" }, { "docid": "81a053a9bc6f8cfd3ebf57a82676a633", "score": "0.5187553", "text": "function getCompanyAndCompanyList(user, isSuperAdmin, companyId, successCallback, errorCallback){\n if(isSuperAdmin){\n var companyQueryObject = new Parse.Query(\"Company\");\n\n if(!companyId || companyId == user.get('company').id){ // requested company and current user's company is the same or no company id is sent\n companyQueryObject.limit(1000);\n companyQueryObject.find().then(function(companyList){\n companyList = commonUtils.sortObjectsByName(companyList);\n for(var companyIndex in companyList){\n if(companyList[companyIndex].id == user.get('company').id){\n successCallback(companyList[companyIndex], companyList)\n }\n }\n }, errorCallback);\n }\n else {\n companyQueryObject.include(\"most_understood_personality\", \"least_understood_personality\", \"highest_pq_user\");\n companyQueryObject.find().then(function(companyList){\n companyList = commonUtils.sortObjectsByName(companyList);\n var company = _.find(companyList, function(companyObject){\n return companyObject.id == companyId\n });\n company == company || user.get(\"company\");\n successCallback(company, companyList);\n }, errorCallback);\n }\n }\n else{\n user.get(\"company\").fetch(successCallback, errorCallback);\n }\n }", "title": "" }, { "docid": "4d0c683057891f93d79e9dd6b0e53529", "score": "0.51657194", "text": "async getAll() {\n\tlet fabric_ca_client = this.client.getCertificateAuthority();\n let caIdentityService = fabric_ca_client.newIdentityService();\n\n\tlet usersList;\n\tusersList = await caIdentityService.getAll(connection.user);\n return usersList;\n }", "title": "" }, { "docid": "4417f5f09abed546224aff9417b66442", "score": "0.51583517", "text": "function _findAllContributor() {\n contributorRestService.findAll(null, function(response) {\n vm.contributors = response;\n });\n }", "title": "" }, { "docid": "ab0161271ee50bd506037250f5058cd2", "score": "0.51446253", "text": "async listAllBikers(req, res) {\n try {\n const users = await User.findAll({ where: {\n is_admin: 0\n }})\n return res.json(users)\n } catch (err) {\n return res.json(err)\n }\n }", "title": "" }, { "docid": "48b1825439153dcb295666f08841e603", "score": "0.5144162", "text": "function rolesGetListForCurrentUser() {\r\n var url = getBaseURL() + \"Roles/Current\";\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "447369726e3d58fb938b197d7c52da9e", "score": "0.51291746", "text": "getAuthBusinesses() {\n return IsObject(this.auth, ['token']) && IsObject(this.auth.businesses) ? JSON.parse(JSON.stringify(this.auth.businesses)) : null;\n }", "title": "" }, { "docid": "87f3439841c29d8b386a099f66488665", "score": "0.5118278", "text": "function findGrants(status) {\n return db(\"grants\");\n // if we want to search grants by it's status...\n // return db('grants').where({status});\n}", "title": "" }, { "docid": "56d8256e3bb018235518df52913a248a", "score": "0.5110725", "text": "function getAssetListTree(tenantId) {\n if (isOnline) {\n return $.ajax({\n type: 'GET',\n headers: baseHeaders,\n url: config.portal + '/portal/assetMon/assetLocTree/assetList/' + tenantId\n });\n } else {\n return $.get(localUrl + 'users.txt');\n }\n }", "title": "" }, { "docid": "e302e3edac3b030a52c77d065a13c4c2", "score": "0.50935704", "text": "function getUserList() {\n return api.get(path)\n .query({ page: 1 })\n .set('Accept', 'application/json')\n .set('Content-Type', 'application/json');\n}", "title": "" }, { "docid": "b51d0eceacad25b0fa57beb237dd1c0e", "score": "0.5069336", "text": "function getUserList() {\n var data = [];\n for (let i = 0; i < clients.length; i++) {\n if (clients[i].userData) {\n data.push(clients[i].userData);\n }\n }\n return data;\n}", "title": "" }, { "docid": "201735b6ed6602d41383593e3f08af9c", "score": "0.5058442", "text": "async getEstatesByUser() {\n let returnList = [];\n let userInEstateList = [];\n let userId = localStorage.getItem('userId');\n await axios\n .get(API_URL + 'estate-list/', {\n headers: {\n Authorization: `JWT ${localStorage.getItem('token')}`,\n },\n })\n .then((response) =>\n response.data.map((element) => userInEstateList.push(element))\n );\n userInEstateList.forEach((element) => {\n element.users.forEach((user) => {\n if (user.id == userId) {\n returnList.push(element);\n }\n });\n });\n return returnList;\n }", "title": "" }, { "docid": "e1223ac868f9e4d98fb45f2e8e91e600", "score": "0.5040024", "text": "function getAllBranches()\n {\n\n userService.getAllBranches()\n .then(function (resault) {\n $scope.brancheList = resault.data.data;\n if ($scope.brancheList) {\n if (mode=='create') {\n \n }\n else if (mode=='update') {\n for (var i = $scope.brancheList.length - 1; i >= 0; i--) {\n if ($scope.brancheList[i].id == $scope.NewUser.markazId) {\n $scope.brancheList.selected = $scope.brancheList[i].id;\n }\n }\n }\n }\n $timeout(function(){\n $('.bs-select').selectpicker('refresh');\n },500)\n })\n .catch(function (error) {\n \n });\n }", "title": "" }, { "docid": "68222ea1ffb489ead83c60e497d28298", "score": "0.5032776", "text": "function getMyBlockeds(req,res){\n\tvar userId = req.user.sub;\n\n\tvar find = Blocked.find({user: userId});\n\n\tfind.populate('user bloquea_a').exec((err, blocked)=>{\n\t\tif (err) return res.status(500).send({message: 'Error en la solicitud de peticion de follows'});\n\n\t\tif(!follows) return res.status(404).send({message: 'No sigues a ningun usuario'});\n\t\t\n\t\t\t\treturn res.status(200).send({blocked});\n\n\t});\n}", "title": "" }, { "docid": "a3f9f7cca2412ce521e904857b31d0eb", "score": "0.50237477", "text": "getAllRegisteredUsers() {\n return userManager().methods.getAllRegisteredUsers().call().then(result => result);\n }", "title": "" }, { "docid": "c75f18e35d9aee693647182caa9c17e7", "score": "0.50126994", "text": "function getUsers() {\n props.getUser()\n }", "title": "" }, { "docid": "0a0fb85cc032fb1987183a6cbfa695e4", "score": "0.50080836", "text": "async getUsers() {\n let returnList = [];\n const response = await axios\n .get(API_URL + 'user-list/', {\n headers: {\n Authorization: `JWT ${localStorage.getItem('token')}`,\n },\n })\n .then((response) => response.data.map((item) => returnList.push(item)));\n return returnList;\n }", "title": "" }, { "docid": "08f3d7e63e684078b7509f5e8cf2eedc", "score": "0.5004353", "text": "async function getBrantList() {\r\n let brandList = await Phone.distinct('brand')\r\n\r\n return brandList\r\n \r\n}", "title": "" }, { "docid": "10c793069b64e0a3fde0f69ce797d0e4", "score": "0.49928147", "text": "function getOwners() {\n API.getOwners()\n .then((res) => {\n const owners = res.data.filter((owner) => owner.user_id !== user.email);\n\n console.log(owners);\n })\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "3b37ad4c9754da67a4fcb81e549609f7", "score": "0.49890578", "text": "function getOrganizationsForLoggedInUser(params) {\n\n var deferred = $q.defer();\n\n $http({\n async: true,\n method: 'get',\n data: params,\n url: GET_ORGANIZATIONS_URL,\n }).success(function(data) {\n $log.log('Success: GetBillingOrganizationsService: getOrganizationsForLoggedInUser');\n var response = data || null;\n deferred.resolve(response);\n }).error(function(jqXHR, textStatus, errorThrown) {\n var errorMsg = 'Error: GetBillingOrganizationsService: getOrganizationsForLoggedInUser: ' + errorThrown;\n $log.error(errorMsg);\n deferred.reject(jqXHR);\n })\n return deferred.promise;\n }", "title": "" }, { "docid": "2762873f69e87ddefb45b9b1263e11a9", "score": "0.49766412", "text": "async function getListOrgsOfUser(userId, logger) {\n var orgs = [];\n try {\n var res = await axios.get(GRAFANA_ENDPOINT + '/api/users/' + userId + '/orgs', { headers: { 'Authorization': GRAFANA_AUTH } });\n logger.infoWith(\"List of user's organizations: \", res.data)\n return res.data\n\n } catch (err) {\n logger.error('Error during updating role of user: ' + err.response.data.message);\n return orgs;\n }\n}", "title": "" }, { "docid": "ab330e519c3723236ba4cf15f833df74", "score": "0.4975735", "text": "function getPlants() {\n $.get(\"/api/user_data\").then(function (data) {\n renderGarden(data);\n\n });\n }", "title": "" }, { "docid": "c5f7b6e18dfd5836dbced7018c3e9a3d", "score": "0.496904", "text": "static getAllUsers() {\n let users = JSON.parse(localStorage.getItem(\"USERS\")) || [];\n return users;\n }", "title": "" }, { "docid": "df9b920cceb302f43db20d087edc3315", "score": "0.49661812", "text": "getAllUsers() {\n return this.users;\n }", "title": "" }, { "docid": "b9a6fe01486a7edddd51297e426c852e", "score": "0.49386498", "text": "getAllCitizens() {\n return userManager().methods.getAllCitizens().call().then(result => result);\n }", "title": "" }, { "docid": "57d6c647ede06772d642a787f02f665b", "score": "0.49370944", "text": "function GetUserList() {\n\t\treturn $.ajax({\n\t\t\turl: '/api/usuarios/listar',\n\t\t\ttype: 'get',\n\t\t\tdataType: \"script\",\n\t\t\tdata: { authorization: localStorage.token },\n\t\t\tsuccess: function(response) {\n\t\t\t\tconst usuarios = JSON.parse(response);\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\n\t\t\t\tusuarios.forEach(user => {\n\t\t\t\t\ttablaUsuarios.row.add({\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\n\t\t\t\t\t}).draw();\n\t\t\t\t\tif(user.nickUsuario == 'admin'){\n\t\t\t\t\t\t$('#userDropdown').val(user.nombreCUsuario);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "f03d70f88977f049806c462c6c514a4c", "score": "0.49355572", "text": "function teacherGetListByMerchant(merchantID) {\r\n var url = getBaseURL() + \"Teachers/List/Merchant/\" + merchantID;\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "550c79f9ecf5f57f6d81483a02b834fa", "score": "0.49292365", "text": "function getOwners() {\n $.get(\"/api/owners\", renderOwnerList);\n }", "title": "" }, { "docid": "5a7142ecae47173dc18f7c8c854fadcb", "score": "0.49249965", "text": "async function getAdminOrgs() {\n return Promise.all([\n chaincode1.getOrgAdmin(),\n chaincode2.getOrgAdmin()\n ]);\n}", "title": "" }, { "docid": "caa1513332724d8d434ad944c7c5e313", "score": "0.49204528", "text": "function getBrands() {\n return $http.get('/api/substances/brands')\n .then(function(result) {\n return result.data;\n });\n }", "title": "" }, { "docid": "d1e3f0dbc80b58d3f28d43c8977c92a0", "score": "0.4919199", "text": "static getList(user, callback) {\n let query = \"SELECT * FROM facilities WHERE props#>'{admins}'?|\"+`array['${user.roles.join(\",\")}']`;\n return Facility.sqlQuery(Facility, query, [], callback);\n }", "title": "" }, { "docid": "3fa74442056218410cb19f888660265d", "score": "0.49095222", "text": "function getGroupsAndUsers(){\n\t//PHP-Request\n\t$.get(\"php/getGroupsUser.php\", function(data){\n\t\tvar parsedData = JSON.parse(data);\n\t\t//For each user\n\t\tfor(var j = 0; j < parsedData[0][0].length; j++){\n\t\t\t//If it is not you who logged in\n\t\t\tif(credentials[0] != parsedData[0][1][j])\n\t\t\t\t//Add the user to the selection list\n\t\t\t\t$(\"select[id='users']\").append(new Option(parsedData[0][1][j], parsedData[0][0][j]));\n\t\t}\n\t\t//For each group\n\t\tfor(var j = 0; j < parsedData[1][0].length; j++){\n\t\t\t//Add the group to the selection list\n\t\t\t$(\"select[id='groups']\").append(new Option(parsedData[1][1][j], parsedData[1][0][j]));\n\t\t}\n\t});\n}//Display available groups and users", "title": "" }, { "docid": "3e50745b133b77c2d57db54e8ee12ab5", "score": "0.49026546", "text": "getScopes() {\n const self = this\n return new Promise((resolve, reject) => {\n mgr.getUser().then(function(user) {\n if (user == null) {\n self.signIn()\n return resolve(null)\n } else {\n return resolve(user.scopes)\n }\n }).catch(function(err) {\n console.log(err)\n return reject(err)\n })\n })\n }", "title": "" }, { "docid": "d1f0bf28e3f2ee4fce3a9a808b63f61e", "score": "0.49013123", "text": "function findGrantsBy(filter) {\n return db(\"grants\").where(filter);\n}", "title": "" }, { "docid": "27df872d58a57161a6b1ec312779269e", "score": "0.4901166", "text": "async getUsers() {\n return await this.contract.getUsers();\n }", "title": "" }, { "docid": "aef03bf8b6f03b40f9fcfa9d468eb1b1", "score": "0.49007443", "text": "function getMemeCreators() {\n $.get(\"/api/users\", renderCreatorList);\n }", "title": "" }, { "docid": "eeaa1cee123562e5011e300c617eb07e", "score": "0.49001524", "text": "function getRestaurants() {\n const currentState = Store.getState();\n //console.log('getRestaurant current state', currentState);\n\n RestaurantSyncanoService\n .getActiveRestaurants(currentState.restaurant.orderBy)\n .then((restaurants) => {\n return Store.dispatch({\n type: 'REFRESH_LIST',\n restaurants\n });\n })\n .catch((error) => {\n console.log(`Get restaurants error: ${error}`);\n })\n ;\n}", "title": "" }, { "docid": "457118abec2c8634d6377ac3cb0e14f0", "score": "0.48985493", "text": "getAll() {\r\n return this.repositoryLogin.find();\r\n }", "title": "" }, { "docid": "4ea8461c748a2fe0ff9cd7af161e4d63", "score": "0.48948035", "text": "function get_boats(req){\n var q = datastore.createQuery(BOAT);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0].map(ds.fromDatastore).filter(boat => boat.owner == req.user.sub)\n })\n}", "title": "" }, { "docid": "7b9bf9880f97904663546bcab0028231", "score": "0.4892179", "text": "static getManagerList() {\n return StatusDashboardOverViewAPI.getHTTPClient().get('/manager');\n }", "title": "" }, { "docid": "61d8e7fcc9772300da95d54783ea7573", "score": "0.48875237", "text": "async function getProfiles(user) {\n if (user.local.role === 'admin') {\n return await User.find({}).lean();;\n } else if (user.local.role === 'moderator') {\n let query = [{ \"local.role\": \"user\" }, { \"local.role\": \"moderator\" }, { \"facebook.role\": \"user\" }, { \"google.role\": \"user\" }]\n return await User.find({$or: query}).lean();;\n } else {\n return [user]\n }\n}", "title": "" }, { "docid": "6826c35cdff19c6cd9cd63774519768a", "score": "0.48805332", "text": "static getList() {\n\t\treturn fetch(`https://api.github.com/search/users?q=ad`)\n\t\t.then((response) => response.json())\n\t\t.then((json) => {\n console.log(\"json in api\",json);\n\t\t\treturn { options: json.items };\n\t\t});\n }", "title": "" }, { "docid": "342cba31e0728191ec2e99f527fa1b6e", "score": "0.48694372", "text": "function getBiomeNameList(biomes) {\n let list = [];\n biomes.forEach(entry => {\n list.push(entry.biome_short_name)\n })\n return list;\n}", "title": "" }, { "docid": "a3a793e6c1d3386778484edb039630d3", "score": "0.48576415", "text": "function getAllBrands() {\n return new Promise((resolve, reject) => {\n DAL.getAllBrands().then(response => {\n resolve(response);\n });\n });\n}", "title": "" }, { "docid": "6b82286114e2e66c2a6e1cf1a976ef2e", "score": "0.48386687", "text": "async function getFlattenedUsersLocations() {\n try {\n const userRes = await axios.get(\"https://randomuser.me/api/?results=20\");\n const usersList = userRes.data.results;\n const flattenedLocations = usersList.map(user => flattenedObject(user.location));\n return flattenedLocations;\n }\n catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "5120955326248ac63e61af073ebd9618", "score": "0.48194504", "text": "static getCustomers() {\n\t\tlet Customers;\n\t\tif (localStorage.getItem('Customers') === null) {\n\t\t\tCustomers = [];\n\t\t} else {\n\t\t\tCustomers = JSON.parse(localStorage.getItem('Customers'));\n\t\t}\n\n\t\treturn Customers;\n\t}", "title": "" }, { "docid": "e09f4961ff8943d229b5bf479e9e9ff8", "score": "0.47928238", "text": "function getAssetLocTree() {\n isTokenValid();\n if (isOnline)\n return $.ajax({\n type: 'GET',\n headers: backendHeaders,\n url: config.portal + '/portal/assetMon/assetLocTree',\n error: function (e) {\n return Promise.reject(e);\n }\n });\n else {\n return $.get(localUrl + 'users.txt');\n }\n }", "title": "" }, { "docid": "6eeee1f8b05881877ad9ac5069c3a913", "score": "0.47919756", "text": "function rolesGetListForCurrentUserWithRights() {\r\n var url = getBaseURL() + \"Roles/Current/WithRights\";\r\n return $http.get(url);\r\n }", "title": "" }, { "docid": "5cfb411267fa9aa512cdd7a39ccfd9a0", "score": "0.4787186", "text": "function getUsers(){\n console.log('getUsers called');\n grout.Users.get().then(function(app){\n console.log('apps list loaded:', app);\n document.getElementById(\"output\").innerHTML = JSON.stringify(app);\n }, function(err){\n console.error('Error getting users:', err);\n });\n }", "title": "" }, { "docid": "6ca35d57d5b430d1596fadcd96389d3d", "score": "0.4773999", "text": "function getBlogs () {\n return new Promise( ( resolve, reject ) => {\n tumblrClient.userInfo( ( err, data ) => {\n if ( err ) {\n return reject( err );\n }\n\n return resolve( data.user.blogs );\n } );\n } );\n}", "title": "" }, { "docid": "db918ced551ace419c2f9a44a3f99ab3", "score": "0.47685817", "text": "function getSurveyListForUser() {\r\n var url = getBaseURL() + \"Surveys/CurrentUser\";\r\n return $http.get(url); \r\n }", "title": "" }, { "docid": "be5585b52a3ed48b15905b99fe0bf81c", "score": "0.47566593", "text": "getAuthUsers() {\n return JSON.parse(JSON.stringify(this.auth.users));\n }", "title": "" }, { "docid": "f5b54d630bd56890e29bb67bd74b2d7b", "score": "0.47387797", "text": "function getRestaurantsAll() {\r\n dbPromise.then(db => {\r\n return db.transaction('restaurants').objectstore('restaurants')\r\n .getRestaurantsAll();\r\n }).then(allObjs => console.log(allObjs));\r\n }", "title": "" }, { "docid": "25a43a5a8a94bdd555dc9b8945346562", "score": "0.47383824", "text": "listAllUsers(){}", "title": "" }, { "docid": "70c395983170009f0f084f70fc84ce75", "score": "0.47354022", "text": "async getUserOrganisation() {\n const user_Id = await getUserId();\n const Auth_token = await getAuthToken();\n const url = `api/userorganisation?userId=${user_Id}`;\n return Method.dataGet(url, Auth_token);\n }", "title": "" }, { "docid": "d51e7aff65b762636377251d67706015", "score": "0.4717776", "text": "function getUserAuthGroups(req, res) {\n new UserAuthGroup().query(function (qb) {\n qb.from('user_auth_group as uag');\n qb.select(bookshelf.knex.raw(\"uag.*,ag.*\"));\n qb.leftJoin('auth_group AS ag', 'ag.id', 'uag.auth_group_id').orderBy('uag.id', 'DESC');\n qb.whereRaw('( uag.user_id = ?)', [req.params.user_id]);\n }).fetchAll({}).then(function (result) {\n var UserAuthGroups = result.toJSON();;\n res.status(200).json({\n status: req.config.statusCode.success,\n data: UserAuthGroups,\n message: \"User Group fetched successfully.\"\n });\n });\n}", "title": "" }, { "docid": "cd9ba14c3ab0ad87b6d7dffac012ed86", "score": "0.47168323", "text": "getDBUlist(callback) {\r\n this.models.ad_users.findAll({\r\n raw: true,\r\n attributes: ['login'],\r\n }).then(res => {\r\n let ulist = []; // LIST OF EXISTING USERS\r\n for (let i in res) {\r\n ulist.push(res[i].login)\r\n }\r\n callback(ulist);\r\n });\r\n }", "title": "" }, { "docid": "f7b1fd80f3f642a1bb26a0bdee00b53b", "score": "0.47097033", "text": "async showAll(){\n return Customer.findAll();\n }", "title": "" }, { "docid": "8453ec19482741eccccccf50f0e80e38", "score": "0.47083417", "text": "function getUsers(){\n\n\t\tUser.getUsers().then(function(data){\n\t\t\tif(data.data.success){\n\t\t\t\tif(data.data.permission === \"Admin\" || data.data.permission === \"Mod\"){\n\t\t\t\t\t//console.log(\"permissions granted\");\n\t\t\t\t\tapp.users = data.data.users;\n\t\t\t\t\tapp.accessDenied = false;\n\t\t\t\t} else{\n\t\t\t\t\t//console.log(\"no permissions granted\");\n\t\t\t\t\tapp.errorMsg = \"Insufficient permission.\"\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tapp.errorMsg = data.data.message;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "232ee131f55e5a600eceb3ab7af91894", "score": "0.47064972", "text": "function getUserList(){\n\tlist = [];\n\tfor(key in people){\n\t\tlist.push(people[key].username);\n\t}\n\treturn list;\n}", "title": "" }, { "docid": "ae53adad40fb4320aaad7d70eb3ddea1", "score": "0.47052616", "text": "getAll(cb) {\n orm.selectAll(burgerTable, res => cb(res) )\n }", "title": "" }, { "docid": "ff21fe08ebdf032200d33f81544b7ecf", "score": "0.47047248", "text": "function list_bans() {\n\tvar ret = new fl.Branch(\n\t\tfunction check(env, after) {\n\t\t\tafter(admin.isAdmin(env));\n\t\t},\n\t\tnew fl.Chain(\n\t\t\tfunction list(env, after) {\n\t\t\t\tenv.filters.bans.select()\n\t\t\t\t\t\t.fields([db.$inet_ntoa('ip'), 'ip'], 'reason', 'date')\n\t\t\t\t\t\t.exec(after, env.$throw);\n\t\t\t},\n\t\t\tfunction render(env, after, bans) {\n\t\t\t\tenv.$template('admin_bans');\n\t\t\t\tenv.$output({\n\t\t\t\t\ttitle : 'Ban List',\n\t\t\t\t\tbans : bans,\n\t\t\t\t\tadmin : true\n\t\t\t\t});\n\t\t\t\tafter();\n\t\t\t}),\n\t\tfunction redirect(env, after) {\n\t\t\tenv.$redirect('/');\n\t\t\tafter();\n\t\t});\n\tret.name = 'list_bans';\n\treturn ret;\n}", "title": "" }, { "docid": "ad6bbc8332aa1f5d11609b779f04c6a5", "score": "0.4704445", "text": "getLinkedAccounts(){}", "title": "" }, { "docid": "2bd202a91d0a143c5633604709abfab9", "score": "0.4701953", "text": "function getContributors(repo_name, client_id, client_secret) {\n var contributors = [];\n\n var url = GITHUB_API_BASE_URL + '/repos/' + REPO_OWNER + '/' + REPO_NAME + '/contributors';\n\n if(typeof client_id !== 'undefined' && typeof client_secret !== 'undefined') {\n url += '?client_id=' + client_id + '&client_secret=' + client_secret;\n }\n\n var data = httpGet(url);\n \n for(var contributor_index = 0; contributor_index < data.length; contributor_index++) {\n contributors.push(data[contributor_index].login);\n }\n\n return contributors;\n}", "title": "" }, { "docid": "04a8810a223af6e0add1f65ab95acb79", "score": "0.4701492", "text": "list(){\n return http\n .get('usuario/activos');\n }", "title": "" }, { "docid": "2a00f4d7bb12763ef418552d9674b933", "score": "0.4697909", "text": "function getUsers (){\r\n \r\n const output= users; \r\n return output;\r\n}", "title": "" }, { "docid": "4e69d6c993ff8014d8d36089203c702c", "score": "0.46918657", "text": "async function getUsers() {\n const allUsersWithLists = await Users.findAll({\n include: { model: TodoLists, attributes: [\"name\"] },\n });\n return allUsersWithLists.map((user) => user.toJSON());\n}", "title": "" }, { "docid": "508252966285394d52b4ed30a19b24d4", "score": "0.4683482", "text": "async function merchantGetAll(req, res, next) {\n try {\n const validMerchantId = req.merchant._id; //MerchantId of the Merchant\n //Find all balances with this Merchant\n let balance = await Balance.find({ merchantId: validMerchantId, isActive: true }).exec();\n\n //If no balances exists\n if (!balance.length) {\n console.log('Merchant has no balances!');\n return res.status(409).json({\n message: \"Merchant has no balances!\"\n });\n //Else\n } else {\n var ids = []; //Array of balanceIds mentioned in the balances\n for (var i = 0; i < balance.length; i++) {\n ids[i] = balance[i]._id;\n }\n //Find real and active hashes mentioned in the balances\n let hash = await Hash.find({ balanceId: { $in: ids }, isActive: true }).exec();\n\n var balances = []; //Array of balances\n for (var i = 0; i < balance.length; i++) {\n for (var x = 0; x < hash.length; x++) {\n //If the hash's balanceId is the same as the _id in the balance\n if (hash[x].balanceId.equals(balance[i]._id)) {\n break;\n }\n }\n balances[i] = {\n balanceId: hash[x].hashId,\n phone: balance[i].phone,\n merchantId: balance[i].merchantId,\n balance: balance[i].balance,\n createdAt: balance[i].createdAt,\n updatedAt: balance[i].updatedAt\n }\n //Remove that Merchant from the list of Merchants\n hash.splice(x,1);\n }\n console.log(\"\\n\"+JSON.stringify(balances, \",\", \" \")+\"\\n\");\n return res.status(200).json({\n balances\n });\n }\n } catch (err) {\n throwErr(res, err);\n }\n}", "title": "" }, { "docid": "6fb32f8147bf9c2638d66357c95bdbdf", "score": "0.46802363", "text": "getAllUsers() {\n return Api().get('/users')\n }", "title": "" }, { "docid": "f1d6f41198dfa95268857223abb503b2", "score": "0.46781117", "text": "static async getCompanies(params = {}) {\n let res = await this.request(`companies/`, params);\n \n return res.companies;\n }", "title": "" }, { "docid": "7dff7b8e57f7f38d3fe1e3a3e8da9c88", "score": "0.46753097", "text": "function getUsers(){\n return [0,1,2,3,4,5];\n}", "title": "" }, { "docid": "cb26dcc5965d290fe2854735e1428055", "score": "0.4674741", "text": "getStaffGroups({ commit }) {\n commit(\"SET_STAFF_GROUPS\", STAFF_GROUPS);\n }", "title": "" }, { "docid": "710b488641575acebe5c14e5c7218ae8", "score": "0.4674245", "text": "async function getAllReportsManagers() {\n const reportsManagers = db.Account.find(\n { role: { $in: [\"Admin\", \"ReportsManager\"] } },\n { firstName: 1, lastName: 1 }\n );\n return reportsManagers;\n}", "title": "" } ]
4ab491bee837a467a86c6a55980e764f
How much the user may change the value at once by moving the slider.
[ { "docid": "e72836169faa9fcda2afa88603e5aa86", "score": "0.0", "text": "get step() {\n return this.args.step || 1;\n }", "title": "" } ]
[ { "docid": "c419e597aaf74b2f12433859d9fdd1bf", "score": "0.71747", "text": "function SliderValue(that, // @param this:\n value, // @param Number(= void 0):\n fx) { // @param Boolean(= false):\n // @return Number: current value\n if (value !== void 0) {\n var param = that.param, pp = 100 / (param.max - param.min);\n\n value = (value - param.min) * pp * (param.size * 0.01);\n SliderMove(that, value, value, fx);\n }\n return that.param.value;\n}", "title": "" }, { "docid": "9149b00fa121f824fe1475a2101b448e", "score": "0.6764866", "text": "changeValueForScrollMovement() {\n evaluator = this.evaluator;\n limInf = this.limInf;\n limSup = this.limSup;\n min = evaluator.eval(this.min);\n max = evaluator.eval(this.max);\n incr = this.incr;\n\n newValue = MathFloor( (((this.pos-limInf)*(max-min))/(limSup-limInf))/incr )*incr +min;\n\n // if the value change, the update everything\n if (newValue != this.value) {\n this.value = newValue;\n this.field.value = this.formatOutputValue(newValue);\n\n // register the control value\n evaluator.setVariable(this.id, this.value);\n\n // update the controls\n this.parent.updateControls();\n // execute the action\n this.actionExec.execute();\n // update again the controls\n this.parent.update();\n }\n }", "title": "" }, { "docid": "cdb145c0415b89f4c36d9ce81ef9c032", "score": "0.6726042", "text": "_handleValueCorrection(event) {\n // Don't update the UI with the current value! The value on pointerdown\n // and pointerup is calculated in the split second before the input(s)\n // resize. See _updateWidthInactive() and _updateWidthActive() for more\n // details.\n this._skipUIUpdate = true;\n // Note that this function gets triggered before the actual value of the\n // slider is updated. This means if we were to set the value here, it\n // would immediately be overwritten. Using setTimeout ensures the setting\n // of the value happens after the value has been updated by the\n // pointerdown event.\n setTimeout(() => {\n this._skipUIUpdate = false;\n this._fixValue(event);\n }, 0);\n }", "title": "" }, { "docid": "f5416416f31433bbd189777fca2d96a8", "score": "0.6661808", "text": "function rangeSlide(value){\n document.getElementById('rangeValue').innerHTML=value;\n document.getElementById('current').innerHTML=Math.round(12/value*100)/100;}", "title": "" }, { "docid": "16a9cc65e55c109ba2c63ebef4935207", "score": "0.66552496", "text": "_fixValue(event) {\n const xPos = event.clientX - this._slider._cachedLeft;\n const width = this._slider._cachedWidth;\n const step = this._slider.step === 0 ? 1 : this._slider.step;\n const numSteps = Math.floor((this._slider.max - this._slider.min) / step);\n const percentage = this._slider._isRtl ? 1 - xPos / width : xPos / width;\n // To ensure the percentage is rounded to the necessary number of decimals.\n const fixedPercentage = Math.round(percentage * numSteps) / numSteps;\n const impreciseValue = fixedPercentage * (this._slider.max - this._slider.min) + this._slider.min;\n const value = Math.round(impreciseValue / step) * step;\n const prevValue = this.value;\n if (value === prevValue) {\n // Because we prevented UI updates, if it turns out that the race\n // condition didn't happen and the value is already correct, we\n // have to apply the ui updates now.\n this._slider._onValueChange(this);\n this._slider.step > 0\n ? this._updateThumbUIByValue()\n : this._updateThumbUIByPointerEvent(event, { withAnimation: this._slider._hasAnimation });\n return;\n }\n this.value = value;\n this.valueChange.emit(this.value);\n this._onChangeFn?.(this.value);\n this._slider._onValueChange(this);\n this._slider.step > 0\n ? this._updateThumbUIByValue()\n : this._updateThumbUIByPointerEvent(event, { withAnimation: this._slider._hasAnimation });\n }", "title": "" }, { "docid": "ff003ace2ed67ff52b8d313585671a57", "score": "0.6606416", "text": "function updateValue() {\n if (!_.isNumber(scope.percent)) {\n scope.el.text.text('?');\n return;\n }\n scope.el.text.text(Math.round(scope.percent * 100) + '%');\n scope.el.foreground.transition()\n .duration(750)\n .call(arcTween, scope.percent * scope.tau);\n }", "title": "" }, { "docid": "fcdb421bfb5ea4fb1fc35e0dc103e1ac", "score": "0.6570643", "text": "get percentage() {\n if (this._slider.min >= this._slider.max) {\n return this._slider._isRtl ? 1 : 0;\n }\n return (this.value - this._slider.min) / (this._slider.max - this._slider.min);\n }", "title": "" }, { "docid": "041ea2eafcc96763ef53ca5056d6ac03", "score": "0.6546835", "text": "function updateSliderValue(value) {\n var output = document.getElementById(\"slideroutput\");\n output.innerHTML = value * 10000;\n}", "title": "" }, { "docid": "c70d296c32b34a17349672da054178d3", "score": "0.65417403", "text": "increase10() {\n desp = (this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;\n\n if (this.orientation == HORIZONTAL) {\n if (this.clickPos.x > this.prePos) {\n this.changeValue( parseFloat(this.value) + desp );\n }\n } else {\n if (this.clickPos.y < this.prePos) {\n this.changeValue( parseFloat(this.value) + desp );\n }\n }\n }", "title": "" }, { "docid": "596f96e33ce37e995d6609bf0cedc1ff", "score": "0.65411973", "text": "function radiusSliderUpdate() {\n let radiusValue = document.getElementById('radius-value');\n let radiusSlide = document.getElementById('radius');\n\n radiusSlide.oninput = function() { //Displayed the radius selected when the slider is moved\n let mls = getDistance(radiusSlide.value);\n radiusValue.innerHTML = Math.round(mls); //rounds the numer and siaplyed in radiusValue\n };\n return radiusSlide;\n}", "title": "" }, { "docid": "631e40221a9681bb5459b7bb84105e59", "score": "0.6527372", "text": "function displayCurrentValue(event) {\n sliderValueInfo.innerHTML =\n runningSpeedArray[parseInt(event.target.value)][0];\n metValue.value = runningSpeedArray[parseInt(event.target.value)][1];\n }", "title": "" }, { "docid": "ccee8dee3d6aad91c0e4df48619dcb85", "score": "0.6516832", "text": "function rangeSlide(value) {\r\n //Como no input de range o valor pode ser 0, um operador ternário substitui o 0 por 1 \r\n let val = (value > 0 ? value : 1);\r\n //waitTime deve ser em milisegundos\r\n waitTime = val;\r\n // val/1000 para mostrar o valor em segundos no html\r\n document.getElementById('rangeValue').textContent = \"Velocidade dos passos: \" + val / 1000 + \" s\";\r\n }", "title": "" }, { "docid": "8ff69c062cb914ed13896015e0bf052c", "score": "0.6510737", "text": "function updateValue() {\n // Clear animations if are still running\n anime.remove([rangeValues, rangeSliderPaths[0], rangeSliderPaths[1]]);\n\n // Calc the `input` value using the current `y`\n rangeValue = parseInt(currentY * max / rangeHeight);\n // Calc `scale` value for numbers\n scale = (rangeValue - rangeMin) / (rangeMax - rangeMin) * scaleMax;\n // Update `input` value\n rangeInput.value = rangeValue;\n // Update numbers values\n rangeValueNumberTop.innerText = max - rangeValue;\n rangeValueNumberBottom.innerText = rangeValue;\n // Translate range values\n rangeValues.style.transform = 'translateY(' + (rangeHeight - currentY) + 'px)';\n // Apply corresponding `scale` to numbers\n rangeValueNumberTop.style.transform = 'scale(' + (1 - scale) + ')';\n rangeValueNumberBottom.style.transform = 'scale(' + (1 - (scaleMax - scale)) + ')';\n\n // Some maths calc\n if (Math.abs(mouseDy) < mouseDyLimit) {\n lastMouseDy = mouseDy;\n } else {\n lastMouseDy = mouseDy < 0 ? -mouseDyLimit : mouseDyLimit;\n }\n\n // Calc the `newSliderY` value to build the slider `path`\n newSliderY = currentY + lastMouseDy / mouseDyFactor;\n if (newSliderY < rangeMinY || newSliderY > rangeMaxY) {\n newSliderY = newSliderY < rangeMinY ? rangeMinY : rangeMaxY;\n }\n\n // Build `path` string and update `path` elements\n newPath = buildPath(lastMouseDy, rangeHeight - newSliderY);\n rangeSliderPaths[0].setAttribute('d', newPath);\n rangeSliderPaths[1].setAttribute('d', newPath);\n }", "title": "" }, { "docid": "5a589b42f8fe5e88a6dd31c78abf8c35", "score": "0.6396902", "text": "function spouse_ielts_listening_change() {\n\n var listening = $('.spouse_ielts_listening_range').val();\n $('.spouse_ielts_listening_value').text(listening);\n\n\n\n if(listening <=4.5){\n\n crs_calculate_object.spouse_ielts.listening = 0;\n }\n else if(listening >=5 && listening<= 5.5){\n crs_calculate_object.spouse_ielts.listening = 1;\n }\n else if(listening >=6 && listening <= 7.5){\n crs_calculate_object.spouse_ielts.listening = 3;\n }\n else if(listening >=8){\n crs_calculate_object.spouse_ielts.listening = 5;\n }\n\n console.log('spouse listening : '+crs_calculate_object.spouse_ielts.listening);\n score_board();\n\n }", "title": "" }, { "docid": "12e2c9cabfa3cd0072a201abdd02f3ec", "score": "0.63914573", "text": "function updateRange(slider)\r\n{\r\n\tsliderVal = slider.value;\r\n}", "title": "" }, { "docid": "2447b580af9792f55189f53eb005d300", "score": "0.6386392", "text": "function SliderDistanceChange(e) {\n slider = document.getElementById(\"SliderDistanceTime\");\n document.body.style.setProperty(\"--chromatic-distance-time\", String(slider.value) + \"ms\")\n document.getElementById(\"TextDistanceTime\").innerHTML = String(slider.value) + \"ms\"; \n }", "title": "" }, { "docid": "603325bdf84dae439052ded6b659b830", "score": "0.63842845", "text": "_setIncrease() {\n let value = this.value + this.step;\n value = Math.min(this.max, Math.max(this.min, value));\n this._setValue(value);\n }", "title": "" }, { "docid": "c95005140d38f5fb8ba912ae33767185", "score": "0.6382177", "text": "_onSliderValueChanged(cli, _slider) {\n\t\tif (this.autoControl.state == 0)\n\t\t{\n\t\t\tlet cmd = 'mono '+ this.location +'/nbfc.exe set -s' + String(this.slider.value * 100);\n\t\t\tGLib.spawn_command_line_sync(cmd);\n\t\t\tthis._updateDisplay();\n\t\t}\n\t}", "title": "" }, { "docid": "155d8bd492c67f54b57a4e27e31d4a39", "score": "0.63743836", "text": "function updateSlider( slideAmount, textField )\n{\n\n $( \"#\" + textField ).text( \"Gewicht: \" + Math.round( slideAmount * 100 ) / 100 + \"%\" );\n}", "title": "" }, { "docid": "0cf998a2db313d375a5c3b3c5672a834", "score": "0.6357387", "text": "incrementValue () {\n this.value = this.value * 2;\n updateScore(this.value);\n this.height++;\n this.setDiv(CLASSES[this.height]);\n if(this.value == 2048 && !hasWon){\n hasWon = true;\n winGame();\n }\n }", "title": "" }, { "docid": "e08547eceaabf3f89d7c9cbcb452a35a", "score": "0.6357095", "text": "function coeff_val_change(newVal) {\n thresh = newVal;\n $(\"#coeff_slider_val\").text(newVal + \"%\");\n}", "title": "" }, { "docid": "c415968fe9dee1266d9e54a68d11198a", "score": "0.6351961", "text": "set_value(value, trigger_event = false) {\n // Though we clamp the value to `min` and `max`, we permit non-`step` values (though in\n // practice, this will not be possible when this event has been triggered by the user).\n // `relative_min` and `relative_max` is the minimum/maximum for this thumb taking into\n // account the previous/next thumb, and `spacing`.\n let relative_min = this.index > 0 ?\n this.slider.thumbs[this.index - 1].value + this.slider.spacing : this.slider.min;\n let relative_max = this.index + 1 < this.slider.thumbs.length ?\n this.slider.thumbs[this.index + 1].value - this.slider.spacing : this.slider.max;\n // If the slider is symmetric, then we need to make sure we don't set the thumb to a value\n // too close to the centre, where there won't be enough space for the thumb's pair.\n if (this.slider.class_list.contains(\"symmetric\")) {\n if (this.index < this.slider.thumbs.length / 2) {\n relative_max = Math.min(\n (this.slider.min + this.slider.max - this.slider.spacing) / 2,\n relative_max\n );\n } else {\n relative_min = Math.max(\n (this.slider.min + this.slider.max + this.slider.spacing) / 2,\n relative_min\n );\n }\n }\n value = clamp(\n Math.max(relative_min, this.slider.min),\n value,\n Math.min(relative_max, this.slider.max),\n );\n\n // Although it would make sense to include the position calculation in the following block,\n // there are times we want to recalculate the position even when the value has not changed,\n // so it's more convenient to set the position regardless.\n const slider_rect = this.slider.bounding_rect();\n const thumb_rect = this.bounding_rect();\n this.set_style({\n left: `${\n thumb_rect.width / 2\n + (value - this.slider.min) / (this.slider.max - this.slider.min)\n * (slider_rect.width - thumb_rect.width)\n }px`,\n });\n\n if (value !== this.value) {\n this.value = value;\n\n const slider_values = this.slider.label.query_selector(\".slider-values\").clear();\n this.slider.thumbs.forEach((thumb, i) => {\n let value = `${thumb.value}`;\n if (typeof thumb.value === \"number\" && !Number.isInteger(thumb.value)) {\n // If we're displaying a floating-point number, cap the number of decimal\n // places to 2.\n value = thumb.value.toFixed(2);\n }\n slider_values.add(new DOM.Element(\"span\", { class: \"slider-value\" })\n .add(`${value}`));\n if (i + 1 < this.slider.thumbs.length) {\n slider_values.add(\" \\u2013 \");\n }\n });\n\n // Trigger a `input` event on the thumb (which will bubble up to the slider).\n if (trigger_event) {\n this.dispatch(new Event(\"input\", { bubbles: true }));\n }\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "b68f4ea801ec852c13bfa9c3f8ee3416", "score": "0.6342841", "text": "function syncCharacterAmount(e) {\n const value = e.target.value\n userLength.value = value\n userSlider.value = value\n}", "title": "" }, { "docid": "dde78549c95feb5f486a81cff827ba07", "score": "0.6332861", "text": "function update(slider,val) {\n //changed. Now, directly take value from ui.value. if not set (initial, will use current value.)\n var $SpaceTaken = slider == 2?val:$(\"#SpaceTaken\").val();\n\n /* commented\n $amount = $( \"#slider\" ).slider( \"value\" );\n $SpaceTaken = $( \"#slider2\" ).slider( \"value\" );\n */\n\n $( \"#SpaceTaken\" ).val($SpaceTaken);\n $( \"#SpaceTaken-label\" ).text($SpaceTaken);\n\n $('#slider2 a').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span>' + $SpaceTaken + '<span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n }", "title": "" }, { "docid": "2141d56de4d20bbdbaff1aa73630d388", "score": "0.6303368", "text": "function on_change() {\n // If the node has the range property set, we'll return values in that range\n let flo_min = flo_min_value['Float'] || 0.0;\n let flo_max = flo_max_value['Float'] || 100.0;\n\n // We get a number 0-1000, change to fit in the range\n let value = (input_element.value/1000.0)*(flo_max-flo_min) + flo_min;\n\n // This is the set event: if the node has an set_value handler, this is where we send it\n let input_handler = element.flo_set_value || (() => {});\n\n // Pass on the event (sliders generate float values)\n input_handler({ 'Float': value });\n }", "title": "" }, { "docid": "6a3d824fee7e76d3170477ff8506c558", "score": "0.6297381", "text": "function UpdateVolume()\n{\n setVolume((slider.value-1));\n}", "title": "" }, { "docid": "cd6de53681abc8e9fa1cd59f40f43017", "score": "0.62814265", "text": "function adjustSlider(sim) {\n if (sim * 100 > similarityThresholdMax) {\n similarityThresholdMax = sim * 100;\n } else if (sim * 100 < similarityThresholdMin) {\n similarityThresholdMin = sim * 100;\n }\n}", "title": "" }, { "docid": "360f67bed56ff099d8fc1481a478a2e0", "score": "0.62390214", "text": "function sliderMoved(value){\n\n newData = updateData(value);\n drawPoints(newData);\n\n}", "title": "" }, { "docid": "360f67bed56ff099d8fc1481a478a2e0", "score": "0.62390214", "text": "function sliderMoved(value){\n\n newData = updateData(value);\n drawPoints(newData);\n\n}", "title": "" }, { "docid": "a57cfd8ee6cb4d9ee7871ec02ecf1a13", "score": "0.6221866", "text": "setValue(val) {\n const valRel = (val - this.valueMin) / (this.valueMax - this.valueMin);\n const newPos = valRel * this.sliderWidth + 2 * this.handleOffset;\n this.translate(newPos);\n this.value = this.getPositionValue();\n this.dispatchEvent(new CustomEvent(\"update\"));\n }", "title": "" }, { "docid": "786512b699b8f5ff6cf88dca07a3c51d", "score": "0.6215276", "text": "getValue(){\n\n // map this slider's ouptput\n let value = map(this.y+this.h - this.position, 0, this.h, 0, 1);\n // match its index number to a game parameter\n switch(this.index){\n case 6: // character height\n // map to correct range and update\n value = map(this.y+this.h-this.position, 0, this.h,window.innerHeight/96, -window.innerHeight/4);\n dude.legMoves[dude.currentMoves].height = value;\n break;\n case 7: // vigor\n dude.vigor[dude.currentMoves] = value;\n break;\n case 8: // synth volume\n musicObject.maxAmplitude[0] = value;\n musicObject.envelopes[0].setRange( musicObject.maxAmplitude[0], 0);\n break;\n case 9: // bass volume\n musicObject.maxAmplitude[1] = value;\n musicObject.envelopes[1].setRange( musicObject.maxAmplitude[1], 0);\n break;\n case 10: // drum volume\n musicObject.maxAmplitude[2] = value;\n musicObject.envelopes[2].setRange( musicObject.maxAmplitude[2], 0);\n musicObject.envelopes[2].setADSR(0.01, 0.05, 0.3*musicObject.maxAmplitude[2], 0.4);\n break;\n case 11: // tempo\n // adapt dude speed to tempo\n for (let i=0; i<dude.limbs.length; i++){\n dude.limbs[i].speed = 1+value*value*15;\n }\n // map music playing speed to match \"tempo\"\n value = map(this.y+this.h-this.position, 0, this.h, 1, 0);\n musicObject.subDivisionLength = floor(2+20*value);\n break;\n }\n }", "title": "" }, { "docid": "1313e63e83085eed2b5e81c3dcdaaeae", "score": "0.62003374", "text": "function changeSpeed() {\r\n\t\tinfectionSpeed = this.value;\r\n\t}", "title": "" }, { "docid": "8831a29e3a3e75e11e5ce87d1b6c6063", "score": "0.6188647", "text": "function spouse_ielts_reading_change() {\n\n var reading = $('.spouse_ielts_reading_range').val();\n $('.spouse_ielts_reading_value').text(reading);\n\n\n\n if(reading <=3.5){\n\n crs_calculate_object.spouse_ielts.reading = 0;\n }\n else if(reading >=4 && reading<= 5.5){\n crs_calculate_object.spouse_ielts.reading = 1;\n }\n else if(reading >=6 && reading <= 6.5){\n crs_calculate_object.spouse_ielts.reading = 3;\n }\n else if(reading >=7){\n crs_calculate_object.spouse_ielts.reading = 5;\n }\n\n console.log('spouse reading : '+crs_calculate_object.spouse_ielts.reading);\n score_board();\n\n }", "title": "" }, { "docid": "ebb7d97d245eae1ef098da92b907b341", "score": "0.6182749", "text": "function sliderUpdation(event){\n\t\tvar value = parseInt(event.currentTarget.textContent);\n\t\tvar width = parseInt(document.getElementById(barSelected).style.width.split('%')[0]);\n\t\tif(total === 0){\n\t\t\ttotal = width;\n\t\t}\n\t\ttotal = total + value;\n\t\tif(total>100){\n\t\t\tdocument.getElementById(barSelected).style.backgroundColor = \"#FF5722\";\n\t\t\tdocument.getElementById(barSelected).style.width = '100%';\n\t\t\tif(data.limit>=total){\n\t\t\t\tdocument.getElementById(barSelected).previousElementSibling.innerHTML = total+'%';\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(barSelected).previousElementSibling.innerHTML = data.limit+'%';\n\t\t\t\ttotal = data.limit;\n\t\t\t}\n\n\t\t}else{\n\t\t\tdocument.getElementById(barSelected).style.backgroundColor = \"rgba(0, 150, 136, 0.33)\";\n\t\t\tif(total<=0){\n\t\t\t\ttotal = 0;\n\t\t\t\tdocument.getElementById(barSelected).style.width = total+'%';\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(barSelected).style.width = total+'%';\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById(barSelected).previousElementSibling.innerHTML = total+'%';\n\t\t \n\t\t}\n\t}", "title": "" }, { "docid": "f6b73cd3c7ee57d2ba41bf9bbfcefec4", "score": "0.6177052", "text": "function mySliderClickHandler(e, percent)\r\n{\r\n let x = e;\r\n let d = percent;\r\n}", "title": "" }, { "docid": "1fba083f5984a5ab018be93f9eda1727", "score": "0.6175607", "text": "function getVelocity()\n {\n var x_position = slider_button.x - slider_box.x; //Determine x position of slider button within box\n var percentage = x_position / (slider_box.width - slider_button.width); //Determine percentage of gunpowder bar filled\n return percentage * MAX_VELOCITY; //Determine velocity\n }", "title": "" }, { "docid": "70cdeb5a2d9861f2a5a3495a025b97a8", "score": "0.6170592", "text": "sliderValuesChange(values) {\n \n // if we slide the left slider, it should keep the waveform in place on the left\n if (values[0] != this.state.sliderOne) {\n\n const x = Math.ceil(this.state.widthPerSecond*values[0])\n\n Animated.parallel([\n Animated.timing(\n this.state.translateX,\n {\n toValue: x,\n duration : 0,\n }\n ),\n Animated.timing(\n this.state.width,\n {\n toValue: Math.ceil(this.state.widthPerSecond*(values[1]-values[0])),\n duration : 0,\n }\n )\n ]).start()\n }\n else {\n Animated.timing(\n this.state.width,\n {\n toValue: Math.ceil(this.state.widthPerSecond*(values[1]-values[0])),\n duration : 0,\n }\n ).start()\n }\n }", "title": "" }, { "docid": "b869aaaf9917245d85baffa414857f7e", "score": "0.6143355", "text": "onValueChanged() {\n if (this._valueChanged) {\n this._valueChanged.raise();\n }\n }", "title": "" }, { "docid": "1125e6a77cdd4795d48671782556f29c", "score": "0.6132262", "text": "function getSliderValue() {\n return SLIDER_TYPE == 'percentile' ? SLIDER_PERCENTILE : SLIDER_BINDING_SCORE;\n}", "title": "" }, { "docid": "cc3420a712b0c071b401d9d52416f79a", "score": "0.61300176", "text": "increase() {\n this.changeValue( parseFloat(this.value) + this.incr );\n }", "title": "" }, { "docid": "b4facbada996b7162a36cb8e84ca2d29", "score": "0.6128698", "text": "function currentvalue(){\n var value=document.getElementById('rangeValue').innerHTML;\n var Current=Math.round(12/value*100)/100;\n document.getElementById(\"current\").innerHTML =Current;\n }", "title": "" }, { "docid": "9a932f0a04104919c88da3fb15131284", "score": "0.61166817", "text": "function slider_update(e) {\r\n\t\r\n\t\tvar values=get_slider_values();\r\n\t\t\r\n\t\t//\r\n\t\t// Calculate Difference\r\n\t\tvar diff=Math.floor((150-(values.work+values.company+values.now))/2);\r\n\t\tif(debug) trace('slider adjustment: '+diff);\r\n\t\t\r\n\t\t//\r\n\t\t// Adjust Sliders\r\n\t\tswitch($(e.target).parents('.group').find('span:first').text()) {\r\n\t\t\r\n\t\t\tcase 'work':\r\n\t\t\t\t$('header.top .logo .group:eq(1) .slider').slider('value',(values.company+diff));\r\n\t\t\t\t$('header.top .logo .group:eq(2) .slider').slider('value',(values.now+diff));\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'company':\r\n\t\t\t\t$('header.top .logo .group:eq(0) .slider').slider('value',(values.work+diff));\r\n\t\t\t\t$('header.top .logo .group:eq(2) .slider').slider('value',(values.now+diff));\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'now':\r\n\t\t\t\t$('header.top .logo .group:eq(0) .slider').slider('value',(values.work+diff));\r\n\t\t\t\t$('header.top .logo .group:eq(1) .slider').slider('value',(values.company+diff));\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "title": "" }, { "docid": "388fb5692f2c621b38b652783964e839", "score": "0.6096016", "text": "function slideVal(){\n\n // get slider value to display as password \"length\"\n complexity = document.getElementById(\"slider\").value;\n document.getElementById(\"length\").innerHTML = \"Length: \" + complexity;\n\n}", "title": "" }, { "docid": "c53dd3a6b150162c052f0afdd346dc81", "score": "0.60927016", "text": "function onSliderChange(event, ui) {\n const start = ui.values[0] / sliderMax;\n const end = ui.values[1] / sliderMax;\n ajaxGetQuakes(start, end);\n }", "title": "" }, { "docid": "d39f7d650a4ae08e84ad6da603b01df2", "score": "0.6083391", "text": "handleSlider(e, name, isDecimal) {\n // If the slider should be from 0.0-1.0, divide the value by 100\n if (isDecimal) {\n e /= 100;\n }\n this.options[\"target_\" + name] = e;\n this.setState({ [name]: e });\n }", "title": "" }, { "docid": "0a1725a49b7f724c98b70e313d04494b", "score": "0.6077295", "text": "function changeSpeed(){\n movmentSpeed = document.getElementById('speedSlider').value;\n document.getElementById('speedText').innerHTML = \" Speed = \" + movmentSpeed;\n}", "title": "" }, { "docid": "7f60e92709868d5892ffe2babe0f6866", "score": "0.6068618", "text": "function onSliderUpDownCamera(slider){\r\n\tchanged=true;//Marco que hubo un cambio, lo cual habilita el reset\r\n\tangle[3] = parseFloat(slider.value);\r\n\tupdateTextInput(3,slider.value);//Actualizo el valor del campo de texto asociado al slider\r\n}", "title": "" }, { "docid": "7e21e5942d567e749d3c86e61fce9800", "score": "0.60525167", "text": "function inputMinSliderLeft() {\n //slider update inputs\n inputMin.value = sliderLeft.value;\n}", "title": "" }, { "docid": "f6e6d9d3f4a94a0dee104a8d38a76609", "score": "0.6051307", "text": "changeNumTo(value, speed) {\n\n\t\tif(value > this.currentValue ){\n\n\n\t\t\tif(value >= this.maxValue) {\n\t \n\t this.currentValue = this.maxValue; \n\n\t if (PiecSettings.winCounterCommaSeparation != null && PiecSettings.winCounterCommaSeparation)\n\t\t\t\t\tthis.textField.text = \"\" + Util.numberWithCommas(this.currentValue);\n\t\t\t\telse \n\t\t\t\t\tthis.textField.text = \"\" + this.currentValue;\t// to be animate\n\t\t\t\t\n\t return; \n\t \n\t }\n\t\t\t\n\t\t\tif (this.currentValue < value) {\n\t\t\t\tthis.currentValue += speed;\n\t\n\t\t\t\tif (this.currentValue > value)\n\t\t\t\t\tthis.currentValue = value;\n\t\n\t\t\t\tthis.game.time.events.add(10, function() {\n\t\n\t\t\t\t\tif (PiecSettings.winCounterCommaSeparation != null && PiecSettings.winCounterCommaSeparation)\n\t\t\t\t\t\tthis.textField.text = \"\" + Util.numberWithCommas(this.currentValue);\n\t\t\t\t\telse \n\t\t\t\t\t\tthis.textField.text = \"\" + this.currentValue;\t// to be animate\n\t\t\t\t\t\n\t\t\t\t\tif (this.currentValue < value) {\n\t\t\t\t\t\tthis.changeNumTo(value, speed);\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\t\t\t}\n\n\t\t}else {\n\n\t\t\tif(value < this.minValue) {\n\t\t\t\t\n\t this.currentValue = this.minValue; \n\t if (PiecSettings.winCounterCommaSeparation != null && PiecSettings.winCounterCommaSeparation)\n\t\t\t\t\tthis.textField.text = \"\" + Util.numberWithCommas(this.currentValue);\n\t\t\t\telse \n\t\t\t\t\tthis.textField.text = \"\" + this.currentValue;\t// to be animate\n\t\t\t\t\n\t return; \n\t \n\t }\n\n\t\t\tif (this.currentValue > value) {\n\t\t\t\tthis.currentValue -= speed;\n\t\n\t\t\t\tif (this.currentValue < value)\n\t\t\t\t\tthis.currentValue = value;\n\t\n\t\t\t\tthis.game.time.events.add(10, function() {\n\t\n\t\t\t\t\tif (PiecSettings.winCounterCommaSeparation != null && PiecSettings.winCounterCommaSeparation)\n\t\t\t\t\t\tthis.textField.text = \"\" + Util.numberWithCommas(this.currentValue);\n\t\t\t\t\telse \n\t\t\t\t\t\tthis.textField.text = \"\" + this.currentValue;\t// to be animate\n\t\t\t\t\t\n\t\t\t\t\tif (this.currentValue < value) {\n\t\t\t\t\t\tthis.changeNumTo(value, speed);\n\t\t\t\t\t}\n\t\t\t\t}, this);\n\t\t\t}\n\n\t\t}\n\t}", "title": "" }, { "docid": "fe670c9df861e9c33eda0fc5b054ab7b", "score": "0.6049438", "text": "onPressInIncreaseButton() {\n this.timer = setInterval(\n () => {\n if (!this.hasReachedMaxValue(this.state.value)) {\n this.increase(this.props.stepValue);\n }\n }, 50);\n }", "title": "" }, { "docid": "e4f4d003eab59b3dcd37109760e6b1bc", "score": "0.60459876", "text": "function OnLengthSliderChange ()\r\n {\r\n var dLengthPercent = document.getElementById ('lengthSlider').value;\r\n _dLength = _dMaxLength * dLengthPercent * 0.01;\r\n\r\n document.getElementById ('lengthTextBox').value = dLengthPercent;\r\n\r\n drawScreen ();\r\n }", "title": "" }, { "docid": "d816f3e2dbad233c51118235a0517e04", "score": "0.6044679", "text": "function on_input() {\n // If the node has the range property set, we'll return values in that range\n let flo_min = flo_min_value['Float'] || 0.0;\n let flo_max = flo_max_value['Float'] || 100.0;\n\n // We get a number 0-1000, change to fit in the range\n let value = (input_element.value/1000.0)*(flo_max-flo_min) + flo_min;\n\n // This is the editing event: if the node has an edit_value handler, this is where we send it\n let input_handler = element.flo_edit_value || (() => {});\n\n // Pass on the event (sliders generate float values)\n input_handler({ 'Float': value });\n }", "title": "" }, { "docid": "8a1891900abd058b24f498cd469e9a45", "score": "0.6042856", "text": "function update(slider, val) {\n //changed. Now, directly take value from ui.value. if not set (initial, will use current value.)\n var $amount = slider == 1 ? val : $(\"#amount\").val();\n\n /* commented\n $amount = $( \"#slider\" ).slider( \"value\" );\n $duration = $( \"#slider2\" ).slider( \"value\" );\n */\n\n $(\"#amount\").val($amount);\n $(\"#amount-label\").text($amount);\n\n $('#slider a').html('<label>' + $amount + '</label><div class=\"ui-slider-label-inner\"></div>');\n }", "title": "" }, { "docid": "4f6404292619326c8833c476ba42fa83", "score": "0.6041982", "text": "function sliderTimeUpdate () {\r\n var newTime = vid.currentTime * (100/vid.duration);\r\n slider.value = newTime;\r\n}", "title": "" }, { "docid": "e8f7da7e21c0614ffb1efbebc188d9c9", "score": "0.6036496", "text": "function tef_listening_change() {\n\n var listening = $('.tef_listening_range').val();\n $('.tef_listening_value').text(listening);\n if (listening < 181){\n\n crs_calculate_object.tef_value.listening = 0;\n }\n else if (listening >=180 && listening <=248){\n\n crs_calculate_object.tef_value.listening = 1;\n\n }\n else if (listening >=249 && listening <=297){\n\n crs_calculate_object.tef_value.listening = 3;\n\n }\n else if (listening >=298 && listening <=415){\n\n crs_calculate_object.tef_value.listening = 6;\n\n }\n console.log('tef lis : '+crs_calculate_object.tef_value.listening);\n\n score_board();\n\n\n }", "title": "" }, { "docid": "e7ca5b9f62eb25f64a3e351561ab1e44", "score": "0.602932", "text": "function calculate(e, newValue) {\n //slider\n if ($(e.target).attr('class') == \"slider\") {\n var thisInput = e.target.parentNode.getElementsByClassName(\"sliderInput\")[0];\n thisInput.value = newValue;\n }\n //number input for slider (unit sales or labor section)\n else if ($(e.target).attr('class') == \"sliderInput focus-visible\") {\n var thisSlider = e.target.parentNode.getElementsByClassName(\"slider\")[0];\n thisSlider.value = newValue;\n }\n //number input for systems section\n else if ($(e.target).attr('class') == \"numInput focus-visible\") {\n $(e.target.parentNode.getElementsByClassName(\"default\")[0]).attr(\"value\", newValue);\n }\n //reset all variables on every calculation\n setVars();\n updateMinMax();\n }", "title": "" }, { "docid": "78613d9727209720d2378d74c3d22eaf", "score": "0.6025319", "text": "function UpdateSpecialValue(gameScene, value) {\n if (gameScene.special + value > 100) {\n gameScene.special = 100;\n } else if (gameScene.special + value < 0) {\n gameScene.special = 0;\n } else {\n gameScene.special += value;\n }\n console.log(`updating special display`);\n let specialBarFill = gameScene.Bars.specialBar;\n specialBarFill.displayWidth = (gameScene.special / 100 * 700);\n}", "title": "" }, { "docid": "e96273126119f764604cccbeacd81222", "score": "0.60251296", "text": "function setValues(stepIncrease) {\n return function (event, ui) {\n var slider = $(\"#\" + this.id);\n var currentValues = slider.slider(\"values\");\n var step = slider.slider(\"option\")[\"step\"];\n // 2 - can be changed\n if (!(Math.abs(ui.values[0] - currentValues[0]) == stepIncrease * step || Math.abs(ui.values[1] - currentValues[1]) == stepIncrease * step)) {\n return false;\n };\n slider.slider(\"values\", ui.values);\n var currentValues = slider.slider(\"values\");\n $(\"#\" + this.id + \"-values\").html(currentValues[0] + ' to ' + currentValues[1]);\n };\n}", "title": "" }, { "docid": "10659c0cfded5313c82499b29145d188", "score": "0.60236233", "text": "toggleSliderPosition() {\n if (this.value === undefined) this.value = 0;\n this.addSliderStepClass();\n }", "title": "" }, { "docid": "a8d2c97c8c8500b8661c7c66e5ae3a9a", "score": "0.602152", "text": "function sliderMoved(sliderValue) {\n\n console.log(sliderValue);\n\n var newData = updateData(sliderValue);\n console.log(newData);\n\n drawPoints(newData);\n}", "title": "" }, { "docid": "33feb5364c9614b70556fb9f519f59cc", "score": "0.60143024", "text": "function updateTotal (){\n total += $(this).data(\"data-value\");\n $(\"#total\").html(\"Total: \" + total);\n if (total >= target) {\n winLose();\n }\n }", "title": "" }, { "docid": "ae0c288248705586c326e79a511046de", "score": "0.60121286", "text": "function set_value(new_property_value) {\n // Get the values that we're using\n let flo_min = flo_min_value['Float'] || 0.0;\n let flo_max = flo_max_value['Float'] || 100.0;\n let value = new_property_value['Float'] || 0.0;\n\n // Change the value to be 0-1000\n value = ((value-flo_min)/(flo_max-flo_min))*1000.0;\n\n // Update the control\n input_element.value = value;\n }", "title": "" }, { "docid": "0d0dc3f73f871e7ec2a1f1c835c38a25", "score": "0.60120714", "text": "_cyclingSpeedControlButtonOnClick(ui, sliderID) {\n var sliderMin = $(\"#\" + sliderID).slider(\"option\", \"min\");\n var sliderMax = $(\"#\" + sliderID).slider(\"option\", \"max\");\n var invertedValue = (sliderMax - ui.value) + sliderMin;/*Change speed to duration*/\n \n /*console.log(\"InvertedValue: \" + invertedValue);*/\n console.log(\"Slider Speed: \" + ui.value);\n let sphereRad = invertedValue;\n this.config.edge.timeInterval = invertedValue;\n this.config.autoPlay.timeIntervalBetweenCycle = invertedValue;\n }", "title": "" }, { "docid": "6be6761b1758906440510a03dd7ce22b", "score": "0.5992067", "text": "function UpdateVolume() {\n setVolume((slider.value - 1));\n}", "title": "" }, { "docid": "56bc301ee127181285289f73de688fff", "score": "0.5991707", "text": "function distanceSlider(){\n\n var $valueSpan = $('.valueSpan');\n var $value = $('#distance');\n\n $valueSpan.html($value.val());\n\n $value.on('input change', function() {\n \n $valueSpan.html($value.val());\n });\n}", "title": "" }, { "docid": "cfe4592f84716a68ed0578c1e75306a5", "score": "0.59813493", "text": "function gameSpeed() {\r\n return expDecrement(parseFloat(document.getElementById(\"gameSpeedSlider\").value),minGameSpeed,maxGameSpeed);\r\n}", "title": "" }, { "docid": "8f809c613f89a7dcbae6f51a1cc7ee66", "score": "0.5981161", "text": "function setNewValue(num,value){\r\n\t//Si no es la cadena nula\r\n\tif(value!=\"\"){\r\n\t\t//Convierto a float\r\n\t\tvalue=parseFloat(value);\r\n\t\t//Si no es un numero....\r\n\t\tif(Number.isNaN(value))\r\n\t\t\tvalue=0;\r\n\t\tif(num==1){\r\n\t\t\tslider1.value=value;\r\n\t\t\tonSliderLuz(slider1);\r\n\t\t}\r\n\t\tif(num==2){\r\n\t\t\tslider2.value=value;\r\n\t\t\tonSliderZoomCamera(slider2);\r\n\t\t}\r\n\t\tif(num==3){\r\n\t\t\tslider3.value=value;\r\n\t\t\tonSliderUpDownCamera(slider3);\r\n\t\t}\r\n\t\tif(num==4){\r\n\t\t\tslider4.value=value;\r\n\t\t\tonSliderRotationCamera(slider4);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "daafae9eac8abae1dd100ccf740a3a9d", "score": "0.5980806", "text": "function change_fan_speed(ss) {\r\n var a = parseInt($('#selected-fan-speed').val()) + ss;\r\n if (a < 0) a = 0;\r\n else if (a > 100) a = 100;\r\n $('#selected-fan-speed').val(a);\r\n}", "title": "" }, { "docid": "bb2065453c9f9d413ef43396693c1caa", "score": "0.59789085", "text": "function moveSliderHelper(){\n\tif (slider.value == Number(slider.getAttribute('max'))){\n\t\tnextSong();\n\t} else {\n\tslider.value++;\n\tupdateSlider();\n\t}\n}", "title": "" }, { "docid": "0e7b60d15ee8c8b768d93b4e90a2f837", "score": "0.59751236", "text": "callbackValueChange(address, value) {\n this.setDSPValueCallback(address, String(value));\n this.faustInterfaceView.slider.value = String((value - parseFloat(this.itemParam.min)) / parseFloat(this.itemParam.step));\n this.faustInterfaceView.output.textContent = String(value.toFixed(parseFloat(this.precision)));\n }", "title": "" }, { "docid": "ad9c7150ed473c3fb1e89994fccc6a32", "score": "0.5973452", "text": "function setRating(){\n\t\t\n\t\tnewValue = SS('sliderBar').value;\n\t\tconsole.log(newValue);\n\t \t\n\t \tvar makeDiv = document.getElementById(\"sliderVal\");\n \t\t makeDiv.innerHTML = newValue;\n\t}", "title": "" }, { "docid": "ed6cadb8d541ac8c5728d111eb6b8c8c", "score": "0.5966577", "text": "function updateNum() {\n nLectura.textContent = Number(nSlider.value);\n n = nSlider.value;\n}", "title": "" }, { "docid": "8295712897434cea58b2acf797a222b2", "score": "0.59523565", "text": "function calculatePoints(){\n switch (true) {\n case (time<15):\n points+=1\n break;\n case (time<30):\n points+=2\n break;\n case (time<45):\n points+=3\n break;\n\n }\n updateProgress('pnts', `Points: ${points}`)\n}", "title": "" }, { "docid": "a5b157cb9d65dede1e8693e5ccfed6f4", "score": "0.5951924", "text": "function valueToPixels(val, updateInputValue) { \r\n var clearVal = false,\r\n value;\r\n \r\n // Allow empty values for non-polyfill sliders\r\n if((typeof val === \"undefined\" || isNaN(val) || val === \"\") && tagName == \"input\" && !forceValue) { \r\n value = defaultVal;\r\n clearVal = true;\r\n userSet = false; \r\n } else { \r\n value = checkValue(val); \r\n };\r\n \r\n handle.style[vertical ? \"top\" : \"left\"] = (scale ? percentToPixels(valueToPercent(value)) : vertical ? Math.round(((max - value) / step) * stepPx) : Math.round(((value - min) / step) * stepPx)) + \"px\"; \r\n redrawRange(); \r\n if(!(typeof updateInputValue === false)) {\r\n setInputValue(clearVal ? \"\" : value);\r\n }; \r\n }", "title": "" }, { "docid": "1daa1a363659cf1e62b6aaf79ae52122", "score": "0.5942647", "text": "function update(slider,val) {\n //changed. Now, directly take value from ui.value. if not set (initial, will use current value.)\n var $amount = slider == 1?val:$(\"#amount\").val();\n var $duration = slider == 2?val:$(\"#duration\").val();\n\n /* commented\n $amount = $( \"#slider\" ).slider( \"value\" );\n $duration = $( \"#slider2\" ).slider( \"value\" );\n */\n\n $total =($amount * 0.05);\n $totals =($amount * 0.03);\n $earnings=$amount-$totals-$total;\n $( \"#amount\" ).val($amount);\n $( \"#amount-label\" ).text($amount);\n $( \"#duration\" ).val($duration);\n $( \"#duration-label\" ).text($duration);\n $( \"#total\" ).val($total);\n $( \"#total-label\" ).text($total);\n $('#slider').html('<a><label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$amount+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label></a>');\n $('#slider2').html('<label><span class=\"glyphicon glyphicon-chevron-left\"></span> '+$duration+' <span class=\"glyphicon glyphicon-chevron-right\"></span></label>');\n }", "title": "" }, { "docid": "532726830b20dff635a498275bfdc057", "score": "0.59397864", "text": "function changeMass() {\r\n if(canChange) {\r\n particle_mass = parseFloat(massSlider.value);\r\n document.getElementById(\"particleMass\").innerHTML = \"Particle Mass: \" + particle_mass\t+ \"e-31 kg\";\r\n }\r\n}", "title": "" }, { "docid": "be0533e07ce36b0bb5ce645a6030ac3b", "score": "0.5927974", "text": "function update3()\n {\n // Try to change slider 1 until it is out of bound\n s1.value = bound(Number(s2.value) - Number(s3.value), 0, 100).toString();\n // Change slider 2 in case slider 1 is not changed enough (bounding is not necessary here)\n s2.value = bound(Number(s1.value) + Number(s3.value), 0, 100).toString();\n }", "title": "" }, { "docid": "5acdb1ada7b48ebe9416b969e86aa60e", "score": "0.59271437", "text": "function speedChanged( event, ui ) {\n\tcl(\"speedChanged\");\n\tsetSpeedTo(parseInt(ui.item.value));\n}", "title": "" }, { "docid": "a680dc171a125c1c5e2344d0a884022c", "score": "0.5926655", "text": "handleChange(value) { // value is either 1 or -1\n // returns a function! \n return () => {\n //jquery specific to update the slider value\n $(\"#slider\").slider('value', this.state.sliderValue + value)\n this.setState({sliderValue: this.state.sliderValue + value}) \n }\n }", "title": "" }, { "docid": "6f744b939143df5708e44026c4e34eaf", "score": "0.59248054", "text": "function calculateNewValue(oldValue, keyCode1, keyCode2) {\n var newValue = parseInt(oldValue, 10) -\n (keysPressed[keyCode1] ? distancePerIteration : 0) +\n (keysPressed[keyCode2] ? distancePerIteration : 0);\n return newValue < 0 ? 0 : newValue > maxValue ? maxValue : newValue;\n }", "title": "" }, { "docid": "c875a858177ee3436db5260eea730256", "score": "0.5918609", "text": "function sliderLimits(){\n switch (g.isotype){\n case 'isothermal':\n slider_label.innerHTML = \"specific volume (L/mol)\";\n switch (g.transition){\n case 'sublimation':\n slider.setAttribute(\"max\", \"34\");\n slider.setAttribute(\"min\", \"-2\");\n slider.value = \"-2\";\n g.slider = slider.value;\n break;\n case 'melting':\n slider.setAttribute(\"max\", \"2.25\");\n slider.setAttribute(\"min\", \"-1.5\");\n slider.value = \"1.5\";\n g.slider = slider.value;\n break;\n case 'vaporization':\n slider.setAttribute(\"max\", \"11.2\");\n slider.setAttribute(\"min\", \"1\");\n slider.value = \"1\";\n g.slider = slider.value;\n break;\n case 'triple-point':\n slider.setAttribute(\"max\", \"14.2\");\n slider.setAttribute(\"min\", \"2\");\n slider.value = \"2\";\n g.slider = slider.value;\n break;\n }\n break;\n case 'isobaric':\n slider_label.innerHTML = \"heat (kJ)\";\n switch (g.transition){\n case 'sublimation':\n slider.setAttribute(\"min\", \"0\");\n slider.setAttribute(\"max\", \"56\");\n slider.value = \"0\";\n g.slider = slider.value;\n slider_value.innerHTML = `${g.slider}`;\n break;\n case 'melting':\n slider.setAttribute(\"min\", \"0\");\n slider.setAttribute(\"max\", \"14\");\n slider.value = \"0\";\n g.slider = slider.value;\n slider_value.innerHTML = `${g.slider}`;\n break;\n case 'vaporization':\n slider.setAttribute(\"min\", \"0\");\n slider.setAttribute(\"max\", \"50\");\n slider.value = \"0\";\n g.slider = slider.value;\n slider_value.innerHTML = `${g.slider}`;\n break;\n case 'triple-point':\n slider.setAttribute(\"min\", \"0\");\n slider.setAttribute(\"max\", \"56\");\n slider.value = \"0\";\n g.slider = slider.value;\n slider_value.innerHTML = `${g.slider}`;\n break;\n }\n break;\n }\n}", "title": "" }, { "docid": "a32c05a86796a347670f8dc4c453d314", "score": "0.59118414", "text": "applyValuetoFaust() {\n var rangeVal = parseFloat(this.accelerometerEditView.rangeVirtual.value);\n Utilitary.accHandler.axisSplitter(this.accSlid, rangeVal, rangeVal, rangeVal, Utilitary.accHandler.applyNewValueToModule);\n }", "title": "" }, { "docid": "b93a08dd391107d64f3630f7e99f1e3f", "score": "0.5902042", "text": "update() {\n return (e) => {\n this.setState({ threshold: e.target.value });\n };\n }", "title": "" }, { "docid": "af25a3dd1c1a06d96ad290d99a78395b", "score": "0.5901235", "text": "function spouse_ielts_writing_change() {\n\n var writing = $('.spouse_ielts_writing_range').val();\n $('.spouse_ielts_writing_value').text(writing);\n\n\n\n if(writing <=4.5){\n\n crs_calculate_object.spouse_ielts.writing = 0;\n }\n else if(writing >=5 && writing<= 5.5){\n crs_calculate_object.spouse_ielts.writing = 1;\n }\n else if(writing >=6 && writing <= 6.5){\n crs_calculate_object.spouse_ielts.writing = 3;\n }\n else if(writing >=7){\n crs_calculate_object.spouse_ielts.writing = 5;\n }\n\n console.log('spouse writing : '+crs_calculate_object.spouse_ielts.writing);\n\n }", "title": "" }, { "docid": "6dad12065cba318aadedab10a9224947", "score": "0.5897848", "text": "function increaseValue() {\n if (lodash.isNull(ctrl.currentValue) || ctrl.currentValue === '') {\n ctrl.currentValue = 0;\n } else {\n ctrl.currentValue = (Number(ctrl.currentValue) + Number(ctrl.valueStep)).toFixed(ctrl.precision);\n }\n\n if (angular.isDefined(ctrl.formObject)) {\n ctrl.formObject[ctrl.inputName].$setViewValue(ctrl.currentValue.toString());\n ctrl.formObject[ctrl.inputName].$render();\n }\n }", "title": "" }, { "docid": "eb5558d8682c3af68969c63ce5d8c035", "score": "0.58975554", "text": "handleSliderAfterChange(value) {\n const pStart = this.sliderTipFormatter(value[0]);\n const pEnd = this.sliderTipFormatter(value[1]);\n\n const detail = this.state.detail;\n detail.start = pStart;\n detail.end = pEnd;\n this.setState({ detail });\n\n const marks = getSliderMarks(this.start, this.end, pStart, pEnd);\n this.setState({ marks });\n\n this._updateDetail(detail);\n }", "title": "" }, { "docid": "488b06e4e9a16f3961cbee3f0d7677c2", "score": "0.58975434", "text": "function setNewValueSpot(value){\r\n\tdocument.getElementById(\"sliderColor1\").value=parseFloat(value);\r\n}", "title": "" }, { "docid": "ef66a327b9d2d558ffc03afef2afdad5", "score": "0.5893611", "text": "function resetValue() {\n\t\tvar remainder = scrollPane.width() - scrollContent.width();\n\t\tvar leftVal = scrollContent.css(\"margin-left\") === \"auto\" ? 0 :\n\t\t\t\tparseInt(scrollContent.css(\"margin-left\"));\n\t\tvar percentage = Math.round(leftVal / remainder * 100);\n\t\tscrollbar.slider(\"value\", percentage);\n\t}", "title": "" }, { "docid": "a875d667c7036fd29d353108eea25f58", "score": "0.5891969", "text": "function showShieldsValue(newValue)\n{\n\tdocument.getElementById(\"shieldsDisplayValue\").innerHTML=newValue;\n\tshieldsPercent=newValue;\n\t\tupdateValues();\n}", "title": "" }, { "docid": "32a3a1e8347e585b43f6f5346a1a58a9", "score": "0.58906114", "text": "function OnInitSpeedSliderChange ()\r\n {\r\n _dOmega = +document.getElementById ('initSpeedSlider').value;\r\n document.getElementById ('initSpeedTextBox').value = (_dOmega * 180 / Math.PI).toFixed (1);\r\n }", "title": "" }, { "docid": "d36d1cec8194bcb32190b0ad816de464", "score": "0.5888524", "text": "function onCircleSliderChange() {\r\n updateBrightnessValue(circleSlider.value());\r\n updateBrightnessIcon(circleSlider.value());\r\n }", "title": "" }, { "docid": "5dfaa574e0297010f6d2e0d2008188db", "score": "0.58855367", "text": "function setValue() {\n if (!lodash.isNil(ctrl.onChangeCallback)) {\n ctrl.onChangeCallback(ctrl.sliderConfig.value === ctrl.sliderConfig.options.ceil ? null : ctrl.sliderConfig.value * Math.pow(1024, ctrl.sliderConfig.pow), ctrl.updateSliderInput);\n }\n\n if (!lodash.isNil(ctrl.selectedData)) {\n ctrl.selectedData[ctrl.sliderConfig.options.id] = ctrl.sliderConfig.value === ctrl.sliderConfig.options.ceil ? 0 : ctrl.sliderConfig.value * Math.pow(1024, ctrl.sliderConfig.pow);\n }\n }", "title": "" }, { "docid": "78ffd1688b43b524448cb044de90c474", "score": "0.5881447", "text": "function updateSlider(position, value, element) {\n var $this = $(element).val(value).change();\n buildFace();\n}", "title": "" }, { "docid": "8a975350ed4bed083ea50b6a72a704a7", "score": "0.5878894", "text": "function resetValue() {\n var remainder = scrollPane.width() - scrollContent.width();\n var leftVal = scrollContent.css( \"margin-left\" ) === \"auto\" ? 0 :\n parseInt( scrollContent.css( \"margin-left\" ) );\n var percentage = Math.round( leftVal / remainder * 100 );\n scrollbar.slider( \"value\", percentage );\n }", "title": "" }, { "docid": "afb6cce74d7cee74a1fefacb92599507", "score": "0.5877764", "text": "setSensitivityValue(e) {\n\t\tlet value = e.target.value\n\t\tthis.props.setSensitivityMax(value)\n\t}", "title": "" }, { "docid": "28fd09550a383ebd6258ed3593cc54f5", "score": "0.5877125", "text": "function resetValue() {\n var remainder = scrollPane.width() - scrollContent.width();\n var leftVal = scrollContent.css(\"margin-left\") === \"auto\" ? 0 :\n parseInt(scrollContent.css(\"margin-left\"), 10);\n var percentage = Math.round(leftVal / remainder * 100);\n scrollbar.slider(\"value\", percentage);\n }", "title": "" }, { "docid": "e435762e6bec1086b04231039c05ee85", "score": "0.58763087", "text": "function sliderChanged() {\n let volume = document.getElementById(\"volume-slider\").value;\n updateVolume(volume);\n}", "title": "" }, { "docid": "226458931cfc6414abe848130d2b510e", "score": "0.587286", "text": "updateFuel(amount) {\n this.fuel += amount;\n document.getElementById(\"fuel\").innerHTML = `Fuel Left: ${Math.max(Math.ceil((this.fuel / this.maxFuel) * 10000) / 100, 0)}%`;\n }", "title": "" }, { "docid": "08dc792fe3238e12ceae263e6dc959b9", "score": "0.5872672", "text": "updatevalue() {\n if (this.value == this.thresholdvalue) { //convert and compare - string \"2\" == 2\n if (!this.triggered) {\n this.triggered = true;\n this.trigger();\n } else {\n this.normalAction();\n }\n } else {\n if (this.triggered) {this.triggered = false;}\n this.normalAction();\n } \n }", "title": "" }, { "docid": "1465363897ad5dc0dbe518e0c1587b53", "score": "0.5871652", "text": "function changeDiameter()\n{\n if (diameter < 200)\n {\n diameter += 2;\n }\n else if (diameter >= 200)\n {\n diameter = 25;\n }\n\n}", "title": "" }, { "docid": "6f362742d663828c414c31ca3f491d59", "score": "0.58714074", "text": "valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.runAutoGrow();\n this.emitStyle();\n this.ionChange.emit({ value });\n }", "title": "" } ]
5cb618e63ff13d29aa7bd0384213e338
This does not return the file extension, instead it returns a media type extension
[ { "docid": "21ec47d3c738d4b7bd41bc44948785ff", "score": "0.0", "text": "function getAzureFileFormat(path) {\n if (/[(,]format=m3u8-/i.test(path)) {\n return 'm3u8';\n } else if (/[(,]format=mpd-/i.test(path)) {\n return 'mpd';\n }\n return false;\n}", "title": "" } ]
[ { "docid": "4fa035bd93769198c1ee45680093c345", "score": "0.77610654", "text": "extension() {\n return this.file instanceof Blob ? this.file.name.split('.').pop().toLowerCase() : this.file.extension;\n }", "title": "" }, { "docid": "6ba42be9f021d991604ecbcad08ad3ce", "score": "0.76606584", "text": "getExtension () {\n\t\treturn this.fileSpec === null\n\t\t\t? ''\n\t\t\t: this.fileSpec.slice(((this.fileSpec.lastIndexOf('.') - 1) >>> 0) + 2);\n\t}", "title": "" }, { "docid": "d501cccc897563ee940bd920013eb169", "score": "0.7580511", "text": "function getFileMime(url) {\n\tconst dotIdx = url.lastIndexOf('.') + 1;\n\tswitch(dotIdx && url.substr(dotIdx).toLowerCase()) {\n\tcase 'gif': return 'image/gif';\n\tcase 'jfif':\n\tcase 'jpeg':\n\tcase 'jpg': return 'image/jpeg';\n\tcase 'mov': return 'video/quicktime';\n\tcase 'mp4':\n\tcase 'm4v': return 'video/mp4';\n\tcase 'ogv': return 'video/ogv';\n\tcase 'png': return 'image/png';\n\tcase 'webm': return 'video/webm';\n\tcase 'webp': return 'image/webp';\n\tdefault: return '';\n\t}\n}", "title": "" }, { "docid": "87001ccb7bcfcbd3bb53a2aaec548515", "score": "0.7518361", "text": "file_extension(fnam) {\r\n let ss = fnam.split(\".\");\r\n let n = ss.length;\r\n if (n > 1) {\r\n return ss[n - 1].toLowerCase();\r\n } else {\r\n return \"\";\r\n }\r\n }", "title": "" }, { "docid": "f091b79d4b00dace0887714ede33134b", "score": "0.7493292", "text": "extension() {\r\n return getExtension(this.path);\r\n }", "title": "" }, { "docid": "e30edee49888b835ed646e0890d2de88", "score": "0.7446566", "text": "function getExt(file){\n return (-1!==file.indexOf('.'))?file.replace(/.*[.]/, ''):'';\n}", "title": "" }, { "docid": "95f88ea6f8191d43b151ab6ed44d2eab", "score": "0.7362127", "text": "function retrieveFileExtension(mimeType) {\n return (0, mime_types_1.extension)(mimeType) || 'xml';\n}", "title": "" }, { "docid": "e6f1eaf1dd16ccbf5c4ff18b3f978134", "score": "0.7252275", "text": "function fileExt(file) {\n \"use strict\";\n try {\n return file.split('.').pop().toLowerCase().trim();\n } catch(e) {\n return '';\n }\n}", "title": "" }, { "docid": "08f5f0c40287104b8324753ba9924f7a", "score": "0.72481036", "text": "function uMime_getMimeByExt(extensionStr) {\n var extToMimes = {\n 'mp4' : 'movie/mp4',\n\t\t'323' : 'text/h323',\n\t\t'*' : 'application/octet-stream',\n\t\t'acx' : 'application/internet-property-stream',\n\t\t'ai' : 'application/postscript',\n\t\t'aif' : 'audio/x-aiff',\n\t\t'aifc' : 'audio/x-aiff',\n\t\t'aiff' : 'audio/x-aiff',\n\t\t'asf' : 'video/x-ms-asf',\n\t\t'asr' : 'video/x-ms-asf',\n\t\t'asx' : 'video/x-ms-asf',\n\t\t'au' : 'audio/basic',\n\t\t'avi' : 'video/x-msvideo',\n\t\t'axs' : 'application/olescript',\n\t\t'bas' : 'text/plain',\n\t\t'bcpio' : 'application/x-bcpio',\n\t\t'bin' : 'application/octet-stream',\n\t\t'bmp' : 'image/bmp',\n\t\t'c' : 'text/plain',\n\t\t'cat' : 'application/vnd.ms-pkiseccat',\n\t\t'cdf' : 'application/x-cdf',\n\t\t'cdf' : 'application/x-netcdf',\n\t\t'cer' : 'application/x-x509-ca-cert',\n\t\t'class' : 'application/octet-stream',\n\t\t'clp' : 'application/x-msclip',\n\t\t'cmx' : 'image/x-cmx',\n\t\t'cod' : 'image/cis-cod',\n\t\t'cpio' : 'application/x-cpio',\n\t\t'crd' : 'application/x-mscardfile',\n\t\t'crl' : 'application/pkix-crl',\n\t\t'crt' : 'application/x-x509-ca-cert',\n\t\t'csh' : 'application/x-csh',\n\t\t'css' : 'text/css',\n\t\t'dcr' : 'application/x-director',\n\t\t'der' : 'application/x-x509-ca-cert',\n\t\t'dir' : 'application/x-director',\n\t\t'dll' : 'application/x-msdownload',\n\t\t'dms' : 'application/octet-stream',\n\t\t'doc' : 'application/msword',\n\t\t'dot' : 'application/msword',\n\t\t'dvi' : 'application/x-dvi',\n\t\t'dxr' : 'application/x-director',\n\t\t'eps' : 'application/postscript',\n\t\t'etx' : 'text/x-setext',\n\t\t'evy' : 'application/envoy',\n\t\t'exe' : 'application/octet-stream',\n\t\t'fif' : 'application/fractals',\n\t\t'flr' : 'x-world/x-vrml',\n\t\t'gif' : 'image/gif',\n\t\t'gtar' : 'application/x-gtar',\n\t\t'gz' : 'application/x-gzip',\n\t\t'h' : 'text/plain',\n\t\t'hdf' : 'application/x-hdf',\n\t\t'hlp' : 'application/winhlp',\n\t\t'hqx' : 'application/mac-binhex40',\n\t\t'hta' : 'application/hta',\n\t\t'htc' : 'text/x-component',\n\t\t'htm' : 'text/html',\n\t\t'html' : 'text/html',\n\t\t'htt' : 'text/webviewhtml',\n\t\t'ico' : 'image/x-icon',\n\t\t'ief' : 'image/ief',\n\t\t'iii' : 'application/x-iphone',\n\t\t'ins' : 'application/x-internet-signup',\n\t\t'isp' : 'application/x-internet-signup',\n\t\t'jfif' : 'image/pipeg',\n\t\t'jpe' : 'image/jpeg',\n\t\t'jpeg' : 'image/jpeg',\n\t\t'jpg' : 'image/jpeg',\n\t\t'js' : 'application/x-javascript',\n\t\t'latex' : 'application/x-latex',\n\t\t'lha' : 'application/octet-stream',\n\t\t'lsf' : 'video/x-la-asf',\n\t\t'lsx' : 'video/x-la-asf',\n\t\t'lzh' : 'application/octet-stream',\n\t\t'm13' : 'application/x-msmediaview',\n\t\t'm14' : 'application/x-msmediaview',\n\t\t'm3u' : 'audio/x-mpegurl',\n\t\t'man' : 'application/x-troff-man',\n\t\t'mdb' : 'application/x-msaccess',\n\t\t'me' : 'application/x-troff-me',\n\t\t'mht' : 'message/rfc822',\n\t\t'mhtml' : 'message/rfc822',\n\t\t'mid' : 'audio/mid',\n\t\t'mny' : 'application/x-msmoney',\n\t\t'mov' : 'video/quicktime',\n\t\t'movie' : 'video/x-sgi-movie',\n\t\t'mp2' : 'video/mpeg',\n\t\t'mp3' : 'audio/mpeg',\n\t\t'mpa' : 'video/mpeg',\n\t\t'mpe' : 'video/mpeg',\n\t\t'mpeg' : 'video/mpeg',\n\t\t'mpg' : 'video/mpeg',\n\t\t'mpp' : 'application/vnd.ms-project',\n\t\t'mpv2' : 'video/mpeg',\n\t\t'ms' : 'application/x-troff-ms',\n\t\t'msg' : 'application/vnd.ms-outlook',\n\t\t'mvb' : 'application/x-msmediaview',\n\t\t'nc' : 'application/x-netcdf',\n\t\t'nws' : 'message/rfc822',\n\t\t'oda' : 'application/oda',\n\t\t'p10' : 'application/pkcs10',\n\t\t'p12' : 'application/x-pkcs12',\n\t\t'p7b' : 'application/x-pkcs7-certificates',\n\t\t'p7c' : 'application/x-pkcs7-mime',\n\t\t'p7m' : 'application/x-pkcs7-mime',\n\t\t'p7r' : 'application/x-pkcs7-certreqresp',\n\t\t'p7s' : 'application/x-pkcs7-signature',\n\t\t'pbm' : 'image/x-portable-bitmap',\n\t\t'pdf' : 'application/pdf',\n\t\t'pfx' : 'application/x-pkcs12',\n\t\t'pgm' : 'image/x-portable-graymap',\n\t\t'pko' : 'application/ynd.ms-pkipko',\n\t\t'pma' : 'application/x-perfmon',\n\t\t'pmc' : 'application/x-perfmon',\n\t\t'pml' : 'application/x-perfmon',\n\t\t'pmr' : 'application/x-perfmon',\n\t\t'pmw' : 'application/x-perfmon',\n\t\t'pnm' : 'image/x-portable-anymap',\n\t\t'pot' : 'application/vnd.ms-powerpoint',\n\t\t'ppm' : 'image/x-portable-pixmap',\n\t\t'pps' : 'application/vnd.ms-powerpoint',\n\t\t'ppt' : 'application/vnd.ms-powerpoint',\n\t\t'prf' : 'application/pics-rules',\n\t\t'ps' : 'application/postscript',\n\t\t'pub' : 'application/x-mspublisher',\n\t\t'qt' : 'video/quicktime',\n\t\t'ra' : 'audio/x-pn-realaudio',\n\t\t'ram' : 'audio/x-pn-realaudio',\n\t\t'ras' : 'image/x-cmu-raster',\n\t\t'rgb' : 'image/x-rgb',\n\t\t'rmi' : 'audio/mid',\n\t\t'roff' : 'application/x-troff',\n\t\t'rtf' : 'application/rtf',\n\t\t'rtx' : 'text/richtext',\n\t\t'scd' : 'application/x-msschedule',\n\t\t'sct' : 'text/scriptlet',\n\t\t'setpay' : 'application/set-payment-initiation',\n\t\t'setreg' : 'application/set-registration-initiation',\n\t\t//'sh' : 'application/x-sh',\n\t\t'sh' : 'text/plain',\n\t\t'shar' : 'application/x-shar',\n\t\t'sit' : 'application/x-stuffit',\n\t\t'snd' : 'audio/basic',\n\t\t'spc' : 'application/x-pkcs7-certificates',\n\t\t'spl' : 'application/futuresplash',\n\t\t'src' : 'application/x-wais-source',\n\t\t'sst' : 'application/vnd.ms-pkicertstore',\n\t\t'stl' : 'application/vnd.ms-pkistl',\n\t\t'stm' : 'text/html',\n\t\t'sv4cpio' : 'application/x-sv4cpio',\n\t\t'sv4crc' : 'application/x-sv4crc',\n\t\t'svg' : 'image/svg+xml',\n\t\t'swf' : 'application/x-shockwave-flash',\n\t\t't' : 'application/x-troff',\n\t\t'tar' : 'application/x-tar',\n\t\t'tcl' : 'application/x-tcl',\n\t\t'tex' : 'application/x-tex',\n\t\t'texi' : 'application/x-texinfo',\n\t\t'texinfo' : 'application/x-texinfo',\n\t\t'tgz' : 'application/x-compressed',\n\t\t'tif' : 'image/tiff',\n\t\t'tiff' : 'image/tiff',\n\t\t'tr' : 'application/x-troff',\n\t\t'trm' : 'application/x-msterminal',\n\t\t'tsv' : 'text/tab-separated-values',\n\t\t'txt' : 'text/plain',\n\t\t'uls' : 'text/iuls',\n\t\t'ustar' : 'application/x-ustar',\n\t\t'vcf' : 'text/x-vcard',\n\t\t'vrml' : 'x-world/x-vrml',\n\t\t'wav' : 'audio/x-wav',\n\t\t'wcm' : 'application/vnd.ms-works',\n\t\t'wdb' : 'application/vnd.ms-works',\n\t\t'wks' : 'application/vnd.ms-works',\n\t\t'wmf' : 'application/x-msmetafile',\n\t\t'wps' : 'application/vnd.ms-works',\n\t\t'wri' : 'application/x-mswrite',\n\t\t'wrl' : 'x-world/x-vrml',\n\t\t'wrz' : 'x-world/x-vrml',\n\t\t'xaf' : 'x-world/x-vrml',\n\t\t'xbm' : 'image/x-xbitmap',\n\t\t'xla' : 'application/vnd.ms-excel',\n\t\t'xlc' : 'application/vnd.ms-excel',\n\t\t'xlm' : 'application/vnd.ms-excel',\n\t\t'xls' : 'application/vnd.ms-excel',\n\t\t'xlt' : 'application/vnd.ms-excel',\n\t\t'xlw' : 'application/vnd.ms-excel',\n\t\t'xof' : 'x-world/x-vrml',\n\t\t'xpm' : 'image/x-xpixmap',\n\t\t'xwd' : 'image/x-xwindowdump',\n\t\t'z' : 'application/x-compress',\n\t\t'zip' : 'application/zip',\n\t\t'shortcut' : 'text/plain'\n }\n\tconsole.log(\"uMime_getMimeByExt: extension = \" + extensionStr );\n\tvar ext = extensionStr.toLowerCase();\n\tif (extToMimes.hasOwnProperty(ext)) {\n\t\tconsole.log(\"mime type = \" + extToMimes[ext]);\n\t\treturn extToMimes[ext];\n\t}\n\tif(ufile_isSafari()){\n\t\treturn extToMimes['txt'];\n\t} else {\n\t\treturn extToMimes['*'];\n\t}\n\n}", "title": "" }, { "docid": "b5dffcf2295419ef98a4f59481e237ff", "score": "0.7232454", "text": "function getFileExtension(v) {\n return v.split('.').pop();\n //return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;\n}", "title": "" }, { "docid": "e4a5c714d0d8809eec8185be19cbd8b4", "score": "0.7158804", "text": "function getMimeType(ext) {\n for(i = 0; i < mimeTypes.length; i++) {\n if(ext === mimeTypes[i].ext) {\n return mimeTypes[i].typ;\n }\n }\n return config.defaultMimeType;\n}", "title": "" }, { "docid": "3ff003dc1c622a1bf1d5f6fab568ed0a", "score": "0.71556073", "text": "function getFileType(filename)\n{\n\treturn (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined;\n}", "title": "" }, { "docid": "f04d6f626a2346619b28cf65689b6f4e", "score": "0.7135245", "text": "function guessMimeType(filename) {\n for (const mimeType in gltfMimeTypes) {\n for (const extensionIndex in gltfMimeTypes[mimeType]) {\n const extension = gltfMimeTypes[mimeType][extensionIndex];\n if (filename.toLowerCase().endsWith('.' + extension)) {\n return mimeType;\n }\n }\n }\n return 'application/octet-stream';\n}", "title": "" }, { "docid": "7062dca933ee81f3f198a35be6e60178", "score": "0.70612097", "text": "function getExt(file) {\n\treturn (/[.]/.exec(file)) ? /[^.]+$/.exec(file.toLowerCase()) : '';\n}", "title": "" }, { "docid": "ffa1f14e985426045d09f342d07db94a", "score": "0.7036038", "text": "function fallback (magic, filePath) {\n if (!magic || !magic.mime) {\n // first 262 bytes told us nothing\n // detect using filename extension\n return mime.lookup(filePath) || 'application/octet-stream';\n }\n if (GENERIC_TYPES.indexOf(magic.mime) !== -1) {\n // first 262 bytes told us nothing useful\n // detect using filename extension\n return mime.lookup(filePath) || magic.mime;\n }\n // use the result from the first 262 bytes\n return magic.mime;\n}", "title": "" }, { "docid": "fc5292824a21e7fc167bcf4c951eaad0", "score": "0.7004836", "text": "function getExtension(file) {\n var ret;\n if (file) {\n var fileTypes = file.split('.');\n var len = fileTypes.length;\n if (0 === len) {\n return ret;\n }\n ret = fileTypes[len - 1];\n return ret;\n }\n }", "title": "" }, { "docid": "8ecec1a08ccd8fd3c1171cbf3a9f593e", "score": "0.6998826", "text": "function getExtension(filename) {\r\n var i = filename.lastIndexOf('.');\r\n return (i < 0) ? '' : filename.substr(i);\r\n }", "title": "" }, { "docid": "fd9e49e5cd2e7fb43ea3359a3a075afe", "score": "0.6996168", "text": "getContentType(fileext){\n \n // Default contentType need to be text/html to display the error404.html if we type wrong URL \n var contentType = 'text/html';\n\n switch (fileext) {\n case '.js':\n contentType = 'text/javascript';\n break;\n case '.css':\n contentType = 'text/css';\n break;\n case '.json':\n contentType = 'application/json';\n break;\n case '.png':\n contentType = 'image/png';\n break; \n case '.jpg':\n contentType = 'image/jpg';\n break;\n case '.ico':\n contentType = 'image/x-icon';\n break;\n }\n return contentType;\n }", "title": "" }, { "docid": "31bb33b4ff80343ca34b10bbb774e737", "score": "0.69877934", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n }", "title": "" }, { "docid": "31bb33b4ff80343ca34b10bbb774e737", "score": "0.69877934", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n }", "title": "" }, { "docid": "31bb33b4ff80343ca34b10bbb774e737", "score": "0.69877934", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n }", "title": "" }, { "docid": "31bb33b4ff80343ca34b10bbb774e737", "score": "0.69877934", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n }", "title": "" }, { "docid": "31bb33b4ff80343ca34b10bbb774e737", "score": "0.69877934", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(name.lastIndexOf('.')+1)];\n }", "title": "" }, { "docid": "2dd2b5d4aa5293fa5dac5f67afa1874b", "score": "0.6983458", "text": "get extname() {\n return typeof this.path === 'string' ? path$1.extname(this.path) : undefined\n }", "title": "" }, { "docid": "59453e5e3d6b63887edcafe87798cd9f", "score": "0.6925691", "text": "static getExtensionFromFilename (filename) {\n return /(?:\\.([^.]+))?$/.exec(filename)[1]\n }", "title": "" }, { "docid": "d1b928842abaf6d3a80807614329aaf1", "score": "0.6909596", "text": "function initAudioFileExt(){\n var contentType = {\n '.mp3': 'audio/mpeg',\n '.m4a': 'audio/mp4',\n '.ogg': 'audio/ogg',\n '.webm': 'audio/webma',\n '.wav': 'audio/wav'\n }\n\n for( var ext in contentType ){\n var type = contentType[ext];\n if ( audioControl.canPlayType(type+';').replace(/no/, '') ){\n fileExt = ext;\n fileType = type;\n break;\n }\n } // for\n\n return fileExt;\n // func. initAudioFileExt\n }", "title": "" }, { "docid": "d4be87ec9303f38c41375558d8a33d4f", "score": "0.68846244", "text": "function findExtention(fileName) {\n extensions = {'.css': 'text/css', '.js': 'text/javascript','.html': 'text/html', '.tiff': 'image/tiff', \n '.tif' : 'image/tiff', '.txt': 'text/plain', '.png' : 'image/png', '.jpeg' : 'image/jpeg', '.jpg': 'image/jpeg'};\n var ext = path.extname(fileName);\n return extensions[ext];\n \n}", "title": "" }, { "docid": "43d50ec492cecac452943dfab20154be", "score": "0.68761635", "text": "function getExtension(filename) {\n var ext = path.extname(filename || '').split('.');\n return ext[ext.length - 1];\n }", "title": "" }, { "docid": "eb857a824047281cd527cc7c4b4747a0", "score": "0.68719155", "text": "function getExt(filename) {\n\treturn path.extname(filename);\n}", "title": "" }, { "docid": "d579594a887f5deb099aec4d4d23f038", "score": "0.68492305", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(-3)];\n return ret;\n }", "title": "" }, { "docid": "d579594a887f5deb099aec4d4d23f038", "score": "0.68492305", "text": "function getMimetype(name) {\n return {\n 'jpg': 'image/jpeg',\n 'jpeg': 'image/jpeg',\n 'png': 'image/png',\n 'bmp': 'image/bmp',\n 'ogg': 'audio/ogg',\n 'wav': 'audio/wav',\n 'mp3': 'audio/mpeg'\n }[name.substr(-3)];\n return ret;\n }", "title": "" }, { "docid": "ffde96fab3fee9ee897196c16f5da2a2", "score": "0.6845908", "text": "function getFileType(text) \n{\n\tvar i = text.indexOf(\".\");\n\t\n\treturn (i !== -1 ? text.substr(i+1) : -1);\n}", "title": "" }, { "docid": "2769a54f2114b39f7111053099585f2a", "score": "0.6841168", "text": "function getFileExtension(filename){\n return (/[.]/.exec(filename)) ? (/[^.]+$/.exec(filename))[0] : undefined;\n}", "title": "" }, { "docid": "599e2ef60bbace9defaabb8e999bd106", "score": "0.6840837", "text": "function getFileExtension(fileName) {\n\treturn fileName.substring(fileName.lastIndexOf('.') + 1);\n}", "title": "" }, { "docid": "f55d30fcd5ea6077b1f8cc2e777ed508", "score": "0.6825719", "text": "function GetFileTypeByFilePath(FilePath) {\n var DEFAULT_MIME = 'application/octet-stream';\n var index = FilePath.lastIndexOf(\".\");\n var returnValue = '';\n\n var Known_File_Types = {\n \".css\": \"text/css\",\n \".crx\": \"application/x-chrome-extension\", //CHROME extension stuff...\n \".htm\": \"text/html\",\n \".html\": \"text/html\",\n \".ico\": \"image/vnd.microsoft.icon\",\n \".mp3\": \"audio/mpeg\",\n \".mp4\": \"video/mp4\",\n \".mp4v\": \"video/mp4\",\n \".mpeg\": \"video/mpeg\",\n \".mpg\": \"video/mpeg\",\n\n };\n\n\n returnValue = Known_File_Types[FilePath.substring(index).toLowerCase()];\n if (!returnValue) {\n return DEFAULT_MIME;\n }\n else {\n return returnValue;\n }\n\n}", "title": "" }, { "docid": "09cad182b481a26986bca5f82f100d19", "score": "0.68221045", "text": "function getExtension(filename){\n var parts = filename.split('.');\n return parts[parts.length - 1];\n}", "title": "" }, { "docid": "029e93efd5a6d239e1113ec5e6c75ed0", "score": "0.68009037", "text": "function getExtension2(s) {\r\n\t\tvar m = s.match(/[^.]+$/);\r\n\t\treturn m? m[0] : '';\r\n\t}", "title": "" }, { "docid": "b520b40b31063189a260fbbf4c0e0a63", "score": "0.6785692", "text": "get extname() {\n return typeof this.path === \"string\" ? path.extname(this.path) : void 0;\n }", "title": "" }, { "docid": "d97f2530ff37c1785243acde26e7602d", "score": "0.6784033", "text": "function getContentTypeByFile(fileName) {\n var rc = 'application/octet-stream';\n var fileNameLowerCase = fileName.toLowerCase();\n\n if (fileNameLowerCase.indexOf('.html') >= 0) rc = 'text/html';\n else if (fileNameLowerCase.indexOf('.css') >= 0) rc = 'text/css';\n else if (fileNameLowerCase.indexOf('.json') >= 0) rc = 'application/json';\n else if (fileNameLowerCase.indexOf('.js') >= 0) rc = 'application/x-javascript';\n else if (fileNameLowerCase.indexOf('.png') >= 0) rc = 'image/png';\n else if (fileNameLowerCase.indexOf('.jpg') >= 0) rc = 'image/jpg';\n\n return rc;\n}", "title": "" }, { "docid": "aebd1c02037c54821151ea3dd94d5311", "score": "0.67719364", "text": "get extname() {\n return typeof this.path === 'string' ? path$1.extname(this.path) : undefined\n }", "title": "" }, { "docid": "5c05360eda788bf60bc00ba3f9087cc4", "score": "0.6762739", "text": "function getFileExtension(filename){\n\treturn filename.slice(filename.lastIndexOf('.'), filename.length).replace(\".\",\"\");\n}", "title": "" }, { "docid": "72a8ce5c5bd30126c03bc53e93b2a424", "score": "0.67523193", "text": "function _get_extention(filename)\n\t\t{\n\t\t\treturn filename.split('.').pop();\n\t\t}", "title": "" }, { "docid": "ff4ca92b1e83f700dbe6ee5050721815", "score": "0.6749672", "text": "function getContentType(fileUrl){\n let fileExtension = fileUrl.substring(fileUrl.lastIndexOf('.'), fileUrl.length)\n switch (fileExtension){\n case '.html': return 'text/html' \n case '.css': return 'text/css'\n case '.js': return 'application/javascript'\n case '.json': return 'application/json'\n default: return 'text/plain'\n }\n}", "title": "" }, { "docid": "6e41b4d3b45b71f469a37302773cb652", "score": "0.6731856", "text": "function getContentTypeByFile(fileName) {\n\tvar rc = \"application/octet-stream\";\n\tvar fn = fileName.toLowerCase();\n\n\tif (fn.indexOf(\".html\") >= 0) rc = \"text/html\";\n\telse if (fn.indexOf(\".css\") >= 0) rc = \"text/css\";\n\telse if (fn.indexOf(\".json\") >= 0) rc = \"application/json\";\n\telse if (fn.indexOf(\".js\") >= 0) rc = \"application/x-javascript\";\n\telse if (fn.indexOf(\".png\") >= 0) rc = \"image/png\";\n\telse if (fn.indexOf(\".jpg\") >= 0 || fn.indexOf(\".jpeg\") >= 0) rc = \"image/jpg\";\n\n\treturn rc;\n}", "title": "" }, { "docid": "32f742e2f9ebc0857a2ef1ed779ee68c", "score": "0.6731543", "text": "function guessMimeType(filename) {\n\tvar split = filename.split('.');\n\tvar extension = split[split.length - 1];\n\n\tif (extension == \"html\") {\n\t\treturn \"text/html\";\n\t} else if (extension == \"js\") {\n\t\treturn \"application/javascript\";\n\t} else if (extension == \"css\") {\n\t\treturn \"text/css\";\n\t} else if (extension == \"gif\") {\n\t\treturn \"image/gif\";\n\t} else if (extension == \"jpg\") {\n\t\treturn \"image/jpeg\";\n\t} else if (extension == \"png\") {\n\t\treturn \"image/png\";\n\t} else if (extension == \"ico\") {\n\t\treturn \"image/x-icon\";\n\t} else if (extension == \"mp3\") {\n\t\treturn \"audio/mpeg\";\n\t} else if (extension == \"mp4\") {\n\t\treturn \"video/mp4\";\n\t} else if (extension == \"wmv\") {\n\t\treturn \"video/x-ms-wmv\";\n\t} else {\n\t\twriteToServerLog(\"system | Warning: MIME type for \" + filename + \" could not be guessed.\");\n\t\treturn \"text/plain\";\n\t}\n}", "title": "" }, { "docid": "dfef213f928bf80ebae967458fa31a39", "score": "0.6702432", "text": "static getFileExtension(path) {\n return path.substring(path.lastIndexOf(\".\"), path.length);\n }", "title": "" }, { "docid": "69a1d6fc429f0ce49d443b808e914875", "score": "0.66996574", "text": "function getFileType(urlStr) {\n\tvar path_parts = urlStr.split(\".\");\n var len = path_parts.length;\n\treturn path_parts[len - 1];\n }", "title": "" }, { "docid": "4908197cb8884465ae6a0c3acb5f7b54", "score": "0.6694496", "text": "get extension () {\n\t\tif (this.name.indexOf('.') === -1 ) { return; }\n\t\treturn this.name.slice(this.name.lastIndexOf('.') + 1);\n\t}", "title": "" }, { "docid": "3e9cebc9c58bf118b40d85dffe56a4f6", "score": "0.6690324", "text": "function mimeType (filePath) {\n // detect MIME using only first 262 bytes of file\n return readChunk(filePath, 0, 262)\n .then((buffer) => fileType(buffer))\n // in case that failed, use the filename extension\n .then((magic) => fallback(magic, filePath));\n}", "title": "" }, { "docid": "1637b8f453a5d9f823897ee9ac927254", "score": "0.66697884", "text": "function getExtension(filename) {\n\t\tvar parts = filename.split('.');\n\t\treturn parts[parts.length - 1];\n\t}", "title": "" }, { "docid": "b5cbc0931bb684523a252fc2de085791", "score": "0.6656948", "text": "function fileExtension(fName){\n var dotpos = PositionsOfLetterInString(fName, '.');\n var lengthofname = fName.length;\n var extension = fName.substring(dotpos[0]+1, lengthofname);\n return extension\n}", "title": "" }, { "docid": "227664198356ce7c0b942dba57d07912", "score": "0.6653034", "text": "checkMimeTypeStr(filename) {\n const mimes = [\".mp4\", \".avi\", \".mkv\", \".webm\", \".flv\", \"ogg\", \".mov\", \".wmv\", \".rmvb\", \".ts\", \".m4v\", \".divx\",\n \".mpg\", \".3gp\"];\n for(let mimeIndex = 0; mimeIndex < mimes.length; mimeIndex++) {\n const strEnd = filename.lastIndexOf(mimes[mimeIndex]);\n if(strEnd > -1) {\n //Valid file type\n return mimes[mimeIndex];\n }\n }\n return false;\n }", "title": "" }, { "docid": "294fc09b4703af7170f9af79b6802504", "score": "0.6647807", "text": "function ext(){\n\tvar fileName = document.getElementById(\"file\").value;\n\tdocument.getElementById(\"extn\").innerHTML = fileName.split('.').pop();\n}", "title": "" }, { "docid": "df407877ab61f51941c90ee705f78c89", "score": "0.6645016", "text": "function getMineType(fileName) {\n var extension = re.exec(fileName)[1];\n var types = {\n 'png': 'application/image',\n 'jpg': 'application/image',\n 'txt': 'application/txt',\n 'ipt': 'application/vnd.autodesk.inventor.part',\n 'iam': 'application/vnd.autodesk.inventor.assembly',\n 'dwf': 'application/vnd.autodesk.autocad.dwf',\n 'dwg': 'application/vnd.autodesk.autocad.dwg',\n 'f3d': 'application/vnd.autodesk.fusion360',\n 'f2d': 'application/vnd.autodesk.fusiondoc',\n 'rvt': 'application/vnd.autodesk.revit'\n };\n return (types[extension] != null ? types[extension] : 'application/' + extension);\n}", "title": "" }, { "docid": "eec869a3b1508c0f37847abe05029063", "score": "0.6643289", "text": "function getExtension(sFilename){\r\n\tvar point = sFilename.split(\".\");\r\n\tif (point.length<2) return;\r\n\treturn point[point.length-1].toLowerCase();\r\n}", "title": "" }, { "docid": "5c12264045708786946280238f32d4b2", "score": "0.6642749", "text": "function getFileExtention(filename) {\n return filename.split('.').pop();\n}", "title": "" }, { "docid": "ec551fa53ebc4e3d0e80ee41458c22bd", "score": "0.6633841", "text": "static extension(url) {\n var name = this.name(url)\n if (!name.match(/\\./)) return undefined\n return name.toLowerCase().replace(/.*\\./,\"\") \n }", "title": "" }, { "docid": "9e39f5abd3c3a3b6186245ac8d98cea4", "score": "0.66336644", "text": "function getExtension(filename) {\n var parts = filename.split('.');\n return parts[parts.length - 1];\n}", "title": "" }, { "docid": "7ec9d2c1681ad7b84ccd2b287dae8772", "score": "0.66182905", "text": "function mime_type_simple(mime_type) {\n if ( typeof mime_type !== \"string\" ) return \"unknown\";\n mime_type = mime_type.split(\"/\");\n\n switch( mime_type[0]) {\n // media\n case \"audio\":\n case \"image\":\n case \"text\":\n case \"video\":\n return mime_type[0];\n\n // archive\n case \"multipart\": // .gzip, .ustar, .zip\n return \"archive\";\n\n // specifc apps\n case \"chemical\": // .pdb, .xyz\n case \"drawing\": // .dwf\n case \"i-world\": // .ivr\n case \"font\": // .otf, .ttf, .woff, .woff2\n case \"message\": // .mht, .mhtml, .mime\n case \"model\": // .dwf, .iges, .igs, .pov, .vrml, .wrl, .wrz\n case \"paleovu\": // .pvu\n case \"music\": // .kar, .mid, .midi\n case \"x-music\": // .mid, .midi\n case \"x-world\": // .3dm, .3dmf, .qd3, .qd3d, .svr, .vrml, .vrt, .wrl, .wrz\n case \"windows\": // .wmf\n case \"www\": // .mime\n return \"application\";\n\n // apps\n case \"application\":\n switch(mime_type[1]) {\n // archive\n case \"gnutar\": // .tgz\n case \"x-compress\": // .z\n case \"x-compressed\": // .z, .zip, .tgz\n case \"rar\": // .rar\n case \"x-7z-compressed\": // .7z\n case \"x-bzip2\": // .bz2\n case \"x-gzip\": // .gz, .gzip\n case \"x-tar\": // .tar\n case \"x-xz\": // .xz\n case \"x-zip-compressed\": // .zip\n case \"zip\": // .zip\n return \"archive\";\n\n // text or similar\n case \"hlp\": // .hlp\n case \"x-helpfile\": // .hlp\n case \"javascript\": // .js\n case \"ecmascript\": // .js\n case \"x-javascript\": // .js\n case \"json\": // .json\n case \"plain\": // .text\n case \"postscript\": // .ps\n case \"x-bsh\": // .sh, .shar\n case \"x-sh\": // .sh\n case \"x-shar\": // .sh, .shar\n case \"xml\": // .xml\n case \"x-bytecode.python\": // .pyc\n case \"x-csh\": // .csh\n return \"text\";\n\n // Adobe PDF\n case \"pdf\": // .pdf\n case \"x-pdf\": // .pdf\n case \"x-bzpdf\": // .pdf\n case \"x-gzpdf\": // .pdf\n return \"pdf\";\n\n // Microsoft files\n case \"msaccess.addin\": // .accda\n case \"msaccess.cab\": // .accdc\n case \"msaccess.runtime\": // .accdr\n case \"msaccess.webapplication\": // .accdw\n case \"msaccess.ftemplate\": // .accft\n case \"vnd.ms-access\": // .accda, .accdb, .accdc, .accde, .accdr, .accdt, .acdw, .accft\n return \"access\";\n\n case \"vnd.ms-excel\": // xls, xlt, xla\n case \"vnd.openxmlformats-officedocument.spreadsheetml.sheet\": // xlsx\n case \"vnd.openxmlformats-officedocument.spreadsheetml.template\": // xltx\n case \"vnd.ms-excel.sheet.macroEnabled.12\": // xlsm\n case \"vnd.ms-excel.template.macroEnabled.12\": // xltm\n case \"vnd.ms-excel.addin.macroEnabled.12\": // xlam\n case \"vnd.ms-excel.sheet.binary.macroEnabled.12\": // xlsb\n return \"excel\";\n\n case \"vns.ms-outlook\": // .msg\n case \"CDFV2-corrupt\": // .msg\n return \"outlook\";\n\n case \"vnd.ms-powerpoint\": // ppt, pot, pps, ppa\n case \"vnd.openxmlformats-officedocument.presentationml.presentation\": // pptx\n case \"vnd.openxmlformats-officedocument.presentationml.template\": // potx\n case \"vnd.openxmlformats-officedocument.presentationml.slideshow\": // ppsw\n case \"vnd.ms-powerpoint.addin.macroEnabled.12\": // ppam\n case \"vnd.ms-powerpoint.presentation.macroEnabled.12\": // pptm\n case \"vnd.ms-powerpoint.template.macroEnabled.12\": // potm\n case \"vnd.ms-powerpoint.slideshow.macroEnabled.12\": // ppsm\n return \"powerpoint\";\n\n case \"msword\": // doc, dot\n case \"vnd.openxmlformats-officedocument.wordprocessingml.document\": // docx\n case \"vnd.openxmlformats-officedocument.wordprocessingml.template\": // dotx\n case \"vnd.ms-word.document.macroEnabled.12\": // docm\n case \"vnd.ms-word.template.macroEnabled.12\": // dotm\n return \"word\";\n\n // video\n case \"ogg\": // .ogg\n return \"video\";\n\n // flash\n case \"x-shockwave-flash\": // .swf, .fla\n return \"flash\";\n\n default:\n return \"application\";\n }\n\n default:\n return mime_type[0];\n }\n}", "title": "" }, { "docid": "b221a4145f0e7a04af35ce56622d16ad", "score": "0.661051", "text": "function mimeType(path) {\n const ext = path.substr(path.lastIndexOf('.') + 1);\n const mimeTypes = {\n '/': 'text/html',\n htm: 'text/html',\n html: 'text/html',\n css: 'text/css',\n png: 'image/png',\n jpg: 'image/jpeg',\n svg: 'image/svg',\n ttf: 'font/ttf',\n woff: 'font/woff',\n woff2: 'font/woff',\n js: 'application/javascript',\n json: 'application/json'\n };\n return mimeTypes[ext] || 'application/octet-stream';\n}", "title": "" }, { "docid": "cd0be04bc247b50bd26d1101ba83e393", "score": "0.65994453", "text": "function getFileExtension(filename) {\n return filename.slice((filename.lastIndexOf(\".\") - 1 >>> 0) + 2);\n}", "title": "" }, { "docid": "8578b86769f7dfadd705eb2ad58c3aef", "score": "0.65809363", "text": "getExtension(type) {\n type = /^\\s*([^;\\s]*)/.test(type) && RegExp.$1;\n return type && this._extensions[type.toLowerCase()] || null;\n }", "title": "" }, { "docid": "c4a3c4a447de19f22625c24c95417696", "score": "0.65740544", "text": "function guessContentType(file) {\n if (file.endsWith(\".htm\") || file.endsWith(\".html\")) return 'text/html';\n if (file.endsWith(\".js\")) return 'application/javascript';\n if (file.endsWith(\".css\")) return 'text/css';\n return 'text/plain'\n}", "title": "" }, { "docid": "0ef72730bfe3d61df9c80bf0bc00a7ea", "score": "0.65562564", "text": "get extname() {\n return typeof this.path === \"string\" ? import_path.default.extname(this.path) : void 0;\n }", "title": "" }, { "docid": "5eb3cb4678334cef0ebc01082713ae8d", "score": "0.6555851", "text": "function getFileExtension(path) {\n\tvar start = path.lastIndexOf(\".\") //find the last period character in the string\n\tif (start == -1) {\n\t\treturn null;\n\t}\n\t\n\treturn path.substring(start, path.length);\n}", "title": "" }, { "docid": "b781142d40d491198e69cca035397673", "score": "0.6545858", "text": "function extname (path) {\n\tvar index = path.lastIndexOf(\".\");\n\treturn index < 0 ? \"\" : path.substring(index);\n}", "title": "" }, { "docid": "b781142d40d491198e69cca035397673", "score": "0.6545858", "text": "function extname (path) {\n\tvar index = path.lastIndexOf(\".\");\n\treturn index < 0 ? \"\" : path.substring(index);\n}", "title": "" }, { "docid": "32819435424f9c3c322e3668384e9cf6", "score": "0.6534033", "text": "function getExtension(name) {\n var pos = name.lastIndexOf('.');\n if (pos == -1)\n return \"\";\n return name.substring(pos);\n }", "title": "" }, { "docid": "537929caef3eed13479cf70a177a1278", "score": "0.6532432", "text": "mimeTypeToGizmoType(mime) {\n let parts = mime.split(\"/\");\n switch (parts[0]) {\n case \"audio\":\n return \"audio\";\n break;\n case \"image\":\n if (parts[1] == \"svg+xml\") {\n return \"svg\";\n }\n return \"image\";\n break;\n case \"video\":\n return \"video\";\n break;\n case \"text\":\n if ([\"csv\", \"html\", \"markdown\"].includes(parts[1])) {\n return parts[1];\n }\n return \"document\";\n break;\n case \"application\":\n if (parts[1] == \"pdf\") {\n return \"pdf\";\n }\n if ([\"zip\", \"gzip\", \"x-tar\"].includes(parts[1])) {\n return \"archive\";\n }\n return \"document\";\n break;\n }\n }", "title": "" }, { "docid": "18781f8a15f09dd12c409dce196a6e3b", "score": "0.65285707", "text": "function getFileExtension(filename) {\n var fileExtension;\n fileExtension = filename.substr((filename.lastIndexOf('.') + 1));\n return fileExtension;\n}", "title": "" }, { "docid": "26ea1493e243bed4c6610f96ac3acd6e", "score": "0.65096015", "text": "function guessFileExtension(mimeType) {\n if (gltfMimeTypes.hasOwnProperty(mimeType)) {\n return '.' + gltfMimeTypes[mimeType][0];\n }\n return '.bin';\n}", "title": "" }, { "docid": "84748be9c3385ddf5ab91ca26ba0f93a", "score": "0.6504571", "text": "function getContentType(req){\n var extname = path.extname(req.url);\n if (extname === '.html'){\n return 'text/html';\n }\n if (extname === '.css') {\n return 'text/css';\n }\n if (extname === '.js') {\n return 'application/javascript';\n }\n}", "title": "" }, { "docid": "a71974ba341d28c16bd62c82d0c6c322", "score": "0.64942175", "text": "function getExtension(path) {\r\n if (!path.includes(\".\"))\r\n return \"\";\r\n return path.substring(path.lastIndexOf(\".\") + 1);\r\n}", "title": "" }, { "docid": "c788adba6d7e6962833eb1956698aa02", "score": "0.6485377", "text": "function getExtension(fpath) {\n var sp = fpath.split(\".\");\n return sp[1];\n}", "title": "" }, { "docid": "a389f2d678116b5fd30d79bfda3f2b7e", "score": "0.64836997", "text": "function getExtension (getRecordingBatchrequestdata) {\n // Store the contenttype to a variable that will be used later to determine the extension of recordings.\n let contentType = getRecordingBatchrequestdata.results[0].contentType;\n // Slice the text and gets the extension that will be used for the recording\n let ext = contentType.split('/').splice(-1);\n\n createDirectory(ext, getRecordingBatchrequestdata);\n}", "title": "" }, { "docid": "a411590cb4a56e52d3a579ed4baa821b", "score": "0.647765", "text": "function determineCorrectFileType() {\n if (MediaRecorder.isTypeSupported(AUDIO_WEBM)) {\n return AUDIO_WEBM;\n } else if (MediaRecorder.isTypeSupported(AUDIO_OGG)) {\n return AUDIO_OGG;\n } else {\n throw new Error(\"unable to create a MediaRecorder with the\" + \"right mimetype!\");\n }\n}", "title": "" }, { "docid": "56569da6af57f35cd7beb2762427ccf2", "score": "0.64666677", "text": "function extname(path) {\n const ext = ObjC.unwrap(\n $(path).stringByStandardizingPath.pathExtension,\n )\n if (ext) return '.' + ext\n return path.endsWith('.') ? '.' : ''\n}", "title": "" }, { "docid": "927ec5f759a3baff5be60e0e2596e79e", "score": "0.6455305", "text": "get mimeType() {\n return this.modelDB.getValue('mimeType');\n }", "title": "" }, { "docid": "96ac29e1625cd277326f99675b67fc26", "score": "0.6450234", "text": "static get_video_mime(format) {\n switch (format) {\n case \"mp4\":\n return \"video/mp4\";\n case \"webm\":\n return \"video/webm\";\n }\n throw new Error(`Unrecognised video format ${format}`);\n }", "title": "" }, { "docid": "26407f80a6306bc5654229cc17f2b171", "score": "0.6433236", "text": "getMimeTypeByFilePath(path) {\n const ext = coreutils_1.PathExt.extname(path);\n if (ext === '.ipy') {\n return 'text/x-python';\n }\n else if (ext === '.md') {\n return 'text/x-ipythongfm';\n }\n let mode = mode_1.Mode.findByFileName(path) || mode_1.Mode.findBest('');\n return mode.mime;\n }", "title": "" }, { "docid": "16063eefa29a1aed4121ae2143be14ea", "score": "0.6406085", "text": "function getMediaType(__context) {\n\t\tmediaType = __context.getContainer().getAttribute(globals.dataAttributes.mediaType) ? __context.getContainer().getAttribute(globals.dataAttributes.mediaType) : null;\n\t\t\n\t\tif (mediaType === null) {\n\t\t\tswitch(__context.source.substring(__context.source.lastIndexOf(\".\") + 1).toLowerCase()) {\n\t\t\t\tcase \"mp3\":\n\t\t\t\t\tmediaType = \"mpeg\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"mp4\":\n\t\t\t\t\tmediaType = \"mp4\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"ogg\":\n\t\t\t\t\tmediaType = \"ogg\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"webm\":\n\t\t\t\t\tmediaType = \"webm\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"wav\":\n\t\t\t\t\tmediaType = \"wav\";\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tmediaType = \"mp4\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tmediaType = \"audio/\" + mediaType.toLowerCase();\n\t\t\n\t\treturn mediaType;\n\t}", "title": "" }, { "docid": "b00e5aa5a0a17c833b1ab1fd6861ffd3", "score": "0.6393716", "text": "function getMimeType() {\n\t\treturn \"application/octet-stream\";\n\t}", "title": "" }, { "docid": "a1d45485302ca1498afd916f8ac916f3", "score": "0.6384868", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n }", "title": "" }, { "docid": "0c7b0fb6a84981ce42136f630157c10f", "score": "0.63801616", "text": "function getSuffix(fileName) {\n var suffix = fileName.substring(fileName.lastIndexOf(\".\"),fileName.length);\n switch(suffix){\n case \".ppt\":\n suffix = \"ppt\";\n break;\n case \".pptx\":\n suffix = \"ppt\";\n break;\n case \".doc\":\n suffix = \"doc\";\n break;\n case \".docx\":\n suffix = \"doc\";\n break;\n case \".pdf\":\n suffix = \"pdf\";\n break;\n case \".jpg\":\n suffix = \"jpg\";\n break;\n case \".mp4\":\n suffix= \"mp4\";\n break;\n case \".psd\":\n suffix = \"psd\";\n break;\n case \".txt\":\n suffix = \"txt\";\n break;\n case \".zip\":\n suffix = \"zip\";\n break;\n default:\n suffix = \"other\";\n break;\n }\n return suffix;\n}", "title": "" }, { "docid": "78ea6ece0f85fe3769178baf13742da5", "score": "0.6366579", "text": "function getFileImage( type:String ) {\r\n\r\n\tif (type == null || type.length==0 ) {\r\n\t\treturn \"\";\r\n\t} else if (type.equals(\"document\") ) {\r\n\t\treturn \"file_extension_doc.png\";\r\n\t} else if (type.equals(\"pdf\") ) {\r\n\t\treturn \"file_extension_pdf.png\";\r\n\t} else if (type.equals(\"presentation\") ) {\r\n\t\treturn \"file_extension_pps.png\";\r\n\t} else if (type.equals(\"spreadsheet\") ) {\r\n\t\treturn \"file_extension_xls.png\";\r\n\t} else if (type.equals(\"image\") ) {\r\n\t\treturn \"file_extension_jpg.png\";\r\n\t} else if (type.equals(\"video\") ) {\r\n\t\treturn \"file_extension_mpg.png\";\r\n\t} else {\r\n\t\treturn \"\";\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "31d751604b8d19235a17eaab1ca86fff", "score": "0.63573754", "text": "function findDriveDocumentMimeType(fileExt)\n{ \n switch(fileExt.toLowerCase())\n {\n case 'docx':\n return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';\n case 'xlsx':\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n default:\n return null;\n }\n}", "title": "" }, { "docid": "aa35991313e0771f1149c429d1025609", "score": "0.63371414", "text": "function getImageExtension(str) {\n return str.substring(str.lastIndexOf(\".\"));\n}", "title": "" }, { "docid": "a96ade40d6d9008689b06d3b989da6a2", "score": "0.6335382", "text": "function matchExt(val) {\n\n return val.split('.')[1] === ext;\n }", "title": "" }, { "docid": "dbdfe72a85beb7f8abc90679327bac37", "score": "0.63285273", "text": "function getContentType(file) {\n str = file.substring(file.indexOf('.'));\n switch (str) {\n case \".html\":\n return 'text/html';\n break;\n case \".css\":\n return 'text/css';\n break;\n case \".jpg\":\n return 'image/jpg';\n break;\n case \".jpeg\":\n return 'image/jpeg';\n break;\n case \".gif\":\n return 'image/gif';\n break;\n case \".txt\":\n return 'text/plain';\n break;\n case '.js':\n return 'application/javascript';\n break;\n }\n throw new noSuchTypeErr;\n}", "title": "" }, { "docid": "90c89bfca74dd042b0ed3074b70cfd12", "score": "0.63256985", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n}", "title": "" }, { "docid": "90c89bfca74dd042b0ed3074b70cfd12", "score": "0.63256985", "text": "function mime(uri) {\n return uri.split(';')[0].slice(5);\n}", "title": "" }, { "docid": "212465e4cbab929f39103f231b8614af", "score": "0.62806267", "text": "function doMime () {\n console.log( 'Mime type for \\\"' + options.src + '\\\":' );\n console.log( '\\t' + colors.yellow( mime.lookup( options.src ) ) );\n}", "title": "" }, { "docid": "98a893322fcacbe21941e5d8219bcbb1", "score": "0.62533957", "text": "function detect_content( file_name )\n{\n\tif (file_name.includes(\".html\"))\n\t{\n return \"text/html\";\n\t}\n\telse if (file_name.includes(\".css\"))\n\t{\n\t\treturn \"text/css\";\n\t}\n\telse if (file_name.includes(\".js\"))\n\t{\n\t\treturn \"application/javascript\";\n\t}\n\telse\n\t{\n\t\tthrow \"invalid extension\";\n\n\t}\n}", "title": "" }, { "docid": "e531628fc35c72ec617f98e4e820df3c", "score": "0.6242945", "text": "function determineMimeOfFileName(nameWithPath) {\n /*jshint -W015 */\n var pathSegments = nameWithPath.split(\"/\"),\n name = pathSegments[pathSegments.length - 1],\n extension = qq.getExtension(name);\n\n extension = extension && extension.toLowerCase();\n\n switch (extension) {\n case \"jpeg\":\n case \"jpg\":\n return \"image/jpeg\";\n case \"png\":\n return \"image/png\";\n case \"bmp\":\n return \"image/bmp\";\n case \"gif\":\n return \"image/gif\";\n case \"tiff\":\n case \"tif\":\n return \"image/tiff\";\n }\n }", "title": "" }, { "docid": "e531628fc35c72ec617f98e4e820df3c", "score": "0.6242945", "text": "function determineMimeOfFileName(nameWithPath) {\n /*jshint -W015 */\n var pathSegments = nameWithPath.split(\"/\"),\n name = pathSegments[pathSegments.length - 1],\n extension = qq.getExtension(name);\n\n extension = extension && extension.toLowerCase();\n\n switch (extension) {\n case \"jpeg\":\n case \"jpg\":\n return \"image/jpeg\";\n case \"png\":\n return \"image/png\";\n case \"bmp\":\n return \"image/bmp\";\n case \"gif\":\n return \"image/gif\";\n case \"tiff\":\n case \"tif\":\n return \"image/tiff\";\n }\n }", "title": "" }, { "docid": "0ccad4e38e4e9252c76b2aa838dd08fd", "score": "0.62390244", "text": "function getFile(str, extension) {\n return str.substr(0, str.length - extension.length-1);\n }", "title": "" }, { "docid": "a533d2dcc4356704aadd5cda43a8f165", "score": "0.62374216", "text": "function getFileType(_file) {\n var _ft = '';\n\n if (fs.lstatSync(_file).isDirectory() == true) {\n _ft = 'folder';\n }\n\n if (fs.lstatSync(_file).isFile() == true) {\n _ft = path.parse(_file).ext;\n }\n return _ft;\n}", "title": "" }, { "docid": "6fab2b0b7f0354e4bf5509541aabd4e6", "score": "0.61786264", "text": "getFileType(file, getMime) {\n\t\tif (getMime == undefined) { getMime = false; }\n\t\tvar mime = undefined;\n\t\tvar parseType = \"uint8array\";\n\t\tif (file.name.endsWith(\".jpg\") || file.name.endsWith(\".JPG\") || file.name.endsWith(\".jpeg\") || file.name.endsWith(\".JPEG\")) {\n\t\t\tmime = \"image/jpg\";\n\t\t} else if (file.name.endsWith(\".html\") || file.name.endsWith(\".HTML\") || file.name.endsWith(\".htm\") || file.name.endsWith(\".HTM\")) {\n\t\t\tmime = \"text/html\";\n\t\t} else if (file.name.endsWith(\".png\") || file.name.endsWith(\".PNG\")) {\n\t\t\tmime = \"image/png\";\n\t\t} else if (file.name.endsWith(\".pdf\") || file.name.endsWith(\".PDF\")) {\n\t\t\tmime = \"application/pdf\";\n\t\t\t//containerUuid = generateUUID();\n\t\t} else if (file.name.endsWith(\".txt\") || file.name.endsWith(\".TXT\")) {\n\t\t\tmime = \"text/plain\";\n\t\t\tparseType = \"string\";\n\t\t} else if (file.name.endsWith(\".csv\") || file.name.endsWith(\".CSV\")) {\n\t\t\tmime = \"text/csv\";\n\t\t\tparseType = \"string\";\n\t\t}\n\t\tif (getMime) {\n\t\t\treturn mime;\n\t\t} else {\n\t\t\treturn parseType;\n\t\t}\n\t}", "title": "" }, { "docid": "a46b9f976cc48c2b9e5bf5084def4866", "score": "0.6176618", "text": "function determineFileType(fileEntry) {\n if (fileEntry && fileEntry.fullPath && fileEntry.fullPath.match(/\\.png$|.jpg$|.gif$/)) {\n return \"image\";\n } else {\n return \"unknown\";\n }\n }", "title": "" }, { "docid": "b4bacb8ddacc41d086cb3257c9a17aff", "score": "0.6175896", "text": "get mimeType() {\n return this._recorder.mimeType;\n }", "title": "" }, { "docid": "4464935c539c32529bc85fba8f951db9", "score": "0.61746264", "text": "getMimeTypeByLanguage(info) {\n let ext = info.file_extension || '';\n return mode_1.Mode.findBest(info.codemirror_mode || {\n mimetype: info.mimetype,\n name: info.name,\n ext: [ext.split('.').slice(-1)[0]]\n }).mime;\n }", "title": "" } ]
5fab230c7fd02fc55f282d051af31ebf
Creates a new `Rect` object with specified `width` and `height`
[ { "docid": "9d9e2312b2c678ec32f5db3b4cf806da", "score": "0.0", "text": "constructor(width, height) {\r\n this.width = 0;\r\n this.height = 0;\r\n this.resize(width, height);\r\n }", "title": "" } ]
[ { "docid": "520a18a3ad369f93bf895b1a05d1b0a4", "score": "0.85524976", "text": "function createRect(width, height) {\r\n const rect = { width, height };\r\n rect.getArea = () => {\r\n return rect.width * rect.height;\r\n };\r\n return rect;\r\n }", "title": "" }, { "docid": "d068a146e982222788ee72e1693f7a40", "score": "0.80642474", "text": "function Rect( x,y,width,height )\n{\n\treturn new Rect_( x,y,width,height );\n}", "title": "" }, { "docid": "beb36d227855cdb0a36f669d8dc907b5", "score": "0.78035", "text": "function Rect(x, y, w, h) {\n Shape.call(this, x, y, w, h);\n return this;\n}", "title": "" }, { "docid": "d9bdeef0229df248662dcfc886d8a0dc", "score": "0.7780621", "text": "function createRect(){\n new Rectangle(rectHeight, rectWidth); \n}", "title": "" }, { "docid": "901895b6af54304baae4b4b64f72a583", "score": "0.77798307", "text": "function Rect(x, y, width, height) {\n this._x = x;\n this._y = y;\n this._width = width;\n this._height = height;\n }", "title": "" }, { "docid": "a249d0f963f42b2e1e7958bb4a210289", "score": "0.76845324", "text": "function rectangle(width, height) {\n this.width = width;\n this.height = height;\n}", "title": "" }, { "docid": "e1fcbb8f6787aecde9d12b07fcf76b8d", "score": "0.7613933", "text": "function Rect(x, y, w, h) {\n this.x = x; this.y = y;\n this.w = w; this.h = h;\n}", "title": "" }, { "docid": "18075cba1a82ca4d8eaa28438b6deaee", "score": "0.75872755", "text": "function Rectangle(height, width) {\n this.height = height;\n this.width = width;\n }", "title": "" }, { "docid": "6059e3e310311360a6da1f587406120b", "score": "0.75410765", "text": "function Rectangle(left, top, width, height) {\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "ece1274eb7e842e565c47a16434cbd27", "score": "0.74828494", "text": "function Rectangle( width, height ) {\n this.width = width;\n this.height = height;\n}", "title": "" }, { "docid": "4c24af435c484bad8c5a811a03ca393f", "score": "0.74148756", "text": "function makeRect(x, y, width, height, speed, color) {\n if (!color) color = \"#000000\";\n return {\n x: x,\n y: y,\n w: width,\n h: height,\n s: speed,\n c: color,\n draw: function() {\n ctx.fillStyle = this.c;\n ctx.fillRect(this.x, this.y, this.w, this.h);\n }\n };\n}", "title": "" }, { "docid": "66ed495851a5380299e5fd2e5884f73d", "score": "0.74099576", "text": "setRect(x, y, width, height) {\n return this.native.setRect(x, y, width, height);\n }", "title": "" }, { "docid": "c78ae06282318102fd391fb2ccefd37d", "score": "0.7373964", "text": "function Rect(Height, Width){\n this.xx = new Vector3(Height/2, Width/2, 0);\n this.xy = new Vector3(Height/2, -Width/2, 0);\n this.yy = new Vector3(-Height/2, -Width/2, 0);\n this.yx = new Vector3(-Height/2, Width/2, 0);\n}", "title": "" }, { "docid": "484acfaeb8dfc21c57f39a02a68f87f3", "score": "0.732699", "text": "function Rectangle(width, height) {\n this.width = width; \n this.height = height; \n}", "title": "" }, { "docid": "815689992ce3af894c7ed9a6aea62393", "score": "0.7286898", "text": "function Rectangle(x, y, width, height) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "52752395cac15aab0445e68648c29a7c", "score": "0.72826993", "text": "function Rectangle (x, y, width, height)\n{\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n}", "title": "" }, { "docid": "3a50758367af590863a51e49ae8b3c51", "score": "0.7096148", "text": "function Rectangle(left, top, right, bottom) {\n this.init(new Point((left || 0), (top || 0)),\n new Point((right || 0), (bottom || 0)));\n}", "title": "" }, { "docid": "9279acf427f1f55c2cd37b77016b0824", "score": "0.70896953", "text": "function Rect(x, y, width, height, rotation, anchorPoint) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.rotation = rotation || 0;\n\t\tthis.anchorPoint = anchorPoint || new Vector2D(0, 0);\n\t}", "title": "" }, { "docid": "7d91af3f461e4a41547b017a8a806d68", "score": "0.7086267", "text": "function makeRectangle (x,y,height,width,color, charType) {\n return {\n x:x,\n y:y,\n height:height,\n width:width,\n color: color,\n charType: charType\n }\n}", "title": "" }, { "docid": "0927250b7d9c9ce4d5a2f60cf5e8a95a", "score": "0.7081572", "text": "function rect( origin, dimensions ) {\n return {\n pos: origin,\n dim: dimensions\n };\n}", "title": "" }, { "docid": "5896d005b4e1060a7d37f4884620d5f8", "score": "0.70507634", "text": "function TRect(x,y,w,h)\n{\n\tif ( x instanceof TRect )\n\t{\n\t\th = x.h;\n\t\tw = x.w;\n\t\ty = x.y;\n\t\tx = x.x;\n\t}\n\t\n\tif ( Array.isArray(x) )\n\t{\n\t\th = x[3];\n\t\tw = x[2];\n\t\ty = x[1];\n\t\tx = x[0];\n\t}\n\t\n\tthis.x = x;\n\tthis.y = y;\n\tthis.w = w;\n\tthis.h = h;\n\t\n\tthis.GetArray = function()\n\t{\n\t\treturn [this.x,this.y,this.w,this.h];\n\t}\n\n\tthis.GetLeft = function()\n\t{\n\t\treturn this.x;\n\t}\n\t\n\tthis.GetTop = function()\n\t{\n\t\treturn this.y;\n\t}\n\n\tthis.GetBottom = function()\n\t{\n\t\treturn this.y + this.h;\n\t}\n\t\n\tthis.GetRight = function()\n\t{\n\t\treturn this.x + this.w;\n\t}\n\t\n\tthis.Accumulate = function(Rect)\n\t{\n\t\tthis.x = Math.min( Rect.x, this.x );\n\t\tlet Right = Math.max( Rect.GetRight(), this.GetRight() );\n\t\tthis.w = Right - this.x;\n\n\t\tthis.y = Math.min( Rect.y, this.y );\n\t\tlet Bottom = Math.max( Rect.GetBottom(), this.GetBottom() );\n\t\tthis.h = Bottom - this.y;\n\t}\n\t\n\tthis.GetLocalUv = function(Uv)\n\t{\n\t\tlet u = Math.Range( this.GetLeft(), this.GetRight(), Uv.x );\n\t\tlet v = Math.Range( this.GetTop(), this.GetBottom(), Uv.y );\n\t\treturn new float2(u,v);\n\t}\n\t\n\tthis.ScaleTo = function(Parent)\n\t{\n\t\tlet Normalised = this;\n\t\tlet l = Math.Lerp( Parent.GetLeft(), Parent.GetRight(), Normalised.GetLeft() );\n\t\tlet r = Math.Lerp( Parent.GetLeft(), Parent.GetRight(), Normalised.GetRight() );\n\t\tlet t = Math.Lerp( Parent.GetTop(), Parent.GetBottom(), Normalised.GetTop() );\n\t\tlet b = Math.Lerp( Parent.GetTop(), Parent.GetBottom(), Normalised.GetBottom() );\n\t\tlet w = r-l;\n\t\tlet h = b-t;\n\t\treturn new TRect( l, t, w, h );\n\t}\n\t\n\tthis.GetMultiplied = function(ScalarRect)\n\t{\n\t\tScalarRect = new TRect( Array.from(arguments) );\n\t\tScalarRect.x *= this.x;\n\t\tScalarRect.y *= this.y;\n\t\tScalarRect.w *= this.w;\n\t\tScalarRect.h *= this.h;\n\t\treturn ScalarRect;\n\t}\n\t\n}", "title": "" }, { "docid": "27812782d2ca698c383aab4c0a6d27f0", "score": "0.7019681", "text": "function getBabyRect(width, height) {\n if (width > height) {\n return {\n width: width - height,\n height: height\n };\n } else {\n return {\n width: width,\n height: height - width\n };\n }\n}", "title": "" }, { "docid": "927522eb5d6f924b4dd5687664b9d5a6", "score": "0.7008694", "text": "function rectangle(length, width)\n{\n this.length = length;\n this.width = width;\n}", "title": "" }, { "docid": "bd66cfca1a282158bf38b3ee67f0fb6c", "score": "0.69923276", "text": "function Rectangle(width, height) {\n Quadrilateral.call(this, width, width, height, height) //create quad, pass it the four lengths it needs\n this.width = width //want to be able to call width or height from a rectangle\n this.height = height\n}", "title": "" }, { "docid": "e8fb2676ad24898a20ec75095ab83f9b", "score": "0.6956305", "text": "function GRect(x, y, width, height) {\n GObject.call(this, x, y);\n this.width = width;\n this.height = height;\n this.refresh();\n}", "title": "" }, { "docid": "47da730f3d104b027e32bcd8b0932d66", "score": "0.69546896", "text": "createRect(x, y, width, height, color = 0x000000, borderWidth = 0, borderColor = 0x000000) {\n let rect = new PIXI.Graphics();\n rect.lineStyle(borderWidth, borderColor, 1);\n rect.beginFill(color, 1);\n rect.drawRect(x, y, width, height);\n return rect;\n }", "title": "" }, { "docid": "312b36213ca73b14b763cb51225c7f71", "score": "0.69358784", "text": "ofSize(width, height) {\n this.size = new Bounds(width, height);\n return this;\n }", "title": "" }, { "docid": "cb1232255d42ddcc507a47b9d4a66f14", "score": "0.69106394", "text": "function CScreenRect(inWidth, inHeight, inX, inY) {\n this.width = inWidth;\n this.height = inHeight;\n this.x = inX;\n this.y = inY;\n}", "title": "" }, { "docid": "7d6d146f03f8b312781b50c883b7db39", "score": "0.69090855", "text": "function rect(x, y, w, h) { // rectangle factory\n\t ctx.beginPath();\n\t ctx.rect(x, y, w, h);\n\t ctx.closePath();\n\t ctx.fill();\n\t ctx.stroke();\n\t}", "title": "" }, { "docid": "2a98b412d9d8dab51e6bd4bb72b25c70", "score": "0.6884136", "text": "function rectangle(width, height, x, y) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](x)) {\n x = 0;\n }\n\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](y)) {\n y = 0;\n }\n\n return moveTo({\n x: x,\n y: y\n }) + lineTo({\n x: x + width,\n y: y\n }) + lineTo({\n x: x + width,\n y: y + height\n }) + lineTo({\n x: x,\n y: y + height\n }) + closePath();\n }", "title": "" }, { "docid": "a32ed8fc7d5602c82dd9a90766b533a8", "score": "0.68779373", "text": "function Rectangle(length, width) {\n this.length = length;\n this.width = width;\n}", "title": "" }, { "docid": "a32ed8fc7d5602c82dd9a90766b533a8", "score": "0.68779373", "text": "function Rectangle(length, width) {\n this.length = length;\n this.width = width;\n}", "title": "" }, { "docid": "31dcab478f86cea7096ab7be1ae40c94", "score": "0.68567866", "text": "static Rectangle(origin, width, height) {\n if (width === undefined) width = 1;\n if (height === undefined) height = 1;\n\n var path = new Path([\n origin,\n new Point(origin.x + width, origin.y, origin.z),\n new Point(origin.x + width, origin.y + height, origin.z),\n new Point(origin.x, origin.y + height, origin.z)\n ]);\n\n return path;\n }", "title": "" }, { "docid": "a911492c07b8ee81d3a3b33dba3840f5", "score": "0.6851096", "text": "function rectangle(width, height, x, y) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](x)) {\n x = 0;\n }\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](y)) {\n y = 0;\n }\n return moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\n}", "title": "" }, { "docid": "4480ada670b52818ce345e1195d76973", "score": "0.6847868", "text": "function create_rectangle(top,left,width,height) {\n\t$(\"<div class='box'></div>\").css({\n\t\tposition: \"absolute\",\n\t\ttop: top,\n\t\tleft: left,\n\t\twidth: width,\n\t\theight: height,\n\t\tborder: \"1px solid #000\"\n\t}).appendTo(\"body\");\n}", "title": "" }, { "docid": "0bb6fa9ba50b61cad433181187a188c6", "score": "0.68309474", "text": "function Rectangle(x,y,width,height){\n //call superclass constructor\n Shape.call(this, 4, x, y);\n\n //set rectangle values\n this.width = width;\n this.height = height;\n\n}", "title": "" }, { "docid": "1716fcc6adfc87a80a534a22ec27a85a", "score": "0.682921", "text": "function Rectangle(length, width) {\n this.length = length;\n this.width = width;\n }", "title": "" }, { "docid": "2f9e4f3f0cc438b09d64cb647fce6f8e", "score": "0.6812529", "text": "function Rectangle() {\n _classCallCheck(this, Rectangle);\n\n this.left = -Infinity;\n this.right = Infinity;\n this.bottom = -Infinity;\n this.top = Infinity;\n }", "title": "" }, { "docid": "2f9e4f3f0cc438b09d64cb647fce6f8e", "score": "0.6812529", "text": "function Rectangle() {\n _classCallCheck(this, Rectangle);\n\n this.left = -Infinity;\n this.right = Infinity;\n this.bottom = -Infinity;\n this.top = Infinity;\n }", "title": "" }, { "docid": "902be89bee6680a3e34b72f68e288d05", "score": "0.6758069", "text": "function Rect(point, size) {\n var _this = _super.call(this, 'rect') || this;\n _this.setPoint(point);\n _this.setSize(size);\n return _this;\n }", "title": "" }, { "docid": "822abc71b49cad255d62d60b97f75f7e", "score": "0.67570084", "text": "function Rectangle(length, width) {\n this.length=length;\n this.width = width;\n}", "title": "" }, { "docid": "8da7f491d731b94245776b880db3aaad", "score": "0.6742997", "text": "function RectangleDiv(div, width, height) {\n this.div = div;\n this.width = width;\n this.height = height;\n this.startXCoord = parseInt(this.div.style.left);\n this.startYCoord = parseInt(this.div.style.top);\n }", "title": "" }, { "docid": "cda738cddc228b117158d60ae14b8a68", "score": "0.67316186", "text": "function rect(x, y, w, h) {\n c.fillRect(x, y, w, h);\n c.strokeRect(x, y, w, h);\n}", "title": "" }, { "docid": "f377b9ad41d395a0271a1e33e767bd92", "score": "0.67293084", "text": "function Rectangle(length, width) { \n\tthis.length = length; \n\tthis.width = width; \n\t\n}", "title": "" }, { "docid": "15d7f1431ef26c511752f93228793bb6", "score": "0.6687893", "text": "function Rectangle(width, height) {\n console.log(\"I'm creating a new Rectangle\");\n this.width = width;\n this.height = height;\n this.calculateArea = function() {\n return this.width * this.height;\n }\n }", "title": "" }, { "docid": "c68cecd4b6df6c6c5d19f02a84c408fb", "score": "0.6673443", "text": "function Rectangle(options ={}) {\n this.top = options.top || 0,\n this.left = options.left || 0,\n this.width = options.width || 0,\n this.height = options.left || 0,\n\n this.getArea = function(){\n \n }\n}", "title": "" }, { "docid": "51162da2361d86a2d409630b18c36a0f", "score": "0.66720074", "text": "function rectA(height, width) {\r\n return height * width\r\n}", "title": "" }, { "docid": "46dbe52c4c85fbc04c156bcb013be7db", "score": "0.6654781", "text": "function Rectangle() {\n var _this = _super.call(this) || this;\n\n _this.className = \"Rectangle\";\n _this.element = _this.paper.add(\"rect\"); //this.pixelPerfect = false;\n\n _this.applyTheme();\n\n return _this;\n }", "title": "" }, { "docid": "c1aa096d9523b862b9aa201f63cee7d0", "score": "0.6636385", "text": "function Rectangle(w, h)\n{\n // Initialize object properties.\n this.width = w;\n this.height = h;\n\n // Define methods for the object.\n this.area = Rectangle_area;\n this.perimeter = Rectangle_perimeter;\n this.set_size = Rectangle_set_size;\n this.enlarge = Rectangle_enlarge;\n this.shrink = Rectangle_shrink;\n}", "title": "" }, { "docid": "efa6b70a5c0dfa74543980d2586ea27b", "score": "0.662247", "text": "function Rectangle() {\n var _this = _super.call(this) || this;\n _this.className = \"Rectangle\";\n _this.element = _this.paper.add(\"rect\");\n //this.pixelPerfect = false;\n _this.applyTheme();\n return _this;\n }", "title": "" }, { "docid": "7a42e3cd98bec3582169d83141fb1e78", "score": "0.6593813", "text": "function rect(color, x, y, width, height) {\n this.color = color; \n this.x = x; \n this.y = y; \n this.width = width; \n this.height = height; \n this.draw = function() {\n context.fillStyle = this.color;\n context.fillRect(this.x, this.y, this.width, this.height);\n };\n}", "title": "" }, { "docid": "c04787dc6254719b6e7fab9a57e59ce4", "score": "0.6571618", "text": "_createRect(rectId, x, y){\n let curRect = document.createElement('div');\n \n curRect.setAttribute('id', rectId);\n curRect.setAttribute('class', 'rect');\n \n curRect.style.left = CONSTANTS.RECT_WIDTH * x + 'px';\n curRect.style.top = y * CONSTANTS.RECT_HEIGHT + 'px';\n \n document.getElementById(\"canvas-id\").append(curRect);\n return curRect;\n }", "title": "" }, { "docid": "793c04a31190ee8db718bb9870b42d90", "score": "0.6564153", "text": "function createRectangle(fill, stroke, stroke_width, stroke_miterlimit, width, height, x, y, transform){\n var rect = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n rect.setAttributeNS(null, \"fill\", fill);\n rect.setAttributeNS(null, \"stroke\", stroke);\n rect.setAttributeNS(null, \"stroke-width\", stroke_width);\n rect.setAttributeNS(null, \"stroke-miterlimit\", stroke_miterlimit);\n rect.setAttributeNS(null, \"width\", width);\n rect.setAttributeNS(null, \"height\", height);\n rect.setAttributeNS(null, \"x\", x);\n rect.setAttributeNS(null, \"y\", y);\n rect.setAttributeNS(null, \"transform\", transform);\n return rect;\n}", "title": "" }, { "docid": "2f59705ede41ee257db911364c2966ce", "score": "0.65203804", "text": "function rect(x, y, w, h) {\n context.beginPath();\n context.rect(x, y, w, h);\n context.fill();\n}", "title": "" }, { "docid": "2f59705ede41ee257db911364c2966ce", "score": "0.65203804", "text": "function rect(x, y, w, h) {\n context.beginPath();\n context.rect(x, y, w, h);\n context.fill();\n}", "title": "" }, { "docid": "74d9c65aee52034db5e51dbeaf9d6ead", "score": "0.65068567", "text": "constructor() {\n\t\t\t/** The x coordinate of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.x = 0;\n\t\t\t/** The y coordinate of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.y = 0;\n\t\t\t\n\t\t\t/** The end x coordinate (i.e. the right) of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.ex = 0;\n\t\t\t/** The end y coordinate (i.e. the bottom) of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.ey = 0;\n\t\t\t\n\t\t\t/** The width of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.width = 0;\n\t\t\t/** The height of the rectangle.\n\t\t\t * @type integer\n\t\t\t * @memberof! dusk.utils.PosRect#\n\t\t\t */\n\t\t\tthis.height = 0;\n\t\t}", "title": "" }, { "docid": "dd3dfdf7798abc77e853879e3f5d9c97", "score": "0.6500169", "text": "constructor (height=10, width=10){\n\t\tthis._height = height;\n\t\tthis._width = width;\n\t}", "title": "" }, { "docid": "0da733439680d11880b1d383c3cde9a3", "score": "0.6477691", "text": "rect(x, y, width, height, opt = {}) {\n let p1 = { x, y };\n let p2 = { x: x + width, y: y + height };\n if (p1.x > p2.x)\n [p1.x, p2.x] = [p2.x, p1.x];\n if (p1.y > p2.y)\n [p1.y, p2.y] = [p2.y, p1.y];\n this.expandAuto(p1, p2);\n this.renderers.push(() => {\n let [{ x, y }, { x: x1, y: y1 }] = scale(this.geo, p1, p2);\n return svgRect(x, y, x1 - x, y1 - y, opt);\n });\n return this;\n }", "title": "" }, { "docid": "d6416ed18c3be085d19b97124f80566f", "score": "0.6467673", "text": "function rect(x,y,recWidth,recHeight){\n\tcontext.fillRect(x, y, recWidth, recHeight);\n}", "title": "" }, { "docid": "801961c16c7df96b430bbbc3c099095a", "score": "0.6461064", "text": "function rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y) {\n\t//Create the sprite\n\tvar sprite = new Rectangle(width, height, fillStyle, strokeStyle, lineWidth, x, y);\n\t//Add the sprite to the stage\n\tstage.addChild(sprite);\n\t//Return the sprite to the main program\n\treturn sprite;\n}", "title": "" }, { "docid": "2e5e89d50abdbbdbd9648c5e0263a483", "score": "0.6458901", "text": "function rect(x, y, w, h) {\n \"use strict\";\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.closePath();\n ctx.fill();\n}", "title": "" }, { "docid": "685494f0ef7f9412d3f408798e3a4fce", "score": "0.64569324", "text": "constructor(width, height) {\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "d5bb99e313df746e982bc0921ec0cfe5", "score": "0.6411762", "text": "constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "7f5fcf215e4caf8d8eec9005f42b58b9", "score": "0.64064896", "text": "getRect () {\n return new Phaser.Rectangle(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "a76079919e0b3583c59d26e19f5133f0", "score": "0.64036715", "text": "function genRect(x, y, w, h, rx, ry, css, id)\n{\n var r = document.createElementNS(SVG_NS, \"rect\");\n r.setAttribute(\"x\", x);\n r.setAttribute(\"y\", y);\n r.setAttribute(\"width\", w);\n r.setAttribute(\"height\", h);\n if (rx) { r.setAttribute(\"rx\", rx); }\n if (ry) { r.setAttribute(\"ry\", ry); }\n if (css) { r.setAttribute(\"class\", css); }\n if (id) { r.setAttribute(\"id\", id); }\n return r;\n}", "title": "" }, { "docid": "73507ff3af1a6a322f1424b34d505abb", "score": "0.6395625", "text": "function Rectangle(a, b) {\n let rectangle = {\n length: a,\n width: b,\n perimeter: 2 * (a + b),\n area: a * b,\n };\n\n return rectangle;\n}", "title": "" }, { "docid": "bab20f4ba08112786aa1162827e02cf5", "score": "0.6389155", "text": "function addRect(x, y, w, h, fill) {\n\tvar rect = new Box;\n\trect.x = x;\n\trect.y = y;\n\trect.w = w\n\trect.h = h;\n\trect.fill = fill;\n\tboxes.push(rect);\n\tinvalidate();\n}", "title": "" }, { "docid": "e8b2f34bc16c494bd05c230698fde95a", "score": "0.63848895", "text": "function rectangle(color, x, y, width, height) {\n context.fillStyle = color;\n context.fillRect(x, y, width,height);\n}", "title": "" }, { "docid": "6ff5d8d46bf9d01edffef5a43deb171a", "score": "0.6346922", "text": "function rect(x, y, w, h) {\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.closePath();\n ctx.fill();\n}", "title": "" }, { "docid": "6ff5d8d46bf9d01edffef5a43deb171a", "score": "0.6346922", "text": "function rect(x, y, w, h) {\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.closePath();\n ctx.fill();\n}", "title": "" }, { "docid": "971e13bfe104affabd6b8330179c346a", "score": "0.6328115", "text": "function Rectangle (attributes) {\n\n\t\tattributes = attributes || {};\n\t\tattributes.w = attributes.w || 50;\n\t\tattributes.h = attributes.h || 40;\n\t\tattributes.x = attributes.x || 225;\n\t\tattributes.y = attributes.y || 180;\n\t\tattributes.type = 'rectangle';\n\n\t\tvar rectangle = Drawing(attributes);\n\n\t\t// Function for drawing the object path on the canvas.\n\t\trectangle.interface.draw = drawFunc(rectangle, function drawRect () {\n\t\t\trectangle.path.rect(rectangle.x.value, rectangle.y.value,\n\t\t\t\trectangle.w.value, rectangle.h.value);\n\t\t});\n\n\t\treturn rectangle.interface;\n\n\t}", "title": "" }, { "docid": "026494254708fb6aa98f241e84c9b0f3", "score": "0.6319954", "text": "function Rectangle(height, width) {\n this.height = height;\n this.width = width;\n this.calcArea = function () {\n return this.height * this.width;\n };\n this.calcPerimeter = function () {\n return (this.height * 2) + (this.width * 2);\n };\n}", "title": "" }, { "docid": "a8e8008b4ff8cb846fd6d16b465cc215", "score": "0.6310635", "text": "function Rectangle(len,wid){\n\tthis.length = len;\n\tthis.width = wid;\n\tthis.area = function(){\n\t\treturn this.length * this.width;\n\t}\n\tthis.perimeter = function(){\n\t\treturn this.height * 2 + this.width * 2;\n\t}\n}", "title": "" }, { "docid": "d5e6fea45beedc703f2fe344621d9a00", "score": "0.6301692", "text": "function rect(lon, lar) {\n this.longueur = lon;\n this.largeur = lar;\n}", "title": "" }, { "docid": "dc575936662d336e0c8851cd759d716f", "score": "0.62932485", "text": "withBounds(width, height) {\n this.between = new Bounds(width, height);\n return this;\n }", "title": "" }, { "docid": "ec8649a2f5f9628b73812c6b0ccd884e", "score": "0.62837017", "text": "function Size(width, height) {\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "df4b303a302fd9bfeebe19d17c99bf50", "score": "0.6278661", "text": "function rectangleArea(width, height) {\n let area = width * height \n }", "title": "" }, { "docid": "e2409f848fe668e1bc86d297e33cca4b", "score": "0.6273666", "text": "function Size(width, height) {\n this._width = width;\n this._height = height;\n }", "title": "" }, { "docid": "11ebdec5c590805840ab5b799a20bdb1", "score": "0.6244271", "text": "function rect(x, y, w, h) {\n const path = newPath();\n openVG.vgu.rect(path, x, y, w, h);\n openVG.drawPath(path, VG_FILL_AND_STROKE_PATH);\n openVG.destroyPath(path);\n}", "title": "" }, { "docid": "7bec049240ab27af83553ed0b72188db", "score": "0.62370616", "text": "function rect(x, y, w, h) {\r\n ctx.beginPath();\r\n ctx.rect(x, y, w, h);\r\n ctx.closePath();\r\n ctx.fill();\r\n}", "title": "" }, { "docid": "ba9d9c8f184dbd70ed13e887dd402fa1", "score": "0.6236155", "text": "constructor() {\n let arg = arguments //eslint-disable-line\n if (arg.length === 1 || (arg.length === 2 && arg[1] === null)) {\n arg = [origin, arg[0]]\n }\n if (arg.length === 2) {\n const [p1, p2] = arg\n if (!isinstance(p1, Point) || !isinstance(p2, Point)) {\n throw new Error(`TypeError: Rect expected Points`)\n }\n super({\n t: Math.min(p1.y, p2.y),\n l: Math.min(p1.x, p2.x),\n b: Math.max(p1.y, p2.y),\n r: Math.max(p1.x, p2.x),\n })\n return\n }\n if (arg.length === 4) {\n if (arg[0] > arg[2] || arg[1] > arg[3]) {\n throw new Error(`TypeError:\"Rect requires: t <= b and l <= r`)\n }\n super({\n t: arg[0],\n l: arg[1],\n b: arg[2],\n r: arg[3],\n })\n return\n }\n throw new Error(`TypeError:\n \"Unexpected arguments to Rect. Takes 1 or 2 Points, or 4 coords.`)\n }", "title": "" }, { "docid": "fcb05481ea365765bf20ffd0198f3bb0", "score": "0.623473", "text": "function Rect(x2,y2,w,h) {\r\n ctx.beginPath();\r\n ctx.rect(x2,y2,w,h);\r\n ctx.closePath();\r\n ctx.fillStyle = \"red\";\r\n ctx.fill();\r\n}", "title": "" }, { "docid": "75003ca0b787a209adabb63a9dcc2d68", "score": "0.6223174", "text": "copy() {\r\n return new Rect(this.width, this.height);\r\n }", "title": "" }, { "docid": "c8cc81f0b4c289cb7267738f0f03db6a", "score": "0.6199251", "text": "function Rectangle2D(settings) {\n var _this = this;\n // Avoid checking every time if the object exists\n if (settings == null) {\n settings = {};\n }\n _this = _super.call(this, settings) || this;\n if (settings.size != null) {\n _this.size = settings.size;\n }\n else if (settings.width || settings.height) {\n var size = new BABYLON.Size(settings.width, settings.height);\n _this.size = size;\n }\n //let size = settings.size || (new Size((settings.width === null) ? null : (settings.width || 10), (settings.height === null) ? null : (settings.height || 10)));\n var roundRadius = (settings.roundRadius == null) ? 0 : settings.roundRadius;\n var borderThickness = (settings.borderThickness == null) ? 1 : settings.borderThickness;\n //this.size = size;\n _this.roundRadius = roundRadius;\n _this.borderThickness = borderThickness;\n return _this;\n }", "title": "" }, { "docid": "f6f5026598986e29d79eb3e6a0c800e3", "score": "0.6195128", "text": "function areaRect(w,h) {\n var area=w*h\n return area;\n}", "title": "" }, { "docid": "88b4aaf728805bf7f9163314fb2c9f6f", "score": "0.617488", "text": "function Rectangles(a, b){\n this.a = a;\n this.b = b;\n}", "title": "" }, { "docid": "b07ffdaf6dafee935aa8df9f61aa78f1", "score": "0.61702055", "text": "constructor(x,y,width,height){\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }", "title": "" }, { "docid": "7f7270d20b99df856d5c426686be486a", "score": "0.61678714", "text": "constructor (x, y) {\n this.x = x;\n this.y = y;\n this.height = 70;\n this.width = 80;\n }", "title": "" }, { "docid": "bad68f285463191a9a2bf7867251d25f", "score": "0.61670494", "text": "function box(top_left, width, height) {\n return {x: top_left.x, y: top_left.y, width, height}\n}", "title": "" }, { "docid": "27c392e0b85b0010642ffc1211754b79", "score": "0.61627966", "text": "get innerRect() {\r\n return new Rectangle(\r\n this._padding,\r\n this._padding,\r\n this.innerWidth,\r\n this.innerHeight\r\n );\r\n }", "title": "" }, { "docid": "728a50a7612191c459d68314d5df4144", "score": "0.61555153", "text": "function drawRect(parentNode, width, height, borderRadius, color) {\r\n const rect = svgCreate('rect');\r\n\r\n svgAttr(rect, {\r\n width: width,\r\n height: height,\r\n rx: borderRadius,\r\n ry: borderRadius,\r\n stroke: color,\r\n strokeWidth: 2,\r\n fill: color\r\n });\r\n\r\n svgAppend(parentNode, rect);\r\n\r\n return rect;\r\n}", "title": "" }, { "docid": "d1db6d69f80ea84f451ea4b3390a4071", "score": "0.61347026", "text": "function Rectangles(a, b) {\n this.a = a;\n this.b = b;\n}", "title": "" }, { "docid": "936992f6e2c4331a2d2d1c6b108a0732", "score": "0.6133264", "text": "function ARERectangleActor(renderer, width, height) {\n var uvs, verts;\n this.width = width;\n this.height = height;\n param.required(width);\n param.required(height);\n if (width <= 0) {\n throw new Error(\"Invalid width: \" + width);\n }\n if (height <= 0) {\n throw new Error(\"Invalid height: \" + height);\n }\n verts = this.generateVertices();\n uvs = this.generateUVs();\n ARERectangleActor.__super__.constructor.call(this, renderer, verts, uvs);\n }", "title": "" }, { "docid": "712abc8261d91b142bfcdd0fdc59180d", "score": "0.6118372", "text": "constructor(width, height) {\n this.setDimensions(width, height);\n }", "title": "" }, { "docid": "b383da70e1dd539613d7f49c05db0c35", "score": "0.61092645", "text": "rect(x, y, width, height, color) {\n if (this.shader.sampler2d != null)\n this.setShaderTexture(this._pixel);\n const uv = this._pixelUVs;\n this.push(x, y, uv[0].x, uv[0].y, color);\n this.pushUnsafe(x + width, y, uv[1].x, uv[1].y, color);\n this.pushUnsafe(x + width, y + height, uv[2].x, uv[2].y, color);\n this.pushUnsafe(x, y, uv[0].x, uv[0].y, color);\n this.pushUnsafe(x, y + height, uv[3].x, uv[3].y, color);\n this.pushUnsafe(x + width, y + height, uv[2].x, uv[2].y, color);\n }", "title": "" }, { "docid": "68d817a48ffdea71ce333f213fa4abe6", "score": "0.6105604", "text": "function rectangleArea(width, height) {\n let area = width * height \n return area;\n }", "title": "" }, { "docid": "b4a48c415fa4b24ce9d965d8cfe0c939", "score": "0.61044526", "text": "function createRect(leftX,topY,width,height,color){\r\n\tcanvasContext.fillStyle=color;\r\n\tcanvasContext.fillRect(leftX,topY,width,height);\t\t\r\n}", "title": "" }, { "docid": "d28599203d3e2d4e44c0293ed7b2f76d", "score": "0.6075816", "text": "function Rectangle(a, b) {\n this.length = a;\n this.width = b;\n this.perimeter = 2 * (a + b);\n this.area = a * b;\n}", "title": "" }, { "docid": "89c9c280cb8cf22ff755326f91378315", "score": "0.6061019", "text": "function addRect(x, y, w, h, img) {\r\n\t\tvar rect = new Box2;\r\n\t\trect.x = x;\r\n\t\trect.y = y;\r\n\t\trect.w = w\r\n\t\trect.h = h;\r\n\t\trect.img = img;\r\n\t\t//rect.fill = fill;\r\n\t\tboxes2.push(rect);\r\n\t\tinvalidate();\r\n\t}", "title": "" }, { "docid": "93d65a2eebbf97ca8a6ce860062de027", "score": "0.6057952", "text": "get rect() { return new Rectangle(0, 0, this.width, this.height); }", "title": "" }, { "docid": "2eecb9daff918e2fc2dbeb679ccdced5", "score": "0.6038541", "text": "function drawRectangleTraditional(x, y, height, width) {\n console.log('X ', x);\n console.log('Y ', x);\n console.log('Height ', height);\n console.log('Width ', width);\n}", "title": "" } ]
f8f71141b3e2b11fa4503cbd1b76507a
Stream of clicks outside of the autocomplete panel.
[ { "docid": "48b26b61122241aacfc1b17e4659a771", "score": "0.53810847", "text": "_getOutsideClickStream() {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"merge\"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"fromEvent\"])(this._document, 'click'), Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"fromEvent\"])(this._document, 'touchend'))\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_14__[\"filter\"])(event => {\n // If we're in the Shadow DOM, the event target will be the shadow root, so we have to\n // fall back to check the first element in the path of the click event.\n const clickTarget = (this._isInsideShadowRoot && event.composedPath ? event.composedPath()[0] :\n event.target);\n const formField = this._formField ? this._formField._elementRef.nativeElement : null;\n const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;\n return this._overlayAttached && clickTarget !== this._element.nativeElement &&\n (!formField || !formField.contains(clickTarget)) &&\n (!customOrigin || !customOrigin.contains(clickTarget)) &&\n (!!this._overlayRef && !this._overlayRef.overlayElement.contains(clickTarget));\n }));\n }", "title": "" } ]
[ { "docid": "e582c81939b8f44ef4a083fc212747b6", "score": "0.57712924", "text": "function bind(){ /*[1]*/\n\t\tclearClickOffs();\n\t\t$('html').click(function(event) {\n\t\t\tfor (var clickIndex=0; clickIndex < s.clickOffs.length; clickIndex++){ /*[2]*/\n\t\t\t\tif (!$(event.target).closest(s.clickOffs[clickIndex].elements).length){\n\t\t\t\t\ts.clickOffs[clickIndex].action();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "eaf29f3c8f6c300fe0b9eda6edec4ce7", "score": "0.57642096", "text": "function clickoutHandlerForDropdown(event) {\n mousedownOn = null;\n scope.hideResults(event);\n document.body.removeEventListener('click', clickoutHandlerForDropdown);\n }", "title": "" }, { "docid": "2aa11557ff5e2674f8e967a3747e0c3c", "score": "0.5756173", "text": "function suggestionsVisibilityControl() {\n $(document).on('click', function (e) {\n\n var isVisible = $searchSuggestions.is(':visible');\n var hasClass = $(e.target).hasClass('search__suggestions') || $(e.target).hasClass('search__suggestions__item');\n\n if (!hasClass && isVisible)\n $searchSuggestions.slideUp();\n });\n }", "title": "" }, { "docid": "c1bd0e25daa45595287ada3b2a24f0fd", "score": "0.5711755", "text": "'click .-autocomplete-item, click [data-autocomplete]'(e, t) {\n\t\tt.data.onItemClick(this, e);\n\t}", "title": "" }, { "docid": "df1ca5a9724749ffd5ec6aed1ce395ca", "score": "0.56798804", "text": "handleClickOutside() {}", "title": "" }, { "docid": "6dceb6c3c696e89f138ad012d950a910", "score": "0.56766176", "text": "ClickOutsideHandler() {\n this.data = [this.content.data.items];\n this.path = [null];\n this.isActive = false;\n this.onPopupVisibleChange && this.onPopupVisibleChange(this.result);\n }", "title": "" }, { "docid": "7546a19cdd204732f91be11838d17c07", "score": "0.56666833", "text": "getOutsideClickStream() {\n return merge(\n // tslint:disable-next-line: no-unnecessary-type-assertion\n fromEvent(this.document, 'click'), \n // tslint:disable-next-line: no-unnecessary-type-assertion\n fromEvent(this.document, 'touchend'))\n .pipe(filter((event) => {\n const clickTarget = event.target;\n const formField = this.formField ? this.formField._elementRef.nativeElement : null;\n const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;\n return this.overlayAttached &&\n clickTarget !== this.elementRef.nativeElement &&\n (!formField || !formField.contains(clickTarget)) &&\n (!customOrigin || !customOrigin.contains(clickTarget)) &&\n (!!this.overlayRef && !this.overlayRef.overlayElement.contains(clickTarget));\n }));\n }", "title": "" }, { "docid": "726b250efa343e329633f02cb442a044", "score": "0.5661368", "text": "function onOutputMouseUp(e) {\n\t\tif (e.target.nodeName == \"INPUT\" || e.target.nodeName == \"textarea\") return;\n\t\tsa.hideInfoBox();\n\t\t//hideMenu();\n\n\t\tif (sa.readonlycomment) {\n\t\t\tvar seenbutton = false;\n\t\t\tvar seencomment = false;\n\t\t\tfor (var i=0; i<e.path.length; ++i) {\n\t\t\t\tif (e.path[i].nodeName == \"BUTTON\" || e.path[i].nodeName == \"A\") seenbutton = true;\n\n\t\t\t\tif (e.path[i].classList && e.path[i].classList.contains(\"eden-comment-line\")) {\n\t\t\t\t\tseencomment = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($(e.target).find(\".eden-comment-line\").length > 0 || seencomment) {\n\t\t\t\tif (!seenbutton) e.preventDefault();\n\t\t\t\tsa.intextarea.blur();\n\t\t\t\tsa.outdiv.blur();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (sa.readonly || e.target.isContentEditable == false) return;\n\n\t\tif (sa.gotomode) {\n\t\t\tvar element = e.target;\n\t\t\tif (element.className == \"\" && element.parentNode.nodeName == \"SPAN\") {\n\t\t\t\telement = element.parentNode;\n\t\t\t}\n\t\t\tif (element.className == \"eden-selector\" || element.className == \"eden-selector2\") {\n\t\t\t\tsa.disableGotoMode();\n\t\t\t\tvar path = element.parentNode.textContent;\n\t\t\t\tEden.Selectors.goto(path);\n\t\t\t\t// TODO Use global goto.\n\t\t\t\t/*var tabs = tabsSym.value();\n\t\t\t\ttabs.push(path);\n\t\t\t\ttabsSym.assign(tabs, eden.root.scope, Symbol.localJSAgent);*/\n\t\t\t} else if (element.className == \"eden-observable\") {\n\t\t\t\tvar obs = element.getAttribute(\"data-observable\");\n\t\t\t\tEden.Selectors.goto(obs+\":active\");\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t} else {\n\t\t\t// To prevent false cursor movement when dragging numbers...\n\t\t\tif (document.activeElement === sa.outdiv) {\n\t\t\t\tvar end = getCaretCharacterOffsetWithin(sa.outdiv);\n\t\t\t\tvar start = getStartCaretCharacterOffsetWithin(sa.outdiv);\n\t\t\t\tif (start != end) {\n\t\t\t\t\t// Fix to overcome current line highlight bug on mouse select.\n\t\t\t\t\tsa.refreshentire = true;\n\t\t\t\t} else {\n\t\t\t\t\t// Move caret to clicked location\n\t\t\t\t\tsa.intextarea.focus();\n\t\t\t\t\tsa.intextarea.selectionEnd = end;\n\t\t\t\t\tsa.intextarea.selectionStart = end;\n\t\t\t\t\tvar curline = sa.currentlineno;\n\t\t\t\t\t//gutter.selectLine(curline);\n\t\t\t\t\t//if (sa.fragment) {\t\t\n\t\t\t\t\t\tsa.updateLineCachedHighlight();\n\t\t\t\t\t//}\n\t\t\t\t\t//checkScroll();\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9b4bf48d5e07fa6bccb7df17a3464d1b", "score": "0.5657325", "text": "removeClickAwayEvent() {\n external_jquery__WEBPACK_IMPORTED_MODULE_6___default()('main').off('click.atkPanel');\n external_jquery__WEBPACK_IMPORTED_MODULE_6___default()(document).off('keyup.atkPanel');\n }", "title": "" }, { "docid": "4509398409b2f6104f7ba96613d87350", "score": "0.55884594", "text": "clickedOutside(event) {\n if (!this.hasFocus && this.whiteList.indexOf(event.target) < 0) {\n if (this.keepFirst && this.hovered && this.selectOnClickOutside) {\n this.setSelected(this.hovered, true);\n } else {\n this.isActive = false;\n }\n }\n }", "title": "" }, { "docid": "b18b1022c1ef261044c3d15e12f18b9d", "score": "0.5533348", "text": "clickHandler() {\r\n this.clickFilter.emit('OTHER');\r\n }", "title": "" }, { "docid": "a0dd61ea0f8184afb4ff0beb6fe601cc", "score": "0.5527055", "text": "doubleClick() {}", "title": "" }, { "docid": "0f44c9d6e57204107fd17b1b97d421e2", "score": "0.5471515", "text": "mouseOutHandler() {\n this.getAll();\n }", "title": "" }, { "docid": "4f7cebebea24b15d63c623ff7fb98b4f", "score": "0.54470044", "text": "handleNoClick() {\n this.postUserInterest(false);\n this.clearBookSuggestion();\n this.getBookSuggestion();\n }", "title": "" }, { "docid": "444bd0c15bc98c363e7c159a145cfc0e", "score": "0.5433753", "text": "function searchIconClickHandler() {\n if (search_wrap.classList.contains('hidden')) {\n showSearch(true);\n window.scrollTo(0, 0);\n searchbar.select();\n } else {\n showSearch(false);\n }\n }", "title": "" }, { "docid": "e82338ebb93f915597c37ed749510287", "score": "0.54279655", "text": "dropDownClick(e) {\n if (!this.enabled || this.readonly) {\n return;\n }\n if (this.isClearButtonClick) {\n this.isClearButtonClick = false;\n return;\n }\n if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {\n this.removeChip(e);\n }\n if (this.isPopupOpen) {\n this.hidePopup();\n }\n else {\n this.focusIn(e);\n this.renderPopup();\n }\n this.showOverAllClear();\n }", "title": "" }, { "docid": "983859a4db5dca625768e2ceca3048b4", "score": "0.54224163", "text": "_evtMousedown(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n if (Private.nonstandardClick(event)) {\n this.reset();\n return;\n }\n let target = event.target;\n while (target !== document.documentElement) {\n // If the user has made a selection, emit its value and reset the widget.\n if (target.classList.contains(ITEM_CLASS)) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n this._selected.emit(target.getAttribute('data-value'));\n this.reset();\n return;\n }\n // If the mouse event happened anywhere else in the widget, bail.\n if (target === this.node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n return;\n }\n target = target.parentElement;\n }\n this.reset();\n }", "title": "" }, { "docid": "f6c012e23717598dd703dee07ec012b3", "score": "0.54198486", "text": "function onDocumentOutsideClick(event) {\n const clickTarget = event.target;\n const formField = _.get(this.props.__formFieldControl, 'el') || null;\n const overlay = this.getAutocomplete().getOverlay();\n\n if (\n this.state.overlayAttached\n && clickTarget !== this.getInput().EL\n && (!formField || !formField.contains(clickTarget))\n && (!!overlay && !overlay.state.pane.contains(clickTarget))\n ) {\n this.onPanelClose();\n }\n}", "title": "" }, { "docid": "09c611c5086654ae801196e994e79b6e", "score": "0.5379994", "text": "_getOutsideClickStream() {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_5__[\"merge\"])(Object(rxjs__WEBPACK_IMPORTED_MODULE_5__[\"fromEvent\"])(this._document, 'click'), Object(rxjs__WEBPACK_IMPORTED_MODULE_5__[\"fromEvent\"])(this._document, 'auxclick'), Object(rxjs__WEBPACK_IMPORTED_MODULE_5__[\"fromEvent\"])(this._document, 'touchend'))\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_14__[\"filter\"])(event => {\n // If we're in the Shadow DOM, the event target will be the shadow root, so we have to\n // fall back to check the first element in the path of the click event.\n const clickTarget = (this._isInsideShadowRoot && event.composedPath ? event.composedPath()[0] :\n event.target);\n const formField = this._formField ? this._formField._elementRef.nativeElement : null;\n const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;\n return this._overlayAttached && clickTarget !== this._element.nativeElement &&\n (!formField || !formField.contains(clickTarget)) &&\n (!customOrigin || !customOrigin.contains(clickTarget)) &&\n (!!this._overlayRef && !this._overlayRef.overlayElement.contains(clickTarget));\n }));\n }", "title": "" }, { "docid": "5fee9d7ba87b9ac03c33f8a6632eac1f", "score": "0.53674483", "text": "function handleClickOutside(event) {\r\n\t\t\t(ref.current && !ref.current.contains(event.target)) && clearOverlay(setSearchResults, setBackgroundOverlay);\r\n\t\t}", "title": "" }, { "docid": "b706dfebed4ba15456b19ee25299e50c", "score": "0.5366521", "text": "clickEvent(e) {\n if (!e.target.classList.contains('dxp-list-container')) {\n this.showSearchBoxList = false;\n }\n }", "title": "" }, { "docid": "2fe0d4fdf556754d772fe63af8436f17", "score": "0.53642225", "text": "handleClick(e) {\n if (typeof e !== \"undefined\") {\n e.preventDefault();\n e.stopPropagation();\n }\n\n if (this.lastTarget !== null) {\n this.lastTarget.style.outline = '0px';\n }\n this.lastTarget = null;\n\n angular.element(this.iframe.contents()[0].body).off('mousemove', this.mouseMoveHandler);\n angular.element(this.iframe.contents()[0].body).off('click', this.clickHandler);\n document.body.removeEventListener('keyup', this.keyUpHandler);\n }", "title": "" }, { "docid": "a47773caefe9017588d2e7fd8fc146c3", "score": "0.5358627", "text": "function inputClick() {\n globalInputClick = true\n}", "title": "" }, { "docid": "a87ccc34d5179ab195179dbba6566f3c", "score": "0.53555435", "text": "function hideSuggest(e) {\n var updatedDisplay = false;\n if (!updatedDisplay && $(e.target).closest(\".hawk-searchQuery\").length <= 0) {\n showSuggest(false);\n updatedDisplay = true;\n }\n }", "title": "" }, { "docid": "0c1d6710ba00b2cc02b1461255fd8dd1", "score": "0.5337403", "text": "function bustClick(ev) {\n // Textarea needs the mousedown event\n if (tapped && !allowQuick && !ev.isMbscTap && !(ev.target.nodeName == 'TEXTAREA' && ev.type == 'mousedown')) {\n ev.stopPropagation();\n ev.preventDefault();\n return false;\n }\n}", "title": "" }, { "docid": "7490fdc2ca610deffa0bdcdc9b6549c3", "score": "0.5330813", "text": "clickOut(event) {\n this.clearOverride();\n }", "title": "" }, { "docid": "72aec30ffa78287d65744c9dbf0aafe7", "score": "0.53234917", "text": "function CursorBrowserFilterItem() {}", "title": "" }, { "docid": "fe04bc250d63fcd75cecc02ea657ee26", "score": "0.5322146", "text": "function onInputClick(ev, el) {\n ev.stopPropagation();\n}", "title": "" }, { "docid": "105b47fb0001d31d13d55e7f6963c64b", "score": "0.5316781", "text": "function EventG_ConnectorClick(){}", "title": "" }, { "docid": "2ced65d8ceaf028a678e74f269e77f15", "score": "0.53090024", "text": "postTagClickEvent(event) {\n const filter = FILTER_INTERFACE.upsertFilter(event.target.innerHTML);\n filter.show();\n filter.toggle();\n }", "title": "" }, { "docid": "9fc8ae6b0430ad7fd939cff694298271", "score": "0.5306796", "text": "function openFriendsDrop() {\n var e = $.Event(\"keyup\", {\n keyCode: 65,\n which: 65\n });\n $(\"#feed-users-autocpl\").focus();\n $(\"#feed-users-autocpl\").attr('value', '');\n $(\"#feed-users-autocpl\").triggerHandler(e);\n}", "title": "" }, { "docid": "79f145e447796bc4d5094bd680beb339", "score": "0.5293728", "text": "function _mousePrepareClick() {}", "title": "" }, { "docid": "95afe5549a0be41881cca0300c09d1ae", "score": "0.5287066", "text": "_documentClickHandler(event) {\n const that = this;\n\n if ((that.isInShadowDOM ? event.composedPath()[0] : event.target).closest('smart-filter-builder')) {\n that._clickHandler(event);\n return;\n }\n\n if (that._editorIsOpen && !that._scrollBarDown) {\n that._closeEditor();\n }\n\n delete that._scrollBarDown;\n }", "title": "" }, { "docid": "eed24fa5030a957dc6b5de7e3856cbb1", "score": "0.52627957", "text": "handleMouseClick()\r\n\t{\r\n\t\treturn false;\t\r\n\t}", "title": "" }, { "docid": "41285dab7e7c01f9712bba82b2aae223", "score": "0.52614766", "text": "mousedown() { }", "title": "" }, { "docid": "ac2ecb10a20cf7ce0ce7ad398213de8c", "score": "0.52614206", "text": "function hideAutocomplete(fieldInstance) {\n fieldInstance.$('.autocompleteContainer').slideUp(200);\n}", "title": "" }, { "docid": "721521ccdd3f898301ed7bf62bc23282", "score": "0.52594155", "text": "_toggleClickOutside(event) {\n var excludedElement = document.querySelector(\".dvClPopUpWrapper\");\n var selectedElement = excludedElement ? excludedElement.contains(event.target) : false;\n if (!selectedElement) {\n this.closeAllPopUp();\n this.closeAllFilterPopUp();\n }\n }", "title": "" }, { "docid": "47ebae1ad3582a50b8064bf13ac5af55", "score": "0.5243084", "text": "function clacked(e){\r\n\t\te.preventDefault();\r\n\t\tif(filter.style.display==\"none\"){\r\n\t\t\tfilter.style.display=\"block\"\r\n\t\t\tif(search.style.display==\"none\")search.style.display=\"block\";\r\n\t\t\tsearchLink.addEventListener(\"click\",clacked,false);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tfilter.style.display=\"none\";\r\n\t\t\tsearchLink.removeEventListener(\"click\",clacked,false);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6cb114e7d2729e13fb4302fc7b29013f", "score": "0.5239321", "text": "uiEvtMouseOutPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "dff136c0b4151b3a799d7c90d8d147d3", "score": "0.5233984", "text": "function handleSearchClick() {\n closeKeyboard();\n handlePostalCodeReturn();\n}", "title": "" }, { "docid": "37e1ac86c19cf7b6542979be8092a9e7", "score": "0.52323806", "text": "function beforeClick(){}", "title": "" }, { "docid": "202a0de420e66225d01b300710e64381", "score": "0.5230374", "text": "uiEvtMouseInPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "202a0de420e66225d01b300710e64381", "score": "0.5230374", "text": "uiEvtMouseInPerformed() {\r\n return false;\r\n }", "title": "" }, { "docid": "1b6ac25b9b1102f895c434a81dec08cd", "score": "0.5224826", "text": "function DidUnlockCursor () {\n\tDebug.Log(\"Unlocking cursor\");\n\n\t// Show the button again\n\t//gt.enabled = true;\n}", "title": "" }, { "docid": "e389dc6a20a5977267ee6c86b80307ba", "score": "0.5221092", "text": "filterClickEvent(event) {\n const id = event.target.getAttribute('id');\n FILTER_INTERFACE.getFilter(id).toggle();\n }", "title": "" }, { "docid": "ecbf45d5fc180565a62604d9b5f7d38f", "score": "0.52165985", "text": "function closeTypeaheadPopup() {\n if (!typeaheadModel.inputElement || !typeaheadModel.inputElement.length || !isTypeaheadPopupOpen()) {\n return;\n } \n\n // Look away now !\n // Send an escape char which will cause the popup to close \n const keydownEvent = jQuery.Event(\"keydown\"); \n keydownEvent.which = 27; // Escape\n typeaheadModel.inputElement.trigger(keydownEvent);\n }", "title": "" }, { "docid": "33507d6a93e1eb71427ac935714f1cb7", "score": "0.5213768", "text": "onClick(){\n haveInteractWheel = false;\n descriptionRemove();\n goToMenu(this.destinationRoom);\n }", "title": "" }, { "docid": "28fefb5f8b7671ea67dec98695decfe2", "score": "0.52038306", "text": "function _handleClick()\n {\n\t const menu = document.getElementById(\"menu\");\n\t const _footer = document.getElementById(\"_footer\");\n const search_zone = document.getElementById(\"search_zone\");\n\tmenu.addEventListener(\"click\", (e) =>\n\t {\n _selectClick(e);\n\t },{passive:true, capture:false});\n\n search_zone.addEventListener(\"click\", (e)=>\n {\n _selectClick(e);\n },{passive:true, capture:false});\n\n\t_footer.addEventListener(\"click\", (e) =>\n\t {\n _selectClick(e);\n\t },{passive:true, capture:false});\n\n\t function _selectClick(event)\n {\n\t event.target !== event.currentTarget;\n\t\tlet targetId = event.target.id;\n\t\tlet execPopUp;\n\t\tif(targetId === \"depotAnnonce\")\n\t\t {\n\t\t\t execPopUp = new PopUpAnnonce();\n\t\t }\n else if(targetId === \"search_simple\")\n {\n const name = document.getElementById(\"search_by_name\").value;\n const category = document.getElementById(\"search_by_category\").value;\n const city = document.getElementById(\"search_by_city\").value;\n\n let data_to_search = name||category||city;\n var search_by = \"\";\n if(name.value !== \"\"){\n search_by = \"search_by_name\";\n }else if(category.value !== \"\"){\n search_by = \"search_by_category\";\n }else if(city.value !== \"\"){\n search_by = \"search_by_city\";\n }\n var formDataToSend = {\n requestName:btoa(btoa(btoa(search_by))),\n data:{\n lastId:0,\n name:data_to_search,\n category:data_to_search,\n city:data_to_search\n }\n }; \n ajaxGetAnnonce(formDataToSend,\"adjacentHtml\"); \n }\n }\n }", "title": "" }, { "docid": "e59e7abf0b3ef34d28a047906a454f4e", "score": "0.51981324", "text": "function handleClickOutside(event) {\n if ( \n event.target.className != '' && ( \n event.target.className.indexOf( 'uix-cascading-dropdown-list__trigger' ) < 0 && \n event.target.className.indexOf( 'uix-cascading-dropdown-list__items' ) < 0 && \n event.target.className.indexOf( 'uix-cascading-dropdown-list__opt' ) < 0\n )\n ) {\n \n $control.data({\n 'isShow': false\n });\n\n }\n }", "title": "" }, { "docid": "4ef0d153b83b21d3b50fd9d42e9f9eb7", "score": "0.51981044", "text": "function openActivitiesDrop() {\n var e = $.Event(\"keyup\", { keyCode: 65, which: 65 });\n $(\"#activities-autocpl\").focus();\n $(\"#activities-autocpl\").attr('value', '');\n $(\"#activities-autocpl\").triggerHandler(e);\n }", "title": "" }, { "docid": "7f9556587ee73dbd4d0b9d41bc91c122", "score": "0.5195779", "text": "clickSearchBox(event) {\n if (!this.isSearching()) {\n this.startSearching();\n }\n }", "title": "" }, { "docid": "04288da19e023330a9d591064c29d2d6", "score": "0.5190848", "text": "function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n setSelectorVisible(false);\n }\n }", "title": "" }, { "docid": "d9b379a5c533ac034a363c1abc7ea072", "score": "0.5187388", "text": "function onKeyClick(word) {\n onFilter(word);\n}", "title": "" }, { "docid": "0153ccf6be894b5774533a0edd378e44", "score": "0.518585", "text": "function ToolBarClickAction(props) {\n var originalSelection = props.editor.value.selection;\n var executed = false;\n\n var onMouseDown = event => {\n // Only for left button\n if (event.buttons !== 1) {\n return;\n }\n\n executed = true;\n event.preventDefault();\n event.stopPropagation(); // This is a workaround to prevent other mousehandlers to pick up this action\n // To illustrate the problem, try to remove the timeout and try to create an annotation\n // This event will then trigg the CaptureOutsideClicks handler for the popover.\n // Not sure why this happens exactly when the event is set to preventDefault og stopPropagation\n // TODO: maybe find a more elegant solution\n\n setTimeout(() => {\n props.onAction(originalSelection);\n }, 300);\n }; // Fallback for button click events with keyboard\n\n\n var onClick = event => {\n if (executed) {\n return;\n }\n\n props.onAction(originalSelection);\n };\n\n return _react.default.createElement(\"span\", {\n onMouseDown: onMouseDown,\n onClick: onClick,\n style: {\n display: 'contents'\n }\n }, props.children);\n}", "title": "" }, { "docid": "5eaa4b0c7bc6bce031536941b8db7d54", "score": "0.51849294", "text": "function preventUserInput() {\n\tisClickDisabled = true;\n}", "title": "" }, { "docid": "59138713556b85a079c19ceba0be2a58", "score": "0.517911", "text": "click()\n\t{\n\t\tgoogle.maps.event.addListener(this.map, \"click\", (event) => {\n\t\t\tgoogle.maps.event.clearListeners(this.map, \"idle\")\n\t\t\tgoogle.maps.event.clearListeners(this.map, \"click\")\n\t\t\tgoogle.maps.event.clearListeners(this.map, \"dragend\")\n\t\t\tfor (let i = 0; i < restObj.markers.length; i++) {\n\t\t\t\tgoogle.maps.event.clearListeners(restObj.markers[i], \"click\")\n\t\t\t}\n\t\t\tif ($(\"#searchBtn\").is(\":visible\")) {\n\t\t\t\t$(\"#searchBtn\").fadeOut(500)\n\t\t\t}\n\t\t\t$(\"#filter\").attr(\"disabled\", true)\n\t\t\tthis.tempMarker = new google.maps.Marker({\n \t\tposition: {lat: event.latLng.lat(), lng: event.latLng.lng()},\n \t\tmap: this.map,\n \t\tanimation: google.maps.Animation.DROP,\n \t\ticon: \"icons/custom_restaurant.png\"\n \t\t})\n\t\t\tthis.map.setCenter(this.tempMarker.position)\n\t\t\tdomObj.showRestForm()\n\t\t})\n\t}", "title": "" }, { "docid": "b10ac37b1e378917225757ea984831ba", "score": "0.5178637", "text": "_onComponentMouseUp() {\n this.internalClick = false;\n }", "title": "" }, { "docid": "dadc244ddec9d30e31a01dbfaea22ad9", "score": "0.5176353", "text": "function prevent_close(autoCompleteBox)\n{\n\tautoCompleteBox.classList.add('dont_close');\n}", "title": "" }, { "docid": "ef961a473a812c9f1ad17c72781981a3", "score": "0.51717776", "text": "function on_click() {\n event = event || window.event;\n event.target = event.target || event.srcElement;\n\n let element = event.target;\n while (element) {\n if (element.nodeName === \"BUTTON\" && /searchButton/.test(element.className)) {\n login = document.getElementById(\"userInput\").value;\n getLogins(url+ '/' + login);\n\t\t break;\n }\n else if(element.nodeName === \"TEXTAREA\" && /displayUserRepoInfo/.test(element.className)){\n login = element.innerHTML;\n getLogins(url+ '/' + login);\n\t\t break;\n }\n\n element = element.parentNode;\n\t }\n\t}", "title": "" }, { "docid": "206c0efde723947486f380f26ba1eb1d", "score": "0.5168418", "text": "click() {}", "title": "" }, { "docid": "1173541ee78044fd6315189c176989ca", "score": "0.5164832", "text": "function inspectorOnClick(e) {\n e.preventDefault();\n var element = e.target;\n if ($(element).hasClass('ignore') || $(element).parents('.ignore:first').length)\n return;\n // These are the default actions (the XPath code might be a bit janky)\n // Really, these could do anything:\n $(\"#inspector-text\").val(cssPath(e.target));\n $('.inspector-select').removeClass('inspector-select');\n $(element).addClass('inspector-select');\n $('body').addClass('ignore');\n $('#inspector-note').hide();\n //console.log(cssPath(e.target));\n /* console.log( getXPath(e.target).join('/') ); */\n $('#inspector-tools').slideDown('slow');\n return false;\n }", "title": "" }, { "docid": "acc28b8e8b5cbb3640fa042db296a4fe", "score": "0.51645035", "text": "function checkClickLocation(e){\r\n\tif (spellingSuggestionsDiv) {\r\n\t\t\r\n\t\t// Bah. There's got to be a better way to deal with this, but the click\r\n\t\t// on a word to get suggestions starts up a race condition between\r\n\t\t// showing and hiding the suggestion box, so we'll ignore the first\r\n\t\t// click.\r\n\t\tif (spellingSuggestionsDiv.ignoreNextClick) {\r\n\t\t\tspellingSuggestionsDiv.ignoreNextClick = false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar theTarget = getTarget(e);\r\n\t\t\t\r\n\t\t\tif (theTarget != spellingSuggestionsDiv){\r\n\t\t\t\tspellingSuggestionsDiv.parentNode.removeChild(spellingSuggestionsDiv);\r\n\t\t\t\tspellingSuggestionsDiv = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn true; // Allow other handlers to continue.\r\n}", "title": "" }, { "docid": "7c9f152410c49629f87226d2b970c271", "score": "0.5161836", "text": "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "title": "" }, { "docid": "7c9f152410c49629f87226d2b970c271", "score": "0.5161836", "text": "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "title": "" }, { "docid": "7c9f152410c49629f87226d2b970c271", "score": "0.5161836", "text": "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "title": "" }, { "docid": "373e0351b0d4fd14d230b1acd680e0a0", "score": "0.5153262", "text": "canUnselectByClickingOutside() {\n return true\n }", "title": "" }, { "docid": "1a3bcd307d8d254007e9b50f364c7ba8", "score": "0.5145401", "text": "function disableDeselectAll() {\n self.displayArea\n .on(\"click\", null);\n }", "title": "" }, { "docid": "6dadb30d256ed73f09e1197cc5030780", "score": "0.5143559", "text": "_onTextInputClick(event) {\n event.stopPropagation()\n }", "title": "" }, { "docid": "e80742a187a96de582cea02c703d8285", "score": "0.5136607", "text": "onAutoQueryAction() {\n this.textInput.on('keyup', atk__WEBPACK_IMPORTED_MODULE_6__[\"default\"].createDebouncedFx(e => {\n const options = external_jquery__WEBPACK_IMPORTED_MODULE_5___default().extend({}, this.urlArgs, this.settings.urlOptions);\n if (e.target.value === '' || e.keyCode === 27) {\n this.doSearch(this.settings.url, null, options, () => {\n this.setButtonState(false);\n this.setFilterState(false);\n this.textInput.val('');\n });\n } else if (e.target.value !== this.$el.data('previousValue')) {\n this.doSearch(this.settings.url, e.target.value, options, () => {\n this.setButtonState(true);\n this.setFilterState(true);\n });\n }\n this.$el.data('previousValue', e.target.value);\n }, this.settings.timeOut));\n }", "title": "" }, { "docid": "b078da30364f56afec0a6d11501a9ea3", "score": "0.51291114", "text": "handleClick() {\n if (!this.parent.inputBlock) {\n this.parent.handleClick(this);\n }\n }", "title": "" }, { "docid": "ccd31a2f4032dda765095455151aece1", "score": "0.5128429", "text": "function addArrayClick() {\n\t\tuserArr.click(function(index) {\n\t\t\tuserArr.unhighlight(getHighlight(userArr))\n\t\t\tuserArr.highlight(index)\n\t\t\tav.gradeableStep()\n\t\t});\n\t}", "title": "" }, { "docid": "42fef6b5976fdd41cbb09741c08162b2", "score": "0.51232773", "text": "function handleClickOutside(event) {\n \n if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {\n setShow(false);\n }\n }", "title": "" }, { "docid": "32dcf0b2e06082b3cf751cd32b7fa0b5", "score": "0.5116641", "text": "function placeHolderFunction(){\n\t\t\tconsole.log('You clicked something');\n\t\t}", "title": "" }, { "docid": "56707d783d514c6f3218fa37871fa3e3", "score": "0.51152766", "text": "function handleClick() {\n\n }", "title": "" }, { "docid": "d34d012052888acd9cde40bb4dd27486", "score": "0.5109452", "text": "function queryHistoryItemClicked(divElement){\n // Set selected query text into Query Editor\n $('#dataBrowserQueryText').val(unescapeHTML(divElement.innerHTML));\n //Enable Execute button\n onQueryTextChange();\n // fire a click event on document to hide history panel\n $(document).click();\n \n \n \n}", "title": "" }, { "docid": "a3bd93611da8ddefdfa4ffaab2953b74", "score": "0.5106155", "text": "function not_click_search() {\r\n window.onclick = function disable() {ul.style.display = \"none\"}\r\n}", "title": "" }, { "docid": "37930adffe9fbfb7edc4ab697b5f6599", "score": "0.5103759", "text": "onAutoComplete() {\n }", "title": "" }, { "docid": "81fb298491a5dd882da0a4739674ec64", "score": "0.5096446", "text": "function bustClick(ev) {\n // Textarea needs the mousedown event\n if (tapped && !ev.tap && !(ev.target.nodeName == 'TEXTAREA' && ev.type == 'mousedown')) {\n ev.stopPropagation();\n ev.preventDefault();\n return false;\n }\n}", "title": "" }, { "docid": "b122ae32eb64b8a84980c01bad2eaf66", "score": "0.5095771", "text": "markerWindowClick(e){\n e.stopPropagation();\n }", "title": "" }, { "docid": "a9714c733a1f0526129edf2d8cbf92e7", "score": "0.50897187", "text": "function clickHandler(e){\n\n}", "title": "" }, { "docid": "be05f3a33b1092b73918a2a4ed128177", "score": "0.5088792", "text": "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "be05f3a33b1092b73918a2a4ed128177", "score": "0.5088792", "text": "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "be05f3a33b1092b73918a2a4ed128177", "score": "0.5088792", "text": "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "22e8dc8483f1aec7007c55b3f064eb07", "score": "0.50853133", "text": "handleKeyUp(e) {\n if (e.keyCode == 17) { // strg\n this.handleClick();\n this.isSelectable = false;\n }\n }", "title": "" }, { "docid": "494dbf1cdcf0b9580e76c7b072a02105", "score": "0.5083686", "text": "function searchResults() {\n weatherDisplayLockupEL.show();\n eventListContainerEL.show();\n }", "title": "" }, { "docid": "8aac44766c82245545f704a20b776724", "score": "0.50836456", "text": "function onClick( tracker, event ) {\n if ( tracker.clickHandler ) {\n $.cancelEvent( event );\n }\n }", "title": "" }, { "docid": "8aac44766c82245545f704a20b776724", "score": "0.50836456", "text": "function onClick( tracker, event ) {\n if ( tracker.clickHandler ) {\n $.cancelEvent( event );\n }\n }", "title": "" }, { "docid": "8aac44766c82245545f704a20b776724", "score": "0.50836456", "text": "function onClick( tracker, event ) {\n if ( tracker.clickHandler ) {\n $.cancelEvent( event );\n }\n }", "title": "" }, { "docid": "fde2f9dc8f549b954a56a428e69b06a4", "score": "0.5081996", "text": "function allowClick() {\n wrapperElement.style.pointerEvents = '';\n }", "title": "" }, { "docid": "b20cebaef7d7b81d9efda98aed6be1bb", "score": "0.5081299", "text": "function _searchClicked() {\n _megaMenu.collapse();\n }", "title": "" }, { "docid": "80c09478ccf9c3a8abfe5f4fbc70498e", "score": "0.5081225", "text": "get panelClosingActions() {\n return merge(this.optionSelections, this.autocomplete.keyManager.tabOut.pipe(filter(() => this.overlayAttached)), this.closeKeyEventStream, this.getOutsideClickStream(), this.overlayRef ?\n this.overlayRef.detachments().pipe(filter(() => this.overlayAttached)) :\n observableOf()).pipe(\n // Normalize the output so we return a consistent type.\n map((event) => event instanceof McOptionSelectionChange ? event : null));\n }", "title": "" }, { "docid": "d90123dc338101be67840df49d5fa1d0", "score": "0.50788534", "text": "function suggestBoxMouseOut(obj) {\n\tdocument.getElementById('pcId'+ obj).className = 'suggestions';\n}", "title": "" }, { "docid": "9e0f1a0463f379d7138faea8c715aefe", "score": "0.50705814", "text": "function emitLongPresses(el) {\n el.addEventListener('pointerdown', pointerDown);\n el.addEventListener('pointermove', pointerMove);\n el.addEventListener('pointerup', pointerUp);\n }", "title": "" }, { "docid": "33f5b259399b709092e2775ea28d3860", "score": "0.5069084", "text": "complete() {\n\t\tlet text = $( '#autocomplete' ).text();\n\t\tG.quill.insertText(G.quill.getSelection().index, text + \" \");\n\t\tthis.hide();\n\t}", "title": "" }, { "docid": "4aed3163194596e61782c1d872672d6b", "score": "0.5063305", "text": "uninstallEventsOnMeanline(meanline) {\n meanline.off(\"click\");\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.5062847", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.5062847", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.5062847", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "d4e8a03f6eb2d948ff221097756fd0b2", "score": "0.5062847", "text": "function onMouseup () {\n elements.input.focus();\n }", "title": "" }, { "docid": "35177d8e39da7a7397acf73126fe58c6", "score": "0.5062376", "text": "addClickAwayEvent(id) {\n // clicking anywhere in main tag will close panel.\n external_jquery__WEBPACK_IMPORTED_MODULE_6___default()('main').on('click.atkPanel', atk__WEBPACK_IMPORTED_MODULE_7__[\"default\"].createDebouncedFx(evt => {\n this.closePanel(id);\n }, 250));\n }", "title": "" } ]
5625c5a34240646d81da4892ed616556
Destroy the connection between the stomp client and broker
[ { "docid": "53a262598ad8af194129ebe803d68f4d", "score": "0.6318996", "text": "disconnect() {\n return new Promise((resolve, reject) => {\n if (this._stompConnection === undefined) {\n reject('Invalid connection');\n } else {\n for (const subscription in this._subscriptions) {\n if (subscription) {\n this._subscriptions[subscription].unsubscribe();\n }\n }\n this._subscriptions = {};\n this._stompConnection.disconnect(() => {\n this._stompConnection = undefined;\n resolve(true);\n }).catch((reason) => {\n reject(reason);\n });\n }\n });\n }", "title": "" } ]
[ { "docid": "c0485b78b52da26a67723eb3296b5511", "score": "0.74784726", "text": "async destroy() {\n\t\t// Clear the reconnect timer if it exists.\n\t\tif (this.reconnectTimer !== undefined) {\n\t\t\tclearInterval(this.reconnectTimer)\n\t\t\tdelete this.reconnectTimer\n\t\t}\n\n\t\t// Close the socket.\n\t\tthis.closeOscSocket()\n\t\tthis.log('debug', 'destroy')\n\t}", "title": "" }, { "docid": "6bec56e17a0b94717d718594eadb87f9", "score": "0.731127", "text": "function disconnect() {\n stompClient && stompClient.disconnect()\n }", "title": "" }, { "docid": "ce93ff032a274f6c08fae22125538e86", "score": "0.71035546", "text": "disconnect() {\r\n\t\tthis.socket.destroy();\r\n\t}", "title": "" }, { "docid": "c1a2f7434f31e9eb963a031f94b348a9", "score": "0.70849186", "text": "destroy() {\n this.subscriptions.unsubscribe();\n this.ws.disconnect();\n this.destroyed = true;\n }", "title": "" }, { "docid": "7ecbfc415b909c11d9f72a0c58404a60", "score": "0.70043373", "text": "disconnect() {\n\t\tif (this.clientSub) {\n\t\t\tthis.clientSub.disconnect();\n\t\t\tthis.clientSub = null;\n\t\t}\n\n\t\tif (this.clientPub) {\n\t\t\tthis.clientPub.disconnect();\n\t\t\tthis.clientPub = null;\n\t\t}\n\t}", "title": "" }, { "docid": "d75381cbe6ffdbdbb06a8b5ac8095be3", "score": "0.6835908", "text": "function disconnect() {\n stompClient.unsubscribe(subscription.id, {userId: userId});\n\n\n if (stompClient !== null) {\n stompClient.disconnect();\n }\n setConnected(false);\n console.log(\"Disconnected\");\n}", "title": "" }, { "docid": "4202abc64495347d83e3ce6f0a6dcb9f", "score": "0.68308365", "text": "destroy() {\n\t\tadapters.resolve(this.options.adapter).disconnect(this);\n\t\tthis.socket = null;\n\t\tfor (var channel in this.channels) {\n\t\t\tthis.channels[channel].resetBundler();\n\t\t}\n\t}", "title": "" }, { "docid": "47a4060dc29aef78001ebde02f60f64f", "score": "0.68034124", "text": "disconnect() {\n this._socket.close();\n this._socket = undefined;\n }", "title": "" }, { "docid": "ab9028eebff18396257cac50f434d202", "score": "0.68022096", "text": "destroy() {\n this.isHost = null;\n if (this.rtcConnection) {\n this.rtcConnection.destroy();\n this.rtcConnection = null;\n }\n if (this.dhcpServer) {\n this.dhcpServer.destroy();\n this.dhcpServer = null;\n }\n if (this.router) {\n this.router.destroy();\n this.router = null;\n }\n this.closeWebSocket();\n }", "title": "" }, { "docid": "27f915670c932f3614b1570f5e056dee", "score": "0.6775777", "text": "async disconnect() {\n await this.client.close();\n this.client = null;\n }", "title": "" }, { "docid": "4947f9476bb07758d24c5078a97e41b5", "score": "0.67485464", "text": "async destroy() {\n\t\tthis.socket.destroy()\n\t\tthis.socketTimer.destroy()\n\t\tthis.log('info', 'destroy', this.id)\n\t}", "title": "" }, { "docid": "806fa310cb07760c1a5bb105b4cb5651", "score": "0.67225724", "text": "async disconnect() {\n if (this.connected) {\n await this.consumeChannel.close();\n this.consumeChannel = undefined;\n\n await this.publishChannel.close();\n this.publishChannel = undefined;\n\n await this.connection.close();\n this.connection = undefined;\n\n this.connected = false;\n\n this.consumers = {};\n this.assertedQueues = {};\n\n log.info('Disconnected');\n }\n }", "title": "" }, { "docid": "ff27853760753e4738394d82221fc92c", "score": "0.67150193", "text": "static async disconnect() {\n if (transportInstance) {\n transportInstance.device.close();\n transportInstance.emit(\"disconnect\");\n transportInstance = null;\n }\n }", "title": "" }, { "docid": "2c233f91f5a29b3e1a1d252fca0a6f9f", "score": "0.667452", "text": "destroy() {\n\n\t\tif (this.heartbeatInterval !== undefined) {\n\t\t\tclearInterval(this.heartbeatInterval);\n\t\t}\n\n\t\tif (this.socket !== undefined) {\n\t\t\tthis.socket.destroy();\n\t\t}\n\n\t\tthis.debug(\"destroy\", this.id);;\n\t}", "title": "" }, { "docid": "169885a5202cf7dbade2890562d32c3c", "score": "0.6672507", "text": "stop() {\n this._tcp.destroy();\n }", "title": "" }, { "docid": "7b3291f37da5d0323c4d9468ac4cd1b3", "score": "0.6662304", "text": "destroy() {\n this.setHeartbeatTimer(-1);\n if (this.connection) this.connection.close(1000);\n this.connection = null;\n this.status = Status.DISCONNECTED;\n this.ratelimit.remaining = this.ratelimit.total;\n this.ratelimit.queue.length = 0;\n if (this.ratelimit.timer) {\n this.manager.client.clearTimeout(this.ratelimit.timer);\n this.ratelimit.timer = null;\n }\n this.sequence = -1;\n }", "title": "" }, { "docid": "4b15b77ede6047326b3ff19bec66de4b", "score": "0.6644574", "text": "disconnect() {\n\t\tif (this.connection) {\n\t\t\treturn this.broker.Promise.all(this.receivers.map(receiver => receiver.close()))\n\t\t\t\t.then(() => this.connection.close())\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.connection = null;\n\t\t\t\t\tthis.connected = false;\n\t\t\t\t\tthis.session = null;\n\t\t\t\t\tthis.receivers = [];\n\t\t\t\t})\n\t\t\t\t.catch(error => {\n\t\t\t\t\tthis.logger.error(error);\n\n\t\t\t\t\tthis.broker.broadcastLocal(\"$transporter.error\", {\n\t\t\t\t\t\terror,\n\t\t\t\t\t\tmodule: \"transporter\",\n\t\t\t\t\t\ttype: C.FAILED_DISCONNECTION\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "065d233f5104e61e28e80cc684b4b221", "score": "0.6586376", "text": "async destroy() {\n\t\tif (this.connection !== undefined) {\n\t\t\tthis.connection.removeAllListeners()\n\t\t\tthis.connection.destroy()\n\t\t\tdelete this.connection\n\t\t}\n\n\t\tif (this.projector !== undefined) {\n\t\t\tthis.projector.removeAllListeners()\n\t\t\tdelete this.projector\n\t\t}\n\n\t\tthis.log('debug', 'destroy' + this.id)\n\t}", "title": "" }, { "docid": "9382d8722fe4e9636a7262d3b7bdb7da", "score": "0.65684336", "text": "dispose() {\r\n if (this.peer) {\r\n this.peer.then(w => w.terminate());\r\n }\r\n this.peer = null;\r\n }", "title": "" }, { "docid": "a5809ff6001494baec05b3e24a9dc950", "score": "0.6564554", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy)=>subDestroy()\n );\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "6ce35db5ad215e7ada7eaf2d05bea98e", "score": "0.6558333", "text": "async destroy() {\n this.ws.close();\n this.ready = false;\n this.connectedPromise.promise = Promise.reject(new Error('The client was destroyed'));\n await this.request({ path: 'logout' });\n this[cookies] = [];\n }", "title": "" }, { "docid": "203b02f297f2c5e05026002159983832", "score": "0.6557934", "text": "function clear_connection() {\r\n connection.shutdown()\r\n }", "title": "" }, { "docid": "1cc2b214d10fa5adf7e3580c56066136", "score": "0.65526396", "text": "function cleanup(hConn,hObj) {\n mq.Close(hObj, 0, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n console.log(\"MQCLOSE successful\");\n }\n mq.Disc(hConn, function(err) {\n if (err) {\n console.log(formatErr(err));\n } else {\n console.log(\"MQDISC successful\");\n }\n });\n });\n}", "title": "" }, { "docid": "ae5d99f705d8071d9aba4741d1504eea", "score": "0.6551515", "text": "function disconnect() {\n\tif (ws) {\n\t\tws.close(1000, 'good bye!');\n\t}\n\n\tws = null;\n\trequestPromises = {};\n\tconnectionPromise = null;\n}", "title": "" }, { "docid": "b79b569ab9fa94870e8a20fbf3bdd170", "score": "0.65438515", "text": "destroy() {\n\t\tif (this.socket !== undefined) {\n\t\t\tthis.socket.destroy();\n\t\t}\n\n\t\tthis.debug(\"destroy\", this.id);;\n\t}", "title": "" }, { "docid": "a4ff769b34d04945b0abdbde3552de6b", "score": "0.6543838", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "3084a26804b809b01fd7736f352acd59", "score": "0.6537071", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "3084a26804b809b01fd7736f352acd59", "score": "0.6537071", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "303839742025337c9061682f90ab6078", "score": "0.65287805", "text": "cleanup() {\n this.player.destroy();\n this.speaking = new Speaking().freeze();\n const { ws, udp } = this.sockets;\n\n this.emit('debug', 'Connection clean up');\n\n if (ws) {\n ws.removeAllListeners('error');\n ws.removeAllListeners('ready');\n ws.removeAllListeners('sessionDescription');\n ws.removeAllListeners('speaking');\n ws.shutdown();\n }\n\n if (udp) udp.removeAllListeners('error');\n\n this.sockets.ws = null;\n this.sockets.udp = null;\n }", "title": "" }, { "docid": "0580e221ac9a900254ee997d937cb182", "score": "0.65261096", "text": "reconnectToBroker() {\n if (this.client != null) {\n this.client.close()\n }\n this.client = zmq.socket('dealer');\n this.client.identity = this.identity;\n this.client.connect(this.broker);\n if (this.verbose)\n console.log(\"I: connecting to broker at %s…\\n\", this.broker);\n }", "title": "" }, { "docid": "a444330f6c689c86836ecf3d2863da83", "score": "0.6511516", "text": "function cleanup(hConn,hObj) {\n mq.Close(hObj, 0, function(err) {\n if (err) {\n console.error(formatErr(err));\n } else {\n console.log(\"MQCLOSE successful\");\n }\n mq.Disc(hConn, function(err) {\n if (err) {\n console.error(formatErr(err));\n } else {\n console.log(\"MQDISC successful\");\n }\n });\n });\n}", "title": "" }, { "docid": "2f4797e088d6276450e727826a713992", "score": "0.6494437", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach(subDestroy => subDestroy());\n this.subs = undefined;\n }\n\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "95a171c5c7d2de0294a2b3bba9617b8d", "score": "0.6493459", "text": "destroy() {\n this.conn.removeListener(\"data\", this.ondata);\n this.conn.removeListener(\"error\", this.onerror);\n this.conn.removeListener(\"close\", this.onclose);\n // @ts-ignore\n this.decoder.removeListener(\"decoded\", this.ondecoded);\n if (this.connectTimeout) {\n clearTimeout(this.connectTimeout);\n this.connectTimeout = undefined;\n }\n }", "title": "" }, { "docid": "21dfeac64524eea90cb158f394cc9d00", "score": "0.6481643", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "21dfeac64524eea90cb158f394cc9d00", "score": "0.6481643", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "6028b8c393030afeb3751596259c5e2f", "score": "0.64620346", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "6c8b43f8ab2766d24d98db51c808b557", "score": "0.6455758", "text": "async disconnect() {}", "title": "" }, { "docid": "fb59532b84e6310103b605ff83c6db29", "score": "0.6448814", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (let i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n this.subs = null;\n }\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "093926fd41c65e975e0abbd165d233b6", "score": "0.6438244", "text": "disconnect() {}", "title": "" }, { "docid": "f147ff38cd6a0eff1f8f3e37180db33f", "score": "0.6436038", "text": "disconnect() {\n\t\t\tthis.connected = false;\n\t\t\tthis.subscriptions.forEach(({ topic, handler }) => this.bus.off(topic, handler));\n\t\t\tthis.subscriptions = [];\n\n\t\t\treturn this.broker.Promise.resolve();\n\t\t}", "title": "" }, { "docid": "e2e700cfc1d390c61db4f6479f243fe3", "score": "0.64341193", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (let i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n\n this.subs = null;\n }\n\n this.io[\"_destroy\"](this);\n }", "title": "" }, { "docid": "0d87e2142e022a9547bab2daa1603a38", "score": "0.6424139", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "0d87e2142e022a9547bab2daa1603a38", "score": "0.6424139", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "0d87e2142e022a9547bab2daa1603a38", "score": "0.6424139", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "0d87e2142e022a9547bab2daa1603a38", "score": "0.6424139", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "0d87e2142e022a9547bab2daa1603a38", "score": "0.6424139", "text": "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "29c8616630ffbc8af61a6925856fb866", "score": "0.64234245", "text": "ondisconnect() {\n this.destroy(), this.onclose(\"io server disconnect\");\n }", "title": "" }, { "docid": "f1cce1901347d89af179dd1829d1f939", "score": "0.64199096", "text": "close() {\n this.clients.forEach(client => client.server.destroy())\n this.connection.close(() => logger.info('Server closed'))\n }", "title": "" }, { "docid": "28a18dcda287fb3a62b33e165681a2b1", "score": "0.64146906", "text": "disconnect()\n\t{\n\t\tif( !! this.connection ) this.connection.close();\n\n\t\tthis.connection = null;\n\t}", "title": "" }, { "docid": "45e8056fb0f7b8e9e377de069488ec58", "score": "0.63992876", "text": "disconnect() {\n this.unsubscribe();\n this.connected = false;\n }", "title": "" }, { "docid": "ad177ddc4c33ccc931f15cefb01c6087", "score": "0.63986605", "text": "disconnect () {\n this.socket.close();\n }", "title": "" }, { "docid": "6017d6b11bbf784991e5d96735fbcd06", "score": "0.6391189", "text": "stop () {\n this.notifyChannel(`${this.nick} disconnected`)\n this.unsubscribe()\n this.connection.removeListener('message', this.clientActionHandler)\n this.connection.removeListener('close', this.stopHandler)\n this.connection.close()\n }", "title": "" }, { "docid": "863d0d75ab0f4dd49a51af4405900dda", "score": "0.6375181", "text": "disconnect() {\n this.duplex.end();\n this.duplex.destroy();\n }", "title": "" }, { "docid": "52a3a38ea80f8c017dc9b1a1bfc82be1", "score": "0.63584876", "text": "destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (let i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n this.subs = null;\n }\n this.io._destroy(this);\n }", "title": "" }, { "docid": "071a287d2c810c2de5ff7157e150fe20", "score": "0.63472396", "text": "_resetConnection() {\n if (this.request) {\n // clear our reference to the `request` instance\n this.request.removeAllListeners()\n this.request.destroy()\n }\n\n if (this.response) {\n // clear our reference to the http.IncomingMessage instance\n this.response.removeAllListeners()\n this.response.destroy()\n }\n\n if (this.parser) {\n this.parser.removeAllListeners()\n }\n\n // ensure a scheduled reconnect does not occur (if one was scheduled)\n // this can happen if we get a close event before .stop() is called\n clearTimeout(this._scheduledReconnect)\n delete this._scheduledReconnect\n\n // clear our stall abort timeout\n this._stopStallAbortTimeout()\n }", "title": "" }, { "docid": "a60d9021392af9e7a24225a0e2b5833b", "score": "0.63463724", "text": "close() {\n if (this.socket !== null) {\n this.socket.close()\n // closses the connection \n }\n this._application.remove()\n }", "title": "" }, { "docid": "875d007fa141275b23c2b115c07848ca", "score": "0.63385665", "text": "function disconnect(){\n connection.end();\n}", "title": "" }, { "docid": "04fcf6f50f0a30441e85f551df75b295", "score": "0.632073", "text": "disconnect() {\n // send disconnect command to MN to indicate that resources for this runtimeURL can be cleaned up\n // the close of the websocket will be initiated from server side\n this._sendWSMsg({\n cmd: \"disconnect\",\n body: {\n runtimeURL: this._runtimeURL\n }\n });\n this._assumeOpen = false;\n this._ws.close();\n }", "title": "" }, { "docid": "1132b03cf24f6230c6ab989db94dd7eb", "score": "0.6317749", "text": "disconnect() {\n\t\t\tthis._server = null;\n\t\t\tthis._username = null;\n\t\t\tthis._password = null;\n\n\t\t\tthis._disconnect();\n\t\t}", "title": "" }, { "docid": "665e84058078c2225089d7099503ab00", "score": "0.63054645", "text": "disconnect() {\n if (this.connection) {\n // the view\n this.core.view.store.dispatch(Action.CONNECTION.disconnect(this.connection.guid));\n // the streams\n this.connection.stream.end();\n // the property\n this.connection = undefined;\n }\n }", "title": "" }, { "docid": "73cebd0ff8974c6c62cc438650cfebd7", "score": "0.6298863", "text": "disconnect() {\n this.connector.disconnect();\n }", "title": "" }, { "docid": "77fe70dc79bec0e45a4662254f284da8", "score": "0.62890357", "text": "_cleanupConnection() {\n this.connection.onopen = this.connection.onclose = this.connection.onerror = this.connection.onmessage = null;\n }", "title": "" }, { "docid": "802733dfc3325b2db59f6aabfcafad06", "score": "0.62858385", "text": "disconnect() {\n if (this._connection && this._connected)\n this._connection.end();\n }", "title": "" }, { "docid": "cc941c2c6e5f3634ee3c553cd77fcd5c", "score": "0.62832695", "text": "stop() {\n if (this._connection) {\n this._connection.close(1000);\n }\n this._webSocketServer = null;\n }", "title": "" }, { "docid": "a3d5c99db83ff99c96bd0ff5f51751ec", "score": "0.62827986", "text": "destroy() {\n\t\tif (this.socket !== undefined) {\n\t\t\tthis.socket.destroy()\n\t\t}\n\n\t\tif (this.udp !== undefined) {\n\t\t\tthis.udp.destroy()\n\t\t}\n\n\t\tthis.debug('destroy', this.id)\n\t}", "title": "" }, { "docid": "18db17771d56916275c81ccecf225254", "score": "0.6279409", "text": "closeConnection() {\n this._client.quit();\n }", "title": "" }, { "docid": "1b523e03171ac85055f0e3477d86a1c3", "score": "0.6269174", "text": "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "title": "" }, { "docid": "1b523e03171ac85055f0e3477d86a1c3", "score": "0.6269174", "text": "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "title": "" }, { "docid": "1b523e03171ac85055f0e3477d86a1c3", "score": "0.6269174", "text": "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "title": "" }, { "docid": "1b523e03171ac85055f0e3477d86a1c3", "score": "0.6269174", "text": "_onFinish () {\n if (this.destroyed) return\n\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = () => {\n setTimeout(() => this.destroy(), 1000)\n }\n\n if (this._connected) {\n destroySoon()\n } else {\n this.once('connect', destroySoon)\n }\n }", "title": "" }, { "docid": "4aadb6495ba0ad4816a3d00c62d927ab", "score": "0.62673354", "text": "closeConnections() {\n\t\tvar firstClient = this.get('firstClient'),\n\t\t\tsecondClient = this.get('secondClient');\n\n\t\tfirstClient && firstClient.disconnect(true);\n\t\tsecondClient && secondClient.disconnect(true);\n\n\t\tthis.set({\n\t\t\tfirstClient: null,\n\t\t\tsecondClient: null\n\t\t});\n\t}", "title": "" }, { "docid": "bcc35e13216cf54c70ff7c803ba1e83e", "score": "0.62620735", "text": "close() {\n this.socket.close();\n this.socket = undefined;\n }", "title": "" }, { "docid": "1ded5ca163b6b8631d796d65382eaed7", "score": "0.62587166", "text": "async destroy() {\n\t\tif (this.udp) {\n\t\t\tthis.udp.destroy()\n\t\t\tdelete this.udp\n\t\t}\n\t}", "title": "" }, { "docid": "21bbcc595fcab0578b4e9f9484bcf65a", "score": "0.62527597", "text": "disconnect() {\n if(this.isConnected) {\n this._connected = false;\n this._clearListeners();\n this._clearQueue();\n }\n }", "title": "" }, { "docid": "11ffaa0a06beeefc3533c7ea3188c9e7", "score": "0.6250369", "text": "function onClose() {\n sshConnection = null;\n}", "title": "" }, { "docid": "30a0424b05d0fabcdd3f9d07b27bb130", "score": "0.624197", "text": "disconnect() {\n this.ws.close();\n }", "title": "" }, { "docid": "55153f4e70937703367bce0d3de26818", "score": "0.6235144", "text": "closeWebSocket() \n {\n for (var key in this.remotePeerConnection) {\n this.remotePeerConnection[key].close();\n }\n //free the remote peer connection by initializing again\n this.remotePeerConnection = [];\n this.webSocketAdaptor.close();\n }", "title": "" }, { "docid": "39a1a7bbb8ce702e2af2e886e358ba74", "score": "0.62302524", "text": "destructor() {\n\t\tObject.keys(this.clients).forEach((hash) => {\n\t\t\tthis.removeClient(hash);\n\t\t});\n\t}", "title": "" }, { "docid": "8711e939830c0ffa37acf238b326843b", "score": "0.6193732", "text": "disconnect() {\n this.socket.close();\n this.socket = null;\n this.isConnected = false;\n this.callback();\n }", "title": "" }, { "docid": "cb6bcb6aa7d14169e79f04b58bc5c02f", "score": "0.6185809", "text": "closeConnection() {\n this.udpConnection.close();\n this.tcpConnection.close();\n }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "34792e172c538618356e53b33f3b5387", "score": "0.6178826", "text": "disconnect() { }", "title": "" }, { "docid": "b7cc1ce6195661ec07ad285e52c77c66", "score": "0.6176773", "text": "disconnect() {\n\t\tthis.connection.end();\n\t}", "title": "" }, { "docid": "d80473fe17f763ed6daccb82f0bceafa", "score": "0.61643136", "text": "async stop() {\n this.commands.complete();\n this.incoming.complete();\n\n this.client.removeAllListeners('ready');\n this.client.removeAllListeners('message');\n await this.client.destroy();\n }", "title": "" }, { "docid": "e9ecc55c08cbdf63c28313ab45568725", "score": "0.6137425", "text": "_onFinish() {\n if (this.destroyed) return;\n // Wait a bit before destroying so the socket flushes.\n // TODO: is there a more reliable way to accomplish this?\n const destroySoon = ()=>{\n setTimeout(()=>this.destroy()\n , 1000);\n };\n if (this._connected) destroySoon();\n else this.once('connect', destroySoon);\n }", "title": "" }, { "docid": "15ebd96bec7a29520977131010254930", "score": "0.6137303", "text": "async close () {\n for (const url in this._subscriptions) {\n try {\n await this.unsubscribe(url)\n } catch (error) {\n this.emit('error', error)\n }\n }\n if (this._params.callbackUrl != null) {\n await this._zpListener.removeClient(this)\n }\n delete this._params.callbackUrl\n }", "title": "" }, { "docid": "fd2d8f87c8ea7e31032cdbee02e0b33c", "score": "0.61347574", "text": "destroy() {\n console.log('[PeerConnectionPipe] Closing peer connection.');\n this.caller_.close();\n this.callee_.close();\n }", "title": "" }, { "docid": "05a7169364d308dfe50665fe7ff3b914", "score": "0.6134148", "text": "disconnect() {\n this.emitter.quit();\n this.receiver.quit();\n }", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.61184454", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "e0ba1e3693aa829431b7597d221b0f1f", "score": "0.611562", "text": "function socketOnError() {\n this.destroy()\n}", "title": "" } ]
e4d90234a842330d1b41bf7d17574d45
Action creator for removing the data for a channel.
[ { "docid": "c5f61e1b91ccf08c282a3ccf0903d946", "score": "0.6731317", "text": "removeChannel ({ id, chan }) {\n return {\n id,\n type: module.exports.REMOVE_CHANNEL,\n chan\n }\n }", "title": "" } ]
[ { "docid": "2205d59a968a1f07287f1b2372ec5a61", "score": "0.6659141", "text": "removeChannel( in_channel_id ) {\n let channel = this.getChannelById(in_channel_id);\n if ( ! channel ) { throw new Error(\"Channel not found\");}\n delete this.channels[in_channel_id];\n this.log(`Removed channel ${in_channel_id}`);\n\n }", "title": "" }, { "docid": "ae8c3162c22a69b3cadfd9a5ef5fedd1", "score": "0.6620213", "text": "deleteChannel() {\n const ctx = this;\n return (uri, req) => {\n ctx.emit(NewRelicAPI.DELETE_CHANNEL, uri, req);\n return ctx.reply('');\n };\n }", "title": "" }, { "docid": "f5d224064bf7aa363fa2a605b199c49e", "score": "0.65935916", "text": "function routeDeleteChannel(req){\n\n\t// check if required data is provided\n\tif(!('userID' in req.body && 'channelID' in req.body))\n\t\treturn respondInvalidRequest();\n\n\t// check if user exists\n\tlet userID = req.body.userID;\n\tif(!(userID in users))\n\t\treturn respondError('User does not exist');\n\n\tlet user = users[userID];\n\n\t// check if user has permission\n\tif(!user.groupadmin && !user.superadmin)\n\t\treturn respondError('User does not have the necessary permission');\n\n\t\tlet channelID = req.body.channelID;\n\n\t// check if channel exists\n\tif(!(channelID in channels))\n\t\treturn respondError('Specified channel does not exist');\n\n\tlet channel = channels[channelID];\n\tlet groupID = channel.group;\n\tlet group = groups[groupID];\n\t\n\t// remove channel from group\n\tlet index = group.channels.indexOf(channelID);\n\tgroup.channels.splice(index, 1);\n\n\t// remove channel from users\n\tfor(let participantID of channel.participants){\n\t\tlet index = users[participantID].groups[groupID].indexOf(channelID);\n\t\tusers[participantID].groups[groupID].splice(index, 1);\n\t}\n\n\t// remove channel from channel and messages from messages\n\tdelete channels[channelID];\n\tdelete messages[channelID];\n\n\tsaveUserGroupChannelState();\n\tsaveMessages();\n\treturn respondData(true);\n}", "title": "" }, { "docid": "1554dfab63bcad357687b61a52959d3a", "score": "0.63847566", "text": "_remove(channel) {\n this.channels = this.channels.filter((c) => c._joinRef() !== channel._joinRef());\n }", "title": "" }, { "docid": "35d84e77ff955d13d864123dcca30068", "score": "0.63558763", "text": "channelDidRemove(channelId) {\n this.dispatch(channelId);\n }", "title": "" }, { "docid": "88c3d09a88d0232c15d775f0cf9436c4", "score": "0.62986887", "text": "function onRemovedFromChannelReceived(data) {\n let alertDiv = document.getElementById('alertContainer');\n\tlet alertDivContent = '';\n\talertDivContent = alertDivContent +\n\t\t`<div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\">\n\t\t\tYou are removed to <strong>${data.channel}</strong> successfully!\n\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n\t\t\t\t<span aria-hidden=\"true\">&times;</span>\n\t\t\t</button>\n\t\t</div>`\n alertDiv.innerHTML = alertDivContent;\n let channelDropDown = document.getElementById('channelsList');\n\tlet channelContent = '';\n\tchannelList.splice(channelList.indexOf(data.channel), 1);\n\tchannelList.map(channel => {\n\t\tchannelContent = channelContent +\n\t\t\t`<option>${channel}</option>`;\n\t});\n\tchannelDropDown.innerHTML = channelContent;\n}", "title": "" }, { "docid": "d52e505a6f8e223aaaca86e171bd0ed1", "score": "0.6289203", "text": "function removeClientFromChannel(channelId, data) {\n if (channels.has(channelId)) {\n let clientIndex = channels.get(channelId).findIndex(client => client == data.ws);\n if (clientIndex > -1) {\n channels.get(channelId).splice(clientIndex, 1);\n }\n }\n}", "title": "" }, { "docid": "41b05f3a982f4bc790082b9e497d3203", "score": "0.6213671", "text": "function DeleteGcmChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "150aa7155fe5ab57a153861245703b65", "score": "0.61042106", "text": "clear(channel) {\n if (channel) {\n this.subscriptions[channel] = {}\n }\n }", "title": "" }, { "docid": "dc082b0cd254fba468eca7cdcf308819", "score": "0.60942644", "text": "function DeleteAdmChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "56f35aa428f1e61ae71d44d6930d9fc1", "score": "0.6009628", "text": "function deleteSyncChannel() {\n $.ajax({\n url: url_to_notify_sync_channel,\n type: 'GET',\n data: {\n syncChannelName: syncChannelName,\n eventName: 'delete-sync',\n message: 'delete-sync-channel'\n },\n success: function (response) {\n },\n error: function (xhr, errmsg, err) {\n }\n }\n );\n}", "title": "" }, { "docid": "719cc86b6cbe6b34b4bdfc72144211cb", "score": "0.59958065", "text": "function DeleteApnsChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "556c2b7b8887aa032a9760892046181d", "score": "0.5972847", "text": "removeChannel(channel) {\n return __awaiter$a(this, void 0, void 0, function* () {\n const status = yield channel.unsubscribe();\n if (this.channels.length === 0) {\n this.disconnect();\n }\n return status;\n });\n }", "title": "" }, { "docid": "f15b07491c748199c3bc12ff89d04a08", "score": "0.59614605", "text": "clear(channel, eventType) {\n if (channel && eventType && this.subscriptions[channel][eventType]) {\n this.subscriptions[channel][eventType] = []\n }\n }", "title": "" }, { "docid": "27fcdb60ea76798764d2699f7aee69e2", "score": "0.59349966", "text": "function DeleteBaiduChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "95bb12347268726b2e83732f6ccd08cb", "score": "0.59335566", "text": "function detachChannelItem(chartData, itemName){\n for (var i in chartData.actions){\n var action = chartData.actions[i];\n detachChannelItemFromBar(action, itemName);\n for (var j in action.bars){\n var bar = action.bars[j];\n detachChannelItemFromBar(bar, itemName);\n }\n }\n}", "title": "" }, { "docid": "9eb1144f0b4c27147b84b20c831177d0", "score": "0.59174365", "text": "function DeleteEmailChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "9c9c6361e4e00af4ce829bb06c221a86", "score": "0.5903308", "text": "handleChannelDelete(id) {\n this.props.deleteChannel(id);\n this.deleteMemberships(id);\n \n let global = Object.values(this.props.channels)[0];\n this.props.fetchChannel(global.id);\n }", "title": "" }, { "docid": "565a4a0168c5065366775c95e3b524ee", "score": "0.5789656", "text": "async function deleteC(e) {\n switch (e) {\n case 0:\n let channela = bot.channels.get(gameData[0].split(\",\")[0])\n if (!channela) {\n await message.channel.send(\"`ERROR` Murder Game Channel not found!\")\n } else {\n await channela.delete()\n }\n break;\n case 1:\n let channelab = bot.channels.get(gameData[0].split(\",\")[2])\n if (!channelab) {\n await message.channel.send(\"`ERROR` Murderer Channel not found!\")\n } else {\n await channelab.delete()\n }\n break;\n case 2:\n let channelac = bot.channels.get(gameData[0].split(\",\")[3])\n if (!channelac) {\n await message.channel.send(\"`ERROR` Detective Channel not found!\")\n } else {\n await channelac.delete()\n }\n break;\n case 3:\n let channelad = bot.channels.get(gameData[0].split(\",\")[4])\n if (!channelad) {\n await message.channel.send(\"`ERROR` Healer Channel not found!\")\n } else {\n await channelad.delete()\n }\n break;\n case 4:\n let channelaf = bot.channels.get(gameData[0].split(\",\")[5])\n if (!channelaf) {\n await message.channel.send(\"`ERROR` Radio Channel not found!\")\n } else {\n await channelaf.delete()\n }\n break;\n case 5:\n let channelae = bot.channels.get(gameData[0].split(\",\")[1])\n if (!channelae) {\n await message.channel.send(\"`ERROR` Shop Channel not found!\")\n } else {\n await channelae.delete()\n }\n break;\n case 6:\n let channelag = bot.channels.get(gameData[0].split(\",\")[6])\n let channelage = bot.channels.get(gameData[0].split(\",\")[7])\n\n if (!channelag) {\n await message.channel.send(\"`ERROR` Jailor Channel not found!\")\n }\n if (!channelage) {\n await message.channel.send(\"`ERROR` Jail Channel not found!\")\n }\n if (channelag) {\n await channelag.delete()\n }\n if (channelage) {\n await channelage.delete()\n }\n break;\n case 7:\n let channelah = bot.channels.get(gameData[0].split(\",\")[8])\n if (!channelah) {\n await message.channel.send(\"`ERROR` Zombie Channel not found!\")\n } else {\n await channelah.delete()\n }\n break;\n\n }\n }", "title": "" }, { "docid": "9aaa16c5ef9217ebe6b656cf554e983e", "score": "0.57729", "text": "function DeleteVoiceChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "7da5e9fafdc5917a532e7317dff6928f", "score": "0.5740208", "text": "_removeWorker(id, channelsObj) {\n delete this.workers[id];\n delete this.healthyWorkers[id];\n Object.keys(channelsObj).forEach((channel) => {\n // TODO: uncomment the following code if worker is mutable\n // this.handleReply(utils.convertObjectToArray({\n // channel, error: new Error('Client is closed')\n // }));\n // return;\n this._dispatch(channel);\n });\n }", "title": "" }, { "docid": "bd14dfae26ecd2bef41254c9e365ee19", "score": "0.572413", "text": "unsubscribeToChannel( channelId) {\n let that = this;\n \n return new Promise(function(resolve, reject) {\n\n that.logger.log(\"debug\", LOG_ID + \"(unsubscribeToChannel) _entering_\");\n\n that.http.delete(\"/api/rainbow/channels/v1.0/channels/\" + channelId + \"/unsubscribe\", getRequestHeader(), null).then(function(json) {\n that.logger.log(\"info\", LOG_ID + \"(unsubscribeToChannel) successfull\");\n that.logger.log(\"info\", LOG_ID + \"(unsubscribeToChannel) REST channel unsubscribed\", json.data);\n that.logger.log(\"debug\", LOG_ID + \"(unsubscribeToChannel) _exiting_\");\n resolve(json.data);\n }).catch(function(err) {\n that.logger.log(\"error\", LOG_ID, \"(unsubscribeToChannel) error\", err);\n that.logger.log(\"debug\", LOG_ID + \"(unsubscribeToChannel) _exiting_\");\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "4b2b431462855974113daa2227acd9c5", "score": "0.5721811", "text": "function DeleteApnsVoipChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "1dba59695ea50c335d32032db43a84c3", "score": "0.56496197", "text": "function devDelete(message) {\n message.guild.channels.cache.forEach(channel => {\n const modChannels = [\"810344292286988348\", \"815749669057462322\", \"830911713204633601\", \"830938936461361152\", \"833521422068350987\"]\n if (modChannels.includes(channel.id) === false && channel.type===\"voice\"){\n channel.delete()\n }\n })\n}", "title": "" }, { "docid": "e7625471b1c852cbdbe8faf9146c0ee2", "score": "0.5611174", "text": "function DeleteSmsChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "da61cd72644e625925745ef94a71525e", "score": "0.5574487", "text": "function deleteChannel(val) {\n\t\n\tvar retVal = confirm(\"Are you sure want to delete this channel from the list ?\");\n\tif (retVal == false) {\n\t\treturn false;\n\t} \n\tvar xmlhttp;\n\tif (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\txmlhttp = new XMLHttpRequest();\n\t} else {// code for IE6, IE5\n\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\tdocument.getElementById(val).innerHTML = \"\";\n\t\t\tdocument.getElementById(val).className = \"newclass\";\n\t\t\tdocument.getElementById(\"output\").innerHTML = \"<font id='output1' style=\\\"color:green;\\\">Deleted Successfully</font>\";\n\t\t}\n\t}\n\txmlhttp\n\t\t\t.open(\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"index.php?option=com_contushdvideoshare&view=searchchannel&tmpl=component\",\n\t\t\t\t\ttrue);\n\txmlhttp.setRequestHeader('Content-Type',\n\t\t\t'application/x-www-form-urlencoded');\n\tvar delete_channel = 'delete';\n\tvar channel_id = val;\n\txmlhttp.send('delete_channel=' + delete_channel + '&channel_id='\n\t\t\t+ channel_id);\n\n}", "title": "" }, { "docid": "d351f297e265bc66484464981e95c5de", "score": "0.5536039", "text": "channelWillRemove(channelId) {\n this.dispatch(channelId);\n SocketService.removeChannel(channelId);\n }", "title": "" }, { "docid": "383a282c5316aad4e039beac3faf1cd0", "score": "0.54649377", "text": "function removeFromChannel(user)\r\n{\r\n\t//Just send the User's nickname instead of a full JSON version\r\n\t\r\n\tif(user.xcdrvesl == false)\r\n\t{\r\n\t\tthis.currentUsers--;\r\n\t}\r\n\t\r\n\tuser.currentChannelUserLevel = user.accountType;\r\n\tuser.currentChannel = \"\";\r\n\t\r\n\tuser.lastActive = Date.now();\r\n\t\r\n\tif(user.xcdrvesl == false)\r\n\t{\r\n\t\tthis.sendEvent('user left channel', user.nickname);\r\n\t\tthis.sendEvent('server message', user.nickname + ' verlaat kanaal (' + this.name + ')');\r\n\t}\r\n\t\r\n\tif(this.currentUsers == 0)\r\n\t{\r\n\t\t//channel is now empty so...\r\n\t\t\r\n\t\tif(this.staticC == 0)\r\n\t\t{\r\n\t\t\t//kill the channel\r\n\t\t\t\r\n\t\t\tfor(var chanIndex=0; chanIndex < channels.length; chanIndex++)\r\n\t\t\t{\r\n\t\t\t\tif(channels[chanIndex] != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(channels[chanIndex].name == this.name)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tchannels[chanIndex] = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texecuteSimpleQuery(\"delete from channels where name='\" + this.name + \"';\");\r\n\t\t\t\r\n\t\t\t//send new channel list to everybody\r\n\t\t\tfor\t(index = 0; index < connections.length; index++)\r\n\t\t\t{\r\n\t\t\t\tif(connections[index] != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(connections[index].user != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tconnections[index].user.sendChannelList();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsendChannelNumbersToAll();\r\n\t}\r\n}", "title": "" }, { "docid": "8cbe6bf71784fb5717081a4a43ce9ad4", "score": "0.5460815", "text": "handleMessageRemoved (data) {\n\n }", "title": "" }, { "docid": "1f0f4a8e1ea8ec5a7b54e25cadd7e115", "score": "0.54491484", "text": "function deleteOptin(msg) {\n var chanID = msg.content.split(' ')[1];\n if (chanID != undefined && dbObj.optinChannels[chanID] != undefined) {\n var name = dbObj.optinChannels[chanID].name;\n delete dbObj.optinChannels[chanID];\n beaver.createMessage(msg.channel.id, name + \" deleted.\");\n }\n else {\n beaver.createMessage(msg.channel.id, \"Error: usage `~deleteoptin [channel-id]`\");\n }\n }", "title": "" }, { "docid": "c4c6d3f64df5b486d5e0409546be1cf0", "score": "0.5444449", "text": "async function unregisterChannel (channel) {\r\n if (await isRegistered(channel)) {\r\n await asyncRun(`DELETE FROM channels WHERE channelId = ${channel.id}`);\r\n // get the last insert id\r\n console.log(`The channel ${channel.id} has been removed from the table.`);\r\n return true;\r\n } else {\r\n //already unregistered\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "99df661a04e2e1229a8f1b5402ccf04b", "score": "0.5432126", "text": "function DeleteApnsSandboxChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "e6a356917f18b03950511685629ca702", "score": "0.54085165", "text": "leaveChannel(name) {\n //\n }", "title": "" }, { "docid": "4a7a9c25150bcb277960f6236666b0ef", "score": "0.54077995", "text": "remove(data) {\n let index = this.indexOf(data);\n return this.removeAt(index);\n\n }", "title": "" }, { "docid": "172437c1f09ee144f7e2112c1d3af043", "score": "0.5407649", "text": "remove() {\n if (this.removable) {\n this.removed.emit({ chip: this });\n }\n }", "title": "" }, { "docid": "cc09f55f3e260d3cba02bc1a67da2ab6", "score": "0.53902006", "text": "handleRemoveFromGame(data){\n const payload = data.payload;\n if(payload.data && payload.data.player && this.state.player){\n if(payload.data.player.uuid === this.state.player.uuid){\n console.log(\"handle remove from game: \",payload);\n if(payload.message){\n window.alert(payload.message);\n }\n this.exitGame();\n }\n }\n }", "title": "" }, { "docid": "e0c907462917b095b42d67ea7b8fbdb4", "score": "0.5383756", "text": "function DeleteApnsVoipSandboxChannelCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "title": "" }, { "docid": "9da5d746d2256b41f879999795c52e80", "score": "0.53786033", "text": "onRemove(event, dataKey) {\n this.log.event(`onRemove`, event);\n if (this.field.facade) {\n this.onBubbleEvent('remove', { dataKey: dataKey });\n }\n else {\n this.srv.dialog.open(PopConfirmationDialogComponent, {\n width: '350px',\n data: {\n option: null,\n body: `Delete this field value?`\n }\n }).afterClosed().subscribe(option => {\n if (option && option.confirmed) {\n this.srv.field.removeEntryValue(this.core, this.field, dataKey).then((res) => {\n delete this.field.data[dataKey];\n delete this.field.items[dataKey];\n this.field.data_keys.pop();\n delete this.dom.state[dataKey];\n delete this.ui.asset[dataKey];\n delete this.dom.session[dataKey];\n this.dom.store('session');\n this.onBubbleEvent('remove', { dataKey: dataKey });\n });\n }\n });\n }\n return true;\n }", "title": "" }, { "docid": "1e3f8ac853fc8b1813f647e89d18c99a", "score": "0.53625685", "text": "unsubscribe() {\n this.unbind();\n this.socket.emit('unsubscribe', {\n channel: this.name,\n auth: this.options.auth || {},\n });\n }", "title": "" }, { "docid": "09d9efd2d296188342d12f03c2a5f2a9", "score": "0.5356151", "text": "leaveChannel(name) {\n if (this.channels[name]) {\n this.channels[name].unsubscribe();\n delete this.channels[name];\n }\n }", "title": "" }, { "docid": "09d9efd2d296188342d12f03c2a5f2a9", "score": "0.5356151", "text": "leaveChannel(name) {\n if (this.channels[name]) {\n this.channels[name].unsubscribe();\n delete this.channels[name];\n }\n }", "title": "" }, { "docid": "4b4e09140291e5fed7fd3e42937ce2b8", "score": "0.53523767", "text": "function deleteChannel(obj) {\n // adapter.log.info('deleteChannel: ' + JSON.stringify(obj));\n // search recrusive for channel name. If found and missing in\n // configuration, delete channel and all states\n Object.keys(obj).forEach((key) => {\n if (obj[key] && typeof obj[key] === 'object') {\n deleteChannel(obj[key]); // recurse.\n } else {\n if (obj[key] == 'channel') {\n var found = false;\n var channelname = obj.common.name;\n // Channel Name ist ein accountnumber\n for (var i = 0; i < adapter.config.keys.length; i++) {\n var keyc = adapter.config.keys[i];\n var idc = getAcountNumberID(keyc.accountnumber);\n if (idc == channelname) {\n found = true;\n }\n }\n if (!found) {\n adapter.deleteChannel(channelname);\n }\n }\n }\n });\n}", "title": "" }, { "docid": "8fe6881c3b4a4e5c436f89d7729d8e52", "score": "0.5343109", "text": "remove(key) {\n delete this.data[key];\n }", "title": "" }, { "docid": "2634433d355bff7915a2d6891477bdef", "score": "0.5302096", "text": "remove({ guids, stack, owner }) {\n\t\treturn this.$publish('remove', { guids, stack, owner });\n\t}", "title": "" }, { "docid": "7f9063909a47034992229a3f40e636f8", "score": "0.5291384", "text": "async function filterRemoveCategory (m, data, callback) {\n // Select filter category here\n const input = m.content\n const { profile } = data\n const locale = profile ? profile.locale : undefined\n const translator = new Translator(locale)\n const translate = translator.translate.bind(translator)\n let chosenFilterType = ''\n\n if (input.startsWith('raw:') || input.startsWith('other:')) {\n chosenFilterType = input\n } else {\n chosenFilterType = filterTypes.find(type => type.use === input.toLowerCase())\n if (chosenFilterType) {\n chosenFilterType = chosenFilterType.use\n }\n }\n\n if (!chosenFilterType) {\n throw new MenuUtils.MenuOptionError(translate('commands.utils.filters.invalidCategory'))\n }\n // else if (typeof filterList[chosenFilterType] === 'string') {\n // await m.channel.send(translate('commands.utils.filters.regexExists', { category: chosenFilterType }))\n // return { __end: true }\n // }\n\n return {\n ...data,\n chosenFilterType,\n next: {\n text: translate('commands.utils.filters.removeFilterConfirm', { category: chosenFilterType }),\n embed: null\n }\n }\n}", "title": "" }, { "docid": "6706cb8c8666917d7de340f554c461ad", "score": "0.5255154", "text": "function deleteUserFromChannel() {\n database.collection(\"channels\").find({}).toArray(function(err, result) {\n if (err) { return console.log(err) }\n result.forEach(element => {\n removeUserFromChannel(element);\n });\n });\n function removeUserFromChannel(channel) {\n let new_users = channel.users.filter(x => x != user_name)\n console.log(\"removeUserFromChannel\");\n console.log(new_users);\n database.collection(\"channels\").updateOne({ name: channel.name }, { $set: {users: new_users} }, function(err, result) {\n if (err) { return console.log(err) }\n });\n }\n }", "title": "" }, { "docid": "292bc05b3b874483469c5a29299adafc", "score": "0.52533776", "text": "remove() {\n return delete self.subscribers[event]\n }", "title": "" }, { "docid": "9b525775660744f0006afd705a8660b6", "score": "0.5246329", "text": "function handleKick(slack, msg) {\n var matches = msg.text.match(/^You have been removed from the group (\\S+) by/)\n || msg.text.match(/^You have been removed from #(\\S+) by/)\n if (!matches) {\n console.error(\"Could not match \", msg)\n return\n }\n var name = matches[1]\n slack.channels = slack.channels.filter(function (chan) {\n return chan.name !== name\n })\n}", "title": "" }, { "docid": "380eef2aa94a58ed39d01a1746ba1da1", "score": "0.5238237", "text": "delete() {\n\t\trequest(ARTICLES_MUTATION.Remove(this.props.id)).then(response => {\n\t\t\tthis.props.fetchArticles();\n\t\t});\n\t}", "title": "" }, { "docid": "78d99a0714ee0af260d3fc58d72d9c8e", "score": "0.5234921", "text": "removeTileData(tileGrid) {\n this.tileDataAction(tileGrid, (x, y) => delete tileGrid[x+','+y]);\n return this;\n }", "title": "" }, { "docid": "927cd2e4c2bb10b4b2e6f4dc55e41b0a", "score": "0.52095485", "text": "_removeBySignalChannel(channel) {\n // XXX inefficient linear scan\n for (const peerAddressState of this._store.values()) {\n if (peerAddressState.peerAddress.protocol === Protocol.RTC) {\n peerAddressState.deleteRoute(channel);\n if (!peerAddressState.hasRoute()) {\n this._remove(peerAddressState.peerAddress);\n }\n }\n }\n }", "title": "" }, { "docid": "67b1fb1b175b28d34fd7082670ac2bd6", "score": "0.5199337", "text": "function removeDom(channel) {\n // console.log('remove dom', channel)\n var el = document.getElementById(channel.domain + channel.id)\n el.remove()\n if (bg.myChannel.channels.length === 0) {\n var template = document.getElementsByClassName('channel_template')[0]\n template.classList.remove('none')\n }\n }", "title": "" }, { "docid": "32aca749e1024937979517e44f1f0ca4", "score": "0.5192183", "text": "async requestDeath(channelID) {\n if (channelID in this.games) {\n delete this.games[channelID];\n }\n }", "title": "" }, { "docid": "3c40d5d818a92ae4610ac04e9e02c496", "score": "0.5191802", "text": "function unsubscribe(channel, conn) {\n if (conn.readyState == 1) {\n conn.send(JSON.stringify({command: WS_COMMAND.unsubscribe,\n channel: channel}));\n\n if ('subscriptions' in conn)\n delete conn.subscriptions[channel];\n }\n}", "title": "" }, { "docid": "604aa4f1bc16a3eeeab667e8cc787764", "score": "0.51890993", "text": "leave(channel) {\n this.connector.leave(channel);\n }", "title": "" }, { "docid": "2ce213172667668c4194218965733cbf", "score": "0.518265", "text": "onWebsocketUnsubscribe(type, name) {\n const { onUnsubscribe } = this.props;\n const channels = this.websocket.channels();\n const { attributes: { error } } = packet;\n return onUnsubscribe({ type, name, error, channels });\n }", "title": "" }, { "docid": "b7b3eece3f5e035d684448b92995b8e6", "score": "0.51823866", "text": "leaveChannel(channel) {\n this.connector.leaveChannel(channel);\n }", "title": "" }, { "docid": "2a2a79b2cc9b26584591f69971bfa485", "score": "0.5160902", "text": "destroy(topic) {\n const subject = this.channels[topic];\n if (!subject) {\n return;\n }\n subject.complete();\n delete this.channels[topic];\n }", "title": "" }, { "docid": "2a2a79b2cc9b26584591f69971bfa485", "score": "0.5160902", "text": "destroy(topic) {\n const subject = this.channels[topic];\n if (!subject) {\n return;\n }\n subject.complete();\n delete this.channels[topic];\n }", "title": "" }, { "docid": "f957b59f0f11a5c634a149d27b2e3486", "score": "0.5144928", "text": "function removeCraftbyIndex(i) {\r\n\t\r\n\t// code below requires server call\r\n\tallCrafts[i].author.crafts.splice(allCrafts[i].index,1)\r\n\tallCrafts[i].author.totalCrafts--\r\n\tfor(j=i;j<allCrafts[i].author.crafts.length;j++){\r\n\t\tallCrafts[i].author.crafts[j].index--;\r\n\t}\r\n\tallCrafts.splice(i, 1);\r\n\tconsole.log('removed craft')\r\n\r\n}", "title": "" }, { "docid": "300c092a5e417adb172285e8097e03af", "score": "0.5141273", "text": "remove(index){\r\n this.contacts[this.chatActive].messages.splice(index, 1 );\r\n }", "title": "" }, { "docid": "c46db3416b7398c9034d3b0985b2f86d", "score": "0.5140533", "text": "async function clear() {\n const fetched = await channel.fetchMessages({ limit: 99 });\n channel.bulkDelete(fetched);\n }", "title": "" }, { "docid": "b76d9838887e693381614c38a35a8005", "score": "0.5133984", "text": "removeReaction({ params }, res) {\n Thought.findOneAndUpdate(\n { _id: params.thoughtId },\n { $pull: { reactions: { reactionId: params.reactionId } } },\n { new: true }\n )\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "1a29f2ff79af8f9a53fe0a7d69c49da6", "score": "0.5132776", "text": "removeUser(username) {\n const usernameIndex = this.findUsernameIndex(username);\n const channelIndex = this.findChannelIndex(username);\n\n // if username was found remove it from the list\n if (usernameIndex >= 0) {\n this.usernameList.splice(usernameIndex, 1);\n }\n\n // if channel with given username is found remove it from the list\n if (channelIndex >= 0) {\n this.channelList.splice(channelIndex, 1);\n }\n }", "title": "" }, { "docid": "72860a15fdb852e30bae4f07f44d0ff6", "score": "0.5131923", "text": "function emit_delete(event) {\n\n // Selected button\n const element = event.target;\n\n // Emit delete message event\n socket.emit('delete message', {\n 'channel': channel_name,\n 'message_id': element.parentElement.dataset.messageId\n });\n }", "title": "" }, { "docid": "0679cd4fa22d0458f7290c053505945a", "score": "0.5125467", "text": "async delete() {\n const scope = {\n method: 'DELETE',\n host: 'discord.com',\n port: '443',\n path: `/api/v8/channels/${this.channel.id}/messages/${this.id}`,\n headers: {\n 'Authorization': `Bot ${this.client.botToken}`,\n 'Content-Type': 'application/json',\n },\n };\n\n return await new Promise((resolve, reject) => {\n const request = https.request(scope, (res) => {\n // console.log(`statusCode: ${res.statusCode}`);\n resolve();\n });\n request.on('error', (err) => {\n reject(err);\n });\n request.end();\n });\n }", "title": "" }, { "docid": "3360db1f9fbc6e73470e0737efff41c1", "score": "0.51252836", "text": "removeCategory(selectedCategory) {\n // Takes the now pending removal `selectedCategory` and picks it out of the\n // selectedCategories array.\n let selectedCategories = this.get('selectedCategories').filter( (el) => {\n return el.name !== selectedCategory.name;\n });\n\n this.set('selectedCategories', selectedCategories);\n this.set('atCapacity', false);\n }", "title": "" }, { "docid": "8de3e9fe519df7870fdacf7acc703113", "score": "0.5122169", "text": "async delChit(cid) {\n let chit = this.findChit(cid);\n await this.db.run(\"UPDATE CHITS SET ISDELETED = 1 WHERE CID = ?\",cid);\n }", "title": "" }, { "docid": "5025d046312251b9004012a7bf649ce1", "score": "0.51192707", "text": "remove(broadcast) {\n\t\tthis.dispatch(Action.Broadcast.Remove, broadcast);\n\t}", "title": "" }, { "docid": "983c39b7339c9b3a143f9a641fb46d38", "score": "0.51170325", "text": "async removeFromDBUrl(passedID, category) {\n // log method\n let tableName = this.tableName;\n logger.log(4, 'removeFromDB', `Attempting to delete entires from ${tableName} with ID ${passedID}`);\n\n // compute method\n const params = {\n TableName: tableName,\n Key: {\n id: passedID,\n category: category\n },\n ReturnValues: 'ALL_OLD'\n };\n\n const deleteCommand = new DeleteCommand(params);\n return documentClient\n .send(deleteCommand)\n .then((data) => {\n // log success\n logger.log(4, 'removeFromDB', `Successfully deleted entires from ${tableName} with ID ${passedID}`);\n\n return data.Attributes;\n })\n .catch(function (err) {\n // log error\n logger.log(4, 'removeFromDB', `Failed to delete entires from ${tableName} with ID ${passedID}`);\n\n // throw error\n throw err;\n });\n }", "title": "" }, { "docid": "f1fe9db69e02127c8a204dc70dcdb889", "score": "0.50937164", "text": "deleteData(resource) {\n return fetch(`http://localhost:8088/messages/${resource}`, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n })\n }", "title": "" }, { "docid": "22448ccc83530e236bcb5afe9de7bb1f", "score": "0.5092259", "text": "function clearChatHandler(channel) {\n\tclient\n\t .clear(channel)\n\t .then(() => {\n\t\tconsole.log(\"CHAT CLEARED\");\n\t })\n\t .catch(err => {\n\t\tconsole.log(err);\n\t });\n }", "title": "" }, { "docid": "6b4f6839a69b2c36f3591d951887b12c", "score": "0.50817436", "text": "delete({\n\t\tactivity,\n\t}, res) {\n activites = activites.filter(a => a !== activity);\n res.sendStatus(204);\n }", "title": "" }, { "docid": "bcf74aa55ebd5217e4883b89cb7f4c7e", "score": "0.507926", "text": "destroy() {\n Array.from(this.links).map(link => link.channel.destroy());\n }", "title": "" }, { "docid": "0c42f918e2980f1a66911d80ff489475", "score": "0.50787735", "text": "async function deleteChannelDB(channelID) {\n await connectDB().then(async (mongoose) => {\n try {\n await customChannels.deleteOne({ _id: channelID })\n } finally {\n mongoose.connection.close()\n }\n }).catch(e => { console.log(`Error deleting from custom channels: ${e}`) });\n}", "title": "" }, { "docid": "8346ae0a5397dce6c8f6e51d0062aa0f", "score": "0.50756", "text": "onDeleteSoftware(indexNo) {\n const { softwareTrait } = this.state;\n const newSoftwareTrait = { ...softwareTrait };\n newSoftwareTrait.traits.data.splice(indexNo, 1);\n this.setState({\n softwareTrait: newSoftwareTrait,\n });\n\n const {\n handle,\n tokenV3,\n updateUserTrait,\n deleteUserTrait,\n } = this.props;\n\n if (newSoftwareTrait.traits.data.length > 0) {\n updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3);\n } else {\n deleteUserTrait(handle, 'software', tokenV3);\n }\n }", "title": "" }, { "docid": "33f6f6136f661083d26ed4f55b929012", "score": "0.5074902", "text": "async removeChits(){\n try{\n await AsyncStorage.removeItem('savedChits');\n this.displayData();\n }catch(error){\n console.log(\"Error3: \"+error);\n }\n}", "title": "" }, { "docid": "bf70add8cd1bc0d27e6ed6e04cb2fb04", "score": "0.50748575", "text": "async deleteBoard({ dispatch }, board) {\n await graphqlClient.mutate({\n mutation: gql.DELETE_BOARD_MUTATION,\n variables: {\n boardId: board.boardId\n }\n });\n dispatch(\"fetchBoards\");\n }", "title": "" }, { "docid": "2f2b855140f62478702fc5f8dd92cc6a", "score": "0.50739855", "text": "remove (data, args) {\n // Verify that all args are numbers.\n const ids = args.map((x) => {\n if (isNaN(x)) {\n throw new TypeError('\"' + x + '\" is not a valid issue ID.');\n }\n return Number(x);\n });\n\n // These are not relavant to issues:\n // - `data.milestones`\n // - `data.versions`\n // - `data.meta`\n // - `data.components`\n\n data.issues = data.issues.filter((issue) => ids.indexOf(issue.id) === -1);\n data.comments = data.comments.filter((comment) => ids.indexOf(comment.issue) === -1);\n data.logs = data.logs.filter((log) => ids.indexOf(log.issue) === -1);\n data.attachments = data.attachments.filter((attachment) => ids.indexOf(attachment.issue) === -1);\n\n println(JSON.stringify(data));\n }", "title": "" }, { "docid": "550d794001de449c2d4ae3325440bdc7", "score": "0.5070124", "text": "removeItemToWishlist(context, payload) {\n context.commit(\"removeItemToWishlist\", payload);\n }", "title": "" }, { "docid": "654718f172a6be5cf6e1a359d9fbd696", "score": "0.50568324", "text": "removeStock(code) {\n var ws = new WebSocket('ws://localhost:8080');\n // event emmited when connected\n ws.onopen = function () {\n console.log('websocket is connected ...');\n // sending a send event to websocket server\n ws.send(JSON.stringify({\n type: \"stock/remove\",\n value: code\n }));\n }\n // event emmited when receiving message\n var React = this;\n ws.onmessage = function (ev) {\n var stocks = JSON.parse(ev.data);\n React.stocks = stocks;\n React.forceUpdate();\n }\n }", "title": "" }, { "docid": "54b6873b349d5edebb29d79cada6d2fe", "score": "0.505664", "text": "function removeSubscriber(app, channelName, subsriberStr) {\n var matchedObj = (R.pickBy(function(key) { // \n if (key.indexOf('channel.' + channelName) > -1 || key.indexOf('message.'+channelName) > -1) {\n return true\n }\n return false;\n }, Object.keys(app.getMetaMap())));\n if (Object.keys(matchedObj).length === 0) {\n delete app.getMetaMap()[subsriberStr];\n }\n}", "title": "" }, { "docid": "b8e4bac28b0229c4a38333f6e91a23d8", "score": "0.5051481", "text": "async delete() {\n const exchange = this.config.exchange;\n await this.channel.deleteExchange(exchange);\n }", "title": "" }, { "docid": "41fb159c3b22de53c94235122bf7a5be", "score": "0.5049373", "text": "remove_chart_data(context, id){}", "title": "" }, { "docid": "0a2f8bbaa67f63d8a4009e256240124e", "score": "0.5043356", "text": "function deleteCategory(event, categoryID) {\n // console.log('destroy category: ' + categoryID);\n Category.destroy({\n where: {id: categoryID}\n });\n event.returnValue = \"1\";\n}", "title": "" }, { "docid": "79ee96bd30a6f99927160b7f9f9b2617", "score": "0.50413835", "text": "function leaveChannel(event, socket) {\n\tevent.preventDefault();\n\tconst channel = document.getElementById('newchannel').value;\n\tsocket.emit('leaveChannel', {channel});\n}", "title": "" }, { "docid": "a24456f3144c4c474d7c504dfa9d94c3", "score": "0.5040774", "text": "function onRemovePlayer(data) {\n var i;\n for (i = 0; i < currentPlayers.length; i++) {\n if (currentPlayers[i].id == data.id) {\n var username = currentPlayers[i].getUsername();\n var position = positions[username];\n var chip, card1, card2, action;\n switch (position) {\n case \"left\":\n chip = game_menu.getChildByName(\"player3_chip_plate\");\n card1 = stage.getChildByName(\"lCard1\");\n card2 = stage.getChildByName(\"lCard2\");\n action = stage.getChildByName(\"leftPlayerAction\");\n break;\n\n case \"back\":\n chip = game_menu.getChildByName(\"player4_chip_plate\");\n card1 = stage.getChildByName(\"bCard1\");\n card2 = stage.getChildByName(\"bCard2\");\n action = stage.getChildByName(\"backPlayerAction\");\n break;\n\n case \"right\":\n chip = game_menu.getChildByName(\"player2_chip_plate\");\n card1 = stage.getChildByName(\"rCard1\");\n card2 = stage.getChildByName(\"rCard2\");\n action = stage.getChildByName(\"rightPlayerAction\");\n break;\n }\n game_menu.removeChild(chip);\n stage.removeChild(card1, card2, action);\n stage.update();\n currentPlayers.splice(i, 1);\n currentPlayers.push(new Player());\n delete positions[username];\n }\n }\n}", "title": "" }, { "docid": "d73eb7579708cc2c32b5d79abeb4615d", "score": "0.50355375", "text": "function _deleteContribution() {\n contributionRestService.remove(_contributionToDelete.id, function() {\n vm.contributions.splice(_contributionToDelete.index,1); // Remove the element from the array.\n messageService.showSuccessMessage('application.contribution.catalog.message.successDeletion');\n });\n }", "title": "" }, { "docid": "a1621678f3f275d1c7c320bfda60f370", "score": "0.50342333", "text": "removeComment({ commit, dispatch }, payload) {\n\n api.delete('boards/' + payload.boardId + '/lists/' + payload.listId + '/tasks/' + payload.taskId + '/comments/' + payload._id)\n .then(results => {\n console.log(results)\n var foundComments = {\n results: results.data,\n listId: payload.listId,\n taskId: payload.taskId\n }\n dispatch(\"getComments\", foundComments)\n })\n .catch(err => { console.log(err) })\n }", "title": "" }, { "docid": "3932d446a57b48946e031b51aeb96bc5", "score": "0.50307673", "text": "delete(action, opts = {}, cb) {\n //if no opts but callback function\n if (typeof opts === 'function') {\n cb = opts;\n opts = {};\n }\n\n return this.modem({\n action: `Delete${action}`,\n ...opts\n }, cb);\n }", "title": "" }, { "docid": "bcc137d4b114f33d47352f1e8d65bb79", "score": "0.5025811", "text": "run (message, { x }) {\n message.channel.bulkDelete(x)\n .catch(err => {\n console.error(err)\n message.channel.send('There was an error trying to prune messages in this channel!')\n })\n }", "title": "" }, { "docid": "f41f5755b5b1acaccfd5f7fb10fe0b2d", "score": "0.50207573", "text": "deleteAllUsersFromChannel(channelId) {\n var that = this;\n\n return new Promise(function(resolve, reject) {\n\n that.logger.log(\"debug\", LOG_ID + \"(deleteAllUsersFromChannel) _entering_\");\n\n that.http.delete(\"/api/rainbow/channels/v1.0/channels/\" + channelId + \"/users\", getRequestHeader()).then(function(json) {\n that.logger.log(\"info\", LOG_ID + \"(deleteAllUsersFromChannel) successfull\");\n that.logger.log(\"info\", LOG_ID + \"(deleteAllUsersFromChannel) REST remove all users in channel with channelId\", json.data);\n that.logger.log(\"debug\", LOG_ID + \"(deleteAllUsersFromChannel) _exiting_\");\n resolve(json.data);\n }).catch(function(err) {\n that.logger.log(\"error\", LOG_ID, \"(deleteAllUsersFromChannel) error\", err);\n that.logger.log(\"debug\", LOG_ID + \"(deleteAllUsersFromChannel) _exiting_\");\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "5c742c74b592b0aedf673a9d9d7fee3d", "score": "0.50104445", "text": "handleRemove(){\n let data = this.props.userData.savedMedia.map( media => {\n if(media.id !== this.props.modalData.id || media.type !== this.props.modalData.type)\n return({type:media.type, id:media.id})\n })\n this.props.closeModal();\n this.props.putFunct(\n this.props.userData.user.accountName,\n this.props.userData.user.description,\n this.props.userData.user.userPhoto,\n data\n )\n }", "title": "" }, { "docid": "d29f29ffc35edf1d656b182d698f50f5", "score": "0.50083125", "text": "function endDebate(data) {\n const title = data.title;\n const url = data.url;\n Topics.update({\"title\": title}, {\n $pull: {\n \"chatrooms\": url\n } \n });\n}", "title": "" }, { "docid": "17e3b12b89312672159c80fe8ed9fd52", "score": "0.50036633", "text": "delete({ type, id, index }) {\n\t\treturn this.$publish('delete', { type, id, index });\n\t}", "title": "" }, { "docid": "6a6c5958860724214d858680fa55e7ea", "score": "0.500062", "text": "function closeChannel(reason) {\r\n clientLog(`------ Finished '${currentChannel.title}' execution [${reason}] ------`);\r\n ctx.fillStyle = \"rgba(0, 0, 0, 1)\";\r\n ctx.fillRect(0, 0, display.width, display.height);\r\n if (titleBar) {\r\n titleBar.updateTitle(defaultTitle);\r\n statusIconFile.innerText = \"\";\r\n statusFile.innerText = \"\";\r\n statusIconVersion.innerText = \"\";\r\n statusVersion.innerText = \"\";\r\n statusResolution.style.display = \"none\";\r\n statusIconRes.style.display = \"none\";\r\n statusSepRes.style.display = \"none\";\r\n}\r\n brsWorker.terminate();\r\n sharedArray[dataType.KEY] = 0;\r\n sharedArray[dataType.SND] = -1;\r\n sharedArray[dataType.IDX] = -1;\r\n resetSounds();\r\n bufferCanvas.width = 1;\r\n running = false;\r\n appMenu.getMenuItemById(\"close-channel\").enabled = false;\r\n currentChannel.id = \"\";\r\n currentChannel.file = \"\";\r\n currentChannel.title = \"\";\r\n currentChannel.version = \"\";\r\n}", "title": "" }, { "docid": "b0bec8d696526c131b2c046697a94da3", "score": "0.4997776", "text": "removeFromCategories(e) {\n const category = e.target.getAttribute('data-category')\n const allCategories = this.props.categories.slice()\n const { onCategoriesUpdate, onCategoryRemove } = this.props\n\n allCategories.splice(allCategories.indexOf(category), 1)\n\n if (typeof onCategoryRemove === 'function') {\n onCategoryRemove(category)\n }\n onCategoriesUpdate(allCategories)\n }", "title": "" }, { "docid": "13fe87c93e65aa5819264f2a4d90c26e", "score": "0.49967867", "text": "remove() { }", "title": "" }, { "docid": "82465bbd9e219c57784624af6bd991e0", "score": "0.49848992", "text": "static sendMessageToRemoveAsset(id) {\n if (UserManager.interactionType == \"sender\") {\n jsonObj.action = \"RemoveAsset\";\n jsonObj.id = id;\n SocketManager.FMEmitStringToOthers(JSON.stringify(jsonObj));\n }\n }", "title": "" }, { "docid": "4af5d2a1fc3af79c586b7404bfd593c6", "score": "0.49814364", "text": "removeAllReaction( req, res ) {\n Thought.findOneAndUpdate(\n { _id: req.params.thoughtId},\n { $pull: { reactions: req.body }},\n { new: true }\n )\n .select('-__v')\n .then(thoughtData => {\n if (!thoughtData) {\n res.status(404).json({ message: 'No reaction found with that id!' });\n return;\n }\n res.json({ message: 'Your reactions were removed!'});\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" } ]
011a9b438155f7fc872a4845ee869b40
Checks what to do and maybe cancels the request.
[ { "docid": "a7593c9c7e64b4436fa82bde012883a9", "score": "0.0", "text": "function blockPage (details) {\n console.log(details.url);\n\n function isScheduleBlocked(schedule) {\n const h = (new Date()).getHours();\n return schedule.start <= h && h < schedule.end;\n }\n\n function isInBlockList(blockList, url) {\n return blockList.some(blocked => url.match(blocked));\n }\n\n function isInExceptionList(exceptionList, url) {\n const d = (new Date()).getDay();\n const h = (new Date()).getHours();\n\n for (const exception of exceptionList) {\n if (url.match(exception.regex)\n && exception.day == d\n && exception.start <= h\n && h < exception.end) {\n console.log(\"Applying blocking exception: \"\n + exception.regex\n + \" \" + exception.day\n + \" \" + exception.start\n + \" \" + exception.end);\n return true;\n }\n }\n\n return false;\n }\n\n if (isScheduleBlocked(config.schedule)\n && isInBlockList(config.blockedList, details.url)\n && !isInExceptionList(config.exceptionList, details.url))\n {\n const blockedUrl =\n browser.runtime.getURL(\"blocked.html\")\n + \"?url=\" + details.url;\n\n console.log(\"Blocking!\");\n return { redirectUrl: blockedUrl };\n } else {\n return {};\n }\n}", "title": "" } ]
[ { "docid": "2eb93ce44e1bda7c75388814ce790a9c", "score": "0.7068284", "text": "function CancelCurrentRequest() {\n if (xmlReq != null)\n xmlReq.abort();\n}", "title": "" }, { "docid": "2d0572cf639a348f9de5c322a6ef470e", "score": "0.6691931", "text": "abort() {\n if (this.request && this.request.abort) {\n this.request.abort();\n this.request = null;\n } else {\n throw 'Cannot abort request, because it does not exist.';\n }\n }", "title": "" }, { "docid": "285e406a23645dbd01cafaf427107511", "score": "0.66438305", "text": "function doCancel() {\n\treturn true;\n}", "title": "" }, { "docid": "a9186ac1c6031c1e8c006b2c081baf27", "score": "0.6481916", "text": "function abortIfExists(request) {\n\tif(request) {\n\t\trequest.abort();\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "aa100f98069a53a235e76beb28c638a8", "score": "0.6399266", "text": "async cancel(request) {\n this.lastPayload = void 0;\n const answer = await this.mapper.insertEx(Requests.Cancel, request);\n if (answer !== void 0) {\n return answer.responseCode === 0;\n }\n return false;\n }", "title": "" }, { "docid": "68487eecfe8f68e4d9138388d5f6ad54", "score": "0.63919276", "text": "checkAndCancel() {\n const currentPage = this.currentPage;\n const currentPageHasOverrides = currentPage.stopCancel || currentPage.preventDefault;\n if (this.stopNavigation) {\n return;\n }\n currentPage.pageOnCancel.emit();\n if (!currentPageHasOverrides) {\n this.onCancel.emit();\n }\n if (!this.stopCancel && !currentPageHasOverrides) {\n this.close();\n }\n }", "title": "" }, { "docid": "eebe7479c320de13036a98abdd0f1a0f", "score": "0.6309828", "text": "throwIfCanceled() {\n\n\t\t\tif (data.reason) {\n\t\t\t\tthrow data.reason;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a24d1880573545620ebcf41dcbd190c7", "score": "0.62334067", "text": "function cancel() {\n cancelled = true;\n }", "title": "" }, { "docid": "a19feafae1b18d916af3abff9b656d0b", "score": "0.6205601", "text": "cancelPendingRequest() {\n const { cancelPendingRequest } = this.state\n if (cancelPendingRequest) cancelPendingRequest()\n }", "title": "" }, { "docid": "255657187ea839e5d7ed07460e6de85a", "score": "0.6203803", "text": "checkCancel(reject) {\n if (this.shouldCancelASAP) {\n this.shouldCancelASAP = false\n reject('Canceling previous running job...')\n }\n }", "title": "" }, { "docid": "fe73c332182fd4ca1b6f1fef39c7f871", "score": "0.618455", "text": "cancelRequests() {\n if (this.busy) {\n this.asyncSubscriber.detach();\n this.statusInternal = OperationStatus.Cancelled;\n this.clearData();\n }\n }", "title": "" }, { "docid": "59f0f6cf068fcaadd63e3c8fc10718c9", "score": "0.6172237", "text": "function cancel() {\n\treturn true;\n}", "title": "" }, { "docid": "80b1fc4a59edad10ff8173e435a60dd3", "score": "0.61608034", "text": "function cancelPendingRequest() {\n //remove\n _.forEach(allRequest, function (oboeObject) {\n if (oboeObject) {\n if (_.get(oboeObject, 'config.cancelOnRouteChange', false)) {\n oboeObject.cancel();\n }\n }\n });\n }", "title": "" }, { "docid": "0f5ad0768fce859e5be039678928e1cb", "score": "0.6136189", "text": "onAbortRequest() {\n\t\tif (this.abortFn) {\n\t\t\tthis.abortFn();\n\t\t}\n\t}", "title": "" }, { "docid": "6100693f6beab7b9dfb3eeb3a269ade0", "score": "0.61304724", "text": "function callAbort() {\n httpRequest.abort();\n logger('It seems the request has timed Out, please try again.');\n execute(true, 'API Request TimeOut', callback);\n } // set timeout and timeout function", "title": "" }, { "docid": "c1cc1b89ce37c09d721b830e0c1dede3", "score": "0.60940737", "text": "onCancel() {}", "title": "" }, { "docid": "184435f09de6af95f5710adf10ef0062", "score": "0.608991", "text": "cancel() {}", "title": "" }, { "docid": "184435f09de6af95f5710adf10ef0062", "score": "0.608991", "text": "cancel() {}", "title": "" }, { "docid": "57ffd95e0306641b96ca336af1fe72b0", "score": "0.60494906", "text": "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "title": "" }, { "docid": "57ffd95e0306641b96ca336af1fe72b0", "score": "0.60494906", "text": "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "title": "" }, { "docid": "57ffd95e0306641b96ca336af1fe72b0", "score": "0.60494906", "text": "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "title": "" }, { "docid": "57ffd95e0306641b96ca336af1fe72b0", "score": "0.60494906", "text": "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "title": "" }, { "docid": "57ffd95e0306641b96ca336af1fe72b0", "score": "0.60494906", "text": "function throwIfCancellationRequested(config){if(config.cancelToken){config.cancelToken.throwIfRequested();}}", "title": "" }, { "docid": "40cffcf3930717cdb3da9ec35ce08b86", "score": "0.6042824", "text": "function cancel_callback(res) {\n \n}", "title": "" }, { "docid": "3de6a239b118cd5d147df8f1756ed4e1", "score": "0.60315126", "text": "function cancelCookedOrder(orderid) {\n var asyncRequest;\n try {\n asyncRequest = new XMLHttpRequest();\n asyncRequest.open('GET', '/getorders?id=' + orderid + '&type=accept&filter=Confirmed', true);\n asyncRequest.send(null);\n } catch (exception) {\n alert(\"Request failed: Change status to accept\" + exception.toString());\n }\n}", "title": "" }, { "docid": "51dd09c8938dc95140151de5adbf111d", "score": "0.601419", "text": "async submitCancel () {\n // this will be the page.cancelSubmit button (evt.currentTarget)\n const page = this.page\n const order = this.order\n const req = {\n orderID: order.id,\n pw: page.cancelPass.value\n }\n page.cancelPass.value = ''\n app.loading(page.cancelForm)\n var res = await postJSON('/api/cancel', req)\n app.loaded()\n if (!app.checkResponse(res)) return\n page.status.textContent = 'cancelling'\n Doc.hide(page.forms)\n order.cancelling = true\n }", "title": "" }, { "docid": "5ab10ea5d269d65fc435236776c762de", "score": "0.59961545", "text": "get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }", "title": "" }, { "docid": "5ab10ea5d269d65fc435236776c762de", "score": "0.59961545", "text": "get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }", "title": "" }, { "docid": "e08237c20f3283085defd45cda4dc2dd", "score": "0.598649", "text": "abort() {\n\t\tif (this.pending) {\n\t\t\tthis._abortController.abort();\n\t\t}\n\t}", "title": "" }, { "docid": "7a0cd955c74be604278f27312d9d5e40", "score": "0.59723973", "text": "function rejectRequest() {\n replyRequest('REJECTED');\n}", "title": "" }, { "docid": "490d9502d281baba7812c273a662f49d", "score": "0.59583205", "text": "cancelFinishRequest() {\n const payloadIndex = this.replyMessage.payload.findIndex(item => {\n return item.type === \"cmd\" && item.name === \"finish_request\";\n });\n if (payloadIndex > -1) {\n this.replyMessage.payload.splice(payloadIndex, 1);\n }\n return true;\n }", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.5948728", "text": "function Cancellation() { }", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.5948728", "text": "function Cancellation() { }", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.5945047", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.5945047", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.5945047", "text": "function Cancellation() {}", "title": "" }, { "docid": "3daa09793ab0f9d9e7808b5c55c7fbc3", "score": "0.5945047", "text": "function Cancellation() {}", "title": "" }, { "docid": "c4dc9d03ec5bf86163e63b00cf019dd8", "score": "0.59351665", "text": "cancel(event) {\n if (this.abortEvent.looselyMatches(event)) {\n this.state = IDLE;\n return this.doCancel(event);\n }\n\n return false;\n }", "title": "" }, { "docid": "31d5ea1155ff0368c41091c5abdb1b32", "score": "0.5931711", "text": "async cancel({ params, request, response }) {\n let userid = params.userid\n\n // Find the order specified and owned by the requester (userid = wallet address)\n let query = await Order.query()\n .where('id', '=', params.id)\n .where('maker', '=', userid)\n .fetch()\n\n let order = query.first()\n\n let validator = await OrderValidator.validateCancelOrderRequest(\n order,\n userid\n )\n if (validator.success !== true) {\n return response.json({\n success: false,\n message: validator.message\n })\n }\n\n // Save the order update to database\n return (\n order\n .save()\n // Success case\n .then(() => {\n response.json({\n success: true,\n id: params.id\n })\n })\n // Failure case\n .catch(error => {\n response.json({\n success: false,\n message: error.message\n })\n })\n )\n }", "title": "" }, { "docid": "a0a0fb91fc197080a32960b0de750e08", "score": "0.59211355", "text": "cancel() {\n this.abort.abort();\n }", "title": "" }, { "docid": "be22798a318dd97d41f7c5544e3d738b", "score": "0.59056115", "text": "Cancel() {\r\n if (this.state === TRANSACTION_STATE.DEAD) return false;\r\n if (this.state === TRANSACTION_STATE.WAITING_FOR_CONFIRM) {\r\n this.state = TRANSACTION_STATE.DEAD;\r\n return true;\r\n } else if (this.state === TRANSACTION_STATE.WORKING) {\r\n this.Buyer.account.Out(global.Bank ,this.cancelFee, true);\r\n }\r\n }", "title": "" }, { "docid": "24f569b8c6581c7dd2cfa63064e37899", "score": "0.58947784", "text": "handleCancel() {\n\t\tthis.clearInputs();\n\t}", "title": "" }, { "docid": "24f569b8c6581c7dd2cfa63064e37899", "score": "0.58947784", "text": "handleCancel() {\n\t\tthis.clearInputs();\n\t}", "title": "" }, { "docid": "f7aa2e51e2ef68a61edc8326d3ff8359", "score": "0.58754706", "text": "function handleRequest(request, response){\n //no interaction with the server just yet.\n response.end('No interactions allowed.');\n}", "title": "" }, { "docid": "db2b0b3a59a26ae6bb349fda794f8d10", "score": "0.5868651", "text": "function cancel() {\n vm.msgContent = null;\n vm.needReplyId = null;\n }", "title": "" }, { "docid": "70d9a8be132ff50f138e827b7c517469", "score": "0.5861955", "text": "function _cancelProcessing(){\n \tsendAutoReply = \"false\";\n \tcurrent.setAbortAction(true);\n \tevent.state='stop_processing';\n }", "title": "" }, { "docid": "bbc11e5d35e1eccce27220f3269df6f9", "score": "0.58412457", "text": "function cancel() {\n // before doing the delete request, switching to DELETING mode\n transition(DELETING, true);\n props.cancelInterview(props.id)\n // if cancelInterview was successful, showing empty appointment\n .then(() => transition(EMPTY))\n // else, it will show the error message\n .catch(() => transition(ERROR_DELETE, true));\n }", "title": "" }, { "docid": "ef7ab934126bdacfb21f104496f9191f", "score": "0.5839384", "text": "function throwIfCancellationRequested (config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "7e1a1f58be6f87df35c987f22331d130", "score": "0.58287674", "text": "function Canceller() {\n var canceller = this;\n var _cancelled = false;\n canceller.cancelled = function() { return _cancelled; };\n canceller.requestInfo = null; // to be set by requestInterceptor\n canceller.cancel = function (/*reason*/) {\n var jqxhr = canceller.requestInfo && canceller.requestInfo.jqXHR;\n if (jqxhr && jqxhr.abort) {\n jqxhr.abort();\n _cancelled = true;\n }\n canceller.close(); \n };\n this.close = function() { \n canceller.requestInfo = null; // release memory\n canceller.cancel = noop;\n };\n }", "title": "" }, { "docid": "10d849025c010c214798f6d1c78bcea3", "score": "0.58264446", "text": "function cancelled_fn() { // canceled_fn \n // No cancel handler code since we don't provide a cancel method \n }", "title": "" }, { "docid": "1caaa9b8afbb13e2c1ee9de0ccdbec26", "score": "0.5816433", "text": "function cancel() {\n clearExistingTimeout();\n cancelled = true;\n }", "title": "" }, { "docid": "70ca9cedcc15b9fccfe91db47dc2694a", "score": "0.58138484", "text": "function maybeCancel()\n{\n if ( typeof( CANCEL ) !== \"undefined\" )\n {\n // should be a CancelException\n throw CANCEL;\n }\n}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.5799819", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d6ccc69152795ade99c553bce7d2d871", "score": "0.57849807", "text": "async handleApiRequest() {\n return false;\n }", "title": "" }, { "docid": "20b9625ef9a0a746c422b3d1adf8417b", "score": "0.57826513", "text": "abortRequest() {\n if (this.layer.request) {\n if (this.layer.request.readyState !== 4) {\n // Abort the request && reset the layer\n this.layer.request.abort();\n this.layer = {};\n }\n }\n }", "title": "" }, { "docid": "225ea6e2e2d215a15a1296914970b177", "score": "0.5762311", "text": "function cancelTicket(){ \n\tvar answer=confirm(\"Are you sure you want to cancel this record?\"); \n\tif (answer==true) { \n\t\tgsftSubmit(null, g_form.getFormElement(), 'cancel_request'); //MUST call the 'Action name' set in this UI Action \n\t} else { \n\t\treturn false; \n\t} \n}", "title": "" }, { "docid": "ede9a0d42cd35f6348f33a7f6a043524", "score": "0.5750957", "text": "function onCancelRequestMembership(data, textStatus, jqXHR) {\n if (data.meta.code == 200) {\n searchGroup();\n console.log(\"Membership request cancelled.\");\n } else {\n alertAPIError(data.meta.message);\n }\n}", "title": "" }, { "docid": "d9981ef324a64c5d58281c0fe7ef1d2f", "score": "0.5747366", "text": "abort () {\n this.requests.forEach(req => req.abort())\n super.abort()\n }", "title": "" }, { "docid": "befcbdd7117afd1184795999c0c713de", "score": "0.57472676", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "921be10b4ee284d39688b4e51bee0d3a", "score": "0.5736692", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "4f715dae057718fe6ed61da5e8a72401", "score": "0.57319087", "text": "function checkCancel(event) {\n if (event.which === 27) {\n preventDefault(event);\n cancel();\n }\n } // prevent ghost click that might occur after a finished", "title": "" }, { "docid": "90b5d90fc852c5bd8e2010dca0fa0ec8", "score": "0.57264084", "text": "cancel() {\n this.cancelled_ = true;\n }", "title": "" }, { "docid": "31f7f1efae96be56b6ed9507b32f6868", "score": "0.5722743", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "46b7b9a7b438b2b9df8888da8889dca6", "score": "0.5721334", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "5f60e5ddefaf5c63ec238a569cfa7ff7", "score": "0.5718736", "text": "function abortPendingRequests() {\n\t\t\tif(currentXhr) {\n\t\t\t\t//there is a request pending, abort it and execute this one\n\t\t\t\tcurrentXhr.abort();\n\t\t\t}\n\t\t\tremoveLoading();\n\t\t}", "title": "" }, { "docid": "9a81b62ee75698121c65c1299146459c", "score": "0.57140565", "text": "function onCancel() {\n}", "title": "" }, { "docid": "7053422fb7ff051f3c7a83332c6eeeca", "score": "0.5706736", "text": "function docancel() {\n cdeferred.resolve();\n if (!command.cancelled) {\n command.cancelled = true;\n //If we are loading the code inside execute will manage the cancel\n if (!command.loading) {\n internal.queue.remove(command);\n }\n }\n }", "title": "" }, { "docid": "3032ec5c152f9b7d03b1049d645ff5b1", "score": "0.57045615", "text": "function onCanceled(cancelSender, cancelReason) {\n cancel = true;\n }", "title": "" }, { "docid": "5abc99c29bc99f1b5c18221c3832b40a", "score": "0.56983125", "text": "handleCancel(){\n\t\tthis.clearInputs();\n\t}", "title": "" }, { "docid": "7ba02ef1615f3ea16d8747528bfc32c8", "score": "0.5697099", "text": "async onCancel() {\n await this.send('cancelAction');\n }", "title": "" }, { "docid": "47da4631039c8299923caea617b53da2", "score": "0.5673447", "text": "function checkCancel(event) {\n\n if (event.which === 27) {\n preventDefault(event);\n\n cancel();\n }\n }", "title": "" }, { "docid": "32cdbe3f8029b05af05f6b0df1e085f3", "score": "0.5669776", "text": "function checkCancel(event) {\n\t\n\t if (event.which === 27) {\n\t event.preventDefault();\n\t\n\t cancel();\n\t }\n\t }", "title": "" }, { "docid": "0f0fbf32b7110fe50e070b4c1a5074e1", "score": "0.5652771", "text": "function cancelReq(res,req,id){\n\t\tvar notification_id = req.query.notification_id;\n\n\t\tasync.waterfall([\n\t\t\tfunction(callback){\n\n\t\t\t\tvar sql = 'SELECT * '\n\t\t\t\t\t\t+ 'FROM users '\n\t\t\t\t\t\t+ 'WHERE id=' + id + '; '\n\n\t\t\t\t\t\t+ 'SELECT * '\n\t\t\t\t\t\t+ 'FROM notification '\n\t\t\t\t\t\t+ 'WHERE id=' + notification_id + '; ';\n\n\t\t\t\tpool.query(sql,function(err,result){\n\t\t\t\t\tvar checkAdmin = result[0][0][\"admin\"];\n\t\t\t\t\tif(checkAdmin==1){\n\t\t\t\t\t\tvar reqId = result[1][0].obj_id;\n\t\t\t\t\t\tcallback(null,reqId);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tres.send(\"-10\");\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},function(reqId, callback){\n\t\t\t\tvar sql = 'DELETE FROM companysReq '\n\t\t\t\t\t\t+ 'WHERE id=' + reqId + '; '\n\n\t\t\t\t\t\t+ 'DELETE FROM notification '\n\t\t\t\t\t\t+ 'WHERE id=' + notification_id + ' LIMIT 1; '\n\n\t\t\t\tpool.query(sql);\n\t\t\t\t\n\t\t\t\tres.send(\"sucsses\");\t\n\t\t\t}\n\t\t])\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "6dcf894d5ca2e6d18cd14b7e0cd70b1c", "score": "0.565258", "text": "function throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}", "title": "" }, { "docid": "439e34cbe4ed3fcdee6f4623aa829f95", "score": "0.5644737", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "439e34cbe4ed3fcdee6f4623aa829f95", "score": "0.5644737", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" }, { "docid": "439e34cbe4ed3fcdee6f4623aa829f95", "score": "0.5644737", "text": "function throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n }", "title": "" } ]
f5ccde660849df0c6c0030cf99d85b1c
draw the bar chart
[ { "docid": "6327e929cea53bae40356dec6c866c6b", "score": "0.0", "text": "function drawHbar(data, svg) {\n let x_hbar = d3.scaleLinear().range([0, width_hbar - 160]);\n let y_hbar = d3.scaleBand().range([height_hbar, 30]);\n\n data.sort(function (a, b) {\n return a.value - b.value;\n });\n\n x_hbar.domain([0, d3.max(data, function (d) {\n return d.value;\n })]);\n y_hbar.domain(data.map(function (d) {\n return d.key;\n })).padding(0.3);\n\n svg.append(\"g\")\n .attr(\"class\", \"x_hbar_axis\")\n .attr(\"transform\", \"translate(80,\" + 30 + \")\")\n .call(d3.axisTop(x_hbar))\n .selectAll(\"text\")\n .style(\"text-anchor\", \"end\");;\n\n svg.append(\"g\")\n .attr(\"class\", \"y_hbar_axis\")\n .attr(\"transform\", \"translate(80,\" + 0 + \")\")\n .call(d3.axisLeft(y_hbar));\n\n svg.selectAll(\".horizontal_bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"horizontal_bar\")\n .attr(\"x\", 80)\n .attr('fill', 'steelblue')\n .attr(\"height\", y_hbar.bandwidth())\n .attr(\"y\", function (d) {\n return y_hbar(d.key);\n })\n .attr(\"width\", function (d) {\n return x_hbar(d.value);\n })\n .on(\"mousemove\", function (d) {\n tooltip_bar\n .style(\"left\", d3.event.pageX - 50 + \"px\")\n .style(\"top\", d3.event.pageY - 70 + \"px\")\n .style(\"display\", \"inline-block\")\n .html((d.key) + \"<br>\" + (d.value));\n d3.select(this).style('fill', '#F4A7B9');\n })\n .on(\"mouseout\", function (d) {\n tooltip_bar.style(\"display\", \"none\");\n d3.selectAll(\".horizontal_bar\").style('fill', 'steelblue')\n });\n\n svg.append(\"text\")\n .attr(\"x\", (width_hbar / 2))\n .attr(\"y\", 0 - (margin_hbar.top / 2) + 10)\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"14px\")\n .text(\"Types of accidents in \" + clickItem);\n\n}", "title": "" } ]
[ { "docid": "5180d10da2deb5d105b096ff7f1f5f36", "score": "0.7621974", "text": "function drawBars() {\n setClassByData(BARS, \"bar\");\n setBarLength(BARS);\n setTitle(BARS);\n setCenterTitle(TARGET_BAR);\n setClick(BARS);\n setMouseover(BARS);\n BARS.classed(\"selected\", function(d){return d.selected;}); // apply data selected status\n }", "title": "" }, { "docid": "c2840c66fa1ecaf2d39717a7f7b388de", "score": "0.74842745", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.arrayToDataTable([\n ['Difficulty', 'Easy', 'Medium', 'Hard', { role: 'annotation'}],\n ['Anna', annaEasy, annaMedium, annaHard, ''],\n ['Alex', alexEasy, alexMedium, alexHard, ''],\n ['Mr. Binks', binksEasy, binksMedium, binksHard, '']\n ])\n // Set chart options\n var options = {'title':'Total Number of Tasks per Person',\n 'width':600,\n 'height':400,\n legend: { position: 'top', maxLines: 3 },\n bar: { groupWidth: '75%'},\n isStacked: true\n };\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "03cf8edcf4eb6beade56455fb4e0f34a", "score": "0.7467605", "text": "drawBarChart() {\n let barChartWrapper = d3.select(\"#bar_chart_wrapper\");\n barChartWrapper.append(\"svg\")\n .attr(\"id\", \"bar_chart_svg\");\n }", "title": "" }, { "docid": "d9455d26564a585438dc179bdf4be871", "score": "0.7405116", "text": "function drawBarChart(data, options, element){\n\n //The Functions\n function drawXYBox(element) {\n $(element).prepend(\"<div class=xyData></div>\");\n $(\".xyData\").css({\n \"height\" : \"auto\",\n \"width\" : \"auto\",\n \"float\" : \"left\",\n \"display\" : \"inline-block\"\n });\n }\n\n function drawYLabel(element, options) {\n $(element).prepend(\"<div class=yLabel></div>\");\n $(\".yLabel\").css({\n \"display\" : \"inline-block\",\n \"float\" : \"left\",\n \"margin-top\" : \"-9.5px\"\n });\n $(element).prepend('<div class=yTitle contenteditable=true>' + options[3] + '</div>');\n $(\".yTitle\").css({\n \"display\" : \"inline-block\",\n \"float\" : \"left\",\n \"writing-mode\" : \"tb-rl\",\n \"text-align\" : \"center\",\n \"margin-right\" : \"10px\",\n \"height\" : options[21],\n \"color\" : options[4],\n \"font-size\" : options[5]\n });\n }\n\n function drawXLabel(options, chartWidth, element){\n $(element).prepend(\"<div class=xTitle contenteditable=true>\" + options[6] + \"</div>\");\n $(\".xTitle\").css({\n \"text-align\" : \"center\",\n \"padding-left\" : \"60px\",\n \"width\" : chartWidth,\n \"margin-top\" : \"10px\",\n \"margin-bottom\" : \"20px\",\n \"color\" : options[7],\n \"font-size\" : options[8]\n })\n }\n\n function drawMainTitle(options, chartWidth, element) {\n $(element).prepend(\"<div class=title contenteditable=true>\" + options[0] + \"</div>\");\n $(\".title\").css({\n \"width\" : chartWidth,\n \"padding-left\" : \"60px\",\n \"text-align\" : \"center\",\n \"color\": options[1],\n \"font-size\" : options[2],\n \"margin-bottom\" : \"15px\"\n }); \n }\n\n //Functions to draw the BARS\n function drawBars(ID, maxVal, options, data) {\n //Append a container to the allData div for the bar being drawn\n $(\".allData\").append(\"<div class=data\" + ID + \"></div>\");\n //Set the bar to be displayed inline-block as the bars must be side by side\n $(\".data\" + ID).css({\n \"display\" : \"inline-block\",\n \"background-color\" : options[14]\n });\n\n function makeBottomBar(ID, i, data, options){\n $(\".dataBar\" + ID + i).css({\n \"border-top\" : \"1px solid black\",\n \"border-left\" : \"1px solid black\",\n \"border-right\" : \"1px solid black\"\n })\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)) \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"position\" : \"relative\",\n \"background-color\" : options[15] // Change later in the options\n });\n\n // Getting the data points styled\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n\n function makeTopBar(ID, i, data, options){\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)), \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"border\" : \"1px solid black\",\n \"position\" : \"relative\",\n \"background-color\" : options[16] // Change later in the options\n });\n\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n \n //for each datapoint in the bar, draw the bar (data for a single bar must be sorted from lowest-highest)\n for (var i = 1; i < data[ID].length; i++) {\n $(\".data\" + ID).prepend(\"<div class=dataBar\" + ID + i + \"><div class=dataPoint\" + i + \">\" + data[ID][i] + \"</div></div>\");\n if(i % 2 !== 0){ // BOTTOM BAR MAKING FUNCTION RUNNING\n makeBottomBar(ID, i, data, options)\n }else{ // TOP BAR MAKING FUNCTION RUNNING\n makeTopBar(ID, i, data, options)\n }\n\n //Set the dataPoint to display at either the top, middle or bottom of the bar\n if (options[19] === \"top\") {\n $(\".dataPoint\" + i).css(\"top\", \"5%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, 0%)\");\n } else if (options[19] === \"middle\") {\n $(\".dataPoint\" + i).css(\"top\", \"50%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -50%)\");\n } else {\n $(\".dataPoint\" + i).css(\"bottom\", \"0%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -10%)\");\n }\n //For multiple values, we calculate the remaining height needed to add above the currently drawn values to get the correct height of the bar\n var heightVal = (data[ID][i] / maxVal) * options[21];\n //console.log(heightVal + \" outside\");\n for (var j = 1; j < i; j++) {\n //heightVal = (((data[ID][j] / maxVal) * options[21]) - heightVal) * (-1);\n //console.log(heightVal);\n }\n $(\".dataBar\" + ID + i).css(\"height\", heightVal);\n }\n $(\".data\" + ID).css(\"border-bottom\", \"1px solid black\");\n //add the space between each bar\n $(\".allData\").append(\"<div class=barSpace></div>\");\n } // END OF DRAW BARS FUNCTION\n\n //Function to create the bars using the data given\n function drawData(data, options) {\n $(\".xyData\").append(\"<div class=allData></div>\");\n $(\".allData\").css(\"border-left\", \"1px solid black\");\n \n //Find the max value contained in the data. It will be used to set the max height\n if(!isNaN(data[0][2])){\n var maxVal = data[0][1] + data[0][2];\n }else{\n var maxVal = data[0][1];console.log(maxVal)\n }\n for(let i = 0; i<data.length; i++){\n var arr = [], sum = 0;\n for(let j=1; j<data[i].length; j++){\n arr.push(data[i][j])\n }\n if(arr.length > 1){\n sum = arr.reduce((total, current)=>(total+current));\n }else{\n sum = arr[0];\n }\n if(maxVal < sum){maxVal = sum}\n }\n\n //Get the largest y-axis value, which will be the closest multiple of 5 to the max value rounded up.\n var maxValAxis = Math.ceil(maxVal / 5) * 5;\n //calls the drawBars function for each bar that needs to be drawn\n for (var i = 0; i < data.length; i++) {\n drawBars(i, maxValAxis, options, data);\n }\n\n //Sets the spacing between the bars to the value input in the options parameter\n $(\".barSpace\").css({\n \"width\" : options[20],\n \"display\" : \"inline-block\",\n \"border-bottom\" : \"1px solid black\"\n });\n return maxValAxis;\n }\n\n //The function that draws the axis marks of the x-axis and y-axis\n function drawAxisMarks(data, options, maxValAxis) {\n\n $(\".xyData\").append(\"<div class=xLabel></div>\");\n $(\".xLabel\").css(\"display\", \"flex\");\n $(\".xLabel\").css(\"flex-wrap\", \"nowrap\");\n \n //Each y-axis will have 10 axis-marks \n var increment = parseInt(options[13]); // Can be changed using the options value\n var yAxisSegments = Math.ceil(maxAxisVal / increment);\n //Every odd value of i, we draw an axis mark with a label (ie] -10), every even value we just draw an axis mark (ie] -).\n for (var i = (yAxisSegments -1); i >= -1; i--) {\n if (i % 2 != 0) { //i.e.- Odd value\n $(\".yLabel\").append(\"<div class=dashY\" + i + \">\" + maxValAxis + \"-</div>\");\n $(\".dashY\" + i).css(\"height\", (options[21] / yAxisSegments));\n } else {\n $(\".yLabel\").append(\"<div class=dashY\" + i + \">-</div>\");\n $(\".dashY\" + i).css(\"height\", (options[21] / yAxisSegments));\n }\n maxValAxis -= increment;\n $(\".dashY\" + i).css(\"text-align\", \"right\");\n }\n \n\n //for each bar, draw an x-axis label\n for (var i = 0; i < data.length; i++) {\n $(\".xLabel\").append(\"<div class=tick\" + i + \">\" + data[i][0] + \"</div>\");\n $(\".tick\" + i).css({\n \"display\" : \"inline-block\",\n //\"text-align\" : \"center\",\n //Translate the x-axis labels so they are written vertically\n \"writing-mode\" : \"tb-rl\",\n \"flex-grow\" : \"1\",\n \"top\" : \"50%\",\n \"padding-right\" : \"10px\",\n \"position\" : \"relative\",\n \"transform\" : \"translateX(-40%)\",\n });\n }\n\n //Color of the labels and add a margin\n $(\".xLabel\").css({\n \"margin\" : \"auto\",\n \"color\" : options[11],\n \"font-size\" : options[12]\n });\n $(\".yLabel\").css({\n \"color\" : options[9],\n \"font-size\" : options[10]\n });\n}\n\n//EXECUTING THE drawBarChart FUNCTION when BEING RUN IN THE SCRIPT FILE\n\n drawXYBox(element);\n drawYLabel(element, options);\n var maxAxisVal = drawData(data, options);\n drawAxisMarks(data, options, maxAxisVal);\n var chartWidth = $(\".xyData\").width();\n drawXLabel(options, chartWidth, element);\n drawMainTitle(options, chartWidth, element);\n\n //THE CLICK EVENTS\n // Main title, X-Title and Y-Title editable on CLICK\n $(\".title, .xTitle, .yTitle\").click((event) => {\n if($(event.target).attr('class') === 'title'){\n var input = window.prompt(\"Enter name of chart\", \"\");\n $(event.target).closest('div').text(input)\n }else if($(event.target).attr('class') === 'xTitle'){\n var input = window.prompt(\"Enter name for x-axis\", \"\");\n $(event.target).closest('div').text(input)\n }else if($(event.target).attr('class') === 'yTitle'){\n var input = window.prompt(\"Enter value for y-axis\", \"\");\n $(event.target).closest('div').text(input)\n }\n });\n\n //Changes color of individual xLabel colors ON CLICK\n $(\".xLabel\").click((event) => {\n var input = window.prompt(\"Enter a color\", \"\");\n $(event.target).closest('div').css(\"color\", input);\n });\n\n //Changes color of individual YLabel colors ON CLICK\n $(\".yLabel\").click((event) => {\n var input = window.prompt(\"Enter a color\", \"\");\n $(event.target).closest('div').css(\"color\", input);\n });\n\n}", "title": "" }, { "docid": "48f1fea145c9a56a73f204df68731b0b", "score": "0.7339654", "text": "drawBars ( ) {\n this.singleBar\n .attr( 'class' , 'bar' )\n .attr( 'y' , this.innerHeight )\n .attr( 'x' , d => this.x( d.date ) )\n .attr( 'height' , 0 )\n .attr( 'width' , this.innerWidth / this.data.length +1 )\n // .attr( 'width' , this.x.bandwidth )\n .attr( 'data-date', d => d.dateString )\n .attr( 'data-gdp' , d => d.value )\n this.handleEvents( );\n return this;\n }", "title": "" }, { "docid": "157d745504e2a23303926a983bcac079", "score": "0.7297972", "text": "function callBarChart()\r\n{\r\n\r\nvar newdiv = document.createElement(\"div\");\r\nnewdiv.setAttribute(\"id\",\"Barchart\");\r\n\r\nvar heading = document.createElement(\"h3\");\r\nheading.setAttribute(\"id\",\"Barheading\");\r\n\r\ndocument.body.appendChild(newdiv);\r\ndocument.getElementById(\"Barchart\").appendChild(heading);\r\ndocument.getElementById(\"Barheading\").innerHTML='Bar Chart';\r\n\r\nvar refugeeCount=getTotals();\r\n\r\n\r\nvar canvas1 = d3.select(\"body\").\r\n\t\t\t\t\tappend(\"svg\").\r\n\t\t\t\t\tattr(\"width\",600).\r\n\t\t\t\t\tattr(\"height\",500).\r\n\t\t\t\t\tappend(\"g\").\r\n\t\t\t\t\tattr(\"transform\",\"translate(50,40)\");\r\n\r\n\r\nvar xaxisScale1 = d3.scaleLinear()\r\n\t\t\t\t.domain([240000,0])\r\n\t\t\t\t.range([40,400]);\r\n\r\n\r\nvar xaxis1=d3.axisLeft().scale(xaxisScale1);\r\n\r\nvar yaxisScale1 = d3.scaleLinear()\r\n\t\t\t\t.domain([1974,2016])\r\n\t\t\t\t.range([0,516]);\r\n\r\nvar yaxis1=d3.axisBottom().scale(yaxisScale1);\r\n\r\n\r\nvar heightscale1 = d3.scaleLinear()\r\n \t\t\t.domain([0,240000])\r\n \t\t\t.range([0,360]);\r\n\r\nvar widthScale = d3.scaleLinear()\r\n \t\t\t.domain([0,240000])\r\n \t\t\t.range([0,360]);\r\n\r\nvar rectangle1=canvas1.selectAll(\"rect\")\r\n\t\t\t\t\t.data(refugeeCount)\r\n\t\t\t\t\t.enter()\r\n\t\t\t\t\t.append(\"rect\")\r\n\t\t\t\t\t\t.attr(\"width\",12)\r\n\t\t\t\t\t\t.attr(\"height\",function(d) {return heightscale1(d);})\r\n\t\t\t\t\t\t//.attr(\"fill\",'red')\r\n\t\t\t\t\t\t.attr(\"y\",function(d,i){return (400-heightscale1(d));})\r\n\t\t\t\t\t\t.attr(\"x\",function(d,i){return (12*i);})\r\n\t\t\t\t\t\t.attr(\"fill\",\"red\")\r\n\t\t\t\t\t\t.attr(\"stroke\",\"white\")\r\n\t\t\t\t\t\t.attr(\"stroke-width\",\"1\")\r\n\t\t\t\t\t\t.attr(\"transform\",\"translate(\"+12+\",0)\");\r\n\r\ncanvas1.append(\"g\")\r\n\t\t.call(xaxis1.ticks(13).tickFormat(d3.formatPrefix(\".0\",1e3)));\r\n\r\ncanvas1.append(\"g\")\r\n\t\t.attr(\"transform\",\"translate(0,400)\")\r\n\t\t.call(yaxis1.ticks(8).tickFormat(d3.format(\"d\")));\r\n\r\n\r\n\t\r\n\r\ncanvas1.append(\"text\")\r\n\t\t.attr(\"x\",\"-150\")\r\n\t\t.attr(\"y\",\"12\")\r\n\t\t.text(\"Number of Refugees\")\r\n\t\t.attr(\"transform\",\"rotate(-90,50,100)\");\r\n\r\n\r\ncanvas1.append(\"text\")\r\n\t\t.attr(\"x\",\"-100\")\r\n\t\t.attr(\"y\",\"12\")\r\n\t\t.text(\"Year\")\r\n\t\t.attr(\"transform\",\"translate(350,425)\");\t\t\r\n\r\n}", "title": "" }, { "docid": "989234afde30bbed786e6fa4c524ef65", "score": "0.7267535", "text": "function drawChart1() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Toppings', 'Slices'],\n ['Mushrooms', 2],\n ['Onions', 4],\n ['Olives', 1],\n ['Corn', 1]\n ]);\n\n // Set chart options\n var options ={ chart: {\n title: 'Kinds of pizza I ate last night',\n },\n bars: 'horizontal', // Required for Material Bar Charts.\n \n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.charts.Bar(document.getElementById('chart_div1'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n }", "title": "" }, { "docid": "896aea0b2796eefda41cac5d4db1c8ee", "score": "0.7259166", "text": "function barchart_walk_post() {\n\n var svg = d3.select(\"#walk_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.walk_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.walk_post);})\n .attr(\"fill\", walk_post_color);\n });\n }", "title": "" }, { "docid": "41009cec75788b7ce3fce6fa379a0d78", "score": "0.7182167", "text": "function barchart_tap_post() {\n\n var svg = d3.select(\"#tap_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.tap_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.tap_post);})\n .attr(\"fill\", tap_post_color);\n });\n }", "title": "" }, { "docid": "0225770db5a47d60129d977e546a6c3b", "score": "0.71763694", "text": "function drawChart() {\n var ctx = canvas.getContext('2d');\n var myBarChart = new Chart(ctx, {\n type: 'bar',\n data: data,\n });\n}", "title": "" }, { "docid": "80fec091ee415233e385648788ff2787", "score": "0.715583", "text": "function draw(data) {\n\td3.select(\"body\")\n\t.append(\"div\")\n\t.attr(\"class\",\"chart\")\n\t.selectAll(\".bar\")\n\t.data(data.cash)\n\t.enter()\n\t.append(\"div\")\n\t.attr(\"class\",\"bar\")\n\t.style(\"width\", function(d){return d.count/100 + \"px\"})\n\t.style(\"outline\", \"1px solid black\")\n\t.text(function(d){return Math.round(d.count)});\n}", "title": "" }, { "docid": "44b3280d1a3e7a363eb65e3f7ab15760", "score": "0.71468574", "text": "function bars(parent) {\n parent.attr('transform', d => `translate(0, ${yScale(d.name)})`);\n\n //draw rects\n if(showRects === true) { \n for(let k = 0; k < seriesNames.length -1; k++) {\n parent.append('rect')\n .attr('class', 'bars')\n .attr('y', 0)\n .attr('height', () => yScale.bandwidth())\n .attr('x', d => xScale(d.groups[k].value))\n .attr('width', d => xScale(d.groups[k + 1].value) - xScale(d.groups[k].value))\n .attr('fill', d => colourScale(k));\n };\n } \n\n //connecting lines\n if (showLines === true){\n parent\n .append('line')\n .attr('x1', d => xScale(d.groups[0].value))\n .attr('x2', d => xScale(d.groups[seriesNames.length - 1].value))\n .attr('y1', d => yScale.bandwidth() / 2)\n .attr('y2', d => yScale.bandwidth() / 2)\n .attr('class', 'connector')\n }\n \n //circles\n if(showMarkers === true) {\n parent.selectAll('circle')\n .data(d => d.groups)\n .enter()\n .append('circle')\n .attr('r', rem / 2)\n .attr('cy', d => yScale.bandwidth() / 2)\n .attr('cx', d => xScale(d.value))\n .attr('fill', d => colourScale(d.name));\n }\n }", "title": "" }, { "docid": "5fdf4098d19373e2c2f8619925f43fdb", "score": "0.7080166", "text": "function insBarras(state) {\n\t\t\t\t\tconst { ctx, chart, scale } = state\n\t\t\t\t\tconst { x0, y0, x1, y1 } = chart.position\n\t\t\t\t\tctx.save()\n\t\t\t\t\t\n\t\t\t\t\tlet barMargin = 10\n\t\t\t\t\tlet barPadding = barMargin/2\n\t\t\t\t\tlet barsSize\n\t\t\t\t\tchart.bars.width == 0 ? barsSize = 1 : chart.bars.width == 1 ? barsSize = 0.8 : chart.bars.width == 2 ? barsSize = 0.6 : barsSize = 1\n\t\t\t\t\t\n\t\t\t\t\tif (chart.orientation == 'vertical') {\n\t\t\t\t\t\tlet width = (x1 - x0 - chart.style.innerPadding.x*2)\n\t\t\t\t\t\tlet height = (y1 - y0 - chart.style.innerPadding.y - chart.axis.width/2)\n\t\t\t\t\t\tlet barCont = (width - barMargin*chart.tags.length - barPadding*chart.tags.length)/chart.tags.length\n\t\t\t\t\t\tlet dy = scale.max == Math.max(...chart.values) ? height / Math.max(...chart.values) : height / scale.max\n\t\t\t\t\t\tlet x = chart.style.innerPadding.x + barMargin\n\t\t\t\t\t\tlet xPos = x0\n\t\t\t\t\t\tlet yPos = y1 - chart.axis.width/2\n\t\t\t\t\t\tlet borderBar = chart.bars.border.width\n\t\t\t\t\t\tlet vardx = barCont + barMargin + barPadding\n\t\t\t\t\t\tfor (let i = 0; i < chart.values.length; i++) {\n\t\t\t\t\t\t\tlet dx = vardx*i\n\t\t\t\t\t\t\tif (chart.bars.highlight.color != '') {\n\t\t\t\t\t\t\t\tresaltarBarras(state, xPos + x + dx,yPos,barCont - borderBar,-dy*chart.values[i], barPadding)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tctx.fillStyle = chart.bars.color\n\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\tctx.rect(xPos + x + dx + borderBar/2,yPos,barCont - 2*borderBar,-dy*chart.values[i])\n\t\t\t\t\t\t\tctx.closePath()\n\t\t\t\t\t\t\tctx.fill()\n\t\t\t\t\t\t\tif (borderBar > 0) {\n\t\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\t\tctx.lineWidth = borderBar\n\t\t\t\t\t\t\t\tctx.strokeStyle = chart.bars.border.color\n\t\t\t\t\t\t\t\tctx.moveTo(xPos + x + dx, yPos)\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx + barCont - borderBar,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t\tctx.lineTo(xPos + x + dx + barCont - borderBar, yPos)\n\t\t\t\t\t\t\t\tctx.stroke()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet height = (y1 - y0 - chart.style.innerPadding.y*2)\n\t\t\t\t\t\tlet width = (x1 - x0 - chart.style.innerPadding.x - chart.axis.width/2)\n\t\t\t\t\t\tlet barCont = (height - barMargin*chart.tags.length - barPadding*chart.tags.length)/chart.tags.length\n\t\t\t\t\t\tlet dx = scale.max == Math.max(...chart.values) ? width / Math.max(...chart.values) : width / scale.max\n\t\t\t\t\t\tlet x = chart.style.innerPadding.x + barMargin\n\t\t\t\t\t\tlet y = chart.style.innerPadding.y/2 + barMargin\n\t\t\t\t\t\tlet xPos = x0 + chart.axis.width/2\n\t\t\t\t\t\tlet yPos = y1\n\t\t\t\t\t\tlet borderBar = chart.bars.border.width\n\t\t\t\t\t\tconsole.log(barCont)\n\t\t\t\t\t\tlet vardx = barCont + barMargin + barPadding\n\t\t\t\t\t\tlet vardy = barCont + barMargin + barPadding\n\t\t\t\t\t\tfor (let i = 0; i < chart.values.length; i++) {\n\t\t\t\t\t\t\tlet dy = vardy*i\n\t\t\t\t\t\t\t// if (chart.bars.highlight.color != '') {\n\t\t\t\t\t\t\t// resaltarBarras(state, xPos + x + dx,yPos,barCont - borderBar,-dy*chart.values[i], barPadding)\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tctx.fillStyle = chart.bars.color\n\t\t\t\t\t\t\tctx.beginPath()\n\t\t\t\t\t\t\t// ctx.rect(xPos + x + dx + borderBar/2,yPos,barCont - 2*borderBar,-dy*chart.values[i])\n\t\t\t\t\t\t\tctx.rect(xPos,yPos - dy - y,dx*chart.values[i],-dx)\n\t\t\t\t\t\t\tconsole.log(chart.values[i])\n\t\t\t\t\t\t\tctx.closePath()\n\t\t\t\t\t\t\tctx.fill()\n\t\t\t\t\t\t\t// if (borderBar > 0) {\n\t\t\t\t\t\t\t// ctx.beginPath()\n\t\t\t\t\t\t\t// ctx.lineWidth = borderBar\n\t\t\t\t\t\t\t// ctx.strokeStyle = chart.bars.border.color\n\t\t\t\t\t\t\t// ctx.moveTo(xPos + x + dx, yPos)\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx + barCont - borderBar,yPos - dy*chart.values[i])\n\t\t\t\t\t\t\t// ctx.lineTo(xPos + x + dx + barCont - borderBar, yPos)\n\t\t\t\t\t\t\t// ctx.stroke()\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tctx.restore()\n\t\t\t\t\tctx.save()\n\t\t\t\t}", "title": "" }, { "docid": "5a99140eb7829a12fdec4f376b429ed3", "score": "0.7077882", "text": "function bar_chart() {\n d3.selectAll(\"svg\").remove();\n d3.selectAll(\"#stats_tb\").remove();\n d3.selectAll(\"#tooltip\").remove();\n\n // d3.selectAll(\"table\").remove();\n var d1 = document.getElementById(\"pie_chart\");\n var d2 = document.getElementById(\"bar_chart\");\n if (d2.style.display === \"none\") {\n d1.style.display = \"none\";\n d2.style.display = \"block\";\n }\n bar()\n }", "title": "" }, { "docid": "531abf741e0a5d4c51b12f67009fcdb1", "score": "0.705905", "text": "function draw(countData)\n {\n setScales(countData);\n\n setAxes();\n\n var bars = g.selectAll('.bar')\n .data(countData);\n\n bars.enter()\n .append('rect')\n .merge(bars)\n .attr('height', 0)\n .attr('y', drawHeight)\n .attr('x', function (d)\n {\n return xScale(d.key);\n })\n .attr('width', xScale.bandwidth())\n .transition().delay(function (d,i){ return i * 100;})\n .duration(1000)\n .attr('y', function (d)\n {\n return yScale(d.value);\n })\n\n .attr('height', function (d)\n {\n return drawHeight - yScale(d.value);\n })\n .attr('class', 'bar')\n .attr('fill', function (d)\n {\n return courtColors[courtTypes[d.key]];\n });\n\n bars.exit()\n .transition()\n .attr('height', 0)\n .remove();\n }", "title": "" }, { "docid": "ba15562ed7464d52e90be3623a3040aa", "score": "0.70257217", "text": "function barchart_voice_post() {\n\n var svg = d3.select(\"#voice_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.voice_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.voice_post);})\n .attr(\"fill\", voice_post_color);\n });\n }", "title": "" }, { "docid": "7d51e16d04001033683aa96e18e54711", "score": "0.70048934", "text": "function drawCanvasBars() {\n const width = canvas.node().width;\n const height = canvas.node().height;\n\n //object with prop and methods used to render graphics in canvas element\n let context = canvas.node().getContext('2d');\n\n // clear canvas\n context.clearRect(0, 0, width, height);\n\n for (let i = 0; i < filteredDatasetMonth.length; i++) {\n let d = filteredDatasetMonth[i];\n\n //draw rect\n context.fillStyle = `rgba(${rgb}, .1)`;\n context.fillRect(xScale(d.Time), 0, 3, height);\n }\n}", "title": "" }, { "docid": "403f8cc170bd1557abf5f8ed65a53def", "score": "0.6984549", "text": "function drawBar(data) {\r\n var wrapper = document.createElement(\"div\");\r\n wrapper.setAttribute(\"id\", \"chartdiv\");\r\n container.appendChild(wrapper);\r\n\r\n am4core.ready(function () {\r\n\r\n am4core.useTheme(am4themes_dataviz);\r\n am4core.useTheme(am4themes_animated);\r\n\r\n var chart = am4core.create(\"chartdiv\", am4charts.XYChart);\r\n\r\n chart.data = data.dateGrafic;\r\n\r\n var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());\r\n categoryAxis.dataFields.category = data.tipdategrafic;\r\n categoryAxis.renderer.grid.template.location = 0;\r\n categoryAxis.renderer.minGridDistance = 30;\r\n\r\n categoryAxis.renderer.labels.template.adapter.add(\"dy\", function (dy, target) {\r\n if (target.dataItem && target.dataItem.index & 2 == 2) {\r\n return dy + 25;\r\n }\r\n return dy;\r\n });\r\n\r\n var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n\r\n var series = chart.series.push(new am4charts.ColumnSeries());\r\n series.dataFields.valueY = \"numarAtacuri\";\r\n series.dataFields.categoryX = data.tipdategrafic;\r\n series.name = \"Attacks\";\r\n series.columns.template.tooltipText = \"{categoryX}: [bold]{valueY}[/]\";\r\n series.columns.template.fillOpacity = .8;\r\n\r\n var columnTemplate = series.columns.template;\r\n columnTemplate.strokeWidth = 2;\r\n columnTemplate.strokeOpacity = 1;\r\n\r\n\r\n chart.exporting.menu = new am4core.ExportMenu();\r\n chart.exporting.menu.align = \"left\";\r\n chart.exporting.menu.verticalAlign = \"top\";\r\n\r\n chart.exporting.menu.items = [{\r\n \"label\": \"...\",\r\n \"menu\": [{\r\n \"type\": \"csv\",\r\n \"label\": \"CSV\"\r\n },\r\n {\r\n \"type\": \"svg\",\r\n \"label\": \"SVG\"\r\n }\r\n ]\r\n }];\r\n\r\n chart.exporting.menu.items[0].menu.push({\r\n label: \"WebP\",\r\n type: \"custom\",\r\n options: {\r\n callback: function () {\r\n window.scrollTo(0, 0);\r\n html2canvas(document.getElementById(\"chartdiv\")).then(function (canvas) {\r\n var imageWeb = canvas.toDataURL(\"image/webp\", 0.9);\r\n var a = document.createElement('a');\r\n a.href = imageWeb;\r\n a.download = 'image/webp';\r\n a.click();\r\n });\r\n }\r\n }\r\n });\r\n chart.exporting.menu.items[0].icon = \"../resurse/Poze/SaveIcon.png\";\r\n });\r\n}", "title": "" }, { "docid": "36b8afaa3c5f7031583cc226c3fc0dd7", "score": "0.6969482", "text": "function barChart() {\n\t\t// approach based on http://bost.ocks.org/mike/chart/\n\t\t// call this as, eg.:\n\t\t// var myChart = d3.elts.barChart().width(...); \n\t\t// d3.select('body').datum(points).call(myChart);\n\t\t//\n\n\t\tvar margin = {top: 10, right: 20, bottom: 120, left: 60},\n\t\t\twidth = 760,\n\t\t\theight = 300,\n\t\t\tduration = 500,\n\t\t\tsvgClass = \"bar-chart\",\n\t\t\txValue = function(d) { return d[0]; },\n\t\t\tyValue = function(d) { return d[1]; },\n\t\t\txPadding = 0.1,\n\t\t\tyMin = function(data) { return Math.min(0, d3.min(data, function(d) {return d[1]})) }, // can be a constant\n\t\t\tyMax = function(data) { return Math.max(0, d3.max(data, function(d) {return d[1]})) }, // can be a constant\n\t\t\txScale = d3.scale.ordinal(),\n\t\t\tyScale = d3.scale.linear(),\n\t\t\txAxis = d3.svg.axis().scale(xScale).orient(\"bottom\").tickSize(6, 0), // set to null for none (faster than hiding it)\n\t\t\txAxisIfBarsWiderThan = null, // set this to only show the xAxis if the bars are wider than some amount\n\t\t\txAxisTickFormat = null, // can be a function of the actual data, not just the primary id, eg. function(d) { return d[2] }\n\t\t\txAxisText = function(textSel) {textSel.attr(\"x\", -8)\n\t\t\t\t\t\t\t.attr(\"y\", 0)\n\t\t\t\t\t\t\t.attr(\"dy\", \".35em\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t\t\t\t\t.style(\"text-anchor\", \"end\");\n\t\t\t\t\t\t},\n\t\t\txAxisAnimate = true,\n\t\t\tyValueOfXAxis = 0, // or a function of the data\n\t\t\tcommasFormatter = d3.format(\",.0f\"),\n\t\t\tyAxis = d3.svg.axis().orient(\"left\").tickSize(6, 0).tickFormat(commasFormatter), // set to null for none (faster than hiding it)\n\t\t\tyNoOverlap = 18,\n\t\t\tfill = function(d) { return d[1]>=0 ? \"#66BB66\" : \"#BB6666\" },\n\t\t\tstroke = function(d) { return d[1]>=0 ? \"gray\" : \"#BB6666\" },\n\t\t\tmouseOver = function() {}, // function(elt, d) {}\n\t\t\tmouseOut = function() {}, // function(elt, d) {}\n\t\t\trangeWidget = null,\n\t\t\txDomain = null; // set this to positions [start, end] into the data, to restrict the x domain\n\n\t\tvar hadXAxis = false;\n\n\t\tfunction chart(selection) {\n\n\t\t\tfunction update(elt, data) {\n\n\t\t\t\tvar heightWithoutRange = height - (rangeWidget ? rangeWidget.height() : 0);\n\t\t\t\t// Convert data to standard representation greedily;\n\t\t\t\t// this is needed for nondeterministic accessors.\n\t\t\t\t// (After this, d[0] is x and d[1] is y; don't use X and Y fns)\n\t\t\t\t\n\t\t\t\tif (_.isArray(data[0])) {\n\t\t\t\t\t// make sure d[0] and d[1] are the x and y values, but leave the rest\n\t\t\t\t\t_.each(data, function(d, i) {\n\t\t\t\t\t\td[0] = xValue.call(data, d, i);\n\t\t\t\t\t\td[1] = yValue.call(data, d, i);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// if data is not an array of arrays, turn it into one\n\t\t\t\t\tdata = _.map(data, function(d, i) {\n\t\t\t\t\t\treturn [xValue.call(data, d, i), yValue.call(data, d, i)];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!xDomain) {\n\t\t\t\t\txDomain = [0, data.length-1];\n\t\t\t\t}\n\t\t\t\tvar subdata = data.slice(xDomain[0], xDomain[1]+1);\n\t\t\t\tfunction getDataLine(x) {\n\t\t\t\t\tvar matches = _.filter(subdata, function(d) { return d[0]===x});\n\t\t\t\t\tif (matches.length!==1) { throw \"cannot find \"+x+\" in data\"; } // shouldn't happen\n\t\t\t\t\treturn matches[0];\n\t\t\t\t}\n\t\t\t\t// Update the x-scale.\n\t\t\t\txScale.rangeBands([0, width - margin.left - margin.right], xPadding)\n\t\t\t\t\t.domain(_.map(subdata, function(d) {return d[0]}));\n\t\t\t\t\n\t\t\t\t// Update the y-scale.\n\t\t\t\t// Note d3.functor allows for constants or functions\n\t\t\t\t// - see https://github.com/mbostock/d3/wiki/Internals#functor\n\t\t\t\tyScale\n\t\t\t\t\t.domain([d3.functor(yMin)(subdata), d3.functor(yMax)(subdata)])\n\t\t\t\t\t.range([(heightWithoutRange - margin.top - margin.bottom), 0]);\n\t\t\t\t\n\t\t\t\t// Select the svg element, if it exists.\n\t\t\t\tvar svg = d3.select(elt).selectAll(\"svg.\"+svgClass).data([1]);\n\n\t\t\t\t// Otherwise, create the svg and the g.\n\t\t\t\tvar gEnter = svg.enter().append(\"svg\").attr(\"class\",svgClass).append(\"g\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"bars\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"x axis\");\n\t\t\t\tgEnter.append(\"g\").attr(\"class\", \"y axis\");\n\n\t\t\t\t// Update the inner dimensions.\n\t\t\t\tvar g = svg.select(\"g\")\n\t\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\t\t\t\t\n\t\t\t\tvar bars = g.select(\"g.bars\").selectAll(\"rect.bar\")\n\t\t\t\t\t.data(subdata, function(d) {return d[0]});\n\t\t\t\t\n\t\t\t\t// ENTER\n\t\t\t\tbars.enter().append(\"rect\")\n\t\t\t\t\t.attr(\"class\", \"bar\")\n\t\t\t\t\t.attr(\"x\", xX )\n\t\t\t\t\t.attr(\"y\", yScale(0) )\n\t\t\t\t\t.attr(\"height\", 0 )\n\t\t\t\t\t.attr(\"width\", xScale.rangeBand())\n\t\t\t\t\t.attr(\"fill\", fill)\n\t\t\t\t\t.attr(\"stroke\", stroke);\n\t\t\t\t\n\t\t\t\t// UPDATE\n\t\t\t\tbars.on(\"mouseover\", function(d) { mouseOver(this, d) }) // put these on the update in case they have changed\n\t\t\t\t\t.on(\"mouseout\", function(d) { mouseOut(this, d) })\n\t\t\t\t\t.transition()\n\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t.attr(\"x\", xX )\n\t\t\t\t\t\t.attr(\"y\", function(d) { return d[1]>0 ? yY(d) : yScale(0) } )\n\t\t\t\t\t\t.attr(\"height\", function(d) { return Math.abs(yY(d)-yScale(0)) } )\n\t\t\t\t\t\t.attr(\"width\", xScale.rangeBand())\n\t\t\t\t\t\t.attr(\"fill\", fill)\n\t\t\t\t\t\t.attr(\"stroke\", stroke);\n\n\t\t\t\t// EXIT\n\t\t\t\tbars.exit().transition()\n\t\t\t\t\t.duration(duration)\n\t\t\t\t\t.attr(\"y\", yScale(0) )\n\t\t\t\t\t.attr(\"height\", 0 )\n\t\t\t\t\t.remove();\n\t\t\t\t\n\t\t\t\t// Update the outer dimensions.\n\t\t\t\tsvg .attr(\"width\", width)\n\t\t\t\t\t.attr(\"height\", heightWithoutRange);\n\n\t\t\t\tif (xAxis && xScale.rangeBand()>=xAxisIfBarsWiderThan) {\n\t\t\t\t\t// Update the x-axis.\n\t\t\t\t\tif (xAxisTickFormat) {\n\t\t\t\t\t\t// don't just set it directly using xAxis.tickFormat(xAxisTickFormat), \n\t\t\t\t\t\t// because xAxisTickFormat is a function(d) of the data line\n\t\t\t\t\t\t// whereas xAxis.tickFormat() takes a function of the string used in the domain\n\t\t\t\t\t\t// which might just be a non-human-readable id field\n\t\t\t\t\t\txAxis.tickFormat(function(x) { return xAxisTickFormat(getDataLine(x)) });\n\t\t\t\t\t}\n\t\t\t\t\tif (xAxisAnimate) {\n\t\t\t\t\t\t// this approach animates the x-axis onto the screen\n\t\t\t\t\t\tg.select(\".x.axis\")\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(0,\" + yScale(d3.functor(yValueOfXAxis)(data)) + \")\")\n\t\t\t\t\t\t\t\t.call(xAxis)\n\t\t\t\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// this approach immediately presents the x-axis\n\t\t\t\t\t\tg.select(\".x.axis\")\n\t\t\t\t\t\t\t.call(xAxis)\n\t\t\t\t\t\t\t\t.attr(\"transform\", \"translate(0,\" + yScale(d3.functor(yValueOfXAxis)(data)) + \")\")\n\t\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\t}\n\t\t\t\t\tg.select(\".x.axis\")\n\t\t \t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t\t\t.on(\"mouseover\", function(x) { mouseOver(this, getDataLine(x)) })\n\t\t\t\t\t\t\t.on(\"mouseout\", function(x) { mouseOut(this, getDataLine(x)) })\n\t\t\t\t\t\t\t.call(xAxisText);\n\t\t\t\t\thadXAxis = true;\n\t\t\t\t} else if (hadXAxis) {\n\t\t\t\t\tg.select(\".x.axis\").selectAll(\".tick\").remove();\n\t\t\t\t\thadXAxis = false;\n\t\t\t\t}\n\n\t\t\t\tif (yAxis) {\n\t\t\t\t\t// Update the y-axis. Note if you turn the yAxis on/off dynamically it won't pick up the change\n\t\t\t\t\tvar dataMin = d3.min(subdata, function(d) {return d[1]}),\n\t\t\t\t\t\tdataMax = d3.max(subdata, function(d) {return d[1]});\n\t\t\t\t\tvar tickValues = [0];\n\t\t\t\t\tif (yScale(dataMin)-yScale(0)>yNoOverlap) {tickValues.push(dataMin); } // only if it won't overlap 0\n\t\t\t\t\telse if (dataMin<0) {tickValues.push(yScale.invert(yScale(0)+yNoOverlap))} // if neg data but min near 0, show domain limit\n\t\t\t\t\tif (yScale(dataMax)-yScale(0)<-yNoOverlap) {tickValues.push(dataMax); }\n\t\t\t\t\telse if (dataMax>0) {tickValues.push(yScale.invert(yScale(0)-yNoOverlap))} // if pos data but max near 0, show domain limit\n\t\t\t\t\tyAxis.scale(yScale).tickValues(tickValues);\n\t\t\t\t\tg.select(\".y.axis\")\n\t\t\t\t\t\t\t.transition()\n\t\t\t\t\t\t\t.duration(duration)\n\t\t\t\t\t\t\t//.attr(\"transform\", \"translate(0,\" + yScale(0) + \")\")\n\t\t\t\t\t\t\t.call(yAxis);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tselection.each(function(data) {\n\t\t\t\t// generate chart here, using width & height etc;\n\t\t\t\t// use 'data' for the data and 'this' for the element\n\t\t\t\tvar elt = this;\n\t\t\t\tupdate(elt, data);\n\t\t\t\t// Update the range widget, if present\n\t\t\t\t// don't put this in the update method or it becomes circular\n\t\t\t\tif (rangeWidget) {\n\t\t\t\t\trangeWidget.width(width).margin({top:0, right:margin.right, bottom:0, left:margin.left});\n\t\t\t\t\trangeWidget.onDrag(function(start, end) { \n\t\t\t\t\t\txDomain = [Math.round(start), Math.round(end)];\n\t\t\t\t\t\tvar oldDur = duration;\n\t\t\t\t\t\tduration = 0;\n\t\t\t\t\t\tupdate(elt, data);\n\t\t\t\t\t\tduration = oldDur;\n\t\t\t\t\t});\n\t\t\t\t\td3.select(elt).datum([{\n\t\t\t\t\t\t\tscale: d3.scale.linear().domain([0,data.length-1]),\n\t\t\t\t\t\t\tstart: xDomain ? xDomain[0] : 0, \n\t\t\t\t\t\t\tend: xDomain ? xDomain[1] : data.length-1\n\t\t\t\t\t\t}]).call(rangeWidget);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// The x-accessor for the path generator; xScale xValue.\n\t\tfunction xX(d) {\n\t\t\treturn xScale(d[0]);\n\t\t}\n\n\t\t// The y-accessor for the path generator; yScale yValue.\n\t\tfunction yY(d) {\n\t\t\treturn yScale(d[1]);\n\t\t}\n\n\t\tchart.margin = function(_) {\n\t\t\tif (!arguments.length) return margin;\n\t\t\tmargin = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.width = function(_) {\n\t\t\tif (!arguments.length) return width;\n\t\t\twidth = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.height = function(_) {\n\t\t\tif (!arguments.length) return height;\n\t\t\theight = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.duration = function(_) {\n\t\t\tif (!arguments.length) return duration;\n\t\t\tduration = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xPadding = function(_) {\n\t\t\tif (!arguments.length) return xPadding;\n\t\t\txPadding = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisText = function(_) {\n\t\t\tif (!arguments.length) return xAxisText;\n\t\t\txAxisText = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yMin = function(_) {\n\t\t\tif (!arguments.length) return yMin;\n\t\t\tyMin = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yMax = function(_) {\n\t\t\tif (!arguments.length) return yMax;\n\t\t\tyMax = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxis = function(_) {\n\t\t\tif (!arguments.length) return xAxis;\n\t\t\txAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yAxis = function(_) {\n\t\t\tif (!arguments.length) return yAxis;\n\t\t\tyAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisIfBarsWiderThan = function(_) {\n\t\t\tif (!arguments.length) return xAxisIfBarsWiderThan;\n\t\t\txAxisIfBarsWiderThan = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisTickFormat = function(_) {\n\t\t\tif (!arguments.length) return xAxisTickFormat;\n\t\t\txAxisTickFormat = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xAxisAnimate = function(_) {\n\t\t\tif (!arguments.length) return xAxisAnimate;\n\t\t\txAxisAnimate = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.yValueOfXAxis = function(_) {\n\t\t\tif (!arguments.length) return yValueOfXAxis;\n\t\t\tyValueOfXAxis = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.x = function(_) {\n\t\t\tif (!arguments.length) return xValue;\n\t\t\txValue = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.y = function(_) {\n\t\t\tif (!arguments.length) return yValue;\n\t\t\tyValue = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.mouseOver = function(_) {\n\t\t\tif (!arguments.length) return mouseOver;\n\t\t\tmouseOver = _;\n\t\t\treturn chart;\n\t\t};\n\t\t\n\t\tchart.mouseOut = function(_) {\n\t\t\tif (!arguments.length) return mouseOut;\n\t\t\tmouseOut = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.stroke = function(_) {\n\t\t\tif (!arguments.length) return stroke;\n\t\t\tstroke = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.fill = function(_) {\n\t\t\tif (!arguments.length) return fill;\n\t\t\tfill = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.xDomain = function(_) {\n\t\t\tif (!arguments.length) return xDomain;\n\t\t\txDomain = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.rangeWidget = function(_) {\n\t\t\tif (!arguments.length) return rangeWidget;\n\t\t\trangeWidget = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\tchart.svgClass = function(_) {\n\t\t\tif (!arguments.length) return svgClass;\n\t\t\tsvgClass = _;\n\t\t\treturn chart;\n\t\t};\n\n\t\treturn chart;\n\t}", "title": "" }, { "docid": "dc2e4a80ae915bae3a8edff361a6614b", "score": "0.6953573", "text": "function drawBarGraph(labels, values, title) {\n\n //$(\"#chart_div\" + (graph - 1)).remove();\n\n //console.log(\"#chart_div\" + (graph - 1));\n\n var rows = [];\n console.log(labels)\n console.log(values)\n console.log(title)\n for (var i = 0; i <= labels.length; i++) {\n var row = []\n row.push(labels[i])\n row.push(values[i])\n rows.push(row)\n }\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Start-Points');\n data.addColumn('number', 'Times');\n data.addRows(rows);\n\n // Set chart options\n var chartWidth = 1000;\n\n var agraph = $(document.createElement(\"div\"));\n agraph.prop(\"id\", \"chart_div\" + graph);\n agraph.prop(\"class\", \"full\");\n $(\"#viewMatchesGraph-form\").append(agraph);\n\n //$(\"#chart_div\" + graph)[0].style.paddingLeft = ((window.innerWidth / 2) - (chartWidth / 2)) + \"px\";\n $(\"#chart_div\" + graph)[0].style.paddingLeft = \"15%\"; //padding-left\n //$(\"#chart_div\" + graph)[0].style.paddingBottom = \"1em\";\n\n var options = {\n 'title': title,\n 'width': chartWidth,\n 'backgroundColor': '#e9e9e9',\n chartArea: {\n width: \"30%\",\n height: \"50%\"\n },\n 'fontName': 'Exo 2'\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div' + graph));\n\n chart.draw(data, options);\n\n graph++;\n\n}", "title": "" }, { "docid": "c66c606f4a993c47958c2762acc775cd", "score": "0.6945343", "text": "function drawBar(canvas, context, i, barHeight ) {\n\tvar barWidth = bars[i]; \t\n\tvar y = (i+1)*barHeight;\t\t\n\tcontext.fillStyle = colors[i];\n\tcontext.fillRect(0, y, barWidth, barHeight);\t\n}", "title": "" }, { "docid": "0743785b81cffd49095134969d2aae00", "score": "0.69315815", "text": "function barchart_stand_post() {\n\n var svg = d3.select(\"#stand_post_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n // Create the chart:\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.stand_post);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.stand_post);})\n .attr(\"fill\", stand_post_color);\n });\n }", "title": "" }, { "docid": "d24bbf788a6c2719de19e5cdad04c7a8", "score": "0.691079", "text": "function drawBar(k){\n var bar_height = 20;\n d3.select(\"#chart svg\").append(\"g\").attr(\"class\",\"bar-rect-\"+k).attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(k*bar_height+margin.top)+\")\").selectAll(\"rect\").data(data.genomicProfileList[k].mutationList).enter().append(\"rect\")\n .on(\"click\",function(d){\n d3.select(this).style(\"fill\",\"red\")\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n })\n // .on(\"mouseover\",function(d){\n // d3.select(this).style(\"opacity\",\".8\");\n // tooltip.transition().style(\"opacity\",\"1\")\n // // console.log(d)\n // tooltip.html(d.geneSymbol)\n // .style(\"left\",(d3.event.pageX)+\"px\")\n // .style(\"top\",(d3.event.pageY)-15+\"px\")\n // })\n // .on(\"mouseout\",function(d){\n // d3.select(this).style(\"opacity\",\"1\");\n // tooltip.transition().style(\"opacity\",\"0\")\n // })\n .attr({\n width:width/(data.genomicProfileList[k].mutationList.length)-5,\n x:function(d,i){ return i*(width/(data.genomicProfileList[k].mutationList.length))},\n height:bar_height,\n y:k*bar_height+5\n }).style(\"fill\",\"#575757\").style(\"cursor\",\"pointer\");\n\n d3.select(\"svg\").append(\"g\").attr(\"class\",\"bar-text-\"+k).attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(k*bar_height+margin.top)+\")\").selectAll(\"text\").data(data.genomicProfileList[k].mutationList).enter().append(\"text\").text(function(d){\n return d.chromosome.substring(3,5);\n }).attr({\n \"text-anchor\":\"middle\",\n \"font-size\":\"10px\",\n x:function(d,i){ return i*(width/(data.genomicProfileList[k].mutationList.length))+8},\n y:k*bar_height+19,\n \"fill\":\"#FFF\",\n \"font-weight\":\"bold\",\n \"cursor\":\"pointer\"\n })\n .on(\"click\",function(d,i){\n d3.select(\".bar-rect-\"+k).select(\"rect:nth-child(\"+(i+1)+\")\").style(\"fill\",\"red\");\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n\n\n })\n // .on(\"mouseover\",function(d){\n // d3.select(this).style(\"opacity\",\".8\");\n // tooltip.transition().style(\"opacity\",\"1\")\n // // console.log(d)\n // tooltip.html(d.geneSymbol)\n // .style(\"left\",(d3.event.pageX)+\"px\")\n // .style(\"top\",(d3.event.pageY)-15+\"px\")\n // })\n // .on(\"mouseout\",function(d){\n // d3.select(this).style(\"opacity\",\"1\");\n // tooltip.transition().style(\"opacity\",\"0\")\n // })\n }", "title": "" }, { "docid": "5054763f91b71afed11991c67bf8c227", "score": "0.6906916", "text": "function barChart(responsedata,window,id,visualizationMethod) {\n\tvar dataObject = trimBarChart(responsedata);\t\n\treturn d3BarChart(dataObject,id,tooltipBarChartPlot,null);\n}", "title": "" }, { "docid": "16d85c59744f1c238d70dce941c72ff4", "score": "0.68778116", "text": "function loadbar(data)\r\n{\r\n\r\n // make an svg for the chart\r\n barsvg = d3.select(\"body\").append(\"svg\").attr(\"class\", \"barchart\")\r\n .attr(\"width\", BARWIDTH)\r\n .attr(\"height\", BARHEIGHT)\r\n\r\n // Produce the axis (yscale domain is hardcoded for readability)\r\n xScale = d3.scaleBand().domain(keys).range([PADDING, BARWIDTH]).padding(0.1)\r\n xAxis = barsvg.append(\"g\").attr(\"transform\", \"translate(0, \" + (BARHEIGHT - PADDING) + \")\")\r\n .call(d3.axisBottom(xScale));\r\n yScale = d3.scaleLinear().domain([0, 215]).range([BARHEIGHT - PADDING, PADDING]).nice()\r\n yAxis = barsvg.append(\"g\").attr(\"transform\", \"translate(\"+ PADDING + \", 0)\")\r\n .call(d3.axisLeft(yScale));\r\n\r\n // Make the text to show what catagory is currently active\r\n bartext = barsvg.append(\"text\").attr(\"class\", \"bartext\")\r\n .attr(\"x\", 100).attr(\"y\", 20)\r\n barsvg.append(\"line\").attr(\"class\", \"averageline\").style(\"stroke\", \"rgb(255,0,0)\")\r\n\r\n // make placeholder bars\r\n bars = barsvg.append(\"g\").attr(\"class\", \"bars\")\r\n .selectAll(\"rect\").data(keys).enter().append(\"rect\")\r\n\r\n // and placeholder tooltip\r\n bars.append(\"title\")\r\n\r\n // returns a function where you can update this graph\r\n // accept an object in the form of {type1: \"string\", type2: \"string\"}\r\n return function(types)\r\n {\r\n text = \"Maintype: \" + types.type1\r\n\r\n // make an object to store all stats\r\n attributes = {}\r\n keys.forEach(function(key)\r\n {\r\n attributes[key] = []\r\n })\r\n\r\n // gets all the nessecary stats from the data stores them in the right location\r\n if (types.type2 === undefined)\r\n {\r\n data.forEach(function(datapoint)\r\n {\r\n if (datapoint.Type1 === types.type1)\r\n {\r\n for (key in datapoint)\r\n {\r\n if (keys.includes(key))\r\n {\r\n attributes[key].push(datapoint[key])\r\n }\r\n }\r\n }\r\n })\r\n }\r\n else\r\n {\r\n text += \" and Subtype: \" + types.type2\r\n data.forEach(function(datapoint)\r\n {\r\n if (datapoint.Type1 === types.type1 && datapoint.Type2 === types.type2)\r\n {\r\n for (key in datapoint)\r\n {\r\n if (keys.includes(key))\r\n {\r\n attributes[key].push(datapoint[key])\r\n }\r\n }\r\n }\r\n })\r\n }\r\n\r\n // average all the stats\r\n for (key in attributes)\r\n {\r\n attributes[key] = average(attributes[key])\r\n }\r\n\r\n // update the graph bars\r\n bars.data(Object.values(attributes)).transition().duration(1000)\r\n .attr(\"width\", xScale.bandwidth())\r\n .attr(\"x\", function(d, i) { return xScale(Object.keys(attributes)[i])})\r\n .attr(\"y\", d => yScale(d))\r\n .attr(\"height\", d => yScale(0) - yScale(d))\r\n .attr(\"fill\", colorfunction(types.type1))\r\n .select(\"title\").text(d => d)\r\n\r\n // update the text\r\n d3.select(\".bartext\").text(text)\r\n\r\n // update the averageline\r\n averagestats = average(Object.values(attributes))\r\n d3.select(\".averageline\")\r\n .attr(\"x1\", PADDING).attr(\"x2\", BARWIDTH)\r\n .attr(\"y1\", yScale(averagestats)).attr(\"y2\", yScale(averagestats))\r\n }\r\n}", "title": "" }, { "docid": "686bb54d8b78e0947965ed436918f00a", "score": "0.68606806", "text": "function drawBarGraph(arr, max) {\n\tvar data = google.visualization.arrayToDataTable(arr);\n\n var options = {\n title: 'Clinic Breakdown',\n hAxis: {title: 'Sites', titleTextStyle: {color: 'red'}},\n vAxis: {viewWindowMode: 'explicit', viewWindow: {max:max+1,min:0}}\n };\n\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "6d4e98dbe8da9c399f887301eaf62d01", "score": "0.68572176", "text": "function drawTotalRevChart(data){\n data = reformatData(data);\n //sort bars based on value\n\n //set up svg using margin conventions - we'll need plenty of room on the left for labels\n var margin = {\n top: 15,\n right: 120,\n bottom: 30,\n left: 60\n };\n\n var width = 960 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\n var svg = d3.select(\"#total_rev_by_date_chart_wrapper\").append(\"svg\")\n .attr('viewBox', '0 0 960 500')\n .append(\"g\")\n .attr('class','chart_wrapper')\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n svg.call(tip); \n\n var y = d3.scale.linear()\n .range([height, 0])\n .domain([0, d3.max(data, function(d) { \n return d.totalrev;\n })]);\n \n var x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1)\n .domain(data.map(function(d) {\n return d.daysold;\n }));\n\n //make y axis to show bar names\n var yAxis = d3.svg.axis()\n .scale(y)\n //no tick marks\n .tickSize(0)\n .orient(\"left\");\n\n var xAxis = d3.svg.axis().scale(x).tickSize(6).orient('bottom').tickFormat(function(d){return 'Day'+d;});\n\n var gy = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n\n var gx = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n\n var bars = svg.selectAll(\".bar\")\n .data(data)\n .enter()\n .append(\"g\")\n\n //append rects\n bars.append(\"rect\")\n // .transition()\n .attr(\"class\", \"bar\")\n .attr(\"y\", function(d) {\n return y(d.totalrev);\n })\n .attr(\"height\",function(d){\n return height - y(d.totalrev)\n })\n .attr(\"x\", function(d){\n return x(d.daysold);\n })\n .attr(\"width\",function(d){ \n return x.rangeBand();\n })\n .on(\"mouseover\", tip.show)\n .on(\"mouseout\", tip.hide);\n }", "title": "" }, { "docid": "c32b984914396d30d3a432efae6ebef4", "score": "0.68541926", "text": "function drawBarChartBars(max)\r\n{\r\n\tcanvas1.cx.lineWidth = 1;\r\n\tcanvas1.cx.fillStyle = color.initial;\r\n\tcanvas1.cx.strokeStyle = '#222222';\r\n\tfor ( var i = 0; i < 6; i++ ) {\r\n\t\tif ( mode == \"mole\" ) {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth/6*i+7,\r\n\t\t\t\t\tcanvas1.scale*moles[0][i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth/6*i+7,\r\n\t\t\t\t\tcanvas1.scale*moles[0][i]*molarMass[i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t}\r\n\r\n\tcanvas1.cx.lineWidth = 1;\r\n\tcanvas1.cx.fillStyle = color.end;\r\n\tcanvas1.cx.strokeStyle = '#222222';\r\n\tfor ( var i = 0; i < 6; i++ ) {\r\n\t\tif ( mode == \"mole\" ) {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth*(2*i+1)/12,\r\n\t\t\t\t\tcanvas1.scale*moles[2][i],\r\n\t\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdrawBar(canvas1.graphLeft+canvas1.graphWidth*(2*i+1)/12,\r\n\t\t\t\tcanvas1.scale*moles[2][i]*molarMass[i],\r\n\t\t\t\tcanvas1.graphWidth/12 - 7);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "473f1dda71b8ec74a9351ef8aaba38aa", "score": "0.6850442", "text": "function barChart(dataset) {\n\n // Create the canvas\n const svg = d3.select(\".bar-chart\")\n .append(\"svg\")\n .attr(\"width\", w + margin.left + margin.right)\n .attr(\"height\", h + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top})`);\n\n // x and y axises\n const dateInfo = dataset.map(d => new Date(d[0]));\n const xMin = d3.min(dateInfo);\n const xMax = d3.max(dateInfo);\n xMax.setMonth(xMax.getMonth() + 3);\n const xScale = d3.scaleTime().domain([xMin, xMax]).range([0, w]);\n const xAxis = d3.axisBottom(xScale);\n\n const yMax = d3.max(dataset, d => d[1]);\n const yScale = d3.scaleLinear().domain([0, yMax]).range([h, 0]);\n const yAxis = d3.axisLeft(yScale);\n svg.append(\"g\")\n .attr(\"id\", \"x-axis\")\n .attr(\"transform\", \"translate(0,\"+ h +\")\")\n .call(xAxis);\n svg.append(\"g\")\n .attr(\"id\", \"y-axis\")\n .call(yAxis);\n\n // chart title\n svg.append(\"text\")\n .attr(\"x\", w * 0.32)\n .attr(\"y\", 40)\n .attr(\"id\", \"title\")\n .text(\"United States GDP (1947 - 2015)\");\n svg.append(\"text\")\n .attr(\"x\", -300)\n .attr(\"y\", 20)\n .style(\"font-size\", 14 + \"px\")\n .attr(\"transform\", \"rotate(-90)\")\n .text(\"Gross Domestic Product ($ Billions)\");\n svg.append(\"text\")\n .attr(\"x\", w * 0.58)\n .attr(\"y\", h + 40)\n .style(\"font-size\", 14 + \"px\")\n .text(\"More Information: http://www.bea.gov/national/pdf/nipaguid.pdf\");\n\n // plot the bar chart\n const barWidth = w / dataset.length;\n const bars = svg.selectAll(\"rect\")\n .data(dataset)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"data-date\", d => d[0])\n .attr(\"data-gdp\", d => d[1])\n .attr(\"x\", (d,i) => barWidth * i)\n .attr(\"y\", d => yScale(d[1]))\n .attr(\"width\", barWidth)\n .attr(\"height\", d => h - yScale(d[1]));\n\n // tooltip\n bars.on(\"mouseover\", function(d) {\n const xPos = parseFloat(d3.select(this).attr(\"x\")) + margin.left + margin.right;\n const yPos = (parseFloat(d3.select(this).attr(\"y\")) + h - margin.top) / 2;\n const toQuarter = function(d) {\n let y = parseInt(d.split(\"-\")[0], 10);\n let q = Math.floor(parseInt(d.split(\"-\")[1], 10) / 3) + 1;\n return `${y} Q${q}`;\n }\n d3.select(\"#tooltip\")\n .style(\"top\", yPos + \"px\")\n .style(\"left\", xPos + \"px\")\n .attr(\"data-date\", d[0])\n .classed(\"hidden\", false);\n\n d3.select(\"#tooltip-date\")\n .text(toQuarter(d[0]));\n\n d3.select(\"#tooltip-value\")\n .text(` $${d[1]} Billions`);\n });\n\n bars.on(\"mouseout\", function(d) {\n d3.select(\"#tooltip\")\n .classed(\"hidden\", true);\n })\n\n }", "title": "" }, { "docid": "0b19341f5cc4017b01a993f5476fb663", "score": "0.6848555", "text": "function barchart_tap_pre() {\n\n var svg = d3.select(\"#tap_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n \n // Load data:\n var idate = 0;\n d3.csv(data_file, function (error, data) {\n\n // axes:\n data.forEach(function (d) {\n idate = idate + 1;\n d.date = parseDate(d.date);\n d.datenum = idate;\n });\n xScale = d3.scale.linear() // time.scale()\n .range([0, width])\n .domain([0, idate]); //data.map(function (d) { return +d.datenum; }));\n xAxis = d3.svg.axis().scale(xScale).orient(\"bottom\").ticks(31);\n yAxis = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\")\n .ticks(1);\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,80)\")\n .call(xAxis);\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(-10,0)\")\n .call(yAxis);\n svg.select(\"g.x\").call(xAxis);\n svg.select(\"g.y\").call(yAxis);\n\n svg.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.tap_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.tap_pre);})\n .attr(\"fill\", tap_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n\n\n });\n }", "title": "" }, { "docid": "daa42cffe800223189608c945972bd9a", "score": "0.6845109", "text": "function render_bar(dat,canvas) {\n \n var tag = canvas.node().parentNode.getAttribute(\"id\");\n \n // Get the unique keys, for the scale domain\n // Only take countries with immigration > 5,000 people in that year\n // Sort by values\n dat = dat.sort(function(a,b) { return b.values - a.values;})\n .filter(function(d) { return d.values > 1000; });\n \n \n var keys = dat.map(function(d) { return d.key.toString(); });\n \n \n // Tooltips\n var tooltip = d3.select(\"#\" + tag)\n .append(\"div\")\n .attr({\n \"class\": \"tooltip\"\n })\n .style({\n \"opacity\": 0\n })\n ;\n \n // Scales\n \n var x_scale = d3.scale.ordinal()\n .domain(keys)\n .rangeBands([padding + 5,w - padding])\n ;\n \n var y_scale = d3.scale.linear()\n .domain([0,d3.max(dat,function(d) { return +d.values; })])\n .range([h - padding, padding])\n ;\n \n // Axes\n \n var x_axis_gen = d3.svg.axis()\n .scale(x_scale)\n .orient(\"bottom\")\n .tickValues(0)\n ;\n\n \n var y_axis_gen = d3.svg.axis()\n .scale(y_scale)\n .orient(\"left\")\n ;\n\n \n // Draw bars\n canvas.selectAll(\"rect\")\n .data(dat)\n .enter()\n .append(\"rect\")\n .attr({\n x: function(d) { return x_scale(d.key); },\n y: function(d) { return y_scale(+d.values); },\n width: w / 70,\n height: function(d) { return h - y_scale(+d.values) - padding; },\n \"fill\": \"#0099FF\",\n \"stroke\": \"#000000\",\n \"stroke-width\": 1.4\n })\n .on(\"mouseover\", function(d) {\n\n \n // Render tooltip on svg parent\n \n tooltip.style({\n \"left\": (w - 5*padding) + \"px\",\n \"top\": (h - 5*padding) + \"px\",\n \"opacity\": 1,\n \"font-size\": \"20px\"\n })\n .html(\"<strong>\" + d.key + \" : \" + comma_format(d.values) + \"</strong>\")\n ;\n \n d3.select(this).transition().duration(200)\n .attr({\n \"fill\": \"#FFA600\",\n x: function(d) { return x_scale(d.key) - w/280; },\n y: function(d) { return y_scale(+d.values) - padding/2;},\n \"width\": w / 50,\n \"height\": function(d) { return h - y_scale(+d.values) - padding/2;}\n })\n })\n .on(\"mouseout\", function() {\n tooltip.style({\n \"opacity\": 0\n });\n \n d3.select(this).transition().duration(150)\n .attr({\n width: w / 70,\n height: function(d) { return h - y_scale(+d.values) - padding; },\n \"fill\": \"#0099FF\",\n y: function(d) { return y_scale(+d.values); },\n x: function(d) { return x_scale(d.key); }\n })\n })\n ;\n \n // Axes\n var x_axis = canvas.append(\"g\")\n .attr({\n \"class\": \"axis\",\n \"transform\": \"translate(0,\" + (h - padding) + \")\"\n })\n .call(x_axis_gen)\n ;\n \n var y_axis = canvas.append(\"g\")\n .attr({\n \"class\": \"axis\",\n \"transform\": \"translate(\" + padding + \",0)\"\n })\n .call(y_axis_gen)\n .selectAll(\".tick\")\n .select(\"text\")\n .on(\"mouseover\", function() {\n d3.select(this).style({ \n \"font-size\": \"28px\"\n })\n .attr({\n x: 35\n })\n })\n .on(\"mouseout\", function() {\n d3.select(this).style({\n \"font-size\": \"12px\"\n })\n .attr({\n x: -9\n })\n })\n ;\n \n}", "title": "" }, { "docid": "76b72ffd63183393a6ded12c675f1a5d", "score": "0.68422234", "text": "function drawBar(left, height, width)\r\n{\r\n\tdepth = canvas1.barDepth;\r\n\tslant = canvas1.barSlant;\r\n\tcanvas1.cx.beginPath();\r\n\tcanvas1.cx.rect(left, canvas1.graphBottom, width, -height);\r\n\tcanvas1.cx.fill();\r\n\tcanvas1.cx.stroke();\r\n\tif ( canvas1.threeD ) {\r\n\t\t// Top\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(left, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.lineTo(left + slant, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + slant + width, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.closePath();\r\n\t\tcanvas1.cx.fill();\r\n\t\tcanvas1.cx.stroke();\r\n\t\t// Right\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(left + slant + width, canvas1.graphBottom - height - depth);\r\n\t\tcanvas1.cx.lineTo(left + slant + width, canvas1.graphBottom - depth);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom);\r\n\t\tcanvas1.cx.lineTo(left + width, canvas1.graphBottom - height);\r\n\t\tcanvas1.cx.closePath();\r\n\t\tcanvas1.cx.fill();\r\n\t\tcanvas1.cx.stroke();\r\n\t}\r\n}", "title": "" }, { "docid": "50fba235f1f56dd80c5d7edc97bb407c", "score": "0.6839611", "text": "drawBars() {\n if (!this.location || (this.data.displayBars === CONST.TOKEN_DISPLAY_MODES.NONE)) return;\n [\"bar1\", \"bar2\"].forEach((b, i) => {\n const bar = this.bars[b];\n const attr = this.getBarAttribute(b);\n if (!attr || (attr.type !== \"bar\")) return bar.visible = false;\n this._drawBar(i, bar, attr);\n bar.visible = true;\n });\n }", "title": "" }, { "docid": "8e8dd7a564fe0313cdad198a3dc0d6fd", "score": "0.68370193", "text": "function drawChart1() {\n\n var data = google.visualization.arrayToDataTable([\n ['Toppings', 'Slices'],\n ['Cheese', 1],\n ['Taco', 3],\n ['Veggie Thai', 2],\n ['Hawaiian', 3],\n ['Pepperoni', 2]\n ]);\n\n var options = {\n chart: {\n title: 'Pizza Eaten by Slices',\n },\n bars: 'horizontal' // Required for Material Bar Charts.\n \n };\n\n var chart = new google.charts.Bar(document.getElementById('chart_div1'));\n\n chart.draw(data, google.charts.Bar.convertOptions(options));\n}", "title": "" }, { "docid": "83073e0941e1968a67574d56c6508715", "score": "0.682197", "text": "async function CreateBarChart() {\n try {\n await CreateBarOrColumnChart(barChartFlag);\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "160f8da9092f62d6266f8fbbabfea6df", "score": "0.68187046", "text": "function drawColumnChart2() {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'type');\n data.addColumn('number', 'Planned Duration');\n data.addColumn('number', 'Real Duration');\n data.addRows(barchart2.length);\n $.each(barchart2,function(index,item){\n data.setValue(index, 0, item.name);\n data.setValue(index, 1, item.planned);\n data.setValue(index, 2, item.real);\n });\n\n var chart = new google.visualization.BarChart($(\"#chart2 .chart\")[0]);\n chart.draw(data, {\n width: 300,\n height: 250,\n colors:[\"#D00000\",\"#000000\"],\n legend:'none',\n min:0,\n hAxis:{title:'Days'},\n vAxis:{title:'Planned VS Real'},\n fontSize:12,\n titleFontSize:11\n });\n}", "title": "" }, { "docid": "55850a490980754c2355f3d29cd2174f", "score": "0.68116295", "text": "draw() {\n\n\t let width = 500;\n\t let height = 250;\n\t let vPadding = 20;\n\t let hPadding = 25;\n\t let barPadding = 2;\n\t let max = 0;\n//\t let barWidth = (width-2*hPadding-barPadding*this.countries.length )/ this.countries.length;\n\n\t let names = [];\n\t for( let c of this.worldData )\n\t\t names.push(c[\"geo.name\"]);\n\n\t let xScale = d3.scaleBand()\n\t\t.domain(names)\n\t\t.rangeRound([hPadding, width-hPadding])\n\t\t.paddingInner(0.05);\n\t let xAxis = d3.axisBottom().scale(xScale);\n\n\t let yScale = d3.scaleLinear()\n\t\t.domain([0,100])\n\t\t.range([height - vPadding, vPadding]);\n\t let yAxis = d3.axisLeft().scale(yScale);\n\n\t d3.select(\"#barchartsvg\").remove();\n \n\t //build svg\n\t let svg = d3.select(\"#barchart\").selectAll(\"#barchartsvg\")\n\t\t.data([0])\n\t\t.enter()\n\t\t.append(\"svg\")\n\t\t.attr(\"width\",width)\n\t\t.attr(\"height\",height)\n\t\t.attr(\"id\",\"barchartsvg\")\n\t ;\n\n\t svg.selectAll(\"rect\")\n\t\t.data(this.worldData)\n\t\t.enter()\n\t\t.append(\"rect\")\n\t\t.attr(\"x\",d => xScale(d[\"geo.name\"]) )\n\t\t.attr(\"y\",d => yScale(d[this.year]))\n\t\t.attr(\"width\", xScale.bandwidth() )\n\t\t.attr(\"height\", d => yScale(0) - yScale(d[this.year]) )\n\t\t.attr(\"id\",d => d.geo + \"Bar\")\n\t\t.style(\"stroke\", \"black\" )\n\t\t.attr(\"class\", (d,i) => \"country\" + i)\n\t\t.on( \"mouseover\", d => time.hoverOnCountry(d.geo) )\n\t\t.on( \"mouseout\", d => time.hoverOffCountry(d.geo) )\n\t\t.on( \"click\", d => time.removeCountry(d.geo) )\n\t ;\n\n\t svg.selectAll(\"text\")\n\t\t.data(this.worldData)\n\t\t.enter()\n\t\t.append(\"text\")\n\t\t.attr(\"x\",d => xScale(d[\"geo.name\"]) + xScale.bandwidth()/ 2 )\n\t\t.attr(\"y\",d => yScale(d[this.year]) - 3 )\n\t\t.attr(\"class\", (d,i) => \"country\" + i)\n\t\t.classed(\"bartext\",true)\n\t\t.html( d => Math.round(d[this.year],0) )\n ;\n\n \t svg.append(\"g\")\n\t\t.attr(\"class\",\"axis\")\n\t\t.attr(\"transform\",`translate(0,${height-vPadding})`)\n\t\t.call(xAxis);\n\n\t svg.append(\"g\")\n\t\t.attr(\"class\",\"axis\")\n\t\t.attr(\"transform\",`translate(${hPadding},0)`)\n\t\t.call(yAxis);\n\n }", "title": "" }, { "docid": "7ae977b451f9ee594cafad8328329ec7", "score": "0.67963856", "text": "function YDisplayLayer_drawBar(x1,y1,x2,y2)\n {\n return this.command_flush(\"B\"+String(Math.round(x1))+\",\"+String(Math.round(y1))+\",\"+String(Math.round(x2))+\",\"+String(Math.round(y2)));\n }", "title": "" }, { "docid": "dfa7c0a56f44a50c8d7470ca2b4382d5", "score": "0.67952436", "text": "function drawChart1() {\n\n // Create the data table.\n // var data = new google.visualization.DataTable();\n // data.addColumn('string', 'Topping');\n // data.addColumn('number', 'Slices');\n // data.addRows([\n // ['Mushrooms', 3],\n // ['Veggie Delight', 5],\n // ['Hawaaian', 4],\n // ['Pepperoni', 2]\n // ]);\n\n\n var data = google.visualization.arrayToDataTable([\n ['Toppings', 'Slices'],\n ['Mushrooms', 3],\n ['Veggie Delight', 5],\n ['Hawaaian', 4],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {\n chart: {\n title: 'Kinds of pizza I ate',\n\n },\n bars: 'horizontal' // Required for Material Bar Charts.\n };\n\n var chart = new google.charts.Bar(document.getElementById('chart_div1'));\n\n chart.draw(data, google.charts.Bar.convertOptions(options));\n}", "title": "" }, { "docid": "2e6e37b05ec158a5c11d835756eccb5d", "score": "0.67949843", "text": "drawChart() {\n this.svg = this.d3.select('#'+this.svgElementId)\n .attr(\"width\", this.width + this.margin.left + this.margin.right)\n .attr(\"height\", this.height + this.margin.top + this.margin.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + this.margin.left + \",\" + this.margin.top + \")\");\n\n\n this.xAxisSvg = this.svg.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n .call(this.xAxis)\n .select(\"g.text\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \"-.55em\")\n .attr(\"transform\", \"rotate(-45)\");\n\n this.yAxisSvg = this.svg\n .append(\"g\")\n .attr(\"class\", \"y-axis\")\n .call(this.yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Value ($)\");\n\n this.barChartHasDrawn = true;\n }", "title": "" }, { "docid": "0181fda8def028b10edcbb6f79f93d57", "score": "0.6792251", "text": "function drawStacked(result) {\n var data_ = Array((result.length + 1));\n\n data_[0] = ['clase', 'Probabilidad', { role: \"style\" }];\n data_[1] = [result[0].className, result[0].probability, '#982107'];\n\n for (iter = 1; iter < result.length; iter++) {\n data_[(iter + 1)] = [result[iter].className, result[iter].probability, '#6F76C2'];\n }\n\n var data = google.visualization.arrayToDataTable(data_);\n\n var view = new google.visualization.DataView(data);\n view.setColumns([0, 1,\n {\n calc: \"stringify\",\n sourceColumn: 1,\n type: \"string\",\n role: \"annotation\"\n },\n 2\n ]);\n\n var options = {\n width: 600,\n height: 200,\n bar: { groupWidth: \"95%\" },\n legend: { position: \"none\" },\n };\n\n\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(view, options);\n}", "title": "" }, { "docid": "fc82282e0292a448505136f0bcae884a", "score": "0.6790409", "text": "function drawBarAxis() {\n var barAxis = d3.select(\"#baraxis\");\n if (barAxis.empty()) {\n barAxis = barsvg.append(\"g\")\n .attr('class', 'baraxis');\n\n barAxis.append('line')\n .attr('x1', 20)\n .attr('y1', 20)\n .attr('x2', barwidth-20)\n .attr('y2', 20)\n .attr('stroke-width', 1)\n .attr('text-anchor', 'center')\n .attr('stroke', 'black');\n\n barAxis.append('text')\n .attr('x', 20)\n .attr('y', 10)\n .attr('font-size', 15)\n .text('How much you have earned so far');\n }\n}", "title": "" }, { "docid": "f7bf90183cf812ae0b42f4a298ef9da1", "score": "0.67807716", "text": "function drawBarChart(parent, data, chartTitle){ \n\tvar isArray = data instanceof Array;\n\n\ttry {\n\t\tvar chartData = google.visualization.arrayToDataTable(data);\n\n\t\tvar options = {\n\t\t\ttitle: chartTitle,\n\t\t};\n\t\tvar chart = new google.visualization.BarChart(parent);\n\t\tvar handler = new selectionHandler(chart, chartData, barSelectResponse);\n\t\tgoogle.visualization.events.addListener(chart, 'select', handler);\t\t\n\t\tchart.draw(chartData, options);\n\t}\n\tcatch (err) {\n\t\tconsole.log(\"Failed to create chart: \"+ err.message);\n\t}\n}", "title": "" }, { "docid": "013f51afe343ec496753687246c805e0", "score": "0.6775755", "text": "function drawBars(ID, maxVal, options, data) {\n //Append a container to the allData div for the bar being drawn\n $(\".allData\").append(\"<div class=data\" + ID + \"></div>\");\n //Set the bar to be displayed inline-block as the bars must be side by side\n $(\".data\" + ID).css({\n \"display\" : \"inline-block\",\n \"background-color\" : options[14]\n });\n\n function makeBottomBar(ID, i, data, options){\n $(\".dataBar\" + ID + i).css({\n \"border-top\" : \"1px solid black\",\n \"border-left\" : \"1px solid black\",\n \"border-right\" : \"1px solid black\"\n })\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)) \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"position\" : \"relative\",\n \"background-color\" : options[15] // Change later in the options\n });\n\n // Getting the data points styled\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n\n function makeTopBar(ID, i, data, options){\n if(options[23] === \"valDepend\"){\n $(\".dataBar\" + ID + i).css({\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n })\n }else{\n $(\".dataBar\" + ID + i).css({\n //Determine the width of each bar based on the width of the chart area\n \"width\": (options[22] / (data.length + 1)), \n })\n }\n $(\".dataBar\" + ID + i).css({ \n \"border\" : \"1px solid black\",\n \"position\" : \"relative\",\n \"background-color\" : options[16] // Change later in the options\n });\n\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n \n //for each datapoint in the bar, draw the bar (data for a single bar must be sorted from lowest-highest)\n for (var i = 1; i < data[ID].length; i++) {\n $(\".data\" + ID).prepend(\"<div class=dataBar\" + ID + i + \"><div class=dataPoint\" + i + \">\" + data[ID][i] + \"</div></div>\");\n if(i % 2 !== 0){ // BOTTOM BAR MAKING FUNCTION RUNNING\n makeBottomBar(ID, i, data, options)\n }else{ // TOP BAR MAKING FUNCTION RUNNING\n makeTopBar(ID, i, data, options)\n }\n\n //Set the dataPoint to display at either the top, middle or bottom of the bar\n if (options[19] === \"top\") {\n $(\".dataPoint\" + i).css(\"top\", \"5%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, 0%)\");\n } else if (options[19] === \"middle\") {\n $(\".dataPoint\" + i).css(\"top\", \"50%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -50%)\");\n } else {\n $(\".dataPoint\" + i).css(\"bottom\", \"0%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -10%)\");\n }\n //For multiple values, we calculate the remaining height needed to add above the currently drawn values to get the correct height of the bar\n var heightVal = (data[ID][i] / maxVal) * options[21];\n //console.log(heightVal + \" outside\");\n for (var j = 1; j < i; j++) {\n //heightVal = (((data[ID][j] / maxVal) * options[21]) - heightVal) * (-1);\n //console.log(heightVal);\n }\n $(\".dataBar\" + ID + i).css(\"height\", heightVal);\n }\n $(\".data\" + ID).css(\"border-bottom\", \"1px solid black\");\n //add the space between each bar\n $(\".allData\").append(\"<div class=barSpace></div>\");\n } // END OF DRAW BARS FUNCTION", "title": "" }, { "docid": "58457ac3e8287de804818adb439a7114", "score": "0.6771698", "text": "function drawChart(data)\n{\n\n //Invoke google's built in method to get data table object required by google.\n let chartData = google.visualization.arrayToDataTable(data);\n\n var options = {\n title: 'Total Service Orders',\n bars: 'horizontal', // Required for Material Bar Charts.\n chartArea: {'height': '90%'},\n legend: {'position': 'bottom'}\n };\n\n var chart = new google.visualization.BarChart(document.getElementById('chartDivNumberOfAvailableProducts'));\n chart.draw(chartData, options);\n}", "title": "" }, { "docid": "9477e296bee035a0723cd2f4015e215d", "score": "0.67699534", "text": "function drawBarChart(localities,localityName,option)\n\t\t{\n\t\t\t\n\t\t\t// get energy production for USA\n\t\t\tvar energyProductionUSA = localities[localityName].energyProduction;\n\n\t\t\t// figure out maximum energy production\n\t\t\tvar maxProduction = d3.max(energyProductionUSA);\n\n\t\t\t// chart size \n\t\t\tvar width = 700;\n\t\t\tvar height = 400;\n\n\t\t\t// figure out the width of individual bars\n\t\t\tvar barWidth = width / (2012-1980+1);\n\n\t\t\t// create a y scale\n\t\t\tvar y = d3.scale.linear()\n\t\t\t\t.domain([0, maxProduction])\n\t\t\t\t.range([height, 0]);\n\n\t\t\t// create a group for the bar chart\n\t\t\td3.select(\"#label\")\n\t\t\t\t.html(localityName + \" \" + option);\n\t\t\t\t\n\t\t\tvar tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function(d) \n \t\t{ console.log(d.barWidth);\n return \"<strong>Value:</strong> <span style='color:White'>\" + y(d) + \"</span>\";\n \t\t\t\t\t\t\t\t})\n\n\n\t\t\tvar svg = d3.select(\"#main\")\n\t\t\t\t\t\t.append(\"g\")\n\t\t\t\t\t\t.attr(\"transform\", \"translate(100, 100)\");\n\n\n\t\t\tsvg.selectAll(\"rect\")\n\t\t\t\t.data(energyProductionUSA)\n\t\t\t\t.enter()\n\t\t\t\t.append('rect')\n\t\t\t\t.attr(\"x\", function(d, i) \n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\treturn i*barWidth \n\t\t\t\t\t\t\t})\n\t\t\t\t.attr(\"y\", function(d, i) \n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\treturn y(d);\n\t\t\t\t\t\t\t})\n\t\t\t\t.attr(\"width\", barWidth)\n\t\t\t\t.attr(\"height\", function(d) \n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\treturn height - y(d); \n\t\t\t\t\t\t\t})\n\t\t\t\t.style(\"stroke\", \"white\")\n\t\t\t\t.style(\"fill\", \"#1b9e77\")\n\t\t\t\t.on('mouseover', tip.show)\n \t\t\t.on('mouseout', tip.hide);\n\t\t\t\t\n\t\t\tsvg.call(tip);\n\t\t\t\n\t\t\t\n\t\t\t// create x axis\n\t\t\tvar x = d3.time.scale()\n\t\t\t\t.domain([new Date(1980, 1, 1), new Date(2012, 1, 1)])\n\t\t\t\t.range([0, width])\n\n\t\t\tvar xAxis = d3.svg.axis()\n\t\t\t\t.scale(x)\n\t\t\t\t.orient('bottom');\n\n\t\t\t// call x axis\n\t\t\tsvg.append(\"g\")\n\t\t\t\t.attr('class', 'axis')\n\t\t\t\t.attr('transform', 'translate(0,' + height + ')')\n\t\t\t\t.call(xAxis);\n\n\t\t\tsvg.append(\"text\") // text label for the x axis\n\t\t .attr(\"x\", 600 )\n\t\t .attr(\"y\", 450 )\n\t\t .style(\"text-anchor\", \"middle\")\n\t\t .text(\"Time (in years)\");\n\n\t\t\t// create y axis\n\t\t\tvar yAxis = d3.svg.axis()\n\t\t\t\t.scale(y)\n\t\t\t\t.orient('left');\n\t\t\t\t\n\t\t\t// call y axis\n\t\t\tsvg.append(\"g\")\n\t\t\t\t.attr('class', 'axis')\n\t\t\t\t.attr('transform', 'translate(-2,0)')\n\t\t\t\t.call(yAxis);\n\n\t\t\t// y axis label \n\t\t\tsvg.append(\"text\")\n\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t .attr(\"y\", -80)\n\t\t .attr(\"x\", -60)\n\t\t .attr(\"dy\", \"1em\")\n\t\t .style(\"text-anchor\", \"middle\")\n\t\t .text(option);\n\t\t}", "title": "" }, { "docid": "65ef982176d2ff5c6198ea72dd7c4f2e", "score": "0.6765478", "text": "__DrawGBars(o){\r\n const\r\n set = o.dataset.extract(x => x.status ? x : null)\r\n , serie = set.extract((item, i) => item.plot ? item.plot.calc(SUM) || .001 : .001)\r\n , ymax = Math.max(1, serie.calc(MAX) * o.roof)\r\n , xpace = o.rects.width / serie.length\r\n , h = o.rects.height\r\n , w = Math.min(xpace / 2, o.barWidth || o.fsize)\r\n ;;\r\n serie.each((n, i) => {\r\n const\r\n rec = set[i]\r\n , color = rec.color ? rec.color : PRISM.array()[i % PRISM.array().length]\r\n , y = Math.max(o.fsize, Math.min(h - h * n / ymax, h))\r\n , x = xpace / 2 + i * xpace\r\n ;;\r\n o.node.app(SVG(\"rect\", \"-avoid-pointer --bar\", { width: w, height: h - y, x: x - w / 2, y: y }, { fill: color }))\r\n })\r\n }", "title": "" }, { "docid": "6bcf5a18811a20ca81d38071b0811cb7", "score": "0.67653257", "text": "function bar_chart_single(data,obj) {\n//var w=850,h=330,element=\"#body\",xLabel=\"x values\",yLabel=\"y values\";\nvar w=obj['w'];\nvar h=obj['h'];\nvar element=obj['element'];\nvar xLabel=obj['xLabel'];\nvar yLabel=obj['yLabel'];\nvar colorRange=obj['color'];\nvar afterColorRange=\"\";\nvar deg=0;\nvar bottombar=40;\nvar xLabelTranslate=0;\n\n\nif('xLabelTranslate' in obj)\n\txLabelTranslate=obj['xLabelTranslate'];\n\n\n\nif('afterColor' in obj)\n afterColorRange=obj['afterColor'];\nelse afterColorRange=colorRange;\n\nif('xTextDegree' in obj)\n deg=obj['xTextDegree'];\nelse deg=\"0\";\nvar anchor=\"middle\";\nif(deg==0) anchor=\"middle\";\nelse anchor=\"middle\";\n\nif('barFontSize' in obj)\n\ttsize=obj['barFontSize'];\nelse tsize=12; \n\nif('extendHeight' in obj)\n\tbottombar=obj['extendHeight'];\nelse bottombar=40; \n\n\n//by default itz true>>>> % will be visible\nvar percentage=\"true\";\nif('percentage' in obj)\n\tpercentage=obj['percentage'];\nelse percentage=\"true\"; \n\n//If there is a special Bar, which is different color than others, use this object. This is only for 1 bar,\n//Only specily x_value and color of that bar\nvar diffXDataColor=null;\nvar diffX=null;\nvar diffXColor=null;\n\nif('diffXDataColor' in obj)\n{\tdiffXDataColor=obj['diffXDataColor'];\n\tdiffX=diffXDataColor[0];\n\tdiffXColor=diffXDataColor[1];\n}\nelse diffXDataColor=null; \n\n\n\n\n//For Many different color bar, Specify The starting number of the bar from where different color will be started as well as color\nvar diffXStartPoint=null;\nvar StartPoint=1000000;\nvar StartPointColor=-1;\n\nif('diffXStartPoint' in obj)\n{\tdiffXStartPoint=obj['diffXStartPoint'];\n\tStartPoint=diffXStartPoint[0] -1;\n\tStartPointColor=diffXStartPoint[1];\n}\nelse StartPointColor=null; \n//console.log(\"yes \" + diffXStartPoint);\n\nvar total=0; // total for percentage calculation\nvar margin = {top: 20, right: 10, bottom: 30, left: 10},\n width = w- margin.left - margin.right,\n height = h - margin.top - margin.bottom;\n\nvar x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .6);\n\nvar y = d3.scale.linear()\n .range([height, 0]);\n\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\nvar color = d3.scale.ordinal()\n .range(colorRange);\n\n\n\nvar afterColor = d3.scale.ordinal()\n .range(afterColorRange);\n\n\nvar yAxis = d3.svg.axis()\n .scale(y)\n.orient(\"left\") \n\t.innerTickSize(-width)\n .outerTickSize(0)\n .tickPadding(10)\n//.ticks(10,\"%\");\n\nvar chart = d3.select(element).append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom+ bottombar)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n//tooltip\nvar tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .style(\"left\", \"px\")\n .html(function(d) {\n return \"<strong>Age: </strong> <span style='color:blue'>\" + d.x_data+\"</span> </br> <strong> Number of member: </strong><span style='color:blue'>\" + d.y_data + \"</span> </br> <strong> Total: </strong><span style='color:blue'>\" + total + \"</span>\";\n\n //return \"<span style='color:gray'>Meassure Name: </span><span style='color:black'> <strong> \" + d.x_data+\" </strong> </span> </br> <span style='color:gray'>Meassure Value</span> <span style='color:black'> <strong> \" +Number((d.y_data)).toFixed(1)+ \" </strong> </span> </br><span style='color:gray'> Total Value: <span style='color:black'> <strong> \" + total.toFixed(1) + \" </strong> </span></br><span style='color:gray'> % is: <span style='color:black'> <strong> \" + d.pData+ \" </strong> </span>\"; \n\n\nreturn \"<span style='color:gray'>Measure Name: </span><span style='color:black'> <strong> \" + d.x_data+\" </strong> </span></br><span style='color:gray'> Value: <span style='color:black'> <strong> \" + d.pData+ \" </strong> </span>\"; \n\n});\nchart.call(tip);\n //console.log(\"Hello \" + d3.max(data, function(d,i) { total+=d.y_data[i]; return d.y_data[i]; }));\n \n x.domain(data.map(function(d) { return d.x_data; }));\n\n y.domain([0, d3.max(data, function(d,i) { total+=+d.y_data; return +d.y_data; })]);\n //console.log(\"*******TOTAL \"+ total);\n chart.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n\t.selectAll(\"text\") \n .style(\"text-anchor\", anchor)\n .style(\"font-size\", 12 + \"px\")\n //.attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \".55em\")\n\t .attr(\"x\", 10)\n .attr(\"transform\", \"rotate(-\"+deg+\")\" );\n // .call(wrap, x.rangeBand());\n\n chart.append(\"g\")\n .attr(\"class\", \"y axis\")\n.attr(\"transform\", \"translate(\" + 20 + \",0)\")\n .call(yAxis);\n \n\n chart.selectAll(\".bar\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n\n .style(\"font-size\", tsize + \"px\")\n .attr(\"x\", function(d) { return x(d.x_data); })\n .attr(\"y\", function(d) { return y(d.y_data); })\n .attr(\"height\", function(d) { return height - y(d.y_data); })\n .style(\"fill\", function(d,i) \n\t\t{ \n\t\tif(i >= diffXStartPoint) return \"#FF0000\";\n\t\t else return color(d.x_data); \n\t\t})\n .attr(\"width\", x.rangeBand())\n\t .on(\"mouseout\", function(d,i){\n\t\tvar clr=0;\n\t\tif(d.x_data==diffX) clr= diffXColor;\n\t\telse if(i>=StartPoint) clr=StartPointColor \n\t\telse clr=color(d.x_data);\n\t\t//d3.select(this).style(\"fill\",color(d.x_data));\t\t\n\t\td3.select(this).style(\"fill\", clr);\n\t\t//legendText.style(\"fill\", \"black\");\n\t\ttip.hide(d);\n\t\t})\n\t .on(\"mouseover\", function(d,i){\n\t\tvar clr=0;\n\t\t//d3.select(this).style(\"fill\", afterColor(d.x_data));\n\t\tif(d.x_data==diffX) clr= \"gray\"; \n\t\telse if(i>=StartPoint) clr=\"gray\";\n\t\telse clr=afterColor(d.x_data);\n\t\td3.select(this).style(\"fill\", clr );\n\t\t//legendText.style(\"fill\", \"blue\");\n\t\ttip.show(d);\n\t\t});\n\t\tvar xv=0;\n//var tsize=0.05*h;\nchart.selectAll(\".bartext\")\n.data(data)\n.enter()\n.append(\"text\")\n.attr(\"class\", \"bartext\")\n.attr(\"text-anchor\", \"middle\")\n.attr(\"fill\", \"black\")\n.style(\"font-size\", tsize + \"px\")\n.attr(\"x\", function(d,i) {\n return x(d.x_data)+x.rangeBand()/2;\n})\n.attr(\"y\", function(d,i) {\n return y(d.y_data)- 6; // previously 20\n})\n.text(function(d){ //percentage calculation here :)\n\t //var percen= (100*d.y_data)/total;\n\t //xv +=percen;\n\t percen=Number((d.y_data)).toFixed(2);\n\t//percen= Math.round(percen);\n\tif(percentage==\"false\")\n\t{\n\t\td.pData=percen;\n\t\treturn percen;\n\t}\n\telse \n\t{\td.pData=percen;\n\t \treturn percen;\n\t}\n});\n\n//X axis label\nchart.append(\"text\")\n .attr(\"transform\", \"translate(\" + ((width / 2)+ xLabelTranslate) + \" ,\" + (height + margin.bottom+ bottombar-10) + \")\")\n.style(\"fill\", \"steelblue\")\n .style(\"text-anchor\", \"middle\")\n\t.style(\"font-size\", \"12px\")\n .text(xLabel);\n\n//Y asis Label\nchart.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left+60)\n .attr(\"x\",0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(yLabel);\nfunction type(d) {\n d.y_data = +d.y_data; // coerce to y_data\n return d;\n}\n\n//For Wraping Text in x axis . This part is totally taken from here>> bl.ocks.org/mbostock/7555321 . no idea whats going on! <PERSIA> \nfunction wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n\t//y = text.attr(\"y\"),\n //dy = parseFloat(text.attr(\"dy\")),\n \t//tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n \t//y = text.attr(\"y\"),\n /* words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1, // ems\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n\n tspan = text.append(\"tspan\").attr(\"x\", 0-20).attr(\"y\", y-10).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\n }\n\n }*/\ntspan = text.append(\"tspan\").attr(\"x\", 40).attr(\"y\", y).text(text.text());\n\t\n });\n}\n\n}", "title": "" }, { "docid": "d6a2bb0c984324a1bf8589125d3487c8", "score": "0.67543447", "text": "function drawcharts(div,indicator) {\n\tvar data = [];\n\t\tcountry = [];\n\t$j.each(indicator, function(ctry,val) {\n\t\tcountry.push(ctry);\n\t\tdata.push(val);\n\t});\n\t//Create the bar chart\n\tvar chart = new Grafico.HorizontalBarGraph($(div), data,\n\t\t{\n\t\t\tlabels:country,\n\t\t\tdatalabels:{one:data},\n\t\t\theight:450, //This needs to be explicity set\n\t\t\tbackground_color:\"#666\", //Set to background color of div container if setting opacity\n\t\t\tcolor:\"#FCBBA1\",\n\t\t\thover_color:\"#99000D\",\n\t\t\tbargraph_lastcolor:\"#99000D\",\n\t\t\tvertical_label_unit:\"%\",\n\t\t\tshow_ticks:false,\n\t\t\tgrid:false\n\t\t});\n}", "title": "" }, { "docid": "296d1c6a2377e6d283734e72003cae70", "score": "0.67517334", "text": "function plotbar(dataset) {\n let barchart = {\n y: dataset.otuid_label.slice(0, 10).reverse(),\n x: dataset.values.slice(0, 10).reverse(),\n orientation: 'h',\n type: \"bar\"\n };\n\n let datasets = [barchart];\n\n Plotly.newPlot(\"bar\", datasets);\n}", "title": "" }, { "docid": "2a598ffcc6918d8fafb9c6cbc162585c", "score": "0.67499083", "text": "function draw(settings,dataset) {\n //import settings\n var margin=settings.margin, width=settings.width, height=settings.height, textwidth=settings.textwidth, \n svg=settings.svg, x=settings.x, y=settings.y;\n\n //Set domains\n y.domain(dataset.map(function(d) { return d.key; }));\n var barmax = d3.max(dataset, function(e) {\n return e.value;\n });\n x.domain([0,barmax]);\n\n\n //create chart row and move to the correct height\n var chartRow = svg.selectAll(\"g\")\n .data(dataset, function(d){return d.key})\n .enter()\n .append(\"g\")\n .attr(\"class\", \"chartRow\")\n .attr(\"transform\", function(d){ return \"translate(0,\" + y(d.key) + \")\"; });\n\n //Add rectangles\n chartRow.append(\"rect\")\n .attr(\"class\",\"bar\")\n .attr(\"x\", 0)\n .attr(\"height\", y.rangeBand())\n .attr(\"width\", 0) //initialize width to zero \n \n var format = d3.format(\"0,000\")\n\n //Add value labels\n chartRow.append(\"text\")\n .attr(\"class\",\"label\")\n .attr(\"y\", y.rangeBand()/2)\n .attr(\"x\",0)\n .attr(\"dy\",\".35em\")\n .attr(\"dx\",\"0.5em\")\n .text(0); //initialize labels at 0\n \n //Add category labels\n chartRow.append(\"text\")\n .attr(\"class\",\"category\")\n .attr(\"text-overflow\",\"ellipsis\")\n .attr(\"y\", y.rangeBand()/2)\n .attr(\"x\",textwidth)\n .attr(\"dy\",\".35em\")\n .attr(\"dx\",\"0.5em\")\n .text(function(d){return d.key});\n \n update(settings,dataset)\n }", "title": "" }, { "docid": "dbafbc25d9b13cfdb4616e194827dc05", "score": "0.67482114", "text": "function drawBarChart(data, valueRanges) {\n\n\t\t//console.log(data)\n\n\t\t// set domains of x and y scalers\n\t\tx.domain(valueRanges);\n\t\t\n\t\ty.domain([ \n\t\t\td3.min(data, function (c) { \n\t\t\t\treturn d3.min(c.values, function (d) { return d.percentage; });\n\t\t\t}),\n\t\t\td3.max(data, function (c) { \n\t\t\t\treturn d3.max(c.values, function (d) { return d.percentage; });\n\t\t\t})\n\t\t]);\n\n\t\t// set domain of color scaler\n\t\tcolor.domain(data.map(function(d) { return d.sort}))\n\n\t\t// draw x axis with value ranges and tick marks\n\t\tchart.append(\"g\")\n\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t\t.call(xAxis)\n\t\t\t.selectAll(\"text\")\n\t\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t\t.attr(\"dx\", \"-.8em\")\n\t\t\t\t.attr(\"dy\", \".5em\")\n\t\t\t\t.attr(\"transform\", function(d) { return \"rotate(-65)\" });\n\n\t\t// add name for the x axis\n\t\tchart.append(\"text\")\n\t\t\t.attr(\"x\", width / 2.5)\n\t\t\t.attr(\"y\", height + margin.bottom / 1.5)\n\t\t\t.style(\"font\", \"18px sans-serif\")\n\t\t\t.text(\"Value in millions \\u20ac\");\n\t\t\t\n\t\t// draw y axis with numbers, tick marks and name y axis\n\t\tchart.append(\"g\")\n\t\t\t.attr(\"class\", \"y axis\")\n\t\t\t.call(yAxis)\n\t\t\t.append(\"text\")\n\t\t\t\t.attr(\"class\", \"values\")\n\t\t\t\t.attr(\"transform\", \"rotate (-90)\")\n\t\t\t\t.attr(\"y\", - margin.left / 1.5)\n\t\t\t\t.attr(\"x\", - height + 60)\n\t\t\t\t.style(\"font\", \"18px sans-serif\")\n\t\t\t\t.text(\"Frequency in %\");\n\t\t\n\t\t// get the sorts\n\t\tconst sorts = data.map(x => x.sort);\n\t\tconsole.log(data);\n\n\n\t\t// draw the bars\n\t\td3.map(data, function(data) {\n\t\t\tchart.selectAll(\".bar\" + sorts.indexOf(data.sort))\n\t\t\t.data(data.values)\n\t\t\t.enter().append(\"rect\")\n\t\t\t\t.attr(\"class\", \"bar\" + sorts.indexOf(data.sort))\n\t\t\t\t.attr(\"y\", function(d) { return y(d.percentage)})\n\t\t\t\t.attr(\"x\", function(d) { \n\t\t\t\t\treturn x(d.range) + x.rangeBand() / sorts.length * sorts.indexOf(data.sort) - (width / 20 / 2)\n\t\t\t\t})\n\t\t\t\t.attr(\"width\", x.rangeBand() / sorts.length)\n\t\t\t\t.attr(\"height\", function(d) { return height - y(d.percentage) })\n\t\t\t\t.style(\"fill\", color(data.sort))\n\t\t});\n\n\t// draw legend\n\tdrawLegend(data, sorts)\n\t}", "title": "" }, { "docid": "d70354d960132756dde0a9733c82bb4c", "score": "0.6746609", "text": "function drawChart(num) {\n \n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Members');\n data.addRows([\n ['Members', num],\n \n ]);\n\n // Set chart options\n var options = {\n 'width':300,\n 'height':300,\n 'colors':['#666666'],\n 'backgroundColor':'#CCCC99'\n \n };\n\n // Instantiate and draw our chart, passing in some options.\n\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n}", "title": "" }, { "docid": "e20a8b858af8be1d66cdf23a84608a11", "score": "0.6738535", "text": "function draw_bar_charts(entity, dimension, time_list, tweet_count_list, negative_count_list) {\n // Construct data for the axis and charts\n var arrData = [];\n for (var i = 0; i < time_list.length; i++) {\n var time_score_pair = [time_list[i], negative_count_list[i], tweet_count_list[i] - negative_count_list[i]];\n arrData.push(time_score_pair);\n }\n\n var barChartSVG = d3.select(\"#bar-chart\")\n .append(\"svg\")\n .attr(\"class\", \"chart\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var xScale = d3.time.scale()\n .domain([new Date(arrData[0][0]), d3.time.day.offset(new Date(arrData[arrData.length - 1][0]), 1)])\n .rangeRound([0, width - margin.left - margin.right]);\n\n var yScale = d3.scale.linear()\n .range([height, 0])\n .domain([\n 0,\n d3.max(arrData, function (d) {\n return (d[1] + d[2]) * 1.1;\n })\n ]);\n\n // Append bottom rect\n barChartSVG.selectAll(\"g\")\n .data(arrData).enter()\n .append(\"g\")\n .attr(\"class\", \"date group\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .append(\"rect\")\n .attr(\"class\", \"data negative\")\n .attr(\"y\", function(d) {\n return yScale(+d[1]);\n })\n .attr(\"height\", function(d) {\n return Math.abs(yScale(+d[1]) - yScale(0));\n });\n\n // Append top rect\n barChartSVG.selectAll(\"g\")\n .data(arrData)\n .append(\"rect\")\n .attr(\"class\", \"data positive\")\n .attr(\"y\", function(d) {\n return yScale(+d[1] + +d[2])\n })\n .attr(\"height\", function(d){\n return Math.abs(yScale(+d[2]) - yScale(0));\n });\n\n // Positioning the bars, add on-clicks and tooltips\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-10, 0])\n .html(function (d) {\n return \"<span>Click to see tweets in \" + d[0] + \"</span>\";\n }\n );\n barChartSVG.call(tip);\n barChartSVG.selectAll(\"g\")\n .data(arrData)\n .selectAll(\"rect.data\")\n .attr(\"x\", function(d){\n return xScale(new Date(d[0]));\n })\n .attr(\"width\", 100)\n .on(\"mouseover\", tip.show)\n .on(\"mouseout\", tip.hide)\n .on(\"click\", function(d) {\n if (dimension == 'None') {\n post('/twitter_services/entity/' + entity + '/',\n {\n entity: decodeURIComponent(entity),\n date: d[0]\n });\n }\n else {\n post('/twitter_services/entity_dimension/' + entity + '/' + dimension + '/',\n {\n entity: decodeURIComponent(entity),\n reputation_dimension: decodeURIComponent(dimension),\n date: d[0]\n });\n }\n });\n\n // Append text label\n var node = barChartSVG.selectAll(\".g\")\n .data(arrData)\n .enter()\n .append(\"g\");\n\n // Negative count\n node.append(\"text\")\n .attr(\"transform\", function(d) {\n var cx = xScale(new Date(d[0])) + 80;\n var cy = yScale(d[1]);\n return \"translate(\" + cx + \",\" + cy + \")\"\n })\n .style(\"font-size\", \"13px\")\n .text(function(d) {\n if (d[1] != 0)\n return d[1];\n });\n\n // Total count\n node.append(\"text\")\n .attr(\"transform\", function(d) {\n var cx = xScale(new Date(d[0])) + 80;\n var cy = yScale(d[2] + d[1]);\n return \"translate(\" + cx + \",\" + cy + \")\"\n })\n .style(\"font-size\", \"13px\")\n .text(function(d) {\n if (d[2] != 0)\n return d[2] + d[1];\n });\n\n // Append the two axises\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient('bottom')\n .ticks(d3.time.days, 1)\n .tickFormat(d3.time.format('%y-%m-%d'))\n .tickSize(0)\n .tickPadding(8);\n\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient('left')\n .ticks(5)\n .tickSize(5)\n .tickPadding(8);\n\n barChartSVG.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(\" + 2 * margin.right + \",\" + (height + margin.top) + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"y\", 0)\n .attr(\"x\", 0)\n .attr(\"dy\", \".5em\")\n .attr(\"transform\", \"rotate(30)\")\n .style(\"text-anchor\", \"start\")\n\n barChartSVG.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\" + margin.right * 1.35 + \",\" + margin.top + \")\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 5)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Count\");\n\n // Append colour identifier\n barChartSVG.append(\"rect\")\n .attr(\"class\", \"data positive\")\n .attr(\"width\", 40)\n .attr(\"height\", 15)\n .attr(\"x\", width * 0.95)\n .attr(\"y\", height * 0.05);\n\n barChartSVG.append(\"rect\")\n .attr(\"class\", \"data negative\")\n .attr(\"width\", 40)\n .attr(\"height\", 15)\n .attr(\"x\", width * 0.95)\n .attr(\"y\", height * 0.1);\n\n barChartSVG.append(\"text\")\n .attr(\"transform\", \"translate(\" + width + \",\" + height * 0.065 + \")\")\n .attr(\"dy\", \".35em\")\n .attr(\"text-anchor\", \"start\")\n .text(\"Positive tweets\");\n\n barChartSVG.append(\"text\")\n .attr(\"transform\", \"translate(\" + width + \",\" + height * 0.115 + \")\")\n .attr(\"dy\", \".35em\")\n .attr(\"text-anchor\", \"start\")\n .text(\"Negative tweets\");\n\n}", "title": "" }, { "docid": "e1a69779f6100da589270f350215262d", "score": "0.67379904", "text": "function createBars() {\n var html = '';\n html += '<table>';\n html += '<tbody>';\n var smittet = komdata[datesSearch[currentIndex]];\n if (typeof (smittet) !== 'undefined') {\n for (i = 0; i < Object.keys(smittet).length; i++) {\n var obj = smittet[i];\n var komkode = Object.keys(smittet)[i];\n var antal = Object.values(smittet)[i];\n html += '<tr>';\n html += ' <td>' + komnrKomnavn[komkode] + '</td>';\n html += ' <td style=\"background-color: ' +\n getColorValueFromSmittetCount(antal) + '; width: ' + antal + 'px;\"><div class=\"pushed-label \"style=\"padding-left:' + (Number(antal) + 5) + 'px;\">' + antal + '</div></td>';\n html += '</tr>';\n }\n }\n html += '</tbody>';\n html += '</table>';\n spsjq(\"#oversigt\").html(html);\n}", "title": "" }, { "docid": "e6c4200f4d4ebc61cc2b602ae0ee1da7", "score": "0.6733097", "text": "function drawBarChart(parent, data, chartTitle){ \n\tvar isArray = data.instanceof(Array);\n\n\ttry {\n\t\tvar chartData = google.visualization.arrayToDataTable(data);\n\n\t\tvar options = {\n\t\t\ttitle: chartTitle,\n\t\t};\n\t\tvar chart = new google.visualization.BarChart(parent);\n\t\tvar handler = new selectionHandler(chart, chartData, barSelectResponse);\n\t\tgoogle.visualization.events.addListener(chart, 'select', handler);\t\t\n\t\tchart.draw(chartData, options);\n\t}\n\tcatch (err) {\n\t\tconsole.log(\"Failed to create chart: \"+ err.message);\n\t}\n}", "title": "" }, { "docid": "d1550001d1ef5b55ee9512051aa6a618", "score": "0.6730894", "text": "function drawChart() {\n const langData = google.visualization.arrayToDataTable([\n ['Language', 'Proficiency', {role: 'style'}],\n ['Java', 80, 'color: blue'], \n ['C++', 70, 'color: blue'], \n ['Golang', 50, 'color: blue'],\n ['Python', 30, 'color: blue'], \n ]);\n const options = {\n title: 'My proficiency in various programming languages',\n chartArea: {\n width: '50%',\n },\n hAxis: {\n title: 'Proficiency (out of 100)',\n minValue: 0\n },\n vAxis: {\n title: 'Language',\n }\n };\n const chart = new google.visualization.BarChart(document.getElementById('LangChartContainer'));\n chart.draw(langData, options);\n}", "title": "" }, { "docid": "2802f2be31063c904b0dc2c8bf60e1a9", "score": "0.6730225", "text": "function barchart_walk_pre() {\n\n var svg = d3.select(\"#walk_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.walk_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.walk_pre);})\n .attr(\"fill\", walk_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n });\n }", "title": "" }, { "docid": "9ad7d123b2b6b36cc07ad732b3559905", "score": "0.67151487", "text": "function bar(d) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n .selectAll(\"g\")\n .data(d.children)\n .enter().append(\"g\")\n .attr(attrName, \"\")\n .style(\"cursor\", function (d) { return !d.children ? null : \"pointer\"; })\n .on(\"click\", down);\n bar.append(\"text\")\n .attr(attrName, \"\")\n .attr(\"x\", -6)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function (d) { return d.name; });\n bar.append(\"rect\")\n .attr(attrName, \"\")\n .attr(\"width\", function (d) { return x(d.value); })\n .attr(\"height\", barHeight);\n return bar;\n }", "title": "" }, { "docid": "7a8ad06c1e5175e554814548a22b4eb1", "score": "0.67150897", "text": "function draw() {\n background(255);\n noStroke();\n \n //p5.dom\n var bars = getElements('bars');\n\n for(var i = 0; i < bars.length; i++) {\n var thisbar = bars[i];\n push();\n translate(thisbar.attribute('x'), thisbar.attribute('y'));\n \n if((mouseX > thisbar.attribute('x')) && (mouseX < (int(thisbar.attribute('x')) + int(thisbar.attribute('dx'))))) {\n fill('brown');\n } else {\n fill('red');\n }\n rect(0,0, thisbar.attribute('dx'), thisbar.attribute('height'));\n fill('white')\n text(int(thisbar.attribute('height')),thisbar.attribute('dx')/2, 15);\n pop();\n }\n stroke('black');\n strokeWeight(3);\n line(0,height-margin,width,height-margin);\n noStroke();\n}", "title": "" }, { "docid": "b728cda1935063963f9f34fe0409b112", "score": "0.67100954", "text": "function showBar() {\n console.log('SHOW BAR');\n\n showAxes(xAxisBar, yAxis);\n g.selectAll('.y.axis')\n .transition(hide)\n .style('opacity', 0);\n\n g.selectAll('.eqg-img')\n .transition(hide)\n .style('opacity', 0);\n\n g.selectAll('.line')\n .transition(hide)\n .style('opacity', 0);\n g.select('.label.line')\n .transition(hide)\n .style('opacity', 0)\n .attr('y1', height);\n g.selectAll('.label.text')\n .transition(hide)\n .style('opacity', 0);\n g.selectAll('.legend')\n .transition(hide)\n .style('opacity', 0);\n\n yScale.domain([0, 100]);\n g.selectAll('.bar')\n .style('opacity', 1.0)\n .transition(show)\n .ease(d3.easeCubic)\n .attr('height', d => height - yScale(d.renewable))\n .attr('y', d => yScale(d.renewable));\n g.selectAll('.bar-label')\n .transition(show)\n .style('opacity', 1);\n\n }", "title": "" }, { "docid": "b2aa4b48be45ce86fd0a9bfcf8b61239", "score": "0.6699299", "text": "function bar(d, svg, x, xAxis, width, height,index) {\n var bar = svg.insert(\"g\", \".y.axis\")\n .attr(\"class\", \"enter\")\n .attr(\"transform\", \"translate(0,5)\")\n \t .selectAll(\"g\")\n .data(d.children)\n\t\t.enter().append(\"g\")\n .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\n .on(\"mouseover\",function(d,i){\n \t\tif(index==currentPos){\n\t\t\t\tvar txt=d3.select(\"#\"+d.id);\n\t\t\t\ttxt.style('color',colorSelected);\n\t\t\t}\n })\n .on(\"mouseout\",function(d,i){\n \t\tif(index==currentPos){\n\t\t\t\tvar txt=d3.select(\"#\"+d.id);\n\t\t\t\ttxt.style('color',null);\n \t\t}\n })\n .on(\"click\", function(d,i){\n down(d, i, svg, x, xAxis, width, height,1,index);\n });\n\n bar.append(\"text\")\n .attr(\"x\", -6)\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d.name; });\n\n bar.append(\"rect\")\n .attr(\"width\", function(d) { return x(d.value); })\n .attr(\"height\", barHeight);\n\t //.attr(\"title\",function(d){return d.value});\n\n return bar;\n}", "title": "" }, { "docid": "649e99b213bc25a6e3575ce3539df388", "score": "0.66970146", "text": "function drawBarChart(dataArray, id, name) \n{\n\n // Create the data table.\n var data = new google.visualization.arrayToDataTable(\n [[name, \"Frequency\"]].concat(dataArray));\n\n // Set chart options\n var options = {'title':name + \" Distribution\",\n 'width':400,\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById(id));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "d1ff1f9c6b60125dbc9532862ca5a2a4", "score": "0.6688228", "text": "function d3barchart(zip) {\r\n var w = 20, h = 100;\r\n\r\n var barArray = [];\r\n\r\n for (c in complaints) {\r\n\tif (pdata[zip][complaints[c]] != undefined) {\r\n\t barArray.push({\r\n\t\tkey: complaints[c],\r\n\t\tvalue: pdata[zip][complaints[c]]\r\n\t });\r\n\t} else {\r\n\t barArray.push({\r\n\t\tkey: complaints[c],\r\n\t\tvalue: 0\r\n\t });\r\n\t}\r\n }\r\n\r\n var barArray = barArray.sort(function(a,b){return b.value - a.value});\r\n var vals = barArray.map(function(o){return o.value});\r\n var labels = barArray.map(function(o){return o.key});\r\n\r\n var max = d3.max(vals);\r\n var y = d3.scale.linear().domain([0, max]).range([0,100]);\r\n var x = d3.scale.ordinal().domain(labels).rangePoints([0,labels.length-1]);\r\n\r\n var colorInd = 4;\r\n\r\n if ($(\".chart\").length == 0) {\r\n\tvar chart = d3.select(\"#sidebar\").append(\"svg\")\r\n\t .attr(\"class\",\"chart\")\r\n\t .attr(\"height\",\"400\")\r\n\t .attr(\"width\", 40*barArray.length+100);\r\n\r\n\tvar node = chart.selectAll(\"g\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .enter()\r\n\t .append(\"g\");\r\n\r\n\tnode.append(\"rect\")\r\n\t .attr(\"fill\",active_colors[colorInd])\r\n\t .attr(\"x\", function(d,i){return x(i)*40+20; })\r\n\t .attr(\"height\", function(d) {return y(d.value)})\r\n\t .attr(\"y\", function(d) {return 100 - y(d.value)})\r\n\t .attr(\"width\", 40);\r\n\t\r\n\tnode.append(\"text\")\r\n\t .text(function(d) { return d.value; })\r\n\t .attr(\"fill\",function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"#ffffff\";\r\n\t\t} else {\r\n\t\t return active_colors[colorInd];\r\n\t\t}\r\n\t })\r\n\t .attr(\"y\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return 113 - y(d.value);\r\n\t\t} else {\r\n\t\t return 99 - y(d.value);\r\n\t\t}\r\n\t })\r\n\t .attr(\"class\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"value white\";\r\n\t\t} else {\r\n\t\t return \"value color\";\r\n\t\t}\r\n\t })\r\n\t .attr(\"x\", function(d,i){return x(i)*40+24});\r\n\r\n\tnode.append(\"text\")\r\n\t .text(function(d) { return d.key; })\r\n\t .attr(\"class\",\"label\")\r\n\t .attr(\"y\", 105)\r\n\t .attr(\"x\", function(d,i){return x(i)*40+35})\r\n\t .attr(\"transform\", function(d,i){\r\n\t\tvar str = \"rotate(90 \";\r\n\t\tstr = str + String(x(i)*40+35);\r\n\t\tstr = str + \",105)\";\r\n\t\treturn str;\r\n\t });\r\n } else {\r\n\tvar chart = d3.select(\"#sidebar\");\r\n\t\r\n\tvar node = chart.selectAll(\"g\")\r\n\t .data(barArray,function(d) { return d.key; });\r\n\t\r\n\tnode.selectAll(\"rect\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .attr(\"fill\",active_colors[colorInd])\r\n\t .attr(\"x\", function(d,i){ return x(d.key)*40+20; })\r\n\t .attr(\"height\", function(d) { return y(d.value) })\r\n\t .attr(\"y\", function(d) {return 100 - y(d.value)});\r\n\r\n\tnode.selectAll(\".value\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .text(function (d) {console.log(d.value); return d.value; })\r\n\t .attr(\"fill\",function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"#ffffff\";\r\n\t\t} else {\r\n\t\t return active_colors[colorInd];\r\n\t\t}\r\n\t })\r\n\t .attr(\"y\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return 113 - y(d.value);\r\n\t\t} else {\r\n\t\t return 99 - y(d.value);\r\n\t\t}\r\n\t })\r\n\t .attr(\"class\", function(d) {\r\n\t\tif (y(d.value) > 18) {\r\n\t\t return \"value white\";\r\n\t\t} else {\r\n\t\t return \"value color\";\r\n\t\t}\r\n\t })\r\n\t .attr(\"x\", function(d,i){ return x(d.key)*40+24; });\r\n\r\n\tnode.selectAll(\".label\")\r\n\t .data(barArray,function(d) { return d.key; })\r\n\t .transition()\r\n\t .duration(1000)\r\n\t .attr(\"x\", function(d,i){return x(d.key)*40+35})\r\n\t .attr(\"transform\", function(d,i){\r\n\t\tvar str = \"rotate(90 \";\r\n\t\tstr = str + String(x(d.key)*40+35);\r\n\t\tstr = str + \",105)\";\r\n\t\treturn str;\r\n\t });\r\n }\r\n\r\n d3.select(\"#bar-zip-label\").transition().style(\"color\",\"white\")\r\n\t.transition().delay(500).text(zip).style(\"color\",\"#555555\");\r\n\r\n $(\"g\").hover(barIn,barOut);\r\n $(\"g\").click(barClick);\r\n}", "title": "" }, { "docid": "10961de22979005643598e53f4a3dd26", "score": "0.6682992", "text": "function DrawBar(elemento,valor,tipo) {\r\n\r\n\t/* Select the 2 bars */\r\n\tlleno = elemento.getElementsByTagName(\"div\")[0];\r\n\tvacio = elemento.getElementsByTagName(\"div\")[1];\r\n\r\n\t/* Get the height and width of the main bar */\r\n\tanchura = parseInt(window.getComputedStyle(elemento).getPropertyValue('width'));\r\n\taltura = parseInt(window.getComputedStyle(elemento).getPropertyValue('height'));\r\n\t\r\n\tif (tipo == 0){\t/* Horizontal */\r\n\t\r\n\t\tvalor = anchura*valor/100;\r\n\t\t\t\r\n\t\tlleno.style.height = altura.toString()+\"px\";\r\n\t\tvacio.style.height = altura.toString()+\"px\";\r\n\t\t\r\n\t\tvacio.style.left = valor.toString()+\"px\";\t\r\n\t\tlleno.style.width = valor.toString()+\"px\";\r\n\t\tvacio.style.width = (anchura-valor).toString()+\"px\";\r\n\r\n\t\r\n\t}\r\n\tif (tipo == 1){\t/* Vertical */\r\n\t\r\n\t\tvalor = altura*valor/100;\t\r\n\t\tvacio.style.top = valor.toString()+\"px\";\t\r\n\t\tlleno.style.height = valor.toString()+\"px\";\r\n\t\tvacio.style.height = (altura-valor).toString()+\"px\";\r\n\t\t\r\n\t\tlleno.style.width = anchura.toString()+\"px\";\r\n\t\tvacio.style.width = anchura.toString()+\"px\";\r\n\t\r\n\t}\t\r\n}", "title": "" }, { "docid": "70b2ee6a466970bbc6a59debc5edc6cb", "score": "0.667479", "text": "function drawChart(){}", "title": "" }, { "docid": "57d5459494c2b207bbea0c5c934d95f3", "score": "0.66738206", "text": "function drawBarChart(acsInfo, geoid, divId) {\n // Allow drawing of trend chart\n document.getElementById(\"drawTrendChart\").disabled = false;\n\n // plotAcs(geoid, acsInfo.tableParams, acsInfo.acsData, divId);\n plotAcs(acsInfo, geoid, divId_1);\n}", "title": "" }, { "docid": "86edec19ecb1ace5ab61ab2eff0e7283", "score": "0.6656954", "text": "function barchart_stand_pre() {\n\n var svg = d3.select(\"#stand_pre_bars\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height + margin.top + margin.bottom));\n\n // Load data:\n d3.csv(data_file, function (error, data) {\n\n bars = svg.selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"x\", function(d, i) {return i * (width / data.length);})\n .attr(\"y\", function(d){return bar_height - yScale(d.stand_pre);})\n .attr(\"width\", width / data.length)\n .attr(\"height\", function(d) {return yScale(d.stand_pre);})\n .attr(\"fill\", stand_pre_color)\n .style(\"opacity\", barchart_opacity);\n\n // horizontal line to compare against:\n var line_height = (1 - control_voice) * height/4;\n var myLine = svg.append(\"svg:line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", line_height)\n .attr(\"x2\", width)\n .attr(\"y2\", line_height)\n .style(\"stroke\", \"lightgray\");\n });\n }", "title": "" }, { "docid": "561d6aa0f140b8777e3992c70304d8ad", "score": "0.66541314", "text": "function buildBarGraph(data){\n\n current_data = data.means;\n dataLength = current_data.length;\n\n d3.select('#barChart').select(\"svg\").remove();\n\n setUpBasics();\n\n d3.select('#barChart').select(\"h2.ChartTitle\").select(\"tspan\").remove();\n d3.select('#barChart').select(\"h2.ChartTitle\").append(\"tspan\").html(\"Average PM2.5 levels by \" + chunk);\n\n monthScale = d3.scaleOrdinal()\n .range(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])\n .domain(0,1,2,3,4,5,6,7,8,9,10,11,12);\n\n weekDayScale = d3.scaleOrdinal()\n .range(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'])\n .domain(0,1,2,3,4,5,6);\n\n hourScale = d3.scaleOrdinal()\n .range(['00:00', '01:00', \"02:00\", \"03:00\", \"04:00\", \"05:00\", \"06:00\",\n '07:00', '08:00', \"09:00\", \"10:00\", \"11:00\", \"12:00\", \"13:00\",\n '14:00', '15:00', \"16:00\", \"17:00\", \"18:00\", \"19:00\", \"20:00\",\n '21:00', '22:00', \"23:00\"])\n .domain(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23);\n\n x = d3.scaleBand()\n .domain(current_data.map(selectScale))\n .range([0, width - 40])\n .padding(0.2);\n\n y = d3.scaleLinear()\n .range([height, 0])\n .domain([0, d3.max(current_data, function(d) { return d + 30; })]);\n\n g = svgBar.append(\"g\")\n .attr(\"transform\",\n \"translate(40,95)\");\n\n addTimeChunkButtons();\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x));\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(d3.axisLeft(y).tickArguments([3]))\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \"0.71em\")\n .attr(\"text-anchor\", \"end\")\n .style(\"font-family\", \"Helvetica Neue\")\n .text(\"Mean PM2.5 levels\");\n\n g.selectAll(\".g-bar\")\n .data(current_data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"g-bar\")\n .attr(\"cx\",0)\n .attr(\"transform\", function(d,i){ return \"translate(\" + x(selectScale(d,i)) + \",0)\";});\n\n g.selectAll(\".g-bar\")\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"id\", function(d) {return \"id\" + d; })\n .attr(\"x\", function(d,i) { return 0; })\n .attr(\"y\", function(d) {return y(d); })\n .attr(\"width\", x.bandwidth())\n .attr(\"height\", function(d) {return height - y(d); });\n\n g.selectAll(\".g-bar\")\n .append(\"foreignObject\")\n .attr(\"x\", function(d,i) { return 0; })\n .attr(\"y\", function(d) {return y(d); })\n .attr(\"width\",x.bandwidth())\n .attr(\"height\",40)\n .append(\"xhtml:div\")\n .style(\"color\", \"white\")\n .append(\"tspan\")\n .attr(\"class\", \"tspan-class\")\n .style(\"font-family\", \"Helvetica Neue\")\n .style(\"fill\", \"white\")\n .style(\"font-size\", \"16px\")\n .html(function(d) {return d; });\n\n g.selectAll(\".tick text\").style(\"font-size\", \"16px\");\n\n}", "title": "" }, { "docid": "f80c6a03b4d8a9258506fd02982f1499", "score": "0.66534555", "text": "function makeBarCharts() {\n graphingData2019 = [];\n graphingData2020 = [];\n graphingHeaders = [];\n const graphingData = getCountryValues();\n console.log(graphingData);\n console.log(graphingData[2019]);\n console.log(graphingData[2020]);\n console.log(countryHappinessKeys);\n graphingData2019.push(graphingData[2019]);\n graphingData2019 = graphingData2019.flat();\n graphingData2020.push(graphingData[2020]);\n graphingData2020 = graphingData2020.flat();\n graphingHeaders.push(countryHappinessKeys);\n graphingHeaders = countryHappinessKeys.flat();\n //start of the graphing\n google.charts.load('current', {'packages':['bar']});\n google.charts.setOnLoadCallback(drawChart);\n // \"+entry\" turns string into an numeric type\n graphingData2020.forEach((entry) => {\n entry = +entry\n })\n graphingData2019.forEach((entry) => {\n entry = +entry\n })\n\n function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Happiness Measures', '2019 Numbers `', '2020 Numbers `'],\n [(graphingHeaders[7]), (graphingData2019[7]), (graphingData2020[7])],\n [(graphingHeaders[6]), (graphingData2019[6]), (graphingData2020[6])],\n [(graphingHeaders[5]), (graphingData2019[5]), (graphingData2020[5])],\n [(graphingHeaders[4]), (graphingData2019[4]), (graphingData2020[4])],\n [(graphingHeaders[3]), (graphingData2019[3]), (graphingData2020[3])],\n [(graphingHeaders[2]), (graphingData2019[2]), (graphingData2020[2])],\n [(graphingHeaders[1]), (graphingData2019[1]), (graphingData2020[1])],\n [(graphingHeaders[0]), (graphingData2019[0]), (graphingData2020[0])]\n\n ]);\n \n var options = {\n colors: ['#34b52d', '#e3d320'],\n width: 800,\n chart: {\n title: 'Happiness Measures by Country',\n subtitle: '2019 in green, 2020 in yellow',\n },\n \n bars: 'horizontal' // Required for Material Bar Charts.\n };\n\n var chart = new google.charts.Bar(document.getElementById('barchart_material'));\n\n chart.draw(data, google.charts.Bar.convertOptions(options));\n };\n\n }", "title": "" }, { "docid": "49dd90115f6a837dd9230979cf6d713c", "score": "0.6642937", "text": "function barplot_base(data,startidx,stopidx,ctx,colors,max,min,x,y,w,pheight,pointup,tosvg)\n{\n if(!colors.p) {\n colors.p='rgb(184,0,92)';\n }\n if(!colors.n) {\n colors.n='rgb(0,79,158)';\n }\n var svgdata=[];\n for(var i=startidx; i<stopidx; i++) {\n var score=data[i];\n var bary=null, barh=null, barcolor=null,\n tipy=null, tipcolor=null;\n if(isNaN(score)) {\n // do nothing\n } else if(score==Infinity) {\n barcolor=colors.inf?colors.inf:'#b5b5b5';\n if(max>0 && min<0) {\n barh=pheight*max/(max-min);\n bary=pointup ? y : (y+pheight-barh);\n } else {\n bary=y;\n barh=pheight;\n }\n } else if(score==-Infinity) {\n barcolor=colors.inf?colors.inf:'#b5b5b5';\n if(max>0 && min<0) {\n barh=pheight*(0-min)/(max-min);\n bary=pointup ? (y+pheight-barh) : y;\n } else {\n bary=y;\n barh=pheight;\n }\n } else {\n if(max>0 && min<0) {\n if(score>=0) {\n barh=pheight*Math.min(score,max)/(max-min);\n barcolor=colors.p;\n bary = y+pheight*max/(max-min) - (pointup ? barh : 0);\n if(score>=max && colors.pth) {\n tipcolor=colors.pth;\n tipy= pointup ? y : y+pheight-2;\n }\n } else {\n barh=pheight*(0-Math.max(score,min))/(max-min);\n barcolor=colors.n;\n bary = y+pheight*max/(max-min) - (pointup ? 0 : barh);\n if(score<=min && colors.nth) {\n tipcolor=colors.nth;\n tipy= pointup ? y+pheight-2 : y;\n }\n }\n } else if(max>0) {\n barcolor=colors.p;\n if(score<min) {\n } else if(min>0 && score==min) {\n barh=1;\n bary=pointup ? y+pheight-1 : y;\n } else {\n barh=pheight*(Math.min(score,max)-min)/(max-min);\n bary= pointup ? (y+pheight-barh) : y;\n if(score>=max && colors.pth) {\n tipcolor=colors.pth;\n tipy= pointup ? y : y+pheight-2;\n }\n }\n } else {\n barcolor=colors.n;\n if(score>max) {\n } else if(max<0 && score==max) {\n barh=1;\n bary=pointup ? y: y+pheight-1;\n } else {\n barh=pheight*(max-Math.max(score,min))/(max-min);\n bary= pointup ? y : (y+pheight-barh);\n if(score<=min && colors.nth) {\n tipcolor=colors.nth;\n tipy= pointup ? y+pheight-2 : y;\n }\n }\n }\n }\n if(barh==null) {\n if(tosvg) svgdata.push({type:svgt_no});\n } else {\n if(colors.barbg) {\n ctx.fillStyle=colors.barbg;\n ctx.fillRect(x,y,w,pheight);\n if(tosvg) svgdata.push({type:svgt_line,x1:x, y1:y, x2:x, y2:y+pheight, w:w, color:ctx.fillStyle});\n }\n\n ctx.fillStyle = barcolor;\n ctx.fillRect(x, bary, w, barh);\n if(tosvg) svgdata.push({type:svgt_rect,x:x,y:bary,w:w,h:barh,fill:barcolor});\n }\n if(tipy) {\n ctx.fillStyle = tipcolor;\n ctx.fillRect(x, tipy, w, 2);\n if(tosvg) svgdata.push({type:svgt_rect,x:x,y:tipy,w:w,h:2,fill:tipcolor});\n }\n x+=w;\n }\n if(tosvg) return svgdata;\n}", "title": "" }, { "docid": "33d0e7faa4e66ac2fb0f207cd758e7b7", "score": "0.66357064", "text": "function drawCollumnVisitorsandLeads() {\n var data = new google.visualization.arrayToDataTable([\n ['Visitors & Leads Last 7 Days', 'Distance', 'Brightness'],\n ['January', 8000, 23.3],\n ['February', 24000, 4.5],\n ['March', 30000, 14.3],\n ['April', 50000, 0.9],\n ['May', 60000, 13.1]\n ]);\n\n var options = {\n width: 900,\n series: {\n 0: { axis: 'distance' }, // Bind series 0 to an axis named 'distance'.\n 1: { axis: 'brightness' } // Bind series 1 to an axis named 'brightness'.\n },\n axes: {\n y: {\n }\n }\n };\n\n var chart = new google.charts.Bar(document.getElementById('CollumnVisitorsandLeads'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "3e8953679fe9758f04d7b10c71f5ee70", "score": "0.66355616", "text": "__DrawBars(o, set){\r\n const\r\n xmax = o.colls ? o.colls : set.plot.calc(MAX)\r\n , ymax = Math.max(1, set.extract(item => item.plot.length).calc(MAX) * (o.roof||1.01))\r\n , xpace = o.rects.width / xmax\r\n , bar_per_unit = set.extract(item => item.plot.length).calc(MAX)\r\n , h = o.rects.height\r\n , w = Math.min(xpace / 2, o.barWidth || o.fsize)\r\n ;;\r\n set.extract((item, i) => {\r\n if(!item.plot) return;\r\n const\r\n serie = item.plot//.tiny(xmax)\r\n , color = item.color ? item.color : PRISM.array()[i % PRISM.array().length]\r\n ;;\r\n serie.each((n, j) => {\r\n n = n ? n : .001;\r\n const\r\n x = j * xpace + xpace / bar_per_unit * i + w\r\n , y = Math.max(o.fsize, Math.min(h - h * n / ymax, h))\r\n ;;\r\n o.node.app(SVG(\"rect\", \"-avoid-pointer\", { width: w, height: h - y, x: x - w / 2, y: y }, { fill: color }))\r\n })\r\n })\r\n }", "title": "" }, { "docid": "c900b8c654405bc90d345d392bd60f4b", "score": "0.6633996", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Languages', 'Python', 'Java', 'Swift', 'Haskell',\n 'HTML/JS/CSS', 'Ruby', 'Racket', { role: 'annotation' } ],\n ['2018', 100, 0, 0, 0, 0, 0, 0, ''],\n ['2019', 45, 0, 0, 45, 0, 10, 0, ''],\n ['2020', 15, 60, 0, 0, 10, 15, 0, ''],\n ['2021', 0, 20, 30, 0, 20, 0, 30, '']\n ]);\n\n var options_fullStacked = {\n isStacked: 'percent',\n height: 300,\n legend: {position: 'top', maxLines: 3},\n hAxis: {\n minValue: 0,\n ticks: [0, .3, .6, .9, 1]\n }\n };\n\n const chart = new google.visualization.BarChart(\n document.getElementById('chart-container'));\n chart.draw(data, options_fullStacked);\n}", "title": "" }, { "docid": "f2c0f806053eb4dec86517396652a91c", "score": "0.6629223", "text": "function initBarChart(){\r\n barChartData = total;\r\n updateTitle(\"Total\");\r\n handler(2007);\r\n}", "title": "" }, { "docid": "3e37e69dace9d7b3f3971e1441d0b09c", "score": "0.66275895", "text": "function BarInit(width, height, margin, filename, svg_id) {\n\n //inner size\n var in_width = width - margin.left - margin.right;\n var in_height = height - margin.top - margin.bottom;\n\n //use json file as data file\n d3.json(filename, function (error, data_file) {\n if (error) {\n throw error;\n }\n\n //convert TimeUse to numerical data\n data_file.forEach(function (d) {\n d.Round = d.Round;\n d.TimeUse = +d.TimeUse;\n });\n\n // get X data\n var x_value = data_file.map(function (d) {\n return d.Round;\n });\n\n // get Y data\n var y_values = data_file.map(function (d) {\n return d.TimeUse;\n });\n\n // create xScale & yScale\n var xScale = d3.scaleBand()\n .domain(x_value).rangeRound([0, in_width])\n .padding(0.1);\n var yScale = d3.scaleLinear()\n .domain([0, d3.max(y_values)])\n .rangeRound([in_height, 0]);\n\n // a svg with given size\n var svg_bar = d3.select(svg_id)\n .attr('width', width)\n .attr('height', height);\n\n // append group to svg\n var g = svg_bar.append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n // add X axis\n g.append('g')\n .attr('class', 'axisX')\n .attr('transform', 'translate(0,' + in_height + ')')\n .call(d3.axisBottom(xScale))\n .attr('font-weight', 'bold');\n\n // add Y axis\n g.append('g')\n .attr('class', 'axisY')\n .call(d3.axisLeft(yScale).ticks(10));\n\n // create chart for rect\n var bar_chart = g.selectAll('.bar')\n .data(data_file)\n .enter().append('g');\n\n // add rects\n bar_chart.append('rect')\n .attr('class', 'bar')\n .attr('x', function (d) {\n return xScale(d.Round);\n })\n //start animatoion\n .attr(\"y\", function (d) {\n var min = yScale.domain()[0];\n return yScale(min);\n })\n .attr(\"height\", function (d) {\n return 0;\n })\n .transition()\n .delay(function (d, i) {\n return i * 200;\n })\n //different duration time from text to show the beating independently\n .duration(1500)\n //BounceIn effect\n .ease(d3.easeBounceIn)\n //animation finish\n .attr('y', function (d) {\n return yScale(d.TimeUse);\n })\n .attr('height', function (d) {\n return in_height - yScale(d.TimeUse);\n })\n .attr('width', xScale.bandwidth());\n\n // add text to rects\n bar_chart.append('text')\n .attr('class', 'barText')\n .attr('x', function (d) {\n return xScale(d.Round);\n })\n\n //start animation\n .attr(\"y\", function (d) {\n var min = yScale.domain()[0];\n return yScale(min);\n })\n .attr(\"height\", function (d) {\n return 0;\n })\n .transition()\n .delay(function (d, i) {\n return i * 200;\n })\n .duration(1000)\n //use ease to show the bonce effect\n .ease(d3.easeBounceIn)\n //animation finish\n .attr('y', function (d) {\n return yScale(d.TimeUse);\n })\n //'dx' + 10 make text middle\n .attr('dx', xScale.bandwidth() / 2 + 10)\n .attr('dy', 20)\n .attr('text-anchor', 'middle')\n .text(function (d) {\n //console.log(\"d.TimeUse\", d.TimeUse)\n return d.TimeUse;\n });\n\n // mouseover event: change the opacity to 0.75\n bar_chart.on('mouseover', function (d) {\n d3.select(this).attr('opacity', 0.75);\n })\n .on('mouseout', function (d) {\n d3.select(this)\n .transition()\n .duration(600)\n .attr('opacity', 1)\n });\n });\n }", "title": "" }, { "docid": "9f4036023639dc6d425cda8d123e8fae", "score": "0.6627259", "text": "function barchart(svalue){\n const filtered_sample = dataSamples.filter(sdata=>sdata.id==svalue)[0];\n let data = [{\n x : filtered_sample.sample_values.slice(0, 10),\n y : filtered_sample.otu_ids.slice(0,10).map(item=>'OTU'.concat(' ', item.toString())),\n text : filtered_sample.otu_labels,\n type : 'bar',\n orientation : 'h'\n // ticks: {\n // reverse: true\n // },\n \n \n }]\n var layout = {\n title : {text : 'Top 10 Bacteria Cultures Found', font: { size: 20 }},\n };\n Plotly.newPlot('bar', data, layout)\n}", "title": "" }, { "docid": "436e4b4e14c9fb29881686f6c6d8e90e", "score": "0.66197324", "text": "draw(ctx, data) {\n ctx.save();\n\n ctx.fillStyle = ctx.strokeStyle = this.config.color.value;\n\n const barConfig = this.config;\n // cache all multiplication, reduce calculation to add and sub\n\n for (let i = 0; i < data.length; i++) {\n if (barConfig.cut && data[i] === 0) {\n continue;\n }\n\n const scaledData = data[i] * barConfig.scale;\n // Draw top left segment\n ctx.fillRect(\n this.cachedPos[i].topBarPosition.x,\n this.cachedPos[i].topBarPosition.y - scaledData,\n barConfig.width,\n barConfig.height\n );\n\n // Draw top right segment\n ctx.fillRect(\n this.cachedPos[i].topBarPosition.x,\n this.cachedPos[i].topBarPosition.y + scaledData,\n barConfig.width,\n barConfig.height\n );\n\n // Draw bottom right segment\n ctx.fillRect(\n this.cachedPos[i].bottomBarPosition.x,\n this.cachedPos[i].bottomBarPosition.y - scaledData,\n barConfig.width,\n barConfig.height\n );\n\n // Draw bottom left segment\n ctx.fillRect(\n this.cachedPos[i].bottomBarPosition.x,\n this.cachedPos[i].bottomBarPosition.y + scaledData,\n barConfig.width,\n barConfig.height\n );\n }\n\n ctx.restore();\n }", "title": "" }, { "docid": "aafc2e69449f02f9089af794dd2a93c8", "score": "0.66171247", "text": "function drawChart() {\n //create arrays for the names of the images and for the click totals of the images.\n //we'll pass these to the chart options object for the bars.\n var imageNames = [];\n var imageClicks = [];\n\n for (var i = 0; i < images.length; i++) {\n //loop through the images array and add each name to the imageNames array and each\n //amount of clicks to the imageClicks array\n imageNames.push(images[i].name);\n imageClicks.push(images[i].clicks);\n }\n\n //get the context for the chart\n var ctx = document.getElementById('chart_canvas');\n\n //call the Chart constructor passing in the context and an options object\n new Chart(ctx, {\n //set the chart type\n type: 'bar',\n //pass in the image names as the labels and the data in the datasets\n data: {\n labels: imageNames,\n datasets: [{\n data: imageClicks\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "dfb4c3f21c4414559cdebac3f5becc25", "score": "0.6608549", "text": "function renderCanvasBars(chartEl) {\n const barsContainer = document.createElement(\"canvas\");\n barsContainer.setAttribute(\"width\", 400);\n barsContainer.setAttribute(\"height\", 140);\n chartEl.appendChild(barsContainer);\n\n const ctx = barsContainer.getContext('2d');\n \n barsData.forEach((barData, index) => {\n ctx.fillStyle = barData.color;\n ctx.fillRect(0, index * (BAR_HEIGHT + BAR_MARGIN), CHART_WIDTH * barData.value / 100, BAR_HEIGHT);\n });\n }", "title": "" }, { "docid": "a2dfe9830569d8d8f56c8a3cdfa2f109", "score": "0.66033787", "text": "function makeBarSing(ctx) {\n myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\",\n \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\"],\n datasets: [{\n label: '# in ' + statName[0],\n data: selectData,\n borderColor: cols[0],\n backgroundColor: cols[0],\n borderWidth: 1\n }]\n },\n options: {\n title: {\n display: true,\n padding: 1,\n text: $(\"#crimeDd option:selected\").text()\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }],\n xAxes: [{\n stacked: true\n }]\n },\n tooltips: {\n mode: \"index\",\n intersect: false\n }\n }\n });\n}", "title": "" }, { "docid": "37de779f0331ff7b16e74c27f6f0bf64", "score": "0.6591791", "text": "function drawChartbar() {\n var data = google.visualization.arrayToDataTable([\n ['Favourite Place', 'Number of Students'],\n ['McDonalds', 5],\n ['Subway', 3],\n ['Sushi B', 1],\n ['New World', 1]\n ]);\n\n var options = {\n legend: {\n position: 'none'\n },\n vAxis: {title: 'Students'},\n width: 600,\n height: 400,\n backgroundColor: '#67EEE4'\n };\n\n var chart = new google.visualization.ColumnChart(document.getElementById(\"graph3\"));\n chart.draw(data, options);\n\n //Create a range slider, passing some options\n var dashboard = new google.visualization.Dashboard(\n document.getElementById('filter3'));\n\n // Create a range slider, passing some options\n var donutRangeSlider = new google.visualization.ControlWrapper({\n 'controlType': 'CategoryFilter',\n 'containerId': 'display-filter3',\n 'options': {\n 'filterColumnLabel': 'Favourite Place'\n }\n });\n\n var pieChart = new google.visualization.ChartWrapper({\n 'chartType': 'PieChart',\n 'containerId': 'display3',\n 'options': {\n 'width': 300,\n 'height': 300,\n 'pieSliceText': 'value',\n 'legend': 'right',\n 'backgroundColor': '#BDFFFD'\n }\n });\n\n dashboard.bind(donutRangeSlider, pieChart);\n\n dashboard.draw(data);\n }", "title": "" }, { "docid": "562e3325bf1dd754759e55ea5d4e94ab", "score": "0.6590591", "text": "function BarGraph(ctx) {\n\n // Private properties and methods\n\n var that = this;\n var startArr;\n var endArr;\n var looping = false;\n\n // Loop method adjusts the height of bar and redraws if neccessary\n var loop = function () {\n\n var delta;\n var animationComplete = true;\n\n // Boolean to prevent update function from looping if already looping\n looping = true;\n\n // For each bar\n for (var i = 0; i < endArr.length; i += 1) {\n // Change the current bar height toward its target height\n delta = (endArr[i] - startArr[i]) / that.animationSteps;\n that.curArr[i] += delta;\n // If any change is made then flip a switch\n if (delta) {\n animationComplete = false;\n }\n }\n // If no change was made to any bars then we are done\n if (animationComplete) {\n looping = false;\n } else {\n // Draw and call loop again\n draw(that.curArr);\n setTimeout(loop, that.animationInterval / that.animationSteps);\n }\n };\n\n // Draw method updates the canvas with the current display\n var draw = function (arr) {\n\n var numOfBars = arr.length;\n var barWidth;\n var barHeight;\n var border = 2;\n var ratio;\n var maxBarHeight;\n var gradient;\n var largestValue;\n var graphAreaX = 0;\n var graphAreaY = 0;\n var graphAreaWidth = that.width;\n var graphAreaHeight = that.height;\n var i;\n\n // Update the dimensions of the canvas only if they have changed\n if (ctx.canvas.width !== that.width || ctx.canvas.height !== that.height) {\n ctx.canvas.width = that.width;\n ctx.canvas.height = that.height;\n }\n\n // Draw the background color\n ctx.fillStyle = that.backgroundColor;\n ctx.fillRect(0, 0, that.width, that.height);\n\n // If x axis labels exist then make room\t\n if (that.xAxisLabelArr.length) {\n graphAreaHeight -= 40;\n }\n\n // Calculate dimensions of the bar\n barWidth = graphAreaWidth / numOfBars - that.margin * 2;\n maxBarHeight = graphAreaHeight - 25;\n\n // Determine the largest value in the bar array\n var largestValue = 0;\n for (i = 0; i < arr.length; i += 1) {\n if (arr[i] > largestValue) {\n largestValue = arr[i];\n }\n }\n\n // For each bar\n for (i = 0; i < arr.length; i += 1) {\n // Set the ratio of current bar compared to the maximum\n if (that.maxValue) {\n ratio = arr[i] / that.maxValue;\n } else {\n ratio = arr[i] / largestValue;\n }\n\n barHeight = ratio * maxBarHeight;\n\n // Turn on shadow\n ctx.shadowOffsetX = 2;\n ctx.shadowOffsetY = 2;\n ctx.shadowBlur = 2;\n ctx.shadowColor = \"#999\";\n\n // Draw bar background\n ctx.fillStyle = \"#333\";\n ctx.fillRect(that.margin + i * that.width / numOfBars,\n graphAreaHeight - barHeight,\n barWidth,\n barHeight);\n\n // Turn off shadow\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = 0;\n\n // Draw bar color if it is large enough to be visible\n if (barHeight > border * 2) {\n // Create gradient\n gradient = ctx.createLinearGradient(0, 0, 0, graphAreaHeight);\n gradient.addColorStop(1 - ratio, that.colors[i % that.colors.length]);\n gradient.addColorStop(1, \"#ffffff\");\n\n ctx.fillStyle = gradient;\n // Fill rectangle with gradient\n ctx.fillRect(that.margin + i * that.width / numOfBars + border,\n graphAreaHeight - barHeight + border,\n barWidth - border * 2,\n barHeight - border * 2);\n }\n\n // Write bar value\n ctx.fillStyle = \"#333\";\n ctx.font = \"bold 12px sans-serif\";\n ctx.textAlign = \"center\";\n // Use try / catch to stop IE 8 from going to error town\n try {\n ctx.fillText(parseInt(arr[i], 10),\n i * that.width / numOfBars + (that.width / numOfBars) / 2,\n graphAreaHeight - barHeight - 10);\n } catch (ex) { }\n // Draw bar label if it exists\n if (that.xAxisLabelArr[i]) {\n // Use try / catch to stop IE 8 from going to error town\t\t\t\t\n ctx.fillStyle = \"#333\";\n ctx.font = \"bold 12px sans-serif\";\n ctx.textAlign = \"center\";\n try {\n ctx.fillText(that.xAxisLabelArr[i],\n i * that.width / numOfBars + (that.width / numOfBars) / 2,\n that.height - 10);\n } catch (ex) { }\n }\n }\n };\n\n // Public properties and methods\n\n this.width = 300;\n this.height = 150;\n this.maxValue;\n this.margin = 5;\n this.colors = [\"purple\", \"red\", \"green\", \"yellow\"];\n this.curArr = [];\n this.backgroundColor = \"#fff\";\n this.xAxisLabelArr = [];\n this.yAxisLabelArr = [];\n this.animationInterval = 100;\n this.animationSteps = 10;\n\n // Update method sets the end bar array and starts the animation\n this.update = function (newArr) {\n\n // If length of target and current array is different \n if (that.curArr.length !== newArr.length) {\n that.curArr = newArr;\n draw(newArr);\n } else {\n // Set the starting array to the current array\n startArr = that.curArr;\n // Set the target array to the new array\n endArr = newArr;\n // Animate from the start array to the end array\n if (!looping) {\n loop();\n }\n }\n };\n}", "title": "" }, { "docid": "cb957c6f6202db10b0bfadba5d2e0d9c", "score": "0.6586186", "text": "function paintBarGraph() {\n const oneCountry = handleCountryData(countryName);\n const dayBarChartData = {\n labels: oneCountry[0],\n series: [oneCountry[1]],\n };\n new Chartist.Bar('#daily-bar-chart', dayBarChartData);\n}", "title": "" }, { "docid": "55dab56715f63bfdca9737f3607b0e1f", "score": "0.6582376", "text": "function barChart(topFiftyData) {\n // set the dimensions and margins of the graph\n const margin = {\n top: 50,\n right: 100,\n bottom: 100,\n left: 100,\n },\n width = 1280 - margin.left - margin.right,\n height = 720 - margin.top - margin.bottom;\n\n // append the svg object to the body of the page\n const svg = d3\n .select(\"body\")\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n // X axis\n const x = d3\n .scaleBand()\n .range([0, width])\n .domain(topFiftyData.map((d) => d.artist))\n .padding(0.2);\n svg\n .append(\"g\")\n .attr(\"transform\", `translate(0,${height})`)\n .call(d3.axisBottom(x))\n .selectAll(\"text\")\n .attr(\"transform\", \"translate(-10,0)rotate(-45)\")\n .style(\"text-anchor\", \"end\");\n\n // Add Y axis\n const y = d3.scaleLinear().domain([0, 6500000]).range([height, 0]);\n svg.append(\"g\").call(d3.axisLeft(y));\n\n // Bars\n svg\n .selectAll(\"bars\")\n .data(topFiftyData)\n .join(\"rect\")\n .attr(\"x\", (d) => x(d.artist))\n .attr(\"width\", x.bandwidth())\n .attr(\"fill\", \"#1ed760\")\n .attr(\"height\", (d) => height - y(0)) // always equal to 0\n .attr(\"y\", (d) => y(0))\n .attr(\"data-amount\", (d) => d.listeners)\n // on mouse effects to create interactivity\n .on(\"mouseover\", function (d, i) {\n tooltip\n .html(`${d.srcElement.__data__.artist}: ${d.srcElement.dataset.amount}`)\n .style(\"visibility\", \"visible\");\n console.log(d);\n d3.select(this).attr(\"fill\", (\"#1ed760\", \"#1db954\"));\n })\n .on(\"mousemove\", function () {\n tooltip\n .style(\"top\", event.y - 10 + \"px\")\n .style(\"left\", event.x + 10 + \"px\");\n })\n .on(\"mouseout\", function () {\n tooltip.html(``).style(\"visibility\", \"hidden\");\n d3.select(this).attr(\"fill\", \"#1ed760\");\n });\n\n // Animation\n svg\n .selectAll(\"rect\")\n .transition()\n .ease(d3.easeQuadOut)\n .duration(800)\n .attr(\"y\", (d) => y(d.listeners))\n .attr(\"height\", (d) => height - y(d.listeners))\n .delay((d, i) => {\n return i * 100;\n });\n\n // create tooltip element\n const tooltip = d3\n .select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"d3-tooltip\")\n .style(\"position\", \"absolute\")\n .style(\"z-index\", \"10\")\n .style(\"visibility\", \"hidden\")\n .style(\"padding\", \"15px\")\n .style(\"background\", \"#3860be\")\n .style(\"border-radius\", \"5px\")\n .style(\"color\", \"#fff\")\n .style(\"font-family\", \"sans-serif\");\n}", "title": "" }, { "docid": "ddded8e230cced2d53114b861d5b632b", "score": "0.6581988", "text": "function drawChart() {\n\n $.ajax({\n url: riff_vars_25.ajaxurl,\n type: 'POST',\n datatype: 'json',\n data: {\n action: 'riffchart_get_data',\n },\n success: function (ret) {\n var dataarray = Array();\n dataarray = eval(ret);\n\n var data = google.visualization.arrayToDataTable(dataarray);\n\n var options = {\n width: 560,\n height: 400,\n legend: {position: 'top', maxLines: 3},\n bar: {groupWidth: '75%'},\n isStacked: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }\n });\n\n }", "title": "" }, { "docid": "49c15a0d8044ff2e93171678b500808b", "score": "0.65670437", "text": "drawBarChart(available, total) {\n\t\tvar $chart = $('<div>')\n\t\tvar chartData = google.visualization.arrayToDataTable(\n\t\t[\n\t\t\t['Kind', 'Available', 'Total', { role: 'annotation' }],\n\t\t\t['Memory', available.memory['value'], total.memory['value'], 'MEMORY'],\n\t\t\t['CPU', available.cpu['value'], total.cpu['value'], 'COMPUTE'],\n\t\t\t['Disk', available.storage['value'], total.storage['value'], 'STORAGE']\n\t\t])\n\t\t\t\t\n\t\tvar chart = new google.visualization.BarChart($chart[0]);\n\t\tvar options = {\n\t\t title: 'Available/Total Capacity',\n\t\t chartArea: {width: '50%'},\n\t\t legend:{position:'bottom'},\n\t\t bar: {groupWidth:'95%'},\n\t\t isStacked:'percent',\n\t\t series: {\n\t\t \t0:{color:'blue'}, // available\n\t\t \t1:{color:'green'} // total\n\t\t }\n\t\t };\n\t\t\n\t\tchart.draw(chartData, options)\n\t\treturn $chart\n\t}", "title": "" }, { "docid": "59ca76be486dc4d8aef7d6988e1b683e", "score": "0.65481436", "text": "function BarChart(info) {\n // campi dati di un bar chart e valori di default\n this._axisX = null;\n this._axisY = null;\n this._barOrientation = 'V';\n this._headers = [];\n this._background = '#FFF';\n this._sortable = true;\n this._groupingControl = true;\n this._legendOnPoint = false;\n this._horizontalGrid = false;\n this._graph = GraphFactory.build(info);\n }", "title": "" }, { "docid": "59ca76be486dc4d8aef7d6988e1b683e", "score": "0.65481436", "text": "function BarChart(info) {\n // campi dati di un bar chart e valori di default\n this._axisX = null;\n this._axisY = null;\n this._barOrientation = 'V';\n this._headers = [];\n this._background = '#FFF';\n this._sortable = true;\n this._groupingControl = true;\n this._legendOnPoint = false;\n this._horizontalGrid = false;\n this._graph = GraphFactory.build(info);\n }", "title": "" }, { "docid": "b16f0048efec9c366ea420440cf793e4", "score": "0.654424", "text": "function drawbarrinha() {\r\n ctx.beginPath();\r\n ctx.rect(barrinha.x, barrinha.y, barrinha.w, barrinha.h);\r\n ctx.fillStyle = '#F2DEA0';\r\n ctx.fill();\r\n ctx.closePath();\r\n}", "title": "" }, { "docid": "ac5e81d25e47031e275af92555ebf83b", "score": "0.65407306", "text": "function drawBar(ctx, upperLeftCornerX, upperLeftCornerY, width, height,color){\n ctx.save();\n ctx.fillStyle=color;\n ctx.fillRect(upperLeftCornerX,upperLeftCornerY,width,height);\n ctx.restore();\n}", "title": "" }, { "docid": "8c4dee42cb5736f8bd888eea04311b3a", "score": "0.653479", "text": "function plot(params){\n\t//select all the elements withing the svg element that have bar class\n\t//.enter() first time data is bound\n\n\tconsole.log(this);\n\t\n\tthis.append(\"g\")\n\t\t.call(params.gridlines)\n\t\t.classed(\"gridline\",true)\n\t\t.attr(\"transform\",\"translate(0,0)\")\n\tthis.selectAll(\".bar\")\n\t\t.data(params.data)\n\t\t.enter()\n\t\t\t.append(\"rect\")\n\t\t\t.classed(\"bar\",true)\n\t\t\t.attr(\"x\", function(d,i){\n\t\t\t\treturn x(d.key);\n\t\t\t})\n\t\t\t.attr(\"y\", function(d,i){\n\t\t\t\treturn y(d.value);\n\t\t\t})\n\t\t\t.attr(\"width\", function(d){\n\t\t\t\treturn x.rangeBand()-50;\n\t\t\t})\n\t\t\t.attr(\"height\", function(d,i){\n\t\t\t\treturn height - y(d.value);\n\t\t\t})\n\t\t\t.style(\"fill\", function(d,i){\n\t\t\t\treturn ordinalColorScale(i);\n\t\t\t\t//return linearColorScale(i);\n\t\t\t});\n\t\t\t//creating text labels\n\t\t\t//select all the elements in svg element that have class bar-label\n\t\t\t//bind data to them\n\t\t\t//append text element\n\t\t\t//dy to nudge y \n\t\t\t//text-anchor in css to position text\n\t\t\t//applied bar-label class to text using classed\n\tthis.selectAll(\".bar-label\")\n\t\t.data(params.data)\n\t\t.enter()\n\t\t\t.append(\"text\")\n\t\t\t.classed(\"bar-label\",true)\n\t\t\t.attr(\"x\",function(d,i){\n\t\t\t\treturn x(d.key) + (x.rangeBand()/2);\n\t\t\t})\n\t\t\t.attr(\"y\", function(d,i){\n\t\t\t\treturn y(d.value);\n\t\t\t})\n\t\t\t.attr(\"dx\", 0)\n\t\t\t.attr(\"dy\", -6)\n\t\t\t.text(function(d,i){\n\t\t\t\treturn d.value;\n\t\t\t})\n\tthis.append(\"g\")\n\t\t\t.classed(\"x axis\",true)\n\t\t\t.attr(\"transform\",\"translate(\"+0+\",\"+height+\")\")\n\t\t\t.call(params.axis.x)\n\t\t\t\t.selectAll(\"text\")\n\t\t\t\t\t.style(\"text-anchor\",\"end\")\n\t\t\t\t\t.attr(\"dx\",-8)\n\t\t\t\t\t.attr(\"dy\",8)\n\t\t\t\t\t.attr(\"transform\",\"translate(0,0) rotate(-45)\");\n\tthis.append(\"g\")\n\t\t\t.classed(\"y axis\",true)\n\t\t\t.attr(\"transform\",\"translate(0,0)\")\n\t\t\t.call(params.axis.y);\n\tthis.select(\".y.axis\")\n\t\t.append(\"text\")\n\t\t.attr(\"x\",0)\n\t\t.attr(\"y\",0)\n\t\t.style(\"text-anchor\",\"middle\")\n\t\t.attr(\"transform\",\"translate(-50,\"+height/2+\") rotate(-90)\")\n\t\t.text(\"% Change\");\n\tthis.select(\".x.axis\")\n\t\t.append(\"text\")\n\t\t.attr(\"x\",0)\n\t\t.attr(\"y\",0)\n\t\t.style(\"text-anchor\",\"middle\")\n\t\t.attr(\"transform\",\"translate(\"+width/2+\",80) \")\n\t\t.text(\"Companies\");\n\n\t\t\n}", "title": "" }, { "docid": "3eeb52977b0329bef20e56c523b159ac", "score": "0.6531702", "text": "function barChart(value) {\n\n // Filter samples data by id selected in dropdown menu\n var selectedSample = dataDB.samples.filter(subject => \n (subject.id === value));\n\n // Get sample data \n var otuLabels = selectedSample[0].otu_labels;\n var otuIds = selectedSample[0].otu_ids;\n var sampleValues = selectedSample[0].sample_values;\n\n // Slice top 10 from each array\n\n var top10_otuLabels = otuLabels.slice(0, 10);\n var top10_otuIds = otuIds.slice(0, 10);\n var top10_sampleValues = sampleValues.slice(0, 10);\n\n // Loop to add \"OTU\" in front of OTU IDs and convert from integer to string\n var top10_otuIdsLabels = [];\n\n for (var i = 0; i < top10_otuIds.length; i++) {\n top10_otuIdsLabels.push(\"OTU \" + top10_otuIds[i]);\n };\n\n // Reverse the order to plot in descending order\n top10_otuLabels = top10_otuLabels.reverse();\n top10_otuIdsLabels = top10_otuIdsLabels.reverse();\n top10_sampleValues = top10_sampleValues.reverse();\n\n\n // Set up trace\n var trace1 = {\n x: top10_sampleValues, \n y: top10_otuIdsLabels,\n text: top10_otuLabels,\n type: \"bar\",\n orientation: \"h\",\n marker: {\n color: 'rgb(128,0,128)',\n opacity: 0.5,\n line: {\n color: 'rgb(128,0,128)',\n width: 1,\n },\n }\n };\n\n // Data for plotting into an array\n var data = [trace1];\n\n // Set up layout\n var layout = {\n title: \"Top 10 Operational Taxonomic Units (OTU)\",\n xaxis: {\n zeroline: true,\n showline: false,\n showticklabels: true,\n showgrid: true\n }\n };\n\n // Render plot\n Plotly.newPlot(\"bar\", data, layout);\n}", "title": "" }, { "docid": "4daa0321787acae45d359c393cb25d71", "score": "0.65299153", "text": "draw() {\n this._predraw();\n const draw = new Draw(this.bar, this.token.w, this.h, this.tempText);\n this._draw(draw);\n this._postdraw();\n }", "title": "" }, { "docid": "31302c277577ff9b5a7a4d2a528b4ad6", "score": "0.6523428", "text": "function drawBarUpdate(ob){\n var width = ob.width;\n console.log(ob);\n d3.select(\".bar-rect-\"+ob.k).selectAll(\"rect\").data(data.genomicProfileList[ob.k].mutationList)\n .attr({\n width:width-5,\n x:function(d,i){ return i*(width)},\n });\n\n d3.select(\".bar-text-\"+ob.k).selectAll(\"text\").data(data.genomicProfileList[ob.k].mutationList).text(function(d){\n if (ob.val == \"geneSymbol\") {\n return d.geneSymbol;\n } else if (ob.val == \"strand\") {\n return d.strand;\n } else {\n return d.chromosome.substring(3,5);\n }\n })\n .attr({\n \"font-size\":\"10px\",\n x:function(d,i){ return i*(width)+ob.offset},\n })\n .on(\"click\",function(d,i){\n d3.select(\".bar-rect-\"+ob.k).select(\"rect:nth-child(\"+(i+1)+\")\").style(\"fill\",\"red\");\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n });\n }", "title": "" }, { "docid": "e1153fc75ba58471e81e89a73469d18c", "score": "0.6521567", "text": "function showBarChart(){\n\t/*\n\t//Please remove\n\tmyAmounts=myInvoices.AmountList;\n\tmyCategories=myInvoices.CategoryList;\n\t*/\n\t\n\t//For Testing ONLY\n\tlet myAmounts=[14,55,33,40,67,22];\n\tlet myCategories=[\"Utilities\",\"Telephone\",\"Services\",\"Consultancy\",\"Raw Materials\", \"Other\"];\n\t//\n\tconsole.log(myAmounts);\n\tconsole.log(myCategories);\n\t\n\tlet popCanvasName=document.getElementById(\"barChart\");\n\tlet barChartName=new Chart(popCanvasName,{\n\t\ttype: 'bar',\n\t\tdata:{\n\t\t\tlabels: myCategories,\n\t\t\tdatasets:[{\n\t\t\t\tlabel: 'Invoice data',\n\t\t\t\tdata: myAmounts,\n\t\t\t\tbackgroundColor:[\n\t\t\t\t'rgba(255, 99, 132, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n\t\t\t\t'rgba(255, 206, 86, 0.6)',\n\t\t\t\t'rgba(75, 192, 192, 0.6)',\n\t\t\t\t'rgba(153, 102, 255, 0.6)'\n\t\t\t\t]\n\t\t\t}]\n\t\t},\n\t\toptions:{\n\t\t\tresponsive: false,\n\t\t\tscales:{\n\t\t\t\tyAxes:[{\n\t\t\t\t\tticks:{beginAtZero:true}\n\t\t\t\t}]\n\t\t\t},\n\t\t\tplugins:{\n\t\t\t\ttitle:{\n\t\t\t\tdisplay: true,\n\t\t\t\ttext: chartTitle,\n\t\t\t\tfont:{\n\t\t\t\t\tsize:20\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "af9d1c72f4de0aab62f0a5d37c876ca5", "score": "0.65174544", "text": "function Barchart(tableData) {\n console.log(tableData.otu_ids.map(function (otu) {\n return \"OTU \" + otu\n }))\n var number = tableData.sample_values.slice(0, 10);\n var slice = tableData.otu_ids.map(function (otu) {\n return \"OTU \" + otu\n }).slice(0, 10)\n console.log(slice)\n var otu_label = tableData.otu_labels\n var trace1 = [{\n text: otu_label.reverse(),\n type: 'bar',\n x: number.reverse(),\n y: slice.reverse(),\n orientation: 'h'\n }];\n var layout = {\n title: 'Top 10 Bacteria Cultures Found',\n xaxis: { title: \"Bacteria Sample Values\" },\n yaxis: { title: \"OTU IDs\" }\n };\n // Display plot\n Plotly.newPlot(\"bar\", trace1, layout);\n}", "title": "" }, { "docid": "6cdc5ab5f740cff05552e5abc3dba26c", "score": "0.65098286", "text": "function drawBars() {\n\nx.domain(dataset.map(function (d) { return d[\"Country\"]; })) \n .round(true) \n .range([0, width])\n .paddingInner(0.05);\n\ny.domain([40, 50])\n .range([height, 0]);\n\nsvg.selectAll(\".bar\")\n .data(dataset, function (d) { return d[\"Country\"]; })\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) { return x(d[\"Country\"]); })\n .attr(\"y\", function (d) { return y(d[\"Labor_2016\"]); })\n .attr(\"width\", x.bandwidth())\n .attr(\"fill\", d=>get_color(d[\"Labor_2016\"]))\n .attr(\"height\", function (d) { return height - y(d[\"Labor_2016\"]); });\n\nsvg.selectAll(\".planet_label\")\n .data(dataset, function (d) { return d[\"Country\"]; })\n .enter().append(\"text\")\n .text(function (d) { return d[\"Country\"]; })\n .attr(\"class\", \"planet_label\")\n .attr(\"x\", function (d) { return x(d[\"Country\"]) + x.bandwidth() / 2; })\n .attr(\"y\", function (d) { return height+15; });\n\n\nvar xAxis;\nxAxis = d3.axisBottom()\n .scale(x)\n .tickFormat('');\n\nsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\nsvg.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"font-weight\", \"bold\")\n .text(\"Developed Countries\")\n .attr(\"x\", width / 2 - 50)\n .attr(\"y\", height + 40);\n\nvar yAxis = d3.axisLeft()\n .scale(y)\n .ticks(5, '.0f');\n\nsvg.append(\"g\")\n .attr(\"class\", \"axis\")\n .call(yAxis);\n\nsvg.append(\"text\")\n.attr(\"transform\", \"rotate(-90)\")\n.attr(\"y\", 0 - padding.left + 10)\n.attr(\"x\",0 - (height / 2))\n.attr(\"dy\", \"1em\")\n.attr(\"font-weight\", \"bold\")\n.style(\"text-anchor\", \"middle\")\n.text(\"Women Labor Force (% to Total)\"); \n\nvar legend = svg.selectAll(\".legend\")\n .data(dataset)\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n// color legend\nlegend.append(\"rect\")\n .attr(\"x\", width +50)\n .attr(\"y\", 20)\n .attr(\"width\", 20)\n .attr(\"height\", 20)\n .style(\"fill\", d=>get_color(d[\"Labor_2016\"]));\n\n// legend label\nlegend.append(\"text\")\n .attr(\"x\", width + 80)\n .attr(\"y\", 30)\n .attr(\"dy\", \".30em\")\n .style(\"text-anchor\", \"start\")\n .text(function(d) { return d[\"Country\"] + \" (\" + d[\"Labor_2016\"] + \"%)\";});\n\n}", "title": "" }, { "docid": "a1c2a203aa2a82a631908f63b702760d", "score": "0.6509029", "text": "function drawBarChartAxis(max)\r\n{\r\n\t// Draw the axis titles and grid lines\r\n\t// canvas2.cx.font = font.title;\r\n\t// canvas2.cx.fillText('Title', canvas2.graphLeft + canvas2.graphWidth/2, canvas2.graphTop - 30);\r\n\tcanvas1.cx.fillStyle = '#000000';\r\n\tcanvas1.cx.strokeStyle = color.graphGrid;\r\n\tif ( canvas1.threeD ) {\r\n\t\t// Rear left vertical axis\r\n\t\tcanvas1.cx.lineWidth = 1;\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(canvas1.graphLeft + canvas1.barSlant + .5,\r\n\t\t\t\t\t\t\tcanvas1.graphBottom - canvas1.barDepth);\r\n\t\tcanvas1.cx.lineTo(canvas1.graphLeft + canvas1.barSlant + .5,\r\n\t\t\t\t\t\t\tcanvas1.graphTop - canvas1.barDepth);\r\n\t\tcanvas1.cx.stroke();\r\n\t\t// Slanted line to right vertical axis\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(canvas1.graphRight, canvas1.graphBottom);\r\n\t\tcanvas1.cx.lineTo(canvas1.graphRight + canvas1.barSlant,\r\n\t\t\t\t\t\t\tcanvas1.graphBottom - canvas1.barDepth);\r\n\t\tcanvas1.cx.stroke();\r\n\t}\r\n\t// Right vertical axis\r\n\tcanvas1.cx.lineWidth = 1;\r\n\tcanvas1.cx.beginPath();\r\n\tcanvas1.cx.moveTo(canvas1.graphRight + canvas1.barSlant + .5,\r\n\t\t\t\t\t\tcanvas1.graphBottom - canvas1.barDepth);\r\n\tcanvas1.cx.lineTo(canvas1.graphRight + canvas1.barSlant + .5,\r\n\t\t\t\t\t\tcanvas1.graphTop - canvas1.barDepth);\r\n\tcanvas1.cx.stroke();\r\n\tcanvas1.cx.font = font.axisNumbers;\r\n\t// Left vertical axis and axis numbering\r\n\tfor ( var i = 0; i < 6; i++ ) {\r\n\t\tvar y = canvas1.graphBottom - canvas1.graphHeight*i/5;\r\n\t\tcanvas1.cx.fillText(round((max*i/5), 4, 6),\r\n\t\t\t\tcanvas1.graphLeft - 25, y + 6);\r\n\t\tcanvas1.cx.beginPath();\r\n\t\tcanvas1.cx.moveTo(canvas1.graphRight + canvas1.barSlant, y - canvas1.barDepth + .5);\r\n\t\tcanvas1.cx.lineTo(canvas1.graphLeft + canvas1.barSlant, y - canvas1.barDepth + .5);\r\n\t\tif ( canvas1.threeD )\r\n\t\t\tcanvas1.cx.lineTo(canvas1.graphLeft, y);\r\n\t\tcanvas1.cx.stroke();\r\n\t}\r\n\tcanvas1.cx.font = font.axisLabels;\r\n\tfor ( var i = 0; i < molecules.length; i++ ) {\r\n\t\tcanvas1.cx.fillText( molecules[i], canvas1.graphLeft + (canvas1.graphWidth*(2*i + 1 ) )/12, canvas1.graphBottom + 20);\r\n\t}\r\n\tcanvas1.cx.save();\r\n\tcanvas1.cx.font = font.axisLabels;\r\n\tvar axisTitle;\r\n\tif ( mode == \"mole\" ) {\r\n\t\taxisTitle = \"Amount (moles)\";\r\n\t}\r\n\telse {\r\n\t\taxisTitle = \"Mass (g)\";\r\n\t}\r\n\tcanvas1.cx.rotate(-Math.PI/2);\r\n\t// Careful, everything is rotated\r\n\tcanvas1.cx.fillText(axisTitle, -canvas1.graphTop-canvas1.graphHeight/2, canvas1.graphLeft-48);\r\n\tcanvas1.cx.restore();\r\n\r\n\t// Draw the axis; drawn second so that it is on top of the grid lines\r\n\tcanvas1.cx.lineWidth = 2;\r\n\tcanvas1.cx.strokeStyle = color.graphAxis;\r\n\tcanvas1.cx.beginPath();\r\n\tcanvas1.cx.moveTo(canvas1.graphLeft, canvas1.graphTop);\r\n\tcanvas1.cx.lineTo(canvas1.graphLeft, canvas1.graphBottom);\r\n\tcanvas1.cx.lineTo(canvas1.graphRight, canvas1.graphBottom);\r\n\tcanvas1.cx.stroke();\r\n}", "title": "" }, { "docid": "d1c8e12d996aa313285e88b2c8d6aa69", "score": "0.6506359", "text": "function makeBarStations(ctx) {\n myChart = new Chart(ctx, {\n type: \"bar\",\n data: {\n labels: [\"2003\", \"2004\", \"2005\", \"2006\", \"2007\", \"2008\", \"2009\",\n \"2010\", \"2011\", \"2012\", \"2013\", \"2014\", \"2015\", \"2016\"],\n datasets: [{\n label: '# in ' + statName[0],\n fill: false,\n borderColor: cols[0],\n backgroundColor: cols[0],\n data: selectData\n },\n {\n label: '# in ' + statName[1],\n fill: false,\n data: extraSelectedStat[0],\n borderColor: cols[1],\n backgroundColor: cols[1],\n },\n {\n label: '# in ' + statName[2],\n fill: false,\n data: extraSelectedStat[1],\n borderColor: cols[2],\n backgroundColor: cols[2]\n },\n {\n label: '# in ' + statName[3],\n fill: false,\n data: extraSelectedStat[2],\n borderColor: cols[3],\n backgroundColor: cols[3]\n },\n {\n label: '# in ' + statName[4],\n fill: false,\n data: extraSelectedStat[3],\n borderColor: cols[4],\n backgroundColor: cols[4]\n },\n {\n label: '# in ' + statName[5],\n fill: false,\n data: extraSelectedStat[4],\n borderColor: cols[5],\n backgroundColor: cols[5]\n }]\n },\n options: {\n title: {\n display: true,\n padding: 1,\n text: $(\"#crimeDd option:selected\").text()\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }],\n // xAxes: [{\n // stacked: true\n // }]\n },\n tooltips: {\n mode: \"index\",\n intersect: false\n }\n }\n });\n}", "title": "" }, { "docid": "70a76b51d6e533adbe8f2babb7d2945d", "score": "0.65063024", "text": "function configureBarStyle(chart) {\n console.log(gdpDataArray[0][1]);\n const chartGroup = chart._groups[0][0].children;\n const bars = $.makeArray(chartGroup).slice(2);\n const gdpConstant = 28.226093;\n bars.forEach(bar => {\n bar.onmouseover = function() {\n this.classList.add('barHover');\n var gdp = (this['height'].baseVal.value * gdpConstant).toFixed(1);\n $(`<span>$${gdp} Billion</span>`).css('text-align', 'center').appendTo(\"#display\");\n }\n bar.onmouseout = function() {\n this.classList.remove('barHover');\n $(`#display`).empty();\n }\n });\n}", "title": "" } ]
575527d3fd1a3705f5b9a57599fd5b19
the Zlib class they all inherit from This thing manages the queue of requests, and returns true or false if there is anything in the queue when you call the .write() method.
[ { "docid": "7a74ce7e9353a88c282b820f3ae23214", "score": "0.0", "text": "function Zlib(opts, mode) {\n this._opts = opts = opts || {};\n this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;\n\n Transform.call(this, opts);\n\n if (opts.flush) {\n if (opts.flush !== binding.Z_NO_FLUSH &&\n opts.flush !== binding.Z_PARTIAL_FLUSH &&\n opts.flush !== binding.Z_SYNC_FLUSH &&\n opts.flush !== binding.Z_FULL_FLUSH &&\n opts.flush !== binding.Z_FINISH &&\n opts.flush !== binding.Z_BLOCK) {\n throw new Error('Invalid flush flag: ' + opts.flush);\n }\n }\n this._flushFlag = opts.flush || binding.Z_NO_FLUSH;\n\n if (opts.chunkSize) {\n if (opts.chunkSize < exports.Z_MIN_CHUNK ||\n opts.chunkSize > exports.Z_MAX_CHUNK) {\n throw new Error('Invalid chunk size: ' + opts.chunkSize);\n }\n }\n\n if (opts.windowBits) {\n if (opts.windowBits < exports.Z_MIN_WINDOWBITS ||\n opts.windowBits > exports.Z_MAX_WINDOWBITS) {\n throw new Error('Invalid windowBits: ' + opts.windowBits);\n }\n }\n\n if (opts.level) {\n if (opts.level < exports.Z_MIN_LEVEL ||\n opts.level > exports.Z_MAX_LEVEL) {\n throw new Error('Invalid compression level: ' + opts.level);\n }\n }\n\n if (opts.memLevel) {\n if (opts.memLevel < exports.Z_MIN_MEMLEVEL ||\n opts.memLevel > exports.Z_MAX_MEMLEVEL) {\n throw new Error('Invalid memLevel: ' + opts.memLevel);\n }\n }\n\n if (opts.strategy) {\n if (opts.strategy != exports.Z_FILTERED &&\n opts.strategy != exports.Z_HUFFMAN_ONLY &&\n opts.strategy != exports.Z_RLE &&\n opts.strategy != exports.Z_FIXED &&\n opts.strategy != exports.Z_DEFAULT_STRATEGY) {\n throw new Error('Invalid strategy: ' + opts.strategy);\n }\n }\n\n if (opts.dictionary) {\n if (!Buffer.isBuffer(opts.dictionary)) {\n throw new Error('Invalid dictionary: it should be a Buffer instance');\n }\n }\n\n this._binding = new binding.Zlib(mode);\n\n var self = this;\n this._hadError = false;\n this._binding.onerror = function(message, errno) {\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n self._binding = null;\n self._hadError = true;\n\n var error = new Error(message);\n error.errno = errno;\n error.code = exports.codes[errno];\n self.emit('error', error);\n };\n\n var level = exports.Z_DEFAULT_COMPRESSION;\n if (typeof opts.level === 'number') level = opts.level;\n\n var strategy = exports.Z_DEFAULT_STRATEGY;\n if (typeof opts.strategy === 'number') strategy = opts.strategy;\n\n this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS,\n level,\n opts.memLevel || exports.Z_DEFAULT_MEMLEVEL,\n strategy,\n opts.dictionary);\n\n this._buffer = new Buffer(this._chunkSize);\n this._offset = 0;\n this._closed = false;\n this._level = level;\n this._strategy = strategy;\n\n this.once('end', this.close);\n}", "title": "" } ]
[ { "docid": "3ee04184c7dc5d77de7ed3b510749e43", "score": "0.6725928", "text": "_emptyQueue() {\n return this._requests.length === 0;\n }", "title": "" }, { "docid": "3ee04184c7dc5d77de7ed3b510749e43", "score": "0.6725928", "text": "_emptyQueue() {\n return this._requests.length === 0;\n }", "title": "" }, { "docid": "16ba82cf1173b4a9477aa5898b179a53", "score": "0.61530083", "text": "function isInQueue()\n\t{\n\t\treturn API.getBoothPosition() !== -1 || API.getWaitListPosition() !== -1;\n\t}", "title": "" }, { "docid": "689b8d1f920115afd3f47c5615c22357", "score": "0.61234033", "text": "function queueRequest(request) {\n handleCaching(request)\n\n queue.asap(request)\n\n return true\n }", "title": "" }, { "docid": "aeff7346249aa70a03b8d50ef8288b22", "score": "0.61005783", "text": "_sendQueued(responseId, data) {\n let idx = 0;\n while (this.writeQueue.length && idx < this.writeQueue.length) {\n // we found the queue entry that matches with the responseId, so store the data so be sent out\n if (this.writeQueue[idx].id === responseId) {\n this.writeQueue[idx].data = data;\n // if we found it not on first index we are done because we can not send it out,\n // need to wait for index 0 to have a complete answer\n if (idx > 0) {\n break;\n }\n }\n // when data for queue entry 0 are preset (!== false) we can send it, remove the first entry\n // and check the other entries if they have completed responses too\n if (idx === 0 && this.writeQueue[idx].data !== false) {\n const response = this.writeQueue.shift();\n if (this.options.enhancedLogging) {\n this.log.silly(`${this.socketId} Redis response (${response.id}): ${(response.data.length > 1024) ? data.length + ' bytes' : response.data.toString().replace(/[\\r\\n]+/g, '')}`);\n }\n this._write(response.data);\n // We sended out first queue entry but no further response is ready\n // and we do not need to check the whole queue, so we are done here\n if (this.writeQueue.length && this.writeQueue[idx].data === false) {\n break;\n }\n } else {\n // we have not found the response on the current index, try next one\n idx++;\n }\n }\n\n if (idx > 0) {\n if (this.options.enhancedLogging) {\n this.log.silly(`${this.socketId} Redis response (${responseId}): Response queued`);\n }\n }\n }", "title": "" }, { "docid": "3c718a200afcf06f8df022b312b634b2", "score": "0.5815665", "text": "function Queue() {}", "title": "" }, { "docid": "ef2f0415cb19bd69789d916ec3a628c8", "score": "0.58092725", "text": "function runQueue(){\n\t\t\tif( urllist.length ){\n\t\t\t\tAI.makeReq( o.proxy + urllist.join( \",\" ), elQueue );\n\t\t\t\telQueue = $();\n\t\t\t\turllist = [];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "84013b54b6485bf2290f13b675a2e1d4", "score": "0.57710737", "text": "function runQueue(){\n\t\t\tif( urllist.length ){\n\t\t\t\tmakeReq( o.proxy + urllist.join( \",\" ), elQueue );\n\t\t\t\telQueue = $();\n\t\t\t\turllist = [];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3e449dec105d1182bd7b9bd8c1bfc0e5", "score": "0.5750681", "text": "function queueCallback() {\n // This is called when a request has been completed, increment the number of requests complete variable \n numRequestsComplete++;\n // Log out the current number of shows processed for debug purposes\n console.log(\"#RequestsComplete: \" + numRequestsComplete);\n}", "title": "" }, { "docid": "e9b620be5ca199da67efdea02b523ffd", "score": "0.57015693", "text": "async digestRequestQueue() {\n this.digesting = (this.queue.length > 0)\n\n if (this.digesting) {\n const { req, res } = this.queue.shift()\n\n try {\n res.json(await this.processRequest(req.body))\n log(\"✓ Completed Request\")\n } catch (err) {\n console.log(err)\n res.json(Message.error('Error', '⚠ An error occurred', err.message))\n }\n\n this.digestRequestQueue()\n }\n }", "title": "" }, { "docid": "a09c364bfb2adbb4e12ea15d81216fe8", "score": "0.5691115", "text": "function Queue(optFns) {\n\n // store your callbacks\n this._methods = (optFns && optFns[0]) || [];\n // keep a reference to your response\n this._response = null;\n // all queues start off unflushed\n this._flushed = false;\n}", "title": "" }, { "docid": "ac60dd516902161c4690f4d8d479bf6b", "score": "0.566157", "text": "function Queue() {\n\n var self = this;\n\n // ensure Queue was called as a constructor\n if (!(self instanceof Queue)) {\n return new Queue();\n }\n\n // @type {array} [[]] Store your method callbacks\n self.m = [];\n\n // @type {object} [null] Keep a reference to your response\n self.r = null;\n\n // @type {boolean} [false] All queues start off unflushed, flushed state\n self.f = false;\n\n }", "title": "" }, { "docid": "423144b272fdae878668a3ced79aae0c", "score": "0.56417584", "text": "function sendQueue() {\n\t\t\t\tif(queue.length > 0) {\n\t\t\t\t\tif(debug) {\n\t\t\t\t\t\tconsole.log(\"Going to send \"+queue.length+\" items from queue.\");\n\t\t\t\t\t}\n\t\t\t\t\tfor(var item = {}; item = queue.shift(); typeof(item) != undefined) {\n\t\t\t\t\t\t// send request\n\t\t\t\t\t\tws.send(item.requestJson);\n\n\t\t\t\t\t\tif(item.hasOwnProperty('oneway_deferred')) {\n\t\t\t\t\t\t\t// is aparently a oneway request\n\t\t\t\t\t\t\t// resolve the deferred\n\t\t\t\t\t\t\titem.oneway_deferred.resolve({});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "0c15a11a434f804e6bb6ae87478028a9", "score": "0.5585892", "text": "function flushQueue () {\n var remainingQueue = context.queue.slice(),\n currentFn = context.queue.shift(),\n lastLine = stdout[stdout.length - 1];\n\n if (!lastLine) {\n onError(createUnexpectedEndError(\n 'No data from child with non-empty queue.', remainingQueue));\n return false;\n }\n else if (context.queue.length > 0) {\n onError(createUnexpectedEndError(\n 'Non-empty queue on spawn exit.', remainingQueue));\n return false;\n }\n else if (!validateFnType(currentFn)) {\n // onError was called\n return false;\n }\n else if (currentFn.name === '_sendline') {\n onError(new Error('Cannot call sendline after the process has exited'));\n return false;\n }\n else if (currentFn.name === '_wait' || currentFn.name === '_expect') {\n if (currentFn(lastLine) !== true) {\n onError(createExpectationError(currentFn.expectation, lastLine));\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "7873aeb1969f7baeb0a1f22b683cd458", "score": "0.5569431", "text": "function Queue() {\n var array = [];\n\n this.enqueue = array.push.bind(array);\n this.dequeue = array.shift.bind(array);\n this.hasNext = function () {\n return !!(array.length); \n };\n}", "title": "" }, { "docid": "7873aeb1969f7baeb0a1f22b683cd458", "score": "0.5569431", "text": "function Queue() {\n var array = [];\n\n this.enqueue = array.push.bind(array);\n this.dequeue = array.shift.bind(array);\n this.hasNext = function () {\n return !!(array.length); \n };\n}", "title": "" }, { "docid": "c9f74583408056dbbb6cdae789ba8500", "score": "0.55372465", "text": "function TCQueue() {}", "title": "" }, { "docid": "6c59098d1e38c86af0bb2f3eccd8b8d8", "score": "0.5484786", "text": "function pushWriteRequest(cmd){\r\n\tif(writeBuffer.length < BUFFER_SIZE){\r\n\t\twriteBuffer.push(cmd);\r\n\t}\r\n}", "title": "" }, { "docid": "89b7056381b8b7240f5f3cc8d2a72648", "score": "0.5466754", "text": "processReadyQueue() {\r\n if (this.readyQueue.length === 0) {\r\n return;\r\n }\r\n var readyQueue = this.readyQueue;\r\n this.readyQueue = []; // in case there is something to reschedule\r\n for (var i = 0; i < readyQueue.length; i++) {\r\n var entry = readyQueue[i];\r\n switch (entry.type) {\r\n case \"getAllElement\":\r\n this.getAllElement(entry.fromRevision, entry.cb);\r\n break;\r\n case \"write\":\r\n this.write(entry.originatingClientResourceId, entry.elementObj, entry.cb);\r\n break;\r\n case \"external\":\r\n entry.cb(undefined, undefined, undefined);\r\n break;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d927db7a54d1924f5aff9b378f704c9d", "score": "0.543652", "text": "function process_outbox() {\n // don't make new requests if we're waiting for old ones\n if (!waiting_for_response) {\n // don't send a request if there are no messages\n if (outbox_queue.length > 0) {\n // don't send any more requests while we're waiting for this one\n waiting_for_response = true;\n\n // send the messages\n for (var i in outbox_queue) {\n ajax(outbox_queue[i], callback)\n }\n }\n\n // we sent all the messages at once so clear the outbox\n outbox_queue = [];\n }\n}", "title": "" }, { "docid": "0d755876e5e5e69862cc6f93e7e64803", "score": "0.53845453", "text": "isEmpty(){\n return this.queue.length == 0;\n }", "title": "" }, { "docid": "497d0ac5772efd8f5303fba1a6de5a3b", "score": "0.53803265", "text": "_emptyQueue() {\n // eslint-disable-line class-methods-use-this\n return true;\n }", "title": "" }, { "docid": "497d0ac5772efd8f5303fba1a6de5a3b", "score": "0.53803265", "text": "_emptyQueue() {\n // eslint-disable-line class-methods-use-this\n return true;\n }", "title": "" }, { "docid": "5ab22fdfbd702c14aceb390e105ffcb9", "score": "0.53797203", "text": "function queueMe(response) {\r\n print(\"Defined function called: \" + response + \"\\n\");\r\n}", "title": "" }, { "docid": "6e2049fcd5efea65d93ba27df82b3821", "score": "0.5375803", "text": "get busy() {\r\n // @ts-ignore\r\n return this.requests.items.length !== 0;\r\n }", "title": "" }, { "docid": "eec5b812db2604bd79eba7b5d8878be9", "score": "0.53597695", "text": "function isEmpty(q){\n return !q.queue.length;\n}", "title": "" }, { "docid": "1cc0ac374b9d901fe86ceb1edd02f913", "score": "0.5358778", "text": "function enqueue(sUrl, postFuncCall, preFuncCall) {\n\tif(!g_q) g_q = new ajaxQueue;\n\n\tif(!g_q.enqueue(sUrl, postFuncCall, preFuncCall))\n\t\treturn false;\n\n\tif(!g_q.isProcessing)\n\t\tg_q.process();\n\n\treturn true;\n}", "title": "" }, { "docid": "5d11a326095d02a569792cb282120b99", "score": "0.5342062", "text": "_sendRequest() {\n if (!this._clientQueue.length) {\n return this._enterIdle();\n }\n this._clearIdle();\n\n // an operation was made in the precheck, no need to restart the queue manually\n this._restartQueue = false;\n\n var command = this._clientQueue[0];\n if (typeof command.precheck === 'function') {\n // remember the context\n var context = command;\n var precheck = context.precheck;\n delete context.precheck;\n\n // we need to restart the queue handling if no operation was made in the precheck\n this._restartQueue = true;\n\n // invoke the precheck command and resume normal operation after the promise resolves\n precheck(context).then(() => {\n // we're done with the precheck\n if (this._restartQueue) {\n // we need to restart the queue handling\n this._sendRequest();\n }\n }).catch(err => {\n // precheck failed, so we remove the initial command\n // from the queue, invoke its callback and resume normal operation\n let cmd;\n const index = this._clientQueue.indexOf(context);\n if (index >= 0) {\n cmd = this._clientQueue.splice(index, 1)[0];\n }\n if (cmd && cmd.callback) {\n cmd.callback(err);\n this._canSend = true;\n this._parseIncomingCommands(this._iterateIncomingBuffer()); // Consume the rest of the incoming buffer\n this._sendRequest(); // continue sending\n }\n });\n return;\n }\n\n this._canSend = false;\n this._currentCommand = this._clientQueue.shift();\n\n try {\n this._currentCommand.data = (0, _emailjsImapHandler.compiler)(this._currentCommand.request, true);\n this.logger.debug('C:', () => (0, _emailjsImapHandler.compiler)(this._currentCommand.request, false, true)); // excludes passwords etc.\n } catch (e) {\n this.logger.error('Error compiling imap command!', this._currentCommand.request);\n return this._onError(new Error('Error compiling imap command!'));\n }\n\n var data = this._currentCommand.data.shift();\n\n this.send(data + (!this._currentCommand.data.length ? EOL : ''));\n return this.waitDrain;\n }", "title": "" }, { "docid": "bbde7be83a3ad8935a002c9ecf2790ae", "score": "0.5313403", "text": "_numPendingRequests() {\n // When connected, the requestQueue will typically be near-empty\n // (commands are flushed quickly) and the responseQueue will match\n // the arrival rate.\n //\n // When disconnected, the requestQueue will fill up and the responseQueue\n // will be empty (no writes to socket until connected).\n return this.requestQueue.length + this.responseQueue.length;\n }", "title": "" }, { "docid": "7aa1f2f671fb31c34723df883f03394a", "score": "0.53089565", "text": "async replayRequests() {\n const now = Date.now();\n const replayedRequests = [];\n const failedRequests = [];\n\n let storableRequest;\n while (storableRequest = await this._queueStore.getAndRemoveOldestEntry()) {\n // Ignore requests older than maxRetentionTime.\n if (now - storableRequest.timestamp > this._maxRetentionTime) {\n continue;\n }\n\n await this._runCallback('requestWillReplay', storableRequest);\n\n const replay = {request: storableRequest.toRequest()};\n\n try {\n // Clone the request before fetching so callbacks get an unused one.\n replay.response = await fetch(replay.request.clone());\n } catch (err) {\n replay.error = err;\n failedRequests.push(storableRequest);\n }\n\n replayedRequests.push(replay);\n }\n\n // If any requests failed, put the failed requests back in the queue\n // and register for another sync.\n if (failedRequests.length) {\n await Promise.all(failedRequests.map((storableRequest) => {\n return this._queueStore.addEntry(storableRequest);\n }));\n\n await this._registerSync();\n }\n\n await this._runCallback('queueDidReplay', replayedRequests);\n }", "title": "" }, { "docid": "54cc60706bf5ca7bcbd7cd1299f46bb3", "score": "0.53060967", "text": "addToQueue(uri) {\n return this._sendCommand(\"/requests/status.json\" /* STATUS */, 'in_enqueue', { input: uri });\n }", "title": "" }, { "docid": "e50de81f7de52d0c35857a0ea7139c92", "score": "0.53046644", "text": "add(...args) {\n if (args && args.length > 0) {\n extend(this._queue, args);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "626ed1e5120f69f4531ac436198e2a75", "score": "0.5302877", "text": "function cont_req(queue,results){\n if (queue.length === 0) return results;\n ws.send(queue.pop());\n ws.onmessage = (payload) => {\n let payload_json = JSON.parse(payload.data);\n if (detect_err(payload_json)){\n console.log(\"there is error!\");\n throw payload_json;\n }\n results.push(payload_json);\n console.log(results);\n cont_req(queue,results);\n }\n}", "title": "" }, { "docid": "455d1b3dbd881409c65a013bd0fb8450", "score": "0.5290698", "text": "function processChunkQueues(self) {\n var done = true\n // both queues are sorted by ascending distance\n if (self._chunkIDsToRemove.length) {\n var remove = parseChunkID(self._chunkIDsToRemove.pop())\n removeChunk(self, remove[0], remove[1], remove[2])\n profile_queues(self, 'removed')\n profile_hook('removed')\n done = false\n }\n if (self._chunkIDsToCreate.length >= self._maxChunksPendingCreation) return done\n // if (self._chunkIDsToMesh.length >= self._maxChunksPendingMeshing) return done\n if (self._chunkIDsToAdd.length) {\n var id = self._chunkIDsToAdd.shift()\n requestNewChunk(self, id)\n profile_hook('requested')\n profile_queues(self, 'requested')\n done = false\n }\n return done\n}", "title": "" }, { "docid": "8038fc858c68204c56faf6f229e7bfca", "score": "0.52823263", "text": "function Queue() {\n this.data = [];\n\n this.push = function(data) {\n data.visited = searchCount;\n this.data.unshift(data);\n }\n\n this.pop = function() {\n return this.data.pop();\n }\n\n this.empty = function() {\n return this.data.length === 0;\n }\n}", "title": "" }, { "docid": "0ffc93b311aea1e7f5954b27f5f06aba", "score": "0.52797145", "text": "isEmpty() {\n return this.queue.length === 0;\n }", "title": "" }, { "docid": "d19a99d5bbcdd2ee4a179f9296e27b56", "score": "0.52631694", "text": "offer(element){\n if(element === null) return false;\n this.queue.push(element);\n if(this.queue.length === 1){\n this.front = this.queue[0];\n this.back = this.queue[0];\n } else {\n this.back = this.queue[this.queue.length-1];\n }\n return true;\n }", "title": "" }, { "docid": "33d062f8363ff8f32a7ba6aafc6358aa", "score": "0.52609926", "text": "function queueOrRequest( el ){\n\t\t\tvar url = el.data( \"url\" );\n\t\t\tif( o.proxy && $.inArray( url, urllist ) === -1 ){\n\t\t\t\turllist.push( url );\n\t\t\t\telQueue = elQueue.add( el );\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmakeReq( el.data( \"url\" ), el );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e08807d2eb8aa6993df4f184a29bd1f0", "score": "0.5256068", "text": "function writeQueue()\r\n{\r\n var order = orders;\r\n for(var i = orders.length - 1; i > -1; i--)\r\n {\r\n writeInfo(i);\r\n }\r\n\r\n}", "title": "" }, { "docid": "b027d55c7ee4175be3355f7a05384fe9", "score": "0.525564", "text": "function queueRequest() {\n var queue = [];\n if (queueLength())\n $(\"#up-next\").children().each(function() {\n queue.push($(this).data('vdata'));\n });\n var m = new Message(\"queueData\", {\n sender: uuid,\n queue: queue,\n nowplaying: $(\"#nowPlaying > span\").text()\n });\n sendMessage(\"/queueData\", m);\n}", "title": "" }, { "docid": "e9c97663954a226fdb0ffc7d646197b3", "score": "0.52454686", "text": "function flushQueue(forcibly){\n\t// Have a buffer window before flushing queue again, unless forcibly == true (used when submitting assessment and we want all statements absolutely sent)\n\tif (Date.now() - _lastFlushTime > _waitTime || forcibly == true) {\n\t\t//console.log(\"stores/xapi:14 flushing queue, forcibly: \"+forcibly,_statements);\n\t\t// Put the current time in the url so that if this request hasn't finished before the queue is flushed again, it won't get cancelled (since this Api.request code cancels pending requests with the same url).\n\t\tApi.post(Constants.FLUSH_STATEMENT_QUEUE, \"api/xapi?\"+Date.now(), {\"statements\":_statements});\n\t\t_lastFlushTime = Date.now();\n\t\t_statements = [];\n\t\treturn true;\n\t}\n\t//console.log(\"stores/xapi:25 queue not flushed.\");\n\treturn false;\n}", "title": "" }, { "docid": "d937ee31f081985c966f1ef0a0570bb8", "score": "0.5233403", "text": "function getQueue(){\n return queue\n}", "title": "" }, { "docid": "681f97ebb523c025a44b6cbb427a060f", "score": "0.52326053", "text": "function queueOrRequest( el ){\n\t\t\tvar url = el.data( \"url\" );\n\t\t\tif( o.proxy && $.inArray( url, urllist ) === -1 ){\n\t\t\t\turllist.push( url );\n\t\t\t\telQueue = elQueue.add( el );\n\t\t\t}\n\t\t\telse{\n\t\t\t\tAI.makeReq( url, el );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f5dcebd608277c4b62c98d2bdeeaf47d", "score": "0.52277917", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true\n var entry = state.bufferedRequest\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount\n var buffer = new Array(l)\n var holder = state.corkedRequestsFree\n holder.entry = entry\n\n var count = 0\n var allBuffers = true\n while (entry) {\n buffer[count] = entry\n if (!entry.isBuf) allBuffers = false\n entry = entry.next\n count += 1\n }\n buffer.allBuffers = allBuffers\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish)\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++\n state.lastBufferedRequest = null\n if (holder.next) {\n state.corkedRequestsFree = holder.next\n holder.next = null\n } else {\n state.corkedRequestsFree = new CorkedRequest(state)\n }\n state.bufferedRequestCount = 0\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk\n var encoding = entry.encoding\n var cb = entry.callback\n var len = state.objectMode ? 1 : chunk.length\n\n doWrite(stream, state, false, len, chunk, encoding, cb)\n entry = entry.next\n state.bufferedRequestCount--\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null\n }\n\n state.bufferedRequest = entry\n state.bufferProcessing = false\n }", "title": "" }, { "docid": "cc9b9f81da73da563b5e934283a083f4", "score": "0.5224105", "text": "function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "cc9b9f81da73da563b5e934283a083f4", "score": "0.5224105", "text": "function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "d0946bf139c3dbe879e1d38490049479", "score": "0.5224086", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n }", "title": "" }, { "docid": "b2c04780403f7c669d75c91e8982aa19", "score": "0.52213037", "text": "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }", "title": "" }, { "docid": "72ebac65c30246074f74954695cf1020", "score": "0.5212132", "text": "function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "ad99a3dc38d99b8b537c53db6a89661a", "score": "0.5211806", "text": "_requestHandler() {\n let timeframe = model.connectionTimeframe;\n //console.debug(\"Game Client is going to send a message to the server, the clock tick'd!\");\n // console.debug(\"_requestHandler Time: \" + new Date());\n // console.debug(\"_requestHandler _lastTesponse: \" + this._lastResponse)\n // console.debug(\"_requestHandler _waiting: \" + this._waitingResponse)\n let now = new Date()\n let elapsed = now - this._lastResponse;\n if(this._waitingResponse) {\n // console.debug(\"_requetHandler waitingResponse: \" + this._waitingResponse)\n window.setTimeout(function(){ this._requestHandler() }.bind(this), timeframe);\n return;\n }\n \n if (elapsed < timeframe) {\n let deltaTimeframe = timeframe - elapsed; // add a little more waiting time\n // console.debug(\"_requetHandler waiting \" + deltaTimeframe + \" ms, waitingResponse: \" + this._waitingResponse)\n window.setTimeout(function(){ this._requestHandler() }.bind(this), deltaTimeframe);\n return;\n }\n // console.debug(\"Passed \" + elapsed + \" from previous message\");\n if(this.isOdd(this._schedulerCounter)) {\n if(this._wsRequests_cmd.length > 0) {\n //console.debug(\"Game Client's request queue is not empty.\");\n let msg = this._wsRequests_cmd.shift();\n //console.debug(\"_requestHandler isOdd && CMD\");\n this._ws.send(new Blob([msg.msg + \"\\n\"], {type: 'text/plain'}));\n this._waitingResponse = true;\n\n this._wsQueue.push(msg.tag);\n this._noRequestsTime = new Date();\n this._schedulerCounter++;\n //console.debug(\"Game Client actually sent \" + msg);\n } else if(this._wsRequests_look.length > 0) {\n //console.debug(\"Game Client's request queue is not empty.\");\n let msg = this._wsRequests_look.shift();\n //console.debug(\"_requestHandler isOdd && LOOK\");\n this._ws.send(new Blob([msg.msg + \"\\n\"], {type: 'text/plain'}));\n this._waitingResponse = true;\n\n this._wsQueue.push(msg.tag);\n this._noRequestsTime = new Date();\n //console.debug(\"Game Client actually sent \" + msg);\n } else {\n if((new Date() - this._noRequestsTime) >= model.nopTimeframe) { \n //console.debug(\"_requestHandler isOdd && NOP\");\n this.nop(); // TODO gamename nop\n timeframe = model.connectionTimeframe;\n this._noRequestsTime = new Date();\n }\n }\n } else {\n if(this._wsRequests_look.length > 0) {\n //console.debug(\"Game Client's request queue is not empty.\");\n let msg = this._wsRequests_look.shift();\n //console.debug(\"_requestHandler isEven && LOOK\");\n this._ws.send(new Blob([msg.msg + \"\\n\"], {type: 'text/plain'}));\n this._waitingResponse = true;\n\n this._wsQueue.push(msg.tag);\n \n this._noRequestsTime = new Date();\n this._schedulerCounter++;\n //console.debug(\"Game Client actually sent \" + msg);\n } else if(this._wsRequests_cmd.length > 0) {\n //console.debug(\"_requestHandler isEven && CMD\");\n let msg = this._wsRequests_cmd.shift();\n //console.debug(\"Game Client is going to actually send the message \" + msg);\n this._ws.send(new Blob([msg.msg + \"\\n\"], {type: 'text/plain'}));\n this._waitingResponse = true;\n\n this._wsQueue.push(msg.tag);\n this._noRequestsTime = new Date();\n //console.debug(\"Game Client actually sent \" + msg);\n } else {\n if((new Date() - this._noRequestsTime) >= model.nopTimeframe) {\n this.nop(); // TODO gamename nop\n //console.debug(\"_requestHandler isEven && NOP\");\n timeframe = model.connectionTimeframe;\n this._noRequestsTime = new Date();\n }\n }\n }\n // console.debug(\"Game Client _waitingResponse = \" + this._waitingResponse)\n // Repeat endlessly\n //console.debug(\"Game Client is going to set the timer to fire again in \" + timeframe + \"ms.\");\n window.setTimeout(function(){ this._requestHandler() }.bind(this), timeframe);\n //console.debug(\"Game Client has set the timer for its queue.\");\n }", "title": "" }, { "docid": "81b3f5ff575a54a2d6a67bc83f08b7f7", "score": "0.5206441", "text": "flush(timeout) { return true; }", "title": "" }, { "docid": "22ffc81c2a0042a0b2b6d788544d46d3", "score": "0.5184493", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true\n var entry = state.bufferedRequest\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount\n var buffer = new Array(l)\n var holder = state.corkedRequestsFree\n holder.entry = entry\n\n var count = 0\n var allBuffers = true\n while (entry) {\n buffer[count] = entry\n if (!entry.isBuf) allBuffers = false\n entry = entry.next\n count += 1\n }\n buffer.allBuffers = allBuffers\n\n doWrite(\n stream,\n state,\n true,\n state.length,\n buffer,\n '',\n holder.finish,\n )\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++\n state.lastBufferedRequest = null\n if (holder.next) {\n state.corkedRequestsFree = holder.next\n holder.next = null\n } else {\n state.corkedRequestsFree = new CorkedRequest(state)\n }\n state.bufferedRequestCount = 0\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk\n var encoding = entry.encoding\n var cb = entry.callback\n var len = state.objectMode ? 1 : chunk.length\n\n doWrite(stream, state, false, len, chunk, encoding, cb)\n entry = entry.next\n state.bufferedRequestCount--\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null\n }\n\n state.bufferedRequest = entry\n state.bufferProcessing = false\n }", "title": "" }, { "docid": "5c37e3eaaf30936e70e3e31be95b7e5b", "score": "0.5181299", "text": "function queue_manage(response,output,command) {\n\n //console.log(\"filling queue with \" + response);\n /*\n console.log(\"rlen=\" + response.length + \n \", type=\" + (typeof output) + \n \", command=\" + command);\n */\n\n // NOTE: as passthru just passes the output it just grows on the \n // client side so there is probably a use of newline pointers\n // for passthru its a bit more complex as multiple/broken\n // lines can be passed\n\n if(response.length>0) {\n\n // get the next response chunk which was not processed yet\n var rm = response.substring(rptr).match(/[\\r\\n]/g);\n if(rm!==null) {\n // if the trimmed chunks last char is not an [\\r\\n] \n // the chunk is broken and needs to be concatenated\n // with the next chunk\n var li = response.substring(rptr).lastIndexOf(rm[rm.length-1]);\n var response_chunk = response.substring(rptr, rptr+li); \n // store last command output length to know where we have been yet\n rptr = rptr + li;\n //console.log(\"li=\"+li+\", rp=\"+rptr+\", r=\"+response_chunk);\n\n // and dump the chunk to the output container \n $(output).empty(); // clear the output container first\n $(output).html(response_chunk.replace(/[\\r\\n]/g,\"<br>\"));\n // adjust the view on the output container, always show the last line\n var o = document.getElementById(output.id);\n o.scrollTop = o.scrollHeight - o.clientHeight;\n // TODO: for logfile responses probably create a queue\n\n // then get statistics for the chunk,\n modify_stats(command,response_chunk);\n }\n\n }\n\n}", "title": "" }, { "docid": "6df27e4efa71579959d3f8ae60c81769", "score": "0.51738155", "text": "function isIdle()\r\n\t{\r\n\t\treturn (transmitQueue.length === 0 && pendingQueue.length === 0);\r\n\t}", "title": "" }, { "docid": "d725bb2b138eee0fbcb57b4db61b8ba5", "score": "0.5172782", "text": "function checkState(request) { return (request.readyState == request.DONE); }", "title": "" }, { "docid": "9f7d09d6143a3eb2929aa560c2d11ba1", "score": "0.5172634", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n while (entry) {\n buffer[count] = entry;\n entry = entry.next;\n count += 1;\n }\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequestCount = 0;\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n }", "title": "" }, { "docid": "9f7d09d6143a3eb2929aa560c2d11ba1", "score": "0.5172634", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n while (entry) {\n buffer[count] = entry;\n entry = entry.next;\n count += 1;\n }\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequestCount = 0;\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n }", "title": "" }, { "docid": "4f4054f2fe331854ae9e229418b13446", "score": "0.5171513", "text": "_checkIfReady(...args){\n let f = args.pop();\n\n if (this._isReady) f(...args);\n else this._addToQueue(...args);\n }", "title": "" }, { "docid": "33df07407ffdb977a1bbfe33f37530f1", "score": "0.517126", "text": "isDone() {}", "title": "" }, { "docid": "a4dc35af6a37ed79cd019d0d40e5e5a0", "score": "0.5158032", "text": "function onCacheUpdate() {\n Y.log( 'onCacheUpdate on ' + Y.doccirrus.ipc.whoAmI() + ', ' + loginQueue.length + ' requests in queue', 'debug', NAME );\n // respond to all requests waiting for card and filter out those that are served\n loginQueue = loginQueue.filter( function( item ) {\n if( myCache.onlineCards[item.deviceName] ) {\n // create session for the request\n checkAndCreateDBSession( myCache.onlineCards[item.deviceName], item );\n } else {\n return true;\n }\n } );\n }", "title": "" }, { "docid": "6d9a4770c58a9727810accfa3393ce7c", "score": "0.51534766", "text": "function requestHandler(error, response, content) { // Let's not make functions in a for loop!\n\t\t\tif (error) { console.log('enqueue error', i, error); }\n\t\t\tassert.ifError(error);\n\t\t\tassert.equal(response.statusCode, 200); \n\t\t\tassert.equal(response.headers['content-type'], 'application/json');\n\t\t\tpollUntilGood(JSON.parse(content).id, function (error, response) {\n\t\t\t\tif (error) { console.log('poll error', error); }\n\t\t\t\tassert.ifError(error);\n\t\t\t\tassert.ok((response.statusCode === 200) || (response.statusCode === 404));\n\t\t\t\tassert.ok(content); // just checking for not empty in this test\n\t\t\t\tif (++resultCount === target) { done(); }\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c8c9eec2aacc86f1119a15eb998cc96e", "score": "0.51510715", "text": "function dequeue() {\n if (!queues[qname]) {\n return;\n }\n var nextCallback = queues[qname].shift();\n if (nextCallback) {\n var xhr = nextCallback();\n activeReqs[qname] = xhr;\n }\n else {\n delete queues[qname];\n delete activeReqs[qname];\n }\n }", "title": "" }, { "docid": "c8c9eec2aacc86f1119a15eb998cc96e", "score": "0.51510715", "text": "function dequeue() {\n if (!queues[qname]) {\n return;\n }\n var nextCallback = queues[qname].shift();\n if (nextCallback) {\n var xhr = nextCallback();\n activeReqs[qname] = xhr;\n }\n else {\n delete queues[qname];\n delete activeReqs[qname];\n }\n }", "title": "" }, { "docid": "b31a961508c0701d8e3eaeacbc9e6fe5", "score": "0.51490504", "text": "static async write() {\n // Who needs fancy thread blocking when you can java\n // I dont know if we even need to handle concurrency, however if there a multiple writes during a write, it will only do 2 instead of 40\n if (isWriting) {\n isWriteEnqueued = true;\n return;\n }\n\n if (!cache) {\n Logger.error(\"DB Write\", \"Cache was deleted, preventing overwrite.\");\n }\n\n try {\n const data = JSON.stringify(cache);\n isWriting = true;\n await fs.writeFileAsync(location, data);\n isWriting = false;\n Logger.info(\"DB Write\", \"Write successful\");\n } catch(err) {\n Logger.error(\"DB Write\", \"Did you delete the database file? Do I still have permission?\");\n }\n\n if (isWriteEnqueued) {\n isWriteEnqueued = false;\n Store.write();\n }\n }", "title": "" }, { "docid": "e8cf57d79e9a9dd38805df8cc60629b3", "score": "0.5149012", "text": "checkQueue() {\n if (this.workerAvailable() && !this.jobQueue.isEmpty()) {\n this.runNextJob();\n }\n }", "title": "" }, { "docid": "17e7b311e2db5ab4999cb2c79aa952a3", "score": "0.5142584", "text": "_startRequest()\r\n\t{\r\n\t\tif(this._queue.length == 0) return;\r\n\r\n\t\t// Get the item\r\n\t\tvar item = this._queue.splice(0,1)[0];\r\n\r\n\t\t// Download only if the file doesn't exist\r\n\t\tif(!fs.existsSync(item.dest))\r\n\t\t{\r\n\t\t\t// Create folders\r\n\t\t\tif(!fs.existsSync(item.path))\r\n\t\t\t\tfx.mkdirSync(item.path);\r\n\r\n\t\t\t// Download next image in the queue\r\n\t\t\tconst options =\r\n\t\t\t{\r\n\t\t\t\turl : item.url,\r\n\t\t\t\tdest : item.dest\r\n\t\t\t}\r\n\r\n\t\t\tdownload(options)\r\n\t\t\t\t.then((filename) =>\r\n\t\t\t\t{\r\n\t\t\t\t\tconsole.log('File saved to', filename);\r\n\t\t\t\t\tthis._startRequest();\r\n\t\t\t\t})\r\n\t\t\t\t.catch((err) =>\r\n\t\t\t\t{\r\n\t\t\t\t\t// Should remove the request here but couldn't get the filename from a reject\r\n\t\t\t\t\tconsole.log(err);\r\n\t\t\t\t\tthis._startRequest();\r\n\t\t\t\t});\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis._startRequest();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "44465ecfe9e894e7dfbb7bbf4ff1e2a5", "score": "0.5139004", "text": "function queueCount(){\n\tif( this.writes&& this.writes.length){\n\t\treturn this.writes.length\n\t}else if( this.reads&& this.reads.length){\n\t\treturn -this.reads.length\n\t}else{\n\t\treturn 0\n\t}\n}", "title": "" }, { "docid": "cf6bad080652ceecd08a5c74d2127f9d", "score": "0.51353526", "text": "function isEmpty(queue) {\n if(queue.first) {\n console.log('false')\n return false\n } else {\n console.log('true')\n return true\n }\n}", "title": "" }, { "docid": "ff2171c8d8502fd3b6846006c62241d5", "score": "0.51339716", "text": "function getQueue(call, callback){\n\t $.ajax ({\n\t url: \"getDir.php\",\n\t data: { type : \"read\", call: call },\n\t type: \"post\",\n\t dataType: \"json\",\n\t async: false,\n\t success: function(result) {\n\t callback(result)\n\t }\n\t })\t\t\n\t}", "title": "" }, { "docid": "0ec47acb690c128ee5f7c2a65b418906", "score": "0.51293415", "text": "function createNewBuffer(logData){\n var start = added;\n if(start >= pending.length){\n return true; //Stops the buffer when all has been sent\n }\n \n var end = added+bufferSize; //Size is 10\n if(end >= pending.length){\n end = pending.length;\n }\n \n var buffer = [];\n for(var requests = start; requests < end; ++requests){\n buffer.push(pending[requests]);\n }\n \n if(debugSend){\n console.log(\"start: \", start, \" end: \", end);\n console.log(\"All requests: \",pending.length, \" in buffer: \", buffer.length);\n }\n \n //Buffer of 10 items\n var bufferPromise = new Promise(function(resolve, reject){\n var buffered = [];\n\n buffer.forEach(function(obj){\n var prom = createPromise(obj);\n buffered.push(prom);\n });\n\n Promise.all(buffered).then(function(val){\n resolve(\"buffer\");\n });\n \n }).then(function(val){\n var retval = createNewBuffer(logData);\n if(retval === true){\n if(debugSend){\n console.log(\"ADDED: \", added);\n console.log(\"COUNT: \", count);\n }\n\n // After all has been pushed to DB, start linking\n link(logData);\n }\n });\n \n return false;\n }//end createNewBuffer()", "title": "" }, { "docid": "0e7cb4c4397fdbdee9b01f7d161d6673", "score": "0.51191026", "text": "available_write() {\n return this.ringbuf.available_write();\n }", "title": "" }, { "docid": "eb8fcecf302b83d14b6ab1e32258cc2e", "score": "0.5118754", "text": "function queueIsFull (messageBatching) {\n\treturn Boolean(messageBatching.queue.length >= messageBatching.maxQueueSize);\n}", "title": "" }, { "docid": "3072b850836cd0fb2f6a5fc4dcf7cd76", "score": "0.51135343", "text": "function addToQueue (req, res, next, end) {\n const blockRef = blockTagForPayload(req)\n if (blockRef === 'latest') {\n requestQueue.push([req, res, next, end])\n } else {\n next()\n }\n }", "title": "" }, { "docid": "d96146c47aeaa87323908aa42c3fd5e3", "score": "0.51120156", "text": "function sendAllRemaining() {\r\n\t\t\tvar sendingAnything = false;\r\n\t\t\tif (isSupported && enabled) {\r\n\t\t\t\t// Create requests for everything left over, batched as normal\r\n\t\t\t\tvar actualBatchSize = appender.getLayout().allowBatching() ? batchSize : 1;\r\n\t\t\t\tvar currentLoggingEvent;\r\n\t\t\t\tvar batchedLoggingEvents = [];\r\n\t\t\t\twhile ((currentLoggingEvent = queuedLoggingEvents.shift())) {\r\n\t\t\t\t\tbatchedLoggingEvents.push(currentLoggingEvent);\r\n\t\t\t\t\tif (queuedLoggingEvents.length >= actualBatchSize) {\r\n\t\t\t\t\t\t// Queue this batch of log entries\r\n\t\t\t\t\t\tqueuedRequests.push(batchedLoggingEvents);\r\n\t\t\t\t\t\tbatchedLoggingEvents = [];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// If there's a partially completed batch, add it\r\n\t\t\t\tif (batchedLoggingEvents.length > 0) {\r\n\t\t\t\t\tqueuedRequests.push(batchedLoggingEvents);\r\n\t\t\t\t}\r\n\t\t\t\tsendingAnything = (queuedRequests.length > 0);\r\n\t\t\t\twaitForResponse = false;\r\n\t\t\t\ttimed = false;\r\n\t\t\t\tsendAll();\r\n\t\t\t}\r\n\t\t\treturn sendingAnything;\r\n\t\t}", "title": "" }, { "docid": "7cd131886270f6ce428a3faa767a299b", "score": "0.5109545", "text": "function CheckIfQueueIsFull(nodeIp) {\n\t//console.log(nodeIp);\n\tvar node = cy.getElementById(nodeIp);\n\t//console.log(\"found elemnt: \");\n\t//console.log(node);\n\t//check if limit has not been reached\n\tif (node._private.data.queue.length < node._private.data.limit ) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "000526ffe8dbf80943188cc714f38f09", "score": "0.5106762", "text": "function clearBuffer(stream, state) {\r\n state.bufferProcessing = true;\r\n var entry = state.bufferedRequest;\r\n\r\n if (stream._writev && entry && entry.next) {\r\n // Fast case, write everything using _writev()\r\n var l = state.bufferedRequestCount;\r\n var buffer = new Array(l);\r\n var holder = state.corkedRequestsFree;\r\n holder.entry = entry;\r\n\r\n var count = 0;\r\n var allBuffers = true;\r\n while (entry) {\r\n buffer[count] = entry;\r\n if (!entry.isBuf) allBuffers = false;\r\n entry = entry.next;\r\n count += 1;\r\n }\r\n buffer.allBuffers = allBuffers;\r\n\r\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\r\n\r\n // doWrite is almost always async, defer these to save a bit of time\r\n // as the hot path ends with doWrite\r\n state.pendingcb++;\r\n state.lastBufferedRequest = null;\r\n if (holder.next) {\r\n state.corkedRequestsFree = holder.next;\r\n holder.next = null;\r\n } else {\r\n state.corkedRequestsFree = new CorkedRequest(state);\r\n }\r\n state.bufferedRequestCount = 0;\r\n } else {\r\n // Slow case, write chunks one-by-one\r\n while (entry) {\r\n var chunk = entry.chunk;\r\n var encoding = entry.encoding;\r\n var cb = entry.callback;\r\n var len = state.objectMode ? 1 : chunk.length;\r\n\r\n doWrite(stream, state, false, len, chunk, encoding, cb);\r\n entry = entry.next;\r\n state.bufferedRequestCount--;\r\n // if we didn't call the onwrite immediately, then\r\n // it means that we need to wait until it does.\r\n // also, that means that the chunk and cb are currently\r\n // being processed, so move the buffer counter past them.\r\n if (state.writing) {\r\n break;\r\n }\r\n }\r\n\r\n if (entry === null) state.lastBufferedRequest = null;\r\n }\r\n\r\n state.bufferedRequest = entry;\r\n state.bufferProcessing = false;\r\n}", "title": "" }, { "docid": "edcdbfcacdbfbb90a2007f6192cc424f", "score": "0.51031566", "text": "function isEventInQueue(event){\n for(var i=0; i<eventQueue.length; i++){\n if(eventQueue[i].id == event.id)\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "03343c19e8cb32aa02c4fcdefff14e2b", "score": "0.5100862", "text": "pushQueue(request) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Add callbacks to the request.\n\t\t\trequest.resolve = val => {\n\t\t\t\tresolve(val);\n\t\t\t};\n\t\t\trequest.reject = err => {\n\t\t\t\treject(err);\n\t\t\t};\n\n\t\t\t// Add the request to the queue.\n\t\t\tthis.queue.push(request);\n\n\t\t\t// If the item is the only item in the queue, execute it.\n\t\t\tif (this.queue.length == 1) {\n\t\t\t\tthis.executeQueue();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "d0c9d798e397c0f0d537004d07a59bdb", "score": "0.50942385", "text": "function checkForCompletion() {\n\t if (queuedObjects.length === 0) {\n\t returnCallback(derezObj);\n\t } \n\t }", "title": "" }, { "docid": "65096b7347cd2c3e091099c69ae6e293", "score": "0.5093164", "text": "dequeue() {\n\n }", "title": "" }, { "docid": "34a3c0899c379fb709c3175a1e514850", "score": "0.50919616", "text": "isFinished(count, length) {\n return(count > length);\n }", "title": "" }, { "docid": "896cbc4f198f4077dc90048de0135582", "score": "0.50886434", "text": "function requestPiece(socket, pieces, queue) {\r\n\tif (queue.choked) return null;\r\n\r\n\twhile (queue.length()) {\r\n\t\tvar pieceBlock = queue.deque();\r\n\t\tif(pieces.needed(pieceBlock)) {\r\n\t\t\tsocket.write(message.buildRequest(pieceBlock));\r\n\t\t\tpieces.addRequested(pieceBlock);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3d07730610feb5062fd36e2b26059d25", "score": "0.50816643", "text": "function ajaxRequestQueue(url,options,queue) {\n queue = queue || 'default';\n \n // This object will wrap the option listeners in another function\n // so the option object needs to be unique. If a shared options object \n // is used when the method is call it will get into a recursive mess.\n options = clone(options) || {};\n if(!requestQueue[queue]) requestQueue[queue] = [];\n \n // The queue needs to invoke the next request using the completeListener\n // when the previous request is complete. If the complete listener is \n // already defined then you need to invoke it first.\n \n // Grab the old listener\n var userCompleteListener = options.completeListener;\n\n // Add a new listener\n options.completeListener = function() {\n \n // If there was an old one invoke it first\n if(userCompleteListener) {\n // this will refer to the request object\n userCompleteListener.apply(this,arguments); \n };\n\n // Remove this request from the queue\n requestQueue[queue].shift();\n \n // Invoke the next item in the queue\n if(requestQueue[queue][0]) {\n // The request is in the req property but you alos need to include\n // the send option incase it's a POST request\n var q = requestQueue[queue][0].req.send(\n requestQueue[queue][0].send\n );\n }\n }\n \n // If there's an error the rest of the queue should be cancelled\n // by calling their error methods\n \n // Grab the old listener\n var userErrorListener = options.errorListener;\n\n // Add a new listener\n options.errorListener = function() {\n \n if(userErrorListener) {\n userErrorListener.apply(this,arguments); \n };\n \n // Remove this request from the queue as the error \n // was already invoked\n requestQueue[queue].shift();\n \n // Kill the rest of the queue as there was an error but call the\n // errorListener on each first. By invoking the error listener on\n // the next item in the queue it will clear all queued requests as\n // as each will invoke the next in a chain\n \n // Check if there is still anything in the queue\n if(requestQueue[queue].length) {\n \n // Grab the next one\n var q = requestQueue[queue].shift();\n\n // Abort the request.\n q.req.abort();\n \n // Fake a request object so that the errorListener thinks it\n // completed and runs accordingly\n\n var fakeRequest = new Object();\n \n // Set the status to 0 and readyState to 4 (as if \n // the request completed but failed\n fakeRequest.status = 0;\n fakeRequest.readyState = 4\n\n fakeRequest.responseText = null;\n fakeRequest.responseXML = null;\n\n // Set an error so you can show a message if you wish.\n fakeRequest.statusText = 'A request in the queue received an error';\n\n // Invoke the state change. If readyState is 4 and \n // status is not 200 then errorListener will be invoked.\n q.error.apply(fakeRequest);\n }\n \n }\n \n // Add this requests to the queue\n requestQueue[queue].push({\n req:getRequestObject(url,options),\n send:options.send,\n error:options.errorListener\n });\n\n\n // If the length of the queue is only one \n // item (the first) invoke the request \n if(requestQueue[queue].length == 1) {\n ajaxRequest(url,options);\n }\n}", "title": "" }, { "docid": "f6871e2c55b5a830c84c7d84a56713e2", "score": "0.50805646", "text": "function _execute_next_request() {\n var data, item;\n log.trace(\"-> _execute_next_request\");\n if (debugLevel > 3) {\n log.trace('isReplicatingNow: ' + isReplicatingNow);\n log.trace('_session_ended: ' + _session_ended);\n log.trace('_request_queue.length: ' + _request_queue.length);\n log.trace('_outstanding_requests.length: ' + _outstanding_requests.length);\n log.trace('_waiting_on_download: ' + _waiting_on_download);\n log.trace('_waiting_on_storage: ' + _waiting_on_storage);\n }\n if (isReplicatingNow && !_session_ended && _request_queue.length == 0 && _outstanding_requests.length == 0 && _waiting_on_download == 0 && _waiting_on_storage == 0) {\n if (_request_more > 0) {\n log.debug(\"Continuing replication of \" + _request_more + \" more subjects\");\n _request_more = 0;\n data = window.hex2bin(window.Protocol.ReplicateRequestTag);\n data += window.hex2bin(window.Protocol.ShouldContinueTag);\n _queue_request(data, true);\n } else if (_fast_lookup) {\n _end_session();\n } else if (_second_stage) {\n _send_end_session();\n } else {\n _second_stage = true;\n\n log.info(\"Re-validating\");\n _update_progress(0, 0, \"Validating subjects...\");\n\n var startedValidating = new Date();\n _storage.validateSubjects(function(errors, stop) {\n var finishedValidating = new Date();\n\n var timeDifference = (finishedValidating.getTime() - startedValidating.getTime()) / 1000;\n log.info(\"Time taken to validate: \" + timeDifference);\n localStorage.timeTakenToValidate = timeDifference;\n\n if (stop !== undefined && stop === true) {\n abortReplication(ReplicationResult.UnrecoverableError);\n return;\n }\n\n log.debug(\"Starting secondary replication...\");\n // Start the 'second replication' to fix the server side inadequacy\n data = window.hex2bin(window.Protocol.ReplicateRequestTag);\n data += window.hex2bin(window.Protocol.GetServerChangesTag);\n data += _encode_sync_list();\n data += window.hex2bin(window.Protocol.AcknowledgementsTag);\n while (_ack_queue.length > 0) {\n item = _ack_queue.shift();\n data += _make_ack_item(item.itemid, item.tag);\n }\n _queue_request(data, true);\n if (!_upload_attachment)\n _update_progress(0, 0, \"Waiting for server....\");\n }, false);\n }\n }\n if (_request_queue.length > 0) {\n data = _request_queue.shift();\n _send_request(data);\n }\n log.trace(\"<- _execute_next_request\");\n }", "title": "" }, { "docid": "d9220429c465534547a6486f55b629f1", "score": "0.50766045", "text": "function drain_queue() {\n if(replay_complete && replay_queue.length == 0) {\n console.log(\"Replay queue flushed, replay complete.\");\n return process.exit(0);\n }\n \n //if there's nothing to do, wait one ms and try again\n if(!replay_queue.length)\n return setTimeout(drain_queue,1);\n \n //maybe we're not supposed to do anything yet...\n if((!script_start_time >= assigned_options.start_time)\n && !validate) //if we're validating, proceed regardless\n return setTimeout(drain_queue,1);\n \n var time_delta = new Date().getTime() - script_start_time + fastforward;\n \n //peek at the last item in the queue and see when it's supposed to be replayed.\n var request_info = replay_queue[replay_queue.length - 1];\n if((time_delta < request_info.time_delta)\n && !validate) //if we're validating, proceed regardless\n //not showtime yet, wait a bit\n return setTimeout(drain_queue,1);\n\n replay_queue.pop(); //clear it off the queue\n \n if(request_info.time_delta < fastforward) {\n if(assigned_options.debug)\n console.log(\"fast forwarding past request: \\n\" + request_info. method + request_info.path);\n //we're fastforwarding, skip this one\n return setTimeout(drain_queue,1);\n }\n \n //if we're validating only, just keep draining the queue\n if(validate)\n return process.nextTick(drain_queue);\n\n //construct the request\n var request;\n var options = {\n host: assigned_options.host,\n port: assigned_options.port,\n path: request_info.path,\n method: request_info.method,\n headers: request_info.headers,\n rejectUnauthorized: false //allow self-signed cert, etc...\n };\n \n //intercept and rewrite the session, if requested\n if(assigned_options.mutate_session)\n mutate_session(request_info.headers, options);\n \n //create a proper request based on the protocol, http or https\n if(request_info.protocol == \"https\")\n http = https;\n console.log(\"playing back request \" + request_id + \" line \" + request_info.line_number + \" : \" + request_info.method + \" \" + request_info.path);\n if(assigned_options.debug) \n console.log(\"request headers: \" + JSON.stringify(options.headers,null,2));\n\n request = http.request(options,\n //closure around the request id\n (function (request_id) {\n return function (response) {\n if (assigned_options.debug)\n console.log('response ' + request_id + ': statusCode: ', response.statusCode, \"response headers: \", response.headers);\n if (assigned_options.mutate_session)\n capture_session(request_info.headers, response.headers);\n\n response.on('data', function (data) {\n if (assigned_options.debug)\n if (\n (response.headers['content-encoding'] != 'gzip') &&\n (response.headers['content-type'].indexOf('application/json') >= 0) ||\n (response.headers['content-type'].indexOf('text/html') >= 0) ||\n (response.headers['content-type'].indexOf('text/plain') >= 0)\n )\n console.log(data.toString('utf8'));\n });\n }\n })(request_id)\n );\n request.on(\"error\",\n //closure around the request id and request\n (function(request_id, request_info) {\n return function(err) {\n console.error(\"Error in request \" + request_id + \", line: \" + request_info.line_number + \" - \" + err);\n }\n })(request_id, request_info)\n );\n \n request_id++;\n \n if(request_info.body)\n request.write(request_info.body,function() {\n request.end();\n process.nextTick(drain_queue);\n });\n else {\n request.end();\n process.nextTick(drain_queue);\n }\n}", "title": "" }, { "docid": "01a75bdb53684b54de8fc40a9e1823fb", "score": "0.50752306", "text": "function clearBuffer(stream,state){state.bufferProcessing=true;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){\n// Fast case, write everything using _writev()\nvar l=state.bufferedRequestCount;var buffer=new Array(l);var holder=state.corkedRequestsFree;holder.entry=entry;var count=0;var allBuffers=true;while(entry){buffer[count]=entry;if(!entry.isBuf)allBuffers=false;entry=entry.next;count+=1}buffer.allBuffers=allBuffers;doWrite(stream,state,true,state.length,buffer,\"\",holder.finish);\n// doWrite is almost always async, defer these to save a bit of time\n// as the hot path ends with doWrite\nstate.pendingcb++;state.lastBufferedRequest=null;if(holder.next){state.corkedRequestsFree=holder.next;holder.next=null}else{state.corkedRequestsFree=new CorkedRequest(state)}state.bufferedRequestCount=0}else{\n// Slow case, write chunks one-by-one\nwhile(entry){var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,false,len,chunk,encoding,cb);entry=entry.next;state.bufferedRequestCount--;\n// if we didn't call the onwrite immediately, then\n// it means that we need to wait until it does.\n// also, that means that the chunk and cb are currently\n// being processed, so move the buffer counter past them.\nif(state.writing){break}}if(entry===null)state.lastBufferedRequest=null}state.bufferedRequest=entry;state.bufferProcessing=false}", "title": "" }, { "docid": "b631cada9b54fbf23fc7b9876f31a289", "score": "0.5067434", "text": "function inDestinationQ(elevator, floorNum) {\n if (elevator.destinationQueue.indexOf(floorNum) != -1) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "c887106599eb1ede81b10b94f448d23e", "score": "0.50661296", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n while (entry) {\n buffer[count] = entry;\n entry = entry.next;\n count += 1;\n }\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequestCount = 0;\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n }", "title": "" }, { "docid": "c2bcf06b68c4cd51279bc4e74b538ce6", "score": "0.5060808", "text": "function proxy() {\r\n\t\t\tvar first = !q.length,\r\n\t\t\t\targs = [].slice.call(arguments);\r\n\t\t\t\r\n\t\t\t// add call to the queue\r\n\t\t\tq.push(args);\r\n\r\n\t\t\tif (first) {\r\n\t\t\t\t// there were no other items in the queue, process it\r\n\t\t\t\tprocessNext();\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" }, { "docid": "20ee05e419a0f6bce0488e2ad2debe89", "score": "0.5056146", "text": "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}", "title": "" } ]
4051160e935960ed9aebe4b129330e6e
Computes the next entry with exceptions catching.
[ { "docid": "dbbb6368184366a66722ef3360a3c584", "score": "0.0", "text": "function computeWithTryCatch(reducer, action, state) {\n\t var nextState = state;\n\t var nextError = void 0;\n\t try {\n\t nextState = reducer(state, action);\n\t } catch (err) {\n\t nextError = err.toString();\n\t if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof window.chrome !== 'undefined' || typeof window.process !== 'undefined' && window.process.type === 'renderer')) {\n\t // In Chrome, rethrowing provides better source map support\n\t setTimeout(function () {\n\t throw err;\n\t });\n\t } else {\n\t console.error(err);\n\t }\n\t }\n\t\n\t return {\n\t state: nextState,\n\t error: nextError\n\t };\n\t}", "title": "" } ]
[ { "docid": "9a454d5e3a1593f7f1631ba916461193", "score": "0.6670629", "text": "function computeNextEntry(reducer, action, state, shouldCatchErrors) {\n\t if (!shouldCatchErrors) {\n\t return { state: reducer(state, action) };\n\t }\n\t return computeWithTryCatch(reducer, action, state);\n\t}", "title": "" }, { "docid": "84c0026e88a62154c8add0b7a8277132", "score": "0.6487333", "text": "function computeNextEntry(reducer, action, state, shouldCatchErrors) {\n if (!shouldCatchErrors) {\n return { state: reducer(state, action) };\n }\n return computeWithTryCatch(reducer, action, state);\n}", "title": "" }, { "docid": "84c0026e88a62154c8add0b7a8277132", "score": "0.6487333", "text": "function computeNextEntry(reducer, action, state, shouldCatchErrors) {\n if (!shouldCatchErrors) {\n return { state: reducer(state, action) };\n }\n return computeWithTryCatch(reducer, action, state);\n}", "title": "" }, { "docid": "bcc4258a739ba5b340e839dab40f1693", "score": "0.62840563", "text": "function computeNextEntry(reducer, action, state, error) {\n\t if (error) {\n\t return {\n\t state: state,\n\t error: 'Interrupted by an error up the chain'\n\t };\n\t }\n\t\n\t var nextState = state;\n\t var nextError = undefined;\n\t try {\n\t nextState = reducer(state, action);\n\t } catch (err) {\n\t nextError = err.toString();\n\t if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && typeof window.chrome !== 'undefined') {\n\t // In Chrome, rethrowing provides better source map support\n\t setTimeout(function () {\n\t throw err;\n\t });\n\t } else {\n\t console.error(err.stack || err);\n\t }\n\t }\n\t\n\t return {\n\t state: nextState,\n\t error: nextError\n\t };\n\t}", "title": "" }, { "docid": "3c6b47a2b821dca6d40efbe84364a321", "score": "0.62485856", "text": "function computeNextEntry(reducer, action, state, error) {\n\t if (error) {\n\t return {\n\t state: state,\n\t error: 'Interrupted by an error up the chain'\n\t };\n\t }\n\n\t var nextState = state;\n\t var nextError = undefined;\n\t try {\n\t nextState = reducer(state, action);\n\t } catch (err) {\n\t nextError = err.toString();\n\t console.error(err.stack || err);\n\t }\n\n\t return {\n\t state: nextState,\n\t error: nextError\n\t };\n\t}", "title": "" }, { "docid": "3c6b47a2b821dca6d40efbe84364a321", "score": "0.62485856", "text": "function computeNextEntry(reducer, action, state, error) {\n\t if (error) {\n\t return {\n\t state: state,\n\t error: 'Interrupted by an error up the chain'\n\t };\n\t }\n\n\t var nextState = state;\n\t var nextError = undefined;\n\t try {\n\t nextState = reducer(state, action);\n\t } catch (err) {\n\t nextError = err.toString();\n\t console.error(err.stack || err);\n\t }\n\n\t return {\n\t state: nextState,\n\t error: nextError\n\t };\n\t}", "title": "" }, { "docid": "b1e5c79ff62005031b254ed25606c01f", "score": "0.6239237", "text": "function computeNextEntry(reducer, action, state, error) {\n\t if (error) {\n\t return {\n\t state: state,\n\t error: 'Interrupted by an error up the chain'\n\t };\n\t }\n\n\t var nextState = state;\n\t var nextError = void 0;\n\t try {\n\t nextState = reducer(state, action);\n\t } catch (err) {\n\t nextError = err.toString();\n\t if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && typeof window.chrome !== 'undefined') {\n\t // In Chrome, rethrowing provides better source map support\n\t setTimeout(function () {\n\t throw err;\n\t });\n\t } else {\n\t console.error(err);\n\t }\n\t }\n\n\t return {\n\t state: nextState,\n\t error: nextError\n\t };\n\t}", "title": "" }, { "docid": "e6253d7669cda080762fb6634d9a5ca5", "score": "0.61469376", "text": "function computeNextEntry(reducer, action, state, error, errorHandler) {\n if (error) {\n return {\n state: state,\n error: 'Interrupted by an error up the chain',\n };\n }\n var nextState = state;\n var nextError;\n try {\n nextState = reducer(state, action);\n }\n catch (err) {\n nextError = err.toString();\n errorHandler.handleError(err.stack || err);\n }\n return {\n state: nextState,\n error: nextError,\n };\n}", "title": "" }, { "docid": "24d708296b7a212eb438c86787919356", "score": "0.61120456", "text": "function computeNextEntry(reducer, action, state, error, errorHandler) {\n if (error) {\n return {\n state,\n error: 'Interrupted by an error up the chain',\n };\n }\n let nextState = state;\n let nextError;\n try {\n nextState = reducer(state, action);\n }\n catch (err) {\n nextError = err.toString();\n errorHandler.handleError(err);\n }\n return {\n state: nextState,\n error: nextError,\n };\n}", "title": "" }, { "docid": "85e3da9c02d66c39e58bd6193cbc6b0f", "score": "0.54507303", "text": "function getNextEntry(contents) {\n var matched = regex.exec(contents);\n if(!matched) return null;\n return matched;\n}", "title": "" }, { "docid": "a14ca9d79a1c54650e14a5a80cdc7fe9", "score": "0.52799153", "text": "function showNextEntry(event)\n{\n if (entries && entries.length && currentEntry < entries.length) {\n if (++currentEntry >= entries.length) {\n currentEntry = entries.length - 1;\n }\n\n showEntry(currentEntry);\n }\n}", "title": "" }, { "docid": "c1bdf6805ae6aec01aae2a61f0b3ff55", "score": "0.5262819", "text": "function next(err, answer){\n var res\n if (err){\n // if error, we want to throw it so it's catchable\n // on the outside\n return gen.throw.apply(gen, arguments)\n }else{\n // if no error, send the answer back to the outside\n res = gen.next.call(gen, answer)\n }\n if (!res.done){\n // recursive call to continues the loop\n res.value(next)\n }\n }", "title": "" }, { "docid": "f9cfe798091dc28efc11138b39d6be4f", "score": "0.5201166", "text": "function next() {\n const elem = iterator.next();\n index++;\n\n // If we get this far, no promises ever resolved\n if (elem.done) {\n reject();\n return;\n }\n\n /**\n * Promise iterator function.\n * @callback IteratorFunction\n * @param value - Current value in iteration.\n * @param {Integer} index - Current index in iteration.\n * @param iterable - Complete series being iterated through.\n * @returns {Promise} Promise containing some value.\n */\n fn(elem.value, index, iterable)\n .then(v => {\n resolve({\n index: index,\n value: v\n });\n })\n .catch(next);\n }", "title": "" }, { "docid": "713d480b75ed9051f3798ebcd7b69f96", "score": "0.508648", "text": "function nextItem() {\n\n if (i === arr.length) {\n return null;\n }\n i = i + 1;\n return arr[i];\n\n}", "title": "" }, { "docid": "e991252b4a8e85444e14e73bbeea737f", "score": "0.50373816", "text": "getAdjacentEntry(entry, direction) {\n\t\tif (!entry) {\n\t\t\tvar entries = this.list.querySelectorAll('.entry')\n\t\t\treturn entries[(direction>0) ? 0 : entries.length-1]\n\t\t}\n\n\t\tvar nextEntry\n\t\tif (direction>0) {\n\t\t\tif (entry.classList.contains('directory') && entry.entries.children[0])\n\t\t\t\tnextEntry = entry.entries.children[0];\n\t\t\telse\n\t\t\t\tnextEntry = this.nextEntry(entry);\n\t\t} else\n\t\t\tnextEntry = this.previousEntry(entry) || entry.parentElement.closest('.directory');\n\t\treturn (entry === nextEntry) ? null : nextEntry\n\t}", "title": "" }, { "docid": "4f8a52cb36e1c277571ac8de4a2779a9", "score": "0.50358635", "text": "function entriesFunc()\n {\n debug(`${_store.name} entries:${_store.size}`); \n var keys = Object.keys(_store.items);\n var i = 0;\n\n return({next: nextFunc});\n\n function nextFunc() \n {\n var key = null;\n var item = null;\n var now = Date.now();\n _store.operations.get++;\n\n while (!item && i < keys.length)\n {\n key = keys[i++];\n item = _store.items[key];\n\n // items have been removed after the iterator was created\n if (!item) continue;\n\n // permanent items are always returned\n if (ITEM_TYPE.PERM === item.type) continue;\n\n // item is expired, skip it\n if ( (item.exp < now) ) item = null;\n }\n\n if (item)\n return({value: {key: key, value: item.value, type: item.type}, done: false});\n else\n return({value: undefined, done: true});\n }\n }", "title": "" }, { "docid": "6a9b6d95ac9f1a29581e6b96da089474", "score": "0.50167596", "text": "getNext() {\n if (this.size)\n return this.entries[--this.size];\n else\n return 0;\n }", "title": "" }, { "docid": "6962a69043bec612d9931048d8416f47", "score": "0.49424878", "text": "next() {\n // 4. it should return the value as an object {done:.., value :...}\n if (this.current[0] + this.current[1] <= this.last) {\n let x = this.current[1];\n this.current[1] = this.current[0] + x;\n this.current[0] = x;\n return { done: false, value: this.current[0] + this.current[1], };\n } else {\n return { done: true, };\n }\n }", "title": "" }, { "docid": "16623839d18900da622b6efb8d6db903", "score": "0.49092492", "text": "recover(e) {\r\n let i = this._input.index;\r\n this.errorHandler.recover(this, e);\r\n if (this._input.index === i) {\r\n // no input consumed, better add an error node\r\n let tok = e.getOffendingToken();\r\n if (!tok) {\r\n throw new Error(\"Expected exception to have an offending token\");\r\n }\r\n let source = tok.tokenSource;\r\n let stream = source !== undefined ? source.inputStream : undefined;\r\n let sourcePair = { source, stream };\r\n if (e instanceof InputMismatchException_1.InputMismatchException) {\r\n let expectedTokens = e.expectedTokens;\r\n if (expectedTokens === undefined) {\r\n throw new Error(\"Expected the exception to provide expected tokens\");\r\n }\r\n let expectedTokenType = Token_1.Token.INVALID_TYPE;\r\n if (!expectedTokens.isNil) {\r\n // get any element\r\n expectedTokenType = expectedTokens.minElement;\r\n }\r\n let errToken = this.tokenFactory.create(sourcePair, expectedTokenType, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\r\n tok.line, tok.charPositionInLine);\r\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\r\n }\r\n else { // NoViableAlt\r\n let source = tok.tokenSource;\r\n let errToken = this.tokenFactory.create(sourcePair, Token_1.Token.INVALID_TYPE, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\r\n tok.line, tok.charPositionInLine);\r\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\r\n }\r\n }\r\n }", "title": "" }, { "docid": "20397afb64ebf227a19116f8273221ef", "score": "0.49070984", "text": "function getNextBlogEntry(evt) {\n\tconsole.log('entering: getNextBlogEntry');\n\tvar currentEntryName = parseUrlForBlogName(),\n\t\tnextEntryName = \"\";\n\tfor (var i = 0; i < entriesLinkedList.length; i++) {\n\t\tif (entriesLinkedList[i].name == currentEntryName) {\n\t\t\tnextEntryName = entriesLinkedList[i].next_entry;\n\t\t}\n\t}\n\tif (nextEntryName != null) {\n\t\tsetUrlToCurrentContent(nextEntryName);\n\t}\n\tsetContentAndNavigationInfo();\n}", "title": "" }, { "docid": "802db9d5bb0c9dcbe84c9fa6aaf32256", "score": "0.4899681", "text": "next() {\n // 4. it should return the value as an object {done:.., value :...}\n if (this.current <= this.last) {\n return { done: false, value: this.current++ };\n } else {\n return { done: true };\n }\n }", "title": "" }, { "docid": "c54a4ac8ff86851879ce94f541d45813", "score": "0.48840332", "text": "function next() {\n\t\tif (arguments[0]) {\n\t\t\tif (!(arguments[0] instanceof Error)) {\n\t\t\t\targuments[0] = new Error(''+arguments[0]);\n\t\t\t}\n\t\t\t\n\t\t\t// Check if there are no steps left\n\t\t\tif (!steps.length || errorHandler) {\n\t\t\t\tthrow arguments[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get the next step to execute\n\t\tvar fn = steps.shift();\n\t\tvar args = arguments;\n\t\tif (errorHandler) {\n\t\t\tArray.prototype.splice.call(args, 0, 1);\n\t\t}\n\t\tcounter = 0;\n\t\tresults = [];\n\t\tlock = true;\n\t\t\n\t\tvar result = fn.apply(next, args);\n\t\t// If a synchronous return is used, pass it to the callback\n\t\tif (result !== undefined) {\n\t\t\tnext(undefined, result);\n\t\t}\n\t\tlock = false;\n\t}", "title": "" }, { "docid": "ad823716564f0411c1025a9d784f0aac", "score": "0.48768324", "text": "_nextIndex(index) {\n const MAX_SAFE_INTEGER = 9007199254740991;\n return (index + 1) % MAX_SAFE_INTEGER;\n }", "title": "" }, { "docid": "085f6099e14b8b45730f562cf2da9201", "score": "0.4876009", "text": "recover(e) {\n let i = this._input.index;\n this.errorHandler.recover(this, e);\n if (this._input.index === i) {\n // no input consumed, better add an error node\n let tok = e.getOffendingToken();\n if (!tok) {\n throw new Error(\"Expected exception to have an offending token\");\n }\n let source = tok.tokenSource;\n let stream = source !== undefined ? source.inputStream : undefined;\n let sourcePair = { source, stream };\n if (e instanceof InputMismatchException_1.InputMismatchException) {\n let expectedTokens = e.expectedTokens;\n if (expectedTokens === undefined) {\n throw new Error(\"Expected the exception to provide expected tokens\");\n }\n let expectedTokenType = Token_1.Token.INVALID_TYPE;\n if (!expectedTokens.isNil) {\n // get any element\n expectedTokenType = expectedTokens.minElement;\n }\n let errToken = this.tokenFactory.create(sourcePair, expectedTokenType, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\n tok.line, tok.charPositionInLine);\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\n }\n else { // NoViableAlt\n let source = tok.tokenSource;\n let errToken = this.tokenFactory.create(sourcePair, Token_1.Token.INVALID_TYPE, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\n tok.line, tok.charPositionInLine);\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\n }\n }\n }", "title": "" }, { "docid": "085f6099e14b8b45730f562cf2da9201", "score": "0.4876009", "text": "recover(e) {\n let i = this._input.index;\n this.errorHandler.recover(this, e);\n if (this._input.index === i) {\n // no input consumed, better add an error node\n let tok = e.getOffendingToken();\n if (!tok) {\n throw new Error(\"Expected exception to have an offending token\");\n }\n let source = tok.tokenSource;\n let stream = source !== undefined ? source.inputStream : undefined;\n let sourcePair = { source, stream };\n if (e instanceof InputMismatchException_1.InputMismatchException) {\n let expectedTokens = e.expectedTokens;\n if (expectedTokens === undefined) {\n throw new Error(\"Expected the exception to provide expected tokens\");\n }\n let expectedTokenType = Token_1.Token.INVALID_TYPE;\n if (!expectedTokens.isNil) {\n // get any element\n expectedTokenType = expectedTokens.minElement;\n }\n let errToken = this.tokenFactory.create(sourcePair, expectedTokenType, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\n tok.line, tok.charPositionInLine);\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\n }\n else { // NoViableAlt\n let source = tok.tokenSource;\n let errToken = this.tokenFactory.create(sourcePair, Token_1.Token.INVALID_TYPE, tok.text, Token_1.Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop\n tok.line, tok.charPositionInLine);\n this._ctx.addErrorNode(this.createErrorNode(this._ctx, errToken));\n }\n }\n }", "title": "" }, { "docid": "921fc6c7917f2968f0bc9cd3ec4cf5a9", "score": "0.48731598", "text": "compose() {\n return async (entry) => {\n var len = this.middlewares.length\n var next = async () => Promise.resolve()\n var nextFactory = (middleware, prevNext) => {\n return async () => {\n try {\n await middleware(entry, prevNext)\n } catch (err) {\n this.emit('onerror', err)\n }\n }\n }\n\n for (var i = len - 1; i >= 0; i--) {\n var currentMiddleware = this.middlewares[i]\n next = nextFactory(currentMiddleware, next)\n }\n await next()\n }\n }", "title": "" }, { "docid": "5bbf1fa68889360f931eee2065523802", "score": "0.48475304", "text": "[ITERATOR] () {\r\n const next = () => {\r\n const value = this.read()\r\n const done = value === null\r\n return { value, done }\r\n }\r\n return { next }\r\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "bc67996c8d23645d8b03797f23da3047", "score": "0.4822672", "text": "[ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }", "title": "" }, { "docid": "c51f18a13e9677f583668f2e38df4458", "score": "0.4806724", "text": "function handleOneNext(prevResult) {\n handleOneIter(function() {\n return genObj.next(prevResult);\n });\n }", "title": "" }, { "docid": "d0b9ce239b23d91d1807f04219ef9370", "score": "0.4795466", "text": "function next() {\n index++;\n}", "title": "" }, { "docid": "924c5602bf7417b3dfaf9fe0d6f60c1c", "score": "0.47641432", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3614( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}", "title": "" }, { "docid": "bbfe248646bc7d945179fe2145bdc2f7", "score": "0.47363412", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3609( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 2 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, collection[ idx ], idx, collection, clbk );\n\t\t}\n\t}", "title": "" }, { "docid": "58cd3af25551f74c85554334eef13b34", "score": "0.47340876", "text": "getCompoundNext() {\n return null;\n }", "title": "" }, { "docid": "6021c466830b05d590dce590273e888f", "score": "0.47177604", "text": "nextValue() {\n this.index += 1;\n }", "title": "" }, { "docid": "9008046b57ccd462d0004a92277987d9", "score": "0.47141194", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3824( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3824( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "eeee36be92238166e11a88cfa5ff8296", "score": "0.47114578", "text": "function finish(expr) {\n\t n.Expression.assert(expr);\n\t if (ignoreResult) {\n\t var after = loc();\n\t self.emit(expr);\n\t self.emitAssign(b.identifier('$__next'), after);\n\t self.emit(b.breakStatement(), true);\n\t self.mark(after);\n\t } else {\n\t return expr;\n\t }\n\t }", "title": "" }, { "docid": "6936f92c48294570942716304da3c20e", "score": "0.4698556", "text": "function handleOneIter(iter) {\n try {\n let yielded = iter(); // may throw\n if (yielded.done) {\n if (yielded.value !== undefined) {\n // Something was explicitly returned:\n // Report the value as a result to the caller\n callbacks.success(yielded.value);\n }\n } else {\n setTimeout(runYieldedValue, 0, yielded.value, {\n success(result) { handleOneNext(result); },\n failure(err) { handleOneThrow(err); }\n });\n }\n }\n // Catch unforeseen errors in genObj\n catch (error) {\n if (callbacks) {\n callbacks.failure(error);\n } else {\n throw error;\n }\n }\n }", "title": "" }, { "docid": "f05d2ed4cb76fb8c982fe8ce2d614384", "score": "0.468508", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3819( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( fcn.length === 3 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], cb );\n\t\t} else if ( fcn.length === 4 ) {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, cb );\n\t\t} else {\n\t\t\tfcn.call( opts.thisArg, acc, collection[ idx ], idx, collection, cb ); // eslint-disable-line max-len\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [result] - accumulation result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, result ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\t__debug_3819( 'Accumulator: %s', JSON.stringify( result ) );\n\t\t\tacc = result;\n\t\t\tclbk();\n\t\t} // end FUNCTION cb()\n\t}", "title": "" }, { "docid": "3c88fd0b2f8b3e2908e270903f707859", "score": "0.46803552", "text": "function next() {\n // Get the items only when the current position is less than items length.\n if (cursor < list.length) {\n // Get the item by cursor position.\n var item = list[cursor];\n\n // Increase the position.\n cursor += 1;\n\n // Call the iteration handler.\n handler.call(self, item.key, item.value, next, stop);\n } else {\n // Mark the iterator as complete.\n self.status = 'complete';\n\n // Call the resolver if defined.\n if ('function' === typeof self.resolve) {\n self.resolve(self);\n }\n }\n }", "title": "" }, { "docid": "7a20c1d860eaad87d163902be1c8336f", "score": "0.46798742", "text": "function nextItem(err, result) {\n var item = gen.next(result);\n\n if (!item.done) {\n // I use the thunk I got from the previous generator yield\n // and pass it the reference to nextItem as a callback to be called\n // from within the method which was thunked\n item.value(nextItem);\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.46791175", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.46791175", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.46791175", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "8e3c3b91c4ab1a6eabb109457c16a0e4", "score": "0.46791175", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "f9b7b15cba1e9d958e2165a9719352ee", "score": "0.46760398", "text": "kthFromTheEnd(k) {\n let current = this.head;\n const values = [];\n while (current !== null) {\n values.push(current.val);\n current = current.next;\n }\n\n if (k > values.length - 1 || k < 0) return 'Exception';\n let index = values.length - k - 1;\n return values[index];\n }", "title": "" }, { "docid": "e74665a473e78f61b63eedd49a706708", "score": "0.46753833", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3755( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "2e8c5d1c305052084a9b3b02c76afec4", "score": "0.46747434", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3578( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "6a6a761cf99a6d01686c45f63fbe85af", "score": "0.4673397", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3750( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "568394da0647a52a714bb0797d82b975", "score": "0.46688068", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3385( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "34ac161e1e2709ade8c1c4ac0068c988", "score": "0.46686685", "text": "function next() {\n var tok = current;\n current = null;\n return tok || readNext();\n }", "title": "" }, { "docid": "c8052a4d4c012b27305aa652bb128503", "score": "0.4667949", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3573( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "2a9888c7baecfcf4ef944a4caf04e8ee", "score": "0.46676877", "text": "function next() {\n\t\tidx -= 1;\n\t\t__debug_3851( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "d8728ca3c8df16c7deba3463e2e4777c", "score": "0.4666977", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3380( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "ddb52c057b5114e5f650831cdc473c95", "score": "0.46664202", "text": "next(){\n if(this.group.length == this.counter){\n return {done: true};\n }\n let value = {index: this.counter, value: this.group[this.counter]};\n this.counter++;\n return {value, done:false};\n }", "title": "" }, { "docid": "96a6312710662369b2a63c9176f87d30", "score": "0.46663928", "text": "function tryCatchReturn(f, x, thisArg, next) {\n\t\t\t\ttry {\n\t\t\t\t\tnext.notify(f.call(thisArg, x));\n\t\t\t\t} catch(e) {\n\t\t\t\t\tnext.notify(e);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "96a6312710662369b2a63c9176f87d30", "score": "0.46663928", "text": "function tryCatchReturn(f, x, thisArg, next) {\n\t\t\t\ttry {\n\t\t\t\t\tnext.notify(f.call(thisArg, x));\n\t\t\t\t} catch(e) {\n\t\t\t\t\tnext.notify(e);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "75ac7d8f0d7518c5ba1d547d4ac503c6", "score": "0.4661236", "text": "function next() {\n\t\tidx += 1;\n\t\t__debug_3846( 'Collection element %d: %s.', idx, JSON.stringify( collection[ idx ] ) );\n\t\tif ( predicate.length === 2 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], clbk );\n\t\t} else if ( predicate.length === 3 ) {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, clbk );\n\t\t} else {\n\t\t\tpredicate.call( opts.thisArg, collection[ idx ], idx, collection, clbk ); // eslint-disable-line max-len\n\t\t}\n\t}", "title": "" }, { "docid": "d85dd77431cd5895e143957cb6528945", "score": "0.46604645", "text": "function next(err) {\n\t var fn = fns[++index];\n\t var params = slice$1.call(arguments, 0);\n\t var values = params.slice(1);\n\t var length = input.length;\n\t var pos = -1;\n\n\t if (err) {\n\t done(err);\n\t return\n\t }\n\n\t // Copy non-nully input into values.\n\t while (++pos < length) {\n\t if (values[pos] === null || values[pos] === undefined) {\n\t values[pos] = input[pos];\n\t }\n\t }\n\n\t input = values;\n\n\t // Next or done.\n\t if (fn) {\n\t wrap_1(fn, next).apply(null, input);\n\t } else {\n\t done.apply(null, [null].concat(input));\n\t }\n\t }", "title": "" }, { "docid": "fc8563eadb7bc9cd13e73b202739cb6f", "score": "0.46583557", "text": "function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "title": "" }, { "docid": "f66d07f87df17861f8606abc2429f3d0", "score": "0.465021", "text": "function next() {\n index++;\n c = expression.charAt(index);\n }", "title": "" }, { "docid": "f66d07f87df17861f8606abc2429f3d0", "score": "0.465021", "text": "function next() {\n index++;\n c = expression.charAt(index);\n }", "title": "" }, { "docid": "f66d07f87df17861f8606abc2429f3d0", "score": "0.465021", "text": "function next() {\n index++;\n c = expression.charAt(index);\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "3c3c588c568fb1efbd3c8f7d136ec013", "score": "0.46484023", "text": "function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }", "title": "" }, { "docid": "0ea9d35f52800761883f84b06e1184bd", "score": "0.46327442", "text": "function _next() {\n\t\t\t\t\t\t\tlet filename = filenames.shift();\n\n\t\t\t\t\t\t\tswitch ( filename ) {\n\t\t\t\t\t\t\t\tcase \".\" :\n\t\t\t\t\t\t\t\tcase \"..\" :\n\t\t\t\t\t\t\t\t\tprocess.nextTick( filenames.length ? _next : done );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t\t\t_collectJobsInFolder( Path.join( src, filename ), Path.join( relPath, filename ), jobs, ( filenames.length ? _next : done ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "fb7ec5801a9f88e597e6dba48a2d59a9", "score": "0.4630393", "text": "function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n } // Copy non-nully input into values.\n\n\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values; // Next or done.\n\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }", "title": "" }, { "docid": "07772f016dfa23047b823f987e61d3df", "score": "0.46111935", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = _utils.is.func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = _utils.is.func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "07772f016dfa23047b823f987e61d3df", "score": "0.46111935", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = _utils.is.func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = _utils.is.func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "7936602192b0ec56e02ded5c22ff5475", "score": "0.45969424", "text": "next(): ?SourceTokenListIndex {\n return this.advance(1);\n }", "title": "" }, { "docid": "61c8c02788ea962b900949657296d202", "score": "0.45803076", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = undefined;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = _utils.is.func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = _utils.is.func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "6aaf911f3270b5c3ab499e056e575792", "score": "0.4571976", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n log('error', 'uncaught at ' + name, error.message);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "3f873d2da200e63b57dc70a43e8e3824", "score": "0.4567085", "text": "function next() {\n\t index++;\n\t c = expression.charAt(index);\n\t }", "title": "" }, { "docid": "48f8ce5920e780ba087c28f1f6d4cb42", "score": "0.455988", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n Thill will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n log('error', 'uncaught at ' + name, error.message);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "6157c6fd771afce81ef6bdc398057f3f", "score": "0.4552338", "text": "next() {\n var i;\n i = this.parent.children.indexOf(this);\n if (i === -1 || i === this.parent.children.length - 1) {\n throw new Error(\"Already at the last node. \" + this.debugInfo());\n }\n return this.parent.children[i + 1];\n }", "title": "" }, { "docid": "d0069a9648186540c768c83de8926eb9", "score": "0.45485467", "text": "function next(current, group) {\n let next = current;\n do {\n\tnext = (next + 1) % input;\n\tif (next == current) {\n\t return current;\n\t}\n } while (group[next] === 0);\n \n return next;\n}", "title": "" }, { "docid": "061c8dc0253051296462c983398eebf3", "score": "0.45439178", "text": "function doNextAction() {\n if (i < listOfCallableActions.length) {\n // Save the current value of i, so we can put the result in the right place\n var actionIndex = i++;\n var nextAction = listOfCallableActions[actionIndex];\n return Promise.resolve(nextAction())\n .then(result => { // Save results to the correct array index.\n resultArray[actionIndex] = result;\n return;\n }).then(doNextAction);\n }\n }", "title": "" }, { "docid": "5eb42914f33e64f0491a1e216de7989c", "score": "0.45436075", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "5eb42914f33e64f0491a1e216de7989c", "score": "0.45436075", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = _utils__WEBPACK_IMPORTED_MODULE_0__[\"is\"].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "e6ff181bff1d7a87e14b9af358e6709b", "score": "0.454242", "text": "next() { return this.move(1); }", "title": "" }, { "docid": "3c478983b94ea37cb404793ee0e365e3", "score": "0.45419595", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "11c99014d36cd9cc40761010d23bed03", "score": "0.45410365", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"n\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "45b653d4c9accde47e7fc9a79ed1c0ba", "score": "0.45338726", "text": "function next() {\n var timeout = expired.shift();\n if (timeout) {\n _execTimeout(timeout, next);\n }\n else {\n // schedule the next round\n _schedule();\n }\n }", "title": "" }, { "docid": "390cc7cc8b50fb8788beff4cd6b0fd98", "score": "0.4531027", "text": "function nextResult () {\n _searchPosition++\n if (_searchPosition >= _hitCount) {\n _searchPosition = 0\n }\n highlightSearchResult()\n}", "title": "" }, { "docid": "aa378e1739b639d28c8718a8e299d3c7", "score": "0.45271027", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "aa378e1739b639d28c8718a8e299d3c7", "score": "0.45271027", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "aa378e1739b639d28c8718a8e299d3c7", "score": "0.45271027", "text": "function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.throw(arg);\n } else if (arg === TASK_CANCEL) {\n /**\n getting TASK_CANCEL automatically cancels the main task\n We can get this value here\n - By cancelling the parent task manually\n - By joining a Cancelled task\n **/\n mainTask.isCancelled = true;\n /**\n Cancels the current effect; this will propagate the cancellation down to any called tasks\n **/\n next.cancel();\n /**\n If this Generator has a `return` method then invokes it\n This will jump to the finally block\n **/\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };\n } else if (arg === CHANNEL_END) {\n // We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)\n result = __WEBPACK_IMPORTED_MODULE_0__utils__[\"q\" /* is */].func(iterator.return) ? iterator.return() : { done: true };\n } else {\n result = iterator.next(arg);\n }\n\n if (!result.done) {\n runEffect(result.value, parentEffectId, '', next);\n } else {\n /**\n This Generator has ended, terminate the main task and notify the fork queue\n **/\n mainTask.isMainRunning = false;\n mainTask.cont && mainTask.cont(result.value);\n }\n } catch (error) {\n if (mainTask.isCancelled) {\n logError(error);\n }\n mainTask.isMainRunning = false;\n mainTask.cont(error, true);\n }\n }", "title": "" }, { "docid": "6d3a5f209a0b5e2fefff929859be9a79", "score": "0.4525036", "text": "function next() {\n var fn;\n if(promiseFns.length === 0) {\n deferred.resolve();\n }\n else {\n fn = promiseFns.shift() || _.noop;\n Q.resolve()\n .then(fn)\n .then(next)\n .catch((error) => {\n if(fn.displayName) {\n console.error(\"Animation error:\",error,\"in\",fn.displayName);\n }\n else {\n console.error(\"Animation error:\",error);\n }\n return next();\n });\n }\n }", "title": "" }, { "docid": "3c208f87bb5c41af3f3a1fe7b72fcff1", "score": "0.4516477", "text": "function next(c) {\n if (c.pipeline.length < 1) {\n return Promise.resolve(c);\n }\n return c.pipeline.shift()(c);\n}", "title": "" }, { "docid": "3d58194d370f9597e12c6c165b50fa64", "score": "0.4513645", "text": "next () {\n const token = this.current;\n this.current = null;\n return token || this.readNext();\n }", "title": "" }, { "docid": "3e3524cf40b98e1f7c1374a7253d0274", "score": "0.45103613", "text": "function next() {\n if (Index < games.length - 1) {\n Index++;\n }\n getData(Index);\n}", "title": "" }, { "docid": "c6add1d39886fcd7ab063da592102581", "score": "0.45003188", "text": "setNextEntry(entry)\n {\n this.nextEntry=entry;\n }", "title": "" }, { "docid": "183d74f1027a1fe9c733055d48bf142f", "score": "0.4487961", "text": "function next () {\n if(ne_hotel_ids.length > 0) {\n console.log(' - - - - - > Remaining Records:', ne_hotel_ids.length);\n var ne_hotel_id = ne_hotel_ids.pop(); // the NE Hotel ID of next record\n var ne_hotel_record = format_ne_hotel_as_taggable_tag(all_ne_hotels[ne_hotel_id]);\n // only lookup & format Master Hotel Record if a mapping exists\n if(ne_hotel_record.tags.length > 0 && ne_hotel_record.tags[0].tagId.indexOf('NO_MHID') === -1) {\n // console.log(ne_hotel_record.tags[0]);\n var master_hotel_record = format_master_hotel_record(ne_hotel_record);\n }\n var lat = ne_hotel_record.location.lat;\n var lon = ne_hotel_record.location.lon;\n if (!lat || !lon) { // don't lookup a record that does not have a lat lon in Geonames\n console.log('- - - - - - - - - - -> Nordics Hotel ha NO lat/lon!', ne_hotel_record._id);\n return setTimeout(function() { next(); }, 3000);\n }\n console.log('Record has lat/lon:', lat, lon);\n geonames.find(lat, lon, function (err, data) {\n if(err || !data || !data.geonames || data.geonames.length === 0){\n console.log(' - - - - - - - -> Geonames Find ERROR:', err, data);\n return setTimeout(function() { next(); }, 3000);\n }\n\n geonames.hierarchy(data.geonames[0].geonameId, function (err, hierarchy) {\n if (err || !hierarchy || !hierarchy.geonames) {\n console.log(' - - - - - - - -> Geonames Hierarchy ERROR:', err, hierarchy);\n return next();\n }\n\n geonames.get_all_geonames_records(hierarchy, function (err, map) {\n if(err || !map || Object.keys(map) < 1) {\n console.log(' - - - - - - - -> Geonames getJSON ERROR:', err, hierarchy);\n return next();\n }\n\n var geo_tags = geonames.format_hierarchy_as_tags(hierarchy, map); // https://git.io/vwm8Y\n var geo_tag; // used below\n geo_tags.forEach(function (g) {\n add_tag(g);\n geo_tag = format_geo_tag(g); // over-write \n });\n if (master_hotel_record) {\n master_hotel_record.tags.unshift(geo_tag); // only add the final Geo tag to Master\n add_tag(master_hotel_record);\n } // only insert a master_hotel_record if it exists\n\n add_tag(ne_hotel_record);\n return next();\n });\n });\n });\n }\n else {\n console.log(' - - - - - - - - - - > Done!', ids.length);\n insert_tags();\n return;\n }\n}", "title": "" } ]
0579f052898b1c103ed8b3188d432088
Choose the first valid path. If `workspace` is undefined then either a workspace or a directory are acceptable. Otherwise it must be a file if a workspace or a directory otherwise.
[ { "docid": "3240540e1b7cbf8e5ebb163c0e7545c8", "score": "0.5260645", "text": "async getFirstValidPath(startPaths) {\n const logger = this.services.get(log_1.ILogService);\n const cwd = process.env.VSCODE_CWD || process.cwd();\n for (let i = 0; i < startPaths.length; ++i) {\n const startPath = startPaths[i];\n if (!startPath) {\n continue;\n }\n const paths = typeof startPath.path === \"string\" ? [startPath.path] : (startPath.path || []);\n for (let j = 0; j < paths.length; ++j) {\n const uri = uri_1.URI.file(extpath_1.sanitizeFilePath(paths[j], cwd));\n try {\n const stat = await util.promisify(fs.stat)(uri.fsPath);\n if (typeof startPath.workspace === \"undefined\" || startPath.workspace !== stat.isDirectory()) {\n return { uri, workspace: !stat.isDirectory() };\n }\n }\n catch (error) {\n logger.warn(error.message);\n }\n }\n }\n return undefined;\n }", "title": "" } ]
[ { "docid": "202f5ef31b117339533319af4e1883c5", "score": "0.515417", "text": "function checkPath () {\n $scope.alreadyOpen_ws = null;\n var loc = $location.path();\n var index = loc.indexOf('workspace/');\n if (index > -1) {\n var workspaceSubstr = loc.substring(index+10);\n var lastindex = workspaceSubstr.indexOf('/');\n if (lastindex > -1) {\n $scope.alreadyOpen_ws = workspaceSubstr.substring(0, lastindex);\n if ($scope.workspaces) { // only open if workspaces already fetched\n reopenWorkspaceFolder();\n }\n }\n }\n }", "title": "" }, { "docid": "99da61a713cbcf0b80840373941a5edc", "score": "0.5143822", "text": "function getCurrentGoWorkspaceFromGOPATH(gopath, currentFileDirPath) {\n if (!gopath) {\n return;\n }\n const workspaces = gopath.split(path.delimiter);\n let currentWorkspace = '';\n currentFileDirPath = fixDriveCasingInWindows(currentFileDirPath);\n // Find current workspace by checking if current file is\n // under any of the workspaces in $GOPATH\n for (const workspace of workspaces) {\n const possibleCurrentWorkspace = path.join(workspace, 'src');\n if (currentFileDirPath.startsWith(possibleCurrentWorkspace) ||\n (process.platform === 'win32' &&\n currentFileDirPath.toLowerCase().startsWith(possibleCurrentWorkspace.toLowerCase()))) {\n // In case of nested workspaces, (example: both /Users/me and /Users/me/src/a/b/c are in $GOPATH)\n // both parent & child workspace in the nested workspaces pair can make it inside the above if block\n // Therefore, the below check will take longer (more specific to current file) of the two\n if (possibleCurrentWorkspace.length > currentWorkspace.length) {\n currentWorkspace = currentFileDirPath.substr(0, possibleCurrentWorkspace.length);\n }\n }\n }\n return currentWorkspace;\n}", "title": "" }, { "docid": "99da61a713cbcf0b80840373941a5edc", "score": "0.5143822", "text": "function getCurrentGoWorkspaceFromGOPATH(gopath, currentFileDirPath) {\n if (!gopath) {\n return;\n }\n const workspaces = gopath.split(path.delimiter);\n let currentWorkspace = '';\n currentFileDirPath = fixDriveCasingInWindows(currentFileDirPath);\n // Find current workspace by checking if current file is\n // under any of the workspaces in $GOPATH\n for (const workspace of workspaces) {\n const possibleCurrentWorkspace = path.join(workspace, 'src');\n if (currentFileDirPath.startsWith(possibleCurrentWorkspace) ||\n (process.platform === 'win32' &&\n currentFileDirPath.toLowerCase().startsWith(possibleCurrentWorkspace.toLowerCase()))) {\n // In case of nested workspaces, (example: both /Users/me and /Users/me/src/a/b/c are in $GOPATH)\n // both parent & child workspace in the nested workspaces pair can make it inside the above if block\n // Therefore, the below check will take longer (more specific to current file) of the two\n if (possibleCurrentWorkspace.length > currentWorkspace.length) {\n currentWorkspace = currentFileDirPath.substr(0, possibleCurrentWorkspace.length);\n }\n }\n }\n return currentWorkspace;\n}", "title": "" }, { "docid": "a8a8d8bb9cfae1f41b66b638e1e71c83", "score": "0.49487033", "text": "function firstRun ( ws ){\n //const ws = path.resolve ( app.get ( 'workspace' ))\n const source = path.resolve ( 'whoobe/workspace' )\n fs.ensureDir ( ws ).then ( () => {\n console.log ( 'Default Workspace created!')\n fs.copy ( source + '/default' , ws + '/default' )\n }).catch ( error => {\n console.log ( error )\n })\n}", "title": "" }, { "docid": "1326bff7ad38a29c3ab2e501f38fb37c", "score": "0.48952243", "text": "function toWorkspaceDir(p) {\n if (p === workspace) {\n return '.';\n }\n // The manifest is written with forward slash on all platforms\n if (p.startsWith(workspace + '/')) {\n return p.substring(workspace.length + 1);\n }\n return path.join('external', p);\n }", "title": "" }, { "docid": "207455abbd1c3d4bef7f0e458e802da1", "score": "0.4850792", "text": "findProjectDir() {\n try {\n var base = process.cwd();\n var firstLevel = path.join(base, '.io');\n var secondBase = path.dirname(base);\n var secondLevel = path.join(secondBase, '.io');\n var thirdBase = path.dirname(secondBase);\n var thirdLevel = path.join(thirdBase, '.io');\n\n if (this.isDir(firstLevel)) {\n return base;\n } else if (this.isDir(secondLevel)) {\n return secondBase;\n } else if (this.isDir(thirdLevel)) {\n return thirdBase;\n } else {\n this.logNoProjectFound();\n process.exit(1);\n }\n } catch (e) {\n // XXX: Need to inform the user that\n // they are not in a project, and possibly\n // log a usage or helper error.\n this.logNoProjectFound();\n process.exit(1);\n }\n\n }", "title": "" }, { "docid": "12a40c9074ebe59fb65b39e93109ade7", "score": "0.4760067", "text": "function defaultPath() {\n var dirname = parsedPath.dirname;\n var name = parsedPath.name;\n\n if (name === 'template' || name === 'index') {\n name = '';\n }\n return _path.posix.join('/', dirname, name, '/');\n }", "title": "" }, { "docid": "12a40c9074ebe59fb65b39e93109ade7", "score": "0.4760067", "text": "function defaultPath() {\n var dirname = parsedPath.dirname;\n var name = parsedPath.name;\n\n if (name === 'template' || name === 'index') {\n name = '';\n }\n return _path.posix.join('/', dirname, name, '/');\n }", "title": "" }, { "docid": "042ebed26b3b1fef2e550af868c9749b", "score": "0.4757482", "text": "getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\n if (insertedPath.startsWith('/') && workspacePath) {\r\n currentDir = vs.workspace.rootPath;\r\n }\r\n return path.resolve(currentDir);\r\n }", "title": "" }, { "docid": "e0a34db78bda3b1f045666f1dc0d64ea", "score": "0.4752326", "text": "function initSelectedWorkspace() {\n var selectedName = StorageService.get('selectedWorkspaceName');\n\n if (!selectedName) {\n selectedName = defaultWorkspace.name;\n StorageService.set('selectedWorkspaceName', selectedName);\n }\n\n var currRepos = repositories();\n for (var i = 0; i < currRepos.length; ++i) {\n if (currRepos[i].name == selectedName)\n return currRepos[i];\n }\n\n return null;\n }", "title": "" }, { "docid": "208bfa2e66840b0abed3948040ea3930", "score": "0.46193552", "text": "function getCurrentStudioPath(changelist) {\n if (typeof changelist === \"undefined\") {\n changelist = getCurrentChangelist();\n }\n if (isLinux()) {\n return {\n path: '',\n folder: ''\n };\n }\n if (currentStudioPath !== null) {\n if (isMac()) {\n return {\n path: path.dirname(path.dirname(path.dirname(currentStudioPath))),\n folder: path.dirname(path.dirname(currentStudioPath))\n };\n } else {\n return {\n path: currentStudioPath,\n folder: path.dirname(currentStudioPath)\n };\n }\n } else {\n var found = null;\n if (isMac()) {\n var wakApps = findFiles(path.join(config.BUILD_TEST_DIR, changelist.toString()), /^wakanda.*(studio|server)$/i);\n wakApps.forEach(function(wakApp) {\n if (/studio/i.test(wakApp)) {\n found = wakApp;\n }\n });\n } else if (isWindows()) {\n var wakApps = findFiles(path.join(config.BUILD_TEST_DIR, changelist.toString()), /^wakanda.*\\.exe$/i);\n wakApps.forEach(function(wakApp) {\n if (/studio/i.test(wakApp)) {\n found = wakApp;\n }\n });\n }\n if (found !== null) {\n if (isMac()) {\n return {\n path: path.dirname(path.dirname(path.dirname(found))),\n folder: path.dirname(path.dirname(found))\n };\n } else {\n return {\n path: found,\n folder: path.dirname(found)\n };\n }\n }\n return {\n path: config.WAKANDA_STUDIO_PATH,\n folder: config.WAKANDA_STUDIO_FOLDER\n };\n }\n}", "title": "" }, { "docid": "b07f8e2a08cd868ce8828361ddbac831", "score": "0.46174508", "text": "function default_robot(){\n return value_of_path(default_robot_name())\n}", "title": "" }, { "docid": "b1796c0821f07791287ae7071b6c2cc4", "score": "0.4589173", "text": "function firstExistingPath(paths) {\n for (var i = 0; i < paths.length; i++) {\n if (fs.existsSync(paths[i])) {\n return paths[i];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "f431e8f98aa63672d1d616eecff1ac67", "score": "0.44821098", "text": "function autoGuessProjectsFolder () {\n var projectsFolder = \"\";\n var tempProjectsFolder = \"\";\n var autoProjects = [ \"github\", \"projects\", \"repositories\", \"repos\", \"websites\" ];\n\n //Set default paths to check based on OS standards\n var homePath = \"\";\n var myDocsPath = \"\";\n if (process.platform == \"linux\") {\n homePath = process.env.HOME;\n myDocsPath = homePath + \"/Documents\";\n } else if (process.platform == \"win32\") {\n homePath = process.env.USERPROFILE;\n myDocsPath = homePath + \"\\\\Documents\";\n } else if (process.platform == \"darwin\") {\n homePath = \"/Users/\" + process.env.USER;\n myDocsPath = homePath + \"/Documents\";\n }\n\n if (homePath) {\n //Check the user profile for common project folders\n var contents = ugui.helpers.readAFolder(homePath);\n for (var i = 0; i < contents.length; i++) {\n for (var j = 0; j < autoProjects.length; j++) {\n if (contents[i].name.toLowerCase() == autoProjects[j]) {\n tempProjectsFolder = homePath.split('\\\\').join('/') + '/' + contents[i].name;\n var innerContents = ugui.helpers.readAFolder(tempProjectsFolder);\n //make sure there is at least one project folder in the projects folder\n for (var k = 0; k < innerContents.length; k++) {\n if (innerContents.length > 0 && innerContents[k].isFolder) {\n projectsFolder = tempProjectsFolder;\n scout.ftux.projectsFolder = projectsFolder;\n return;\n }\n }\n }\n }\n }\n }\n //then look in My Docs if it isn't in the user profile\n if (!projectsFolder && myDocsPath) {\n var myDocsContents = ugui.helpers.readAFolder(myDocsPath);\n for (var i = 0; i < myDocsContents.length; i++) {\n for (var j = 0; j < autoProjects.length; j++) {\n if (myDocsContents[i].name.toLowerCase() == autoProjects[j]) {\n tempProjectsFolder = myDocsPath.split('\\\\').join('/') + '/' + myDocsContents[i].name;\n var innerContents = ugui.helpers.readAFolder(tempProjectsFolder);\n //make sure there is at least one project folder in the projects folder\n for (var k = 0; k < innerContents.length; k++) {\n if (innerContents.length > 0 && innerContents[k].isFolder) {\n projectsFolder = tempProjectsFolder;\n scout.ftux.projectsFolder = projectsFolder;\n return;\n }\n }\n }\n }\n }\n }\n //If on Window and no project folder was found in Docs or User, check drive roots (slow)\n if (!projectsFolder && process.platform == \"win32\") {\n //Each drive letter adds like half a second to load time, so I limited them to the common ones\n var driveLetters = [\"C\", \"D\", \"E\", \"F\", \"Z\", \"Y\", \"X\", \"G\", \"H\", \"M\", \"N\",];\n var shortProjects = [\"GitHub\", \"Projects\"];\n var fs = require('fs');\n var stats = \"\";\n for (var i = 0; i < driveLetters.length; i++) {\n for (var j = 0; j < shortProjects.length; j++) {\n var driveAndFolder = driveLetters[i] + \":/\" + shortProjects[j];\n try {\n stats = fs.lstatSync(driveAndFolder);\n if (stats.isDirectory()) {\n tempProjectsFolder = driveAndFolder;\n var innerContents = ugui.helpers.readAFolder(tempProjectsFolder);\n //make sure there is at least one project folder in the projects folder\n for (var k = 0; k < innerContents.length; k++) {\n if (innerContents.length > 0 && innerContents[k].isFolder) {\n projectsFolder = tempProjectsFolder;\n scout.ftux.projectsFolder = projectsFolder;\n return;\n }\n }\n }\n }\n catch (err) {\n continue;\n }\n }\n }\n }\n\n scout.ftux.projectsFolder = projectsFolder;\n }", "title": "" }, { "docid": "3e9243f7fc3928f8f6dc6ecea6468cbf", "score": "0.4428135", "text": "function directory(path) {\n return new File(path).getParent() || '.';\n}", "title": "" }, { "docid": "fc808856419551f938e10518159db1a2", "score": "0.44168356", "text": "function getWorkspaceDir() {\n return shelljs_shell.env.GITHUB_WORKSPACE || '';\n}", "title": "" }, { "docid": "2731339251f8a36d430eefaf672226ec", "score": "0.4406255", "text": "function pathToBuild(browser) {\n\tif (validBrowsers.includes(browser)) {\n\t\tif (testMode) {\n\t\t\treturn path.join(buildDir, browser + '-test')\n\t\t}\n\t\treturn path.join(buildDir, browser)\n\t}\n\n\terror(`pathToBuild: invalid browser ${browser} given`)\n}", "title": "" }, { "docid": "fc5b5691bbb295a45ffbd53abce982e5", "score": "0.43766126", "text": "getProperPath(a_src) {\n\t\tif (!Utils.IsAbsolutePath(a_src)) {\n\t\t\treturn this.path;\n\t\t} else return \"\";\n\t}", "title": "" }, { "docid": "9c27b0b51d2051b479987bd332ec9db7", "score": "0.4364701", "text": "function openFileOrDirectory() {\n dialog.showOpenDialog(win, { \n title: \"Select File(s)\", \n defaultPath: process.env.HOME,\n buttonLabel: \"Choose File(s)\", \n filters: \n [\n { \n name: 'All Files', \n extensions: ['*'] \n }\n ],\n properties: \n [\n \"openFile\", \n \"multiSelections\", \n \"showHiddenFiles\", \n \"openDirectory\"\n ]\n }).then(result => {\n selectedFiles = result.filePaths;\n win.webContents.send('picked-files', { selected: selectedFiles });\n }).catch(err => { \n console.log(err); \n });\n}", "title": "" }, { "docid": "5c851025f433064cf3554479492e567d", "score": "0.4317019", "text": "getSourceDirectory(type) {\n const part = this.getPartConfiguration(type);\n\n if (part === null || part != null && part.sourceDirectory === null) {\n // part or sourceDirectory is explicitly set to null\n return null;\n }\n\n const result = part == null ? null : part.sourceDirectory;\n\n if (result == null) {\n return path.join(this.projectDir, \"src\", type.startsWith(\"renderer\") || type === \"test\" ? \"renderer\" : type);\n } else {\n return path.resolve(this.projectDir, result);\n }\n }", "title": "" }, { "docid": "4a6b72596b4024536261897d2ebc7036", "score": "0.43085787", "text": "function checkProject(path) {\n const foldersName = path.split('/');\n const projects = [\n 'automation-api',\n 'automation-app',\n 'automation-pj',\n 'automation-store'\n ];\n const projectName = foldersName.find(folderName => {\n const result = projects.find(project => {\n return project === folderName ? project : false;\n });\n return result ? result : false;\n });\n return projectName;\n}", "title": "" }, { "docid": "291831bbc303ccfbc56a5b340119427a", "score": "0.42839786", "text": "function getFileOrFolder (torrentSummary) {\n const ts = torrentSummary\n if (!ts.path || !ts.files || ts.files.length === 0) return null\n const dirname = ts.files[0].path.split(path.sep)[0]\n return path.join(ts.path, dirname)\n}", "title": "" }, { "docid": "d6a6d580b9355182ffc5167969d5091f", "score": "0.42624223", "text": "function do_get_file(path, allowNonexistent) {\n try {\n let lf = Components.classes[\"@mozilla.org/file/directory_service;1\"]\n .getService(Components.interfaces.nsIProperties)\n .get(\"CurWorkD\", Components.interfaces.nsILocalFile);\n\n let bits = path.split(\"/\");\n for (let i = 0; i < bits.length; i++) {\n if (bits[i]) {\n if (bits[i] == \"..\")\n lf = lf.parent;\n else\n lf.append(bits[i]);\n }\n }\n\n if (!allowNonexistent && !lf.exists()) {\n var stack = Components.stack.caller;\n dump(\"Problem locating file | \" + stack.filename + \" | [\" +\n stack.name + \" : \" + stack.lineNumber + \"] \" + lf.path +\n \" does not exist\\n\");\n }\n\n return lf;\n }\n catch (ex) {\n console.error('do_get_file problem:', ex, '\\n', ex.stack);\n }\n\n return null;\n}", "title": "" }, { "docid": "efccdf859d64256aea1140a679fe218a", "score": "0.4257435", "text": "function getCurrentFileOrDefault() {\n var pFile = LaunchBar.executeAppleScript('if application \"TaskPaper\" is running then',\n 'tell application id (id of application \"TaskPaper\")',\n ' set a to file of the front document',\n ' return POSIX path of a',\n 'end tell',\n 'else',\n ' return \"\"',\n 'end if').trim();\n if (pFile == \"\") {\n if(File.exists(LaunchBar.homeDirectory + \"/.tpProjectFile\"))\n pFile = File.readText(LaunchBar.homeDirectory + \"/.tpProjectFile\");\n } else {\n //\n // Save the path to the ~/.tpProjectFile location.\n //\n File.writeText(pFile, LaunchBar.homeDirectory + \"/.tpProjectFile\");\n }\n\n //\n // Return the project file location.\n //\n return (pFile);\n}", "title": "" }, { "docid": "3e881d3f9a1fa9851e7d464755f2bc78", "score": "0.423329", "text": "function getPathArg() {\n var pathArg = yargs.argv.path;\n\n if (!pathArg) {\n throw new Error('Must specify a `--path path/to/file` argument.');\n }\n\n // Support relative path.\n if (pathArg[0] !== '/') {\n pathArg = path.normalize(path.join(process.cwd(), pathArg));\n }\n\n if (!fs.existsSync(pathArg)) {\n throw new Error(format('File not found: `%s`', pathArg));\n }\n\n return pathArg;\n}", "title": "" }, { "docid": "5bf70f125487e79e05180952c32a65cd", "score": "0.42130187", "text": "gopath (options = {}) {\n let e = this.rawEnvironment(options)\n if (isFalsy(e.GOPATH) || e.GOPATH.trim() === '') {\n return false\n }\n\n return pathhelper.expand(e, e.GOPATH)\n }", "title": "" }, { "docid": "c5ec4fc8b5a3235af6c4e9ab7c6d672a", "score": "0.4202055", "text": "function actualPath(p, failIfNotExist) {\n if (typeof failIfNotExist === \"undefined\") {\n failIfNotExist = false;\n }\n var expected = p.replace(/\\/\\//g, '/').replace(/\\\\\\\\/g, '\\\\').split(path.sep);\n var actual = '';\n var next = null;\n var index = 1;\n var failed = false;\n expected.forEach(function(item) {\n if (failed === false) {\n if (next === null) {\n actual += item + path.sep\n } else {\n for (var i = 0; i < next.length; i++) {\n if (next[i] === item) {\n if (index === expected.length) {\n actual += next[i];\n } else {\n actual += next[i] + path.sep;\n }\n break;\n } else if (next[i].toLowerCase() === item.toLowerCase()) {\n if (index === expected.length) {\n actual += next[i];\n } else {\n actual += next[i] + path.sep;\n }\n break;\n }\n }\n }\n try {\n files = fs.readdirSync(actual);\n next = files;\n index++;\n } catch (e) {\n failed = true;\n }\n }\n });\n if (failIfNotExist === true && failed === true && p.toLowerCase() !== actual.toLowerCase()) {\n return null;\n } else {\n return actual;\n }\n}", "title": "" }, { "docid": "74660a950a370f6d4c2b26e4fec15fe5", "score": "0.4200984", "text": "function tryFile(requestPath, isMain) {\n\t const rc = stat(requestPath);\n\t return rc === 0 && toRealPath(requestPath);\n\t }", "title": "" }, { "docid": "9e6ea57cf863b9cda869193eb6254b2f", "score": "0.41883126", "text": "function hasWorkspaceFolder() {\n return vscode.workspace.rootPath ? true : false;\n}", "title": "" }, { "docid": "9362251e7b8e02815d6fc3880dfe60de", "score": "0.4178354", "text": "isProjectDir() {\n try {\n var base = process.cwd();\n var firstLevel = path.join(base, '.io');\n var secondBase = path.dirname(base);\n var secondLevel = path.join(secondBase, '.io');\n var thirdBase = path.dirname(secondBase);\n var thirdLevel = path.join(thirdBase, '.io');\n\n if (this.isDir(firstLevel) ||\n this.isDir(secondLevel) ||\n this.isDir(thirdLevel))\n {\n return true;\n }\n } catch (e) {\n return false;\n }\n\n }", "title": "" }, { "docid": "4b9399462e069d9fdaf4bff8fa9f513c", "score": "0.41751745", "text": "function getRootCamelFolder(workspace) {\n var tree = workspace ? workspace.tree : null;\n if (tree) {\n return tree.get(Camel.jmxDomain);\n }\n return null;\n }", "title": "" }, { "docid": "a5be9924e8c219940cf319b1a6ee6d15", "score": "0.41642842", "text": "function onlyOneFileEnteredUseIt() {\n if (files.length === 1) {\n return files[0].relativePath;\n }\n\n return null;\n }", "title": "" }, { "docid": "602864bf961a5ac41f16bbee105a6e6c", "score": "0.4143845", "text": "function findFile (filename) {\n const file = configDirectory + '/' + filename\n if (fs.existsSync(file)) return file\n const defaultFile = defaultDirectory + '/' + filename\n if (fs.existsSync(defaultFile)) return defaultFile\n return null\n }", "title": "" }, { "docid": "46b68a8fad6d868143ad3f4696de7c72", "score": "0.4143265", "text": "fileIsPath () {\n return this.target.file && /[/\\\\]/.test(this.target.file)\n }", "title": "" }, { "docid": "d16e0c0499e260dbac83d8ed0ba8d05e", "score": "0.41422808", "text": "function filterDefaultWorkspace (workspaces) {\n return _.find(workspaces, (workspace) => {\n return workspace &&\n workspace.type === 'personal' &&\n _.get(workspace, 'state.isDefault') === true;\n });\n }", "title": "" }, { "docid": "b5e5f29e0d34bdcfa2441b6b0ed09150", "score": "0.4128399", "text": "function getDefaultPath() {\n return \"python3\";\n}", "title": "" }, { "docid": "a1466640a550d761ed0b69eaa91d809e", "score": "0.4113065", "text": "function checkPathInDeployOption(path) {\n if (path[path.length - 1] === '/') {\n logger.error('Error: option deploy does not support directories: ' + path);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "80c7d96f12e0d457e49787ce0f0e0c31", "score": "0.41080078", "text": "function fileURLToPath$1(path) {\n if (typeof path === \"string\") path = new URL(path);\n else if (!(path instanceof URL)) {\n throw new Deno.errors.InvalidData(\n \"invalid argument path , must be a string or URL\",\n );\n }\n if (path.protocol !== \"file:\") {\n throw new Deno.errors.InvalidData(\"invalid url scheme\");\n }\n return isWindows$1 ? getPathFromURLWin$1(path) : getPathFromURLPosix$1(path);\n}", "title": "" }, { "docid": "6db9131e6ffd9c24bc7d2d81c2b2e4e5", "score": "0.40885186", "text": "function fileURLToPath(path) {\n if (typeof path === \"string\") path = new URL(path);\n else if (!(path instanceof URL)) {\n throw new Deno.errors.InvalidData(\n \"invalid argument path , must be a string or URL\",\n );\n }\n if (path.protocol !== \"file:\") {\n throw new Deno.errors.InvalidData(\"invalid url scheme\");\n }\n return isWindows ? getPathFromURLWin(path) : getPathFromURLPosix(path);\n}", "title": "" }, { "docid": "1cfba5d165d237d014cd312b2b003414", "score": "0.40878657", "text": "function normalizeFilePath (x) {\n if (!x || typeof x !== 'string') {\n throw new TypeError(`Invalid file path ${x}`)\n }\n return x.charAt(0) === '/' ? x : path.join(__dirname, '../..', x)\n}", "title": "" }, { "docid": "bf06e53a06af0114f4d71caefb3795f9", "score": "0.4074492", "text": "function chooseProject(){\n let projectsUrl = path.join(__dirname, 'projects');\n \n dialog.showOpenDialog({\n defaultPath: projectsUrl,\n properties:[\"openDirectory\"]\n \n }).then(result => {\n let paths = result.filePaths;\n var justName = paths[0].substring(paths[0].lastIndexOf('\\\\')+1);\n currentProjectTitle = justName;\n if(paths.length == 0 || !projectFolderisValid(paths[0])){\n ShowError(\"project files at '\"+paths[0]+\"' are invalid, try restarting the program\");\n return;}\n getJson(justName).then(result => {\n result.title = justName;\n startWindow.webContents.send('project:open', [justName, result]);\n InteractLastProject(false, result.title);\n })\n }).catch(err => {\n console.log(\"promise was rejected, project will not be opened\");\n });\n\n /*fs.readdirSync(projectsUrl).forEach(file => {\n fileNames.push(file)\n });*/\n}", "title": "" }, { "docid": "2f51261abacdb260427dd7706a32d8fc", "score": "0.40710932", "text": "resolveActiveRootDirectory() {\r\n const projectPaths = atom.project.getPaths();\r\n let activeTextEditor = atom.workspace.getActiveTextEditor();\r\n let activeProject = null;\r\n\r\n if (_.isEmpty(projectPaths) || _.isEmpty(activeTextEditor))\r\n return null;\r\n\r\n activeTextEditor = activeTextEditor.buffer.file.path;\r\n\r\n projectPaths.forEach(p => {\r\n if (activeTextEditor.startsWith(p))\r\n activeProject = p;\r\n });\r\n\r\n return activeProject;\r\n }", "title": "" }, { "docid": "fec92f443c485abc58ee8ecc9e6ac015", "score": "0.40654472", "text": "function getRootDir(path) {\n if (path == null) {\n return null;\n }\n var index = path.indexOf(\"/\");\n return index == -1 ? null : path.substring(0, index);\n}", "title": "" }, { "docid": "5cc7f7c15f3a9e777e65fb9714153abf", "score": "0.40596998", "text": "function isAbsolutePath (path) {\n return path[0] === '/';\n}", "title": "" }, { "docid": "e426f1ab02dee79ff93c65224d1eec8f", "score": "0.40313172", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0, 1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n const rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "e426f1ab02dee79ff93c65224d1eec8f", "score": "0.40313172", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0, 1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n const rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "ef3a73547ee09aab03dfc3b0db8d0514", "score": "0.40205887", "text": "StartWorkspace(string, string, string, string, int, int) {\n\n }", "title": "" }, { "docid": "6e86562773b55e29c0380c100e75a3c7", "score": "0.40198278", "text": "function main(path){\n let directory = './'\n\n //If directory is specified when executing, the program will search that directory, else it will search the current working directory\n //(NOT NECESSARILY WHERE THE FILE RESIDES)\n if (path){\n directory = path\n }\n\n list = []\n\n //First check if the supplied directory (if any) is valid (exists & is a folder)\n if (fs.existsSync(directory) && fs.lstatSync(directory).isDirectory()){\n //Begin check\n return(todofinder(directory))\n } else {\n //Invalid directory. Supplied directory is either not a folder or doesnt exist\n return(directory + \" is not a valid directory\")\n }\n}", "title": "" }, { "docid": "54b895fea5863fc0e726755916234f4c", "score": "0.40153536", "text": "function assignmentValidatePath(idx, showAlert) {\n\tif (!assignments[idx].folder && !assignments[idx].path.trim()) {\n\t\tif (showAlert) alert(\"Path can't be empty for tasks.\");\n\t\treturn false;\n\t}\n\tcurrentPath = assignmentGetPath(idx);\n\t\n\tfor (var i=0; i<assignments.length; i++) {\n\t\tvar path = assignmentGetPath(i);\n\t\tif (i != idx && path != \"\" && path == currentPath) {\n\t\t\talert(\"Path \" + currentPath + \" is the same as \"+assignmentGetName(i));\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "d111d1e441c8e9382c43a40423c1aa0d", "score": "0.40126842", "text": "function verify_theme( themeNameOrPath ) {\n var tFolder = PATH.join(\n parsePath ( require.resolve('fresh-themes') ).dirname,\n '/themes/',\n themeNameOrPath\n );\n var exists = require('path-exists').sync;\n if( !exists( tFolder ) ) {\n tFolder = PATH.resolve( themeNameOrPath );\n if( !exists( tFolder ) ) {\n throw { fluenterror: 1, data: _opts.theme };\n }\n }\n return tFolder;\n }", "title": "" }, { "docid": "da0b65d5d0ae7adce7d69b11190991d8", "score": "0.40089568", "text": "getInputFolder(resourceType) {\n return this.folders[resourceType];\n }", "title": "" }, { "docid": "5766979768d80f126ac4a8b9c1f51398", "score": "0.40075785", "text": "function _schemeFix(scheme, _strict) {\n if (_strict || _throwOnMissingSchema) {\n return scheme || _empty;\n }\n if (!scheme) {\n // console.trace('BAD uri lacks scheme, falling back to file-scheme.');\n scheme = 'file';\n }\n return scheme;\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "c4804ad9196b3a5185c1057bf70d3a8e", "score": "0.4003482", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "5d09728c1ec6babecdccce319a1a0795", "score": "0.3999665", "text": "function defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0, 1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}", "title": "" }, { "docid": "fa94db872b4dde960aaafea91b766055", "score": "0.39935374", "text": "getTestPath(argv) {\n let testPath = undefined;\n if (argv.length >= 3 && fs.existsSync(argv[2])) {\n const isDirectory = fs.lstatSync(argv[2]).isDirectory();\n testPath = isDirectory ? argv[2] : path.dirname(argv[2]);\n }\n return testPath;\n }", "title": "" }, { "docid": "ad2b3bbb3e24b1fa5cd15d7312bd8ec1", "score": "0.3987337", "text": "IsWorkspaceCredentialSpecified(string, bool) {\n\n }", "title": "" }, { "docid": "b32ccffef0637e3b57cada38a8f3d932", "score": "0.39673248", "text": "function findShortestPath(x,y,dir)\n{\n tmp_path.push([x,y]);\n\n // If we're on the border. STOP'\n if (board.field[y][x] == POLY_TYPE_WHITESPACE || x == 0 || x == board.width-1 || y == 0 || y == board.height-1) {\n return tmp_path;\n } else {\n var surround = getSurroundingCoords(x,y);\n\n if (board.field[surround[dir][1]] != undefined && board.field[surround[dir][1]][surround[dir][0]] != undefined\n && board.field[surround[dir][1]][surround[dir][0]] == POLY_TYPE_EMPTY) {\n return findShortestPath(surround[dir][0], surround[dir][1], dir);\n } else {\n tmp_path = [];\n return tmp_path;\n }\n }\n}", "title": "" }, { "docid": "de483a4ca2e2b6c48ab247c9420731cc", "score": "0.39666533", "text": "function getPositionalPathType(self, path) {\n const subpaths = path.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);\n if (subpaths.length < 2) {\n return self.paths.hasOwnProperty(subpaths[0]) ?\n self.paths[subpaths[0]] :\n 'adhocOrUndefined';\n }\n\n let val = self.path(subpaths[0]);\n let isNested = false;\n if (!val) {\n return 'adhocOrUndefined';\n }\n\n const last = subpaths.length - 1;\n\n for (let i = 1; i < subpaths.length; ++i) {\n isNested = false;\n const subpath = subpaths[i];\n\n if (i === last && val && !/\\D/.test(subpath)) {\n if (val.$isMongooseDocumentArray) {\n val = val.$embeddedSchemaType;\n } else if (val instanceof MongooseTypes.Array) {\n // StringSchema, NumberSchema, etc\n val = val.caster;\n } else {\n val = undefined;\n }\n break;\n }\n\n // ignore if its just a position segment: path.0.subpath\n if (!/\\D/.test(subpath)) {\n // Nested array\n if (val instanceof MongooseTypes.Array && i !== last) {\n val = val.caster;\n }\n continue;\n }\n\n if (!(val && val.schema)) {\n val = undefined;\n break;\n }\n\n const type = val.schema.pathType(subpath);\n isNested = (type === 'nested');\n val = val.schema.path(subpath);\n }\n\n self.subpaths[path] = val;\n if (val) {\n return 'real';\n }\n if (isNested) {\n return 'nested';\n }\n return 'adhocOrUndefined';\n}", "title": "" }, { "docid": "70914d1143483b60d9790008ab407c8a", "score": "0.39608955", "text": "findToolWithDefaultStrategy (name, options = {}) {\n if (isFalsy(name) || name.constructor !== String || name.trim() === '') {\n return Promise.resolve(false)\n }\n\n // Default Strategy Is: Look For The Tool In GOPATH, Then Look In PATH\n return Promise.resolve().then(() => {\n return this.findToolInDelimitedEnvironmentVariable(name, 'GOPATH', options)\n }).then((tool) => {\n if (isTruthy(tool)) {\n return tool\n }\n return this.findToolInDelimitedEnvironmentVariable(name, this.pathKey, options)\n })\n }", "title": "" }, { "docid": "f6304e46c40f96b15d939cf78357ce8e", "score": "0.3954373", "text": "defaultFolder(folder){\n if (!fs.existsSync(folder)){\n shell.mkdir('-p', folder)\n }\n }", "title": "" }, { "docid": "f268737e8d6f4fddd9a6edbb02b6f7a3", "score": "0.3948693", "text": "function getFilePath(outputFile) {\n if (outputFile) {\n if (outputFile.match(\"^/\") === \"/\") {\n return outputFile;\n } else {\n return path.join(cwd, \"/\", outputFile);\n }\n }\n return null;\n}", "title": "" }, { "docid": "ff4929bfb8bc2447d0a2895ffdabaf52", "score": "0.39483333", "text": "function getPositionalPathType(self, path) {\n const subpaths = path.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);\n if (subpaths.length < 2) {\n return self.paths.hasOwnProperty(subpaths[0]) ?\n self.paths[subpaths[0]] :\n 'adhocOrUndefined';\n }\n\n let val = self.path(subpaths[0]);\n let isNested = false;\n if (!val) {\n return 'adhocOrUndefined';\n }\n\n const last = subpaths.length - 1;\n\n for (let i = 1; i < subpaths.length; ++i) {\n isNested = false;\n const subpath = subpaths[i];\n\n if (i === last && val && !/\\D/.test(subpath)) {\n if (val.$isMongooseDocumentArray) {\n const oldVal = val;\n val = new SchemaType(subpath, {\n required: get(val, 'schemaOptions.required', false)\n });\n val.cast = function(value, doc, init) {\n return oldVal.cast(value, doc, init)[0];\n };\n val.$isMongooseDocumentArrayElement = true;\n val.caster = oldVal.caster;\n val.schema = oldVal.schema;\n } else if (val instanceof MongooseTypes.Array) {\n // StringSchema, NumberSchema, etc\n val = val.caster;\n } else {\n val = undefined;\n }\n break;\n }\n\n // ignore if its just a position segment: path.0.subpath\n if (!/\\D/.test(subpath)) {\n // Nested array\n if (val instanceof MongooseTypes.Array && i !== last) {\n val = val.caster;\n }\n continue;\n }\n\n if (!(val && val.schema)) {\n val = undefined;\n break;\n }\n\n const type = val.schema.pathType(subpath);\n isNested = (type === 'nested');\n val = val.schema.path(subpath);\n }\n\n self.subpaths[path] = val;\n if (val) {\n return 'real';\n }\n if (isNested) {\n return 'nested';\n }\n return 'adhocOrUndefined';\n}", "title": "" }, { "docid": "e28d8cf3808973f4c3b2cdd1adf48286", "score": "0.39479965", "text": "function getCdPath(appName, appPath, originalDirectory) {\n return path.join(originalDirectory, appName) === appPath ? appName : appPath\n}", "title": "" }, { "docid": "3105a9c3286b4dae4190789cb0ee62c9", "score": "0.39445597", "text": "function absolutePath( inputPath ){\n return /^\\//.test(inputPath) ? inputPath : path.join(process.cwd(), inputPath)\n}", "title": "" }, { "docid": "2d01740003d71dcd608f528a62285dc7", "score": "0.39387545", "text": "function getCategory() {\n var urlCategory = prompt(\"Enter Category: team, teams, or event\");\n if (urlCategory != \"\") { //This statement causes the function to return a null value if there is no input from the user\n return \"/\" + urlCategory\n } else {\n return \"\"\n }\n }", "title": "" }, { "docid": "ab6f33c35f779d11fdd513706433e1e4", "score": "0.39252532", "text": "function getInputFilename(pathname) {\n var pos = pathname.lastIndexOf('/');\n if (pos == -1)\n pos = pathname.lastIndexOf('\\\\');\n if (pos != -1)\n return pathname.substring(pos+1);\n else\n return pathname;\n }", "title": "" }, { "docid": "9ba4f7a667476087385e0198eb51eb88", "score": "0.3924506", "text": "async path_for_write(prompt, defaultFile) {\n if (prompt) {\n console.log(prompt);\n }\n\n while (true) { // keep going until a valid path is found\n // get the path\n let path = await this.question(`[${defaultFile}] `);\n if (path === '') {\n path = defaultFile;\n }\n\n try { // exclusive write to see if the file exists\n const fd = openSync(path, 'wx');\n closeSync(fd); // path is writable, all is well\n return path;\n } catch (err) {\n if (err.code === 'EEXIST') { // file exists, prompt user\n if (await this.one_of(\n 'Overwrite this file?', ['yes', 'no'], 'no') ===\n 'no') {\n continue; // user requested not to overwrite\n } else {\n try { // verify that file is otherwise writable\n const fd = openSync(path, 'w');\n closeSync(fd); // path is writable, all is well\n return path;\n } catch {\n // some other kind of error: try again\n }\n }\n }\n }\n console.log('Error: can not write to this file.');\n }\n }", "title": "" }, { "docid": "385f2d1e2864f187e10d33957d74c329", "score": "0.39191478", "text": "function workspaceOption(workspace, i) {\n return {\n value: i.toString(),\n name: workspace.name,\n description: workspace.description\n };\n}", "title": "" }, { "docid": "13159a1b37671e6c6ab1a848596abdc5", "score": "0.39168537", "text": "inferLocalPathFromRemotePath(remotePath) {\n if (this.remoteToLocalPathMapping.has(remotePath)) {\n return this.remoteToLocalPathMapping.get(remotePath);\n }\n const convertedLocalPackageFile = this.inferLocalPathFromRemoteGoPackage(remotePath);\n if (convertedLocalPackageFile) {\n this.remoteToLocalPathMapping.set(remotePath, convertedLocalPackageFile);\n return convertedLocalPackageFile;\n }\n // If we cannot find the path in packages, most likely it will be in the current directory.\n const fileName = getBaseName(remotePath);\n const globSync = glob.sync(fileName, {\n matchBase: true,\n cwd: this.delve.program\n });\n const bestMatchingLocalPath = this.findPathWithBestMatchingSuffix(remotePath, globSync);\n if (bestMatchingLocalPath) {\n const fullLocalPath = path.join(this.delve.program, bestMatchingLocalPath);\n this.remoteToLocalPathMapping.set(remotePath, fullLocalPath);\n return fullLocalPath;\n }\n }", "title": "" }, { "docid": "1f47b8f6bb41225df03d873b12385a6e", "score": "0.39113718", "text": "function getCurrentShellPath(changelist) {\n if (currentShellPath !== null) {\n return currentShellPath;\n } else {\n var found = null;\n if (isMac()) {\n var shellApp = findFiles(path.join(config.BUILD_TEST_DIR, changelist.toString()), /^wakanda$/);\n if (shellApp && shellApp.length === 1) {\n found = shellApp[0];\n }\n } else if (isLinux()) {\n var shellApp = findFiles(path.join(config.BUILD_TEST_DIR, changelist.toString()), /^wakanda$/);\n if (shellApp && shellApp.length === 1) {\n found = shellApp[0];\n }\n }\n if (found !== null) {\n return found;\n }\n return config.WAKANDA_SHELL_PATH;\n }\n}", "title": "" }, { "docid": "d833cea029283388b8197dae10654fe5", "score": "0.3910835", "text": "function find_path(path) {\n gdir.forEach(it =>{\n if (it.path == path) return it;\n })\n}", "title": "" }, { "docid": "e0e5c983e33513db053f8385dbfd1fc9", "score": "0.39087933", "text": "function search_paths(thing_to_find, explicit_path, env_name)\n{\n\tvar i, found = false, place = false, file, env;\n\n\tSTDOUT.Write(\"Checking for \" + thing_to_find + \" ... \");\n\n\tthing_to_find = thing_to_find.replace(new RegExp(\"/\", \"g\"), \"\\\\\");\n\n\tif (explicit_path != null) {\n\t\tif (typeof(explicit_path) == \"string\") {\n\t\t\texplicit_path = explicit_path.split(\";\");\n\t\t}\n\n\t\tfor (i = 0; i < explicit_path.length; i++) {\n\t\t\tfile = glob(explicit_path[i] + \"\\\\\" + thing_to_find);\n\t\t\tif (file) {\n\t\t\t\tfound = true;\n\t\t\t\tplace = file[0];\n\t\t\t\tplace = place.substr(0, place.length - thing_to_find.length - 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!found && env_name != null) {\n\t\tenv = WshShell.Environment(\"Process\").Item(env_name);\n\t\tenv = env.split(\";\");\n\t\tfor (i = 0; i < env.length; i++) {\n\t\t\tfile = glob(env[i] + \"\\\\\" + thing_to_find);\n\t\t\tif (file) {\n\t\t\t\tfound = true;\n\t\t\t\tplace = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (found && place == true) {\n\t\tSTDOUT.WriteLine(\" <in default path>\");\n\t} else if (found) {\n\t\tSTDOUT.WriteLine(\" \" + place);\n\t} else {\n\t\tSTDOUT.WriteLine(\" <not found>\");\n\t}\n\treturn place;\n}", "title": "" }, { "docid": "27f47ee97c785593992039d4c39fab34", "score": "0.38999453", "text": "function getWorkspaceParentDir() {\n return external_path_.dirname(getWorkspaceDir());\n}", "title": "" }, { "docid": "8e643251182a95623724e8987d1d4daf", "score": "0.38967398", "text": "static getWorkingDir (opts) {\n const workingDir = options.getRelevantOption(opts, \"workingDir\") || process.cwd();\n\n return workingDir + path.sep;\n }", "title": "" }, { "docid": "cddaa05719808bd1141112e26be5d60c", "score": "0.38915917", "text": "function isFolder(path) {\n return path.substr(-1) === '/';\n }", "title": "" }, { "docid": "1cc318413a9a1b31e247ebc2f91b1a3c", "score": "0.38884237", "text": "buildPath({ resource, type, extra}) {\n if (_.isString(type)) return type\n if (resource && _.isFunction(resource.constructor.path)) {\n return resource.constructor.path(extra)\n }\n if (!type) return this.inferType(resource)\n if (_.isFunction(type.path)) return type.path(extra)\n if (this.models.includes(type)) return this.inferType(new type())\n return ''\n }", "title": "" }, { "docid": "f139f191207ad12f4485f9f8f00ef1b9", "score": "0.38855103", "text": "function isLocalPath(source) {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}", "title": "" }, { "docid": "7748d574baaddc622ee76f89dfb84b4a", "score": "0.3871769", "text": "function tryFile(requestPath, isMain) {\r\n // console.log(requestPath, isMain);\r\n return requestPath;\r\n var rc = stat(requestPath);\r\n // console.log('rc', rc);\r\n if(rc) return requestPath;\r\n else return false;\r\n // console.log(rc);\r\n // if (preserveSymlinks && !isMain) {\r\n // return rc === 0 && path.resolve(requestPath);\r\n // }\r\n // return rc === 0 && fs.realpathSync(requestPath);\r\n}", "title": "" }, { "docid": "f234c74da17f788c94e2108de08c07d6", "score": "0.38618585", "text": "_resolveFileSpecifier(specifier, containingFilePath) {\n const importFullPath = containingFilePath !== undefined ? path.join(path.dirname(containingFilePath), specifier) : specifier;\n const stat = getFileStatus(importFullPath);\n if (stat && stat.isFile()) {\n return importFullPath;\n }\n for (const extension of this.extensions) {\n const pathWithExtension = `${importFullPath}.${extension}`;\n const stat = getFileStatus(pathWithExtension);\n if (stat && stat.isFile()) {\n return pathWithExtension;\n }\n }\n // Directories should be considered last. TypeScript first looks for source files, then\n // falls back to directories if no file with appropriate extension could be found.\n if (stat && stat.isDirectory()) {\n return this._resolveFileSpecifier(path.join(importFullPath, 'index'));\n }\n return null;\n }", "title": "" }, { "docid": "b683361a5cb1ed146a86af7866b3ed85", "score": "0.38600048", "text": "file () {\n try {\n const file = this.currentFile()\n\n if (!file) throw createError({ code: 'ENOENT', message: 'No file selected' })\n return file\n } catch (e) {\n throw new Error(e)\n }\n }", "title": "" }, { "docid": "75521d8d91b7669489bfd482e2dbd6e2", "score": "0.38599336", "text": "function getLanguageServerToolPath() {\n const goConfig = config_1.getGoConfig();\n // Check that all workspace folders are configured with the same GOPATH.\n if (!allFoldersHaveSameGopath()) {\n vscode.window.showInformationMessage('The Go language server is currently not supported in a multi-root set-up with different GOPATHs.');\n return;\n }\n // Get the path to gopls (getBinPath checks for alternate tools).\n const goplsBinaryPath = util_1.getBinPath('gopls');\n if (path.isAbsolute(goplsBinaryPath)) {\n return goplsBinaryPath;\n }\n const alternateTools = goConfig['alternateTools'];\n if (alternateTools) {\n // The user's alternate language server was not found.\n const goplsAlternate = alternateTools['gopls'];\n if (goplsAlternate) {\n vscode.window.showErrorMessage(`Cannot find the alternate tool ${goplsAlternate} configured for gopls.\nPlease install it and reload this VS Code window.`);\n return;\n }\n // Check if the user has the deprecated \"go-langserver\" setting.\n // Suggest deleting it if the alternate tool is gopls.\n if (alternateTools['go-langserver']) {\n vscode.window.showErrorMessage(`Support for \"go-langserver\" has been deprecated.\nThe recommended language server is gopls. Delete the alternate tool setting for \"go-langserver\" to use gopls, or change \"go-langserver\" to \"gopls\" in your settings.json and reload the VS Code window.`);\n return;\n }\n }\n // Prompt the user to install gopls.\n goInstallTools_1.promptForMissingTool('gopls');\n}", "title": "" }, { "docid": "84b14530388bdd08088b09a702a133f5", "score": "0.3854998", "text": "function getFilePath(outputFile) {\n\tif (outputFile) {\n\t\tif (outputFile.match(\"^/\") == \"/\") {\n\t\t\treturn outputFile;\n\t\t} else {\n\t\t\treturn path.join(cwd, \"/\", outputFile);\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "128fb824f52902a66c8f53076c39b2c8", "score": "0.38545218", "text": "function getSchemaDirSync(schemaPathFromArgs) {\n if (schemaPathFromArgs) {\n return path_1.default.resolve(path_1.default.dirname(schemaPathFromArgs));\n }\n const schemaPath = getSchemaPathSync(schemaPathFromArgs);\n if (schemaPath) {\n return path_1.default.dirname(schemaPath);\n }\n return null;\n}", "title": "" }, { "docid": "62f27149f99cb186426beb2398b9cccc", "score": "0.38526654", "text": "function path(input) {\n if(input == null) return input\n let returnObj = {}\n\n returnObj.root = input.startsWith('/') ? '/' : ''\n\n let dirs = input.split('/')\n returnObj.base = dirs.pop()\n returnObj.dir = dirs.join('/')\n\n let file = returnObj.base.split('.')\n returnObj.ext = '.' + file.pop()\n returnObj.name = file.shift()\n\n return returnObj\n}", "title": "" }, { "docid": "1d9e40de65154455a3ae702cec1302c4", "score": "0.38481942", "text": "validateOriginPath(originPath) {\n if (core_1.Token.isUnresolved(originPath)) {\n return originPath;\n }\n if (originPath === undefined) {\n return undefined;\n }\n let path = originPath;\n if (!path.startsWith('/')) {\n path = '/' + path;\n }\n if (path.endsWith('/')) {\n path = path.slice(0, -1);\n }\n return path;\n }", "title": "" }, { "docid": "6d46099911d1d1204f01865751f06fef", "score": "0.38397756", "text": "async loadPreviousSelectedCurrentProject() {\n\t\tlet project = studio.settings.loadValue('projects', 'currentProject', null);\n\t\tlet file = studio.settings.loadValue('projects', 'currentFile', null);\n\n\t\tif (project !== null) {\n\t\t\tif(await studio.filesystem.pathExists(project.folder)) {\n\t\t\t\tif(await this.selectCurrentProject(project, false)) {\n\t\t\t\t\tif (file !== null) {\n\t\t\t\t\t\tawait this.changeFile(project,file);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tstudio.workspace.showDialog(ProjectsLibrary, {width: 1000});\n\t\t\t}\t\t\t\n\t\t} else if(!studio.settings.loadValue('firstrun', 'firstRun', true)) {\n\t\t\tstudio.workspace.showDialog(ProjectsLibrary, {width: 1000});\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "ff70e90a059f1811c32f18179ecf1d1e", "score": "0.38360858", "text": "function getStylesPath(project) {\n const buildTarget = project.architect['build'];\n if (buildTarget.options && buildTarget.options.styles && buildTarget.options.styles.length) {\n const styles = buildTarget.options.styles.map(s => typeof s === 'string' ? s : s.input);\n // First, see if any of the assets is called \"styles.(le|sc|c)ss\", which is the default\n // \"main\" style sheet.\n const defaultMainStylePath = styles.find(a => /styles\\.(c|le|sc)ss/.test(a));\n if (defaultMainStylePath) {\n return core_1.normalize(defaultMainStylePath);\n }\n // If there was no obvious default file, use the first style asset.\n const fallbackStylePath = styles.find(a => /\\.(c|le|sc)ss/.test(a));\n if (fallbackStylePath) {\n return core_1.normalize(fallbackStylePath);\n }\n }\n throw new schematics_1.SchematicsException('No style files could be found into which a theme could be added');\n}", "title": "" } ]
65270b575efda62a681e18373e7feb1b
END valIndRep This is used in valIndRep to compare the paths of the expression, and the path of the referenced field, to check if indexedrepeat() is needed. Returns TRUE if indexedrepeat is needed, and FALSE if it NOT needed. Essentially, returns TRUE if they do NOT match up / If each part of the referenced path equals the current path until the end of current path, then it is all set, since if the current path is in a deeper nested repeat than the referenced path, that is fine. This is based on another function I made, arraysEqual
[ { "docid": "d7aa3b0bb241df2ba134a4447b59aa0c", "score": "0.8480273", "text": "function needIndRep(curPath, refPath){\n try{\n if(curPath == refPath){ //Both are aleady equal (usually if they are null)\n return false;\n }\n \n if(!Array.isArray(curPath) || !Array.isArray(refPath)){ //One is not an array. This should never happen in this context\n return true;\n }\n \n for(var a = 0; a < refPath.length; a++){\n if(curPath[a] != refPath[a]){\n return true;\n }\n } //End FOR loop\n }\n catch(e){\n breakerError(\"Error checking if an indexed-repeat() expression is needed.\",e);\n }\n \n return false;\n} //END needIndRep", "title": "" } ]
[ { "docid": "38fa5477a4bf11284c6679a68b113cfa", "score": "0.6103034", "text": "isRepeatable(): boolean {\n return this.expression.isRepeatable() && this.indexingExpr.isRepeatable();\n }", "title": "" }, { "docid": "4ebbdf7262cca17b1f92f80963da3e80", "score": "0.56316835", "text": "function nestedArrEqual(a1, a2) {\n if (a1.length != a2.length) {\n return false;\n } else {\n for (var i = 0; i < a1.length; i++) { if (!arrEqual(a1[i], a2[i])) { return false; } }\n }\n return true;\n}", "title": "" }, { "docid": "8c8e205ef9a783d9bc6ea28525149e3c", "score": "0.53953475", "text": "function deepEqual(valOne, valTwo) {\n let valuesEqual = true;\n\n if ((typeof valOne === 'object' && typeof valTwo === 'object') &&\n (valOne != null && valTwo != null)) {\n for (const i in valOne) {\n if (valOne.hasOwnProperty(i)) {\n if (valTwo.hasOwnProperty(i)) {\n valuesEqual = deepEqual(valOne[i], valTwo[i]);\n if (!valuesEqual) {\n return false;\n }\n }\n }\n }\n } else {\n if (valOne != valTwo) {\n valuesEqual = false;\n }\n }\n return valuesEqual;\n}", "title": "" }, { "docid": "d76757ddd418731cfb1b564a6295cba2", "score": "0.5395273", "text": "function areRxDocumentArraysEqual(primaryPath, ar1, ar2) {\n if (ar1.length !== ar2.length) {\n return false;\n }\n var i = 0;\n var len = ar1.length;\n while (i < len) {\n var row1 = ar1[i];\n var row2 = ar2[i];\n i++;\n if (row1._rev !== row2._rev || row1[primaryPath] !== row2[primaryPath]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "744e1ca3a039a5f2e7653b4e2b5d8bb0", "score": "0.53895134", "text": "function compareArrays(requestedFields, curPath){\n\n var pathObjectNames = [];\n var requestObjectNames = [];\n var curName, requestObjectNamesLen, counter;\n var equal = 1;\n //return object that holds count of similar objects and whether the two arrays hold the same object names\n var verdict = {\n bool: true,\n count: 0\n };\n \n //\n //remove '..._fieldName' names to just get object names from request\n for(var i = 0; i < requestedFields.length; i++){\n curName = requestedFields[i];\n //special cases with multiple '_'\n if(checkFor_Object(curName)){ \n //find 3rd instance of _ to remove trailing attribute name\n if(findXInstanceOfY(curName, '_', 3) >= 0){\n requestObjectNames.push(curName.substring(0, findXInstanceOfY(curName, '_', 3)));\n }\n }\n else{\n requestObjectNames.push(curName.substring(0, curName.indexOf('_'))); \n }\n }\n requestObjectNamesLen = requestObjectNames.length;\n \n //get object names from path for readability\n for(var names in curPath){\n pathObjectNames.push(curPath[names].name);\n }\n \n //check if arrays contain the same objects\n //if not set a flag to return they are not equal.\n //Hold count of similar objects so if a path isnt found\n //the path with the most objects in common can be created instead\n for(var i = 0; i < requestObjectNamesLen; i++){\n if(pathObjectNames.indexOf(requestObjectNames[i]) === -1){\n verdict.bool = false\n }\n else{\n verdict.count = verdict.count+1\n }\n }\n \n //check how many objects are in \n return verdict\n}", "title": "" }, { "docid": "f03d0d8cbf8ff37e358bd292ccb123d6", "score": "0.5239231", "text": "function equal_r(o1, o2) {\n if (!is_mergeable(o1) || !is_mergeable(o2) || (o1 === o2)) {\n return o1 === o2\n }\n //\n var call_stack = [],\n src_stack = [],\n cur_o1 = o1,\n cur_o2 = o2,\n cur_keys = keys(cur_o1),\n cur_key_idx = cur_keys.length\n //\n if ( !equal_array_str(cur_keys, keys(cur_o2)) ) {\n return false\n }\n //\n while (--cur_key_idx > -1) {\n var key = cur_keys[cur_key_idx],\n val_o1 = cur_o1[key],\n val_o2 = cur_o2[key]\n //\n if (!hasOwnProperty.call(cur_o2, key)) {\n return false\n }\n else if (not_mergeable(val_o1) && (val_o1 !== val_o2)) {\n return false\n }\n else if (index_of(val_o1, src_stack) === -1) {\n call_stack.push([cur_o1, cur_o2, cur_keys, cur_key_idx])\n src_stack.push(val_o1)\n //\n cur_o1 = val_o1\n cur_o2 = val_o2\n cur_keys = keys(cur_o1)\n cur_key_idx = cur_o1.length\n //\n if (!equal_array_str(cur_keys, keys(cur_o2))) {\n return false\n }\n }\n //\n while ((0 === cur_key_idx) && (0 !== call_stack.length)) {\n var call_data = call_stack.pop()\n cur_o1 = call_data[0]\n cur_o2 = call_data[1]\n cur_keys = call_data[2]\n cur_key_idx = call_data[3]\n }\n }\n //\n return true\n }", "title": "" }, { "docid": "cf5d98a94247cada2bfc5e5f4627f3cc", "score": "0.5219217", "text": "function deepArrayEqual(first, second) {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n // Compare the values for equality.\n for (var i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n // At this point, the arrays are equal.\n return true;\n }", "title": "" }, { "docid": "bbd670fffcd4f7a9a44907d65db22f46", "score": "0.52092165", "text": "function deepArrayEqual(first, second) {\r\n // Check referential equality first.\r\n if (first === second) {\r\n return true;\r\n }\r\n // Test the arrays for equal length.\r\n if (first.length !== second.length) {\r\n return false;\r\n }\r\n // Compare the values for equality.\r\n for (var i = 0, n = first.length; i < n; ++i) {\r\n if (!deepEqual(first[i], second[i])) {\r\n return false;\r\n }\r\n }\r\n // At this point, the arrays are equal.\r\n return true;\r\n }", "title": "" }, { "docid": "bbd670fffcd4f7a9a44907d65db22f46", "score": "0.52092165", "text": "function deepArrayEqual(first, second) {\r\n // Check referential equality first.\r\n if (first === second) {\r\n return true;\r\n }\r\n // Test the arrays for equal length.\r\n if (first.length !== second.length) {\r\n return false;\r\n }\r\n // Compare the values for equality.\r\n for (var i = 0, n = first.length; i < n; ++i) {\r\n if (!deepEqual(first[i], second[i])) {\r\n return false;\r\n }\r\n }\r\n // At this point, the arrays are equal.\r\n return true;\r\n }", "title": "" }, { "docid": "bbd670fffcd4f7a9a44907d65db22f46", "score": "0.52092165", "text": "function deepArrayEqual(first, second) {\r\n // Check referential equality first.\r\n if (first === second) {\r\n return true;\r\n }\r\n // Test the arrays for equal length.\r\n if (first.length !== second.length) {\r\n return false;\r\n }\r\n // Compare the values for equality.\r\n for (var i = 0, n = first.length; i < n; ++i) {\r\n if (!deepEqual(first[i], second[i])) {\r\n return false;\r\n }\r\n }\r\n // At this point, the arrays are equal.\r\n return true;\r\n }", "title": "" }, { "docid": "733801cf1ea6c40c8947f4886162c47a", "score": "0.520646", "text": "isRepeatable(): boolean {\n return this.expression.isRepeatable();\n }", "title": "" }, { "docid": "db3c4bf37468f914dc0ca03be0d0c164", "score": "0.520325", "text": "function deepEquals(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length != b.length)\n return false;\n for (var i = 0; i < a.length; i++) {\n if (!deepEquals(a[i], b[i]))\n return false;\n }\n return true;\n } else {\n return a == b;\n }\n}", "title": "" }, { "docid": "66f4e7813a7042e497fd346525488d4c", "score": "0.5202464", "text": "function matchesPattern(cleanedNode, patternNode, unknownArr) {\n patpad = buildPath(patternNode);\n bigpad = buildPath(cleanedNode);\n\n // console.log(\"patpad \");\n // console.log(patpad);\n // console.log(\"bigpad \");\n // console.log(bigpad);\n\n // placeholders = ['a','b','c','d','x','y','z'];\n checker = {};\n var match = true;\n for (var place in patpad) {\n currentplaceholder = patpad[place];\n match =\n match &&\n (patpad[place] == bigpad[place] ||\n unknownArr.includes(currentplaceholder));\n if (unknownArr.includes(currentplaceholder)) {\n if (bigpad[place] == undefined) {\n // console.log(\"adres bestaat niet in cleanednode \");\n return false;\n } else {\n // console.log(\"place \" + place);\n adres = place.split(\",\");\n subexp = readAtAdress(adres, cleanedNode);\n // console.log(\"subexp = \" + subexp.toString());\n checker[currentplaceholder]\n ? (match = match && checker[currentplaceholder].equals(subexp))\n : (checker[currentplaceholder] = subexp);\n\n // weggecommente poging om overmatching te vermijden werkt niet... geen idee waarom\n // keys(bigpad).forEach( key => {if (key.includes(place)) { bigpad[key]}});\n\n }\n }\n\n console.log(\"place match =\" + match);\n \n \n }\n // rest = Object.keys(bigpad).length\n // console.log('rest = ' + rest );\n console.log(\"pattern match =\" + match);\n // return match && rest==0;\n return match;\n}", "title": "" }, { "docid": "607d8a66a6627eda34b462830f672abc", "score": "0.519824", "text": "function recursivelyCheckEqual(x, ...rest) {\n return (\n Object.is(x, rest[0]) && (rest.length < 2 || recursivelyCheckEqual(...rest))\n );\n}", "title": "" }, { "docid": "aba09a1cf3e0b8a917e18a204b078406", "score": "0.5171795", "text": "function deepEquals(arr1, arr2) {\n\tif (!Array.isArray(arr1)) {\n\t\treturn canonicalForm(arr1) === canonicalForm(arr2);\n\t}\n\tconst length = arr1.length;\n\tif (!Array.isArray(arr2) || arr2.length !== length) {\n\t\treturn false;\n\t}\n\tfor (let i = 0; i < length; i++) {\n\t\tconst value1 = arr1[i];\n\t\tconst value2 = arr2[i];\n\t\tif (Array.isArray(value1)) {\n\t\t\tif (!deepEquals(value1, value2)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (canonicalForm(value1) !== canonicalForm(value2)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "c2a597d180ea5619fafc11636c9bf13b", "score": "0.51681685", "text": "isChained(x, y) {\n var value = this.grid.getAt(x, y).id;\n\n if (value == 0) return false;\n\n return this.grid.getAt(x - 1, y ) == value && this.grid.getAt(x - 2, y ) == value ||\n this.grid.getAt(x + 1, y ) == value && this.grid.getAt(x + 2, y ) == value ||\n this.grid.getAt(x - 1, y ) == value && this.grid.getAt(x + 1, y ) == value ||\n this.grid.getAt( x , y - 1) == value && this.grid.getAt( x , y - 2) == value ||\n this.grid.getAt( x , y + 1) == value && this.grid.getAt( x , y + 2) == value ||\n this.grid.getAt( x , y - 1) == value && this.grid.getAt( x , y + 1) == value;\n }", "title": "" }, { "docid": "8dae9b4cae27525af22bd94602394412", "score": "0.51551944", "text": "function eqPrefixes(p1, p2) {\n if (p1.length != p2.length) { return false; }\n for (let i = 0; i < p1.length; i++) {\n if (p1[i].constructor != p2[i].constructor) { return false; }\n if (p1[i] instanceof End) {\n return p1[i].p == p2[i].p && p1[i].e.equals(p2[i].e);\n }\n if (p1[i] instanceof Group) {\n return p1[i].d == p2[i].d && eqPrefixes(p1[i].gs, p2[i].gs);\n }\n }\n}", "title": "" }, { "docid": "13334c0de9d8291ce74a4a606c90e415", "score": "0.51538056", "text": "function deepEquals(arrayA, arrayB) {\n return arrayA.length === arrayB.length && arrayA.every((element, index) => arrayB[index] === element);\n}", "title": "" }, { "docid": "1865f0bd2a1d4d8fbf94860a0144be83", "score": "0.51521885", "text": "function deepEquals(arrayA, arrayB) {\n return arrayA.length === arrayB.length && arrayA.every((element, index) => arrayB[index] === element);\n}", "title": "" }, { "docid": "ea99389f2b98467b053e147936764051", "score": "0.51467645", "text": "hasEqualSource(path) {\n return (\n JSON.stringify(this.node, jsonSkipLoc) ===\n JSON.stringify(path.node, jsonSkipLoc)\n );\n }", "title": "" }, { "docid": "828134f1856d23bf95020e742a4f21d8", "score": "0.51150405", "text": "function check_arange_eq(arange, startTS, endTS, highestModseq, updated) {\n do_check_eq(arange.startTS, startTS);\n do_check_eq(arange.endTS, endTS);\n do_check_eq(arange.fullSync.highestModseq, highestModseq);\n do_check_eq(arange.fullSync.updated, updated);\n}", "title": "" }, { "docid": "1353d7e64d109af8a420fd5f74730685", "score": "0.51063293", "text": "function deepCheckFields(curIndex) {\n var thisField;\n return safeCall(function() {\n thisField = that.fields[curIndex];\n var thisChecker = that.anns[thisField];\n return thisChecker.check(that.locs[curIndex], getColonField(val, thisField));\n }, function(result) {\n if(thisRuntime.ffi.isOk(result)) {\n if(curIndex === that.locs.length - 1) { return thisRuntime.ffi.contractOk; }\n else { return deepCheckFields(curIndex + 1); }\n }\n else if(thisRuntime.ffi.isFail(result)) {\n return that.createRecordFailureError(compilerLoc, val, thisField, result);\n }\n },\n \"PRecordAnn:deepCheckFields\");\n }", "title": "" }, { "docid": "174ce1bd6cb477921817308b61ef1bbb", "score": "0.5099582", "text": "function getIndRepExpr(fieldRefName, refPath){\n try{\n var indRepExpr = \"indexed-repeat(${\" + fieldRefName + \"}\"; //Slowly builds into an example expression that the user can use.\n var refPathLength = refPath.length;\n for(var i = 0; i < refPathLength; i++){ //Start at 1, since the first part of the array is blank\n indRepExpr += \", ${\" + refPath[i] + \"}, ${index_field\" + (i + 1) + \"}\";\n }\n indRepExpr += \")\";\n \n return indRepExpr;\n }\n catch(e){\n breakerError(\"Error getting a sample indexed-repeat() expression\", e);\n return \"indexed-repeat(${fieldname}, ${groupname}, ${index})\";\n }\n} //END getIndRepExpr", "title": "" }, { "docid": "662ea25be2c8cb9f0fae69d4a80bf715", "score": "0.5083565", "text": "function compareSubPath (got, wanted, i, j, delta) {\n for (let k = 0; k !== wanted.length; ++k) {\n const commandNum = `path command #${i}${k}`;\n if (got[i + k].op.toUpperCase() !== wanted[j + k].op.toUpperCase()) {\n return {\n pass: false,\n message: `${commandNum} actual '${got[i + k].op.toUpperCase() \n }' != expected '${wanted[j + k].op.toUpperCase()}'`\n };\n }\n if (got[i + k].args.length !== wanted[j + k].args.length) {\n return {\n pass: false,\n message: `${commandNum} number of arguments ${ \n got[i + k].args.length} != expected ${wanted[j + k].args.length}`\n };\n }\n for (let h = 0; h < got[i + k].args.length; ++h) {\n const result = compareWithinDelta(got[i + k].args[h], wanted[j + k].args[h], delta);\n if (!result.pass) {\n result.message = `${commandNum}, element ${h}: ${result.message}`;\n return result;\n }\n }\n }\n return {pass: true};\n}", "title": "" }, { "docid": "50aa6532328db8ed620683c3ca33e0b7", "score": "0.5080498", "text": "function deepEquals (a, b) {\n\t\tif (a == b) {\n\t\t\treturn true;\n\t\t}\n\t\tif ((typeof a) !== 'object' || (typeof b) !== 'object' ||\n\t\t\t(a === null) || (b === null)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (a.constructor === Array) {\n\t\t\tif (b.constructor !== Array) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (a.length != b.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (var i = 0; i < a.length; i++) {\n\t\t\t\tif (i in a) {\n\t\t\t\t\tif (!(i in b) || !(deepEquals(a[i], b[i]))) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (i in b) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c99b5c84fb2fa20948a1f1be9cbb01c3", "score": "0.50624406", "text": "function deepEqual(val1, val2) {\n\tif(val1 === val2) {\n\t\treturn true\n\t}\n\tif(typeof(val1) === null) {\n\t\tif(typeof(val2) === null) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif(typeof(val1) === 'object' && typeof(val2) === 'object') {\n\t\tresult = true\n\t\tfor(var key in val1) {\n\t\t\tif(val1[key] == val2[key] && result || deepEqual(val1[key], val2[key])) {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\tresult = false\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ab0b935389f5fa577041773b582c9c4c", "score": "0.5025995", "text": "function deepCompare() {\n return JSON.stringify(shallowClone.array) === JSON.stringify(deepClone.array);\n}", "title": "" }, { "docid": "f4522019f141ad5f6580b0bcbd5db70c", "score": "0.50065553", "text": "function checkNextReel(path) {\n // This returns an array of arrays, each representing a path of matching symbols across reels\n // path is a list of reels/rows, where the index of each item is the reel and the value of the item is the row\n // This function then checks the next reel to see if any *connected* rows contain a matching icon.\n // All new paths, branching from arg path, are returned\n console.log(`checkNextReel(${path})`);\n // match is an array of rows, left to right, that all have same value\n // [0,1,0] means same value on reel0-row0, reel1-row1, reel2-row0\n const reel = path.length - 1;\n const row = path[path.length - 1];\n if (reel >= results.length) { return [path] };\n\n const iconToMatch = results[reel][row];\n const nextReel = results[reel + 1];\n let matchingPaths = [];\n // console.log(`iconToMatch: ${iconToMatch}`);\n // r2 is the row of nextReel\n let minRow = Math.max(row - 1, 0);\n let maxRow = Math.min(row + 1, rows - 1);\n // console.log(`rows ${minRow} to ${maxRow}`);\n\n for (let r2 = minRow; r2 <= maxRow; r2++) {\n // console.log(`__row ${r2}`);\n let icon2 = nextReel[r2];\n // console.log(`icon2(row ${r2}): ${icon2}`);\n if (icon2 === iconToMatch) {\n // console.log(`match!`);\n matchingPaths.push([...path, r2]);\n }\n // console.log(`r2: ${r2}, maxRow: ${maxRow}`);\n }\n\n return matchingPaths.length > 0 ? matchingPaths : [path];\n }", "title": "" }, { "docid": "422618687dc387fae5a7dad717ce5373", "score": "0.498963", "text": "function checkComplete() {\n size = this.Graph[0].length;\n if (!(size === this.Graph[1].length)) return false;\n for (i = 0; i < this.Graph[1].length; i++) {\n if (!(size === this.Graph[1][i].length - 1)) return false;\n for (j = 1; j < size + 1; j++) {\n if (!(this.Graph[1][i][j])) return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "6031836113446f5d29561ce68daa9116", "score": "0.49881434", "text": "tequals(otherMap) {\n let currNode = this.rootNode\n let otherNode = otherMap.rootNode\n\n while (Boolean(currNode)) {\n if (JSON.stringify(currNode.val) !== JSON.stringify(otherNode.val)) {\n return false\n }\n currNode = currNode.next\n otherNode = otherNode.next\n }\n if (currNode === otherNode) {\n return true\n }\n return false\n }", "title": "" }, { "docid": "c9378dfb7af988a7b7f9848e1aa75831", "score": "0.49615806", "text": "function hasSame(ds){\n let flag=false;\n for(let i=0; i<ds.length; i++){\n for(let j=0; j < ds[i].length; j++){\n if(ds[i-1] && ds[i-1][j] === ds[i][j]){\n flag = true;\n break;\n }\n if(ds[i][j-1] && ds[i][j-1] === ds[i][j]){\n flag = true;\n break;\n }\n if(ds[i+1] && ds[i+1][j] === ds[i][j]){\n flag = true;\n break;\n }\n if(ds[i][j+1] && ds[i][j+1] === ds[i][j]){\n flag = true;\n break;\n }\n }\n }\n return flag;\n}", "title": "" }, { "docid": "1adb32e14521584aa428316a136f3d29", "score": "0.49547234", "text": "function deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (typeof Buffer !== \"undefined\" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {\n if (actual.length !== expected.length) {\n return false;\n }\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) {\n return false;\n }\n }\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (isString(actual) && isString(expected) && actual !== expected) {\n return false;\n } else if (typeof actual !== 'object' && typeof expected !== 'object') {\n return actual === expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n }", "title": "" }, { "docid": "19de1d7bd5baa7afc4499779af24ed61", "score": "0.4947031", "text": "function deepEqual(a, b) {\n\t// FIXME expensive lazy way:\n\treturn JSON.stringify(a) == JSON.stringify(b);\n}", "title": "" }, { "docid": "3bc7568ecf622c7bf4045be846516294", "score": "0.49429125", "text": "arrayEquals(other){\n for (var col = 0; col < 4; col++){\n for (var row = 0; row < 4; row++){\n if((this.board[col][row] != null && other[col][row] == null) ||\n (this.board[col][row] == null && other[col][row] != null)){\n return false;\n }\n if(this.board[col][row] != null && other[col][row] != null){\n if(this.board[col][row].value != other[col][row].value) {\n return false;\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "930f9faf7748b9a6347c401f44b52453", "score": "0.4929454", "text": "function arrayEquals(array) {\n // if the other array is a falsy value, return\n if (!array) return false;\n\n // compare lengths - can save a lot of time\n if (this.length != array.length) return false;\n\n for (var i = 0, l = this.length; i < l; i++) {\n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array) {\n // recurse into the nested arrays\n if (!this[i].equals(array[i])) return false;\n } else if (this[i] != array[i]) {\n // Warning - two different object instances will never be\n // equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "249d917bfd0b8e9fab46b7549e98f2dd", "score": "0.49245083", "text": "function isEqualVaryings (arr1, arr2) {\r\n if (arr1 === null && arr2 === null) return true\r\n if (arr1 === null || arr2 === null) return false\r\n if (arr1.length !== arr2.length) return false\r\n let j = 0\r\n while (j < arr1.length) {\r\n if (arr1[j] !== arr2[j]) return false\r\n j += 1\r\n }\r\n return true\r\n}", "title": "" }, { "docid": "e929efbaa280439d2c547e79340d6ea2", "score": "0.4914004", "text": "function testEquality(context, equality, nodes, val, reverse) {\n var typeName = val.type.getTypeName();\n return !nodes.each(function() {\n if (!reverse && context.call(equality, context.call(typeName, xpath.core.newNodeSet(new NodeSet([this]))), val).value\n || reverse && context.call(equality, val, context.call(typeName, xpath.core.newNodeSet(new NodeSet([this])))).value)\n return false;\n });\n}", "title": "" }, { "docid": "7f3e6c390e44034c8b5810f6e261484e", "score": "0.4910191", "text": "function viewTargetsEqual(currViewTarget, nextViewTarget) {\n\n // Update if one is undefined and the other isn't\n if ((currViewTarget === undefined) !== (nextViewTarget === undefined)) {\n return false;\n }\n\n // Update if view target tracks are not equal\n if (Object.keys(currViewTarget.tracks).length !== Object.keys(nextViewTarget.tracks).length) {\n // Different lengths so not equal\n return false;\n }\n\n for (const key in currViewTarget.tracks) {\n const currTrack = currViewTarget.tracks[key];\n const nextTrack = nextViewTarget.tracks[key];\n\n // if the key doesn't exist in the other track\n if (!currTrack || !nextTrack) {\n return false;\n }\n\n if (!tracksEqual(currTrack, nextTrack)) {\n // Different tracks so not equal\n return false;\n }\n }\n\n if (currViewTarget.bedFile !== nextViewTarget.bedFile) {\n return false;\n }\n\n // Update if regions are not equal\n if (currViewTarget.region !== nextViewTarget.region) {\n return false;\n }\n\n return true;\n\n}", "title": "" }, { "docid": "94fca2cc72e9b414454156639346704a", "score": "0.490993", "text": "function eqArrays(array1, array2){ \n if (array1.length !== array2.length) {\n return false;\n } \n for (let i = 0; i < array1.length; i++) { //check item at same index if the same; not nested for loop, not need both 1 and 2\n if(array1[i] !== array2[i]) { //end condition is not equal\n return false; \n } \n } \n return true; //return boolean\n}", "title": "" }, { "docid": "4f80a67ebf849ccbda959bbc29b60dc3", "score": "0.49076512", "text": "function arraysEqual(ar1,ar2){var n=ar1.length;if(n!==ar2.length){return false;}for(var i=0;i<n;i++){if(ar1[i]!==ar2[i]){return false;}}return true;}// Find the first subtable of a lookup table in a particular format.", "title": "" }, { "docid": "bbabd9c192329c00eef5f70bce9a5505", "score": "0.49073687", "text": "function equal3(left, right, alwaysFlag, tol, rel, fromWithin) {\n if(tol === undefined) { // means that we aren't doing any kind of within\n var isIdentical = identical3(left, right);\n if (!thisRuntime.ffi.isNotEqual(isIdentical)) { return isIdentical; } // if Equal or Unknown...\n }\n\n var stackOfToCompare = [];\n var toCompare = { stack: [], curAns: thisRuntime.ffi.equal };\n var cache = {left: [], right: [], equal: []};\n function findPair(obj1, obj2) {\n for (var i = 0; i < cache.left.length; i++) {\n if (cache.left[i] === obj1 && cache.right[i] === obj2)\n return cache.equal[i];\n }\n return false;\n }\n function setCachePair(obj1, obj2, val) {\n for (var i = 0; i < cache.left.length; i++) {\n if (cache.left[i] === obj1 && cache.right[i] === obj2) {\n cache.equal[i] = val;\n return;\n }\n }\n// throw new Error(\"Internal error: tried to\n }\n function cachePair(obj1, obj2) {\n cache.left.push(obj1);\n cache.right.push(obj2);\n cache.equal.push(thisRuntime.ffi.equal);\n return cache.equal.length;\n }\n function equalHelp() {\n var current, curLeft, curRight;\n while (toCompare.stack.length > 0 && !thisRuntime.ffi.isNotEqual(toCompare.curAns)) {\n current = toCompare.stack.pop();\n if(current.setCache) {\n cache.equal[current.index - 1] = toCompare.curAns;\n continue;\n }\n curLeft = current.left;\n curRight = current.right;\n\n if (thisRuntime.ffi.isEqual(identical3(curLeft, curRight))) {\n continue;\n } else if (isNumber(curLeft) && isNumber(curRight)) {\n if (tol) {\n if (rel) {\n if (jsnums.roughlyEqualsRel(curLeft, curRight, tol, NumberErrbacks)) {\n continue;\n } else {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n } else if (jsnums.roughlyEquals(curLeft, curRight, tol, NumberErrbacks)) {\n continue;\n } else {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n } else if (jsnums.isRoughnum(curLeft) || jsnums.isRoughnum(curRight)) {\n toCompare.curAns = thisRuntime.ffi.unknown.app(\n fromWithin ? \"RoughnumZeroTolerances\" : \"Roughnums\",\n curLeft,\n curRight);\n } else if (jsnums.equals(curLeft, curRight, NumberErrbacks)) {\n continue;\n } else {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n } else if (isNothing(curLeft) && isNothing(curRight)) {\n continue;\n } else if (isFunction(curLeft) && isFunction(curRight)) {\n toCompare.curAns = thisRuntime.ffi.unknown.app(\"Functions\" , curLeft , curRight);\n } else if (isMethod(curLeft) && isMethod(curRight)) {\n toCompare.curAns = thisRuntime.ffi.unknown.app(\"Methods\" , curLeft , curRight);\n } else if (isOpaque(curLeft) && isOpaque(curRight)) {\n if (curLeft.equals(curLeft.val, curRight.val)) {\n continue;\n } else {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n } else {\n var curPair = findPair(curLeft, curRight);\n if (curPair !== false) {\n // Already checked this pair of objects\n toCompare.curAns = curPair\n continue;\n } else {\n var index = cachePair(curLeft, curRight);\n toCompare.stack.push({ setCache: true, index: index, left: curLeft, right: curRight });\n if (isRef(curLeft) && isRef(curRight)) {\n if (alwaysFlag && !(isRefFrozen(curLeft) && isRefFrozen(curRight))) { // In equal-always, non-identical refs are not equal\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight); // We would've caught identical refs already\n } else if(!isRefSet(curLeft) || !isRefSet(curRight)) {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n } else { // In equal-now, we walk through the refs\n var newPath = current.path;\n var lastDot = newPath.lastIndexOf(\".\");\n var lastParen = newPath.lastIndexOf(\")\");\n if (lastDot > -1 && lastDot > lastParen) {\n newPath = newPath.substr(0, lastDot) + \"!\" + newPath.substr(lastDot + 1);\n } else {\n newPath = \"deref(\" + newPath + \")\";\n }\n toCompare.stack.push({\n left: getRef(curLeft),\n right: getRef(curRight),\n path: newPath\n });\n }\n } else if(isTuple(curLeft) && isTuple(curRight)) {\n if (curLeft.vals.length !== curRight.vals.length) {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n } else {\n for (var i = 0; i < curLeft.vals.length; i++) {\n toCompare.stack.push({\n left: curLeft.vals[i],\n right: curRight.vals[i],\n path: \"is-tuple{ \" + current.path + \"; \" + i + \" }\"\n });\n }\n }\n } else if (isArray(curLeft) && isArray(curRight)) {\n if (alwaysFlag || (curLeft.length !== curRight.length)) {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n } else {\n for (var i = 0; i < curLeft.length; i++) {\n toCompare.stack.push({\n left: curLeft[i],\n right: curRight[i],\n path: \"raw-array-get(\" + current.path + \", \" + i + \")\"\n });\n }\n }\n } else if (isObject(curLeft) && isObject(curRight)) {\n if (!sameBrands(getBrands(curLeft), getBrands(curRight))) {\n /* Two objects with brands that differ */\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n else if (isObject(curLeft) && curLeft.dict[\"_equals\"]) {\n /* Two objects with the same brands and the left has an _equals method */\n // If this call stack-returns,\n var newAns = getColonField(curLeft, \"_equals\").full_meth(curLeft, curRight, equalFunPy);\n if(isContinuation(newAns)) { return newAns; }\n // the continuation stacklet will get the result, and combine them manually\n toCompare.curAns = combineEquality(toCompare.curAns, newAns);\n }\n else if (isDataValue(curLeft) && isDataValue(curRight)) {\n /* Two data values with the same brands and no equals method on the left */\n var fieldNames = curLeft.$constructor.$fieldNames;\n if (fieldNames && fieldNames.length > 0) {\n for (var k = 0; k < fieldNames.length; k++) {\n toCompare.stack.push({\n left: curLeft.dict[fieldNames[k]],\n right: curRight.dict[fieldNames[k]],\n path: current.path + \".\" + fieldNames[k]\n });\n }\n }\n } else {\n /* Two non-data objects with the same brands and no equals method on the left */\n var dictLeft = curLeft.dict;\n var dictRight = curRight.dict;\n var fieldsLeft;\n var fieldsRight;\n fieldsLeft = getFields(curLeft);\n fieldsRight = getFields(curRight);\n if(fieldsLeft.length !== fieldsRight.length) {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n for(var k = 0; k < fieldsLeft.length; k++) {\n toCompare.stack.push({\n left: curLeft.dict[fieldsLeft[k]],\n right: curRight.dict[fieldsLeft[k]],\n path: current.path + \".\" + fieldsLeft[k]\n });\n }\n }\n } else {\n toCompare.curAns = thisRuntime.ffi.notEqual.app(current.path, curLeft, curRight);\n }\n }\n }\n }\n return toCompare.curAns;\n }\n var stackFrameDesc = [alwaysFlag ? \"runtime equal-always\" : \"runtime equal-now\"];\n function equalFun($ar) {\n var $step = 0;\n var $ans = undefined;\n if (thisRuntime.isActivationRecord($ar)) {\n $step = $ar.step;\n $ans = $ar.ans;\n }\n while(true) {\n switch($step) {\n case 0:\n $step = 1;\n $ans = equalHelp();\n if(isContinuation($ans)) {\n $ans.stack[thisRuntime.EXN_STACKHEIGHT++] = thisRuntime.makeActivationRecord(\n stackFrameDesc,\n equalFun,\n $step,\n [],\n []);\n }\n return $ans;\n case 1:\n toCompare.curAns = combineEquality(toCompare.curAns, $ans);\n $step = 0;\n break;\n }\n }\n }\n function reenterEqualFun(left, right) {\n // arity check\n var $step = 0;\n var $ans = undefined;\n if (thisRuntime.isActivationRecord(left)) {\n $step = left.step;\n $ans = left.ans;\n }\n while(true) {\n switch($step) {\n case 0:\n stackOfToCompare.push(toCompare);\n toCompare = {stack: [{left: left, right: right, path: \"the-value\"}], curAns: thisRuntime.ffi.equal};\n $step = 1;\n $ans = equalFun();\n if(isContinuation($ans)) {\n $ans.stack[thisRuntime.EXN_STACKHEIGHT++] = thisRuntime.makeActivationRecord(\n stackFrameDesc,\n reenterEqualFun,\n $step,\n [],\n []);\n return $ans;\n }\n break;\n case 1:\n for(var i = 0; i < toCompare.stack.length; i++) {\n var current = toCompare.stack[i];\n if(current.setCache) {\n cache.equal[current.index - 1] = $ans;\n }\n }\n toCompare = stackOfToCompare.pop();\n return $ans;\n }\n }\n }\n var equalFunPy = makeFunction(reenterEqualFun, \"equalFun\");\n return reenterEqualFun(left, right);\n }", "title": "" }, { "docid": "4a4979477703363b1de2501f03d9c926", "score": "0.49007997", "text": "function deepCheckFields(curIndex) {\n return safeCall(function() {\n var thisChecker = that.anns[curIndex];\n return thisChecker.check(that.locs[curIndex], val.vals[curIndex]);\n }, function(result) {\n if(thisRuntime.ffi.isOk(result)) {\n if(curIndex === that.anns.length - 1) { return thisRuntime.ffi.contractOk; }\n else { return deepCheckFields(curIndex + 1); }\n }\n else if(thisRuntime.ffi.isFail(result)) {\n return that.createTupleFailureError(compilerLoc, val, curIndex, result);\n //return ffi.throwMessageException(\"types are wrong\");\n }\n },\n \"PTupleAnn:deepCheckFields\");\n }", "title": "" }, { "docid": "a905ada5b2f6137fe93e917aa0da565d", "score": "0.48910108", "text": "function findEqual(sequence) {\n for (let i = 0; i < sequence.length; i++) {\n for (let j = 0; j < sequence.length; j++) {\n if ((sequence[i] == sequence[j]) && (i != j)) return true;\n }\n } return false;\n}", "title": "" }, { "docid": "c2a2e71b19d2657cdb4ec3b1563abdc5", "score": "0.48855418", "text": "function solved() {\n for (let i = 0; i < 16; i++) {\n if (positions[i] !== i + 1) return false;\n }\n return true;\n}", "title": "" }, { "docid": "fbd4082b377e06559b900d9f879213b6", "score": "0.48840353", "text": "function findPath(path, acc) {\n // cycle complete\n if (path.length === 6) {\n const first = path[0];\n const last = path[5];\n if (Math.floor(first / 100) === last % 100) { // the first 2 digits of first = the last 2 digits of last\n // FOUND!\n return path;\n }\n return false;\n }\n const last = path[path.length - 1];\n\n const suffix = last.toString().match(/\\d{1,2}/g)[1];\n\n // all polygonals starting with the current suffix\n const nextPolygons = prefixLookup[suffix];\n if (!nextPolygons) {\n return false;\n }\n\n // find the next polygon from all sides which are still missing from the cycle\n const missingSides = Object.keys(acc).filter(key => !acc[key]);\n for (let i = 0; i < missingSides.length; i++) {\n const missingSide = missingSides[i];\n const nextMatchingPolygons = nextPolygons[missingSide];\n if (nextMatchingPolygons) {\n for (let j = 0; j < nextMatchingPolygons.length; j++) {\n const nextPolygon = nextMatchingPolygons[j];\n // if a valid path is found, return it, otherwise keep looping\n const findNextPath = findPath([...path, nextPolygon], { ...acc, [missingSide]: nextPolygon });\n if (findNextPath) {\n return findNextPath;\n }\n }\n }\n }\n\n // if no polygons are found with none of the missing sides, return false\n return false;\n }", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.48792127", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.48792127", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "33250834a8cc25cb1edf5eb9f9250dcc", "score": "0.48592165", "text": "deepEquals(other) {\n let eq = false;\n if (!other) {\n eq = this.type === other.type;\n if (eq) {\n eq = this.children.length === other.children.length;\n if (this.type === expressionType_1.ExpressionType.And || this.type === expressionType_1.ExpressionType.Or) {\n // And/Or do not depand on order\n for (let i = 0; eq && i < this.children.length; i++) {\n const primary = this.children[0];\n let found = false;\n for (var j = 0; j < this.children.length; j++) {\n if (primary.deepEquals(other.children[j])) {\n found = true;\n break;\n }\n }\n eq = found;\n }\n }\n else {\n for (let i = 0; eq && i < this.children.length; i++) {\n eq = this.children[i].deepEquals(other.children[i]);\n }\n }\n }\n }\n return eq;\n }", "title": "" }, { "docid": "6d4bdbce91e9934e958e952b92b334ee", "score": "0.4849434", "text": "function explore_eq_subgraph()\n {\n if (debug) console.log('explore equality subgraph');\n\n while (q_back > q_front && !found_augmentation)\n {\n x = q[q_front++];\n\n // plausible heuristic: first try x_aug+1 with y_aug+1\n if (y_aug) {\n var y = y_aug + 1;\n if (!T[y] && yx[y] == -1 && mat.cost(x, y) == lx[x] + ly[y])\n {\n augment(x, y);\n stat_upper++; // stat\n continue;\n }\n }\n\n // sparse heuristic: try only y with positive cost\n for (var i_y = 0; i_y < mat.y[x].length; ++i_y)\n {\n var y = mat.y[x][i_y];\n if (mat.c[x][i_y] == lx[x] + ly[y] && !T[y])\n {\n if (yx[y] == -1) // if y is unmatched\n {\n augment(x, y);\n stat_mid++; // stat\n break;\n }\n\n rev_path[yx[y]] = x;\n add_to_tree(yx[y], false);\n }\n }\n }\n }", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "2532aefa4cd6eba569d9af394cb1696f", "score": "0.48494056", "text": "function _VirtualDom_pairwiseRefEqual(as, bs)\n{\n\tfor (var i = 0; i < as.length; i++)\n\t{\n\t\tif (as[i] !== bs[i])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "8a3788199fa64e206fc249fff45bc732", "score": "0.48472303", "text": "function areNestedArrayItemsStrictlyEqual(a, b) {\n // If `a` and `b` are referentially equal, return true.\n if (a === b) {\n return true;\n }\n // If either `a` or `b` are not an array or not of the same length return false. `a` and `b` are\n // known to not be equal here, we checked above.\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n // Otherwise let us compare all of the array items (which are potentially nested arrays!) to see\n // if they are equal.\n return a.every(function (item, i) { return areNestedArrayItemsStrictlyEqual(item, b[i]); });\n}", "title": "" }, { "docid": "8a3788199fa64e206fc249fff45bc732", "score": "0.48472303", "text": "function areNestedArrayItemsStrictlyEqual(a, b) {\n // If `a` and `b` are referentially equal, return true.\n if (a === b) {\n return true;\n }\n // If either `a` or `b` are not an array or not of the same length return false. `a` and `b` are\n // known to not be equal here, we checked above.\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n // Otherwise let us compare all of the array items (which are potentially nested arrays!) to see\n // if they are equal.\n return a.every(function (item, i) { return areNestedArrayItemsStrictlyEqual(item, b[i]); });\n}", "title": "" }, { "docid": "8a3788199fa64e206fc249fff45bc732", "score": "0.48472303", "text": "function areNestedArrayItemsStrictlyEqual(a, b) {\n // If `a` and `b` are referentially equal, return true.\n if (a === b) {\n return true;\n }\n // If either `a` or `b` are not an array or not of the same length return false. `a` and `b` are\n // known to not be equal here, we checked above.\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n // Otherwise let us compare all of the array items (which are potentially nested arrays!) to see\n // if they are equal.\n return a.every(function (item, i) { return areNestedArrayItemsStrictlyEqual(item, b[i]); });\n}", "title": "" }, { "docid": "15f020f0ad2fd7bebde2ec1909432cce", "score": "0.48441625", "text": "tracePath() {\n const path = [];\n let ai = this.aLen;\n let bi = this.bLen;\n let current = this.matrix[bi][ai];\n let cost = current.cost;\n // Since we're doing a prefix match, we don't include the edits in the\n // suffix of sequence `a` that don't match sequence `b`. The suffix is\n // considered to be a consecutive sequence of deletes from `a` at the\n // end of the match.\n let inSuffix = true;\n let leftmostA = -1;\n let rightmostA = -1;\n let common = 0;\n while (current.edit !== Edit.NONE) {\n switch (current.edit) {\n case Edit.DELETE_A:\n if (inSuffix) {\n cost -= 1;\n }\n ai--;\n leftmostA = ai;\n break;\n case Edit.DELETE_B:\n bi--;\n break;\n case Edit.REPLACE:\n // DESIGN NOTE: it is important to take the item from\n // sequence `a` instead of `b`, in order to allow wildcards\n // from `b` to match items in `a`. In other words, we don't\n // want the match to contain the wildcard specifier from\n // `b`. Rather we want to it to contain the item from `a`\n // that matches the wildcard specifier.\n path.push(this.a[ai - 1]);\n // EXPERIMENT: replace above line with code below.\n // if (!inSuffix) {\n // path.push(this.a[ai - 1]);\n // }\n ai--;\n bi--;\n // EXPERIMENT: comment out // inSuffix = false;\n inSuffix = false;\n leftmostA = ai;\n break;\n case Edit.MATCH:\n path.push(this.a[ai - 1]);\n ai--;\n bi--;\n common++;\n inSuffix = false;\n leftmostA = ai;\n break;\n default:\n // Should never get here.\n break;\n }\n if (rightmostA < 0 && !inSuffix) {\n rightmostA = ai;\n }\n current = this.matrix[bi][ai];\n }\n this.result = { match: path.reverse(), cost, leftmostA, rightmostA, common };\n }", "title": "" }, { "docid": "fb5806f8bbcf8b22bf1cee261eab7c32", "score": "0.48420718", "text": "function innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}", "title": "" }, { "docid": "fb5806f8bbcf8b22bf1cee261eab7c32", "score": "0.48420718", "text": "function innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}", "title": "" }, { "docid": "fb5806f8bbcf8b22bf1cee261eab7c32", "score": "0.48420718", "text": "function innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}", "title": "" }, { "docid": "fb5806f8bbcf8b22bf1cee261eab7c32", "score": "0.48420718", "text": "function innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}", "title": "" }, { "docid": "a846e198c9f2b92aa800cf99d285d473", "score": "0.48400107", "text": "function deepEqual(valueA, valueB, mode) {\n if (mode === void 0) { mode = 'soft'; }\n var compare = function (a, b) {\n if (a === b)\n return true;\n if (type_1.type(a) !== type_1.type(b))\n return false;\n if (index_1.isFunction(a) && index_1.isFunction(b))\n a.toString() === b.toString();\n if (index_1.isPromise(a) && index_1.isPromise(b))\n return a === b;\n if (index_1.isArray(a) && index_1.isArray(b)) {\n if (a.length !== b.length)\n return false;\n var aArray = mode === 'hard' ? a : a;\n var bArray = mode === 'hard' ? b : b;\n for (var index in aArray) {\n if (!deepEqual(aArray[index], bArray[index]))\n return false;\n }\n return true;\n }\n if (index_1.isObject(a) && index_1.isObject(b)) {\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length)\n return false;\n if (!deepEqual(aKeys, bKeys))\n return false;\n for (var _i = 0, aKeys_1 = aKeys; _i < aKeys_1.length; _i++) {\n var aKey = aKeys_1[_i];\n if (!deepEqual(a[aKey], b[aKey]))\n return false;\n }\n return true;\n }\n return false;\n };\n return compare(valueA, valueB);\n}", "title": "" }, { "docid": "a84c09e61bd17e5a28b97354fcbdecfe", "score": "0.48327532", "text": "function isEqual (array1,array) {\n for (let i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array[i] instanceof Array) {\n // recurse into the nested arrays\n if (!array1[i].equals(array[i]))\n return false;\n }\n else if (array1[i] != array[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "26006a8764db2eb7fab1886714809f73", "score": "0.48321405", "text": "function nestedRefs() {\n var refs = this._mark.def.properties.update.nested,\n parent = this._builder,\n level = 0,\n i = 0, len = refs.length,\n ref, ds, stamp;\n\n for (; i<len; ++i) {\n ref = refs[i];\n\n // Scale references are resolved via this._mark._scaleRefs which are\n // added to dependency lists + connected in Builder.evaluate.\n if (ref.scale) continue;\n\n for (; level<ref.level; ++level) {\n parent = parent.parent();\n ds = parent.ds();\n }\n\n // Compare stamps to determine if a change in a group's properties\n // or data should trigger a reeval. We cannot check anything fancier\n // (e.g., pulse.fields) as the ref may use item.datum.\n stamp = (ref.group ? parent.encoder() : ds.last())._stamp;\n if (stamp > this._stamp) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "26006a8764db2eb7fab1886714809f73", "score": "0.48321405", "text": "function nestedRefs() {\n var refs = this._mark.def.properties.update.nested,\n parent = this._builder,\n level = 0,\n i = 0, len = refs.length,\n ref, ds, stamp;\n\n for (; i<len; ++i) {\n ref = refs[i];\n\n // Scale references are resolved via this._mark._scaleRefs which are\n // added to dependency lists + connected in Builder.evaluate.\n if (ref.scale) continue;\n\n for (; level<ref.level; ++level) {\n parent = parent.parent();\n ds = parent.ds();\n }\n\n // Compare stamps to determine if a change in a group's properties\n // or data should trigger a reeval. We cannot check anything fancier\n // (e.g., pulse.fields) as the ref may use item.datum.\n stamp = (ref.group ? parent.encoder() : ds.last())._stamp;\n if (stamp > this._stamp) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "26006a8764db2eb7fab1886714809f73", "score": "0.48321405", "text": "function nestedRefs() {\n var refs = this._mark.def.properties.update.nested,\n parent = this._builder,\n level = 0,\n i = 0, len = refs.length,\n ref, ds, stamp;\n\n for (; i<len; ++i) {\n ref = refs[i];\n\n // Scale references are resolved via this._mark._scaleRefs which are\n // added to dependency lists + connected in Builder.evaluate.\n if (ref.scale) continue;\n\n for (; level<ref.level; ++level) {\n parent = parent.parent();\n ds = parent.ds();\n }\n\n // Compare stamps to determine if a change in a group's properties\n // or data should trigger a reeval. We cannot check anything fancier\n // (e.g., pulse.fields) as the ref may use item.datum.\n stamp = (ref.group ? parent.encoder() : ds.last())._stamp;\n if (stamp > this._stamp) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "26006a8764db2eb7fab1886714809f73", "score": "0.48321405", "text": "function nestedRefs() {\n var refs = this._mark.def.properties.update.nested,\n parent = this._builder,\n level = 0,\n i = 0, len = refs.length,\n ref, ds, stamp;\n\n for (; i<len; ++i) {\n ref = refs[i];\n\n // Scale references are resolved via this._mark._scaleRefs which are\n // added to dependency lists + connected in Builder.evaluate.\n if (ref.scale) continue;\n\n for (; level<ref.level; ++level) {\n parent = parent.parent();\n ds = parent.ds();\n }\n\n // Compare stamps to determine if a change in a group's properties\n // or data should trigger a reeval. We cannot check anything fancier\n // (e.g., pulse.fields) as the ref may use item.datum.\n stamp = (ref.group ? parent.encoder() : ds.last())._stamp;\n if (stamp > this._stamp) return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "2a405115e61cc64d2e6512596c82639b", "score": "0.4825386", "text": "function deepEqual(obj1,obj2) {\n var temp1 = [], temp2 = [];\n for (var i in obj1) {\n temp1.push(i);\n }\n for (var i in obj2) {\n temp2.push(i);\n }\n if (temp1.length == temp2.length) {\n var count = 0;\n for (var i = 0; i < temp1.length; i++) {\n if ((((typeof obj1[temp1[i]]) === (typeof obj2[temp2[i]])) && ((obj1[temp1[i]] == obj2[temp2[i]])))) {\n count += 1;\n }\n }\n }\n if (count == (temp1.length -1)) {\n return true;\n }\n}", "title": "" }, { "docid": "68825a7cb681d880325a81bd6789ac8a", "score": "0.48221138", "text": "function deepEqual(obj1, obj2, rFlag) {\n rFlag = rFlag || false;\n if (typeof obj1 === 'object' && obj1 != null)\n {\n //console.log(\"line 21\");\n if (typeof obj2 === 'object' && obj2 != null)\n { \n for (var x in obj1)\n { \n if (obj1.x === obj2.x)\n {\n if (obj1[x] != obj2[x])\n { \n return false;\n } \n } \n else \n {\n return false;\n }\n }\n if (rFlag == true) //if it's the second object.\n { \n return true;\n }\n else \n {\n if (deepEqual(obj2, obj1, true))\n {\n return true;\n }\n return false; \n } \n }\n return false;\n }\n else \n {\n return false;\n }\n}", "title": "" }, { "docid": "def138f9814d980522c73e37fd3172f8", "score": "0.4816145", "text": "function isRefEqual(lhs,rhs){\nif(isNaN(lhs)&&isNaN(rhs)){\nreturn true;\n}\nreturn lhs===rhs;\n}", "title": "" }, { "docid": "a1033829307127e62b64afe8163f9b1c", "score": "0.48154965", "text": "function deepEqual(FObj,SObj)\n{\n\tif(FObj === SObj) return true;\n \n if(FObj == null || typeof FObj != typeof SObj ||\n SObj == null )\n return false;\n \n var FObjProp = 0; SObjProp = 0;\n \t\n \tfor(var prop in FObj)\n FObjProp+=1;\n \n\n \tfor(var prop in SObj)\n { \n SObjProp+=1; \n if(!(prop in FObj) || !deepEqual(FObj[prop],SObj[prop]))\n return false; \n } \n \n return FObjProp == SObjProp;\n}", "title": "" }, { "docid": "22e85cb7467e0a593c4d7e5b0f02a5f5", "score": "0.48096946", "text": "function checkNoCircularReference(affectedElement, targetElement) {\n /* targetElement has an effect on affectedElement: targetElement --> affectedElement.\n * listDependencies is an array of element pairs where dependency[0] --> dependency[1].\n * Function checks whether there is a case when there is a circular reference:\n * targetElement--> (dependency[0]==affectedElement)--> (dependency[1]==targetElement)\n * Ex. A1-->A1 or A1-->B1-->A1 or A1-->B1-->C1-->D1-->E1-->A1\n */\n var isValid = true;\n\n if ($(affectedElement).data('index') == $(targetElement).data('index')) {\n return false; /* Ex. A1 = A1 */\n }\n\n listDependencies.forEach(function (dependency) {\n if ($(affectedElement).data('index') == $(dependency[0]).data('index')) {\n if ($(targetElement).data('index') == $(dependency[1]).data('index')) {\n isValid = false;\n return;\n }\n else {\n isValid = checkNoCircularReference(dependency[1], targetElement);\n if (!isValid)\n return;\n }\n }\n });\n\n return isValid;\n}", "title": "" }, { "docid": "5867199e697a76079e0cba1934cc7e65", "score": "0.480497", "text": "function AndComp(a){ for(var pr in a) if(a[pr]) if(y.c[i][pr] != y.o[j][pr]) return false; return true; }", "title": "" }, { "docid": "b56851de8985defec4788f961fd38848", "score": "0.4799472", "text": "function pathValidation (recPath, uuidCollection) {\n const paths = dataStorage.dividingPaths(recPath)\n const pathArr = getPathArr(uuidCollection)\n let result\n if(Array.isArray(paths)){\n for(let i = 0, len = paths.length; i < len; i++){\n result = dataStorage.filterPathArr(pathArr, paths[i])\n if(result.length !== 0){\n return true\n }\n }\n return false \n } else {\n result = dataStorage.filterPathArr(pathArr, recPath)\n if (result.length !== 0) {\n return true\n }\n return false\n }\n}", "title": "" }, { "docid": "4eb19943f1799d7ad03de4672667bae6", "score": "0.47948974", "text": "function arrayEquals(array1, array2) {\n // if either array is a falsy value, return\n if (!array1 || !array2)\n return false;\n\n // compare lengths - can save a lot of time\n if (array1.length != array2.length)\n return false;\n\n for (var i = 0, l=array1.length; i < l; i++) {\n // Check if we have nested arrays\n if (array1[i] instanceof Array && array2[i] instanceof Array) {\n // recurse into the nested arrays\n if (!arrayEquals(array1[i], array2[i]))\n return false;\n }\n else if (array1[i] != array2[i]) {\n // Warning - two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "3c0e2cbdfde130fd0e7586c82046cd70", "score": "0.4793875", "text": "equiv(p2){\n return(this.startx == p2.startx && this.starty == p2.starty && this.size == p2.size);\n }", "title": "" }, { "docid": "a77a51ce5c901cedd8594d108fd6c3f7", "score": "0.47937134", "text": "function solveUpdate(log, paths) {\n var i, j, k, l, m, n, p, c, s;\n\n // Looping through possible paths\n for (i = 0, l = paths.length; i < l; i++) {\n p = paths[i];\n\n if (!p.length)\n return true;\n\n // Looping through logged paths\n for (j = 0, m = log.length; j < m; j++) {\n c = log[j];\n\n if (!c.length)\n return true;\n\n // Looping through steps\n for (k = 0, n = c.length; k < n; k++) {\n s = c[k];\n\n // If path is not relevant, we break\n if (s != p[k])\n break;\n\n // If we reached last item and we are relevant\n if (k + 1 === n || k + 1 === p.length)\n return true;\n }\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "7c3cf766041c35f4db74afc462429eee", "score": "0.47922567", "text": "function equalArrays(arrayOne, arrayTwo) {\n\t// compare lengths - can save a lot of time \n\tif (arrayOne.length != arrayTwo.length)\n\t\treturn false;\n\n\tfor (var i = 0; i < arrayOne.length; i++) {\n\t\t// Check if we have nested arrays\n\t\tif (arrayOne[i] instanceof Array && arrayTwo[i] instanceof Array) {\n\t\t\t// recurse into the nested arrays\n\t\t\tif (!arrayOne[i].equals(arrayTwo[i]))\n\t\t\t\treturn false;\n\t\t}\n\t\telse if (arrayOne[i] != arrayTwo[i]) { \n\t\t\t// Warning - two different object instances will never be equal: {x:20} != {x:20}\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "1c732ec8a4c161bd70ec28e238026b71", "score": "0.47881147", "text": "function refactoredSame(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n let counter1 = {};\n let counter2 = {};\n for (let elt of array1) {\n counter1[elt] = (counter1[elt] || 0) + 1;\n }\n for (let elt of array2) {\n counter2[elt] = (counter2[elt] || 0) + 1;\n }\n\n for (let key in counter1) {\n if (!(key ** 2 in counter2)) {\n return false;\n }\n if (counter2[key ** 2] !== counter1[key]) {\n return false;\n }\n }\n // Successive loops are often better than a nested loop\n\n return true;\n}", "title": "" }, { "docid": "5a335dfd57880883e1f2b38f763d446a", "score": "0.47855312", "text": "checkForEndState(){\n let equal = false;\n if (this.store1 && this.store2){\n if (this.store1.length == this.store2.length){\n equal = true;\n let i = 0;\n while (i < this.store1.length && equal){\n if (this.store1[i] != this.store2[i]){\n equal = false;\n }\n i++;\n }\n }\n }\n return equal\n }", "title": "" }, { "docid": "afdc0f42d0036e98b3dfff34732b9504", "score": "0.47756863", "text": "function brackets(){\n for (var i = 0; i < brackets.length; i++) {\n if (brackets[i] === brackets[i] +1)\n }\n return true;\n}", "title": "" }, { "docid": "8afe70c3da99388ea80fa6f1092d4006", "score": "0.47686052", "text": "function iterableEquality(a, b) {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n Array.isArray(a) ||\n Array.isArray(b) ||\n a === null ||\n b === null\n ) {\n return undefined;\n }\n if (a && b && a.constructor !== b.constructor) {\n // check if the object are natives and then shallow equal them\n return a.sketchObject && b.sketchObject && a.sketchObject == b.sketchObject;\n }\n\n if (a.size !== undefined) {\n if (a.size !== b.size) {\n return false;\n } else if (isA(\"Set\", a)) {\n var allFound = true;\n for (var aValue of a) {\n if (!b.has(aValue)) {\n allFound = false;\n break;\n }\n }\n if (allFound) {\n return true;\n }\n } else if (isA(\"Map\", a)) {\n var allFound = true;\n for (var aEntry of a) {\n if (\n !b.has(aEntry[0]) ||\n !equals(aEntry[1], b.get(aEntry[0]), [iterableEquality])\n ) {\n allFound = false;\n break;\n }\n }\n if (allFound) {\n return true;\n }\n }\n }\n\n if (Object.keys(a).length !== Object.keys(a).length) {\n return false;\n }\n\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n\n for (var i = 0; i < aKeys.length; i += 1) {\n var aKey = aKeys[i];\n var bKey = bKeys[i];\n if (aKey !== bKey || !equals(a[aKey], b[bKey], [iterableEquality])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "c430a3a86ea05507d35f48f0e599a5f3", "score": "0.47665808", "text": "function $n(t, e) {\n return function (t, e) {\n var n = e.key.path;\n return null !== t.collectionGroup ? e.key.N(t.collectionGroup) && t.path.T(n) : A.F(t.path) ? t.path.isEqual(n) : t.path.I(n);\n }(t, e) && function (t, e) {\n for (var n = 0, r = t.rn; n < r.length; n++) {\n var i = r[n]; // order by key always matches\n\n if (!i.field.p() && null === e.field(i.field)) return !1;\n }\n\n return !0;\n }(t, e) && function (t, e) {\n for (var n = 0, r = t.filters; n < r.length; n++) {\n if (!r[n].matches(e)) return !1;\n }\n\n return !0;\n }(t, e) && function (t, e) {\n return !(t.startAt && !cr(t.startAt, Bn(t), e)) && (!t.endAt || !cr(t.endAt, Bn(t), e));\n }(t, e);\n}", "title": "" }, { "docid": "31a285ee5eb8de705d1ebb780e2cbdde", "score": "0.47665244", "text": "function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n var a = _arrayFromIterator(aIterator);\n\n var b = _arrayFromIterator(bIterator);\n\n function eq(_a, _b) {\n return _equals(_a, _b, stackA.slice(), stackB.slice());\n } // if *a* array contains any element that is not included in *b*\n\n\n return !_includesWith(function (b, aItem) {\n return !_includesWith(eq, aItem, b);\n }, b, a);\n }", "title": "" }, { "docid": "a9f4b62bce6ea9b7565b7ecc59bff22f", "score": "0.4762963", "text": "function isEqual() {\n var toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnProperties = Object.getOwnPropertySymbols\n ? function (c) {\n return Object.keys(c).concat(Object.getOwnPropertySymbols(c));\n }\n : Object.keys;\n\n function checkEquality(a, b, refs) {\n var aElements,\n bElements,\n element,\n aType = toString.call(a),\n bType = toString.call(b);\n\n // trivial case: primitives and referentially equal objects\n if (a === b) return true;\n\n // if both are null/undefined, the above check would have returned true\n if (a == null || b == null) return false;\n\n // check to see if we've seen this reference before; if yes, return true\n if (refs.indexOf(a) > -1 && refs.indexOf(b) > -1) return true;\n\n // save results for circular checks\n refs.push(a, b);\n\n if (aType != bType) return false; // not the same type of objects\n\n // for non-null objects, check all custom properties\n aElements = getOwnProperties(a);\n bElements = getOwnProperties(b);\n if (\n aElements.length != bElements.length ||\n aElements.some(function (key) {\n return !checkEquality(a[key], b[key], refs);\n })\n ) {\n return false;\n }\n\n switch (aType.slice(8, -1)) {\n case \"Symbol\":\n return a.valueOf() == b.valueOf();\n case \"Date\":\n case \"Number\":\n return +a == +b || (+a != +a && +b != +b); // convert Dates to ms, check for NaN\n case \"RegExp\":\n case \"Function\":\n case \"String\":\n case \"Boolean\":\n return \"\" + a == \"\" + b;\n case \"Set\":\n case \"Map\": {\n aElements = a.entries();\n bElements = b.entries();\n do {\n element = aElements.next();\n if (!checkEquality(element.value, bElements.next().value, refs)) {\n return false;\n }\n } while (!element.done);\n return true;\n }\n case \"ArrayBuffer\":\n (a = new Uint8Array(a)), (b = new Uint8Array(b)); // fall through to be handled as an Array\n case \"DataView\":\n (a = new Uint8Array(a.buffer)), (b = new Uint8Array(b.buffer)); // fall through to be handled as an Array\n case \"Float32Array\":\n case \"Float64Array\":\n case \"Int8Array\":\n case \"Int16Array\":\n case \"Int32Array\":\n case \"Uint8Array\":\n case \"Uint16Array\":\n case \"Uint32Array\":\n case \"Uint8ClampedArray\":\n case \"Arguments\":\n case \"Array\":\n if (a.length != b.length) return false;\n for (element = 0; element < a.length; element++) {\n if (!(element in a) && !(element in b)) continue; // empty slots are equal\n // either one slot is empty but not both OR the elements are not equal\n if (\n element in a != element in b ||\n !checkEquality(a[element], b[element], refs)\n )\n return false;\n }\n return true;\n case \"Object\":\n return checkEquality(getPrototypeOf(a), getPrototypeOf(b), refs);\n default:\n return false;\n }\n }\n\n return function (a, b) {\n return checkEquality(a, b, []);\n };\n}", "title": "" }, { "docid": "ef157c917a47b50e09a3450d041486ea", "score": "0.4760807", "text": "function arraysEqual(a,b) {\r\n\tif (a instanceof Array && b instanceof Array) {\r\n\t\tif (a.length != b.length) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < a.length; i++) {\r\n\t\t\t\t/* if this is a multi-dimensional array, check equality at the next level */\r\n\t\t\t\tif (a[i] instanceof Array || b[i] instanceof Array) {\r\n\t\t\t\t\tvar tmp = arraysEqual(a[i],b[i]);\r\n\t\t\t\t\tif (!tmp) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (a[i] != b[i]) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "3a312082ccf9053df13d6cd21026d397", "score": "0.4756393", "text": "function deepEqual(expected, actual) {\n debug('deepEqual comparing', typeof expected, expected, typeof actual, actual)\n if (expected instanceof RegExp) {\n return expected.test(actual)\n }\n\n if (Array.isArray(expected) && Array.isArray(actual)) {\n if (expected.length !== actual.length) {\n return false\n }\n\n return expected.every((expVal, idx) => deepEqual(expVal, actual[idx]))\n }\n\n if (isPlainObject(expected) && isPlainObject(actual)) {\n const allKeys = Array.from(\n new Set(Object.keys(expected).concat(Object.keys(actual)))\n )\n\n return allKeys.every(key => deepEqual(expected[key], actual[key]))\n }\n\n return expected === actual\n}", "title": "" }, { "docid": "2be6ba973e7e538dfee17a1b509ce281", "score": "0.47403803", "text": "function solveUpdate(log, paths) {\n\t var i, j, k, l, m, n, p, c, s;\n\n\t // Looping through possible paths\n\t for (i = 0, l = paths.length; i < l; i++) {\n\t p = paths[i];\n\n\t if (!p.length) return true;\n\n\t // Looping through logged paths\n\t for (j = 0, m = log.length; j < m; j++) {\n\t c = log[j];\n\n\t if (!c.length) return true;\n\n\t // Looping through steps\n\t for (k = 0, n = c.length; k < n; k++) {\n\t s = c[k];\n\n\t // If path is not relevant, we break\n\t if (s != p[k]) break;\n\n\t // If we reached last item and we are relevant\n\t if (k + 1 === n || k + 1 === p.length) return true;\n\t }\n\t }\n\t }\n\n\t return false;\n\t}", "title": "" }, { "docid": "11fd42592ff040e36e3e11fc7336b666", "score": "0.4739477", "text": "function identical_dicts(a, b, depth=1, allow_non_dicts=false) {\n\n if (a === undefined) {\n return false;\n }\n if (b === undefined) {\n return false;\n }\n if (!allow_non_dicts) {\n check(typeof a === 'object' && typeof b === 'object', 'non-dict not allowed');\n }\n if (typeof a !== typeof b) {\n if ((typeof a === 'string') && is_RegExp(b)) {\n let result = b.test(a);\n return result;\n }\n\n return false;\n }\n\n if (Array.isArray(a) !== Array.isArray(b)) {\n return false;\n }\n if (Array.isArray(a)) {\n for (var i in a) {\n if (!identical_dicts(a[i], b[i], depth-1, allow_non_dicts)) {\n return false;\n }\n }\n return true;\n }\n if (typeof a !== 'object') {\n return a === b;\n }\n let next_ab = (a,b)=>identical_dicts(a,b, depth-1, true);\n let next_ba = (a,b)=>identical_dicts(b,a, depth-1, true);\n let boolean_result =\n keys_are_subset(a, b, next_ab) &&\n keys_are_subset(b, a, next_ba);\n\n return boolean_result;\n}", "title": "" }, { "docid": "018529b2406f4850e61cb29615cfb95a", "score": "0.47354674", "text": "function temDuplicados(array) {\n var valuesSoFar = Object.create(null);\n for (var i = 0; i < array.length; ++i) {\n var value = array[i];\n if (value in valuesSoFar) {\n return true;\n }\n valuesSoFar[value] = true;\n }\n return false;\n }", "title": "" }, { "docid": "bf5be9e58d09e1921c1d38fdd650b8cf", "score": "0.47294217", "text": "function\nXATS2JS_g_eqref\n (x1, x2)\n{\n return (x1 === x2); \n}", "title": "" }, { "docid": "bf5be9e58d09e1921c1d38fdd650b8cf", "score": "0.47294217", "text": "function\nXATS2JS_g_eqref\n (x1, x2)\n{\n return (x1 === x2); \n}", "title": "" }, { "docid": "bf5be9e58d09e1921c1d38fdd650b8cf", "score": "0.47294217", "text": "function\nXATS2JS_g_eqref\n (x1, x2)\n{\n return (x1 === x2); \n}", "title": "" }, { "docid": "bf5be9e58d09e1921c1d38fdd650b8cf", "score": "0.47294217", "text": "function\nXATS2JS_g_eqref\n (x1, x2)\n{\n return (x1 === x2); \n}", "title": "" }, { "docid": "35b0c94d5ad4b8902ccd4da4a8c76dd4", "score": "0.4729415", "text": "static testArrayEqual(arr1, arr2) {\n if (arr1 && !arr2 || arr2 && !arr1) {\n return false\n\n }\n if (!arr1 && !arr2) {\n return true\n }\n if (arr1.length !== arr2.length)\n return false;\n for (var i = arr1.length; i--;) {\n if (arr1[i].id !== arr2[i].id)\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "a5f860e6084407ac869aff5df10236c6", "score": "0.47282493", "text": "function recursiveOneWayDiff(left, right) {\n if (left instanceof Array)\n {\n if (!(right instanceof Array))\n return false;\n\n for (var i = 0; i < left.length; i++)\n {\n if (left[i] === null)\n continue;\n else if (typeof left[i] === 'undefined' && typeof right[i] === 'undefined')\n continue;\n else if (typeof left[i] !== 'undefined' && typeof right[i] === 'undefined')\n return false;\n else if (!Utility.isPOJS(left[i])) {\n if (!propDiff(left[i], right[i])) {\n return false;\n }\n }\n else if (!Utility.isPOJS(right[i]))\n return false;\n else if (!recursiveOneWayDiff(left[i], right[i]))\n return false;\n }\n }\n else\n {\n if (typeof right !== 'object')\n return false;\n\n for (var prop in left)\n {\n if (typeof left[prop] === 'undefined' && typeof right[prop] === 'undefined')\n continue;\n else if (!(prop in right))\n return false;\n else if (!Utility.isPOJS(left[prop])) {\n if (!propDiff(left[prop], right[prop])) {\n return false;\n }\n }\n else if (!Utility.isPOJS(right[prop]))\n return false;\n else if (!recursiveOneWayDiff(left[prop], right[prop]))\n return false;\n }\n }\n\n return true;\n }", "title": "" } ]
05ed2f887757fd5c2b8aaa865bd54e5b
Enable or disable all input handlers
[ { "docid": "68c892fe28bcf0bdb47173806b4d286d", "score": "0.0", "text": "setEnabled(enable) {\n if (this.enabled !== enable) {\n this.fire(\"enabled\", this.enabled = enable);\n }\n }", "title": "" } ]
[ { "docid": "ccd65a8f10235625aebfab7146d3cf80", "score": "0.652111", "text": "ENABLE_INPUT (state) {\n state.inputEnabled = true;\n }", "title": "" }, { "docid": "89b102ef22248c77eef544bb5b91036e", "score": "0.6446941", "text": "disableInputs() {\n if(!this.app.isRunning){\n if(this.app.disabledInputs){\n for(let input of this.inputs) input.setAttribute(\"disabled\", true);\n }else{\n for(let input of this.inputs) input.removeAttribute(\"disabled\");\n } \n }\n }", "title": "" }, { "docid": "2841862b155fc4d7b0cd3f25700c5b19", "score": "0.6280789", "text": "enableListening () {\n this.listenForKeyPress = true;\n }", "title": "" }, { "docid": "2833860c23540b8a74f86a7e789551f2", "score": "0.6265597", "text": "function enable() {\n\t\tif(window.addEventListener) {\n\t\t\tdocument.addEventListener('keydown', keydown, false);\n\t\t\tdocument.addEventListener('keyup', keyup, false);\n\t\t\twindow.addEventListener('blur', reset, false);\n\t\t\twindow.addEventListener('webkitfullscreenchange', reset, false);\n\t\t\twindow.addEventListener('mozfullscreenchange', reset, false);\n\t\t} else if(window.attachEvent) {\n\t\t\tdocument.attachEvent('onkeydown', keydown);\n\t\t\tdocument.attachEvent('onkeyup', keyup);\n\t\t\twindow.attachEvent('onblur', reset);\n\t\t}\n\t}", "title": "" }, { "docid": "2833860c23540b8a74f86a7e789551f2", "score": "0.6265597", "text": "function enable() {\n\t\tif(window.addEventListener) {\n\t\t\tdocument.addEventListener('keydown', keydown, false);\n\t\t\tdocument.addEventListener('keyup', keyup, false);\n\t\t\twindow.addEventListener('blur', reset, false);\n\t\t\twindow.addEventListener('webkitfullscreenchange', reset, false);\n\t\t\twindow.addEventListener('mozfullscreenchange', reset, false);\n\t\t} else if(window.attachEvent) {\n\t\t\tdocument.attachEvent('onkeydown', keydown);\n\t\t\tdocument.attachEvent('onkeyup', keyup);\n\t\t\twindow.attachEvent('onblur', reset);\n\t\t}\n\t}", "title": "" }, { "docid": "aff9fc55fcaa51a35601ca90c3816130", "score": "0.6234512", "text": "enableUI() {\n\t\tfor (let i = 0; i < this.controls.length; i++) {\n\t\t\tthis.controls[i].disabled = false;\n\t\t}\n\t}", "title": "" }, { "docid": "dda8eeadf8720c9eebf285fe9ef5007a", "score": "0.6206852", "text": "enable() {\n this.$window.on('keydown', this.onKeydownHandler);\n this.$window.on('keyup', this.onKeyupHandler);\n // TODO: these are non-standard events and will be deprecated soon. this should be moved\n // over to the `wheel` event. This should also be moved over to `.on()` instead of `.bind()`\n // https://developer.mozilla.org/en-US/docs/Web/Events/wheel\n // this.$commandInput.on('DOMMouseScroll mousewheel', this.onMouseScrollHandler);\n this.$canvases.bind('DOMMouseScroll mousewheel', this.onMouseScrollHandler);\n this.$canvases.on('mousemove', this.onMouseClickAndDragHandler);\n this.$canvases.on('mouseup', this.onMouseUpHandler);\n this.$canvases.on('mousedown', this.onMouseDownHandler);\n this.$canvases.on('dblclick', this.onMouseDblclickHandler);\n this.$body.addEventListener('contextmenu', (event) => event.preventDefault());\n\n // TODO: Fix this\n this._eventBus.on(EVENT.STRIP_CLICK, this.selectAircraftByCallsign);\n\n return this;\n }", "title": "" }, { "docid": "e98309eab32dc7ea3eba9cf6cc132535", "score": "0.61899525", "text": "handleEnable() {\n\t\tthis.el.classList.add(this.toggleClass);\n\n\t\tthis.isToggled = true;\n\t}", "title": "" }, { "docid": "1bd5b1d2771caa3797f90aea83d00ccb", "score": "0.61828905", "text": "enableInterface() {\n Object.keys(this.panel.btns).forEach(btnKey => this.panel.btns[btnKey].enable());\n }", "title": "" }, { "docid": "2e9ea5db64613914fc8a686abce2fc7a", "score": "0.61113155", "text": "function setInterface(enable) {\n $(\"#search_button\").prop(\"disabled\", !enable);\n $(\"#clear_button\").prop(\"disabled\", !enable);\n $(\"#stop_button\").prop(\"disabled\", enable);\n}", "title": "" }, { "docid": "108566db95b4f2208916f1aaf23eb963", "score": "0.61023027", "text": "enable () {}", "title": "" }, { "docid": "2c06e27752e5ef576997daca4d451d3b", "score": "0.6063412", "text": "function lockInputs(locked) {\n wordInput.disabled = locked;\n whitelistRadioButton.disabled = locked;\n blacklistRadioButton.disabled = locked;\n saveButton.disabled = locked;\n}", "title": "" }, { "docid": "de010d1fdb850af39ca090941efed348", "score": "0.5977518", "text": "function lockControls() {\n $(\"#userinput\").attr(\"disabled\", \"disabled\");\n $(\"#calculatebutton\").attr(\"disabled\", \"disabled\");\n}", "title": "" }, { "docid": "879f2c750fb09b3af3338f8c8e0a59bb", "score": "0.59761333", "text": "function enableAllInputsSymmetric() {\r\n\tjQuery.each(getDisabledElements(),\r\n\t\tfunction(index, element) {\r\n\t\t\tif(jQuery(element).is('a')) {\r\n\t\t\t\tjQuery(element).removeAttr('disabled');\r\n\t\t\t} else {\r\n\t\t\t\tjQuery(element).attr('disabled',false);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\tresetDisabledElements();\r\n}", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "bf04efe2cb2481e5963f4bf38a4a20f0", "score": "0.59731007", "text": "enable() { }", "title": "" }, { "docid": "6162c270e6f45b36540cf755f464f6b0", "score": "0.5942304", "text": "function enableInterface() {\n\t\t$('.basic-form input').prop('disabled', false);\n\t\t$('.basic-form select').prop('disabled', false);\n\t\t$('.basic-form button').not('#connection').prop('disabled', false);\n\t\tif(ready()) $('.basic-form #connection').prop('disabled', false);\n\t}", "title": "" }, { "docid": "da6f7e126c9dae6d48f3c8bbecb34dfd", "score": "0.59251326", "text": "setupInputHandlers() {\n\t\tthis.input.handleBlock.bind(this)();\n\t\tthis.input.handleLevelData.bind(this)();\n\t}", "title": "" }, { "docid": "b697264b02b643e4f3be5d70683526b0", "score": "0.592373", "text": "function enableInternal(enabled) {\r\n\t\tif (enabled && !_enabled) {\r\n\t\t\t// Going from disabled to enabled\r\n\t\t\tclearKeyTimer();\r\n\t\t\tmyAttachEvent(_control, \"keyup\", controlKeyUpHandler);\r\n\t\t\tmyAttachEvent(_control, \"keydown\", controlKeyDownHandler);\r\n\t\t\tmyAttachEvent(_control, \"blur\", controlBlurHandler);\r\n\t\t\tmyAttachEvent(_control, \"click\", controlClickHandler);\r\n\t\t}\r\n\t\telse if (!enabled && _enabled) {\r\n\t\t\t// Going from enabled to disabled\r\n\t\t\tremovePopup();\r\n\t\t\tmyDetachEvent(_control, \"keyup\", controlKeyUpHandler);\r\n\t\t\tmyDetachEvent(_control, \"keydown\", controlKeyDownHandler);\r\n\t\t\tmyDetachEvent(_control, \"blur\", controlBlurHandler);\r\n\t\t\tmyDetachEvent(_control, \"click\", controlClickHandler);\r\n\t\t}\r\n\t\t_enabled = enabled;\r\n\t}", "title": "" }, { "docid": "ca42e68784282e6cddcc3270b75c4529", "score": "0.5914985", "text": "function OnEnable () {}", "title": "" }, { "docid": "837203991cf8c283da69f2f4d7df2692", "score": "0.5897464", "text": "enable() {\n if (this.isEnabled) return\n this.isEnabled = true\n EventManager.on('raf', this.onRaf)\n }", "title": "" }, { "docid": "cdbc6d7cfbeb49b102906cccdda4235c", "score": "0.58851105", "text": "function disable_input(input, handler){\n //Resets input value\n input.value = '';\n //Removes the input attribute\n input.removeEventListener('input', handler);\n //Turns the input attribute to disabled\n input.setAttribute('disabled', 'disabled');\n}", "title": "" }, { "docid": "8accbe28078e09779a85bd6ed0c3bc80", "score": "0.5884156", "text": "function enableInput() {\n\t\t$( '[type=text], [type=number], [type=email] select' ).each( function () {\n\t\t\t$( this ).removeAttr( 'disabled' );\n\t\t} );\n\t}", "title": "" }, { "docid": "839a59ad358cf7723baeef29da9a170e", "score": "0.58783525", "text": "function enableInput() {\n \"use strict\";\n // Stop the progress timer and hide the progress message\n // (including the Cancel button).\n stopProgressTimer();\n showElement(\"progressDiv\", false);\n\n // Enable the input UI.\n disableElement(inputArea, false);\n }", "title": "" }, { "docid": "6136a8b9116c0a02e27619cd754408a8", "score": "0.586768", "text": "function disableAllInputsSymmetric() {\r\n\tvar index=0;\r\n\t\r\n\tjQuery('input').each(function() {\r\n\t\taddAndDisableIfEnabled(index, this);\r\n\t\tindex++;\r\n\t});\r\n\tjQuery('a').each(function() {\r\n\t\taddAndDisableIfEnabled(index, this);\r\n\t\tindex++;\r\n\t});\r\n\tjQuery('select').each(function() {\r\n\t\taddAndDisableIfEnabled(index, this);\r\n\t\tindex++;\r\n\t});\r\n\taddAndDisableIfEnabled(index, 'form');\r\n}", "title": "" }, { "docid": "898ac7323d49f4d3920ea81d79bbe94f", "score": "0.58123213", "text": "disableInputs() {\n for(const treePropertyInput in this.treePropertyInputs) {\n this.treePropertyInputs[treePropertyInput].readOnly = true;\n }\n\n for(const nodePropertyInput in this.nodePropertyInputs) {\n this.nodePropertyInputs[nodePropertyInput].readOnly = true;\n }\n }", "title": "" }, { "docid": "327054f238639313db97f9e8f3136080", "score": "0.5800022", "text": "function bind_input_handlers()\n\t{\n\t\tvar _Drone = drone.get( Drone );\n\n\t\t// Partially hide HUD on input...\n\t\tinput.on( 'input', function( key ) {\n\t\t\tif (\n\t\t\t\t// ...if in pilot mode...\n\t\t\t\tmode === Modes.PILOT_MODE &&\n\t\t\t\t// ...and the pressed key is not SHIFT...\n\t\t\t\tkey !== 16 &&\n\t\t\t\t// ...and the player isn't scrolling through hardware\n\t\t\t\t!is_scrolling_hardware()\n\t\t\t) {\n\t\t\t\thud.get( HUD ).fade();\n\t\t\t}\n\t\t} );\n\n\t\t// Spin stabilization\n\t\tinput.on( 'S', function() {\n\t\t\tif ( _Drone.isControllable() ) {\n\t\t\t\t_Drone.stabilize();\n\t\t\t}\n\t\t} );\n\n\t\t// Docking-related actions\n\t\tinput.on( 'D', function() {\n\t\t\tif ( _Drone.signal > 0 ) {\n\t\t\t\tif ( _Drone.isDocked() ) {\n\t\t\t\t\t_Drone.undock();\n\t\t\t\t} else\n\t\t\t\tif ( !_Drone.isDocking() ) {\n\t\t\t\t\tenter_docking_mode();\n\t\t\t\t} else {\n\t\t\t\t\t_Drone.abortDocking();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// Hardware menu navigation\n\t\tinput.on( 'UP', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).scrollHardware( 'up' );\n\t\t\t}\n\t\t} );\n\n\t\tinput.on( 'DOWN', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).scrollHardware( 'down' );\n\t\t\t}\n\t\t} );\n\n\t\tinput.on( 'ENTER', function() {\n\t\t\tif ( is_scrolling_hardware() ) {\n\t\t\t\thud.get( HUD ).selectHardware();\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "e5429f1b35621a68cc2f988d74ab0397", "score": "0.57846826", "text": "enable()\n\t\t{\n\t\t\tthis.disabled = false;\n\t\t}", "title": "" }, { "docid": "c7847b0741e142764f093edf778ce022", "score": "0.578353", "text": "function unlockControls() {\n $(\"#userinput\").removeAttr(\"disabled\");\n $(\"#calculatebutton\").removeAttr(\"disabled\");\n}", "title": "" }, { "docid": "c48fd3c7eb5897b495d1fd847e0d3867", "score": "0.57712275", "text": "function enableAllControls() {\n\t//$('select, button, input, textarea, a').prop('disabled', false);\n}", "title": "" }, { "docid": "9698107c5907cd9b0d0c90c97927f20a", "score": "0.5768396", "text": "function disableUI () {\n\n fileButton.disabled = true;\n splitButton.disabled = true;\n selectionRadios[0].disabled = true;\n selectionRadios[1].disabled = true;\n\n for (let i = 0; i < maxLengthRadios.length; i++) {\n\n maxLengthRadios[i].disabled = true;\n\n }\n\n outputCheckbox.disabled = true;\n outputButton.disabled = true;\n\n prefixCheckbox.disabled = true;\n prefixInput.disabled = true;\n\n}", "title": "" }, { "docid": "c5c697c3283e5fb4162a1dd138efb271", "score": "0.5766668", "text": "function enableControls(evt) {\n\tsap.ui.getCore().byId(\"idanki2--slider\").setEnabled(evt);\n\tsap.ui.getCore().byId(\"idanki2--speedUp\").setEnabled(evt);\n\tsap.ui.getCore().byId(\"idanki2--speedDown\").setEnabled(evt);\n}", "title": "" }, { "docid": "3a0c13e84f6fa8d2f24fce2b17725f22", "score": "0.57564396", "text": "enableButtons() {\n this.buttonsDisabled = false;\n }", "title": "" }, { "docid": "3ceb1b1c3792fc9966160747c64d0981", "score": "0.5755018", "text": "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "title": "" }, { "docid": "ef8629e1c8ff136f217e553c7dc5d15e", "score": "0.57499814", "text": "_events() {\n this._addClickHandler();\n this._addFocusHandler();\n }", "title": "" }, { "docid": "311ab09690b68b0d432c144397c6f1a9", "score": "0.5746532", "text": "enable() {\n this.html.removeClass('submitDisable');\n // re-enable the click event\n let that = this;\n this.widgetHtml.on(\"click\", (e) => {\n that.callback();\n });\n }", "title": "" }, { "docid": "c333dcb45ec8060edb1991e02d78bb96", "score": "0.57284105", "text": "onDisabled() {}", "title": "" }, { "docid": "30bd0c35d9c9506026c0d8d283067225", "score": "0.5715804", "text": "function enableInput() {\n\t$(\"#editfirstName\").removeAttr('disabled');\n\t$(\"#editMiddleName\").removeAttr('disabled');\n\t$(\"#editLastName\").removeAttr('disabled');\n\t$(\"#editBiometrics\").removeAttr('disabled');\n\t$(\"#editDepartment\").removeAttr('disabled');\n\t$(\"#editShift\").removeAttr('disabled');\n\t$(\"#editPosition\").removeAttr('disabled');\n\t$(\"#editLevel\").removeAttr('disabled');\n\t$(\"#editHiredDate\").removeAttr('disabled');\n\t$(\"#editRegularizationDate\").removeAttr('disabled');\n\t$(\"#editResignationDate\").removeAttr('disabled');\n\t$(\"#editSupervisorName\").removeAttr('disabled');\n\t$(\"#editSupervisorEmail\").removeAttr('disabled');\n\t$(\"#editLocAssign\").removeAttr('disabled');\n\t$(\"#editEmployeeEmail\").removeAttr('disabled');\t\n}", "title": "" }, { "docid": "32556f1c4d16c508a28aeb3bed91b4d9", "score": "0.5714246", "text": "onEnabled() {}", "title": "" }, { "docid": "fb3f309d6f5f7035b688996e19b9e63b", "score": "0.5697428", "text": "function OnEnable(){\n\t\t\t//\tGesture.onChargingE += OnCharging;\n\t\t\t\tGesture.onShortTapE += OnTap;\n\t\t\t\tGesture.onLongTapE += OnTap;\n\t\t\t\tGesture.onDoubleTapE += OnTap;\n\t\t\t\tGesture.onSwipeE += OnSwipe;\n\t\t\t\tGesture.onDraggingE += OnDrag;\n\t\t\t//\tGesture.onChargeEndE += OnChargeEnd;\n\t\t}", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "1f51f3308a52df2b06a465dff27d95da", "score": "0.5672727", "text": "disable() { }", "title": "" }, { "docid": "af98ffc4ff94880fe3cb1a612a8cc57e", "score": "0.5658294", "text": "disableUI() {\n\t\tfor (let i = 0; i < this.controls.length; i++) {\n\t\t\tthis.controls[i].disabled = true;\n\t\t}\n\t}", "title": "" }, { "docid": "6554a33f250543a01d7c4b319debf190", "score": "0.56480384", "text": "function inputHandler() {\n enableClearForm();\n enableSubmitButton();\n enableResetButton();\n enableUpdateButton();\n displayMaxErrorMessage();\n}", "title": "" }, { "docid": "10e8a8190e1b0411f0aff92913ff5c21", "score": "0.56436175", "text": "enable() {\n this.content.setAttribute('draggable', true);\n this.toggleEffect('disabled', false);\n\n for (let id in this.buttons) {\n this.buttons[id].enable();\n }\n\n this.disabled = false;\n }", "title": "" }, { "docid": "7db2d396749775d84f27072829cdae67", "score": "0.5628535", "text": "enableMenuButtons() {\n var elements = this.__menuElements;\n for (var i = 0; i < elements.length; i++) {\n elements[i].setEnabled(true);\n }\n }", "title": "" }, { "docid": "afeebf41dc25d8246ec4b58b8da17ea4", "score": "0.56235737", "text": "function disable() {\n\t\treset();\n\t\tif(window.removeEventListener) {\n\t\t\tdocument.removeEventListener('keydown', keydown, false);\n\t\t\tdocument.removeEventListener('keyup', keyup, false);\n\t\t\twindow.removeEventListener('blur', reset, false);\n\t\t\twindow.removeEventListener('webkitfullscreenchange', reset, false);\n\t\t\twindow.removeEventListener('mozfullscreenchange', reset, false);\n\t\t} else if(window.detachEvent) {\n\t\t\tdocument.detachEvent('onkeydown', keydown);\n\t\t\tdocument.detachEvent('onkeyup', keyup);\n\t\t\twindow.detachEvent('onblur', reset);\n\t\t}\n\t}", "title": "" }, { "docid": "afeebf41dc25d8246ec4b58b8da17ea4", "score": "0.56235737", "text": "function disable() {\n\t\treset();\n\t\tif(window.removeEventListener) {\n\t\t\tdocument.removeEventListener('keydown', keydown, false);\n\t\t\tdocument.removeEventListener('keyup', keyup, false);\n\t\t\twindow.removeEventListener('blur', reset, false);\n\t\t\twindow.removeEventListener('webkitfullscreenchange', reset, false);\n\t\t\twindow.removeEventListener('mozfullscreenchange', reset, false);\n\t\t} else if(window.detachEvent) {\n\t\t\tdocument.detachEvent('onkeydown', keydown);\n\t\t\tdocument.detachEvent('onkeyup', keyup);\n\t\t\twindow.detachEvent('onblur', reset);\n\t\t}\n\t}", "title": "" }, { "docid": "f4f20fcd181b32422004c89a2f37e255", "score": "0.56114936", "text": "disableDraggableHandlers() {}", "title": "" }, { "docid": "f09fbe05db224993d1488b5487c342ea", "score": "0.5610687", "text": "function disableAllInterfaceOnSubmit() {\n $('.disable-all-on-Submit').prop('disabled', true);\n $('.disable-all-on-Submit').css({ cursor: 'not-allowed' });\n} //disable all interface on submit end", "title": "" }, { "docid": "5799e1e929964af6c45e95276c11f113", "score": "0.5610103", "text": "function enable_inputs() {\n $(\"#Country\").prop('disabled', false);\n $(\"#Years\").prop('disabled', false);\n $(\"#ProductCategory\").prop('disabled', false);\n $(\"#Dimension\").prop('disabled', false);\n}", "title": "" }, { "docid": "f36f301e16afbeccde6155d9942d87cd", "score": "0.56044734", "text": "function bindEventsToInput(element) {\n element._input.addEventListener('keydown', function (e) {\n if (element.busy && e.keyCode === _keyCode2.default.SPACE) {\n e.preventDefault();\n }\n });\n // prevent toggle can be trigger through SPACE key on Firefox\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n element._input.addEventListener('click', function (e) {\n if (element.busy) {\n e.preventDefault();\n }\n });\n }\n}", "title": "" }, { "docid": "122f3d939890c85f8fea3e0c418e2d90", "score": "0.5586159", "text": "function disable(){enabled=false;}", "title": "" }, { "docid": "7b50526ca23e171529e0d3c8f80c1852", "score": "0.55694914", "text": "_registerEvents() {\n this._registerMouseEvents();\n this._registerKeyboardEvents();\n }", "title": "" }, { "docid": "753b3bf5db9348353ae8a90131aea270", "score": "0.5567921", "text": "function setControls(isDisable){\n\tdocument.getElementById(\"animation\").disabled = isDisable;\n\tdocument.getElementById(\"stop\").disabled =! isDisable;\n\tdocument.getElementById(\"start\").disabled = isDisable;\n\tdocument.getElementById(\"turbo\").disabled =! isDisable;\n\tdocument.getElementById(\"turbo\").checked =! isDisable;\n\tdocument.getElementById(\"playarea\").readOnly = isDisable;\n}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5567828", "text": "function disabled(){}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5567828", "text": "function disabled(){}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5567828", "text": "function disabled(){}", "title": "" }, { "docid": "fe0252a972c88c2f608a20be182ac51c", "score": "0.5567828", "text": "function disabled(){}", "title": "" }, { "docid": "17488349a17d4e52dd4c14817bc3cd12", "score": "0.5567199", "text": "setEnable() {\n this.setFrame(0);\n this.setInteractive();\n this.enable = true;\n }", "title": "" }, { "docid": "17fed8395f3d10e4400033caf1d242f8", "score": "0.5565608", "text": "function disableInputs(enable) {\n $(\"#btn-save-draft\").prop('disabled', enable);\n $(\"#btn-publish\").prop('disabled', enable);\n $(\"#post-title\").prop('disabled', enable);\n $(\"#post-category\").prop('disabled', enable);\n $(\".preview-input\").prop('disabled', enable);\n}", "title": "" }, { "docid": "93f39e44932111050436c8d823dd52ca", "score": "0.55617607", "text": "enable() {\n this._isEnabled = true\n }", "title": "" }, { "docid": "cff4dcd32ff4c2877e072327e729ccfe", "score": "0.5557555", "text": "function disable()\r\n{\r\n document.getElementById(\"bbtn\").disabled = true;\r\n document.getElementById(\"qbtn\").disabled = true;\r\n document.getElementById(\"mbtn\").disabled = true;\r\n document.getElementById(\"hbtn\").disabled = true;\r\n document.getElementById(\"ibtn\").disabled = true;\r\n document.getElementById(\"sbtn\").disabled = true;\r\n inp_as.disabled=true;\r\n inp_gen.disabled=true;\r\n inp_aspeed.disabled=true;\r\n}", "title": "" }, { "docid": "643d508ea7419417e3c091f775dbc31f", "score": "0.5551451", "text": "function disabledInputsONU(flag) {\n\t\t\n\t\tif(flag) {\n\t\t\t\n\t\t\t$('#snDescripcion').attr('disabled', true);\n\t\t\t$('#macDescripcion').attr('disabled', true);\n\t\t\t$('#wifissid').attr('disabled', true);\n\t\t\t$('#wifiPassword').attr('disabled', true);\n\t\t}\n\t\telse {\n\t\t\t$('#snDescripcion').attr('disabled', false);\n\t\t\t$('#macDescripcion').attr('disabled', false);\n\t\t\t$('#wifissid').attr('disabled', false);\n\t\t\t$('#wifiPassword').attr('disabled', false);\n\t\t}\n\t}", "title": "" }, { "docid": "57e48b256d99eb869b54f770e36e6af4", "score": "0.5546845", "text": "disable() {\n this.$window.off('keydown', this.onKeydownHandler);\n this.$window.off('keyup', this.onKeyupHandler);\n // uncomment only after `.on()` for this event has been implemented.\n // this.$commandInput.off('DOMMouseScroll mousewheel', this.onMouseScrollHandler);\n this.$canvases.off('mousemove', this.onMouseClickAndDragHandler);\n this.$canvases.off('mouseup', this.onMouseUpHandler);\n this.$canvases.off('mousedown', this.onMouseDownHandler);\n this.$canvases.off('dblclick', this.onMouseDblclickHandler);\n this.$body.removeEventListener('contextmenu', (event) => event.preventDefault());\n\n this._eventBus.off(EVENT.STRIP_CLICK, this.selectAircraftByCallsign);\n\n return this.destroy();\n }", "title": "" }, { "docid": "82ec708263d4c01fd9a6c8bd065aa82a", "score": "0.5545547", "text": "function disableUI () {\n\n fileButton.disabled = true;\n downsampleButton.disabled = true;\n selectionRadios[0].disabled = true;\n selectionRadios[1].disabled = true;\n\n sampleRateRadioHolder.style.display = 'none';\n disabledSampleRateRadioHolder.style.display = '';\n\n uiOutput.disableOutputCheckbox();\n uiOutput.disableOutputButton();\n\n prefixCheckbox.disabled = true;\n prefixInput.disabled = true;\n\n}", "title": "" }, { "docid": "e8a22717f68a75d9fea0dda5f863fa5b", "score": "0.5541476", "text": "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n EventManager.off('raf', this.onRaf)\n }", "title": "" }, { "docid": "37b00e09f6c19ab72cd6145c60ecc420", "score": "0.55389017", "text": "function enable() {\n enabled = true;\n }", "title": "" }, { "docid": "517e698aba0de25028ee707cba20ba47", "score": "0.55326694", "text": "function turnOnEvents() {\n // start the interval timer\n updateInterval = setInterval(update, 1000 / FPS);\n // turn on event handlers\n $(document).on('keydown', handleKeyDown);\n $(document).on('keyup', handleKeyUp); \n \n }", "title": "" }, { "docid": "9a5f077446a0ffaa35e7603c0e53736a", "score": "0.5531653", "text": "enable() {\n\t\t\tthis.switch.classList.remove('disabled');\n\t\t\tthis.switch.removeAttribute('disabled');\n\t\t\tthis.element.removeAttribute('disabled');\n\t\t}", "title": "" }, { "docid": "d22f24fc2d67ebfb52d34fb1152c63ab", "score": "0.5530169", "text": "function disable () {\n buttons = []\n update()\n}", "title": "" }, { "docid": "b51b2c534a5fd935624e81f7f4f94c64", "score": "0.55287415", "text": "function enabledFormAllField() {\n $(\"#statusSelector\").removeAttr(\"disabled\", \"disabled\");\n $(\"#pathSelector\").removeAttr(\"disabled\", \"disabled\");\n $(\"#batchFileSelector\").removeAttr(\"disabled\", \"disabled\");\n}", "title": "" }, { "docid": "b519b407493219fef09c9fe4399d8f87", "score": "0.55270594", "text": "function setEnabled(enable) {\r\n\t\t\t\t\t$(element).find(\"input\")[0].disabled = enable?false:\"disabled\";\r\n\t\t\t\t}", "title": "" }, { "docid": "c064ce72e5c7a06a5f8cffce75be11af", "score": "0.5523933", "text": "enable() {\n this.element.prop('disabled', false);\n }", "title": "" }, { "docid": "bb30cf346be09892f92eecd2e0e34018", "score": "0.55131876", "text": "disableButtons() {\n\t\tdocument.getElementById('normalAttack').disabled = true;\n\t\tdocument.getElementById('specialAttack').disabled = true;\n\t\tthis.selectedButton = '';\n\t}", "title": "" }, { "docid": "c1ec9f646f94098feb830b52b1576920", "score": "0.55043805", "text": "function enable() {\n enabled = true;\n }", "title": "" }, { "docid": "bda35d9352a688005952075b11fa353f", "score": "0.5502644", "text": "function opOn(){\n document.getElementById('multiply').disabled = false;\n document.getElementById('divide').disabled = false;\n document.getElementById('add').disabled = false;\n}", "title": "" }, { "docid": "e9464069e8b2ae36be64ea0bfd8d3d9d", "score": "0.5498014", "text": "function disableListeners() {\n\n\t\t//turn off OK listener\n\t\t$('button[data-button-id=\"' + Dialog.DIALOG_BTN_OK + '\"').off('click');\n\n\t\t//turn off ESCAPE listener\n\t\t$(document).off('keyup');\n\n\t\t//turn off CANCEL listener\n\t\t$('button[data-button-id=\"' + Dialog.DIALOG_BTN_CANCEL + '\"').off('click');\n\n\t}", "title": "" }, { "docid": "1b8a968306181ce717db380adb545edf", "score": "0.5497663", "text": "function disableInput() {\n\t\t$( '[type=text], [type=number], [type=email], select' ).each( function () {\n\t\t\t$( this ).attr( 'disabled', true );\n\t\t} );\n\t}", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "5eea5e8271cde8e4262dcf0b5ccd3411", "score": "0.5497238", "text": "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "title": "" }, { "docid": "57f0d23e5fe10f2ff01a0076fcd0be76", "score": "0.5490603", "text": "function enableAll() {\n var cmdhnd = myDiagram.commandHandler;\n enable(\"Rename\", myDiagram.selection.count > 0);\n enable(\"Undo\", cmdhnd.canUndo());\n enable(\"Redo\", cmdhnd.canRedo());\n enable(\"Cut\", cmdhnd.canCutSelection());\n enable(\"Copy\", cmdhnd.canCopySelection());\n enable(\"Paste\", cmdhnd.canPasteSelection());\n enable(\"Delete\", cmdhnd.canDeleteSelection());\n enable(\"SelectAll\", cmdhnd.canSelectAll());\n enable(\"AlignLeft\", cmdhnd.canAlignSelection());\n enable(\"AlignRight\", cmdhnd.canAlignSelection());\n enable(\"AlignTop\", cmdhnd.canAlignSelection());\n enable(\"AlignBottom\", cmdhnd.canAlignSelection());\n enable(\"AlignCenterX\", cmdhnd.canAlignSelection());\n enable(\"AlignCenterY\", cmdhnd.canAlignSelection());\n enable(\"AlignRow\", cmdhnd.canAlignSelection());\n enable(\"AlignColumn\", cmdhnd.canAlignSelection());\n enable(\"AlignGrid\", cmdhnd.canAlignSelection());\n enable(\"Rotate45\", cmdhnd.canRotate(45));\n enable(\"Rotate_45\", cmdhnd.canRotate(-45));\n enable(\"Rotate90\", cmdhnd.canRotate(90));\n enable(\"Rotate_90\", cmdhnd.canRotate(-90));\n enable(\"Rotate180\", cmdhnd.canRotate(180));\n}", "title": "" }, { "docid": "e9945f07076eb729786ae4dc6b9bf164", "score": "0.5481432", "text": "function enableButtons() {\n choiceA.disabled = false;\n choiceB.disabled = false;\n choiceC.disabled = false;\n choiceD.disabled = false;\n}", "title": "" }, { "docid": "985abd559d9b73feaeb4ab95d92f6bd1", "score": "0.5477954", "text": "function disabled() {}", "title": "" }, { "docid": "985abd559d9b73feaeb4ab95d92f6bd1", "score": "0.5477954", "text": "function disabled() {}", "title": "" }, { "docid": "985abd559d9b73feaeb4ab95d92f6bd1", "score": "0.5477954", "text": "function disabled() {}", "title": "" }, { "docid": "985abd559d9b73feaeb4ab95d92f6bd1", "score": "0.5477954", "text": "function disabled() {}", "title": "" }, { "docid": "985abd559d9b73feaeb4ab95d92f6bd1", "score": "0.5477954", "text": "function disabled() {}", "title": "" } ]
d1ff1d51ebf0342f84f9a76129a21a4c
Convert a string into the corresponding DType.
[ { "docid": "f8f627404133a7f73c406471889df8cf", "score": "0.7146954", "text": "function stringToDType(dtype) {\n switch (dtype) {\n case 'float32':\n return 'float32';\n default:\n throw new errors_1.ValueError(\"Invalid dtype: \" + dtype);\n }\n}", "title": "" } ]
[ { "docid": "27af887f81f6d996384fce7e130d7a75", "score": "0.6375772", "text": "function descriptor2typestr(type_str) {\n var c = type_str[0];\n if (c in exports.internal2external)\n return exports.internal2external[c];\n if (c === 'L')\n return type_str.slice(1, -1);\n if (c === '[')\n return type_str;\n // no match\n throw new Error(\"Unrecognized type string: \" + type_str);\n}", "title": "" }, { "docid": "6027e46f385f22e64e6965633c654597", "score": "0.59878826", "text": "function stringToType(input) {\n var ast = myna_1.Myna.parse(myna_1.Myna.grammars['cat'].typeExpr, input);\n return astToType(ast);\n }", "title": "" }, { "docid": "5f7dae33219c3ca0c9ff66fae4d2a97b", "score": "0.5873646", "text": "function valueFromString(type, value) {\n switch (type) {\n case 'integer':\n var res = parseInt(value, 10);\n if (isNaN(res)) {\n this.valueType = \"string\";\n res = value ? value.toString() : '';\n }\n return res;\n case 'number':\n var res = parseFloat(value);\n if (isNaN(res)) {\n this.valueType = \"string\";\n res = value ? value.toString() : '';\n }\n return res;\n case 'boolean':\n return (/true/i.exec(value) !== null || value === '1');\n case 'string':\n return value ? value.toString() : '';\n case 'object':\n return JSON.parse(value);\n default:\n // T0 DO retrieve type from name and call a fromString method\n return value;\n }\n }", "title": "" }, { "docid": "72603a08c35b85de226eac115ce3da6a", "score": "0.58419484", "text": "function typestr2descriptor(type_str) {\n if (exports.external2internal[type_str] !== void 0) {\n return exports.external2internal[type_str];\n }\n else if (type_str[0] === '[') {\n return type_str;\n }\n else {\n return \"L\" + type_str + \";\";\n }\n}", "title": "" }, { "docid": "faf7e27f5dfc0b63a7aac94599368175", "score": "0.57361555", "text": "function checkType(str) {\n var obj = {\n datatype: typeof str,\n length: str.length,\n }\n return obj;\n}", "title": "" }, { "docid": "62d9e1c21670f5e312b5d7545abe5abb", "score": "0.56840986", "text": "function ctParseType(str)\n{\n\tvar begInd, endInd;\n\tvar type, len;\n\tif (typeof (str) != 'string')\n\t\tthrow (new Error('type must be a Javascript string'));\n\n\tendInd = str.lastIndexOf(']');\n\tif (endInd == -1) {\n\t\tif (str.lastIndexOf('[') != -1)\n\t\t\tthrow (new Error('found invalid type with \\'[\\' but ' +\n\t\t\t 'no corresponding \\']\\''));\n\n\t\treturn ({ type: str });\n\t}\n\n\tbegInd = str.lastIndexOf('[');\n\tif (begInd == -1)\n\t\tthrow (new Error('found invalid type with \\']\\' but ' +\n\t\t 'no corresponding \\'[\\''));\n\n\tif (begInd >= endInd)\n\t\tthrow (new Error('malformed type, \\']\\' appears before \\'[\\''));\n\n\ttype = str.substring(0, begInd);\n\tlen = str.substring(begInd + 1, endInd);\n\n\treturn ({ type: type, len: len });\n}", "title": "" }, { "docid": "62d9e1c21670f5e312b5d7545abe5abb", "score": "0.56840986", "text": "function ctParseType(str)\n{\n\tvar begInd, endInd;\n\tvar type, len;\n\tif (typeof (str) != 'string')\n\t\tthrow (new Error('type must be a Javascript string'));\n\n\tendInd = str.lastIndexOf(']');\n\tif (endInd == -1) {\n\t\tif (str.lastIndexOf('[') != -1)\n\t\t\tthrow (new Error('found invalid type with \\'[\\' but ' +\n\t\t\t 'no corresponding \\']\\''));\n\n\t\treturn ({ type: str });\n\t}\n\n\tbegInd = str.lastIndexOf('[');\n\tif (begInd == -1)\n\t\tthrow (new Error('found invalid type with \\']\\' but ' +\n\t\t 'no corresponding \\'[\\''));\n\n\tif (begInd >= endInd)\n\t\tthrow (new Error('malformed type, \\']\\' appears before \\'[\\''));\n\n\ttype = str.substring(0, begInd);\n\tlen = str.substring(begInd + 1, endInd);\n\n\treturn ({ type: type, len: len });\n}", "title": "" }, { "docid": "62d9e1c21670f5e312b5d7545abe5abb", "score": "0.56840986", "text": "function ctParseType(str)\n{\n\tvar begInd, endInd;\n\tvar type, len;\n\tif (typeof (str) != 'string')\n\t\tthrow (new Error('type must be a Javascript string'));\n\n\tendInd = str.lastIndexOf(']');\n\tif (endInd == -1) {\n\t\tif (str.lastIndexOf('[') != -1)\n\t\t\tthrow (new Error('found invalid type with \\'[\\' but ' +\n\t\t\t 'no corresponding \\']\\''));\n\n\t\treturn ({ type: str });\n\t}\n\n\tbegInd = str.lastIndexOf('[');\n\tif (begInd == -1)\n\t\tthrow (new Error('found invalid type with \\']\\' but ' +\n\t\t 'no corresponding \\'[\\''));\n\n\tif (begInd >= endInd)\n\t\tthrow (new Error('malformed type, \\']\\' appears before \\'[\\''));\n\n\ttype = str.substring(0, begInd);\n\tlen = str.substring(begInd + 1, endInd);\n\n\treturn ({ type: type, len: len });\n}", "title": "" }, { "docid": "55270d2a76ab1c94e7854876e4086871", "score": "0.56775993", "text": "function fromDescriptorType(type) {\n switch (type) {\n // 0 is reserved for errors\n case 1: return \"double\";\n case 2: return \"float\";\n case 3: return \"int64\";\n case 4: return \"uint64\";\n case 5: return \"int32\";\n case 6: return \"fixed64\";\n case 7: return \"fixed32\";\n case 8: return \"bool\";\n case 9: return \"string\";\n case 12: return \"bytes\";\n case 13: return \"uint32\";\n case 15: return \"sfixed32\";\n case 16: return \"sfixed64\";\n case 17: return \"sint32\";\n case 18: return \"sint64\";\n }\n throw Error(\"illegal type: \" + type);\n}", "title": "" }, { "docid": "d1fe2e57333ae2fda43f156d88d5068f", "score": "0.56676763", "text": "function validateType(tstr){\n let retVal = Type.NOT_A_TYPE;\n if(tstr != Type.NOT_A_TYPE){\n for(const t in Type){\n // If a valid type (not NOT_A_TYPE) and symbol string matches given string:\n if(Type[t] && String(Type[t]).slice(7, -1) == tstr){\n retVal = Type[t];\n break;\n }\n }\n }\n\n return retVal;\n} // #validateType", "title": "" }, { "docid": "b2ee4debbb073f04a036f5918e7abdc8", "score": "0.56365925", "text": "function GetDataType(t) {\n var t = t.toLowerCase();\n ret = {type: \"string\" , class: \"center\"};\n if ( t == \"i\" || t.indexOf(\"float\") >= 0 || t.indexOf(\"double\") >= 0 ||\n t.indexOf(\"int\") >= 0 || t.startsWith(\"real\") ||\n t.indexOf(\"long\") >= 0 || t.startsWith(\"numeric\") ) {\n ret = {type: \"number\", class: \"right\"}\n } else if (t.indexOf(\"date\") >= 0 || t.indexOf(\"time\") >= 0 ) {\n ret ={ type: \"datetime\"}\n } else if (t.indexOf(\"bool\") >= 0) {\n ret = {type: \"boolean\" , class: \"center\"};\n }\n return ret;\n}", "title": "" }, { "docid": "d1382d32a0cf6193696fa75abb964b30", "score": "0.559394", "text": "function deserialize(str, type=null) {\n if (type !== null) {\n type = get_DS(structure);\n }\n switch (type) {\n case \"array\":\n return structure.toString();\n case \"array_2d\":\n return serialize_2d(structure);\n default:\n return \"ERROR: UNRECOGNIZED DATA STRUCTURE\";\n }\n}", "title": "" }, { "docid": "07868c2286f47829df24be03ffd4c48e", "score": "0.5545497", "text": "function typeCast(name, value, type) {\n if (!type) return value;\n if (value == null) return;\n if (typeof value !== STRING) return value;\n\n switch (type) {\n case 'number': {\n return Number(value);\n }\n case 'boolean': {\n return (value.toLowerCase() === 'true');\n }\n case 'json': {\n if (value) {\n try {\n return JSON.parse(value);\n } catch (error) {\n throw new Error(`JSON invalid in ref ${name}: ${value}. Parse error: (${error})`);\n }\n }\n return {};\n }\n case 'jsonString': {\n // Stringify the jsonstring. This has the effect of double escaping the json, so that\n // when we go to parse the final template to apply it to kube, it doesnt mistakenly\n // turn our jsonString into actual json.\n const result = JSON.stringify(value);\n // JSON.stringify adds quotes around the newly created json string. Kube forces us\n // to wrap out curly braces in quotes so that it wont error on our templates. In order\n // to avoid having 2 double quotes around the result, we need to remove the stringify\n // quotes. slice(start of slice, end of slice)\n return result.slice(1, result.length - 1);\n }\n case 'base64': {\n return Buffer.from(value).toString('base64');\n }\n }\n}", "title": "" }, { "docid": "a610e87ea29a1b4f155fa1dd9f42399c", "score": "0.5472993", "text": "function inferType (_value) {\n\n\tvar x = String(_value),\n\t\ty = \"\";\n\n\tvar z = isA(_value);\n\n\tif (z !== 'string') {\n\n\t\ty = z;\n\n\t} else {\n\n\t\t// if string is exactly true, false, or null, use primitives\n\t\tif (x === 'null' || x === 'false' || x === 'true' ) { y = x; }\n\n\t\t// if the string contains ONLY numbers and periods, it's probably a number\n\t\telse if (x.match(/^[-]*[\\.\\deE\\+]+$/)) { y = 'number'; }\n\n\t\t// if the string begins with '{' or '[', use nesting type respectively\n\t\telse if (x.match(/^\\{/)) { y = 'object'; }\t// } for vim folding\t\n\t\telse if (x.match(/^\\[/)) { y = 'array'; }\t// } for vim folding\n\n\t\t// Otherwise, it's just a generic string\n\t\telse { y = 'string'}\n\n\t}\n\n\treturn y;\n\t\n}", "title": "" }, { "docid": "d562dc46c2c144986ddcc3ac99f9c384", "score": "0.5441265", "text": "function convert(value, ty) {\n if (ty === tyNumber) {\n return safeParseFloat(value);\n }\n if (ty === tyBool) {\n return safeParseBool(value);\n }\n if (ty === tyString) {\n return value.toString();\n }\n throw new Error('Cannot convert the given value to the given type');\n }", "title": "" }, { "docid": "37ae60b2ff420d63f74012797bb6b493", "score": "0.5407567", "text": "toType(arg, lowerCase = true) {\n var str, tok, typ;\n str = Object.prototype.toString.call(arg);\n tok = str.split(' ')[1];\n typ = tok.substring(0, tok.length - 1);\n typ = this.toMoreTypes(typ, arg);\n if (lowerCase) {\n return typ.toLowerCase();\n } else {\n return typ;\n }\n }", "title": "" }, { "docid": "b9efa7fb9791df090b3f47cac3c0c25e", "score": "0.53775024", "text": "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n } else if (typeof value === \"number\") {\n return \"\" + value;\n } else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n }", "title": "" }, { "docid": "35947ec548bc4a61b049340349dfea78", "score": "0.53487295", "text": "function parse(stringJson, type) {\n return decode(JSON.parse(stringJson), type)\n }", "title": "" }, { "docid": "54a03a94eca1b23414a580e9989290b6", "score": "0.5331912", "text": "convertFromString (strValue) {\n // return strValue;\n throw \"Conversion from string into entity property type is not specified for this editor.\";\n }", "title": "" }, { "docid": "6374b80f40ca1f53a7aeb12bd5fd7f3f", "score": "0.53183377", "text": "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "title": "" }, { "docid": "6374b80f40ca1f53a7aeb12bd5fd7f3f", "score": "0.53183377", "text": "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "title": "" }, { "docid": "6374b80f40ca1f53a7aeb12bd5fd7f3f", "score": "0.53183377", "text": "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "title": "" }, { "docid": "6374b80f40ca1f53a7aeb12bd5fd7f3f", "score": "0.53183377", "text": "function castString(value) {\n if (typeof value === \"string\") {\n return value;\n }\n else if (typeof value === \"number\") {\n return \"\" + value;\n }\n else {\n throw new Error(\"Expected a string or number but got \" + getType(value));\n }\n}", "title": "" }, { "docid": "44879d4058cdf96cbfecad1e2e04bb61", "score": "0.5314637", "text": "function typeStringToLength(str) {\n switch (str) {\n case \"float\":\n return 1;\n case \"vec2\":\n return 2;\n case \"vec3\":\n return 3;\n case \"vec4\":\n return 4;\n }\n}", "title": "" }, { "docid": "44879d4058cdf96cbfecad1e2e04bb61", "score": "0.5314637", "text": "function typeStringToLength(str) {\n switch (str) {\n case \"float\":\n return 1;\n case \"vec2\":\n return 2;\n case \"vec3\":\n return 3;\n case \"vec4\":\n return 4;\n }\n}", "title": "" }, { "docid": "cc0b49991901c447e0ded539f8e3c5f9", "score": "0.52843255", "text": "function isType(str, value){\n\n}", "title": "" }, { "docid": "fdabbfa7fc3cd5ec34b10baec962163b", "score": "0.52801436", "text": "function getType(str, expectedType) {\n if (isArray(str)) {\n return 'array';\n }\n else if (typeof str === 'boolean' || str === true || str === false) {\n return 'boolean';\n // ValidateInternals UpdateConfig shows true/false as string.\n // Avoid a type mismatch error if boolean is expected and we get string form\n } else if ((str === 'true' || str === 'false') && (!expectedType || expectedType === 'boolean')) {\n return 'boolean';\n } else if (!isNaN(str) && !isNaN(parseInt(str))) {\n return 'integer';\n } else if (isObject(str)) {\n return 'object';\n } else {\n return 'string';\n }\n}", "title": "" }, { "docid": "7fff15a4c9b018854465d5e0e6ccd7c1", "score": "0.5244183", "text": "get datatypeString() {\n // Find the last quotation mark (e.g., '\"abc\"^^http://ex.org/types#t')\n const id = this.id, dtPos = id.lastIndexOf('\"') + 1;\n const char = dtPos < id.length ? id[dtPos] : '';\n // If \"^\" it follows, return the remaining substring\n return char === '^' ? id.substr(dtPos + 2) :\n // If \"@\" follows, return rdf:langString; xsd:string otherwise\n (char !== '@' ? xsd.string : rdf.langString);\n }", "title": "" }, { "docid": "b7e8d8d79d8fca4d72db2aa1af904745", "score": "0.5232793", "text": "function JSONConverter(string) {\n //check if it's a primitive\n if (string === 'true') {\n return true;\n }\n if (string === 'false') {\n return false;\n }\n if (string === 'null') {\n return null;\n }\n\n //number\n if (!isNaN(string)) {\n return parseInt(string);\n }\n\n // checks if strings\n if (string[0] === '\"' || string[0] === \"'\") {\n return stringParser(string);\n }\n\n //arrays\n if (string[0] === '[') {\n return arrayParser(string);\n }\n\n //objects\n}", "title": "" }, { "docid": "1f6e58c9837e436e672962b9aabee8c4", "score": "0.52060753", "text": "function strToNum(string) {\n\t\tvar regex = /^(([0-9]+)|([0-9]+\\.[0-9]+)|(0b[01]+)|(0x[0-9a-f]+)|(0o[0-7]+))$/i;\n\t\tif (!regex.test(string)) return false;\n\t\tif (string.charAt(0) === \"0\" && string.length > 2) {\n\t\t\tvar sub = string.substr(2);\n\t\t\tswitch (string.charAt(1).toLowerCase()) {\n\t\t\t\tcase \"b\": return new Num(parseInt(sub, 2), false);\n\t\t\t\tcase \"o\": return new Num(parseInt(sub, 8), false);\n\t\t\t\tcase \"x\": return new Num(parseInt(sub, 16), false);\n\t\t\t}\n\t\t}\n\t\tif (indexOf(string, \".\") !== -1) {\n\t\t\treturn new Num(parseFloat(string), true);\n\t\t} else {\n\t\t\treturn new Num(parseInt(string), false);\n\t\t}\n\t}", "title": "" }, { "docid": "d3aabc09b330247e5a31dc4390e90799", "score": "0.5197354", "text": "function getFieldNameAndDataTypes (string) {\n // Trims the whitespace and slices the curly braces from the string. Then splits each key/value pair (string form) into an element into schemaArray\n let schema = string.trim().slice(1, -1).trim()\n if (schema[schema.length - 1] === ',') schema = schema.slice(0, -1)\n const schemaArray = schema.split(',')\n // Declare an empty object result\n const result = {}\n for (let i = 0; i < schemaArray.length; i++) {\n // Parses through each element in the schemaArray and creates a Javascript key/value pair in the result object\n const curElement = schemaArray[i].trim()\n const split = curElement.split(':')\n result[split[0].trim()] = split[1].trim()\n }\n // Return the result object\n return result\n}", "title": "" }, { "docid": "7d0ac1f96cbe2a42e67341e6bcc616b2", "score": "0.5193958", "text": "_parseDataType (value, dataType) {\n let parsedValue = null\n\n if (value !== undefined && value !== null) {\n switch (dataType) {\n case CommandLineArgumentDataType.Boolean:\n parsedValue = Boolean(value)\n break\n case CommandLineArgumentDataType.Number:\n parsedValue = Number(value)\n if (isNaN(parsedValue)) {\n parsedValue = null\n }\n break\n case CommandLineArgumentDataType.String:\n parsedValue = String(value)\n break\n default: {\n throw new Error(`Unknown data type '${dataType}.`)\n }\n }\n\n if (parsedValue === null) {\n throw new Error(`Could not parse value '${value}' to data type '${dataType}.`)\n }\n }\n\n return parsedValue\n }", "title": "" }, { "docid": "14d0afe4260431509cce84870eec8c0b", "score": "0.51694006", "text": "function physicalPropertyTypeOfValue(valueAsStr) {\n // If it is empty or enclosed in double-quotes, it's a string.\n if (\n valueAsStr.length === 0 ||\n (valueAsStr.startsWith('\"') && valueAsStr.endsWith('\"'))\n ) {\n return physicalPropertyType.string;\n }\n // If it does not contain anything but digits, '.', and optionally a '-'at the\n // beginning, then it's a number.\n else if (\n valueAsStr.search(/[^\\d.]/) === -1 ||\n (valueAsStr[0] === '-' && valueAsStr.substring(1).search(/[^\\d.]/) === -1)\n ) {\n return physicalPropertyType.number;\n }\n // If it contains binary-or characters, it's a flag sequence.\n else if (valueAsStr.includes('|')) {\n return physicalPropertyType.flags;\n }\n // Anything else is an identifier.\n else {\n return physicalPropertyType.identifier;\n }\n }", "title": "" }, { "docid": "36890868f4d033e19134201e02d8d6f5", "score": "0.5157926", "text": "function apiType(d) {\n\n switch (typeof d) {\n\n case 'number':\n return 'NUMBER';\n case 'object':\n if ($.type(d) == 'date')\n return 'DATETIME';\n else if ($.type(d) == 'null')\n return 'NONE';\n else\n return 'STRING';\n case 'undefined':\n return 'NONE';\n\n default:\n return 'STRING'\n }\n }", "title": "" }, { "docid": "92254003c3f26e986137a2fa4ca8c6b6", "score": "0.51554424", "text": "type(str) {\n return { commit: 'commit', tree: 'tree', blob: 'tree' }[str.split(' ')[0]] || 'blob';\n }", "title": "" }, { "docid": "678d246e69fb0a576c2ee101fcc260da", "score": "0.51368046", "text": "get datatypeString() {\n // Find the last quotation mark (e.g., '\"abc\"^^http://ex.org/types#t')\n const id = this.id,\n dtPos = id.lastIndexOf('\"') + 1;\n const char = dtPos < id.length ? id[dtPos] : ''; // If \"^\" it follows, return the remaining substring\n\n return char === '^' ? id.substr(dtPos + 2) : // If \"@\" follows, return rdf:langString; xsd:string otherwise\n char !== '@' ? xsd.string : rdf.langString;\n }", "title": "" }, { "docid": "812acab2c982827e9ad78a1f648dd097", "score": "0.51282334", "text": "_inferType(fieldName, dataset) {\n const sampleValue = dataset.getFirstValidValue(fieldName);\n\n return sampleValue !== null ? dl.type.infer([sampleValue]) :\n this._types[2];\n }", "title": "" }, { "docid": "8ae6ec3e0e4abd6e26a11e934beaa297", "score": "0.51213145", "text": "function get_component_type(type_str) {\n return type_str.slice(1);\n}", "title": "" }, { "docid": "bf6cd0013f27bbebc24362ff00792ff3", "score": "0.50910276", "text": "function cast(value, type) {\n switch (type) {\n case numberType:\n return Number(value);\n case stringType:\n return String(value);\n case boolType:\n return (value == 'true');\n default:\n return value;\n }\n }", "title": "" }, { "docid": "343e5f6d537625686496d1f94e1aee37", "score": "0.50831383", "text": "function valuify(string) {\n if (JSON_STRING.test(string)) {\n return JSON.parse(string);\n }\n return string;\n }", "title": "" }, { "docid": "412c3a1960c3b7e1740af92cdb14c2b8", "score": "0.5079238", "text": "function fromString(type) {\n var t = type.trim().toLowerCase();\n\n if (t === 'tap') {\n return GestureTypes.tap;\n } else if (t === 'doubletap') {\n return GestureTypes.doubleTap;\n } else if (t === 'pinch') {\n return GestureTypes.pinch;\n } else if (t === 'pan') {\n return GestureTypes.pan;\n } else if (t === 'swipe') {\n return GestureTypes.swipe;\n } else if (t === 'rotation') {\n return GestureTypes.rotation;\n } else if (t === 'longpress') {\n return GestureTypes.longPress;\n } else if (t === 'touch') {\n return GestureTypes.touch;\n }\n\n return undefined;\n}", "title": "" }, { "docid": "d312a71af8cc50b7788305bedeb7b919", "score": "0.5053321", "text": "type(string) {\n if (string) {\n this._type = string;\n let old = this.items();\n old[old.length - 1].type = this._type;\n return this;\n } else {\n return this._type;\n }\n }", "title": "" }, { "docid": "8b260515d6409fdc2b473dff8da2dbb1", "score": "0.50469464", "text": "function convertToPhysicalPropertyTypeValue(valueAsStr, type) {\n switch (type) {\n case physicalPropertyType.string: {\n return valueAsStr;\n }\n case physicalPropertyType.identifier: {\n return valueAsStr;\n }\n case physicalPropertyType.number: {\n return util.toNumber(valueAsStr);\n }\n case physicalPropertyType.flags: {\n return valueAsStr;\n }\n default: {\n throw new Error('Unexpected physical property type to convert to.');\n }\n }\n }", "title": "" }, { "docid": "df5a8b8ba5368ecd843f156a4bd66774", "score": "0.504538", "text": "function setType(key, value) {\n // Get the expected type for the given key\n var type = TYPES[key];\n\n // Type of a key is unknown, throw\n if (!type) {\n throw \"setType: Unknown type for key \" + key;\n }\n\n // Do the conversion or\n // throw if there is an unknown type\n switch (type) {\n case \"float\":\n case \"floatList\":\n return parseFloat(value);\n case \"int\":\n case \"intList\":\n return parseInt(value);\n case \"string\":\n case \"stringList\":\n case \"stringListWildcards\":\n return value;\n default:\n throw \"setType: Unknown conversion for key \" + key;\n }\n }", "title": "" }, { "docid": "9ab4396e9cd3991ee6b3387624785344", "score": "0.5037699", "text": "function parseType(t){\n\n\tvar colonIndex = t.indexOf(':');\n\t\n\tif(startsWith(t, 'set:')){\n\t\treturn {type: 'set', members: parseType(t.substr(4))};\n\t}else if(startsWith(t, 'list:')){\n\t\treturn {type: 'list', members: parseType(t.substr(5))};\n\t}else if(colonIndex !== -1){\n\t\tvar keyType = t.substr(0, colonIndex);\n\t\tvar valueType = t.substr(colonIndex+1);\n\t\treturn {type: 'map', key: parseType(keyType), value: parseType(valueType)};\n\t}else if(isPrimitive(t)){\n\t\tif(t === 'bool') t = 'boolean';\n\t\treturn {type: 'primitive', primitive: t};\n\t}else{\n\t\t_.assertDefined(t)\n\t\t_.assert(t !== 'undefined')\n\t\treturn {type: 'object', object: t};\n\t}\n}", "title": "" }, { "docid": "cb9fec165e55f77c82f6acf12123142f", "score": "0.50312436", "text": "static string(v) { return new Typed(_gaurd, \"string\", v); }", "title": "" }, { "docid": "ff393e4d21616a85c3ef17ba36656712", "score": "0.5004662", "text": "function stringToNumber(str) {\r\n const n2 = parseInt(str);\r\n const x = (typeof n2);\r\n \r\n return \"String \" + str +\r\n \" has been converted to : \" + x;\r\n}", "title": "" }, { "docid": "1b966719b1245ed81c5064aebe0a06b4", "score": "0.49943066", "text": "function typeadvD(typec) {\n /* Returns a dict about the type typec. */\n var x = typeobj[toTitleCase(typec)];\n return x;\n}", "title": "" }, { "docid": "7928daf0a20df7f540c1500a79655720", "score": "0.4994304", "text": "function castStrToDate(dateStr){\n\tvar splitSrtDate = dateStr.toString().split(dateDivider);\n\tvar date = new Date(parseInt(splitSrtDate[0]), parseInt(splitSrtDate[1])-1, parseInt(splitSrtDate[2]));\n\treturn date;\n}", "title": "" }, { "docid": "95ea254ef32981e22d035ff598f4141c", "score": "0.49738172", "text": "function type(input) {\n\n //If the input value is null, undefined or NaN the toStringTypes object shouldn't be used\n if (input === null || input === undefined || (input !== input && String(input) === \"NaN\")) {\n return String(input);\n }\n\n // use the typeMap to detect the type and fallback to object if the type wasn't found\n return typeMap[Object.prototype.toString.call(input)] || \"object\";\n}", "title": "" }, { "docid": "48d93a2d2e664f164bf09e872204a9f7", "score": "0.49480516", "text": "function Duck (str, pondDims) {\n this.coordinates = [ +spaceParse(str, 0), +spaceParse(str, 1) ]\n this.orientation = spaceParse(str, 2)\n this.pondSize = pondDims\n}", "title": "" }, { "docid": "06433867a05bbe01d1577ca4365a39d9", "score": "0.4937101", "text": "function isType(str, value){\n if (typeof str === typeof value){\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "f923ee815c8456a2282d49b49d787565", "score": "0.49330264", "text": "_convertReturnFct(fctName, rawVal)\n\t{\n\t\t\t//Return a char*\n\t\t\tif(fctName.includes(\"str_\"))\n\t\t\t{\n\t\t\t\tif(rawVal == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn this._memory.getStringAt(rawVal);\n\t\t\t}\n\t\t\t//Return a pointer\n\t\t\telse if(fctName.includes(\"pi_\")\n\t\t\t\t\t|| fctName.includes(\"pv_\")\n\t\t\t\t\t|| fctName.includes(\"pc_\"))\n\t\t\t{\n\t\t\t\treturn parseInt(rawVal);\n\t\t\t}\n\t\t\t//Return a ASCII char\n\t\t\telse if(rawVal <= 255 && fctName.startsWith(\"c_\"))\n\t\t\t\treturn String.fromCharCode(rawVal);\n\t\t\t//Return a int\n\t\t\telse if(fctName.includes(\"i_\") || fctName.includes(\"ui_\"))\n\t\t\t\treturn parseInt(rawVal);\n\t\t\t//Return an floating\n\t\t\telse if(fctName.includes(\"d_\"))\n\t\t\t\treturn parseFloat(rawVal);\n\t\t\telse if(fctName.includes(\"v_\"))\n\t\t\t\treturn undefined;\n\t\tthrow SyntaxError(`${this._name} Can't get the Datatype return type for: ${rawVal} for: ${fctName}`);\n\t}", "title": "" }, { "docid": "91093251effc96108ed510e8ad9a6846", "score": "0.49228606", "text": "_fromType(val) {\n if (this.convert && !this.overridden) {\n if (this._is(val, \"time\")) {\n return this.toSeconds(val);\n } else if (this._is(val, \"decibels\")) {\n return (0, _Conversions.dbToGain)(val);\n } else if (this._is(val, \"frequency\")) {\n return this.toFrequency(val);\n } else {\n return val;\n }\n } else if (this.overridden) {\n // if it's overridden, should only schedule 0s\n return 0;\n } else {\n return val;\n }\n }", "title": "" }, { "docid": "899b9ec264c548469cc7f4cd6d085147", "score": "0.49081498", "text": "function toType(v){return{}.toString.call(v).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();}", "title": "" }, { "docid": "efd7d40cbac0496d439906af93ae5a8a", "score": "0.4888145", "text": "function interpretType(type) {\n switch (type) {\n case \"s\": return \"Stamped Letter\";\n case \"m\": return \"Metered Letter\";\n case \"f\": return \"Large Envelope\";\n case \"p\": return \"Parcel\";\n default:\n return type;\n }\n}", "title": "" }, { "docid": "4365a5a7af3f3bb66dc5e4bea5f3ae44", "score": "0.48780698", "text": "function castFieldValue(fieldName, value){\n var field, retValue;\n if (objectType(fieldName) === 'string') field = fields[fieldName];\n if (field === undefined) field = appendField(fieldName);\n\n switch (field.type){\n case \"integer\":\n case \"cents\":\n if (objectType(value) === 'number')\n return value;\n else\n return parseInt(value, 10);\n case \"float\":\n case \"currency\":\n if (objectType(value) === 'number')\n return value;\n else\n return parseFloat(value, 10);\n case \"date\":\n case \"time\":\n switch (objectType(value)){\n case 'number':\n case 'date':\n return value;\n default:\n if (/^\\d+$/.test(value))\n return parseInt(value);\n else\n return Date.parse(value);\n };\n default:\n return value.toString();\n }\n }", "title": "" }, { "docid": "6c52135bd3329913e50d3cbe774aaaac", "score": "0.4873082", "text": "function decodeTyped(){\n let res;\n let type = readByte();\n switch(type){ // Read Type\n case 0:\n res = readInt16();\n break;\n case 1:\n res = readAscii();\n break;\n case 2:\n res = readByte();\n break;\n case 3:\n res = readFloat32();\n break;\n case 4:\n res = readInt32();\n }\n\n return res;\n}", "title": "" }, { "docid": "4088df95b8e0cfc2264184ae3a698c17", "score": "0.48478353", "text": "function convertString(text, type, opts) {\n\n\tswitch(type){\n\tcase 'number':\n\t\treturn toNumber(text, opts);\n\tcase 'boolean':\n\t\treturn convertToBoolean(text, opts);\n\tdefault:\n\t\treturn text;\n\t}\n\n\n}", "title": "" }, { "docid": "59e4b12facefd28dfcf10dff666abb3d", "score": "0.48446938", "text": "function data_type(value)\r\n{\r\nvar dtypes = [Function, RegExp, Number, String, Boolean, Object], x, len;\r\n \r\nif (typeof value === \"object\" || typeof value === \"function\") \r\n {\r\n for (x = 0, len = dtypes.length; x < len; x++) \r\n {\r\n if (value instanceof dtypes[x])\r\n {\r\n return dtypes[x];\r\n }\r\n }\r\n }\r\n \r\n return typeof value;\r\n}", "title": "" }, { "docid": "afcbba9cddfe3b10bef6b72733fa71a4", "score": "0.48426598", "text": "function typeOf(input) {\r\n\r\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.48418954", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" }, { "docid": "033843c457104a72807e7697a4caaeb9", "score": "0.4838044", "text": "function getLiteralType (literal) {\n var match = /^\"[^]*\"(?:\\^\\^([^\"]+)|(@)[^@\"]+)?$/.exec(literal);\n if (!match)\n throw new Error(literal + ' is not a literal');\n return match[1] || (match[2] ? RdfLangString : XsdString);\n }", "title": "" }, { "docid": "0a57418609efec0d933974a20f3354fc", "score": "0.48150218", "text": "function contentTypes__deserialize(str, type) {\n\tif (!str || typeof(str) != 'string' || !type) {\n\t\treturn str;\n\t}\n\tvar fn = contentTypes__find(type, 'deserializer');\n\tif (!fn) {\n\t\treturn str;\n\t}\n\treturn fn(str);\n}", "title": "" }, { "docid": "afe619da9de6c8987ceb2594cffea7bb", "score": "0.48035368", "text": "function h$fromHsString(str) {\n var xs = '';\n while(str.f.a === 2) {\n if(typeof str.d1 === 'number') {\n xs += String.fromCharCode(str.d1);\n } else {\n xs += String.fromCharCode(str.d1.d1); // unbox_e\n }\n str = str.d2;\n }\n return xs;\n}", "title": "" }, { "docid": "afe619da9de6c8987ceb2594cffea7bb", "score": "0.48035368", "text": "function h$fromHsString(str) {\n var xs = '';\n while(str.f.a === 2) {\n if(typeof str.d1 === 'number') {\n xs += String.fromCharCode(str.d1);\n } else {\n xs += String.fromCharCode(str.d1.d1); // unbox_e\n }\n str = str.d2;\n }\n return xs;\n}", "title": "" }, { "docid": "01af1494a5704725107ccbe12cc03104", "score": "0.48017228", "text": "static fromString(s) {\n const data = multibase_1.default.decode(s);\n return this.fromBytes(data);\n }", "title": "" }, { "docid": "01af1494a5704725107ccbe12cc03104", "score": "0.48017228", "text": "static fromString(s) {\n const data = multibase_1.default.decode(s);\n return this.fromBytes(data);\n }", "title": "" }, { "docid": "b7b86f3f15b0850f18686c360cc53104", "score": "0.48007217", "text": "function handleDataType(valueType, value, compoundValue) {\n\t\t\tif(compoundValue){\n\t\t\t\treturn new astNodesLib.UOMLiteralNode(compoundValue.value, valueType, compoundValue.constant); \n\t\t\t}\n\t\t\treturn new astNodesLib.LiteralNode(value, valueType);\n\t\t}", "title": "" }, { "docid": "b377e78122960d4938d4b5e607bcdf94", "score": "0.4790413", "text": "function sfTypeToApexType(input){\n\n var output = '';\n\n if(input === 'Text'){\n return output = 'string';\n }else if(input === 'Number'){\n return output = 'double';\n }if(input === 'Checkbox'){\n return output = 'boolean';\n }if(input === 'TextArea'){\n return output = 'string';\n };\n\n }", "title": "" }, { "docid": "822bc57f02042eeca6d39366a66351ac", "score": "0.47891828", "text": "function parse (string) {\n const isoish = /^\\d\\d\\d\\d-\\d\\d-\\d\\d.*/.test(string)\n if (isoish) return parseISO(string)\n\n return parseNumber(string)\n}", "title": "" }, { "docid": "68b0d9aeb5f4026e85c28271f4af8002", "score": "0.47868034", "text": "function _agb_syntax_do_type(struct) {\n\tif (_agb_syntax_is(struct, _AGB_TOKEN.NUM)) {\n\t\tvar token = _agb_syntax_do(struct, _AGB_TOKEN.NUM);\n\t\treturn new _agb_number_type(token);\n\t} else if (_agb_syntax_is(struct, _AGB_TOKEN.STR)) {\n\t\tvar token = _agb_syntax_do(struct, _AGB_TOKEN.STR);\n\t\treturn new _agb_string_type(token);\n\t} else if (_agb_syntax_is(struct, _AGB_TOKEN.BOOL)) {\n\t\tvar token = _agb_syntax_do(struct, _AGB_TOKEN.BOOL);\n\t\treturn new _agb_boolean_type(token);\n\t} else if (_agb_syntax_is(struct, _AGB_TOKEN.OBJ)) {\n\t\tvar token = _agb_syntax_do(struct, _AGB_TOKEN.OBJ);\n\t\treturn new _agb_obj_type(token);\n\t} else {\n\t\tvar token = _agb_syntax_do_id(struct);\n\t\treturn new _agb_type(token);\n\t}\n}", "title": "" }, { "docid": "009202414cf6adb0fe1bad06206b8297", "score": "0.47739953", "text": "static toType(obj) {\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n if (obj == null) {\n return obj + \"\";\n }\n //isNumeric toType\n // Support: Android <=2.3 only (functionish RegExp)\n return typeof obj === \"object\" ?\n class2type[toString.call(obj)] || \"object\" :\n typeof obj;\n }", "title": "" }, { "docid": "4b63bf82945e3c37da8d1850619988d5", "score": "0.4773715", "text": "_fromType(val) {\n if (this.convert && !this.overridden) {\n if (this._is(val, \"time\")) {\n return this.toSeconds(val);\n }\n else if (this._is(val, \"decibels\")) {\n return (0,_type_Conversions__WEBPACK_IMPORTED_MODULE_0__.dbToGain)(val);\n }\n else if (this._is(val, \"frequency\")) {\n return this.toFrequency(val);\n }\n else {\n return val;\n }\n }\n else if (this.overridden) {\n // if it's overridden, should only schedule 0s\n return 0;\n }\n else {\n return val;\n }\n }", "title": "" }, { "docid": "4b63bf82945e3c37da8d1850619988d5", "score": "0.4773715", "text": "_fromType(val) {\n if (this.convert && !this.overridden) {\n if (this._is(val, \"time\")) {\n return this.toSeconds(val);\n }\n else if (this._is(val, \"decibels\")) {\n return (0,_type_Conversions__WEBPACK_IMPORTED_MODULE_0__.dbToGain)(val);\n }\n else if (this._is(val, \"frequency\")) {\n return this.toFrequency(val);\n }\n else {\n return val;\n }\n }\n else if (this.overridden) {\n // if it's overridden, should only schedule 0s\n return 0;\n }\n else {\n return val;\n }\n }", "title": "" }, { "docid": "b63b24207a3cfb403abd64b24b002008", "score": "0.477229", "text": "function typeOf(input) {\n\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t\t}", "title": "" }, { "docid": "d504317612b2dfec0ed7600c6a1593e5", "score": "0.47687835", "text": "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "title": "" }, { "docid": "d504317612b2dfec0ed7600c6a1593e5", "score": "0.47687835", "text": "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "title": "" }, { "docid": "d504317612b2dfec0ed7600c6a1593e5", "score": "0.47687835", "text": "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "title": "" }, { "docid": "d504317612b2dfec0ed7600c6a1593e5", "score": "0.47687835", "text": "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "title": "" }, { "docid": "d504317612b2dfec0ed7600c6a1593e5", "score": "0.47687835", "text": "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "title": "" }, { "docid": "84e6f52afe2a0a30817109cbaa927158", "score": "0.4748266", "text": "static castToType(val, type) {\n switch (type.toLowerCase()) {\n case 'boolean':\n return Boolean(val);\n case 'boolstring':\n return String(val) === 'true';\n case 'number':\n return Number(val);\n case 'string':\n return String(val);\n default:\n return val;\n }\n }", "title": "" }, { "docid": "0e1cd9c00de430159d3dd492bc55f54f", "score": "0.4741615", "text": "function guessFieldTypeFromValue(v) {\n if (v instanceof Date || isDateTime(v)) {\n return exports.FieldType.time;\n }\n if (_.isNumber(v)) {\n return exports.FieldType.number;\n }\n if (_.isString(v)) {\n if (NUMBER.test(v)) {\n return exports.FieldType.number;\n }\n if (v === 'true' || v === 'TRUE' || v === 'True' || v === 'false' || v === 'FALSE' || v === 'False') {\n return exports.FieldType.boolean;\n }\n return exports.FieldType.string;\n }\n if (_.isBoolean(v)) {\n return exports.FieldType.boolean;\n }\n return exports.FieldType.other;\n}", "title": "" }, { "docid": "a20ccf8b16c991c8d125cc01ccd3af76", "score": "0.47244462", "text": "function stringToJsonObject() {\n return function (name, mixed) {\n if (typeof mixed != \"string\") {\n try {\n var str = JSON.stringify(mixed);\n if (typeof str == \"string\" && str[0] == \"{\") {\n if (type_util_1.isBigIntNativelySupported() || !type_util_1.isBigInt(mixed)) {\n return JSON.parse(str);\n }\n }\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; received \" + type_util_1.toTypeStr(mixed),\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object\",\n });\n }\n }\n if (!/^\\s*\\{/.test(mixed)) {\n throw error_util_1.makeMappingError({\n message: name + \" must be JSON Object string\",\n inputName: name,\n actualValue: mixed,\n expected: \"JSON Object string\",\n });\n }\n try {\n return JSON.parse(mixed);\n }\n catch (err) {\n throw error_util_1.makeMappingError({\n message: name + \" must be valid JSON Object string; \" + err.message,\n inputName: name,\n actualValue: mixed,\n expected: \"valid JSON Object string\",\n });\n }\n };\n}", "title": "" }, { "docid": "6f61fabaaa98085caab1da70be850e97", "score": "0.47222295", "text": "function dataType(data) {\n if (typeof (data) == 'number')\n return new type_inference_1.TypeInference.TypeConstant('Num');\n if (typeof (data) == 'boolean')\n return new type_inference_1.TypeInference.TypeConstant('Bool');\n if (typeof (data) == 'string')\n return new type_inference_1.TypeInference.TypeConstant('Str');\n if (data instanceof CatInstruction)\n return data.type;\n throw new Error(\"Could not figure out the type of the data: \" + data);\n }", "title": "" }, { "docid": "ce411327ccdf95b3062aabe821fbb7bd", "score": "0.47206622", "text": "set fromString(_v) {\n this._variable = _v;\n }", "title": "" }, { "docid": "92f36ed25080cedc32c44c24e282d0a3", "score": "0.47182262", "text": "function cast(x, dtype) {\n return x.asType(dtype);\n}", "title": "" }, { "docid": "47f968ded50280bf9e856ffe51b4618c", "score": "0.47163573", "text": "static cast (value, datatype) {\n\t\tswitch (datatype) {\n\t\t\tcase \"number\": return +value;\n\t\t\tcase \"boolean\": return !!value;\n\t\t\tcase \"string\": return value + \"\";\n\t\t}\n\n\t\treturn value;\n\t}", "title": "" }, { "docid": "950ffe122f1f742ddac9eb42763a2933", "score": "0.47121054", "text": "function lint(type, string){\n\t// Put Lint Function Here\n\tif (string){\n\t\tconvert(type, string);\n\t}\n}", "title": "" }, { "docid": "5b3846d35093b7ba0a32dbe3dfc2c7aa", "score": "0.47077915", "text": "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "title": "" }, { "docid": "5b3846d35093b7ba0a32dbe3dfc2c7aa", "score": "0.47077915", "text": "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "title": "" }, { "docid": "09749666e0bf2eeb76f6718e5a4082a7", "score": "0.46951208", "text": "function stringFromValue(type, value) {\n if (typeof (value) === 'string')\n return value;\n\n if (type === 'object') {\n return JSON.stringify(value);\n }\n else if ((type === 'integer' || type === 'number') && ((Number.isNan && Number.isNaN(value) === true) || (isNaN !== undefined && isNaN(value) === true))) {\n return 'NaN';\n }\n else if (type === 'integer' || type === 'number') {// || type === 'string') {\n return value.toString();\n }\n else {\n return value;\n }\n }", "title": "" }, { "docid": "dca359406d22c135f1eecb1fca461997", "score": "0.46926606", "text": "function typeOf(input) {\n return {}.toString.call(input).slice(8, -1).toLowerCase();\n}", "title": "" }, { "docid": "8d4af452faceb49d99c974b42d6ea88a", "score": "0.46800783", "text": "function type(variable, explicit) {\n\t\tvar result = typeof variable;\n\n\t\tswitch (result) {\n\t\t\tcase 'number':\n\t\t\t\tresult = numberType(result, variable, explicit);\n\t\t\t\tbreak;\n\n\t\t\tcase 'object':\n\t\t\t\tresult = objectType(result, variable, explicit);\n\t\t\t\tbreak;\n\n\t\t\tcase 'boolean':\n\t\t\t\tresult = booleanType(result, explicit);\n\t\t\t\tbreak;\n\n\t\t\tcase 'undefined':\n\t\t\t\tresult = undefinedType(result, explicit);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "4d0e94703c27c9867c7bdda02c6871ec", "score": "0.46753824", "text": "function _fnDetectType( sData )\n\t\t{\n\t\t\tvar aTypes = _oExt.aTypes;\n\t\t\tvar iLen = aTypes.length;\n\t\t\t\n\t\t\tfor ( var i=0 ; i<iLen ; i++ )\n\t\t\t{\n\t\t\t\tvar sType = aTypes[i]( sData );\n\t\t\t\tif ( sType !== null )\n\t\t\t\t{\n\t\t\t\t\treturn sType;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn 'string';\n\t\t}", "title": "" } ]
231e96a92a72e1c42291da20e1f5af96
don't leave dangling pipes when there are errors.
[ { "docid": "cd49ce7fe44301e5e1c18cb945bbab20", "score": "0.0", "text": "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" } ]
[ { "docid": "9ea31af3978491d2e034f98719002e7a", "score": "0.6613372", "text": "function epipeError(err) {\n if (err.code === 'EPIPE' || err.errno === 32) return process.exit;\n\n if (process.stdout.listeners('error').length <= 1) {\n process.stdout.removeAllListeners();\n process.stdout.emit('error', err);\n process.stdout.on('error', epipeError);\n }\n}", "title": "" }, { "docid": "f7c4d81353c33846e0e82f1380b75f86", "score": "0.64303035", "text": "function onerror(err) {\n var handlers = emitter._events.error\n\n cleanup()\n\n // Cannot use `listenerCount` in node <= 0.12.\n if (!handlers || handlers.length === 0 || handlers === onerror) {\n throw err // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "04537493da0307c4e202fd6964ae41a8", "score": "0.6383316", "text": "function onerror(er) {\n\t cleanup();\n\t if (this.listeners('error').length === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "50d5b4828bd357b928903c1f8a2b2ac9", "score": "0.63701004", "text": "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "50d5b4828bd357b928903c1f8a2b2ac9", "score": "0.63701004", "text": "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "50d5b4828bd357b928903c1f8a2b2ac9", "score": "0.63701004", "text": "function onerror(er) {\n\t cleanup();\n\t if (EventEmitter.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "9ff09738f5ca5c36e70613e76da57da9", "score": "0.6352793", "text": "function onerror(er) {\n\t cleanup();\n\t if (events.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "682d636c9939fa0b3a23682b3301bab8", "score": "0.6331938", "text": "function onerror (err) {\n unpipe();\n if (EventEmitter.listenerCount(dest, 'error') === 0) {\n dest.emit('error', err);\n }\n }", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.6285128", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.6285128", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.6285128", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "2d35814422f8a6733af1589bc809b6f5", "score": "0.6285128", "text": "function onerror(er) {\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EE.listenerCount(dest, 'error') === 0)\n\t dest.emit('error', er);\n\t }", "title": "" }, { "docid": "7eb0dc214364858a1853ff63dc1ddf07", "score": "0.6284331", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(listenerCount$1(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "57e8436e811a8fabfda1290af90dbc15", "score": "0.62696296", "text": "function onerror (er) {\n\t cleanup()\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "0d4773b85bbe0abc172f9d85b53fa63c", "score": "0.6239972", "text": "function onerror(er) {\n unpipe();\n if (dest.listeners('error').length === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "4ec44f2c54a7252466d6fc6f885469eb", "score": "0.6233449", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "4ec44f2c54a7252466d6fc6f885469eb", "score": "0.6233449", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "f0e0f062d51b5daf8487cafc79af9385", "score": "0.62146306", "text": "function onerror(er) {\n unpipe();\n dest.removeListener('error', onerror);\n if (EE.listenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }", "title": "" }, { "docid": "ccc5119a3e30c5c0c2abd4162142c83e", "score": "0.6212333", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "ccc5119a3e30c5c0c2abd4162142c83e", "score": "0.6212333", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "ccc5119a3e30c5c0c2abd4162142c83e", "score": "0.6212333", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "cae36775748a8649e94400683917a8e7", "score": "0.62057316", "text": "function onerror(er) {\n cleanup();\n if (EventEmitter.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "e49c625b101e97ec5f7fa3d741044e4c", "score": "0.6202309", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "600bdf910c447b1df535cfe4780b848f", "score": "0.6196249", "text": "function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "bf69bbef05957abe0cc2a5fbfe3f1240", "score": "0.61765504", "text": "function onerror(er) {\n cleanup();\n if (this.listeners('error').length === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "387db13532187e6ce2526ef16a4a6652", "score": "0.6153597", "text": "function onerror(er) {\r\n unpipe();\r\n dest.removeListener('error', onerror);\r\n if (EE.listenerCount(dest, 'error') === 0)\r\n dest.emit('error', er);\r\n }", "title": "" }, { "docid": "f987ad729ed255ab2819881846360361", "score": "0.6114369", "text": "function test(err) {\n console.log('########### Starting Pipe flow ' + ((err == 1) ? 'with' : 'without') + ' error ###########');\n let pkg = (new Package()).init({\n step: 0,\n msg: 'Initial state'\n });\n let PipelineFlow = new Pipeline(pkg);\n PipelineFlow\n .pipe(new Step(1, '--> First step msg'))\n .pipe(new Step(2, '--> Second step msg'))\n .pipe(new StepWhatEver(err)) //1 err, 0 no err\n .pipe(new StepErrHandler())\n .pipe(new Step('N', '--> N step msg'))\n .flow().then((pkg) => {\n console.log('////// Final package state');\n console.log(pkg);\n console.log('########### Pipe flow successfully ###########');\n }).catch((err) => {\n console.log(err);\n console.log('!!!!!!!!!!!! Broken Pipe !!!!!!!!!!!!');\n });\n}", "title": "" }, { "docid": "1d6cc6ea5e2b640c2986f15be7ac429d", "score": "0.60875434", "text": "function onerror (er) {\n\t debug('onerror', er)\n\t unpipe()\n\t dest.removeListener('error', onerror)\n\t if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er)\n\t }", "title": "" }, { "docid": "c25cfcbb6d08ed2cbbbd5835aa081f23", "score": "0.60673684", "text": "function cleanup() {\n return src('tmp', {read: false})\n .pipe(clean());\n}", "title": "" }, { "docid": "66921dd0935746466e6ab1f935f0a54f", "score": "0.6059274", "text": "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "66921dd0935746466e6ab1f935f0a54f", "score": "0.6059274", "text": "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "04cfad94ab66a2417a4fe1f977ff826e", "score": "0.605242", "text": "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" }, { "docid": "78b396fc10ba3e93d5b733c94931fb5b", "score": "0.6052071", "text": "function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, \"error\") === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }", "title": "" } ]
31396a96fcf8bd0690ac04aaba436628
deletion, so don't let them throw. Hostoriginating errors should interrupt deletion, so it's okay
[ { "docid": "eeee9bbcd62a49b0bd27d655ea5d4161", "score": "0.0", "text": "function commitUnmount(finishedRoot, current, renderPriorityLevel) {\n onCommitUnmount(current);\n\n switch (current.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n var updateQueue = current.updateQueue;\n\n if (updateQueue !== null) {\n var lastEffect = updateQueue.lastEffect;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n var _effect2 = effect,\n destroy = _effect2.destroy,\n tag = _effect2.tag;\n\n if (destroy !== undefined) {\n if ((tag & Passive$1) !== NoFlags$1) {\n enqueuePendingPassiveHookEffectUnmount(current, effect);\n } else {\n {\n safelyCallDestroy(current, destroy);\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n }\n\n return;\n }\n\n case ClassComponent:\n {\n safelyDetachRef(current);\n var instance = current.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(current, instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n safelyDetachRef(current);\n return;\n }\n\n case HostPortal:\n {\n // TODO: this is recursive.\n // We are also not using this parent because\n // the portal will get pushed immediately.\n {\n unmountHostComponents(finishedRoot, current);\n }\n return;\n }\n\n case FundamentalComponent:\n {\n return;\n }\n\n case DehydratedFragment:\n {\n return;\n }\n\n case ScopeComponent:\n {\n return;\n }\n }\n }", "title": "" } ]
[ { "docid": "8bf6a3f04550dfcae86d77a756a44160", "score": "0.647436", "text": "async preDelete () {\n\t}", "title": "" }, { "docid": "b188e824182f6ce285e3256455357cf7", "score": "0.6450559", "text": "function hoistedDelete() {}", "title": "" }, { "docid": "b94afa9e6b47607ac67d9c312f4fb704", "score": "0.63733006", "text": "delete() {\n \n }", "title": "" }, { "docid": "f4b2ca029a3ab2d2c44f8e1eb63e1530", "score": "0.6280785", "text": "delete() {}", "title": "" }, { "docid": "f4b2ca029a3ab2d2c44f8e1eb63e1530", "score": "0.6280785", "text": "delete() {}", "title": "" }, { "docid": "d59040ea38d520816636fd1643dfbec4", "score": "0.6242876", "text": "function rejectAndDelete(exceptions) {\n\t\t\t media.delete();\n\t\t\t reject(exceptions);\n\t\t\t }", "title": "" }, { "docid": "f1e0e30b2488240661817657ea1de3a1", "score": "0.6156361", "text": "delete() {\n\n\t}", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "99e0a35c1681fc1b4dbc47cb81473622", "score": "0.61540544", "text": "detach() {\n throw new Error('Not Implemented');\n }", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.6091117", "text": "cleanup() {}", "title": "" }, { "docid": "f335b0c6d6d097c63e6f85de2fc7394e", "score": "0.6091117", "text": "cleanup() {}", "title": "" }, { "docid": "a26f579aaf72649dfabd5e8ed0b5bc26", "score": "0.60719866", "text": "function cleanup() {\n const idx = []\n for(let i=0; i < WORKERS.length; i++) {\n if (!WORKERS[i].is('dead', 'error')) continue;\n idx.push(i)\n }\n idx.forEach(i => WORKERS.splice(i, 1))\n}", "title": "" }, { "docid": "728ea6309cc49e5b27e2feaf8f4aeaf7", "score": "0.6047838", "text": "delete() {\n\t\tthis.notAllowed();\n\t}", "title": "" }, { "docid": "d025c6c41feb3320fe84827f322812b2", "score": "0.60099345", "text": "exitOC_Delete(ctx) {}", "title": "" }, { "docid": "e4544bca8ff5c8bcbb16ef6019db1544", "score": "0.59670293", "text": "function _fnRemoved () {\n throw {code: 410, text: 'Object is removed'};\n}", "title": "" }, { "docid": "efbe9731bafeca2ca14f847ead3a0e13", "score": "0.59136623", "text": "beforeDelete () {}", "title": "" }, { "docid": "13fe87c93e65aa5819264f2a4d90c26e", "score": "0.58315235", "text": "remove() { }", "title": "" }, { "docid": "4e9eb5abb4d43b8ec64725dbbedb0562", "score": "0.5799465", "text": "cleanOnDemandBuffer()\n {\n if (this._pendingOnDemandDeletes.length > 0)\n {\n var pending = this._pendingOnDemandDeletes.shift();\n this.deletePendingOnDemand(pending.delete_range);\n }\n }", "title": "" }, { "docid": "0eeb694231152609bc00eecd6f67b0b5", "score": "0.5783152", "text": "_terminate() {\n return function(t) {\n const n = te.get(t);\n n && (m(\"ComponentProvider\", \"Removing Datastore\"), te.delete(t), n.terminate());\n }(this), Promise.resolve();\n }", "title": "" }, { "docid": "93ff555b904992ec34f79a27b2bf12fb", "score": "0.57776266", "text": "onDeleted() {\n\t \n this.log('device deleted');\n\t\tcmdclient[device_data.host].destroy();\n\t\t\n }", "title": "" }, { "docid": "831d6952a1e904dc7c3453151404a3dd", "score": "0.5771356", "text": "detach() {\n throw new Error('incompatible reuse strategy');\n }", "title": "" }, { "docid": "7e7917dcc4cc4df6611aaade6cce3bb6", "score": "0.57097995", "text": "onCleanUp() { }", "title": "" }, { "docid": "45efd5e90545fbfd8df5632a45964c87", "score": "0.5692756", "text": "delete() {\n\n }", "title": "" }, { "docid": "b12cd533bbd1fe739be114fdc2e8cb74", "score": "0.56922054", "text": "onDelete() {\n delete this.files;\n delete this.filesNameString;\n this.clearErrors();\n this.dropped.emit(undefined);\n }", "title": "" }, { "docid": "9baf79f101c1a6dd314411435cace946", "score": "0.5691224", "text": "_tryGCOne(now) {\n if (this._cleanupNextPosition >= this._cleanupKeys.length) {\n this._cleanupKeys = Object.keys(this._storage);\n this._cleanupNextPosition = 0;\n }\n if (this._cleanupKeys.length <= 0) {\n //nothing to try cleaning up\n return;\n }\n let key = this._cleanupKeys[this._cleanupNextPosition];\n this._cleanupNextPosition++;\n let tryCleanup = this._storage[key];\n if (tryCleanup == null) {\n // tslint:disable-next-line: no-dynamic-delete\n delete this._storage[key];\n return;\n }\n if (tryCleanup.gcAfter > now) {\n //not expired;\n return;\n }\n //no early exit clauses triggered, so cleanup\n // tslint:disable-next-line: no-dynamic-delete\n delete this._storage[key];\n return;\n }", "title": "" }, { "docid": "d1c014152fc686ce354f1bc601373717", "score": "0.56770384", "text": "recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode) this.storeNode(next, this.pos, nextEnd);\n this.storeNode(0\n /* Err */\n , this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 200\n /* Token */\n ;\n }", "title": "" }, { "docid": "89f9664d746170fce231e33ad5e28be2", "score": "0.56697303", "text": "function destroyed() {\n throw new Error('Call made to destroyed method');\n}", "title": "" }, { "docid": "bc35786ce7a1571cadca57a66421bde8", "score": "0.5668556", "text": "async delete() {\n await this._impl_delete();\n }", "title": "" }, { "docid": "1e105b31f94f450a39fee37704d01990", "score": "0.56643784", "text": "function finish(err) {\n\t\tif(err)\n\t\t{\n\t\t\tremoveFunc(function(err) {\n\t\t\t\tif(err)\n\t\t\t\t\tconsole.warn(\"Error while removing errorneous object: \", err);\n\t\t\t});\n\t\t\tcallback(err);\n\t\t}\n\t\telse\n\t\t\tcallback(null);\n\t}", "title": "" }, { "docid": "afdf2199588f5fb3b1d32a51bc9fe5bd", "score": "0.56634754", "text": "function cleanup() {\n }", "title": "" }, { "docid": "8e1cf2fd266a2e18eee29d3ef6ee964c", "score": "0.5654208", "text": "function handleDeleteResponseAndThrow(resultOfDelete){\n var response = handleDeleteResponse(resultOfDelete);\n if(response!==null){\n throw response;\n }\n}", "title": "" }, { "docid": "376a0adf8a3d1ae5c2a655ee5b6af29c", "score": "0.56459075", "text": "function errCleanUp(err) {\n //Clean up temp area. Even though this is async,\n //it is not important to track the completion.\n file.asyncPlatformRm(tempDirName);\n\n deferred.reject(err);\n }", "title": "" }, { "docid": "ca4cdc7c3bd4b40af1fd0e9131c4c9e3", "score": "0.56431437", "text": "function cleanupException() {\n var stream = dbExceptions\n .createReadStream({\n keys: true,\n values: true\n })\n .on(\"data\", item => {\n const value = JSON.parse(item.value);\n if (value.reason === \"greylist\") {\n if (value.created < Date.now() - greylistduration) {\n dbExceptions.del(item.key, err => {\n console.log(\"removed \", item.key, \"from greylist\");\n });\n }\n }\n });\n}", "title": "" }, { "docid": "c9af41be2d3b9cb37f331a33611de75c", "score": "0.56168723", "text": "destroy (err) {\n this._destroy(err, () => {})\n }", "title": "" }, { "docid": "c9af41be2d3b9cb37f331a33611de75c", "score": "0.56168723", "text": "destroy (err) {\n this._destroy(err, () => {})\n }", "title": "" }, { "docid": "c9af41be2d3b9cb37f331a33611de75c", "score": "0.56168723", "text": "destroy (err) {\n this._destroy(err, () => {})\n }", "title": "" }, { "docid": "c1202705c0692790b59f75688c5a0cf4", "score": "0.5614218", "text": "disconnect() {\n\t\t\t/* istanbul ignore next */\n\t\t\tthrow new Error(\"Not implemented!\");\n\t\t}", "title": "" }, { "docid": "02979b533dc78a1629d5fdd0e9a61a61", "score": "0.5584163", "text": "remove(){ throw 'Remove not overridden'}", "title": "" }, { "docid": "a7c06bcb10e8ccaffec930f225055f72", "score": "0.5582894", "text": "wsFail() {\n this.destroy();\n }", "title": "" }, { "docid": "0eb9d8761e071b743236eb360e182928", "score": "0.55781895", "text": "function errCleanUp(err) {\r\n //Clean up temp area. Even though this is async,\r\n //it is not important to track the completion.\r\n if (tempDirName) {\r\n file.asyncPlatformRm(tempDirName);\r\n }\r\n\r\n deferred.reject(err);\r\n }", "title": "" }, { "docid": "048ad481d5249b197295fe0124f49f25", "score": "0.5578025", "text": "G_() {\n if (this.ks.z_) throw new k$1(x$1.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }", "title": "" }, { "docid": "5cdd102732d1dcebea139679433c3ad1", "score": "0.5575195", "text": "function socketError () {\n this.destroy();\n}", "title": "" }, { "docid": "5cdd102732d1dcebea139679433c3ad1", "score": "0.5575195", "text": "function socketError () {\n this.destroy();\n}", "title": "" }, { "docid": "5cdd102732d1dcebea139679433c3ad1", "score": "0.5575195", "text": "function socketError () {\n this.destroy();\n}", "title": "" }, { "docid": "6f76fdf4e98720e359f24e1d34341a20", "score": "0.5561665", "text": "function removeDeletedEntities() {\n\t\t// copy list so we can modify it\n\t\tvar delList = that.deleteQueue.slice(0);\n\t\t\n\t\tfor (var ie = 0; ie < delList.length; ie++) {\n\t\t\tvar e = delList[ie];\n\t\t\tif (e.deathCallback != null) {\n\t\t\t\t//Log.i(\"Asciiquarium\", \"Animation: invoke death callback for \" + e.name);\n\t\t\t\te.deathCallback.run(e);\n\t\t\t}\n\t\t\t\n\t\t\tif (e.physical)\n\t\t\t\tthat.physicalCount--;\n\n\t\t\t// that.list.remove(e)\n\t\t\tfor (var id = 0; id < that.list.length; id++) {\n\t\t\t\tif (that.list[id] == e) {\n\t\t\t\t\tthat.list.splice(id, 1);\n\t\t\t\t\tdelete e;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tthat.deleteQueue = [];\n\t}", "title": "" }, { "docid": "8611190ef28310fe8e2fd541b878a125", "score": "0.5553094", "text": "delDrops() {\n this.head = null\n }", "title": "" }, { "docid": "f608a345f7f9b983d817b545f1980cc7", "score": "0.55456144", "text": "deleteAll() {\n try {\n fs.unlinkSync(this.filename)\n return null\n } catch(error) {\n if (error?.code === 'ENOENT') {\n console.log('file not found');\n return null\n }\n return error\n }\n\n}", "title": "" }, { "docid": "86fc7c21c117579e90b7f46197c99387", "score": "0.5537583", "text": "cleanup() {\n this.disposeDeleteUnlinkedNodes();\n this.disposeGraphStateEmpty();\n }", "title": "" }, { "docid": "357bd59c8948a241230a1dc5738f28e9", "score": "0.5531501", "text": "function postMortem(){throw new Error('This method cannot be called because this Handsontable instance has been destroyed');}", "title": "" }, { "docid": "97d23c2184e6568b4ccead28322d0092", "score": "0.5517569", "text": "function clean (cb) {\n return del([DEST]).then(cb.bind(null, null))\n}", "title": "" }, { "docid": "1efd9b13ced7e741316ef96248c8e9d2", "score": "0.5515699", "text": "function del(){\r\n\thandleSchemaNode('deleteNode');\r\n}", "title": "" }, { "docid": "ba705f12d1967a26aea1abed38644c24", "score": "0.55104387", "text": "Remove() {}", "title": "" }, { "docid": "b2920e95fb87b05051857da87f504159", "score": "0.5504821", "text": "indicateRemove() {}", "title": "" }, { "docid": "09ac391cc292a9cd893de90859f9aea8", "score": "0.5496084", "text": "destroy() {}", "title": "" }, { "docid": "09ac391cc292a9cd893de90859f9aea8", "score": "0.5496084", "text": "destroy() {}", "title": "" }, { "docid": "e0ba1e3693aa829431b7597d221b0f1f", "score": "0.54878384", "text": "function socketOnError() {\n this.destroy()\n}", "title": "" }, { "docid": "623a081576d675acb7d3bafafcec3a31", "score": "0.5484814", "text": "function deletef() {\n\n }", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "340f3604b43096aa62515040287d8010", "score": "0.5475925", "text": "function socketOnError() {\n this.destroy();\n}", "title": "" }, { "docid": "33468bc6495e5471ba41d3d5d3ab2771", "score": "0.5467322", "text": "delete() {\n if (!this.removed) {\n for (let [_, edge] of this.neighbors) edge.delete();\n\n for (let g of this.glissInputs) g.remove();\n\n for (let g of this.glissOutputs) g.remove();\n\n let removed = this.glissInputs.concat(this.glissOutputs).concat([...this.neighbors].map(e => e[1]));\n editor$1.removeReferences(removed);\n this.remove();\n }\n }", "title": "" }, { "docid": "ac925ec7e29b364695a769e7d74d96ee", "score": "0.54647607", "text": "postDestroy() { }", "title": "" }, { "docid": "0ff0514c1153445ccd4546ff9770a2b6", "score": "0.5460329", "text": "delete() {\n let _this = this;\n\n\n _this._releaseListeners();\n\n //TODO: send delete message ?\n\n // nothing to be done\n // return new Promise((resolve) => {\n // log.log('[DataObjectChild.delete]');\n // resolve();\n // });\n }", "title": "" }, { "docid": "0e75ecd1163be1cb79211ab8ea976c0b", "score": "0.54438174", "text": "function deleteGhosts() {\n let ghosts = document.querySelectorAll(GHOST_SEL);\n [...ghosts].forEach(g => g.parentElement.removeChild(g));\n ghost = null;\n }", "title": "" }, { "docid": "0d6ef1679480db1d5cfee15822825343", "score": "0.5442813", "text": "function deleteProcesses() {\n\tconsole.log(\"@deleteProcesses: not implemented\");\n}", "title": "" }, { "docid": "62f45728c67ea60cf00e5299a1129c85", "score": "0.5437965", "text": "onRemoved() {}", "title": "" }, { "docid": "bf57d4302a91408c70d85669cafdf177", "score": "0.5434755", "text": "async postDelete () {\n\t}", "title": "" }, { "docid": "eb1052bd1a80443e2ec05b951f9e1ef9", "score": "0.5420964", "text": "function deleteFailure() {\n alert('You are not the owner of this item and do not have authorization to delete!');\n}", "title": "" }, { "docid": "01870724891feeb11d45e533ba2bcd37", "score": "0.54144716", "text": "_cleanup() {\n _.each(this.tokenBuckets, (value, key) => {\n const tokenBucket = this.tokenBuckets[key];\n if (tokenBucket.tokens == tokenBucket.limit) {\n tokenBucket.destroy();\n delete this.tokenBuckets[key];\n }\n });\n }", "title": "" }, { "docid": "5d76dba6bc81fc278b9a8a6e8485dffc", "score": "0.54056156", "text": "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n>>>>>>> master\n }", "title": "" }, { "docid": "8ea299ba5a861087d3a7ca97be691a40", "score": "0.5403551", "text": "_handleDelete() {\n const pathDeleteIndices = this._handleSingleVertexDelete();\n // Remove enqueued paths\n if (this.allowPathRemoval) {\n // Remove paths starting with the last (!) index.\n for (var i = pathDeleteIndices.length - 1; i >= 0; i--) {\n this.removePathAt(pathDeleteIndices[i]);\n }\n }\n this.pb.redraw();\n }", "title": "" }, { "docid": "a23a51c65d1c4b9ba5ad30ade474e5c1", "score": "0.5401192", "text": "delete(){\n\n }", "title": "" }, { "docid": "cb21908a78ad9d06deb15a99344ea0b4", "score": "0.53945136", "text": "async __deleteIndex() {\n await this.pool.end();\n let client = new Client(Object.assign({}, config, { database: 'postgres' }));\n try {\n await client.connect();\n await client.query(`drop database if exists ${config.database}`);\n } finally {\n client.end();\n }\n }", "title": "" }, { "docid": "39a1a7bbb8ce702e2af2e886e358ba74", "score": "0.53940105", "text": "destructor() {\n\t\tObject.keys(this.clients).forEach((hash) => {\n\t\t\tthis.removeClient(hash);\n\t\t});\n\t}", "title": "" }, { "docid": "e676f0ebae40ae5aa3c8c92abd3ed798", "score": "0.53872085", "text": "function postMortem() {\n throw new Error('This method cannot be called because this Handsontable instance has been destroyed');\n }", "title": "" }, { "docid": "2518eeca194c445505a993ed42313377", "score": "0.5385519", "text": "delete () {\n this.emit('deleting', this);\n this.beforeDelete();\n this.constructor._service.delete(this);\n this.emit('deleted', this);\n }", "title": "" }, { "docid": "815f8f4cc6c0c6cfb7e7254adb9b6a1f", "score": "0.53756875", "text": "tryDeleteLastWatcher() {\n if (this.lastWatcher) {\n this.getWatcherGroup().delete(this.lastWatcher);\n this.lastWatcher = null;\n }\n }", "title": "" }, { "docid": "815f8f4cc6c0c6cfb7e7254adb9b6a1f", "score": "0.53756875", "text": "tryDeleteLastWatcher() {\n if (this.lastWatcher) {\n this.getWatcherGroup().delete(this.lastWatcher);\n this.lastWatcher = null;\n }\n }", "title": "" }, { "docid": "6124204e03fe97303d979d1cd0a948f6", "score": "0.53562963", "text": "exitDeleteStatement(ctx) {\n\t}", "title": "" }, { "docid": "2104bf85cc79f1ccb8ee8851c21540e0", "score": "0.5353155", "text": "disconnectedCallback() {\n console.log(\"removido\")\n }", "title": "" }, { "docid": "3b49f783ea4b6593c268afeb2dcbafa4", "score": "0.5353154", "text": "async deleteAction(epcList) {\n throw new Error('deleteAction not implemented');\n }", "title": "" }, { "docid": "b060d3158847584512ef99c6f6d3baec", "score": "0.53526694", "text": "del(dbId) {}", "title": "" }, { "docid": "91ae5a455bbbb467af7fb1e9e03e1e20", "score": "0.5343543", "text": "async destroy() {\r\n return null;\r\n }", "title": "" }, { "docid": "f4e40dcf633ac00ebbd1d25bc8013a63", "score": "0.5336141", "text": "async abort() {\n return;\n }", "title": "" }, { "docid": "e0b204cc80b658b9807c5f6c4ffe10eb", "score": "0.53359836", "text": "onDestroy() {}", "title": "" } ]
048f85cd9546cd80ce13bc4df8cae176
Renders the AWS CloudFormation properties of an `AWS::AmplifyUIBuilder::Form.FieldInputConfig` resource
[ { "docid": "0e07d893d9a445b5056898c7fd49f779", "score": "0.5892025", "text": "function cfnFormFieldInputConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnForm_FieldInputConfigPropertyValidator(properties).assertSuccess();\n return {\n DefaultChecked: cdk.booleanToCloudFormation(properties.defaultChecked),\n DefaultCountryCode: cdk.stringToCloudFormation(properties.defaultCountryCode),\n DefaultValue: cdk.stringToCloudFormation(properties.defaultValue),\n DescriptiveText: cdk.stringToCloudFormation(properties.descriptiveText),\n IsArray: cdk.booleanToCloudFormation(properties.isArray),\n MaxValue: cdk.numberToCloudFormation(properties.maxValue),\n MinValue: cdk.numberToCloudFormation(properties.minValue),\n Name: cdk.stringToCloudFormation(properties.name),\n Placeholder: cdk.stringToCloudFormation(properties.placeholder),\n ReadOnly: cdk.booleanToCloudFormation(properties.readOnly),\n Required: cdk.booleanToCloudFormation(properties.required),\n Step: cdk.numberToCloudFormation(properties.step),\n Type: cdk.stringToCloudFormation(properties.type),\n Value: cdk.stringToCloudFormation(properties.value),\n ValueMappings: cfnFormValueMappingsPropertyToCloudFormation(properties.valueMappings),\n };\n}", "title": "" } ]
[ { "docid": "3f6d2a9caec1a248caa8cc470150ae63", "score": "0.59356356", "text": "renderInputField(fields) {\n\n const { meta : { touched, error }} = fields;\n\n const className = `form-group ${ touched && error ? 'has-danger' : ''}`;\n\n const placeholders = fields.input.name === 'servComments' ? 'Please detail your complaints here.' : '';\n\n return (\n\n <div className = { className } style = {{ marginBottom : '40px'}}>\n\n <p><strong>{ fields.showTitle }\n\n { fields.input.name === 'telephone' || \n fields.input.name === 'servComments' ? '' : ' (Required)' }</strong></p>\n \n <label>\n\n <input type = { \n\n fields.input.name === 'password' || \n fields.input.name === 'password2' ?\n 'password' : 'text'\n \n \n }\n\n width = '300' height = '500'\n placeholder = { placeholders } \n { ...fields.input } // each property only\n\n />\n\n </label>\n\n <div className = 'text-help'>\n\n { touched ? error : '' }\n\n </div>\n\n </div>\n\n );\n\n }", "title": "" }, { "docid": "15dd17b50d6ccbb5b90515dcae6f3570", "score": "0.5859076", "text": "render() {\n const {value, label, box, outlined, disabled, icon, iconTrailing, fullWidth, required, placeHolder, helperText, type} = this;\n const hostClassInfo = {\n 'mdc-text-field--with-leading-icon': icon && !iconTrailing,\n 'mdc-text-field--with-trailing-icon': icon && iconTrailing,\n 'mdc-text-field--box': !fullWidth && box,\n 'mdc-text-field--outlined': !fullWidth && outlined,\n 'mdc-text-field--disabled': disabled,\n 'mdc-text-field--fullwidth': fullWidth,\n };\n return html`\n ${this.renderStyle()}\n <div class=\"mdc-text-field mdc-text-field--upgraded ${classMap(hostClassInfo)}\">\n ${!fullWidth && icon ? html`<i class=\"material-icons mdc-text-field__icon\" tabindex=\"0\">${icon}</i>` : ''}\n ${this._renderInput({value, required, type, placeHolder, label})}\n ${!fullWidth && label ? html`<label class=\"mdc-floating-label ${value ? 'mdc-floating-label--float-above' : ''}\" for=\"text-field\">${label}</label>` : ''}\n ${!fullWidth && outlined ? html`<div class=\"mdc-notched-outline\">\n <svg><path class=\"mdc-notched-outline__path\"/></svg>\n </div>\n <div class=\"mdc-notched-outline__idle\"></div>` :\n html`<div class=\"mdc-line-ripple\"></div>`}\n </div>\n ${helperText ? html`<p class=\"mdc-text-field-helper-text\" aria-hidden=\"true\">${helperText}</p>` : ''}`;\n }", "title": "" }, { "docid": "5338ff6a8495efc0a59f51eb07affa83", "score": "0.5794789", "text": "render() {\n return (\n <div className={`field field-type-text ${this.props.hidden ? \"hidden\" : \"u-marginTop--15\"}`}>\n {this.props.title !== \"\" || this.props.required ?\n <ConfigItemTitle\n title={this.props.title}\n recommended={this.props.recommended}\n required={this.props.required}\n name={this.props.name}\n />\n : null}\n {this.props.help_text !== \"\" ? <p className=\"field-section-help-text u-marginTop--small u-lineHeight--normal\">{this.props.help_text}</p> : null}\n <div className=\"field-input-wrapper u-marginTop--15\">\n <input\n ref={this.inputRef}\n type={this.props.inputType}\n {...this.props.props}\n placeholder={this.props.default}\n value={this.state.inputVal}\n readOnly={this.props.readonly}\n disabled={this.props.readonly}\n onChange={(e) => this.handleOnChange(e)}\n onFocus={() => this.setState({ focused: true })}\n onBlur={() => this.setState({ focused: false })}\n className={`${this.props.className || \"\"} Input ${this.props.readonly ? \"readonly\" : \"\"}`} />\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "11520cdbd1e1dd5e5301e853686f3348", "score": "0.5756605", "text": "render() {\r\n\t\treturn this.validateProps() ? (\r\n\t\t\tthis.printField()\r\n\t\t) : (\r\n\t\t\t<h4>Error initializing Field component props</h4>\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "735068d985d16b4dfabd30023e52ad25", "score": "0.57410026", "text": "renderField(fieldConfig, field) {\n const fieldHelper = this.props.fields[field];\n\n return (\n <div className={`form-group ${fieldHelper.touched && fieldHelper.invalid ? 'has-danger' : ''}`}>\n <label>{fieldConfig.label}</label>\n <fieldConfig.type type=\"text\" className=\"form-control\" {...fieldHelper} />\n <div className=\"form-control-feedback\">\n {fieldHelper.touched ? fieldHelper.error : ''}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "774a515484c363edeaa00cb49392b7f7", "score": "0.5695642", "text": "renderField() { }", "title": "" }, { "docid": "d5aa365dfcfe184ffc6a98c8fdd6ab61", "score": "0.56712633", "text": "function cfnFormFieldConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnForm_FieldConfigPropertyValidator(properties).assertSuccess();\n return {\n Excluded: cdk.booleanToCloudFormation(properties.excluded),\n InputType: cfnFormFieldInputConfigPropertyToCloudFormation(properties.inputType),\n Label: cdk.stringToCloudFormation(properties.label),\n Position: cfnFormFieldPositionPropertyToCloudFormation(properties.position),\n Validations: cdk.listMapper(cfnFormFieldValidationConfigurationPropertyToCloudFormation)(properties.validations),\n };\n}", "title": "" }, { "docid": "e66be485a9d449b079bde475afe5c946", "score": "0.56418014", "text": "printField() {\r\n\t\tlet label = this.generateLabel();\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t<label>{label}</label>\r\n\t\t\t\t<br />\r\n\t\t\t\t<input {...this.props.attributes} />\r\n\t\t\t\t<br style={{ lineHeight: 2 }} />\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "title": "" }, { "docid": "e527900f5d1eaac0afaabc44ae910fba", "score": "0.5521393", "text": "renderTemplate() {\n return '\"attributeValues\": $util.dynamodb.toMapValuesJson($input)';\n }", "title": "" }, { "docid": "d835e847c0fe74160acd5cb419c82c21", "score": "0.5505428", "text": "config_fields() {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttype: 'textinput',\n\t\t\t\tid: 'host',\n\t\t\t\tlabel: 'Target IP',\n\t\t\t\tdefault: '',\n\t\t\t\twidth: 6,\n\t\t\t\tregex: this.REGEX_IP\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'textinput',\n\t\t\t\tid: 'port',\n\t\t\t\tlabel: 'API Port',\n\t\t\t\twidth: 4,\n\t\t\t\tdefault: '8082',\n\t\t\t\tregex: this.REGEX_PORT\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'textinput',\n\t\t\t\tid: 'auth',\n\t\t\t\tlabel: 'API Authentication Key',\n\t\t\t\twidth: 6,\n\t\t\t\tdefault: null\n\t\t\t},\n\t\t]\n\t}", "title": "" }, { "docid": "bb116c7e9cf0b05df475edb800b924db", "score": "0.5437114", "text": "renderInputField(field){\n \n // console.log(field)\n const className = `form-input ${field.meta.touched && field.meta.error ? 'has-error':''}`;\n return (\n <div className={className}>\n <label>{field.myLabel}</label>\n <input type=\"text\" {...field.input} onChange = {field.input.onChange} />\n <div className=\"error\">\n {field.meta.touched? field.meta.error:''}\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "eebd19bf2de747c9e5eca1b63179a483", "score": "0.54288185", "text": "renderField(field) {\n\t\tconst {input, label, type, onChange, meta: { touched, error, warning, invalid }} = field;\n\t\treturn (\n\t\t <div className=\"form-group\">\n\t\t <label>{label}</label>\n\t\t <span>\n\t\t <input className={`form-control ${touched && invalid ? 'is-invalid' : ''}`} {...input} onBlur={onChange} placeholder={label} type={type} />\n\t\t {touched &&\n\t\t ((error && <span className=\"alert alert-danger\">{error}</span>) ||\n\t\t (warning && <span className=\"alert alert-warning\">{warning}</span>))}\n\t\t </span>\n\t\t </div>\n\t\t);\n\t}", "title": "" }, { "docid": "ba044dd2832084e33377b6a82603cbab", "score": "0.5425475", "text": "renderInput(formProps){\n //need to take relevant properties out of formProps and assign onChange and value properties using ES2015 syntax\n // // equivalent\n // <input\n // onChange={formProps.input.onChange}\n // value={formProps.input.value}/>\n console.log(formProps);\n return (\n\n <div>\n <label>{formProps.label}</label>\n <input {...formProps.input}/>\n </div>\n\n );\n }", "title": "" }, { "docid": "4dee0110b9285b445a39880f5112774b", "score": "0.54211426", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * Hint for expected file type in file upload controls\n */\n accept: {\n type: String,\n },\n hideInput: {\n type: Boolean,\n attribute: \"hide-input\",\n },\n /**\n * Hint for form autofill feature\n */\n autocomplete: {\n type: String,\n },\n /**\n * Automatically focus on field when the page is loaded\n */\n autofocus: {\n type: Boolean,\n },\n value: {\n type: String,\n },\n option: {\n type: String,\n },\n /**\n * Used when we want to ensure there is not a web cam option like video upload.\n */\n noCamera: {\n type: Boolean,\n attribute: \"no-camera\",\n },\n /**\n * No Voice Recording\n */\n noVoiceRecord: {\n type: Boolean,\n attribute: \"no-voice-record\",\n },\n responsiveSize: {\n type: String,\n attribute: \"responsive-size\",\n reflect: true,\n },\n responsiveWidth: {\n type: Number,\n attribute: \"responsive-width\",\n reflect: true,\n },\n itemsList: {\n type: Object,\n attribute: \"items-list\",\n },\n };\n }", "title": "" }, { "docid": "62176cf01dd1762bd591c0750bc43806", "score": "0.54035324", "text": "render() {\n const { labelName, typeName, placeholderText } = this.props;\n\n return (\n <div className=\"field\">\n <label className=\"label\">{labelName}</label>\n <div className=\"control\">\n <input\n className=\"input\"\n type={typeName}\n placeholder={placeholderText}\n />\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "0cbe0b4b64d767ef721322c4781bf72d", "score": "0.5394775", "text": "renderTitleInput(formProps) {\n return (\n <div className=\"field\">\n <label htmlFor=\"title\">{formProps.label}</label>\n <input\n value={formProps.input.value}\n onChange={formProps.input.onChange}\n />\n </div>\n );\n }", "title": "" }, { "docid": "c618b3a4bfaa5d7e84c2c920feda3902", "score": "0.53564173", "text": "renderFields(){\n\t\treturn _.map(FIELDS, ({name, label}) => {\n\t\t\treturn <Field key={name} label={label} type=\"text\" name={name} component={SurveyField} />\n\t\t});\n\t}", "title": "" }, { "docid": "c2ee531b76330325c202922e7ca18bff", "score": "0.535245", "text": "renderField(field){\n\n const {meta}=field;\n const className=`form-group ${meta.touched && meta.error ? 'has-danger' : ''}`;\n\n\n\n return(\n <div className={className}>\n <label>{field.label}</label><br></br>\n <input\n className=\"form-title\"\n type=\"text\"\n {...field.input}\n \n />\n <div className=\"text-help\">\n {meta.touched ? meta.error : ''}\n </div> \n </div>\n );\n }", "title": "" }, { "docid": "073edd9569f4133c30a8887054ec53b7", "score": "0.52831376", "text": "render() {\n let { inputType, inputName, inputChange, inputValue, inputPlaceholder, inputFetching, inputToolbar, inputOptions } = this.props;\n if (!inputType || !inputName || !inputChange || (inputType === 'select' && !inputOptions)) {\n return null;\n }\n if (inputType === 'hidden') {\n return (\n <input\n type=\"hidden\"\n name={ inputName }\n value={ inputValue }\n />\n );\n }\n if (inputType === 'select' || inputType === 'selectrealm') {\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n { this.buildSelect() }\n { this.getDescription() }\n { this.getError() }\n </fieldset>\n );\n }\n if (inputType === 'editor') {\n let options = {\n imageAccept: '.jpg,.jpeg,.png,.tiff'\n }\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <MdEditor\n value={ inputValue }\n renderHTML={(text) => markdownToHTML(text) }\n onChange={ inputChange }\n onImageUpload={ this.wysiwygFileUpload }\n config={ options }\n />\n { this.getDescription() }\n { this.getError() }\n { this.getInputState() }\n </fieldset>\n );\n }\n if (inputType === 'checkbox') {\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <input\n type=\"checkbox\"\n name={ inputName }\n checked={ inputValue }\n onChange={ inputChange }\n />\n { this.getDescription() }\n { this.getError() }\n </fieldset>\n );\n }\n if (inputType === 'file') {\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <div className=\"file-upload\">\n { this.getFileType(inputName, inputChange) }\n </div>\n { this.getReactLoading(inputFetching) }\n { this.getFilePreview(inputName, inputValue) }\n { this.getDescription() }\n { this.getError() }\n { this.getRemoveBtn() }\n </fieldset>\n );\n }\n if (inputType === 'text') {\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <input\n type={ inputType }\n name={ inputName }\n value={ inputValue }\n placeholder={ (inputPlaceholder) ? inputPlaceholder : inputName }\n onChange={ inputChange }\n />\n { this.getDescription() }\n { this.getError() }\n </fieldset>\n );\n }\n if (inputType === 'date') {\n let formattedDate = (inputValue.indexOf('T') !== -1) ? inputValue.split('T')[0] : inputValue;\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <input\n type={ inputType }\n name={ inputName }\n value={ formattedDate }\n onChange={ inputChange }\n />\n { this.getDescription() }\n { this.getError() }\n </fieldset>\n );\n }\n if (inputType === 'textarea') {\n return (\n <fieldset className={`input__wrapper ${this.getWrapperClass(inputName)} ${this.getTypeClass(inputType)} ${this.getErrorClass()}`}>\n { this.getLabel() }\n <textarea\n className=\"textarea\"\n name={ inputName }\n placeholder={ (inputPlaceholder) ? inputPlaceholder : null }\n value={ inputValue }\n onChange={ inputChange }>\n ></textarea>\n { this.getDescription() }\n { this.getError() }\n </fieldset>\n );\n }\n return null;\n }", "title": "" }, { "docid": "9c5394b31a0093b2868178925e7205b6", "score": "0.5249314", "text": "function partParameterTemplateFields() {\n return {\n name: {},\n description: {},\n units: {\n icon: 'fa-ruler',\n },\n choices: {\n icon: 'fa-th-list',\n },\n checkbox: {},\n };\n}", "title": "" }, { "docid": "bd582cfc6007badd8bde422d1b725bb5", "score": "0.52487546", "text": "_renderParticipantInfo() {\n const { displayName } = this.state;\n const { t } = this.props;\n\n return (\n <InputField\n onChange = { this._onChangeDisplayName }\n placeHolder = { t('lobby.nameField') }\n testId = 'lobby.nameField'\n value = { displayName } />\n );\n }", "title": "" }, { "docid": "c8c44544d14ee922bd93cfdb9108433a", "score": "0.52441347", "text": "renderField(field) {\n // destructuring field.meta.touched and field.meta.error so I can user touched and error.\n const { touched, error } = field.meta;\n /**\n * this is the conditional styling part\n * if the input is touched AND has error, then 'has-danger' class is added\n * otherwise, just form-group is added\n */\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n\n /**\n * this is the JSX that the Form component contains\n * field.label is taken from label=\"Title\" property\n * {...field.input} probably spreads all the input properties from redux form into this input \n * redux-form documentation uses \"props\" instead of \"field\"\n * \"props\" makes more sense because you're passing properties into an input element\n * when I removed {...field.input}, the validation no longer worked\n * touched and error are just shorthand for field.meta.touched and field.meta.error\n */\n return (\n <div className={className}>\n <label>{field.label}</label>\n <input className=\"form-control\" {...field.input} />\n <div className=\"text-help\">{touched ? error : \"\"}</div>\n </div>\n );\n }", "title": "" }, { "docid": "8f1c828c08044690e48d10abe9f253ce", "score": "0.5238336", "text": "getConfigFields() {\n\t\treturn [\n\t\t\t{\n\t\t\ttype: 'textinput',\n\t\t\tid: 'host',\n\t\t\tlabel: 'IP-Adress of Picturall server',\n\t\t\twidth: 6,\n\t\t\tdefault: '192.168.2.140',\n\t\t\tregex: Regex.IP,\n\t\t\ttooltip: 'Enter the IP-adress of the Picturall server you want to control. The IP of the unit can be found on the frontpanel LCD.'\n\t\t\t}\n\t\t]\n\t}", "title": "" }, { "docid": "65ae15474ac5e54d1aec7238c6000ede", "score": "0.5229813", "text": "function Form() {\n\n console.info(`+++++++++ formConfig: ${typeof formConfig}`);\n const formModel = new FormModel(formConfig[0]);\n const formId = formModel.id;\n\n return (\n <div className=\"ff-form\"\n data-form-id={formId} >\n\n <Field\n formId={formId}\n model={formModel.fields[0]} />\n <Field\n formId={formId}\n model={formModel.fields[1]} />\n </div>\n );\n}", "title": "" }, { "docid": "1d58e5f7c69fb5f28ea54bcfd6efddf8", "score": "0.5228726", "text": "function updateProperties() {\n\tgenUI.genPropertiesForm();\n\t\n\tvar selectedObj = selected[0];\n\tvar formName = \"propertiesFormId\";\n\t\n\tvar text = \"\";\n\tvar textsize = \"\";\n\tvar textcolour = \"\";\n\tvar width = \"\";\n\tvar height = \"\";\n\tvar colour = \"\";\n\tvar url = \"\";\n\t\n\t\n\tif (selectedObj) {\n\t\ttext = selectedObj.getLabel();\n\t\ttextsize = selectedObj.getTextSize();\n\t\ttextcolour = selectedObj.getTextColour();\n\t\twidth = selectedObj.getXSize();\n\t\theight = selectedObj.getYSize();\n\t\tcolour = selectedObj.getColour();\n\t\tif (selectedObj.attributes.type === \"QMLab.ImageNode\" ) {\n\t\t\turl = selectedObj.getImageURL();\n\t\t}\n\t\tif(selectedObj.attributes.type === \"QMLab.Agent\" ){\n\t\t\turl = selectedObj.getImage();\n\t\t}\n\t}\n\t\n\tsetPropertyDisplayValues(text, textsize, textcolour, width, height, colour, url)\n}", "title": "" }, { "docid": "00cf5eca2997c6a583e86a928bccbb74", "score": "0.52262884", "text": "getXMLAttributes() { return { inputValue : this.input.value.toString() }; }", "title": "" }, { "docid": "00cf5eca2997c6a583e86a928bccbb74", "score": "0.52262884", "text": "getXMLAttributes() { return { inputValue : this.input.value.toString() }; }", "title": "" }, { "docid": "00cf5eca2997c6a583e86a928bccbb74", "score": "0.52262884", "text": "getXMLAttributes() { return { inputValue : this.input.value.toString() }; }", "title": "" }, { "docid": "36437fcdd22f236b8e4c0fc80420a998", "score": "0.5220353", "text": "function renderField(field) {\n return (\n <div>\n <input {...field.input} type={field.type} className=\"form-control\" />\n {field.meta.touched && field.meta.error && <span className=\"error\">{field.meta.error}</span>}\n </div>\n );\n}", "title": "" }, { "docid": "ba3428799c5e2324beb8baac7c926c56", "score": "0.5202937", "text": "function makeField (data) {\n return `\n <div class=\"fields\" id=\"${data.id}\">\n <input type=\"${data.type}\" placeholder=\"${data.label}\"/>\n <i class=\"fa ${data.icon}\"</i>\n </div>`;\n}", "title": "" }, { "docid": "6262fd206ce11b54b6d48c129f5bf808", "score": "0.51897645", "text": "function renderField({ input, label, type, meta: { touched, error, warning } }){\n return (\n <div>\n <label>{label}</label>\n <div>\n <input {...input} placeholder={label} type={type} data-test-id={label} />\n {touched && ((error && <span>{error}</span>) || (warning && <span>{warning}</span>))}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "ebc1d9b93bbb3d1d36bb97d054482311", "score": "0.51860636", "text": "function cfnFormFieldValidationConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnForm_FieldValidationConfigurationPropertyValidator(properties).assertSuccess();\n return {\n NumValues: cdk.listMapper(cdk.numberToCloudFormation)(properties.numValues),\n StrValues: cdk.listMapper(cdk.stringToCloudFormation)(properties.strValues),\n Type: cdk.stringToCloudFormation(properties.type),\n ValidationMessage: cdk.stringToCloudFormation(properties.validationMessage),\n };\n}", "title": "" }, { "docid": "c665635f737cae63d87735248f447d54", "score": "0.51520896", "text": "function cfnFormFormStyleConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnForm_FormStyleConfigPropertyValidator(properties).assertSuccess();\n return {\n TokenReference: cdk.stringToCloudFormation(properties.tokenReference),\n Value: cdk.stringToCloudFormation(properties.value),\n };\n}", "title": "" }, { "docid": "6653f1b437fc579a59f1e101e2bdaab5", "score": "0.5128002", "text": "static get properties() {\n return {\n /** The text to display */\n label: { type: String },\n };\n }", "title": "" }, { "docid": "f5a31fff0cf96e7a4da3e02fcbaadb7b", "score": "0.51259786", "text": "function renderFields () {\n\t\tfor ( var key in Defaults.fields ) {\n\t\t\tvar data = Defaults.fields[key];\n\t\t\t$fieldSource.append(Fields.renderData(data));\n\t\t}\n\t}", "title": "" }, { "docid": "e2a8e54f748e2c5e74c0b0f1a1ca2000", "score": "0.5114302", "text": "renderField(field) {\n const { meta: { touched, error } } = field;\n const className = `formInput form-group ${touched && error ? \"has-danger\" : \"\"}`;\n\n return (\n <div className={className}>\n <input className=\"formInput form-control\" {...field.input} />\n <div className=\"text-help\">\n {touched ? error : \"\"}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "99c7bcb9d7f768d3bcdbf723eaf55803", "score": "0.5114181", "text": "renderSpecialPermissionsInputs() {\n return (\n <div className=\"col-md-11\">\n <input \n type=\"text\" \n className=\"form-control\" \n id=\"permissionContact\" \n name=\"permissionContact\"\n aria-describedby=\"permissionContact\" \n placeholder=\"email or url of contact to get accesss permissions\" \n />\n </div>\n )\n }", "title": "" }, { "docid": "22c0d17299462a101b0b4654faa67d59", "score": "0.5111112", "text": "renderField(field) {\n const { meta: { touched, error } } = field;\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n\n return (\n <div className={className}>\n <label>{field.label}</label>\n <input className=\"form-control w-35 ml-5\" type={field.type} {...field.input} />\n <div className=\"text-help\">\n {touched ? error : \"\"}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "4fdd6273d24c67b268928a922a03c75f", "score": "0.51075596", "text": "getTemplate() {\n return function (locals) {\n\n var stylesheet = locals.stylesheet;\n var formGroupStyle = stylesheet.formGroup.normal;\n var controlLabelStyle = stylesheet.controlLabel.normal;\n var selectStyle = stylesheet.select.normal;\n var helpBlockStyle = stylesheet.helpBlock.normal;\n var errorBlockStyle = stylesheet.errorBlock;\n\n if (locals.hasError) {\n formGroupStyle = stylesheet.formGroup.error;\n controlLabelStyle = stylesheet.controlLabel.error;\n selectStyle = stylesheet.select.error;\n helpBlockStyle = stylesheet.helpBlock.error;\n }\n\n var label = locals.label ? <Text style={controlLabelStyle}>{locals.label}</Text> : null;\n var help = locals.help ? <Text style={helpBlockStyle}>{locals.help}</Text> : null;\n var error = locals.hasError && locals.error ? <Text style={errorBlockStyle}>{locals.error}</Text> : null;\n var valueAsText;\n locals.options.map(({value, text}) => { \n if(locals.value == value) {\n valueAsText = text;\n }\n });\n\n if(locals.hide)\n {\n return(<View></View>);\n }\n var options = locals.options.map(({value, text}) => <PickerIOS.Item key={value} value={value} label={text} />);\n return (\n <View style={formGroupStyle}>\n <TouchableOpacity onPress={() => locals.onToggle(locals.collapsed)} underlayColor=\"#ffffff\">\n <View style={styles.buttonView}>\n <Text style={[controlLabelStyle, styles.buttonLabel]}>{locals.label}</Text> \n <Text style={[stylesheet.textbox.inputfont, styles.buttonDate]}>{valueAsText}</Text>\n </View>\n <Collapsible collapsed={locals.collapsed}>\n <PickerIOS\n ref=\"input\"\n style={selectStyle}\n selectedValue={locals.value}\n onValueChange={locals.onChange}\n >\n {options}\n </PickerIOS>\n </Collapsible>\n </TouchableOpacity>\n {help}\n {error}\n </View>\n ); \n }\n }", "title": "" }, { "docid": "0f17e2f362df7fe460bde38cfe7b988a", "score": "0.5083211", "text": "function oncreate$f() {\n \tconst { field } = this.get();\n \tif (field.data == null || field.data.metadata == null) {\n \t\treturn;\n \t}\n\n \tconst columns = field.data.metadata;\n \tdelete columns.customProperties;\n\n \tconst formMetadata = new FormMetadata({\n \t\tcustomProperties: field.data.metadata.customProperties,\n \t\toutputFields: columns,\n \t\tinputFields: []\n \t});\n\n \tconst items = [];\n \tfor (const item of field.data.items) {\n \t\titems.push(FormInstance.getOutputFieldValues(formMetadata.outputFields, item));\n \t}\n\n \tthis.set({\n \t\titems,\n \t\tcssClass: formMetadata.getCustomProperty(\"cssClass\") || \"\"\n \t});\n }", "title": "" }, { "docid": "6409e506aece9d77a15d788abd264d8f", "score": "0.5077449", "text": "render() {\n return (\n <div className=\"input-field\">\n <label htmlFor={this.props.name}>{this.props.label}</label>\n <input\n type={this.props.type}\n name={this.props.name}\n placeholder={this.props.placeholder}\n value={this.state.value}\n onChange={this.handleChange}\n />\n </div>\n )\n }", "title": "" }, { "docid": "6b6e37a7ca728407d20d2b7f27a86e60", "score": "0.5075963", "text": "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group form-control-lg ${\n touched && error ? \"has-danger\" : \"\"\n }`;\n //console.log(\"className : \" + className);\n return (\n <div class=\"form-group form-control-lg has-danger\">\n <label>{field.label}</label>\n <input\n class=\"form-control form-control-lg border border border-dark\"\n type={type}\n placeholder={placeholder}\n value={value}\n {...field.input}\n />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "title": "" }, { "docid": "a304004b971479f7d72801460eff0c01", "score": "0.5074173", "text": "static get properties() {\n return {\n /**\n * If set, a synchronous POST call will be fired to the path defined.\n * The `login` event is also dispatched, so `event.preventDefault()` can be called to prevent the POST call.\n */\n action: {\n type: String,\n value: null,\n notify: true\n },\n /**\n * If set, disable the \"Log in\" button and prevent user from submitting login form.\n * It is re-enabled automatically, when error is set to true, allowing form resubmission\n * after user makes changes.\n */\n disabled: {\n type: Boolean,\n value: false,\n notify: true\n },\n /**\n * If set, the error message is shown. The message is hidden by default.\n * When set, it changes the disabled state of the submit button.\n */\n error: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n notify: true\n },\n /**\n * Whether to hide the forgot password button. The button is visible by default.\n */\n noForgotPassword: {\n type: Boolean,\n value: false,\n notify: true\n },\n\n /**\n * The object used to localize this component.\n * For changing the default localization, change the entire\n * _i18n_ object or just the property you want to modify.\n *\n * The object has the following JSON structure (by default it doesn't include `additionalInformation`\n * and `header` sections, `header` can be added to override `title` and `description` properties\n * in `vaadin-login-overlay`):\n\n {\n header: {\n title: 'App name',\n description: 'Inspiring application description'\n },\n form: {\n title: 'Log in',\n username: 'Username',\n password: 'Password',\n submit: 'Log in',\n forgotPassword: 'Forgot password'\n },\n errorMessage: {\n title: 'Incorrect username or password',\n message: 'Check that you have entered the correct username and password and try again.'\n },\n additionalInformation: 'In case you need to provide some additional info for the user.'\n }\n *\n * @default {English/US}\n */\n i18n: {\n type: Object,\n value: function() {\n return {\n form: {\n title: 'Log in',\n username: 'Username',\n password: 'Password',\n submit: 'Log in',\n forgotPassword: 'Forgot password'\n },\n errorMessage: {\n title: 'Incorrect username or password',\n message: 'Check that you have entered the correct username and password and try again.'\n }\n };\n },\n notify: true\n },\n\n /**\n * If set, prevents auto enabling the component when error property is set to true.\n */\n _preventAutoEnable: {\n type: Boolean,\n value: false\n }\n };\n }", "title": "" }, { "docid": "6d293aa108ae2525e3e624f0aac20b94", "score": "0.50394285", "text": "static get properties() {\n return {\n ...super.properties,\n\n /**\n * allow grey instead of accent color, default selects a color\n */\n allowGrey: {\n type: Boolean,\n attribute: \"allow-grey\",\n },\n /**\n * optional simple-icon\n */\n icon: {\n type: String,\n },\n /**\n * invert colors\n */\n invert: {\n type: Boolean,\n attribute: \"invert\",\n reflect: true,\n },\n /**\n * text to use for avatar\n */\n label: {\n type: String,\n },\n /**\n * link to an image, optional\n */\n src: {\n type: String,\n },\n /**\n * Mode for presenting 1st two letters\n */\n twoChars: {\n type: Boolean,\n attribute: \"two-chars\",\n },\n /**\n * \"Deprecated\": Color class work to apply\n */\n color: {\n type: String,\n },\n /**\n * Form abstract art from hash of label\n */\n jdenticon: {\n type: Boolean,\n },\n };\n }", "title": "" }, { "docid": "9314bb210a31b38a0dce3815af10d079", "score": "0.50383645", "text": "renderField(field) {\r\n const {\r\n meta: { touched, error }\r\n } = field;\r\n const className =\r\n touched && error\r\n ? \"form-control form-control-lg is-invalid\"\r\n : \"form-control form-control-lg\";\r\n const inputType = field.type;\r\n const inputPlaceholder = field.placeholder;\r\n const errorMessageStyling = touched && error ? \"text-danger\" : \"\";\r\n\r\n return (\r\n <div className=\"form-group\">\r\n <label>{field.label}</label>\r\n <input\r\n className={className}\r\n type={inputType}\r\n placeholder={inputPlaceholder}\r\n {...field.input}\r\n />\r\n <div className={errorMessageStyling}>\r\n <div>{touched ? error : \"\"}</div>\r\n </div>\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "664cb4542e3237d43e2d92f41d0bf441", "score": "0.5036894", "text": "function setupFieldControl(fieldDef, fieldConfig)\n{\n // construct the control object for the field\n var control = {};\n control.params = {};\n \n var defaultControlConfig = null;\n var isPropertyField = (fieldDef.type !== \"association\");\n \n if (isPropertyField)\n {\n // get the default control for the property data type\n defaultControlConfig = defaultControls.items[fieldDef.dataType];\n \n // for backwards compatibility also check d:<dataType>\n if (defaultControlConfig === null)\n {\n defaultControlConfig = defaultControls.items[\"d:\" + fieldDef.dataType];\n }\n }\n else\n {\n // look for a specific type based default control for associations\n defaultControlConfig = defaultControls.items[\"association:\" + fieldDef.endpointType];\n \n // get the generic default control for associations if a type specific one was not found\n if (defaultControlConfig === null)\n {\n defaultControlConfig = defaultControls.items[\"association\"];\n }\n }\n \n // see if the fieldConfig already has a template defined, if not \n // retrieve the default template for the field's data type\n if (fieldConfig !== null && fieldConfig.control !== null && fieldConfig.control.template !== null)\n {\n control.template = fieldConfig.control.template;\n }\n else\n {\n if (isPropertyField)\n {\n if (defaultControlConfig !== null)\n {\n control.template = defaultControlConfig.template;\n }\n else if (logger.isWarnLoggingEnabled())\n {\n logger.warn(\"No default control found for data type \\\"\" + fieldDef.dataType + \"\\\" whilst processing field \\\"\" + fieldDef.configName + \"\\\"\");\n }\n }\n else\n {\n if (defaultControlConfig !== null)\n {\n control.template = defaultControlConfig.template;\n }\n else if (logger.isWarnLoggingEnabled())\n {\n logger.warn(\"No default control found for associations\" + \"\\\" whilst processing field \\\"\" + fieldDef.configName + \"\\\"\");\n }\n }\n }\n \n // send any type parameters returned from the server to the control\n if (isPropertyField && typeof fieldDef.dataTypeParameters !== \"undefined\")\n {\n control.params.dataTypeParameters = fieldDef.dataTypeParameters;\n }\n \n // get control parameters for the default control (if there is one)\n if (defaultControlConfig !== null)\n {\n var paramsConfig = defaultControlConfig.params;\n for (var p = 0; p < paramsConfig.length; p++)\n {\n control.params[paramsConfig[p].name] = paramsConfig[p].value;\n }\n }\n \n // get overridden control parameters (if there are any)\n if (fieldConfig !== null)\n {\n var paramsConfig = fieldConfig.control.params;\n for (var p = 0; p < paramsConfig.length; p++)\n {\n control.params[paramsConfig[p].name] = paramsConfig[p].value;\n }\n }\n \n fieldDef.control = control;\n}", "title": "" }, { "docid": "126fd9097b02cd5eba030cc3db4e5c59", "score": "0.50360066", "text": "renderPage() {\n return (\n <Grid id=\"edit-recipe\" container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Edit Recipe</Header>\n <AutoForm schema={bridge} onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment>\n <TextField id='edit-recipe-name' name='recipeName'/>\n <TextField id='edit-recipe-description' name='description'/>\n <TextField id='edit-recipe-image' name='image'/>\n <NumField id='edit-recipe-servings' name='servings' decimal={true}/>\n <MultiSelectField id='edit-recipe-restrictions' name='restrictions' showInlineError={true} placeholder={'Restrictions'}/>\n <span>*Please capitalize and specify only the name of ingredient*</span>\n <ListField\n id='edit-recipe-ingredients'\n name='ingredients'\n showInlineError={true}\n initialCount={this.props.doc.ingredients.length}\n itemProps={this.props.doc.ingredients}>\n </ListField>\n <ListField\n id='edit-recipe-tools'\n name='tools'\n showInlineError={true}\n initialCount={this.props.doc.tools.length}\n itemProps={this.props.doc.tools}>\n </ListField>\n <span>*Be sure to mention the amount of a certain ingredient that is being used!*</span>\n <ListField\n id='edit-recipe-steps'\n name='steps'\n showInlineError={true}\n initialCount={this.props.doc.steps.length}\n itemProps={this.props.doc.steps}>\n </ListField>\n <SubmitField id='submit' value='Submit'/>\n <ErrorsField/>\n <HiddenField name='recipeEmail' />\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "84762853d697174bdc290f24186acee6", "score": "0.50327724", "text": "render() {\n return (\n <form className=\"was-validated\">\n <h2>Lifestyle</h2>\n <div className=\"form-group\">\n <label>Diet</label>\n {Util.pageInputForField(this, Model.FIELD_IDS.diet)}\n </div>\n\n <div className=\"form-group\">\n <label>Do you shop mostly for local produce?</label>\n {Util.pageInputForField(this, Model.FIELD_IDS.shop_local_produce)}\n </div>\n\n <div className=\"form-group\">\n <label>Do you shop mostly for organic food?</label>\n {Util.pageInputForField(this, Model.FIELD_IDS.shop_organic_food)}\n </div>\n </form>\n )\n }", "title": "" }, { "docid": "e8dcf02242f393fa1d2dd7c467294292", "score": "0.5031332", "text": "renderField(field) {\n // giving the input {...field.input} is the same as doing\n // onChange={field.input.onChange}\n // onFocus={field.input.onFocus} etc etc saves a lot of time!\n // Also, any props given to the Field JSX component are passed onto the field object\n // i.e. field.label in our case\n // also the error object from validate is present here inside the meta object\n // so field.meta.error\n const { meta: { touched, error } } = field // nested destructuring. touched and error pulled out from meta object, which is pulled out of field object\n const className = `form-group ${touched && error ? 'has-danger' : ''}`\n return (\n <div className={className}>\n <label> {field.label} </label>\n <input className=\"form-control\"\n type=\"text\"\n {...field.input}\n />\n <div className={\"text-help\"}>\n {touched ? error : ''}\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "4245ee821fb8452dfa10947a0287e67f", "score": "0.50273746", "text": "elementInfo() {\n const attributes = {\n name: this.options.name,\n type: this.component.inputType || 'text',\n class: 'form-control',\n lang: this.options.language\n };\n\n if (this.component.placeholder) {\n attributes.placeholder = this.t(this.component.placeholder, { _userInput: true });\n }\n\n if (this.component.tabindex) {\n attributes.tabindex = this.component.tabindex;\n }\n\n if (this.disabled) {\n attributes.disabled = 'disabled';\n }\n\n _.defaults(attributes, this.component.attributes);\n\n return {\n type: 'input',\n component: this.component,\n changeEvent: 'change',\n attr: attributes\n };\n }", "title": "" }, { "docid": "249824fd93cddb5fe0aa15585b908ace", "score": "0.5024403", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"D\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"o\" /* getElementType */])(FormField, props);\n\n // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label)\n );\n }\n\n // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n var controlProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { children: children, disabled: disabled, required: required, type: type\n\n // wrap HTML checkboxes/radios in the label\n });if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n 'label',\n null,\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps),\n ' ',\n label\n )\n );\n }\n\n // pass label prop to controls that support it\n if (control === __WEBPACK_IMPORTED_MODULE_7__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_8__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, controlProps, { label: label }))\n );\n }\n\n // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label, { defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(controlProps, 'id') }\n }),\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps)\n );\n}", "title": "" }, { "docid": "4e9d44a03ac05fcaafc0abc393659aab", "score": "0.5024223", "text": "constructor(\n object = mandatory('object'),\n property = mandatory('property'),\n parent = null,\n fieldType = 'input',\n allowedValues = null,\n hierarchy = null,\n { constraints = '', title = null, baseMessage = '' } = {},\n ) {\n super(object, property, hierarchy)\n\n // constant\n this.VALID_FIELD_TYPE = ['input', 'select', 'slider', 'radio']\n\n // field\n this._field = undefined\n this.fieldType = fieldType\n this.fieldHTML = null\n this.allowedValues = allowedValues\n this.constraints = constraints || ''\n this.tempClass = `binded-${typeof object}${property}`\n this.subfields = []\n this.errorDiv = null\n this.messageDiv = null\n this.title = (title || property).replace(/(^|\\s)[a-z]/g, f => f.toUpperCase())\n this.baseMessage = baseMessage\n\n\n // parent\n this.parent = parent\n\n // build the field html based on the fieldType: input, select, textaera, slider, radio\n const idRadio = $('input[type=\"radio\"]').length\n let html = ''\n switch (this.fieldType) {\n case 'input':\n this.fieldHTML = `<div class=\"form-group\"><label class=\"bindedfield-label\">${this.title}</label>\n <input type=\"text\" class=\"form-control ${this.tempClass}\" data-binded=\"${property}\">\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\" >\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </div>`\n break\n case 'password':\n this.fieldHTML = `<div class=\"form-group\"><label class=\"bindedfield-label\">${this.title}</label>\n <input type=\"password\" class=\"form-control ${this.tempClass}\" data-binded=\"${property}\">\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\" >\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </div>`\n break\n case 'select':\n if (!allowedValues) {\n debugError('fieldType selector needs at least one allowedValues')\n return\n }\n\n html += `<div class=\"form-group\">\n <label class=\"bindedfield-label\">${this.title}</label>\n <select class=\"form-control ${this.tempClass}\" data-binded=\"${property}\">`\n\n for (let i = 0; i < this.allowedValues.length; i++) {\n html += `${this.fieldHTML}<option value=\"${\n this.allowedValues[i]\n }\">${\n this.allowedValues[i]\n }</option>`\n }\n this.fieldHTML = `${html}</select>\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\"\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </div>`\n break\n case 'textaera':\n this.fieldHTML = `<div class=\"form-group\"><label class=\"bindedfield-label\">${this.title}</label>\n <textarea class=\"form-control ${this.tempClass}\" rows=\"3\" data-binded=\"${property}\"></textarea>\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\" >\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </div>`\n break\n case 'slider':\n this.fieldHTML = `<div class=\"form-group\"><label class=\"bindedfield-label\">${this.title}</label>\n <input type=\"range\" data-binded=\"${property}\" class=\"form-control ${this.tempClass}\" min=\"${this.allowedValues[0]}\" max=\"${this.allowedValues[1]}\" step=\"${this.allowedValues[2]}\" />\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\" >\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </div>`\n break\n case 'radio':\n if (!allowedValues) {\n debugError('fieldType selector needs at least one allowedValues')\n return\n }\n\n html = `<fieldset class=\"form-group\"><label class=\"bindedfield-label\">${this.title}</label>`\n for (const value of this.allowedValues) {\n html += `<div class=\"form-check\">\n <label class=\"form-check-label\">\n <input type=\"radio\" class=\"form-check-input ${this.tempClass}\" name=\"${property}${idRadio}\" value=\"${value}\" data-binded=\"${property}\" checked>\n ${value}\n </label>\n </div> `\n }\n\n this.fieldHTML = `${html}\n <div class=\"col-sm-10 bindedfield-errordiv ${this.tempClass}-error\" >\n <i class=\"glyphicon glyphicon-remove\"></i><span class=\"bindedfield-error\"></span>\n </div>\n <div class=\"col-sm-10 bindedfield-messagediv ${this.tempClass}-message\" >\n <i class=\"glyphicon glyphicon-info\"></i><span class=\"bindedfield-message\"></span>\n </div>\n </fieldset>`\n break\n default:\n debugError('fieldType is invalid : input, selector and slider are the only valid type for now')\n return\n }\n\n if (parent) {\n this.placeInParent()\n }\n }", "title": "" }, { "docid": "5082123dc832b60bbb9a30054ee16793", "score": "0.50195336", "text": "render() {\n return html`\n <style>\n :host {\n display: flex;\n flex-direction: column;\n }\n input {\n border: none;\n background-color: #F3F3F3;\n border-radius: 4px;\n outline: none;\n padding: 8px 12px;\n }\n </style>\n <input .value=\"${this.value}\" \n @change=\"${(e) => this.handleChange(e)}\" \n placeholder=\"${this.placeholder}\">\n `;\n }", "title": "" }, { "docid": "80442e4fd9388254ff51e874f5fa47de", "score": "0.50179356", "text": "render() {\n return html`\n <ul>\n <div>\n <label for=\"uname\">Username</label>\n <input type=\"text\" placeholder=\"${this.uname}\" name=\"uname\">\n </div>\n <div>\n <label for=\"firstName\">First Name</label>\n <input type=\"text\" placeholder=\"${this.firstName}\" name=\"firstName\">\n </div>\n <div>\n <label for=\"lastName\">Last Name</label>\n <input type=\"text\" placeholder=\"${this.lastName}\" name=\"lastName\">\n </div>\n <div>\n <label for=\"oldPwd\">Old Password</label>\n <input type=\"password\" placeholder=\"\" name=\"oldPwd\">\n </div>\n <div>\n <label for=\"pwd\">New Password</label>\n <input type=\"password\" placeholder=\"\" name=\"uname\">\n </div>\n </ul>\n `;\n }", "title": "" }, { "docid": "b33572d95eba7606af53e8e96aadc1e1", "score": "0.5013961", "text": "renderFields() {\n const state = this.state;\n\n return (\n <div className=\"form-group\">\n <input name=\"id\" value={state.id} type=\"hidden\" className=\"form-control\" />\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblName}</span>\n <input type=\"text\" name=\"name\" value={state.name} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblSystName}</span>\n <input type=\"text\" name=\"systemName\" value={state.systemName} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblDesc}</span>\n <input type=\"text\" name=\"description\" value={state.description} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblBenef}</span>\n <input type=\"text\" name=\"benefits\" value={state.benefits} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblServices}</span>\n <input type=\"text\" name=\"services\" value={state.services} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblActualGoal}</span>\n <input type=\"number\" name=\"actualGoal\" value={state.actualGoal} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblMonthlyGoal}</span>\n <input type=\"number\" name=\"monthlyGoal\" value={state.monthlyGoal} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblStartDate}</span>\n <input type=\"date\" name=\"startDate\" value={state.startDate} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <label className=\"col-md-12\">\n <span>{GLOBAL.prodAdmin.lblEndDate}</span>\n <input type=\"date\" name=\"endDate\" value={state.endDate} className=\"form-control\" onBlur={this._handleBlur} onChange={this._handleChange} />\n </label>\n <span><br />&nbsp;</span>\n </div>\n );\n }", "title": "" }, { "docid": "7f13bbee8235c5e24f334e7b225f7f1e", "score": "0.5012234", "text": "renderPage() {\n // eslint-disable-next-line no-unused-vars\n let fRef = null;\n const keySchema = null;\n const formSchema = makeSchema(keySchema);\n return (\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Edit Key</Header>\n <AutoForm ref={ref => { fRef = ref; }} schema={formSchema}\n onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment>\n <TextField name='keyName'/>\n <TextField name='website'/>\n <Segment.Group horizontal>\n <Segment><TextField name='username'/></Segment>\n <Segment><TextField name='password'/></Segment>\n </Segment.Group>\n <LongTextField name='description'/>\n <SubmitField value='Submit'/>\n <Link to=\"/my-keys\"><Button>Back</Button></Link>\n <ErrorsField/>\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "f8376450e514f1169dcb57efb650b8fc", "score": "0.5009918", "text": "renderPage() {\n return (\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">\n Edit Event\n </Header>\n <AutoForm\n schema={bridge}\n onSubmit={(data) => this.submit(data)}\n model={this.props.doc}\n >\n <Segment>\n <TextField name=\"title\" />\n <DateField\n name=\"eventDate\"\n label=\"Start Date\"\n max={new Date(2100, 1, 1)}\n min={new Date(2000, 1, 1)}\n />\n <DateField\n name=\"endDate\"\n label=\"End Date\"\n max={new Date(2100, 1, 1)}\n min={new Date(2000, 1, 1)}\n />\n <TextField name=\"location\" />\n <SelectField name=\"cost\" />\n <TextField name=\"description\" />\n <UploadImg imgRef={this.imgRef} />\n <SubmitField value=\"Submit\" />\n <ErrorsField />\n <HiddenField name=\"owner\" />\n <HiddenField name=\"image\" />\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "fb1e0caa68a91a277458a8023ef982bf", "score": "0.5008768", "text": "createFormField(){\n return [\n //name field\n {\n key : 'name',\n type : 'input',\n templateOptions : {\n label: 'Name',\n required: true\n },\n\n validators : {\n alpha: ($viewValue, $modelValue) => {\n let value = $modelValue || $viewValue;\n if(value.length > 1 && value.length < 60) {\n return /^[a-zA-Z ]*$/.test(value);\n } else {\n return false;\n }\n }\n }\n },\n //name error msg\n {\n template: '<p class=\"text-danger\"> Please enter a valid name</p>',\n hideExpression: function($viewValue, $modelValue, scope) {\n let error = scope.theFormlyForm.$error.alpha;\n return (error && error[0].$dirty) ? false : true;\n }\n\n },\n //email field\n {\n key : 'email',\n type : 'input',\n templateOptions : {\n label: 'Email Address',\n required: true,\n type: 'email'\n }\n\n },\n //email error message\n {\n template: '<p class=\"text-danger\"> Please enter a valid Email address {{$modelValue |json}}</p>',\n hideExpression: function($viewValue, $modelValue, scope) {\n return !scope.theFormlyForm.$error.email;\n }\n\n },\n {\n key : 'password',\n type : 'input',\n templateOptions : {\n label: 'Password',\n required: true,\n type : 'password',\n minlength: 5\n }\n },\n {\n template: '<p class=\"text-danger\"> Please enter a valid password</p>',\n hideExpression: function($viewValue, $modelValue, scope) {\n return !scope.theFormlyForm.$error.minlength;\n }\n\n }\n ];\n }", "title": "" }, { "docid": "dd97c6d7fabd096eefaa12cb0fb00349", "score": "0.50086224", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n var classes = __WEBPACK_IMPORTED_MODULE_4_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"A\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"A\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"A\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"G\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"q\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"p\" /* getElementType */])(FormField, props); // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(label)) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_7__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n }\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"h\" /* createHTMLLabel */])(label, {\n autoGenerateKey: false\n }));\n } // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n\n\n var controlProps = __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_objectSpread___default()({}, rest, {\n content: content,\n children: children,\n disabled: disabled,\n required: required,\n type: type // wrap HTML checkboxes/radios in the label\n\n });\n\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\"label\", null, Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, controlProps), \" \", label));\n } // pass label prop to controls that support it\n\n\n if (control === __WEBPACK_IMPORTED_MODULE_8__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_9__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_objectSpread___default()({}, controlProps, {\n label: label\n })));\n } // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"h\" /* createHTMLLabel */])(label, {\n defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(controlProps, 'id')\n },\n autoGenerateKey: false\n }), Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, controlProps));\n}", "title": "" }, { "docid": "7aac617a66daf4a89ff0396a288ca185", "score": "0.49778798", "text": "renderField(field){\n var className = 'form-group';\n\n if(field.meta.touched && field.meta.error){\n className += ' has-danger';\n }\n else{\n className += '';\n }\n\n return(\n <div className={className}>\n <label>{field.labelToShow}</label>\n <input\n className=\"form-control\"\n type=\"text\"\n {...field.input}\n />\n <div className=\"text-help\">\n {field.meta.touched ? field.meta.error : ''}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "66cd82627efc23e3f962dcb1ee4aea50", "score": "0.49778485", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"I\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"s\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getElementType */])(FormField, props);\n\n // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label)\n );\n }\n\n // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n var controlProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { content: content, children: children, disabled: disabled, required: required, type: type\n\n // wrap HTML checkboxes/radios in the label\n });if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n 'label',\n null,\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps),\n ' ',\n label\n )\n );\n }\n\n // pass label prop to controls that support it\n if (control === __WEBPACK_IMPORTED_MODULE_7__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_8__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, controlProps, { label: label }))\n );\n }\n\n // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label, { defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(controlProps, 'id') }\n }),\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps)\n );\n}", "title": "" }, { "docid": "5b369b3f4ff35f261558fc15961509b8", "score": "0.49742076", "text": "function populateField(config, text, alt, employee) {\n const fields = config[\"inputField\"];\n const cells = config[\"inputCell\"];\n const type = config[\"inputType\"];\n for(let i = 0; i<fields.length; i++){\n if(alt == fields[i] && cells[i] != \"\"){\n text.setText(replacePlaceholders(cells[i], employee, config, type[i] == \"Date\", type[i] == \"Date-time range\"));\n }\n }\n}", "title": "" }, { "docid": "5a6fa31c0bea6b929b30ffe97b617f28", "score": "0.49737507", "text": "renderField(field) {\n return(\n <div className={`margin-bottom-20 ${field.meta.touched && field.meta.error ? 'has-error' : ''}`}>\n <div className='input-group'>\n <span className=\"input-group-addon\"><i className={field.spanClassName}></i></span>\n <input {...field.input} type={field.inputType} className='form-control' placeholder={field.placeholder}/>\n </div>\n {field.meta.touched && field.meta.error && <span className=\"control-label\">{field.meta.error}</span>}\n </div>\n )\n }", "title": "" }, { "docid": "dfe6b12a28191e202ce1efefa3ed9226", "score": "0.49632636", "text": "function getHTMLTxtField(field) {\n return \"<div class=\\\"input-field col s6\\\"><input id=\" + field.id + \" type=\\\"text\\\" \" + \"><label for=\" + field.id + \">\" + field.label + \"</label></div>\"\n}", "title": "" }, { "docid": "40dcdfbc31f183062652812415cff5e8", "score": "0.49632215", "text": "renderPage() {\n return (\n <Container id=\"signup-page\">\n <Grid textAlign=\"center\" verticalAlign=\"middle\" centered columns={2}>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\" inverted>\n Update your barGAINS profile\n </Header>\n <Divider/>\n <AutoForm schema={bridge} onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment>\n <TextField name='email'/>\n <Form.Group widths='equal'>\n <TextField name='firstName'/>\n <TextField name='lastName'/>\n </Form.Group>\n <TextField name='profilePic'/>\n <TextField name='phone'/>\n <SelectField name='questionnaire'/>\n <SubmitField value='Submit'/>\n <ErrorsField/>\n <HiddenField name='owner' />\n <Button color='red' basic as={Link} activeClassName=\"active\" exact to=\"/myprofile\" key='profile'>Cancel</Button>\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n </Container>\n );\n }", "title": "" }, { "docid": "f56a76249a8b7a7a81345800a8466ca8", "score": "0.49609858", "text": "static get properties() {\n return {\n text: {\n type: String\n },\n customclass: {\n type: String,\n value: 'primary'\n },\n color: {\n type: String,\n value: 'green'\n }\n }\n }", "title": "" }, { "docid": "a35ce659fa354521bdd78a68902c0652", "score": "0.49601182", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getElementType */])(FormField, props);\n\n // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label)\n );\n }\n\n // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n var controlProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { content: content, children: children, disabled: disabled, required: required, type: type\n\n // wrap HTML checkboxes/radios in the label\n });if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n 'label',\n null,\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps),\n ' ',\n label\n )\n );\n }\n\n // pass label prop to controls that support it\n if (control === __WEBPACK_IMPORTED_MODULE_7__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_8__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, controlProps, { label: label }))\n );\n }\n\n // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label, { defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(controlProps, 'id') }\n }),\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps)\n );\n}", "title": "" }, { "docid": "4920f1eb201788116cb430859d4ae522", "score": "0.4957381", "text": "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n console.log(\"className : \" + className);\n return (\n <div class={className}>\n <label>{field.label}</label>\n <input\n class=\"form-control\"\n type={type}\n placeholder={placeholder}\n value={value}\n {...field.input}\n />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "title": "" }, { "docid": "8dfae8c5acf25bc9e8fb5438f1b46865", "score": "0.49552178", "text": "function renderInputView() {\n input_task_field.value = user_input_task;\n}", "title": "" }, { "docid": "34b3a3bb9e8582833473d2277a021231", "score": "0.4954042", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(FormField, props);\n\n // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label)\n );\n }\n\n // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n var controlProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { content: content, children: children, disabled: disabled, required: required, type: type\n\n // wrap HTML checkboxes/radios in the label\n });if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n 'label',\n null,\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps),\n ' ',\n label\n )\n );\n }\n\n // pass label prop to controls that support it\n if (control === __WEBPACK_IMPORTED_MODULE_7__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_8__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, controlProps, { label: label }))\n );\n }\n\n // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n { className: classes },\n Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"i\" /* createHTMLLabel */])(label, { defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(controlProps, 'id') }\n }),\n Object(__WEBPACK_IMPORTED_MODULE_5_react__[\"createElement\"])(control, controlProps)\n );\n}", "title": "" }, { "docid": "faac68018815c1b066c0fb4e2655abb5", "score": "0.49516606", "text": "function cfnFormFormInputValuePropertyPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnForm_FormInputValuePropertyPropertyValidator(properties).assertSuccess();\n return {\n Value: cdk.stringToCloudFormation(properties.value),\n };\n}", "title": "" }, { "docid": "4ae313ae445cf2dce4c34857bc62adcf", "score": "0.4946475", "text": "renderPage() {\n return (\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Edit Profile</Header>\n <AutoForm schema={MusicianSchema} onSubmit={data => this.submit(data)} model={this.props.doc}>\n <Segment>\n <Form.Group widths={'equal'}>\n <TextField name='firstName' placeholder={'First Name'}/>\n <TextField name='lastName' placeholder={'Last Name'}/>\n </Form.Group>\n <LongTextField name='bio' placeholder='Write a little bit about yourself.'/>\n <Form.Group widths={'equal'}>\n <TextField name='picture' placeholder={'URL to picture'}/>\n <TextField name='website' optional={true} placeholder={'Link to Website'}/>\n </Form.Group>\n <Form.Group widths={'equal'}>\n <TextField name='youtube' optional={true} placeholder={'Link to Youtube channel'}/>\n <TextField name='soundcloud' optional={true} placeholder={'Link to Soundcloud feed'}/>\n </Form.Group>\n <Form.Group widths={'equal'}>\n <MultiSelectField name='skills' placeholder={'Skills'}/>\n <MultiSelectField name='genres' placeholder={'Genres'}/>\n </Form.Group>\n <ErrorsField/>\n <HiddenField name='owner' />\n <SubmitField value='Submit'/>\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "0fc97dc0640c6962248f021f55218356", "score": "0.4941756", "text": "ContractInfoFields() {\n if(this.state.isContentObjectContract) { return null; }\n\n return [\n <label key=\"contract-name-label\" htmlFor=\"name\">Name</label>,\n <input key=\"contract-name\" name=\"name\" value={this.state.name} required={true} onChange={this.HandleInputChange} />,\n\n <label key=\"contract-description-label\" className=\"align-top\" htmlFor=\"description\">Description</label>,\n <textarea key=\"contract-description\" name=\"description\" value={this.state.description} onChange={this.HandleInputChange} />\n ];\n }", "title": "" }, { "docid": "0fc97dc0640c6962248f021f55218356", "score": "0.4941756", "text": "ContractInfoFields() {\n if(this.state.isContentObjectContract) { return null; }\n\n return [\n <label key=\"contract-name-label\" htmlFor=\"name\">Name</label>,\n <input key=\"contract-name\" name=\"name\" value={this.state.name} required={true} onChange={this.HandleInputChange} />,\n\n <label key=\"contract-description-label\" className=\"align-top\" htmlFor=\"description\">Description</label>,\n <textarea key=\"contract-description\" name=\"description\" value={this.state.description} onChange={this.HandleInputChange} />\n ];\n }", "title": "" }, { "docid": "edc695f4435c1a6d76cdc4b1d288c2eb", "score": "0.4940338", "text": "render () {\n const { handleSubmit, pristine, reset, submitting } = this.props;\n return (\n <form onSubmit={handleSubmit}>\n <Field\n label=\"Employee\"\n name=\"employee\"\n component={this.renderTextAreaField.bind(this)}\n />\n <Field\n label=\"Cost Centre\"\n name=\"cost_centre_id\"\n component={this.renderCostCenterDropdownField.bind(this)}\n />\n <Field\n label=\"Approval Limit (CAD)\"\n name=\"amount\"\n component={this.renderField}\n type=\"number\"\n min={0}\n step={0.01}\n />\n <div className=\"buttons-row\">\n <button type=\"submit\" className=\"btn page-button-blue\" disabled={pristine || submitting}>Save</button>\n <button type=\"button\" className=\"btn page-button-red\" disabled={pristine || submitting} onClick={reset}>Reset</button>\n </div>\n </form>\n );\n }", "title": "" }, { "docid": "8a4da9f5aa095cc018717a31a0cfc332", "score": "0.4940034", "text": "renderField(field) {\n const { meta: { touched, error } } = field;\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n\n return (\n <div className={className}>\n <label>{field.label}</label>\n <input className=\"form-control\" type=\"text\" {...field.input} />\n <div className=\"text-help\">\n {touched ? error : \"\"}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "f6930a1f850ed6727895bca00f04c8a9", "score": "0.49354306", "text": "function OptionsForm(props) { \n const classes = makeStyles();\n const {\n formField: {\n optionsCardSize,\n optionsPackaging,\n optionsShippingType,\n deliveryContactNumber,\n deliveryContrast,\n }\n } = props;\n\n return (\n <div className={classes.root}>\n <Grid container spacing={2}>\n <Grid item xs={12} sm={6}>\n <Paper className={classes.paper}>\n <h3>Flowers</h3> \n </Paper>\n </Grid> \n <Grid item xs={12} sm={6}>\n <Paper className={classes.paper}>\n <h3>Chocolates</h3> \n </Paper>\n </Grid> \n </Grid> \n <br /> \n </div> \n );\n}", "title": "" }, { "docid": "13b72d44f37660331a519d7d0ba4ee60", "score": "0.49352828", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n var classes = __WEBPACK_IMPORTED_MODULE_4_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"B\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"B\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"B\" /* useKeyOnly */])(required, 'required'), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"H\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"s\" /* getUnhandledProps */])(FormField, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"r\" /* getElementType */])(FormField, props); // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(label)) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_7__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children);\n }\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"i\" /* createHTMLLabel */])(label));\n } // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n\n\n var controlProps = __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_objectSpread___default()({}, rest, {\n content: content,\n children: children,\n disabled: disabled,\n required: required,\n type: type // wrap HTML checkboxes/radios in the label\n\n });\n\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\"label\", null, Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, controlProps), \" \", label));\n } // pass label prop to controls that support it\n\n\n if (control === __WEBPACK_IMPORTED_MODULE_8__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_9__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_objectSpread___default()({}, controlProps, {\n label: label\n })));\n } // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(ElementType, {\n className: classes\n }, Object(__WEBPACK_IMPORTED_MODULE_7__lib__[\"i\" /* createHTMLLabel */])(label, {\n defaultProps: {\n htmlFor: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(controlProps, 'id')\n }\n }), Object(__WEBPACK_IMPORTED_MODULE_6_react__[\"createElement\"])(control, controlProps));\n}", "title": "" }, { "docid": "d51a35f4106f748fae5645a7ef31bfc3", "score": "0.49327645", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_4___default()(Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(error, 'error'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(inline, 'inline'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(required, 'required'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useWidthProp\"])(width, 'wide'), 'field', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"getUnhandledProps\"])(FormField, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"getElementType\"])(FormField, props); // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (lodash_isNil__WEBPACK_IMPORTED_MODULE_3___default()(control)) {\n if (lodash_isNil__WEBPACK_IMPORTED_MODULE_3___default()(label)) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_7__[\"childrenUtils\"].isNil(children) ? content : children);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, rest, {\n className: classes\n }), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"createHTMLLabel\"])(label, {\n autoGenerateKey: false\n }));\n } // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n\n\n var controlProps = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n content: content,\n children: children,\n disabled: disabled,\n required: required,\n type: type // wrap HTML checkboxes/radios in the label\n\n });\n\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(\"label\", null, Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, controlProps), \" \", label));\n } // pass label prop to controls that support it\n\n\n if (control === _modules_Checkbox__WEBPACK_IMPORTED_MODULE_8__[\"default\"] || control === _addons_Radio__WEBPACK_IMPORTED_MODULE_9__[\"default\"]) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, controlProps, {\n label: label\n })));\n } // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"createHTMLLabel\"])(label, {\n defaultProps: {\n htmlFor: lodash_get__WEBPACK_IMPORTED_MODULE_2___default()(controlProps, 'id')\n },\n autoGenerateKey: false\n }), Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, controlProps));\n}", "title": "" }, { "docid": "5457da75ccdc729b49f6f5d610003512", "score": "0.49242112", "text": "renderField(field) {\n const { meta: { touched, error } } = field;\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n\n return (\n <div className={className}>\n <label>{field.label}</label>\n <input className=\"form-control\" {...field.input} />\n <div className=\"text-help\">\n {touched ? error : \"\"}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "7eb18cd847d2fabc32bf64155607b317", "score": "0.49187964", "text": "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group form-control-lg ${\n touched && error ? \"has-danger\" : \"\"\n }`;\n console.log(\"className : \" + className);\n return (\n <div class=\"form-group form-control-lg has-danger\">\n <label>{field.label}</label>\n <input\n class=\"form-control form-control-lg border border border-dark\"\n type={type}\n placeholder={placeholder}\n value={value}\n {...field.input}\n />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "title": "" }, { "docid": "437b59510c16d1a63d9762770ad75804", "score": "0.49139008", "text": "render() {\n let fRef = null;\n return (\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Add Vaccine Information</Header>\n <AutoForm ref={ref => { fRef = ref; }} schema={bridge} onSubmit={data => this.submit(data, fRef)} >\n <Segment>\n <TextField name='name'/>\n <TextField name='patientID'/>\n <SelectField name='vaccineType'/>\n <DateField name='dose1' />\n <TextField name='clinic1' />\n <DateField name='dose2' />\n <TextField name='clinic2' />\n <SubmitField value='Submit'/>\n <ErrorsField/>\n </Segment>\n </AutoForm>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "0ce296be447b8fd356a72e8db5a13ec7", "score": "0.49118686", "text": "function setupEditField() {\n\t}", "title": "" }, { "docid": "dd9891f3c361a29fa8845eb6fb104fde", "score": "0.49102142", "text": "renderPage() {\n return (\n <Grid container centered>\n <Grid.Column>\n <Header as=\"h2\" textAlign=\"center\">Edit Profile</Header>\n <AutoForm schema={ProfileSchema} onSubmit={this.submit} model={this.props.doc}>\n <Segment>\n <Form.Group widths='equal'>\n <TextField label='First Name' name='firstName'/>\n <TextField label='Last Name' name='lastName'/>\n </Form.Group>\n <TextField name='picture'/>\n <LongTextField name='bio'/>\n <Form.Group widths='equal'>\n <SelectField label='Fluent Languages' name='fluentLanguages'/>\n <SelectField label='Practice Languages' name='practiceLanguages'/>\n </Form.Group>\n <Form.Group>\n <SelectField label='Days Available For Meetings' name='days'/>\n <SelectField label='Meeting Preferences' name='meetingOptions'/>\n </Form.Group>\n <SubmitField value='Submit'/>\n <ErrorsField/>\n <HiddenField name='owner'/>\n <HiddenField name='active'/>\n </Segment>\n </AutoForm>\n <Divider/>\n <Button positive as={Link} to={`/list/${this.props.doc._id}`}>\n Return to pals\n </Button>\n <Button as={Link} to={`/deactivateprofile/${this.props.doc._id}`}\n icon labelPosition='left' negative compact>\n Deactivate Profile\n <Icon name='warning sign'/>\n </Button>\n </Grid.Column>\n </Grid>\n );\n }", "title": "" }, { "docid": "519b1bfa5ea3bc66b4c9c310eb41e219", "score": "0.49083292", "text": "render() {\n\n const { onChangingValues, onPassingValues, onCreatingProfile } = this.props;\n\n return (\n <div id=\"FormIntroduce\" className=\"ui middle aligned center aligned grid segment\">\n <Form>\n <Form.Group widths={1}>\n <Form.Input label='First name' placeholder='First name' onChange={ (event) => onChangingValues('name',event.target.value) } value={ onPassingValues.name } />\n <Form.Input label='Last name' placeholder='Last name' onChange={ (event) => onChangingValues('lastname',event.target.value) } value={ onPassingValues.lastname } />\n </Form.Group>\n <Form.Group widths={1}>\n <Form.Input label='Username' placeholder='Username' onChange={ (event) => onChangingValues('username',event.target.value) } value={ onPassingValues.username } />\n <Form.Input label='Email' placeholder='Email' onChange={ (event) => onChangingValues('email',event.target.value) } value={ onPassingValues.email } />\n </Form.Group>\n <Button type='submit' onClick={ () => onCreatingProfile() }>Create Profile</Button>\n </Form>\n </div>\n )}", "title": "" }, { "docid": "9ffb99c070556d28846e078c5cf31649", "score": "0.49051657", "text": "constructor() {\n this._config = {\n settings: {\n debug: false\n },\n fields: {\n array: fields.ArrayField,\n boolean: fields.BooleanField,\n enum: fields.ChoiceField,\n number: fields.IntegerField,\n integer: fields.IntegerField,\n object: fields.ObjectField,\n string: fields.StringField,\n date: fields.StringField,\n datetime: fields.StringField,\n button: fields.ButtonField\n },\n widgets: {\n array: widgets.ArrayInput,\n checkbox: widgets.CheckboxInput,\n checkboxlist: widgets.CheckboxList,\n date: widgets.DateInput,\n dateselect: widgets.DateSelectionInput,\n number: widgets.NumberInput,\n currency: widgets.CurrencyInput,\n object: widgets.ObjectInput,\n radio: widgets.RadioInput,\n select: widgets.SelectInput,\n text: widgets.TextInput,\n textarea: widgets.TextAreaInput,\n email: widgets.EmailInput,\n hidden: widgets.HiddenInput,\n password: widgets.PasswordInput,\n display: widgets.DisplayWidget,\n button: widgets.ButtonWidget\n },\n serializers: {\n trim: serializers.TrimSerializer\n },\n validators: {\n required: validators.RequiredValidator,\n booleanRequired: validators.BooleanRequiredValidator,\n booleanTrue: validators.BooleanTrueValidator,\n length: validators.LengthValidator,\n integer: validators.IntegerValidator,\n regex: validators.RegexValidator,\n alpha: validators.AlphaValidator\n }\n }\n }", "title": "" }, { "docid": "ba6c6643f8f6a2e287585fca41817a34", "score": "0.4903703", "text": "get config() {\n return this.cForm ? this.cForm.config : {}\n }", "title": "" }, { "docid": "ddae0dc2cbbac7201b17b7595067df19", "score": "0.48959023", "text": "renderField(field) {\n // field arguement lets the <Field> component know that it is responsible for it\n // it also brings in event handlers to let it know\n // field.meta.touched and field.meta.error lets you know the status of the form\n // const { meta: { touched, error } } = field;\n // const {meta: {touched, error}} = field;\n const {touched, error} = field.meta;\n // use ternary operator for classname to make input red outline dynamic\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n // same thing as className = `form-group ${field.meta.touched && field.meta.error ? has-danger : \"\"}`\n\n return (\n <div className={className}>\n {/* title label */}\n <label>{field.label}</label>\n {/*{...field.input} - is an object which contains a bunch of event handlers and props */}\n {/*like on change, onblur, on focus */}\n {/*2.a by doing '...' we are just passing the props from field.input */}\n {/*... says this is an object and I want all of the props of field.input to be put */}\n {/* into this field tag */}\n {/* similar to onChange={field.input.onChange}\n onBlur={field.input.onFocus}\n */}\n <input className=\"form-control\" type=\"text\" {...field.input} />\n {/*type='text', deliberatly says this is a text input */}\n <div className=\"text-help\">\n {/*text-help makes the text red */}\n {touched ? error : \"\"}\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "9b004e43389b9df2b45a71c775535313", "score": "0.48948345", "text": "render(){\n // console.log(this.props)\n const {fields: { email, password, confirmPassword }, handleSubmit} = this.props;\n return(\n <form onSubmit={ handleSubmit(this.handleFormSubmit.bind(this) ) }>\n\n <h4>Sign Up</h4>\n <Field name=\"email\" component={renderField} type=\"email\" label=\"Email\"/>\n\n <Field name=\"password\" type=\"password\" label=\"Password\" component={renderField} />\n\n <Field name=\"confirmPassword\" type=\"password\" label=\"Confirm Password\" component={renderField} />\n {this.renderAlert()}\n <button className=\"btn btn-primary\" action=\"submit\">\n Sign Up\n </button>\n\n </form>\n )\n }", "title": "" }, { "docid": "e1a170c29b34bb1b407bf3368914d87b", "score": "0.4893439", "text": "function FormField(props) {\n var children = props.children,\n className = props.className,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(error, 'error'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(inline, 'inline'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(required, 'required'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(width, 'wide'), 'field', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(FormField, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(FormField, props);\n\n // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(control)) {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(label)) return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"t\" /* createHTMLLabel */])(label)\n );\n }\n\n // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n var controlProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { children: children, required: required, type: type });\n\n // wrap HTML checkboxes/radios in the label\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n { className: classes },\n __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n 'label',\n null,\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_react__[\"createElement\"])(control, controlProps),\n ' ',\n label\n )\n );\n }\n\n // pass label prop to controls that support it\n if (control === __WEBPACK_IMPORTED_MODULE_5__modules_Checkbox__[\"a\" /* default */] || control === __WEBPACK_IMPORTED_MODULE_6__addons_Radio__[\"a\" /* default */]) {\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n { className: classes },\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_react__[\"createElement\"])(control, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, controlProps, { label: label }))\n );\n }\n\n // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n { className: classes },\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"t\" /* createHTMLLabel */])(label),\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_react__[\"createElement\"])(control, controlProps)\n );\n}", "title": "" }, { "docid": "aa05839ea80d3be34d4ec491a92b8641", "score": "0.48914897", "text": "render(){\n console.log(this.props)\n return(\n <TextField\n id=\"standard-dense\"\n label={this.props.title}\n type = {this.props.type}\n margin=\"normal\"\n />\n )\n }", "title": "" }, { "docid": "81c6b49f3a6e7ff0b7bc94a3965d7e24", "score": "0.48876724", "text": "get fields() {\n return html`\n <div id=\"upload-options\">\n <vaadin-upload\n capture=\"\"\n class=\"option-${this.option}\"\n form-data-name=\"file-upload\"\n id=\"fileupload\"\n @upload-before=\"${this._fileAboutToUpload}\"\n @upload-response=\"${this._fileUploadResponse}\"\n part=\"upload\"\n ?nodrop=\"${this.disabled}\"\n >\n <button\n ?disabled=\"${this.disabled}\"\n id=\"add-hidden\"\n slot=\"add-button\"\n >\n ${this.t.upload}..\n </button>\n <div\n slot=\"drop-label\"\n part=\"browse-area\"\n ?hidden=\"${this.option == \"selfie\" ||\n this.option == \"audio\" ||\n this.hideInput}\"\n >\n <simple-fields-url-combo\n id=\"url\"\n ?autofocus=\"${this.autofocus}\"\n autocomplete=\"both\"\n value=\"${this.value || \"\"}\"\n label=\"URL\"\n type=\"url\"\n auto-validate=\"\"\n part=\"url\"\n ?disabled=\"${this.disabled}\"\n ?always-expanded=\"${this.responsiveSize.indexOf(\"s\") < 0}\"\n display-as=\"${this.responsiveSize.indexOf(\"l\") > -1\n ? \"grid\"\n : \"\"}\"\n .itemsList=\"${this.itemsList}\"\n @click=\"${(e) => e.stopImmediatePropagation()}\"\n @mousedown=\"${(e) => e.stopImmediatePropagation()}\"\n @focus=\"${(e) => e.stopImmediatePropagation()}\"\n @value-changed=\"${this.valueChanged}\"\n >\n </simple-fields-url-combo>\n </div>\n <div id=\"upload\">\n <span part=\"drop-area-text\">${this.t.dropMediaHereOr}</span>\n ${this.sources}\n </div>\n <simple-toolbar-button\n id=\"cancel\"\n icon=\"icons:clear\"\n ?disabled=\"${this.disabled}\"\n label=\"${this.t.cancel}\"\n @mousedown=\"${(e) => e.preventDefault()}\"\n @focus=\"${(e) => e.preventDefault()}\"\n @click=\"${this._handleCancel}\"\n controls=\"fieldset\"\n slot=\"drop-label\"\n part=\"cancel-media\"\n ?hidden=\"${this.option !== \"selfie\" && this.option !== \"audio\"}\"\n >\n </simple-toolbar-button>\n <div\n id=\"camerahole\"\n ?hidden=\"${this.option !== \"selfie\"}\"\n part=\"camera\"\n part=\"camera-preview\"\n ></div>\n <div\n id=\"voicerecorder\"\n ?hidden=\"${this.option !== \"audio\"}\"\n part=\"voice-preview\"\n ></div>\n ${this.desc}\n </vaadin-upload>\n </div>\n `;\n }", "title": "" }, { "docid": "19e3a265249ac4310435be2d968ff974", "score": "0.48859745", "text": "FactoryAbi() {\n if(this.state.isContentTypeContract) {\n return [\n <label key=\"contract-factory-abi-info-label\">Factory ABI</label>,\n <div key=\"contract-factory-abi-info\" className=\"form-text\">\n If this contract is a factory, specify the ABI of the contract that will be applied to the content objects of this type\n </div>,\n\n <label key=\"contract-factory-abi-label\" className=\"align-top\" htmlFor=\"factoryAbi\"/>,\n <JsonInput\n key=\"contract-factory-abi\"\n name=\"factoryAbi\"\n value={this.state.factoryAbi}\n onChange={this.HandleInputChange}\n />\n ];\n }\n }", "title": "" }, { "docid": "a816d7e4919e35fd9c93ed999fa61efb", "score": "0.4871838", "text": "function ObjectInputField(object, config) {\n _classCallCheck(this, ObjectInputField);\n\n var _this6 = _possibleConstructorReturn(this, (ObjectInputField.__proto__ || Object.getPrototypeOf(ObjectInputField)).call(this, 'object-' + object.$id + '-field-' + config.name, config.name, config.type, config.label ? config.label : _i18n.i18n.t(Sidebar.getObjectType(object) + '.' + config.name), new _pathValueAccessor.PathValueAccessor(object, config.path || config.name), config.validator, config.options));\n\n _this6.path = config.path || config.name;\n _this6.onChange = config.onChange;\n return _this6;\n }", "title": "" }, { "docid": "fcef2766111225776b70c600df9b247f", "score": "0.48703617", "text": "function CfnForm_FieldInputConfigPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('defaultChecked', cdk.validateBoolean)(properties.defaultChecked));\n errors.collect(cdk.propertyValidator('defaultCountryCode', cdk.validateString)(properties.defaultCountryCode));\n errors.collect(cdk.propertyValidator('defaultValue', cdk.validateString)(properties.defaultValue));\n errors.collect(cdk.propertyValidator('descriptiveText', cdk.validateString)(properties.descriptiveText));\n errors.collect(cdk.propertyValidator('isArray', cdk.validateBoolean)(properties.isArray));\n errors.collect(cdk.propertyValidator('maxValue', cdk.validateNumber)(properties.maxValue));\n errors.collect(cdk.propertyValidator('minValue', cdk.validateNumber)(properties.minValue));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('placeholder', cdk.validateString)(properties.placeholder));\n errors.collect(cdk.propertyValidator('readOnly', cdk.validateBoolean)(properties.readOnly));\n errors.collect(cdk.propertyValidator('required', cdk.validateBoolean)(properties.required));\n errors.collect(cdk.propertyValidator('step', cdk.validateNumber)(properties.step));\n errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type));\n errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type));\n errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));\n errors.collect(cdk.propertyValidator('valueMappings', CfnForm_ValueMappingsPropertyValidator)(properties.valueMappings));\n return errors.wrap('supplied properties not correct for \"FieldInputConfigProperty\"');\n}", "title": "" }, { "docid": "1b6497a6267dc3a4b1db8cee0ed54b11", "score": "0.48698848", "text": "function App() {\n const schema = {\n \"type\": \"object\",\n \"title\": \"Number fields & widgets\",\n \"properties\": {\n \"number\": {\n \"title\": \"Number\",\n \"type\": \"number\"\n },\n \"integer\": {\n \"title\": \"Integer\",\n \"type\": \"integer\"\n },\n \"numberEnum\": {\n \"type\": \"number\",\n \"title\": \"Number enum\",\n \"enum\": [\n 1,\n 2,\n 3\n ]\n },\n \"numberEnumRadio\": {\n \"type\": \"number\",\n \"title\": \"Number enum\",\n \"enum\": [\n 1,\n 2,\n 3\n ]\n },\n \"integerRange\": {\n \"title\": \"Integer range\",\n \"type\": \"integer\",\n \"minimum\": 42,\n \"maximum\": 100\n },\n \"integerRangeSteps\": {\n \"title\": \"Integer range (by 10)\",\n \"type\": \"integer\",\n \"minimum\": 50,\n \"maximum\": 100,\n \"multipleOf\": 10\n }\n },\n \"anyOf\": [\n {\n \"title\": \"First method of identification\",\n \"properties\": {\n \"firstName\": {\n \"type\": \"string\",\n \"title\": \"First name\",\n \"default\": \"Chuck\"\n },\n \"lastName\": {\n \"type\": \"string\",\n \"title\": \"Last name\"\n }\n }\n },\n {\n \"title\": \"Second method of identification\",\n \"properties\": {\n \"idCode\": {\n \"type\": \"string\",\n \"title\": \"ID code\"\n }\n }\n }\n ]\n }\n\n const uiSchema = {\n \"integer\": {\n \"ui:widget\": \"updown\",\n },\n \"numberEnumRadio\": {\n \"ui:widget\": \"radio\",\n \"ui:options\": {\n \"inline\": true\n }\n },\n \"integerRange\": {\n \"ui:widget\": \"range\"\n },\n \"integerRangeSteps\": {\n \"ui:widget\": \"range\"\n }\n }\n\n return (\n <>\n <div>\n <FormKore schema={schema} uiSchema={uiSchema} framework=\"AntDTheme\" />\n <FormKore schema={schema} uiSchema={uiSchema} framework=\"FluentUITheme\" />\n </div>\n </>\n );\n}", "title": "" }, { "docid": "7d3348d82110316b81515c552e1945f2", "score": "0.48690853", "text": "buildInputElement(inputType, value) {\n let $input = html.makeInputElement(\n inputType,\n makeHtmlPropertyId(this.propertySpec.label),\n !this.propertySpec.isModifiable(),\n value\n );\n html.addClasses($input, this.propertySpec.tags);\n return $input;\n }", "title": "" }, { "docid": "3d63a16a8ed96b7cdb58e0042d5a92ef", "score": "0.48615476", "text": "getFieldProps(field) {\n let props = Object.assign({}, field);\n props.value = this.state.values[field.path];\n props.values = this.state.values;\n props.onChange = this.handleChange;\n props.mode = 'create';\n props.key = field.path;\n return props;\n }", "title": "" }, { "docid": "4535703ec04007b8c9ff9d3d974f1715", "score": "0.48598897", "text": "function renderNameValuePair(dom, kb, box, form, label) {\n // const property = kb.any(form, ns.ui('property'))\n box.style.display = 'flex';\n box.style.flexDirection = 'row';\n var lhs = box.appendChild(dom.createElement('div'));\n lhs.style.width = _style.formFieldNameBoxWidth;\n var rhs = box.appendChild(dom.createElement('div'));\n lhs.setAttribute('class', 'formFieldName');\n lhs.setAttribute('style', _style.formFieldNameBoxStyle);\n rhs.setAttribute('class', 'formFieldValue');\n if (label) {\n lhs.appendChild(dom.createTextNode(label));\n } else if (kb.any(form, ns.ui('property'))) {\n // Assume more space for error on right\n lhs.appendChild(fieldLabel(dom, kb.any(form, ns.ui('property')), form));\n } else {\n rhs.appendChild((0, _error.errorMessageBlock)(dom, 'No property or label given for form field: ' + form));\n lhs.appendChild(dom.createTextNode('???'));\n }\n return rhs;\n}", "title": "" }, { "docid": "8f531877984069bc08ae38c8db15dd28", "score": "0.48532298", "text": "static getCustomProperties() {\n\t\treturn [\n\t\t\t'type',\t\t\t\t// temporary for backward compatibility vith v1.0\n\t\t\t'input-data',\t\t// the type of input data. 'percents', 'value', 'auto'. The 'auto' is default\n\t\t\t'input-mode',\t\t// how to interpret an input data. 'flat', 'rel', p-ch ('0.1, 0.2,...1.0, 1.1, ...), 'json' equivalent to 'rel'\n\t\t\t'view-type',\t\t// 'donut', 'zwatch, 'pie'\n\t\t\t'view-mode',\t\t// 'comp', 'comp-100'\n\n\t\t\t'rotation',\t\t\t// Positive values rotate the widget in the direction of the clockwise movement,\n\t\t\t'start-angle',\t\t// The starting angle to start drawing the widget segment. 0 degrees are at 12 o'clock. Segment drawing direction - clockwise.\n\t\t\t'end-angle',\t\t// End angle of the widget segment rendering. When the starting and ending angles are equal, a full circle is drawn.\n\t\t\t'inner-radius',\t\t// Inner radius of a donut hole. A value of 0 replaces the value of the “viewType”\n\t\t\t\t\t\t\t\t// parameter from “donut” to “pie”! Any non-zero parameter value switches the\n\t\t\t\t\t\t\t\t// “viewType” parameter value to “donut”. The maximum value of the parameter must\n\t\t\t\t\t\t\t\t// not exceed the value of the “radius” parameter.\n\t\t\t\t\t\t\t\t// negative values - in the counterclockwise direction.\n\t\t\t'radius',\t\t\t// This parameter sets the radius of the widget. It should not be more than half the\n\t\t\t\t\t\t\t\t// height or width of the widget. During initialization or installation of parameters,\n\t\t\t\t\t\t\t\t// all disputed parameters are checked and corrected automatically.\n\t\t\t'width',\t\t\t// The width of the widget. The value of the “radius” parameter will be corrected if it\n\t\t\t\t\t\t\t\t// exceeds half the value of this parameter, or the parameter “height” if its value is less than this parameter.\n\t\t\t'height',\t\t\t// The height of the widget. The value of the “radius” parameter will be corrected if it exceeds half the value\n\t\t\t\t\t\t\t\t// of this parameter, or the parameter “width” if its value is less than this parameter.\n\t\t\t'sort-by',\t\t\t// Sort parameter for multiple data. May contains one of the data parameters name: 'asis', 'name', 'value', 'color', 'state'. the default is 'value'\n\t\t\t'sort-dir',\t\t\t// sorting direction parameter. the default value is '1', wich means from low to high. Possible values: 0, 1.\n\t\t\t'is-animate',\t\t// Allows to animate the moment of receiving the data array.\n\t\t\t'is-link',\t\t\t// Allows to disable going to the link by ckick on the sector. Used in example. The default is 1\n\t\t\t'is-legend',\t\t// Allows to display the legend on the defined side of the widget\n\t\t\t'is-tooltip',\t\t// Allows displaying a tooltip next to the mouse pointer. Reproducing legends, hints are not displayed and vice versa.\n\t\t\t'position',\t\t\t// The value describes location of tooltip or legend window Default value is 'rt' which means right-top conner of element.\n\t\t\t'ttip-template',\t// Default value for this property is 'pie', wich means the using of internal SmartTooltip pie template definition.\n\t\t\t\t\t\t\t\t// Currently only 4 types of templates are implemented: 'pie', 'simple', 'image' and 'iframe'.\n\t\t\t'ttip-type',\t\t// 'alldata' or 'curtarget'\n\t\t\t'is-emulate',\t\t// Allows automatic emulation of the process of receiving an array of data.\n\t\t\t'is-run',\t\t\t// Starts the internal mechanism of sending requests to the server, if there are parameters: “server”, “provider”, “user”\n\t\t\t'interval',\t\t\t// Determines the interval of sending requests to the server in seconds (if the value is less than 2000)\n\t\t\t\t\t\t\t\t// or in milliseconds (if the value is greater than 1999)\n\t\t\t'server',\n\t\t\t'provider',\n\t\t\t'user',\t\t\t\t// These parameters determine the URL of the request to the server\n\n\t\t\t'var-is-shadow',\t// Allows shadow for widget, legend and tooltip\n\t\t\t'var-font-family',\n\t\t\t'var-font-size',\n\t\t\t'var-font-stretch',\n\t\t\t'var-font-color',\t// Are the font definition parameters. Will be derived from host elemet in case if not specified.\n\t\t\t'var-stroke-color',\t// Sets the widget's stroke color, legend and tooltip.\n\t\t\t'var-stroke-width',\t// Sets the width of the widget's stroke, legend (and hints, which also depend on the template).\n\t\t\t'var-fill-color',\t// Sets the fill color for the widget's background, legend (and hints, which also depend on the template).\n\t\t\t'var-opacity'\t\t// Sets the transparency of the widget, the legend (and hints, which also depend on the template)\n\t\t];\n\t}", "title": "" } ]
b5a1ea99c7014061cb00f13e7637623e
Registers an icon using an HTML string in the default namespace.
[ { "docid": "002955f8b57e995ed3ab8d9bde332300", "score": "0.633655", "text": "addSvgIconLiteral(iconName, literal, options) {\n return this.addSvgIconLiteralInNamespace('', iconName, literal, options);\n }", "title": "" } ]
[ { "docid": "080db690709193c515490bb0e3d2bc98", "score": "0.6815123", "text": "addSvgIconLiteralInNamespace(namespace, iconName, literal, options) {\n const sanitizedLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n if (!sanitizedLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n const svgElement = this._createSvgElementForSingleIcon(sanitizedLiteral, options);\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement, options));\n }", "title": "" }, { "docid": "6d1399e864a18c83b6aeba0938899b38", "score": "0.6775263", "text": "addSvgIconLiteralInNamespace(namespace, iconName, literal) {\n const sanitizedLiteral = this.sanitizer.sanitize(SecurityContext.HTML, literal);\n if (!sanitizedLiteral) {\n throw this.getIconFailedToSanitizeLiteralError(literal);\n }\n const svgElement = this.createSvgElementForSingleIcon(sanitizedLiteral);\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(svgElement));\n }", "title": "" }, { "docid": "b766722f467a66b2efe51cc5e7a69223", "score": "0.6669055", "text": "static xicon(icon, arialabel) {\n if (icon instanceof Object) { // this is probably a pre-defined icon\n return icon;\n }\n let i = document.createElement('span');\n i.classList.add('icon');\n\n if (Array.isArray(icon)) {\n for (let c of icon) {\n i.classList.add(c);\n }\n } else {\n i.classList.add(icon);\n }\n\n if (arialabel) {\n i.setAttribute('aria-label', arialabel);\n } else {\n i.setAttribute('aria-hidden', \"true\");\n }\n return i;\n }", "title": "" }, { "docid": "0e81d4ed10c76351e14efa1b7cf4b61d", "score": "0.6667454", "text": "function Icon(el,config){if(el&&el.tagName!='svg'){el=angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];}// Inject the namespace if not available...\n\tif(!el.getAttribute('xmlns')){el.setAttribute('xmlns',\"http://www.w3.org/2000/svg\");}this.element=el;this.config=config;this.prepare();}", "title": "" }, { "docid": "1ac39dd40a0322a8d98c55f822a864b9", "score": "0.6615188", "text": "function ELEMENT_ICON$static_(){IconWithTextBEMEntities.ELEMENT_ICON=( IconWithTextBEMEntities.BLOCK.createElement(\"icon\"));}", "title": "" }, { "docid": "a02538ab04cea84e0f14d656840adddd", "score": "0.66090286", "text": "addSvgIconLiteral(iconName, literal) {\n return this.addSvgIconLiteralInNamespace('', iconName, literal);\n }", "title": "" }, { "docid": "b10371c585e74f263f78b7b2dab02aef", "score": "0.65830994", "text": "function icon(selector, value) {\n if (typeof value !== 'string') {\n var attrs = Object.keys(value || {}).map(function (key) {\n return key + '=\"' + value[key] + '\"';\n }).join(' ');\n return '<svg ' + attrs + '><use xlink:href=\"#' + selector + '\"></svg>';\n } else {\n var el = $(selector).find('use')[0];\n el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + value);\n }\n}", "title": "" }, { "docid": "a79eaa1e7527740f930951977460c955", "score": "0.6535342", "text": "addSvgIconLiteralInNamespace(namespace, iconName, literal, options) {\n const cleanLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n // TODO: add an ngDevMode check\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig('', cleanLiteral, options));\n }", "title": "" }, { "docid": "a79eaa1e7527740f930951977460c955", "score": "0.6535342", "text": "addSvgIconLiteralInNamespace(namespace, iconName, literal, options) {\n const cleanLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n // TODO: add an ngDevMode check\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig('', cleanLiteral, options));\n }", "title": "" }, { "docid": "6c64e7906e43c5dc8b9cbf0b01857405", "score": "0.64994675", "text": "function Icon(el, config) {\n // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>.\n if (el && el.tagName.toLowerCase() === 'symbol') {\n var viewbox = el.getAttribute('viewBox');\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').html(el.innerHTML)[0];\n if (viewbox) el.setAttribute('viewBox', viewbox);\n }\n\n if (el && el.tagName.toLowerCase() !== 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];\n }\n\n // Inject the namespace if not available...\n if (!el.getAttribute('xmlns')) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "57f23e2e4f62afb2abb2eea34bf6df4d", "score": "0.64235944", "text": "addSvgIconSetLiteralInNamespace(namespace, literal, options) {\n const sanitizedLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n if (!sanitizedLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n const svgElement = this._svgElementFromString(sanitizedLiteral);\n return this._addSvgIconSetConfig(namespace, new SvgIconConfig(svgElement, options));\n }", "title": "" }, { "docid": "7da05882a8037b1ebb639551a7f0e3fd", "score": "0.64032686", "text": "set icon(value) {\n this.setAttribute('icon', value);\n }", "title": "" }, { "docid": "4ed27a422ad2db9a2d0817f43126f0ba", "score": "0.6388502", "text": "function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];\n }\n\n // Inject the namespace if not available...\n if (!el.getAttribute('xmlns')) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "4ed27a422ad2db9a2d0817f43126f0ba", "score": "0.6388502", "text": "function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];\n }\n\n // Inject the namespace if not available...\n if (!el.getAttribute('xmlns')) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "cc7a0baefd788845c5459a33d4160045", "score": "0.634819", "text": "function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el)[0];\n }\n\n // Inject the namespace if not available...\n if ( !el.getAttribute('xmlns') ) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "cc7a0baefd788845c5459a33d4160045", "score": "0.634819", "text": "function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el)[0];\n }\n\n // Inject the namespace if not available...\n if ( !el.getAttribute('xmlns') ) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "cc7a0baefd788845c5459a33d4160045", "score": "0.634819", "text": "function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el)[0];\n }\n\n // Inject the namespace if not available...\n if ( !el.getAttribute('xmlns') ) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }", "title": "" }, { "docid": "68ef9209ccc9fe9c1acccb43f8a0174f", "score": "0.6315813", "text": "addSvgIconSetLiteralInNamespace(namespace, literal, options) {\n const cleanLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n return this._addSvgIconSetConfig(namespace, new SvgIconConfig('', cleanLiteral, options));\n }", "title": "" }, { "docid": "68ef9209ccc9fe9c1acccb43f8a0174f", "score": "0.6315813", "text": "addSvgIconSetLiteralInNamespace(namespace, literal, options) {\n const cleanLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n if (!cleanLiteral) {\n throw getMatIconFailedToSanitizeLiteralError(literal);\n }\n return this._addSvgIconSetConfig(namespace, new SvgIconConfig('', cleanLiteral, options));\n }", "title": "" }, { "docid": "e33ac60cc3b572f975ff4d22da2ed989", "score": "0.63094676", "text": "function icon(selector) {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 8 8\"><use xlink:href=\"${selector}\" /></svg>`;\n}", "title": "" }, { "docid": "e33ac60cc3b572f975ff4d22da2ed989", "score": "0.63094676", "text": "function icon(selector) {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 8 8\"><use xlink:href=\"${selector}\" /></svg>`;\n}", "title": "" }, { "docid": "158db63ee016303a3603b9758fe53926", "score": "0.62374943", "text": "function Icon(el, config) {\r\n if (el && el.tagName != 'svg') {\r\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el)[0];\r\n }\r\n\r\n // Inject the namespace if not available...\r\n if ( !el.getAttribute('xmlns') ) {\r\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\r\n }\r\n\r\n this.element = el;\r\n this.config = config;\r\n this.prepare();\r\n }", "title": "" }, { "docid": "6b704382ed1261ff0bcc8f55c0a5aa75", "score": "0.6155743", "text": "drawIcon() {\n return `<i class=\"fas fa-flask\"></i>`\n }", "title": "" }, { "docid": "87b1108e40b029072a9ce9ee2ed6af43", "score": "0.6128105", "text": "function iconByName(name) {\n return '<i class=\"icon icon-'+name+'\"></i>';\n }", "title": "" }, { "docid": "3d65c7dbc662a005482f1f8e86d1cbaf", "score": "0.60468644", "text": "function set_icon(icon) {\n video_out.innerHTML = '<span class=\"glyphicon glyphicon-' +\n icon + '\"></span>';\n}", "title": "" }, { "docid": "06396f4f5dab8ecadebbaee002762fbd", "score": "0.6023827", "text": "addSvgIconSetLiteral(literal, options) {\n return this.addSvgIconSetLiteralInNamespace('', literal, options);\n }", "title": "" }, { "docid": "06396f4f5dab8ecadebbaee002762fbd", "score": "0.6023827", "text": "addSvgIconSetLiteral(literal, options) {\n return this.addSvgIconSetLiteralInNamespace('', literal, options);\n }", "title": "" }, { "docid": "06396f4f5dab8ecadebbaee002762fbd", "score": "0.6023827", "text": "addSvgIconSetLiteral(literal, options) {\n return this.addSvgIconSetLiteralInNamespace('', literal, options);\n }", "title": "" }, { "docid": "16a0e91bdf61bb35bdf755581dccd2be", "score": "0.6003537", "text": "function renderIcon(placeholder, customisations$1, iconData, returnString) {\n\t // Create placeholder. Why placeholder? IE11 doesn't support innerHTML method on SVG.\n\t var span;\n\t try {\n\t span = document.createElement('span');\n\t }\n\t catch (err) {\n\t return returnString ? '' : null;\n\t }\n\t var data = build.iconToSVG(iconData, customisations.mergeCustomisations(customisations.defaults, customisations$1));\n\t // Placeholder properties\n\t var placeholderElement = placeholder.element;\n\t var finder = placeholder.finder;\n\t var name = placeholder.name;\n\t // Get class name\n\t var placeholderClassName = placeholderElement\n\t ? placeholderElement.getAttribute('class')\n\t : '';\n\t var filteredClassList = finder\n\t ? finder.classFilter(placeholderClassName ? placeholderClassName.split(/\\s+/) : [])\n\t : [];\n\t var className = 'iconify iconify--' +\n\t name.prefix +\n\t (name.provider === '' ? '' : ' iconify--' + name.provider) +\n\t (filteredClassList.length ? ' ' + filteredClassList.join(' ') : '');\n\t // Generate SVG as string\n\t var html = '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"' +\n\t className +\n\t '\">' +\n\t id.replaceIDs(data.body) +\n\t '</svg>';\n\t // Set HTML for placeholder\n\t span.innerHTML = html;\n\t // Get SVG element\n\t var svg = span.childNodes[0];\n\t var svgStyle = svg.style;\n\t // Add attributes\n\t var svgAttributes = data.attributes;\n\t Object.keys(svgAttributes).forEach(function (attr) {\n\t svg.setAttribute(attr, svgAttributes[attr]);\n\t });\n\t // Add custom styles\n\t if (data.inline) {\n\t svgStyle.verticalAlign = '-0.125em';\n\t }\n\t // Copy stuff from placeholder\n\t if (placeholderElement) {\n\t // Copy attributes\n\t var placeholderAttributes = placeholderElement.attributes;\n\t for (var i = 0; i < placeholderAttributes.length; i++) {\n\t var item = placeholderAttributes.item(i);\n\t if (item) {\n\t var name$1 = item.name;\n\t if (name$1 !== 'class' &&\n\t name$1 !== 'style' &&\n\t svgAttributes[name$1] === void 0) {\n\t try {\n\t svg.setAttribute(name$1, item.value);\n\t }\n\t catch (err$1) { }\n\t }\n\t }\n\t }\n\t // Copy styles\n\t var placeholderStyle = placeholderElement.style;\n\t for (var i$1 = 0; i$1 < placeholderStyle.length; i$1++) {\n\t var attr = placeholderStyle[i$1];\n\t svgStyle[attr] = placeholderStyle[attr];\n\t }\n\t }\n\t // Store finder specific data\n\t if (finder) {\n\t var elementData = {\n\t name: name,\n\t status: 'loaded',\n\t customisations: customisations$1,\n\t };\n\t svg[elementDataProperty] = elementData;\n\t svg[elementFinderProperty] = finder;\n\t }\n\t // Get result\n\t var result = returnString ? span.innerHTML : svg;\n\t // Replace placeholder\n\t if (placeholderElement && placeholderElement.parentNode) {\n\t placeholderElement.parentNode.replaceChild(svg, placeholderElement);\n\t }\n\t else {\n\t // Placeholder has no parent? Remove SVG parent as well\n\t span.removeChild(svg);\n\t }\n\t // Return new node\n\t return result;\n\t}", "title": "" }, { "docid": "4fe2e650a4c7b9bc6c5f464f55cfc63b", "score": "0.6000196", "text": "function iconHtml(name, xtra) {\n var glyph = glyphMap[name];\n if (!glyph) return;\n var xtra = xtra ? (' fa-' + xtra.split(/\\s/).join(' fa-')) : '';\n return '<span class=\"fa' + xtra + '\">' + sGlyph(glyph) + '</span>';\n}", "title": "" }, { "docid": "b85bd3c9c232d491a3eb34e79af3624c", "score": "0.5970834", "text": "addIconHtml(iconConfig) {\n //var iconContainer = this.doc.createElement(\"div\");\n //iconContainer.setAttribute('id', iconConfig.id);\n\n var iconImg = this.doc.createElement(\"img\");\n iconImg.setAttribute('class', 'icon');\n iconImg.setAttribute('id', iconConfig.id);\n iconImg.setAttribute('src', this.pedal.ASSETS_PATH + '/icons/' + iconConfig.file);\n\n //iconContainer.appendChild(iconImg);\n this.pedal.shadowRoot.querySelector('.pedal').appendChild(iconImg);\n\n return iconImg;\n }", "title": "" }, { "docid": "948131351fb2bc34403ea1045638d61a", "score": "0.5850159", "text": "static addIcon(element, icon, iconPos = 'left') {\n let span = document.createElement('span');\n span.classList.add('glyphicon');\n span.classList.add(`glyphicon-${icon}`);\n span.setAttribute('aria-hidden', 'true');\n if (iconPos === 'left' && element.hasChildNodes()) {\n element.insertBefore(span, element.childNodes[0]);\n } else {\n element.appendChild(span);\n }\n }", "title": "" }, { "docid": "202c1920da512373f8115a72bacc6075", "score": "0.58417994", "text": "replaceIcone()\n\t\t{\n\t\t}", "title": "" }, { "docid": "26f85f62af034862c1618c16a1f42463", "score": "0.58368945", "text": "set_icon(value) {\n if (typeof value === 'string') {\n const file = Gio.File.new_for_path(value);\n if (file.query_exists(null)) {\n this._stack.set_visible_child_name('custom-icon-page');\n this._iconFileChooser.set_file(file);\n } else {\n this._stack.set_visible_child_name('icon-theme-page');\n }\n }\n }", "title": "" }, { "docid": "8cb17b4eb697304061c5773266e30521", "score": "0.58120733", "text": "function appendIcon() {\n const iconFragment = document.createDocumentFragment();\n const iconContainer = document.createElement('div');\n iconContainer.classList.add('mb--lg', 'p--xs');\n if (iconSetMarkup) {\n iconContainer.innerHTML = iconSetMarkup(icons);\n }\n iconFragment.appendChild(iconContainer);\n document.getElementById('root').appendChild(iconFragment);\n}", "title": "" }, { "docid": "1b22f54c02ccad099d25393e6616a3c0", "score": "0.5804836", "text": "function Icon({ className, title, name, style }) {\n const classes = classNames('icon', className);\n\n return (\n <svg className={classes} style={style} role=\"img\" aria-label={title}>\n <title>{title}</title>\n <use role=\"presentation\" xlinkHref={`#${name}`} />\n </svg>\n );\n}", "title": "" }, { "docid": "65d552e9a09b1d48fd464190ff370fa6", "score": "0.5797069", "text": "function setIcon(path) {\n chrome.browserAction.setIcon({path: path});\n}", "title": "" }, { "docid": "a815821dd8781d494aa9078e53c65cc7", "score": "0.57891357", "text": "function Icon_Icon({\n className = '',\n type\n}) {\n let pathData = null;\n\n switch (type) {\n case 'arrow':\n pathData = PATH_ARROW;\n break;\n\n case 'bug':\n pathData = PATH_BUG;\n break;\n\n case 'code':\n pathData = PATH_CODE;\n break;\n\n case 'components':\n pathData = PATH_COMPONENTS;\n break;\n\n case 'copy':\n pathData = PATH_COPY;\n break;\n\n case 'error':\n pathData = PATH_ERROR;\n break;\n\n case 'facebook':\n pathData = PATH_FACEBOOK;\n break;\n\n case 'flame-chart':\n pathData = PATH_FLAME_CHART;\n break;\n\n case 'profiler':\n pathData = PATH_PROFILER;\n break;\n\n case 'ranked-chart':\n pathData = PATH_RANKED_CHART;\n break;\n\n case 'search':\n pathData = PATH_SEARCH;\n break;\n\n case 'settings':\n pathData = PATH_SETTINGS;\n break;\n\n case 'store-as-global-variable':\n pathData = PATH_STORE_AS_GLOBAL_VARIABLE;\n break;\n\n case 'warning':\n pathData = PATH_WARNING;\n break;\n\n default:\n console.warn(`Unsupported type \"${type}\" specified for Icon`);\n break;\n }\n\n return /*#__PURE__*/react[\"createElement\"](\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n className: `${Icon_default.a.Icon} ${className}`,\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\"\n }, /*#__PURE__*/react[\"createElement\"](\"path\", {\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n }), /*#__PURE__*/react[\"createElement\"](\"path\", {\n fill: \"currentColor\",\n d: pathData\n }));\n}", "title": "" }, { "docid": "440e777f60e2a8b0f8bc6061754bc863", "score": "0.578582", "text": "makeIcon(icon) {\n // if not specified, just fallback to `completion.type`\n if (!icon) return ''\n if (icon.startsWith('icon-')) return `<span class=\"${icon}\"}></span>`\n return icon.length === 1 ? icon : ''\n }", "title": "" }, { "docid": "2cddc5cee132d5b2bf84a6de2fa926cc", "score": "0.57737124", "text": "function insertIcon() {\n const { show,\n topMenuSelector,\n headerNtooltip,\n ids: { icon : iconId },\n classes: { icon, smodals: { modal } }\n } = modalConfig;\n\n if (document.querySelector(`${topMenuSelector} #${iconId}`))\n return; // Don't add another\n\n // The icon inside the item on the top bar\n const settingsLink = document.createElement(\"a\");\n settingsLink.classList.add(icon.iconLink); // unrelated to links, just a class.\n\n // https://chat.stackoverflow.com/transcript/message/52315572#52315572\n // https://chat.stackoverflow.com/transcript/message/52315623#52315623\n // https://chat.stackoverflow.com/transcript/message/52333918#52333918\n if (typeof Svg !== \"undefined\") {\n settingsLink.append(Svg.Gear().get(0));\n } else {\n settingsLink.textContent = \"⚙️\"; // https://emojipedia.org/gear/\n settingsLink.style.fontSize = \"125%\";\n }\n settingsLink.title = headerNtooltip; // tooltip\n\n // The settings-item on the top bar\n const settingsItem = document.createElement(\"li\");\n settingsItem.classList.add(icon.iconItem);\n settingsItem.id = iconId;\n settingsItem.append(settingsLink);\n\n const topBar = document.querySelector(topMenuSelector);\n topBar.append(settingsItem);\n\n // loads the GUI for the settings\n settingsItem.addEventListener(\"click\", () => {\n const aside = createModalAside(loadIt());\n settingsItem.append(aside);\n settingsLink.dataset.action = show;\n settingsItem.dataset.controller = modal;\n\n // The GUI needs to load first..\n setTimeout(() => settingsLink.click(), 0);\n // alternative Stacks.showModal(settingsItem);\n }, { once: true });\n\n }", "title": "" }, { "docid": "4890cbe731c14195ce4e21d7511de9cc", "score": "0.57661647", "text": "function genIcon(type) {\n return $(\"<i>\").addClass(`fa fa-${type} text-white`);\n}", "title": "" }, { "docid": "cfbe0bc1d5a8a21359379d29e9d31aff", "score": "0.5706635", "text": "function iconKey(namespace, name) {\n return namespace + ':' + name;\n}", "title": "" }, { "docid": "cfbe0bc1d5a8a21359379d29e9d31aff", "score": "0.5706635", "text": "function iconKey(namespace, name) {\n return namespace + ':' + name;\n}", "title": "" }, { "docid": "cfbe0bc1d5a8a21359379d29e9d31aff", "score": "0.5706635", "text": "function iconKey(namespace, name) {\n return namespace + ':' + name;\n}", "title": "" }, { "docid": "102c89f0ff400583baec6d2d97422592", "score": "0.5689557", "text": "addSvgIcon(iconName, url) {\n return this.addSvgIconInNamespace('', iconName, url);\n }", "title": "" }, { "docid": "af59e8e3df4956f5245b290eab1502d9", "score": "0.5651912", "text": "function createSvgUse(iconId) {\n var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var svg = document.createElementNS(NAMESPACE_SVG, 'svg');\n for (var attr in attributes) {\n svg.setAttribute(attr, attributes[attr]);\n }\n var use = document.createElementNS(NAMESPACE_SVG, 'use');\n use.setAttributeNS(NAMESPACE_XLINK, 'xlink:href', '#' + iconId);\n svg.appendChild(use);\n return svg;\n}", "title": "" }, { "docid": "1ce390aaf947c0cc055569f642c314cb", "score": "0.56278116", "text": "newIcon() {\n return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;\n }", "title": "" }, { "docid": "9e29acd4689997f86acbbbb63d9a6e25", "score": "0.56164587", "text": "function addIcon(storage, name, icon$1) {\n\t try {\n\t if (typeof icon$1.body === 'string') {\n\t // Freeze icon to make sure it will not be modified\n\t storage.icons[name] = Object.freeze(icon.fullIcon(icon$1));\n\t return true;\n\t }\n\t }\n\t catch (err) {\n\t // Do nothing\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "07bcd42c440105feb7af9e099e752a6d", "score": "0.55998003", "text": "function icon(icon) {\n\t\treturn { text: false, icons: { primary: icon } };\n\t}", "title": "" }, { "docid": "7586c41a9c5893d86514134b91af1d73", "score": "0.55991983", "text": "constructor ({\n\t\ticon = '🏇'\n\t} = {}) {\n\t\tsuper({ icon });\n\t}", "title": "" }, { "docid": "0d3c98f453c452cad9d5556e061ca9f3", "score": "0.5591286", "text": "constructor ({\n\t\ticon = '👇'\n\t} = {}) {\n\t\tsuper({ icon });\n\t}", "title": "" }, { "docid": "c8f4b52f55717af83bfea502d6cc0cfb", "score": "0.55781615", "text": "constructor ({\n\t\ticon = '🏃'\n\t} = {}) {\n\t\tsuper({ icon });\n\t}", "title": "" }, { "docid": "051b72ee908c296f38c0c07475f77dac", "score": "0.5568584", "text": "constructor ({\n\t\ticon = '🐈',\n\t\t...rest\n\t} = {}) {\n\t\tsuper({ icon, ...rest });\n\t}", "title": "" }, { "docid": "94077e128c29c33f4cb3b86fcd4ac3ad", "score": "0.5563328", "text": "function mdIconDirective(t,e,n,i){function r(r,a,c){function u(){var t=a.parent();return t.attr(\"aria-label\")||t.text()?!0:!(!t.parent().attr(\"aria-label\")&&!t.parent().text())}function s(){c.mdSvgIcon||c.mdSvgSrc||(c.mdFontIcon&&a.addClass(\"md-font \"+c.mdFontIcon),a.addClass(t.fontSet(c.mdFontSet)))}e(a),s();var l=a[0].getAttribute(c.$attr.mdSvgSrc),d=c.alt||c.mdFontIcon||c.mdSvgIcon||a.text(),g=c.$normalize(c.$attr.mdSvgIcon||c.$attr.mdSvgSrc||\"\");c[\"aria-label\"]||(\"\"===d||u()?a.text()||n.expect(a,\"aria-hidden\",\"true\"):(n.expect(a,\"aria-label\",d),n.expect(a,\"role\",\"img\"))),g&&c.$observe(g,function(e){o(e)||e!==l||(e=i.trustAsUrl(e)),a.empty(),e&&t(e).then(function(t){a.empty(),a.append(t)})})}function o(t){var e=/^data:image\\/svg\\+xml[\\s*;\\w\\-\\=]*?(base64)?,(.*)$/i;return e.test(t)}return{restrict:\"E\",link:r}}", "title": "" }, { "docid": "354fcfc38fce2d4c3e6c0976504c2659", "score": "0.5549844", "text": "function documentIcon() {\n return createElement(\"img\", {\n src:\n \"data:image/png;base64,\" +\n \"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABCElEQVR4XmNgoCbQ0tJiU5S\" +\n \"Vb1aUl2+BYSU5hU5FWUU3dLVYgYKCgoCCnPxROTk5LSDbAITl5eUVFeXkPyjKyYWiq8cAIA\" +\n \"OU5OXXo4sDDfgFxJ+U5OSc0eVQAMgARTmFVUCFPgpycnlKsvJFKioqfEDN/6H4L1DOBV0fH\" +\n \"IC9ICu/VklJSQ7odENlOTljqLgGkK8J8hrQkNfo+uAA4gL5RUBX7ALS/9DwfwVZBX8g/QNd\" +\n \"HxxADVijJCOjCww0V2QM1OwOlOcAyv9E1wcH1DKAMi8gByIaNgKpIcIFiGhExkqyCoVAeQk\" +\n \"iDJBfjS6ODPAaoCUqygNU8BLogSfYMFDuKTCp30HXN7AAAKarYBD/VuTqAAAAAElFTkSuQm\" +\n \"CC\",\n width: \"16\",\n height: \"16\",\n });\n}", "title": "" }, { "docid": "d8786fe5d687b800d931cb04971069b1", "score": "0.55469483", "text": "function replaceContentTypeIcon(contentIconSrc, replacementIconID) {\n\tvar replacementIconImg = document.getElementById(replacementIconID);\n\tif (replacementIconImg)\n\t\treplaceIconSrc(contentIconSrc, replacementIconImg); \n}", "title": "" }, { "docid": "5f211e777e2d8c4c6f30965377b3dd40", "score": "0.55446917", "text": "function IconSymbol(name) {\n return {\n type: \"web-style\", // autocasts as new WebStyleSymbol()\n name: name,\n styleName: \"EsriIconsStyle\"//EsriRealisticTransportationStyle, EsriIconsStyle\n };\n }", "title": "" }, { "docid": "dda32ada71c915ba80f964f3fcaf0c63", "score": "0.5538751", "text": "set icon(icon: string) {\n this._icon = icon;\n }", "title": "" }, { "docid": "f368e74f056e4ff8e24fd932cc389ff9", "score": "0.55327785", "text": "function assignIcon(){\n\ticonLeft = String(\"icons/\" + nameArr[0] + \"-icon.svg\");\t\n\ticonRight = String(\"icons/\" + nameArr[nameArr.length - 1] + \"-icon.svg\");\n\tif (nameArr.length === 3) {\n\t\ticonMid = String(\"icons/\" + nameArr[1] + \"-icon.svg\");\n\t}\n}", "title": "" }, { "docid": "a4c9dc5382781426784bce3634d0055e", "score": "0.5524166", "text": "function addIcon(el, file) {\n\t\tvar $icon = $('<div class=\"nc-icon ui-widget-content\"></div>'),\n\t\t\t$image = $([\n\t\t\t\t'<img src=\"mime-map.php?mimetype=',\n\t\t\t\tfile.mimetype,\n\t\t\t\t(!supportsSVG) ? '&noSVG=1' : '',\n\t\t\t\t'\" alt=\"',\n\t\t\t\tfile.dirname,\n\t\t\t\t'/',\n\t\t\t\tfile.basename,\n\t\t\t\t'\" />'\n\t\t\t].join(''));\n\t\t\n\t\tif (file.is_dir) {\n\t\t\t$icon.bind('dblclick', function (e) {\n\t\t\t\tnc.descend(file.basename);\n\t\t\t});\n\t\t}\n\t\t\n\t\t$icon.append($image);\n\t\t$icon.append('<div class=\"nc-fname\">' + file.basename + '</div>');\n\t\tel.append($icon);\n\t\t//el.selectable('refresh');\n\t}", "title": "" }, { "docid": "c4a3f54205f510942f1d0c6f6dcec07a", "score": "0.55122966", "text": "constructor ({\n\t\ticon = '🤡',\n\t\t...rest\n\t} = {}) {\n\t\tsuper({ icon, ...rest });\n\t}", "title": "" }, { "docid": "da419aaef269a3c13f0cb78ae31276f9", "score": "0.55015725", "text": "function DRAG_GHOST_ELEMENT_ICON$static_(){DraggableItemsUtils.DRAG_GHOST_ELEMENT_ICON=( DraggableItemsUtils.DRAG_GHOST_BLOCK.createElement(\"icon\"));}", "title": "" }, { "docid": "b67be2a036e27e7c9ebe51639bf4a079", "score": "0.54991066", "text": "constructor(iconLibPath, namespace) {\n this.iconLibPath = iconLibPath;\n this.namespace = namespace;\n }", "title": "" }, { "docid": "37995e56c3608902a513958c64809202", "score": "0.54471004", "text": "function insertIcon(index, cell, type) {\n let iconType = type.toString();\n let newIcon = createIcon(index, iconType);\n \n cell.innerHTML = '';\n cell.appendChild(newIcon);\n}", "title": "" }, { "docid": "010cd27c840dccf458324fe9eec5fa4a", "score": "0.5435004", "text": "function getElementIcon(elementKind, modifiers) {\n var GIF_EXTENSION = \".gif\";\n var PNG_EXTENSION = \".png\";\n if (\"PACKAGE\" === elementKind) {\n return \"package\" + GIF_EXTENSION;\n } else if (\"ENUM\" === elementKind) {\n return \"enum\" + PNG_EXTENSION;\n } else if (\"ANNOTATION_TYPE\" === elementKind) {\n return \"annotation\" + PNG_EXTENSION;\n } else if (\"CLASS\" === elementKind) {\n return \"class\" + PNG_EXTENSION;\n } else if (\"INTERFACE\" === elementKind) {\n return \"interface\" + PNG_EXTENSION;\n } else if (\"FIELD\" === elementKind) {\n return getIconName(\"field\", PNG_EXTENSION, modifiers);\n } else if (\"ENUM_CONSTANT\" === elementKind) {\n return \"constant\" + PNG_EXTENSION;\n } else if (\"CONSTRUCTOR\" === elementKind) {\n return getIconName(\"constructor\", PNG_EXTENSION, modifiers);\n } else if (\"INSTANCE_INIT\" === elementKind\n || \"STATIC_INIT\" === elementKind) {\n return \"initializer\" + (modifiers.contains(\"STATIC\") ? \"Static\" : \"\") + PNG_EXTENSION;\n } else if (\"METHOD\" === elementKind) {\n return getIconName(\"method\", PNG_EXTENSION, modifiers);\n } else {\n return \"\";\n }\n}", "title": "" }, { "docid": "fb174291325e628bfbb4c8a05fc27637", "score": "0.5433306", "text": "getIcon() {\n const { icon, iconClassName } = this.props;\n\n if (icon) {\n return icon;\n }\n\n if (!iconClassName) {\n return null;\n }\n\n return <i className={iconClassName} key=\"icon\" />;\n }", "title": "" }, { "docid": "4364ce3d1b54b887f6e9ec1487a03370", "score": "0.5432705", "text": "function Icon(_ref) {\n var _ref$icon = _ref.icon,\n icon = _ref$icon === void 0 ? null : _ref$icon,\n size = _ref.size,\n className = _ref.className;\n var iconSize;\n\n if ('string' === typeof icon) {\n // Dashicons should be 20x20 by default\n iconSize = size || 20;\n return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(___WEBPACK_IMPORTED_MODULE_1__.Dashicon, {\n icon: icon,\n size: iconSize,\n className: className\n });\n } // Any other icons should be 24x24 by default\n\n\n iconSize = size || 24;\n\n if ('function' === typeof icon) {\n if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Component) {\n return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(icon, {\n className: className,\n size: iconSize\n });\n }\n\n return icon();\n }\n\n if (icon && (icon.type === 'svg' || icon.type === ___WEBPACK_IMPORTED_MODULE_1__.SVG)) {\n var appliedProps = (0,_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: className,\n width: iconSize,\n height: iconSize\n }, icon.props);\n\n return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(___WEBPACK_IMPORTED_MODULE_1__.SVG, appliedProps);\n }\n\n if ((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.isValidElement)(icon)) {\n return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(icon, {\n className: className,\n size: iconSize\n });\n }\n\n return icon;\n}", "title": "" }, { "docid": "7f03536fb87ca2376577feca946c9201", "score": "0.54322875", "text": "addSvgIconInNamespace(namespace, iconName, url) {\n return this.internalAddSvgIconConfig(namespace, iconName, new SvgIconConfig(url));\n }", "title": "" }, { "docid": "9071ca192d4a420090a8680370ba56cd", "score": "0.54232633", "text": "function getIcon(i) {\n icon.src = `http://openweathermap.org/img/wn/${i}@4x.png`;\n}", "title": "" }, { "docid": "3f77340e995ee08cf887707c1a705ef1", "score": "0.54214895", "text": "function iconURLby(iconID){\n let iconLinkString = \"http://openweathermap.org/img/wn/\" + iconID + \"@2x.png\"; \n return iconLinkString;\n }", "title": "" }, { "docid": "fb96b01d358fbff4cc212a4bfab815a8", "score": "0.54189056", "text": "function registerIconAlias(iconName, mappedToName) {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}", "title": "" }, { "docid": "fb96b01d358fbff4cc212a4bfab815a8", "score": "0.54189056", "text": "function registerIconAlias(iconName, mappedToName) {\n _iconSettings.__remapped[normalizeIconName(iconName)] = normalizeIconName(mappedToName);\n}", "title": "" }, { "docid": "496b87dc1e3301a37dffd9e1a2940fbe", "score": "0.54158676", "text": "function MatIconLocation() {}", "title": "" }, { "docid": "f32ea9a41437e9c8267d65bb0a4a49f8", "score": "0.5406464", "text": "openNotificationWithIcon(type, title, msg){\n notification[type]({\n message: title,\n description: msg,\n });\n }", "title": "" }, { "docid": "465e9116186468cb998e7e191eba5db4", "score": "0.54037905", "text": "function createValueIcon( label ) {\n const html = templateValue\n .replace( /{classes}/g, '' )\n .replace( /{uri}/g, '' )\n .replace( /{label}/g, label );\n return $( html );\n }", "title": "" }, { "docid": "bdc451ef55d9d6d254c90ad6bd57ddf2", "score": "0.5399896", "text": "function addIcon(figureURL) {\n return L.icon({\n iconUrl: figureURL,\n iconSize: [30, 30],\n iconAnchor: [15,15],\n popupAnchor: [0, -15]\n });\n}", "title": "" }, { "docid": "cd35a70ce904a24b5ea9a3f105d9809d", "score": "0.53959703", "text": "constructor ({\n\t\ticon = '➰',\n\t\t...rest\n\t} = {}) {\n\t\tsuper({ icon, ...rest });\n\t}", "title": "" }, { "docid": "53e9ae35b241a5ffb0879136b671d239", "score": "0.5371632", "text": "function returnIcon(icon) {\n\n} // close returnIcon function", "title": "" }, { "docid": "a914e85cdce18a995a860aa9fde1880c", "score": "0.5370969", "text": "function iconClass(iconName) {\r\n if (iconName == null) {\r\n return undefined;\r\n }\r\n return iconName.indexOf(NS + \"-icon-\") === 0\r\n ? iconName\r\n : NS + \"-icon-\" + iconName;\r\n}", "title": "" }, { "docid": "dcca008be2497801859b1a667a5b7614", "score": "0.5345356", "text": "addSvgIconInNamespace(namespace, iconName, url, options) {\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, null, options));\n }", "title": "" }, { "docid": "dcca008be2497801859b1a667a5b7614", "score": "0.5345356", "text": "addSvgIconInNamespace(namespace, iconName, url, options) {\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, null, options));\n }", "title": "" }, { "docid": "d6474aff6ed36034b4c10485f030053d", "score": "0.5342619", "text": "addSvgIconInNamespace(namespace, iconName, url, options) {\n return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, options));\n }", "title": "" }, { "docid": "e09640158a08778346102a0839382af1", "score": "0.5341006", "text": "function Icon(_ref) {\n var _ref$icon = _ref.icon,\n icon = _ref$icon === void 0 ? null : _ref$icon,\n size = _ref.size,\n additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ \"a\"])(_ref, [\"icon\", \"size\"]);\n\n // Dashicons should be 20x20 by default.\n var dashiconSize = size || 20;\n\n if ('string' === typeof icon) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"])({\n icon: icon,\n size: dashiconSize\n }, additionalProps));\n }\n\n if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"] === icon.type) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"cloneElement\"])(icon, _objectSpread({\n size: dashiconSize\n }, additionalProps));\n } // Icons should be 24x24 by default.\n\n\n var iconSize = size || 24;\n\n if ('function' === typeof icon) {\n if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"Component\"]) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(icon, _objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n return icon(_objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[\"SVG\"])) {\n var appliedProps = _objectSpread({\n width: iconSize,\n height: iconSize\n }, icon.props, {}, additionalProps);\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"createElement\"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[\"SVG\"], appliedProps);\n }\n\n if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"isValidElement\"])(icon)) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__[\"cloneElement\"])(icon, _objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n return icon;\n}", "title": "" }, { "docid": "a6dfc9b4302505bbdce28d4271a2e244", "score": "0.53354496", "text": "function Icon({href = 'like', width = 30, height = 30}) {\n return (\n <svg viewBox=\"0 0 100 100\" width={width} height={height}>\n <use href={`#${href}`}></use>\n </svg>\n )\n}", "title": "" }, { "docid": "94105d376a3cd11522845e3ea9a910fc", "score": "0.53254974", "text": "function iconImage(attr) {\n var color = (attr) ? \"red\" : \"blue\";\n return \"img/\" + color + \"_restaurant.png\";\n}", "title": "" }, { "docid": "d0e7c3d21fb77413a276d19a5ed7780d", "score": "0.5324515", "text": "function registerIcons(iconSubset, options) {\r\n var subset = tslib_1.__assign({}, iconSubset, { isRegistered: false, className: undefined });\r\n var icons = iconSubset.icons;\r\n // Grab options, optionally mix user provided ones on top.\r\n options = options ? tslib_1.__assign({}, _iconSettings.__options, options) : _iconSettings.__options;\r\n for (var iconName in icons) {\r\n if (icons.hasOwnProperty(iconName)) {\r\n var code = icons[iconName];\r\n var normalizedIconName = iconName.toLowerCase();\r\n if (_iconSettings[normalizedIconName]) {\r\n _warnDuplicateIcon(iconName);\r\n }\r\n else {\r\n _iconSettings[normalizedIconName] = {\r\n code: code,\r\n subset: subset\r\n };\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "d0e7c3d21fb77413a276d19a5ed7780d", "score": "0.5324515", "text": "function registerIcons(iconSubset, options) {\r\n var subset = tslib_1.__assign({}, iconSubset, { isRegistered: false, className: undefined });\r\n var icons = iconSubset.icons;\r\n // Grab options, optionally mix user provided ones on top.\r\n options = options ? tslib_1.__assign({}, _iconSettings.__options, options) : _iconSettings.__options;\r\n for (var iconName in icons) {\r\n if (icons.hasOwnProperty(iconName)) {\r\n var code = icons[iconName];\r\n var normalizedIconName = iconName.toLowerCase();\r\n if (_iconSettings[normalizedIconName]) {\r\n _warnDuplicateIcon(iconName);\r\n }\r\n else {\r\n _iconSettings[normalizedIconName] = {\r\n code: code,\r\n subset: subset\r\n };\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "93e5eb7b65b4db8678ba64ae538bc72c", "score": "0.5313564", "text": "function normalIcon() {\n return {\n url: 'static/media/marker.png'\n };\n}", "title": "" }, { "docid": "db57194cefbb0902b7d8ea2cba3bd18a", "score": "0.53076875", "text": "function Icon(app, entryPoint) {\n this.app = app;\n this.entryPoint = entryPoint;\n\n this.identifier = [app.manifestURL, entryPoint].join(\"-\");\n }", "title": "" }, { "docid": "131a0ece8333e93d1f86ca957de04459", "score": "0.5299545", "text": "function getIcon(id){id=id||'';// If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n\t// over a URL string. If the value is not trusted, this will intentionally throw an error\n\t// because the user is attempted to use an unsafe URL, potentially opening themselves up\n\t// to an XSS attack.\n\tif(!angular.isString(id)){id=$sce.getTrustedUrl(id);}// If already loaded and cached, use a clone of the cached icon.\n\t// Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\tif(iconCache[id]){return $q.when(transformClone(iconCache[id]));}if(urlRegex.test(id)||dataUrlRegex.test(id)){return loadByURL(id).then(cacheIcon(id));}if(id.indexOf(':')==-1){id='$default:'+id;}var load=config[id]?loadByID:loadFromIconSet;return load(id).then(cacheIcon(id));}", "title": "" }, { "docid": "aea825d9fc66fb2919ed215d0284f079", "score": "0.5294561", "text": "function getIconAndName(interface) {\n var name = document.createElement(\"div\");\n name.setAttribute(\"class\", \"name\");\n name.innerText = getName(interface);\n\n var icon = getIcon(interface);\n var div = document.createElement(\"div\");\n div.appendChild(icon);\n div.appendChild(name);\n return div;\n}", "title": "" }, { "docid": "923ba2270ab98572ac3f3de158c16fbb", "score": "0.5293968", "text": "function getIcon (timeRange, dataInstance) {\n\t\tvar icon, symbol;\n\t\tif (timeRange === \"currently\") {\n\t\t\ticon = weatherdata.currently.icon\n\t\t} else if ((timeRange === \"hourly\") || (timeRange === \"daily\")) {\n\t\t\ticon = weatherdata[timeRange].data[dataInstance].icon\n\t\t}\n\t\tsymbol = '<i class=\"wi wi-forecast-io-' + icon + '\"></i>';\n\n\t\treturn symbol\n\t}", "title": "" }, { "docid": "6d6ff9d1bb60b27852ada39fb5f506bb", "score": "0.5293579", "text": "function createIcon(a,b) {\n a.classList.add(\"btn\");\n a.innerHTML = b;\n }", "title": "" }, { "docid": "f580f615a685e1ad4983992a3ca80f7e", "score": "0.5289725", "text": "function Icon(_ref) {\n var _ref$icon = _ref.icon,\n icon = _ref$icon === void 0 ? null : _ref$icon,\n size = _ref.size,\n additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_9__[/* default */ \"a\"])(_ref, [\"icon\", \"size\"]); // Dashicons should be 20x20 by default.\n\n\n var dashiconSize = size || 20;\n\n if ('string' === typeof icon) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"createElement\"])(_dashicon__WEBPACK_IMPORTED_MODULE_12__[/* default */ \"a\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_8__[/* default */ \"a\"])({\n icon: icon,\n size: dashiconSize\n }, additionalProps));\n }\n\n if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_12__[/* default */ \"a\"] === icon.type) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"cloneElement\"])(icon, _objectSpread({\n size: dashiconSize\n }, additionalProps));\n } // Icons should be 24x24 by default.\n\n\n var iconSize = size || 24;\n\n if ('function' === typeof icon) {\n if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"Component\"]) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"createElement\"])(icon, _objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n return icon(_objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_11__[/* SVG */ \"h\"])) {\n var appliedProps = _objectSpread({\n width: iconSize,\n height: iconSize\n }, icon.props, {}, additionalProps);\n\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"createElement\"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_11__[/* SVG */ \"h\"], appliedProps);\n }\n\n if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"isValidElement\"])(icon)) {\n return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__[\"cloneElement\"])(icon, _objectSpread({\n size: iconSize\n }, additionalProps));\n }\n\n return icon;\n}", "title": "" }, { "docid": "eda30880c3a04c8348bae6a5ec1834b7", "score": "0.5287305", "text": "function createIcon(item, self) {\n var isNotLink = typeof(item) === 'string';\n var isKen = item.type && item.type === 'ken';\n var name = item.name || item;\n var defaultKeys = createDefaultKeyMap();\n var iconMap = {\n 'quote': 'quote-left',\n 'ordered-list':'list-ol',\n 'unordered-list': 'list',\n 'fullscreen': 'expand'\n };\n\n if (isKen) {\n item = findTool(item.name);\n if (!item) return;\n }\n\n if (isNotLink) {\n var sep = document.createElement('i');\n sep.className = 'separator';\n return sep;\n }\n\n var el = document.createElement('a');\n\n if (defaultKeys[name])\n item.title = defaultKeys[name];\n\n if (item.title) {\n el.title = item.title;\n el.title = el.title.replace('Cmd', '⌘');\n if (/Mac/.test(navigator.platform))\n el.title = el.title.replace('Alt', '⌥');\n }\n\n if (item.href) {\n el.href = item.href;\n el.target = '_blank';\n }\n\n if (item.html) \n el.innerHTML = item.html;\n\n el.className += item.class || ('fa fa-' + (iconMap[name] || name));\n\n if (item.action) {\n el.onclick = function(eve) {\n if (typeof(item.action) === 'function')\n return item.action(self, el, eve);\n return;\n };\n }\n\n return el;\n }", "title": "" }, { "docid": "be068e8a3ff64d4ca0ba66e9739260b3", "score": "0.5285038", "text": "function registerIcons(iconSubset, options) {\n var subset = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, iconSubset, { isRegistered: false, className: undefined });\n var icons = iconSubset.icons;\n // Grab options, optionally mix user provided ones on top.\n options = options ? tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, _iconSettings.__options, options) : _iconSettings.__options;\n for (var iconName in icons) {\n if (icons.hasOwnProperty(iconName)) {\n var code = icons[iconName];\n var normalizedIconName = normalizeIconName(iconName);\n if (_iconSettings[normalizedIconName]) {\n _warnDuplicateIcon(iconName);\n }\n else {\n _iconSettings[normalizedIconName] = {\n code: code,\n subset: subset\n };\n }\n }\n }\n}", "title": "" }, { "docid": "b3171134dd093611e61f6609d1b2eaa5", "score": "0.52792114", "text": "function genIconReactComponent(component, id, iconElementName, iconPkg) {\n const componentAliasName = `Sp${component}`;\n return `/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\n \nimport { ${component} as ${componentAliasName} } from '@spectrum-web-components/${iconPkg}/src/elements/${id}.js';\nimport '@spectrum-web-components/${iconPkg}/icons/${iconElementName}.js';\n \nexport const ${component} = createComponent({ react: React, tagName: '${iconElementName}', elementClass: ${componentAliasName}, events: {}, displayName: '${component}' });\n\nexport type ${component}Type = ${componentAliasName};\n`;\n}", "title": "" }, { "docid": "273e2ba5662efb5a58c396e812ba6525", "score": "0.52717465", "text": "function createMarkerIcon(icon, prefix, markerColor, iconColor) {\n return L.AwesomeMarkers.icon({\n icon: icon,\n prefix: prefix,\n markerColor: markerColor,\n iconColor: iconColor\n });\n }", "title": "" } ]
3514571ab91f29731036ab7a6040c9c6
tdesign v0.8.4 (c) 2022 TDesign Group
[ { "docid": "14feb9b472432d158435ce00492e5a69", "score": "0.0", "text": "function Am(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}", "title": "" } ]
[ { "docid": "b4da0765549006784698ad3d3ae8063f", "score": "0.5703861", "text": "function Ct(){E(Da.v(),\"app-events\",\"start\",null,2);Bt();window.location.hash=\"\";(\"Microsoft Internet Explorer\"===navigator.appName||\"Netscape\"===navigator.appName&&0<=navigator.userAgent.indexOf(\"Trident\"))&&ya(\"Your browser is not supported yet.<br>Considere using chrome or firefox instead of Internet Explorer.\",u(function(){},this));this.c=new Uj;this.view=new Wj;this.h=new Vj;var a=Q(\"silex-stage\"),b=new ej(a,this.h),c=Q(\"silex-menu\"),c=new Ji(c,this.h),d=Q(\"silex-page-tool\"),d=new qt(d,this.h),\nf=Q(\"silex-html-editor\"),f=new Xj(f,this.h),g=Q(\"silex-css-editor\"),g=new bk(g,this.h),h=Q(\"silex-js-editor\"),h=new $i(h,this.h),l=Q(\"silex-text-editor\"),l=new ot(l,this.h),m=Q(\"silex-settings-dialog\"),m=new Po(m,this.h),n=new jf(document.getElementById(\"silex-file-explorer\"),this.h),s=Q(\"silex-property-tool\"),z=new Oo(s,this.h),F=Q(\"silex-workspace\"),F=new vt(F,this.h),B=Q(\"vertical-splitter\"),B=new Qo(B,this.h);So(B,a);Zi(B,s);this.view.Yc(c,b,d,z,f,g,h,l,n,m,B,F);this.c.Yc(new xt(this.c,this.view),\nnew ck(this.c,this.view),new Yj(this.c,this.view),new Jk(this.c,this.view),new Fk(this.c,this.view));this.h.Yc(new Nj(this.c,this.view),new Aj(this.c,this.view),new qj(this.c,this.view),new tj(this.c,this.view),new mb(this.c,this.view),new Hj(this.c,this.view),new xj(this.c,this.view),new uj(this.c,this.view),new Ij(this.c,this.view),new aj(this.c,this.view),new Lj(this.c,this.view),new mf(this.c,this.view),new Ui(this.c,this.view));F.H();b.H();c.H();d.H();f.H();g.H();h.H();l.H();m.H();z.H();Oa(F,\nthis.view);this.h.zb.Yh();wt()}", "title": "" }, { "docid": "501a987dc69a4a83e41ada2edb5e5454", "score": "0.5648382", "text": "function showDesignIntent()\r\n{\r\n TechSpec.show(\"view\",\"designintent.do\");\r\n}", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.55046195", "text": "function TView() { }", "title": "" }, { "docid": "228343261e2a6a45cf340c7421bd7305", "score": "0.55046195", "text": "function TView() { }", "title": "" }, { "docid": "c1540e0ebb9af4a8f1366c8ac064b675", "score": "0.54013634", "text": "static get tag() {\n return \"outline-designer\";\n }", "title": "" }, { "docid": "805c282c819e60368bd8172ac8a43261", "score": "0.53993785", "text": "function i(t,e){const o=t.view;o&&(e&&o.ready&&o.activeTool!==t?(o.activeTool=t,Object(_DOMContainer_js__WEBPACK_IMPORTED_MODULE_2__[\"isDOMContainer\"])(o)&&o.focus()):e||o.activeTool!==t||(o.activeTool=null))}", "title": "" }, { "docid": "cdd17d0db381f380815a8fabf40e1c8b", "score": "0.537336", "text": "function effacerBudgetVisualisation() {\n b('tbVilleBudgetVisualisation','')\n b('lblBudgetVisualisation','')\n b('lblMessageBudgetVisualisation','')\n}", "title": "" }, { "docid": "6c2bce6aac3b129bae318a7e97bedfbf", "score": "0.53418916", "text": "afterCreateControl() {\n }", "title": "" }, { "docid": "cd2c0ac79b18878ce320c8ba210f7119", "score": "0.5331594", "text": "TAC(){\n \n }", "title": "" }, { "docid": "2ac069652dab4b08979296e16162a796", "score": "0.5325105", "text": "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\")\n var url = \"https://public.tableau.com/views/PregnancyNutritionFinder/TopTenDash\";\n var options = {\n hideTabs: true,\n hideToolbar: true,\n // width: \"1200px\",\n // height: \"900px\",\n //\"Long Desc\": \"Catsup\",\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n }\n };\n viz = new tableau.Viz(containerDiv, url, options);\n}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.5285927", "text": "function TView() {}", "title": "" }, { "docid": "9ad909efbeb2fb47614a006a7ae61401", "score": "0.526087", "text": "function organizationAboutPage(){\r\n //This used to have d3.js material.\r\n //I'm waiting on implementing this.\r\n //Back-end comes first.\r\n}", "title": "" }, { "docid": "6bc654b157b6ef2a447a90c4f001aead", "score": "0.52493197", "text": "drag_text_companions(){}", "title": "" }, { "docid": "ceafe675a48e4b6015d11eb84cb32f61", "score": "0.5198266", "text": "function startDesignTool() {\n DBSDK.startOverlay();\n }", "title": "" }, { "docid": "370218cabb892b6b16cd877cca2565b6", "score": "0.51959264", "text": "function dhtmlXLayoutPanel() { }", "title": "" }, { "docid": "ab3d7a1e034e6623fd431abbf8ff8026", "score": "0.5189226", "text": "get TEAPOT() {\n return 418;\n }", "title": "" }, { "docid": "44342617c9dade8152931c3ea2b57e9f", "score": "0.5157578", "text": "edit() {\n\t}", "title": "" }, { "docid": "f285be409039c680e95e0e716f34b60a", "score": "0.5148746", "text": "function fT(a){var b=!!a.readOnly;if(b)var c=null,d=!1,e=!1,g=!1,f=!1,k=!1,m=!1;else{var l=a.toolbox;l?(\"string\"!=typeof l&&(\"undefined\"==typeof XSLTProcessor&&l.outerHTML?l=l.outerHTML:l instanceof Element||(l=null)),\"string\"==typeof l&&(l=gT(l))):l=null;c=l;d=Boolean(c&&c.getElementsByTagName(\"category\").length);e=a.trashcan;void 0===e&&(e=d);g=a.collapse;void 0===g&&(g=d);f=a.comments;void 0===f&&(f=d);k=a.disable;void 0===k&&(k=d);m=a.sounds;void 0===m&&(m=!0)}var l=!!a.rtl,n=a.horizontalLayout;\nvoid 0===n&&(n=!1);var q=a.toolboxPosition,q=\"end\"===q?!1:!0,w=a.scrollbars;void 0===w&&(w=d);var x=a.css;void 0===x&&(x=!0);var B=\"https://blockly-demo.appspot.com/static/media/\";a.media?B=a.media:a.path&&(B=a.path+\"media/\");this.K=l;this.collapse=g;this.ny=f;this.disable=k;this.readOnly=b;this.Cs=a.maxBlocks||Infinity;this.tf=B;this.$z=d;this.rs=w;this.eA=e;this.dA=m;this.bA=x;this.rg=n;this.Pi=c;b=a.grid||{};c={};c.spacing=parseFloat(b.spacing)||0;c.BQ=b.colour||\"#888\";c.length=parseFloat(b.length)||\n1;c.snap=0<c.spacing&&!!b.snap;this.Re=c;a=a.zoom||{};b={};b.controls=void 0===a.controls?!1:!!a.controls;b.wheel=void 0===a.wheel?!1:!!a.wheel;b.vF=void 0===a.startScale?1:parseFloat(a.startScale);b.Ak=void 0===a.maxScale?3:parseFloat(a.maxScale);b.Dk=void 0===a.minScale?.3:parseFloat(a.minScale);b.gF=void 0===a.scaleSpeed?1.2:parseFloat(a.scaleSpeed);this.ae=b;this.ac=n?q?0:1:q==l?3:2}", "title": "" }, { "docid": "bfe4aa4f4203efd25bbf3878f6b6eabd", "score": "0.5116287", "text": "function PSD(){\n \n }", "title": "" }, { "docid": "1414b1936ac7a49b088719fbb5be3664", "score": "0.5113369", "text": "function differentType3(s) {\n app.pages.AddNewContact1.descendants.GenderField.visible = false;\n app.pages.AddNewContact1.descendants.MartialField.visible = false;\n app.pages.AddNewContact1.descendants.DOBField.visible = false;\n app.pages.AddNewContact1.descendants.AgeField.visible = false;\n app.pages.AddNewContact1.descendants.LawFirmField.visible = false;\n app.pages.AddNewContact1.descendants.LawWebSite.visible = false;\n app.pages.AddNewContact1.descendants.MobilePhoneField.visible = false;\n app.pages.AddNewContact1.descendants.WorkPhoneField.visible = false;\n app.pages.AddNewContact1.descendants.WorkAddressField.visible = false;\n app.pages.AddNewContact1.descendants.StreetAddressField.visible = false;\n}", "title": "" }, { "docid": "09cec39c6b7f564c3507791ba0a0450c", "score": "0.51092535", "text": "_firstRendered() {}", "title": "" }, { "docid": "9363479a725fd827ed3fae024a8eb866", "score": "0.5097455", "text": "function showConstructions()\r\n{\r\n TechSpec.show(\"showConstruction\",\"construction.do\");\r\n}", "title": "" }, { "docid": "88021ca8aeabadd3804b0cabde9b06b9", "score": "0.5083662", "text": "function CMP3_TC001(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n\n//Enter Physical Restraints\nexestatus = Features.MvBolusToolTip(TestName,exestatus);\n\n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "6ad53c93d55f2d4d47f3acfe50167cc4", "score": "0.50728947", "text": "function ViewControl() {\n}", "title": "" }, { "docid": "07c138ece9b490bd012546aee3989f6c", "score": "0.50708765", "text": "function onStageChange() {\n}", "title": "" }, { "docid": "87dad3b23eed89ec2f521715e8c9922c", "score": "0.5061187", "text": "render() {\n }", "title": "" }, { "docid": "a22ee3cb0b5e59b8505d459754f1b33b", "score": "0.5055154", "text": "function OttomanStoreadapter() {\n}", "title": "" }, { "docid": "52a76e5dd7c7945ca20bdcdde9caac3b", "score": "0.5047985", "text": "initialRender() {}", "title": "" }, { "docid": "ed7f25421f7353b893a7350b926da2b8", "score": "0.5045268", "text": "static get tag() {\n return \"elmsln-studio\";\n }", "title": "" }, { "docid": "8c953f986e10e43145bfa369f971a3f1", "score": "0.5044667", "text": "function yFirstQt()\n{\n return YQt.FirstQt();\n}", "title": "" }, { "docid": "8a39461d62529b8c105bb588bc0b37de", "score": "0.5029983", "text": "static get tag() {\n return \"lrndesign-chart\";\n }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5026963", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5026963", "text": "function LView() { }", "title": "" }, { "docid": "a99cdb8f3328c3d3d05cd27c2fd6da3e", "score": "0.5024863", "text": "static init() {\n\t\trtj_Code_edit.ExampleIndex = 0;\n\t}", "title": "" }, { "docid": "21737b4ca2b27924a54c7f45b7ece51f", "score": "0.5022122", "text": "function CND_EXTHIDDEN()\r\n\t{\r\n\t}", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.5017281", "text": "_firstRendered() { }", "title": "" }, { "docid": "d0b54cade4582bbc0106e7ba12399c58", "score": "0.5017281", "text": "_firstRendered() { }", "title": "" }, { "docid": "cf566b3f40d899be581d3fd20dd72a50", "score": "0.5015285", "text": "function VeroldComponent() {\n }", "title": "" }, { "docid": "0115e43ecd6f7ec950517df02bc5f74d", "score": "0.49947366", "text": "function showDesignServiceModel(event) {\n show3DModel(event.target, pencil, 12, 10, 50, 50);\n}", "title": "" }, { "docid": "0d30bb7df2682bbf5cd6fcf8188bb755", "score": "0.4993854", "text": "function XForms() {\r\n}", "title": "" }, { "docid": "029b3c9edfd9491ab5b696d5702a0a59", "score": "0.4991651", "text": "getPageDescription() {}", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.49872535", "text": "_onRender() {}", "title": "" }, { "docid": "e787653d09317659becd66fd5bbd3f88", "score": "0.49847493", "text": "function M$3(t){const{view:n,graphic:i}=t,o=new e$1({graphic:i}),a=[],r=C$2(t,o,a);return P$2(t,o,a,r),a.push(n.trackGraphicState(o)),{visualElement:r,remove(){r$8(a).remove();}}}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.49816", "text": "function TView(){}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.49816", "text": "function TView(){}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.49816", "text": "function TView(){}", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.49816", "text": "function TView(){}", "title": "" }, { "docid": "8076ee58e940280d6047dda320aa1223", "score": "0.49785766", "text": "function startDesign() {\n\t// start the design mode\n\tdocument.getElementsByTagName(\"article\")[0].designMode = \"On\";\n}", "title": "" }, { "docid": "ee1e6dfc1f7d30a7dc8708324f3608d4", "score": "0.49767986", "text": "function EntGraphicsConfig(){\n \n}", "title": "" }, { "docid": "daf5873558e5d03bb38a52617a3619c0", "score": "0.4971593", "text": "static get toolbox() {\n return {\n title: 'EditTable',\n icon: `\n <svg width=\"18\" height=\"14\">\n <path d=\"M2.833 8v1.95a1.7 1.7 0 0 0 1.7 1.7h3.45V8h-5.15zm0-2h5.15V2.35h-3.45a1.7 1.7 0 0 0-1.7 1.7V6zm12.3 2h-5.15v3.65h3.45a1.7 1.7 0 0 0 1.7-1.7V8zm0-2V4.05a1.7 1.7 0 0 0-1.7-1.7h-3.45V6h5.15zM4.533.1h8.9a3.95 3.95 0 0 1 3.95 3.95v5.9a3.95 3.95 0 0 1-3.95 3.95h-8.9a3.95 3.95 0 0 1-3.95-3.95v-5.9A3.95 3.95 0 0 1 4.533.1z\"/>\n </svg>\n `\n };\n }", "title": "" }, { "docid": "1a3a1c1dfa148ab5d622b1aeae1b0ce1", "score": "0.4966253", "text": "function CMP10_TC022(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n//Validation of ViewPathology \n// Flowsheet validation to be checked\nexestatus = Features.MvViewPathology(TestName,exestatus);\n\n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "657e902aef0ccc4a21eb67cd78acf11f", "score": "0.49632192", "text": "function init() {\n \n \n// \n// if (!checkLocalStorage()) {\n// var currentFile = document.getElementById(\"currentFile\");\n// currentFile.textContent = \"Sorry! No web storage support. \\n If you're using Internet Explorer, you must load the page from a server for local storage to work.\";\n// }\n// var openDocument = document.getElementById(\"openDocument\");\n// openDocument.style.visibility = \"hidden\";\n// var removeDocument = document.getElementById(\"removeDocument\");\n//\n// removeDocument.style.visibility = \"hidden\";\n\n myDiagram =\n $AJ(go.Diagram, \"myDiagramDiv\",\n {\n //\"grid.visible\": true,\n allowDrop: true, // accept drops from palette\n allowLink: false, // no user-drawn links\n commandHandler: new DrawCommandHandler(), // defined in DrawCommandHandler.js\n // default to having arrow keys move selected nodes\n \"commandHandler.arrowKeyBehavior\": \"move\",\n \"toolManager.mouseWheelBehavior\": go.ToolManager.WheelZoom , // mouse wheel zooms instead of scrolls\n // allow Ctrl-G to call groupSelection()\n \"commandHandler.archetypeGroupData\": { text: \"Group\", isGroup: true },\n\n rotatingTool: new RotateMultipleTool(), // defined in RotateMultipleTool.js\n\n resizingTool: new ResizeMultipleTool(), // defined in ResizeMultipleTool.js\n\n //draggingTool: new GuidedDraggingTool(), // defined in GuidedDraggingTool.js\n //\"draggingTool.horizontalGuidelineColor\": \"blue\",\n //\"draggingTool.verticalGuidelineColor\": \"blue\",\n //\"draggingTool.centerGuidelineColor\": \"green\",\n //\"draggingTool.guidelineWidth\": 1,\n //\n //\"draggingTool.isGridSnapEnabled\": true,\n //\"resizingTool.isGridSnapEnabled\": true,\n // notice whenever the selection may have changed\n \"ChangedSelection\": enableAll, // defined below, to enable/disable commands\n\n // notice when the Paste command may need to be reenabled\n \"ClipboardChanged\": enableAll,\n\n // notice when an object has been dropped from the palette\n \"ExternalObjectsDropped\": function(e) {\n var nodex;\n e.subject.each(function (node) {\n console.log(node.data.key);\n if (node.data.key == 'car')\n nodex = node;\n });\n if (nodex) {\n myDiagram.remove(nodex);\n //var cod = '69';\n //var cco = myDiagram.findNodeForKey('016903');\n //var coo1 = myDiagram.findNodeForKey('017103');\n //var ll = (go.Point.parse(cco.data.loc).x + go.Point.parse(coo1.data.loc).x) / 2;\n //var ly = (go.Point.parse(cco.data.loc).y + go.Point.parse(coo1.data.loc).y) / 2;\n //var loc = go.Point.stringify(new go.Point(ll,ly))\n var ops1 = {key:\"016803\",color:\"red\",width:40};\n var a = new createObj();\n a.cntr(ops1);\n\n //alert(go.Point.parse(\"121 20\").x);\n //myDiagram.remove(cco);\n //cco.data.loc=\"100 200\";\n // myDiagram.model.setDataProperty(cco.data, \"color\", \"red\");\n //console.log(cco);\n }\n }\n\n });\n\n\n\n // change the title to indicate that the diagram has been modified\n// myDiagram.addDiagramListener(\"Modified\", function(e) {\n// var currentFile = document.getElementById(\"currentFile\");\n// var idx = currentFile.textContent.indexOf(\"*\");\n// if (myDiagram.isModified) {\n// if (idx < 0) currentFile.textContent = currentFile.textContent + \"*\";\n// } else {\n// if (idx >= 0) currentFile.textContent = currentFile.textContent.substr(0, idx);\n// }\n// });\n//the Layers\n\n myDiagram.addLayer(yardlay);\n myDiagram.addLayer(cntrlay);\n // the Template\n myDiagram.nodeTemplate= myPaletteTp;\n myDiagram.groupTemplateMap.add(\"yardGroup\",groupTp);\n myDiagram.nodeTemplateMap.add('yardTitle',nodeTpYardTitle);\n myDiagram.nodeTemplateMap.add('yardShape',nodeTpYardShape);\n myDiagram.nodeTemplateMap.add('yardText',nodeTpYardText);\n myDiagram.nodeTemplateMap.add('cntr',nodeTpCntr);\n myDiagram.nodeTemplate.contextMenu =contextTp;\n\n\n // default structures and furniture\n myPalette =\n $AJ(go.Palette, \"myPaletteDiv\",\n {\n nodeTemplate:myDiagram.nodeTemplate, // shared with the main Diagram\n \"contextMenuTool.isEnabled\": false, // but disable context menus\n allowZoom: false,\n //allowDragOut:false,\n layout: $AJ(go.GridLayout, { cellSize: new go.Size(1, 1), spacing: new go.Size(5, 5) }),\n // initialize the Palette with a few furniture and structure nodes\n model: $AJ(go.GraphLinksModel,\n {\n nodeDataArray: [\n {\n key: \"yardtp\",\n //geo: \"F1 M0 0 L5,0 5,40 0,40 0,0z x M5,0 a40,40 0 0,1 40,40 \",\n fig:\"InternalStorage\",\n color: \"lightgreen\"\n },\n {\n key: \"car\",\n geo: \"F1 M0 0 L30 0 30 30 0 30 z\",\n color: \"red\"\n }\n ] // end nodeDataArray\n }) // end model\n }); // end Palette\n\n\n // the Overview\n\n\n myOverview =\n $AJ(go.Overview, \"myOverviewDiv\",\n { observed: myDiagram, maxScale: 0.5 });\n\n // change color of viewport border in Overview\n myOverview.box.elt(0).stroke = \"dodgerblue\";\n\n\n // start off with an empty document\n myDiagram.isModified = false;\n// newDocument();\n var ops = {name:\"01\",text:\"yard01\",row:8,bay:40,tile:5,rowSeq:\"A\",baySeq:\"L\"};\n\n var a = new createObj();\n a.yard(ops);\n\n myDiagram.addDiagramListener(\"ChangedSelection\",\n function(e) {\n var newdata = getBay();\n if (newdata.bayno.length > 0)\n window.open('bay.html?bayno=' + newdata.bayno);\n }\n );\n\n} // end init", "title": "" }, { "docid": "73980ed1e07cd02b472c70c82cd0a6d3", "score": "0.49630082", "text": "getMetaDescription() {}", "title": "" }, { "docid": "c73a43313705233ce3826a14abf464a7", "score": "0.4959279", "text": "function CMP16_TC020(TestName)\n{\nvar exestatus = true;\n\n \n//Login to DBUpdate tool\nexestatus = Features.MvDBUpdateLogin(TestName,exestatus);\n\n//Enter updated input details in DB Update tool\nexestatus = Features.MvDBUpdateAllFields(TestName,exestatus);\n\n//Logout of DBUpdate tool\nexestatus = Features.MvDBUpdateLogout(TestName,exestatus);\n}", "title": "" }, { "docid": "3efee26d22605fe5dbfd4b5fedda5ea0", "score": "0.49580422", "text": "function showStandards()\r\n{\r\n TechSpec.show(\"showStandards\",\"standards.do\");\r\n}", "title": "" }, { "docid": "a65819b36752cee3a70ce0a5921f236a", "score": "0.4948149", "text": "function ixo1013809() { return 'Acti'; }", "title": "" }, { "docid": "3754fc9b270421f7e351ea0bbd7382a5", "score": "0.49451897", "text": "if (GetRenderType()!=CEntity::RT_MODEL) {\n return;\n }", "title": "" }, { "docid": "d8b767928a5031eefc43a8e014e0f109", "score": "0.4941736", "text": "function TGWM ()\n{\n\t\n}", "title": "" }, { "docid": "2bd0411903cea172cfc2ee08f82562c9", "score": "0.4937575", "text": "function LView() {}", "title": "" }, { "docid": "0ce296be447b8fd356a72e8db5a13ec7", "score": "0.49356744", "text": "function setupEditField() {\n\t}", "title": "" }, { "docid": "a58800a256c910dc69219751fb51e4b9", "score": "0.4935218", "text": "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\"),\n url = \"https://public.tableau.com/views/responsiveLastTry/Dashboard2?:embed=y&:display_count=yes\",\n options = {\n hideTabs: true,\n hideToolbar: true,\n showShareOptions: false,\n width: \"800px\",\n height: \"700px\",\n\n };\n\n\n\n viz = new tableau.Viz(containerDiv, url, options);\n // Create a viz object and embed it in the container div.\n}", "title": "" }, { "docid": "093e4a37469af5104c02b9cbde01592a", "score": "0.49323234", "text": "function amr730210() { return 'doc'; }", "title": "" }, { "docid": "63cda1cfd4b316a361197704ce3475da", "score": "0.49279943", "text": "function CMP10_TC015(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n//Validation of DocumentPresenceTTube \n//Flowsheet validation to be checked\nexestatus = Features.MvDocumentPresenceTTube(TestName,exestatus);\n\n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "d0ebdce9957d69199d6a57e33da4fd64", "score": "0.4923129", "text": "function CMP16_TC019(TestName)\n{\nvar exestatus = true;\n\n \n//Login to DBUpdate tool\nexestatus = Features.MvDBUpdateLogin(TestName,exestatus);\n\n//Enter updated input details in DB Update tool\nexestatus = Features.MvDBUpdateAllFields(TestName,exestatus);\n\n//Logout of DBUpdate tool\nexestatus = Features.MvDBUpdateLogout(TestName,exestatus);\n}", "title": "" }, { "docid": "a7d141bb5ab08fefb9512ffe482c0d34", "score": "0.49193406", "text": "function CreateTweak() {\r\n var TASuite = {};\r\n qx.Class.define(\"TASuite.main\", {\r\n type: \"singleton\",\r\n extend: qx.core.Object,\r\n members: {\r\n buttons: {\r\n attack: {\r\n layout: {\r\n save: null, // buttonLayoutSave\r\n load: null, // buttonLayoutLoad\r\n\t\t\t\t\t},\r\n simulate: null, // buttonSimulateCombat\r\n unlock: null, // buttonUnlockAttack\r\n unlockReset: null, // buttonUnlockReset\r\n tools: null, // buttonTools\r\n\t\t\t\t},\r\n simulate: {\r\n back: null // buttonReturnSetup\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\r\n stats: {\r\n spoils: {\r\n tiberium: null, // tiberiumSpoils\r\n crystal: null, // crystalSpoils\r\n credit: null, // creditSpoils\r\n research: null // researchSpoils\r\n\t\t\t\t},\r\n health: {\r\n infantry: null, // lastInfantryPercentage\r\n vehicle: null, // lastVehiclePercentage\r\n aircraft: null, // lastAirPercentage\r\n overall: null, // lastPercentage\r\n\t\t\t\t},\r\n repair: {\r\n infantry: null, // lastInfantryRepairTime\r\n vehicle: null, // lastVehicleRepairTime\r\n aircraft: null, // lastAircraftRepairTime\r\n overall: null // lastRepairTime\r\n\t\t\t\t},\r\n damage: {\r\n units: {\r\n overall: null // lastEnemyUnitsPercentage\r\n\t\t\t\t\t},\r\n structures: {\r\n construction: null, // lastCYPercentage\r\n defense: null, // lastDFPercentage\r\n command: null, // lastCCPercentage\r\n overall: null // lastEnemyBuildingsPercentage\r\n\t\t\t\t\t},\r\n overall: null // lastEnemyPercentage\r\n\t\t\t\t}\r\n\t\t\t},\r\n labels: {\r\n health: {\r\n infantry: null, // infantryTroopStrengthLabel\r\n vehicle: null, // vehicleTroopStrengthLabel\r\n aircraft: null, // airTroopStrengthLabel\r\n overall: null // simTroopDamageLabel\r\n\t\t\t\t},\r\n damage: {\r\n units: {\r\n overall: null // enemyUnitsStrengthLabel\r\n\t\t\t\t\t},\r\n structures: {\r\n construction: null, // CYTroopStrengthLabel\r\n defense: null, // DFTroopStrengthLabel\r\n command: null, // CCTroopStrengthLabel\r\n support: null, // enemySupportStrengthLabel\r\n overall: null // enemyBuildingsStrengthLabel\r\n\t\t\t\t\t},\r\n overall: null, // enemyTroopStrengthLabel\r\n outcome: null // simVictoryLabel\r\n\t\t\t\t},\r\n repair: {\r\n overall: null // simRepairTimeLabel\r\n\t\t\t\t},\r\n time: null, // simTimeLabel\r\n supportlevel: null // enemySupportLevelLabel\r\n\t\t\t},\r\n\t\t\t\r\n add_ViewModeChange: null,\r\n add_ArmyChanged: null,\r\n\t\t\t\r\n attacker_modules: null,\r\n defender_modules: null,\r\n\t\t\t\r\n units: null,\r\n units_list: null,\r\n saved_units: null,\r\n layoutsList: null,\r\n layoutsLabelText: null,\r\n\t\t\t\r\n battleResultsBox: null,\r\n statsPage: null,\r\n\t\t\t\r\n totalSeconds: null,\r\n isPlayerCity: null,\r\n\t\t\t\r\n initializeStats: function (tabView) {\r\n // ////////////////Stats ////////////////////\r\n this.statsPage = new qx.ui.tabview.Page(\"Stats\");\r\n this.statsPage.setLayout(new qx.ui.layout.VBox(5));\r\n this.statsPage.setPadding(1);\r\n tabView.add(this.statsPage);\r\n\t\t\t\t\r\n // The Enemy Vertical Box\r\n var eVBox = new qx.ui.container.Composite();\r\n eVBox.setLayout(new qx.ui.layout.VBox(5));\r\n eVBox.setThemedFont(\"bold\");\r\n eVBox.setThemedPadding(2);\r\n eVBox.setThemedBackgroundColor(\"#eef\");\r\n this.statsPage.add(eVBox);\r\n // The Enemy Troop Strength Label\r\n var eHBox1 = new qx.ui.container.Composite();\r\n eHBox1.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox1.add(new qx.ui.basic.Label(\"Enemy Base: \"));\r\n this.labels.damage.overall = new qx.ui.basic.Label(\"100\");\r\n eHBox1.add(this.labels.damage.overall);\r\n this.labels.damage.overall.setTextColor(\"red\");\r\n eVBox.add(eHBox1);\r\n // Units\r\n var eHBox4 = new qx.ui.container.Composite();\r\n eHBox4.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox4.add(new qx.ui.basic.Label(\"Defences: \"));\r\n this.labels.damage.units.overall = new qx.ui.basic.Label(\"100\");\r\n eHBox4.add(this.labels.damage.units.overall);\r\n this.labels.damage.units.overall.setTextColor(\"green\");\r\n eVBox.add(eHBox4);\r\n // Buildings\r\n var eHBox5 = new qx.ui.container.Composite();\r\n eHBox5.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox5.add(new qx.ui.basic.Label(\"Buildings: \"));\r\n this.labels.damage.structures.overall = new qx.ui.basic.Label(\"100\");\r\n eHBox5.add(this.labels.damage.structures.overall);\r\n this.labels.damage.structures.overall.setTextColor(\"green\");\r\n eVBox.add(eHBox5);\r\n // Command Center\r\n var eHBox2 = new qx.ui.container.Composite();\r\n eHBox2.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox2.add(new qx.ui.basic.Label(\"Construction Yard: \"));\r\n this.labels.damage.structures.construction = new qx.ui.basic.Label(\"100\");\r\n eHBox2.add(this.labels.damage.structures.construction);\r\n this.labels.damage.structures.construction.setTextColor(\"red\");\r\n eVBox.add(eHBox2);\r\n // Defense Facility\r\n var eHBox3 = new qx.ui.container.Composite();\r\n eHBox3.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox3.add(new qx.ui.basic.Label(\"Defense Facility: \"));\r\n this.labels.damage.structures.defense = new qx.ui.basic.Label(\"100\");\r\n eHBox3.add(this.labels.damage.structures.defense);\r\n this.labels.damage.structures.defense.setTextColor(\"red\");\r\n eVBox.add(eHBox3);\r\n // Command Center\r\n var eHBox6 = new qx.ui.container.Composite();\r\n eHBox6.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox6.add(new qx.ui.basic.Label(\"Command Center: \"));\r\n this.labels.damage.structures.command = new qx.ui.basic.Label(\"100\"), eHBox6.add(this.labels.damage.structures.command);\r\n this.labels.damage.structures.command.setTextColor(\"red\");\r\n eVBox.add(eHBox6);\r\n // The Support Horizontal Box\r\n var hboxSupportContainer = new qx.ui.container.Composite();\r\n hboxSupportContainer.setLayout(new qx.ui.layout.HBox(5));\r\n this.labels.supportlevel = new qx.ui.basic.Label(\"Suport lvl \");\r\n hboxSupportContainer.add(this.labels.supportlevel);\r\n this.labels.damage.structures.support = new qx.ui.basic.Label(\"--: 100\");\r\n hboxSupportContainer.add(this.labels.damage.structures.support);\r\n this.labels.damage.structures.support.setTextColor(\"red\");\r\n eVBox.add(hboxSupportContainer);\r\n // The Troops Vertical Box\r\n var tVBox = new qx.ui.container.Composite();\r\n tVBox.setLayout(new qx.ui.layout.VBox(5));\r\n tVBox.setThemedFont(\"bold\");\r\n tVBox.setThemedPadding(2);\r\n tVBox.setThemedBackgroundColor(\"#eef\");\r\n this.statsPage.add(tVBox);\r\n // The Repair Time Label\r\n var tHBox1 = new qx.ui.container.Composite();\r\n tHBox1.setLayout(new qx.ui.layout.HBox(5));\r\n tHBox1.add(new qx.ui.basic.Label(\"Repair Time: \"));\r\n this.labels.repair.overall = new qx.ui.basic.Label(\"0:00:00\");\r\n tHBox1.add(this.labels.repair.overall);\r\n this.labels.repair.overall.setTextColor(\"blue\");\r\n tVBox.add(tHBox1);\r\n // The Troop Strength Label\r\n var tHBox5 = new qx.ui.container.Composite();\r\n tHBox5.setLayout(new qx.ui.layout.HBox(5));\r\n tHBox5.add(new qx.ui.basic.Label(\"Overall: \"));\r\n this.labels.health.overall = new qx.ui.basic.Label(\"100\");\r\n tHBox5.add(this.labels.health.overall);\r\n this.labels.health.overall.setTextColor(\"blue\");\r\n tVBox.add(tHBox5);\r\n // The Infantry Troop Strength Label\r\n var tHBox2 = new qx.ui.container.Composite();\r\n tHBox2.setLayout(new qx.ui.layout.HBox(5));\r\n tHBox2.add(new qx.ui.basic.Label(\"Infantry: \"));\r\n this.labels.health.infantry = new qx.ui.basic.Label(\"100\");\r\n tHBox2.add(this.labels.health.infantry);\r\n this.labels.health.infantry.setTextColor(\"green\");\r\n tVBox.add(tHBox2);\r\n // The Vehicle Troop Strength Label\r\n var tHBox3 = new qx.ui.container.Composite();\r\n tHBox3.setLayout(new qx.ui.layout.HBox(5));\r\n tHBox3.add(new qx.ui.basic.Label(\"Vehicle: \"));\r\n this.labels.health.vehicle = new qx.ui.basic.Label(\"100\");\r\n tHBox3.add(this.labels.health.vehicle);\r\n this.labels.health.vehicle.setTextColor(\"green\");\r\n tVBox.add(tHBox3);\r\n // The Air Troop Strength Label\r\n var tHBox4 = new qx.ui.container.Composite();\r\n tHBox4.setLayout(new qx.ui.layout.HBox(5));\r\n tHBox4.add(new qx.ui.basic.Label(\"Aircraft: \"));\r\n this.labels.health.aircraft = new qx.ui.basic.Label(\"100\");\r\n tHBox4.add(this.labels.health.aircraft);\r\n this.labels.health.aircraft.setTextColor(\"green\");\r\n tVBox.add(tHBox4);\r\n\t\t\t\t\r\n // The inner Vertical Box\r\n var vBox = new qx.ui.container.Composite();\r\n vBox.setLayout(new qx.ui.layout.VBox(5));\r\n vBox.setThemedFont(\"bold\");\r\n vBox.setThemedPadding(2);\r\n vBox.setThemedBackgroundColor(\"#eef\");\r\n // The Victory Label\r\n var hBox2 = new qx.ui.container.Composite();\r\n hBox2.setLayout(new qx.ui.layout.HBox(5));\r\n hBox2.add(new qx.ui.basic.Label(\"Outcome: \"));\r\n this.labels.damage.outcome = new qx.ui.basic.Label(\"Unknown\");\r\n hBox2.add(this.labels.damage.outcome);\r\n this.labels.damage.outcome.setTextColor(\"green\");\r\n vBox.add(hBox2);\r\n // The Battle Time Label\r\n var hBox1 = new qx.ui.container.Composite();\r\n hBox1.setLayout(new qx.ui.layout.HBox(5));\r\n hBox1.add(new qx.ui.basic.Label(\"Battle Time: \"));\r\n this.labels.time = new qx.ui.basic.Label(\"120\");\r\n hBox1.add(this.labels.time);\r\n this.labels.time.setTextColor(\"black\");\r\n vBox.add(hBox1);\r\n this.statsPage.add(vBox);\r\n\t\t\t},\r\n initializeLayout: function (tabView) {\r\n // ////////////////Layouts ////////////////////\r\n var layoutPage = new qx.ui.tabview.Page(\"Layouts\");\r\n layoutPage.setLayout(new qx.ui.layout.VBox());\r\n tabView.add(layoutPage);\r\n\t\t\t\t\r\n this.layoutsList = new qx.ui.form.List();\r\n this.layoutsList.set({\r\n height: 200,\r\n width: 180,\r\n selectionMode: \"one\"\r\n\t\t\t\t});\r\n layoutPage.add(this.layoutsList);\r\n\t\t\t\t\r\n // Add the two buttons for save and load\r\n var layHBox = new qx.ui.container.Composite();\r\n layHBox.setLayout(new qx.ui.layout.HBox(5));\r\n // Load button\r\n this.buttons.attack.layout.load = new qx.ui.form.Button(\"Load\");\r\n this.buttons.attack.layout.load.set({\r\n width: 80,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Load this saved layout.\"\r\n\t\t\t\t});\r\n this.buttons.attack.layout.load.addListener(\"click\", this.loadCityLayout, this);\r\n layHBox.add(this.buttons.attack.layout.load);\r\n // Delete button\r\n this.buttonLayoutDelete = new qx.ui.form.Button(\"Delete\");\r\n this.buttonLayoutDelete.set({\r\n width: 80,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Delete this saved layout.\"\r\n\t\t\t\t});\r\n this.buttonLayoutDelete.addListener(\"click\", this.deleteCityLayout,\r\n this);\r\n layHBox.add(this.buttonLayoutDelete);\r\n layoutPage.add(layHBox);\r\n\t\t\t\t\r\n var layVBox = new qx.ui.container.Composite();\r\n layVBox.setLayout(new qx.ui.layout.VBox(5));\r\n layVBox.setThemedFont(\"bold\");\r\n layVBox.setThemedPadding(2);\r\n layVBox.setThemedBackgroundColor(\"#eef\");\r\n // The Label Textbox\r\n var layHBox2 = new qx.ui.container.Composite();\r\n layHBox2.setLayout(new qx.ui.layout.HBox(5));\r\n layHBox2.add(new qx.ui.basic.Label(\"Name: \"));\r\n this.layoutsLabelText = new qx.ui.form.TextField();\r\n layHBox2.add(this.layoutsLabelText);\r\n layVBox.add(layHBox2);\r\n\t\t\t\t\r\n this.buttons.attack.layout.save = new qx.ui.form.Button(\"Save\");\r\n this.buttons.attack.layout.save.set({\r\n width: 80,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Save this layout.\"\r\n\t\t\t\t});\r\n this.buttons.attack.layout.save.addListener(\"click\", this.saveCityLayout, this);\r\n layVBox.add(this.buttons.attack.layout.save);\r\n layoutPage.add(layVBox);\r\n\t\t\t},\r\n initializeInfo: function (tabView) {\r\n // //////////////// Info ////////////////////\r\n var infoPage = new qx.ui.tabview.Page(\"Info\");\r\n infoPage.setLayout(new qx.ui.layout.VBox(5));\r\n tabView.add(infoPage);\r\n\t\t\t\t\r\n // The Help Vertical Box\r\n var pVBox = new qx.ui.container.Composite();\r\n pVBox.setLayout(new qx.ui.layout.VBox(5));\r\n pVBox.setThemedFont(\"bold\");\r\n pVBox.setThemedPadding(2);\r\n pVBox.setThemedBackgroundColor(\"#eef\");\r\n infoPage.add(pVBox);\r\n var proHelpBar = new qx.ui.basic.Label().set({\r\n value: \"<a target='_blank' href='http://userscripts.org/scripts/discuss/130344'>Forums</a>\",\r\n rich: true\r\n\t\t\t\t});\r\n pVBox.add(proHelpBar);\r\n // The Spoils\r\n var psVBox = new qx.ui.container.Composite();\r\n psVBox.setLayout(new qx.ui.layout.VBox(5));\r\n psVBox.setThemedFont(\"bold\");\r\n psVBox.setThemedPadding(2);\r\n psVBox.setThemedBackgroundColor(\"#eef\");\r\n infoPage.add(psVBox);\r\n psVBox.add(new qx.ui.basic.Label(\"Spoils\"));\r\n // Tiberium\r\n this.stats.spoils.tiberium = new qx.ui.basic.Atom(\"0\", \"webfrontend/ui/common/icn_res_tiberium.png\");\r\n psVBox.add(this.stats.spoils.tiberium);\r\n // Crystal\r\n this.stats.spoils.crystal = new qx.ui.basic.Atom(\"0\", \"webfrontend/ui/common/icn_res_chrystal.png\");\r\n psVBox.add(this.stats.spoils.crystal);\r\n // Credits\r\n this.stats.spoils.credit = new qx.ui.basic.Atom(\"0\", \"webfrontend/ui/common/icn_res_dollar.png\");\r\n psVBox.add(this.stats.spoils.credit);\r\n // Research\r\n this.stats.spoils.research = new qx.ui.basic.Atom(\"0\", \"webfrontend/ui/common/icn_res_research_mission.png\");\r\n psVBox.add(this.stats.spoils.research);\r\n\t\t\t\t\r\n this.battleResultsBox.add(tabView);\r\n\t\t\t},\r\n initialize: function () {\r\n this.add_ViewModeChange = (new ClientLib.Vis.ViewModeChange).LEUXCZ(this, this.onViewChange); //\r\n this.add_ArmyChanged = (new $I.QUXOEF).LEUXCZ(this, this.onUnitMoved); //\r\n this.buttons.attack.simulate = new qx.ui.form.Button(\"Simulate\");\r\n this.buttons.attack.simulate.set({\r\n width: 58,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Start Combat Simulation\"\r\n\t\t\t\t});\r\n this.buttons.attack.simulate.addListener(\"click\", this.startSimulation, this);\r\n\t\t\t\t\r\n this.buttons.simulate.back = new qx.ui.form.Button(\"Setup\");\r\n this.buttons.simulate.back.set({\r\n width: 80,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Return to Combat Setup\"\r\n\t\t\t\t});\r\n this.buttons.simulate.back.addListener(\"click\", this.returnSetup, this);\r\n\t\t\t\t\r\n var replayBar = qx.core.Init.getApplication().getReportReplayOverlay();\r\n replayBar.add(this.buttons.simulate.back, {\r\n top: 10,\r\n left: 0\r\n\t\t\t\t});\r\n\t\t\t\t\r\n var armyBar = qx.core.Init.getApplication().getUIItem(ClientLib.Data.Missions.PATH.BAR_ATTACKSETUP);\r\n\t\t\t\t\r\n this.buttons.attack.unlock = new qx.ui.form.Button(\"Unlock\");\r\n this.buttons.attack.unlock.set({\r\n width: 55,\r\n height: 46,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Unlock Attack Button\"\r\n\t\t\t\t});\r\n this.buttons.attack.unlock.addListener(\"click\", this.unlockAttacks, this);\r\n this.buttons.attack.unlock.setOpacity(0.5);\r\n armyBar.add(this.buttons.attack.unlock, {\r\n top: 102,\r\n right: 4\r\n\t\t\t\t});\r\n\t\t\t\t\r\n this.buttons.attack.unlockReset = new qx.ui.form.Button(\"Unlock\");\r\n this.buttons.attack.unlockReset.set({\r\n width: 55,\r\n height: 42,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Unlock Reset Button\"\r\n\t\t\t\t});\r\n this.buttons.attack.unlockReset.addListener(\"click\", this.unlockResets, this);\r\n this.buttons.attack.unlockReset.setOpacity(0.5);\r\n armyBar.add(this.buttons.attack.unlockReset, {\r\n top: 59,\r\n right: 4\r\n\t\t\t\t});\r\n\t\t\t\t\r\n this.buttons.attack.tools = new qx.ui.form.Button(\"Tools\");\r\n this.buttons.attack.tools.set({\r\n width: 58,\r\n appearance: \"button-text-small\",\r\n toolTipText: \"Open Simulator Tools\"\r\n\t\t\t\t});\r\n this.buttons.attack.tools.addListener(\"click\", this.toggleTools, this);\r\n\t\t\t\t\r\n var battleUnitData = $I.PJNPPV.prototype;\r\n if (!battleUnitData.set_Enabled_Original) {\r\n battleUnitData.set_Enabled_Original = battleUnitData.set_Enabled;\r\n\t\t\t\t}\r\n battleUnitData.set_Enabled = function (a) {\r\n this.set_Enabled_Original(a);\r\n var ta = window.TASuite.main.getInstance();\r\n ta.onUnitMoved();\r\n\t\t\t\t};\r\n\t\t\t\t\r\n _this = this;\r\n setTimeout(\r\n\t\t\t\t\r\n function () {\r\n try {\r\n // Get the active modules\r\n // Doing this the hard and unreliable way for now, until\r\n // we figure out a better way\r\n _this.attacker_modules = {};\r\n _this.attacker_modules.l = [];\r\n var g = ClientLib.Res.ResMain.GetInstance();\r\n\t\t\t\t\t\t\r\n // Get the player faction\r\n // var gdi_unit_ids = g.GetFactionUnitIds(1);\r\n // var nod_unit_ids = g.GetFactionUnitIds(2);\r\n // var forgotten_unit_ids = g.GetFactionUnitIds(3);\r\n\t\t\t\t\t\t\r\n var player_research = ClientLib.Data.MainData.GetInstance().get_Player().get_PlayerResearch();\r\n\t\t\t\t\t\t\r\n for (var i in g.EUIRZQ.units) { //\r\n var ug = g.GetUnit_Obj(i);\r\n var research = player_research.GetResearchItemFomMdbId(ug.tl);\r\n\t\t\t\t\t\t\t\r\n var modules = ug.m;\r\n for (var j in modules) {\r\n var module = modules[j];\r\n if (research && module.r.length > 0) {\r\n try {\r\n // This is an upgradeable ability\r\n var required_level = module.r[0].l;\r\n var current_level = research.get_CurrentLevel();\r\n if (current_level >= required_level) {\r\n _this.attacker_modules.l.push(module.i);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} else {\r\n _this.attacker_modules.l.push(module.i);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n // Get the defender modules\r\n _this.defender_modules = _this.attacker_modules;\r\n ClientLib.Vis.VisMain.GetInstance().add_ViewModeChange(\r\n _this.add_ViewModeChange);\r\n\t\t\t\t\t\t\r\n armyBar.add(_this.buttons.attack.tools, {\r\n top: 74,\r\n right: 62\r\n\t\t\t\t\t\t});\r\n armyBar.add(_this.buttons.attack.simulate, {\r\n top: 112,\r\n right: 62\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, 10000);\r\n\t\t\t\t\r\n // The Battle Simulator box\r\n this.battleResultsBox = new qx.ui.window.Window(\"Battle Simulator\");\r\n this.battleResultsBox.setPadding(1);\r\n this.battleResultsBox.setLayout(new qx.ui.layout.VBox(1));\r\n this.battleResultsBox.setShowMaximize(false);\r\n this.battleResultsBox.setShowMinimize(false);\r\n this.battleResultsBox.moveTo(125, 125);\r\n this.battleResultsBox.setHeight(300);\r\n this.battleResultsBox.setWidth(200);\r\n\t\t\t\t\r\n var tabView = new qx.ui.tabview.TabView();\r\n tabView.setPadding(5);\r\n this.battleResultsBox.add(tabView);\r\n\t\t\t\t\r\n this.initializeStats(tabView);\r\n this.initializeLayout(tabView);\r\n this.initializeInfo(tabView);\r\n\t\t\t},\r\n closeToolsBox: function () {\r\n try {\r\n var units = this.getCityPreArmyUnits();\r\n if (units) {\r\n units.remove_ArmyChanged(this.add_ArmyChanged);\r\n\t\t\t\t\t}\r\n this.battleResultsBox.close();\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n toggleTools: function () {\r\n var units = this.getCityPreArmyUnits();\r\n this.units = units.get_ArmyUnits().l;\r\n var cityFaction = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_CityFaction();\r\n this.isPlayerCity = false;\r\n if ((cityFaction === ClientLib.Base.EFactionType.GDIFaction) || (cityFaction === ClientLib.Base.EFactionType.NODFaction)) this.isPlayerCity = true;\r\n\t\t\t\t\r\n if (this.battleResultsBox.isVisible()) {\r\n this.closeToolsBox();\r\n\t\t\t\t\t} else {\r\n // Add the event listener for armybar\r\n try {\r\n units.remove_ArmyChanged(this.add_ArmyChanged);\r\n units.add_ArmyChanged(this.add_ArmyChanged);\r\n\t\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n this.updateLayoutsList();\r\n this.calculateLoot();\r\n this.calculateSimResults();\r\n this.updateStatsWindow();\r\n this.battleResultsBox.open();\r\n\t\t\t\t}\r\n\t\t\t},\r\n getCityPreArmyUnits: function () {\r\n var armyBar = qx.core.Init.getApplication().getUIItem(\r\n ClientLib.Data.Missions.PATH.BAR_ATTACKSETUP);\r\n var units = null;\r\n for (var key in armyBar) {\r\n try {\r\n if (armyBar[key] instanceof ClientLib.Data.CityPreArmyUnits) { // ClientLib.Data.CityPreArmyUnits renamed to $I.UIG = $I.NSVPME *CHECKED*\r\n units = armyBar[key];\r\n break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (e) {}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n return units;\r\n\t\t\t},\r\n calculateLoot: function () {\r\n // Adapted from the CNC Loot script:\r\n // http://userscripts.org/scripts/show/135953\r\n var city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity();\r\n var num = 0;\r\n var spoils = {\r\n 1: 0,\r\n 2: 0,\r\n 3: 0,\r\n 6: 0,\r\n 7: 0\r\n\t\t\t\t};\r\n\t\t\t\t\r\n if (city.get_CityBuildingsData().HWFIJH !== null) {\r\n // every building\r\n num = city.get_CityBuildingsData().HWFIJH.l.length;\r\n for (var j = num; --j >= 0;) {\r\n var building = city.get_CityBuildingsData().HWFIJH.l[j];\r\n // TODO: check for destroyed building\r\n var mod = building.get_HitpointsPercent();\r\n for (var i = building.MNNADO.rer.length; --i >= 0;) {\r\n spoils[building.MNNADO.rer[i].t] += mod * building.MNNADO.rer[i].c;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n // every unit\r\n if (city.get_CityUnitsData().TXDWUM !== null) {\r\n num = city.get_CityUnitsData().TXDWUM.l.length;\r\n for (j = num; --j >= 0;) {\r\n var unit = city.get_CityUnitsData().TXDWUM.l[j];\r\n mod = unit.get_HitpointsPercent();\r\n for (i = unit.MNNADO.rer.length; --i >= 0;) {\r\n spoils[unit.MNNADO.rer[i].t] += mod * unit.MNNADO.rer[i].c;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n this.stats.spoils.tiberium.setLabel(this.formatNumberWithCommas(spoils[1]));\r\n this.stats.spoils.crystal.setLabel(this.formatNumberWithCommas(spoils[2]));\r\n this.stats.spoils.credit.setLabel(this.formatNumberWithCommas(spoils[3]));\r\n this.stats.spoils.research.setLabel(this.formatNumberWithCommas(spoils[6]));\r\n\t\t\t},\r\n calculateSimResults: function () {\r\n var battleground = this.setupBattleground(this.getCityPreArmyUnits());\r\n\t\t\t\t\r\n // Run the simulation until it's done\r\n while (battleground.DHSWQJ.OAEJMD(false)) {}\r\n // DoStep$0 was renamed to OAEJMD, m_Simulation was renamed to DHSWQJ\r\n\t\t\t\t\r\n this.calculateTroopStrengths(battleground);\r\n\t\t\t},\r\n onUnitMoved: function (sender, e) {\r\n if (this.battleResultsBox.isVisible()) {\r\n var ta = window.TASuite.main.getInstance();\r\n //ta.calculateSimResults();\r\n //ta.updateStatsWindow();\r\n\t\t\t\t}\r\n\t\t\t},\r\n calculateTroopStrengths: function (battleground) {\r\n var battleground = ClientLib.Vis.VisMain.GetInstance().get_Battleground();\r\n var total_hp = 0;\r\n var end_hp = 0;\r\n var e_total_hp = 0;\r\n var e_end_hp = 0;\r\n var eb_total_hp = 0;\r\n var eb_end_hp = 0;\r\n var eu_total_hp = 0;\r\n var eu_end_hp = 0;\r\n var i_end_hp = 0;\r\n var v_end_hp = 0;\r\n var a_end_hp = 0;\r\n var v_total_hp = 0;\r\n var a_total_hp = 0;\r\n var i_total_hp = 0;\r\n this.stats.damage.structures.defense = 0;\r\n this.stats.damage.structures.construction = 0;\r\n this.stats.damage.structures.command = 0;\r\n this.SupportLevel = 0;\r\n this.lastSupportPercentage = 0;\r\n this.stats.repair.infantry = 0;\r\n this.stats.repair.vehicle = 0;\r\n this.stats.repair.aircraft = 0;\r\n\t\t\t\t\r\n var own_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentOwnCity();\r\n var crd = own_city.get_CityRepairData();\r\n var cud = own_city.get_CityUnitsData();\r\n var repair_times = own_city.get_CityUnitsData().EDTHDX.d; // m_FullRawRepairTimeForUnitGroupTypes renamed to EDTHDX\r\n var r_types = ClientLib.Base.EResourceType;\r\n\t\t\t\t\r\n var entities = battleground.NNXRBC.d; // m_Entities has been renamed to NNXRBC\r\n for (var i in entities) {\r\n var entity = entities[i];\r\n var i_entity = entity.QXYJOG; // get_Entity$0() has been removed. Propery is $I.TQL - QXYJOG\r\n var a_entity = entity.GUXBBT; // ??? has been renamed to GUXBBT\r\n var current_hp = i_entity.HOTKDN; // m_iHitpointsCurrent has been renamed to HOTKDN\r\n var max_hp = i_entity.EUJPNP; // m_iHitpoints has been renamed to EUJPNP\r\n if (a_entity.XPEHRJ === 2) { // ??? has been renamed to XPEHRJ, Attacker is 2\r\n // This is one of the good guys\r\n end_hp += current_hp;\r\n total_hp += max_hp;\r\n switch (a_entity.TRKXAB) { // movement type has been renamed toTRKXAB\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Air:\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Air2:\r\n a_end_hp += current_hp;\r\n a_total_hp += max_hp;\r\n break;\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Feet:\r\n i_end_hp += current_hp;\r\n i_total_hp += max_hp;\r\n break;\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Track:\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Wheel:\r\n v_end_hp += current_hp;\r\n v_total_hp += max_hp;\r\n break;\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Structure:\r\n break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n // Enemy Overall\r\n e_total_hp += max_hp;\r\n e_end_hp += current_hp;\r\n\t\t\t\t\t\t\r\n if (i_entity.XZXAQZ >= 200 && i_entity.XZXAQZ <= 205) {\r\n this.SupportLevel = parseInt(i_entity.BGYEIQ); // m_iLevel has been renamed to BGYEIQ\r\n this.lastSupportPercentage = (current_hp / max_hp) * 100;\r\n\t\t\t\t\t\t\t} else {\r\n switch (i_entity.XZXAQZ) {\r\n // m_MDCTypeId has been renamed to XZXAQZ\r\n\t\t\t\t\t\t\t\tcase 112:\r\n // GDI YARD\r\n\t\t\t\t\t\t\t\tcase 151:\r\n // NOD CY\r\n\t\t\t\t\t\t\t\tcase 177:\r\n // FOR CY\r\n this.stats.damage.structures.construction = (current_hp / max_hp) * 100;\r\n break;\r\n\t\t\t\t\t\t\t\tcase 158:\r\n // NOD DF\r\n\t\t\t\t\t\t\t\tcase 131:\r\n // GDI DF\r\n\t\t\t\t\t\t\t\tcase 195:\r\n // FOR DF\r\n this.stats.damage.structures.defense = (current_hp / max_hp) * 100;\r\n break;\r\n\t\t\t\t\t\t\t\tcase 111:\r\n // GDI CC\r\n\t\t\t\t\t\t\t\tcase 159:\r\n // NOD CC\r\n this.stats.damage.structures.command = (current_hp / max_hp) * 100;\r\n break;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n switch (a_entity.TRKXAB) {\r\n\t\t\t\t\t\t\tcase ClientLib.Base.EUnitMovementType.Structure:\r\n // Enemy Building\r\n eb_total_hp += max_hp;\r\n eb_end_hp += current_hp;\r\n break;\r\n\t\t\t\t\t\t\tdefault:\r\n // Enemy Defence\r\n eu_total_hp += max_hp;\r\n eu_end_hp += current_hp;\r\n break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n // Get MaxHealth for UnitTypes\r\n var totalInfantryHealth = 0;\r\n var totalVehicleHealth = 0;\r\n var totalAirHealth = 0;\r\n for (var i in this.units) {\r\n switch (this.units[i].get_UnitGameData_Obj().at) {\r\n\t\t\t\t\t\tcase ClientLib.Data.EUnitGroup.Infantry:\r\n totalInfantryHealth += (this.units[i].get_MaxHealth() * 16);\r\n break;\r\n\t\t\t\t\t\tcase ClientLib.Data.EUnitGroup.Vehicle:\r\n totalVehicleHealth += (this.units[i].get_MaxHealth() * 16);\r\n break;\r\n\t\t\t\t\t\tcase ClientLib.Data.EUnitGroup.Aircraft:\r\n totalAirHealth += (this.units[i].get_MaxHealth() * 16);\r\n break;\r\n\t\t\t\t\t\tdefault:\r\n alert(\"CombatSim: Unknown UnitType found!\");\r\n break;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n // Calculate Percentages\r\n this.stats.health.infantry = i_total_hp ? (i_end_hp / i_total_hp) * 100 : 100;\r\n this.stats.health.vehicle = v_total_hp ? (v_end_hp / v_total_hp) * 100 : 100;\r\n this.stats.health.aircraft = a_total_hp ? (a_end_hp / a_total_hp) * 100 : 100;\r\n this.totalSeconds = (battleground.DHSWQJ.NHMXEO * battleground.get_TimePerStep()) / 1000;\r\n\t\t\t\t\r\n this.stats.damage.units.overall = (eu_end_hp / eu_total_hp) * 100;\r\n this.stats.damage.structures.overall = (eb_end_hp / eb_total_hp) * 100;\r\n this.stats.damage.overall = (e_end_hp / e_total_hp) * 100;\r\n this.stats.health.overall = end_hp ? (end_hp / total_hp) * 100 : 0;\r\n\t\t\t\t\r\n // Calculate the repair time\r\n crd.ConvertRepairCost = crd.JBTHHM; // ConvertRepairCost has been renamed to JBTHHM\r\n this.stats.repair.infantry = crd.ConvertRepairCost(\r\n r_types.RepairChargeInf,\r\n repair_times[ClientLib.Data.EUnitGroup.Infantry], (1 - (i_end_hp + totalInfantryHealth - i_total_hp) / (totalInfantryHealth ? totalInfantryHealth : 1)));\r\n this.stats.repair.aircraft = crd.ConvertRepairCost(\r\n r_types.RepairChargeAir,\r\n repair_times[ClientLib.Data.EUnitGroup.Aircraft], (1 - (a_end_hp + totalAirHealth - a_total_hp) / (totalAirHealth ? totalAirHealth : 1)));\r\n this.stats.repair.vehicle = crd.ConvertRepairCost(\r\n r_types.RepairChargeVeh,\r\n repair_times[ClientLib.Data.EUnitGroup.Vehicle], (1 - (v_end_hp + totalVehicleHealth - v_total_hp) / (totalVehicleHealth ? totalVehicleHealth : 1)));\r\n this.stats.repair.overall = Math.max(this.stats.repair.vehicle,\r\n this.stats.repair.aircraft, this.stats.repair.infantry);\r\n\t\t\t\t\r\n\t\t\t},\r\n setLabelColor: function (obj, val, dir) {\r\n var colors = ['black', 'blue', 'green', 'red'];\r\n var color = colors[0];\r\n var v = val;\r\n if (dir >= 0) v = 100.0 - v;\r\n if (v > 99.99) color = colors[3];\r\n else if (v > 50) color = colors[2];\r\n else if (v > 0) color = colors[1];\r\n obj.setTextColor(color);\r\n\t\t\t},\r\n updateLabel100: function (obj, val, dir) {\r\n this.setLabelColor(obj, val, dir);\r\n obj.setValue(val.toFixed(2).toString());\r\n\t\t\t},\r\n updateLabel100time: function (obj, val, dir, time) {\r\n var s = val.toFixed(2).toString() + \" @ \";\r\n s += this.formatSecondsAsTime(time, \"h:mm:ss\");\r\n this.setLabelColor(obj, val, dir);\r\n obj.setValue(s);\r\n\t\t\t},\r\n updateStatsWindow: function () {\r\n var colors = ['black', 'blue', 'green', 'red'];\r\n var s = \"\";\r\n var n = 0;\r\n if (this.stats.damage.structures.construction === 0) {\r\n s = \"Total Victory\";\r\n n = 0;\r\n\t\t\t\t\t} else if (this.stats.damage.structures.overall < 100) {\r\n s = \"Victory\";\r\n n = 1;\r\n\t\t\t\t\t} else {\r\n s = \"Total Defeat\";\r\n n = 3;\r\n\t\t\t\t}\r\n this.labels.damage.outcome.setValue(s);\r\n this.labels.damage.outcome.setTextColor(colors[n]);\r\n this.updateLabel100(this.labels.damage.overall, this.stats.damage.overall, - 1);\r\n this.updateLabel100(this.labels.damage.units.overall, this.stats.damage.units.overall, - 1);\r\n this.updateLabel100(this.labels.damage.structures.overall, this.stats.damage.structures.overall, - 1);\r\n this.updateLabel100(this.labels.damage.structures.construction, this.stats.damage.structures.construction, - 1);\r\n this.updateLabel100(this.labels.damage.structures.defense, this.stats.damage.structures.defense, - 1);\r\n // Command Center\r\n if (this.isPlayerCity) this.updateLabel100(this.labels.damage.structures.command, this.stats.damage.structures.command, - 1);\r\n else {\r\n this.labels.damage.structures.command.setValue(\"--\");\r\n this.labels.damage.structures.command.setTextColor(\"green\");\r\n\t\t\t\t}\r\n // SUPPORT\r\n var SLabel = (this.SupportLevel > 0) ? this.SupportLevel.toString() : '--';\r\n this.labels.supportlevel.setValue('Suport lvl ' + SLabel + ': ');\r\n this.updateLabel100(this.labels.damage.structures.support, this.lastSupportPercentage, - 1);\r\n // ATTACKER\r\n this.setLabelColor(this.labels.repair.overall, this.stats.repair.overall / 14400.0, - 1); // max is 4h\r\n this.labels.repair.overall.setValue(this.formatSecondsAsTime(this.stats.repair.overall, \"h:mm:ss\"));\r\n // OVERALL\r\n this.updateLabel100(this.labels.health.overall, this.stats.health.overall, 1);\r\n // INF\r\n this.updateLabel100time(this.labels.health.infantry, this.stats.health.infantry, 1, this.stats.repair.infantry);\r\n // VEH\r\n this.updateLabel100time(this.labels.health.vehicle, this.stats.health.vehicle, 1, this.stats.repair.vehicle);\r\n // AIR\r\n this.updateLabel100time(this.labels.health.aircraft, this.stats.health.aircraft, 1, this.stats.repair.aircraft);\r\n // BATTLE TIME\r\n this.setLabelColor(this.labels.time, this.totalSeconds / 120.0, - 1); // max is 120s\r\n this.labels.time.setValue(this.totalSeconds.toFixed(2).toString());\r\n\t\t\t},\r\n formatNumberWithCommas: function (x) {\r\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n\t\t\t},\r\n formatSecondsAsTime: function (secs, format) {\r\n var hr = Math.floor(secs / 3600);\r\n var min = Math.floor((secs - (hr * 3600)) / 60);\r\n var sec = Math.floor(secs - (hr * 3600) - (min * 60));\r\n\t\t\t\t\r\n if (hr < 10) hr = \"0\" + hr;\r\n if (min < 10) min = \"0\" + min;\r\n if (sec < 10) sec = \"0\" + sec;\r\n\t\t\t\t\r\n if (format !== null) {\r\n var formatted_time = format.replace('hh', hr);\r\n formatted_time = formatted_time.replace('h', hr * 1 + \"\");\r\n formatted_time = formatted_time.replace('mm', min);\r\n formatted_time = formatted_time.replace('m', min * 1 + \"\");\r\n formatted_time = formatted_time.replace('ss', sec);\r\n formatted_time = formatted_time.replace('s', sec * 1 + \"\");\r\n return formatted_time;\r\n\t\t\t\t\t} else {\r\n return hr + ':' + min + ':' + sec;\r\n\t\t\t\t}\r\n\t\t\t},\r\n unlockAttacks: function () {\r\n var armyBar = qx.core.Init.getApplication().getUIItem(ClientLib.Data.Missions.PATH.BAR_ATTACKSETUP);\r\n armyBar.remove(this.buttons.attack.unlock);\r\n var _this = this;\r\n setTimeout(function () {\r\n armyBar.add(_this.buttons.attack.unlock);\r\n\t\t\t\t}, 2000);\r\n\t\t\t},\r\n unlockResets: function () {\r\n var armyBar = qx.core.Init.getApplication().getUIItem(\r\n ClientLib.Data.Missions.PATH.BAR_ATTACKSETUP);\r\n armyBar.remove(this.buttons.attack.unlockReset);\r\n var _this = this;\r\n setTimeout(function () {\r\n armyBar.add(_this.buttons.attack.unlockReset);\r\n\t\t\t\t}, 2000);\r\n\t\t\t},\r\n onViewChange: function (oldMode, newMode) {\r\n try {\r\n if (oldMode !== webfrontend.gui.PlayArea.PlayArea.modes.EMode_CombatSetupDefense || newMode !== webfrontend.gui.PlayArea.PlayArea.modes.EMode_PlayerOffense) {\r\n // Close the stats box\r\n this.closeToolsBox();\r\n this.battleResultsBox.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n returnSetup: function () {\r\n // Set the scene again, just in case it didn't work the first time\r\n var app = qx.core.Init.getApplication();\r\n var player_cities = ClientLib.Data.MainData.GetInstance().get_Cities();\r\n var current_city = player_cities.get_CurrentCity();\r\n try {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.PlayArea.modes.EMode_CombatSetupDefense, localStorage.ta_sim_last_city, 0, 0);\r\n\t\t\t\t\t} catch (e) {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.modes.EMode_CombatSetupDefense, localStorage.ta_sim_last_city, 0, 0);\r\n\t\t\t\t}\r\n\t\t\t},\r\n setupBattleground: function (offense_units) {\r\n try {\r\n var mainData = ClientLib.Data.MainData.GetInstance();\r\n var player_cities = mainData.get_Cities();\r\n var current_city = player_cities.get_CurrentCity();\r\n var own_city = player_cities.get_CurrentOwnCity();\r\n\t\t\t\t\t\r\n // Bust the cache\r\n // own_city.get_CityArmyFormationsManager().ZJG.d[own_city.get_CityArmyFormationsManager().XJG].UpdateFormation();\r\n\t\t\t\t\t\r\n localStorage.ta_sim_last_city = current_city.get_Id();\r\n\t\t\t\t\t\r\n var alliance = ClientLib.Data.MainData.GetInstance().get_Alliance();\r\n var combatData = (new ClientLib.Data.Combat).$ctor();\r\n // var combatData = (new $I.CM).QB();\r\n combatData.MCXRNN = 1; // Version is MCXRNN\r\n\t\t\t\t\t\r\n var unitData = own_city.get_CityUnitsData().YDBIOO().l; // Attacker Units renamed to YDBIOO\r\n if (offense_units) {\r\n offense_units = offense_units.SXMOWS.l;\r\n\t\t\t\t\t\t} else {\r\n offense_units = own_city.get_CityArmyFormationsManager().GetFormationByTargetBaseId(current_city.get_Id()).get_ArmyUnits().l;\r\n\t\t\t\t\t}\r\n var data = new Array();\r\n\t\t\t\t\t\r\n for (var i = 0; i < unitData.length; i++) {\r\n if (offense_units[i].get_Enabled()) {\r\n var info = new Object();\r\n info.h = unitData[i].get_Health();\r\n info.i = unitData[i].get_MdbUnitId();\r\n info.l = unitData[i].get_CurrentLevel();\r\n info.x = offense_units[i].get_CoordX();\r\n info.y = offense_units[i].get_CoordY();\r\n data.push(info);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n combatData.UJWJOI = data; // Attackers renamed to UJWJOI\r\n\t\t\t\t\t\r\n data = new Array();\r\n if (current_city.get_CityUnitsData().TXDWUM !== null) { // empty defender army\r\n unitData = current_city.get_CityUnitsData().TXDWUM.l; // defender units\r\n for (i = 0; i < unitData.length; i++) {\r\n info = new Object();\r\n info.h = unitData[i].get_Health();\r\n info.i = unitData[i].get_MdbUnitId();\r\n info.l = unitData[i].get_CurrentLevel();\r\n info.x = unitData[i].get_CoordX();\r\n info.y = unitData[i].get_CoordY();\r\n data.push(info);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n combatData.PMEAOH = data; // Defenders renamed to PMEAOH\r\n\t\t\t\t\t\r\n data = new Array();\r\n for (var i = 0; i < 9; i++) {\r\n for (var j = 0; j < 8; j++) {\r\n var terrainType = current_city.GetResourceType(i, (j + 8));\r\n var unitType = -1;\r\n switch (terrainType) {\r\n\t\t\t\t\t\t\t\tcase ClientLib.Data.ECityTerrainType.FOREST:\r\n unitType = ClientLib.Base.EUnit.Forest;\r\n break;\r\n\t\t\t\t\t\t\t\tcase ClientLib.Data.ECityTerrainType.BRIAR:\r\n unitType = ClientLib.Base.EUnit.Scrub;\r\n break;\r\n\t\t\t\t\t\t\t\tcase ClientLib.Data.ECityTerrainType.SWAMP:\r\n unitType = ClientLib.Base.EUnit.Swamp;\r\n break;\r\n\t\t\t\t\t\t\t\tcase ClientLib.Data.ECityTerrainType.WATER:\r\n unitType = ClientLib.Base.EUnit.Water;\r\n break;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n if (unitType !== -1) {\r\n info = new Object();\r\n info.h = 100;\r\n info.i = unitType;\r\n info.l = 1;\r\n info.x = i;\r\n info.y = j;\r\n data.push(info);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n combatData.YDPGXU = data; // Terrain renamed to YDPGXU\r\n\t\t\t\t\t\r\n unitData = current_city.get_CityBuildingsData().HWFIJH.l; // City buildings renamed to HWFIJH\r\n\t\t\t\t\t\r\n data = new Array();\r\n for (i = 0; i < unitData.length; i++) {\r\n info = new Object();\r\n info.h = unitData[i].get_Health();\r\n info.i = unitData[i].get_MdbUnitId();\r\n info.l = unitData[i].get_CurrentLevel();\r\n info.x = unitData[i].get_CoordX();\r\n info.y = unitData[i].get_CoordY();\r\n data.push(info);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n combatData.YBXPKT = data; // Buildings renamed to YBXPKT\r\n\t\t\t\t\t\r\n combatData.XDMLON = null; // Support Structures renamed to XDMLON\r\n combatData.MALBMJ = 8696244; // Start Step - this is just a random number - renamed to MALBMJ\r\n combatData.m_CombatSteps = 1;\r\n combatData.m_BoostInfantry = alliance.get_POIInfantryBonus();\r\n combatData.m_BoostVehicle = alliance.get_POIVehicleBonus();\r\n combatData.m_BoostAir = alliance.get_POIAirBonus();\r\n combatData.m_BoostDefense = current_city.get_AllianceDefenseBonus();\r\n combatData.m_AttackerBaseId = own_city.get_Id();\r\n combatData.m_AttackerBaseName = own_city.get_Name();\r\n combatData.m_AttackerPlayerId = own_city.get_PlayerId();\r\n combatData.m_AttackerPlayerName = own_city.get_PlayerName();\r\n combatData.m_AttackerAllianceId = own_city.get_AllianceId();\r\n combatData.m_AttackerAllianceName = own_city.get_AllianceName();\r\n combatData.m_DefenderBaseId = current_city.get_Id();\r\n combatData.m_DefenderBaseName = current_city.get_Name();\r\n combatData.m_DefenderPlayerId = current_city.get_PlayerId();\r\n combatData.m_DefenderPlayerName = current_city.get_OwnerName();\r\n combatData.m_DefenderAllianceId = current_city.get_AllianceId();\r\n combatData.m_DefenderAllianceName = current_city.get_OwnerAllianceName();\r\n combatData.m_DefenderBlockStep = 0;\r\n combatData.m_AttackTimeStamp = new Date().getTime();\r\n var resourceLayout = new Object();\r\n resourceLayout.l = new Array();\r\n combatData.m_ResourceLayout = resourceLayout;\r\n combatData.m_DefenderFaction = current_city.get_CityFaction();\r\n combatData.m_AttackerModules = this.attacker_modules;\r\n combatData.m_DefenderModules = this.defender_modules;\r\n\t\t\t\t\t\r\n if (((combatData.m_DefenderFaction === ClientLib.Base.EFactionType.FORFaction) || (combatData.m_DefenderFaction === ClientLib.Base.EFactionType.NPCBase)) || (combatData.m_DefenderFaction === ClientLib.Base.EFactionType.NPCCamp)) {\r\n combatData.FGCUFQ(); // This might not be needed\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n combatData.m_MaxDuration = 120;\r\n combatData.m_Complete = false;\r\n combatData.SXOUOX = null; // Debug renamed to SXOUOX\r\n\t\t\t\t\t\r\n var battleground = ClientLib.Vis.VisMain.GetInstance().get_Battleground();\r\n battleground.Reset();\r\n battleground.QPRVSK = combatData; // m_currentreplay\r\n battleground.InitBattle();\r\n battleground.MYAZHR(combatData); // Set combat data\r\n battleground.StartBattle();\r\n\t\t\t\t\t\r\n return battleground;\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n startSimulation: function () {\r\n try {\r\n var app = qx.core.Init.getApplication();\r\n var player_cities = ClientLib.Data.MainData.GetInstance().get_Cities();\r\n var current_city = player_cities.get_CurrentCity();\r\n\t\t\t\t\t\r\n try {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.PlayArea.modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);\r\n\t\t\t\t\t\t} catch (e) {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);\r\n\t\t\t\t\t}\r\n //var battleground = this.setupBattleground();\r\n\t\t\t\t\t\r\n // Set the scene again, just in case it didn't work the first time\r\n try {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.PlayArea.modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);\r\n\t\t\t\t\t\t} catch (e) {\r\n app.getPlayArea().setView(webfrontend.gui.PlayArea.modes.EMode_CombatReplay, current_city.get_Id(), 0, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n this.battleResultsBox.close();\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n updateLayoutsList: function () {\r\n this.layoutsList.removeAll();\r\n // Load the saved layouts for this city\r\n var city_layouts = this.loadCityLayouts();\r\n if (city_layouts) {\r\n for (var i in city_layouts) {\r\n var layout = city_layouts[i];\r\n var item = new qx.ui.form.ListItem(layout.label, null, layout.id);\r\n this.layoutsList.add(item);\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t},\r\n deleteCityLayout: function () {\r\n try {\r\n var layouts = this.loadLayouts();\r\n var current_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_Id();\r\n var own_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentOwnCity().get_Id();\r\n var lid = this.layoutsList.getSelection()[0].getModel();\r\n if (layouts && typeof layouts[current_city] !== 'undefined' && typeof layouts[current_city][own_city] !== 'undefined' && typeof layouts[current_city][own_city][lid] !== 'undefined') {\r\n delete layouts[current_city][own_city][lid];\r\n this.saveLayouts(layouts);\r\n this.updateLayoutsList();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n loadCityLayout: function () {\r\n try {\r\n this.toggleTools();\r\n var city_layouts = this.loadCityLayouts();\r\n var lid = this.layoutsList.getSelection()[0].getModel();\r\n if (city_layouts && typeof city_layouts[lid] !== 'undefined') {\r\n // Load the selected city layout\r\n var saved_units = city_layouts[lid].layout;\r\n this.restoreFormation(saved_units);\r\n\t\t\t\t\t}\r\n this.toggleTools();\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n saveCityLayout: function () {\r\n try {\r\n // Save the current layout for this city\r\n var current_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_Id();\r\n var own_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentOwnCity().get_Id();\r\n var layouts = this.loadLayouts();\r\n this.saveFormation();\r\n var lid = new Date().getTime().toString();\r\n var title = this.layoutsLabelText.getValue();\r\n if (!title) return;\r\n\t\t\t\t\t\r\n title += \" (TS: \" + this.stats.health.overall.toFixed(2).toString() + \")\";\r\n var city_layouts = this.loadCityLayouts();\r\n if (!layouts.hasOwnProperty(current_city)) {\r\n layouts[current_city] = {};\r\n\t\t\t\t\t}\r\n if (!layouts[current_city].hasOwnProperty(own_city)) {\r\n layouts[current_city][own_city] = city_layouts;\r\n\t\t\t\t\t}\r\n layouts[current_city][own_city][lid] = {\r\n id: lid,\r\n label: title,\r\n layout: this.saved_units,\r\n\t\t\t\t\t};\r\n this.saveLayouts(layouts);\r\n this.updateLayoutsList();\r\n this.layoutsLabelText.setValue(\"\");\r\n\t\t\t\t\t} catch (e) {\r\n console.log(e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n loadLayouts: function () {\r\n var temp = localStorage.tasim_layouts;\r\n if (temp) return JSON.parse(temp);\r\n return {};\r\n\t\t\t},\r\n loadCityLayouts: function () {\r\n var temp = localStorage.tasim_layouts;\r\n if (temp) {\r\n var layouts = JSON.parse(temp);\r\n var current_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_Id();\r\n var own_city = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentOwnCity().get_Id();\r\n\t\t\t\t\t\r\n if (layouts.hasOwnProperty(current_city) && layouts[current_city].hasOwnProperty(own_city)) {\r\n return layouts[current_city][own_city];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n return {};\r\n\t\t\t},\r\n saveLayouts: function (layouts) {\r\n // TODO - Remove cities that are no longer existing\r\n localStorage.tasim_layouts = JSON.stringify(layouts);\r\n\t\t\t},\r\n restoreFormation: function (saved_units) {\r\n var sUnits = saved_units || this.saved_units;\r\n var units = this.getCityPreArmyUnits();\r\n var units_list = units.get_ArmyUnits().l;\r\n for (var idx = 0; idx < sUnits.length; idx++) {\r\n var saved_unit = sUnits[idx];\r\n var uid = saved_unit.id;\r\n for (var i = 0;\r\n (i < units_list.length); i++) {\r\n if (units_list[i].get_Id() === uid) {\r\n units_list[i].MoveBattleUnit(saved_unit.x, saved_unit.y);\r\n if (saved_unit.enabled === undefined) units_list[i].set_Enabled(true);\r\n else units_list[i].set_Enabled(saved_unit.enabled);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n units.CLEZCG(); // UpdateArmyLayout$0() has been renamed to CLEZCG()\r\n units.WRKUTR(); // RefreshData() has been renamed to WRKUTR()\r\n\t\t\t},\r\n saveFormation: function () {\r\n this.saved_units = [];\r\n for (var i = 0;\r\n (i < this.units.length); i++) {\r\n var unit = this.units[i];\r\n var armyUnit = {};\r\n armyUnit.x = unit.get_CoordX();\r\n armyUnit.y = unit.get_CoordY();\r\n armyUnit.id = unit.get_Id();\r\n armyUnit.enabled = unit.get_Enabled();\r\n this.saved_units.push(armyUnit);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "ee58d7a6bcbe2eecb56548a5d7f0ea59", "score": "0.49183738", "text": "function CMP8_TC013(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n\n//Validate Documentation of Pastoral Care Progress Notes\nexestatus = Features.MvDocumentPastoralCare(TestName,exestatus);\n \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "e9639a9b7ef7dc23f3c9dc89cf12aea8", "score": "0.49171546", "text": "function showTechspecEvents()\r\n{\r\n TechSpec.show(\"view\",\"techspecevents.do\");\r\n}", "title": "" }, { "docid": "1aecf2b9256c873725a366a8c83d3b62", "score": "0.4915079", "text": "function CMP8_TC007(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n\n//Validate Documentation of Clinical Event \nexestatus = Features.MvDocumentClinicalEventNew(TestName,exestatus);\nexestatus = Features.MvPlacePatient(TestName,exestatus);\n \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "bfadf5b8c31847fb120d993037ab73ec", "score": "0.4912462", "text": "function CMP10_TC018(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n//Validation of MedicationChartDiffData \n//exestatus = Features.MvMedicationChart(TestName,exestatus);\n\n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "76309819212273fc6d2c7b00d6d9f3a7", "score": "0.4906658", "text": "function DragPreviewTemplate() { }", "title": "" }, { "docid": "2832307d35d66d8823fde406def8a0fb", "score": "0.49048385", "text": "get ui() { return null; }", "title": "" }, { "docid": "cbda9f7c79e029b55ffc1876dc32f76d", "score": "0.48977482", "text": "en(t) {\n ke(!this.Ws.get(t).Fs, \"Should only reset active targets\"), this.Ws.set(t, new me), \n this.Qs.an(t).forEach(e => {\n this.Js(t, e, /*updatedDocument=*/ null);\n });\n }", "title": "" }, { "docid": "95a71ce67781fe3b20d9a07ff9897dca", "score": "0.489722", "text": "function explainDQRTE() {\r\n\tsimpleDialog(null,null,'explain_rte',550);\r\n}", "title": "" }, { "docid": "1048eaa1d7aea2301686ffeff3e21f35", "score": "0.48963183", "text": "function CMP8_TC019(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n\n//Validate Documentation of Resuscitation Plan \nexestatus = Features.MvDocumentResuscitation(TestName,exestatus);\n \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "6dcc90f37265595fdb1e7a07424fea55", "score": "0.48956177", "text": "function CMP8_TC018(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n\n//Validate Documentation of Research Progress Note\nexestatus = Features.MvDocumentResearchProgress(TestName,exestatus);\n \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.48941094", "text": "function setup() {\n\n}", "title": "" }, { "docid": "c52525124dec81097aa3d75cf42ca9f7", "score": "0.48939624", "text": "configure(R,Events){\n\t\tR.once('artefacts:ready',function(){\n\t\t\t\n\t\t\tR.bundles['templates-gen'].manifest.technologies['Extjs-4.2.0'].templates['designer']=require(path.join(__dirname,'Artefacts'))\n\t\t})\n\t}", "title": "" }, { "docid": "25c560ceca6b6f84f49dfeb8de4674b5", "score": "0.48908758", "text": "it(t) {\n this.G.set(t, new pn);\n this.W.getRemoteKeysForTarget(t).forEach((e => {\n this.tt(t, e, /*updatedDocument=*/ null);\n }));\n }", "title": "" }, { "docid": "19efb2adfdc92225f37689979763f985", "score": "0.48875076", "text": "function getTView() {\n return instructionState.lFrame.tView;\n}", "title": "" }, { "docid": "19efb2adfdc92225f37689979763f985", "score": "0.48875076", "text": "function getTView() {\n return instructionState.lFrame.tView;\n}", "title": "" }, { "docid": "19efb2adfdc92225f37689979763f985", "score": "0.48875076", "text": "function getTView() {\n return instructionState.lFrame.tView;\n}", "title": "" }, { "docid": "19efb2adfdc92225f37689979763f985", "score": "0.48875076", "text": "function getTView() {\n return instructionState.lFrame.tView;\n}", "title": "" }, { "docid": "19efb2adfdc92225f37689979763f985", "score": "0.48875076", "text": "function getTView() {\n return instructionState.lFrame.tView;\n}", "title": "" }, { "docid": "81ca7d6215c1c18a05ae9d367ad6a954", "score": "0.48837563", "text": "onRender() {}", "title": "" }, { "docid": "acf8ba1503bcc7b8d3c10f57d2cf02ba", "score": "0.48830065", "text": "function ex12_0() {\n\n}", "title": "" }, { "docid": "35fa04907bf2551d214be08349979915", "score": "0.4880993", "text": "render() {\n\n //Material-UI layout, label ja elementien asettaminen tasauksen mukaan\n\n let ui_kentta = (<div> <TextField style={{ backgroundColor: 'silver', fontSize: 26 }} > </TextField> </div>);\n\n let ui_nappi_a = (<Button> Teksti </Button>);\n\n\n //Materia-UI \"layout\" toimii \"table\" elementtien kanssa hyvin\n // return ( <div> <table> <tr> <td> { ui_kentta } </td> <td> {ui_nappi_a} </td> </tr> </table> </div> );\n\n\n // <ResponsiveCard style={{ maxWidth: 360 }}>\n // <CardHeader title=\"Layout testi\"></CardHeader> \n\n return (\n <div>\n\n <CardWrapper>\n <CardContent>\n {ui_kentta}\n </CardContent>\n\n <CardContent>\n {ui_nappi_a}\n </CardContent>\n </CardWrapper>\n\n <CardWrapper>\n <CardContent>\n {ui_kentta}\n </CardContent>\n\n <CardContent>\n {ui_nappi_a}\n </CardContent>\n </CardWrapper>\n\n </div>\n );\n\n }", "title": "" }, { "docid": "5367485727eee8127a419ed8335de972", "score": "0.48750398", "text": "initTL() {}", "title": "" }, { "docid": "da2e7181dd19c3a098ce8deb49e8dae4", "score": "0.48740834", "text": "function CMP7_TC007(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n//Enter Patient Demographics\nexestatus = Features.MvPatientDemographics(TestName,exestatus);\nexestatus = Features.MvWeightsandDimensions(TestName,exestatus);\n\n//Review Admission Summary\n//exestatus = Features.MvAdmissionSummary(TestName,exestatus);\n\n//Validate Insertion of Central Venous Catheter\nexestatus = Features.MvDocumentInsertionCVC(TestName,exestatus);\n \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "220b8bbd07551ef96e6bed2862072437", "score": "0.48697704", "text": "function dt(e,t){Object.keys(e).forEach(function(e){if(!Je(t,e))throw new Error(\"[tippy]: `\".concat(e,\"` is not a valid option\"))})}", "title": "" }, { "docid": "11b6abd73d2db2d3d33b7b3b66ce9a3a", "score": "0.48695686", "text": "function Ts(){}", "title": "" }, { "docid": "150c1a3a67432ba1d86056972e7776d3", "score": "0.48659647", "text": "function CMP3_TC027(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n//Enter Patient Demographics\n//exestatus = Features.MvPatientDemographics(TestName,exestatus);\n\n//Enter Document Insertion of Endotracheal Tube\nexestatus = Features.MvEndotrachealTube(TestName,exestatus);\n\n// \n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "d630e227023258ce38a61450aad6ac1e", "score": "0.48618838", "text": "function setup() {\n \n}", "title": "" }, { "docid": "9a11644cac2df92ff995dc05dbe9f4f5", "score": "0.4861152", "text": "function WwLsf9svtT_acggkuTIOTEA() {}", "title": "" }, { "docid": "cfbb5be4d71429583242b481a7a55678", "score": "0.485572", "text": "function CMP3_TC031(TestName)\n{\nvar exestatus = true;\n \n// add a comment\n//Login\nexestatus = Features.MvLogin(TestName,exestatus);\n\n//Enter Patient Register\nexestatus = Features.MvPatientRegister(TestName,exestatus);\n\n\n//Enter Mv Review medication timeline\nexestatus = Features.MvMedicationChart(TestName,exestatus);\n\n//Logout\nexestatus = Features.MvLogout(TestName,exestatus);\n \n}", "title": "" }, { "docid": "21e3f202f91b68c56898488e1259bce5", "score": "0.48479158", "text": "function SERPTools() {\n}", "title": "" } ]