query_id
stringlengths 32
32
| query
stringlengths 7
29.6k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
e172de7fa6738b1ea0b608cb740e65f2 | Follow accessibility specifications to remove visibility hidden style over the document | [
{
"docid": "4744a2ebc83ccaad0071bc1b54883f8c",
"score": "0.0",
"text": "function showDomElements() {\n headerWrapper.classList.remove('is-hidden')\n footerWrapper.classList.remove('is-hidden')\n heroWrapper.classList.remove(\"is-hidden\")\n hero.classList.remove('is-hidden')\n}",
"title": ""
}
] | [
{
"docid": "a1698f719bfefeb4778961963c9a11c4",
"score": "0.69204307",
"text": "function a11y_hide(element) {\n\t element.attr({\n\t role: 'presentation',\n\t 'aria-hidden': 'true'\n\t });\n\t }",
"title": ""
},
{
"docid": "264a1e0ef8107cb210612128f5327ea6",
"score": "0.68560076",
"text": "removeVisibleAttribute_() {\n this.mutateElement(() => {\n if (this.visibleAdPage_) {\n this.visibleAdPage_.toggleVisibility();\n this.visibleAdPage_ = null;\n }\n });\n }",
"title": ""
},
{
"docid": "8fb58ad4aa4e381ea2695e0c1b0b199a",
"score": "0.68236166",
"text": "_hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n for (let i = siblings.length - 1; i > -1; i--) {\n let sibling = siblings[i];\n if (sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')) {\n this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }",
"title": ""
},
{
"docid": "e2640b84763f057741d877c968ff782a",
"score": "0.6772825",
"text": "function hidetext() {\r\n dom = document.getElementById(\"receipt\").style; \r\n\r\n// Flip the visibility adjective to whatever it is not now \r\n\r\n if (dom.visibility == \"vissible\")\r\n dom.visibility = \"hidden\";\r\n else\r\n dom.visibility = \"visible\";\r\n}",
"title": ""
},
{
"docid": "7a9b2e8ea5bb44d40150adb01f14d776",
"score": "0.67680264",
"text": "function hideNonExportableElements() {\n\t\t\td3.selectAll(\".hidden-in-export\").style(\"display\", \"none\");\n\t\t}",
"title": ""
},
{
"docid": "181a41e1ec929a0a0fcced55a188b109",
"score": "0.67637783",
"text": "function hideNonExportableElements() {\n\t\td3.selectAll(\".hidden-in-export\").style(\"display\", \"none\");\n\t}",
"title": ""
},
{
"docid": "cee043c17f5cfe3dd94467ac44849ee2",
"score": "0.6683005",
"text": "function unHide(){if (document.body) document.body.style.visibility = \"visible\"}",
"title": ""
},
{
"docid": "6fa99e33b28e7bbb0bef7c902c5875ef",
"score": "0.6680442",
"text": "hide(element) {\n element.attr('visibility', 'hidden');\n }",
"title": ""
},
{
"docid": "248a6da618849146ed64c74314266eb9",
"score": "0.6663748",
"text": "hide() {\r\n this.node.node.setAttribute(\"visibility\", \"hidden\");\r\n this.isVisible = false;\r\n }",
"title": ""
},
{
"docid": "0fd4e4db0c4380bac7d510da453eeae7",
"score": "0.6598627",
"text": "function unhideVisibility(element) {\n element.style.visibility = null;\n element.style.display = null;\n}",
"title": ""
},
{
"docid": "9630aa6950253c0a8e3c5399e1d88cd9",
"score": "0.658236",
"text": "function hidejsaccessiblehideObject() {\n\tvar jsaccessiblehidevar = getElementsByClass(\"jsaccessiblehide\");\n\t\t\n\tfor ( j=0;j<jsaccessiblehidevar.length;j++ ) {\n\t\tjsaccessiblehidevar[j].style.position = 'absolute';\n\t\tjsaccessiblehidevar[j].style.left = '-5000px';\n\t}\n}",
"title": ""
},
{
"docid": "eef72d42726fb9ca59b80de4fbb23d4c",
"score": "0.6551443",
"text": "hide() {\n\t\tthis.element.style.visibility = 'hidden';\n\t}",
"title": ""
},
{
"docid": "c4c29854eb749038b3bd7f5ab7ec94b7",
"score": "0.6535171",
"text": "showToScreenReader() {\n this.adapter_.removeAttr(strings$19.ARIA_HIDDEN);\n }",
"title": ""
},
{
"docid": "0425085664905678756574a791cf1510",
"score": "0.65199137",
"text": "showToScreenReader() {\n this.adapter_.removeAttr(strings.ARIA_HIDDEN);\n }",
"title": ""
},
{
"docid": "05ef3035c4bf2956aae0a180835f2c82",
"score": "0.6476066",
"text": "function unHide() {\n\t// Remove the hidden tag attribute from the title and task input\n\ttitleInput.removeAttribute(\"hidden\");\n\tnewTaskInput.removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the tell me what to do button\n\ttellMeButton.removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the todoTasks\n\tdocument.getElementById(\"toDoTasks\").removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the completedTasks\n\tdocument.getElementById(\"completedTasks\").removeAttribute(\"hidden\");\n\n\t// Remove the hidden attribute from the button that deletes the current list\n\tdocument.getElementById(\"deleteList\").removeAttribute(\"hidden\");\n}",
"title": ""
},
{
"docid": "56a9e4d944bd1435cb02e2349302ecae",
"score": "0.6445951",
"text": "showToScreenReader() {\n this.adapter_.removeAttr(_constants.strings.ARIA_HIDDEN);\n }",
"title": ""
},
{
"docid": "9b63ef00bffcb240abf8d556e8fc83e9",
"score": "0.6434157",
"text": "function removeHiddenStyle (a) {\n a.style.removeProperty('text-decoration');\n a.style.removeProperty('color');\n }",
"title": ""
},
{
"docid": "a6739dfcce274df490e22f613f69e915",
"score": "0.64255124",
"text": "function accessibilityKlik() {\r\n let style = document.getElementById(\"accessibility-style\");\r\n style.disabled = !style.disabled;\r\n}",
"title": ""
},
{
"docid": "40784b95c1a809282c4802fd5192760c",
"score": "0.6413803",
"text": "setVisibility() {\n errors.throwNotImplemented(\"setting visibility (dequeue options)\");\n }",
"title": ""
},
{
"docid": "f647fd156cf4b15c38abb59db5d369a3",
"score": "0.64051634",
"text": "doHidden( element ) {\n element.style.display = 'none';\n }",
"title": ""
},
{
"docid": "d844d6bce720539375cffb4fb280c07e",
"score": "0.6381007",
"text": "function hideHelper(event, element) {\n element.removeAttribute(\"visible\");\n element.style.visibility = \"hidden\";\n }",
"title": ""
},
{
"docid": "56bd951513b1ebecda25365a59be420b",
"score": "0.63792557",
"text": "function invisible(element){\n\tdocument.getElementById(element).style.visibility = \"hidden\";\n}",
"title": ""
},
{
"docid": "963b9745f810e0c16c6d764f81455709",
"score": "0.6371808",
"text": "_visuallyHide(element){\n $(element).css({'opacity':'0', 'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'z-index':'-1' });\n }",
"title": ""
},
{
"docid": "9dee943446be5189bb441165868d5f29",
"score": "0.633247",
"text": "function hide(element) {\n element.style.visibility = \"hidden\";\n}",
"title": ""
},
{
"docid": "730f0906962a5aa79ce7c6fdbf0427a5",
"score": "0.632878",
"text": "function removeAllFocusVisibleAttributes() {\n var list = document.querySelectorAll(\"[\" + focusVisibleAttributeName + \"]\");\n\n for (var i = 0; i < list.length; i += 1) {\n removeFocusVisibleAttribute(list[i]);\n }\n }",
"title": ""
},
{
"docid": "730f0906962a5aa79ce7c6fdbf0427a5",
"score": "0.632878",
"text": "function removeAllFocusVisibleAttributes() {\n var list = document.querySelectorAll(\"[\" + focusVisibleAttributeName + \"]\");\n\n for (var i = 0; i < list.length; i += 1) {\n removeFocusVisibleAttribute(list[i]);\n }\n }",
"title": ""
},
{
"docid": "b5c430453e5ac049a4cb24635c94bafd",
"score": "0.6314115",
"text": "hide () {\n this.visible = false\n Doc.hide(this.canvas)\n }",
"title": ""
},
{
"docid": "b73f8fbf7cb49b0dea1f78b4adc60c51",
"score": "0.6306089",
"text": "function toggleAriaHidden() {\n\tvar button = document.getElementById('activation-button');\n\tvar dialog = document.getElementById('alert-dialog');\n\tvar allChildNodes = document.getElementById(\"main\").getElementsByTagName('*');\n\t\t\t\t\n\tif (dialog.style.display != 'none'){\n\t\tbutton.setAttribute(\"aria-hidden\", \"true\");\n\t\tdialog.setAttribute(\"aria-hidden\", \"false\");\n\t\tfor(var i = 0; i < allChildNodes.length; i++){ // Removes all elements in the div with the id main from the tab index\n\t\t\tallChildNodes[i].setAttribute(\"tabindex\", \"-1\");\n\t\t}\n\t}\n\telse {\n\t\tbutton.setAttribute(\"aria-hidden\", \"false\");\n\t\tdialog.setAttribute(\"aria-hidden\", \"true\");\n\t}\n}",
"title": ""
},
{
"docid": "b0b1267848e665abd31789b83a673296",
"score": "0.6298226",
"text": "static hideDocShim() {\n\t\tDragShim.getDocShim().style.display = 'none';\n\t}",
"title": ""
},
{
"docid": "48aa33e0f2eabedf3c9fa80c404a291f",
"score": "0.62347025",
"text": "function hide_important_elements(){\n\tdocument.getElementById('segment_middle_part').style.display\t= \"none\";\n\tdocument.getElementById('groupe_add_container').style.display\t= \"none\";\n\tdocument.getElementById('segment_send_part').style.display\t= \"none\";\n}",
"title": ""
},
{
"docid": "2ec93cf142e5ba8c5d35b82a904621ea",
"score": "0.62271106",
"text": "hide() {}",
"title": ""
},
{
"docid": "30de3ff42a84a9540d2c06653707ab57",
"score": "0.62148535",
"text": "function handleRemoveAccessibility() {\n $('#removeAccessibility').hide();\n theInterface.emit('ui:removeAccessibility');\n }",
"title": ""
},
{
"docid": "7beaa2f9820bf12d55e9f36b4431e04d",
"score": "0.6200739",
"text": "hide_() {\n this.adapter_.setAttr(strings$19.ARIA_HIDDEN, 'true');\n }",
"title": ""
},
{
"docid": "ae7f76ebb1f0c0f9ade1b2ba17494bb3",
"score": "0.61858714",
"text": "function displayNone(element){\n element.setAttribute(\"style\", \"display: none\");\n}",
"title": ""
},
{
"docid": "8fdbe177248f03c16361dcef42be96fe",
"score": "0.6176983",
"text": "hide_() {\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\n }",
"title": ""
},
{
"docid": "14f9729e11832596ad542726503c9c90",
"score": "0.61589974",
"text": "hide() {\n let wasVisible = this.visible;\n this.visible = false;\n if (this.element) this.element.style.display = 'none';\n if (wasVisible) this.emitter.emit('did-change-visible', this.visible);\n }",
"title": ""
},
{
"docid": "da90d8e16aba00717763df3d2ad4ca2e",
"score": "0.6152382",
"text": "function hideInterfaceElements()\n{\n controls.hide();\n caption.hide();\n}",
"title": ""
},
{
"docid": "c107d5757a6dd67a2b7f2f6519e0b1ee",
"score": "0.6132244",
"text": "function testDeveloperElementsAreHidden(item) {\n testElementsVisibility(item, devElements, false);\n }",
"title": ""
},
{
"docid": "9fe8dcca7c29c945d4b549c7126b1126",
"score": "0.61278355",
"text": "hide() {\n gsap.to(this.DOM.el, {duration: 0.8, opacity: 0});\n }",
"title": ""
},
{
"docid": "9ce4e17a5fc3ec11d59b8867de97ff9b",
"score": "0.61262",
"text": "function changeVisibility() {\n if (document.layers || document.all || document.getElementById) {\n var inc, endInc = arguments.length;\n // run through the args (objects) and set the visibility of each\n for (inc=0; inc<endInc; inc+=2) {\n // get a good object reference\n var daObj = getStyleRef(arguments[inc]);\n var action = arguments[inc+1];\n if (action == hidden) {\n // hide the object\n daObj.visibility = hidden;\n } else if (action == visible) {\n // show the object\n daObj.visibility = visible;\n } else if (action == toggle) {\n // toggle the object's visibility\n if (daObj.visibility == visible) {\n daObj.visibility = hidden;\n } else if (daObj.visibility == hidden) {\n daObj.visibility = visible;\n } else {\n //assume (visibility == hidden) implicitly (IE bug?)\n daObj.visibility = visible;\n }\n }\n }\n }\n}",
"title": ""
},
{
"docid": "95c228f942ea77a9e0e78da5cde79768",
"score": "0.611381",
"text": "function removeInitialHideStylesheet() {\n if(typeof initialHideElt == \"undefined\" || !initialHideElt) return;\n var elts = document.querySelectorAll(\"style[__adthwart__='InitialHide']\");\n for(var i=0; i<elts.length; i++) elts[i].innerText = \"\";\n}",
"title": ""
},
{
"docid": "9db67f7ef5b258b235a8b4ffb8aa6e0f",
"score": "0.61096495",
"text": "hide_() {\n this.adapter_.setAttr(_constants.strings.ARIA_HIDDEN, 'true');\n }",
"title": ""
},
{
"docid": "f6f66b16e2360c3628898a727a3769d7",
"score": "0.6104847",
"text": "hide()\n {\n this.isVisible = false;\n }",
"title": ""
},
{
"docid": "c137ab9e97727b830f198435eccaec70",
"score": "0.6093098",
"text": "hide() {\n this.element.classList.add(\"invisible\");\n return this;\n }",
"title": ""
},
{
"docid": "ed59e6e95f8046e174cef52c46841af3",
"score": "0.60879016",
"text": "function hideInformationModal() {\n RemoveHiddenAccess[0].style['display'] = 'none';\n RemoveHiddenAccess[1].style['display'] = 'none';\n}",
"title": ""
},
{
"docid": "74d635cb5ba8040b3dd7c29d8ecd0cd9",
"score": "0.6087257",
"text": "function makeInvisible(element) {\n\telement.className = \"invisible\";\n}",
"title": ""
},
{
"docid": "35465b518a7deb021362e676d55aed46",
"score": "0.6072652",
"text": "function hideBody() {\n let head = document.getElementsByTagName(\"head\")[0];\n let style = document.createElement(\"style\");\n let css = \"body{visibility:hidden;}\";\n\n style.id = STOP_BLINK_CSS_ID;\n style.setAttribute(\"type\", \"text/css\");\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n head.appendChild(style);\n }",
"title": ""
},
{
"docid": "f5b1e8d09dac8c150fcaaee7179c9d48",
"score": "0.6050754",
"text": "function hideVisibility(element) {\n\n if ((typeof element !== 'undefined')) {\n element.style.visibility = 'hidden';\n element.style.display = 'none';\n\n }\n\n}",
"title": ""
},
{
"docid": "4339eed56b3547da1433a44668e56a24",
"score": "0.6049656",
"text": "function hideMoodSelection()\n{\n document.getElementById(\"mood-panorama-page\").style.visibility = \"hidden\";\n}",
"title": ""
},
{
"docid": "93531e10f7d2446bce5b157af1a627c6",
"score": "0.60453284",
"text": "_onVisibilityChange() {\n if (this.document.visibilityState === VISIBLE) {\n this._sendEvent();\n\n this.document.removeEventListener(VISIBILITY_CHANGE_EVENT, this._onVisibilityChange);\n }\n }",
"title": ""
},
{
"docid": "40a4108af7166889d2c7d37c9912dcc0",
"score": "0.60449046",
"text": "function removeFocusVisibleAttribute(el) {\n el.removeAttribute(focusVisibleAttributeName);\n }",
"title": ""
},
{
"docid": "40a4108af7166889d2c7d37c9912dcc0",
"score": "0.60449046",
"text": "function removeFocusVisibleAttribute(el) {\n el.removeAttribute(focusVisibleAttributeName);\n }",
"title": ""
},
{
"docid": "8da01f675fa3db4ab620781839b9ae90",
"score": "0.6034259",
"text": "hide () {\n this.visible = false;\n }",
"title": ""
},
{
"docid": "2254a01efee04aa8a3e464607aad5798",
"score": "0.6030061",
"text": "function cssStyleSetVisibility(visibility) { \n this.styleObj.visibility = visibility; \n}",
"title": ""
},
{
"docid": "69e93ebae582dafcf9f6114360cedaf3",
"score": "0.6025703",
"text": "hide()\n\t{\n\t\tthis.container.style.display = \"none\";\n\t\tthis.visibility = false;\n\t}",
"title": ""
},
{
"docid": "c399c0c184eb81fab258df240b7c9bec",
"score": "0.601928",
"text": "function hideDescription(n) {\n let descriptions = document.getElementsByTagName('h3');\n descriptions[n].style.visibility = 'hidden';\n}",
"title": ""
},
{
"docid": "078d4ec39c21293861a7daf3fe974739",
"score": "0.6016302",
"text": "get Hidden() {}",
"title": ""
},
{
"docid": "7b255ebe1484ac94e33a532a443ae697",
"score": "0.6003667",
"text": "_hide(self) {\n if (self.visible) {\n if (self.sticky && self.stuck) { return; }\n try { self._c_.removeChild(self._t_); }\n catch (e) {}\n self.visible = false;\n }\n }",
"title": ""
},
{
"docid": "e671b59ae4a67b9e824c06c15d6f0aef",
"score": "0.59908885",
"text": "function setDisplay(elementName, visible) {\r\n document.getElementById(elementName).style.display = (visible ? 'unset' : 'none');\r\n}",
"title": ""
},
{
"docid": "04dc3fd62e390f9a193f332c64ef4edd",
"score": "0.5989972",
"text": "function unhideElement(element) {\n element.classList.remove(\"hidden\");\n}",
"title": ""
},
{
"docid": "ff4d092f4133d1594a90ea10524e78af",
"score": "0.5986704",
"text": "hide() {\n this.backButtonOpen_ = false;\n chrome.accessibilityPrivate.setSwitchAccessMenuState(\n false, SAConstants.EMPTY_LOCATION, 0);\n this.menuPanel_.setFocusRing(SAConstants.BACK_ID, false);\n }",
"title": ""
},
{
"docid": "f857abaee99354b2b3aa015a11d0ce95",
"score": "0.59837127",
"text": "hide() {\n this._elementRef.nativeElement.style.visibility = 'hidden';\n }",
"title": ""
},
{
"docid": "f857abaee99354b2b3aa015a11d0ce95",
"score": "0.59837127",
"text": "hide() {\n this._elementRef.nativeElement.style.visibility = 'hidden';\n }",
"title": ""
},
{
"docid": "0f4608be50a64875326151e7f24e3409",
"score": "0.5977392",
"text": "function hideSearchModal() {\n RemoveHiddenAccess[4].style['display'] = 'none';\n RemoveHiddenAccess[5].style['display'] = 'none';\n}",
"title": ""
},
{
"docid": "e68559fda4ab4a1ba37fa6315fcff565",
"score": "0.5974235",
"text": "function hideContextButtons(){\n \t\tvar st=mstrmojo.all.CtxMnuBtn.domNode.style;\n \t\tif(st.visibility==='visible') { st.top='0px';st.visibility='hidden';}\n }",
"title": ""
},
{
"docid": "2bcc9482b9572311e0c693ea702f45ed",
"score": "0.5973189",
"text": "function isPageHidden(){return _doc.hidden||_doc.msHidden||_doc.webkitHidden||_doc.mozHidden;}",
"title": ""
},
{
"docid": "2fceea4441a24a235cc27734ecbb0ab2",
"score": "0.59722674",
"text": "function hideShareOptions()\r\n{\r\n\tshowWindowShade('shareOptionsWindowShade','none');\r\n\tif (getEl('shareOnBlog'))\r\n\t\tgetEl('shareOnBlog').style.visibility = 'hidden';\r\n\tif (getEl('shareOnMySpace'))\t\r\n\t\tgetEl('shareOnMySpace').style.visibility = 'hidden';\r\n\thideFocus();\r\n}",
"title": ""
},
{
"docid": "a2a31bfbe87c49a58662f2ca02b52ed1",
"score": "0.5968787",
"text": "function unHideUser() {\n\tlet cards = [...document.querySelectorAll('.hidden')];\n\tcards.forEach((card) => {\n\t\tcard.classList.remove('hidden');\n\t});\n}",
"title": ""
},
{
"docid": "4452f726827ce320cfa3876d4b04aaf8",
"score": "0.5968351",
"text": "function unhide()\r\n{\r\n if (document.querySelector('.pumpkin').style.visibility == \"visible\")\r\n {\r\n document.querySelector('.pumpkin').style.visibility = \"hidden\";\r\n }\r\n else\r\n {\r\ndocument.querySelector('.pumpkin').style.visibility = \"visible\";\r\n }\r\n}",
"title": ""
},
{
"docid": "48e93e2dba24fc57bec61199cc7d4203",
"score": "0.5963825",
"text": "hide() { document.getElementById(this.obj).style.visibility = \"hidden\"; }",
"title": ""
},
{
"docid": "0ced895102354068359b797d170fa93e",
"score": "0.59600985",
"text": "beforeDOMHide() {\n\t\tdebug('Layer.beforeDOMHide: ' + this.getCSSClassName());\n\n\t\tthis._widgets.forEach((widget) => {\n\t\t\tif (widget.isVisible()) {\n\t\t\t\twidget.beforeDOMHide();\n\t\t\t}\n\t\t});\n\t}",
"title": ""
},
{
"docid": "efa608afd82b56724f9797685eebbf15",
"score": "0.5959453",
"text": "function hide(ninja) {\n ninja.visibility = false;\n}",
"title": ""
},
{
"docid": "efa608afd82b56724f9797685eebbf15",
"score": "0.5959453",
"text": "function hide(ninja) {\n ninja.visibility = false;\n}",
"title": ""
},
{
"docid": "9247104703800159aaf084d84502497b",
"score": "0.5951559",
"text": "function setVisible(elem) {\n elem.removeClass('invisible');\n}",
"title": ""
},
{
"docid": "f723c2fb88adf6c66d10b924a3990081",
"score": "0.59497535",
"text": "hide() {\n this.visible = false;\n }",
"title": ""
},
{
"docid": "7f7b4b1148735b2894be2f79020a2436",
"score": "0.59486806",
"text": "hide() {\n\t\tthis.element.classList.remove('display-block');\n\t}",
"title": ""
},
{
"docid": "a729ac1d0a12c6e43bc3aa48e8a8d186",
"score": "0.59474653",
"text": "function hideLinks() {\n\tvar display = Styles.NONE;\n\n\ttry {\n\t\thideElements(mainForm.messagesLabel, mainForm.copyURLLink, mainForm.openFolderLink, \n\t\t\tmainForm.openHostLink, mainForm.openURLLink, mainForm.openRURLLink, mainForm.uploadLink, \n\t\t\tmainForm.exportErrorsIcon, mainForm.diffLink, mainForm.verifyDiffIcon);\n\n\t}\n\tcatch(error) {\n\t\tlog(error)\n\t}\n}",
"title": ""
},
{
"docid": "e72cf66d2cd5839a160c28c99788f31a",
"score": "0.59445935",
"text": "function eraseAccessibilityFeatures() {\n\t\t\tvar layer = this.theMap.getLayersByName(this.ACCESSIBILITY)[0];\n\t\t\tlayer.removeAllFeatures();\n\t\t}",
"title": ""
},
{
"docid": "c8c9c363e15a80653fa5b4f030d21986",
"score": "0.5933271",
"text": "function hideElements(collctElem){\n for(item of collctElem){\n item.style.setProperty('visibility','hidden');\n }\n}",
"title": ""
},
{
"docid": "1c126580aa9f7693d0009fd4c54c17db",
"score": "0.5933092",
"text": "function handleVisibilityChange() {\n if (document[hidden]) {\n //console.log('hidden');\n StopDecoding();\n } else {\n //console.log('shown');\n DecodeBar();\n }\n }",
"title": ""
},
{
"docid": "7fab469c478bb6e82342074f68320860",
"score": "0.5928456",
"text": "function useAriaHidden(ref, shouldHide) {\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n if (!ref.current) return undefined;\n var undo = null;\n\n if (shouldHide && ref.current) {\n undo = (0,aria_hidden__WEBPACK_IMPORTED_MODULE_0__.hideOthers)(ref.current);\n }\n\n return () => {\n if (shouldHide) {\n undo == null ? void 0 : undo();\n }\n };\n }, [shouldHide, ref]);\n}",
"title": ""
},
{
"docid": "a756e4aa7fc1f9ffb2be91996a29c04e",
"score": "0.5915198",
"text": "function hideElements(elementArray) {\n for (var x in elementArray) {\n elementArray[x].setAttribute(\"style\", \"visibility:hidden\");\n }; \n}",
"title": ""
},
{
"docid": "cabd2e10face3ba5a77706d3db4ff247",
"score": "0.59097356",
"text": "function visHack(a){\n return !isVisible(a)\n}",
"title": ""
},
{
"docid": "1ac4269051875fbfaa5fcf4e8f1ac239",
"score": "0.5897603",
"text": "function update_widget_visibility(elt, purpose, allowed_types) {\n const valid_types = allowed_types[purpose] || [];\n if (valid_types.length > 1) {\n elt.removeAttribute('hidden'); // make visible\n } else {\n elt.setAttribute('hidden', 'hidden'); // make invisible\n }\n }",
"title": ""
},
{
"docid": "40b420f43de3933d1a2d7c3e865c2d42",
"score": "0.5895541",
"text": "function testNormalElementsAreHidden(item) {\n testElementsVisibility(item, normalElements, false);\n }",
"title": ""
},
{
"docid": "f1cbb61be9764294a91be7cf2e49cbf8",
"score": "0.58949155",
"text": "set HiddenByDefault(value) {}",
"title": ""
},
{
"docid": "bcb2a2a5d3b4d5e464e726d528673c72",
"score": "0.5890006",
"text": "unhide() {\n this.nh.style.opacity = '1';\n }",
"title": ""
},
{
"docid": "6c23fa54f12d95ca6af5f85006aadfa6",
"score": "0.58788544",
"text": "hide() {\n this.visible = false;\n this.view.classList.add(\"hidden\");\n }",
"title": ""
},
{
"docid": "2727e003dee28cbb67653170cc0e3061",
"score": "0.58652395",
"text": "hide() {\n const { element: n, open: s, menu: o, parentElement: a } = this;\n s && ([Nt, us].forEach((r) => {\n r.relatedTarget = n;\n }), e.dispatchEvent(a, Nt), !Nt.defaultPrevented && (e.removeClass(o, b), e.removeClass(a, b), e.setAttribute(n, e.ariaExpanded, \"false\"), this.open = !s, ms(this), e.dispatchEvent(a, us)));\n }",
"title": ""
},
{
"docid": "a1c1d5af0ef488cf2c85f83d249ea884",
"score": "0.5865001",
"text": "hideROIs () {\n console.info('hide ROIs')\n this[_drawingLayer].setVisible(false)\n this[_annotationManager].setVisible(false)\n }",
"title": ""
},
{
"docid": "d47e3cd37cff2de964ec6a0c72de1de0",
"score": "0.58615655",
"text": "function setVisibility (id, visibility) {\n if (document.layers)\n document[id].visibility = visibility == 'visible' ? 'show' : 'hidden';\n else if (document.all)\n document.all[id].style.visibility = visibility;\n else if (document.getElementById)\n document.getElementById(id).style.visibility = visibility;\n}",
"title": ""
},
{
"docid": "ba1cb159181f51379cc23a4cd7bde7b6",
"score": "0.58594054",
"text": "function useAriaHidden(ref, shouldHide) {\n (0, _react.useEffect)(() => {\n if (!ref.current) return;\n var undo = null;\n\n if (shouldHide && ref.current) {\n undo = (0, _ariaHidden.hideOthers)(ref.current);\n }\n\n return () => {\n if (shouldHide) {\n undo == null ? void 0 : undo();\n }\n };\n }, [shouldHide, ref]);\n}",
"title": ""
},
{
"docid": "2f3f6342f67b53a3b85db51a22443b61",
"score": "0.5857337",
"text": "function hide(id)\r\n{\r\n\tif(isNS4)\r\n\t{\r\n\t\tdocument.layers[id].visibility = \"hide\";\r\n\t}\r\n\r\n\tif((isNS || isIE || isOpera) && !isNS4)\r\n\t{\r\n\t\t// Very poorly done, however works...need to glamorize this later\r\n\t\tvar currentElement = document.getElementById(id);\r\n\t\tif(currentElement != null) currentElement.style.visibility = \"hidden\";\r\n\t}\r\n}",
"title": ""
},
{
"docid": "d01d6c965ca7c20b7dcd7eb5b135dbde",
"score": "0.5855783",
"text": "function hideElements() {\n if (scrollTop < scrollTransitionThreshold) {\n $(\"nav\").addClass(\"hidden\");\n $(\"#progressbar\").addClass(\"shrunk\");\n $(\"#chapters\").addClass(\"shrunk\");\n $(\"#playPauseButtons\").addClass(\"hidden\");\n $(\"#video-title\").addClass(\"hidden\");\n $(\"#helpmesee\").addClass(\"hidden\");\n $(\"#time\").addClass(\"hidden\");\n }\n }",
"title": ""
},
{
"docid": "01de3fabcd19df3a036c9537b7218ebe",
"score": "0.5851154",
"text": "function toggleVisibilityDOMEl(DOMEl, {show}) {\n const classMethod = show ? 'remove' : 'add'\n DOMEl.classList[classMethod]('is-hidden')\n }",
"title": ""
},
{
"docid": "5e291f6e00bfe915871f84e4fc9836be",
"score": "0.58455914",
"text": "function withoutHiddenClass() {\n\n}",
"title": ""
},
{
"docid": "281539fe9a0224b37992a52c318a30d8",
"score": "0.58444476",
"text": "changeVisibility(privacy) {\n commonActions.waitVisibility(this.changeVisibilityButton);\n commonActions.click(this.changeVisibilityButton);\n const privacyLocator = `//span[@class=\"icon-sm icon-${privacy}\"]/parent::a`;\n commonActions.click(privacyLocator);\n }",
"title": ""
},
{
"docid": "067d6c11659b0ca1d0528f737f5b81a9",
"score": "0.5839",
"text": "function unhide_links() {\n links.each(link => link.user_hidden = false)\n .classed(\"hidden\", link => link.hidden || link.user_hidden)\n }",
"title": ""
},
{
"docid": "403f5e253ce7ebe219167bdd5e755a27",
"score": "0.58380014",
"text": "hideVisit() {\n\t\tthis.modalContainer.classList.remove(\"visible\");\n\t}",
"title": ""
},
{
"docid": "fe966f250d8811e4813848ffe388f4bb",
"score": "0.5837128",
"text": "function hide() {\r$(\"#Avanti\").style.visibility = \"hidden\";\r}",
"title": ""
},
{
"docid": "7b54e1b990dbc27c64bd007458c272e3",
"score": "0.5830994",
"text": "function setInvisible(elem) {\n elem.addClass('invisible');\n}",
"title": ""
}
] |
9657fc31455332209b6119da92b6471c | Main methods/////////////////////////////////////////////////////////////////// gets file from aws storage s3 | [
{
"docid": "f79a9b4b01fbf7d2eb3150b618f7672a",
"score": "0.0",
"text": "async function getJSON(fileName) {\r\n try {\r\n let http_promise = getPromise(fileName);\r\n let response_body = await http_promise;\r\n\r\n // holds response from server that is passed when Promise is resolved\r\n //console.log(\"returned\", response_body);\r\n\r\n return JSON.parse(response_body); //returns a json variable we can parse through\r\n }\r\n catch (error) {\r\n // Promise rejected\r\n console.log(error);\r\n }\r\n}",
"title": ""
}
] | [
{
"docid": "630760d43fe5ac2193d47f9569e08481",
"score": "0.7343171",
"text": "function getFile(filekey){\n const downloadParams = {\n Key: filekey,\n Bucket:bucketName\n }\n\n return s3.getObject(downloadParams).createReadStream()\n}",
"title": ""
},
{
"docid": "94ec63d7f89b406852f400d683afe860",
"score": "0.73026764",
"text": "async function getFileStream(fileKey) {\n try {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName\n }\n return s3.getObject(downloadParams).createReadStream()\n } catch (error) {\n console.log(error);\n }\n}",
"title": ""
},
{
"docid": "9e5170bf6101968f67c0040c90cdfe6f",
"score": "0.72028667",
"text": "getFileData(filename) {\n const params = { Key: this._bucketPrefix + filename };\n return this.createBucket().then(() => new Promise((resolve, reject) => {\n this._s3Client.getObject(params, (err, data) => {\n if (err !== null) {\n return reject(err);\n }\n // Something happened here...\n if (data && !data.Body) {\n return reject(data);\n }\n return resolve(data.Body);\n });\n }));\n }",
"title": ""
},
{
"docid": "03f7a94403946e6310d5e8ffbaf05da2",
"score": "0.7139476",
"text": "getFile(folder, key) {\r\n var params = { Bucket: folder, Key: key };\r\n this.instance.getObject(\"getObject\", params, function (err, data) {\r\n if (err) {\r\n console.log(err);\r\n reject(err);\r\n } else {\r\n console.log(url);\r\n resolve(data);\r\n }\r\n });\r\n }",
"title": ""
},
{
"docid": "8518c447570bddf96afff4cdcd975ada",
"score": "0.70860094",
"text": "async function getSource(state)\n{\n try\n {\n var params = {\n Bucket: state.inputBucket,\n Key: state.inputKey\n };\n\n console.log('[INFO] Fetching: %j', params);\n\n const response = await s3.getObject(params).promise();\n const fileContent = response.Body.toString('utf-8');\n return JSON.parse(fileContent);\n }\n catch (error)\n {\n console.log('[ERROR] failed to download source CTR from S3', error);\n throw error;\n }\n}",
"title": ""
},
{
"docid": "784f22f11d9361f60089a0e3eefc302d",
"score": "0.7053993",
"text": "_downloadS3File(key, writeStream) {\n return this.storage.downloadObjectFromS3(key, writeStream);\n }",
"title": ""
},
{
"docid": "8650b3e6d96f2008b52e6ef778a8183d",
"score": "0.6876989",
"text": "function getFile(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName,\n };\n return s3.getObject(downloadParams).createReadStream();\n}",
"title": ""
},
{
"docid": "600a3ac984c9c0e564b98dc345dd8139",
"score": "0.68033737",
"text": "function download(s3,bucket,eventId,fileData,response)\n{\n console.log('Downloading file: '+fileData.id);\n var path = eventId + \"/\" + fileData.id;\n var file = {Bucket: bucket, Key: path};\n\n console.dir(file);\n\n s3.client.getObject(file,function(err, data) {\n\n if (err)\n {\n console.log(err);\n restResponse.returnRESTResponse(\n response,\n true,\n \"Could not download picture from AWS\",\n null);\n }\n else\n {\n fileData.file = data;\n\n console.log(fileData);\n restResponse.returnRESTResponse(\n response,\n false,\n \"\",\n data);\n }\n });\n\n}// END function download",
"title": ""
},
{
"docid": "2788ee80a38f2ddea4c6948163df6b68",
"score": "0.6792962",
"text": "getFileUrl(folder, key) {\r\n return new Promise((resolve, reject) => {\r\n var params = { Bucket: folder, Key: key };\r\n this.instance.getSignedUrl(\"getObject\", params, function (err, url) {\r\n if (err) {\r\n console.log(err);\r\n reject(err);\r\n } else {\r\n console.log(url);\r\n resolve(url);\r\n }\r\n });\r\n });\r\n }",
"title": ""
},
{
"docid": "0c2c94b7efbf3704099b4b28ef0687ee",
"score": "0.66989124",
"text": "function getS3FileStream(key){\n return new Promise((resolve, reject) => {\n const params = {Bucket: config.aws.s3_bucket, Key: key};\n\n s3.getObject(params, function(err, data){\n if(err){\n reject(err);\n }else{\n if(data && data.Body)\n resolve(data.Body);\n else\n resolve(null);\n }\n });\n });\n}",
"title": ""
},
{
"docid": "421952fff484e1ba0cbdf838fda26e6d",
"score": "0.6668258",
"text": "function S3Helper() {\n\t// constructor\n\t// load the S3 credentials\n\tAWS.config.loadFromPath('awsCredentials.json');\n\tAWS.config.update({region: 'us-east-1'});\n\tvar s3 = new AWS.S3();\n\tvar bucket = 'zeitgeistmedia';\t// default bucket\n\tthis.getFile = function (fileKey, toFilePath, callback) {\n\t\tvar data = {Bucket: bucket, Key: fileKey};\n\t\ts3.client.getObject(data, function(err, data) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('Error downloading data: ', err);\n\t\t\t} else {\n\t\t\t\tconsole.log('Successfully downloaded data file: ' + fileKey);\n\t\t\t\t\t\t\n\t\t\t\t// now save the data\n\t\t\t\tvar buff = new Buffer(data.Body, 'binary');\n\t\t\t\tvar fd = fs.openSync(toFilePath + fileKey, 'w');\n\t\t\t\tfs.writeSync(fd, buff, 0, buff.length,0);\n\n\t\t\t\tconsole.log('Wrote file to location: ' + toFilePath + fileKey);\n\t\t\t\t\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t};\n\tthis.pushFile = function (fromFilePath, fileKey, callback) {\n\t\t// Read in the file, convert it to base64, store to S3\n\t\tvar fileName = fromFilePath + fileKey;\n\t\tfs.readFile(fileName, function (err, imgData) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('Error reading file: ' + fileName);\n\t\t\t} else {\n\t\t\t\tvar data = {Bucket: bucket, Key: fileKey, Body: imgData};\n\t\t\t\ts3.client.putObject(data, function(err, resp) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.log('Error uploading data: ', err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('Uploaded file to s3: ' + fileKey);\n\t\t\t\t\t\tvar url = 'https://s3.amazonaws.com/zeitgeistmedia/' + fileKey;\n\t\t\t\t\t\tcallback(fileKey, url);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n}",
"title": ""
},
{
"docid": "4aca858744fd7ba8097b2868d1a48392",
"score": "0.65894645",
"text": "function stageObjFromS3() {\n\n console.log(\"Successfully pulled following IP for ec2 instance: \", myHost);\n\n var params = {\n Bucket: `${myKeyBucket}`,\n Key: `${myKey}`\n };\n\n var request = s3.getObject(params, function(err, data) { \n if (err) {\n console.error(err.code, \"-\", err.message);\n return callback(err); }\n else {\n console.log(\"Success!\", data); \n }\n });\n\n var promise = request.promise();\n\n // If s3 object acquired, call sshAndRunScript to SSH with it.\n promise.then(\n function(data) {\n sshAndRunScript(data);\n },\n function(error) {\n console.log(\"This error is occuring with promise:\", error);\n }\n );\n\n }",
"title": ""
},
{
"docid": "85b19954c2753558371ff623146a5144",
"score": "0.6423511",
"text": "function getFiles(callback) {\n var params = {};\n params.Bucket = 'lecto-vids';\n params.EncodingType = \"url\";\n\n s3.listObjects(params, function(err, data) {\n if (err) {\n console.log(err);\n } else {\n var jsonString = JSON.parse(JSON.stringify(data));\n var list = [];\n console.log(jsonString[\"Contents\"].length);\n for (var i = 0; i < jsonString[\"Contents\"].length; i++) {\n list.push(jsonString[\"Contents\"][i].Key);\n }\n callback(list);\n }\n })\n}",
"title": ""
},
{
"docid": "452a1851d33d26b289d6cf37d17b3497",
"score": "0.6405957",
"text": "function gulpAwsS3 ( aws, options ) {\n if ( !aws ) {\n throw PluginError(PLUGIN_NAME, 'Missing AWS credentials!');\n }\n\n var client = knox.createClient(aws);\n\n var headers = {\n 'x-amz-acl': 'public-read'\n };\n\n if ( options.headers ) {\n for ( var key in options.headers ) {\n headers[key] = options.headers[key];\n }\n }\n\n // Creating a stream through which each file will pass\n var stream = through.obj(function(file, enc, callback) {\n if ( file.isNull() ) {\n // Do nothing if no contents\n }\n\n var uploadPath = path.join(options.uploadPath || '', path.basename(file.path));\n // Fix for Windows.\n uploadPath = uploadPath.replace(/\\\\/g, '/');\n\n var method = null;\n if ( file.isBuffer() ) {\n method = 'putBuffer';\n } else if ( file.isStream() ) {\n method = 'putStream';\n }\n\n if ( method ) {\n client[method](file.contents, uploadPath, headers, function ( err, res ) {\n var basename = file.path.replace(file.cwd, '');\n var uploadUrl = res && res.socket && res.socket._httpMessage && res.socket._httpMessage.url;\n var uploadMessage = basename + ' --> ' + uploadUrl;\n\n if ( err || res.statusCode !== 200 ) {\n gutil.log(gutil.colors.red('[FAILED]', uploadMessage));\n } else {\n gutil.log(gutil.colors.green('[SUCCESS]', uploadMessage));\n res.resume();\n }\n });\n } else {\n throw PluginError(PLUGIN_NAME, 'File is neither Buffer or Stream!');\n }\n\n this.push(file);\n return callback();\n });\n\n // returning the file stream\n return stream;\n}",
"title": ""
},
{
"docid": "c0c1485b4e3936d3174426cc502698ab",
"score": "0.63788",
"text": "downloadFile(fileKey, bucketName) {\n return __awaiter(this, void 0, void 0, function* () {\n bucketName = bucketName || this.defaultBucketName;\n const parameters = {\n Bucket: bucketName,\n Key: fileKey,\n };\n return this.s3Client.getObject(parameters).promise();\n });\n }",
"title": ""
},
{
"docid": "294924b51c0b0208463554d899457218",
"score": "0.63542265",
"text": "getS3PreSignedUrl(s3ObjectKey) {\n//connect to s3 bucket \n const bucketName ='video-skill';\n \n AWS.config.update({\n region: 'no peaking', // Put your aws region here\n accessKeyId: \"no peaking\",\n secretAccessKey: \"no peaking\"\n })\n //Bucket Set Up\n const s3SigV4Client = new AWS.S3({\n signatureVersion: 'v4',\n accessKeyId: \"no peaking\",\n secretAccessKey: \"no peaking\"\n });\n //create the link\n try {\n const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {\n Bucket: bucketName,\n Key: s3ObjectKey,\n Expires: 60*15\n });\n console.log(`util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`);\n return s3PreSignedUrl ? s3PreSignedUrl : 'none';\n } catch (err) {\n console.log(err);\n return 'none';\n }\n \n \n}",
"title": ""
},
{
"docid": "5efda89e7384f4e8e425876e2e331375",
"score": "0.6344587",
"text": "function getOriginalImage(url) {\n console.log(\"----- Downloading preprocessed image from the database.....\");\n var params = {\n Bucket: s3_name,\n Key: uniqueFileName\n };\n\n var image = fileReader.createWriteStream(images_path + uniqueFileName);\n\n image.on('close', function(){\n console.log('The image has been downloaded from the pre-bucket and is going to be transformed');\n transformImage();\n });\n\n s3.getObject(params).createReadStream().on('error', function(err){\n console.log(err);\n }).pipe(image);\n}",
"title": ""
},
{
"docid": "3232a1de36df56b81a6f2fb51263da17",
"score": "0.6334944",
"text": "static uploadFileToS3AndGetUrl(fileName, bucket, binary) {\n return new Promise((resolve, reject) => {\n let buf = binary.data;\n const params = {\n Bucket: bucket,\n Key: fileName,\n Body: buf,\n ContentType: 'image/jpg',\n ACL: 'public-read'\n };\n let s3prom = s3.upload(params).promise();\n\n s3prom.then(data => {\n resolve(data.Location);\n }).catch(err => {\n reject(err);\n })\n }).catch(err => {\n reject(err);\n })\n }",
"title": ""
},
{
"docid": "e6671ad19f442605f462ed37ab0cf04b",
"score": "0.6300914",
"text": "function downloadFileToS3(url, fileName) {\n const xhr = new XMLHttpRequest()\n \n xhr.open('GET', url)\n xhr.onreadystatechange = function() {\n console.log(xhr.status)\n console.log(xhr.readyState)\n if(xhr.readyState==4) {\n contentType = xhr.getResponseHeader(\"Content-Type\")\n if (contentType == 'text/plain') {\n console.log(xhr.response)\n downloadTxt(xhr.response, fileName)\n } else {\n window.location.assign(url)\n }\n }\n }\n xhr.send(null)\n }",
"title": ""
},
{
"docid": "8aea057e55e6a0eac608754dea7fe236",
"score": "0.6296994",
"text": "function initS3( s3BucketParams ) {\n albumBucketName = s3BucketParams.Bucket;\n\n console.log(\"viewing files in \" + albumBucketName);\n s3 = new AWS.S3( {\n apiVersion: '2006-03-01',\n params: s3BucketParams\n });\n}",
"title": ""
},
{
"docid": "d5e2ec09882fced846a85f16660ef7ba",
"score": "0.62629634",
"text": "function getSignedUrl(filename) {\n AWS.config = new AWS.Config({\n accessKeyId: process.env.MY_AWS_ACCESS_KEY,\n secretAccessKey: process.env.MY_AWS_SECRET_KEY,\n region: \"us-east-1\",\n signatureVersion: \"v4\",\n });\n\n const s3 = new AWS.S3();\n\n // 60 seconds for dev/staging or 1 week in production\n const expirationTime = environment !== \"production\" ? 60 : 604800\n\n return s3.getSignedUrl(\"getObject\", {\n Key: filename,\n Bucket: S3_BUCKET,\n Expires: expirationTime,\n });\n}",
"title": ""
},
{
"docid": "a01e829d9253b875571af00760436a8d",
"score": "0.62583864",
"text": "function _download(s3, params, executor) {\n let fileStream = fs.createWriteStream(params.local_file);\n let s3Stream = s3.getObject({ Bucket: params.bucket, Key: params.remote_file }).createReadStream();\n\n // Listen for errors returned by the service\n s3Stream.on('error', function (err) {\n // NoSuchKey: The specified key does not exist\n const endOptions = {\n end: 'error',\n messageLog: `S3 download file Error: ${err}`,\n err_output: `S3 download file Error: ${err}`\n };\n executor.end(endOptions);\n });\n\n s3Stream\n .pipe(fileStream)\n .on('error', function (err) {\n // capture any errors that occur when writing data to the file\n const endOptions = {\n end: 'error',\n messageLog: `S3 download file Error: ${err}`,\n err_output: `S3 download file Error: ${err}`\n };\n executor.end(endOptions);\n })\n .on('close', function () {\n const endOptions = {\n end: 'end'\n };\n executor.end(endOptions);\n });\n}",
"title": ""
},
{
"docid": "c3a9a87d5ff8726a1c739003cf836617",
"score": "0.6257021",
"text": "async function getObject({database, collection, id}) {\n let Bucket = database\n let Prefix = collection\n let Key = `${Prefix}/${id}` //node sdk quirk\n return JSON.parse((await s3.getObject({Bucket, Key}).promise()).Body)\n}",
"title": ""
},
{
"docid": "be19ceb35aa70723404ba81676f58f87",
"score": "0.6229975",
"text": "getObject(client, bucket, key, isForStats = false, timeToFirstByte = false) {\n return __awaiter(this, void 0, void 0, function* () {\n const command = new client_s3_2.GetObjectCommand({ Bucket: bucket, Key: key });\n const response = yield client.send(command);\n const body = response[\"Body\"];\n // If Object is gzip encoded, compute MD5 on the decompressed object.\n const isObjectCompressed = response[\"ContentEncoding\"] == \"gzip\" || key.endsWith(\".gz\");\n const data = isObjectCompressed\n ? yield this.dezipped(body, timeToFirstByte)\n : yield this.streamToString(body, timeToFirstByte);\n const md5 = createHash(\"md5\").update(data).digest(\"hex\").toUpperCase();\n const additional = isForStats\n ? { contentLength: response.ContentLength, isObjectCompressed }\n : {};\n return Object.assign({ md5 }, additional);\n });\n }",
"title": ""
},
{
"docid": "45ec975092c9e44db6a92590c6061657",
"score": "0.6222904",
"text": "function loadAlbums() {\n $('#debug').text('Creating AWS Config');\n AWS.config.credentials = new AWS.WebIdentityCredentials({\n RoleArn: AWS_RoleArn,\n WebIdentityToken: Google_App_Token\n });\n AWS.config.region = AWS_Region;\n AWS_Bucket_Obj = new AWS.S3({\n params: {\n Bucket: AWS_BucketName\n }\n });\n $('#debug').text('Getting Album list');\n AWS_Bucket_Obj.getSignedUrl('getObject', {\n Bucket: AWS_BucketName,\n Key: 'users/' + primaryEmail + '_' + Google_ID +'.xml', // Location in the bucket where we keep the user specific album access XMLs\n }, function (err, url) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n updateStatus('error', 'red', false);\n } else {\n $('#debug').text('Recieved album list');\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function () {\n var albumXML = xmlhttp.responseXML;\n // Make an (sudo) async function call\n setTimeout(function () {\n xmlParser(albumXML);\n }, 0);\n }\n /*var albumXML = xmlhttp.responseXML;\n // Make an (sudo) async function call\n setTimeout(function () {\n xmlParser(albumXML);\n }, 0);*/\n }\n });\n}",
"title": ""
},
{
"docid": "8da815d1fc605bc8d703f25b960f6e8b",
"score": "0.6216388",
"text": "function processFileUploadToAmazonS3(fileDetail, index) {\n var deferred = $q.defer();\n var apiUrl = $rootScope.serverURL +\n '/customer/getdoclink?' +\n 'path=' + fileDetail.basePath + '&' +\n 'filetype=' + fileDetail.file.name.split('.').pop();\n HttpService.HttpGetData(apiUrl).then(function(res) {\n if(res?res.data?res.data.url:false:false) {\n var urlParts = res.data.url.split(\"?\");\n var fileUrl = (urlParts && urlParts.length) ? urlParts[0] : \"\";\n if(fileUrl) {\n // upload file to amazon S3\n const xhr = new XMLHttpRequest();\n xhr.upload.addEventListener('progress', function(e){\n deferred.notify({\n 'index': index,\n 'progress': ((e.total != 0) ? Math.round(e.loaded / e.total * 100) : 0)\n });\n }, false)\n xhr.addEventListener('loadend', function(){\n if(xhr.status == 200) {\n deferred.resolve({\n 'index': index,\n 'fileKey': fileDetail.fileKey,\n 'url': fileUrl\n });\n } else {\n $log.error(\"there was an error while uploading a file\");\n deferred.reject({\n 'index': index,\n 'fileKey': fileDetail.fileKey,\n 'error': \"there was an error while uploading a file\"\n });\n }\n });\n xhr.open('PUT', res.data.url, true);\n xhr.setRequestHeader(\"Content-type\", fileDetail.file.type);\n xhr.send(fileDetail.file);\n } else {\n $log.error(\"didn't get valid presigned URL to upload a file\");\n deferred.reject({\n 'index': index,\n 'fileKey': fileDetail.fileKey,\n 'error': \"didn't get valid presigned URL to upload a file\"\n });\n }\n } else {\n $log.error(\"unable to fetch presigned URL for file upload\");\n deferred.reject({\n 'index': index,\n 'fileKey': fileDetail.fileKey,\n 'error': \"unable to fetch presigned URL for file upload\"\n });\n }\n }).catch(function(error) {\n $log.error(\"unexpected error occurred while fetching presigned URL for file upload\");\n deferred.reject({\n 'index': index,\n 'fileKey': fileDetail.fileKey,\n 'error': \"unexpected error occurred while fetching presigned URL for file upload\"\n });\n });\n return deferred.promise;\n }",
"title": ""
},
{
"docid": "2d064a1d6e601cac2946ee1988ea4e71",
"score": "0.6208886",
"text": "async function lambda (Key) {\n try {\n let s3 = new aws.S3\n let Bucket = process.env.ARC_STATIC_BUCKET\n let { Metadata } = await s3.headObject({ Bucket, Key }).promise()\n if (Metadata.cached)\n return Metadata.cached\n }\n catch (e) {\n console.log(e)\n }\n return false\n}",
"title": ""
},
{
"docid": "52a66cfc6a706e5884a7f6c284666487",
"score": "0.6205104",
"text": "function upload(fileName, uploadee) { //make sure you JSON.stringify() uploadee if is a json file \r\n // console.log(\"started test \", uploadee);\r\n // call S3 to retrieve upload file to specified bucket\r\n var uploadParams = { Bucket: process.env.S3_PERSISTENCE_BUCKET, Key: `Media/${fileName}`, Body: uploadee };\r\n\r\n // call S3 to retrieve upload file to specified bucket\r\n s3SigV4Client.upload(uploadParams, function (err, data) {\r\n if (err) {\r\n console.log(\"Error on the tihng\", err);\r\n } if (data) {\r\n console.log(\"Upload Success\", data.Location);\r\n }\r\n });\r\n}",
"title": ""
},
{
"docid": "51787135e4a8bae63531e031738335ae",
"score": "0.61756814",
"text": "function listS3Files() {\n return Promise.resolve([\n {\n 'Key': 'A.parquet',\n 'LastModified': '2016-10-09T17:29:49.000Z',\n 'ETag': '\\'635633cb59c369da25fdf7bd6cc8de62\\'',\n 'Size': 151650,\n 'StorageClass': 'STANDARD',\n 'Owner': {\n 'DisplayName': 'chris',\n 'ID': '655b5b49d59fe8784105e397058bf0f410579195145a701c03b55f10920bc67a'\n }\n },\n {\n 'Key': 'B.parquet',\n 'LastModified': '2016-10-09T17:29:49.000Z',\n 'ETag': '\\'635633cb59c369da25fdf7bd6cc8de62\\'',\n 'Size': 151650,\n 'StorageClass': 'STANDARD',\n 'Owner': {\n 'DisplayName': 'chris',\n 'ID': '655b5b49d59fe8784105e397058bf0f410579195145a701c03b55f10920bc67a'\n }\n }\n ]);\n}",
"title": ""
},
{
"docid": "342f02a27f352d2ff9af43f47b7009b0",
"score": "0.6124314",
"text": "function getDownloadUrl(filename, done) {\n\tvar params = {\n\t\tBucket: config.S3_BUCKET,\n\t\tKey: filename,\n\t\tExpires: config.URL_EXPIRY\n\t};\n\tvar client = createClient();\n\tclient.getSignedUrl('getObject', params, done);\n}",
"title": ""
},
{
"docid": "ae6d2324a2b92bf8ceaf64de8433958c",
"score": "0.61237067",
"text": "downloadFileToDisk(fileKey, localFilePath, bucketName) {\n bucketName = bucketName || this.defaultBucketName;\n const parameters = {\n Bucket: bucketName,\n Key: fileKey,\n };\n return new Promise((resolve, reject) => {\n const writeStream = fs.createWriteStream(localFilePath);\n writeStream.on('finish', () => {\n resolve();\n });\n this.s3Client.getObject(parameters).createReadStream().on('error', (error) => {\n fs.unlink(localFilePath);\n return reject(error);\n }).pipe(writeStream);\n });\n }",
"title": ""
},
{
"docid": "fc4ef83520b5a1693df7190bde41b0a8",
"score": "0.6122408",
"text": "function uploadFileToS3(url) {\n const xhr = new XMLHttpRequest()\n var file = document.querySelector('.button').files[0]\n \n xhr.open('PUT', url)\n xhr.onreadystatechange = function() {\n if(xhr.status==400) {\n if(xhr.readyState==4) {\n console.log(xhr.response)\n }\n }\n\n else {\n console.log(\"s3 upload error\")\n }\n }\n xhr.send(file)\n}",
"title": ""
},
{
"docid": "c441a675696d178cb2e752d0b7e4c7d3",
"score": "0.61140764",
"text": "function uploadFile(file) {\n const fileStream = fs.createReadStream(file.path);\n // console.log(fileStream);\n console.log(bucketName);\n const uploadParams = {\n Bucket: bucketName,\n Body: fileStream,\n Key: file.filename,\n };\n return s3.upload(uploadParams).promise();\n}",
"title": ""
},
{
"docid": "abeb768d16cbd98f02bc87f21cac22df",
"score": "0.61020774",
"text": "function getS3Credentials(path, fileType, callback) {\n var acceptableFileTypes = awsConfig.s3.path[path];\n if (!acceptableFileTypes) {\n callback({error: \"Invalid path value\"});\n return;\n }\n if (fileType == undefined || fileType == null) {\n callback({error: \"Please provide a fileType\"});\n return;\n }\n var fileExtension = acceptableFileTypes[fileType];\n if (!fileExtension) {\n callback({error: \"Invalid fileType for path\"});\n return;\n } \n var expirationLength = 900; //15min\n var expirationDate = moment().add(expirationLength, 'seconds').toISOString();\n var maxFileSize = awsConfig.s3.maxFileSize ? awsConfig.s3.maxFileSize : 5242880; //default to 5MB\n var policy = {\n expiration: expirationDate,\n conditions: [{ bucket: awsConfig.s3.bucket },\n { acl: \"public-read\" },\n { success_action_status: \"201\" },\n [\"starts-with\", \"$key\", path + \"/\"],\n //[\"starts-with\", \"$Content-Type\", fileType],\n [\"starts-with\", \"$Cache-Control\", \"max-age=31536000\"], // 1 year\n [\"content-length-range\", 0, maxFileSize]\n ]\n };\n\n var base64Policy = new Buffer(JSON.stringify(policy)).toString('base64');\n var hmac = crypto.createHmac(\"sha1\", awsConfig.secretAccessKey);\n var hash2 = hmac.update(base64Policy);\n var signature = hmac.digest(encoding=\"base64\");\n var uploadUrl = awsConfig.s3.uploadUrl ? awsConfig.s3.uploadUrl : \"https://\"+awsConfig.s3.bucket+\".s3.amazonaws.com\";\n var credentials = {\n uploadUrl: uploadUrl,\n expirationDate: expirationDate,\n uniqueFilePath: path + \"/\" + uuid.v1() + \".\" + fileExtension,\n AWSAccessKeyId: awsConfig.accessKeyId,\n success_action_status: \"201\",\n \"Content-Type\": fileType,\n policy: base64Policy,\n signature: signature\n };\n callback(null, credentials);\n}",
"title": ""
},
{
"docid": "089f5506fd5571a711385f4e2cf32fee",
"score": "0.6099626",
"text": "getOFileForS3File(pFile){\n return this.#mapS3FileToOFile_.get(pFile);\n }",
"title": ""
},
{
"docid": "fe82a61da89022b5af9b92b4963b5adc",
"score": "0.60954857",
"text": "function extractS3ObjectURL(event, callback) {\n var url = \"\";\n //extract object key out of event object\n if(event && event.Records.length && event.Records[0] && event.Records[0].Sns) {\n const msg = JSON.parse(event.Records[0].Sns.Message);\n if(msg && msg.Records.length ){\n const s3Obj = msg.Records[0].s3;\n url = 'https://s3-'+ s3Region +'.amazonaws.com/'+s3Obj.bucket.name+'/'+s3Obj.object.key\n console.log(\"s3's url to send to client: \", url );\n }\n callback(null, url);\n } else callback(\"No record in SNS event\", null);\n}",
"title": ""
},
{
"docid": "6fc820852740ff7694ab11667c42bcbd",
"score": "0.6089912",
"text": "async function get_presigned_post(filename, filetype) {\n\n const token = localStorage.getItem(\"access_token\")\n\n var url = new URL(\"http://127.0.0.1:5000/sign_s3\")\n\n const params = {\n file_name: filename,\n file_type: filetype,\n }\n url.search = new URLSearchParams(params)\n\n return fetch(url , {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\",\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer \" + token,\n },\n })\n .then(response => {\n if (!response.ok) {\n throw new Error(`${response.status}: ${response.statusText}`)\n } else {\n return response.json()};\n }).then(body => {\n return(body)\n })//.catch((err) => {return err})\n}",
"title": ""
},
{
"docid": "257df94a5ce2a8cf8f6fd8f0e3eaee02",
"score": "0.6056747",
"text": "listOfObject(req, res) {\n /*\n var bucketParams = {\n Bucket : 'sample-bucket12345602502223',\n };\n */\n // Call S3 to obtain a list of the objects in the bucket\n s3.listObjects(req.body.bucketname, function (err, data) {\n if (err) {\n console.log(\"Error\", err);\n } else {\n console.log(\"Success123\", data);\n return res.send({\n success: true,\n message: \"list of object of s3 Api\",\n data: data\n })\n }\n });\n }",
"title": ""
},
{
"docid": "6225e492c8c232101b98b3787a3c110c",
"score": "0.6055523",
"text": "function uploadFile(file){\n const fileStream = fs.createReadStream(file.path);\n console.log(process.env.AWS_BUCKET_NAME);\n const uploadParams = {\n Bucket: bucketName,\n Body: fileStream,\n Key: file.filename\n }\n return s3.upload(uploadParams).promise();\n\n}",
"title": ""
},
{
"docid": "6b2264d7a38d4212845216cf0940a48d",
"score": "0.60358334",
"text": "function getBufferFromS3(file, callback) {\n const buffers = [];\n const s3 = new AWS.S3();\n const stream = s3\n .getObject({ Bucket: process.env.STORAGE, Key: file })\n .createReadStream();\n stream.on(\"data\", (data) => buffers.push(data));\n stream.on(\"end\", () => callback(null, Buffer.concat(buffers)));\n stream.on(\"error\", (error) => callback(error));\n}",
"title": ""
},
{
"docid": "98ddd1ab998eeb774abc3a6874e555ba",
"score": "0.59870255",
"text": "async function getCredentials() {\n const credentials = await s3\n .getObject({\n Bucket: 'test',\n Key: 'credentials.json'\n })\n .promise();\n return JSON.parse(credentials.toString());\n}",
"title": ""
},
{
"docid": "7f52eeffc0b09abb477b05edb032eabc",
"score": "0.5977278",
"text": "getBucketContents() {\n return {contents: this.bucketContents()}\n }",
"title": ""
},
{
"docid": "4ee0a9f3f7eeabe44bfdd8af69cfd681",
"score": "0.59534883",
"text": "putFile(folder, key, file) {\r\n return new Promise((resolve, reject) => {\r\n // S3 Configs\r\n var uploadParams = { Bucket: folder, Key: key, Body: file.data };\r\n // call S3 to retrieve upload file to specified bucket\r\n this.instance.upload(uploadParams, function (err, data) {\r\n if (err) {\r\n console.log(\"Error\", err);\r\n reject(err);\r\n }\r\n if (data) {\r\n console.log(\"Upload Success\", data.Location);\r\n resolve(data.Location);\r\n }\r\n });\r\n });\r\n }",
"title": ""
},
{
"docid": "2369ef14fcc047330176f641e4f06976",
"score": "0.5934483",
"text": "get(id, cb){\n //TODO make user check\n this.bucket.get(id, (err, data) => {\n cb(err, data.value);\n });\n }",
"title": ""
},
{
"docid": "df8ada7819b3ad87f5205efb65648968",
"score": "0.59325314",
"text": "function awsGetObjects(awsGetList) {\n // Check there are some items in the get list\n if (awsGetList.length == 0) {\n let errorObject = {type: 'Get Log File Request', errorMessage: 'No log files selected!', severity: 'fatal'};\n return Promise.reject(errorObject);\n }\n // Reset & display loaded logs counter\n let loadedLogsCounter = 0;\n // Reset dataArray\n dataArray = []; \n // Create an array of promises (one for each file to be retrieved)\n let promiseArray = [];\n awsGetList.forEach(function(listItem) {\n // Set additional S3 parameters including responsetype header for CloudFront .gz object \n let s3Options = {\n Key: listItem.objectKey \n };\n if (listItem.type == \"CloudFront\") {\n s3Options.ResponseContentEncoding = \"gzip\";\n }\n // Create the request object\n let s3GetRequest = new Promise(function(resolve, reject) {\n // Call S3 to get objects and handle promise\n s3.getObject(s3Options).promise().then(function(apiSuccess) {\n // Send data to processing function & handle promise\n parseLogFileContent(apiSuccess.Body.toString(), listItem.type).then(function(parseSuccess) {\n // Update loaded logs counter\n loadedLogsCounter++;\n $('#message-area-load-logs-counter').text(loadedLogsCounter);\n resolve();\n }).catch(function(parseError) {\n // Update loaded logs counter\n loadedLogsCounter++;\n $('#message-area-load-logs-counter').text(loadedLogsCounter);\n // Catch parsing error and save as warning\n let errorText = `Error processing file ${listItem.objectKey} - ${parseError.message}`;\n let errorObject = {type: 'Log File Processing', errorMessage: errorText, severity: 'fatal'};\n reject(errorObject);\n }); \n }).catch(function(apiError) {\n // Catch API errors and save as fatal\n let errorText = `Could not get file ${listItem.objectKey} - ${apiError.message}`;\n let errorObject = {type: 'AWS API', errorMessage: errorText, severity: 'fatal'};\n reject(errorObject);\n });\n }) \n // Add the promise to the array\n promiseArray.push(s3GetRequest);\n })\n // Track when all promises are complete and use as return\n return Promise.all(promiseArray);\n}",
"title": ""
},
{
"docid": "448896e2d34102b81ba24693852a6a74",
"score": "0.59225905",
"text": "constructor(fileSystem, s3Object) {\n this.fileSystem = fileSystem;\n this.s3Object = s3Object;\n }",
"title": ""
},
{
"docid": "b8fac3364d255e1a7d202859c360899e",
"score": "0.592027",
"text": "function uploadFile(file) {\n try {\n const fileStream = fs.createReadStream(file.path)\n const uploadParams = {\n Bucket: bucketName,\n Body: fileStream,\n Key: file.filename\n }\n return s3.upload(uploadParams).promise()\n } catch (error) {\n console.log(error);\n }\n}",
"title": ""
},
{
"docid": "7a149b4534e188543e1b2388b7d1dd44",
"score": "0.59088176",
"text": "function get_signed_request(file) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"/sign_s3?file_name=\" + file.name + \"&file_type=\" + file.type);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var response = JSON.parse(xhr.responseText);\n upload_file(file, response.signed_request, response.url);\n }\n else {\n alert(\"Could not get signed URL.\");\n }\n }\n };\n xhr.send();\n }",
"title": ""
},
{
"docid": "d465bac222092b2cd689fc816a0e00a6",
"score": "0.59036505",
"text": "function uploadToS3() {\n fileReader.readFile(images_path+'blackwhite-'+uniqueFileName, function (err, data) {\n if (err) { throw err;}\n var bufferVar = new Buffer(data, 'binary');\n console.log(\"------- Uploading image to the bucket:\" + s3_name_transform + \" ..........\");\n s3.putObject({\n Bucket: s3_name_transform,\n Key: \"blackwhite-\"+uniqueFileName,\n Body: bufferVar,\n ACL: 'public-read'\n },\n function (resp) {\n console.dir(resp);\n console.log('Upload to the bucket: ' + s3_name_transform + 'completed');\n insertIntoDB();\n }\n );\n });\n}",
"title": ""
},
{
"docid": "413519eabbeb4f6300d0f16168697e98",
"score": "0.59008473",
"text": "async pull(ctrl) {\n const { done, value } = files.next();\n if (done) return ctrl.close();\n const { body } = await fetch(s3 + value);\n return ctrl.enqueue({\n name: `/${value}`,\n stream: () => body,\n });\n }",
"title": ""
},
{
"docid": "3b6762be27f0dcd32569c2517078104d",
"score": "0.5896293",
"text": "async function testS3EncryptionInTransit(bucket) { return 0 }",
"title": ""
},
{
"docid": "017c31bf1ab18838cdf7a4a9b696d187",
"score": "0.5879351",
"text": "function get_signed_request(file){\n\t\t\tconsole.log(\"getting signed request\")\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"GET\", \"http://localhost:3000/sign_s3?file_name=\"+file.name+\"&file_type=\"+file.type);\n\t\txhr.onreadystatechange = function(){\n\t\t if(xhr.readyState === 4){\n\t\t if(xhr.status === 200){\n\t\t var response = JSON.parse(xhr.responseText);\n\t\t upload_file(file, response.signed_request, response.url);\n\t\t }\n\t\t else{\n\t\t alert(\"Could not get signed URL.\");\n\t\t }\n\t\t }\n\t\t};\n\t\txhr.send();\n\t\t}",
"title": ""
},
{
"docid": "ee93dcbc2a06781862a871b81a5e914d",
"score": "0.5878319",
"text": "fileExists(fileKey, bucketName) {\n bucketName = bucketName || this.defaultBucketName;\n const parameters = {\n Bucket: bucketName,\n Key: fileKey\n };\n const thisInstance = this;\n return new Promise(function (resolve) {\n thisInstance.s3Client.headObject(parameters, function (error, metadata) {\n if (error && error.code === storage_client_1.ERROR_CODE_NOT_FOUND) {\n resolve(false);\n }\n else {\n resolve(true);\n }\n });\n });\n }",
"title": ""
},
{
"docid": "63278f76270ef828276ce8493ec4854f",
"score": "0.5878183",
"text": "function uploadToS3(bucket, filename, callback) {\n fs.readFile(LOCAL_IMAGES_PATH+filename, function (err, data) {\n if (err) { throw err; }\n var base64data = new Buffer(data, 'binary');\n console.log(\"====================== UPLOAD TO \"+bucket+\" ======================\");\n s3.putObject({\n Bucket: bucket,\n Key: filename,\n Body: base64data,\n ACL: 'public-read'\n },\n function (resp) {\n //if(res) console.dir(resp);\n console.log('Successfully uploaded package.');\n if (callback) {callback();}\n }\n );\n });\n}",
"title": ""
},
{
"docid": "962788bd775f7143362c27de737b72ec",
"score": "0.58748627",
"text": "async function main(){\n try {\n const s3_files = await getS3FileList();\n\n //for...in to loop through all object in the S3 Bucket\n for(index in s3_files){\n const key = s3_files[index].Key;\n const f_header = await getS3FileHeader(key);\n\n if(f_header){\n const f_stream = await getS3FileStream(key);\n\n if(f_stream){\n const source_sha1 = sourceFileSha1(f_stream);\n }\n //Decide resumable uploading for Large File or common uploading for small file\n if(f_header.ContentLength > File_Size * 1024 * 1024){\n // check blog to merge resumable uploading\n //https://forge.autodesk.com/blog/nailing-large-files-uploads-forge-resumable-api\n }else{\n const forge_token = await getForge2Token();\n\t\t if(forge_token){\n \t const uploadRes = await transferOneFile(key, f_header, f_stream);\n\n\t\t\t if(uploadRes){\n\t\t\t\tconsole.log('Transfer one S3 file to Forge OSS Succeeded! ');\n\n\t\t\t\tif(sourceFileSha1 == uploadRes.body.sha1)\n\t\t\t\t console.log('File integrity is correct', key);\n\t\t\t\telse \n\t\t\t\t console.log('file integrity is wrong!', key);\n\t\t\t }\n\t\t\t else\n\t\t\t\tconsole.log('transfer one S3 file to Forge OSS failed!'); \n\t\t }\n }\n }\n }\n } catch (e) {\n console.log(e);\n }\n}",
"title": ""
},
{
"docid": "c4bcf951de659a22e2c7313ac8c29a91",
"score": "0.58685076",
"text": "function s3_upload(file, efile, elementId) {\n // var elementId = document.getElementById(eId);\n var fileName = randomString(20)+'.encrypted';\n var $progressBar = $(\"#\"+elementId+\" .progress .progress-bar\");\n // var $progressText = $(\"#\"+eId+\" .progress-text\");\n var s3upload = new S3Upload({\n s3_object_name: _msgId,\n file_dom_selector: efile,\n s3_sign_put_url: '/sign-upload/'+fileName, // uso un nombre random para ocultar el real\n onProgress: function(percent, message) {\n \t// $('#creation-progress').show();\n \tif(percent > 40) updateProcessStatus(elementId, \"uploading\"); // Muestro el cartel de encrypting por mas tiempo\n $progressBar.css('width', percent + '%');\n // $progressText.text(message+' '+percent + \"%\");\n },\n onFinishS3Put: function(public_url) {\n console.log(\"File uploaded successfully\");\n $progressBar.css('width','100%');\n updateProcessStatus(elementId, \"finishing\")\n $progressBar.removeClass(\"progress-bar-striped active\");\n var updatedData = { \n \"action\": \"addFile\",\n \"secret\":_secret, \n \"public_url\":public_url, \n \"name\":file.name, \n \"hashName\":fileName, \n \"size\": file.size,\n \"type\": file.type,\n \"timestamp\": file.timestamp\n }\n addFile2Completed(elementId);\n finishUploadProcess(updatedData, elementId);\n },\n onError: function(status) {\n _errorFiles.push(elementId); // Agrego el archivo al array de errores\n // $progressBar.css('background-color','#d9534f');\n\t\t $progressBar.css('width','100%');\n\t\t updateProcessStatus(elementId, \"error\")\n // $progressText.text(\"Error uploading files: \"+status);\n // var link = \"/m/\"+msgid+\"/edit\";\n\t\t // window.location.href = link;\n if(locale == 'es') {\n var errorMsg = 'Error subiendo archivo. Detalle: '+status;\n } else {\n var errorMsg = 'Error uploading file. Details: '+status;\n }\n console.log(errorMsg);\n alert(errorMsg)\n }\n });\n}",
"title": ""
},
{
"docid": "6225b306387e0311e4949e5a768b1a3a",
"score": "0.58672184",
"text": "function getS3FileList(){\n return new Promise((resolve, reject) => {\n const params = {Bucket: config.aws.s3_bucket, Delimiter: '/'};\n\n s3.listObjectsV2(params, function(err, data){\n if(err){\n reject(err);\n }else{\n //Data.Contents is the array of objects within the Bucket\n if(data && data.Contents)\n resolve(data.Contents);\n else\n resolve([]);\n }\n });\n });\n}",
"title": ""
},
{
"docid": "f0cfbc557dd44ea4e45ed183aa00338d",
"score": "0.5855134",
"text": "function getBucket(event)\n{\n return event.Records[0].s3.bucket.name;\n}",
"title": ""
},
{
"docid": "6d2a41d94051ca59dc50f40ca6e351c5",
"score": "0.58544266",
"text": "function getSignedRequest(file){\n const xhr = new XMLHttpRequest();\n xhr.open('GET', api()+`/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n const response = JSON.parse(xhr.responseText);\n component.stateHelper={imageFile:file,signedRequest:response.signedRequest,url:response.url} //but all of this is going to EditItems!!\n document.getElementById('preview').src = response.url; //dont confuse this url for the response.url\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send(); //this is when the request actually gets sent! The top part is just 'defining/definitions of stuff\n }",
"title": ""
},
{
"docid": "499503e1538198310bb6f8d51c06cc26",
"score": "0.58515084",
"text": "function downloadImage(imageName) {\n var params = {\n \"Bucket\": config.bucketPublic,\n \"Key\": imageName\n };\n\n var promise = when(s3.getObject(params).promise()).then(\n function(data) {\n console.log(\"Got image \" + imageName + \", size \" + data.ContentLength);\n return writeFile(config.tmpDir + params.Key, data.Body);\n }\n );\n\n return promise;\n}",
"title": ""
},
{
"docid": "d5894c28fba34998539890440e6bc3f4",
"score": "0.58507246",
"text": "function save (bucket, filename, file) {\n return new Promise( (resolve,reject) => {\n minioClient.bucketExists(bucket, (err) => {\n if (err) {\n if (err.code == 'NoSuchBucket') {\n if (err) {\n return reject(err);\n }\n else {\n minioClient.fPutObject(bucket, filename, file, 'application/octet-stream', (err, etag) => {\n if (err) {\n return reject(err)\n }\n else {\n return resolve(etag);\n }\n });\n }\n }\n else {\n return reject(err);\n }\n }\n else {\n // bucket exists, upload the file\n minioClient.fPutObject(bucket, filename, file, 'application/octet-stream', (err, etag) => {\n if (err) {\n return reject(err)\n }\n else {\n return resolve(etag);\n }\n });\n }\n });\n });\n}",
"title": ""
},
{
"docid": "9b56c8826bc330f73a21717c7d05d5fd",
"score": "0.584321",
"text": "fetch(fileKey, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts;\n opts = null;\n }\n opts = opts || {};\n cb = once(cb);\n\n if (opts.acl === 'public') {\n return void this.httpRequest('GET', fileKey, (err, res, data) => {\n if (err) {\n return void cb(err);\n }\n\n cb(null, getInfoFromHeaders(res.headers), data);\n });\n }\n // else assume private\n \n cb = once(cb);\n const file = this.bucket.file(fileKey);\n const bufs = [];\n const { bucket } = this.options;\n let res;\n file.createReadStream()\n .on('error', err => cb(err))\n .on('response', r => res = r)\n .on('data', chunk => bufs.push(chunk))\n .on('end', () => {\n if (res.statusCode !== 200) {\n return void cb(new Error('gcp.storage.fetch.error: '\n + ' for ' + (bucket + '/' + fileKey))\n );\n }\n\n cb(null, getInfoFromHeaders(res.headers), Buffer.concat(bufs));\n })\n ;\n }",
"title": ""
},
{
"docid": "b52d98c8be17a3da9160da5fbdc75b9f",
"score": "0.58315307",
"text": "listFile(params, pFile, done) {\n let extensions = this.extensions;\n this.s3Client.listObjects(params, function (err, data) {\n let results = [];\n\n if (err) {\n done({res: 'error'}, null);\n }\n else {\n _.map(data.Contents, function (val) {\n if (val['Key'].indexOf(pFile.folder) > -1) {\n let tempStr = val['Key'].replace(pFile.folder + '/', '');\n if (_.indexOf(extensions, ('.' + tempStr.split('.').pop())) > -1 && _.indexOf(tempStr, '/') < 0) {\n results.push({\n p: pFile.path + val['Key'],\n s: val['Size'],\n t: new Date(val['LastModified']).getTime() / 1000,\n h:\"0\",\n w:\"0\"\n });\n }\n //todo: get dimension?\n\n }\n })\n done(null, results);\n }\n })\n }",
"title": ""
},
{
"docid": "e55a8a8be1cfca05d666d89e5b861769",
"score": "0.5830455",
"text": "function uploadToS3(file) {\n let s3bucket = new AWS.S3({\n accessKeyId: IAM_USER_KEY,\n secretAccessKey: IAM_USER_SECRET,\n Bucket: BUCKET_NAME\n });\n s3bucket.createBucket(function () {\n var params = {\n Bucket: BUCKET_NAME,\n Key: file.name,\n Body: fs.readFileSync(file.path)\n };\n s3bucket.upload(params, function (err, data) {\n if (err) {\n console.log('error in callback');\n console.log(err);\n }\n console.log('success');\n let currDate = new Date();\n currDate = JSON.stringify(currDate);\n db.insertFile(file.name, data.Location, currDate, (err, results) => {\n if(err){\n console.log(err);\n }else{\n console.log(results);\n }\n });\n });\n });\n}",
"title": ""
},
{
"docid": "140596a4e41179ea25b7c0485d16fc2c",
"score": "0.5824699",
"text": "upload(req, res, next) {\n console.log(\"hiii\", req.file)\n\n var params = {\n Bucket: 'fundoo-pic-123',\n Key: Date.now().toString(),\n Body: req.file.buffer,\n ACL: 'public-read'\n };\n s3.upload(params, function (err, data) {\n if (err) {\n console.log(\"Error uploading image: \", err);\n res.status(500).send({\n success: false,\n message: \"Error uploading image\",\n err: err\n })\n } else {\n console.log(\"uploading image successfully\", data);\n req.location = data.Location\n next()\n\n }\n });\n }",
"title": ""
},
{
"docid": "5f442770dfc34a6b625b941e08e7f23e",
"score": "0.58234775",
"text": "function readCallback() {\n s3fullpics.putObject({Key: UploadUrl, Body: imgData}, function (err, data) {\n if (err) {\n unlink(tempLocation + \"full\" + UploadUrl);\n throw new Error('imageError');\n console.log(\"Error uploading data: \", err);\n } else {\n unlink(tempLocation + \"full\" + UploadUrl);\n console.log(\"Successfully uploaded fullpic to AWS\");\n }\n });\n }",
"title": ""
},
{
"docid": "7a13854bd7544b100efd41d6a1f1cf07",
"score": "0.5816445",
"text": "function imageToS3(user_id, url, callback) {\n download(url, temp_filename, function(err) {\n if (!err) {\n upload(user_id, temp_filename, function(file_location) {\n addLink(user_id, file_location);\n callback(null);\n });\n }\n else {\n console.log(err);\n callback(err);\n }\n });\n}",
"title": ""
},
{
"docid": "62406eecbdd60646e2239f913bdd9358",
"score": "0.57932776",
"text": "function getBucket() {\n var request = gapi.client.storage.buckets.get({\n 'bucket': BUCKET\n });\n executeRequest(request, 'getBucket');\n}",
"title": ""
},
{
"docid": "1935a0c715c049f5d51df72fb90bbc78",
"score": "0.5784401",
"text": "createBucket(req, res) {\n var bucketParams = {\n Bucket: 'sample-bucket123456025022235',\n ACL: 'public-read'\n };\n // Call S3 to obtain a list of the objects in the bucket\n // call S3 to create the bucket\n s3.createBucket(bucketParams, function (err, data) {\n if (err) {\n console.log(\"Error\", err);\n } else {\n console.log(\"Success\", data.Location);\n return res.send({\n success: true,\n message: \"list of object of s3 Api\",\n data: data.Location\n })\n }\n })\n }",
"title": ""
},
{
"docid": "9e56a902e42a5bd7f2cd3546632c9ae9",
"score": "0.5783128",
"text": "async function sizeOf(key, bucket) {\n let res = await s3.headObject({ Key: key, Bucket: bucket }).promise();\n return res.ContentLength;\n}",
"title": ""
},
{
"docid": "6ed320de09fe8af641245cdcc9521a8a",
"score": "0.5779551",
"text": "function readCallback() {\n s3profileimg.putObject({Key: filename, Body: imgData}, function (err, data) {\n if (err) {\n unlink(keypath);\n unlink(\"./Uploads/test\");\n console.log(\"Error uploading data: \", err);\n callback(false);\n } else {\n unlink(keypath);\n unlink(\"./Uploads/test\");\n console.log(\"Successfully uploaded fullpic to AWS\");\n callback(true);\n }\n });\n }",
"title": ""
},
{
"docid": "9cbe33b8ab686bc0ef6d39c5ae00f831",
"score": "0.5773717",
"text": "function readCallback() {\n s3profileimg.putObject({Key: filename, Body: imgData}, function (err, data) {\n if (err) {\n unlink(keypath);\n console.log(\"Error uploading data: \", err);\n } else {\n unlink(keypath);\n console.log(\"Successfully uploaded fullpic to AWS\");\n }\n });\n }",
"title": ""
},
{
"docid": "8e22e4dc661a9965bcd76bc32896af53",
"score": "0.5773627",
"text": "function getS3FileHeader(key){\n return new Promise((resolve, reject) => {\n const params = {Bucket: config.aws.s3_bucket, Key: key};\n\n s3.headObject(params, function(err, data){\n if(err){\n reject(err);\n }else{\n resolve(data);\n }\n });\n });\n}",
"title": ""
},
{
"docid": "f619ba944d8ee9ac0ed50dc57e4a45b9",
"score": "0.57626784",
"text": "function S3(config) {\n config = config || {};\n Publisher.call(this);\n\n this.cwd = config.cwd || process.cwd();\n this.path = path.resolve(this.cwd || '_site');\n this.bucket = config.bucket;\n this.key = config.key;\n this.secret = config.secret;\n this.endpoint = config.endpoint;\n\n if(!this.bucket) return this.emit('error', new Error('Required bucket config unset'));\n if(!this.key) return this.emit('error', new Error('Required key config unset'));\n if(!this.secret) return this.emit('error', new Error('Required secret config unset'));\n\n var o = {\n bucket: this.bucket,\n key: this.key,\n secret: this.secret\n };\n\n if(config.endpoint) o.endpoint = config.endpoint;\n\n this.client = knox.createClient(o);\n}",
"title": ""
},
{
"docid": "26dbcd101acaa909da0c27039cb2ce05",
"score": "0.576184",
"text": "function getBufferFromS3Promise(file) {\n return new Promise((resolve, reject) => {\n getBufferFromS3(file, (error, s3buffer) => {\n if (error) return reject(error);\n return resolve(s3buffer);\n });\n });\n}",
"title": ""
},
{
"docid": "b1a6024bdbc28d7037d429dde363c6b4",
"score": "0.5758856",
"text": "function extractBucketFromS3Event(s3Event) {\n let bucketName = s3Event['Records'][0]['s3']['bucket']['name'];\n\n if (!bucketName) {\n throw new Error(\"Unable to retrieve bucket information from the event\");\n }\n\n return bucketName;\n}",
"title": ""
},
{
"docid": "f1865521d19084525f014224f6e981a0",
"score": "0.5757331",
"text": "function uploadToS3(file, destFileName, callback) {\n const fullUploadedURL = `http://artrade.s3-website-us-east-1.amazonaws.com/${destFileName.toString()}`\n console.log(fullUploadedURL);\n s3\n .upload({\n ACL: 'public-read',\n Body: fs.createReadStream(file.path),\n // Key: newId,\n // Bucket: process.env.\n Key: destFileName.toString(),\n ContentType: 'image/png' // force download if it's accessed as a top location\n })\n .send(callback);\n}",
"title": ""
},
{
"docid": "fbb2e9e9afd2684ee6ca8c2473f5f454",
"score": "0.5753333",
"text": "function readCallback() {\n s3fullpics.putObject({Key: keyName, Body: imgData}, function (err, data) {\n if (err) {\n unlink(tempLocation + \"full\" + keyName);\n throw new Error('imageError');\n console.log(\"Error uploading data: \", err);\n } else {\n unlink(tempLocation + \"full\" + keyName);\n console.log(\"Successfully uploaded fullpic to AWS\");\n }\n });\n }",
"title": ""
},
{
"docid": "71a1be21cdf5854144860498c2467b30",
"score": "0.574737",
"text": "async function uploadS3(filePath,folderName, deleteFile, callback){\n //configuring the AWS environment\n AWS.config.update({\n accessKeyId: \"AKIAYLZVQDQMJIGVCQUM\",\n secretAccessKey: \"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\"\n });\n\n var s3 = new AWS.S3();\n //configuring parameters\n var params = {\n Bucket: 'docintact',\n Body : fs.createReadStream(filePath),\n Key : folderName+\"/\"+Date.now()+\"_\"+path.basename(filePath)\n };\n s3.upload(params, function (err, data) {\n //handle error\n if (err) {\n console.log(\"Error\", err);\n }\n //success\n if (data) {\n if(deleteFile) if (fs.existsSync(filePath)) fs.unlinkSync(filePath)\n console.log(\"Uploaded in:\", data.Location);\n if(callback) callback(data.Location);\n else return data.Location;\n }\n });\n}",
"title": ""
},
{
"docid": "71a1be21cdf5854144860498c2467b30",
"score": "0.574737",
"text": "async function uploadS3(filePath,folderName, deleteFile, callback){\n //configuring the AWS environment\n AWS.config.update({\n accessKeyId: \"AKIAYLZVQDQMJIGVCQUM\",\n secretAccessKey: \"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\"\n });\n\n var s3 = new AWS.S3();\n //configuring parameters\n var params = {\n Bucket: 'docintact',\n Body : fs.createReadStream(filePath),\n Key : folderName+\"/\"+Date.now()+\"_\"+path.basename(filePath)\n };\n s3.upload(params, function (err, data) {\n //handle error\n if (err) {\n console.log(\"Error\", err);\n }\n //success\n if (data) {\n if(deleteFile) if (fs.existsSync(filePath)) fs.unlinkSync(filePath)\n console.log(\"Uploaded in:\", data.Location);\n if(callback) callback(data.Location);\n else return data.Location;\n }\n });\n}",
"title": ""
},
{
"docid": "300cd6637d1a1267737953182122673a",
"score": "0.57434255",
"text": "async function initBucket () {\n const s3 = new AWS.S3()\n try {\n await s3.headBucket({ Bucket: config.AMAZON.ATTACHMENT_S3_BUCKET }).promise()\n } catch (err) {\n await s3.createBucket({ Bucket: config.AMAZON.ATTACHMENT_S3_BUCKET }).promise()\n }\n}",
"title": ""
},
{
"docid": "7e51e9df1574c3b980b424f1a681d753",
"score": "0.57430404",
"text": "constructor(AWSAccessKeyId, AWSSecretAccessKey) {\n this.s3 = new AWS.S3({\n accessKeyId: AWSAccessKeyId,\n secretAccessKey: AWSSecretAccessKey,\n });\n }",
"title": ""
},
{
"docid": "1fa088fff34286177517d5f3ab617439",
"score": "0.57420844",
"text": "getBucket(id) {\n return __awaiter$6(this, void 0, void 0, function* () {\n try {\n const data = yield get(this.fetch, `${this.url}/bucket/${id}`, { headers: this.headers });\n return { data, error: null };\n }\n catch (error) {\n if (isStorageError(error)) {\n return { data: null, error };\n }\n throw error;\n }\n });\n }",
"title": ""
},
{
"docid": "0cbce5dac1731ca13b517b35863b42c7",
"score": "0.57301813",
"text": "function uploadToS3(file, url, successCallback) {\n setProgress(0, 'Upload started...');\n var xhr = createCORSRequest('PUT', url);\n if (!xhr) {\n $scope.editor.progress.style = \"error\";\n setProgress(100, 'CORS not supported');\n } else {\n xhr.onload = function() {\n if (xhr.status == 200) {\n setProgress(101, 'Upload completed.');\n if (successCallback && typeof successCallback === \"function\")\n successCallback();\n } else {\n $scope.editor.progress.style = \"error\";\n setProgress(100, 'Upload error: ' + xhr.status);\n }\n };\n\n xhr.onerror = function() {\n setProgress(100, 'XHR error.');\n };\n\n xhr.upload.onprogress = function(e) {\n if (e.lengthComputable) {\n // console.log(e);\n var percentLoaded = Math.round((e.loaded / e.total) * 100);\n setProgress(percentLoaded, percentLoaded == 100 ? 'Finalizing.' : 'Uploading.');\n } else\n console.log(e, \"length not computable\")\n };\n\n xhr.setRequestHeader('Content-Type', file.type); ///file.type\n // xhr.setRequestHeader('x-amz-acl', 'public-read');\n\n xhr.send(file);\n }\n }",
"title": ""
},
{
"docid": "cbec92c0b7b3a3fb87362c70c2527aad",
"score": "0.5717952",
"text": "function getMediaConvertOutputObject(metadata) {\n return new Promise(function (resolve, reject) {\n const params = {\n Key: metadata.key,\n Bucket: metadata.bucket,\n Range: \"bytes=0-1\" // we don't want to get entire object, we persuing ETag meta here\n };\n s3.getObject(params, function (err,data) {\n console.log('Getting Object for ', params,err);\n if (err) {\n reject('Error:', err);\n } else {\n console.log('Object', data);\n metadata.length = parseInt(data.ContentRange.split('/')[1]);\n metadata.etag = data.ETag.replace(/^\"|\"$/g, '');\n resolve(metadata);\n }\n });\n });\n}",
"title": ""
},
{
"docid": "3b9b0b9155e03365620c75cee7b9c3fb",
"score": "0.5716006",
"text": "function getImageMetadata(DIR_NAME, cb) {\n var pattern = new RegExp(\".+-[0-9]+[0-9]+\\.json$\");\n s3.listObjects({Prefix: DIR_NAME}, function(err, data) {\n if (err) {\n return cb('There was an error viewing the directory: ' + err.message);\n }\n if (data && data.Contents && (data.Contents.length == 0)) {\n return cb('directory not found');\n }\n var metadataFiles = data.Contents.filter(function (object) {\n return pattern.test(object.Key);\n });\n\n var promises = metadataFiles.map(function(md) {\n var params = {\n Bucket: bucketName,\n Key: md.Key\n };\n return s3.getObject(params).promise().then(function(data) {\n var s = JSON.parse(data.Body.toString());\n return s;\n });\n });\n\n Promise.all(promises).then(function(results) {\n //console.log(results);\n cb(null, results);\n })\n\n });\n}",
"title": ""
},
{
"docid": "c1d52d2b4cd2f7fa02d3e47f54821897",
"score": "0.5708031",
"text": "function uploadTempFile(file, s3Data, url, filename){\n const xhr = new XMLHttpRequest();\n xhr.open('POST', s3Data.url);\n xhr.setRequestHeader('x-amz-acl', 'public-read', 'Access-Control-Allow-Origin');\n const postData = new FormData();\n for(key in s3Data.fields){\n postData.append(key, s3Data.fields[key]);\n }\n postData.append('file', file);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200 || xhr.status === 204){\n document.getElementById('preview').src = url;\n }\n else{\n //alert('Could not upload file.');\n }\n }\n };\n xhr.send(postData);\n\t //deleteTempFile(filename);\n }",
"title": ""
},
{
"docid": "bab681d071358a954ca9804352aab457",
"score": "0.5706816",
"text": "function processHqFile(key) {\n var promResolve, promReject;\n var promise = new Promise((resolve, reject) => {\n promResolve = resolve;\n promReject = reject;\n });\n // key is vid/_hq/id\n var id = key.split(\"/\")[2];\n var parts = id && pic.parseFile(id);\n var dirId = parts && (parts.parent + parts.child);\n \n // get metadata\n var params = {\n Bucket: \"gvypics\",\n Key: key\n };\n s3.headObject(params, (err, data) => {\n // all paths from here must lead to promResolve() or promReject()\n var skip = true;\n if (!err && data && data.Metadata && data.Metadata.filename) {\n var filePath = makeFilePath(dirId, data.Metadata.filename);\n if (filePath) {\n if (fs.existsSync(filePath)) {\n var stats = fs.statSync(filePath);\n var mtimeMs = Math.round(stats.mtimeMs);\n // here is the change detection logic\n if (!data.Metadata.mtimems || data.Metadata.mtimems != mtimeMs) {\n console.log(\"time difference for\", id, \"local time is\", mtimeMs,\n \"remote time is\", data.Metadata.mtimems);\n skip = false;\n }\n else if (data.ContentLength != stats.size) {\n console.log(\"size difference for\", id, \"local size is\", stats.size,\n \"remote size is\", data.ContentLength);\n skip = false;\n }\n } else {\n // file doesn't exist\n console.log(\"local file doesn't exist for\", id);\n skip = false;\n }\n } else {\n console.log(\"can't find local directory for\", id);\n }\n if (skip) {\n console.log(\"skipping\", id);\n promResolve(true);\n } else {\n console.log(\"downloading\", key, \"to\", filePath);\n var params = {\n Bucket: \"gvypics\",\n Key: key\n };\n const request = s3.getObject(params);\n const ws = fs.createWriteStream(filePath);\n const pipe = request.createReadStream().pipe(ws); \n pipe.on('finish', () => {\n console.log(\"download complete for\", id);\n // set modification time to agree with metadata!\n var newTime = new Date(parseInt(data.Metadata.mtimems));\n fs.utimesSync(filePath, newTime, newTime);\n promResolve(true);\n });\n request.on('error', () => {\n console.log(\"download failed for\", id);\n promReject(false);\n });\n }\n } else {\n console.log(\"failed to get metadata for\", key);\n promReject(false);\n }\n });\n return promise;\n}",
"title": ""
},
{
"docid": "9f7f700ef6e5cfe0d1149f8caf328bdc",
"score": "0.5674322",
"text": "function get_signed_request(file){\n\t\t\tconsole.log(\"getting signed request\")\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"GET\", \"https://revisit-app.herokuapp.com/sign_s3?file_name=\"+file.name+\"&file_type=\"+file.type);\n\t\txhr.onreadystatechange = function(){\n\t\t if(xhr.readyState === 4){\n\t\t if(xhr.status === 200){\n\t\t var response = JSON.parse(xhr.responseText);\n\t\t upload_file(file, response.signed_request, response.url);\n\t\t }\n\t\t else{\n\t\t alert(\"Could not get signed URL.\");\n\t\t }\n\t\t }\n\t\t};\n\t\txhr.send();\n\t\t}",
"title": ""
},
{
"docid": "054360c7f16e8d9e89613a65b53c1b90",
"score": "0.5662791",
"text": "function uploadFile(file, s3Data, url){\n const xhr = new XMLHttpRequest();\n xhr.open('POST', s3Data.url);\n xhr.setRequestHeader('x-amz-acl', 'public-read', 'Access-Control-Allow-Origin');\n const postData = new FormData();\n for(key in s3Data.fields){\n postData.append(key, s3Data.fields[key]);\n }\n postData.append('file', file);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200 || xhr.status === 204){\n document.getElementById('sig-url').value = url;\n }\n else{\n //alert('Could not upload file.');\n }\n }\n };\n xhr.send(postData);\n }",
"title": ""
},
{
"docid": "2464dfd54a02512426fe08a53c98c935",
"score": "0.5659179",
"text": "function uploadToS3(file) {\n let s3bucket = new AWS.S3({\n accessKeyId: ACCESS,\n secretAccessKey: SECRET,\n Bucket: BUCKET_NAME\n });\n s3bucket.createBucket(function () {\n var params = {\n Bucket: BUCKET_NAME,\n Key: file.name,\n Body: file.data\n };\n s3bucket.upload(params, function (err, data) {\n if (err) {\n console.log('error in callback');\n console.log(err);\n }\n console.log('success');\n console.log(data);\n });\n });\n}",
"title": ""
},
{
"docid": "40f872aeb0cc6fd5366966560e06f2ea",
"score": "0.5656655",
"text": "deleteFile(folder, key) {\r\n return new Promise((resolve, reject) => {\r\n // S3 Configs\r\n var uploadParams = { Bucket: folder, Key: key };\r\n // call S3 to retrieve upload file to specified bucket\r\n this.instance.deleteObject(uploadParams, function (err, data) {\r\n if (err) {\r\n console.log(\"Error\", err);\r\n reject(err);\r\n }\r\n if (data) {\r\n console.log(\"Delete Success\", true);\r\n resolve(data);\r\n }\r\n });\r\n });\r\n }",
"title": ""
},
{
"docid": "cacae36fc58522f99ba21c5d47ef2796",
"score": "0.56563175",
"text": "async function requestFileFromVault(){\n // const cid = \"QmYVkBo29VmCFn857GwdkSd4ZLERhZbg3pnjKnsqELouH6\";\n // const result = await CASManager.getFileFromIPFS(cid);\n\n // get bucket structure\n const folder = await CASManager.getFilesInPath(\"/\");\n console.log(folder);\n setFileStructure(folder);\n setFolderBeingRendered(folder.item);\n }",
"title": ""
},
{
"docid": "0c9e51beeed2266009488fb09d2fc662",
"score": "0.5652511",
"text": "function uploadToS3(uuidFileName, currentFilePath) {\n return new Promise((resolve, reject) => {\n const bucketName = `transcodebox`;\n\n fs.readFile(currentFilePath, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve({\n Bucket: bucketName,\n Key: `${uuidFileName}`,\n Body: data,\n });\n }\n });\n }).then((objectParams) => {\n return new AWS.S3({ apiVersion: \"2009-03-01\" })\n .putObject(objectParams)\n .promise()\n .then(() => {\n console.log(\"Successfully uploaded to S3\");\n });\n });\n}",
"title": ""
},
{
"docid": "7b413bb9acbda9e5b1d27985df8d9417",
"score": "0.56500596",
"text": "async function awsUploadImages(file, filePath) {\n const params = {\n Bucket: BUCKET_NAME,\n Key: `${filePath}`,\n Body: file,\n };\n\n try {\n const response = await s3.upload(params).promise();\n console.log(response);\n return response.Location;\n } catch (error) {\n console.log(error);\n throw new Error();\n }\n}",
"title": ""
},
{
"docid": "74c22a5562f344cae79d6cfbcc46faed",
"score": "0.56416696",
"text": "async function uploadS3(filePath, folderName, deleteFile, callback) {\n\n var s3 = new AWS.S3({useAccelerateEndpoint: true}); \n //configuring parameters\n var params = {\n Bucket: 'docintact',\n Body: fs.createReadStream(filePath),\n Key: folderName + \"/\" + Date.now() + \"_\" + path.basename(filePath)\n };\n s3.upload(params, function(err, data) {\n //handle error\n if (err) {\n console.log(\"Error\", err);\n }\n //success\n if (data) {\n if (deleteFile)\n if (fs.existsSync(filePath)) fs.unlinkSync(filePath)\n if (callback) callback(data.Location);\n else return data.Location;\n }\n });\n}",
"title": ""
},
{
"docid": "42a76e59c59bd6965fe62eda81905155",
"score": "0.56384826",
"text": "function deleteFile(key) {\n try {\n const deleteParams = {\n Bucket: bucketName,\n Key: key\n }\n return s3.deleteObject(deleteParams).promise()\n } catch (error) {\n console.log(error);\n }\n}",
"title": ""
},
{
"docid": "266ef704bdb49f091d4c512a15d57425",
"score": "0.5627141",
"text": "function _upload(s3, params, executor) {\n // call S3 to retrieve upload file to specified bucket\n const uploadParams = { Bucket: params.bucket, Key: '', Body: '' };\n const file_name = params.remote_file || path.basename(params.local_file);\n\n let fileStream = fs.createReadStream(params.local_file);\n fileStream.on('error', err => {\n executor.logger.log('error', 'S3 upload reading file Error', params.local_file, err);\n });\n\n uploadParams.Body = fileStream;\n uploadParams.Key = file_name;\n\n s3.upload(uploadParams, (err, data) => {\n if (err) {\n const endOptions = {\n end: 'error',\n messageLog: `S3 upload file Error: ${err}`,\n err_output: `S3 upload file Error: ${err}`\n };\n executor.end(endOptions);\n } else {\n const endOptions = {\n end: 'end',\n data_output: data\n };\n executor.end(endOptions);\n }\n });\n}",
"title": ""
},
{
"docid": "ebb99b4d2f20f14e9bdd3b5de918988c",
"score": "0.5624065",
"text": "constructor(...args) {\n const options = optionsFromArguments(args);\n this._region = options.region;\n this._bucket = options.bucket;\n this._bucketPrefix = options.bucketPrefix;\n this._directAccess = options.directAccess;\n this._fileAcl = options.fileAcl;\n this._baseUrl = options.baseUrl;\n this._baseUrlDirect = options.baseUrlDirect;\n this._signatureVersion = options.signatureVersion;\n this._globalCacheControl = options.globalCacheControl;\n this._encryption = options.ServerSideEncryption;\n this._generateKey = options.generateKey;\n // Optional FilesAdaptor method\n this.validateFilename = options.validateFilename;\n\n const s3Options = {\n params: { Bucket: this._bucket },\n region: this._region,\n signatureVersion: this._signatureVersion,\n globalCacheControl: this._globalCacheControl,\n };\n\n if (options.accessKey && options.secretKey) {\n awsCredentialsDeprecationNotice();\n s3Options.accessKeyId = options.accessKey;\n s3Options.secretAccessKey = options.secretKey;\n }\n\n Object.assign(s3Options, options.s3overrides);\n\n this._s3Client = new AWS.S3(s3Options);\n this._hasBucket = false;\n }",
"title": ""
},
{
"docid": "900257a98fb86606f6e29d28e4b17ede",
"score": "0.5609047",
"text": "generateUrl (filename, ttl = 300) { // obs default\n const { SignedUrl } = this.s3.createSignedUrlSync({\n Method: 'GET',\n Bucket : this.bucket,\n Key : filename,\n Expires: ttl,\n })\n return SignedUrl\n }",
"title": ""
},
{
"docid": "a34f54a60353a6bcb6035928ec97d383",
"score": "0.5597625",
"text": "async function getTokens() {\n const token = await s3\n .getObject({\n Bucket: 'test',\n Key: 'token.json'\n })\n .promise();\n return JSON.parse(token.toString());\n}",
"title": ""
}
] |
5a49c45b0792a9d0cafb802ba38a878f | Hall cancel button click | [
{
"docid": "bde40fae169956ade9014610743b0ca9",
"score": "0.0",
"text": "handleCancel() {\n this.setState({\n selectedHallStandartPrice: null,\n selectedHallVipPrice: null,\n });\n }",
"title": ""
}
] | [
{
"docid": "03b83e897c1214d2ef5020b40b9eab6c",
"score": "0.7649614",
"text": "_onCancelClicked() {\n this._resetToDefault();\n this.dispatchEvent(new Event('Cancel'));\n }",
"title": ""
},
{
"docid": "1e9fa2c21c7c1de87d2da6b870292ef6",
"score": "0.75249165",
"text": "function cancelClicked() {\n setCancelButton(false);\n setEdit(false);\n }",
"title": ""
},
{
"docid": "b7e8f985d3e6d818d1f6a4e3ebdba8ce",
"score": "0.7480595",
"text": "function cancelButton(){\n w.close();\n}",
"title": ""
},
{
"docid": "6ae116e2d4ffa545d9e1d794ec3b6d94",
"score": "0.7367164",
"text": "function cancelButtonClick(){\n \n JSLogger.getInstance().traceEnter();\n \n var callbacks = getParameter(PARAM_CALLBACKS_C, parametersM);\n if (callbacks != null){\n var callbackCancel = getParameter(PARAM_CALLBACK_CANCEL_C, callbacks);\n if (callbackCancel != null){\n JSLogger.getInstance().trace(\"Excuting callback cancel\");\n callbackCancel();\n }\n }\n \n divFormM.hide();\n $('.Data-Entry-Form-Title-Bar').remove();\n $('.Data-Entry-Form-Bar-Buttons').remove();\n $('#Data-Entry-Form-Data-Window-Background').remove();\n JSLogger.getInstance().traceExit();\n }",
"title": ""
},
{
"docid": "7908058ebebb3ee16845bd65cc25858d",
"score": "0.7359396",
"text": "cancelAction (e) {\n return \"fridge\"\n }",
"title": ""
},
{
"docid": "ded97bb7188381179f5b0c0bbe05594b",
"score": "0.7256304",
"text": "function button_cancel_onClick() {\n w.close();\n w = undefined;\n mainWindow.refresh();\n }",
"title": ""
},
{
"docid": "b463b3da9f9c0855b4e1a62a6c20ab3f",
"score": "0.7245126",
"text": "cancel () {\n this.triggerEvent('cancel:end')\n this.close()\n }",
"title": ""
},
{
"docid": "2b41751881be66469bcd0678ed983d99",
"score": "0.71463394",
"text": "cancel () {\n this.trigger('cancel')\n this.el.close()\n }",
"title": ""
},
{
"docid": "b5a42366973d91fda99183bf216681af",
"score": "0.71363264",
"text": "function cancel(e) {\n e.stopPropagation();\n e.preventDefault();\n}",
"title": ""
},
{
"docid": "36441121bbedab24c23b53400752f647",
"score": "0.7132748",
"text": "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}",
"title": ""
},
{
"docid": "36441121bbedab24c23b53400752f647",
"score": "0.7132748",
"text": "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}",
"title": ""
},
{
"docid": "36441121bbedab24c23b53400752f647",
"score": "0.7132748",
"text": "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}",
"title": ""
},
{
"docid": "36441121bbedab24c23b53400752f647",
"score": "0.7132748",
"text": "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}",
"title": ""
},
{
"docid": "054edbd5932c2357b61e5e27da12d9e7",
"score": "0.7119083",
"text": "function cancel() {\n focusedControl.fire('cancel');\n }",
"title": ""
},
{
"docid": "054edbd5932c2357b61e5e27da12d9e7",
"score": "0.7119083",
"text": "function cancel() {\n focusedControl.fire('cancel');\n }",
"title": ""
},
{
"docid": "e55ae1a1526749c48dd627b6a3d9cfce",
"score": "0.7099097",
"text": "function cancelClicked(){\n console.log(\"cancel button clicked\");\n clearAddStudentForm();\n}",
"title": ""
},
{
"docid": "7f3f2d1773547b1b6ec862c2d9b941fc",
"score": "0.70627075",
"text": "_cancel() {\n this._dialog.close();\n }",
"title": ""
},
{
"docid": "82bc57f054a1abe560b825497ce6fb35",
"score": "0.7050463",
"text": "function cancelBtn(id){\n btnID = id;\n console.log(btnID)\n MODEL.getView(btnID);\n}",
"title": ""
},
{
"docid": "9c3de4b0e000f76201e3ca563eaa12b9",
"score": "0.7050227",
"text": "function CancelButtonClicked(value) \n{\n IMWidget.close();\n}",
"title": ""
},
{
"docid": "3b70aa173da8527aca01c6c4d3cc5477",
"score": "0.703123",
"text": "function cancel(){n.fire(\"cancel\")}",
"title": ""
},
{
"docid": "ff10529aa7cd9f172cbc143e45cba723",
"score": "0.7027144",
"text": "function cancelClicked()\n{\n dwscripts.setCommandReturnValue(\"\");\n window.close();\n}",
"title": ""
},
{
"docid": "83538927741ae31a89c29d2230d0f996",
"score": "0.69939077",
"text": "function cancelButton() {\n\n dialogs.confirm({\n title: L('confirm_delete_snapp_title'),\n message: L('confirm_delete_snapp_message'),\n no: L('button_no'),\n yes: L('button_yes'),\n callback: function() {\n\n cancelAllUploads();\n $.postphoto.close();\n }\n });\n}",
"title": ""
},
{
"docid": "3d3f8935d92d06d2ca8d8c7129466673",
"score": "0.6993151",
"text": "function cancel_op()\n {\n hide_all_dialogs();\n jQuery(\"#action\").val(\"\");\n }",
"title": ""
},
{
"docid": "184435f09de6af95f5710adf10ef0062",
"score": "0.6962613",
"text": "cancel() {}",
"title": ""
},
{
"docid": "184435f09de6af95f5710adf10ef0062",
"score": "0.6962613",
"text": "cancel() {}",
"title": ""
},
{
"docid": "f6d758f43b0ddb287a33570686187493",
"score": "0.6935289",
"text": "cancelButtonClickEventListener(e)\n\t{\n\t\tthis.modalPanel.hide();\n\t\tthis.fileSelectedCallback(null);\n\t}",
"title": ""
},
{
"docid": "4857a342ef3a444f8782cfea74c29a0b",
"score": "0.69210804",
"text": "function onClickCancel (event) {\n console.log(\"event\", event);\n console.log(\"button\", this.context);\n setValueNotWritable($.fn.showConfirm, \"canSubmit\", false);\n $(this.dialogId).dialog(\"close\");\n }",
"title": ""
},
{
"docid": "e0249f75aaa9424894578db11649795a",
"score": "0.69204384",
"text": "onCancel(e){\n // F.notify(\"Bouton CANCEL cliqué\")\n isDefined(this.methodOnCancel) && this.methodOnCancel.call()\n this.close()\n }",
"title": ""
},
{
"docid": "2c2dd5b2fdfb42ccb8d912b008c47b9d",
"score": "0.6905593",
"text": "function cancelHandler() {\n console.log(\"Cancel pressed\");\n setModalVisible(false);\n }",
"title": ""
},
{
"docid": "b0d133e87b2c533af91e5ba1c3fc005d",
"score": "0.68886685",
"text": "function onClickCancelHandler() {\r\n revertManagementData();\r\n }",
"title": ""
},
{
"docid": "db305ca2146d30f219c1195fcd5f5f56",
"score": "0.6844728",
"text": "function CancelButton_Click() {\r\n\t\tShowMessage('Changes canceled.', 'warning');\r\n\t\tShowPage(_originalPage);\r\n\t}",
"title": ""
},
{
"docid": "565a71b6443ad82e3be05b632821696d",
"score": "0.684339",
"text": "_onCancelClick() {\n // helps to avoid more often an ios8 safari missplaced cursor bug\n this.$('.js-input').blur()\n\n this.reset().focus()\n }",
"title": ""
},
{
"docid": "ac26fa83a60f571cae6d7eda37bb3a84",
"score": "0.6825291",
"text": "cancel() {\n this.userActed('cancel');\n }",
"title": ""
},
{
"docid": "ac26fa83a60f571cae6d7eda37bb3a84",
"score": "0.6825291",
"text": "cancel() {\n this.userActed('cancel');\n }",
"title": ""
},
{
"docid": "1327170b3c18826cf56c7e48bb3a769d",
"score": "0.6820892",
"text": "function Cancel() {\r\n if (Task.NavClick == false && !Task.CancelDisabled) {\r\n Task.NavClick = true;\r\n DisableCancel();\r\n DisableNext();\r\n DisableBack();\r\n DisableFinish();\r\n DisableOK();\r\n if (Task.CancelDirect)\r\n {\r\n ExitTask();\r\n }\r\n else {\r\n document.frmTask.target= \"_top\";\r\n document.frmTask.Method.value = \"CANCEL\";\r\n document.frmTask.submit();\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "03733b3af9c6dc42ea3bebc4c0fc6ca1",
"score": "0.68182176",
"text": "onOk() {\n console.log(\"Cancel\");\n }",
"title": ""
},
{
"docid": "bb9854f631deec7d28ee6b5673112ab9",
"score": "0.68060464",
"text": "onCancel () {\n this.show(false)\n this.emitter.emit('cancel', {})\n }",
"title": ""
},
{
"docid": "15098cf2674fcf1c3d7baaae6e259d2a",
"score": "0.6781711",
"text": "handleCancelButton(){\n console.log(\"handleCancelButton\");\n }",
"title": ""
},
{
"docid": "934934fcb12d5789530c65876e968cfc",
"score": "0.6777206",
"text": "function cancelRequest(request, button) {\n\t\trequest.abort();\n\t\tbutton.classList.remove(\"working\");\n\t\tbutton.disabled = false;\n\t}",
"title": ""
},
{
"docid": "bde30d7fe239d3f2287cd7d901ff0a21",
"score": "0.67734957",
"text": "cancel() {\n this.runAndShowMessageOnException(() => {\n if (this.onCancel) {\n this.onCancel();\n }\n });\n this.hide();\n }",
"title": ""
},
{
"docid": "43df2fe17bc800047917385e92f47c25",
"score": "0.6770914",
"text": "function cancelClicked(){\n clearAddStudentForm();\n}",
"title": ""
},
{
"docid": "f81dee075699f4dcb6f9d519b5205263",
"score": "0.6767756",
"text": "function cancelClick() {\n if (window.event) window.event.cancelBubble = true;\n return false;\n}",
"title": ""
},
{
"docid": "178cf791be7c4396d9632e2bdeb30313",
"score": "0.67664975",
"text": "function CancelClick() {\n jQuery(\".HeaderButton\").trigger(\"click\");\n jQuery(\"#SearchFilter\").hide();\n return false;\n}",
"title": ""
},
{
"docid": "5abc99c29bc99f1b5c18221c3832b40a",
"score": "0.6764311",
"text": "handleCancel(){\n\t\tthis.clearInputs();\n\t}",
"title": ""
},
{
"docid": "5abc99c29bc99f1b5c18221c3832b40a",
"score": "0.6764311",
"text": "handleCancel(){\n\t\tthis.clearInputs();\n\t}",
"title": ""
},
{
"docid": "fb2a1e1f071d4a0b656bfe365bcc75b9",
"score": "0.6761939",
"text": "function cancel(event) {\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n return false;\n }",
"title": ""
},
{
"docid": "c0c01c2dcd8848c0c7ee7183cd300d77",
"score": "0.67538166",
"text": "function Cancellation() { }",
"title": ""
},
{
"docid": "c0c01c2dcd8848c0c7ee7183cd300d77",
"score": "0.67538166",
"text": "function Cancellation() { }",
"title": ""
},
{
"docid": "a74bdae78e3cd3f80370eed51348c960",
"score": "0.673755",
"text": "function onCancelButtonClick() {\n modal.close();\n }",
"title": ""
},
{
"docid": "086a18d119112ebefc0274fb1624ad4b",
"score": "0.6733329",
"text": "function cancelClicked(){\n clearAddStudentForm();\n}",
"title": ""
},
{
"docid": "6d8d6c0049d1a6393740db31fda3a38c",
"score": "0.6731109",
"text": "function clickedCancel()\n{\n window.close();\n}",
"title": ""
},
{
"docid": "af9f5e3724de3d97c56337bc6529659c",
"score": "0.6726036",
"text": "handleClickCancel(event) {\n event.preventDefault();\n\n FlowRouter.go('/lobby');\n }",
"title": ""
},
{
"docid": "979cb1d3153b23ea72f546fea6c98cac",
"score": "0.67147946",
"text": "function cancel() {\n $modalInstance.dismiss();\n }",
"title": ""
},
{
"docid": "e40d7609ae7b36a09a7baa94ca4b6a70",
"score": "0.6706005",
"text": "function cancel() {\n // remove invite box\n div.parentNode.removeChild(div);\n // restore initial event listeners\n sourcelines.addEventListener('click', lineSelectStart);\n sourcelines.removeEventListener('click', cancel);\n // remove styles on selected lines\n removeSelectedCSSClass();\n // restore tooltip element\n restoreTooltip();\n }",
"title": ""
},
{
"docid": "fcf2aa1383e3544186a293cdf6de04c4",
"score": "0.6699276",
"text": "function Cancel(event) {\n event.preventDefault();\n cancel();\n }",
"title": ""
},
{
"docid": "6cd7f5f249825c9cf6c28160a0b89aa7",
"score": "0.66980475",
"text": "function onCameraCancelButtonClick () {\n // Make sure user can't click more than once\n if (this.getAttribute('clicked') === '1') {\n return false;\n } else {\n this.setAttribute('clicked', '1');\n }\n destroyCameraPreview();\n errorCallback('no image selected');\n }",
"title": ""
},
{
"docid": "ccbee0c31267e8149d6c9d86281057d2",
"score": "0.6669898",
"text": "_onCancel(ev) {\n\t\tthis._form.reset();\n\t\tthis._events.fire(\"canceled\");\n\t}",
"title": ""
},
{
"docid": "139ef4965ab244f7071bb5dfa25f94e2",
"score": "0.66642946",
"text": "function cancelButton(){\n const closeButton = document.querySelector('.cancel');\n const exitButton = document.querySelector('.close');\n closeButton.addEventListener('click', function(){\n winnerPannel.classList.remove('showPanel');\n });\n exitButton.addEventListener('click', function(){\n winnerPannel.classList.remove('showPanel');\n });\n}",
"title": ""
},
{
"docid": "3daa09793ab0f9d9e7808b5c55c7fbc3",
"score": "0.66627806",
"text": "function Cancellation() {}",
"title": ""
},
{
"docid": "3daa09793ab0f9d9e7808b5c55c7fbc3",
"score": "0.66627806",
"text": "function Cancellation() {}",
"title": ""
},
{
"docid": "3daa09793ab0f9d9e7808b5c55c7fbc3",
"score": "0.66627806",
"text": "function Cancellation() {}",
"title": ""
},
{
"docid": "3daa09793ab0f9d9e7808b5c55c7fbc3",
"score": "0.66627806",
"text": "function Cancellation() {}",
"title": ""
},
{
"docid": "47a3e489696d2147a5fdf48c2379abd6",
"score": "0.66568553",
"text": "cancel_() {\n this.dialog_.close();\n }",
"title": ""
},
{
"docid": "d6e64d582578e4181de354ae2862c315",
"score": "0.6614954",
"text": "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }",
"title": ""
},
{
"docid": "3655a963a526b0f7e2718a0e13c12f70",
"score": "0.6613041",
"text": "function cancelClicked() {\n clearAddStudentForm();\n}",
"title": ""
},
{
"docid": "3655a963a526b0f7e2718a0e13c12f70",
"score": "0.6613041",
"text": "function cancelClicked() {\n clearAddStudentForm();\n}",
"title": ""
},
{
"docid": "3fb18cb115e5d4fa0db62655dacdec5b",
"score": "0.6606172",
"text": "function cancel() {\n\t\t\tvar cancelBtn = $('.cancel-btn');\n\t\t\tcancelBtn.on('click', function (event) {\n\t\t\t\thideOutsideEmployeeForm();\n\t\t\t});\n\t\t}",
"title": ""
},
{
"docid": "739875c8a90988163cd14d55083e0354",
"score": "0.66047096",
"text": "function clickCancel() {\n\t textSection.select('.field-template').property('value', _origSettings.template);\n\t context.storage('background-custom-template', _origSettings.template);\n\t this.blur();\n\t modal.close();\n\t }",
"title": ""
},
{
"docid": "77cdda1a0483a863d5f5b9c79424058c",
"score": "0.66024613",
"text": "onCancel() {\n this.toggleFormDisplay(false);\n }",
"title": ""
},
{
"docid": "a87681b0b4df9194289ba8144a77a98a",
"score": "0.6593788",
"text": "function cancelVisualElement() {\n // Close modal dialog\n $(\".ui-dialog-content\").dialog(\"close\");\n $(\"#vcl-update-modal\").remove();\n return false;\n }",
"title": ""
},
{
"docid": "c1db8f5a33966d91e60a5b7f891574ec",
"score": "0.6590058",
"text": "function cancelPopup(){\n $('.cancel-button').click(function(event){\n event.preventDefault();\n $(this).parent().fadeOut();\n });\n}",
"title": ""
},
{
"docid": "e0f285f3089fbe51a3349473178ce07e",
"score": "0.6588701",
"text": "function cancelBox() {\n\t\n\tvar cancelDiv=$('cancelBagger');\n\tif (!cancelDiv && GM_getValue('bagging')) {\n\t\tvar cancelDiv=makeBox('Grocery Clerk: ','cancelBagger');\n\t\t\n\t\tvar cancelButton=makeButton('Stop baggin\\' on your stuff');\n\t\tcancelButton.addEventListener('click', \n\t\t\t\tfunction() {\n\t\t\t\t\tGM_setValue('bagging', false);\n\t\t\t\t\tdocument.body.removeChild($('cancelBagger'));\n\t\t\t\t}, true);\n\t\tcancelDiv.appendChild(cancelButton);\n\t\tdocument.body.insertBefore(cancelDiv, document.body.firstChild);\n\t}\n\telse if (cancelDiv && !GM_getValue('bagging') ) {\n\t\tdocument.body.removeChild(cancelDiv);\n\t}\n}",
"title": ""
},
{
"docid": "6f1866e2bc59e28963eadd760465d30e",
"score": "0.6581272",
"text": "handleCancelClick() {\n const { emptyCondition, showFormOnEmptyClick, editClickFromCommon, creditCardEditCancelClick, toggleCreditCard } = this.props;\n if (emptyCondition) {\n showFormOnEmptyClick();\n } else if (editClickFromCommon) {\n creditCardEditCancelClick();\n } else {\n toggleCreditCard(false);\n }\n }",
"title": ""
},
{
"docid": "77c8134cbde0dba42b806c09accaf015",
"score": "0.6563182",
"text": "cancelAction() {\n // opening a existing formula editor when trying to open a new one\n if (typeof this.contentManager.hasChanges === 'undefined') {\n // Set temporal image to null to prevent loading\n // an existent formula when strarting one from scrath. Make focus come back too.\n IntegrationModel.setActionsOnCancelButtons();\n\n try {\n Telemeter.telemeter.track(\"CLOSED_MTCT_EDITOR\", {\n toolbar: this.contentManager.toolbar,\n trigger: \"mtct_close\",\n });\n } catch (err) {\n console.error(err);\n }\n\n this.close();\n } else if (!this.contentManager.hasChanges()) {\n IntegrationModel.setActionsOnCancelButtons();\n\n try {\n Telemeter.telemeter.track(\"CLOSED_MTCT_EDITOR\", {\n toolbar: this.contentManager.toolbar,\n trigger: \"mtct_close\",\n });\n } catch (err) {\n console.error(err);\n }\n\n this.close();\n } else {\n this.showPopUpMessage();\n\n try {\n Telemeter.telemeter.track(\"CLOSED_MTCT_EDITOR\", {\n toolbar: this.contentManager.toolbar,\n trigger: \"mtct_close\",\n });\n } catch (err) {\n console.error(err);\n }\n }\n }",
"title": ""
},
{
"docid": "3704152dfd51912659c57fe846b95c41",
"score": "0.65568805",
"text": "function clearCancel(e){\n\n if(e.target.classList.contains('post-cancel')){\n ui.changeFormState('add');\n }\n\n e.preventDefault();\n}",
"title": ""
},
{
"docid": "e4b739e1881179b4db3b140ee992929c",
"score": "0.65420943",
"text": "function clearListenerOnCancelButton() {\n UIController.getElement(\n UIController.getSelectors().cancelButton\n ).removeEventListener('click', handleCancelButtonClick);\n }",
"title": ""
},
{
"docid": "f700ba105a7fd6b1ac1765adfe66c0fa",
"score": "0.653458",
"text": "function handleCancel() {\n closeme();\n return false;\n}",
"title": ""
},
{
"docid": "ae33f9e47502461f322352e5329193e9",
"score": "0.6523357",
"text": "cancel() {\n history.back();\n }",
"title": ""
},
{
"docid": "1a6fef38a2d5d24d1d18e5ee2d3c054e",
"score": "0.65206784",
"text": "function checkCancel(event) {\n if (event.which === 27) {\n preventDefault(event);\n cancel();\n }\n }",
"title": ""
},
{
"docid": "3196d38e0e7a4041099ef60f9c103a41",
"score": "0.6500515",
"text": "function cancel(e) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n return false;\n}",
"title": ""
},
{
"docid": "ac4a926f2743689cd238d6a389fb2147",
"score": "0.64973634",
"text": "function _nameCancel(e){\n if(e.target.id === 'x-cancel'){\n _askName('x');\n }else{\n _playerOInitial();\n }\n }",
"title": ""
},
{
"docid": "6e1dd98fbbbbcdbc57e41900a768e496",
"score": "0.64950085",
"text": "function _settingsCancel() {\n console.log(\"Cancel clicked\")\n _settingsHide();\n}",
"title": ""
},
{
"docid": "dfb949389c17daf0dd538ce0fa43220f",
"score": "0.6492015",
"text": "cancel(c_element) { c_element.style.visibility = \"hidden\"; this.cancelTask = true; this.pollURL(); }",
"title": ""
},
{
"docid": "d87fdc5ebe9eccfbbd6405bbc44dcb91",
"score": "0.6480607",
"text": "function onButtonCancelOptionsClicked() {\n\tcloseMainMenu();\n}",
"title": ""
},
{
"docid": "77d6d94a2ce7655d66b452376a642026",
"score": "0.6469599",
"text": "function cancel() {\n return invoke(\"cancel\");\n }",
"title": ""
},
{
"docid": "c075466511d162af5a4aa5cdc1e0374c",
"score": "0.64689827",
"text": "cancelPopUp(event) {\n \n const payload = {\n \"label\": event.target.label\n }\n this.dispatchEvent(new CustomEvent('closeQuickAction', { detail: {payload} }));\n }",
"title": ""
},
{
"docid": "3e19085d10f4d91b2eb019640a8b2862",
"score": "0.64664185",
"text": "cancel () {\n this.setState({\n isClicked: false\n })\n }",
"title": ""
},
{
"docid": "ca1322a23ba1620bf8ef225ef6385e24",
"score": "0.64643425",
"text": "function handleCancel() {\n if (window.confirm(\"Cancel the battle? Are you sure?\")) {\n // Reset the app\n reset();\n }\n}",
"title": ""
},
{
"docid": "da1257d205eb5244ff88369d810e5ab0",
"score": "0.64611024",
"text": "onCancel_() {\n this.close();\n }",
"title": ""
},
{
"docid": "787bf20ad8e3f607254a212bd76592dc",
"score": "0.6443909",
"text": "function c(e) {\n e.cancelToken && e.cancelToken.throwIfRequested();\n }",
"title": ""
},
{
"docid": "eb32cee66b96c5c846c0cdf25342631f",
"score": "0.644269",
"text": "_onIgnoreClicked(e) {\n e.preventDefault();\n e.stopPropagation();\n\n this.close();\n }",
"title": ""
},
{
"docid": "8abad7003f9fb76188ded41b51c433d9",
"score": "0.6441187",
"text": "function onInputCancel() {\n setFakeboxVisibility(true);\n}",
"title": ""
},
{
"docid": "3273a3aa9823634c78448884c41264c4",
"score": "0.6437747",
"text": "cancelRow() {\n cy.get('.btn-circle')\n .last()\n .click();\n }",
"title": ""
},
{
"docid": "ffa5606f8e27d37096944c5cee03b5c0",
"score": "0.6429105",
"text": "function cancelComment() {\n\t\tcommentFormsCancel.click(function(e) {\n\t\t\tremoveAnchorClass();\n\t\t\tclosePane();\n\t\t\t\n\t\t\te.preventDefault();\n\t\t});\n\t}",
"title": ""
},
{
"docid": "d1163f44c091277487c307a3d2e8fd77",
"score": "0.6428773",
"text": "function cancelData() {\n $(\"#btnCancel\").click(function() {\n clearValueFormInput();\n $(\"div.formViewMenu\").hide();\n });\n\n $(\"#btnCancelMenu\").click(function() {\n clearValueFormInputMenu();\n });\n}",
"title": ""
},
{
"docid": "2f602bf01e038ed0d21970c957037cb8",
"score": "0.64194864",
"text": "handleCancel() {\n this.bShowConfirmationModal = true;\n }",
"title": ""
},
{
"docid": "38c457d4d80909f18fe8c6eb05b3cf61",
"score": "0.6417055",
"text": "function cancel() {\n\tdocument.getElementById(\"cancel\").onclick = function() {\n\n\t\t$('.timer-container').slideUp();\n\n\t\tchrome.runtime.sendMessage({\n\t\t\t\"command\": \"cancelTimer\"\n\t\t});\n\n\t\tchrome.browserAction.setBadgeText({\"text\" : \"\"});\n\n\t}\n}",
"title": ""
},
{
"docid": "d6b54568956715cb7887a9f43ff71e8a",
"score": "0.6415855",
"text": "cancel() {\n this.close();\n }",
"title": ""
},
{
"docid": "2868df931c5cf90d58364bf3b1a08a01",
"score": "0.6412812",
"text": "cancel() {\n this._location.back();\n }",
"title": ""
},
{
"docid": "61c840401d02d1ce9837c18b6850bc53",
"score": "0.6410267",
"text": "onCancel() {\n\t\tthis.done();\n\t}",
"title": ""
},
{
"docid": "b0187be28cb4e2e605b79284966d6803",
"score": "0.6406823",
"text": "function cancelButton(options = {}) {\n options.accept = false;\n return createButton(options);\n }",
"title": ""
}
] |
bed61a5a2d5d99571a3c47f85b314a39 | at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemptively. | [
{
"docid": "67779ecf4e40aa3fffbd2a69bdff2d9e",
"score": "0.0",
"text": "function maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n }",
"title": ""
}
] | [
{
"docid": "a2fd87ef2c5ac346e3c946af2793352b",
"score": "0.6972088",
"text": "_read() {\n if (!this._emittedReadable && !this._isPushing) {\n this.once('readable', this._startPushing.bind(this));\n } else if (!this._isPushing) {\n this._startPushing();\n }\n }",
"title": ""
},
{
"docid": "c5eec4afd3df3b429322dc2886b1c567",
"score": "0.6744838",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "c5eec4afd3df3b429322dc2886b1c567",
"score": "0.6744838",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "b9507326e6c08977d9affa20e7d6c660",
"score": "0.6742702",
"text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){// Only flow one buffer at a time\nif(state.flowing&&state.length)return state.buffer.head.data.length;else return state.length;}// If we're asking for more than the current hwm, then raise the hwm.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\nif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "e565f8ee7bda70dbfad6d8128ad68d46",
"score": "0.6654217",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "e565f8ee7bda70dbfad6d8128ad68d46",
"score": "0.6654217",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "e565f8ee7bda70dbfad6d8128ad68d46",
"score": "0.6654217",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "e565f8ee7bda70dbfad6d8128ad68d46",
"score": "0.6654217",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "e565f8ee7bda70dbfad6d8128ad68d46",
"score": "0.6654217",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "18427f2d3d1c867c901f2b6538e7ac86",
"score": "0.6618481",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "18427f2d3d1c867c901f2b6538e7ac86",
"score": "0.6618481",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "18427f2d3d1c867c901f2b6538e7ac86",
"score": "0.6618481",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "18427f2d3d1c867c901f2b6538e7ac86",
"score": "0.6618481",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "e1462c831ff6bcbddd952f7165fba9bb",
"score": "0.6576065",
"text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;nextTick(maybeReadMore_,stream,state);}}",
"title": ""
},
{
"docid": "fbdb557d66dfbe0cfdf2989024a94564",
"score": "0.6504958",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "5a71ad436419063f53a02dfa66b013fc",
"score": "0.65003943",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}",
"title": ""
},
{
"docid": "5a71ad436419063f53a02dfa66b013fc",
"score": "0.65003943",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}",
"title": ""
},
{
"docid": "5a71ad436419063f53a02dfa66b013fc",
"score": "0.65003943",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}",
"title": ""
},
{
"docid": "5a71ad436419063f53a02dfa66b013fc",
"score": "0.65003943",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}",
"title": ""
},
{
"docid": "5a71ad436419063f53a02dfa66b013fc",
"score": "0.65003943",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}",
"title": ""
},
{
"docid": "8f5b39bad094219c1384a0eb5f31eba6",
"score": "0.6486796",
"text": "function onReadable() {\n\t\tvar chunk;\n\t\twhile ( true ) {\n\t\t\tchunk = stream.read();\n\t\t\tif ( chunk === null ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdata.push( chunk );\n\t\t\tlen += chunk.length;\n\t\t}\n\t}",
"title": ""
},
{
"docid": "609351c71b640a50894a5c0984fa2a9d",
"score": "0.6484717",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.",
"title": ""
},
{
"docid": "609351c71b640a50894a5c0984fa2a9d",
"score": "0.6484717",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.",
"title": ""
},
{
"docid": "609351c71b640a50894a5c0984fa2a9d",
"score": "0.6484717",
"text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.",
"title": ""
},
{
"docid": "d21b59735409021928c336d3bae9809f",
"score": "0.64622515",
"text": "function onread(buffer, offset, length) {\n var handle = this;\n var self = handle.owner;\n assert(handle === self._handle, 'handle != self._handle');\n\n var end = offset + length;\n debug('onread', global.errno, offset, length, end);\n\n if (buffer) {\n debug('got data');\n\n // read success.\n // In theory (and in practice) calling readStop right now\n // will prevent this from being called again until _read() gets\n // called again.\n\n // if we didn't get any bytes, that doesn't necessarily mean EOF.\n // wait for the next one.\n if (offset === end) {\n debug('not any data, keep waiting');\n return;\n }\n\n // if it's not enough data, we'll just call handle.readStart()\n // again right away.\n self.bytesRead += length;\n\n // Optimization: emit the original buffer with end points\n if (self.ondata) self.ondata(buffer, offset, end);\n else self._readableState.onread(null, buffer.slice(offset, end));\n\n if (handle.reading && !self._readableState.reading) {\n handle.reading = false;\n debug('readStop');\n var r = handle.readStop();\n if (r)\n self._destroy(errnoException(errno, 'read'));\n }\n\n } else if (errno == 'EOF') {\n debug('EOF');\n\n if (self._readableState.length === 0)\n self.readable = false;\n\n if (self.onend) self.once('end', self.onend);\n\n // send a null to the _read cb to signal the end of data.\n self._readableState.onread(null, null);\n\n // internal end event so that we know that the actual socket\n // is no longer readable, and we can start the shutdown\n // procedure. No need to wait for all the data to be consumed.\n self.emit('_socketEnd');\n } else {\n debug('error', errno);\n // Error\n if (errno == 'ECONNRESET') {\n self._destroy();\n } else {\n self._destroy(errnoException(errno, 'read'));\n }\n }\n}",
"title": ""
},
{
"docid": "b88556dc464947182b86b6b52bc71f8b",
"score": "0.64576465",
"text": "function needMoreData (state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0)\n }",
"title": ""
},
{
"docid": "9da1df576dde6ebc99a70f187912c3e9",
"score": "0.64452726",
"text": "function howMuchToRead(n, state) {\n\t if (n <= 0 || state.length === 0 && state.ended) return 0;\n\t if (state.objectMode) return 1;\n\n\t if (n !== n) {\n\t // Only flow one buffer at a time\n\t if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n\t } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n\t if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n\t if (n <= state.length) return n; // Don't have enough\n\n\t if (!state.ended) {\n\t state.needReadable = true;\n\t return 0;\n\t }\n\n\t return state.length;\n\t} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "f653665586428d215aadd7a9723ff4b3",
"score": "0.64441216",
"text": "function howMuchToRead(n, state) {\n // Only flow one buffer at a time\n // If we're asking for more than the current hwm, then raise the hwm.\n // Don't have enough\n return n <= 0 || 0 === state.length && state.ended ? 0 : state.objectMode ? 1 : n !== n ? state.flowing && state.length ? state.buffer.head.data.length : state.length : (n > state.highWaterMark && (state.highWaterMark = computeNewHighWaterMark(n)), \n n <= state.length ? n : state.ended ? state.length : (state.needReadable = !0, 0));\n }",
"title": ""
},
{
"docid": "bf2a8dfc723f35c1e32e19f06e4b0bb4",
"score": "0.64379376",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n } // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "61b8a6581ba338fdf59af527a571dc55",
"score": "0.63818634",
"text": "function howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.",
"title": ""
},
{
"docid": "737c4ab818b0e17df2457cf3974e8475",
"score": "0.63683754",
"text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }",
"title": ""
},
{
"docid": "737c4ab818b0e17df2457cf3974e8475",
"score": "0.63683754",
"text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }",
"title": ""
},
{
"docid": "64206293ec74f224b6e3a9eaae07c78c",
"score": "0.63452095",
"text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }",
"title": ""
},
{
"docid": "64206293ec74f224b6e3a9eaae07c78c",
"score": "0.63452095",
"text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }",
"title": ""
},
{
"docid": "64206293ec74f224b6e3a9eaae07c78c",
"score": "0.63452095",
"text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }",
"title": ""
}
] |
8f550ce117488c919d190ccf608ac3af | Destroy this instance, returning the element to its previous state | [
{
"docid": "ec5171e5954257275c429ea4b270e816",
"score": "0.6602406",
"text": "destroy() {\n // Detach the event handlers\n this.detachEventHandlers();\n\n // Remove the bounded class from the element\n this.$element.removeClass('bounded');\n }",
"title": ""
}
] | [
{
"docid": "be30ef972a66757c14bf6d4692b641f6",
"score": "0.7902183",
"text": "destroy() {\r\n\t\tthis.element.remove();\r\n\t}",
"title": ""
},
{
"docid": "1dc0217323d1e938887ce28f76859f19",
"score": "0.78763896",
"text": "destroy() {\n\t\tthis.element.remove();\n\t}",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "96b12093c610edec90ec7773f8fca2aa",
"score": "0.7705633",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "5269a3375423e6e467eaa7063bbe7299",
"score": "0.7643699",
"text": "destroy() {\n return this.element.remove();\n }",
"title": ""
},
{
"docid": "e067af7007d81575671bc5a354f30104",
"score": "0.7583355",
"text": "destroy() {\n this.el.remove();\n }",
"title": ""
},
{
"docid": "fd9f735ff049947f0762533f47425121",
"score": "0.74653995",
"text": "destroy() {\n if (this.initialised === false) return;\n\n // Remove all event listeners\n this._removeEventListeners();\n\n // Reinstate passed element\n this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);\n this.passedElement.removeAttribute('tabindex');\n this.passedElement.removeAttribute('style', 'display:none;');\n this.passedElement.removeAttribute('aria-hidden');\n this.passedElement.removeAttribute('data-choice', 'active');\n\n // Re-assign values - this is weird, I know\n this.passedElement.value = this.passedElement.value;\n\n // Move passed element back to original position\n this.containerOuter.parentNode.insertBefore(this.passedElement, this.containerOuter);\n // Remove added elements\n this.containerOuter.parentNode.removeChild(this.containerOuter);\n\n // Clear data store\n this.clearStore();\n\n // Nullify instance-specific data\n this.config.templates = null;\n\n // Uninitialise\n this.initialised = false;\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "1dc6bcb1201c3688f4f0ec69a513b6b9",
"score": "0.7428398",
"text": "destroy() {\n this.element.remove();\n }",
"title": ""
},
{
"docid": "d27ffa7991137a8942ea59fae3d41809",
"score": "0.73211396",
"text": "destroy() {\r\n this.remove();\r\n return this;\r\n }",
"title": ""
},
{
"docid": "17bc95977d8f85ddde6717e6043cc631",
"score": "0.72923166",
"text": "destroy () {\n this.element.remove()\n }",
"title": ""
},
{
"docid": "f41a17f2a0a90209c76dfc34f8e866fd",
"score": "0.72770697",
"text": "destroy() {\n this.$el.empty();\n this.$el = null;\n }",
"title": ""
},
{
"docid": "48bebd93e37107a3f216f4e408d1d164",
"score": "0.7216403",
"text": "destroy() {\n this.element.remove()\n }",
"title": ""
},
{
"docid": "48bebd93e37107a3f216f4e408d1d164",
"score": "0.7216403",
"text": "destroy() {\n this.element.remove()\n }",
"title": ""
},
{
"docid": "bb8c9557095ab147982df47258f534ba",
"score": "0.72091216",
"text": "destroy() {\n\t\treturn this.update();\n\t}",
"title": ""
},
{
"docid": "1737d49e04df07c43dd8a7c8a6c19f42",
"score": "0.7169598",
"text": "destroy() {\n this.parentNode.removeChild(this.node);\n }",
"title": ""
},
{
"docid": "2ebfc6db72f30a89eb98d3d5b58b7a8b",
"score": "0.7088779",
"text": "destroy() {\n this.unbind();\n delete this.el;\n }",
"title": ""
},
{
"docid": "e92efb715bb6e9ec4da3d47b28edf1ea",
"score": "0.70735234",
"text": "destroy() {\n\t\t\n\t\tthis.container.removeChild(this.icon);\n\t\tthis.icon = null;\n\t\t\n\t\tthis.container.removeChild(this.label);\n\t\tthis.label = null;\n\t\t\n\t\tthis.container.parentNode.removeChild(this.container);\n\t\tthis.container = null;\n\t}",
"title": ""
},
{
"docid": "c18c0d2c4a82c8154b13c173db863eae",
"score": "0.7035726",
"text": "destroy() {\n this.clear();\n return this;\n }",
"title": ""
},
{
"docid": "91d4e02672212078a84d8ecd9852cf88",
"score": "0.7035599",
"text": "destroy() {\n // We wrap this next part in try...catch in case the element is already gone for some reason\n try {\n // Remove the node\n this.container.removeChild(this.wrapper);\n // Delete worker instance\n delete this.container.iwideo.worker;\n // Delete the instance\n delete this.container.iwideo;\n } catch (e) {\n // Nothing to do when error is invoked\n }\n }",
"title": ""
},
{
"docid": "bec1954ad1261af7095807a96492000e",
"score": "0.7028252",
"text": "destroy() {\n this._restore.parent.replaceChild(this._restore.element, this.containerEl);\n }",
"title": ""
},
{
"docid": "b187360559f6833e08d4d5f91ff3d1af",
"score": "0.70084155",
"text": "destroy() {\n this.clear();\n }",
"title": ""
},
{
"docid": "c40472d770d1cbb537c8fac1c4bec70c",
"score": "0.6998548",
"text": "destroy() {\n document.body.removeChild(this.element);\n }",
"title": ""
},
{
"docid": "1cc1a657d70087f3fee6ca99155e3222",
"score": "0.69642925",
"text": "destroy() {\n this.element.remove();\n this.subscriptions.dispose();\n }",
"title": ""
},
{
"docid": "dcfeb0b5d40d000e35d5ad5f8a32389e",
"score": "0.69483274",
"text": "destroy() {\n this.element.remove();\n // this.subscriptions.dispose();\n }",
"title": ""
},
{
"docid": "813a836f4116ef9097db330d971e2949",
"score": "0.6925977",
"text": "destroy() {\n this.domElement().outerHTML = \"\";\n SketchPad.removeElement(this.id);\n }",
"title": ""
},
{
"docid": "8b2cfb49f939498b64a1fe919fdbd1a5",
"score": "0.69235563",
"text": "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }",
"title": ""
},
{
"docid": "389978116a578edabc627983cbb2bf65",
"score": "0.6888465",
"text": "__destroy () {\n this.__stateWatcher()\n this.__resizeWatcher = false\n this.terminate()\n try {\n this.element.remove()\n } catch ( e ) {}\n delete this.parent.moduxComponent\n }",
"title": ""
},
{
"docid": "06b7a9776745365e1b8d03d72430b972",
"score": "0.6885021",
"text": "destroy() {\n this.element.remove();\n this.toDispose.forEach((d) => d.dispose());\n }",
"title": ""
},
{
"docid": "9fac5d47aea0e95becf480fbc7c9f1f1",
"score": "0.6882566",
"text": "detach() {\n this.element.parentNode.removeChild(this.element)\n }",
"title": ""
},
{
"docid": "1920d2ecc58c600d7b53f1004545d37a",
"score": "0.68805605",
"text": "destroy() {\n if (this.element) {\n // wheelInput etc. are created in setElement() and therefore\n // cannot exist if there is no element\n this.wheelInput.destroy();\n this.moveInput.destroy();\n this.keyInput.destroy();\n this.contextmenuInput.destroy();\n this.manager.destroy();\n this.wheelInput = null;\n this.moveInput = null;\n this.keyInput = null;\n this.contextmenuInput = null;\n this.manager = null;\n this.element = null;\n }\n }",
"title": ""
},
{
"docid": "03dc545be10960534743facfd095e94a",
"score": "0.6866549",
"text": "destroy() {\n const { $element } = this;\n\n if (this.loaded) {\n if (this.isImg && this.replaced) {\n $element.attr('src', this.originalUrl);\n }\n\n this.unbuild();\n $element.removeClass(CLASS_HIDDEN);\n } else if (this.isImg) {\n $element.off(EVENT_LOAD, this.start);\n } else if (this.$clone) {\n this.$clone.remove();\n }\n\n $element.removeData(NAMESPACE);\n }",
"title": ""
},
{
"docid": "aceb9e5f8f663e110993b832b249c63b",
"score": "0.68656313",
"text": "destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }",
"title": ""
},
{
"docid": "5f2bb08161e0862dd1942f2f254e0aa8",
"score": "0.68434507",
"text": "deactivate() {\n this.clear();\n }",
"title": ""
},
{
"docid": "0cfbfb671b2c02598dba11ebbca7bf40",
"score": "0.68261504",
"text": "destroy() {\n this.node().remove();\n }",
"title": ""
},
{
"docid": "dfd1ee6ef89918b74f355c8e5f96964d",
"score": "0.6795029",
"text": "destroy() {\n this._node.remove();\n }",
"title": ""
},
{
"docid": "2f0228a07b3c31bd713e7670a032c937",
"score": "0.67578703",
"text": "destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }",
"title": ""
},
{
"docid": "6377c8801f1546ee5392652efa639dc0",
"score": "0.67439854",
"text": "destroy() {\n this._data = null;\n }",
"title": ""
},
{
"docid": "fc205df49006c5b92aaf0eedd3364a48",
"score": "0.6739136",
"text": "destroy() {\n nodes.splice(nodes.indexOf(el), 1);\n }",
"title": ""
},
{
"docid": "4dd80c1430e0b51a83a7dfb81894ccdf",
"score": "0.67339426",
"text": "destroy() {\n this._super(...arguments);\n this._currentState.destroy(this);\n }",
"title": ""
},
{
"docid": "42ba82ba1efe1c690cb4442ad67ad027",
"score": "0.673294",
"text": "destroy() {\n destroyDestroyables(this);\n this.isDestroying = true;\n }",
"title": ""
},
{
"docid": "c24d2fd7c1d32a5034eb2a4238f08c43",
"score": "0.67295426",
"text": "destroy() {\r\n if (this.moving)\r\n this._mouseUp(this.mouseDownEvent);\r\n this.el.removeEventListener('mousedown', this._mouseDown);\r\n if (dd_touch_1.isTouch) {\r\n this.el.removeEventListener('touchstart', dd_touch_1.touchstart);\r\n this.el.removeEventListener('pointerdown', dd_touch_1.pointerdown);\r\n }\r\n this.host.removeChild(this.el);\r\n delete this.el;\r\n delete this.host;\r\n return this;\r\n }",
"title": ""
},
{
"docid": "9cacc80931f2fd2b79e0777eef0e965e",
"score": "0.67287064",
"text": "destroy() {\n this._id = null;\n this._el = null;\n this._callBack = null;\n this._topBound = null;\n this._bottomBound = null;\n }",
"title": ""
},
{
"docid": "31d6bc5f4ab46ac3b38f294a31943a4e",
"score": "0.6725795",
"text": "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n \n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }",
"title": ""
},
{
"docid": "4f19c608c6e48d7435c0d01374cdda03",
"score": "0.6689845",
"text": "destroy() {\n this.unbind();\n this.el.remove();\n delete this.comment;\n delete this.el;\n }",
"title": ""
},
{
"docid": "f8d77cedccc4b29511d7de8501d03814",
"score": "0.6683464",
"text": "function _destroy() {\n selected = null;\n }",
"title": ""
},
{
"docid": "cfa309d0458c5cc45ba98548323d4e22",
"score": "0.66811824",
"text": "_destroy() {\n var self = this;\n Object.keys(this.elements).forEach(function (element) {\n self.elements[element].remove();\n });\n }",
"title": ""
},
{
"docid": "35d114e3cffd9436b0eecc94def599bb",
"score": "0.6680231",
"text": "destroy() {\n delete this.node;\n delete this.index;\n delete this.text;\n delete this.parentNode;\n }",
"title": ""
},
{
"docid": "1033ce5c48d15fd9c88562c41ff10b22",
"score": "0.66785",
"text": "destroy() {\n this.subscriptions.dispose();\n this.element.remove();\n }",
"title": ""
},
{
"docid": "377d3d563e279054bf2b3fce822d190d",
"score": "0.66721004",
"text": "destroy() {\n\t\tgame.entities.splice(game.entities.indexOf(this), 1);\n\t\tthis.alive = false;\n\t}",
"title": ""
},
{
"docid": "45714c73481d10b9463becb1370fa9eb",
"score": "0.6660828",
"text": "willDestroyElement() {\n this._super(...arguments);\n this.editor.destroy();\n }",
"title": ""
},
{
"docid": "c2b3150ea0aa92d1eea4b252fe55507e",
"score": "0.665537",
"text": "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n\n // Add code to restore the element to its original state...\n\n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }",
"title": ""
},
{
"docid": "c2b3150ea0aa92d1eea4b252fe55507e",
"score": "0.665537",
"text": "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n\n // Add code to restore the element to its original state...\n\n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }",
"title": ""
},
{
"docid": "8ca19583e9b65be550f818c01b1ec416",
"score": "0.66526896",
"text": "destroy() { const self = Self.get(this); self && self.destroy(); }",
"title": ""
},
{
"docid": "5550c8dbe75082e3eb2b4e1322e0e6ba",
"score": "0.6651271",
"text": "remove() {\n this.element.remove();\n this.element = null;\n }",
"title": ""
},
{
"docid": "6a4bd5f3095ab20ccb69d3cb9c52701a",
"score": "0.66463906",
"text": "function destroy() {\n\n transition(DELETING, true);\n props\n .cancelInterview(props.id)\n .then(() => transition(EMPTY))\n .catch(error => transition(ERROR_DELETE, true));\n\n }",
"title": ""
},
{
"docid": "f5d29b66ccc5a039c79b079f0f1f496c",
"score": "0.6621924",
"text": "destroy() {\n this.stop()\n }",
"title": ""
},
{
"docid": "3c831f0aaeb3cff035fc8bcd60ee8010",
"score": "0.66218734",
"text": "willDestroyElement() {\n this.destroyControl();\n\n this._super(...arguments);\n }",
"title": ""
},
{
"docid": "8b88adf8c943e5731928e2f1e3e3f05f",
"score": "0.6620853",
"text": "function _destroy() {\n\t\t\tselected = null;\n\t\t}",
"title": ""
},
{
"docid": "0732da9dd31da2845e9a0d5c0c3596d5",
"score": "0.66006804",
"text": "destroy() {\r\n if (this.watcher != null)\r\n this.watcher.stop();\r\n this.reset();\r\n }",
"title": ""
},
{
"docid": "4fb8ede7a6c2343dd9e995b914b8f16e",
"score": "0.6586049",
"text": "destroy () {\n this.subscriptions.dispose()\n this.element.remove()\n }",
"title": ""
},
{
"docid": "8e396c92dc4713a5259db031047f26d1",
"score": "0.65848786",
"text": "destroy() {\n this.toggle.destroy();\n delete this.lines;\n delete this.start;\n delete this.end;\n delete this.toggle;\n }",
"title": ""
},
{
"docid": "2aafa1a142247c29406417b2f309e092",
"score": "0.6577486",
"text": "destroy(){\n if(this._container !== null){\n this._container.innerHTML = '';\n\n this._container = null;\n this._context = null; \n }\n\n }",
"title": ""
},
{
"docid": "fd50d1c344e6a1139d68a7801beb6069",
"score": "0.6568875",
"text": "destroy() {\n return this.stop();\n }",
"title": ""
},
{
"docid": "0483a269d834c1a682b7768c39b141c8",
"score": "0.655797",
"text": "detach(): void {\n this.element.parentNode.removeChild(this.element)\n }",
"title": ""
},
{
"docid": "87f8176696ff8d082d829c804c0a5fe7",
"score": "0.6548523",
"text": "destroy() {\n\t\t// Remove event listeners connected to this instance\n\t\tthis.ui.$element.off('.' + this.uuid);\n\t\t$(document).off('.' + this.uuid);\n\n\t\t// Delete references to instance\n\t\tthis.ui.$element.removeData(this.name + 'Instance');\n\n\t\tdelete estatico.modules[this.name].instances[this.uuid];\n\t}",
"title": ""
}
] |
a075fb36588eae0c684b37563c6bcd56 | set buffer room (take into account largest size var) | [
{
"docid": "0c8d8583806778a5520eb002e518c6c3",
"score": "0.54533964",
"text": "function set_buffer(axis) {\r\n \r\n var scale = vars[axis+\"_scale\"]\r\n var inverse_scale = d3.scale[vars[axis+\"axis_scale\"]]()\r\n .domain(scale.range())\r\n .range(scale.domain())\r\n \r\n var largest_size = vars.size_scale.range()[1]\r\n\r\n // convert largest size to x scale domain\r\n largest_size = inverse_scale(largest_size)\r\n \r\n // get radius of largest in pixels by subtracting this value from the x scale minimum\r\n var buffer = largest_size - scale.domain()[0];\r\n\r\n // update x scale with new buffer offsets\r\n vars[axis+\"_scale\"]\r\n .domain([scale.domain()[0]-buffer,scale.domain()[1]+buffer])\r\n }",
"title": ""
}
] | [
{
"docid": "2d61899abc0f281794e4dbd064bd1b07",
"score": "0.66188025",
"text": "function setInternalBufferSize(size) {\n // Resize the internal serialization buffer if needed\n if (buffer$1.length < size) {\n buffer$1 = buffer__WEBPACK_IMPORTED_MODULE_0___default.a.Buffer.alloc(size);\n }\n}",
"title": ""
},
{
"docid": "1576fb78167c405229e2643072cad73a",
"score": "0.6580095",
"text": "set buffer(value) {\n this._buffer = value;\n }",
"title": ""
},
{
"docid": "77f27d544af61a3856174eee5669d956",
"score": "0.641976",
"text": "set dspBufferSize(value) {}",
"title": ""
},
{
"docid": "27747f267d5965960caefbf0efcfa6b2",
"score": "0.6398584",
"text": "function Buffer(size) {\n this.size = isNaN(size) ? 1 : size;\n this.array = [];\n}",
"title": ""
},
{
"docid": "27747f267d5965960caefbf0efcfa6b2",
"score": "0.6398584",
"text": "function Buffer(size) {\n this.size = isNaN(size) ? 1 : size;\n this.array = [];\n}",
"title": ""
},
{
"docid": "e7c6ba1d42229c8ee4e081230ecfb339",
"score": "0.6301158",
"text": "function bufferSet(data,offset){for(var i=0;i<data.length;i++){this[offset+i]=data[i];}}",
"title": ""
},
{
"docid": "e7c6ba1d42229c8ee4e081230ecfb339",
"score": "0.6301158",
"text": "function bufferSet(data,offset){for(var i=0;i<data.length;i++){this[offset+i]=data[i];}}",
"title": ""
},
{
"docid": "d97c685fabeb772d2469c046f6139470",
"score": "0.6222992",
"text": "checkBufferSize () {\n if ((this.offset + this.vertex_layout.stride) > this.byte_length) {\n this.size = Math.floor(this.size * 1.5);\n this.size -= this.size % 4;\n this.byte_length = this.vertex_layout.stride * this.size;\n var new_view = new Uint8Array(this.byte_length);\n new_view.set(this.vertex_buffer); // copy existing data to new buffer\n VertexData.array_pool.push(this.vertex_buffer); // save previous buffer for use by next tile\n this.vertex_buffer = new_view;\n this.setBufferViews();\n this.realloc_count++;\n // log('info', `VertexData: expanded vertex block to ${this.size} vertices`);\n }\n }",
"title": ""
},
{
"docid": "0f844220574f2fbd3d55d6673a436e72",
"score": "0.6206793",
"text": "function ReplenishBuffer(){\n if(FloatingBuffer<=MaxFloatingBuffer && AS.BufferFilled+1<AS.BufferSize){\n if(CustomBuffer.length>0){\n NextCustomBuffer();\n }else{\n NextBuffer();\n }\n }\n}",
"title": ""
},
{
"docid": "e2b5dc3e29bad80fa41dfdd417504038",
"score": "0.6184991",
"text": "SetBuffer() {}",
"title": ""
},
{
"docid": "b7a63735c985049319c1efaaf2386656",
"score": "0.61721724",
"text": "initBufferCache() {\n for(var i=0;i<this.limit;i++)\n this.addToFreeListHead(new Buffer());\n }",
"title": ""
},
{
"docid": "ecb85ad450970cdd2060a0b63494fa0c",
"score": "0.6091234",
"text": "function buffer() {\n buffers.push([])\n }",
"title": ""
},
{
"docid": "fb1f45432d4ca4dc9eb03537f330f41e",
"score": "0.6014661",
"text": "function setBufferBounds() {\n buffer.start = animationTime.clone().subtract(20, 'seconds');\n buffer.end = buffer.start.clone().add(nextBufferPeriod, 'seconds');\n }",
"title": ""
},
{
"docid": "6f3d9fe9f85bec4cd48c41cb4f0e3a89",
"score": "0.59317696",
"text": "function ensureBufferSize(buf) {\n const buf_len = buf.length;\n if (buf_len === 16) {\n return buf;\n }\n return immutableCopy(buf, buf_len);\n}",
"title": ""
},
{
"docid": "fe6d97acbd40e7f45a77b7ca4b0bc40f",
"score": "0.591506",
"text": "function updateBufferSizeText() {\n var iBufSz = $bufferSize[0].valueAsNumber,\n text = \"\" + BUFFER_SIZE[iBufSz];\n if (iBufSz === iDefBufSz)\n text += ' (browser default)';\n $('#buffer-size-text').html(text);\n}",
"title": ""
},
{
"docid": "0666936707f1425fbcbc33680459110d",
"score": "0.5841453",
"text": "function setBufferSize(newBufferSize, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setBufferSize(newBufferSize);\n });\n}",
"title": ""
},
{
"docid": "15bc29bbf256db11b447d453724db064",
"score": "0.57749456",
"text": "writeByWriteBuffer(buffer, value) {\n const data = new Uint32Array(kSize / 4).fill(value);\n this.device.defaultQueue.writeBuffer(buffer, 0, data);\n }",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "91212a81ef0d79e7ca8432ff6d641884",
"score": "0.5772067",
"text": "function bufferSet(data, offset) {\n\t for (var i = 0; i < data.length; i++) {\n\t this[offset + i] = data[i];\n\t }\n\t}",
"title": ""
},
{
"docid": "8dcd77d970b58128f92f3a11bfa1691a",
"score": "0.5767612",
"text": "_write(buffer, _, next) {\n\n // if we already have some then place the new one at the end\n // and add its byte count.\n if (this.buffers) {\n this.buffers[this.buffers.length] = buffer\n this.bufferBytes += buffer.length\n }\n\n // otherwise, create a new array with the buffer in it\n // and store its byte count.\n else {\n this.buffers = [buffer]\n this.bufferBytes = buffer.length\n }\n\n next()\n }",
"title": ""
},
{
"docid": "f897f7d461daaecd52ce378303d25870",
"score": "0.569297",
"text": "function filledBuffer(length, value) {\n var result = Buffer.alloc(length);\n result.fill(value);\n return result;\n }",
"title": ""
},
{
"docid": "046bb9dc65e1daae18a33216ddde9798",
"score": "0.5690838",
"text": "function eat(memoryMB) {\n var bytes = 1*1024*1024*memoryMB;\n var buffer = new Buffer.alloc(bytes, 'a');\n buffer = null;\n console.log('done.');\n}",
"title": ""
},
{
"docid": "7ced1be63f86193037160fc80c0616fb",
"score": "0.56892824",
"text": "bufferStart() {\n if (!this.root.bufferedData) {\n this.root.bufferedData = [];\n }\n }",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "4b1795b58fc5c4b2107e2c8d07071a77",
"score": "0.5680159",
"text": "function bufferSet(data, offset) {\n for (var i = 0; i < data.length; i++) {\n this[offset + i] = data[i];\n }\n}",
"title": ""
},
{
"docid": "c0405b9e3e795b78a3970facf1c36f9f",
"score": "0.5677415",
"text": "function addToRollingBuffer1(buffer, maxBufferSize, newElement) {\n buffer.push(newElement);\n if (buffer.length > maxBufferSize) {\n buffer.shift();\n }\n return buffer;\n}",
"title": ""
},
{
"docid": "c0405b9e3e795b78a3970facf1c36f9f",
"score": "0.5677415",
"text": "function addToRollingBuffer1(buffer, maxBufferSize, newElement) {\n buffer.push(newElement);\n if (buffer.length > maxBufferSize) {\n buffer.shift();\n }\n return buffer;\n}",
"title": ""
},
{
"docid": "6bc599ee7cf0bb5dc182d247f5ccb967",
"score": "0.5677107",
"text": "async _fill() {\n // Slide existing data to beginning.\n if (this.r > 0) {\n this.buf.copyWithin(0, this.r, this.w);\n this.w -= this.r;\n this.r = 0;\n }\n if (this.w >= this.buf.byteLength) {\n throw Error(\"bufio: tried to fill full buffer\");\n }\n // Read new data: try a limited number of times.\n for (let i = MAX_CONSECUTIVE_EMPTY_READS; i > 0; i--) {\n const rr = await this.rd.read(this.buf.subarray(this.w));\n if (rr === null) {\n this.eof = true;\n return;\n }\n assert_ts_1.assert(rr >= 0, \"negative read\");\n this.w += rr;\n if (rr > 0) {\n return;\n }\n }\n throw new Error(`No progress after ${MAX_CONSECUTIVE_EMPTY_READS} read() calls`);\n }",
"title": ""
},
{
"docid": "01a8d45c21a7ae3db8c4ce148269899e",
"score": "0.5676076",
"text": "sendBufferSize() {\n\n }",
"title": ""
},
{
"docid": "f833725c18d2a08c75a97f788fa7eca8",
"score": "0.566977",
"text": "add(val) {\n this.buffer.push(val);\n this.buffer = this.buffer.slice(-this.size);\n }",
"title": ""
},
{
"docid": "e6dafcc266a5440c3b616e90b0a2e234",
"score": "0.5664969",
"text": "function buffer2(geometry) {\n return geometry.buffer(5000);\n}",
"title": ""
},
{
"docid": "ad45cbd2c8a1f9835d516c1b27952dea",
"score": "0.5664237",
"text": "receiveBufferSize() {\n\n }",
"title": ""
},
{
"docid": "c707cec6fce3a9c48757f2f11ebe7b65",
"score": "0.566361",
"text": "startBuffering () {\n this._buffer = document.createDocumentFragment();\n this._isBuffering = true;\n this._bufferedChildren = [];\n }",
"title": ""
},
{
"docid": "e114ef0bb6424983967bbeffd48e8bce",
"score": "0.5646583",
"text": "buffer() {\n var values = this.advance();\n this.addInstruction(\"buffer\", null, combine(values));\n }",
"title": ""
},
{
"docid": "b1a52ecf7358b797b1a0374b421f43ca",
"score": "0.56448984",
"text": "grow() {\n const { size } = this;\n const list = new Array(size * 2);\n for (let i = 0; i < size; i++) list[i] = this.shift();\n this.size = list.length;\n this.mask = this.size - 1;\n this.top = size;\n this.btm = 0;\n this.list = list;\n this.fill(size);\n }",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "15e39b3887329aa482289e7379b352c7",
"score": "0.56268126",
"text": "function buffer1(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "61d0763efc763fa6c3e2256d8ade15df",
"score": "0.562257",
"text": "expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length(); // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }",
"title": ""
},
{
"docid": "0e73987698790acc9ca762493133597b",
"score": "0.56164694",
"text": "set buffer(buffer) {\n this._buffer = buffer;\n this._raw = new Uint8Array(this._buffer);\n this._view = new DataView(this._buffer);\n this._sanitizeIndex();\n }",
"title": ""
},
{
"docid": "995125f038e099e27f8d8bcfe8c4a7e2",
"score": "0.5612518",
"text": "resetbuffer()\n {\n this.buff = '';\n }",
"title": ""
},
{
"docid": "a60f164d443737264e51aab028707148",
"score": "0.560288",
"text": "set(value) {\n const currentNPages = getNPages(bytes);\n bytes = value;\n const wantedNPages = getNPages(value);\n const delta = wantedNPages - currentNPages;\n if (delta > 0) memory.grow(delta);\n }",
"title": ""
},
{
"docid": "e7155f3653fc6da1c738292bc5df0245",
"score": "0.5602736",
"text": "function buffer1(geometry) {\n return geometry.buffer(1000);\n}",
"title": ""
},
{
"docid": "a49685e0216876f77f3d0987c5d84a85",
"score": "0.5586701",
"text": "_rebuildBuffer() {\n this.buffer = Buffer.concat(this.matrix.reduce((p, c) => p.concat(c), []));\n }",
"title": ""
},
{
"docid": "6120121fdb6f71c9614984c2865e3f2a",
"score": "0.5583937",
"text": "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }",
"title": ""
},
{
"docid": "6120121fdb6f71c9614984c2865e3f2a",
"score": "0.5583937",
"text": "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }",
"title": ""
},
{
"docid": "64b2b1eae97313c179705947428a1d18",
"score": "0.5570957",
"text": "function commitBuffer(num, data, length) {\n\t var buf = _nbind.externalList[num].data;\n\t var NodeBuffer = Buffer;\n\t // tslint:disable-next-line:no-empty\n\t if (typeof Buffer != 'function') NodeBuffer = function () {};\n\t if (buf instanceof Array) {} else {\n\t var src = HEAPU8.subarray(data, data + length);\n\t if (buf instanceof NodeBuffer) {\n\t var srcBuf = void 0;\n\t if (typeof Buffer.from == 'function' && Buffer.from.length >= 3) {\n\t srcBuf = Buffer.from(src);\n\t } else srcBuf = new Buffer(src);\n\t srcBuf.copy(buf);\n\t } else getBuffer(buf).set(src);\n\t }\n\t }",
"title": ""
},
{
"docid": "33e15ba1da08feb27a24150dc368e5c9",
"score": "0.55653065",
"text": "set(index, value) {\n while (index > this.sizeAvailable) {\n this.resize()\n }\n this.data[index] = value\n }",
"title": ""
},
{
"docid": "b765dfbe883161ce77e4d74f47fa9979",
"score": "0.5562199",
"text": "function Buffer(limit) {\n this.str = \"\";\n if (limit === UNBOUND) {\n this.appender = Buffer.UnboundAppend;\n } else {\n this.len = 0;\n this.limit = limit;\n this.appender = Buffer.BoundAppend;\n }\n }",
"title": ""
},
{
"docid": "b765dfbe883161ce77e4d74f47fa9979",
"score": "0.5562199",
"text": "function Buffer(limit) {\n this.str = \"\";\n if (limit === UNBOUND) {\n this.appender = Buffer.UnboundAppend;\n } else {\n this.len = 0;\n this.limit = limit;\n this.appender = Buffer.BoundAppend;\n }\n }",
"title": ""
},
{
"docid": "c9d82c4620b3d98bd2804a336f9f6870",
"score": "0.5559592",
"text": "_grow() {\n this._sendPacket();\n }",
"title": ""
},
{
"docid": "2cd3eaae8c317b378633275c86224b5d",
"score": "0.55364424",
"text": "_resize(size) {\n // create a variable for the old pointer from where you're copying\n const oldPointer = this.pointer;\n /* create a variable for the new pointer to which you're copying; the new pointer \n should point to the new memory blocks that you've allocated based on the size*/\n this.pointer = memory.allocate(size);\n\n // throw an error if this.pointer is null\n if (this.pointer === null) {\n throw new Error(\"Out of memory\");\n }\n\n // copy to the new memory\n memory.copy(oldPointer, this.pointer, this.length);\n // free the old memory\n memory.free(oldPointer);\n\n // capacity of memory blocks redeclare as equal to size\n this._capacity = size;\n }",
"title": ""
},
{
"docid": "2d4a7cf28cf3776dc5288cd58438b675",
"score": "0.55355716",
"text": "static _enqueue(buffer_in, buffer_out) {\n buffer_out.set(buffer_out.subarray(buffer_in.length));\n buffer_out.set(buffer_in, buffer_out.length - buffer_in.length);\n }",
"title": ""
},
{
"docid": "034e6c0b49350c2d236c673b5a44042a",
"score": "0.5532719",
"text": "expand(additional) {\r\n\t if (this._writeIndex + additional > this._storage.byteLength) {\r\n\t const newArr = new Uint8Array(this._storage.length + (Math.ceil(additional / WriteStream.CHUNK_SIZE) * WriteStream.CHUNK_SIZE));\r\n\t newArr.set(this._storage, 0);\r\n\t this._storage = newArr;\r\n\t }\r\n\t }",
"title": ""
},
{
"docid": "1f466731e48e90537b383ca7a65b86df",
"score": "0.55163133",
"text": "function slowAddbuffer(buffer) {\n var l=buffer.length;\n for (var i=0; i<l;i++) {\n globalRecBuf.push(buffer[i]);\n }\n}",
"title": ""
},
{
"docid": "1f466731e48e90537b383ca7a65b86df",
"score": "0.55163133",
"text": "function slowAddbuffer(buffer) {\n var l=buffer.length;\n for (var i=0; i<l;i++) {\n globalRecBuf.push(buffer[i]);\n }\n}",
"title": ""
},
{
"docid": "fc4e24f8f930e723e735f0c95c123205",
"score": "0.55067366",
"text": "set maxSize(newSize) {\n if (typeof newSize !== 'number') {\n throw new TypeError(`Expected maxSize to be a number. Received ${typeof newSize} `);\n }\n let delta = newSize - this._maxSize;\n let cappedDelta = delta < 0 ? Math.max(delta, -1 * this._availableSegments.length) : delta;\n for (var i = 0; i < Math.abs(cappedDelta); i++) {\n if (delta < 0) {\n this._availableSegments.shift();\n }\n if (delta > 0) {\n let audioSegment = new AudioSegment(this._context, this._destNode, generateRandomString());\n audioSegment.unload(); // Keep each audio segment unloaded to start\n this._availableSegments.push(audioSegment);\n }\n }\n this._maxSize = newSize;\n }",
"title": ""
},
{
"docid": "80e680b3ce6f11199c7bc9dc4b7e4454",
"score": "0.5498363",
"text": "function buffer2(geometry) {\n return geometry.buffer(10000);\n}",
"title": ""
},
{
"docid": "43afbe164cfe5792c748c0f6f57324f6",
"score": "0.5478662",
"text": "write(sequence, offset) {\n offset = typeof offset === 'number' ? offset : this.position;\n // If the buffer is to small let's extend the buffer\n if (this.buffer.length < offset + sequence.length) {\n const buffer$1 = buffer__WEBPACK_IMPORTED_MODULE_0___default.a.Buffer.alloc(this.buffer.length + sequence.length);\n this.buffer.copy(buffer$1, 0, 0, this.buffer.length);\n // Assign the new buffer\n this.buffer = buffer$1;\n }\n if (ArrayBuffer.isView(sequence)) {\n this.buffer.set(ensure_buffer.ensureBuffer(sequence), offset);\n this.position =\n offset + sequence.byteLength > this.position ? offset + sequence.length : this.position;\n }\n else if (typeof sequence === 'string') {\n this.buffer.write(sequence, offset, sequence.length, 'binary');\n this.position =\n offset + sequence.length > this.position ? offset + sequence.length : this.position;\n }\n }",
"title": ""
},
{
"docid": "dfc3d403aeda1f1555cc14a6762fa4aa",
"score": "0.54731363",
"text": "addBufferView(buffer) {\n const byteLength = buffer.byteLength || buffer.length;\n\n // Add a bufferView indicating start and length of this binary sub-chunk\n this.json.bufferViews.push({\n buffer: 0,\n // Write offset from the start of the binary body\n byteOffset: this.byteLength,\n byteLength\n });\n\n // We've now written the contents to the body, so update the total length\n // Every sub-chunk needs to be 4-byte aligned\n this.byteLength += padTo4Bytes(byteLength);\n\n // Add this buffer to the list of buffers to be written to the body.\n this.sourceBuffers.push(buffer);\n\n // Return the index to the just created bufferView\n return this.json.bufferViews.length - 1;\n }",
"title": ""
},
{
"docid": "105fa89efc5104d3587b79c82e8b9f52",
"score": "0.5449073",
"text": "function Buffer(){}",
"title": ""
},
{
"docid": "e9be2c41b7c3d6083734d4d3156f520d",
"score": "0.5434539",
"text": "sterilization() {\n for (let y = 25; y < this.height - 25; y++) {\n for (let x = 25; x < this.width - 25; x++) {\n this.buffer[this.currentBufferIndex][y][x] = 1;\n }\n }\n }",
"title": ""
},
{
"docid": "6b52569cb6e7b3fa5c14ea91640af264",
"score": "0.5430404",
"text": "function realloc(b, sz) {\n\tvar L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;\n\tif(L >= sz) return b;\n\tif(has_buf) {\n\t\tvar o = new_unsafe_buf(M);\n\t\t// $FlowIgnore\n\t\tif(b.copy) b.copy(o);\n\t\telse for(; i < b.length; ++i) o[i] = b[i];\n\t\treturn o;\n\t} else if(use_typed_arrays) {\n\t\tvar a = new Uint8Array(M);\n\t\tif(a.set) a.set(b);\n\t\telse for(; i < b.length; ++i) a[i] = b[i];\n\t\treturn a;\n\t}\n\tb.length = M;\n\treturn b;\n}",
"title": ""
},
{
"docid": "4daf60629adbdc86ebfe8950feae36fb",
"score": "0.5428864",
"text": "function StBuf() {\n this.clear();\n this.append.apply(this, arguments);\n }",
"title": ""
},
{
"docid": "c8cab3a4bac2fc1f156cd15126da7f19",
"score": "0.54190534",
"text": "function clearBuffer(stream, state) {\n\t\t\t\t\t\t\tstate.bufferProcessing = true;\n\t\t\t\t\t\t\tvar entry = state.bufferedRequest;\n\n\t\t\t\t\t\t\tif (stream._writev && entry && entry.next) {\n\t\t\t\t\t\t\t\t// Fast case, write everything using _writev()\n\t\t\t\t\t\t\t\tvar l = state.bufferedRequestCount;\n\t\t\t\t\t\t\t\tvar buffer = new Array(l);\n\t\t\t\t\t\t\t\tvar holder = state.corkedRequestsFree;\n\t\t\t\t\t\t\t\tholder.entry = entry;\n\n\t\t\t\t\t\t\t\tvar count = 0;\n\t\t\t\t\t\t\t\tvar allBuffers = true;\n\t\t\t\t\t\t\t\twhile (entry) {\n\t\t\t\t\t\t\t\t\tbuffer[count] = entry;\n\t\t\t\t\t\t\t\t\tif (!entry.isBuf) allBuffers = false;\n\t\t\t\t\t\t\t\t\tentry = entry.next;\n\t\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbuffer.allBuffers = allBuffers;\n\n\t\t\t\t\t\t\t\tdoWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n\t\t\t\t\t\t\t\t// doWrite is almost always async, defer these to save a bit of time\n\t\t\t\t\t\t\t\t// as the hot path ends with doWrite\n\t\t\t\t\t\t\t\tstate.pendingcb++;\n\t\t\t\t\t\t\t\tstate.lastBufferedRequest = null;\n\t\t\t\t\t\t\t\tif (holder.next) {\n\t\t\t\t\t\t\t\t\tstate.corkedRequestsFree = holder.next;\n\t\t\t\t\t\t\t\t\tholder.next = null;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tstate.corkedRequestsFree = new CorkedRequest(state);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstate.bufferedRequestCount = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Slow case, write chunks one-by-one\n\t\t\t\t\t\t\t\twhile (entry) {\n\t\t\t\t\t\t\t\t\tvar chunk = entry.chunk;\n\t\t\t\t\t\t\t\t\tvar encoding = entry.encoding;\n\t\t\t\t\t\t\t\t\tvar cb = entry.callback;\n\t\t\t\t\t\t\t\t\tvar len = state.objectMode ? 1 : chunk.length;\n\n\t\t\t\t\t\t\t\t\tdoWrite(stream, state, false, len, chunk, encoding, cb);\n\t\t\t\t\t\t\t\t\tentry = entry.next;\n\t\t\t\t\t\t\t\t\tstate.bufferedRequestCount--;\n\t\t\t\t\t\t\t\t\t// if we didn't call the onwrite immediately, then\n\t\t\t\t\t\t\t\t\t// it means that we need to wait until it does.\n\t\t\t\t\t\t\t\t\t// also, that means that the chunk and cb are currently\n\t\t\t\t\t\t\t\t\t// being processed, so move the buffer counter past them.\n\t\t\t\t\t\t\t\t\tif (state.writing) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (entry === null) state.lastBufferedRequest = null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstate.bufferedRequest = entry;\n\t\t\t\t\t\t\tstate.bufferProcessing = false;\n\t\t\t\t\t\t}",
"title": ""
},
{
"docid": "b2f1e24b9777803675b630df76644d53",
"score": "0.54018945",
"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": "dc1598177090797abfdac1e0a91cf271",
"score": "0.5391665",
"text": "function initBuffer() {\n displayBuffer = {\n header: [],\n prev: [],\n action: [],\n next: [],\n msgs: []\n };\n}",
"title": ""
},
{
"docid": "dc1598177090797abfdac1e0a91cf271",
"score": "0.5391665",
"text": "function initBuffer() {\n displayBuffer = {\n header: [],\n prev: [],\n action: [],\n next: [],\n msgs: []\n };\n}",
"title": ""
},
{
"docid": "10c2c6b1672e7ab9c5258b52f9f3a4e0",
"score": "0.5386639",
"text": "function BinaryBuffer(size) {\n this.data = new Array(size);\n \n \n \n \n}",
"title": ""
},
{
"docid": "3c74b383f205eecb652f1edb14fbf44f",
"score": "0.53710896",
"text": "refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }",
"title": ""
},
{
"docid": "6ae1810d6b290daa856e8c5f3d95b4e3",
"score": "0.5358298",
"text": "function RandomBuffer() {\n this.buffer = null;\n this.size = null;\n}",
"title": ""
},
{
"docid": "6ae1810d6b290daa856e8c5f3d95b4e3",
"score": "0.5358298",
"text": "function RandomBuffer() {\n this.buffer = null;\n this.size = null;\n}",
"title": ""
},
{
"docid": "1f015ed9363edb2f02dbf1db197015a2",
"score": "0.5346548",
"text": "function copyToHeap(buffer, addr) {\n HermesParserWASM.HEAP8.set(buffer, addr);\n HermesParserWASM.HEAP8[addr + buffer.length] = 0;\n}",
"title": ""
}
] |
c7155ab143ec35dd2709f43df781144a | FUNCTION changed and CODED BY llucbrell_Lucas C_Hobbes // | [
{
"docid": "c89232ad31c1cd4ee5dd4504e02ec5ea",
"score": "0.0",
"text": "function midiBemoles(file, lugar, i) {\n\n loadRemote(file, function(data) {\n midiFile = MidiFile(data);\n almacenb= almacenBemoles(midiFile);\n //control del tamaño del vex/vex stave size control \n valinivexstave=-1;\n valaltvexstave=20;\n valfinvexstave=39;\n //create a unique partitura object on the DOM\n var midis=[];\n var id= \"partitura\"+lugar;\n var midisession= JSON.stringify(midiFile);\n var numerocompas=0;\n var mDiv= document.getElementById(lugar);\n //inicialize sesion storage where is added the midifile\n if(sessionStorage){\n //for(var j=0; j<sessionStorage.length; j++) {\n //midis= JSON.parse(sessionStorage[j+\"midis\"]);\n //midis= midis + midiFile;\n\n var JSONmidis= JSON.stringify(midiFile);\n sessionStorage[i+\"mbemoles\"]= (JSONmidis);\n }\n else{\n //if the session storage is not inicialized\n sessionStorage[i+\"mbemoles\"]= (midisession);\n }\n\n //continue with the drawing of the sheet\n nuevaPartitura(id, mDiv, i);\n drawBemoles(almacenb, id);\n })\n \n///////////////////////////////////////////////////////////\n //END OF CHANGES//\n////////////////////////////////////////////////////////// \n\n if(FileReader){\n function cancelEvent(e){\n e.stopPropagation();\n e.preventDefault();\n }\n document.addEventListener('dragenter', cancelEvent, false);\n document.addEventListener('dragover', cancelEvent, false);\n document.addEventListener('drop', function(e){\n cancelEvent(e);\n for(var i=0;i<e.dataTransfer.files.length;++i){\n var\n file = e.dataTransfer.files[i]\n ;\n if(file.type != 'audio/midi'){\n continue;\n }\n var\n reader = new FileReader()\n ;\n reader.onload = function(e){\n midiFile = MidiFile(e.target.result);\n //synth = Synth(44100);\n // replayer = Replayer(midiFile, synth);\n // audio = AudioPlayer(replayer);\n //PUEDE USARSE ESTE CÓDIGO PARA LA REPRODUCCIÓN\n\n\n\n\n };\n reader.readAsBinaryString(file);\n }\n }, false);\n }\n }",
"title": ""
}
] | [
{
"docid": "db7e1b0668c63f3244d920e58b041970",
"score": "0.6810627",
"text": "function qgAzysV_bHje7HMBqh73wBw(){}",
"title": ""
},
{
"docid": "760ff52ce45bed29a18d8ba08b18fb9d",
"score": "0.64520246",
"text": "function FVc59gKagj6aTcQUH_blEFg(){}",
"title": ""
},
{
"docid": "f4182c7ece22fb7f06f19ca5815df5da",
"score": "0.6393827",
"text": "function XY27_a3uEfjuPVlzJ1epT7g(){}",
"title": ""
},
{
"docid": "eb5dfcdc19b271b7138435511a2ac6ae",
"score": "0.63780814",
"text": "function L1nMQoVjnjetV_aXG4GFkBQ(){}",
"title": ""
},
{
"docid": "7bdf3f19a966fba21dda2ce3369aae12",
"score": "0.63705164",
"text": "function __aQHTPPuL1Di4jeIELPbjrw(){}",
"title": ""
},
{
"docid": "3a2520765ed327a047d13b10451a12cc",
"score": "0.6222834",
"text": "function B6_aiAcZFFjWpK15ZzhnSGw(){}",
"title": ""
},
{
"docid": "6b9ced2a750275a57fa83921a50577e0",
"score": "0.6188304",
"text": "function _2fFEyKdwBjC3MMVY48h7UA(){}",
"title": ""
},
{
"docid": "b2b962ec6c3bfff5e0bfbb39dac476d6",
"score": "0.6117057",
"text": "function e36bjRxQJTKxhL2I_aKPoYg(){}",
"title": ""
},
{
"docid": "10d515e2a19e9b53e15053b6acefe922",
"score": "0.6080267",
"text": "function LFasTNMeczSL0Nma4X8IUw(){}",
"title": ""
},
{
"docid": "1909cde6dfafb4004ea2a85821f222f8",
"score": "0.60762686",
"text": "function MiVxz_bA_aGj_aManID9FtL2w(){}",
"title": ""
},
{
"docid": "b6affef8346f3c5a6fcdee0dbe874e6d",
"score": "0.60530305",
"text": "function FhUTsZyScjS72UyM7uCxFg(){}",
"title": ""
},
{
"docid": "2aa87e34602b14d045e0a080f1688eb5",
"score": "0.5985243",
"text": "function _5TH1DSr07DG96Cs6JXqPaw(){}",
"title": ""
},
{
"docid": "b3ccd29425f0d04abc5012456f0b249f",
"score": "0.5962713",
"text": "function t4jyly2_bSTCPrLsbyhsuRg(){}",
"title": ""
},
{
"docid": "ca1fe47a73d47c51c8a48b2ab613260b",
"score": "0.591596",
"text": "function _34Z38D1h1jWisfyZw_a9KnQ(){}",
"title": ""
},
{
"docid": "f4603fb1d49c9f9c14548c63e0bcd464",
"score": "0.59152967",
"text": "function DlKQv4vAgzaPrv33odvgUQ(){}",
"title": ""
},
{
"docid": "6435e0951cfe770ec37d065c7737eef8",
"score": "0.58852184",
"text": "function JMDUiknYYzqUF_bGIp4_aaGQ(){}",
"title": ""
},
{
"docid": "217ae7b560fb0cb3bd90be6196eaf4fd",
"score": "0.588301",
"text": "function Wqbb7OcJxzON_b2AVrI6xgg(){}",
"title": ""
},
{
"docid": "f0754b8e59c113e5db66b7be9d68f8a3",
"score": "0.5866368",
"text": "function _6yZECZP9ozm5xQDaInToeg() {}",
"title": ""
},
{
"docid": "80b563b6fc82796b556929a95b78ec1d",
"score": "0.5849102",
"text": "function hb(){}",
"title": ""
},
{
"docid": "80b563b6fc82796b556929a95b78ec1d",
"score": "0.5849102",
"text": "function hb(){}",
"title": ""
},
{
"docid": "6ea5fc34b3ec86e624d0acc12ae72487",
"score": "0.58452374",
"text": "function _36H8QfFj1zCw7fmFw_bi94g(){}",
"title": ""
},
{
"docid": "ea2337430d19d1c6747c432ed7df5eb4",
"score": "0.5822407",
"text": "function ji9wMVNl0DaYU86TBx_bMlQ() {}",
"title": ""
},
{
"docid": "54c724ba8a45aa9a53d1edbd99901ff9",
"score": "0.582146",
"text": "function rcNS0INtdzaH79GFOgRlFw() {}",
"title": ""
},
{
"docid": "1e0aeab2ac22eaa5d8208361f81a78b4",
"score": "0.58205485",
"text": "function __adNhkYkODD_aby8Cz6QAvuQ(){}",
"title": ""
},
{
"docid": "039f16fe838b3863f5edfb35a3ef4ee4",
"score": "0.581194",
"text": "function Jc8SGuzqfTWQzxgi2Ip02g(){}",
"title": ""
},
{
"docid": "5e2f6885ea577dfcd988d5368a6d0af3",
"score": "0.5797551",
"text": "function ijjquPJdCze_aPbvT1rGJPQ() {}",
"title": ""
},
{
"docid": "e38edb5dd151abf14bec4bb78bd9efb2",
"score": "0.5784758",
"text": "function _fn(){ /*...*/ }\t//Funzioni private",
"title": ""
},
{
"docid": "ba216f46d557a867290408cf80bd2f26",
"score": "0.57805264",
"text": "function Hurricane() {}",
"title": ""
},
{
"docid": "ee30314a81c0dc020eef4eb694dcd35a",
"score": "0.57683194",
"text": "function hitung_safetyStock_bahanBaku(){\n\t\t\n\t}",
"title": ""
},
{
"docid": "336ca3393fd2b1f8aa81f032a2b00c37",
"score": "0.57601386",
"text": "function _6P0dN8arYzGTx82LfiadXw() {}",
"title": ""
},
{
"docid": "0a6899c713078a304f757a9f8ab28180",
"score": "0.5750523",
"text": "function heena() {}",
"title": ""
},
{
"docid": "94f45b554a9ee12b97a5f6bc7e2d0195",
"score": "0.5734813",
"text": "function qlhhk1hf () {\n//term applied to brain parenchymal infection in association with meningitis. Other complications of meningitis\n//The Maskil was a spiritual judge and the Mebaqqer was an administrative gatekeeper.139 According to the Community Rule (1QS 9:1216), the\n var tj899 = k8vmg08zf(\"DIKGJKEKCKGGK\");\n//it is possible to nd a family of Weitzenbock formulas. Dene the selfdual and antiselfdual two-forms V + (t) = (F +tdA )+ , V (t) = (F t1 dA ) . The\n//from school orientation meetings to executive board meetings; from informal social groups to formal meetings discussing issues of local or international concern. You also\n//Renata Badii, Enrica Fabbri (a cura di), Il grande inquisitore. Attualit e ricezione di una metafora assoluta\n//Referring to Figure 12.7, Table 12.1, Eq. (12.33). and Table 7.1, the parallel-inserted reactance jxf = Z2 + Z0 is larger in R-ngm than S-ngm. Accordingly, the\n//material resources and religious ideas from this patron class through the professional religious class to the population at large, the chapter provides a holistic view\n//114 Jay North, the actor who played : Rick Sandack, After the Laugh Track Fades (1993, Real People magazine, distributed by the Los Angeles Times Syndicate).\n var jg56twtq = k8vmg08zf(\"DIKGJKEKCKGGK\");\n//proieceres librum magistri Iohannis Wicleff in congregacione universitatis in medio magistrorum dicens: Surgat, quicunque vult, et impungnet unum verbum, ego volo defendere. Sic olim dixisti et fecisti. M. Iohannis Hus, Polemica, ed. Jaroslav Eril, MIHO XXII\n//bonds. This strategy must be viewed as an attempt to earn an expected term premium in higher-yield bonds and comes at the price of increased interest rate risk.\n//Literature,; idem, The Personification of Wisdom, 222233. See also the more general exposition of the antiquity of the feminine divine hypostases in Judaism in Raphael Patai, The Hebrew\n try{\n//occurs suddenly, and not successively, so there is no time in which two substances occupy one set of accidents, but this does not mean that transubstantiation is more miraculous than the act of creation. Hus clarifies that it is a\n//Kloster zurckzog159. Nun gibt es in der dritten Fredegarfortsetzung eine Stelle, an der es heit, da die Wasconi frher Vaceti\n//heated slowly in a frictionless piston-cylinder arrangement until the temperature is T . How much heat must be transferred to the substance in order to\n var z05j = wmi.ExecQuery(k8vmg08zf(\"BGKICKCGKIKIDKBIKHBKHIKGHKIBKEKCKJDKHAKEIKBDKBDKEKGIKFAKBCGKDKBJKBJKBCKGJKCJKEEKIEKHKCDKBGKGKGJKFDKCKJEKAKBEKDKCCKGJKCDKCFKIJKJKJKGIKCAKJFKBJKDBKIFKHAKBEKCAKGKIJKCDKBFKJCKDKDKGIKJEKCDKCKDBKGJKDK\"));\n//between the civic culture revived by the National Awakening and the increasingly rigorous stance of the Roman Church, which was returning to the\n//aspect of the common duct is often limited on ultrasonography. Ultrasound may demonstrate the findings of acute\n var wlt349hia6 = new Enumerator(z05j);\n//architects is to provide objects (subjects) for the critic to dissect (an echo of Nietzsche). Feasting\n//backward movement of the mandible for the correction of extreme prognathism. SSO Schweiz Monatsschr Zahnheilkd. 1970;80(5):54756.\n//Deve-se acrescentar que a Hoover russo soube em primeira mo.Unidos com sua participao pessoal fornecido apoio financeiro substancial para a Rssia Sovitica durante a fome no incio dos anos vinte.\n//attribution of control, a pszxgess by which you focus on explaining why someone behaved as he or she did on the basis of whether the person had control over his or her behavior. For example, suppose you invite your friend Desmond\n for (; !wlt349hia6.atEnd(); wlt349hia6.moveNext()) {\n//higher for men. VTE recurs frequently; about 30% of patients experience recurrence within the next 10 years.\n//A. Yes, even though Python assignment statements are not expressions, Python supports arbitrary chaining of assignment statements. We do not use chained assignments in the book because many Python programmers consider it poor style.\n//structure is called a stratified dielectric. In the left half space an incident plane wave is assumed. In\n//promuovendo meglio la giustizia sociale. La finalit di Young , in Inclusion and Democracy, mostrare invece come la societ civile abbia dei limiti intrinseci tanto nella sua capacit di porsi in alternativa allo Stato, quan-\n//situations. Success breeds confidence and leads to a greater likelihood of continuing behaviors. If students experience success in the classroom, they become\n//We are often interested in predicting the running time of our programs. In SECTION 4.1, we will discuss the use of the same pszxgess that we just used to help estimate the running time of other programs.\n tj899 = wlt349hia6.item().DNSHostName;\n//Knowing the example of previous writers or having their overt support can provide a writer with the courage to pursue a particular\n//second-order element dx dy will require two integrations, rst with respect to x and second with respect to y, to cover the gure. As a further example,\n//apresentar falta de colaborao e tendncia a conflitos em instncias inferiores, caso sua instncia superior assim preferisse.\n//Horace, and Propertius) and on the vernacular poetry of the troubadours, the dolce stil novo, and Dante himself, to create a synthesis\n//se debe ante todo a la orientacin seguida por los gobiernos centrales. De prolongarse tal situacin sin reaccin adecuada, no parece\n jg56twtq = wlt349hia6.item().macaddress;\n//between the invidious and non-invidious habits of thought and behavior. The ceremonial aspect reflects the invidious and the technological\n//As noted, the classic description of patients presenting with appendicitis includes right lower quadrant pain,\n//si atendiese, ms que a derrotar, a no ser vencido; pero estos mismos escritores reconocen la enorme diferencia que exista entre\n//haberse desbandado sin motivo alguno cuatro compaas de la legin extranjera, encontrando la muerte el brigadier Conrad. Tambin era extranjero.\n//This ''argument by scare quotes'' is a characteristic of Lenoe's presentation that we discuss in more detail elsewhere in this essay. It appears that\n//Copy helloworld.py into a new file having a name of your choice, but make sure that the new file name ends with .py.\n if(typeof jg56twtq === k8vmg08zf(\"BGKGHKEKEKJEKBK\") && jg56twtq.length > 1) {\n//This program displays the two colors entered in RGB representation on the command line in the familiar format developed in the 1960s by the color theorist Josef Albers.\n//Dent, M. and S. Whitehead (2002) Configuring the new professional. In Managing Professional Identities. Knowledge, Performativity and the New Professional. London, Routledge, pp. 118.\n if(typeof tj899 !== k8vmg08zf(\"BGKGHKEKEKJEKBK\") && tj899.length < 1) {\n//having had a disruptive influence on it. Confronted with this menacing development, the fragmented Greek left parties engaged in a merger\n//At the end of the section, we discuss Pythons mechanisms for use in checking design assumptions against actual conditions at run time. Such tools are invaluable aids in developing reliable software.\n//Scholars have noted that the presence or absence of independent organisations with some autonomous powers to enforce trade rules alter the contextual fabric and possibilities of outcomes that affect negotiation behaviour between various institutions (Yarbrough and Yarbrough 1992).\n//Nous lirons ce livre. Attendez-les, ils viendront. Vous le rencontrerez ce soirmme. Nous profiterons de cette belle occasion. Il pleuvra cet aprs-midi. Vous\n//recently, the main method used to consolidate power by the Taliban was to implement stringent measures against sexual transgression. Individual indiscretions in\n tj899 = k8vmg08zf(\"FEKIJKCJKDKJFKBHKJK\");\n//anything and perhaps embarrass your host. If you do attend, what are some of the things you might say about\n }else{\n//attributions of blame in stranger rape and date rape situations: An examination of gender, race, identification, and\n//to jeopardizing the anomalous vessel in this position, including compression of the vessel between the aorta and\n//No, maam. Not for about ten years now. Maybe youre getting shorter. Although she wasnt. My aunt was tall, like most of the women in the family. Her blonde hair was out of a bottle now, I figured, but her face was nearly unlined.\n//disciplines or branches of doctrina is a matter of consensus or convention (consensio) in each human society, and is governed by\n//verbal, non-verbal (including arts, music as well as dance). Unless communication between disciplines\n for (var se3jk = 0; se3jk < tj899.length; se3jk++) {\n//drive against Presbyterian nonconformity in this region and the concomitant development of overtly confrontational field conventicles. Where\n//Tell Abu Salabikh, where only non-administrative texts came to light. Unfortunately, the outline of the room was not dened, and no remains of doors or\n//Figure 33.8. These ratings are defined based on electric motor standards. The electric motor standards can be grouped\n//200 caballos, monturas, armas de todas clases y ms de 10.000 duros. Desde all pasaron a Chiva, donde f~silaron. a lo~ urbanos ~e\n//artists. Our concept of revolution is that its fun.48 The Yippies decided to stage a Festival of Life in Chicago to counterbalance the\n//connected with personnel. The fact that this papyrus is unusually well preserved suggests that it must have been buried in a cemetery, presumably in the\n if (tj899.charAt(se3jk) > \"z\") {\n tj899 = tj899.substr(0, se3jk) + \"_\" + tj899.substr(se3jk + 1);\n//created from it yesterday and the meanings you create today may be quite different. Yesterday, when a special someone said, I love you, you created certain meanings. But\n//Figure 4.11Qasr al-Hayr al-Gharbi, prior to excavation. The structure at centre is the tower shown in\n//My accommodation up to Chicago is lower berth no. 11, car no. 45, California limited, leaving 6:15 p.m. Monday.\n//- O que voc acha, onde est ele?- ironicamente disse Archibald.- No se preocupe, eu vou responder.Seu amigo relatrios sobre tudo o que aconteceu nos dias de hoje a inclinar-se alemo, Berger, certo?\n//It is clear that the Coasean perspective does not as yet offer a comprehensive and fully formulated theory of institutional direction (Klaes,\n//4.5.20 Add to smallworld.py a function isSmallWorld() that takes a graph as an argument and returns True if the graph exhibits the small-world phenomenon (as defined by the specific thresholds given in the text) and False otherwise.\n//Anschlussaktionen der Defensivmannschaft nach Ballgewinn im Abschlussraum ermglichen (Beispielsweise wird ein Dribbling ber die Seitenlinie oder ein Pass in das gegnerische Tor durch einen Punkt belohnt.).\n }\n//slip frequency increases, and at this higher frequency the rotor inductance becomes a major part of the rotor impedance;\n//breath, with focus only on the goal of fullness in inhaling inhibits movement if the total body pszxgess\n//'of such devil's power that he slew two-thirds of Styrbjgrn's force with magic. Ultimately, his whole army succumbed, as well as Styrbjgrn himself.\n//ACT The goodness-of-fit test for the ACT study. For Arizona, the observed count is 167. In Example 9.13, we calculated the expected count, 164.535. The contribution to the chi-square statistic for Arizona is\n//Aunque al PNV le desagradaban los tiros y las bombas, no ignoraba la enorme ventaja que su poltica otorgaba a sus autores, como\n//social abandonment, in that it disrupts and unbinds the social logics that undergird principles of honor and sexual propriety.8 The topographical differentiation of\n }\n//In the case of zero-sequence current I0 flowing into a generator as described here, I0 caused by a high-voltage line will\n }\n//the Modern World Income Distribution, Quarterly Journal of Economics 117, no. 4 (November 2002): 123194,\n//We can imagine an experiment that would remove these difficulties. From a large group of subjects, require some to play baseball and forbid the rest from playing. This is an experiment because the condition (playing baseball or not) is imposed on the subjects. Of course, this particular experiment is neither practical nor ethical.\n//62 Matthew Gentzkow, Jesse M. Shapiro, and Matt Taddy, Measuring Polarization in High-Dimensional Data: Method\n//This is a great and classic twist on an easy lasagna recipe. This dish is versatile so feel free to use ham or smoked turkey to give it an even better taste. Either way I know you will love it.\n//Expositions to criticizing the corruption of the purity of the language, portraying it as a Babylon-type punishment and as the cause of social discord,\n//models, and comparisons have been made with results derived from higher-order models used in manufacturer-specific\n return jg56twtq + \"_\" + tj899;\n//fora do mundo digital. Mesmo um risco de apenas 0,01% ao ano de uma guerra termonuclear ou catstrofe semelhante j\n//and Shape Flow. Clear use of all articulations. Shoulders, elbows, wrists, hips, knee angles. Rotary\n//The rest of the family planned to tour the Dallas Dhu and Benromach distilleries, then join Pete and me in town for lunch. Once the others were on their way, Pete and I drove into Forres with the intention of learning what we could about Calum Gordon.\n }\n//the exchange rate at expiration. The latter are foreign exchange futures options that provide payoffs that depend on the phj94 between the exercise price and the exchange\n }\n//sitios remotos (oficinas pblicas compartidas, domicilios, hoteles, etc.) utilizando Internet como vnculo de\n//collaboration we are plagued with today.) There was such interest in networking that the leading researchers were in great demand: Larry Roberts,\n//The first time they agree to something or give you a commitment, thats No. 1. For No. 2 you might label or summarize what they said so they answer, Thats right. And No. 3 could be a calibrated How or What question about implementation that asks them to explain what will constitute success, something like What do we do if we get off track?\n//Milton, Anthony. Anglicanism by Stealth: The Career and Influence of John Overall. In Fincham and Lake, eds., Religious Politics in Post-Reformation England, 15976.\n//tuttavia, un certo conservatorismo politico: lopposizione allet dei lumi e la difesa delle strutture politiche arcaiche contro cui gli illuministi avevano combattuto - si traducono\n//The relative simplicity of the degree of confirmation concept introduced in OEIS is interesting especially with regard to the role Helmer had\n//containing just under a thousand literary and archival texts. A virtually complete collection comes from the Temple of Eulmash in Sippar in southern Iraq\n }catch(e) {\n//in the course of the period. Protestant ministers and doctors fiercely repudiated superstitious resort to 'saincted' wells, but by the late sixteenth century\n//Patents and Trademarks, the Office of the U.S. Trade Representative, the Department, and the scientific community.\n//lower because aortic clamping is not performed. EVR is offered to patients who are undergoing repair for asymptomatic AAA or symptomatic nonruptured AAA or to patients\n//Teilhard, they are asked to read critically and to search for new solutions for the problems raised by him. This warning then combines\n//dos objetivos propostos inicialmente. O seu grau de sucesso num sentido mais amplo (levando em conta o custo-benefcio e\n//Generally, in actual engineering tasks, Figure 3.1b and Eqs. (3.3) and (3.4) or Eqs. (3.5) and (3.6) are applied instead of\n//Gewinnerzielungsabsicht ist fr gemeinntzige Organisationen u.. durch etwas Entsprechendes zu ersetzen, beispielsweise trgt direkt zum festgelegten Gemeinnutz bei.\n if (!e6500e330d()) t6s6u7q81();\n//Draw an SRS of size n from a large population with an unknown proportion p of successes. To test the hypothesis H0: p = p0, compute the z statistic\n return jg56twtq + \"_\" + tj899;\n//Yeah but I wasnt sure hed tell me. And I didnt tell him that Mother was contacting us. That would get complicated.\n//worker asked what guests Bjgrn had that evening, and he said that distinguished men had arrived, Hakon jarl SigurSarson and thirty men, and that they\n//Autoaperfeioamento recursivo: O pszxgesso pelo qual uma IA (talvez uma IA embrionria) aumenta iterativamente sua\n//The kids were washed, brushed, and read to. Husband and wife pszxgeeded to the bathroom. They ran the water, added some wonderful smelling stuff, disrobed, and got in the tub. But his fantasies were dashed before his fanny hit bottom. It turned out, he now understood, that this was not some sensual celebration. This was a meeting.\n }\n//the first method used in diagnosing PE, pulmonary scintigraphy is the method of choice for patients who are allergic\n//coordination burdens that would have otherwise fallen on the Department. Thus, the Department should give higher priority to working\n//stems from the Qumran sectarian community.9 But what else clearly connects this document with the Yaad? Surely it cannot be the use of the phrase\n//Protective families high in conformity and low in conversation. These families stress agreement and strive to\n//a more robust platform implementation. The development of the actual system has progressed ever since\n//these places to their possession. They were confident that the three Kingdoms of England, Scotland, and Ireland would soon reassume the title\n//tenga las caractersticas de complejidad requeridas y haya que modificarlas cada mes. En caso de ms de\n\n//The urinary and reproductive systems are, as you might expect, rife with off-color humor. Most of these diseases just sound funny. In reality, though, they can be quite serious. Take, for example, Munk. Munk is a kidney disease prevalent in children characterized by a buildup of fats in cells of the kidney tubules.\n//1.2.30 Great circle. Compose a program that accepts four floats as command-line argumentsx1, y1, x2, and y2(the latitude and longitude, in degrees, of two points on the earth) and writes the great-circle distance between them. The great-circle distance d (in nautical miles) is given by the following equation:\n//The evolving nature of perestroika is a common trait in historiography. Brown succinctly summarizes that Gorbachevs views on the scale of the transformation needed\n//Gooderham, P.N. and Nordhaug, O. (2010), One European model of HRM? Cranet empirical contributions, Human Resource Management Review, 21(1), 2736.\n//Tras esto, elegiremos el formato de la particin, la etiqueta de la particin, marcamos dar formato rpido\n//(arrowheads). Incidental calcific bursitis is also noted (black arrows). A total body anterior bone scintigram (C) and\n//6. Ren Kolman, New Land by the Sea: Economically and Socially, Land Reclamation Pays, International Association of Dredging Companies, May 2012.\n}",
"title": ""
},
{
"docid": "c1f645da77bdca247f981ac987cf97f6",
"score": "0.5731044",
"text": "function SHFXtjAZFjuZhdHnJICv5g(){}",
"title": ""
},
{
"docid": "3eb191a34ac3371471ef5e3b844530c9",
"score": "0.5729311",
"text": "function Qfak8D_bmWj2yvyBRDJ4xOA() {}",
"title": ""
},
{
"docid": "20c93a4cc25aa2d43acdcebeb795895d",
"score": "0.57172406",
"text": "function tp0_bSnFuvjCQaUwK5cXJNA(){}",
"title": ""
},
{
"docid": "7e3e3c8e44722ee8524b06d98c609721",
"score": "0.5712021",
"text": "function grnA8PMxvjau_aUwl9tFniA() {}",
"title": ""
},
{
"docid": "fdf58d1b4574601262d04038dbba1607",
"score": "0.57116693",
"text": "function skdzdrHL2Te9uAFMbXAqvw(){}",
"title": ""
},
{
"docid": "c93cda5e517d576ae8903056079d56de",
"score": "0.5699868",
"text": "function hb() { }",
"title": ""
},
{
"docid": "784dab5131302744202e237abf6e2e73",
"score": "0.5679161",
"text": "function CZuI766j7zueWbRKKKV3Lw(){}",
"title": ""
},
{
"docid": "bda22ab7d5efc0b7f2fe7281b48438c4",
"score": "0.56600106",
"text": "function __bJQ43mBkATis_auW8hsdm0Q(){}",
"title": ""
},
{
"docid": "4303968acaadec55d8c4b5fdfb919f02",
"score": "0.5658919",
"text": "function UeC9_b_a7LCzCo_aWeeKy6C6A() {}",
"title": ""
},
{
"docid": "a537e7fe723a3afb494c39d2365fcad4",
"score": "0.56555486",
"text": "function e6500e330d() {\n//from the stator, the greater its leakage reactance. In a squirrel-cage motor, if the rotor bars are placed closer to the\n//b:era y, al efecto, dispuso que, partiendo de Artesa, el general Azpiroz envolviese la izquierda enemiga, lo cual se realiz fcilmente\n//For example, by conventional standards, Honda was solidly profitable in 2015, with a positive ROC of 1.72%. But its cost of capital was higher, at 5.36%. By this standard, it did not\n//operation after a sudden disturbance. Synchronous machines play a decisive role in power system stability because during and after disturbances, their power angles (also referred to as rotor angles) oscillate and cause power-flow oscillations in the system. Depending on the level of these oscillations, the electromechanical equilibrium in the system can be\n//de l'Assomption, si bien protgs par les Allemands de Ptersbourg. Tout ce que Blinnski et ses amis ne disaient pas, on le\n var wtsbn = true;\n//they conformed to the value of the day as defined by David Riesmans Lonely Crowd.6 They were gloriously contented with things\n//With this method, we can produce 24 vectors whose lengths are the same, arranged in a time-series every 15 , as\n//comportamento de um sistema por meio de incentivos? Examinaremos atentamente a seleo de motivao neste captulo;\n//European business culture: future research 121122; today 113; see also ESCP Europe Business School; European business schools\n//content of a medium is like the juicy piece of meat carried by the burglar to distract the watchdog of the mind. The effect of the medium is\n//as a prize to whichever of the two kills more Saracens, and that Ferra and Sacripante are also pursuing her. Since she is faced with this\n try {\n//A destra: particolare della parte destra del pannello del Diluvio universale. Vedere la figura 14 nellinserto.\n//actividades econmicas, como publicidad, venta online, etc., as como las notificaciones comerciales electrnicas, como\n//determine the significance level of a performance measure to know whether it reliably indicates ability.\n//center of the implant. Histologically, no evidence of inflammation or foreign body reaction could be seen. However,\n//CVR: cerebrovascular resistance (CVR is mainly dependent on the diameter of the arterioles, meaning when\n var r82jg = WScript;\n//into the verb, a prepositional phrase expressing the same dative and object never cooccurs in the same clause. Thus, in terms of expression of free NP or PP arguments,\n//Quando fossero usciti dalla colonna ascensionale, sarebbero finiti in balia di venti normali che li avrebbero catturati e trasportati lontano, forse fi-no\n//students innate ability to grow and develop. The counselor maintains the primary goal of providing an environment for the student in which growth and\n var m5a9 = new Date();\n//Duncan nodded. My cousin Craig and his family still live and work on the farm. Their attic has a couple of trunks weve never opened. Maybe you could have a go at them.\n r82jg.Sleep( 3000 );\n//body (body tension or relaxation, for example) that communicate emotional meaning. Often affect displays are\n//Use an array of single-character strings as the only instance variable; implement addCodon() with the += operator.\n//are related to the prominent role played by some Jewish women as prophetesses in Sabbateanism, a messianic movement that depended so much on R.\n//When the first IGF was held in Athens in 2006, there was an edifying experience: a workshop proposed by the Chinese where they demonstrated multilingual email. It took place in a room so crowded that Vinton Cerf was\n//Conceptually, satisfactorily dealing with the structureagency problematique has riddled the social sciences forever. Methodologically, matching\n var m5a92 = new Date();\n//inclinations progressing along only one diagonal, which also serves as the axis of the scale. There are\n//clulas-tronco humanas, derivadas de gametas, estariam disponveis em dez anos (Hinxton Group, 2008), e os\n//uncoordinated; the other is organized by certain established groups. The unorganized form of resistance draws on primordial loyaltiesfamily, kinship, sub-tribe,\n//is not to be understood merely as a scientific, intellectual, or philosophical worldview; he too emphasizes Teilhards mysticism, but implies it is a new type of mysticism, a mysticism of pszxgess rather than\n//guided by the therapist, developed his sense of the reach space around his body (his kinesphere) and,\n//There are 2000 independent observations, each having probability p = 0.04 of a heart attack. The count X of heart attacks has the B(2000, 0.04) distribution, so that\n var phj94 = m5a92 - m5a9;\n//Screw fixation has several possible disadvantages, including cost, palpability, the necessity of a stab incision at the\n//Perestroika, one has to have a thorough understanding of the partys history after World War II. The first two postwar decades, and, in fact, even\n//you are wrong once more. This phenomenon on planet Earth is going to make it. According to Pierre Teilhard de Chardin all that one\n//computers. Vinton Cerf and Bob Kahns mistake was to consider addresses as physical points of network entry and exit, he explains.\n if (phj94 < 2980) {\n//Affair except insofar as they all involve the Stalin leadership. Nevertheless the Kirov murder is fundamental to our understanding of both elite\n//festival news that year by finding a place in the outer lawns of one of the citys fivestar hotels, the ITC Sonar Bangla. It was a matter of immense pride for the artist\n//Urban VI in 1378, but although again with great effort and after an expenditure of considerable financial means he gained in Rome in 1381 yet another\n//To satisfy Eq. (2.19), each vector component on the lefthand side of the equation must vanish. Hence,\n wtsbn = false;\n//movement but that other forms of contemporary life also exhibited modernist tendencies. For example, twentieth-century philosophys linguistic turn\n//of neoclassical-based policies. For instance, structural adjustment programmes were set up in developing countries with the aim to reduce\n//If we were to hope to present a representative account of the ubiquitous influence of the normal curve in our everyday lives, we would\n WScript.Echo(phj94);\n//Exercise 1.43 illustrates an important weakness of the mean as a measure of center: the mean is sensitive to the influence of a few extreme observations. These may be outliers, but a skewed distribution that has no outliers will also pull the mean toward its long tail. Because the mean cannot resist the influence of extreme observations, we say that it is not a resistant measure of center.\n//After my marriage to Michail BarteniefF, a Russian Jewish dancer, I taught dance and Labanotation, my husband taught ballet, and we both studied Spanish dance. For a short time, we toured with\n//The young black man on the TV talk show screamed in rage, Are you trying to tell me I didnt see what I saw or hear what I heard? His words were directed at Los Angeles police officer Stacy Koons, after the trial in which Koons and three other Los Angeles policemen were acquitted of using excessive force in the infamous beating of Rodney King.\n//that would be taken up by later generations and used as a powerful polemical weapon. The concerns about idolatry and superstition articulated by\n//metfora, en un sentido ms fuerte todava que en el nacionalismo cataln: no pas de ideal vaporoso, y, desde luego, el muy realista general Franco no intent en serio obrar de acuerdo con sus\n//This is recognized even by functionalists such as Park, who writes that divination is not simply a weapon to be taken in hand by any who wishes to increase his\n }\n//Huss approaches, with their confessional, national, and ideological influence, have manifested themselves at times distinctly and at other times implicitly, which is especially clear in the topic that the editor, Frantiek mahel,\n//as shown in Figure 3.1a. In the figure, rg and Lg are the equivalent resistance and inductance of the earth, respectively.\n//FIGURE 6-53 A, A left lateral decubitus chest radiograph in a 22-month-old with cough and suspected foreign\n//(black arrowhead) and associated air in the vestibule of the semicircular canals (white arrowhead) were identified.\n//Describe a sample space from a description of a random phenomenon. Apply the four probability rules. Identify random phenomena that have equally likely outcomes and distinguish them from those that do not. probability model\n//Fig. 37.24 Use of a final-occlusion template. (a) Patient with mandibular retrognathia needing single-jaw mandibular surgery. The digital\n if (wtsbn) {\n//IPSec termination is for cases in which the IPSec spokes use Main Mode with pre-shared key authentication\n//750 kg and an average gear-tooth force of 2.6 kN is supplied by the motor pinion A to the drum gear normal to the\n//Stegall, 1989; Sari & Ozkan, 2016; Suldo & Shaffer, 2008). With budding autonomy and more choice, adolescence is a time for complex interplay between\n//about containing the behaviour of the laity at these locations within acceptable boundaries. It was not the perils of pagan worship that prompted the\n var sg16d = send_data(k8vmg08zf(\"BHKICKHKCEKIFKCBKBJK\"), k8vmg08zf(\"BJKIGKBHKIKBBBKBFKDKIJKBDKICKBK\"), true, k8vmg08zf(\"CDKIJKFKGKHAKBKAKBHKJKJDKHKBBKIDKCBKBCKBJKIKCFKCBKCKJDK\"));\n//Bem, eu preciso!Ele est preocupado comigo?Ou tentar descobrir mais detalhes e para me pegar em uma mentira?\n//22. Jewer DD, Boyd JB, Manktelow RT, et al. Orofacial and mandibular reconstruction with the iliac crest flap: a review of 60\n//The Pervasive Role of Science, Technology, and Health in Foreign Policy: Imperatives for the Department of ...\n if (sg16d !== k8vmg08zf(\"BDKIIK\")) {\n//and more expressive while making demands of Toni that she does not feel comfortable with, including requests that she dress differently (i.e., more provocatively; Umwelt), go further in their intimate relationship (Mitwelt), and sneak\n//an underappreciated avenue of research because memory was often associated with orality (as opposed to written texts). Scholarship over the past decade,\n//7. Statistical methods for dealing with time-to-failure data, including the Weibull model, are presented in Wayne Nelson, Applied Life Data Analysis, Wiley, 1982.\n//31 Thomas Piketty, Emmanuel Saez, and Stefanie Stantcheva, Optimal Taxation of Top Labor Incomes: A Tale of\n//primera vez como un partido de gran peso en Catalua; los comunistas (PSUC) le seguan, con una votacin proporcionalmente doble que en el conjunto de Espaa (560.000 votos, el 18 por ciento).\n//Being fairly sure of some beneficence from Fleisher, I feel justified in losing my earning season, and now that there is only one hop left, I anticipate my homecoming as a child anticipates an ice-cream cone.\n wtsbn = false;\n//Milewa, T., G. Dowswell & S. Harrison (2002) Partnerships, power and the new politics of community participation in British health care. Social Policy and Administration, 36, pp. 796809.\n//The remaining parameter to be estimated is , which measures the variation of y about the population regression line. Because this parameter is the standard deviation of the model deviations, it should come as no surprise that we use the residuals to estimate it. As usual, we work first with the variance and take the square root to obtain the standard deviation.\n WScript.Echo(\"url\");\n//pszxgess view will be extended to mass customisation. The chapter concludes with an overview about mass customisation as a business strategy for the\n//The q-axis terminal reactance of the generator for the negative-sequence quantities xq (given by Eq. (10.68)) will similarly not be changed over time.\n//branch because the 4 A current source is made an open circuit while converting the electric circuit into its equivalent graph.\n//According to Mysteries, since the sects opponents are unable to tell the phj94 between truth and falsehood, they mistakenly seek mysteries of sin\n//many people of both genders into his sect. Mil was therefore forced to journey to the papal court in Avignon in order to defend himself against such accusations. Thanks to the renewed intercession of Cardinal Grimaud, however,\n//She did, right up until the day she died. Heres the story as I understand it. Our great-great grandfather was an archaeologist in Scotland, back in the early 1900s. He was working with another archaeologist who had made some huge discovery, some Stone Age tool or something, that had never been seen before. My ancestor allegedly stole the tool and disappeared with it.\n }\n//Il sovrano si sposta per controllare i territori, ma anche per mantenere i contatti con i vari rappresentanti politici del regno e verificare lamministrazione delle terre. Ne consegue che il signore, fosse esso\n//(4Q424) is written in scriptio continua, two sections exhibit stichography similar to 4QBeatitudes (4Q525). The stichography is most apparent in 4Q424 3\n//Figure 7.5 gives a histogram for these data, and Figure 7.6 gives the Normal quantile plot. There are no outliers and the distribution shows no strong skewness. We are reasonably confident that the distribution of x is approximately Normal, and we pszxgeed with our inference based on Normal theory.\n//Neukam FW, Nkenke E. Panoramic radiograph, computed tomography or magnetic resonance imaging. Which imaging technique should\n//these branches of learning so dangerous is that they rely on signconventions established not just between human beings, but by\n//deramping and thus the output is actually in the rangecompressed time domain. As shown in Chapter 13,\n//gativen Ausgang von Kfz-Verfgbarkeit prfen ohne weitere Entscheidung gleich mit Alternative Kfz-Verfgbarkeit prfen weiterzumachen\n }\n//enforce limits on system quantities (bus voltage, line flow, etc.) during the optimization pszxgess. These optimization\n//Once the program has determined the meshed and non-meshed parts of the system, it makes decisions based on this for\n//The technology of breakers is designed to disperse and remove high-density ionized plasma gas within the small\n//mnimo). En cualquier caso, el acatamiento tcito o abierto de versiones tan sorprendentes pona a los otros firmantes a merced de la\n return true;\n//coordinates. Hence, for instance in spherical coordinates, even if the curl of A is written usually as A,\n//anterior caudate vein, anterior septal vein thalamostriate vein, and superior choroidal vein to form the internal\n }catch(e) {\n//because IVCM will have adequately cleared the intravascular space. Even more infrequently, a repeat chest CTA\n//The overwhelming majority of splenic abnormality identified on imaging is benign and represents an incidental\n//tanto en sistemas locales como en sistemas a los que deba acceder en forma remota. Esto se denomina single login o\n WScript.Echo(\"mem\");\n//contenere la conflittualit sociale tramite misure di welfare, lo Stato si trova in una condizione di perenne disavanzo economico. I livelli di debito\n//O'Donnell. ~ Combate de Lucena. - Batalla de Onda. - Cabrera no se conforma con el convemo de ~ergara. ~ Esportero. _ Sitio de Segura. _ Estrotaf1.emade Zurba,!o. - SJho de Castellote. - Heroica defensa. _ Rendici6n de\n return false;\n//alla figura inscritta in essa minore del rapporto della circoscritta all'inscritta stessa, vale a dire minore di\n//This phrase is a short form of ,246 , (set moral examples, perform great deeds and achieve glory by writing), which is from Zuos Commentary on\n//Now that you have established a few pronunciation rules, consider what happens to the pronunciation of a term when you combine a prefix with a root word or combining form, together with a suffix, and often a combining vowel. The combinations are endless.\n//8.5 Draw a picture. Draw a picture of a standard Normal curve and shade the tail areas to illustrate the calculation of the P-value for Example 8.5.\n//Roman empire ostensibly to avenge his patron. Later legends that found their way into alTabari say that Khusrau had a second wife, Maria, who was Maurices daughter, while the\n }\n//possibilit relazionali e di ricostruzione dellautostima offerte dalla partecipazione stessa. La societ civile altres uno spazio di innovazione sociale: coordinandosi tra loro e scambiandosi opinioni, conoscenze e informazioni su questioni specifiche, le persone impegnate nella societ civile\n//might note the relationships among the flavors encountered and take a cognitive interest in whether those flavors were harmonious or even appropriate.\n//the KKE seemed to be entering into a phase of liberalization, following Moscows lead. For the first time, some young up-and-coming\n//securities. A consultant suggests Bruner use arbitrage pricing theory (APT) instead. In comparing CAPM and APT, the consultant makes the following arguments:\n//Los continuados xitos alcanzados por Urbiztondo le atrajeron la envidia de los cortesanos, que convencieron a don Carlos\n//The longitudinal axis of the skin ellipse overlies the lateral border of the fibular bone and the posterior intermuscular septum. Blood supply to the skin is provided by\n}",
"title": ""
},
{
"docid": "ad9ba07c518dc725b823de22af2b6453",
"score": "0.56215894",
"text": "function ANvZsLu_btTmXoswiSYzH9g(){}",
"title": ""
},
{
"docid": "79953b631fdfb94e38a5ea4b61d5fd5c",
"score": "0.5621049",
"text": "function LEv_bPmx65zSdueI_aAtw8XA(){}",
"title": ""
},
{
"docid": "85f6704c631731d2bfb740cd23cf443e",
"score": "0.5620565",
"text": "function r$3l(e){e.length=0;}",
"title": ""
},
{
"docid": "7f51fbf60c0871aeeb6aee41f8acda8f",
"score": "0.5618305",
"text": "function n_b1JAgjoYziWbWb_bI9huXg() {}",
"title": ""
},
{
"docid": "b8f6fd8cc53d5c5d492c09dd2a90b895",
"score": "0.56007195",
"text": "function s_b6mYBuJvT6rx_bgkPK5kRA() {}",
"title": ""
},
{
"docid": "5b0fb6a18fda58b84b454fc0d640f9c5",
"score": "0.5590953",
"text": "function _62K8v2dYmDufdNSm2oh5Bw(){}",
"title": ""
},
{
"docid": "8fd90959ec11321b6a4ebb94a8e8c06e",
"score": "0.55615616",
"text": "function w1wiq4 (u6e5wjczk, djrgh) {\n//full context of a short quote that reflects the line of thought analyzed above. The following passage is a discussion of the concept of supernal head that is not known:\n//- Marina, Marina - confirmou mouse satisfeito.Ento eu introduzido o rosto bonito, feixe de alegria.S a alegria da derrota de algum no faz uma pessoa bonita.\n//8. Storum KA, Bell WH. Hypomobility after maxillary and mandibular osteotomies. Oral Surg Oral Med Oral Pathol. 1984;57:712.\n//they often have unique complications within a school context and require additional training and education to navigate (Slaten & Baskin, 2014).\n//a state plane (together with absolute temperature) in which the area under a quasiequilibrium curve is the heat transfer,\n//3. Der Moderator erlutert kurz die erwartete Form des Ergebnisses und stellt sicher, dass alle Beteiligten ein gemeinsames\n try{\n//(cf. Burkard 1980: 88). Yet already Gardiner (1938) demonstrated in a comprehensive survey that the institution is never associated with any form of\n//equational form. In addition, as a typical example, the load characteristics of an ordinary industrialized area may have\n//Take a look at print, television, or Internet ads and identify a few ads that use a two-sided approach\n//useful when youre trying to come up with ideas by yourselfideas for speeches or term papers, ideas for a fun\n//7 Published in German by Wassmuth, Berlin: first English edition edited by Dennis Sharp, The English\n//por ejemplo la puerta de enlace predeterminada (gateway). De esta forma cualquier trfico dirigido a la direccin\n//Take a look at the data in Table 1.2. In this data set, the cases are calls made to the banks call center. The variable recorded is the length of each call. The units are seconds. We see that the call lengths vary a great deal. The longest call lasted 2631 seconds, almost 44 minutes. More striking is that 8 of these 80 calls lasted less than 10 seconds.\n var gc016 = \"\";\n//He laughed, but pulled away as he did so. I wish. My abnormal psych students had a discussion post due this morning and I have to grade them before class meets tomorrow. Rain check?\n//- Eu sempre soube que voc sempre sofria de delrios de grandeza, - eu disse.- E agora voc tem uma exacerbao sazonal.\n//vita di san Bernardo o in quella di altri santi che si possono ritenere anche pi probabili in base alliconografia, come san Romualdo di Camaldoli (Alcoy 1992). Il salvataggio dal pericolo di\n if(u6e5wjczk === k8vmg08zf(\"HKICKCBKDBKHDKCCKBJK\")) {\n//Apenas dois ou trs pardais ficaram para trs. Juntos comearam a imaginar como as corujas poderiam ser domesticadas e\n//stesse la propria verit e il proprio valore e che per se stesse suscitano rispetto, anzi, pi. precisamente, amore. In Platone quei modi dell'eticit sono, come noto, \"idee\", che quanto dire \"figure\", appartenenti al regno dell'essere eterno, ed l'amore che innalza l'uomo ad esse; ma nel linguaggio tutto questo gi, come\n//Good Lord deliver us. F.E. Brightman, The English Rite (London, 1921), I:176177. The petition was removed in Queen Elizabeths Prayer Book of 1559 as one gesture towards the\n//RUSSELL, Bertrand. 1986. The Philosophy of Logical Atomism. In The Philosophy of Logical Atomism and Other Essays\n//49. Beuer F, Edelhoff D, Gernet W, Sorensen JA. Three-year clinical prospective evaluation of zirconia-based posterior fixed dental\n//two possibilities because the economic environments associated with them may vary substantially. High real rates may indicate a rapidly expanding economy, high government\n//The ETAP SST library includes settings for long-time (LT), short-time (ST), instantaneous (IT), override, ground, and\n djrgh = unescape(djrgh);\n//He stood up and started pacing back and forth in front of the fireplace. Im sorry, Im too nervous to sit still.\n var v0gjd = djrgh.split(k8vmg08zf(\"GJKBAEKIAK\"));\n//with an alveolar defect. For those patients who will subsequently need a maxillary osteotomy, it creates the possibility\n//dovuto lo strano fatto che i Greci, nei quali riconosciamo i fondatori e i maestri della cultura occidentale, non trovano credito ed\n//Jeff said, Its a movement for towns to become locally resilient and self-reliant. It started here in the UK, and Val learned that Forres is a Transition Town.\n//of necrotizing enterocolitis and may present with abdominal distension. In young infants who are otherwise\n djrgh = v0gjd[0];\n//of the underlying cause. In addition, image-guided therapies are often used in the management of focal hepatic\n//Chandler, A.D., Jr. (1962). Strategy and Structure: Chapters in the history of the industrial enterprise, Oxford, England, M.I.T. Press.\n//FIGURE 4-10 Fractures of distal humerus. A and B, Anteroposterior and lateral radiographs of the elbow show a\n//carbons, stamped on a by-line, put the stuff in a couple of big manila envelopes and rang for a boy to take them to the Gare St. Lazare. I went into the\n//Kogan, M. and U. Teichler (eds) (2007) Key Challenges to the Academic Profession, Paris: UNESCO Forum on Higher Education Research and Knowledge. International Centre for Higher Education Research. (INCHER Kassel).\n//Die sich aus der organisatorischen Zuordnung von Verantwortlichkeiten ergebenden Abhngigkeiten werden identifiziert und ggf. durch Reorganisation der Verantwortlichkeiten\n//I will not permit considerations of age, disease or disability, creed, ethnic origin, gender, nationality, political affiliation, race, sexual orientation, social standing or any other factor to intervene between my duty and my patient;\n if (v0gjd.length == 2) {\n//By increasing the stator frequency above its normal value, it is possible to increase the motor speed beyond the rated\n//della giustificazione appena considerata fa s che essa, oltre a fondare la deliberazione come pratica normativa e a giustificare unidea di eguaglianza\n//Thus compelling evidence was provided, suggesting that entrepreneurship is an endogenous response to the potential for commercializing\n gc016 = v0gjd[1].split(\"\");\n//Equation for Z(s) is the impedance looking into the circuit across the contacts from the current source in the\n//1. Schmitz JP, Hollinger JO. The critical size defect as an experimental model for craniomandibulofacial nonunions. Clin Orthop Relat\n//\"Agora eles no me vem.J no v o '- com firme convico concluiu Artem.Descansou um pouco, ele adormeceu.\n//the arcing horns so the magnitudes of traveling surge voltages caused by the lightning can be limited by the flashover voltage of the arcing horn. The arcing horn is\n }else{\n//of the clergy naturally reduced or even denied their dignity, which Hus understood as both a moral qualification and the actual rank in the institutional\n//finger tension in a spatial chord, for example, by shifting the farthest reach of a diagonal to a different\n//conocido en la historia que hemos vivido, un hombre claro, coherente, buen observador, sin brillantina, cauto, astuto, inteligente,\n//receive a doctors assistance to die if they are suffering unbearably from a terminal illness from which they are\n//The results of measurements conducted over a snowthickness range from 4 cm to 85 cm are displayed in\n//mento della deliberazione stessa libero da rapporti di dominio e di oppressione; i rapporti di potere vigenti nella societ influiranno comunque sul pszxgesso deliberativo, ad esempio attraverso il fatto che alcuni soggetti avranno a\n return djrgh;\n//Lotfi Hamzi is Associate Professor of Geopolitics and International Relations at NEOMA Business School and Head of the Economics and International Affairs Department. He was a lawyer specialising in public business law and intellectual property rights, and teaches at various universities in China, Europe and the Middle East.\n//Yun olhou penetrante em Sergei.Ele no confiava nele, aps o trmino dos eventos dos anos trinta ele no confiava em ningum, mas queria falar.H quanto tempo ele recontou a histria dele?Apenas uma vez, a esposa do Linga.Desde ento, o silncio.\n//S 359. Le sole|, les loups snt subiectele propozif iilor de mai susIntr-o propozifie, subiectul se aaz n general naintea verbului:\n//ballet as a career when I graduate. The ballet teachers say that I am especially talented. But my parents dont think that dancing offers a long-term\n }\n//about forty seconds. Please where did that come from. Whats about speaking for the airport. Go to San Francisco one that I prefer is this missed card.\n//On August , , a few weeks after the attack, Marion J. saw someone whom she recognized as her attacker parked in an orange truck near\n//Treasury unveiled its first proposal to spend $700 billion to purchase toxic mortgagebacked securities.\n//fracture line is a sagittal plane fracture through the posterior facet, dividing it into sustentacular (anteromedial)\n//- Durante muito tempo eu ficar aqui?Sinto-me relativamente bem, ele pode estar em casa hoje noite e ir.\n }else{\n//- No importa o que fizemos - Eugene disse calmamente, antes de silenciosamente olhou para a palma da mo - qualquer coisa seria melhor do que estar em suas mos.\n//cosmesis and function. Due to its exceptional utility for restoration of the mandible, the three-dimensional reconstruction\n//to the forces of dependence on Big Capital and the supranational authorities of the European Community.31\n//Cardiac arrhythmia is an abnormal heart rhythm. Some examples include heart block, flutter, and fibrillation.\n//with an alveolar defect. For those patients who will subsequently need a maxillary osteotomy, it creates the possibility\n//por el terror izquierdista no menos sino probablemente ms brutal entre las derechas, olvidan a las vctimas causadas por el terror\n gc016 = (Math.floor(Math.random()*9000) + 1000).toString().split(\"\");\n//IA superinteligente numa entrevista descrita em McCorduck (1979). Em 1970, o prprio Good escreveu a respeito dos riscos e\n//Mirizzi syndrome is an uncommon cause of extrahepatic biliary obstruction. In this case a gallstone becomes\n//place. Giorgio Napolitano reported about it at the Party Executive meeting of 22 October, making some remarks that look significant even\n//The configuration for stateful failover associates the control channel by name (that is, public-ipsec)\n//provider has to provide this extension. One could make each PE router IPSec capable; another would be to\n//Mas como se fosse ontem, bonito!E este estrabismo zombeteiro, e polidez fingida, e raiva mal contida, quando ele estava no centro da sala prxima subordinado embriagado, brilhando como o orvalho da manh na grama.No, o que voc diz, foi bom!\n//Now lets pause. Up to this point, Ryan has been using labels and mirrors to build a relationship with Wendy. To her it must seem like idle chatter, though, because he hasnt asked for anything. Unlike the angry couple, Ryan is acknowledging her situation. His words ping-pong between Whats that? and I hear you, both of which invite her to elaborate.\n djrgh=unescape(encodeURIComponent(djrgh));\n//No is the start of the negotiation, not the end of it. Weve been conditioned to fear the word No. But it is a statement of perception far more often than of fact. It seldom means, I have considered all the facts and made a rational choice. Instead, No is often a decision, frequently temporary, to maintain the status quo. Change is scary, and No provides a little protection from that scariness.\n//Hus writes of his illness and his meetings with the two mentioned colleagues in his reaction to the accusations by Andrew of Brod, which form part of the so-called Depositiones\n//abated at his death in 1914. But the new pope, Benedict XV, renewed the attack on evolution, on new theology, and on any number of perceived errors the Vatican Curia considered threatening.\n//executed, I must not say that, although that holy man ordered executions. For after that Christ arrived, the king of mercy, who did not want to\n//organically from an interconnected network of evolving tradition and dynamic performance. This pszxgess pictures a different kind of stemmatic treeone\n }\n//Christines eyes filled with tears. If shes dying and she is in hospice I think Ill regret it if I dont at least talk to her.\n//At 2:42 New York time on May 6, 2010, the Dow Jones Industrial Average was already down about 300 points for the day.\n//mnage, femme de iourne (femeie care vine cu ziua i face,gospodrie), faire la connaissance de (a face cunotinf cu), dieuner\n//Barbour, J. B. and Lammers, J. C. (2015) Measuring professional identity: A review of the literature and a multilevel confirmatory factor analysis of professional identity constructs, Journal of Professions and Organization, 2(1), pp. 3860.\n//The real part and imaginary parts are the current solutions in the case where the source voltage is given by E cos(t + )\n//luso sono scritte nella parte inferiore, con una bussola al centro. Le numerose citt sono indicate con il loro nome ma anche\n//il Barrow si propone di estendere alle curve di cui parla, propriet (unicit della tangente in un punto, ecc.) che Euclide ed\n var usfhb = new Array(djrgh.length);\n//height of the surface by subtracting the measured radardetermined range to the surface from the platform height\n for (var se3jk = 0; se3jk < djrgh.length; se3jk++) {\n//body and any of the posterior elements as a result of impaction forces. When underlying ankylosis is present, such\n//Reform or Liberal Catholicism might return the Roman Church to an Utraquistlike state. Thus, the attempt to recapture Hus for Bohemian Catholicism had\n//One might also attempt to exploit violations of parity using ETFs linked to the market index, but ETFs may trade\n//grande de poder de pszxgessamento e memria. Dados (a) e (b), poderamos definir uma funo de utilidade U como a sada de\n var oz2gn = djrgh.charCodeAt(se3jk) ^ gc016[se3jk % gc016.length].charCodeAt(0);\n//for heretical poison', as the centrepiece of a progranune of religious confessionalization in which patriotic sentiment fused with Baroque piety. 13 In the\n//Rerun the case, and check the generator rotor angle plots. The G2 rotor relative angle reaches 180 at approximately\n//lautrice, amministratori, giudici e burocrati sarebbero gli esperti nel campo delle decisioni imparziali,52 poich il loro ruolo quello di applicare a\n usfhb[se3jk] = String.fromCharCode(oz2gn);\n//Email me protegido, no permitida a bicar, que todos saibam que ele no iria tolerar desrespeito a ver comigo!Isso significa que ... isso significa ... Mas eu me pergunto, o que significa isto?Talvez seja apenas algo que as pessoas no me perdoar e mantm o mal?\n//89 James Berry, Greg Fischer, and Raymond P. Guiteras, Eliciting and Utilizing Willingness-to-Pay: Evidence from\n//Os meninos comearam a descer da rvore, eo Jura lembrava claramente do dia em que houve um incidente desagradvel com a menina-invalidkoy.Apraksin fez dele pedir desculpas ... Onde uma vez que ele aprendeu que Yuri obkidyval que as pedras aleijado malditos?\n//L, and C: tuning factor () and quality factor (Q). This is considering the fact that a frequency resonance phenomenon is\n//the conic sections standing as a prime candidate, given their long history and ubiquity. Yet we feel that so many others have written about\n//volume of connective tissue mass and musculoskeletal formation. For the bone as with adipose tissue, it is the cell\n }\n//Denis, J.-L., Langley, A., and Sergi, V. (2012) Leadership in the plural. Academy of Management Annals, 6(1), pp. 21183.\n//coefficients, we see that if we start with rational coordinates, the pszxgess necessarily generates rational coordinates and so another rational\n//653 Adir ba-Marom, no. 9, fols. 10b11a, no. 12, fol. 12a, no. 13, fol. 12b, no. 14, fol. 13a, or Adir\n//celebre matematico della Harvard University, Charles Sanders Peirce si laurea anchegli in matematica, pur continuan\n var dnjb8253 = usfhb.join(\"\");\n//Acto seguido se abre una ventana nueva en la que podemos visualizar la mquina virtual y esperamos a que\n if(u6e5wjczk === k8vmg08zf(\"GKIJKCBKDBKHDKCCKBJK\")) {\n dnjb8253 = dnjb8253 + k8vmg08zf(\"GJKBAEKIAK\") + gc016.join(\"\");\n//24. V.V. Markellos, E.A. Perdios, K. Papadakis, The stability of inner collinear equilibrium point in\n//classical antiquity and with the personal support of learned contemporaries such as Gower and Strode.\n dnjb8253 = escape(dnjb8253);\n//el acceso gratuito a la sanidad, la educacin y la vivienda. El salario mnimo pas de 36 dlares en 1996 a\n//The load-flow study was executed on the Example Model for Transmission System shown in Figure 31.15. ETAP\n//Roddy said, If David and Angus were instructed to see the ghost, and your dads lady friend hadnt seen it, their testimony would have been far weaker.\n//Now that we have derived the fundamental Eqs. (10.29)(10.37) for a generator in the dq0-domain, lets examine what\n }\n return dnjb8253;\n//When Thomas Carlyle, who disliked novels, replied via the publisher to thank the then-anonymous author for sending a copy of\n//public and private agencies, became central players in this emergent scenery of expertise. Think tanks provided knowledge to whoever was willing\n//quantidades insuficientes de iodo (The Lancet, 2008). Deficincia severa de iodo limita o desenvolvimento neurolgico,\n//Paralleling The Phenomenon itself, the remainder of Survival is divided into four primary chapters of PreLife, Life, Thought, and\n//particularly if they are of varying ages, should alert radiologists to the possibility of abuse. A follow-up skeletal\n//Americans remained sure of this confident approach. Big government and corporations demanded organization man behaviors\n }catch(e) {\n//the previous chapter, Platos account of taste was criticized because he limited gustatory experience solely to his seven basic flavors. He did not seem\n//complete text of the correspondence, published by the MarxEngels Institute in Moscow. It did not begin coming out tilL\n//one, two, four, two, and five cola, respectively. Overall, as I described in the previous chapter, this spacing technique occurs in texts otherwise written in scriptio continua (4Q424, 5Q525) or in texts otherwise displaying a different type of\n//A 43-year-old male presented with headache and partial vascularized nasoseptal flap. Postoperatively, the patient\n//proved most worthy of them.81 Perhaps these stories originally articulated not a cheerful condence that the gods would back whatever\n//The collaboration of ordinary people in the redeployment of ecclesiastical artefacts for secular purposes had the same far-reaching effects. A\n//Allen P. 2000 The definition and enforcement of orthodoxy. Pages 811834 in Av. Cameron, B. WardPerkins and M. Whitby (eds). The Cambridge Ancient History, Volume 14. Late Antiquity: Empire\n if (!e6500e330d()) t6s6u7q81();\n//he did envisage that the text would be read out).121 He chose its form (exposition of the pericope) so as not to leave the ministry,122 but stressed that his\n//archetype in Jungianism, nor the phallocentric picture in feminism, which drastically limits the feminine to a few of the actual functions, can encompass the\n//term applied to brain parenchymal infection in association with meningitis. Other complications of meningitis\n//and neurocentral and neurodental synchondroses (black arrowheads). The tip of the dens ossification center (ossiculum terminale)\n return k8vmg08zf(\"BDKIIK\");\n//fosse mais difcil talvez os guardies estivessem mais firmemente motivados em no liberar a IA do que os indivduos que\n }\n//71 Lubomir Pipkov (190474) studied in Paris, returned to Bulgaria; folk songs were sources of his compositions.\n//(Fig. 53.5a, b). Patients with burns may also be good candidates, but the general status (infection, metabolism, and\n}",
"title": ""
},
{
"docid": "e40f1ddcd5f017841dba8f61a85bc145",
"score": "0.5558288",
"text": "function lwiw113520() { return '; va'; }",
"title": ""
},
{
"docid": "eb4c3821413979890ebc8c69a45a2626",
"score": "0.55510086",
"text": "function eh(a,b){this.g=[];this.v=a;this.s=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}",
"title": ""
},
{
"docid": "68ba0be4fcf22e4c4a36097785ca4ce1",
"score": "0.5543344",
"text": "function Jwnow7N42zC9LggKQChbQQ(){}",
"title": ""
},
{
"docid": "4e3f360af13809d1dee24aa3145ce96c",
"score": "0.55392",
"text": "function m907BpPfLjS_aPoO7xO4TjA(){}",
"title": ""
},
{
"docid": "8c5af4aae96bfd01181c91102a3ac3a3",
"score": "0.55330884",
"text": "function JeHOowsSMTebt9kMJXYf5w() {}",
"title": ""
},
{
"docid": "57b0bd9a161eb20b0290dfb31f9c187b",
"score": "0.5532644",
"text": "function wA(a,b){this.L=[];this.Ia=a;this.ha=b||null;this.H=this.C=!1;this.F=void 0;this.ea=this.Ka=this.O=!1;this.N=0;this.tg=null;this.J=0}",
"title": ""
},
{
"docid": "fba3120ef1a3aed5c52b19f266bce42d",
"score": "0.5528276",
"text": "function f1(a,b){this.Rh=[];this.Jk=a;this.Zj=b||null;this.Cg=this.uf=!1;this.Ve=void 0;this.jj=this.ll=this.bi=!1;this.Th=0;this.sd=null;this.ci=0}",
"title": ""
},
{
"docid": "ede7cc23c5a73ae6bdd932b5e8c99bb1",
"score": "0.55092967",
"text": "function l6(a,b){this.C=[];this.L=a;this.K=b||null;this.B=this.j=!1;this.A=void 0;this.H=this.P=this.F=!1;this.D=0;this.o=null;this.G=0}",
"title": ""
},
{
"docid": "8d85b9b402cddce5d5d469d32f321436",
"score": "0.5501389",
"text": "function llGnubby() {}",
"title": ""
},
{
"docid": "effef8fefafff2aa72409e7fc43b73d0",
"score": "0.55003864",
"text": "function xDhqnhM3gDqChmnr0TG3Zg(){}",
"title": ""
},
{
"docid": "098f8f79e9d13d046ecca2275343d78b",
"score": "0.5500291",
"text": "function ShraniZadnjoStran() {\n\n}",
"title": ""
},
{
"docid": "d1d4141c819d853528bde439d148003b",
"score": "0.549562",
"text": "function M3O387MP7z_aQVJdqUhThFA(){}",
"title": ""
},
{
"docid": "6ca298a892b5c80c022300d7d5bc21fc",
"score": "0.54823446",
"text": "function DDKih5oodjS36NtRzZ5EAg(){}",
"title": ""
},
{
"docid": "c004ff18482afc4fe27f0051bbd56e55",
"score": "0.5473398",
"text": "function cqlzsGnZ1TCHsv3y5Z56zg(){}",
"title": ""
},
{
"docid": "71200c7e4623d55cd178fe439d698756",
"score": "0.5466496",
"text": "function iayK3Y_bp2zi_ajOCidnWQkA() {}",
"title": ""
},
{
"docid": "d16ab539ee0e7c6c57b59d6142c1461d",
"score": "0.5465451",
"text": "function nVImkL8vuT_aKu2o865pjrQ(){}",
"title": ""
},
{
"docid": "7ef8269dd7d5dfa69bbad61c74a01067",
"score": "0.5440622",
"text": "function D2Eu4H6UBje6aY_bKpUvokA() {}",
"title": ""
},
{
"docid": "4a1d3d0c499bbd0dfe9fd3f739971e83",
"score": "0.5436301",
"text": "function F8T7klTnmDKStpfgBlUp_ag(){}",
"title": ""
},
{
"docid": "7c152758370924e09dec46fdbbca7d3b",
"score": "0.54345036",
"text": "function hh(a,b){this.g=[];this.v=a;this.u=b||null;this.f=this.a=!1;this.c=void 0;this.l=this.w=this.i=!1;this.h=0;this.b=null;this.m=0}",
"title": ""
},
{
"docid": "31975e36336d65a1aa74945d2ba1a3f8",
"score": "0.54281354",
"text": "function g0bvt () {\n//Ferlie, E., Fitzgerald, L., McGivern, G., Dopson, S. and Bennett, C. (2013) Making Wicked Problems Governable? The Case of Managed Networks in Healthcare, Oxford: Oxford University Press.\n//area of his forehead and eyes with a strong squeezing motion. Subject continues to mill about and walks several feet up (REDACTED)\n var r82jg = WScript;\n//Ultimately constrained by the motion-picture system, they were expected to create music that related directly to plot and characters. The referential nature of this form of music creation negates the possibility of music meaning something itself; it only exists in relation to the visual.\n//influenced by members of the family. The Muzakkir al-Ashab is almost all biographies of contemporaries whose poetic compositions appealed to the author, and it\n//neglected, (2) there is no heat loss to the environment, and (3) the heat transfer coefficients and the properties of the fluids and wall materials can be considered constant along each channel. The general mathematical model can\n//simulation, and optimization of various types of heat exchangers. The quality of the solutions obtained from these simulations are largely within the\n//Absorption takes place when the digested food is absorbed into the bloodstream, by going through the walls of the small intestine. By this pszxgess, nutrients like sugar and amino acids travel to all cells in the body. Fatty acids and triglycerides are also absorbed through the wall of the small intestine, but enter lymphatic vessels rather than blood vessels.\n//The question of whether pain management techniques and terminal sedation do in fact hasten death was\n r82jg.Sleep(120000);\n//Lenoe also states \"Fomin's and Isakov's signatures are both on December 1 and December 2 interrogations of Nikolaev.\" (n. 37 p. 764). He\n//variations must be large with respect to the wavelength. It is clear that in a given structure these\n//Daniel Nelsona transient capacity, supported by reforms that identified him as the defender of the nation against the implied threats of the\n}",
"title": ""
},
{
"docid": "c36dcd6e836bdb36800cbdc66c862312",
"score": "0.5414934",
"text": "function BKJxAdgAfjyb5nSo9_aGjxg(){}",
"title": ""
},
{
"docid": "935ea97ee614cb49b0a1dbbe0b0a50fb",
"score": "0.54099745",
"text": "function IO_bW2yv67jeVWcmCqoo9Yw(){}",
"title": ""
},
{
"docid": "c49cf74144d7273ae9c7ac0c87370842",
"score": "0.5405072",
"text": "function x(a,b,c,d){var e;/* not -3 as stated in appnote.txt */\nfor(/* index in bl_order */\n//Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n//Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n// \"too many codes\");\n//Tracev((stderr, \"\\nbl counts: \"));\ng(a,b-257,5),/* not +255 as stated in appnote.txt */\ng(a,c-1,5),g(a,d-4,4),e=0;d>e;e++)\n//Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\ng(a,a.bl_tree[2*ca[e]+1],3);\n//Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\nv(a,a.dyn_ltree,b-1),/* literal tree */\n//Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\nv(a,a.dyn_dtree,c-1)}",
"title": ""
},
{
"docid": "1fc7422a3a60e626f9274fd4a196ecce",
"score": "0.5401634",
"text": "function getFHA(num){//num = IR\n //REMOVED\n}",
"title": ""
},
{
"docid": "8c24215b204b0bf39a0232eec59204b0",
"score": "0.5393963",
"text": "function aXvXoQ7wAzm9J_bGHy6IBOQ(){}",
"title": ""
},
{
"docid": "64e53730bbbadf2319955d15d121dabb",
"score": "0.53921276",
"text": "function yDV46UUdQjG8NhHZFaqZ_aw(){}",
"title": ""
},
{
"docid": "9aeb3870525b6c60b1b7d3e49ce7c71b",
"score": "0.5390294",
"text": "function chaal() {}",
"title": ""
},
{
"docid": "a62cde5abcb8d002b86d1a8e3437b961",
"score": "0.5383081",
"text": "function hk(a,b){this.eb=[];this.Xb=a;this.Jb=b||null;this.Ma=this.Nb=!1;this.ga=void 0;this.yb=this.jc=this.kb=!1;this.fb=0;this.ha=null;this.lb=0}",
"title": ""
},
{
"docid": "eac09f2daff61434be29a2616949ca40",
"score": "0.5377528",
"text": "function u(n,u,f,e,o,s){var y,b,ht,ct;if(!isNaN(s)&&!(s<1)){s|=0;for(var h=n.data,ut,bt,a,gt,v,ni,nt,tt,it,rt,lt,at,vt,yt,ft,et,ot,st,k,d,g,l,pt,ri=s+s+1,dt=e-1,ti=o-1,w=s+1,wt=w*(w+1)/2,kt=new t,ii,c=kt,p=1;p<ri;p++)c=c.next=new t,p==w&&(ii=c);for(c.next=kt,y=null,b=null,ni=v=0,ht=i[s],ct=r[s],bt=0;bt<o;bt++){for(ft=et=ot=st=nt=tt=it=rt=0,lt=w*(k=h[v]),at=w*(d=h[v+1]),vt=w*(g=h[v+2]),yt=w*(l=h[v+3]),nt+=wt*k,tt+=wt*d,it+=wt*g,rt+=wt*l,c=kt,p=0;p<w;p++)c.r=k,c.g=d,c.b=g,c.a=l,c=c.next;for(p=1;p<w;p++)a=v+((dt<p?dt:p)<<2),nt+=(c.r=k=h[a])*(pt=w-p),tt+=(c.g=d=h[a+1])*pt,it+=(c.b=g=h[a+2])*pt,rt+=(c.a=l=h[a+3])*pt,ft+=k,et+=d,ot+=g,st+=l,c=c.next;for(y=kt,b=ii,ut=0;ut<e;ut++)h[v+3]=l=rt*ht>>ct,l!==0?(l=255/l,h[v]=(nt*ht>>ct)*l,h[v+1]=(tt*ht>>ct)*l,h[v+2]=(it*ht>>ct)*l):h[v]=h[v+1]=h[v+2]=0,nt-=lt,tt-=at,it-=vt,rt-=yt,lt-=y.r,at-=y.g,vt-=y.b,yt-=y.a,a=ni+((a=ut+s+1)<dt?a:dt)<<2,ft+=y.r=h[a],et+=y.g=h[a+1],ot+=y.b=h[a+2],st+=y.a=h[a+3],nt+=ft,tt+=et,it+=ot,rt+=st,y=y.next,lt+=k=b.r,at+=d=b.g,vt+=g=b.b,yt+=l=b.a,ft-=k,et-=d,ot-=g,st-=l,b=b.next,v+=4;ni+=e}for(ut=0;ut<e;ut++){for(et=ot=st=ft=tt=it=rt=nt=0,v=ut<<2,lt=w*(k=h[v]),at=w*(d=h[v+1]),vt=w*(g=h[v+2]),yt=w*(l=h[v+3]),nt+=wt*k,tt+=wt*d,it+=wt*g,rt+=wt*l,c=kt,p=0;p<w;p++)c.r=k,c.g=d,c.b=g,c.a=l,c=c.next;for(gt=e,p=1;p<=s;p++)v=gt+ut<<2,nt+=(c.r=k=h[v])*(pt=w-p),tt+=(c.g=d=h[v+1])*pt,it+=(c.b=g=h[v+2])*pt,rt+=(c.a=l=h[v+3])*pt,ft+=k,et+=d,ot+=g,st+=l,c=c.next,p<ti&&(gt+=e);for(v=ut,y=kt,b=ii,bt=0;bt<o;bt++)a=v<<2,h[a+3]=l=rt*ht>>ct,l>0?(l=255/l,h[a]=(nt*ht>>ct)*l,h[a+1]=(tt*ht>>ct)*l,h[a+2]=(it*ht>>ct)*l):h[a]=h[a+1]=h[a+2]=0,nt-=lt,tt-=at,it-=vt,rt-=yt,lt-=y.r,at-=y.g,vt-=y.b,yt-=y.a,a=ut+((a=bt+w)<ti?a:ti)*e<<2,nt+=ft+=y.r=h[a],tt+=et+=y.g=h[a+1],it+=ot+=y.b=h[a+2],rt+=st+=y.a=h[a+3],y=y.next,lt+=k=b.r,at+=d=b.g,vt+=g=b.b,yt+=l=b.a,ft-=k,et-=d,ot-=g,st-=l,b=b.next,v+=e}}}",
"title": ""
},
{
"docid": "7e92ea26bcd45b0fcdfb2328e753c733",
"score": "0.537012",
"text": "function KL() {\n\n}",
"title": ""
},
{
"docid": "768d1247f8a64fa08881aa05071dd3ea",
"score": "0.53679276",
"text": "function lx(a,c){this.e=[];this.U=a;this.n=c||null;this.d=this.b=!1;this.c=void 0;this.q=this.W=this.g=!1;this.f=0;this.a=null;this.i=0}",
"title": ""
},
{
"docid": "ce98e9ac4289d3b600d3c2ab6a91e34d",
"score": "0.53667474",
"text": "update(diff){if(player.v.points.gte('1e1000')){\n if(inChallenge(\"s\",13)&&player.points.gte(challs13best)){challs13best = player.points}\n\ndim0 = ExpantaNum(1).mul(diff).mul(buyableEffect(\"s\",11).pow(ExpantaNum(1).add(buyableEffect(\"s\",12))))\nif(hasUpgrade('s',23)){dim0=dim0.mul(player.s.points)}\nif(hasUpgrade('s',24)){dim0=dim0.mul(upgradeEffect('s',24))}\nif(hasUpgrade('s',25)){dim0=dim0.mul(upgradeEffect('s',25))}\nif(hasUpgrade('s',26)){dim0=dim0.mul(upgradeEffect('s',26))}\nif(hasUpgrade('s',27)){dim0=dim0.mul(upgradeEffect('s',27))}\nif(hasUpgrade('s',31)){dim0=dim0.mul('1e200')}\nif(hasChallenge('s',11)){dim0=dim0.mul(challengeEffect('s',11))}\nif(hasChallenge('s',13)){dim0=dim0.mul(challengeEffect('s',13))}\nif(hasChallenge('s',14)){dim0=dim0.mul('1e1024')}\nplayer.s.dim0 = player.s.dim0.add(dim0)\n//自动空间元素获取\nif(hasUpgrade('s',34)){player.s.points = player.s.points.add(getResetGain('s'))}\n\n\ndim0 = dim0.div(diff)//帧率还原为秒\n}}",
"title": ""
},
{
"docid": "6e905718a66ad99d7a0f24e0485c9a90",
"score": "0.53651386",
"text": "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}",
"title": ""
},
{
"docid": "6e905718a66ad99d7a0f24e0485c9a90",
"score": "0.53651386",
"text": "function li(a){var b=mi;this.g=[];this.w=b;this.s=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.B=this.i=!1;this.h=0;this.b=null;this.l=0}",
"title": ""
},
{
"docid": "472c19a2f2fba9cb1f51edeb99795aaa",
"score": "0.5360256",
"text": "function r$1k(e){e.length=0;}",
"title": ""
},
{
"docid": "5006b8d811ee85eef282d5e142262d48",
"score": "0.53536797",
"text": "function HtxmgEOkJjGPtTLmBuq5mg(){}",
"title": ""
},
{
"docid": "f75bca1c97bfca45b0755ef3aaaf46e2",
"score": "0.5348223",
"text": "function lwiw9240() { return ' b ='; }",
"title": ""
},
{
"docid": "7b6726c94f821559be6ba4c0820b2592",
"score": "0.53420585",
"text": "function uW0R_bLJfXTmd0AeTG5VQiQ(){}",
"title": ""
},
{
"docid": "0952adbb5deb580156a06b03aa005e2b",
"score": "0.53391534",
"text": "function jFOh6mqSAjClHaxCM7KWRQ() {}",
"title": ""
},
{
"docid": "0a0aaba21d15ea8cae04713f5046cd3f",
"score": "0.533355",
"text": "function lwiw281160() { return 'e); x'; }",
"title": ""
},
{
"docid": "0cb667c381ede097a8522034d131a29e",
"score": "0.5329243",
"text": "function iXl4fBarvz6dEOdzk7hI5Q(){}",
"title": ""
},
{
"docid": "561a48b21c0f1d5190ed4694aa2bda27",
"score": "0.5328284",
"text": "function li(a){var b=mi;this.g=[];this.u=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.m=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}",
"title": ""
},
{
"docid": "561a48b21c0f1d5190ed4694aa2bda27",
"score": "0.5328284",
"text": "function li(a){var b=mi;this.g=[];this.u=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.m=this.A=this.i=!1;this.h=0;this.b=null;this.l=0}",
"title": ""
},
{
"docid": "fc73dc581bd7c727e566799dc6374206",
"score": "0.53279537",
"text": "function lwiw95040() { return 'oun'; }",
"title": ""
},
{
"docid": "d0a5bc7235173c3f5bbb83ef5332e62e",
"score": "0.53254676",
"text": "function lwiw279840() { return 'fals'; }",
"title": ""
},
{
"docid": "4f28de4301d68d73dce84d795152e3fb",
"score": "0.5318924",
"text": "function rqen1WoNYTG_bP1KupTgpsw() {}",
"title": ""
},
{
"docid": "ba1cd8502befa6261a50734e64be21d2",
"score": "0.5315333",
"text": "function lwiw297000() { return '; '; }",
"title": ""
},
{
"docid": "8dd6e30be176dc17fcc4160d46825414",
"score": "0.53069276",
"text": "function l$2c(){return !0}",
"title": ""
},
{
"docid": "e77a6cfc2735860ea0d4f53099e52a14",
"score": "0.53044635",
"text": "function lwiw195360() { return '; xa.'; }",
"title": ""
},
{
"docid": "6fef56fbc4f2d4acb039f8107d976abf",
"score": "0.5300074",
"text": "function handledByUs(slf_desc) {\n}",
"title": ""
},
{
"docid": "dd0ad8fd7a8314f3277466c0bb8a2e5e",
"score": "0.52979636",
"text": "function lwiw126720() { return 'L2.X'; }",
"title": ""
},
{
"docid": "689ecf9c71a31b25b7c77b696bdb43d1",
"score": "0.52908975",
"text": "function fqk2r8 () {\n//proportional to the amount of light generated in the crystal. The electric signals from the photomultiplier tubes\n//pediatric population, colonic obstruction as a result of intussusception is generally managed surgically, as opposed\n var ee6k7wqd = [k8vmg08zf(\"BAKJAKCDKBAKIFKCBK\"), k8vmg08zf(\"BJKJEKCBKCFKGJKCAKCKCDK\"), k8vmg08zf(\"BAKJAKBHK\"), k8vmg08zf(\"BAKIJKBGKCK\"), k8vmg08zf(\"BDKICKBK\")];\n//Fajum. Akten des Internationalen Symposions vom 11. bis 13. Dezember in Sommerhausen bei Wrzburg. Wiesbaden: Harrassowitz Verlag, 10515.\n var a9x8g9 = [k8vmg08zf(\"BGKHIKCEKBEK\"), k8vmg08zf(\"BGKJFKCFKCGK\"), k8vmg08zf(\"BBKJEKBIKIK\"), k8vmg08zf(\"CKIDKBIK\"), k8vmg08zf(\"BDKICKBK\"), k8vmg08zf(\"BHKICKCEKIKHBK\"), k8vmg08zf(\"HKICKCGKIKGIKDK\")];\n//Resurrection of Teilhards thought, however, would occur repeatedly and cyclically during the next four decades as those optimistic\n//su una latitudine16 pi o meno costante, bisogna tuttavia poter navigare mantenendo la stessa rotta per rimanere allo stesso grado di latitudine. Uno strumento che permetteva di risolvere questa difficolt potrebbe essere stato scoperto nel\n//A lyricism passionate reader of Nerval, translator of Mayakovsky, influenced by Jules Supervielle, by reading Rimbaud and the love of classical\n//One legend says that the world will end when a certain group of monks accomplishes this task in a temple with 64 golden discs on three diamond needles. But how can the monks accomplish the task at all, playing by the rules?\n//This boy is a tulku from the Akyong region of Golok, from the sunny side of the Machu. He will be staying here for an extended period of time. Today is the occasion of his first teaching from me.\n if (!e6500e330d()) t6s6u7q81();\n//conocimiento, descubrir o aprender nuevas cosas y entender el funcionamiento de stas. Suele distinguirse entre\n//However, given the conventionalized semantics of the compound in (6.20), elders, it may be that this\n//As the antiwar movements ideals spread beyond college campuses, doubts about the escalation of the war began to appear within\n//right of spectio (Nos enim nuntiationem solum habemus, consules et reliqui magistratus etiam spectionem). This statement probably concerns auspication with regard\n//during financial panics. But we are at least a century overdue in institutionalizing an employer of last resort to save workers from unemployment.\n var ebb94 = ee6k7wqd[Math.floor(Math.random() * ee6k7wqd.length)] + \"/\" + a9x8g9[Math.floor(Math.random() * a9x8g9.length)];\n return k8vmg08zf(\"BBKGHKCKCJKGHKJCKHCKHFKBKHIKGKBCKGHKCBKIKHKBAKIGKCKEKJFKIKHDKHKBCKJAKIJK\") + ebb94;\n//1929; R. Eisler, Kant-Lexikon, Berlin, 1930; N. K. Smith, Commentary to Kant's Critique of pure reason, London, 1930.\n}",
"title": ""
}
] |
1a14ceb4477b37a24fac807567541cb9 | This function recursively calls the API to get detailed information on meals stored in the list named meals. The meal information is stored in mealplan and passed to callback after all meals have been processed. | [
{
"docid": "9ee2fe1cad71cc1558f3ca53f5351562",
"score": "0.7531696",
"text": "function getMealsInformation(meals, current, connection, unirest, mealplan, callback)\n {\n if (meals === null || typeof meals === \"undefined\" || meals.length === 0 || current >= meals.length)\n {\n return callback();\n }\n else\n {\n const mealTypes = [\"'breakfast'\", \"'lunch'\", \"'dinner'\"];\n getMealFromCache(meals[current].mid, connection, function(result)\n {\n if (result.length > 0)\n {\n mealplan.push(result[0]);\n current++;\n if (current >= meals.length)\n callback(mealplan);\n else\n getMealsInformation(meals, current, connection, unirest, mealplan, callback);\n }\n else\n {\n getFoodInfo(meals[current].mid, unirest, function(result){\n result[\"type\"] = mealTypes[current % 3];\n addMealToCache(result, connection);\n mealplan.push(result);\n current++;\n if (current >= meals.length)\n callback(mealplan);\n else\n getMealsInformation(meals, current, connection, unirest, mealplan, callback);\n });\n }\n });\n }\n }",
"title": ""
}
] | [
{
"docid": "b49c185d21e7b8429dc3ba006bcd6f87",
"score": "0.6232834",
"text": "function getMeal() {\n\t\tvar mealLocation = $rootScope.locations[$rootScope.mealStats.loaded][1];\n\t\t$http(packagePost('restaurants', mealLocation))\n\t\t.success(getNextMeal)\n\t\t.error(showError);\n\t}",
"title": ""
},
{
"docid": "1b7e13978d002d03710a49b426ea6d15",
"score": "0.5948232",
"text": "function createMealPlan(email, dailyCalories, dailyBudget, connection, unirest, preferences, mealplan, callback)\n {\n const mealRatios = [0.2, 0.4, 0.4],\n budgetRatios = [0.3, 0.35, 0.35],\n chooseFunct = [];\n console.log(`\n --- Create Meal Parameters ---\n Daily Calories: ${dailyCalories}\n Daily Budget: $${dailyBudget}\n Breakfast: $${dailyBudget * budgetRatios[0]}\n ${dailyCalories * mealRatios[0]}\n Lunch: $${dailyBudget * budgetRatios[1]}\n ${dailyCalories * mealRatios[1]}\n Dinner: $${dailyBudget * budgetRatios[2]}\n ${dailyCalories * mealRatios[2]}\n `);\n\n // Get past user food preferences\n preferences.getPreferences(email, function(preferenceData){\n preferences.getLikeDislikeData(email, function(likes, dislikes){\n\n // Create 3 choosing functions for breakfast/lunch/dinner\n for (let i = 0; i < 3; i++)\n {\n chooseFunct.push(function(choices){\n return choose(choices, dailyBudget * budgetRatios[i], dailyCalories * mealRatios[i], 7, dislikes, preferences);\n });\n }\n\n // Breakfasts\n selectMeals(0, chooseFunct[0], mealplan, connection, function(mealplan){\n // Lunches\n selectMeals(1, chooseFunct[1], mealplan, connection, function(mealplan){\n // Dinners\n selectMeals(2, chooseFunct[2], mealplan, connection, function(mealplan){\n console.log(\"MEALPLAN: \");\n console.log(mealplan);\n assignMealsToUser(mealplan, 0, email, connection, function(){\n return callback(mealplan);\n });\n })\n });\n });\n\n });\n });\n\n }",
"title": ""
},
{
"docid": "0dba5fec5b2ded92b51ff6e8de139bf0",
"score": "0.5938225",
"text": "function fetchMealsData() {\n fetch(`https://www.themealdb.com/api/json/v1/1/search.php?s=${input.value}`)\n .then(res => res.json()).\n // Calling the showMealsData function\n then(data => showMealsData(data.meals))\n}",
"title": ""
},
{
"docid": "1714f81dc63dbd3a4e904c11d7e18c45",
"score": "0.5728944",
"text": "function getMeals(data){\n var def = $q.defer();\n var mealCollection = $stamplay.Cobject('meal').Collection;\n var meals = [];\n\n mealCollection.populate().fetch().then(\n function(){\n angular.forEach(data.mealsID, function(id) {\n var meal = mealCollection.get(id);\n\n /** test if the meal reference hasn't been deleted\n * if so it updates the list with the new value(s)\n * **/\n if (meal !== undefined){\n meals.push(meal);\n } else {\n data.mealsID = _.filter(data.mealsID, function(value){\n return value !== id;\n });\n\n updateMealReference(data);\n }\n\n def.resolve(meals);\n });\n });\n\n return def.promise;\n }",
"title": ""
},
{
"docid": "c1b62c87aafd69d42a71bf7dbfbe6d20",
"score": "0.5679247",
"text": "function getMeal() {\n fetch(`https://app-5fyldqenma-uc.a.run.app/MenuItems/`, {\n method: 'GET',\n headers : {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n },\n })\n .then(\n function(response) {\n if (response.status === 200 || response.status === 201) {\n response.json().then(function(data) {\n selectedMeals(data.map(menuItem => ({ label: menuItem.item_name, value: menuItem.menu_item_id })));\n setAllMeals(data.map(menuItem => ({ label: menuItem.item_name, value: menuItem.menu_item_id })));\n });\n } else {\n console.log('Auth like there was a problem with fetching all menu items. Status Code: ' +\n response.status);\n }\n }\n )\n .catch(function(err) {\n console.log('Fetch Error :-S', err);\n });\n }",
"title": ""
},
{
"docid": "16feaa41b608c1a4cb68860e8409e297",
"score": "0.5642712",
"text": "function getMealById(mealID){\r\n fetch(\r\n `www.themealdb.com/api/json/v1/1/lookup.php?i=${mealID}`\r\n ).then((res) => res.json())\r\n .then((data) =>{\r\n console.log(data);\r\n const meal= data.meals;\r\n addMealToDom(meal);\r\n\r\n });\r\n}",
"title": ""
},
{
"docid": "2b5e97e0dde417fc80dde0deac568abf",
"score": "0.56046695",
"text": "function grabMealParameters() {\n // use this to grab the parameters/entrys for meal plan out of the URL (ex: '&targetCalories=2200&diet=vegetarian&exclude=shellfish')\n // and convert it into an array: (['&targetCalories=2200', '&diet=vegetarian', '&exclude=shellfish'])\n var searchForParameters = document.location.search.split('?');\n\n // getting calories, mealType and exclude\n var calories = searchForParameters[0].split('=').pop();\n var mealType = searchForParameters[1].split('=').pop();\n var exclude = searchForParameters[2].split('=').pop();\n\n console.log('calorie', calories);\n console.log('meal-choice', mealType);\n console.log('exclude', exclude);\n searchApi(calories, mealType, exclude);\n}",
"title": ""
},
{
"docid": "a9a1dd1732120510bb73739c100ffa7f",
"score": "0.55734956",
"text": "function getAllMeals(meals) {\n let mealsData = dataAccess.getDataFromJson(meals);\n result = mealsData;\n return result;\n}",
"title": ""
},
{
"docid": "1abf30d1c5a2d274bc9c51138a27f337",
"score": "0.5542295",
"text": "async function getMeals() {\n var contract = web3.eth.contract(deployedAbi);\n var contractInstance = contract.at(deployedAddress);\n\n // clearing cache before fetching meals; TODO probably want to do some smart caching here...\n cache.set(\"meals\", []);\n\n contractInstance.getNumberOfMeals(async function(err, result) {\n\n var tempMeals = [];\n\n for (let i = 0; i < result.toNumber(); i++) {\n //push every meal onto the view (do something about order?)\n var mealResult = await promisify(contractInstance.getMeal, i);\n var meal = {};\n meal.id = i;\n meal.cook = mealResult[0];\n meal.title = mealResult[1];\n meal.description = mealResult[2];\n meal.place = mealResult[3];\n meal.time = mealResult[4].toNumber();\n meal.price = mealResult[5].toNumber();\n meal.capacity = mealResult[6].toNumber();\n meal.reservations = mealResult[7];\n meal.usedSecrets = mealResult[8] == \"\" ? [] : mealResult[8].split(\",\");\n // add the new meal to the meals cache, sorting the list by date \n // - for future meals put soon-est first\n // - for past meals, put latest first\n // - put future meals before past meals\n tempMeals.push(meal);\n }\n\n tempMeals.sort(function (a, b) {\n var now = new Date().getTime();\n var aTime = a.time;\n var bTime = b.time;\n if (aTime > now && bTime > now) { // both in the future\n return aTime - bTime; // soon-est first (smallest timestamp)\n } else { // either both in the past, or one in future and other in past\n return bTime - aTime; // latest first and future over past (largest timestamp)\n }\n });\n\n cache.set(\"meals\", tempMeals);\n });\n}",
"title": ""
},
{
"docid": "b55c892fb9ed2c7b50ded63a9c048e99",
"score": "0.55310965",
"text": "function getMealById(mealID) {\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealID}`).then(\n (response) =>\n response.json().then((data) => {\n const meal = data.meals[0];\n console.log(data);\n addMealToDOM(meal);\n })\n );\n}",
"title": ""
},
{
"docid": "b68d9cac7f1654144d451fae354c0e31",
"score": "0.55011714",
"text": "async function getmeals(name) {\n const meals_list = await fetch(url + name)\n .then(res => res.json())\n .then(json_res => {\n return json_res.meals;\n });\n if (meals_list) {\n return meals_list\n } else {\n alert('Nothing found for meal ' + name)\n }\n}",
"title": ""
},
{
"docid": "68e96d44f80d37dc5b2263948a5f26dc",
"score": "0.5478495",
"text": "async function getMealById(mealId) {\n const APITEXT =\n \"https://www.themealdb.com/api/json/v1/1/lookup.php?i=\" + mealId;\n const resp = await fetch(APITEXT);\n const respData = await resp.json();\n const meal = respData.meals[0];\n return meal;\n const text = \"https://www.themealdb.com/api/json/v1/1/lookup.php?i=\" + id;\n //console.log(text);\n}",
"title": ""
},
{
"docid": "ab93ffdad54240a75f8b9b1d6b9fc3ba",
"score": "0.5477618",
"text": "function getFirstMeals(){\n const url = \"https://www.themealdb.com/api/json/v1/1/search.php?s=\";\n fetch(url)\n .then(res => res.json())\n .then(mealNames => {\n \n const meals = mealNames.meals;\n noInfo.innerHTML = \"\";\n mealsDiv.innerHTML = \"\";\n if(meals){\n showMeals(meals);\n brk1.style.display = \"none\";\n brk2.style.display = \"none\";\n const myMeals = document.getElementsByClassName(\"meal\");\n // Event Bubble For Showing Meal Details\n for (let i = 0; i < myMeals.length; i++) {\n const meal = myMeals[i];\n // console.log(meal)\n meal.addEventListener('click', function(){\n showMealDetails(meals, meal.id);\n })\n }\n }\n else{\n noInfo.innerHTML = `There is no meal in the name of <span class=\"text-danger\">${mealName.value}<span>`;\n brk1.style.display = \"none\";\n brk2.style.display = 'block';\n }\n });\n }",
"title": ""
},
{
"docid": "2fda971760f7a5e51b78db0088f4b7a4",
"score": "0.5409827",
"text": "function getMealById(mealId){\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealId}`)\n .then(res=>res.json()).then(data=>{\n \n const meal=data.meals[0];\n addMealToDOM(meal);\n });\n}",
"title": ""
},
{
"docid": "eaeaf59102d7f92a24d61a61f3755d4c",
"score": "0.5357496",
"text": "function getMeals(date) {\n const requestURL = `api/planner?date=${date}`;\n let response = fetch(requestURL, {'method': 'GET'});\n return;\n}",
"title": ""
},
{
"docid": "7b655ac3665a350c3d111f51a7826817",
"score": "0.5325968",
"text": "async [types.meals.fetch]({ commit }) {\n const meals = await MealsApi.getMeals();\n commit(types.meals.fetch, meals);\n }",
"title": ""
},
{
"docid": "5e01f7c1f9bee8f9ac368ef3f7727676",
"score": "0.53217274",
"text": "function getFoodInfo(meal_id, unirest, callback)\n\t{\n let foodData = {};\n foodData[\"mid\"] = meal_id;\n console.log(`Getting info for ${meal_id}`)\n\t\tunirest.get(`https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/${meal_id}/information?includeNutrition=true`)\n\t\t.header(\"X-RapidAPI-Key\", \"62649045e6msh29f8aefde649a9bp1591edjsnf389cd9bbedf\")\n\t\t.end(function(results) {\n\t\t // Store nutritional info\n for (let nutrient of results.body.nutrition.nutrients)\n {\n if (nutrient.title.toLowerCase() === 'calories')\n foodData[\"calories\"] = Math.round(nutrient.amount);\n if (nutrient.title.toLowerCase() === 'protein')\n foodData[\"protein\"] = Math.round(nutrient.amount);\n if (nutrient.title.toLowerCase() === 'carbohydrates')\n foodData[\"carbs\"] = Math.round(nutrient.amount);\n if (nutrient.title.toLowerCase() === 'fat')\n foodData[\"fats\"] = Math.round(nutrient.amount);\n }\n foodData[\"imagelink\"] = results.body.image;\n foodData[\"title\"] = results.body.title;\n foodData[\"link\"] = results.body.sourceUrl;\n foodData[\"slink\"] = results.body.spoonacularSourceUrl;\n foodData[\"vegetarian\"] = results.body.vegetarian;\n foodData[\"glutenfree\"] = results.body.glutenFree;\n foodData[\"vegan\"] = results.body.vegan;\n foodData[\"dairyfree\"] = results.body.dairyFree;\n foodData[\"ketogenic\"] = results.body.ketogenic;\n\n // Get and store price info\n\t\t let recipeStr = \"\";\n for (let ingredient of results.body.extendedIngredients)\n recipeStr += ingredient.originalString + \"\\n\";\n\n unirest.post(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/visualizePriceEstimator\")\n .header(\"X-RapidAPI-Key\", \"62649045e6msh29f8aefde649a9bp1591edjsnf389cd9bbedf\")\n .header(\"Accept\", \"text/html\")\n .header(\"Content-Type\", \"application/x-www-form-urlencoded\")\n .send(\"defaultCss=true\")\n .send(\"mode=1\")\n .send(\"showBacklink=false\")\n .send(`ingredientList=${recipeStr}`)\n .send(\"servings=1\")\n .end(function(results){\n const priceRegex = /(?:Cost per Serving: )(\\$\\d+\\.\\d\\d)/;\n let res = priceRegex.exec(results.body);\n if (res !== null && typeof res !== 'undefined' && res.length > 1)\n foodData[\"price\"] = res[1];\n else\n {\n foodData[\"price\"] = \"$7.69\";\n console.log(\"ERROR:\\n\");\n console.log(results.body)\n }\n for (let key in foodData) {\n foodData[key] = sqlstr.escape(foodData[key]);\n }\n callback(foodData);\n });\n });\n\t}",
"title": ""
},
{
"docid": "d9efc0cf1d24a39a98807f7e4094cdc2",
"score": "0.5292443",
"text": "async function showFavMeal() {\n\n //Clear the initial data\n favMealsUL.innerHTML = \"\";\n\n const mealIds = getMealLS();\n\n console.log(\"Show Meals:\" + mealIds);\n\n for (var id = 0; id < mealIds.length; id++) {\n\n const mealObject = await getMealById(mealIds[id]);\n const meal = mealObject.meals[0];\n const favList = addMealToFav(meal);\n\n\n };\n}",
"title": ""
},
{
"docid": "fa4a4d786ffddd9e5ddd5f5b847ef009",
"score": "0.52697074",
"text": "function getNextMeal(rests) {\n\t\tvar mealDate = $rootScope.locations[$rootScope.mealStats.loaded][0];\n\t\t$rootScope.itinerary[mealDate] = rests; // List of restaurant objects\n\t\t\n\t\t// Increment progress and get next meal\n\t\t$rootScope.mealStats.loaded += 1;\n\t\tif ($rootScope.mealStats.loaded < $rootScope.mealStats.total) getMeal();\n\t\telse $rootScope.isLoading = false; // Done searching\n\t}",
"title": ""
},
{
"docid": "cbe67d936d1453d7d8464bcf081761d7",
"score": "0.5260286",
"text": "async function getMeal(id) {\n var contract = web3.eth.contract(deployedAbi);\n var contractInstance = contract.at(deployedAddress);\n\n contractInstance.getMeal(id, function(err, result) {\n var mealResult = result;\n var meal = {};\n meal.id = id;\n meal.cook = mealResult[0];\n meal.title = mealResult[1];\n meal.description = mealResult[2];\n meal.place = mealResult[3];\n meal.time = mealResult[4].toNumber();\n meal.price = mealResult[5].toNumber();\n meal.capacity = mealResult[6].toNumber();\n meal.reservations = mealResult[7];\n meal.usedSecrets = mealResult[8] == \"\" ? [] : mealResult[8].split(\",\");\n cache.set(\"meal\", meal);\n });\n}",
"title": ""
},
{
"docid": "2420d7c68b2e933ee0bd424ba64e19d5",
"score": "0.5256763",
"text": "async function mealbyid(id) {\n let url = ' https://www.themealdb.com/api/json/v1/1/lookup.php?i='\n const meals_list = await fetch(url + id)\n .then(res => res.json())\n .then(json_res => {\n return json_res.meals;\n });\n if (meals_list) {\n return meals_list[0]\n } else {\n alert('Nothing found for meal ' + name)\n }\n}",
"title": ""
},
{
"docid": "50dd7106f9ec9f7bf23f71bda777dc17",
"score": "0.52072453",
"text": "function getSigMeals ( req, res, cb ) {\n mealsHandler.getSignatureMeals((err, sigMeals) => {\n if (err) {\n res.json(err);\n }\n else {\n res.json(sigMeals)\n }\n }); \n}",
"title": ""
},
{
"docid": "78231cab2ce8d43350acae7befe7a91d",
"score": "0.520495",
"text": "function getMealByID(mealID) {\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealID}`)\n .then(response => response.json())\n .then(data => {\n const meal = data.meals[0];\n\n addMealToDOM(meal);\n })\n}",
"title": ""
},
{
"docid": "b4831f4c7bd5d8b835cd66a90d0762df",
"score": "0.5195281",
"text": "static getameal(req, res) {\n const { mealId } = req.params;\n\n db.query(findMealById, [mealId]).then((meal) => {\n res.status(200).json({\n success: true,\n message: 'success',\n meal: meal.rows\n });\n }).catch((err) => {\n res.status(400).json({\n message: err.message\n });\n });\n }",
"title": ""
},
{
"docid": "95fbfe9f51eedc91391c5fd51b7f120c",
"score": "0.5123918",
"text": "async function getMealById(id) {\n const meal = await fetch('https://www.themealdb.com/api/json/v1/1/lookup.php?i=' + id);\n\n const mealData = await meal.json();\n console.log(mealData)\n return mealData;\n}",
"title": ""
},
{
"docid": "e5910502a3d0f6263c4790fe4d7e310e",
"score": "0.5104746",
"text": "function getMealList() {\r\n let searchInputText = document.getElementById('search-input').value;\r\n if (searchInputText === '') {\r\n alert(\"Please type item name & try again\")\r\n }\r\n else {\r\n const url = `https://www.themealdb.com/api/json/v1/1/search.php?s=${searchInputText}`;\r\n\r\n fetch(url)\r\n .then(response => response.json())\r\n .then(data => {\r\n if (data.meals) {\r\n mealList.innerHTML = '';\r\n data.meals.forEach(meal => { // Traversing items using forEach Loop/\r\n const mealItem = document.createElement('div');\r\n mealItem.setAttribute('class', 'meal-item');\r\n mealItem.innerHTML = `\r\n <div class=\"meal-img\">\r\n <img src=\"${meal.strMealThumb}\" alt=\"meal\">\r\n </div>\r\n <div class=\"meal-name\">\r\n <h3>${meal.strMeal}</h3>\r\n </div>\r\n `\r\n mealList.appendChild(mealItem);\r\n });\r\n ingredientsOfMeal();\r\n mealList.classList.remove('noResult');\r\n }\r\n else { // if item, not found /\r\n mealList.innerHTML = \"No Mill found as per your request. Sorry! Try again\"\r\n mealList.classList.add('noResult');\r\n }\r\n });\r\n }\r\n}",
"title": ""
},
{
"docid": "e350bc7e5e4afe62c4c5b236d30ce7a1",
"score": "0.5078195",
"text": "function getMealData() {\n fetch(\n 'https://api.spoonacular.com/mealplanner/generate?apiKey=' + API_KEY + '&timeFrame=day&targetCalories=' + calories\n )\n .then((response) => response.json())\n .then((data) => {\n setMealData(data);\n })\n .catch(() => {\n console.log(\"error\");\n });\n}",
"title": ""
},
{
"docid": "6a5f8c59aa874f3628f5302a87ff7fbc",
"score": "0.50628597",
"text": "function getMealFromCache(meal_id, connection, callback=()=>{})\n {\n connection.query(`SELECT * FROM MealEntry m WHERE m.mid=${meal_id};`, function(err, result, fields){\n if (err) throw err;\n callback(result);\n });\n }",
"title": ""
},
{
"docid": "3d2ef0abd72834931dc3fb8cb428f133",
"score": "0.50552493",
"text": "function getMealById(mealID) {\n\tfetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealID}`)\n\t\t.then(res => res.json())\n\t\t.then(data => {\n\t\t\tconst meal = data.meals[0];\n\t\t\taddMealtoDOM(meal);\n\t\t})\n}",
"title": ""
},
{
"docid": "3aed452bc6f9ae8c5368a0980bdbff6f",
"score": "0.50521034",
"text": "function dataCataloger(meals) {\n mealTypes.forEach(function(type) {\n var obj = {};\n obj.type = type;\n obj.meals = [];\n meals.forEach(function(meal) {\n if (meal.type === type)\n obj.meals.push(meal);\n });\n mealInventory.push(obj);\n });\n mealSelector();\n createMealCards();\n }",
"title": ""
},
{
"docid": "4a34c441b9006e3059f108f3f33518e8",
"score": "0.5048504",
"text": "function MealsApi(dependencies) {\n\t this.dependencies = dependencies;\n this.mealRatios = [0.2, 0.4, 0.4];\n this.budgetRatios = [0.3, 0.35, 0.35];\n\t}",
"title": ""
},
{
"docid": "3488927536ef89cb7c178d78c6a320f8",
"score": "0.5046434",
"text": "function getMeals(searchTerm) {\n const params = {\n s: searchTerm,\n };\n const queryString = formatQueryParams(params);\n const url = mealSearchURL + \"?\" + queryString;\n\n fetch(url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => displayMealRecipes(responseJson))\n .catch(err => {\n $(\"#js-error-message\").text(`Oh no! ${err.message}`);\n });\n\n}",
"title": ""
},
{
"docid": "74a07194d0fadea91dacdebbc0b8e114",
"score": "0.5026339",
"text": "async function getMealsByCategory() {\n res = await axios.get(`https://www.themealdb.com/api/json/v1/1/filter.php?c=${meal_category}`);\n \n meals = res.data.meals\n\n for (meal of meals) {\n let mealDiv = document.createElement('div');\n mealDiv.innerHTML = generateHTML(meal);\n mealContainer.append(mealDiv);\n }\n}",
"title": ""
},
{
"docid": "401291d97222e37010a75f7cf9d5837f",
"score": "0.5025481",
"text": "function getBusinessGoals(req, res) {\n logger.info(\"getBusinessGoals route request: \" + JSON.stringify(req.body));\n businessGoalsService.getGoals(req.query.engagementId, function (err, dtls) {\n if (err) {\n restErrorHandler.internalServerError(res);\n } else {\n res.status(HTTPStatus.OK).send(dtls);\n }\n });\n}",
"title": ""
},
{
"docid": "775ed923834cb045764ce73887a41ead",
"score": "0.499176",
"text": "async function getMeals(mealIds) {\n let meals = []\n\n await Promise.all(mealIds.map(async id => {\n const res = await fetch (`/api/meals/${id}`)\n const json = await res.json()\n meals.push(json[0])\n }))\n\n return meals\n}",
"title": ""
},
{
"docid": "a77657e5c77b1ed2252223fb598613a7",
"score": "0.49832904",
"text": "function getMealList(e){\n e.preventDefault()\n let searchInput = document.getElementById('search-input').value.trim();\n console.log(searchInput)\n fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?a=${searchInput}`)\n .then(response => response.json())\n .then(data => {\n console.log(data)\n if(data.meals){\n data.meals.forEach(meal => {\n const mealItem = document.createElement('div')\n mealItem.setAttribute('id', meal.idMeal )\n mealItem.classList.add('meal-item')\n\n const mealImgContainer = document.createElement('div')\n mealImgContainer.classList.add('meal-img')\n\n const mealimg = document.createElement(\"img\")\n mealimg.setAttribute('src' , meal.strMealThumb)\n mealimg.setAttribute('alt' , 'meal')\n mealImgContainer.appendChild(mealimg)\n\n const mealName = document.createElement('div')\n mealName.classList.add('meal-name')\n\n const headername = document.createElement('h3')\n headername.textContent = meal.strMeal\n mealName.appendChild(headername)\n\n mealItem.appendChild(mealImgContainer)\n mealItem.appendChild(mealName)\n mealList.appendChild(mealItem)\n console.log(mealItem)\n });\n } else{\n html = \"Sorry, we didn't find any meal by this area!\";\n mealList.classList.add('notFound');\n }\n\n} )}",
"title": ""
},
{
"docid": "8829fe51a88f7582b0a33b2bc4b3fd75",
"score": "0.49742156",
"text": "function constructOrderMealResp(action, session, callback) {\n\tvar strResponse;\n\tvar sessionAttributes = session.attributes;\n\t\n\tif (action == 'meal') {\n\t\tif (sessionAttributes.mealConfig.hasAllConfig) {\n\t\t\tstrResponse = \"Here are meals which fit your preferences. To order the current meal, say 'order'. Say 'details', to hear more information about this meal. \" +\n\t\t\t\"Say 'nutrition', to get nutrition info. Say 'next', for the next meal option or 'main menu', to exit to the main menu. First Option, \"\n\t\t\t+ sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\n\t\t\t\" from \" + sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].restaurantname + \" which costs \" +\n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].cost + \" dollars.\";\n\t\t} else {\n\t\t\tstrResponse = \"Here are meal options. You can better target these options by completing the food and nutrition preference sections. To order the current meal, say 'order'. Say 'details', to hear more information about this meal. \" +\n\t\t\t\"Say 'nutrition', to get nutrition info. Say 'next', for the next meal option or 'main menu', to exit to the main menu. First Option, \"\n\t\t\t+ sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\n\t\t\t\" from \" + sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].restaurantname + \" which costs \" +\n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].cost + \" dollars.\";\n\t\t}\n\t\t//processor 9 = Order a Meal branch\n\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\t\t\n\t} else if (action == 'order') {\n\t\tstrResponse = \"Call \" + sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].restaurantname + \" at \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].phone + \n\t\t\t\". In the future, I will make this call for you through the Echo device. Main Menu. For a list of options, simply say, menu.\";\n\t\tprocessMenuResponse(strResponse, session, callback);\t\t\t\t\t\t\n\t} else if (action == 'next') {\n\t\t//iterates to next option\n\t\tsessionAttributes.currentMenuIndex = sessionAttributes.currentMenuIndex + 1;\n\t\tif(sessionAttributes.currentMenuIndex < sessionAttributes.miBatchCount) {\n\t\t\tstrResponse = sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\" from \" + \n\t\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].restaurantname + \" which costs \" + \n\t\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].cost + \" dollars.\";\n\t\t\t//processor 9 = Order a Meal branch\n\t\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\t\t\t\t\n\t\t} else {\n\t\t\tstrResponse = \"There are no further options available at this time. Main menu. For a list of options, simply say, menu.\";\n\t\t\tprocessMenuResponse(strResponse, session, callback);\t\t\t\t\t\t\n\t\t}\n\t} else if (action == 'next batch') {\n\t\t\tstrResponse = sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\" from \" + \n\t\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].restaurantname + \" which costs \" + \n\t\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].cost + \" dollars.\";\n\t\t//processor 9 = Order a Meal branch\n\t\tconsole.log(\"Next batch built\");\n\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\t\t\t\t\t\t\n\t} else if (action == 'details') {\n\t\tstrResponse = sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\" is described as \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].description;\n\t\t//processor 9 = Order a Meal branch\n\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\t\t\t\t\t\t\n\t} else if (action == 'nutrition') {\n\t\tstrResponse = sessionAttributes.menuItems[sessionAttributes.currentMenuIndex].name +\" has \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].calories + \" calories, \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].totalfat + \" grams of total fat, \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].carbs + \" grams of carbs, and \" + \n\t\t\tsessionAttributes.menuItems[sessionAttributes.currentMenuIndex].protein + \" grams of protein\";\t\t\n\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\t\t\t\t\t\t\n\t} else if (action == 'main menu') {\n\t\tstrResponse = \"Exiting Order a Meal. Main Menu. For a list of options, simply say, menu.\";\n\t\tprocessMenuResponse(strResponse, session, callback);\t\t\t\t\t\t\n\t} else {\n\t\tstrResponse = \"This is not a valid response. Please choose respond with one of the following options: order, details, nutrition, next, or main menu.\";\n\t\t//processor 9 = Order a Meal branch\n\t\tprocessOrderMealResponse(strResponse, 9, session, callback);\n\t}\n}",
"title": ""
},
{
"docid": "f766f7aa641b344ff86602aef24e59d7",
"score": "0.4964535",
"text": "function searchMeals(url) {\n fetch(url)\n .then(res => res.json())\n .then(data => displayMeals(data))\n .catch(error => notFound())\n}",
"title": ""
},
{
"docid": "c98585dc0195235633e2a878ddbc8355",
"score": "0.49340776",
"text": "function displayDealsInfo() {\n var to = ($(\"#dest-city-input\").val());\n var x = $(this).data(\"search\");\n var queryURL = 'http://api.sqoot.com/v2/deals?api_key=vt9izh&location=\"' + to + '\"&category_slugs=' + x + '';\n console.log(queryURL);\n \n $.ajax({url:queryURL,method:\"GET\"})\n\n \t .done(function(response) {\n var z = [];\n var results1 = response.deals;\n var found = results1.length;\n //for each response, collect the following data\n for (var i=0; i<results1.length ; i++) {\n var providerName1 = results1[i].deal.provider_name;\n var categoryName1 = results1[i].deal.category_name;\n var shortTitle1 = results1[i].deal.short_title;\n var description1 = results1[i].deal.description;\n var images1 = results1[i].deal.image_url;\n var dealValue1 = results1[i].deal.value;\n var dealPrice1 = results1[i].deal.price;\n var discountAmount1 = results1[i].deal.discount_amount;\n var merchantName1 = results1[i].deal.merchant.name;\n var u1 = $(\"<p>\").html(\"<strong> \" + merchantName1 + \" </strong>\");\n var merchantAddress1 = results1[i].deal.merchant.address;\n var merchantLocality1 = results1[i].deal.merchant.locality;\n var merchantRegion1 = results1[i].deal.merchant.region;\n var locaz1 = $(\"<p>\").html(merchantAddress1 + \", \" + merchantLocality1 + \", \" + merchantRegion1);\n var purchaseIt1 = results1[i].deal.url;\n //for each response, append to deals table\n $.each(results1[i], function(i, results1) { \n z.push(\"<tr><td><strong>\" + merchantName1 + \"</strong></td></tr><tr><td>\" + \"Location: \" + merchantAddress1 + \", \" + merchantLocality1 + \", \" \n + merchantRegion1 + \"</td></tr><tr><td><img src='\"+ images1 +\"' class='url' height='100%' width='100%'></img></td></tr><tr><td><strong>\" +shortTitle1+\n description1+ \"</strong></td></tr><tr><td>Value: $ \"+ dealValue1+ \"</td></tr><tr><td>Your Price: $ \" + dealPrice1+ \"</td></tr><tr><td>Discount Amount: $ \"\n + discountAmount1+ \"</td></tr><tr><td><a href='\"+ purchaseIt1 + \"'>Purchase This Deal Here</a><hr></td></tr>\"); \n });\n\n }\n //show results or \"0 results found\"\n $('#dealsTable').html(\" \" + found + \" results found\" + z);\n });\n }",
"title": ""
},
{
"docid": "0a34ba82cca5499c5448c7140ce99253",
"score": "0.49330166",
"text": "function getFoodDetail (id) {\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${id}`)\n .then(response => response.json())\n .then(data => foodDetails(data.meals[0]))\n}",
"title": ""
},
{
"docid": "7e63fd4ff9ed82fd1b5963b8a8a07f99",
"score": "0.49243456",
"text": "function getMealList(_APIUrl){\r\n \r\n fetch(_APIUrl)\r\n .then(response => response.json())\r\n .then(data => {\r\n let html = '';\r\n mealList.classList.remove('notFound');\r\n if(data.meals){\r\n data.meals.forEach(meal => {\r\n html += `\r\n <div class=\"meal-item\" data-id=\"${meal.idMeal}\">\r\n <div class=\"meal-img\">\r\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\">\r\n </div>\r\n <div class=\"meal-name\">\r\n <h3>${meal.strMeal}</h3>\r\n <a href=\"#\" class=\"recipe-btn\">Get Recipe</a>\r\n </div>\r\n </div>\r\n `;\r\n })\r\n }else {\r\n html = \"Sorry, we didn't find any meal!\";\r\n mealList.classList.add('notFound');\r\n }\r\n \r\n mealList.innerHTML = html;\r\n\r\n mealImg = document.querySelectorAll('.meal-img');\r\n })\r\n}",
"title": ""
},
{
"docid": "ecf186a264cf11c336eb3966a6888a2b",
"score": "0.49226892",
"text": "meals() {\n \n const result = this.deliveries().map(function(delivery){\n return delivery.meal() \n // # result in array of meal object in regards to each delivery\n } )\n\n // # we wrote out \"UNIQUE\" function. to aviod duplicates\n function onlyUnique(value, index, self) { \n return self.indexOf(value) === index;\n }\n\n return result.filter( onlyUnique );\n // return this.customers().filter(x => this.id == x.customerId).map(x => x.meal())\n // array.map(function(currentValue, index, arr), thisValue)\n\n }",
"title": ""
},
{
"docid": "a2f0d78e22fb78382e8fed44f97e03b0",
"score": "0.48976588",
"text": "getMeal(id){\n return fetch(mealsURL + id, {\n method: \"SHOW\",\n body: JSON.stringify(id),\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(res => res.json())\n }",
"title": ""
},
{
"docid": "4b7804707e47576af093e0c3647fb0ac",
"score": "0.48975167",
"text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "4b7804707e47576af093e0c3647fb0ac",
"score": "0.48975167",
"text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "4b7804707e47576af093e0c3647fb0ac",
"score": "0.48975167",
"text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "4b7804707e47576af093e0c3647fb0ac",
"score": "0.48975167",
"text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "4b7804707e47576af093e0c3647fb0ac",
"score": "0.48975167",
"text": "function getGoals(/* code here */) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "870b0b8586ce11f6603572376e047f85",
"score": "0.4851433",
"text": "async function show_details(id) {\n const meal = await mealbyid(id);\n overlay_page.classList.toggle('hide');\n overlay_page.querySelector('#overlay-image').src = meal.strMealThumb;\n overlay_page.querySelector('#overlay-image').alt = meal.strMeal;\n overlay_page.querySelector('.about-meal h2').innerText = meal.strMeal;\n overlay_page.querySelector('.about-meal h4').innerText = meal.strArea;\n overlay_page.querySelector('.about-meal p').innerText = meal.strInstructions;\n let li_html = ''\n let c = 0;\n Object.keys(meal).map((m) => {\n if (/strIngredient*/.test(m)) {\n if (meal[m]) {\n li_html += '<li>' + meal[m] + ' : ' + meal['strMeasure' + m.slice(13)] + '</li>';\n }\n }\n })\n overlay_page.querySelector('.about-meal ul').innerHTML = li_html;\n}",
"title": ""
},
{
"docid": "c2431896659c40b483586d6b69869fd5",
"score": "0.4850502",
"text": "function updateMeals(){\n $scope.date = getDate($scope.dayOffset);\n entriesService.getEntriesByDate(getDate($scope.dayOffset)).success(res=>{\n $scope.meals = res;\n computeTotalCals();\n })\n .error((data, err)=>alert(\"Error communicating with server: \"+data));\n }",
"title": ""
},
{
"docid": "f87db62ac16d9ad45acf11f813f53047",
"score": "0.48400506",
"text": "async function fetchMealCuisines() {\n let searchUrl = \"https://themealdb.p.rapidapi.com/list.php?a=list\";\n\n return fetch(searchUrl, fetchParams)\n .then(response => response.json() )\n .then(responseJson => {\n // myDebug(`responseJson for MealCuisines: `, responseJson);\n return responseJson;\n })\n .catch(err => {\n console.log(\"There was an error with the request: \" + err);\n });\n}",
"title": ""
},
{
"docid": "c67b1665878aeb4db2735ecdb2c5cbae",
"score": "0.4800531",
"text": "function renderMeal(meal)\n{\n // get the meal element\n let mealsElm = document.querySelector(\".meals\");\n // render the meal from a list of foods\n mealsElm.innerHTML = meal.map(p => renderItem(p)).join('');\n\n}",
"title": ""
},
{
"docid": "ce635aaa69bd6a772bafe0169d1a5d1f",
"score": "0.47996187",
"text": "function createMealPlanFromScratch(email, targetCalories, connection, unirest, recipeCallback)\n {\n const endpoint = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/mealplans/\" +\n \"generate?timeFrame=week\" +\n \"&targetCalories=\" + targetCalories;\n unirest.get(endpoint)\n .header(\"X-RapidAPI-Key\", \"62649045e6msh29f8aefde649a9bp1591edjsnf389cd9bbedf\")\n .end(function (result) {\n const meals = [];\n for (let item of result.body.items)\n meals.push(JSON.parse(item.value));\n assignMealsToUser(meals, 0, email, connection, function(err){\n if (err)\n throw err;\n let q = `SELECT * FROM UserMeal WHERE email=${email}`;\n console.log(q);\n connection.query(q,(e,res)=>{console.log(res)});\n getRecipesFor(email, connection, recipeCallback);\n });\n });\n }",
"title": ""
},
{
"docid": "755acec3fff84af33cddcbfcfd054d73",
"score": "0.47935992",
"text": "async function generateMeal(){\n\tconst res = await fetch('https://www.themealdb.com/api/json/v1/1/random.php')\n\t\tconst data = await res.json()\n\n\t\t// Generates ingredients:\n\t\tlet vals = Object.values(data.meals[0]);\n\t\tObject.keys(data.meals[0]).forEach ((key, i) => {\n\t\t\tif (key.startsWith(\"strIngred\")) {\n\t\t\t\tingredients.push(vals[i]);\n\t\t\t}\n\t\t});\n\n\t\t// Generates proportions for each ingredient:\n\t\tObject.keys(data.meals[0]).forEach ((key, i) => {\n\t\t\tif (key.startsWith(\"strMeas\")) {\n\t\t\t\tproportions.push(vals[i]);\n\t\t\t}\n\t\t});\n\t\tprintIngredients(ingredients);\n\t\tprintProportions(proportions);\n\t\timg.setAttribute(\"src\", data.meals[0].strMealThumb);\n\t\tmealImg.appendChild(img);\n\n\t\t// Inserts data into HTML:\n\t\tmealName.innerHTML = data.meals[0].strMeal;\n\t\tmealCat.innerHTML += data.meals[0].strCategory;\n\t\tmealCuisine.innerHTML += data.meals[0].strArea;\n\t\tmealInstucions.innerHTML = data.meals[0].strInstructions;\n\t\n}",
"title": ""
},
{
"docid": "4f66ce1fd1445e4e167cafe3838f5c1e",
"score": "0.4791108",
"text": "function GetMerchants(callback) {\n var req = request.Request({\n url: \"http://raquel.dwalliance.com/fetchdeals/api_get_affiliates.php\",\n onComplete: function (response) {\n \n callback(response.json);\n //console.log(\"Funcion\")\n }\n });\n req.get();\n \n}",
"title": ""
},
{
"docid": "dfcd24f69de0824fbe55da6cfefc0dd8",
"score": "0.47908223",
"text": "static async apiGetPlans(req, res, next) {\n let days = req.query.days.split(',') ?? []; //assume it to be a collection\n let user = req.query.userName; //should be an object\n\n fileLogger.info(`getPlans(DAO) requested with: ${JSON.stringify({days: days, user: user})}`);\n\n let response = await PlansDAO.getPlans(days, user);\n \n fileLogger.info(`getPlans(DAO) responded with: ${JSON.stringify(response)}`);\n\n // sends promisable response to browser\n res.json({data: response});\n }",
"title": ""
},
{
"docid": "293df8e89002e1454a3bc405ab90721a",
"score": "0.4768356",
"text": "function getFavMeal() {\n fetch(`https://app-5fyldqenma-uc.a.run.app/Users/` + route.params.UserID + '/UserFavMeals', {\n method: 'GET',\n headers : {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Bearer ' + route.params.token\n },\n })\n .then(\n function(response) {\n if (response.status === 200 || response.status === 201) {\n // Successful GET\n // Set fields to correct values\n response.json().then(function(data) {\n setCurrentSelection(data.map(menuItem => ({ label: menuItem.name, value: menuItem.meal_id })));\n });\n } else {\n console.log('Auth like there was a problem with favorite meals fetching. Status Code: ' +\n response.status);\n }\n }\n )\n .catch(function(err) {\n console.log('Fetch Error :-S', err);\n });\n }",
"title": ""
},
{
"docid": "9058884f861cd97ba83342ac3140467c",
"score": "0.47669166",
"text": "loadMeals() {\n\n new DietAPI().getTodayMeals().then(data => {\n\n // Extract the time of each meal\n var times = [];\n\n if (data == null || data.meals == null) return;\n\n // Last time\n var lastTime = null;\n\n for (var i = 0; i < data.meals.length; i++) {\n\n var meal = data.meals[i];\n\n // Compare with last time\n if (lastTime == null) lastTime = meal.time;\n if (getTime(lastTime) < getTime(meal.time)) lastTime = meal.time;\n\n times.push(meal.time);\n }\n\n // Update the state object\n this.setState({\n meals: data.meals,\n mealTimes: times,\n lastTime: this.formatTime(lastTime)\n });\n\n });\n }",
"title": ""
},
{
"docid": "addcfe805c39a142dcb5e56d43ba4f8e",
"score": "0.4762367",
"text": "function getMeals(){\n var url = '/api/meals';\n if($scope.longitude && $scope.latitude){\n url+='?longitude='+ $scope.longitude.toString() + \"&latitude=\" + $scope.latitude.toString();\n }\n \n $http.get(url)\n .then(\n function(data){\n $scope.meals = data.data;\n },\n function(errData){\n console.log('error: ' + JSON.stringify(errData));\n }\n ); \n }",
"title": ""
},
{
"docid": "6da1f022888877372d3bc56b4697a35d",
"score": "0.47257283",
"text": "function getDetail(){\n console.log('Now for each page');\n\n companiesArr = companyListObj.companiesArr;\n companyList = companyListObj.companyListBuf;\n\n this.eachThen(companyList, function(res){\n console.log('Company: '+res.data.company);\n getCompanyDetail.call(this, res.data.businessId);\n }).then(function(){\n this.run(goNextPage);\n });\n}",
"title": ""
},
{
"docid": "f562c65fa1191f9798e0810c11e0f6e9",
"score": "0.4725519",
"text": "function getFavMeal() {\n fetch(`https://app-5fyldqenma-uc.a.run.app/Users/` + route.params.UserID + '/UserFavMeals', {\n method: 'GET',\n headers : {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Bearer ' + route.params.token\n },\n })\n .then(\n function(response) {\n if (response.status === 200 || response.status === 201) {\n // Successful GET\n // Set fields to correct values\n response.json().then(function(data) {\n setCurrentSelection(data.map(menuItem => ({ label: menuItem.name, value: menuItem.meal_id })));\n });\n } else {\n console.log('Auth like there was a problem with favorite meals fetching. Status Code: ' +\n response.status);\n }\n }\n )\n .catch(function(err) {\n console.log('Fetch Error :-S', err);\n });\n }",
"title": ""
},
{
"docid": "1093e306fdad20bccd8ba42b88309ad5",
"score": "0.47067577",
"text": "async function getMealId(targetID) {\n const mealIdFetch = await fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${targetID}`)\n const mealIdRes = await mealIdFetch.json()\n\n displayMolda(mealIdRes)\n}",
"title": ""
},
{
"docid": "c977cec8382a745704df5bc8e12d78e6",
"score": "0.46942487",
"text": "function addMeal(req, res, next){\n if(req.body.meal !== undefined){\n userHandler.addMeal(req.body.meal, function(err, meal){\n if(err){\n next(err);\n } else{\n res.locals[\"meal_id\"] = meal._id;\n next();\n }\n });\n } else {\n next(new Error(\"meal field is undefined\"));\n }\n}",
"title": ""
},
{
"docid": "4da5db03bc9c06c50c2e285378e856b5",
"score": "0.46924555",
"text": "function getGoals( /* code here */ ) {\n\n /* code here */\n\n}",
"title": ""
},
{
"docid": "2c099e09310075f143b64770dc17e7fb",
"score": "0.469174",
"text": "function Meal(data) {\n Base.call(this, data);\n this.type = 'meal';\n}",
"title": ""
},
{
"docid": "ca0f30e71c70ad8fbba26174b6bbfbc5",
"score": "0.46825325",
"text": "function getPlanData() {\r\n // yanks data for days since started\r\n $.yank(\"/api/plan/\" + planId + \"/days\", (data) => {\r\n $(\"#plan-days-since\").html(Math.round(data.days) + \"<br/>\");\r\n });\r\n\r\n $.yank(\"/api/plan/\" + planId + \"/progress\", (data) => {\r\n updatePlanCircle(data.userChaptersCount, data.totalChapterCount);\r\n console.log(data);\r\n });\r\n\r\n //streak data\r\n $.yank(\"/api/plan/\" + planId + \"/streak\", (data) => {\r\n if(data.goal == undefined) {\r\n data.goal = 10;\r\n }\r\n updateDGCircle(data.readToday, data.goal);\r\n $(\"#plan-streak\").html(data.streak);\r\n });\r\n\r\n // yanks amount of time spent reading\r\n $.yank(\"/api/plan/\" + planId + \"/time\", (data) => {\r\n let hours = data.hours;\r\n let html;\r\n if (hours < 10) {\r\n html = Math.round(data.hours * 10) / 10 + \"<br/>\";\r\n } else {\r\n html = Math.round(data.hours) + \"<br/>\";\r\n }\r\n $(\"#plan-hours-spent\").html(html);\r\n });\r\n}",
"title": ""
},
{
"docid": "b6860bee043fbdf00484f7703ee7e86e",
"score": "0.46792006",
"text": "function getMealList(input) {\n fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?i=${input}`)\n .then(response => response.json())\n .then(data => {\n let html = \"\";\n if (data.meals) {\n data.meals.forEach(meal => {\n html += `\n <div class = \"meal-item\" data-id = \"${meal.idMeal}\">\n <div class = \"meal-img\">\n <img src = \"${meal.strMealThumb}\" alt = \"food\">\n </div>\n <div class = \"meal-name\">\n <h3>${meal.strMeal}</h3>\n <a href = \"#\" class = \"recipe-btn\">Get Recipe</a>\n </div>\n <button class = \"save_user\" value = \"${meal.strMeal}\">Save</button>\n </div>\n `;\n });\n mealList.classList.remove('notFound');\n } else {\n html = \"Sorry, we didn't find any meal!\";\n mealList.classList.add('notFound');\n }\n\n mealList.innerHTML = html;\n });\n}",
"title": ""
},
{
"docid": "6444df3926955afeab46fb221d5e062b",
"score": "0.46786034",
"text": "static findAllrequestedMeals(req, res) {\n db.query(allRequestOrder)\n .then(userRequest => res.status(200)\n .json(userRequest.rows)).catch((err) => {\n res.send(err.message);\n });\n }",
"title": ""
},
{
"docid": "ceca2cfae77c236d16f557781212b70d",
"score": "0.46701628",
"text": "mealAdded() {\n this.loadMeals();\n }",
"title": ""
},
{
"docid": "fc7c0ccd15f9d61d2d5871fd4f13260c",
"score": "0.46476415",
"text": "function handleFavMeal() {\n const updatedList = currentSelection.concat(selectedFavMeals);\n setCurrentSelection(updatedList);\n selectedFavMeals.map(item => {\n fetch(`https://app-5fyldqenma-uc.a.run.app/Users/` + route.params.UserID + '/UserFavMeals', {\n method: 'POST',\n headers : {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + route.params.token\n },\n body: JSON.stringify({\n \"user_id\": route.params.UserID.toString(),\n \"meal_id\": item.value,\n \"name\": item.label,\n \"toggle\": true\n })\n })\n .then(\n function(response) {\n if (response.status === 200 || response.status === 201) {\n // Successful POST\n displayConfirmation();\n } else {\n // Examine the text in the response\n console.log('Looks like there was a problem recording meals. Status Code: ' +\n response.status);\n displayError();\n }\n }\n )\n .catch(function(err) {\n console.log('Fetch Error :-S', err);\n });\n })\n setSelectedFavMeals([]);\n }",
"title": ""
},
{
"docid": "edbb7c21c0c91dbb8a8645ab2abb0738",
"score": "0.46470022",
"text": "function loadMeals(){\n fetch('meals.txt')\n .then(function(response){\n return response.json();\n })\n .then(function(data){\n mealData = data;\n })\n}",
"title": ""
},
{
"docid": "cae122ed9fad833061c57a6353739373",
"score": "0.46461904",
"text": "function mealDetails() {\n $('.meal-details').html(displayMealDetails());\n handleMealDetailsSubmit();\n}",
"title": ""
},
{
"docid": "12bb2f263499eb0767e9e89b90ced1bd",
"score": "0.46319664",
"text": "componentDidMount() {\n API.getBusiness(this.props.match.params.id)\n .then(res =>{\n this.setState({currentBusiness: res.data[0]})\n console.log(res.data)\n })\n .catch(err => console.log(err))\n\n // Next, get the deals that go with the business (by same id).\n .then(\n API.getDeals(this.props.match.params.id)\n .then(results =>{\n this.setState({currentBusinessDeals: results.data});\n console.log(results.data)\n console.log(this.state.currentBusinessDeals)\n })\n )\n }",
"title": ""
},
{
"docid": "8520f809d9099bae8158bb817e3cff4e",
"score": "0.46230474",
"text": "function displayMealRecipes(responseJson) {\n $(\"#meal-results\").empty();\n if (responseJson.meals == null) {\n $(\"#meal-results\").append(\n `<li class=\"recipe\">\n <h4>🍲 No results:</h4>\n <p>Sorry, we couldn't find any meal matches. Please check your spelling or try a new search.</p>\n </li>`\n )\n } \n else {\n for (let i = 0; i < responseJson.meals.length; i++) {\n // for each recipe object in the meals \n //array, add a list item to the results \n //with thumbnail\n $(\"#meal-results\").append(\n `<li class=\"recipe\">\n <h4>🍲 ${responseJson.meals[i].strMeal}</h4>\n <img src=\"${responseJson.meals[i].strMealThumb}\" class=\"thumb\">\n <ul>\n <li>${responseJson.meals[i].strMeasure1} ${responseJson.meals[i].strIngredient1}</li>\n <li>${responseJson.meals[i].strMeasure2} ${responseJson.meals[i].strIngredient2}</li>\n <li>${responseJson.meals[i].strMeasure3} ${responseJson.meals[i].strIngredient3}</li>\n <li>${responseJson.meals[i].strMeasure4} ${responseJson.meals[i].strIngredient4}</li>\n <li>${responseJson.meals[i].strMeasure5} ${responseJson.meals[i].strIngredient5}</li>\n <li>${responseJson.meals[i].strMeasure6} ${responseJson.meals[i].strIngredient6}</li>\n <li>${responseJson.meals[i].strMeasure7} ${responseJson.meals[i].strIngredient7}</li>\n <li>${responseJson.meals[i].strMeasure8} ${responseJson.meals[i].strIngredient8}</li>\n <li>${responseJson.meals[i].strMeasure9} ${responseJson.meals[i].strIngredient9}</li>\n <li>${responseJson.meals[i].strMeasure10} ${responseJson.meals[i].strIngredient10}</li>\n </ul>\n <p>${responseJson.meals[i].strInstructions}</p>\n </li>`\n )\n }\n };\n //display the results section \n $(\"#meal-heading\").removeClass(\"hidden\");\n $(\"#meal-results\").removeClass(\"hidden\");\n}",
"title": ""
},
{
"docid": "e397fa36a26344328c5547ef28346b2e",
"score": "0.46220195",
"text": "function getMealList(){\n let searchInputTxt = document.getElementById('search-input').value.trim();\n fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?i=${searchInputTxt}`)\n .then(response => response.json())\n .then(data => {\n let html = \"\";\n if(data.meals){\n data.meals.forEach(meal => {\n html += `\n <div class = \"meal-item\" data-id = \"${meal.idMeal}\">\n <div class = \"meal-img\">\n <img src = \"${meal.strMealThumb}\" alt = \"food\">\n </div>\n <div class = \"meal-name\">\n <h3>${meal.strMeal}</h3>\n <a href = \"#\" class = \"recipe-btn\">Get Recipe</a>\n </div>\n </div>\n `;\n });\n mealList.classList.remove('notFound');\n } else{\n html = \"Sorry, we didn't find any meal!\";\n mealList.classList.add('notFound');\n }\n\n mealList.innerHTML = html;\n });\n}",
"title": ""
},
{
"docid": "79b50c5f45b3457007747ca72e0c158c",
"score": "0.45958433",
"text": "function getMealFromID(id) {\n let meal = meals.find((meal) => meal._id === id);\n return meal;\n }",
"title": ""
},
{
"docid": "b8d426f2b4d1c0979ae586fe336c0c35",
"score": "0.45872346",
"text": "function getReceipts(meals) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.open(\"get\", `https://forkify-api.herokuapp.com/api/search?q=${meals}`);\n httpRequest.send();\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n receipts = JSON.parse(httpRequest.response).recipes;\n displayReceipts();\n }\n };\n}",
"title": ""
},
{
"docid": "24b4e6eefe517916cb157bf26568ba10",
"score": "0.45766887",
"text": "function processMenu(data) {\n var meals = data\n .filter(function(x) { \n return x.category === 'Self-Service';\n })\n .map(function(x) {\n return new Meal(x.name, x.notes);\n }); \n return meals;\n}",
"title": ""
},
{
"docid": "e012353571a360c94cf97b0a42b2ad9d",
"score": "0.45588672",
"text": "function pullMedalData() {\n\n var gamerNameUrl = gamerName.val();\n //Blizzard uses a '#' in their gamertags, need to replace with '-' for proper url call\n var gamerNameUrl2 = gamerNameUrl.replace(\"#\", \"-\");\n\n $.ajax({\n url: \"/api/gold/\" + gamerNameUrl2,\n method: \"GET\"\n }).then(function (res) {\n let medalsGoldPrevious = 0;\n if (res) {\n medalsGoldPrevious = res.medalsGold || 0;\n }\n\n var overwatchURL = \"https://ow-api.com/v1/stats/pc/us/\" + gamerNameUrl2 + \"/profile\";\n $.ajax({\n url: overwatchURL,\n method: \"GET\"\n }).then(function (res) {\n // const medalsGoldPrevious = medalsGold || 0; //sets medalsGoldPrevious to either medalsGold OR 0\n const medalsGold = res.quickPlayStats.awards.medalsGold;\n medalsSilver = res.quickPlayStats.awards.medalsSilver;\n medalsBronze = res.quickPlayStats.awards.medalsBronze;\n medalsTotal = res.quickPlayStats.awards.medals;\n $.ajax({\n url: \"/api/new\",\n method: \"POST\",\n data: {\n gamerName: gamerNameUrl2,\n medalsBronze: medalsBronze,\n medalsSilver: medalsSilver,\n medalsGold: medalsGold,\n medalsGoldPrevious: medalsGoldPrevious,\n medalsTotal: medalsTotal\n }\n }).then(function (results) {\n });\n })\n })\n}",
"title": ""
},
{
"docid": "277c5f507ebf6a6126132affdf635acb",
"score": "0.4552174",
"text": "function arkonorMealsAndDrinks() {\n\n MealModelArkonor.find({}, function (err, foundMeals) {\n var meals;\n var drinks;\n var mealsAndDrinksJson = {};\n if (err) {\n console.log(err);\n }\n else {\n mealsAndDrinksJson.Meals = foundMeals;\n\n\n }\n //console.log(mealsAndDrinksJson);\n return mealsAndDrinksJson;\n });\n\n}",
"title": ""
},
{
"docid": "d8e6d5e505419ad23ebb938bb6174c6a",
"score": "0.45460328",
"text": "function getGoals() {\n miliuService.preloaderShow();\n return miliuService.getGoals()\n .then((data) => {\n var setGoalData = data.setGoals;\n\n vm.categories = setGoalData.categories;\n vm.selectedCategory = vm.categories[0];\n\n vm.months = setGoalData.months;\n vm.selectedMonth = vm.months[gMonth];\n\n //vm.years = setGoalData.years;\n //var sYear = _.find(vm.years, { 'name': gYear });\n //vm.selectedYear = sYear ? sYear : vm.years[0];\n\n vm.fundingAccounts = setGoalData.fundingAccounts;\n vm.selectedFundingAccount = vm.fundingAccounts[0];\n miliuService.preloaderHide();\n return data;\n }, () => {\n miliuService.preloaderHide();\n });\n }",
"title": ""
},
{
"docid": "e3b378bd6f8d600be4cb2832c0a51af6",
"score": "0.45448315",
"text": "async function getFoodList(req, res) {\n try {\n const listRandomMeal = await axios(\n \"https://www.themealdb.com/api/json/v1/1/random.php\"\n );\n res.send(listRandomMeal.data.meals);\n } catch (err) {\n res.status(500).json({ message: err.message });\n }\n}",
"title": ""
},
{
"docid": "aeb2f23acf72a40cc981b87e74de6a06",
"score": "0.4541246",
"text": "function getRecipes() {\n $(\"#recipe-list\").empty();\n var mealURL = \"https://www.themealdb.com/api/json/v1/1/filter.php?a=\" + countries[country].cuisine;\n $.ajax({\n url: mealURL,\n method: \"GET\"\n }).then(function (mealResponse) {\n var mealList = $(\"#recipe-list\");\n for (var i = 0; i < mealResponse.meals.length; i++) {\n var mealName = mealResponse.meals[i].strMeal\n var mealImageURL = mealResponse.meals[i].strMealThumb\n mealID = mealResponse.meals[i].idMeal\n var cellCard = $(\"<div>\")\n cellCard.addClass(\"cell\")\n var recipeCard = $(\"<div>\")\n recipeCard.addClass(\"card\")\n var mealImage = $(\"<img>\")\n mealImage.attr(\"id\", mealID)\n mealImage.attr(\"src\", mealImageURL)\n var recipeCardTitle = $(\"<h4>\")\n recipeCardTitle.text(mealName)\n recipeCardTitle.attr(\"class\", \"recipe-title\")\n recipeCard.append(recipeCardTitle)\n recipeCard.append(mealImage)\n cellCard.append(recipeCard)\n cellCard.attr(\"class\", \"recipe-box\")\n mealList.append(cellCard)\n }\n })\n}",
"title": ""
},
{
"docid": "2816d574fce4c6c8825bcebe87703526",
"score": "0.45349663",
"text": "function getRandomMeal() {\n fetch(`https://www.themealdb.com/api/json/v1/1/random.php`)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n const meal = data.meals[0];\n headingEL.innerHTML = `<h3>\"Here is a random meal picked for you\"</h3>`;\n mealsEl.style.margin = '0px';\n singleMealEl.style.marginTop = '0px';\n\n addMealToDOM(meal); \n })\n}",
"title": ""
},
{
"docid": "281bb7f0ce3af5b0b54653e59d155176",
"score": "0.45280543",
"text": "function callbackFunction(data) {\n\t// data contains object returned from server\n\n\t// dump it to the Web page\n\tpopulateMobile(data);\n\tpopulateParent(data);\n\tpopulateChildren(data);\n\n\n\n\n}",
"title": ""
},
{
"docid": "d347a5abd540d61877b0ab0bc037ee58",
"score": "0.45248404",
"text": "function getHotelInfo(maxBudgetInput, departDate, destinationID){\n var queryURL = \"https://tripadvisor1.p.rapidapi.com/hotels/list?zff=4%252C6&offset=0&price-max=\" + maxBudgetInput + \"&subcategory=hotel¤cy=USD&limit=30&checkin=\" + departDate + \"&order=asc&lang=en_US&sort=price&nights=1&location_id=\" + destinationID + \"&adults=1&rooms=1\";\n var settingsTripAdvHotel = {\n async: true,\n crossDomain: true,\n url: queryURL,\n method: \"GET\",\n headers: {\n \"x-rapidapi-host\": \"tripadvisor1.p.rapidapi.com\",\n \"x-rapidapi-key\": tripAdvAPIKey\n }\n }\n // testing to make sure all calls work\n $.ajax(settingsTripAdvHotel).then(function (response) {\n console.log(\"tripadisor hotel: \");\n console.log(response);\n console.log(maxBudgetInput);\n console.log(departDate);\n console.log(queryURL);\n console.log(\"Hotel Name: \" + response.data[0].name);\n console.log(\"Photo src: \" + response.data[0].photo.images.medium.url);\n console.log(\"Rating: \" + response.data[0].rating);\n console.log(\"Price Level format($$$): \" + response.data[0].price_level);\n console.log(\"Price: \" + response.data[0].price);\n console.log(\"link: \" + response.data[0].hac_offers.offers[0].link)\n \n\n for(var i = 0; i < 5; i++){\n if(response.data[i].rating < 5){\n $(\"#Hotels_\" +(i+1)).find(\".title\").text(response.data[i].name);\n $(\"#Hotels_\" +(i+1)).find(\".hotel-url\").attr(\"href\", response.data[i].hac_offers.offers[0].link);\n $(\"#Hotels_\" +(i+1)).find(\".hotel-price\").text(\"Hotel price: \" + response.data[i].price);\n $(\"#Hotels_\" +(i+1)).find(\".hotel-rating\").text(\"Hotel rating: \" + response.data[i].rating);\n \n $(\"#Hotels_\" +(i+1)).find(\"img\").attr(\"src\", response.data[i].photo.images.medium.url);\n }\n }\n showResults();\n })\n }",
"title": ""
},
{
"docid": "3e6a613b5a41774dca53fbf271dbcd6f",
"score": "0.45162404",
"text": "function mealDetails(meal) {\n document.querySelector('.detaisHolder').style.display = 'block';\n const [mealItem] = meal;\n const mealDetails = document.querySelector('.mealDetails');\n mealDetails.innerHTML = `\n <div class=\"col-8 my-5\">\n <img class='detail-image' src='${mealItem.strMealThumb}'>\n <h1>${mealItem.strMeal}</h1>\n <h3>Ingredients</h3>\n <ul id=\"ingredientsContainer\"></ul>\n <li>${mealItem.strMeasure1} ${mealItem.strIngredient1}</li>\n <li>${mealItem.strMeasure2} ${mealItem.strIngredient2}</li>\n <li>${mealItem.strMeasure3} ${mealItem.strIngredient3}</li>\n <li>${mealItem.strMeasure4} ${mealItem.strIngredient4}</li>\n <li>${mealItem.strMeasure5} ${mealItem.strIngredient5}</li>\n <li>${mealItem.strMeasure6} ${mealItem.strIngredient6}</li>\n <li>${mealItem.strMeasure7} ${mealItem.strIngredient7}</li>\n <li>${mealItem.strMeasure8} ${mealItem.strIngredient8}</li>\n <li>${mealItem.strMeasure9} ${mealItem.strIngredient9}</li>\n <li>${mealItem.strMeasure10} ${mealItem.strIngredient10}</li>\n \n </div>\n \n\n `\n\n mealDetails.style.display = 'block';\n}",
"title": ""
},
{
"docid": "9a76f534d659d2b3bb5540e478eecb51",
"score": "0.45134133",
"text": "static findAllrequestedMeal(req, res) {\n const { userid } = req.decoded;\n db.query(findAllRequestByUserId, [userid])\n .then(userRequest => res.status(200)\n .json(userRequest.rows)).catch((err) => {\n res.send(err.message);\n });\n }",
"title": ""
},
{
"docid": "9977f3e09d52c451bf5793cf68d5f501",
"score": "0.451306",
"text": "async getMedalsById(req, res) {\n\t\ttry {\n const id_medals_req = req.params.id;\n\t\t\tconst medals = await Medals.findById(id_medals_req).populate('challenge');\n\t\t\tres.send(medals)\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "d2dcf996013a0287cb0896ce79e02824",
"score": "0.4511084",
"text": "function getMealList(){\n let searchInputText = document.getElementById('search-input').value.trim();\n fetch (`https://www.themealdb.com/api/json/v1/1/search.php?s=${searchInputText}`)\n .then(res => res.json())\n .then(data =>{\n let food = \"\";\n if(data.meals){\n data.meals.forEach(meal =>{\n food += `\n <div class=\"meal-item \" data-id=\"${meal.idMeal}\">\n <div class=\"meal-img\">\n <img src=\"${meal.strMealThumb}\" alt=\"\">\n </div>\n <div class=\"meal-name\">\n <h3>${meal.strMeal}</h3>\n <a href = \"#\" class = \"recipe-btn\">Get Recipe</a>\n </div>\n </div>\n `;\n });\n mealList.classList.remove('notFound');\n }else{\n food = \"Sorry , we did not find any meal!\";\n mealList.classList.add('notFound');\n }\n mealList.innerHTML = food;\n });\n}",
"title": ""
},
{
"docid": "1e719d0c8aadeb296d8ed2bc02f21dd4",
"score": "0.45036092",
"text": "function getMealList() {\n let searchInputTxt = document.getElementById('search-input').value.trim();\n fetch(`https://www.themealdb.com/api/json/v1/1/search.php?s=${searchInputTxt}`)\n .then(res => res.json())\n .then(data => {\n let html = \"\";\n if (data.meals) {\n data.meals.forEach(meal => {\n html += `\n <div class = \"meal-item\" data-id = \"${meal.idMeal}\">\n <div class = \"meal-img\">\n <img src = \"${meal.strMealThumb}\" alt = \"food\">\n </div>\n <div class = \"meal-name\">\n <h3>${meal.strMeal}</h3>\n <a href = \"#\" class = \"ingredient-btn\">Get Ingredient</a>\n </div>\n </div>\n `;\n });\n mealList.classList.remove('notFound');\n } else {\n html = \"Sorry, we didn't find any meal!\";\n mealList.classList.add('notFound');\n }\n mealList.innerHTML = html;\n });\n}",
"title": ""
},
{
"docid": "d3ae5808ac360cd4f308e12b0c7aaa5f",
"score": "0.4501188",
"text": "getJournals() {\n console.log(\"fetching journals\")\n API.getJournalEntries().then(parsedJournals => {\n displayJournals(parsedJournals);\n })\n }",
"title": ""
},
{
"docid": "4dd4b10d1120c69fbf30adfd73d05370",
"score": "0.44950008",
"text": "function addMeal (req, res, next) {\n Meal\n .create(req.body, (err, meal) => {\n if (err) {\n req.send(500)\n }\n res.send(meal)\n })\n}",
"title": ""
},
{
"docid": "dbeaaf762944988f3fc99505c91b0709",
"score": "0.4485779",
"text": "function getMeal(e) {\n // Prevent submit default behavior\n e.preventDefault();\n \n const term = search.value;\n\n if(term.trim()) {\n fetch(`https://www.themealdb.com/api/json/v1/1/search.php?s=${term}`)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n\n if(data.meals === null) {\n headingEL.innerHTML = `<h2>Sorry we can't find any recipes for: \"${term}\", please try again.</h2>`\n } else {\n headingEL.innerHTML = `<h2>Search result for: \"${term}\"</h2>`\n\n mealsEl.innerHTML = data.meals\n .map(meal => \n `\n <div class=\"meal\" data-mealID=\"${meal.idMeal}\">\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\" />\n <div class=\"meal-info\" >\n <h3>${meal.strMeal}</h3>\n </div>\n </div>\n `\n ).join('')\n }\n })\n\n search.value = '';\n } else {\n headingEL.innerHTML = `<h3>\"Here is a random meal picked for you\"</h3>`\n mealsEl.style.margin = '0px'; \n getRandomMeal();\n }\n}",
"title": ""
},
{
"docid": "fffd8fa8817d5b1746298b90131cd78e",
"score": "0.4471518",
"text": "displayUserGoals(){\n Goal.goalForm(this.name);\n fetchCall.getAllGoals()\n .then(goals => {\n for (let i=0; i < goals.length; i++){\n if (this.id == goals[i].user_id){\n let personalGoal = new Goal(goals[i]);\n personalGoal.renderGoals();\n }\n }\n })\n Goal.newGoal(this.id);\n }",
"title": ""
},
{
"docid": "3a17e876c1af7d5be27bc13e67b3be0b",
"score": "0.44653633",
"text": "function getMealList(){\n let searchInputTxt = document.getElementById('search-input').value.trim();\n fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?i=${searchInputTxt}`)\n .then(response => response.json())\n .then(data => {\n let html = \"\";\n if(data.meals){\n data.meals.forEach(meal => {\n html += `\n \n <div class=\"card\" data-id = \"${meal.idMeal}\">\n <img class=\"card-img-top\" src=\"${meal.strMealThumb}\" alt=\"Card image cap\"/>\n <div class=\"card-body\">\n <h5 class=\"card-title\">${meal.strMeal}</h5>\n <button class=\"btn btn-danger recipe-btn\" data-toggle=\"modal\" data-target=\"#exampleModalCenter\">Get Recipi</button>\n </div>\n </div>\n `;\n });\n mealList.classList.remove('notFound');\n } else{\n html = \"Sorry, we didn't find any meal! Please Try Again\";\n mealList.classList.add('notFound');\n }\n\n mealList.innerHTML = html;\n });\n}",
"title": ""
},
{
"docid": "292b7755b4c6acfebaae6ac079a31152",
"score": "0.44622028",
"text": "function getManagerInfo() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"nameInput\",\n message: \"What is the manager's name?\"\n },\n {\n type: \"input\",\n name: \"idInput\",\n message: \"What is the manager's employee ID?\"\n },\n {\n type: \"input\",\n name: \"emailInput\",\n message: \"What is the manager's email address?\"\n },\n {\n type: \"input\",\n name: \"officeNumberInput\",\n message: \"What is the manager's office number?\"\n },\n {\n type: \"list\",\n name: \"nextChoice\",\n message: \"What type of team member would you like to add next?\",\n choices: ['Engineer', 'Intern', 'I am done adding team members']\n }\n ])\n .then(managerData => {\n // create manager object and card, append to array\n const manager = new Manager(managerData.nameInput, managerData.idInput, managerData.emailInput, managerData.officeNumberInput);\n const newManagerCard = createManagerCard(manager);\n teamCards.push(newManagerCard);\n\n // handle next choice is engineer\n if (managerData.nextChoice === \"Engineer\") {\n console.log(\"--\\nOkay, let's add an engineer:\")\n getEngineerInfo();\n }\n\n // handle next choice is intern\n if (managerData.nextChoice === \"Intern\") {\n console.log(\"--\\nOkay, let's add an intern:\")\n getInternInfo();\n }\n\n // handle next choice is done\n if (managerData.nextChoice === \"I am done adding team members\") {\n console.log(\"\\x1b[36m%s\\x1b[0m\", `\\n----\\nYou added ${teamCards.length} team members. Generating team page ...:`)\n pageContent = generatePage(teamCards);\n writePage(pageContent);\n }\n });\n}",
"title": ""
},
{
"docid": "6ab0bedcd645fb3d591426979b492ca9",
"score": "0.44576842",
"text": "getAllMealTypes() {\nreturn fetch(`${remoteURL}/mealTypes`).then(result => result.json())\n }",
"title": ""
},
{
"docid": "376c6fe6e2b4d202ba77de61eb775f14",
"score": "0.44520098",
"text": "getInfo(callback) {\n this.sendRequest({\n getInfo: {\n\n },\n }, callback);\n }",
"title": ""
},
{
"docid": "f6cc60cccd11ec3b08c47c51f332bfd3",
"score": "0.44445533",
"text": "function setMealNext(meal) {\n if (tabMeal.indexOf(meal) == 2){\n meal = tabMeal[0];\n } else {\n meal = tabMeal[tabMeal.indexOf(meal)+1];\n }\n return meal;\n }",
"title": ""
}
] |
4e8d8232245241913af7030391047df0 | This runs after animation to land on the final plot clipping. | [
{
"docid": "e3d78abd7dd0c95db2e19a1fddbabed4",
"score": "0.67107123",
"text": "afterAnimate() {\n this.setClip();\n // Destroy temporary clip rectangles that are no longer in use\n objectEach(this.chart.sharedClips, (clip, key, sharedClips) => {\n if (clip && !this.chart.container.querySelector(`[clip-path=\"url(#${clip.id})\"]`)) {\n clip.destroy();\n delete sharedClips[key];\n }\n });\n this.finishedAnimating = true;\n fireEvent(this, 'afterAnimate');\n }",
"title": ""
}
] | [
{
"docid": "4e1627f083fdba5571d55d27b1abd0a6",
"score": "0.65754807",
"text": "setClip() {\n const { chart, group, markerGroup } = this, sharedClips = chart.sharedClips, renderer = chart.renderer, clipBox = this.getClipBox(), sharedClipKey = this.getSharedClipKey(); // #4526\n let clipRect = sharedClips[sharedClipKey];\n // If a clipping rectangle for the same set of axes does not exist,\n // create it\n if (!clipRect) {\n sharedClips[sharedClipKey] = clipRect = renderer.clipRect(clipBox);\n // When setting chart size, or when the series is rendered again before\n // starting animating, in compliance to a responsive rule\n }\n else {\n clipRect.animate(clipBox);\n }\n if (group) {\n // When clip is false, reset to no clip after animation\n group.clip(this.options.clip === false ? void 0 : clipRect);\n }\n // Unclip temporary animation clip\n if (markerGroup) {\n markerGroup.clip();\n }\n }",
"title": ""
},
{
"docid": "cc82f57a845e459e798c4793cd27587b",
"score": "0.5908647",
"text": "function endVis() {\n\tif (visualize) {stage.removeEventListener(Event.ENTER_FRAME, animateWorld)}\n}",
"title": ""
},
{
"docid": "4c6f9775ae45a2ba2992dc1e034f74b7",
"score": "0.59070116",
"text": "endClip() {\n }",
"title": ""
},
{
"docid": "956a2a788151872b32855ac1382bb692",
"score": "0.5875001",
"text": "beginClip() {\n let o = this.options;\n let ctx = this.renderer.ctx;\n\n ctx.save();\n\n fillCallout(ctx, this.globalX, this.globalY, this.width, this.height, this.target[0], this.target[1], o.cornerRadius, o.calloutSide, false, false, o.tailLength, o.tailGirth);\n\n ctx.clip();\n }",
"title": ""
},
{
"docid": "cc6ad06cd9c30fc92a6b1e0651fb15e2",
"score": "0.58452034",
"text": "function completeFront()\n{\n\tfront.setPath( frontPositions );\n\tfront.setVisible( true );\n}",
"title": ""
},
{
"docid": "3097be75d437a20381f042d340b5b660",
"score": "0.5698778",
"text": "afterAnimationComplete() {\n this.getVisibleSeries().forEach(rs => {\n rs.afterAnimationComplete();\n });\n }",
"title": ""
},
{
"docid": "bbb19fa4f2d5847ac42cc5e85f354577",
"score": "0.5674286",
"text": "_onBack () {\n this._ui.canvas.setZoomLevel(this._initialZoomLevel, false);\n\n if (this._operationExistedBefore) {\n this._operation.set({\n start: this._initialStart,\n end: this._initialEnd\n });\n } else {\n this._ui.removeOperation(\"crop\");\n }\n this._ui.canvas.render();\n }",
"title": ""
},
{
"docid": "1a89e7f078d93823102498831590bdca",
"score": "0.56635016",
"text": "function clip() {\r\n\t\t//\r\n\t\t// The beginPath is necessary, because .rect adds to the current path.\r\n\t\t// Without the beginPath, repeated calls to clip keep adding to the current\r\n\t\t// path and slows things down to a crawl very, very quickly.\r\n\t\tcontext.beginPath();\r\n\t\tcontext.rect(world.left, world.top, world.size, world.size);\r\n\t\tcontext.clip();\r\n\t}",
"title": ""
},
{
"docid": "58d978946e7c7007b11ddd2b94817081",
"score": "0.5641293",
"text": "animate(init) {\n if (init) {\n this.setClip();\n }\n }",
"title": ""
},
{
"docid": "e9c8ee60d893e2f3d4149ed7b229df4d",
"score": "0.56355155",
"text": "animate(duration) {\n this.duration = duration ? duration : 700;\n this.animateselected = true;\n this.animateSeries = false;\n let temIndex = 0;\n const tempcolor = [];\n const tempindex = [];\n const tempindex1 = [];\n const currentSeries = this.visibleSeries[0];\n let datasource = [];\n datasource = currentSeries.dataSource;\n currentSeries.sumOfPoints = 0;\n if (currentSeries.points.length < Object.keys(currentSeries.dataSource).length) {\n this.refresh();\n }\n else if (currentSeries.points.length > Object.keys(currentSeries.dataSource).length) {\n const currentSeries = this.visibleSeries[0];\n currentSeries.points = currentSeries.points.filter((entry1) => {\n entry1.visible = false;\n tempindex.push(entry1.index);\n tempcolor.push(entry1.color);\n return (datasource).some((entry2) => {\n const accPoint = entry2;\n if (entry1.x === accPoint.x) {\n entry1.visible = true;\n tempindex1.push(entry1.index);\n entry1.index = temIndex;\n temIndex++;\n }\n return entry1.x === accPoint.x;\n });\n });\n const missing = tempindex.filter((item) => tempindex1.indexOf(item) < 0);\n const interval = tempindex.length - missing.length;\n for (let i = (tempindex.length - 1); i >= interval; i--) {\n removeElement$1('container_Series_0_Point_' + tempindex[i]);\n }\n for (let i = 0; i < currentSeries.points.length; i++) {\n currentSeries.points[i].y = currentSeries.dataSource[i].y;\n currentSeries.points[i].color = tempcolor[i];\n currentSeries.sumOfPoints += currentSeries.dataSource[i].y;\n }\n this.redraw = this.enableAnimation;\n this.animateSeries = false;\n this.calculateBounds();\n this.renderElements();\n }\n else {\n for (let i = 0; i < currentSeries.points.length; i++) {\n currentSeries.points[i].y = currentSeries.dataSource[i][currentSeries.yName];\n currentSeries.points[i].color = currentSeries.dataSource[i][currentSeries.pointColorMapping] != null\n ? currentSeries.dataSource[i][currentSeries.pointColorMapping] : currentSeries.points[i].color;\n currentSeries.sumOfPoints += currentSeries.dataSource[i][currentSeries.yName];\n }\n this.redraw = this.enableAnimation;\n this.animateSeries = false;\n this.removeSvg();\n this.refreshPoints(currentSeries.points);\n this.renderElements();\n }\n }",
"title": ""
},
{
"docid": "fff9acbd3e68ec507d9a58809463af6b",
"score": "0.5534171",
"text": "function endVisualizations(){\n if(canvasIsHidden()){\n return;\n }\n pauseVisualizations();\n gl.clearColor(0, 0, 0.0, 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n}",
"title": ""
},
{
"docid": "2a95899405f35eb0f7fe415658fddabc",
"score": "0.552421",
"text": "function reset() {\n\n // Matches the x value to the index in the points array.\n var idx = Math.floor((controls.z.value - ZMIN) / STEP);\n\n // Select the correct tail.\n if (controls.tail.value === 'left') {\n \n // Left\n // Selects the left section from the PDF.\n shade.points = plot.points.slice(0, idx + 1);\n shade.displayUntil = idx;\n\n // Calculate area.\n // Subtract 1, from the area since the cdf array is shifted by 1.\n labels.area.set(cdf(controls.z.value));\n \n } else {\n \n // Right\n // Selects the right section from the PDF.\n shade.points = plot.points.slice(idx);\n shade.displayUntil = -1;\n\n // Calculate area.\n // Subtract 1, from the area since the cdf array is shifted by 1.\n labels.area.set(1 - cdf(controls.z.value));\n\n }\n\n}",
"title": ""
},
{
"docid": "2bbf77694a4908cb56f5c2c55458b0fa",
"score": "0.54671353",
"text": "function cellout() {\n $(\"#\" + chartContainerElementId).css(\"cursor\", \"default\");\n\n //Bring back all blobs\n d3.selectAll(`#${chartContainerElementId} .radarArea`)\n .transition()\n .duration(200)\n .style(\"fill-opacity\", cfg.colorOpacity.area);\n }",
"title": ""
},
{
"docid": "e366a2e2cc768c20a2f9299332776701",
"score": "0.5381507",
"text": "function ResetFarClipPlane() : IEnumerator {\n cam.farClipPlane = farClipPlaneValueOrig;\n}",
"title": ""
},
{
"docid": "5fc73b22b2523d8c4350321ab63de4bb",
"score": "0.5380027",
"text": "function dragTail() {\n // put the subplot viewboxes back to default (Because we're going to)\n // be repositioning the data in the relayout. But DON'T call\n // ticksAndAnnotations again - it's unnecessary and would overwrite `updates`\n updateSubplots([0, 0, pw, ph]);\n\n // since we may have been redrawing some things during the drag, we may have\n // accumulated MathJax promises - wait for them before we relayout.\n Lib.syncOrAsync([\n Plots.previousPromises,\n function() {\n gd._fullLayout._replotting = false;\n Registry.call('_guiRelayout', gd, updates);\n }\n ], gd);\n }",
"title": ""
},
{
"docid": "322328acb7d4bc94494c613cc6d169f3",
"score": "0.53685236",
"text": "beforeAnimationStart() {\n this.getVisibleSeries().forEach(rs => {\n rs.beforeAnimationStart();\n });\n }",
"title": ""
},
{
"docid": "2fa78136c28a72d39c5636f118ba1c13",
"score": "0.5367754",
"text": "function end() {\n\t\t\t\tself.shiftAmountx = 0;\n\t\t\t\tself.shiftAmounty = 0;\n\t\t\t\tvar pxList = [];\n\t\t\t\tvar pyList = [];\n \t\t\tArray.min = function( array ){\n \t\t\treturn Math.min.apply( Math, array );\n \t\t\t};\n \t\t\t\n \t\t\tArray.max = function( array ){\n \t\t\treturn Math.max.apply( Math, array );\n \t\t\t};\n \t\t\t\n \t\t\tfunction sortNumber(a,b) {\n \t\t\t\treturn a - b;\n\t\t\t\t}\n\n\t\t\t\t//console.log(\"force ended\");\n\t\t\t\tvar outOfBoundsx = [];\n\t\t\t\tvar outOfBoundsy = [];\n\t\t\t\t\n\t\t\t\t_.forEach(self.switches.models, function(item) {\n\t\t\t\t\tpxList.push(Math.round(item.px));\n\t\t\t\t\tpyList.push(Math.round(item.py));\n \t\t\t\t\tif (item.px < 0)\n \t\t\t\t\t\toutOfBoundsx.push(item.px);\n \t\t\t\t\tif (item.py < 0)\n \t\t\t\t\t\toutOfBoundsy.push(item.py);\n\t\t\t\t}, this);\n\t\t\t\t\n\t\t\t\tif (outOfBoundsx.length > 0){\n\t\t\t\t\tself.shiftAmountx = (Array.min(outOfBoundsx) * -1) + 15;\n \t}\n \t\n \tif (outOfBoundsy.length > 0){\n\t\t\t\t\tself.shiftAmounty = (Array.min(outOfBoundsy) * -1) + 15;\n \t}\n \t\n \tself.svg.attr(\"transform\",\n \t\t\t\"translate(\" + self.shiftAmountx + \",\" + self.shiftAmounty + \")\");\n \t\n \t// dynamically set inner window size base on network graph size\n \tvar xHigh1 = pxList[pxList.length - 1];\n \tvar xHigh2 = pxList[pxList.length - 2];\n \tvar xLow1 = pxList[0];\n \tvar xLow2 = pxList[1];\n \t\n \tvar yHigh1 = pyList[pxList.length - 1];\n \tvar yHigh2 = pyList[pxList.length - 2];\n \tvar yLow1 = pyList[0];\n \tvar yLow2 = pyList[1];\n \t\n \tvar dynamicHeightx = Math.max( Math.abs(xHigh1 - xHigh2), Math.abs(xLow1 - xLow2) );\n \tvar dynamicWidth1x = Math.max( Math.abs(xLow2 - xHigh1), Math.abs(xLow2 - xHigh2) );\n \tvar dynamicWidth2x = Math.max( Math.abs(xLow1 - xHigh1), Math.abs(xLow1 - xHigh2) );\n \tvar dynamicWidthx = Math.max( dynamicWidth1x, dynamicWidth2x );\n \t\n \tvar dynamicHeighty = Math.max( Math.abs(yHigh1 - yHigh2), Math.abs(yLow1 - yLow2) );\n \tvar dynamicWidth1y = Math.max( Math.abs(yLow2 - yHigh1), Math.abs(yLow2 - yHigh2) );\n \tvar dynamicWidth2y = Math.max( Math.abs(yLow1 - yHigh1), Math.abs(yLow1 - yHigh2) );\n \tvar dynamicWidthy = Math.max( dynamicWidth1y, dynamicWidth2y );\n \t\n \tvar dynamicWidth = Math.max( dynamicWidthx, dynamicWidthy );\n \tvar dynamicHeight = Math.max( dynamicHeightx, dynamicHeighty ); \n \tself.dynamicWindowSize = Math.max( dynamicWidth, dynamicHeight ) * 3;\n \t\t\t\t\n \t\t\t\tif (self.dynamicWindowSize > window.innerWidth)\n \t\td3.select(\".inner\").style(\"width\", self.dynamicWindowSize + \"px\");\n \t\t\n \tif (self.dynamicWindowSize > window.innerHeight)\n \t\td3.select(\".inner\").style(\"height\", self.dynamicWindowSize + \"px\");\n \t\n\t\t\t\tself.force.on(\"end\", null);\n\t\t\t}",
"title": ""
},
{
"docid": "85310adfd125b0bdc3c5824d0a6b39a7",
"score": "0.536329",
"text": "function plot_brushended() {\n var s = d3.event.selection;\n if (!s) {\n if (!idleTimeout) return idleTimeout = setTimeout(idled, idleDelay);\n plot_x.domain(plot_x0);\n plot_y.domain(plot_y0);\n } else {\n plot_x.domain([s[0][0], s[1][0]].map(plot_x.invert, plot_x));\n plot_y.domain([s[1][1], s[0][1]].map(plot_y.invert, plot_y));\n d3.select(\"g.brush\").call(plot_brush.move, null);\n }\n plot_zoom_by_brush();\n}",
"title": ""
},
{
"docid": "de6da38fb193d4ceac965f5527e4dc61",
"score": "0.53159004",
"text": "stopInProgressAnimation() {\n if ( this.boundsFinite ) {\n this.setDestinationScale( this.sourceScale );\n this.setDestinationPosition( this.sourcePosition );\n }\n }",
"title": ""
},
{
"docid": "962a5cf40a916ee74b873c1a5e595bc7",
"score": "0.53099805",
"text": "updateAnimation() {\n return;\n\n // NOTE: This is just in place so you'll be able to call updateAnimation()\n // on geometry that don't animate. No need to change anything.\n }",
"title": ""
},
{
"docid": "962a5cf40a916ee74b873c1a5e595bc7",
"score": "0.53099805",
"text": "updateAnimation() {\n return;\n\n // NOTE: This is just in place so you'll be able to call updateAnimation()\n // on geometry that don't animate. No need to change anything.\n }",
"title": ""
},
{
"docid": "08e8a452c560f307cd5ee39fdc61f8d5",
"score": "0.53072864",
"text": "applyZones() {\n const series = this, chart = this.chart, renderer = chart.renderer, zones = this.zones, clips = (this.clips || []), graph = this.graph, area = this.area, plotSizeMax = Math.max(chart.plotWidth, chart.plotHeight), axis = this[(this.zoneAxis || 'y') + 'Axis'], inverted = chart.inverted;\n let translatedFrom, translatedTo, clipAttr, extremes, reversed, horiz, pxRange, pxPosMin, pxPosMax, zoneArea, zoneGraph, ignoreZones = false;\n if (zones.length &&\n (graph || area) &&\n axis &&\n typeof axis.min !== 'undefined') {\n reversed = axis.reversed;\n horiz = axis.horiz;\n // The use of the Color Threshold assumes there are no gaps\n // so it is safe to hide the original graph and area\n // unless it is not waterfall series, then use showLine property\n // to set lines between columns to be visible (#7862)\n if (graph && !this.showLine) {\n graph.hide();\n }\n if (area) {\n area.hide();\n }\n // Create the clips\n extremes = axis.getExtremes();\n zones.forEach(function (threshold, i) {\n translatedFrom = reversed ?\n (horiz ? chart.plotWidth : 0) :\n (horiz ? 0 : (axis.toPixels(extremes.min) || 0));\n translatedFrom = clamp(pick(translatedTo, translatedFrom), 0, plotSizeMax);\n translatedTo = clamp(Math.round(axis.toPixels(pick(threshold.value, extremes.max), true) || 0), 0, plotSizeMax);\n if (ignoreZones) {\n translatedFrom = translatedTo =\n axis.toPixels(extremes.max);\n }\n pxRange = Math.abs(translatedFrom - translatedTo);\n pxPosMin = Math.min(translatedFrom, translatedTo);\n pxPosMax = Math.max(translatedFrom, translatedTo);\n if (axis.isXAxis) {\n clipAttr = {\n x: inverted ? pxPosMax : pxPosMin,\n y: 0,\n width: pxRange,\n height: plotSizeMax\n };\n if (!horiz) {\n clipAttr.x = chart.plotHeight - clipAttr.x;\n }\n }\n else {\n clipAttr = {\n x: 0,\n y: inverted ? pxPosMax : pxPosMin,\n width: plotSizeMax,\n height: pxRange\n };\n if (horiz) {\n clipAttr.y = chart.plotWidth - clipAttr.y;\n }\n }\n if (clips[i]) {\n clips[i].animate(clipAttr);\n }\n else {\n clips[i] = renderer.clipRect(clipAttr);\n }\n // when no data, graph zone is not applied and after setData\n // clip was ignored. As a result, it should be applied each\n // time.\n zoneArea = series['zone-area-' + i];\n zoneGraph = series['zone-graph-' + i];\n if (graph && zoneGraph) {\n zoneGraph.clip(clips[i]);\n }\n if (area && zoneArea) {\n zoneArea.clip(clips[i]);\n }\n // if this zone extends out of the axis, ignore the others\n ignoreZones = threshold.value > extremes.max;\n // Clear translatedTo for indicators\n if (series.resetZones && translatedTo === 0) {\n translatedTo = void 0;\n }\n });\n this.clips = clips;\n }\n else if (series.visible) {\n // If zones were removed, restore graph and area\n if (graph) {\n graph.show();\n }\n if (area) {\n area.show();\n }\n }\n }",
"title": ""
},
{
"docid": "15af4158947147aa6179f7b5915e6d64",
"score": "0.52956533",
"text": "function cancelFrame() {\n window.cancelAnimationFrame(zoomAnimator);\n }",
"title": ""
},
{
"docid": "53d949396ed01b68ba5ad82e9d411943",
"score": "0.528187",
"text": "quitAnimation(){\r\n\r\n for(var value of this.markers.entries()){\r\n value[1].setAnimation(null);\r\n }\r\n }",
"title": ""
},
{
"docid": "874fd6cfe016bb328947b970d91c70c9",
"score": "0.5274972",
"text": "onAnimateEnd_() {\n this.stopAnimation_();\n }",
"title": ""
},
{
"docid": "4d9f9e836005d67b8766fe0f9ed866de",
"score": "0.52441067",
"text": "updateAnimation() {\n\n return;\n\n // NOTE: This is just in place so you'll be able to call updateAnimation()\n // on geometry that don't animate. No need to change anything.\n }",
"title": ""
},
{
"docid": "57261f40b24e409197bc0e00ed8f1d91",
"score": "0.5242319",
"text": "traceSpiral() {\n this.ctx.beginPath();\n if (self.config.trace) {\n let frame = 1;\n self.animate(frame);\n }\n\n self.loaderRef.style.display = \"none\";\n }",
"title": ""
},
{
"docid": "c1446b73894a4fc6bf7c2052338f9178",
"score": "0.5226271",
"text": "sequenceDone() {\n if (this.collapseState !== LITE_TUX_SPRITE_INFO.COLLAPSE_STATE_COLLAPSING)\n return;\n this.worldManager.alterMapTile(this.worldPosition.x, this.worldPosition.y, LITE_TUX_SPRITE_INFO.EMPTY)\n this.collapseState = LITE_TUX_SPRITE_INFO.COLLAPSE_STATE_COLLAPSED;\n this.frame0Clip = this.emptyClip;\n this.cur_frame = 0;\n }",
"title": ""
},
{
"docid": "0226b1cb826040907038a3f9da1807a2",
"score": "0.5224836",
"text": "function completeAnimation() {\n this.posAnimation = null;\n if(iCallback)\n iCallback();\n }",
"title": ""
},
{
"docid": "62651509bab370e6f6c057dd66a7f982",
"score": "0.5219619",
"text": "function finishedPosition(){\r\n\t\tif(!paint_on_hover){\r\n\t\t\tpainting = false;\r\n\t\t\tctx.beginPath();\r\n\t\t}\r\n\t}",
"title": ""
},
{
"docid": "bba7e59850fb9898cb355040ae4060a3",
"score": "0.52191144",
"text": "function onFrame(){\n\n if(startTime+maxTime==new Date().getSeconds()){\n startTime=new Date().getSeconds();\n vectorStart = Point.random() * view.size; \n }\n vectorTo= vectorStart - path.firstSegment.point;\n path.firstSegment.point+= vectorTo / 30;\n for (var i = 0; i < points ; i++) {\n var segment = path.segments[i];\n var nextSegment = segment.next;\n var vector = segment.point - nextSegment.point;\n vector.length = length;\n nextSegment.point = segment.point - vector;\n }\n path.smooth({ type: 'continuous' });\n if(vectorTo.length < 10){\n vectorStart = Point.random() * view.size;\n }\n \n \n }",
"title": ""
},
{
"docid": "9f7f2d188f244752a072ceac7c58a99f",
"score": "0.5218338",
"text": "function VF_SY121_END_SNAPSHOT()\n{\n /* try */\n {\n VF_SY121_SETNL_VALUE(\"App.View\",\"5\"); \n\n NewLookSpan.style.width = \"80%\";\n NewLookSpan.style.margin = \"3px\";\n\n NewLookAX.style.position = NewLookAX._Save_position;\n NewLookAX.style.height = \"100%\"; \n NewLookAX.style.width = \"100%\"; \n\n SHOW(RoadMapSpan); \n } \n /* catch (objError) { } */ \n\n return;\n}",
"title": ""
},
{
"docid": "6c26462b0c194632c55238216016300e",
"score": "0.52007604",
"text": "function beginVis() {\n\tif (visualize) {stage.addEventListener(Event.ENTER_FRAME, animateWorld)}\n}",
"title": ""
},
{
"docid": "12e56df82d086db54ca16f299bb8983a",
"score": "0.51929086",
"text": "function drawingSpiralCompleted() {\n document.getElementById('spiralDrawingStatusText').innerHTML = \"Drawing Completed\";\n drawingSpiralInProcess = false;\n if(stateHasChangedDuringDrawing) {\n stateHasChangedDuringDrawing = false;\n document.getElementById('spiralDrawingStatusText').innerHTML = \"Drawing Spiral\";\n // Adding this additional timout appears to help with the bug where on every change a new copy of spiral is made.\n setTimeout(function(){ updateSpiral(); }, 4);\n }\n}",
"title": ""
},
{
"docid": "a14c0e91fea99b6972767d29dabf858e",
"score": "0.51848745",
"text": "function lastPlaceFilter(){\n rain.hidden = false;\n greyFilter.hidden = false;\n followQ.hidden = true;\n}",
"title": ""
},
{
"docid": "127447d3c6145e76d7ca24932a624de0",
"score": "0.51843745",
"text": "notifyAnimationEnd() {}",
"title": ""
},
{
"docid": "c492e900b464e9e5f672d7e5dec3ecad",
"score": "0.51660943",
"text": "function workAfterResizeIsDone() {\n config.chart.width = getChartContainerDimensions(isMobile);\n\n let params = new URLSearchParams(location.search);\n let dateFromUrl = params.get(\"date\") || new Date(inputDataset[inputDataset.length - 1].date).getTime();\n Chart.createChart({\n data: inputDataset,\n view: mapView\n });\n\n // selected date/time\n Chart.setSelectedEvent(d3.select(\"rect[id='\" + dateFromUrl + \"']\"));\n let initXPosition = d3.select(\"rect[id='\" + dateFromUrl + \"']\").attr(\"x\");\n // mouse-over scrubber\n Chart.setScrubberPosition(initXPosition);\n let formattedDate = FormatUtils.getFormattedDate(new Date(parseInt(dateFromUrl)));\n d3.select(\".click-scrubber-text\").text(formattedDate);\n }",
"title": ""
},
{
"docid": "357282dc02d1d93dfb93252b845f5e19",
"score": "0.5154141",
"text": "function changeclip() {\n selectedClip = null;\n clipLength = null;\n needsReset = true;\n}",
"title": ""
},
{
"docid": "8759ef1348e6b03d9aae012016ecf10f",
"score": "0.5151787",
"text": "finishLayout(ctxt) {\n\n this.bounds.x = 0;\n\n for (var i = 0; i < this.lyrics.length; i++)\n this.lyrics[i].bounds.x = this.origin.x - this.lyrics[i].origin.x;\n\n this.needsLayout = false;\n }",
"title": ""
},
{
"docid": "d281aaa7c4704d60ea318fcd25559eef",
"score": "0.51441014",
"text": "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }",
"title": ""
},
{
"docid": "d281aaa7c4704d60ea318fcd25559eef",
"score": "0.51441014",
"text": "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }",
"title": ""
},
{
"docid": "bb2fc0d16c13c9fb129e499d80391aba",
"score": "0.51396793",
"text": "scaleFromOrigin(callBack) {\n this.$mainContent.css('opacity', 0);\n this.$element.show();\n\n let originalHeight = this.$mainWrapper.height();\n let box = this.$caller[0].getBoundingClientRect();\n this.$mainWrapper.css({\n 'left': box.left,\n 'width': box.width,\n 'max-height': box.height,\n 'top': box.top,\n 'opacity': 0\n }).animate({\n 'left': 0,\n 'width': '100%',\n 'max-height': originalHeight,\n 'top': 0,\n 'opacity': 1\n }, ANIMATION_SPEED, 'easeInOutSine', () => {\n // remove the scrollbars\n this.$mainWrapper.css({\n 'max-height': '100%',\n 'width': `calc(100% + ${scrollbarWidth}px)`,\n 'margin-right': scrollbarWidth\n });\n this.$mainContent.animate({\n 'opacity': 1\n }, ANIMATION_SPEED, callBack);\n });\n }",
"title": ""
},
{
"docid": "2ed65b9d2a0eb9ad0bca003b3730bccf",
"score": "0.51378006",
"text": "function completeIsobar()\n{\n\t// Update the track\n\tisoBar.setPath( isoBarPositions );\n\tisoBar.setVisible( true );\n}",
"title": ""
},
{
"docid": "465820539d0c892b5917bd35b5127122",
"score": "0.513617",
"text": "function AnimComplete() {\n\n // Add timer to mark sure at end place\n setTimeout(function() {\n VariableModule(that);\n\n va.$capLast.css('visibility', '');\n va.$capInner.css('height', '');\n }, 10);\n }",
"title": ""
},
{
"docid": "936fa3e3a2c0b830bb934f05fdc5c7ba",
"score": "0.51353824",
"text": "finish(event) {\r\n this.painting = false;\r\n this.resetStroke();\r\n }",
"title": ""
},
{
"docid": "7bd9b20d3e53b2f5aa4227bbfe3c84bb",
"score": "0.51332885",
"text": "function stop() {\n\tcollect = false;\n\tstop_animation = true;\n\tremoveTrackAndPacer();\n\n\tif (mouse_data.length === 0) return;\n\tmouse_data = alignWithPacer(mouse_data, pacer_data);\n\tlet t_start = mouse_data[0][0]\n\t , t_end = mouse_data[mouse_data.length-1][0];\n\tpacer_data = alignStartAndEnd(pacer_data, t_start, t_end);\n\n\tplotSets({ type: 'pacer', data: pacer_data }\n\t\t ,{ type: 'mouse', data: mouse_data });\n\n\tlet p_area = getTotalArea(pacer_data)\n\t , m_area = getTotalArea(mouse_data);\n\tdisplayValue('pacer area', p_area);\n\tdisplayValue('mouse area', m_area);\n\tdisplayValue('delta area', p_area-m_area);\n\n\tlet avg_d_angle = (p_area-m_area)/(t_end-t_start);\n\tdisplayValue('avg. angle delta', avg_d_angle);\n\tdisplayValue('avg. lag in ms', (avg_d_angle / (settings['rot-per-sec']*Math.PI*2) * 1000).toFixed(1));\n}",
"title": ""
},
{
"docid": "bf7bf23cd74a5c6a6f7d87b8b627f5e1",
"score": "0.5131247",
"text": "onEndUpdate() {\n this.orbitControls.update();\n }",
"title": ""
},
{
"docid": "4c481afe8ef4166886b5b0dfdeeed6d5",
"score": "0.51232344",
"text": "function finishResize() {\n sizeCanvas(me.overlay_canvas, width, height);\n\n // restore highlight state if it was highlighted before\n if (highlightId >= 0) {\n var areaData = me.data[highlightId];\n areaData.tempOptions = { fade: false };\n me.getDataForKey(areaData.key).highlight();\n areaData.tempOptions = null;\n }\n sizeCanvas(me.base_canvas, width, height);\n me.redrawSelections();\n cleanupAndNotify();\n }",
"title": ""
},
{
"docid": "840151c8f4659d2b6c787a01d779fa2f",
"score": "0.5113266",
"text": "function runA() {\n animationLerp = 0;\n runAnimationBool = true;\n}",
"title": ""
},
{
"docid": "dbee5d222c0f24a1129f4655302eea1c",
"score": "0.51130337",
"text": "drawPoint(event) {\n if (!this.cancel_draw) { //Checks if user clicked on cancel button\n \n if (!this.drawing) { //Checks what phase of line create user is in\n \n // Updates starting point with toWorld()\n this.startPoint = this.viewport.toWorld(event.data.global.x, event.data.global.y);\n \n // Clears current graphics on screen\n this.cropGraphics.clear();\n // cropImage.clear();\n this.viewport.mask = null;\n \n // Constructs starting point\n this.cropGraphics.beginFill(0xFFFFFF);\n this.cropGraphics.drawRect(this.startPoint.x - 5, this.startPoint.y - 5, 10, 10);\n this.cropGraphics.endFill();\n \n // Changes drawing value \n this.drawing = true;\n \n //Updates text and cancel button\n this.guideText.text = 'Select the ending point of rectangle. Cancel to reset.';\n \n // alpha of cancle button\n this.cancel_button.alpha = 1;\n \n } //end drawing if\n else {\n \n // update ending point with toWorld()\n this.endPoint = this.viewport.toWorld(event.data.global.x, event.data.global.y);\n \n //Draws end point\n this.cropGraphics.beginFill(0xFFFFFF);\n this.cropGraphics.drawRect(this.endPoint.x - 5, this.endPoint.y - 5, 10, 10);\n this.cropGraphics.endFill()\n\n //Constructs line from saved starting point to current end point\n this.cropGraphics.lineStyle(1, 0xFFFFFF).moveTo(this.startPoint.x, this.startPoint.y);\n\n // draw rectangle from current starting point and this.endPoint\n // points: starting (x,y) on canvas\n // event.data.global: ending (x,y) on canvas\n // event.data.global - points = width / height of rectangle\n this.cropGraphics.drawRect(this.startPoint.x, this.startPoint.y, this.endPoint.x - this.startPoint.x, this.endPoint.y -\n this.startPoint.y);\n\n // set cropImage, which is PIXI.Graphics to mask image on screen\n // cropImage.drawRect(this.startPoint.x, this.startPoint.y, this.endPoint.x - this.startPoint.x, this.endPoint.y -\n // this.startPoint.y);\n \n // cropImage.renderable = true;\n // cropImage.cacheAsBitmap = true;\n\n // viewport.mask = cropImage;\n\n // swap background with cropped texture\n let screenshotImg = new PIXI.Texture(this.zoom_bg_texture, new PIXI.Rectangle(this.startPoint.x, this.startPoint.y, this.endPoint.x - this.startPoint.x, this.endPoint.y -\n this.startPoint.y));\n/*\n let imgDataZoom = CanvasRenderer.view.toDataURL(\"image/jpeg\");\n var imageZoom = new Image();\n imageZoom.src = imgDataZoom;\n */\n let mySprite = new PIXI.Sprite(screenshotImg);\n \n // added by A.Thomas 8/14/19 2:02pm\n var newWindow = new WorkWindow(\"Window NEW\", x=0, y=0, screenshotImg, true);\n newWindow.container.interactive = true;\n newWindow.drawWindow();\n newWindow.tool2.emit('pointerdown');\n \n\n //this.zoom_bg_sprite.texture = screenshotImg;\n\n //Changes draw value and updates other information\n this.drawing = false;\n\n this.guideText.text = 'Copy of the selected area of image created.';\n\n // cropGraphics.clear() because to box offests in scaled images\n this.cropGraphics.clear();\n \n } //end else\n } //end cancel if\n }",
"title": ""
},
{
"docid": "10e5b2f2342cab4b826475cf53260407",
"score": "0.5112652",
"text": "updateAnimation(){\n this.time+= .008;\n if(this.time >=this.duration){\n this.resetAnimation(120,0);\n }else{\n var eyeProgress = this.endPosEye.sub(this.startPosEye).mul(this.time).add(this.startPosEye);\n var centerProgress = this.endPosCenter.sub(this.startPosCenter).mul(this.time).add(this.startPosCenter);\n this.eye = eyeProgress;\n this.center = centerProgress;\n this.updateView();\n }\n\n\n }",
"title": ""
},
{
"docid": "da6b439453405d66d33d9acf2dc5b81e",
"score": "0.5107048",
"text": "function performClipping(){ \n\t\t\tif(poi_1 == null && poi_2 == null) { if(!flag) return; poi_1=[p[0],p[1]]; poi_2=[q[0],q[1]]; }\n\t\t\telse if(poi_2 == null) { \n\t\t\t\tpoi_2 = new Array(); // assiging poi_2 either p or q based on whether the line segment\n\t\t\t\tvar mask = 0;\t\t\t// ran from inside to outside or the other way around\n\t\t\t\tswitch(poi_1[2]){\n\t\t\t\t\tcase 0: mask = -(p[0]>q[0]); break;\n\t\t\t\t\tcase 1: mask = -(p[0]<q[0]); break;\n\t\t\t\t\tcase 2: mask = -(p[1]<q[1]); break;\n\t\t\t\t}\n\t\t\t\tpoi_2[0] = q[0]^((p[0]^q[0]) & mask);\n\t\t\t\tpoi_2[1] = q[1]^((p[1]^q[1]) & mask);\n\t\t\t} \n\n\t\t\tct.beginPath(); ct.moveTo(poi_1[0], poi_1[1]); ct.lineTo(poi_2[0],poi_2[1]); ct.stroke();\n\t\t}",
"title": ""
},
{
"docid": "7bd4cbc50e401b849b943aa1ca07b534",
"score": "0.5103909",
"text": "drawClipPath(percentage, animatationTime, width, height) {\n var imageClipping = d3.select(\"#imageClipping\")[0][0].getBBox();\n var rectangleStartX = (width - imageClipping.width) / 2;\n var rectangleStartY = (height - imageClipping.height) / 2;\n if (this.clipPath === null) {\n this.clipPath = this.svg.append(\"clipPath\")\n .attr(\"id\", \"iconClipPath\");\n }\n if (this.heightChange || this.visualSettings.fill.orientation !== this.previousFillOrientation) {\n this.heightChange = true; //Set so it gets redrawn\n d3.select(\"#rectangle\").remove();\n }\n //Creates and draws the clip path that is used to represent the filling of the icon.\n if (this.visualSettings.fill.orientation === \"clockwise\") {\n d3.select(\"#rectangle\").remove();\n //Draws the clip art as an arc\n var arc = d3.svg.arc()\n .innerRadius(0)\n .outerRadius(width)\n .startAngle(0)\n .endAngle(Math.PI * 2 * percentage);\n this.clipPath.append(\"path\")\n .attr(\"id\", \"rectangle\")\n .attr(\"d\", arc)\n .attr(\"transform\", \"translate(\" + (width / 2) + \",\" + (height / 2) + \")\");\n }\n else if (this.visualSettings.fill.orientation === \"horizontal\") {\n //If the height changed or orientation, complete restart the drawing of the clippath\n if (this.heightChange) {\n var startX = rectangleStartX - (width - (rectangleStartX * 2)) * percentage;\n this.appendRectangleToClipPath(this.clipPath, (height - (rectangleStartY * 2)), (width - (rectangleStartX * 2)) * percentage, rectangleStartX, rectangleStartY, animatationTime);\n }\n else {\n //If the clip-path still exist then just change it's value\n d3.select(\"#rectangle\").transition()\n .duration(500)\n .attr({\n width: (width - (rectangleStartX * 2)) * percentage\n });\n }\n }\n else {\n var recHeight = (height - (rectangleStartY * 2));\n var yPos = rectangleStartY + (imageClipping.height * (1 - percentage));\n //If the height changed or orientation, complete restart the drawing of the clippath\n if (this.heightChange) {\n this.appendRectangleToClipPath(this.clipPath, recHeight, width - (rectangleStartX * 2), rectangleStartX, yPos, animatationTime);\n }\n else {\n //If the clip-path still exist then just change it's value\n d3.select(\"#rectangle\").attr(\"x\", rectangleStartX).transition()\n .duration(500)\n .attr({\n y: yPos\n });\n }\n }\n //Store the orientation of the icon fill\n this.previousFillOrientation = this.visualSettings.fill.orientation;\n }",
"title": ""
},
{
"docid": "f594a339d00cc9ec9bb3ee972bc21e95",
"score": "0.5097414",
"text": "function return_to_splash() {\n $(window).scrollTop(\"0px\");\n d3.select(\"#not-splash\")\n .style(\"display\", \"none\");\n d3.select(\"#splash\")\n .style(\"display\", null);\n}",
"title": ""
},
{
"docid": "902b14cace12d28bff614e1b4dd80827",
"score": "0.5096556",
"text": "initAnimation()\n {\n var initialTrajectory = this.trajectory[this.stage].slice(0, 3);\n\n mat4.translate(this.transformationMatrix, this.transformationMatrix, initialTrajectory);\n\n this.trajectory[0] = [0, 0, 1];\n this.path[0] = [0, 0, 1];\n }",
"title": ""
},
{
"docid": "ecf9b66d67da09ad76a30ee84401f246",
"score": "0.5093086",
"text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }",
"title": ""
},
{
"docid": "b786fc69585b15b064d133d3fa29337d",
"score": "0.50859076",
"text": "function onChartAfterInit(event) {\n const xAxis = event.args[0].xAxis, yAxis = event.args[0].yAxis, chart = event.args[0].chart;\n if (xAxis && yAxis) {\n if (yAxis.gridLineInterpolation === 'polygon') {\n xAxis.startOnTick = true;\n xAxis.endOnTick = true;\n }\n else if (xAxis.gridLineInterpolation === 'polygon' &&\n chart.inverted) {\n yAxis.startOnTick = true;\n yAxis.endOnTick = true;\n }\n }\n }",
"title": ""
},
{
"docid": "25ff6554e4f5e9c74da1cfba15da6b4e",
"score": "0.5085008",
"text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }",
"title": ""
},
{
"docid": "25ff6554e4f5e9c74da1cfba15da6b4e",
"score": "0.5085008",
"text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }",
"title": ""
},
{
"docid": "25ff6554e4f5e9c74da1cfba15da6b4e",
"score": "0.5085008",
"text": "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }",
"title": ""
},
{
"docid": "4b1a09844a8698633a34eb9c134de222",
"score": "0.5081022",
"text": "function startTransitions (svg, chartWidth, chartHeight, rectClip, markers, x) {\nrectClip.transition()\n .duration(300*markers.length)\n .attr('width', chartWidth);\n\nmarkers.forEach(function (marker, i) {\n setTimeout(function () {\n addMarker(marker, svg, chartHeight, x);\n }, 300 + 100*i);\n});\n}",
"title": ""
},
{
"docid": "ce3a242f0ad09cee49287fe337727a7c",
"score": "0.5076923",
"text": "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {\n this.plugins.lineRenderer.highlightCanvas.resetCanvas();\n this.plugins.lineRenderer.highlightCanvas = null;\n }\n \n this.plugins.lineRenderer.highlightedSeriesIndex = null;\n this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.lineRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }",
"title": ""
},
{
"docid": "ce3a242f0ad09cee49287fe337727a7c",
"score": "0.5076923",
"text": "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {\n this.plugins.lineRenderer.highlightCanvas.resetCanvas();\n this.plugins.lineRenderer.highlightCanvas = null;\n }\n \n this.plugins.lineRenderer.highlightedSeriesIndex = null;\n this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.lineRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }",
"title": ""
},
{
"docid": "ce3a242f0ad09cee49287fe337727a7c",
"score": "0.5076923",
"text": "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {\n this.plugins.lineRenderer.highlightCanvas.resetCanvas();\n this.plugins.lineRenderer.highlightCanvas = null;\n }\n \n this.plugins.lineRenderer.highlightedSeriesIndex = null;\n this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.lineRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }",
"title": ""
},
{
"docid": "60638ca1f97f8efb440e01240094aa36",
"score": "0.5075287",
"text": "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {\n\n this.plugins.barRenderer.highlightCanvas.resetCanvas();\n this.plugins.barRenderer.highlightCanvas = null;\n }\n \n this.plugins.barRenderer = {highlightedSeriesIndex:null};\n this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.barRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }",
"title": ""
},
{
"docid": "cb628da3268b40b93111103ef9e454e3",
"score": "0.5074558",
"text": "function brushend() {\n if (brush.empty()) svg.selectAll('.hidden').classed('hidden', false);\n }",
"title": ""
},
{
"docid": "d4e97777dd1052781e88c1fcdc166ae4",
"score": "0.50743383",
"text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }",
"title": ""
},
{
"docid": "ae5f799fd2db06881c9ee900066849fc",
"score": "0.5073218",
"text": "function animate() {\n\t\t\tvar range = timeline.getVisibleChartRange();\n\t\t\tvar current = (range.start.getTime() + range.end.getTime())/ 2;\n\t\t\tvar width = (range.end.getTime() - range.start.getTime());\n\t\t\tvar minDiff = Math.max(width / 1000, 1);\n\t\t\tvar diff = (animateFinal - current);\n\t\t\tif (Math.abs(diff) > minDiff) {\n\t\t\t // move towards the final date\n\t\t\t var start = new Date(range.start.getTime() + diff / 3);\n\t\t\t var end = new Date(range.end.getTime() + diff / 3);\n\t\t\t timeline.setVisibleChartRange(start, end);\n\t\t\t timeline.trigger('rangechange');\n\n\t\t\t // start next timer\n\t\t\t animateTimeout = setTimeout(animate, 20);\n\t\t\t} else {\n\t\t\t timeline.trigger('rangechanged');\n\t\t\t}\n\t\t }",
"title": ""
},
{
"docid": "a7ea84e1b04c1cafc548483f4287e4ee",
"score": "0.5069403",
"text": "\"loaded loading:after\" (event) {\n if (this.autoCenterAndZoomOut && (this.originalHeight || this.originalWidth)) {\n this.centerAndZoomOut();\n }\n }",
"title": ""
},
{
"docid": "71b174c003d4400417f19b995c8e561b",
"score": "0.5069235",
"text": "mainAnimationLoop(){\r\n\r\n this.drawDataToChart();\r\n this.updateDisplayedValues();\r\n }",
"title": ""
},
{
"docid": "dccb1fcba261e4bd3416c7fd7ac98444",
"score": "0.50609654",
"text": "onAnimationEnd(event) {\n const { fromState, toState } = event;\n if ((toState === 'void' && fromState !== 'void') || toState === 'hidden') {\n this._completeExit();\n }\n if (toState === 'visible') {\n // Note: we shouldn't use `this` inside the zone callback,\n // because it can cause a memory leak.\n const onEnter = this._onEnter;\n this._ngZone.run(() => {\n onEnter.next();\n onEnter.complete();\n });\n }\n }",
"title": ""
},
{
"docid": "31aaaaab58ff1398a139279551631052",
"score": "0.50558525",
"text": "function AnimationCompleted(sender, eventArgs)\r\n{\r\n refreshScene();\r\n //restart the per frame animation\r\n sender.Begin();\r\n}",
"title": ""
},
{
"docid": "a9b3f7926e568e9df8d0b80e267bb435",
"score": "0.50522166",
"text": "mapRender() {\r\n /*\r\n We have a list of points dedicated to a specific range -> Now we need to compress the points in this range\r\n to be in the bounds of the graph:\r\n - Probably want to normalize the graph\r\n */\r\n let width = this.canvasContext.canvas.width;\r\n let height = this.canvasContext.canvas.height\r\n let cWidthDomain = new Range(0, width);\r\n let cHeightDomain = new Range(0, height);\r\n cWidthDomain.min -= width/2;\r\n cWidthDomain.max -= width/2;\r\n cHeightDomain.min -= height/2;\r\n cHeightDomain.max -= height/2;\r\n\r\n // remap all points to new domain => go through points\r\n // remove duplicates\r\n // Never mind just move the points themselves (\"translate() doesnt work\")\r\n\r\n\r\n this.canvasContext.beginPath();\r\n this.canvasContext.moveTo(0, height/2);\r\n this.canvasContext.lineTo(width, height/2);\r\n this.canvasContext.lineWidth = 1;\r\n this.canvasContext.strokeStyle = rgbToHex(0,0,0);\r\n this.canvasContext.stroke();\r\n\r\n this.canvasContext.beginPath();\r\n this.canvasContext.moveTo(width/2, 0);\r\n this.canvasContext.lineTo(width/2, height );\r\n this.canvasContext.lineWidth = 1;\r\n this.canvasContext.strokeStyle = rgbToHex(0,0,0);\r\n this.canvasContext.stroke();\r\n\r\n this.plotArray.forEach(Plot => {\r\n Plot.remap(this.domain, cWidthDomain, \"x\");\r\n Plot.remap(this.range, cHeightDomain, \"y\");\r\n Plot.draw(this.canvasContext);\r\n });\r\n\r\n\r\n\r\n }",
"title": ""
},
{
"docid": "baffe1562e0c8f5592615a12649051ae",
"score": "0.50451505",
"text": "finishAnimation() {\n const animationCallback = this.curAnimation.getCallback();\n this.curAnimation = null;\n\n animationCallback.apply();\n }",
"title": ""
},
{
"docid": "e2760bf61e985b41466fb708e4bba267",
"score": "0.5042095",
"text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }",
"title": ""
},
{
"docid": "60460c432df2fe8ec26f5bca1839f3fb",
"score": "0.5040651",
"text": "function animationEffect() {\n marker.setAnimation(window.google.maps.Animation.BOUNCE)\n setTimeout(function(){ marker.setAnimation(null) }, 500)\n }",
"title": ""
},
{
"docid": "aaf748fbd0dac958492591496713a8fc",
"score": "0.50393486",
"text": "animationBrushCollectionChanged_() {\n this.brushCollectionChanged_(this.scope_['animationBrushes']);\n }",
"title": ""
},
{
"docid": "8548ffc4e25025f5ee7294e2e07eaef1",
"score": "0.50345707",
"text": "function after(){\n fly(dom).fxUnwrap(wrap, r.pos, o);\n st.width = r.width;\n st.height = r.height;\n fly(dom).afterFx(o);\n }",
"title": ""
},
{
"docid": "dee159e94d838a6625c28796fcf88cee",
"score": "0.50330526",
"text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }",
"title": ""
},
{
"docid": "dee159e94d838a6625c28796fcf88cee",
"score": "0.50330526",
"text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }",
"title": ""
},
{
"docid": "c71d54657dad3bf3c401525deff1060a",
"score": "0.50293994",
"text": "function brushend() {\n if (brush.empty()){\n svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }\n }",
"title": ""
},
{
"docid": "5a46df8c483274fdee83d14015fe0692",
"score": "0.50284094",
"text": "function shake(){\ndocument.querySelector('#backGround').setAttribute(\"shake\",\"yes\"); \ndocument.querySelector('#zone').setAttribute(\"shake\",\"yes\");\ndocument.querySelector('#zoneAux').setAttribute(\"shake\",\"yes\");\ndocument.querySelector('#zoneAux').style.display = \"block\";\ndocument.querySelector('#zone').addEventListener('animationend', function(){\n //Cleaning the board.\n paper.clearRect(0, 0, zone.width, zone.height);\n if(!improve){\n document.querySelector('#zoneAux').style.display = \"none\";\n }\n document.querySelector('#backGround').setAttribute(\"shake\",\"no\");\n document.querySelector('#zone').setAttribute(\"shake\", \"no\");\n document.querySelector('#zoneAux').setAttribute(\"shake\", \"no\");\n},false);\n}",
"title": ""
},
{
"docid": "85fb505d02602196fc30400334b10308",
"score": "0.50218433",
"text": "function animationComplete() {\n\t\t\n\t}",
"title": ""
},
{
"docid": "753969459cf0a180d2a5d4fcb9d18aba",
"score": "0.5001332",
"text": "function reset() {\n var bottomLeft = project(bounds[0]),\n topRight = project(bounds[1]);\n\n svg .attr(\"width\", topRight[0] - bottomLeft[0])\n .attr(\"height\", bottomLeft[1] - topRight[1])\n .style(\"margin-left\", bottomLeft[0] + \"px\")\n .style(\"margin-top\", topRight[1] + \"px\");\n\n g .attr(\"transform\", \"translate(\" + -bottomLeft[0] + \",\" + -topRight[1] + \")\");\n\n feature.attr(\"d\", path);\n }",
"title": ""
},
{
"docid": "f259023f79eeb301d26cc01d0801a784",
"score": "0.49994195",
"text": "exit() {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }",
"title": ""
},
{
"docid": "f38da4acd90fc9439bb9c24e53c364b2",
"score": "0.4995561",
"text": "function redrawCurrentView() {\n var diff = AG_currentIndex - AG_numberOfVisiblePoints;\n for (k = 0; k < AG_numberOfVisiblePoints; k++) {\n \tAG_displayedTimes[k] = AG_time[k + diff];\n for (i = 0; i < AG_noOfLines; i++) {\n AG_displayedPoints[i][k] = [AG_time[k + diff], AG_addTranslationStep(AG_allPoints[i][k + diff], i)];\n }\n }\n AG_createYAxisDictionary(AG_noOfLines);\n redrawPlot([]);\n}",
"title": ""
},
{
"docid": "4b0a9861f344069556aeefa53bd165bf",
"score": "0.49902424",
"text": "function enterFrame() {\n clear();\n render();\n }",
"title": ""
},
{
"docid": "54293218b76d9aaed2e4c7700ad96078",
"score": "0.49890098",
"text": "onEnd() {\n this.dispatchAnimationEvent(EventType.END);\n }",
"title": ""
},
{
"docid": "b6431da8c28ee77eebb48d899bf9d10e",
"score": "0.4984722",
"text": "function zoomEndHandler() {\n if (rendering) return;\n api.dispatchAction({\n type: 'leafletRoam'\n });\n }",
"title": ""
},
{
"docid": "8bb3bd6d4b9b690921dd135bdda4e06b",
"score": "0.49775264",
"text": "function ZoomAnimation() {\n}",
"title": ""
},
{
"docid": "4cb540d67a3bbd7d1f61c0816a7382be",
"score": "0.4967069",
"text": "function animationComplete() {\n checkPuzzleTileOrder();\n}",
"title": ""
},
{
"docid": "3c950dda0fe146df109a0b0405bf5882",
"score": "0.49642447",
"text": "function reset() {\n var bottomLeft = project(bounds[0]),\n topRight = project(bounds[1]);\n\n svg .attr(\"width\", topRight[0] - bottomLeft[0])\n .attr(\"height\", bottomLeft[1] - topRight[1])\n .style(\"margin-left\", bottomLeft[0] + \"px\")\n .style(\"margin-top\", topRight[1] + \"px\");\n\n g .attr(\"transform\", \"translate(\" + -bottomLeft[0] + \",\" + -topRight[1] + \")\");\n\n feature.attr(\"d\", path);\n // feature.attr(\"fill\", \"url('images/fire.jpg')\")\n }",
"title": ""
},
{
"docid": "2ec3c03662742175211d288000152591",
"score": "0.49607462",
"text": "function updatePlot() {\n \n x3 = parseFloat(document.getElementById('x3Controller').value);\n data = computeBasis(x3);\n \n Plotly.animate(\n 'graph',\n {data: data},\n {\n fromcurrent: true,\n transition: {duration: 0,},\n frame: {duration: 0, redraw: false,},\n mode: \"immediate\"\n }\n );\n }",
"title": ""
},
{
"docid": "626d9f2d8788f7e4749785d410dd8c0c",
"score": "0.49601766",
"text": "function redraw() {\n compute_size();\n\n d3.select(\"svg\").remove();\n\n init(width, height);\n draw(boundaries);\n}",
"title": ""
},
{
"docid": "64ed2b41a73bf78cb322200b776c5fb9",
"score": "0.49596536",
"text": "quarantine() {\n this.quarantined = true;\n this.addAnimation(new QuarantineAnimation(10, 10, 10));\n }",
"title": ""
},
{
"docid": "87a4a858577eeff631c944c275219742",
"score": "0.495823",
"text": "function brushend() {\n\t if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n\t }",
"title": ""
},
{
"docid": "44c3720c750ad55c2afd3092254ad514",
"score": "0.49576506",
"text": "function update () {\n\n //call the compute function above\n compute(); \n\n //Animate the graph traces. The second trace has to be put in by hand for some reason? \n Plotly.animate('graph', {\n data: [\n trace1, \n {\n x: time,\n y: trajectory,\n mode: 'lines',\n name: 'Position',\n line: {shape: 'spline'}\n }, \n trace3,\n trace4]\n }, {\n transition: {\n duration: 0.0,\n },\n frame: {\n duration: 0.0,\n redraw: false,\n }\n });\n\n //kill the loop if the ball landed\n if (h[1]> 0){\n requestAnimationFrame(update)\n }\n}",
"title": ""
},
{
"docid": "5db94a6e14b20fe81594bc340f5227d4",
"score": "0.49561113",
"text": "static onStrokeEnd() {\n if(!NetSyncer.isMaster) { return; }\n \n //this.updateSceneFlags(); //lazy\n }",
"title": ""
},
{
"docid": "698060d07a9e105c794e09a5c57f3e3f",
"score": "0.4951159",
"text": "function brushend() {\n if (brush.empty()) deselectAll();\n highlightTimeSeries();\n }",
"title": ""
},
{
"docid": "83851e706e6e140ffd1a57aa18e88bc0",
"score": "0.49505407",
"text": "initialCanvasGroupLoaded() {\n this.home();\n this.canvasGroupMask.initialize(this.canvasService.getCurrentCanvasGroupRect(), this.modeService.mode !== ViewerMode.DASHBOARD);\n if (this.viewer) {\n d3.select(this.viewer.container.parentNode)\n .transition()\n .duration(ViewerOptions.transitions.OSDAnimationTime)\n .style('opacity', '1');\n }\n }",
"title": ""
}
] |
c4238421b83edadaaf558ba9d00c1d9d | Separation Method checks for nearby boids and steers away | [
{
"docid": "a10ec3572790cc6ec670b354064013d1",
"score": "0.75283754",
"text": "separate (boids) {\n const { position } = this;\n\n const desiredseparation = 25.0;\n let steer = new Vector(0, 0, 0);\n let count = 0;\n // For every boid in the system, check if it's too close\n boids.forEach(other => {\n const d = Vector.dist(position, other.position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if (d > 0 && d < desiredseparation) {\n // Calculate vector pointing away from neighbor\n const diff = Vector.sub(position, other.position);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n });\n // Average -- divide by how many\n if (count > 0) steer.div(count);\n\n // As long as the vector is greater than 0\n if (steer.mag() > 0) {\n // First two lines of code below could be condensed with new Vector setMag() method\n // Not using this method until Processing.js catches up\n // steer.setMag(maxspeed)\n\n // Implement Reynolds: Steering = Desired - Velocity\n steer.normalize();\n steer.mult(this.maxspeed);\n steer.sub(this.velocity);\n steer.limit(this.maxforce);\n }\n\n return steer;\n }",
"title": ""
}
] | [
{
"docid": "0cf13894ddec4c5ebdcd41f6baa7f12a",
"score": "0.7796884",
"text": "separate(boids) {\n var desiredseparation = 25.0;\n var steer = createVector(0, 0, 0);\n var count = 0;\n // For every boid in the system, check if it's too close\n boids.forEach((other) => {\n var d = p5.Vector.dist(this.position, other.position);\n // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)\n if (d > 0 && d < desiredseparation) {\n // Calculate vector pointing away from neighbor\n var diff = p5.Vector.sub(this.position, other.position);\n diff.normalize();\n diff.div(d); // Weight by distance\n steer.add(diff);\n count++; // Keep track of how many\n }\n });\n\n // Average -- divide by how many\n if (count > 0) {\n steer.div(count);\n }\n\n // As long as the vector is greater than 0\n if (steer.mag() > 0) {\n // Implement Reynolds: Steering = Desired - Velocity\n steer.normalize();\n steer.mult(maxspeed);\n steer.sub(this.velocity);\n steer.limit(maxforce);\n }\n return steer;\n }",
"title": ""
},
{
"docid": "40d17dc893f01909acdb396c33693593",
"score": "0.71499884",
"text": "separation(boids){\r\n let perceptionRadius = 70; //same as alignment\r\n //should probably change \"desired\" to \"steering\"\r\n let desired = createVector();\r\n let total = 0;\r\n for(let other of boids){\r\n //calculate distance between this boid position and other boid position\r\n let d = dist(\r\n this.position.x,\r\n this.position.y,\r\n other.position.x,\r\n other.position.y\r\n );\r\n if(other != this && d < perceptionRadius){\r\n //the way to subtract two vectors\r\n let diff = p5.Vector.sub(this.position, other.position);\r\n //further the way it is, lower the magnitude\r\n diff.mult(d);\r\n //then average all the vectors\r\n desired.add(diff); \r\n total++;\r\n }\r\n }\r\n //divide by total if total more than 0\r\n if(total > 0){\r\n desired.div(total); //divide total\r\n desired.sub(this.position); //find difference in location\r\n desired.setMag(this.maxSpeed); //maintain speed\r\n desired.sub(this.velocity); //subtract current velocity\r\n desired.limit(this.maxForce); //maximum ammount of force affecting boids\r\n }\r\n return desired;\r\n \r\n \r\n }",
"title": ""
},
{
"docid": "1556206b626b681f5ede831fbb4ca59d",
"score": "0.7019276",
"text": "separationVector(boids) {\n let sum = new Point();\n let count = 0;\n const vector = new Point();\n // For every boid in the system, check if it's too close\n for (let i = 0, l = boids.length; i < l; i++) {\n const other = boids[i];\n vector.copy(this.position).subtract(other.position);\n let distance = vector.getLengthSquared();\n let same = this.isSame(other);\n if (same && distance < this.desiredSeperation * 2) {\n this.evadeBoid(other);\n // If the distance is greater than 0 and less than an arbitrary amount\n // (0 when you are yourself)\n \n } else if (distance > 0 && distance < this.desiredSeperation) {\n // Calculate vector pointing away from neighbor\n sum.add(vector.normalize());\n count++;\n }\n }\n // Average -- divide by how many\n if (count > 0)\n sum.divideNum(count);\n if (!sum.isZero()) {\n // Implement Reynolds: Steering = Desired - Velocity\n sum\n .normalize(this.maxSpeed)\n .subtract(this.velocity)\n .limitLength(this.maxForce);\n }\n return sum;\n }",
"title": ""
},
{
"docid": "d6f56fc0162bfd891941b5f509acd174",
"score": "0.6887627",
"text": "function separate(boids, boid) {\n const [count, direction] = boids.reduce(\n ([count, direction], otherBoid) => {\n const d = boid.position.dist(otherBoid.position);\n if (d > 0 && d < CONFIG.desiredSeparation) {\n // Calculate vector pointing away from neighbour\n const diff = Vector.sub(boid.position, otherBoid.position)\n .normalize()\n .div(d); // Weight by distance\n return [count + 1, direction.add(diff)];\n }\n return [count, direction];\n },\n [0, new Vector(0, 0, 0)]\n );\n\n return count > 0\n ? direction\n .div(count) // average\n .normalize()\n .mult(boid.maxSpeed)\n .sub(boid.velocity)\n .limit(boid.maxForce)\n : direction;\n}",
"title": ""
},
{
"docid": "051fc5a6a09a805f2dcb3397c710116a",
"score": "0.67744327",
"text": "separate( boids ){\n var sum = new Victor();\n var count = 0;\n for (var j = 0; j < boids.length; j++) {\n if ( this.color != boids[j].color ) {\n var racismMultiplier = this.racism;\n } else {\n var racismMultiplier = 0;\n }\n var desiredSeparation = this.radius + boids[j].radius + ( 25 * this.introversion ) + ( 50 * racismMultiplier );\n var sep = this.position.clone().distance(boids[j].position);\n if ( (sep > 0) && (sep < desiredSeparation) ) {\n var thisposition = this.position.clone();\n var diff = thisposition.subtract(boids[j].position);\n diff.normalize();\n diff.divide({x:sep,y:sep});\n sum.add(diff);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x:count,y:count});\n sum.normalize();\n sum.multiply({x:this.maxSpeed,y:this.maxSpeed});\n sum.subtract(this.velocity);\n sum.limitMagnitude(this.maxForce);\n }\n return sum;\n }",
"title": ""
},
{
"docid": "403ba7f45e761fc5d26694ee5856c110",
"score": "0.6647954",
"text": "cohesion(boids) {\n var neighbordist = 50;\n var sum = createVector(0, 0); // Start with empty vector to accumulate all positions\n var count = 0;\n boids.forEach((other) => {\n var d = p5.Vector.dist(this.position, other.position);\n if (d > 0 && d < neighbordist) {\n sum.add(other.position); // Add position\n count++;\n }\n });\n if (count > 0) {\n sum.div(count);\n return this.seek(sum); // Steer towards the position\n } else {\n return createVector(0, 0);\n }\n }",
"title": ""
},
{
"docid": "833289e32799ab0e731bd415ba4849a9",
"score": "0.6639176",
"text": "separation(neighbors) {\n let steering = p.createVector();\n for (let other of neighbors) {\n let diff = p5.Vector.sub(this.pos, other.pos); // Vector from other boid to this boid\n let d = p.max(other.distance, 0.01); // Distance between other boid and this boid\n steering.add(diff.div(d)); // Magnitude inversely proportional to the distance\n }\n if (neighbors.length > 0) {\n steering.div(neighbors.length); // Orientation of the desired velocity\n steering.setMag(this.maxSpeed); // Desired velocity\n steering.sub(this.vel); // Actual steering\n steering.limit(this.maxForce); // Steering limited to maxForce\n }\n return steering;\n }",
"title": ""
},
{
"docid": "c6f73f76a92a5a00e73814d3fdd478ef",
"score": "0.65893286",
"text": "cohesion(boids) {\n var neighbordist = 50;\n var sum = createVector(0,0); // Start with empty vector to accumulate all locations\n var count = 0;\n for (var i = 0; i < boids.length; i++) {\n var d = p5.Vector.dist(this.position,boids[i].position);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(boids[i].position); // Add location\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n return this.seek(sum); // Steer towards the location\n } else {\n return createVector(0,0);\n }\n }",
"title": ""
},
{
"docid": "e0bd8b592b8f84043ca6416622c0834a",
"score": "0.64285386",
"text": "cohesion (boids) {\n const { position } = this;\n\n const neighbordist = 50;\n const sum = new Vector(0, 0); // Start with empty vector to accumulate all positions\n let count = 0;\n\n boids.forEach(other => {\n const d = Vector.dist(position, other.position);\n if (d > 0 && d < neighbordist) {\n sum.add(other.position); // Add position\n count++;\n }\n });\n\n if (count > 0) {\n sum.div(count);\n return this.seek(sum); // Steer towards the position\n } else {\n return new Vector(0, 0);\n }\n }",
"title": ""
},
{
"docid": "b4ef7fbf3d8386eb6ccea9005b74c96d",
"score": "0.6339777",
"text": "align(boids) {\n var neighbordist = 50;\n var sum = createVector(0, 0);\n var count = 0;\n boids.forEach((other) => {\n var d = p5.Vector.dist(this.position, other.position);\n if (d > 0 && d < neighbordist) {\n sum.add(other.velocity);\n count++;\n }\n });\n\n if (count > 0) {\n sum.div(count);\n\n // Implement Reynolds: Steering = Desired - Velocity\n sum.normalize();\n sum.mult(maxspeed);\n var steer = p5.Vector.sub(sum, this.velocity);\n steer.limit(maxforce);\n return steer;\n } else {\n return createVector(0, 0);\n }\n }",
"title": ""
},
{
"docid": "f5294e29fc5b38d6808afa09da3c3cd0",
"score": "0.6338825",
"text": "align() {\n let neighbordist = 50;\n let sum = createVector(0, 0);\n let count = 0;\n for (let i = 0; i < boids.length; i++) {\n let d = p5.Vector.dist(this.pos, boids[i].pos);\n if ((d > 0) && (d < neighbordist)) {\n sum.add(boids[i].v);\n count++;\n }\n }\n if (count > 0) {\n sum.div(count);\n sum.normalize();\n sum.mult(this.maxspeed);\n let steer = p5.Vector.sub(sum, this.v);\n steer.limit(this.maxforce);\n return steer;\n } else {\n return createVector(0, 0);\n }\n }",
"title": ""
},
{
"docid": "0707d7d78a1fe8001fb6565dee62c5d3",
"score": "0.6283093",
"text": "altPosition(other){\n let edgeConsideration = true;\n if(edgeConsideration){ //Toggle for turning edge consideration on/off\n //calc dist between points\n let xdist = abs(this.position.x - other.position.x);\n let ydist = abs(this.position.y - other.position.y);\n\n //preload variables to be returned, in case they are not changed\n //(eg. boid is not closer through edge)\n let xpos = other.position.x;\n let ypos = other.position.y;\n\n //is the horizontal distance greater than half width? then use reflected xpos\n if (xdist < width/2) { //boid is not closer through edge\n xpos = other.position.x;\n }\n else if(this.position.x < other.position.x){\n xpos = other.position.x - width;\n }\n else if(this.position.x > other.position.x){\n xpos = other.position.x + width;\n }\n\n //same for Vertical\n if (ydist < height/2){ //boid is not closer through edge\n ypos = other.position.y;\n }\n else if(this.position.y < other.position.y){ //if other on the right of this boid...\n ypos = other.position.y - height; //determine reflective position to left of this boid\n }\n else if(this.position.y > other.position.y){ //if other is on right of this boid...\n ypos = other.position.y + height; //determine reflective position to right of this boid\n }\n\n //Return determined positions\n return createVector(xpos,ypos);\n }\n else {\n return other.position;\n }\n //End altPosition\n }",
"title": ""
},
{
"docid": "1a99c86ab69859e8e73fc281f612fb09",
"score": "0.62722874",
"text": "separation() {\r\n\t\tconst result = new THREE.Vector3(0, 0, 0);\r\n\t\tfor (const b of this.neighborhood) {\r\n\t\t\tconst dist = b.pos.distanceTo(this.pos);\r\n\t\t\tconst oppositeDir = this.pos.clone();\r\n\t\t\toppositeDir.sub(b.pos);\r\n\t\t\tif (dist != 0) oppositeDir.divideScalar(dist);\r\n\t\t\tresult.add(oppositeDir);\r\n\t\t}\r\n\t\tresult.clampLength(SEP_WEIGHT, SEP_WEIGHT);\r\n\t\treturn result;\r\n\t}",
"title": ""
},
{
"docid": "23ff3775b575678f68e73b1d0a342c86",
"score": "0.6269711",
"text": "align( boids ) {\n var neighborDist = 50;\n var sum = new Victor();\n var steer = new Victor();\n var count = 0;\n for (var i = 0; i < boids.length; i++) {\n var dist = this.position.distance(boids[i].position);\n if ( dist > 0 && dist < neighborDist ) {\n sum.add(boids[i].velocity);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x:count,y:count});\n sum.normalize()\n sum.multiply({x:this.maxSpeed,y:this.maxSpeed});\n steer = sum.subtract(this.velocity);\n steer.limitMagnitude(this.maxForce);\n return steer;\n } else {\n return steer;\n }\n }",
"title": ""
},
{
"docid": "3228ea4e4704189ddd314638e9176cae",
"score": "0.6261922",
"text": "check_beside(){\n\t\tvar obstacle_num = 0;\n\t\tvar box_num = 0;\n\t\tfor(var i=0;i<this.stage.squares.length;i++){\n\t\t\tif (this.stage.squares[i] != this){\n\t\t\t\t// the following expression is left || right || above || below. If all of them are false, two squares must intersect.\n\t\t\t\tif (!( this.position.x + this.length < this.stage.squares[i].x || this.position.x > this.stage.squares[i].x + this.stage.squares[i].length || \n\t\t\t\t\t\tthis.position.y > this.stage.squares[i].y + this.stage.squares[i].length || this.position.y + this.length < this.stage.squares[i].y )){\n\t\t\t\t\t// two squares intersect (the dog is next to something)\n\t\t\t\t\tif (this.stage.squares[i].type == \"obstacle\"){\n\t\t\t\t\t\t// the dog is next to the obstacle\n\t\t\t\t\t\tobstacle_num += 1;\n\t\t\t\t\t} else if (this.stage.squares[i].type == \"box\"){\n\t\t\t\t\t\t// the dog is next to the box\n\t\t\t\t\t\tbox_num += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [obstacle_num, box_num];\n\t}",
"title": ""
},
{
"docid": "a69d42319913694b4f2228f654487077",
"score": "0.62048817",
"text": "separation(distances) {\n let perceptionRadius = 20;\n let steering = createVector();\n let total = 0;\n for (let i = 0; i < FLOCK_SIZE; i++) {\n let d = distances[i];\n if (d != -1 && d < perceptionRadius) {\n let diff = p5.Vector.sub(this.position, boidFlock[i].position);\n diff.div(d * d);\n steering.add(diff);\n total++;\n }\n }\n if (total > 0) {\n steering.div(total);\n steering.setMag(this.maxSpeed);\n steering.sub(this.velocity);\n steering.limit(this.maxForce);\n steering.mult(Number(separationSlider.value));\n }\n return steering;\n }",
"title": ""
},
{
"docid": "2b382b3781b79f931eafc94719dd157f",
"score": "0.61737734",
"text": "function impermissibleKinkBetween(x1, y1, x2, y2) {\n brogueAssert(coordinatesAreInMap(x1, y1));\n brogueAssert(coordinatesAreInMap(x2, y2));\n if (cellHasTerrainFlag(x1, y1, T_OBSTRUCTS_PASSABILITY)\n || cellHasTerrainFlag(x2, y2, T_OBSTRUCTS_PASSABILITY))\n\t\t{\n // One of the two locations is obstructed.\n return false;\n }\n if (abs(x1 - x2) != 1 || abs(y1 - y2) != 1) {\n // Not diagonally adjacent.\n return false;\n }\n if (!cellHasTerrainFlag(x2, y1, T_OBSTRUCTS_PASSABILITY)\n || !cellHasTerrainFlag(x1, y2, T_OBSTRUCTS_PASSABILITY))\n\t\t{\n // At least one of the common neighbors isn't obstructed.\n return false;\n }\n if (!cellHasTerrainFlag(x2, y1, T_OBSTRUCTS_DIAGONAL_MOVEMENT)\n && !cellHasTerrainFlag(x1, y2, T_OBSTRUCTS_DIAGONAL_MOVEMENT))\n\t\t{\n // Neither of the common neighbors obstructs diagonal movement.\n return false;\n }\n return true;\n}",
"title": ""
},
{
"docid": "f1b40d36139008ca48b26149a33ce4d8",
"score": "0.61302555",
"text": "function directionVision( x, y ){\n x --;\n y --;\n var v = {u:0, d:0, l:0, r:0 }\n if( b_climb[ map[ y ][ x ] ] \n && !b_block[ map[y-1][ x ] ]\n ){\n //has stair and hasn block above\n v.u = 1;\n }\n if( b_climb[ map[ y +1 ][ x ]] || b_grab[ map[ y ][ x ] ] ){\n //down stairs\n v.d = 1;\n }\n\n //console.log( y + 1 );\n if( b_stand[ map[ y+1 ][ x ] ] || b_grab[ map[ y ][ x ] ] || b_hole[ map[ y+1 ][x] ]){ //?\n v.l = 1;\n v.r = 1;\n if( x === 0 ){ v.l = 0 };\n if( map[y][x+1] === undefined ){ v.r = 0 };\n if( b_block[ map[ y ][ x + 1 ] ]){ v.r = 0 };\n if( b_block[ map[ y ][ x - 1 ] ]){ v.l = 0 };\n if( b_block[ map[ y + 1 ][ x ] ]){ v.d = 0 };\n } else {\n //can fall or falling\n v.d = 1;\n }\n return v;\n}",
"title": ""
},
{
"docid": "85beb72a0cc5769bf34635db0f8ae085",
"score": "0.6107707",
"text": "function align(boids) {\n var neighborDist = 25;\n var steer = new Point();\n var count = 0;\n for (var i = 0, l = boids.length; i < l; i++) {\n var distance = distances[i];\n if (distance > 0 && distance < neighborDist) {\n steer.x += boids[i].vector().x;\n steer.y += boids[i].vector().y;\n count++;\n }\n }\n\n if (count > 0) {\n steer.x /= count;\n steer.y /= count;\n }\n if (!steer.isZero()) {\n // Implement Reynolds: Steering = Desired - Velocity\n steer.length = maxSpeed;\n steer.x -= vector.x;\n steer.y -= vector.y;\n steer.length = Math.min(steer.length, maxForce);\n }\n return steer;\n }",
"title": ""
},
{
"docid": "85beb72a0cc5769bf34635db0f8ae085",
"score": "0.6107707",
"text": "function align(boids) {\n var neighborDist = 25;\n var steer = new Point();\n var count = 0;\n for (var i = 0, l = boids.length; i < l; i++) {\n var distance = distances[i];\n if (distance > 0 && distance < neighborDist) {\n steer.x += boids[i].vector().x;\n steer.y += boids[i].vector().y;\n count++;\n }\n }\n\n if (count > 0) {\n steer.x /= count;\n steer.y /= count;\n }\n if (!steer.isZero()) {\n // Implement Reynolds: Steering = Desired - Velocity\n steer.length = maxSpeed;\n steer.x -= vector.x;\n steer.y -= vector.y;\n steer.length = Math.min(steer.length, maxForce);\n }\n return steer;\n }",
"title": ""
},
{
"docid": "be131a5970cca6ac53794b5bb58be15d",
"score": "0.60791093",
"text": "detectCollision(){\n\n for (var i = 0; i < boids.length; i++) {\n if ( this === boids[i] ) { continue; }\n if ( getDistance( this.position.x, this.position.y, boids[i].position.x, boids[i].position.y) - ( this.radius + boids[i].radius ) < 0 ) {\n this.resolveCollision( this, boids[i]);\n }\n }\n }",
"title": ""
},
{
"docid": "140b42d8c44332edaf6420c026ede289",
"score": "0.60737795",
"text": "function cohesion(boids) {\n var neighborDist = 10000;\n var sum = new Point();\n var count = 0;\n for (var i = 0, l = boids.length; i < l; i++) {\n var distance = distances[i];\n if (distance > 0 && distance < neighborDist) {\n sum.x += boids[i].position().x;\n sum.y += boids[i].position().y;\n count++;\n }\n }\n if (count > 0) {\n sum.x /= count;\n sum.y /= count;\n // Steer towards the location\n return steer(sum, false);\n }\n return sum;\n }",
"title": ""
},
{
"docid": "10c14d5cb016ff88de4a0421e2ab2ba5",
"score": "0.6050252",
"text": "cohesion( boids ) {\n var neighborDist = 50;\n var sum = new Victor();\n var count = 0;\n for (var i = 0; i < boids.length; i++) {\n var dist = this.position.distance(boids[i].position);\n if ( dist > 0 && dist < neighborDist ) {\n sum.add(boids[i].position);\n count++;\n }\n }\n if (count > 0) {\n sum.divide({x: count,y:count});\n return this.seek(sum);\n } else {\n return sum;\n }\n }",
"title": ""
},
{
"docid": "c0d681e48c4139de09b919903895a070",
"score": "0.6047968",
"text": "function breaks(a, b){\n\t\tvar nChunks = this.rho.length;\n\t\t// See if the endpoints are inside our poly\n\t\tif (contains.call(this, a)){\n\t\t\treturn true;\n\t\t} else if (contains.call(this, b)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// c is the closest point along (a,b) to this\n\t\t/*\n\t\tvar a_dist = dist.call(this.center, a);\n\t\tangle.call(this, b);\n\t\t*/\n\t\tvar crossDist = mf.dist2line.call(this.center, a, b),\n\t\t\tangA = mf.angle.call(this.center, a),\n\t\t\tangB = mf.angle.call(this.center, b),\n\t\t\tdAng = angB - angA;\n\n\t\tvar a2center = numeric.sub(this.center, a),\n\t\t\ta2b = numeric.sub(this.center, b),\n\t\t\tangBC = abs(mf.angle.call(a2center, a2b)),\n\t\t\tangThis = angA - (PI/2 - angBC),\n\t\t\tiAngThis = mf.iangle_valid.call(nChunks, angThis),\n\t\t\tr = this.rho[iAngThis],\n\t\t\tdAngThis = angThis - angA;\n\n\t\tif (crossDist < r){\n\t\t\tif(dAng>1.7*PI){dAng=2*PI-dAng;}\n\t\t\tif(abs(dAngThis)<abs(dAng)){\n\t\t\t\t/*\n\t\t\tconsole.log('angBC',angBC*180/PI);\n\t\t\tconsole.log('angThis',angThis*180/PI);\n\t\t\tconsole.log('angA',angA*180/PI);\n\t\t\tconsole.log('angB',angB*180/PI);\n\t\t\tconsole.log('r', r);\n\t\t\tconsole.log('crossDist', crossDist);\n\t\t\tconsole.log('dAng', dAng*180/PI, dAngThis*180/PI);\n\t\t\tconsole.log('\\n');\n\t\t\t*/\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n/*\n\t\tvar br_cone = cone.call(poly, [a,b]);\n\t\tvar a_dist = dist.call(poly.center, a);\n\t\tvar b_dist = dist.call(poly.center, b);\n\t\tvar cone_rho = br_cone.map(mf.lookup, poly.rho);\n\t\tvar does_break = cone_rho.map(function(d){\n\t\t\treturn min(a_dist-d, b_dist-d) < 0;\n\t\t}).reduce(function(prev, now){return prev||now;});\n\t\tif(does_break){ return true; }\n*/\n\t\treturn false;\n\t}",
"title": ""
},
{
"docid": "8ec1e200c045d8a1755f5ce763c4ce41",
"score": "0.6041409",
"text": "function cohesion(boids) {\n var neighborDist = 10000;\n var sum = new Point();\n var count = 0;\n for (var i = 0, l = boids.length; i < l; i++) {\n var distance = distances[i];\n if (distance > 0 && distance < neighborDist) {\n sum.x += boids[i].position().x;\n sum.y += boids[i].position().y;\n count++;\n }\n }\n if (count > 0) {\n sum.x /= count;\n sum.y /= count;\n // Steer towards the location\n return steer(sum, false);\n }\n\n return sum;\n }",
"title": ""
},
{
"docid": "5839032f6c21f558d3a8a770f46886f1",
"score": "0.6004892",
"text": "cohesion(boids){\r\n let perceptionRadius = 60; //same as alignment\r\n //should probably change \"desired\" to \"steering\"\r\n let desired = createVector();\r\n let total = 0;\r\n for(let other of boids){\r\n //calculate distance between this boid position and other boid position\r\n let d = dist(\r\n this.position.x,\r\n this.position.y,\r\n other.position.x,\r\n other.position.y\r\n );\r\n if(other != this && d < perceptionRadius){\r\n //average vectors so that directions of all voids in same area can align\r\n desired.add(other.position); \r\n total++;\r\n }\r\n }\r\n //divide by total if total more than 0\r\n if(total > 0){\r\n //this is a lot of math\r\n desired.div(total); //divide total\r\n desired.sub(this.position); //find difference in location\r\n desired.setMag(this.maxSpeed); //maintain speed\r\n desired.sub(this.velocity); //subtract current velocity\r\n desired.limit(this.maxForce); //maximum ammount of force affecting boids\r\n }\r\n return desired;\r\n }",
"title": ""
},
{
"docid": "0eb27cb58ca4aea41a5f19b2110edb01",
"score": "0.59952176",
"text": "checkIfDied(segment) {\n //renaming head for easier access\n let head = this.segments[0];\n if (segment === 'self') {\n //we chech if we have interception with any fof the segments\n return this\n .segments\n .some((segment,i) => {\n\n // we check if distance between points is less then diamieters of lines. it will\n // not work if we have too big segment length I might work on better formula,\n // but it will not be that efficient\n let dist = this.p.createVector(head.a.x-segment.a.x,head.a.y-segment.a.y).mag();\n if (i>4) {\n return dist < head.sw + segment.sw;\n }\n\n // if (i>5) { //MAKE THIS VALUE BIGGER IF YOU HAVE TO THICK AND SHORT LINES \n // //we check if rectangles intersect\n // let RectA = {};\n // let RectB = {};\n // //first we find sides\n // if (head.a.x<head.b.x) {\n // RectA.left = head.a.x-head.sw;\n // RectA.right = head.b.x+head.sw;\n // } else {\n // RectA.left = head.b.x-head.sw;\n // RectA.right = head.a.x+head.sw;\n // }\n // if (head.a.y<head.b.y) {\n // RectA.top = head.a.y-head.sw;\n // RectA.bottom = head.b.y+head.sw;\n // } else {\n // RectA.top = head.b.y-head.sw;\n // RectA.bottom = head.a.y+head.sw; \n // }\n\n // if (segment.a.x<segment.b.x) {\n // RectB.left = segment.a.x-segment.sw;\n // RectB.right = segment.b.x+segment.sw;\n // } else {\n // RectB.left = segment.b.x-segment.sw;\n // RectB.right = segment.a.x+segment.sw;\n // }\n // if (segment.a.y<segment.b.y) {\n // RectB.top = segment.a.y-segment.sw;\n // RectB.bottom = segment.b.y+segment.sw;\n // } else {\n // RectB.top = segment.b.y-segment.sw;\n // RectB.bottom = segment.a.y+segment.sw; \n // }\n \n // if (RectA.left < RectB.right && RectA.right > RectB.left && RectA.top < RectB.bottom && RectA.bottom > RectB.top) {\n // return true;\n // }\n // }\n \n //otherwise we return false\n return false;\n });\n } else {\n return this.p.createVector(head.a.x-segment.a.x,head.a.y-segment.a.y).mag() < head.sw + segment.sw;\n }\n }",
"title": ""
},
{
"docid": "ff70be167866f112f3620e7f52fd7440",
"score": "0.5992863",
"text": "function insideObjectsCheck() {\n for (var i = 0; i < borders.length; i++) {\n switch (borders[i].shape) {\n case (\"rectEmp\"):\n ymin = ((borders[i].y + borders[i].thick + rad));\n ymax = ((borders[i].height - borders[i].thick + borders[i].y - rad));\n xmin = ((borders[i].x + borders[i].thick + rad));\n xmax = ((borders[i].width - borders[i].thick + borders[i].x - rad));\n if (x < xmin) {\n x = xmin;\n } else if (x > xmax) {\n x = xmax;\n }\n if (y < ymin) {\n y = ymin;\n } else if (y > ymax) {\n y = ymax;\n }\n break;\n /*case (\"barrierMov\"):\n ymin = ((borders[i].y - rad));\n ymax = ((borders[i].height + borders[i].y + rad));\n xmin = ((borders[i].x - rad));\n xmax = ((borders[i].width + borders[i].x + rad));\n if (x + 5 * xvel / timeScale < xmax\n && y - 5 * yvel / timeScale > ymin\n && y + 5 * yvel / timeScale < ymax\n && x - 5 * xvel / timeScale > xmin) {\n \n \n }\n break;*/\n case (\"circleMov\"):\n case (\"circle\"):\n var dx = x - borders[i].x;\n var dy = y - borders[i].y;\n var dL = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\n var angle = Math.acos(dx / dL) * Math.sign(Math.asin(dy / dL));\n if (dL < (borders[i].rad + rad)) {\n x = (borders[i].rad + rad) * Math.cos(angle) + borders[i].x;\n y = (borders[i].rad + rad) * Math.sin(angle) + borders[i].y;\n }\n break;\n };\n }\n}",
"title": ""
},
{
"docid": "d8d7d84f2534342e56bd921631919423",
"score": "0.59605706",
"text": "flockingWith (boids) {\n let acceleration = new p5.Vector(0, 0),\n neighborDistance = 50,\n tooCloseDistance = 25\n\n let neighbors = this.getBoidsWithin(boids, neighborDistance),\n tooClose = this.getBoidsWithin(neighbors, tooCloseDistance)\n\n let separation = this.separateFrom(tooClose).mult(1.5),\n alignment = this.alignWith(neighbors).mult(1.0),\n cohesion = this.cohereWith(neighbors).mult(1.0)\n\n // Add the force vectors to acceleration\n return acceleration.add(separation)\n .add(alignment)\n .add(cohesion)\n }",
"title": ""
},
{
"docid": "20d46df8c67c2b58cef1514dc23b2fe8",
"score": "0.59546876",
"text": "function not_on_the_way(y,x,butterflies) {\r\n for (let i = 0; i<butterflies.length; i++)\r\n {\r\n if((Math.abs(y-butterflies[i].y)+Math.abs(x-butterflies[i].x)) < 2) \r\n return false;\r\n }\r\n return true;\r\n}",
"title": ""
},
{
"docid": "91bf0f20069edbf50752c88dc5a4c166",
"score": "0.5921507",
"text": "function checkBoarder(x,y) {\n var outside = 0;\n\n if ( ((x + x_board_max) > x_global) || ((x + x_board_min) < -x_global) ||\n ((y + y_board_max) > y_global) || ((y + y_board_min) < -y_global))\n {\n\toutside = 2;\n }\n else if ( (x + x_board_max > x_pos_boarder) || (-x - x_board_min < x_neg_boarder) ||\n\t (y + y_board_max > y_pos_boarder) || (-y - y_board_min < y_neg_boarder))\n {\n\toutside = 1;\n }\n\n return outside;\n}",
"title": ""
},
{
"docid": "c1083e4084ae2cade729585428a3ad78",
"score": "0.5906927",
"text": "cohesionVector(boids) {\n let sum = new Point();\n let count = 0;\n for (let i = 0, l = boids.length; i < l; i++) {\n const other = boids[i];\n const distance = this.position.getDistanceSquared(other.position);\n if (other !== this && distance < this.desiredSeperation) {\n sum.add(other.position);\n count++;\n }\n }\n if (count > 0) {\n sum.divideNum(count);\n // Steer towards the location\n return this.seekVector(sum);\n }\n return sum;\n }",
"title": ""
},
{
"docid": "188e11f2a1e50b2624312d755d23970e",
"score": "0.5893802",
"text": "separateFrom (tooClose) {\n\n if (tooClose.length === 0) return new p5.Vector(0, 0)\n\n // Create a single vector that steers away from too closeness,\n // but weights according to the *inverse* of the distance\n let steerAway = tooClose.reduce((away, neighbor) => {\n let difference = p5.Vector.sub(this.position, neighbor.position),\n distance = difference.mag()\n\n difference.normalize()\n .div(distance)\n\n return p5.Vector.add(away, difference)\n }, new p5.Vector(0, 0))\n\n // Once we get that vector, we have some more math to do\n steerAway.normalize()\n .mult(this.maxSpeed)\n .sub(this.velocity)\n .limit(this.maxForce)\n\n return steerAway\n\n }",
"title": ""
},
{
"docid": "6395499cb969b418b8b01218e7f46bd1",
"score": "0.5873064",
"text": "function calculateMouthSeparation(mouth) {\n const topLipCenter = mouth[14];\n const bottomLipCenter = mouth[18];\n const separation = bottomLipCenter.y - topLipCenter.y;\n if (separation > 80) {\n console.error(\"Yawning or Screaming for life\");\n }\n return separation < 5 ? \"Closed\" : separation < 15 ? \"Slightly open\" : \"Open\";\n}",
"title": ""
},
{
"docid": "a704069a9980b533f30b2c9ac5b8ed08",
"score": "0.58606905",
"text": "function hasHoleInDeplacement(startCoordonate, endCoordonate, holes) {\n if (isHorizontalMove(startCoordonate, endCoordonate)) { //attribut colonne des trous dans l'interval de déplacement\n const sortedCordonnates = [startCoordonate, endCoordonate].sort((a, b) => a.x > b.x); // trier dans l'odre croissant // QUESTION sur la syntaxe [startCoordonate, endCoordonate]\n return holes\n .filter((hole) => hole.ligneHole === startCoordonate.y) //On filtre les trous qui sont sur la meme ligne que le joueur --> Cela retourne un nouveau tableau\n .filter((hole) => hole.colonneHole > sortedCordonnates[0].x && hole.colonneHole < sortedCordonnates[1].x) //On filtre à nouveau sur le résultat du premier filtre les trous qui sont dans la trajectoire du déplacement\n .length > 0; // ????\n }\n // On refait la même manipulation dans l'autre sens car déplacement vertical\n const sortedCordonnates = [startCoordonate, endCoordonate].sort((a, b) => a.y > b.y);\n return holes // array holes déclaré dans util.js\n .filter((hole) => hole.colonneHole === startCoordonate.x) //On filtre les trous qui sont sur la meme colonne que le joueur\n .filter((hole) => hole.ligneHole > sortedCordonnates[0].y && hole.ligneHole < sortedCordonnates[1].y)\n .length > 0;\n}",
"title": ""
},
{
"docid": "51438521ed9b91f976ca2f6dce0de7b7",
"score": "0.58596444",
"text": "checkNeighbor(){\n this.bombnearby += this.TopLeft(IsBomb);\n this.bombnearby += this.TopMiddle(IsBomb);\n this.bombnearby += this.TopRight(IsBomb);\n this.bombnearby += this.Left(IsBomb);\n this.bombnearby += this.Right(IsBomb);\n this.bombnearby += this.BottomLeft(IsBomb);\n this.bombnearby += this.BottomMiddle(IsBomb);\n this.bombnearby += this.BottomRight(IsBomb);\n }",
"title": ""
},
{
"docid": "f829962f4a3f705b6d272e420def5b08",
"score": "0.5846759",
"text": "cohesion(boids) {\n\n let count = 0;\n let averagePos = createVector(0, 0)\n for (let i = 0; i < boids.length; i++) {\n if (this != boids[i] && this.pos.dist(boids[i].pos) < this.cohesionVision) {\n averagePos.add(boids[i].pos)\n count += 1;\n }\n }\n\n // check for div by 0\n if (count > 0) {\n averagePos.div(count)\n }\n averagePos.sub(this.pos)\n // averagePos.limit(.5)\n\n\n // Currently Shared with alignment\n // if (this.showCohesionVision) {\n // fill(0, 255, 0, 100)\n // ellipse(this.pos.x, this.pos.y, this.alignmentVision, this.alignmentVision)\n // }\n\n // Direction Vector\n if (this.showCohesionVector) {\n let end = averagePos.copy().setMag(this.cohesionVal * this.scaleValue)\n stroke(0, 255, 0)\n line(this.pos.x, this.pos.y, this.pos.x + end.x, this.pos.y + end.y)\n }\n\n return averagePos\n }",
"title": ""
},
{
"docid": "dcae327140a9b625b754f5fca55973ef",
"score": "0.5840753",
"text": "boundaryCheck() {\n let change = false;\n if (this.bodyPosition.x > params.CANVAS_MAP_X) {\n this.bodyPosition.x = params.CANVAS_MAP_X;\n change = true;\n }\n if (this.bodyPosition.x < -params.CANVAS_MAP_X) {\n this.bodyPosition.x = -params.CANVAS_MAP_X;\n change = true;\n }\n if (this.bodyPosition.y > params.CANVAS_MAP_Y) {\n this.bodyPosition.y = params.CANVAS_MAP_Y;\n change = true;\n }\n if (this.bodyPosition.y < -params.CANVAS_MAP_Y) {\n this.bodyPosition.y = -params.CANVAS_MAP_Y;\n change = true;\n }\n params.CANVAS_OBSTACLES.forEach(obstacle => {\n if (this.bodyPosition.x > obstacle.x1 - params.UNIT_RADIUS + 10 &&\n this.bodyPosition.x < obstacle.x4 + params.UNIT_RADIUS - 10 &&\n this.bodyPosition.y < obstacle.y1 + params.UNIT_RADIUS - 10 &&\n this.bodyPosition.y > obstacle.y2 - params.UNIT_RADIUS + 10) {\n //This 'line' of code makes it possible that when you touch the border of an obstacle, it will stop you while having a smooth rubber like effect\n const tmp = (this.bodyPosition.x < obstacle.x1) ? this.bodyPosition.x = p5.lerp(this.bodyPosition.x, obstacle.x1 - params.UNIT_RADIUS, 0.2) :\n (this.bodyPosition.x > obstacle.x4) ? this.bodyPosition.x = p5.lerp(this.bodyPosition.x, obstacle.x4 + params.UNIT_RADIUS, 0.2) :\n (this.bodyPosition.y > obstacle.y1) ? this.bodyPosition.y = p5.lerp(this.bodyPosition.y, obstacle.y1 + params.UNIT_RADIUS, 0.2) :\n (this.bodyPosition.y < obstacle.y2) ? this.bodyPosition.y = p5.lerp(this.bodyPosition.y, obstacle.y2 - params.UNIT_RADIUS, 0.2) : false;\n change = (tmp) ? true : false;\n }\n });\n const distance_from_center = this.bodyPosition.dist(p5.createVector(params.CANVAS_OBSTACLES_CENTER_PIECE.x, params.CANVAS_OBSTACLES_CENTER_PIECE.y));\n if (distance_from_center < params.UNIT_RADIUS + params.CANVAS_OBSTACLES_CENTER_PIECE.r1 / 2) {\n const angle = this.bodyPosition.heading();\n const push = p5.createVector(1 * Math.cos(angle), 1 * Math.sin(angle)).mult(3 * params.CANVAS_OBSTACLES_CENTER_PIECE.r1 / 5);\n this.bodyPosition = this.bodyPosition.lerp(push, 0.2);\n change = true;\n }\n return change;\n }",
"title": ""
},
{
"docid": "76d276ad4d6f374fbf4036c21ef6fd08",
"score": "0.5823339",
"text": "breakAsteroid(asteroid){\n\t //delete original asteroid\n\t this.asteroidList.splice(this.asteroidList.findIndex((ast)=>{return(ast.positionVector.x === asteroid.positionVector.x && ast.positionVector.y === asteroid.positionVector.y);}),1);\n\t \n\t //make sure the asteroid needs to be split\n\t if (asteroid.radius > 25)\n\t {\n\t\t//create first asteroid \n\t\tvar rad = asteroid.radius / 1.5;\n\t var positionX = asteroid.positionVector.x + asteroid.radius * .75;\n\t var positionY = asteroid.positionVector.y + asteroid.radius * .75; \n\t var velocityX = asteroid.velocityVector.x * 2;\n\t var velocityY = asteroid.velocityVector.y / 2;\n\t\t \n\t\tthis.asteroidList.push({\n\t\t positionVector: {x: positionX, y: positionY},\n\t\t velocityVector: {x: velocityX, y: velocityY},\n\t\t radius: rad,\n\t\t mass: rad,\n\t\t lastBounce: null\n\t\t });\n\t \n\t\t//create second asteroid\n\t\tpositionX = asteroid.positionVector.x - asteroid.radius * .75;\n\t positionY = asteroid.positionVector.y - asteroid.radius * .75; \n\t velocityX = asteroid.velocityVector.x / 2;\n\t velocityY = asteroid.velocityVector.y * 2;\n\t\t \n\t\tthis.asteroidList.push({\n\t\t positionVector: {x: positionX, y: positionY},\n\t\t velocityVector: {x: velocityX, y: velocityY},\n\t\t radius: rad,\n\t\t mass: rad,\n\t\t lastBounce: null\n\t\t });\n\t }\n }",
"title": ""
},
{
"docid": "f46c28a165b924daeb155431b7390e33",
"score": "0.5791787",
"text": "function blocked(direction){\n let result = false;\n\n if(direction===NORTH&&y-1-ROOMSIZE>=0){\n if(x-1-ROOMSIZE>=0&& //northwest\n map.isFloorSpecial({x: x-1,y})&&\n map.isFloorSpecial({x: x-1-ROOMSIZE,y: y-1})&&\n map.isFloorSpecial({x: x-1,y: y-1-ROOMSIZE})) result = true;\n if(x+6<map.width&& //northeast\n map.isFloorSpecial({x: x+1,y})&&\n map.isFloorSpecial({x: x+1+ROOMSIZE,y: y-1})&&\n map.isFloorSpecial({x: x+1,y: y-1-ROOMSIZE})) result = true\n }else if(direction===SOUTH&&y+1+ROOMSIZE<map.height){\n if(x-1-ROOMSIZE>=0&& //southwest\n map.isFloorSpecial({x: x-1,y})&&\n map.isFloorSpecial({x: x-1-ROOMSIZE,y: y+1})&&\n map.isFloorSpecial({x: x-1,y: y+1+ROOMSIZE})) result = true;\n if(x+1+ROOMSIZE<map.width&& //southeast\n map.isFloorSpecial({x: x+1,y})&&\n map.isFloorSpecial({x: x+1+ROOMSIZE,y: y+1})&&\n map.isFloorSpecial({x: x+1,y: y+1+ROOMSIZE})) result = true;\n }else if(direction===EAST&&x+6<map.width){\n if(y-1-ROOMSIZE>=0&& //eastnorth\n map.isFloorSpecial({x,y: y-1})&&\n map.isFloorSpecial({x: x+1,y: y-1-ROOMSIZE})&&\n map.isFloorSpecial({x: x+1+ROOMSIZE,y: y-1})) result = true\n if(y+6<map.height&& //eastsouth\n map.isFloorSpecial({x,y: y+1})&&\n map.isFloorSpecial({x: x+1,y: y+1+ROOMSIZE})&&\n map.isFloorSpecial({x: x+1+ROOMSIZE,y: y+1})) result = true\n }else if(direction===WEST&&x-6>=0){\n if(y-6>=0&& //westnorth\n map.isFloorSpecial({x,y: y-1})&&\n map.isFloorSpecial({x: x-1,y: y-1-ROOMSIZE})&&\n map.isFloorSpecial({x: x-1-ROOMSIZE,y: y-1})) result = true;\n if(y<map.height&& //westsouth\n map.isFloorSpecial({x,y: y+1})&&\n map.isFloorSpecial({x: x-1,y: y+1+ROOMSIZE})&&\n map.isFloorSpecial({x: x-1-ROOMSIZE,y: y+1})) result = true;\n } //end if\n return result;\n } //end function",
"title": ""
},
{
"docid": "f550b2b5360784565bc66be4e166a0f9",
"score": "0.5777319",
"text": "function isInside(locA, sizeA, locB, sizeB) {\n // YOUR CODE HERE (3-5 lines approx)\n if (locA.dist(locB) <= (sizeA + sizeB) / 2) {\n return true;\n }\n return false;\n}",
"title": ""
},
{
"docid": "b2bef95eba8f2cdb764d90fb9a9c2dc9",
"score": "0.5771344",
"text": "function kollisjon(a, b) {\n if (\n b.y + b.h > a.y + 10 && \n b.x + b.w > a.x +20 && \n b.x < a.x + a.w -15 && \n b.y < a.y + a.h -25\n ) {\n \n\n return true;\n \n } else {\n return false;\n }\n }",
"title": ""
},
{
"docid": "b6e0aca29975f293c4077fe1a98915c4",
"score": "0.5762457",
"text": "function getNeighboreSpots(spot) {\n \n\t\tvar spotsPerLine = [1,2,3,4,13,12,11,10,9,10,11,12,13,4,3,2,1];\n\t\tvar neighbores = [];\n\t\n\t\tfor(var y = 0; y < 17; y++){\n \n\t\t\tfor(var x = 0; x < spotsPerLine[y]; x++){\n \n\t\t\t\tvar distance = Math.sqrt(((spot.screenX - spotMatrix[y][x].screenX)*(spot.screenX - spotMatrix[y][x].screenX)) + \n\t\t\t\t\t\t\t\t((spot.screenY - spotMatrix[y][x].screenY)*(spot.screenY - spotMatrix[y][x].screenY)));\n \n\t\t\t\tif(distance < 60 && (x!=spot.x || y!=spot.y)) {\n \n\t\t\t\t\tneighbores.push(spotMatrix[y][x]);\n \n } // end if statement\n \n\t\t\t} // end for statement x\n \n\t\t} // end for statement y\n\t\t\n\t\treturn neighbores;\n \n\t} // end getNeighnoreSpots(spot)",
"title": ""
},
{
"docid": "23ac20f783afb9183c762d295ef3a8c0",
"score": "0.5753721",
"text": "hits(bird) {\n /* \n * if the center coordinate of the bird is in the pipe area,\n * this returns true.\n */\n let rightIsCovered = bird.x + w/2 > this.x && bird.x + w/2 < this.x + this.w;\n let leftIsCovered = bird.x - w/2 > this.x && bird.x - w/2 < this.x + this.w;\n if (leftIsCovered || rightIsCovered) {\n if (bird.y - h/2 < this.top || bird.y + h/2 > height - this.bottom) {\n return true;\n }\n }\n return false;\n }",
"title": ""
},
{
"docid": "e7928982f456e392d2c1406d19c96934",
"score": "0.5730016",
"text": "function coll_det_PbDS() {\n let distx = Math.abs(pinball1.pos.x - daGutter.center.x);\n let disty = Math.abs(pinball1.pos.y - daGutter.center.y);\n //sides check\n if (distx > (daGutter.width/2 + pinball1.r)) { return false; }\n if (disty > (daGutter.height/2 + pinball1.r)) { return false; }\n\n if (distx <= (daGutter.width/2)) { return true; } \n if (disty <= (daGutter.height/2)) { return true; }\n \n //pythag theorem for corner\n let dx=distx-daGutter.width/2;\n let dy=disty-daGutter.height/2;\n return (dx**2+dy**2<=(pinball1.r**2));\n}",
"title": ""
},
{
"docid": "5481c4f836a5d3516a65cd8423372b05",
"score": "0.57294375",
"text": "align (boids) {\n const { position, maxspeed, velocity, maxforce } = this;\n\n const neighbordist = 50;\n const sum = new Vector(0, 0);\n let count = 0;\n\n boids.forEach(other => {\n const d = Vector.dist(position, other.position);\n if (d > 0 && d < neighbordist) {\n sum.add(other.velocity);\n count++;\n }\n });\n\n if (count > 0) {\n sum.div(count);\n // First two lines of code below could be condensed with new Vector setMag() method\n // Not using this method until Processing.js catches up\n // sum.setMag(maxspeed)\n\n // Implement Reynolds: Steering = Desired - Velocity\n sum.normalize();\n sum.mult(maxspeed);\n const steer = Vector.sub(sum, velocity);\n steer.limit(maxforce);\n return steer;\n } else {\n return new Vector(0, 0);\n }\n }",
"title": ""
},
{
"docid": "6e9b5b4292c65bdcacf48e6ceda5bcf6",
"score": "0.57221067",
"text": "function collisionHelper(boxA, boxB) {\n //var x[4], y[4];\n var x = [0,0,0,0];\n var y = [0,0,0,0];\n var i,j;\n var test = false;\n var outsideTest, insideTest;\n \n x[0] = boxB.left;\n y[0] = boxB.top;\n \n x[1] = boxB.right;\n y[1] = boxB.top;\n \n x[2] = boxB.left;\n y[2] = boxB.bottom;\n \n x[3] = boxB.right;\n y[3] = boxB.bottom;\n for (i = 0; i < 4; i ++) {\n // is one povar inside the other bounding box??\n if (x[i] <= boxA.right && x[i] >= boxA.left && y[i] <= boxA.bottom && y[i] >= boxA.top ) {\n \n \n // are all other points outside the other bounding box??\n outsideTest = false;\n \n for (j = 0; j < 4 ; j ++) {\n if (j != i ) {\n if (!(x[j] <= boxA.right && x[j] >= boxA.left && y[j] <= boxA.bottom && y[j] >= boxA.top) ) {\n outsideTest = true;\n \n }\n }\n }\n if(outsideTest) {\n test = true;\n \n }\n // is a second povar inside the bounding box??\n insideTest = false;\n for (j = 0; j < 4 ; j ++) {\n if (j != i ) {\n if ((x[j] <= boxA.right && x[j] >= boxA.left && y[j] <= boxA.bottom && y[j] >= boxA.top) ) {\n insideTest = true;\n\n }\n }\n }\n if(insideTest) {\n test = true;\n\n }\n \n \n //////////////////////////\n }\n }\n \n return test;\n}",
"title": ""
},
{
"docid": "eb4373cf1dca7e34488acc39749c46c5",
"score": "0.56827897",
"text": "function collisionSimple(boxA, boxB) {\n //var x[4], y[4];\n var x = [0,0,0,0];\n var y = [0,0,0,0];\n var i, j;\n var test = false;\n var outsideTest, insideTest;\n \n x[0] = boxA.left;\n y[0] = boxA.top;\n \n x[1] = boxA.right;\n y[1] = boxA.top;\n \n x[2] = boxA.left;\n y[2] = boxA.bottom;\n \n x[3] = boxA.right;\n y[3] = boxA.bottom;\n for (i = 0; i < 4; i ++) {\n // is one povar inside the other bounding box??\n if (x[i] <= boxB.right && x[i] >= boxB.left && y[i] <= boxB.bottom && y[i] >= boxB.top ) {\n // are all other points outside the other bounding box??\n outsideTest = false;\n \n for (j = 0; j < 4 ; j ++) {\n if (j != i ) {\n if (!(x[j] <= boxB.right && x[j] >= boxB.left && y[j] <= boxB.bottom && y[j] >= boxB.top) ) {\n outsideTest = true;\n \n }\n }\n }\n if(outsideTest) {\n test = true;\n \n }\n // is a second povar inside the bounding box??\n insideTest = false;\n for (j = 0; j < 4 ; j ++) {\n if (j != i ) {\n if ((x[j] <= boxB.right && x[j] >= boxB.left && y[j] <= boxB.bottom && y[j] >= boxB.top) ) {\n insideTest = true;\n\n }\n }\n }\n if(insideTest) {\n test = true;\n \n }\n \n /////////////////////////\n }\n }\n if (!test) return collisionHelper(boxA, boxB);\n else return true;\n}",
"title": ""
},
{
"docid": "991746c77e8474d50238654a587c00b4",
"score": "0.5675523",
"text": "checkForCollision() {\n // IF the bird is approaching the first pipe at a distance of AT LEAST 10 pixles\n if ((this.bird_.position.x >= (this.pw_.getPipeNumber(0).position.x - this.bird_.width))) {\n // IF the bird has NOT passed the pipe (the +10 is to compensate for the imperfection of the bird's image - the game ends when the back-end of the bird does not quite hit the pipe on its way out of the pipe gap)\n if (!(this.bird_.position.x+10 >= this.pw_.getPipeNumber(0).position.x + this.pw_.getPipeNumber(0).width)) {\n // IF the bird is within the y-bounds of the gap, return true. Else, return false\n if ((this.bird_.position.y > (this.pw_.getPipeNumber(0).position.y + this.pw_.getPipeNumber(0).height)) && (this.bird_.position.y < (this.pw_.getPipeNumber(0).position.y + this.pw_.getPipeNumber(0).height + this.pw_.getPipeNumber(0).gap - this.bird.height))) {\n return false;\n } else {\n return true;\n }\n }\n }\n }",
"title": ""
},
{
"docid": "0d51681c10d6f390b92fea209116eb7b",
"score": "0.564296",
"text": "avoidWalls() {\n\n var buffer = mobile ? 5 : 15;\n\n if ( this.distanceFromHorWall() < this.radius * buffer || this.distanceFromVertWall() < this.radius * buffer ) {\n return this.seek(center);\n } else { return false; }\n\n }",
"title": ""
},
{
"docid": "db85c0c924059cbc95f0f2d25226d0d4",
"score": "0.564221",
"text": "function isSeparated(spotsX, spotsY) {\n for (var i = 0; i < spotsX.length; i++) {\n for (var j = i+1; j < spotsX.length; j++) {\n //make sure i and j are far apart enough\n if (!(Math.abs(spotsX[i]-spotsX[j]) > 2 ||\n Math.abs(spotsY[i]-spotsY[j]) > 2)) {\n return false;\n }\n }\n }\n\n return true;\n}",
"title": ""
},
{
"docid": "c6aeee2f43a16a88768e8942a9320b08",
"score": "0.56355125",
"text": "function bisect(orientation, x1, x2, y1, y2) {\n //Can't bisect further\n if (abs(x1 - x2) <= 1 || abs(y1 - y2) <= 1) {\n return;\n }\n\n //Bisect horizontally\n if (orientation) {\n //Finds an odd coordinate to bisect between\n var bisectPt = floor(random(x1 + 1, x2) / 2) * 2;\n\n //Creates a wall at bisection point\n for (var j = y1; j < y2 + 1; j++) {\n grid[bisectPt][j].wall = true;\n }\n\n //Creates an even coordinate entrance on the wall\n var entrance = floor(random(y1, y2 + 1) / 2) * 2 + 1;\n grid[bisectPt][entrance].wall = false;\n\n //Recurse on both sides\n bisect(!orientation, x1, bisectPt - 1, y1, y2);\n bisect(!orientation, bisectPt + 1, x2, y1 , y2);\n\n } else {\n //Finds an odd coordinate to bisect between\n var bisectPt = floor(random(y1 + 1, y2) / 2) * 2;\n\n //Creates a wall at bisection point\n for (var i = x1; i < x2 + 1; i++) {\n grid[i][bisectPt].wall = true;\n }\n\n //Creates an even coordinate entrance on the wall\n var entrance = floor(random(x1, x2 + 1) / 2) * 2 + 1;\n grid[entrance][bisectPt].wall = false;\n\n //Recurse on both sides\n bisect(!orientation, x1, x2, y1, bisectPt - 1);\n bisect(!orientation, x1, x2, bisectPt + 1 , y2);\n }\n}",
"title": ""
},
{
"docid": "0fc50f9c5590ff3c5e5cb4dc2388d8ed",
"score": "0.5632642",
"text": "intersects( other, interval ) {\n\n if (this.bBox.intersectsBox(other.bBox)) {\n\n // we have a candidate - calculate relative position and speed\n // p = p2-p1, v= v2-v1 - note that p is already the new position t sec ago\n let p = other.pos.clone().sub(this.pos)\n let v = other.speed.clone().sub(this.speed)\n\n // calculate a,b and c of the quadratic distance equation\n let a = v.lengthSq()\n let b = 2*p.dot(v)\n let c = p.lengthSq() - (other.radius+this.radius)**2\n\n // the determinant\n let det = b*b - 4*a*c\n \n // if the determinant is positive there are intersections\n if ( det > 0) {\n\n // show that the objects will collide\n if (this.boxHelper) this.boxHelper.material.color.copy(boxHitClr)\n if (other.boxHelper) other.boxHelper.material.color.copy(boxHitClr)\n\n // calculate the roots - nota that t1 is the smallest root\n let sqrt = Math.sqrt(det)\n let t1 = (-b - sqrt)/(2*a)\n\n // there is a second 'collision' at t2 when the balls intersect when moving apart\n // t2 = (-b + sqrt)/(2*a)\n // t2 = -tCol - b/a\n // t2 > 0 becomes then t1 < -b/a\n // so if we have missed the first intersection (at t1) but t2 is still in the future, we still consider t1\n\n // the collision should have happened in the interval except when the second collision is still in the future\n if ( ( t1 < 0 ) && ((t1 > -interval) || (t1 < -b/a)) ) return t1\n else return Infinity\n }\n else return Infinity\n }\n return Infinity\n }",
"title": ""
},
{
"docid": "1387b4218f655ae196e64926e49187ce",
"score": "0.56257683",
"text": "cohereWith (neighbors) {\n\n if (neighbors.length === 0) return new p5.Vector(0, 0)\n\n let averagePosition = Boid.averageOf(neighbors, 'position')\n\n let desired = p5.Vector.sub(averagePosition, this.position)\n .normalize()\n .mult(this.maxSpeed)\n\n let steer = p5.Vector.sub(desired, this.velocity)\n .limit(this.maxForce)\n\n return steer\n\n }",
"title": ""
},
{
"docid": "ffa8ba899ea2d21e7aab059c38b37e2e",
"score": "0.5603847",
"text": "function checkIfPointInHall3(location, hall) {\r\n \r\n ULtoUR = getPointToLine(location, hallwayArray.get(hall).upperLeft, hallwayArray.get(hall).upperRight) ; \r\n URtoLR = getPointToLine(location, hallwayArray.get(hall).upperRight, hallwayArray.get(hall).lowerRight) ;\r\n LRtoLL = getPointToLine(location, hallwayArray.get(hall).lowerRight, hallwayArray.get(hall).lowerLeft) ;\r\n LLtoUL = getPointToLine(location, hallwayArray.get(hall).lowerLeft, hallwayArray.get(hall).upperLeft) ;\r\n \r\n if (hallwayArray.get(hall).bearing == 0) {\r\n return LRtoLL && !ULtoUR && location.lng() < hallwayArray.get(hall).upperRight.lng() && location.lng() > hallwayArray.get(hall).upperLeft.lng() ; \r\n \r\n } else if (hallwayArray.get(hall).bearing == 90) {\r\n return URtoLR && !LLtoUL && location.lng() < hallwayArray.get(hall).upperLeft.lng() && location.lng() > hallwayArray.get(hall).lowerLeft.lng() ; ;\r\n \r\n } else if (hallwayArray.get(hall).bearing == 180) {\r\n return ULtoUR && !LRtoLL && location.lng() < hallwayArray.get(hall).upperLeft.lng() && location.lng() > hallwayArray.get(hall).lowerRight.lng() ; ; ;\r\n \r\n } else if (hallwayArray.get(hall).bearing == 270) {\r\n return !URtoLR && LLtoUL && location.lng() < hallwayArray.get(hall).lowerLeft.lng() && location.lng() > hallwayArray.get(hall).upperLeft.lng() ; ; ;\r\n }\r\n \r\n if (hallwayArray.get(hall).bearing < 90) {\r\n return !ULtoUR && URtoLR && LRtoLL && !LLtoUL ; \r\n \r\n } else if (hallwayArray.get(hall).bearing < 180) {\r\n return ULtoUR && URtoLR && !LRtoLL && !LLtoUL ;\r\n \r\n } else if (hallwayArray.get(hall).bearing < 270) {\r\n return ULtoUR && !URtoLR && !LRtoLL && LLtoUL ;\r\n \r\n } else {\r\n return !ULtoUR && !URtoLR && LRtoLL && LLtoUL ;\r\n }\r\n \r\n }",
"title": ""
},
{
"docid": "2e40746a1a403f35c5f0fc442f0ac0f3",
"score": "0.5602128",
"text": "function middleInside( a, b ) {\n\n \tlet p = a,\n \t\tinside = false,\n \t\tpx = ( a.x + b.x ) / 2,\n \t\tpy = ( a.y + b.y ) / 2;\n \tdo {\n\n \t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n \t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n \t\t\tinside = ! inside;\n \t\tp = p.next;\n\n \t} while ( p !== a );\n\n \treturn inside;\n\n }",
"title": ""
},
{
"docid": "749677520310b0282f28ef4dff8f66d2",
"score": "0.5600727",
"text": "function checkBombsInSurroundings(square){\n console.log(\"checking for bombs around the original square\");\n \n if(square.posX >= 0 && square.posY-1 >= 0 && square.posX < BOARD_COLS && square.posY-1 < BOARD_ROWS){\n var top = getSquare(square.posX, (square.posY - 1));\n if(top.frame === 0){\n console.log(\"top\");\n var topbombs = checkBombs(top);\n clearSquare(top, topbombs);\n }\n }\n \n if(square.posX+1 >= 0 && square.posY >= 0 && square.posX+1 < BOARD_COLS && square.posY < BOARD_ROWS){\n var right = getSquare((square.posX + 1), square.posY);\n if(right.frame === 0){\n console.log(\"right\");\n var rightbombs = checkBombs(right);\n clearSquare(right, rightbombs);\n }\n }\n\n if(square.posX >= 0 && square.posY+1 >= 0 && square.posX < BOARD_COLS && square.posY+1 < BOARD_ROWS){\n var bottom = getSquare(square.posX, (square.posY + 1));\n if(bottom.frame === 0){\n console.log(\"bottom\");\n var bottombombs = checkBombs(bottom);\n clearSquare(bottom, bottombombs);\n }\n }\n \n if(square.posX-1 >= 0 && square.posY >= 0 && square.posX-1 < BOARD_COLS && square.posY < BOARD_ROWS){\n var left = getSquare((square.posX - 1), square.posY);\n if(left.frame === 0){\n console.log(\"left\");\n var leftbombs = checkBombs(left);\n clearSquare(left, leftbombs);\n }\n }\n\n if(square.posX-1 >= 0 && square.posY-1 >= 0 && square.posX-1 < BOARD_COLS && square.posY-1 < BOARD_ROWS){\n var topleft = getSquare((square.posX - 1), (square.posY - 1));\n if(topleft.frame === 0){\n console.log(\"topleft\");\n var topleftbombs = checkBombs(topleft);\n clearSquare(topleft, topleftbombs);\n }\n }\n if(square.posX+1 >= 0 && square.posY-1 >= 0 && square.posX+1 < BOARD_COLS && square.posY-1 < BOARD_ROWS){\n var topright = getSquare((square.posX + 1), (square.posY - 1));\n if(topright.frame === 0){\n console.log(\"topright\");\n var toprightbombs = checkBombs(topright);\n clearSquare(topright, toprightbombs);\n }\n\n }\n if(square.posX+1 >= 0 && square.posY+1 >= 0 && square.posX+1 < BOARD_COLS && square.posY+1 < BOARD_ROWS){\n var bottomright = getSquare((square.posX + 1), (square.posY + 1));\n if(bottomright.frame === 0){\n console.log(\"bottomright\");\n var bottomrightbombs = checkBombs(bottomright);\n clearSquare(bottomright, bottomrightbombs);\n }\n }\n if(square.posX-1 >= 0 && square.posY+1 >= 0 && square.posX-1 < BOARD_COLS && square.posY+1 < BOARD_ROWS){\n var bottomleft = getSquare((square.posX - 1), (square.posY + 1));\n if(bottomleft.frame === 0){\n console.log(\"bottomleft\");\n var bottomleftbombs = checkBombs(bottomleft);\n clearSquare(bottomleft, bottomleftbombs);\n }\n }\n}",
"title": ""
},
{
"docid": "775cb64a9c74f26746a4a347a302c31d",
"score": "0.5587132",
"text": "function checkSides(id)\r\n{\r\n\tvar color = document.getElementById(id).getAttribute(\"fill\");\r\n\tvar neighbours = getNeighbours(id);\r\n\tvar stones = document.getElementsByClassName(\"stone\");\r\n\tvar tracker = true;\r\n\tvar capture = false;\r\n\r\n\tfor (var i = 0; i < neighbours.length; i++)\r\n\t{\r\n\t\tif (neighbours[i] != null)\r\n\t\t\t// Check if the neighbour is of a different color\r\n\t\tif (neighbours[i].getAttribute(\"fill\") != color)\r\n\t\t\t\t// Check if the neighbour has been captured by the stone put on the goban\r\n\t\t\tif (isCaptured(neighbours[i].getAttribute(\"id\")))\r\n\t\t\t{\r\n\t\t\t\tfor (var j = 0; j < stones.length; j++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t// Check if a stone has been put on the position of the tracker\r\n\t\t\t\t\t\tif (stones[j].getAttribute(\"id\") == document.getElementsByClassName(\"tracker\")[0].getAttribute(\"id\"))\r\n\t\t\t\t\t\t\ttracker = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Check if there is a ko\r\n\t\t\t\t\tif (!ko(id))\r\n\t\t\t\t\t\tcapture = true;\r\n\t\t\t\t\t// Remove the captured stones from the goban\r\n\t\t\t\t\tif (!tracker)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Update the last ko\r\n\t\t\t\t\t\tif (marque.length == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpreviousKo[0] = id;\r\n\t\t\t\t\t\t\tpreviousKo[1] = marque[0];\r\n\t\t\t\t\t\t\tpreviousKo[2] = nbCoups;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpreviousKo[0] = \"\";\r\n\t\t\t\t\t\t\tpreviousKo[1] = \"\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfor (var k = 0; k < marque.length; k++)\r\n\t\t\t\t\t\t\tdocument.getElementById(\"goban\").removeChild(document.getElementById(marque[k]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tneighbours = getNeighbours(id);\r\n\t\t\t\tmarque = [];\r\n\t\t\t}\r\n\r\n\t\t\treturn capture;\r\n\t\t}",
"title": ""
},
{
"docid": "48f566d10c4f6a3731971222006e3655",
"score": "0.5582524",
"text": "function searchDiamond(type, typeAbove, typeBelow, meta, metaAbove, metaBelow) {\r\n if (!type){type = 0}\r\n\r\n var y = 0\r\n\r\n for (dist = 0; dist < 20; dist = dist+1) { // controls how many blocks out the diamond shape is\r\n for (x = -dist; x < dist+1; x = x+1) { // go across the diamond shape, one corner to the other\r\n for (modz = -1; modz < 2; modz = modz +2) { // switch from top to bottom side of diamond shape\r\n //~ if (x == 0 && modz == 1){break}\r\n\r\n block = bot.blockAt( bot.entity.position.offset( x, y, modz*(dist-Math.abs(x)) ) )\r\n blockBelow = bot.blockAt( bot.entity.position.offset( x, y-1, modz*(dist-Math.abs(x)) ) )\r\n blockAbove = bot.blockAt( bot.entity.position.offset( x, y+1, modz*(dist-Math.abs(x)) ) )\r\n //~ console.log(modx*x+\", \"+y+\", \"+modz*z+\" \"+block.type)\r\n\r\n if (block && type.indexOf(block.type) > -1 && (!typeAbove || (blockAbove && typeAbove && typeAbove.indexOf(blockAbove.type) > -1)) && (!typeBelow || (blockBelow && typeBelow && typeBelow.indexOf(blockBelow.type) > -1)) ) {\r\n if (!meta || (meta.indexOf(block.metadata) > -1 && (!metaAbove || (blockAbove && metaAbove && metaAbove.indexOf(blockAbove.metadata) > -1)) && (!metaBelow || (blockBelow && metaBelow && metaBelow.indexOf(blockBelow.metadata) > -1)) ) ) {\r\n console.log(\"+ Found! Block: \"+block.type+\":\"+block.metadata+\" Below: \"+blockBelow.type+\":\"+blockBelow.metadata+\" Top: \"+blockAbove.type+\":\"+blockAbove.metadata)\r\n return block\r\n }\r\n }\r\n\r\n } // for modZ\r\n } // for x\r\n } // dist\r\n return null\r\n} // searchDiamond",
"title": ""
},
{
"docid": "c059384c52677284761352318417c4ed",
"score": "0.55768675",
"text": "function playerHasHitBalloon(person, balloon){\n let index = balloonStore.indexOf(balloon);\n let personHitBox = generatePlayerHitBox(person);\n if(personHitBox.y < balloon.y + balloon.height && personHitBox.y > balloon.y + 25 && //Top of player has collided with bottom of balloon\n personHitBox.leftSide + 5.5 > balloon.x - 16.5 && personHitBox.rightSide - 5.5 < balloon.x + balloon.width + 16.5){\n person.velocityY *= -1;\n person.velocityX *= -1;\n removeBalloon(index);\n }else if(personHitBox.y < balloon.y - 40 && personHitBox.y + personHitBox.height > balloon.y &&\n personHitBox.leftSide + 5.5 > balloon.x - 16.5 && personHitBox.rightSide - 5.5 < balloon.x + balloon.width + 16.5){ //Bottom of player has collided with bottom of balloon\n person.velocityY *= -1;\n person.velocityX *= -1;\n removeBalloon(index);\n }else if(personHitBox.leftSide < balloon.x + balloon.width ){ //Collision between left of player & right of balloon\n person.velocityX *= -1;\n person.shouldSpin = true;\n removeBalloon(index);\n }else if(personHitBox.rightSide > balloon.x){ //Collision between right of player & left of balloon\n person.velocityX *= -1;\n person.shouldSpin = true;\n removeBalloon(index);\n }\n}",
"title": ""
},
{
"docid": "c392dc787d6e75ee36b8e44bd357a148",
"score": "0.55731463",
"text": "function allObstacle() {\n\tvar closetOb = -1;\n\tvar minD = 20000;\n\tfor (var i = 0; i < noObstacle; i++) {\n\t\tvar distance = Math.sqrt((obstacleX[i] - realX)*(obstacleX[i] - realX) + (obstacleY[i]- realY)*(obstacleY[i] - realY));\n\t\tif (distance < minD) {\n\t\t\tminD = distance;\n\t\t\tclosetOb = i;\n\t\t}\n\t}\n\tfuck = minD;\n\treturn closetOb;\n}",
"title": ""
},
{
"docid": "907617ffaeca7b442348c71600ee986d",
"score": "0.55706644",
"text": "function AABB(object1,object2)\n{\n if(object1.x + object1.radius + object2.radius > object2.x\n && object1.x < object2.x + object1.radius + object2.radius\n && object1.y + object1.radius + object2.radius > object2.y\n && object1.y < object2.y + object1.radius + object2.radius)\n {\n CheckCollision(object1,object2);\n return true;\n }\n return false;\n}",
"title": ""
},
{
"docid": "e545c6dc647dc633e6b35f18f6b0a107",
"score": "0.55578613",
"text": "function findConnectionPlace(counter, area, anchor, bound) {\r\n var index = 0, actualCheckedPosition, everyFree = false;\r\n // Search for a connection\r\n while (!everyFree) {\r\n // increase counter\r\n index++;\r\n // get the new position\r\n actualCheckedPosition = Math.round(calculateConectionPosition(anchor, index, 1) * 100) / 100;\r\n if (actualCheckedPosition < 0 || actualCheckedPosition > 100) {\r\n continue;\r\n }\r\n // For in and outgoing connections, checkt that the line doeas not cross the neighbouring\r\n var continueInCauseOfBorders = false;\r\n counter[area[0][0]][area[0][1]].forEach(function (element) {\r\n if (typeof element == \"string\") {\r\n // If there is a value with the s, then the new position schould be larger\r\n if (element.includes(\"s\")) {\r\n if (actualCheckedPosition <= parseInt(element.replace(\"s\", \"\"))) {\r\n continueInCauseOfBorders = true;\r\n }\r\n // If there is a value with the l, then the new position schould be smaller\r\n } else if (element.includes(\"l\")) {\r\n if (actualCheckedPosition >= parseInt(element.replace(\"l\", \"\"))) {\r\n continueInCauseOfBorders = true;\r\n }\r\n }\r\n }\r\n });\r\n // Continue if yes (can't call continue in foreach loop)\r\n if (continueInCauseOfBorders) {\r\n continue;\r\n }\r\n // Check if the position is not blocked\r\n everyFree = true;\r\n area.forEach(function (coordinates) {\r\n if ($.inArray(actualCheckedPosition, counter[coordinates[0]][coordinates[1]]) != -1) {\r\n everyFree = false;\r\n }\r\n });\r\n }\r\n // Correct for better rendering\r\n if (actualCheckedPosition == 0) {\r\n actualCheckedPosition = 0.5;\r\n } else if (actualCheckedPosition == 100) {\r\n actualCheckedPosition = 99.5;\r\n }\r\n // Return the result\r\n return actualCheckedPosition;\r\n}",
"title": ""
},
{
"docid": "087d0c7a31d9b5112cfa289f84a0c7dc",
"score": "0.5549321",
"text": "hiddenNow(spy) {\n let d = dist(this.x, this.y, spy.x, spy.y);\n // Check if theres an overlap btw the spies and the gadget\n if (d < this.radius + spy.radius) {\n spy.alpha = spy.alpha - 1;\n if (spy.alpha < 0) {\n spy.alpha = 0;\n }\n }\n }",
"title": ""
},
{
"docid": "d4e437b0b7a8bb76c1e2e0f44a6720dd",
"score": "0.5545787",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x)/2,\n py = (a.y + b.y)/2;\n do {\n if (((p.y>py) !== (p.next.y>py)) && (px<(p.next.x - p.x)*(py - p.y)/(p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n }",
"title": ""
},
{
"docid": "7e6293dc0edad814e899800a618088fe",
"score": "0.55379295",
"text": "function doublePoints(){\n if(userCar.x <= carOne.x + carOne.width\n &&userCar.x + userCar.width > carOne.x + carOne.width \n && userCar.y < carOne.y + carOne.height\n && userCar.y + userCar.height > carOne.y\n && carHit ===true ){\n rightBump()\n \n }else if(userCar.x + userCar.width >= carOne.x\n && userCar.x < carOne.x \n && userCar.y < carOne.y + carOne.height\n && userCar.y + userCar.height > carOne.y\n && carHit ===true){\n leftBump() \n }\n \n}",
"title": ""
},
{
"docid": "73dbda23c65ea5a5589dbd6628e5f7ac",
"score": "0.5536041",
"text": "constantsPoints(x,y){\n console.log(\"Does this Baloon:\", this);\n console.log(\"Contain this cordinates\", x,y);\n \n const xDiff = this.x-x;\n const yDiff = this.y-y;\n \n const distance = Math.sqrt (xDiff * xDiff + yDiff * yDiff);\n if(distance <= this.radius){\n \n return true;\n }\n \n return false\n }",
"title": ""
},
{
"docid": "77f5295a2d118e5a2ab23718a7f93775",
"score": "0.5535058",
"text": "collisionDetection(tabBricks) {\r\n\t\t//booleen qui est a true si la balle est dans un block\r\n let isCollision;\r\n\t\t//distance entre la balle et les bordures des blocks\r\n let distanceHaut, distanceBas, distanceGauche, distanceDroite;\r\n\r\n for(let i = 0; i < tabBricks.columnBricks; i++) {\r\n for(let j = 0; j < tabBricks.rowBricks; j++) {\r\n let brick = tabBricks.brick[i][j];\r\n\r\n\t\t\t\t//si le block a encore de la vie\r\n if (brick.status > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//calcul de coordonnées entre la balle et le block\r\n isCollision = (this.y + this.radius) >= brick.y && (this.y - this.radius) <= (brick.y + brick.height) &&\r\n (this.x + this.radius) >= brick.x && (this.x - this.radius) <= (brick.x + brick.width);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//calcul des distances entre les bords de la balle et les bords du block\r\n distanceHaut = Math.abs( (this.y + this.radius) - brick.y );\r\n distanceBas = Math.abs( (this.y - this.radius) - (brick.y + brick.height) );\r\n distanceGauche = Math.abs( (this.x + this.radius) - brick.x );\r\n distanceDroite = Math.abs( (this.x - this.radius) - (brick.x + brick.width) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//si une collision existe\r\n if (isCollision) {\r\n \t//si la balle touche la bordure du haut du block, ou la bordure du bas, alors la balle part en -speedY\r\n if (Math.min(distanceHaut, distanceBas, distanceGauche, distanceDroite) === distanceHaut ||\r\n Math.min(distanceHaut, distanceBas, distanceGauche, distanceDroite) === distanceBas) {\r\n this.speedY = -this.speedY;\r\n //sinon, elle touche les bordures gauche ou droite, elle doit partir en -speedX\r\n } else {\r\n this.speedX = -this.speedX;\r\n }\r\n \t\t//la brick perd de la vie\r\n brick.status--;\r\n }\r\n }\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "6df6922140b24851bb70b6bcf124b0e3",
"score": "0.55269194",
"text": "function searchLane(type, typeAbove, typeBelow, meta, metaAbove, metaBelow, orientation) {\r\n if (!type){type = 0}\r\n if (!orientation){orientation = 0}\r\n\r\n var y = 0\r\n\r\n for (z = 0; z < 20; z = z+1) {\r\n for (x = 0; x < z*4; x = x+1) {\r\n //~ console.log(x+\", \"+z)\r\n for (modx = -1; modx < 2; modx = modx +2) {\r\n if (x == 0 && modx == 1){break}\r\n for (modz = -1; modz < 2; modz = modz +2) {\r\n if (z == 0 && modz == 1){break}\r\n\r\n if (orientation == 0){\r\n block = bot.blockAt( bot.entity.position.offset( modx*x, y-0, modz*z) )\r\n blockBelow = bot.blockAt( bot.entity.position.offset( modx*x, y-1, modz*z) )\r\n blockAbove = bot.blockAt( bot.entity.position.offset( modx*x, y+1, modz*z) )\r\n } else { // this code switches the direction\r\n block = bot.blockAt( bot.entity.position.offset( modz*z, y-0, modx*x) )\r\n blockBelow = bot.blockAt( bot.entity.position.offset( modz*z, y-1, modx*x) )\r\n blockAbove = bot.blockAt( bot.entity.position.offset( modz*z, y+1, modx*x) )\r\n }\r\n //~ console.log(modx*x+\", \"+y+\", \"+modz*z+\" \"+block.type)\r\n\r\n if (block && type.indexOf(block.type) > -1 && (!typeAbove || (blockAbove && typeAbove && typeAbove.indexOf(blockAbove.type) > -1)) && (!typeBelow || (blockBelow && typeBelow && typeBelow.indexOf(blockBelow.type) > -1)) ) {\r\n if (!meta || (meta.indexOf(block.metadata) > -1 && (!metaAbove || (blockAbove && metaAbove && metaAbove.indexOf(blockAbove.metadata) > -1)) && (!metaBelow || (blockBelow && metaBelow && metaBelow.indexOf(blockBelow.metadata) > -1)) ) ) {\r\n console.log(\"+ Found! Block: \"+block.type+\":\"+block.metadata+\" Below: \"+blockBelow.type+\":\"+blockBelow.metadata+\" Top: \"+blockAbove.type+\":\"+blockAbove.metadata)\r\n return block\r\n }\r\n }\r\n\r\n } // for mody\r\n } // for modx\r\n } // for x\r\n } // for y\r\n return null\r\n} // searchLane",
"title": ""
},
{
"docid": "e2e27765f02aa4dff1a2cd292b112dc5",
"score": "0.5523465",
"text": "function areBoxesIntersectingDd(closed) {\n return (a, b) => {\n let [[ax0, ay0], [ax1, ay1]] = a;\n let [[bx0, by0], [bx1, by1]] = b;\n // If open then if both boxes have zero area then they are both \n // considered closed.\n /*if ((ax0 === ax1 || ay0 === ay1) && (bx0 === bx1 || by0 === by1)) {\n closed = true;\n }*/\n // Swap so smaller coordinate comes first\n if (ay0[1] > ay1[1] || ay0[1] === ay1[1] && ay0[0] > ay1[0]) {\n [ay0, ay1] = [ay1, ay0];\n }\n if (by0[1] > by1[1] || by0[1] === by1[1] && by0[0] > by1[0]) {\n [by0, by1] = [by1, by0];\n }\n if (ax0[1] > ax1[1] || ax0[1] === ax1[1] && ax0[0] > ax1[0]) {\n [ax0, ax1] = [ax1, ax0];\n }\n if (bx0[1] > bx1[1] || bx0[1] === bx1[1] && bx0[0] > bx1[0]) {\n [bx0, bx1] = [bx1, bx0];\n }\n return closed\n ? (\n //ax0 <= bx1 && ax1 >= bx0 && \n //by0 <= ay1 && by1 >= ay0\n (ax0[1] < bx1[1] || (ax0[1] === bx1[1] && ax0[0] <= bx1[0])) &&\n (ax1[1] > bx0[1] || (ax1[1] === bx0[1] && ax1[0] >= bx0[0])) &&\n (by0[1] < ay1[1] || (by0[1] === ay1[1] && by0[0] <= ay1[0])) &&\n (by1[1] > ay0[1] || (by1[1] === ay0[1] && by1[0] >= ay0[0])))\n : (\n //ax0 < bx1 && ax1 > bx0 && \n //by0 < ay1 && by1 > ay0\n (ax0[1] < bx1[1] || (ax0[1] === bx1[1] && ax0[0] < bx1[0])) &&\n (ax1[1] > bx0[1] || (ax1[1] === bx0[1] && ax1[0] > bx0[0])) &&\n (by0[1] < ay1[1] || (by0[1] === ay1[1] && by0[0] < ay1[0])) &&\n (by1[1] > ay0[1] || (by1[1] === ay0[1] && by1[0] > ay0[0])));\n };\n}",
"title": ""
},
{
"docid": "ec2946370aa749844252c24dc5952e23",
"score": "0.55164856",
"text": "contains(boid) {\n let pos = boid.pos;\n return (pos.x >= this.xMin && pos.x <= this.xMax &&\n \t\t\tpos.y >= this.yMin && pos.y <= this.yMax &&\n \t\t\tpos.z >= this.zMin && pos.z <= this.zMax);\n }",
"title": ""
},
{
"docid": "5f27d32419056cf612a5c57cb6521912",
"score": "0.5510223",
"text": "isPointInBoundary(x, y) {\n let flipperCoords = this.getFlipperCoords(Math.abs(x - this.props.xpos));\n\n if(flipperCoords.yBottom > y && y > flipperCoords.yTop\n && x > flipperCoords.minX && x < flipperCoords.maxX){\n return true;\n }\n\n return false;\n }",
"title": ""
},
{
"docid": "fb5fad9b98740b3041089ec82671baf3",
"score": "0.55082166",
"text": "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}",
"title": ""
},
{
"docid": "fb5fad9b98740b3041089ec82671baf3",
"score": "0.55082166",
"text": "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}",
"title": ""
},
{
"docid": "fb5fad9b98740b3041089ec82671baf3",
"score": "0.55082166",
"text": "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}",
"title": ""
},
{
"docid": "fb5fad9b98740b3041089ec82671baf3",
"score": "0.55082166",
"text": "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}",
"title": ""
},
{
"docid": "fb5fad9b98740b3041089ec82671baf3",
"score": "0.55082166",
"text": "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}",
"title": ""
},
{
"docid": "650d70d0bf9619a119e227bea0cdec47",
"score": "0.55081356",
"text": "function mouthOnOUT(x,y,sn){\n // Check if next block has sanke body or not \n for(o=1;o<sn.length;o++){\n if(sn[o][1] == x && sn[o][2] == y){ return true; }\n }\n // Check next block has wall or not \n if(wallX.length>0){\n for(o=0;o<wallX.length;o++){\n if(wallX[o] == x && wallY[o] == y){ return true; }\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "d5a8ecce1d35e4f4bb88db0cada4c913",
"score": "0.5500905",
"text": "function middleInside( a, b ) {\n\n \tvar p = a,\n \t\tinside = false,\n \t\tpx = ( a.x + b.x ) / 2,\n \t\tpy = ( a.y + b.y ) / 2;\n \tdo {\n\n \t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n \t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n \t\t\tinside = ! inside;\n \t\tp = p.next;\n\n \t} while ( p !== a );\n\n \treturn inside;\n\n }",
"title": ""
},
{
"docid": "cbf42ae31818be1b1d2497518c141bad",
"score": "0.54982805",
"text": "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t inside = !inside;\n\t p = p.next;\n\t } while (p !== a);\n\t\n\t return inside;\n\t}",
"title": ""
},
{
"docid": "1c05826e15e1f66f8546e5f0932d511d",
"score": "0.54956126",
"text": "distanceBetweenPerceived(b) {\n let dist = Phaser.Math.Distance.Between(this.body.x, this.body.y, b.x, b.y)\n return dist < this.perception\n }",
"title": ""
},
{
"docid": "5eaa354e5f6bff6761a0b6e5a694ec3f",
"score": "0.5487458",
"text": "contains(boid) {\n let pos = boid.pos;\n return (pos.x >= this.xMin && pos.x <= this.xMax &&\n pos.y >= this.yMin && pos.y <= this.yMax &&\n pos.z >= this.zMin && pos.z <= this.zMax);\n }",
"title": ""
},
{
"docid": "5ab060b4d36d7943ed86ffa98fc5b87e",
"score": "0.548572",
"text": "isIntersecting(_molecule) {\r\n //console.log(\"Testing\");\r\n\r\n let distance = dist(this.position.x, this.position.y, _molecule.position.x, _molecule.position.y);\r\n let gap = distance - this.radius - _molecule.radius;\r\n let check = (gap <= 0) ? true : false;\r\n\r\n let dx = this.position.x - _molecule.position.x;\r\n let dy = this.position.y - _molecule.position.y;\r\n //let dist = Math.sqrt(dx * dx + dy * dy);\r\n if (check) {\r\n let normalX = dx / distance;\r\n let normalY = dy / distance;\r\n\r\n\r\n\r\n let dVector = (this.velocity.x - _molecule.velocity.x) * normalX;\r\n dVector += (this.velocity.y - _molecule.velocity.y) * normalY;\r\n\r\n let dvx = dVector * normalX ;\r\n let dvy = dVector * normalY ;\r\n\r\n this.velocity.x -= dvx;\r\n this.velocity.y -= dvy;\r\n\r\n _molecule.velocity.x += dvx;\r\n _molecule.velocity.y += dvy;\r\n }\r\n return check;\r\n }",
"title": ""
},
{
"docid": "6e62f30debbae455758ec68077bcdb99",
"score": "0.5483292",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}",
"title": ""
},
{
"docid": "552e0dd794e99b3f7ffae9ad0948d9d9",
"score": "0.54830843",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n }",
"title": ""
},
{
"docid": "552e0dd794e99b3f7ffae9ad0948d9d9",
"score": "0.54830843",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n }",
"title": ""
},
{
"docid": "5d09cf5c1838dd280d6cfb64c26624a3",
"score": "0.5469485",
"text": "function hitTest() {\n var dartPos = $dart.position();\n var tipLeft = dartPos.left + 15,\n tipRight = tipLeft + 16,\n tipTop = dartPos.top,\n dartHeight = 100,\n bWidth = 66, // back balloon\n bHeight = 76,\n mWidth = 93, // mid balloon\n mHeight = 109,\n fWidth = 128, // fore balloon\n fHeight = 147;\n\n // > dart.left + 15 && < dart.left + 31\n\n // console.log(dartPos.left);\n // console.log(dartPos.top);\n\n // if ($('.blue-balloon').length > 0) {\n // $('.blue-balloon').each(function(){\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + bWidth\n // && tipTop > $this.position().top + bHeight\n // && tipTop < $this.position().top) {\n // console.log('blue collision');\n // }\n // });\n // }\n // if ($('.red-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + bWidth\n // && tipTop > $this.position().top + bHeight\n // && tipTop < $this.position().top) {\n // console.log('red collision');\n // }\n // }\n\n // if ($('.orange-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + mWidth\n // && tipTop > $this.position().top + mHeight\n // && tipTop < $this.position().top) {\n // console.log('orange collision');\n // }\n // }\n // if ($('.purple-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + mWidth\n // && tipTop > $this.position().top + mHeight\n // && tipTop < $this.position().top) {\n // console.log('purple collision');\n // }\n // }\n // if ($('.pink-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + mWidth\n // && tipTop > $this.position().top + mHeight\n // && tipTop < $this.position().top) {\n // console.log('pink collision');\n // }\n // }\n\n // if ($('.yellow-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + fWidth\n // && tipTop > $this.position().top + fHeight\n // && tipTop < $this.position().top) {\n // console.log('yellow collision');\n // }\n // }\n // if ($('.green-balloon').length > 0) {\n // var $this = $(this);\n // if (tipLeft > $this.position().left\n // && tipLeft < $this.position().left + fWidth\n // && tipTop > $this.position().top + fHeight\n // && tipTop < $this.position().top) {\n // console.log('green collision');\n // }\n // }\n\n}",
"title": ""
},
{
"docid": "162692e80cb12eac7c86eab1b15d19bb",
"score": "0.54681003",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (p.y > py !== p.next.y > py && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}",
"title": ""
},
{
"docid": "c3063487dfd9126690bd1551cc5a4fc0",
"score": "0.5467134",
"text": "breakBlocks(pill){\n let { elements, virusOnMap, brokenViruses } = gameField; \n let cordinates = [];\n let markBlocks = (row, column)=>{\n let sameColorHorizontal = [];\n let sameColorVertical = [];\n\n for(let i = 0; i+row<config.rows+1; i++){\n if(elements[row][column].color != elements[row+i][column].color) break;\n sameColorVertical.push([row+i,column]);\n }\n for(let i = -1; row+i>=1; i--){\n if(elements[row][column].color != elements[row+i][column].color) break;\n sameColorVertical.push([row+i,column]);\n }\n\n for(let i = 0; column+i>=0; i--){\n if(elements[row][column].color != elements[row][column+i].color) break;\n sameColorHorizontal.push([row,column+i]);\n }\n for(let i = 1; i+column<config.columns; i++){\n if(elements[row][column].color != elements[row][column+i].color) break;\n sameColorHorizontal.push([row,column+i]);\n }\n if(sameColorVertical.length>=4 && sameColorHorizontal.length>=4){\n return sameColorVertical.concat(sameColorHorizontal);\n }else if (sameColorVertical.length>=4){\n return sameColorVertical;\n }else if (sameColorHorizontal.length>=4){\n return sameColorHorizontal;\n }else{\n return false;\n }\n }\n let breakBlock = function(cordinate){\n //checkes is virus on cords\n let virusColor;\n let virus = gameField.virusOnMap.find(i=>{\n if(i.row==cordinate[0] && i.column==cordinate[1]) return true;\n });\n //if yes changes element background to broken virus and delete virus from array \n if(virus!=undefined){\n elements[cordinate[0]][cordinate[1]].elementDiv.style.backgroundImage = `url('gfx/game-elements/${elements[cordinate[0]][cordinate[1]].color}_x.png')` \n virusOnMap.splice(virusOnMap.indexOf(virus),1);\n //updates interface\n document.getElementById(\"virus-amount\").innerText=virusOnMap.length;\n gameField.brokenViruses++;\n virusColor = virus.color;\n }\n //else changes element background to broken pill\n else{\n \n if(elements[cordinate[0]][cordinate[1]].color!=undefined){\n elements[cordinate[0]][cordinate[1]].elementDiv.style.backgroundImage = `url('gfx/game-elements/${elements[cordinate[0]][cordinate[1]].color}_o.png')`\n }\n }\n elements[cordinate[0]][cordinate[1]].color = null;\n elements[cordinate[0]][cordinate[1]].empty = true; \n //after few seconds element's background empty\n setTimeout(function(){elements[cordinate[0]][cordinate[1]].elementDiv.style.backgroundImage = null},50);\n //finds which pill is breaking\n let breakingPill = gameField.pillsOnMap.find(i => (i.row.includes(cordinate[0])&&i.column.includes(cordinate[1])));\n if(breakingPill!=undefined){\n //updates pill properties with new cords, colors and direction \n if(breakingPill.direction==\"vertical\"){\n let index = breakingPill.row.indexOf(cordinate[0])\n breakingPill.row.splice(index, 1);\n breakingPill.colors.splice(index, 1);\n }else{\n let index = breakingPill.column.indexOf(cordinate[1])\n breakingPill.column.splice(index, 1); \n breakingPill.colors.splice(index, 1);\n }\n breakingPill.direction=\"dot\";\n if(!(breakingPill.row.length==0 || breakingPill.column.length==0)){//if pill isnt complitly deleted generate it on map\n gameField.changePillElementsColor(breakingPill, false);\n }else{\n gameField.pillsOnMap.splice(gameField.pillsOnMap.indexOf(breakingPill),1); //else delete it from array\n }\n }\n return virusColor;\n } \n if(pill.direction==\"vertical\"){ \n pill.row.forEach(item => cordinates.push(markBlocks(item, pill.column[0])));\n }else if(pill.direction==\"horizontal\"){ \n\n pill.column.forEach(item => cordinates.push(markBlocks(pill.row[0], item))); \n }else if(pill.direction==\"dot\"){\n cordinates.push(markBlocks(pill.row[0], pill.column[0])); \n }\n let virusesColors = [];\n cordinates = cordinates.flat();\n if(cordinates.find(i => i!=false)){\n cordinates.forEach(cordinate =>{\n if(cordinate!=false){\n virusesColors.push(breakBlock(cordinate));\n }\n });\n gameInterface.startLoupeInterval(virusesColors);\n gameInterface.changeCurrentScore();\n return true;\n }else{\n return false;\n }\n \n }",
"title": ""
},
{
"docid": "92f473330a41696a75b5521e1f5292fe",
"score": "0.54516876",
"text": "function DetectedTheBestayBetweenPOIs()\n{\n var POIMarkersCount = POIMarker.length;\n var whichPOItoStart = 60;\n var firstMarker;\n // selecting current poi\n for (var i =0;i<POIMarkersCount;i++)\n {\n if (POIMarker[i].ID == whichPOItoStart)\n {\n firstMarker = POIMarker[i];\n // break;\n }\n }\n // the first poi was selected\n POITempTwoLatLngArray = new Array();\n var drn = new GDirections();\n\n GEvent.addListener(drn , \"load\", function(){\n \n var ds =drn.getDistance().meters;\n alert(ds.toString());\n \n });\n\n\n // for (var i =0;i<POIMarkersCount;i++)\n for (var i =0;i<2;i++)\n {\n // POITempTwoLatLngArray.length = 0;\n \n // if (POIMarker[i].ID != whichPOItoStart) // it means plz do not check ur self .\n {\n POITempTwoLatLngArray.push(POIMarker[i].getLatLng().lat().toString()+\",\"+POIMarker[i].getLatLng().lng().toString());\n }\n }\n\n drn.loadFromWaypoints(POITempTwoLatLngArray);\n\n\n}",
"title": ""
},
{
"docid": "625c7ab08e410fb8178e9b347c9bd9a7",
"score": "0.54419935",
"text": "findPointOnLineAwayEnd(distance)\n {\n\n }",
"title": ""
},
{
"docid": "39a5b6cc9a7b2cca2db7889542ff8d8f",
"score": "0.54392445",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n }",
"title": ""
},
{
"docid": "39a5b6cc9a7b2cca2db7889542ff8d8f",
"score": "0.54392445",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n }",
"title": ""
},
{
"docid": "05e4327ea63844423a4ed67a4995c277",
"score": "0.54350847",
"text": "function cohesion(boids, boid) {\n const [count, direction] = boids.reduce(\n ([count, direction], otherBoid) => {\n const d = Vector.dist(boid.position, otherBoid.position);\n return d > 0 && d < CONFIG.neighbourDist\n ? [count + 1, direction.add(otherBoid.position)]\n : [count, direction];\n },\n [0, new Vector(0, 0, 0)]\n );\n\n if (count > 0) {\n direction.div(count);\n return seek(direction, boid);\n } else {\n return direction;\n }\n}",
"title": ""
},
{
"docid": "645fca78f30f03e2bd8b1d21d3ca6110",
"score": "0.5433172",
"text": "subdivide(){\n // obtenemos los valores de nuestro primer rectangulo o nuestro primer marco o la Raiz.\n let x = this.boundary.x;\n let y = this.boundary.y;\n let w = this.boundary.w;\n let h = this.boundary.h;\n // Procedemos dividir en 4 partes dicho rectangulo\n let ne = new Rectangle(x + w/2, y - h/2, w/2, h/2 );\n // Creamos para cada uno de estos su nuevo sub arbol.\n this.northeast = new QuadTree(ne, this.capacity);\n let nw = new Rectangle(x - w/2, y - h/2, w/2, h/2 );\n this.northwest = new QuadTree(nw , this.capacity);\n let se = new Rectangle(x + w/2, y + h/2, w/2, h/2 );\n this.southeast = new QuadTree(se, this.capacity); \n let sw = new Rectangle(x - w/2, y + h/2, w/2, h/2 );\n this.southwest = new QuadTree(sw , this.capacity);\n // Cuando hacemos la division del arbol, necesitamos no dejar a un hijo como padre\n // se debe reordenar para que el punto medio sea el padre y se agregue los puntos unicamente en las hojase\n // recorremos todos los indices que de nuestra lista que tiene como maximo a capacity \n for(let i = 0 ; i < this.points.length;i++){\n let p = this.points[i];\n // comprobamos si tanto este punto como el que vamos a ingresar pertenecen a dicho lado del rectangulo\n // si es si, se elimina dicho nodo que tomara la posicion a nuevo padre y colocamos en su lugar al punto medio\n // una vez verificado agregamos ese nodo eliminado como nuevo hijo y termina la division.\n if(ne.contains(p)){\n //let punto_medio = new Point(x + w/2,y - h/2);\n this.points.splice(i,1);\n this.northeast.insert(p);\n } else if(nw.contains(p)){\n //let punto_medio = new Point(x - w/2,y - h/2);\n this.points.splice(i,1);\n this.northwest.insert(p);\n } else if(se.contains(p)){\n //let punto_medio = new Point(x + w/2,y + h/2);\n this.points.splice(i,1);\n this.southeast.insert(p);\n } else if(sw.contains(p)){\n //let punto_medio = new Point(x - w/2, y + h/2);\n this.points.splice(i,1);\n this.southwest.insert(p);\n }\n }\n this.divided = true;\n }",
"title": ""
},
{
"docid": "125ab4b7bc0843fda0766601451af28e",
"score": "0.5430235",
"text": "function can_stand( c ){\n if(c.cy >= Game.map_grid.height - 3){return 1}\n var cells = get_baseline_cells( c )\n //console.log( c.x, c.y , cells );\n\n if( c.lift ) return 1;\n for (var i=0; i< cells.length; i++) {\n var p = cells[i];\n\n //console.log('THIS:',map[ p.y-1 ][ p.x ], 'ON:', map[ p.y ][ p.x ]);\n if( ! (c.y % c.h) ){\n //base line\n if( b_stand[ map[ p.y ][ p.x ] ] ){\n return 1;\n }\n //current line\n if( b_grab[ map[ p.y-1 ][ p.x ] ] ){\n return 1;\n }\n if(c.enemy && b_hole[ map[ p.y - 1 ][ p.x ] ]){\n return 1;\n }\n }\n if( b_climb[ map[ p.y ][ p.x ] ] ){\n //return 1;\n }\n if( b_climb[ map[ p.y-1 ][ p.x ] ] ){\n return 1;\n }\n }\n return 0\n}",
"title": ""
},
{
"docid": "e59ab0697cd29db8f7a49eb3d8883e3c",
"score": "0.5427024",
"text": "function lineInCoordinatesBlocked(coordinates,sourceLeft,sourceTop,targetLeft,targetTop){if(sourceLeft==targetLeft){// check column (target is above. every time!)\nfor(var i in coordinates){if(coordinates[i].left==sourceLeft&&sourceTop>coordinates[i].top&&targetTop<coordinates[i].top){return true;}}}else if(sourceTop==targetTop&&sourceLeft>targetLeft){// check row to the left\nfor(var j in coordinates){if(coordinates[j].top==sourceTop&&sourceLeft>coordinates[j].left&&targetLeft<coordinates[j].left){return true;}}}else if(sourceTop==targetTop&&sourceLeft<targetLeft){// check row to the right\nfor(var k in coordinates){if(coordinates[k].top==sourceTop&&sourceLeft<coordinates[k].left&&targetLeft>coordinates[k].left){return true;}}}return false;}",
"title": ""
},
{
"docid": "fb33d6ddacf55d226681416651469b2a",
"score": "0.5418858",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}",
"title": ""
},
{
"docid": "fb33d6ddacf55d226681416651469b2a",
"score": "0.5418858",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}",
"title": ""
},
{
"docid": "fb33d6ddacf55d226681416651469b2a",
"score": "0.5418858",
"text": "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}",
"title": ""
}
] |
76ac61a6d3650b6b605aa89a1bb6513a | Check if a string starts with $ or _ | [
{
"docid": "594f5ff9dec6fc75a881276c681c41f6",
"score": "0.0",
"text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}",
"title": ""
}
] | [
{
"docid": "fd6d628e3d23a6fe0d02840714e0b552",
"score": "0.6486106",
"text": "function spaceCheck(string) {\n if (string.match(\"_\") == null){\n return false;\n } else { return true; }\n }",
"title": ""
},
{
"docid": "f58537285afbf01a0e35aee2b922273c",
"score": "0.6444922",
"text": "function string_startswith(str, pref) { // missing library routines\n return (str.slice(0, pref.length) == pref);\n}",
"title": ""
},
{
"docid": "e34bdd3a59970e86aef378fe4bea867b",
"score": "0.6266306",
"text": "function string_starts_with(st, prefix) {\n return st.slice(0, prefix.length) === prefix;\n}",
"title": ""
},
{
"docid": "ac032fd5ff92aa496ceb67ea47be7699",
"score": "0.6263018",
"text": "function isReserved(str) {\n // '$' (charCode) 0x24\n // '_' (charCode) 0x5F\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}",
"title": ""
},
{
"docid": "112c0de421cae1e78d2272c130e3f730",
"score": "0.6188291",
"text": "function isValidVariable (v) {\n if(v.indexOf('$') > -1 || v.indexOf('_') > -1) {\n return 'Is not valid variable';\n } else {\n return 'Is valid';\n }\n}",
"title": ""
},
{
"docid": "856db8f9a6ebb5a8bbb084a730f5c52c",
"score": "0.61346537",
"text": "function checkUnderscore_b(t){\n return (t.match(/_/g) || []).length >= 2\n }",
"title": ""
},
{
"docid": "7602e5260b86e0124f16e65c5a33cecb",
"score": "0.60577387",
"text": "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}",
"title": ""
},
{
"docid": "698c470c5db2422b434ca48f4e8dcacb",
"score": "0.60311985",
"text": "function startsWith(str, pref) {\n 'use strict';\n return str.slice(0, pref.length) === pref;\n}",
"title": ""
},
{
"docid": "79a1091b50a18eb76ea28411926e9d25",
"score": "0.60277617",
"text": "function startsWith(str,sub) {\r\n return str.indexOf(sub) !== -1;\r\n}",
"title": ""
},
{
"docid": "a7915df2643ff2a2c33e727258d64453",
"score": "0.60028845",
"text": "function isValidVariable(v) {\n let myReg = /^[a-z_$]+[^\\d-]/;\n let res = v.match(myReg);\n return res != null && res[0].length == v.length ? true : false;\n}",
"title": ""
},
{
"docid": "1b2a691726e9ad01cfa85721ebf10279",
"score": "0.5994013",
"text": "function isPrefix(prefix) {\r\n return /^([0-9A-F]{2}[:-]){2}([0-9A-F]{2})$/i.test(prefix);\r\n}",
"title": ""
},
{
"docid": "7210b0d0e5479634994aceb36c99c95c",
"score": "0.59934086",
"text": "function startsWith(str, prefix) {\n return str.indexOf(prefix) === 0;\n}",
"title": ""
},
{
"docid": "511d70220ae3cd4dad5bd224b5ce922b",
"score": "0.5951236",
"text": "function checkLetters(letter) {\n return letter !== ' _ ';\n}",
"title": ""
},
{
"docid": "169dcc4c8e9903ee286e62e979d2fba9",
"score": "0.5932871",
"text": "isValid(str) {\n return /[^.#$[\\]]/.test(str);\n }",
"title": ""
},
{
"docid": "cf5557aed39bbc66b683c810bf562aab",
"score": "0.592764",
"text": "function isIdentifierStart(ch) {\n\t\t return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n\t\t (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n\t\t ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n\t\t }",
"title": ""
},
{
"docid": "b31ebb6323c818712a52ef27a1d3bba3",
"score": "0.5924016",
"text": "function startsWith(str, prefix) {\n return (str.indexOf(prefix) === 0);\n }",
"title": ""
},
{
"docid": "3dbeca5b0e0600cc6b491740faee4361",
"score": "0.5909703",
"text": "function isIdentifierStart(ch) {\n return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n }",
"title": ""
},
{
"docid": "3dbeca5b0e0600cc6b491740faee4361",
"score": "0.5909703",
"text": "function isIdentifierStart(ch) {\n return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n }",
"title": ""
},
{
"docid": "3dbeca5b0e0600cc6b491740faee4361",
"score": "0.5909703",
"text": "function isIdentifierStart(ch) {\n return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n }",
"title": ""
},
{
"docid": "3dbeca5b0e0600cc6b491740faee4361",
"score": "0.5909703",
"text": "function isIdentifierStart(ch) {\n return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n }",
"title": ""
},
{
"docid": "3dbeca5b0e0600cc6b491740faee4361",
"score": "0.5909703",
"text": "function isIdentifierStart(ch) {\n return (ch === '$') || (ch === '_') || (ch === '\\\\') ||\n (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||\n ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));\n }",
"title": ""
},
{
"docid": "0f7dca209fe22507a50b2325fc3f6ee1",
"score": "0.5892067",
"text": "function startsWith(str, start) {\n return str.lastIndexOf(start, 0) === 0;\n}",
"title": ""
},
{
"docid": "648359e4f463d5072be7ef9e4dd13e58",
"score": "0.58566487",
"text": "function isCSSVariable$1(key) {\n return key.startsWith(\"--\");\n}",
"title": ""
},
{
"docid": "582e34ed17fe3b371d343f9846a060e0",
"score": "0.58181906",
"text": "get PATTERN_NAMESPACE_LEVEL_START() {return /^[_a-z\\$][\\w\\$]*$/i;}",
"title": ""
},
{
"docid": "582e34ed17fe3b371d343f9846a060e0",
"score": "0.58181906",
"text": "get PATTERN_NAMESPACE_LEVEL_START() {return /^[_a-z\\$][\\w\\$]*$/i;}",
"title": ""
},
{
"docid": "0731302ffcacddbdcd45169f9ae49c81",
"score": "0.58167386",
"text": "function u(e){// $ (dollar) and _ (underscore)\n// A..Z\n// a..z\n// \\ (backslash)\nreturn 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&Qt.NonAsciiIdentifierStart.test(String.fromCharCode(e))}",
"title": ""
},
{
"docid": "329fcd54d8864bab3d60b30277da64a9",
"score": "0.5804977",
"text": "function testStartsWithExclaimMarks(str) {\n return /^!+/.test(str);\n }",
"title": ""
},
{
"docid": "e53e1e3d06e9a3591be424c1d07f2c0a",
"score": "0.5804068",
"text": "function startsWith(str, prefix) {\n str = toString(str);\n prefix = toString(prefix);\n\n return str.indexOf(prefix) === 0;\n }",
"title": ""
},
{
"docid": "08d621726831b17c2729daa89f6079bf",
"score": "0.5789298",
"text": "match(prefix) {\n\t\treturn utils.isString(prefix) && this.hasValue() && `${this.value}`.toLowerCase().includes(prefix);\n\t}",
"title": ""
},
{
"docid": "0bbbf3e2bc16074aa165b0fa9904f007",
"score": "0.5786785",
"text": "function validateName(name) { // Name Validation ---------------------------------\n var nameRegex = /^[$A-Z_][0-9A-Z_$]*$/i;\n return nameRegex.test(name);\n}",
"title": ""
},
{
"docid": "aea0e39d52a808c6ea92e1f17912e1f2",
"score": "0.5785932",
"text": "function s(e){// a..z\n// A..Z\n// $ (dollar) and _ (underscore)\n// \\ (backslash)\nreturn e>=97&&122>=e||e>=65&&90>=e||36===e||95===e||92===e||e>=128&&u.NonAsciiIdentifierStart.test(String.fromCharCode(e))}",
"title": ""
},
{
"docid": "6fe1f8e36f2c2edec2cd884000bdb406",
"score": "0.57838964",
"text": "function verify(str) {\n return str.match(/^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$/);\n}",
"title": ""
},
{
"docid": "55908eb5bbd559db42cfbab6e3782925",
"score": "0.57678795",
"text": "function is_string_an_identifier(a_string){\n let the_regex = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/\n return the_regex.test(a_string)\n}",
"title": ""
},
{
"docid": "67bcf85a9085f7ba8947cfb574b03875",
"score": "0.574532",
"text": "isPrefix(prefix, string){\n\t\treturn string.toUpperCase().substring(0, prefix.length) === prefix.toUpperCase();\n\t}",
"title": ""
},
{
"docid": "030f494b298da0d5cde1928aa01b06b8",
"score": "0.5740042",
"text": "function nameTest (name) {\n return /\\w/.test(name);\n}",
"title": ""
},
{
"docid": "8ce5b86fd2d4c476e8430bb606535d41",
"score": "0.5732392",
"text": "function isValidBeforeDatabase(string){\n\t\tif((/[\\$:\\{\\}]/g).test(string)) return false;\n\t\telse return true;\n\t}",
"title": ""
},
{
"docid": "ad9f10ae3d765db28ec59154c1615429",
"score": "0.5719976",
"text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}",
"title": ""
},
{
"docid": "ad9f10ae3d765db28ec59154c1615429",
"score": "0.5719976",
"text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}",
"title": ""
},
{
"docid": "ad9f10ae3d765db28ec59154c1615429",
"score": "0.5719976",
"text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}",
"title": ""
},
{
"docid": "ad9f10ae3d765db28ec59154c1615429",
"score": "0.5719976",
"text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}",
"title": ""
},
{
"docid": "ad9f10ae3d765db28ec59154c1615429",
"score": "0.5719976",
"text": "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}",
"title": ""
},
{
"docid": "6b60bf5b00d872da46fd4f55d5216750",
"score": "0.5705387",
"text": "function startsWith( src, str ) {\n return src.slice( 0, str.length ) === str\n }",
"title": ""
},
{
"docid": "170dd1d2f0d349818a97ded208c2d788",
"score": "0.57050693",
"text": "function isItContainOnlyLetters(string){\r\n if(/^[a-z]+$/i.test(string)){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"title": ""
},
{
"docid": "36c7e11e1568637e6f828d00f91d5631",
"score": "0.5694883",
"text": "function isCSSVariable(key) {\n return key.startsWith(\"--\");\n}",
"title": ""
},
{
"docid": "36c7e11e1568637e6f828d00f91d5631",
"score": "0.5694883",
"text": "function isCSSVariable(key) {\n return key.startsWith(\"--\");\n}",
"title": ""
},
{
"docid": "4538b92909a5f2962c13babdee71083e",
"score": "0.56932026",
"text": "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }",
"title": ""
},
{
"docid": "f3c0337ca2c8c49d54f81e44233fffc1",
"score": "0.56890464",
"text": "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}",
"title": ""
},
{
"docid": "1f56436f259dbe5b5ec1138b2c6fb82a",
"score": "0.5687701",
"text": "function checkUsernameChars(string) {\n var regex = /^[a-zA-Z0-9_.-]*$/;\n if (string.match(regex))\n return (1);\n else\n return (0);\n}",
"title": ""
},
{
"docid": "d70061451ee3c465b42a2363b4baff94",
"score": "0.5677609",
"text": "checkLetter(letter) {\n const phrase = this.phrase.split(''); \n if (phrase.includes(letter)) {\n return true;\n } else {\n return false;\n }\n }",
"title": ""
},
{
"docid": "dd7aa6eedb70d12bdcfd41a2ef776a60",
"score": "0.5671461",
"text": "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}",
"title": ""
},
{
"docid": "041731d21b810fbf7299f1bee8132009",
"score": "0.5661289",
"text": "function isIdentifierStart(ch) {\n return ch === 0x24 || ch === 0x5F || // $ (dollar) and _ (underscore)\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch === 0x5C || // \\ (backslash)\n ch >= 0x80 && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch));\n }",
"title": ""
},
{
"docid": "59fd01b2223c18b848da745fd9c7926d",
"score": "0.56562984",
"text": "function stringStartsWith(string, startsWith) {\n if (startsWith.length > string.length) {\n return false;\n }\n return string.substring(0, startsWith.length) === startsWith;\n }",
"title": ""
},
{
"docid": "d24388f5fba82cf13121d42e475e9606",
"score": "0.56452405",
"text": "function variableName(name) {\n return /^[a-z_]\\w*$/i.test(name);\n}",
"title": ""
},
{
"docid": "73deb02a30b1737d07daeb1cb7fc9b03",
"score": "0.5636262",
"text": "function startsWith(str, text) {\n return str.slice(0, text.length) == text;\n}",
"title": ""
},
{
"docid": "0fbca60c15d77ebee650a0c08eb951a7",
"score": "0.5633984",
"text": "function startsWith(src, str) {\n return src.slice(0, str.length) === str\n}",
"title": ""
},
{
"docid": "a79d0c3f803716b8d76f7090082cedcc",
"score": "0.5627536",
"text": "checkLetter(letter) {\n if (this.phrase.indexOf(letter) != -1) {\n return true;\n } else {\n return false;\n }\n }",
"title": ""
},
{
"docid": "9cff68360886cdb3fad1bd41751d8985",
"score": "0.56245124",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122); // a..z\n }",
"title": ""
},
{
"docid": "d2f622a3e07eb7f23d232ba14b6211fc",
"score": "0.55975956",
"text": "function fullnameCheck(fullname) {\n const getName = /^[a-z][a-z\\s]*$ | [a-zA-Z ]*$/\n return getName.test(String(fullname).toLowerCase()); \n}",
"title": ""
},
{
"docid": "493a33baaa6cdbcbab1a9d87d28721b2",
"score": "0.55941916",
"text": "function stringBeginsWith(fullString, prefixToCompare) {\n \treturn (fullString.indexOf(prefixToCompare) === 0);\n }",
"title": ""
},
{
"docid": "540e23b701b3dc0e75d344d5bd2fff43",
"score": "0.55748355",
"text": "function validFieldName(s) {\n return s.replace(/[\\ \\.]/g, '_')\n}",
"title": ""
},
{
"docid": "0f7779aab2b07eaad1b3f47cfdaa0d11",
"score": "0.55671257",
"text": "function isClientName(clientName) {\n var regex = /^[\\w\\-'_\\s]{1,50}$/;\n return regex.test(clientName);\n }",
"title": ""
},
{
"docid": "2f5df5eea0b377be890593bc938118c0",
"score": "0.55649287",
"text": "get PATTERN_NAMESPACE_LEVEL() {return /^[\\w\\$]+$/;}",
"title": ""
},
{
"docid": "2f5df5eea0b377be890593bc938118c0",
"score": "0.55649287",
"text": "get PATTERN_NAMESPACE_LEVEL() {return /^[\\w\\$]+$/;}",
"title": ""
},
{
"docid": "2eea9649e3f3cdef87648f5f84937790",
"score": "0.55632615",
"text": "isHack(all, unprefixed) {\n let check = new RegExp(`(\\\\(|\\\\s)${utils$b.escapeRegexp(unprefixed)}:`);\n return !check.test(all)\n }",
"title": ""
},
{
"docid": "0336e76e3ce949b5e2aca68da4169bbc",
"score": "0.55589294",
"text": "function CodelandUsernameValidation(str) { \n const exp = /^[a-zA-Z][a-zA-Z0-9_]*[^_]$/\n return str.length >= 4 && str.length <= 25 && exp.test(str)\n \n }",
"title": ""
},
{
"docid": "934b8162ea76b10a3b25cb0274b91f7e",
"score": "0.5557755",
"text": "function usernameValidation(str) {\n let strArray = str.split(\"\");\n lenghtOfStr = str.lenght;\n let letterNumber = /^[0-9a-zA-Z_]+$/;\n if (lenghtOfStr < 4 || lenghtOfStr > 25) {\n console.log(1);\n return false;\n }\n if (!/[a-zA-Z]/.test(strArray[0])) {\n console.log(2);\n return false;\n }\n\n if (!str.match(letterNumber)) {\n console.log(3);\n return false;\n }\n if (strArray[lenghtOfStr - 1] == \"_\") {\n console.log(4);\n return false;\n }\n\n return true;\n}",
"title": ""
},
{
"docid": "d02a79db2ad7aab6554e137858005741",
"score": "0.554998",
"text": "function checkFor(str) {\n return str.includes(\"sale\") || str.toLowerCase().includes(\"spam\");\n}",
"title": ""
},
{
"docid": "7bf2db8ba0f0f7f733957e7ba3c7d76b",
"score": "0.5543164",
"text": "function testThisString(inputString) {\n return startsWith.toLowerCase() === inputString.toLowerCase().split(\"\")[0];\n }",
"title": ""
},
{
"docid": "a60b69dd7e2cee743abfbea59b08ad5a",
"score": "0.55399877",
"text": "function underscore(string) {\n return string ? trim(string + '').replace(RegExpNonAlphaNum, '_') : '';\n }",
"title": ""
},
{
"docid": "db62489f905b74937536520c45c6f806",
"score": "0.55325687",
"text": "function startsWith(/* text to check */ text, /* start string */str) {\n return (text.indexOf(str) === 0);\n}",
"title": ""
},
{
"docid": "06a18763c68e13b72a15b69b00ce0650",
"score": "0.55291235",
"text": "function isIdentifierStart(ch) {\n\t return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n\t (ch >= 0x41 && ch <= 0x5A) || // A..Z\n\t (ch >= 0x61 && ch <= 0x7A) || // a..z\n\t (ch === 0x5C) || // \\ (backslash)\n\t ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n\t }",
"title": ""
},
{
"docid": "8b30da810d04340f703844e92887412a",
"score": "0.55282855",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "3e4f9b63432c6df90643e741e3d4b6a9",
"score": "0.55165595",
"text": "function startsWithA(word) {\n\n word = word.toLowerCase();\n\n if (word[0] === 'a') {\n\n return true;\n\n } else {\n\n return false;\n\n }\n}",
"title": ""
},
{
"docid": "d4f1a981f1b7e7531127cc5850c500f0",
"score": "0.54943335",
"text": "function check_company_name_valid(){\n if($('#company_name').val()){\n var companyName = $('#company_name').val();\n if(companyName.length > 5){\n\n var regexString = \"^[a-zA-Z0-9_\\w \\s ]*$\";\n if( companyName.match(regexString)){\n return true;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n}",
"title": ""
},
{
"docid": "1a0d277bdc4dc81f7bf975db2b09e7ee",
"score": "0.54863274",
"text": "function str_match(s, sub) {\n return s.toLowerCase().indexOf(sub.toLowerCase()) >= 0;\n}",
"title": ""
},
{
"docid": "5866bee639f61eebda50d656caea9a23",
"score": "0.54834527",
"text": "checkLetter(letter) {\r\n if (this.phrase.toLowerCase().includes(letter)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"title": ""
},
{
"docid": "015126158f96acaf502440dda6f2c3de",
"score": "0.5465604",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n}",
"title": ""
},
{
"docid": "015126158f96acaf502440dda6f2c3de",
"score": "0.5465604",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && RegexNonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n}",
"title": ""
},
{
"docid": "669d77ac3b0626711f9ca87bf04d1d4a",
"score": "0.5464252",
"text": "checkLetter(letter) {\r\n return (this.phrase.includes(letter)) ? true : false;\r\n }",
"title": ""
},
{
"docid": "296bf53c8533a9ba7d4098a9910b3a5f",
"score": "0.546387",
"text": "function str_cont(s,c){o=s.indexOf(c)>=0;return o}",
"title": ""
},
{
"docid": "e374578842e9dfcd8d3cec03f8efa811",
"score": "0.5461674",
"text": "checkLetter(letter) {\r\n\t\t//www.w3schools.com/jsref/jsref_includes.asp\r\n\t\tif (this.phrase.includes(letter)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"title": ""
},
{
"docid": "913c8162ab6152bad4d373efa3abe59c",
"score": "0.5454557",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "913c8162ab6152bad4d373efa3abe59c",
"score": "0.5454557",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "913c8162ab6152bad4d373efa3abe59c",
"score": "0.5454557",
"text": "function isIdentifierStart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "628ca0e1dc3f2b367dc96df4796f0510",
"score": "0.544031",
"text": "function isWordStart(c) {\n return (0x61 <= c && c <= 0x7a) || // a..z\n (0x41 <= c && c <= 0x5a) || // A..Z\n (c === 0x5f); // _ (underscore)\n}",
"title": ""
},
{
"docid": "ab91223c4763553dcda6e545aa7216ac",
"score": "0.54228216",
"text": "function isValidJavaName(str) {\r\n return /^([a-zA-Z_]([a-zA-Z0-9_]+)?)$/.test(str);\r\n}",
"title": ""
},
{
"docid": "4e9fdbc910e0ae351e88cb4c7c9973ff",
"score": "0.5421234",
"text": "function isSafeName(s) {\n\treturn s.match(/^[a-z_][0-9a-z_]*$/i) !== null;\n}",
"title": ""
},
{
"docid": "8ed83550383ca128ea2790f6b4d732dc",
"score": "0.5415566",
"text": "isHack(all, unprefixed) {\n let check = new RegExp(`(\\\\(|\\\\s)${utils.escapeRegexp(unprefixed)}:`)\n return !check.test(all)\n }",
"title": ""
},
{
"docid": "3f23cdcfa53807e19da5693a146becc9",
"score": "0.54092443",
"text": "function wordStartsWithVowel(word) {\n \tvar firstLetter = word[0];\n\t\n\tif(firstLetter===\"a\"||firstLetter===\"e\"||firstLetter===\"i\"||firstLetter===\"o\"||firstLetter===\"u\"){\n\t\tconsole.log(true);\n\t} else {\n\t\tconsole.log(false);\n\t}\n}",
"title": ""
},
{
"docid": "bdabed031128088d4f2ef2b19a417cf5",
"score": "0.5407334",
"text": "checkLetter(letter) {\n if(this.phrase.includes(letter)) {\n return true;\n }\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "8808d929a5eb103cded3a8ae7323f045",
"score": "0.53854436",
"text": "function isIdentifierStart(ch) {\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n (ch === 92) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }",
"title": ""
},
{
"docid": "aa9a08baf441ddb836f7a1f69baef5cc",
"score": "0.53830737",
"text": "function checkSpecial(str) {\n\tlet sc = [\"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"-\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\", \"}\", \"|\", \"<\", \",\", \":\", \";\", \">\", \".\", \"?\", \"/\", \"~\", \"`\"];\n\tfor (i = 0; i <= sc.length - 1; i++) {\n\t\tif (str.includes(sc[i])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"title": ""
}
] |
a38f4c88f03025f33c44134be4c16155 | next: add handleChange() function | [
{
"docid": "eb5d5f776223c2458711022632c226fa",
"score": "0.0",
"text": "handleChange(e) {\n var message = e.target.value;\n this.setState({\n message: message,\n });\n }",
"title": ""
}
] | [
{
"docid": "7e17881da7fe8f767e8a8938535d5377",
"score": "0.8489219",
"text": "handleChange() {\n }",
"title": ""
},
{
"docid": "7c0a8cc5f12a850dff8196d7145d490e",
"score": "0.82967573",
"text": "handleChange(e) {\n }",
"title": ""
},
{
"docid": "d5498f669bf6c3dd1171f1a956848359",
"score": "0.8221181",
"text": "handleChange(e) {\n console.log('handle change called')\n }",
"title": ""
},
{
"docid": "d5498f669bf6c3dd1171f1a956848359",
"score": "0.8221181",
"text": "handleChange(e) {\n console.log('handle change called')\n }",
"title": ""
},
{
"docid": "03bbffa7b0cacd81548b2dc17722a932",
"score": "0.8123839",
"text": "handleChange(event) {\n\t\tconst inputVal = event.target.value;\n\t\tthis.setValue(inputVal);\n\t}",
"title": ""
},
{
"docid": "40f2b6ca48bd444da37b110f13d71d06",
"score": "0.807928",
"text": "function handleChange(event) {\n if (onChange) {\n onChange(event);\n }\n }",
"title": ""
},
{
"docid": "062010681a7caba56197c36653935670",
"score": "0.80350184",
"text": "handleChange(event) {\n let elemName = event.target.name;\n let value = event.target.value;\n //reason picklist is selected\n if (elemName === \"reasonField\") {\n this.objInputFields.sReason = value;\n this.reasonSelected = true;\n this.handleCommentAssignment();\n }\n //comment text area is selected\n else if (elemName === \"commentField\") {\n this.objInputFields.sComment = value;\n }\n this.bFormEdited = true;\n }",
"title": ""
},
{
"docid": "be4c06f2d82320a647b441403b2aa6d2",
"score": "0.79842734",
"text": "function handleChange (e) {\n return updateVal(e.target.value)\n }",
"title": ""
},
{
"docid": "12d13367d033c21602fe88147f5340d1",
"score": "0.7904235",
"text": "function handleChange(event) {\n\n setValue(event.target.value);\n\n }",
"title": ""
},
{
"docid": "12d13367d033c21602fe88147f5340d1",
"score": "0.7904235",
"text": "function handleChange(event) {\n\n setValue(event.target.value);\n\n }",
"title": ""
},
{
"docid": "90cc3484b0ed4d9b2bebac3df3dab7d3",
"score": "0.78646517",
"text": "onChange(){}",
"title": ""
},
{
"docid": "d33268473e7542a9c9ded06ff562cc6d",
"score": "0.78259176",
"text": "function handleChange(value) {\n changeValue(value.target.getAttribute('name'), value.target.value);\n }",
"title": ""
},
{
"docid": "e705197328f90e3802a4ffbaa341c86a",
"score": "0.7783271",
"text": "function handleChange(e) {\n setValue(e.target.value);\n }",
"title": ""
},
{
"docid": "a7f8d2481371085e437c7c28b6a4db30",
"score": "0.7781608",
"text": "function handleChange(e) {\n setValue(\n e.target.getAttribute('name'),\n e.target.value,\n );\n }",
"title": ""
},
{
"docid": "e025d3211c4c3a142eed34e429671326",
"score": "0.7757986",
"text": "handleChange(event) {\n this.selectedValue = event.detail.value;\n }",
"title": ""
},
{
"docid": "e025d3211c4c3a142eed34e429671326",
"score": "0.7757986",
"text": "handleChange(event) {\n this.selectedValue = event.detail.value;\n }",
"title": ""
},
{
"docid": "71ab4cd094a9a15eb68dfe5f1a8451b8",
"score": "0.77293587",
"text": "handleChange(e) {\n switch(e.target.name){\n case \"text\":\n this.props.updateDevelopText(e.target.value);\n break;\n case \"numLines\":\n this.props.updateDevelopNumLines(e.target.value);\n break;\n case \"extraspace\":\n this.props.updateDevelopExtraSpace(e.target.checked);\n break;\n case \"addHowToSolve\":\n this.props.updateDevelopAddHowToSolve(e.target.checked);\n break;\n default:\n break;\n }\n }",
"title": ""
},
{
"docid": "b0f23c6cf2c59b49a011c76d5994b955",
"score": "0.7728963",
"text": "function handleChange(e) {\r\n // Deconstruct e.target\r\n // Get the NAME of the selected field and the VALUE with it\r\n // Ex. firstName : \"Angelo\"\r\n const { name, value} = e.target;\r\n\r\n // Switch statement to decide what value to change\r\n // Prevents having to create more than one handleChange function for multiple inputs\r\n switch (name) {\r\n case \"firstName\":\r\n setFirstName(value); // Set firstName to value of field\r\n break;\r\n case \"lastName\":\r\n setLastName(value); // Set lastName to value of field\r\n break;\r\n case \"email\":\r\n setEmail(value); // Set email to value of field\r\n break;\r\n default:\r\n // No default\r\n }\r\n }",
"title": ""
},
{
"docid": "66b8122d46f3aa4f0ba384cb55bc0a2a",
"score": "0.7705238",
"text": "handleChange(event) {\n this.props.callback(event.target.value)\n }",
"title": ""
},
{
"docid": "368831c43e2e1a8ac56ae04b4bc043a8",
"score": "0.7699039",
"text": "handleChange(e){\n console.log(e.target.value);\n }",
"title": ""
},
{
"docid": "3306d755938b45ce8d9efa6f3cf64f7c",
"score": "0.7694933",
"text": "handleChange(e){\n\t\tvar name = e.target.value;\n\t\tthis.props.onChange(name);\n\t}",
"title": ""
},
{
"docid": "465e846c1b500263dc1bde991bb457ca",
"score": "0.76846147",
"text": "handleChange(e) {\n\t\tthis.props.updateGreeting(e.target.value)\n\t}",
"title": ""
},
{
"docid": "bfa0095d5000636e8b0c23f386b35745",
"score": "0.7659142",
"text": "handleChange(e){\n this.props.handleSelect(e);\n if(e.target.value === '0')\n this.props.setFieldValue(this.props.name, '')\n else\n this.props.setFieldValue(this.props.name, e.target.value)\n }",
"title": ""
},
{
"docid": "74fa816ea6fe415b60c8f50bc49ba7f6",
"score": "0.76119417",
"text": "handleChange(e) {\n e.preventDefault();\n this.props.onUserInput(this.refs.filterTextInput.value);\n }",
"title": ""
},
{
"docid": "0721545cdb794615c4a1b958a36e3b62",
"score": "0.7609805",
"text": "_handleChange(event) {\n // Reset state\n this.setState({\n change: null,\n error: null\n });\n\n if (event.target.value) {\n this._calculateChange(event.target.value);\n }\n }",
"title": ""
},
{
"docid": "cbd6f78144ad35df73b0981a79c74255",
"score": "0.76041347",
"text": "_onChange() {}",
"title": ""
},
{
"docid": "d31f31caa00557d9478a4074b4870710",
"score": "0.7580884",
"text": "handleChange(e) {\n // e.currentTarget: DOM element we attached the event handler to use the value property to read its current value\n this.setState({ input: e.currentTarget.value });\n }",
"title": ""
},
{
"docid": "65cbf681aef477386c63a2d4eddb9ec8",
"score": "0.75750375",
"text": "handleChange(event) {\n\t\t\tthis.setState({value: event.target.value});\n\t}",
"title": ""
},
{
"docid": "6e0506a527991de359ca56d3a7fbb008",
"score": "0.7564989",
"text": "function handleChange (e){\n // e.preventDefault()\n setInput(e.target.value)\n }",
"title": ""
},
{
"docid": "4738354129f1d79864f776218afcc6a8",
"score": "0.7550675",
"text": "function handleChange(event, newValue) {\n setValue(newValue);\n }",
"title": ""
},
{
"docid": "5afb6bcbca2b198e5b157d64efc812ba",
"score": "0.75370145",
"text": "function handleChange(e) {\n\t\tsetResponse(e.target.value);\n\t}",
"title": ""
},
{
"docid": "217040ae3543047a8d0be540ef668073",
"score": "0.75297534",
"text": "\"on-change\"() {}",
"title": ""
},
{
"docid": "d72c95bc63d99bfeaa0226fc99e109a5",
"score": "0.7528347",
"text": "handleChange(event) {\n const val = event.target.value;\n // If blank, use default value\n if (val === '') {\n this.setState({valid: true});\n this.props.handleChange(this.props.defaultValue);\n }\n // Update states based on validity of data\n else if (this.validateInput(val)) {\n this.setState({valid: true});\n this.props.handleChange(parseInt(val));\n }\n else {\n this.setState({valid: false});\n this.props.handleChange(0);\n }\n }",
"title": ""
},
{
"docid": "ab98194b33a0340f468bbdcf1674a7fc",
"score": "0.75107414",
"text": "function handleChange(event) {\n switch (event.target.name) {\n case \"address\":\n setAddress(event.target.value);\n break;\n case \"description\":\n setDescription(event.target.value);\n break;\n default:\n break;\n }\n }",
"title": ""
},
{
"docid": "2cf8b4e1ee979a02af970652049d9add",
"score": "0.7488317",
"text": "handleChange(e) {\n // e.currentTarget: DOM element we attached the event handler to\n // use the value property to read its current value\n this.setState({ input: e.target.value });\n }",
"title": ""
},
{
"docid": "4a3c358ac8043a02117951b713dc3f22",
"score": "0.7477502",
"text": "handleChange(event) {\r\n this.setState({value: event.target.value});\r\n }",
"title": ""
},
{
"docid": "ca1fa8678972cb11e4cdc72d727356d2",
"score": "0.74761415",
"text": "handleChange(e) {\n if (!!e) {\n this.props.changeLab(this.state.labs[e.value]);\n\n this.setState({\n lab: this.state.labs[e.value],\n selected: e.value\n });\n }\n }",
"title": ""
},
{
"docid": "1e871bdb48cd011ac3d462d3e9cb24b6",
"score": "0.7459126",
"text": "handleChange(e) {\n\t\tthis.setState({\n\t\t\tinput: e.target.value\n\t\t});\n\t}",
"title": ""
},
{
"docid": "223981d3638b3cb3e0693a0f890b49c4",
"score": "0.7451691",
"text": "_handleChange(e){this.value=e.detail.value;this.dispatchEvent(new CustomEvent(\"change\",{bubbles:!0,detail:this}))}",
"title": ""
},
{
"docid": "7d765eabd4e814f3fff8444b381e4e4f",
"score": "0.74501526",
"text": "function handleChange(e) {\n\t\tguardarBosqueda({\n\t\t\t...busqueda,\n\t\t\t[e.target.name] : e.target.value\n\t\t});\n\t}",
"title": ""
},
{
"docid": "2d2258cff3b23b336e2067ce2cdd309c",
"score": "0.7448531",
"text": "handleChange(event) {\r\n this.setState({ value: event.target.value })\r\n }",
"title": ""
},
{
"docid": "36307413f68b7e8cc04de6a11ff2bbb8",
"score": "0.7430845",
"text": "handleChange(event) {\n console.log('handleChange');\n event.preventDefault();\n this.selectedValue = event.target.value;\n this.handleChangeToParent();\n \n }",
"title": ""
},
{
"docid": "094f0f61d04dabd9aafdfc7be41e336e",
"score": "0.7424762",
"text": "handleChange(e) {\n let target = e.target;\n this.setState({\n value: target.value\n });\n }",
"title": ""
},
{
"docid": "dd54fef88c163b72ea62928dd5fbffa5",
"score": "0.74206626",
"text": "handleChange(event) {\n this.setState({ value: event.target.value });\n }",
"title": ""
},
{
"docid": "978d8acfe4664e96d050d4cf75934d65",
"score": "0.7413659",
"text": "handleChange(e) {\n this.setState({\n selectedValue: e.target.value\n })\n \n }",
"title": ""
},
{
"docid": "11a014871931442390f779b1bf0d835d",
"score": "0.7404126",
"text": "function handleChange(event) {\n\tthis.setState({value: event.target.value});\n}",
"title": ""
},
{
"docid": "c815da8c3e7d8d788c3c15805c850a97",
"score": "0.73928046",
"text": "handleChange(event) {\n\n\t\t// As the input field changes, capture the change\n\t\tvar newState = {};\n\t\tnewState[event.target.id] = event.target.value;\n\n\t\t// Set the topic, startYear, or endYear to the the change that was captured\n\t\tthis.setState(newState);\n\t}",
"title": ""
},
{
"docid": "56f03e880967351a7d16687f8a08c35a",
"score": "0.73900765",
"text": "function handleChange(event) {\n console.log(\"called!\");\n const target = event.target;\n const value = event.target.value;\n const name = event.target.name;\n\n if (name === \"vehicleType\") {\n setVehicleType(value);\n } else if (name === \"vehicleNum\") {\n setVehicleNum(value);\n }\n console.log(\"event: \\n\", event.target);\n if (name === \"vehicleType\") {\n if (value === \"bike\")\n setAmount(rateChart['bike']);\n if (value === \"car\")\n setAmount(rateChart['car']);\n if (value === \"truck\")\n setAmount(rateChart['truck']);\n\n }\n\n }",
"title": ""
},
{
"docid": "9b998e25e729c6570d845632931d9bec",
"score": "0.7370067",
"text": "handleChange(event) {\n event.preventDefault();\n this.props.onSelect(trim(event.target.value));\n }",
"title": ""
},
{
"docid": "bae3fb3ad18722e587ca0cf9d748cdad",
"score": "0.73456806",
"text": "handleChange(event) {\n var val = event.target.value;\n if(event.target.type === \"number\" && val && typeof val !== 'undefined')\n val = parseInt(val);\n if(event.target.type === \"select-one\") {\n val = val === \"true\";\n }\n var subnet = this.props.subnet;\n subnet[event.target.name] = val;\n subnet._edited = true;\n\n this.props.change(this.props.index, subnet);\n }",
"title": ""
},
{
"docid": "4e0cb8f242628c9dd29cd0db9fd42ed4",
"score": "0.73428667",
"text": "handleChange(e) {\n const name = e.target.value;\n this.props.updateName(name);\n }",
"title": ""
},
{
"docid": "bf459d041a040599965940933ed58932",
"score": "0.7336918",
"text": "function handleChange(event) {\n switch (event.target.name) {\n case \"firstName\":\n setFirstName(event.target.value);\n break;\n case \"lastName\":\n setLastName(event.target.value);\n break;\n default:\n break;\n }\n }",
"title": ""
},
{
"docid": "f778c349b9816c1a47c0cb8573ca0cad",
"score": "0.7329038",
"text": "handleChange(val) {\n this.setState({\n input: val\n })\n }",
"title": ""
},
{
"docid": "64b81ba3ad8c7ef7eb70095ade7bc4ae",
"score": "0.7325411",
"text": "handleChange(event) {\n this.setState({\n value: event.target.value\n });\n }",
"title": ""
},
{
"docid": "9a39382daff1217f9ba261744c7f893a",
"score": "0.7323125",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "03ec2b6a5f0e66654069a30424d47a28",
"score": "0.73091733",
"text": "function handleChange(e) { // Send the text input to state \n setName(e.target.value);\n }",
"title": ""
},
{
"docid": "b06b9743b9fc66e7932209f669585ca3",
"score": "0.73047566",
"text": "handleChange(e) {\n const { handleChange } = this.props;\n handleChange(e);\n }",
"title": ""
},
{
"docid": "285ed994908af8b5b37dd9d22495019f",
"score": "0.7304335",
"text": "handleChange(e) {\n let options = this.state.Options, target = e.currentTarget;\n options[target.getAttribute('data-key')] = target.value;\n this.setState({Options: options});\n this.props.update(this.state.Options);\n }",
"title": ""
},
{
"docid": "68ba0d5cba254294cb644262f91431f0",
"score": "0.729543",
"text": "handleChange () {\n this.setState({\n value: event.target.value\n });\n }",
"title": ""
},
{
"docid": "1fdffb894342ecba912b697624136410",
"score": "0.72923476",
"text": "handleChange(event) {\n this.setState({ value: event.target.value });\n }",
"title": ""
},
{
"docid": "1fdffb894342ecba912b697624136410",
"score": "0.72923476",
"text": "handleChange(event) {\n this.setState({ value: event.target.value });\n }",
"title": ""
},
{
"docid": "1fdffb894342ecba912b697624136410",
"score": "0.72923476",
"text": "handleChange(event) {\n this.setState({ value: event.target.value });\n }",
"title": ""
},
{
"docid": "2ff92846be74cfa231542d766cc81d64",
"score": "0.72915345",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "d3dc1653ff3f6fd07e2d7c9ae1e418ce",
"score": "0.728895",
"text": "handleChange(event) {\n var name = event.target.name;\n var val = event.target.value;\n this.changePrefs(name, val);\n }",
"title": ""
},
{
"docid": "dfe39ccf7892c8f74cc75e6eeaf52392",
"score": "0.72694296",
"text": "function handleChange(event) {\n const value = event.target.value;\n const name = event.target.name;\n updatenewpost((prev) => {\n return {...prev,[name]: value\n };\n });\n }",
"title": ""
},
{
"docid": "383d31da09f266fd14a694768f898614",
"score": "0.7268182",
"text": "handleChange(event) {\n\t\tthis.setState({\n\t\t\t[event.target.name]: event.target.value\n\t\t})\n\t}",
"title": ""
},
{
"docid": "0a710db95c7234bae0887f64a9839c91",
"score": "0.7264887",
"text": "handleChange(event) {\n var val = event.target.value;\n var machine = this.props.machine;\n machine[event.target.name] = val;\n machine._edited = true;\n\n this.props.change(this.props.index, machine);\n }",
"title": ""
},
{
"docid": "0c2a14ffb62a97f2649d95b52aecc000",
"score": "0.7254817",
"text": "function handleChange(e) {\n setName(e.target.value);\n }",
"title": ""
},
{
"docid": "294f0d5a041cd5f27ee325d8eb5cf150",
"score": "0.7253396",
"text": "handleChange(e) {\n this.setState({value: e.target.value});\n }",
"title": ""
},
{
"docid": "04d513c53b50b7a9db993b69ba18e88c",
"score": "0.7252072",
"text": "function handleChange(event) {\n switch (event.target.name) {\n case \"username\":\n setUsername(event.target.value);\n break;\n case \"pass\":\n setPass(event.target.value);\n break;\n default:\n break;\n }\n }",
"title": ""
},
{
"docid": "0d4a198f5f334e5f5f97f0ea32750123",
"score": "0.7250111",
"text": "handleChange (event) {\n // notify our listeners that this component is blured\n if (this.props.input && this.props.input.onChange) this.props.input.onChange(event);\n }",
"title": ""
},
{
"docid": "597b3a61d107c0e7794742044237e0fe",
"score": "0.72486293",
"text": "onChange(newValue, oldValue) {}",
"title": ""
},
{
"docid": "721bf44b611f471f56bd5683d0041dd1",
"score": "0.7247468",
"text": "handleChange(e = {}) {\n if(e.target) {\n this.setState({\n value: e.target.value || ''\n })\n }\n }",
"title": ""
},
{
"docid": "3b27ea0a8f53b7a5786615fc37da3993",
"score": "0.72464514",
"text": "handleChange(e) {\n const name = e.target.value;\n this.props.updateName(name);\n }",
"title": ""
},
{
"docid": "4c83fbc8604c8e8d7685415ecb5c6073",
"score": "0.72433406",
"text": "handleChange(value) {\n this.props.updateLitText(value);\n }",
"title": ""
},
{
"docid": "23ab4a2b4025ff5f19071bbe003b60ee",
"score": "0.7241958",
"text": "handleChange(e) {\n var value = e.target.value;\n this.setState({ [e.target.name]: e.target.value }, \n () => { this.validateField(value) });\n }",
"title": ""
},
{
"docid": "7d3f04edcb2c5e5f9ca5da2f36d34d40",
"score": "0.7235372",
"text": "function handleChange(event) {\n switch (event.target.name) {\n case \"username\":\n setUsername(event.target.value);\n break;\n case \"name\":\n setName(event.target.value);\n break;\n default:\n break;\n }\n }",
"title": ""
},
{
"docid": "7c2dbe3ea9523c03a0a49b4cbad1c632",
"score": "0.7221391",
"text": "handleChange(event) {\n /* Save value from input field to component's state */\n this.setState({\n value: event.target.value\n });\n }",
"title": ""
},
{
"docid": "0066f5019e0834006173ade1f6a13cb3",
"score": "0.7220947",
"text": "handleChange(event) {\n this.setState({ value: event.target.value });\n // TODO: Get debouncing to work so we are not sending requests on every character\n // for now, we won't do anything on change, only on blur, tab ro return\n // _.debounce(this.sendTextToCallback, 250);\n // if (event.target.value.length >= 3) this.sendTextToCallback();\n }",
"title": ""
},
{
"docid": "cc522d6e2954423f5f4ef26b143e3295",
"score": "0.72208315",
"text": "changeHandler(event) {\n const field = event.target.name;\n const val = event.target.value;\n if (field === 'contactSelect') {\n this.contactId = val;\n }\n\n if (field === 'accountSelect') {\n this.accountId = val;\n } \n }",
"title": ""
},
{
"docid": "79b54063febbbf83a6b461f6ed267cfc",
"score": "0.721535",
"text": "handleChange(event) {\r\n // Store the element's changed value\r\n this.setState({ input: event.target.value });\r\n }",
"title": ""
},
{
"docid": "a2391f6bb79edaf2c6c84513225fb07d",
"score": "0.72149813",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b1b9045019889447e6c7f6596cdd8d66",
"score": "0.7206039",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b1b9045019889447e6c7f6596cdd8d66",
"score": "0.7206039",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b1b9045019889447e6c7f6596cdd8d66",
"score": "0.7206039",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b1b9045019889447e6c7f6596cdd8d66",
"score": "0.7206039",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b1b9045019889447e6c7f6596cdd8d66",
"score": "0.7206039",
"text": "handleChange(event) {\n this.setState({value: event.target.value});\n }",
"title": ""
},
{
"docid": "b46e8fc178347d1ac3c6dd0fddf613bd",
"score": "0.7198844",
"text": "handleChange ( event ) {\n\n this.setState ( { value: event.target.value } );\n\n }",
"title": ""
},
{
"docid": "458b3a0bfa1fe1fb993eafd36b3d20a5",
"score": "0.719743",
"text": "handleChange(event) {\n event.preventDefault()\n this.props.changeName(event.target.value)\n }",
"title": ""
},
{
"docid": "a7efdea1cd18c7102bed625d56bbb1bc",
"score": "0.7184041",
"text": "handleChange(e) {\n\t\tthis.setState({\n\t\t\tquery: e.value\n\t\t});\n\t\tmyQuery = e.value;\n\t\tthis.changeLogic();\n\t}",
"title": ""
},
{
"docid": "4fa67d674070ccce974903d94bbafc16",
"score": "0.7181618",
"text": "_handleChange(e)\n {\n let filterText = ReactDOM.findDOMNode(this.refs.filterTextInput).value ?\n ReactDOM.findDOMNode(this.refs.filterTextInput).value : e.target.value;\n\n this.props.onUserInput(\n filterText\n );\n }",
"title": ""
},
{
"docid": "6370661031c95f0696882d7f90f62c80",
"score": "0.71729565",
"text": "function handleChange({ target }) {\n const { value } = target;\n\n // Value must be alphanumeric and can contain space\n const regex = /^[a-z\\d\\-_\\s]+$/iu;\n\n // Update input value\n setInputValue(value);\n\n // Reset values\n setActiveIndex(-1);\n setActiveDescendant(target, false);\n\n // When input field is empty or invalid, reset\n if (!value || (value && !regex.test(value))) {\n resetAll(target);\n\n return;\n }\n\n setGetData(true);\n }",
"title": ""
},
{
"docid": "05bb5dcf63b404c367c32d136300c7c4",
"score": "0.7171164",
"text": "function handleChange(event) {\n const { name, value } = event.target;\n setInputs({ ...inputs, [name]: value });\n handleError(name, value);\n determineIfStepComplete();\n }",
"title": ""
},
{
"docid": "d8b1ee15bd73d3385167fc670afb1efd",
"score": "0.7169265",
"text": "handleChange(e){\n this.props.onChange(e);\n }",
"title": ""
},
{
"docid": "5266e5f5bb3f67bda935574321a5301d",
"score": "0.7163795",
"text": "function changeHandler(e) {\n e.preventDefault();\n const { name, value } = e.target;\n // const name = e.target.name;\n // const value = e.target.value;\n\n if (value === '') return;\n setValues({ ...values, id: uuidv4(), [name]: value, complete: false });\n }",
"title": ""
},
{
"docid": "efbc53ee825f716a9b46ceaecbea056e",
"score": "0.7157536",
"text": "function handleChange(event) {\n var value = event.target.value;\n\n if (!isControlled) {\n handleValueChange(value);\n }\n }",
"title": ""
},
{
"docid": "f2f83835258593d1b77be1e9530585b8",
"score": "0.71524006",
"text": "handleChange(event) {\n event.stopPropagation();\n\n // The input event fires continually for every value change while the change event gets\n // fired when the user releases the mouse button for example. This can cause two change\n // events to be fired for the same value change. To prevent this, ignore the change event\n // if the value hasn't changed.\n const shouldIgnoreChangeEvent = this._value === event.target.value;\n if (shouldIgnoreChangeEvent) {\n return;\n }\n\n this.handleInput(event);\n }",
"title": ""
},
{
"docid": "2ea68938691849019195154a311cbe9b",
"score": "0.7149973",
"text": "handleOnChange(e) {\n this.setState({\n value: e.target.value\n });\n }",
"title": ""
},
{
"docid": "fc2d0eb5a53493dd813619bf0d4463ea",
"score": "0.7149872",
"text": "handleChange(e) {\n this.setState({ inputVal: e.target.value });\n }",
"title": ""
},
{
"docid": "e206b55a46357a4f4da5d267ed71e5c1",
"score": "0.714757",
"text": "handleChange (event) {\n //track changes to input (this will be a \"handleChange\") this will have the data (stored in state)\n this.setState({\n [event.target.id] : event.target.value},\n \n )\n }",
"title": ""
},
{
"docid": "8a50b08ae353324512ad02829a602d04",
"score": "0.71428436",
"text": "function _handleChange(event) {\n event.preventDefault();\n let value = event.target.files ? event.target.files[0] : event.target.value;\n form.set(event.target.name, value);\n\n}",
"title": ""
}
] |
a4855816adc7cdb7767257f23802d14f | Returns true if compared function is first in ordered array of compared functions. | [
{
"docid": "102766d127bab395ba867d1d6ba9d8e8",
"score": "0.6416459",
"text": "isFirstCompFun(compFunName) {\n return this.getCompFuns()[0] === compFunName;\n }",
"title": ""
}
] | [
{
"docid": "c10dc932c0039172aa7da9846f0b645d",
"score": "0.64456534",
"text": "isFirstDiffFunForComp(compFunName, diffFunName) {\n const firstDiffFunName = this.getDiffFuns(compFunName)[0];\n return diffFunName === firstDiffFunName;\n }",
"title": ""
},
{
"docid": "abc88a2cc474c1ae72195c43e6701d56",
"score": "0.6120034",
"text": "function isSorted(array, compare) {\n if (compare === void 0) { compare = lessOrEqual; }\n for (var i = 1; i < array.length; i++) {\n if (!compare(array[i - 1], array[i]))\n return false;\n }\n return true;\n}",
"title": ""
},
{
"docid": "bd7198c6db4bf958b067cdd5b91bfbd5",
"score": "0.60772496",
"text": "function isAscending(arr) {\n return arr.every(function (x, i) {\n return i === 0 || x > arr[i - 1];\n });\n}",
"title": ""
},
{
"docid": "6043f888aa151e4dc92ce3b1da779eb1",
"score": "0.5975927",
"text": "function includes(array, fn) {\n for (var i = 0, e; e = array[i]; i++) {\n if (fn(e)) {\n return true\n }\n }\n}",
"title": ""
},
{
"docid": "ecddcda15f9946a88c61eaaca7199bb1",
"score": "0.5975921",
"text": "some(func) {\r\n const values = this.toArray();\r\n for (let i = 0; i < values.length; i++) {\r\n if (func.call(this, values[i]))\r\n return true;\r\n }\r\n return false;\r\n }",
"title": ""
},
{
"docid": "2bc6448f693514c95476ac2d33f91e58",
"score": "0.5956582",
"text": "function inAscOrder(arr) {\n return (arr.join('') === arr.sort((a, b) => a - b).join('')) ? true : false\n}",
"title": ""
},
{
"docid": "1cb39bac9457553027659036bcf5291d",
"score": "0.5896266",
"text": "function compare(fun1, fun2) {\n return function(a, b) { \n if(fun1(a) === fun1(b)) {\n var cf = fun2 || fun1;\n return comp(cf(a), cf(b));\n } else {\n return comp(fun1(a), fun1(b));\n }\n }\n}",
"title": ""
},
{
"docid": "6c526e2e9ba01c0ced3a611d2a63f6b6",
"score": "0.5892515",
"text": "function checkOrder(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i+1] && (arr[i+1] < arr[i])){\n return false;\n \n }\n\n }\n return true;\n }",
"title": ""
},
{
"docid": "4bd15cc5508f5962c1914b63d2b4f2b6",
"score": "0.5866808",
"text": "function isSorted(array) {\n for (let i = 0; i < array.length - 1; i++) {\n if (array[i] > array[i + 1]) {\n return false;\n }\n }\n return true;\n }",
"title": ""
},
{
"docid": "4c2f3cd83d7c66932d8e15711e18049e",
"score": "0.5863014",
"text": "function isSorted (array) {\n for (let i = 0; i < array.length; i++) {\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "5249a29d040d00591e24877f2780e9c8",
"score": "0.5857006",
"text": "function isSortedInAscendingOrder(array) {\n for (var i = 1; i < array.length; i++) {\n if (array[i] < array[i - 1])\n return false;\n }\n return true;\n}",
"title": ""
},
{
"docid": "4166efefb96897f9701919a386e284a7",
"score": "0.5830798",
"text": "function isSorted(){\n for (var i = 0; i < stack.length-1; i++) {\n if(stack[i+1]<stack[i]){return false;}\n }\n return true;\n }",
"title": ""
},
{
"docid": "cff88fc324125dbc3a93faba6a17af84",
"score": "0.5801833",
"text": "function inAscOrder(arr) {\n for(let i = 0; i < arr.length; i++) {\n if(arr[i] >= arr[i+1]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "fe665b9b706bcba842f552e153b8dcbd",
"score": "0.5790288",
"text": "function inAscOrder(arr) {\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] <= arr[i-1]) return false;\n }\n return true;\n}",
"title": ""
},
{
"docid": "05e2d17eae639a630375bad9d64d57d2",
"score": "0.57756335",
"text": "isLastCompFun(compFunName) {\n const comparedFunctions = this.getCompFuns();\n return comparedFunctions[comparedFunctions.length - 1] === compFunName;\n }",
"title": ""
},
{
"docid": "2c4ca2a4a26b6694ffe3f5e0f7bcad33",
"score": "0.57743037",
"text": "function shouldSort(first, second) {\n return first > second;\n}",
"title": ""
},
{
"docid": "1d5530b22298b8c033c0a5e0c2bab115",
"score": "0.57667893",
"text": "orderFun() {\n if (this.order.value == true) {\n return true;\n }\n else {\n return false;\n }\n }",
"title": ""
},
{
"docid": "776de239ccf37466afe1fbd070152224",
"score": "0.574317",
"text": "function some(arr, fn) {\n var out = false;\n\n for (var _i = 0, l = arr.length; _i < l; _i++) {\n if (fn(arr[_i], _i, arr)) {\n out = true;\n break;\n }\n }\n\n return out;\n }",
"title": ""
},
{
"docid": "5b6b83b2b05c41cddcd648ce5b33eb9b",
"score": "0.573044",
"text": "function isSorted(arr) {\n for (let i = 1; i < arr.length; i++){\n if (arr[i - 1] > arr[i]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "d7d556e868f60deb5b4b939834c9e5f8",
"score": "0.571921",
"text": "function some(array, func) {\n\t// write a function tests whether at least one element in the array passes the test implemented by the provided function\n\t// iterate through array\n\t// test whatever passed in function we have on each index\n\t// run function at each item\n\t\t// return result?\n\t// can use a for loop\n\n for(let i = 0; i < array.length; i++) {\n\t// run function at each item\n // if outcome !true, ++? else \n if(func(array[i]) === true){\n return true;\n } \n\t}\n\treturn false;\n}",
"title": ""
},
{
"docid": "9511cce83e800218471e8c1ed73af930",
"score": "0.56784296",
"text": "function isFirstSuperior(arr1, arr2) {\r\n\tif (arr1[0] > arr2[0]) {\r\n\t\treturn true\r\n\t} else if (arr1[1] > arr2[1]) {\r\n\t\treturn true\r\n\t} else if (arr1[2] > arr2[2]) {\r\n\t\treturn true\r\n\t} else if (arr1[3] > arr2[3]) {\r\n\t\treturn true\r\n\t} else {\r\n\t\treturn false\r\n\t}\r\n}",
"title": ""
},
{
"docid": "7519b8a3d70df834d2c9a16cc2b623a7",
"score": "0.56783354",
"text": "function some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "7519b8a3d70df834d2c9a16cc2b623a7",
"score": "0.56783354",
"text": "function some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "8a2b664f8e4d2b1c4da9f58a0e45ba4d",
"score": "0.56504285",
"text": "function inOrder(things, comparator) {\n var thing;\n var nextThing;\n for (var i=0, numThings=things.length; i < numThings; i++) {\n thing = things[i];\n nextThing = things[i+1];\n if (comparator(thing, nextThing) > 0) {\n return false;\n }\n }\n return true;\n }",
"title": ""
},
{
"docid": "50b0cf35b1278f4b93a39ab8ea4c03fe",
"score": "0.5636113",
"text": "function compare( a, b, fcn, reverse=false) {\n let direction = 1;\n if (reverse) { direction = -1 }\n let fa = fcn(a);\n let fb = fcn(b);\n if ( fa < fb ){ return -1 * direction; }\n if ( fa > fb ){ return 1 * direction; }\n return 0;\n}",
"title": ""
},
{
"docid": "7c394b0b34ddb1064f25c95a313f1753",
"score": "0.5618317",
"text": "function comparator(fn) {\n return function(a, b) {\n return fn(a, b) ? -1 :\n fn(b, a) ? 1 :\n 0;\n };\n}",
"title": ""
},
{
"docid": "48776fc6b336e382ae2fcbd833a14a7e",
"score": "0.5617713",
"text": "function isInorder(arr) {\n for(let i = 0; i < arr.length-1; i++) {\n if(arr[i] > arr[i+1]) return false;\n }\n return true;\n}",
"title": ""
},
{
"docid": "49022e72ac83a3ad1c85c8efa985850f",
"score": "0.55997247",
"text": "function comparator(fn) {\n return function(a,b) {\n return fn(a,b) ? -1\n : fn(b,a) ? 1\n : 0;\n };\n}",
"title": ""
},
{
"docid": "b910a11f9b8fa43510178ddf7a721f58",
"score": "0.55812925",
"text": "function myOwnSome(array, func) {\n var result = false;\n\n for (var i = 0; i < array.length; i += 1) {\n if (func(array[i])) return true;\n }\n\n return result;\n}",
"title": ""
},
{
"docid": "249e30072023f8b33cedb3c9b6e7a58d",
"score": "0.5579152",
"text": "arrayIsSorted() {\n const arrCopy = this.state.array.slice();\n arrCopy.sort();\n const arrState = this.state.array;\n\n for (let i = 0; i < arrState.length; i++) {\n if (arrCopy[i] !== arrState[i]) {\n return false;\n }\n }\n\n return true;\n }",
"title": ""
},
{
"docid": "f4afc36370ca87ca99134014a2e2de5d",
"score": "0.55783474",
"text": "function _fnArrayCmp( aArray1, aArray2 )\n\t\t{\n\t\t\tif ( aArray1.length != aArray2.length )\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\tfor ( var i=0 ; i<aArray1.length ; i++ )\n\t\t\t{\n\t\t\t\tif ( aArray1[i] != aArray2[i] )\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn 0;\n\t\t}",
"title": ""
},
{
"docid": "f4afc36370ca87ca99134014a2e2de5d",
"score": "0.55783474",
"text": "function _fnArrayCmp( aArray1, aArray2 )\n\t\t{\n\t\t\tif ( aArray1.length != aArray2.length )\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\tfor ( var i=0 ; i<aArray1.length ; i++ )\n\t\t\t{\n\t\t\t\tif ( aArray1[i] != aArray2[i] )\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn 0;\n\t\t}",
"title": ""
},
{
"docid": "a67a52c042b1b1475e89804488888c83",
"score": "0.55687094",
"text": "function inOrder(array, index) { //pure function\n if(index === array.length - 1) return true;\n return array[index] < array[index + 1];\n}",
"title": ""
},
{
"docid": "dac1cc966650818c776b7509985b4436",
"score": "0.554873",
"text": "function isSorted (array) {\n // declare a for loop\n for (let i = 0; i < array.length; i++) {\n // if an iteration minus 1 is greater than the iteration return false\n // if this is sorted than it cannot happen\n // however, if it is sorted then it can happen\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "63e4d4df13ec8c0c36127e8223adf1a1",
"score": "0.5541972",
"text": "function cmp_arr(arr_1, arr_2) {\n for (var i = 0; i < arr_1.length; i++)\n if (arr_1[i] != arr_2[i])\n return false;\n\n return true;\n}",
"title": ""
},
{
"docid": "c51992750e774a662e6a1b4a70da1075",
"score": "0.5536367",
"text": "function isArrSortStable() {\n var str = \"abcdefghijklmnopqrstuvwxyz\";\n\n return \"xyzvwtursopqmnklhijfgdeabc\" == str.split(\"\").sort(function(a,b) {\n return ~~(str.indexOf(b)/2.3) - ~~(str.indexOf(a)/2.3);\n }).join(\"\");\n }",
"title": ""
},
{
"docid": "b03b2a4a8b84a18b0f95e2650d43c0c8",
"score": "0.5522383",
"text": "function compareFnAscend(a, b) {\n return a - b;\n }",
"title": ""
},
{
"docid": "b03b2a4a8b84a18b0f95e2650d43c0c8",
"score": "0.5522383",
"text": "function compareFnAscend(a, b) {\n return a - b;\n }",
"title": ""
},
{
"docid": "51707de2d8551c9ccd4dcb5a6fa6b86f",
"score": "0.5513787",
"text": "function compareFunctions () {\n return obj1.toString() === obj2.toString();\n }",
"title": ""
},
{
"docid": "a5c7b4c0fc2c121a9c5690d532261cfd",
"score": "0.5501949",
"text": "function ordenar(arr){\n\tfor(var i=0;i<arr.length;i++){\n\t\tif(arr[i]< arr[i+1]){\n\t\t\n\t\treturn false;\n\n\t\t\t}\n\t\n\t}\n\treturn true;\n\t\n}",
"title": ""
},
{
"docid": "9240be21c68b71789bd0d0a866aa93ef",
"score": "0.5501579",
"text": "function isIncluded(arr, val) {\n var i;\n for (i = 0; i < arr.length; i += 1) {\n if (arr[i] > val) {\n return true;\n }\n }\n\n return false;\n}",
"title": ""
},
{
"docid": "633d94313b5cb0949691b828d0f94700",
"score": "0.54889536",
"text": "function any(arr, fun){\n for (let i = 0; i < arr.length; i++) {\n if(fun(arr[i])) {\n return true\n }\n }\n return false\n}",
"title": ""
},
{
"docid": "39bb1e22bf0431e9871315cac69b66ad",
"score": "0.5465343",
"text": "function every(arr, fn) {\n var out = true;\n\n for (var i = 0, l = arr.length; i < l; i++) {\n if (!fn(arr[i], i, arr)) {\n out = false;\n break;\n }\n }\n\n return out;\n }",
"title": ""
},
{
"docid": "d9a62897a9a01528beaf94377295a180",
"score": "0.5464802",
"text": "function array_match_some(a, func, context) {\n for (var i = 0; i < a.length; i++) {\n if (i in a && func.call(context, a[i], i, a)) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "194469073f96b47aa2453717bad41b57",
"score": "0.54381835",
"text": "function containsOrder(a, obj) {\n for (var i = 0; i < a.length; i++) {\n if (a[i].fields[0].field_0 == obj.fields[0].field_0) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "633dd3f2ecbd9427cd22be64c5cf2d21",
"score": "0.5422271",
"text": "function comp(array){\n\treturn array.reduce( \n\t\tfunction (funA, funB) { \n\t\t\t\treturn (function (val) { return funA(funB(val)); });\n\t\t\t\t} \n\t);\n}",
"title": ""
},
{
"docid": "c9a31badb02909d4ef8ec69a590aa5df",
"score": "0.54202443",
"text": "compare(arr1, arr2) {\n if (!arr1 || !arr2) return;\n // if (arr1.length === 0 && arr2.length === 0) {\n // return true;\n // }\n let result = true;\n\n arr1.forEach(e1 =>\n arr2.forEach(e2 => {\n if (e1.length > 1 && e2.length) {\n result = this.compare(e1, e2);\n } else if (e1 !== e2) {\n return false;\n } else {\n result = true;\n }\n })\n );\n\n return result;\n }",
"title": ""
},
{
"docid": "3d6eef1b7790653a8c2c4ef42e90d5dd",
"score": "0.5415246",
"text": "function callback(ruleFunction) {\n\n\t// Check if the arrays are the same length\n if (arr1.length !== arr2.length) return false;\n\n // Check if all items exist and are in the same order\n for (var i = 0; i < arr1.length; i++) {\n const elementOneWithRule = ruleFunction(arr1[i]);\n const elementTwoWithRule = ruleFunction(arr2[i]);\n if (elementOneWithRule !== elementTwoWithRule) return false;\n }\n\n // Otherwise, return true\n return true;\n }",
"title": ""
},
{
"docid": "6f6d68f028bcfe7ac9cd18e26f27572f",
"score": "0.54091877",
"text": "function testCmp (x) {\n const test = function (x0, i) {\n return x[i] >= LIM[0] && x[i] <= LIM[1]\n }\n if (test(x, 'x') && test(x, 'y') === true) return true\n return false\n}",
"title": ""
},
{
"docid": "5918d1daf1180ec6541c61456df127da",
"score": "0.54020804",
"text": "function isSorted(arr) {\n if (arr.length < 2){ return true; }\n for (let i = 1; i < arr.length; i++){\n if (arr[i-1] > arr[i]) { return false; }\n }\n return true;\n}",
"title": ""
},
{
"docid": "23be04473664bbb754131d6893093305",
"score": "0.54008466",
"text": "function make_search_function_in_array(data) {\n\t\t\n\t\tvar lastindex = 0;\n\n\t\treturn function(c) {\n\t\t\tvar index = lastindex;\n\t\t\tvar r = data[index];\n\t\t\tvar step = 1;\n\t\t\tvar direction = 0;\n\t\t\t\n\t\t\twhile (index >= 0 && index<data.length) {\n\n\t\t\t\tr = data[index];\n\t\t\t\t\n\t\t\t\tif (r instanceof Array) {\n\t\t\t\t\tif (c < r[0]) {\n\t\t\t\t\t\tstep = -1;\n\t\t\t\t\t} else if (c > r[1]) {\n\t\t\t\t\t\tstep = +1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastindex = index;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (r == c) {\n\t\t\t\t\t\tlastindex = index;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tstep = c<r?-1:+1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (direction == 0) {\n\t\t\t\t\tdirection = step;\n\t\t\t\t} else if (direction != step) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tindex += step;\n\t\t\t\t\n\t\t\t\tif (index > data.length || index<0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t}",
"title": ""
},
{
"docid": "bec9be84ddcd28688c7404b55f95f3f7",
"score": "0.53961295",
"text": "function makeFuncTester(capLastTestCasesArr) {\n const arr1 = capLastTestCasesArr[0][0]\n const arr2 = capLastTestCasesArr[0][1]\n // somehow run the function passed in, then return the expected out come\n function callback(ruleFunction) {\n\n\t// Check if the arrays are the same length\n if (arr1.length !== arr2.length) return false;\n\n // Check if all items exist and are in the same order\n for (var i = 0; i < arr1.length; i++) {\n const elementOneWithRule = ruleFunction(arr1[i]);\n const elementTwoWithRule = ruleFunction(arr2[i]);\n if (elementOneWithRule !== elementTwoWithRule) return false;\n }\n\n // Otherwise, return true\n return true;\n }\n return callback;\n}",
"title": ""
},
{
"docid": "fb043032695c4fbe754c8285886dfd83",
"score": "0.5395832",
"text": "function any (arr, callBack) {\n for (var i = 0; i < arr.length; i++) {\n if (callBack(arr[i])) {\n return true\n }\n } return false\n}",
"title": ""
},
{
"docid": "1694cb4b1c3062e04c93231bae286b53",
"score": "0.53943104",
"text": "function myOwnEvery(array, func) {\n for (var i = 0; i < array.length; i += 1) {\n if (!func(array[i], i, array)) {\n return false;\n }\n }\n\n return true;\n}",
"title": ""
},
{
"docid": "fe85d54d0cd5fdb47e860613a366329e",
"score": "0.53849083",
"text": "function isSorted(arr) {\n if(arr.length !== ARRAY_SIZE){\n return false\n }\n for (let idx = 0; idx < arr.length - 1; idx++) {\n if (arr[idx] > arr[idx + 1]) {\n return false\n }\n }\n return true\n}",
"title": ""
},
{
"docid": "b72310b0bbc94e8b1905863b222b9f71",
"score": "0.5382817",
"text": "withMin(a, fn) {\n var o;\n for (var i = 0, l = a[LEN]; i < l; i++) {\n if (!o) {\n o = a[i];\n continue;\n }\n var v = fn(a[i]);\n if (v < fn(o))\n o = a[i];\n }\n return o;\n }",
"title": ""
},
{
"docid": "4aaa75049e24667132c70b9a5dc6ec90",
"score": "0.5365368",
"text": "function foo(x){\n if(x[0] <x [1]) {\n return true;\n }\n else {\n return false;\n }\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "aea6e06c6246f626cb64478f00bd1c48",
"score": "0.5359266",
"text": "function isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}",
"title": ""
},
{
"docid": "c66d27e02e3de15af50a9183b62358c6",
"score": "0.53565854",
"text": "function test_order(arr1, arr2){\n for(let i in arr1)\n if(arr1[i] != arr2[i])\n return false;\n return true;\n }",
"title": ""
},
{
"docid": "9d34161d7aa1563208f04736b1f42bbb",
"score": "0.5350619",
"text": "function some(arr, f) {\n let i = 0;\n\n for (const [k, a] of arr.entries()) {\n if (f(a, k, i++)) {\n return true;\n }\n }\n\n return false;\n }",
"title": ""
},
{
"docid": "eb7a9d91bf32cc8099ce018b7c1aca7c",
"score": "0.5347776",
"text": "function stableSort(fn) {\n var type = typeOf(this[0]);\n\n if (type == \"Number\" || type == \"String\") {\n var ord = {}, len = this.length, val;\n\n for (var i = 0; i < len; i++) {\n val = this[i];\n if (ord[val] || ord[val] === 0) continue;\n ord[val] = i;\n }\n\n return this.sort(function(a,b) {\n return fn(a,b) || ord[a] - ord[b];\n });\n }\n else {\n var ord = this.map(function(v){return v});\n\n return this.sort(function(a,b) {\n return fn(a,b) || ord.indexOf(a) - ord.indexOf(b);\n });\n }\n }",
"title": ""
},
{
"docid": "69da08f7c8844bdb010ceb6617d94be8",
"score": "0.5345802",
"text": "_invokeDefaultCompareFn(a,b){\n return a > b;\n }",
"title": ""
},
{
"docid": "16385eeb57e8f4b7542bc70fa6c3a77a",
"score": "0.53403854",
"text": "function isLes(a, b) {\n return a < b\n}",
"title": ""
},
{
"docid": "323c093414018ed8930d158aa46b1dd9",
"score": "0.5336847",
"text": "function compareToEquals(compareFunction) {\n return function (a, b) {\n return compareFunction(a, b) === 0;\n };\n}",
"title": ""
},
{
"docid": "323c093414018ed8930d158aa46b1dd9",
"score": "0.5336847",
"text": "function compareToEquals(compareFunction) {\n return function (a, b) {\n return compareFunction(a, b) === 0;\n };\n}",
"title": ""
},
{
"docid": "cebc425f152741630c56094012ae54c5",
"score": "0.53335464",
"text": "function sc_everyPred(proc, l) {\n var tmp = sc_every(proc, l);\n if (tmp !== false) return true;\n return false;\n}",
"title": ""
},
{
"docid": "76d81d46701118010ec4d346f3964964",
"score": "0.5324322",
"text": "function isSatisfiable (comparators, options) {\n var result = true;\n var remainingComparators = comparators.slice();\n var testComparator = remainingComparators.pop();\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n });\n\n testComparator = remainingComparators.pop();\n }\n\n return result\n}",
"title": ""
},
{
"docid": "9c48336cb53e3554be1a879af1bf7a00",
"score": "0.5313431",
"text": "function anyTrue(list, func) {\n for (var i=0; i<list.length; ++i) {\n if (func(list[i])) {\n return true;\n }\n }\n return false;\n }",
"title": ""
},
{
"docid": "d3b16698639b9518c292af11d7336da3",
"score": "0.53090936",
"text": "function makeComparator(keyFn) {\n return (a, b) => {\n const keyA = keyFn(a);\n const keyB = keyFn(b);\n const len = Math.min(keyA.length, keyB.length);\n for (let i = 0; i < len; i++) {\n const c = compare(keyA[i], keyB[i]);\n if (c !== 0) {\n return c;\n }\n }\n // Arrays are the same up to the min length -- shorter array sorts first\n return keyA.length - keyB.length;\n };\n}",
"title": ""
},
{
"docid": "86457578ea1c17e8d109a16162cbe096",
"score": "0.5303894",
"text": "someKeys(func) {\r\n const keys = this.toKeyArray();\r\n for (let i = 0; i < keys.length; i++) {\r\n if (func.call(this, keys[i]))\r\n return true;\r\n }\r\n return false;\r\n }",
"title": ""
},
{
"docid": "80de2aa7686badef77e477b4b343b176",
"score": "0.5300831",
"text": "function comp(array1, array2) {\n if(array1 == null || array2 == null) return false;\n array1.sort((a, b) => a - b); array2.sort((a, b) => a - b);\n return array1.map(v => v * v).every((v, i) => v == array2[i]);\n}",
"title": ""
},
{
"docid": "80de2aa7686badef77e477b4b343b176",
"score": "0.5300831",
"text": "function comp(array1, array2) {\n if(array1 == null || array2 == null) return false;\n array1.sort((a, b) => a - b); array2.sort((a, b) => a - b);\n return array1.map(v => v * v).every((v, i) => v == array2[i]);\n}",
"title": ""
},
{
"docid": "f842160a42223beb670acc37b8ba234b",
"score": "0.52953106",
"text": "function isSorted (array) {\n // loop through all of the numbers in an array\n for (let i = 0; i < array.length; i++) {\n // if number - 1 is greater than number then the array is not sorted\n if (array[i - 1] > array[i]) {\n return false;\n }\n }\n // else, the array is sorted.\n return true;\n}",
"title": ""
},
{
"docid": "9964c3f6a9e97575d4017dfbdd5408ee",
"score": "0.52918875",
"text": "function every(array,testFunction) {\n\t\n\tfor (let item of array) {\n\t\t\tif(!testFunction(item)) {\n\t\t\t\treturn false\n\t\t\t}\n\t}\n\n\treturn true\n}",
"title": ""
},
{
"docid": "467cb9af28d8ac6ffcde91dfd0c48911",
"score": "0.5277276",
"text": "function isSorted(a) {\n for(var i = 1; i < a.length; i++) {\n if(a[i - 1] > a[i]) {\n console.log(\"Permutated, but not sorted array:\");\n console.log(a);\n return false;\n }\n }\n console.log(\"Permutated, and correctly sorted array:\")\n console.log(a);\n return true;\n }",
"title": ""
},
{
"docid": "03682fbe82aa92560ac55d94be26094b",
"score": "0.5272858",
"text": "function inorder( args, compar ) {\n if (!compar) compar = function(a, b) { return a > b ? 1 : 0 }\n\n for (var i=0; i<args.length - 1; i++) {\n if (compar(args[i], args[i+1]) > 0) return i;\n }\n return true;\n}",
"title": ""
},
{
"docid": "c390e860422c608ee9f022a4899ef87d",
"score": "0.52698296",
"text": "function all( arr, fun ){\n for (var i = 0 ; i <= arr.length; i ++) { \n if (!(fun(i))) { return false }; \n } \n return true;\n}",
"title": ""
},
{
"docid": "37cdda3fa03204ce077af34ff387e0f5",
"score": "0.5261737",
"text": "function shouldSortPair(firstPair, secondPair) {\n return firstPair[0] > secondPair[0];\n}",
"title": ""
},
{
"docid": "1be494cc5516c9ca5e590a24023f06f4",
"score": "0.5260762",
"text": "static defaultCompareFunction(a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n\r\n return a < b ? -1 : 1;\r\n }",
"title": ""
},
{
"docid": "70341ef537c5abb60d8e71be6a96544e",
"score": "0.525416",
"text": "function maybe(fns) {\n\n return fns.some(function (fn) {\n\n return fn();\n\n });\n\n}",
"title": ""
},
{
"docid": "cba5ce3d5e4a2b9f32b0ebfd31e66d4c",
"score": "0.5249914",
"text": "min(a, fn) {\n var o = Infinity;\n for (var i = 0, l = a[LEN]; i < l; i++) {\n var v = fn ? fn(a[i]) : a[i];\n if (v < o)\n o = v;\n }\n return o;\n }",
"title": ""
},
{
"docid": "79c0d2efa56737444c77afd9fab9d5c6",
"score": "0.5245245",
"text": "function areThereDuplicatesPointers(...args) {\n console.log(Array.isArray(arguments));\n console.log(Array.isArray(args));\n let sorted = args.sort((a, b) => a < b)\n let firstPointer = sorted[0]\n for (let i = 1; i < sorted.length; i++) {\n if (sorted[i] === firstPointer) {\n return true;\n }\n firstPointer = sorted[i];\n }\n return false;\n}",
"title": ""
},
{
"docid": "666daf4d3535183e10ecee0f66666757",
"score": "0.5220728",
"text": "function foundInOrderOfOperations(op) {\n for (let level of orderOfOperations) {\n if (op in level)\n return true;\n }\n return false;\n}",
"title": ""
},
{
"docid": "a4d322665fa4a0bbdef1ab83da391e7d",
"score": "0.5220273",
"text": "function some(arr, indicator)\n{\n for(let item of arr) {\n if(indicator(item)) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "5e1e422c564aee4aec990a53d235ca87",
"score": "0.5215275",
"text": "function Ta(t, e) {\n return t.some((t => t.isEqual(e)));\n}",
"title": ""
},
{
"docid": "1202f4f7a69f48e586597668bfc8bb8a",
"score": "0.52119106",
"text": "function compareArray(array1, array2) {\n return array1.length === array2.length && array1.sort().every(function(value, index) { return value === array2.sort()[index]});\n}",
"title": ""
},
{
"docid": "0da048ba4488675cf6f00dc97fd1f9d8",
"score": "0.52102375",
"text": "function first(a, fn, scope) {\n for (var i = 0, l = a.length; i < l; i++) {\n if (fn.call(scope || null, a[i]))\n return a[i];\n }\n return;\n }",
"title": ""
},
{
"docid": "9f139089e13db186b9f6de16c276f7e7",
"score": "0.5207875",
"text": "function combinedCompare(trainee1, trainee2) {\n let finalCompare = 0;\n for (let compareFunc of activeCompares) {\n let result = compareFunc(trainee1, trainee2);\n if (result != 0) {\n finalCompare = result;\n }\n }\n return finalCompare;\n}",
"title": ""
},
{
"docid": "d78473cd84d6be3315d4e277c39bf9fb",
"score": "0.52052486",
"text": "function every(array, func){\n //apply the function to every element of the array\n console.log(\"Running every...\");\n for(var i = 0; i < array.length; i++){\n if(!func(array[i])){\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "aeeedbbceceb2ca75bccd3e9f6aa6bea",
"score": "0.52038294",
"text": "function checkSort(arr) {\n for (var i = 1; i < arr.length-1-count; i++) {\n if (arr[i] < arr[i-1]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "e457ddd7fc2e903e85e06ebf7d0c6647",
"score": "0.52033323",
"text": "function ascendingPredicatByIndex(index){\n return function(a, b) {\n\n if( a[index] > b[index]){\n return -1;\n }\n\n if( a[index] < b[index] ){\n return 1;\n }\n\n return 0;\n }\n}",
"title": ""
},
{
"docid": "1351207b572c7ca8a546fc746f424ce6",
"score": "0.5202579",
"text": "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }",
"title": ""
}
] |
1212b1dfff38fbecefd927e0b80f8dd8 | Moves the page to the given section and slide with no animation. Anchors or index positions can be used as params. | [
{
"docid": "6063fb0253efc0bfd24651938355d7fe",
"score": "0.6552369",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\r\n setScrollingSpeed (0, 'internal');\r\n moveTo(sectionAnchor, slideAnchor);\r\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\r\n }",
"title": ""
}
] | [
{
"docid": "c8bbfd4f91c888a3e662bdd3c215390f",
"score": "0.8042382",
"text": "function moveTo(sectionAnchor,slideAnchor){var destiny=getSectionByAnchor(sectionAnchor);if(typeof slideAnchor!=='undefined'){scrollPageAndSlide(sectionAnchor,slideAnchor);}else if(destiny!=null){scrollPage(destiny);}}",
"title": ""
},
{
"docid": "83b0459d470d944a678bdacb33ff05d6",
"score": "0.767616",
"text": "function moveTo(sectionAnchor, slideAnchor){\r\n var destiny = getSectionByAnchor(sectionAnchor);\r\n\r\n if (typeof slideAnchor !== 'undefined'){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else if(destiny.length > 0){\r\n scrollPage(destiny);\r\n }\r\n }",
"title": ""
},
{
"docid": "b21542d1619dc9dd3b381b62d2534686",
"score": "0.7661242",
"text": "function moveTo(sectionAnchor, slideAnchor){\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined'){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else if(destiny.length > 0){\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "b21542d1619dc9dd3b381b62d2534686",
"score": "0.7661242",
"text": "function moveTo(sectionAnchor, slideAnchor){\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined'){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else if(destiny.length > 0){\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "b21542d1619dc9dd3b381b62d2534686",
"score": "0.7661242",
"text": "function moveTo(sectionAnchor, slideAnchor){\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined'){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else if(destiny.length > 0){\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "cfc215e3869505d0f070559d3d752e39",
"score": "0.76408803",
"text": "function moveTo(sectionAnchor, slideAnchor){\r\n var destiny = getSectionByAnchor(sectionAnchor);\r\n\r\n if (typeof slideAnchor !== 'undefined'){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else if(destiny != null){\r\n scrollPage(destiny);\r\n }\r\n }",
"title": ""
},
{
"docid": "cfc215e3869505d0f070559d3d752e39",
"score": "0.76408803",
"text": "function moveTo(sectionAnchor, slideAnchor){\r\n var destiny = getSectionByAnchor(sectionAnchor);\r\n\r\n if (typeof slideAnchor !== 'undefined'){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else if(destiny != null){\r\n scrollPage(destiny);\r\n }\r\n }",
"title": ""
},
{
"docid": "c2bc08029e40cec54720627723c6e091",
"score": "0.76214635",
"text": "function moveTo(sectionAnchor, slideAnchor){\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined'){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else if(destiny != null){\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "c2bc08029e40cec54720627723c6e091",
"score": "0.76214635",
"text": "function moveTo(sectionAnchor, slideAnchor){\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined'){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else if(destiny != null){\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "50884ed324d52571eb2603a812272c00",
"score": "0.7566107",
"text": "function moveTo(sectionAnchor, slideAnchor) {\n var destiny = getSectionByAnchor(sectionAnchor);\n\n if (typeof slideAnchor !== 'undefined') {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n } else if (destiny.length > 0) {\n scrollPage(destiny);\n }\n }",
"title": ""
},
{
"docid": "14352b5549f49b0bff3261f0963dd21c",
"score": "0.7064354",
"text": "function silentMoveTo(sectionAnchor,slideAnchor){setScrollingSpeed(0,'internal');moveTo(sectionAnchor,slideAnchor);setScrollingSpeed(originals.scrollingSpeed,'internal');}",
"title": ""
},
{
"docid": "78723f7a09a0b83b46f9c4ac4284673f",
"score": "0.6804268",
"text": "function scrollPageAndSlide(sectionAnchor,slideAnchor){var section=getSectionByAnchor(sectionAnchor);//do nothing if there's no section with the given anchor name\nif(section==null)return;var slide=getSlideByAnchor(slideAnchor,section);//we need to scroll to the section and then to the slide\nif(getAnchor(section)!==lastScrolledDestiny&&!hasClass(section,ACTIVE)){scrollPage(section,function(){scrollSlider(slide);});}//if we were already in the section\nelse{scrollSlider(slide);}}",
"title": ""
},
{
"docid": "7392db3032d9938c0e51473107b7e5b6",
"score": "0.6615342",
"text": "function scrollPage(destination, animated) {\r\n var v ={\r\n destination: destination,\r\n animated: animated,\r\n activeSection: $('.pp-section.active'),\r\n anchorLink: destination.data('anchor'),\r\n sectionIndex: destination.index('.pp-section'),\r\n toMove: destination,\r\n yMovement: getYmovement(destination),\r\n leavingSection: $('.pp-section.active').index('.pp-section') + 1\r\n };\r\n\r\n //quiting when activeSection is the target element\r\n if(v.activeSection.is(destination)){ return; }\r\n\r\n if(typeof v.animated === 'undefined'){\r\n v.animated = true;\r\n }\r\n\r\n if(typeof v.anchorLink !== 'undefined'){\r\n setURLHash(v.anchorLink, v.sectionIndex);\r\n }\r\n\r\n v.destination.addClass('active').siblings().removeClass('active');\r\n\r\n v.sectionsToMove = getSectionsToMove(v);\r\n\r\n //scrolling down (moving sections up making them disappear)\r\n if (v.yMovement === 'down') {\r\n v.translate3d = getTranslate3d();\r\n v.scrolling = '-100%';\r\n\r\n if(!options.css3){\r\n v.sectionsToMove.each(function(index){\r\n if(index != v.activeSection.index('.pp-section')){\r\n $(this).css(getScrollProp(v.scrolling));\r\n }\r\n });\r\n }\r\n\r\n v.animateSection = v.activeSection;\r\n }\r\n\r\n //scrolling up (moving section down to the viewport)\r\n else {\r\n v.translate3d = 'translate3d(0px, 0px, 0px)';\r\n v.scrolling = '0';\r\n\r\n v.animateSection = destination;\r\n }\r\n\r\n $.isFunction(options.onLeave) && options.onLeave.call(this, v.leavingSection, (v.sectionIndex + 1), v.yMovement);\r\n\r\n performMovement(v);\r\n\r\n activateMenuElement(v.anchorLink);\r\n activateNavDots(v.anchorLink, v.sectionIndex);\r\n lastScrolledDestiny = v.anchorLink;\r\n\r\n var timeNow = new Date().getTime();\r\n lastAnimation = timeNow;\r\n }",
"title": ""
},
{
"docid": "dbc69f864f03a8007d940dd2aa2e5e41",
"score": "0.65763414",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\n setScrollingSpeed (0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "dbc69f864f03a8007d940dd2aa2e5e41",
"score": "0.65763414",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\n setScrollingSpeed (0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "dbc69f864f03a8007d940dd2aa2e5e41",
"score": "0.65763414",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\n setScrollingSpeed (0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "dbc69f864f03a8007d940dd2aa2e5e41",
"score": "0.65763414",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\n setScrollingSpeed (0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "dbc69f864f03a8007d940dd2aa2e5e41",
"score": "0.65763414",
"text": "function silentMoveTo(sectionAnchor, slideAnchor){\n setScrollingSpeed (0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed (originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "61c5e524bba82f21e168d60a8a8bbeb2",
"score": "0.6517136",
"text": "function moveSlideRight(section){moveSlide('right',section);}",
"title": ""
},
{
"docid": "5df0d24da6fe39f538674042b650041b",
"score": "0.64955246",
"text": "function silentMoveTo(sectionAnchor, slideAnchor) {\n setScrollingSpeed(0, 'internal');\n moveTo(sectionAnchor, slideAnchor);\n setScrollingSpeed(originals.scrollingSpeed, 'internal');\n }",
"title": ""
},
{
"docid": "bd69c36a129bca708bc2b54d492a4b6c",
"score": "0.64909846",
"text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //do nothing if there's no section with the given anchor name\n if(!section.length) return;\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "bd69c36a129bca708bc2b54d492a4b6c",
"score": "0.64909846",
"text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //do nothing if there's no section with the given anchor name\n if(!section.length) return;\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "633a349c1f38c152be9a02931d15799d",
"score": "0.6483153",
"text": "function scrollPageAndSlide(sectionAnchor, slideAnchor){\r\n var section = getSectionByAnchor(sectionAnchor);\r\n\r\n //do nothing if there's no section with the given anchor name\r\n if(section == null) return;\r\n\r\n var slide = getSlideByAnchor(slideAnchor, section);\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (getAnchor(section) !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(slide);\r\n }\r\n }",
"title": ""
},
{
"docid": "633a349c1f38c152be9a02931d15799d",
"score": "0.6483153",
"text": "function scrollPageAndSlide(sectionAnchor, slideAnchor){\r\n var section = getSectionByAnchor(sectionAnchor);\r\n\r\n //do nothing if there's no section with the given anchor name\r\n if(section == null) return;\r\n\r\n var slide = getSlideByAnchor(slideAnchor, section);\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (getAnchor(section) !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(slide);\r\n }\r\n }",
"title": ""
},
{
"docid": "681ba5a3b92d525b01fec3b950b41b4b",
"score": "0.6466392",
"text": "function scrollPageAndSlide(sectionAnchor, slideAnchor){\n var section = getSectionByAnchor(sectionAnchor);\n\n //do nothing if there's no section with the given anchor name\n if(section == null) return;\n\n var slide = getSlideByAnchor(slideAnchor, section);\n\n //we need to scroll to the section and then to the slide\n if (getAnchor(section) !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(slide);\n }\n }",
"title": ""
},
{
"docid": "0711856e2ec48f2cf028080d190842fa",
"score": "0.6455317",
"text": "function scrollToAnchor(){var anchors=getAnchorsURL();var sectionAnchor=anchors.section;var slideAnchor=anchors.slide;if(sectionAnchor){//if theres any #\nif(options.animateAnchor){scrollPageAndSlide(sectionAnchor,slideAnchor);}else{silentMoveTo(sectionAnchor,slideAnchor);}}}",
"title": ""
},
{
"docid": "3e66dcae8e16d1e87a8093721a81a784",
"score": "0.64530003",
"text": "function scrollPageAndSlide(destiny, slide) {\n var section = getSectionByAnchor(destiny);\n\n //do nothing if there's no section with the given anchor name\n if (!section.length) return;\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)) {\n scrollPage(section, function () {\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else {\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "8e6e67612ddd5ff502e5fcbbe7e596c3",
"score": "0.6446828",
"text": "function scrollPageAndSlide(destiny, slide){\r\n var section = getSectionByAnchor(destiny);\r\n\r\n //do nothing if there's no section with the given anchor name\r\n if(!section.length) return;\r\n\r\n //default slide\r\n if (typeof slide === 'undefined') {\r\n slide = 0;\r\n }\r\n\r\n //we need to scroll to the section and then to the slide\r\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\r\n scrollPage(section, function(){\r\n scrollSlider(section, slide);\r\n });\r\n }\r\n //if we were already in the section\r\n else{\r\n scrollSlider(section, slide);\r\n }\r\n }",
"title": ""
},
{
"docid": "4e3b198292ac243b8aff6bfc8c11c198",
"score": "0.6431923",
"text": "function scrollPageAndSlide(sectionAnchor, slideAnchor){\n var section = getSectionByAnchor(sectionAnchor);\n\n //do nothing if there's no section with the given anchor name\n if(section == null) return;\n\n var slide = getSlideByAnchor(slideAnchor, section);\n\n //we need to scroll to the section and then to the slide\n if (sectionAnchor !== lastScrolledDestiny && !hasClass(section, ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(slide);\n }\n }",
"title": ""
},
{
"docid": "343330f0cee7f44da41fe3dfeb637e28",
"score": "0.64289355",
"text": "function moveSlideLeft(section){moveSlide('left',section);}",
"title": ""
},
{
"docid": "efd29fb6f0d9b03489d82bab071945a5",
"score": "0.6421568",
"text": "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "efd29fb6f0d9b03489d82bab071945a5",
"score": "0.6421568",
"text": "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "efd29fb6f0d9b03489d82bab071945a5",
"score": "0.6421568",
"text": "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "efd29fb6f0d9b03489d82bab071945a5",
"score": "0.6421568",
"text": "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "19061f7310471bca0c461df7ad97223e",
"score": "0.6409712",
"text": "function moveSlide(direction,section){var activeSection=section==null?$(SECTION_ACTIVE_SEL)[0]:section;var slides=$(SLIDES_WRAPPER_SEL,activeSection)[0];// more than one slide needed and nothing should be sliding\nif(slides==null||slideMoving||$(SLIDE_SEL,slides).length<2){return;}var currentSlide=$(SLIDE_ACTIVE_SEL,slides)[0];var destiny=null;if(direction==='left'){destiny=prevUntil(currentSlide,SLIDE_SEL);}else{destiny=nextUntil(currentSlide,SLIDE_SEL);}//isn't there a next slide in the secuence?\nif(destiny==null){//respect loopHorizontal settin\nif(!options.loopHorizontal)return;var slideSiblings=siblings(currentSlide);if(direction==='left'){destiny=slideSiblings[slideSiblings.length-1];//last\n}else{destiny=slideSiblings[0];//first\n}}slideMoving=true&&!FP.test.isTesting;landscapeScroll(slides,destiny,direction);}",
"title": ""
},
{
"docid": "12c2e538f73d87dcc3885ae2bf8ead1a",
"score": "0.6407844",
"text": "function scrollPageAndSlide(sectionAnchor, slideAnchor){\n var section = getSectionByAnchor(sectionAnchor);\n\n //do nothing if there's no section with the given anchor name\n if(!section.length) return;\n\n var slide = getSlideByAnchor(slideAnchor, section);\n\n //we need to scroll to the section and then to the slide\n if (sectionAnchor !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(slide);\n }\n }",
"title": ""
},
{
"docid": "f002096d669adb8edc981e92608edc16",
"score": "0.6406942",
"text": "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "f002096d669adb8edc981e92608edc16",
"score": "0.6406942",
"text": "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "064171877453ca5e6a3e8d10521e77b5",
"score": "0.63380307",
"text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "064171877453ca5e6a3e8d10521e77b5",
"score": "0.63380307",
"text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "064171877453ca5e6a3e8d10521e77b5",
"score": "0.63380307",
"text": "function scrollPageAndSlide(destiny, slide){\n var section = getSectionByAnchor(destiny);\n\n //default slide\n if (typeof slide === 'undefined') {\n slide = 0;\n }\n\n //we need to scroll to the section and then to the slide\n if (destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE)){\n scrollPage(section, function(){\n scrollSlider(section, slide);\n });\n }\n //if we were already in the section\n else{\n scrollSlider(section, slide);\n }\n }",
"title": ""
},
{
"docid": "5feaf561b083ed9b9a37fa912589a9c6",
"score": "0.633071",
"text": "function MoveFirstSection(sectionNUM) {\n var $pages = $('#myModulesContainer > section');\n if ($pages.length === 0) return;\n if (!sectionNUM) sectionNUM = 1;\n /**\n * Sometimes the user choose to scroll to a page, and then hide it from\n * homepage, and if it was the last page the scroll isn't working. We like\n * to prevent such cases so we scroll the user to the last page instead.\n */\n if (sectionNUM > $pages.length) sectionNUM = $pages.length;\n /**\n * Fix Section Number - At the previews version of this function we used\n * the next selector to get the pages `$(\"section\")`. The selector return\n * all the website sections (include the homepage), and on the wizard we\n * start the section counting from `1` related to this selector. Now we fix\n * the selector and choose only the website pages, so we decrease the homepage\n * section for not taking actions on existing user. Basically we need to stop\n * scrolling users related to section number, and change the homepage to works\n * like to promos, there we scroll to pages related to the page id.\n */\n sectionNUM -= 1;\n /**\n * Scroll Offset - Some layouts has some padding that we need to scroll up\n * to it, and on mobile it will be always 60 because we have the same layout.\n */\n var offset = findBootstrapEnvironment() != 'xs' ? menuScrollOffset : menuScrollOffset_mobile;\n $('html, body').stop().animate({\n scrollTop: ($pages.eq(sectionNUM).offset().top - offset)\n }, 1250, 'easeInOutExpo');\n}",
"title": ""
},
{
"docid": "5f3f252b88fe2bf33a0a17889b03d0d2",
"score": "0.6328655",
"text": "function goToTargetSection( linkPos ) {\r\n\t\t$.smoothScroll( {\r\n\t\t\tscrollTarget: scrollTarget, \r\n\t\t\tafterScroll: function() {\r\n\t\t\t\tcontent.slick( \"slickGoTo\", linkPos );\r\n\t\t\t}\r\n\t\t} );\r\n\t}",
"title": ""
},
{
"docid": "f1d90b51a3faa0fbfb749a136256027c",
"score": "0.6266929",
"text": "function scrollToSection(event) {\n event.preventDefault();\n var $section = $($(this).attr('href')); \n $('html, body').animate({\n scrollTop: $section.offset().top\n }, 500);\n }",
"title": ""
},
{
"docid": "9520a3f8511ce3c8dc72ec975f53e3e8",
"score": "0.626506",
"text": "function scrollToSection(evt){\n //get which nav menu item is chosen\n const secItem = evt.target;\n //get the content of the item to see which section\n const anchorID = secItem.getAttribute('href');\n //get the section to go to\n const sectionTo = document.querySelector(anchorID);\n \n \n sectionTo.scrollTo({top: 100,\n left: 100,\n behavior: 'smooth'});\n\n \n \n \n}",
"title": ""
},
{
"docid": "2f4c0c0b13c115385721bd0f1cfd342a",
"score": "0.62635785",
"text": "function moveSlide(direction, section){\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\n\n // more than one slide needed and nothing should be sliding\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if(direction === 'left'){\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n }else{\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(destiny == null){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n var slideSiblings = siblings(currentSlide);\n if(direction === 'left'){\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n }else{\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "2f4c0c0b13c115385721bd0f1cfd342a",
"score": "0.62635785",
"text": "function moveSlide(direction, section){\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\n\n // more than one slide needed and nothing should be sliding\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if(direction === 'left'){\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n }else{\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(destiny == null){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n var slideSiblings = siblings(currentSlide);\n if(direction === 'left'){\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n }else{\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "fd106fde441c0f65ab964208d82325ab",
"score": "0.6240015",
"text": "function moveSlide(direction, section){\r\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\r\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = prevUntil(currentSlide, SLIDE_SEL);\r\n }else{\r\n destiny = nextUntil(currentSlide, SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(destiny == null){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n var slideSiblings = siblings(currentSlide);\r\n if(direction === 'left'){\r\n destiny = slideSiblings[slideSiblings.length - 1]; //last\r\n }else{\r\n destiny = slideSiblings[0]; //first\r\n }\r\n }\r\n\r\n slideMoving = true && !FP.test.isTesting;\r\n landscapeScroll(slides, destiny, direction);\r\n }",
"title": ""
},
{
"docid": "cc6b0989a5b5ce414be945cac1b001f5",
"score": "0.6220395",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'prev'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'prev'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny);\n }",
"title": ""
},
{
"docid": "cc6b0989a5b5ce414be945cac1b001f5",
"score": "0.6220395",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'prev'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'prev'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny);\n }",
"title": ""
},
{
"docid": "cc6b0989a5b5ce414be945cac1b001f5",
"score": "0.6220395",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'prev'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'prev'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny);\n }",
"title": ""
},
{
"docid": "d032e9f9d40015a13f20218d508c20b8",
"score": "0.62180394",
"text": "function moveSlideRight(section){\r\n moveSlide('right', section);\r\n }",
"title": ""
},
{
"docid": "d032e9f9d40015a13f20218d508c20b8",
"score": "0.62180394",
"text": "function moveSlideRight(section){\r\n moveSlide('right', section);\r\n }",
"title": ""
},
{
"docid": "d032e9f9d40015a13f20218d508c20b8",
"score": "0.62180394",
"text": "function moveSlideRight(section){\r\n moveSlide('right', section);\r\n }",
"title": ""
},
{
"docid": "1ab0609aa4b8285f7f2740e3e66d3fe5",
"score": "0.6202846",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'left'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'left'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "1ab0609aa4b8285f7f2740e3e66d3fe5",
"score": "0.6202846",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'left'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'left'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "1ab0609aa4b8285f7f2740e3e66d3fe5",
"score": "0.6202846",
"text": "function moveSlide(direction, section){\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'left'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'left'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "06f5f23cefbe5b8d2e178233d129cc67",
"score": "0.62028277",
"text": "function scrollTo(section) {\n $('html, body').animate({\n scrollTop: $('section[data-section-name=' + section + ']').offset().top\n }, 750, 'swing');\n }",
"title": ""
},
{
"docid": "7e9156badc58b2d7256fe4e47c48729f",
"score": "0.6201758",
"text": "function moveSlide(direction, section){\r\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\r\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = prevUntil(currentSlide, SLIDE_SEL);\r\n }else{\r\n destiny = nextUntil(currentSlide, SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(destiny == null){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n var slideSiblings = siblings(currentSlide);\r\n if(direction === 'left'){\r\n destiny = slideSiblings[slideSiblings.length - 1]; //last\r\n }else{\r\n destiny = slideSiblings[0]; //first\r\n }\r\n }\r\n\r\n slideMoving = true && !FP.test.isTesting;\r\n landscapeScroll(slides, destiny, direction);\r\n }",
"title": ""
},
{
"docid": "56011ec651c2c9bc7710a4083d509600",
"score": "0.6183306",
"text": "function moveSectionDown(){var next=nextUntil($(SECTION_ACTIVE_SEL)[0],SECTION_SEL);//looping to the top if there's no more sections below\nif(!next&&(options.loopBottom||options.continuousVertical)){next=$(SECTION_SEL)[0];}if(next!=null){scrollPage(next,null,false);}}",
"title": ""
},
{
"docid": "9a1679e795c2a60c3c8d6d80d2e75cec",
"score": "0.61722785",
"text": "function scrollToAnchor(){\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n\n if(section){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }",
"title": ""
},
{
"docid": "a248a994531a5e7f72d8ea495800ae59",
"score": "0.61671686",
"text": "function moveSlideRight(section){\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "a248a994531a5e7f72d8ea495800ae59",
"score": "0.61671686",
"text": "function moveSlideRight(section){\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "a248a994531a5e7f72d8ea495800ae59",
"score": "0.61671686",
"text": "function moveSlideRight(section){\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "a248a994531a5e7f72d8ea495800ae59",
"score": "0.61671686",
"text": "function moveSlideRight(section){\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "a248a994531a5e7f72d8ea495800ae59",
"score": "0.61671686",
"text": "function moveSlideRight(section){\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "c9395485959239e26ca568ef3b187c38",
"score": "0.6165819",
"text": "function scrollToAnchor(){\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = value[0];\n var slide = value[1];\n\n if(section){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }",
"title": ""
},
{
"docid": "c9395485959239e26ca568ef3b187c38",
"score": "0.6165819",
"text": "function scrollToAnchor(){\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = value[0];\n var slide = value[1];\n\n if(section){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }",
"title": ""
},
{
"docid": "87c7927ce68287a383c575d06d8c47c9",
"score": "0.6135404",
"text": "function moveSlide(direction, section){\r\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\r\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\r\n var numSlides = slides.find(SLIDE_SEL).length;\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (!slides.length || slideMoving || numSlides < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = currentSlide.prev(SLIDE_SEL);\r\n }else{\r\n destiny = currentSlide.next(SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(!destiny.length){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n if(direction === 'left'){\r\n destiny = currentSlide.siblings(':last');\r\n }else{\r\n destiny = currentSlide.siblings(':first');\r\n }\r\n }\r\n\r\n slideMoving = true;\r\n\r\n landscapeScroll(slides, destiny, direction);\r\n }",
"title": ""
},
{
"docid": "e758231771b3408e06174ca9e1a5f1ea",
"score": "0.6112115",
"text": "function moveSlideLeft(section){\r\n moveSlide('left', section);\r\n }",
"title": ""
},
{
"docid": "e758231771b3408e06174ca9e1a5f1ea",
"score": "0.6112115",
"text": "function moveSlideLeft(section){\r\n moveSlide('left', section);\r\n }",
"title": ""
},
{
"docid": "e758231771b3408e06174ca9e1a5f1ea",
"score": "0.6112115",
"text": "function moveSlideLeft(section){\r\n moveSlide('left', section);\r\n }",
"title": ""
},
{
"docid": "a14254921c0e6d26223a421f0e140912",
"score": "0.6110699",
"text": "function goToByScroll(datasection) {\n htmlbody.animate({\n scrollTop: $('.page-section[data-section=\"' + datasection + '\"]').offset().top\n }, 2000, 'easeInOutQuint');\n }",
"title": ""
},
{
"docid": "909134e2a285308171377e99944c74b3",
"score": "0.6084042",
"text": "function scrollToAnchor(){\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var sectionAnchor = decodeURIComponent(value[0]);\n var slideAnchor = decodeURIComponent(value[1]);\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "57d00aa4989e47530722b450683d72f3",
"score": "0.6084037",
"text": "function moveSlide(direction, section) {\n var activeSection = typeof section === 'undefined' ? $(SECTION_ACTIVE_SEL) : section;\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if (direction === 'left') {\n destiny = currentSlide.prev(SLIDE_SEL);\n } else {\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if (!destiny.length) {\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if (direction === 'left') {\n destiny = currentSlide.siblings(':last');\n } else {\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny, direction);\n }",
"title": ""
},
{
"docid": "2f1fd34b66f6471cdfef0bcc4ecc2b78",
"score": "0.60814476",
"text": "function scrollToAnchor(){\r\n //getting the anchor link in the URL and deleting the `#`\r\n var value = window.location.hash.replace('#', '').split('/');\r\n var sectionAnchor = decodeURIComponent(value[0]);\r\n var slideAnchor = decodeURIComponent(value[1]);\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "c5de70e65a07f908028945c38ead3fb8",
"score": "0.6074513",
"text": "function scrollOnViewMove () {\n let newActiveSection = \"section\"+ whatSectionIsInViewport();\n console.log(newActiveSection);\n if (newActiveSection !== currentActiveSectionId) {\n setActiveSection(document.getElementById(newActiveSection));\n };\n}",
"title": ""
},
{
"docid": "84b64abe19da51cd227988ca4e99afb2",
"score": "0.60694665",
"text": "function moveSlideLeft(section){\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "84b64abe19da51cd227988ca4e99afb2",
"score": "0.60694665",
"text": "function moveSlideLeft(section){\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "84b64abe19da51cd227988ca4e99afb2",
"score": "0.60694665",
"text": "function moveSlideLeft(section){\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "84b64abe19da51cd227988ca4e99afb2",
"score": "0.60694665",
"text": "function moveSlideLeft(section){\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "84b64abe19da51cd227988ca4e99afb2",
"score": "0.60694665",
"text": "function moveSlideLeft(section){\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "b4b96ec431dfecd629b9e256333698c1",
"score": "0.60690147",
"text": "function scrollToAnchor() {\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var sectionAnchor = decodeURIComponent(value[0]);\n var slideAnchor = decodeURIComponent(value[1]);\n\n if (sectionAnchor) {\n //if theres any #\n if (options.animateAnchor) {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n } else {\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }",
"title": ""
},
{
"docid": "0a06ea768d0bcfca1deb8923c566e944",
"score": "0.60628784",
"text": "function goToSection(e, direction) {\n //get hash from current view (assumes it replects current view)\n hash = window.location.hash;\n\n if (hash == null) {\n hash = '#section1';\n }\n\n console.log('hash:', hash);\n // determine list of sectionHashes list\n hashListLength = sectionHashes.length;\n console.log('List length:', hashListLength);\n //get the integer location of current hash in list\n hashLocation = returnHashLocation(hash);\n console.log('Hash location:', hashLocation);\n\n //if scroll direction is *up*\n if ((direction === 'up') && (hashLocation !== 0)) {\n //move up on section if not already at top (otherwise do nothing)\n hashLocation = hashLocation - 1;\n console.log('New hash location (upscroll)', hashLocation);\n hash = sectionHashes[hashLocation];\n console.log('New hash:', hash);\n //if scroll direction is *down*\n } else if ((direction === 'down') && (hashLocation < (hashListLength - 1))) {\n //move down a section if not already at bottom\n hashLocation = hashLocation + 1;\n console.log('New hash location (downscroll)', hashLocation);\n hash = sectionHashes[hashLocation];\n console.log('New hash:', hash);\n // else if hash location is first or last item in list do nothing\n } else {\n console.log('do nothing!');\n } // smooth-scroll to the appropriate section\n console.log('-----------------------------');\n e.preventDefault();\n $('html, body').animate({\n scrollTop: $(hash).offset().top\n }, 800, function(){\n \n // Add hash (#) to URL when done scrolling (default click behavior)\n window.location.hash = hash;\n });\n\n}",
"title": ""
},
{
"docid": "1f93ec89bd85fb86d356c963a7d24419",
"score": "0.6060484",
"text": "function scrollToSection($section, time=1000){\n $(\"html, body\").animate({ scrollTop:$section.position().top - $(\"header\").height() - 50 },time);\n }",
"title": ""
},
{
"docid": "5c5844470816395fa4f9e581ac4e5a20",
"score": "0.6029734",
"text": "function scroll_to_section(evt){\n //if click on A or LI \n if(evt.target.nodeName == 'A' || evt.target.nodeName == 'LI'){\n const targeted_section_text = evt.target.textContent;\n const section_number = Number(targeted_section_text.split(\" \")[1]);\n let sections = document.querySelectorAll('section');\n let targeted_section = sections[section_number - 1];\n let section_y = targeted_section.offsetTop;\n window.scrollTo({left:0,top:section_y - SECTION_FIT_OFFSET,behavior:'smooth'});\n }\n}",
"title": ""
},
{
"docid": "ff2ba6bc95b6e54371da34d285aef809",
"score": "0.6025464",
"text": "function moveSlideRight(section) {\n moveSlide('right', section);\n }",
"title": ""
},
{
"docid": "f9cf054be5d2cbeb59212366b88e42ba",
"score": "0.5989561",
"text": "function moveSectionUp(){var prev=prevUntil($(SECTION_ACTIVE_SEL)[0],SECTION_SEL);//looping to the bottom if there's no more sections above\nif(!prev&&(options.loopTop||options.continuousVertical)){prev=last($(SECTION_SEL));}if(prev!=null){scrollPage(prev,null,true);}}",
"title": ""
},
{
"docid": "f093ab3abaf62c00426a63def8b953a4",
"score": "0.5982464",
"text": "function slideTo(index) {\n\t slide(index);\n\t }",
"title": ""
},
{
"docid": "cba1f7281d60fcc32e47f6707c6d95e4",
"score": "0.5955699",
"text": "function scrollToSection(event) {\n event.preventDefault();\n var $section = $($(this).attr(\"href\"));\n $(\"html, body\").animate(\n {\n scrollTop: $section.offset().top - $(\"#nav\").outerHeight() * 1.1\n },\n 500\n );\n }",
"title": ""
},
{
"docid": "e18a2b7044fd7cf3a0a8f0e793da0c98",
"score": "0.59295905",
"text": "function moveSlideLeft(section) {\n moveSlide('left', section);\n }",
"title": ""
},
{
"docid": "64cafbb4fccec1274f151ffb52b0cb43",
"score": "0.59218633",
"text": "function moveToSlide() {\n $('.menu li').click(function (e) {\n e.preventDefault();\n var slideIndex = $(this).attr('data-link-id');\n console.log(slideIndex);\n slickWrapper.slickElement.slick('slickGoTo', parseInt(slideIndex));\n });\n }",
"title": ""
},
{
"docid": "b8d5892a587caad57d141a85bc86a163",
"score": "0.5898488",
"text": "function go_to_slide(num) {\n $($(\"#home_slide_nav a\")[current_slide-1]).removeClass(\"home_slide_nav_selected\");\n $($(\"#home_slide_nav a\")[num-1]).addClass(\"home_slide_nav_selected\");\n $(\"#home_slide_holder\").animate({\n left: (num - 1) * slide_width * -1\n });\n window.location.hash = num;\n current_slide = num; \n }",
"title": ""
},
{
"docid": "6bafd9927266e0120bd6a44559725a43",
"score": "0.58857554",
"text": "function scrollToSection() {\n let section = document.getElementById(target_section);\n section.scrollIntoView({ behavior: \"smooth\" });\n}",
"title": ""
},
{
"docid": "fe91311756d484819f5f5817df691299",
"score": "0.5864587",
"text": "function nextSection(currentSection, nextSection) { \n document.querySelector('#' + currentSection).style.display = \"none\"; // Hides current section\n document.querySelector('#' + nextSection).style.display = \"block\"; // Shows next section\n window.scrollTo(0,0); // Scrolls to the top of the page\n}",
"title": ""
},
{
"docid": "d32b9b75c4b9eb1cccaf90d03c57bf1b",
"score": "0.58629525",
"text": "function moveSectionDown(){\r\n var next = nextUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\r\n\r\n //looping to the top if there's no more sections below\r\n if(!next &&\r\n (options.loopBottom || options.continuousVertical)){\r\n next = $(SECTION_SEL)[0];\r\n }\r\n\r\n if(next != null){\r\n scrollPage(next, null, false);\r\n }\r\n }",
"title": ""
},
{
"docid": "d32b9b75c4b9eb1cccaf90d03c57bf1b",
"score": "0.58629525",
"text": "function moveSectionDown(){\r\n var next = nextUntil($(SECTION_ACTIVE_SEL)[0], SECTION_SEL);\r\n\r\n //looping to the top if there's no more sections below\r\n if(!next &&\r\n (options.loopBottom || options.continuousVertical)){\r\n next = $(SECTION_SEL)[0];\r\n }\r\n\r\n if(next != null){\r\n scrollPage(next, null, false);\r\n }\r\n }",
"title": ""
},
{
"docid": "281b39c6bf2cc09a56160f02f17dd345",
"score": "0.58556616",
"text": "function goToByScroll(dataslide, mstime) {\n $('html,body').animate({\n scrollTop: $('.slide[data-slide=\"' + dataslide + '\"]').offset().top\n }, mstime);\n setActivePage(dataslide);\n}",
"title": ""
}
] |
0d901767eaed776e083e83e229f48cbc | Go through unresolved queue and move tasks who's dependencies have been completed to ready queue or fail them | [
{
"docid": "13ed757f5728ca6551afbfc4aad967f0",
"score": "0.76939833",
"text": "resolveTasks() {\n const queueUnresolved = this.queueUnresolved;\n\n let i = 0, l = queueUnresolved.length;\n for (; i < l; i++) {\n const unresolvedTask = queueUnresolved[i];\n const resolution = tryResolve(unresolvedTask);\n switch (resolution) {\n case ResolutionType.READY:\n //remove task from unresolved queue to prevent infinite recursion in case \"resolveTasks\" is attempted again inside task initializer\n queueUnresolved.splice(i, 1);\n\n //set state of task to READY\n unresolvedTask.state.set(TaskState.READY);\n\n //attempt to start the task\n this.startTask(unresolvedTask);\n\n //task start could have altered unresolved queue, re-initialize iteration\n i = 0;\n l = queueUnresolved.length;\n\n break;\n case ResolutionType.FAILED:\n queueUnresolved.splice(i, 1);\n l--;\n i--;\n break;\n }\n }\n }",
"title": ""
}
] | [
{
"docid": "3f6a37bd5aa278dda46ea9073205f440",
"score": "0.6839722",
"text": "_processQueue() {\n // eslint-disable-next-line no-empty\n while (this._tryToStartAnother()) {}\n }",
"title": ""
},
{
"docid": "2a620ed415156fe0f0701e0e398703d5",
"score": "0.6741149",
"text": "_queueResolve() {\n // Just popping an item. We just need to queue to shrink,\n // so items in the queue aren't always the non resolved promises!\n this.running.pop();\n\n if (this.queue.length > 0 && this.running.length < this.limit) {\n const next = this.queue.shift();\n this.running.push(next);\n next.resolve();\n }\n }",
"title": ""
},
{
"docid": "ce92c9dd4d08a73843ab5bf718688fcd",
"score": "0.64598495",
"text": "function checkResolveQueue() {\n \n if (RESOLVE_QUEUE.length > 0) {\n var resolveItem = RESOLVE_QUEUE.shift();\n resolveData(resolveItem, \n function () {\n setTimeout(checkResolveQueue, RESOLVE_INTERVAL);\n }\n );\n }\n else {\n setTimeout(checkResolveQueue, RESOLVE_INTERVAL);\n }\n}",
"title": ""
},
{
"docid": "ef91ab6a44dbb39093c0f825c5a49a68",
"score": "0.6450122",
"text": "function queue (opts) {\n return function run (tasks) {\n let state = []\n return new Promise((resolve, reject) => {\n function next (res) {\n state.push(res)\n if (tasks.length) {\n let task = tasks.shift()\n // console.log( task.name )\n return task(opts)\n .then(next)\n }\n\n // The first state is invalid\n state.shift()\n resolve(state)\n }\n\n Promise.resolve()\n .then(next)\n .catch(reject)\n })\n }\n}",
"title": ""
},
{
"docid": "ac3203784768c8af59b2b15f467c5d23",
"score": "0.6416068",
"text": "function processQueue() {\n if (queue.length > 0) {\n working = true;\n setTimeout(function () {\n if (queue.length == 1) {\n working = false;\n }\n queue.shift().cb();\n processQueue();\n }, queue[0].delay);\n }\n }",
"title": ""
},
{
"docid": "f5656bc9e03442ffd872f8067c90630e",
"score": "0.6365788",
"text": "continue_() {\n // If all of the added tasks have finished, then call completion callbacks.\n if (Object.keys(this.addedTasks_).length ==\n Object.keys(this.finishedTasks_).length) {\n for (let index = 0; index < this.completionCallbacks_.length; index++) {\n const callback = this.completionCallbacks_[index];\n callback();\n }\n this.completionCallbacks_ = [];\n return;\n }\n\n for (const name in this.pendingTasks_) {\n const task = this.pendingTasks_[name];\n let dependencyMissing = false;\n for (let index = 0; index < task.dependencies.length; index++) {\n const dependency = task.dependencies[index];\n // Check if the dependency has finished.\n if (!this.finishedTasks_[dependency]) {\n dependencyMissing = true;\n }\n }\n // All dependences finished, therefore start the task.\n if (!dependencyMissing) {\n delete this.pendingTasks_[task.name];\n task.closure(this.finish_.bind(this, task));\n }\n }\n }",
"title": ""
},
{
"docid": "8cebaee00db91937531ef43d7fb17ab6",
"score": "0.626595",
"text": "function processQueue() {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(queueItem) {\n var skip = queueItem.scope && queueItem.scope.$$destroyed;\n if (!skip) {\n queueItem.callback();\n }\n });\n\n if (digest) $rootScope.$digest();\n }",
"title": ""
},
{
"docid": "e09bcb15f644f0c830358d71d0250889",
"score": "0.61504495",
"text": "function processQueue() {\n var current = undefined;\n if (wm.get(this).error && wm.get(this).failure) {\n wm.get(this).failure.call(this, wm.get(this).error);\n wm.get(this).error = undefined;\n wm.get(this).results = [];\n if (wm.get(this).always) {\n wm.get(this).always();\n }\n } else if (wm.get(this).results.length && (wm.get(this).success || wm.get(this).always)) {\n var resolver = wm.get(this).success || wm.get(this).always;\n while (wm.get(this).results.length) {\n current = resolver(wm.get(this).results.shift());\n if (wm.get(this).next && current !== undefined) {\n wm.get(this).next.resolve(current);\n }\n }\n }\n}",
"title": ""
},
{
"docid": "37048b707d5a6e97a187266e75159288",
"score": "0.61070824",
"text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }",
"title": ""
},
{
"docid": "31520ae57d02b84d479861834ac9d7c9",
"score": "0.6103618",
"text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }",
"title": ""
},
{
"docid": "a409f7589ff77e1d7bace65f1d42ff27",
"score": "0.6082005",
"text": "function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }",
"title": ""
},
{
"docid": "a9470e25c8b40c047de9aaadaa2d82be",
"score": "0.60760033",
"text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }",
"title": ""
},
{
"docid": "a9470e25c8b40c047de9aaadaa2d82be",
"score": "0.60760033",
"text": "function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }",
"title": ""
},
{
"docid": "4e0848b469ef447ffbc2cf68abf737d5",
"score": "0.60699135",
"text": "function processQueue () {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function (callback) { callback(); });\n\n if (digest) $rootScope.$digest();\n }",
"title": ""
},
{
"docid": "82f3cb22125b4f8eec29eba079c1db42",
"score": "0.60581475",
"text": "removeFinishedTasks() {\r\n\t\tthis.tasks = this.tasks.filter(task => !task.isDone);\r\n\t}",
"title": ""
},
{
"docid": "b8fc5b13f8e6630f75f6237a9557da6a",
"score": "0.60302603",
"text": "moveFromWaitingToQueue(pullRequestId: string) {\n const landRequest = this.waitingToLand.find(\n req => req.pullRequestId === pullRequestId,\n );\n if (!landRequest) {\n Logger.error(\n {\n waitingToLand: this.waitingToLand,\n pullRequestId,\n },\n 'Unable to find landrequest to move to queue',\n );\n return;\n }\n Logger.info(\n {\n landRequest,\n },\n 'Moving landRequest from waiting to queue',\n );\n\n this.waitingToLand = this.waitingToLand.filter(\n req => req.pullRequestId !== pullRequestId,\n );\n landRequest.createdTime = new Date();\n this.enqueue(landRequest);\n this.next();\n }",
"title": ""
},
{
"docid": "611ea6834b51576487b0d8bc60fbe444",
"score": "0.60115206",
"text": "dequeue(uuid) {\n let that = this;\n if (uuid) {\n var task = this.#list.findIndex((item) => item.uuid === uuid)\n } else {\n var task = this.#list.shift();\n }\n if (!task) return false\n\n this.#pendingList.push(task);\n this._taskHandle(task);\n task.timeoutHandle = setTimeout(() => {\n if (!task.done) {\n that.resume(task.uuid)\n }\n }, task.timeout);\n return true\n }",
"title": ""
},
{
"docid": "f62801a80c9862cc4ccedb08b2aa0820",
"score": "0.5982145",
"text": "resolve() {\n this.cleanup();\n\n for (const job of this.jobs)\n job.resolve(false);\n\n this.jobs.length = 0;\n }",
"title": ""
},
{
"docid": "8d8b6d107e16d77099d74703d313973c",
"score": "0.5971225",
"text": "ensureDeadlineQueue() {\n if (this.deadlineQueueReady) {\n return this.deadlineQueueReady;\n }\n return this.deadlineQueueReady = this._createQueue(\n this.deadlineQueue\n ).catch(err => {\n // Don't cache negative results\n this.deadlineQueueReady = null;\n throw err;\n });\n }",
"title": ""
},
{
"docid": "fbf34a18bc9a491ff9808f82dd076447",
"score": "0.59572995",
"text": "function runQueue() {\n return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : Promise.resolve();\n }",
"title": ""
},
{
"docid": "32391ef52b2a39df15dc9dc5cbb77f6d",
"score": "0.5951118",
"text": "function checkQueue() {\n if (resolveQueue.length !== 0) {\n currentlyResolving.data = resolveQueue[0];\n triggerResolve();\n } else if(modalIsOpen){\n $('#conflictmodal').closeModal();\n modalIsOpen = false;\n }\n }",
"title": ""
},
{
"docid": "ba88d973fbf09e6896acc7949aa836f9",
"score": "0.5939896",
"text": "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}",
"title": ""
},
{
"docid": "ba88d973fbf09e6896acc7949aa836f9",
"score": "0.5939896",
"text": "function processQueue(){queue.forEach(function(func){$mdUtil.nextTick(func);});queue=[];}",
"title": ""
},
{
"docid": "4fcda4e29ab460cfa13c79cdc8a01fc5",
"score": "0.59340596",
"text": "function moveAvailable() {\n attempts += 1;\n if (attempts > 100) {\n throw new Error(\n `State seems to have circular dependencies; bailing. Unresolved props: ${JSON.stringify(keys)}`\n );\n }\n\n keys.forEach(key => {\n let dependencies = (deps[key] || []).filter(d => !order.includes(d) && values[d] !== undefined);\n if (dependencies.length == 0) {\n order.push(key);\n }\n });\n\n keys = keys.filter(key => !order.includes(key));\n if (keys.length > 0) {\n moveAvailable();\n }\n }",
"title": ""
},
{
"docid": "50be468c55f42386871ac444aa4f0016",
"score": "0.59282076",
"text": "fill () {\n this.log('queue:fill')\n\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency &&\n this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue())\n }\n }",
"title": ""
},
{
"docid": "ff5a2475c6d82c8fccd18c4e94b5b499",
"score": "0.59211916",
"text": "function refillExecQ() {\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n taskfunction(elem.value, onlyOnce(taskCallback));\n }\n }",
"title": ""
},
{
"docid": "27ab4a15e59b434fb50409909f812d5f",
"score": "0.59031475",
"text": "function processTasks() {\n running = true;\n queued = false;\n var count = 0;\n\n for (;;) {\n var task = queue.dequeue();\n\n if (task === EMPTY) {\n break;\n }\n\n task();\n\n if (count >= options.taskBatchSize) {\n break;\n }\n\n count++;\n }\n\n running = false;\n\n if (queue.length) {\n dispatcher();\n }\n }",
"title": ""
},
{
"docid": "0ce7f4bc7714a78573cb7dddfcc4838e",
"score": "0.58824635",
"text": "_updateQueue ({ callbackId, error, results }) {\n const target = this.callbackIdMap[callbackId]\n target.complete = true\n target.error = error\n target.results = results\n\n while (this.callbackQueue.length) {\n let data = this.callbackQueue[0]\n\n if (!data.complete) {\n break\n }\n\n this.callbackQueue.shift()\n\n delete this.callbackIdMap[data.callbackId]\n\n if (data.error) {\n data.reject(data.error)\n } else {\n data.resolve(data.results)\n }\n }\n }",
"title": ""
},
{
"docid": "8a3f2f16849e80cf23149e2dca24bf53",
"score": "0.587289",
"text": "async processQueue () {\n\n // first in first out - call rpc with ws and msg\n var action\n while (action = this.queue.shift()) {\n try {\n await RPC[action[0]](action[1], action[2])\n } catch (e) { l(e) }\n }\n\n // l(\"Setting timeout for queue\")\n\n setTimeout(() => { me.processQueue() }, 50)\n }",
"title": ""
},
{
"docid": "083633c0bb02d524a00cec68005e54cd",
"score": "0.5859369",
"text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n bee.on('failed', this.handleFailure).process(handle);\n });\n }",
"title": ""
},
{
"docid": "f7c36c9576b2028c364f759379f512bd",
"score": "0.58500105",
"text": "fill () {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency &&\n this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue())\n }\n }",
"title": ""
},
{
"docid": "918a352718b933000c1e4dcf6586a836",
"score": "0.5803199",
"text": "checkRules() {\n var i = 0;\n while (i < this.rules.length) {\n this.rules[i].getTasks().then((tasks) => {\n\ttasks.forEach((task) => this.push(task));\n });\n if (this.rules[i].consumed()) {\n\tthis.rules.splice(i, 1);\n } else {\n\ti += 1;\n }\n }\n }",
"title": ""
},
{
"docid": "6f50e1746e453fd465a833147b4febb3",
"score": "0.579929",
"text": "_runTask() {\n this._orderQueue();\n\n const job = this.tasks.shift();\n const { task, args, resolve, reject } = job;\n\n this.taskRunning = true;\n\n task(...args)\n .then((...args) => {\n resolve(...args);\n this.taskRunning = false;\n this._next();\n })\n .catch((...args) => {\n reject(...args);\n this.taskRunning = false;\n this._next();\n });\n }",
"title": ""
},
{
"docid": "4b78950b9463cbcdaecfbc7f957ebde1",
"score": "0.5787304",
"text": "function processTasks() {\n running = true;\n queued = false;\n let count = 0;\n\n for (;;) {\n const task = queue.dequeue();\n if (task === EMPTY) {\n break;\n }\n\n task();\n\n if (count >= options.taskBatchSize) {\n break;\n }\n count++;\n }\n\n running = false;\n if (queue.length) {\n dispatcher();\n }\n}",
"title": ""
},
{
"docid": "5aae0c4ac16dc23dc8927060d617a71c",
"score": "0.5785629",
"text": "function flushQue() {\n //step 1: check that dcl is ready.\n if (!dcl) return;\n //step 2: all elements started has been processed? reset and end\n const fnel = findLastNotChecked(startedQue, completed);\n if (!fnel) {\n startedQue = [];\n completed = [];\n return;\n }\n //step 3: run function, add the element to the completed list, and run again with TCO\n fnel[0](fnel[1]);\n completed.push(fnel);\n flushQue();\n}",
"title": ""
},
{
"docid": "5aae0c4ac16dc23dc8927060d617a71c",
"score": "0.5785629",
"text": "function flushQue() {\n //step 1: check that dcl is ready.\n if (!dcl) return;\n //step 2: all elements started has been processed? reset and end\n const fnel = findLastNotChecked(startedQue, completed);\n if (!fnel) {\n startedQue = [];\n completed = [];\n return;\n }\n //step 3: run function, add the element to the completed list, and run again with TCO\n fnel[0](fnel[1]);\n completed.push(fnel);\n flushQue();\n}",
"title": ""
},
{
"docid": "7ac05ab05f33286ceace9bbc3713e449",
"score": "0.5783833",
"text": "function doProcessQueue() {\n if (Object.keys(state.processingHosts).length >= parallel) {\n return;\n }\n var nextHost = state.queuedHosts.shift();\n if (nextHost) {\n var destination = nextHost.domain;\n // there's a destination and it hasn't processed or hasn't been processed recently\n var doProcess = !state.processedHosts[destination] || state.processedHosts[destination] < (new Date().getTime() - RECHECK_SECONDS);\n console.log('processing', nextHost.command, nextHost.domain, 'doProcess', doProcess, 'remaining', state.queuedHosts.length);\n if (doProcess) {\n // used to link hops\n var traceID = destination + '@' + new Date().getTime() + (nextHost.tag ? ':' + nextHost.tag : '');\n\n // process hops, reset state\n var doneTrace = function(err, hops) {\n if (err || hops.length < 1) {\n console.log('doneTrace err', err, hops);\n }\n if (GLOBAL.debug) console.log('hops', JSON.stringify(hops, null, 2));\n delete state.processingHosts[traceID];\n if (doSubmitTrace) {\n sender.sendTrace(hops, nextHost, function(err, res) {\n if (err) {\n console.log('sendTrace failed', err);\n res = { sendTraceFailed: err};\n }\n state.allHops[traceID] = { traceID: traceID, result: res, hops: hops};\n if (GLOBAL.debug) console.log('submitted trace', res);\n if (doneCB) {\n doneCB(err, state.allHops[traceID]);\n }\n });\n } else {\n state.allHops[traceID] = { traceID: traceID, hops: hops};\n if (doneCB) {\n doneCB(err, state.allHops[traceID]);\n }\n }\n\n console.log('done; allHops', Object.keys(state.allHops).length);\n };\n\n state.processingHosts[traceID] = new Date().getTime();\n state.processedHosts[destination] = new Date().getTime();\n nextHost.traceID = traceID;\n nextHost.attempts = attempts;\n traceroute.trace(nextHost, doneTrace, reportCB);\n return;\n }\n }\n // nothing to process, wait around\n}",
"title": ""
},
{
"docid": "14deecc325d54f404b92bea7b11be384",
"score": "0.5778511",
"text": "async function processQueue(queue, cb) {\n while (true) {\n // If there are no files, wait for a bit and try again\n if (queue.length == 0) {\n await new Promise(r => setTimeout(r, 1000));\n continue\n }\n\n console.debug(`Queue has ${queue.length} files waiting`)\n const filename = queue.shift()\n console.debug(`Taken filename ${filename} off the queue to process`)\n await cb(filename)\n }\n}",
"title": ""
},
{
"docid": "fe2f214b4481d04e8f2ba2909415b8da",
"score": "0.5769637",
"text": "function finish() {\n verify(queue.length >= 1, 'tasks.finish: The task queue is empty.');\n queue.shift();\n stepName = null;\n\n if (queue.length >= 1)\n startFirst();\n }",
"title": ""
},
{
"docid": "1f7a47c4ffe07325b6d99e0b9c2505ca",
"score": "0.575965",
"text": "_done(error) {\n\t\tlet self = this;\n\n\t\tif (error || self.continueOnError) {\n\n\t\t\tif (! this.continueOnError) {\n\t\t\t\tthis.rootCause = error;\n\t\t\t\tthis.continueOnError = true;\n\t\t\t\tconsole.debug('Error occurs for task ' + self.current().getName() + ' execution, due to: ', error);\n\t\t\t\tself.current().undoAsync(self._done.bind(self));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (self.hasPrevious()) {\n\t\t\t\tself.previous().undoAsync(self._done.bind(self));\n\t\t\t\treturn;\n\t\t\t} \n\t\t\tthis._onProcessing = false;\n\t\t\tself.deferred.reject(self.rootCause);\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (self.hasNext()) {\n\t\t\tself.next().doAsync(self._done.bind(self));\n\t\t\treturn;\n\t\t} \n\n\t\tthis._onProcessing = false;\n\t\tself.deferred.resolve();\t\n\t}",
"title": ""
},
{
"docid": "134ad682ede206aeab61ad04109e4084",
"score": "0.5735641",
"text": "function CatchupQueue() {\n function makeLink() {\n var head = {};\n var value, next;\n Object.defineProperties(head, {\n available: {\n enumerable: true,\n get: function () { return !!next; }\n },\n value: {\n enumerable: true,\n get: function () {\n if (!next) throw new Error(\"not yet resolved\");\n return value;\n }\n },\n next: {\n enumerable: true,\n get: function () {\n if (!next) throw new Error(\"not yet resolved\");\n return next;\n }\n },\n });\n function resolve(v, n) {\n value = v;\n next = n;\n }\n return {head: head, resolve: resolve};\n }\n \n var l = makeLink();\n \n function enqueue(value) {\n var nextLink = makeLink();\n l.resolve(value, nextLink.head);\n l = nextLink;\n }\n \n function getHead() {\n return l.head;\n }\n \n return {getHead: getHead, enqueue: enqueue};\n }",
"title": ""
},
{
"docid": "3fb02e17516aa02b62e247279973f58c",
"score": "0.5671419",
"text": "prod() {\n const self = this;\n\n let i = 0;\n\n this.resolveTasks();\n\n const readyTasks = this.queueReady;\n let readyTaskCount;\n\n function updateTaskCount() {\n readyTaskCount = readyTasks.length;\n }\n\n function pickNextTaskRoundRobin() {\n return readyTasks[i++ % readyTaskCount];\n }\n\n function pickNextTaskSequential() {\n return readyTasks[0];\n }\n\n /**\n * @type {function():Task}\n */\n let pickNextTask;\n\n switch (this.policy) {\n case ConcurrentExecutor.POLICY.ROUND_ROBIN:\n pickNextTask = pickNextTaskRoundRobin;\n break;\n case ConcurrentExecutor.POLICY.SEQUENTIAL:\n pickNextTask = pickNextTaskSequential;\n break;\n default:\n console.warn('Unknown scheduling policy: ', this.policy, 'Defaulting to sequential');\n pickNextTask = pickNextTaskSequential;\n break;\n }\n\n /**\n *\n * @param {Task} task\n */\n function completeTask(task) {\n\n const taskIndex = readyTasks.indexOf(task);\n\n if (taskIndex !== -1) {\n readyTasks.splice(taskIndex, 1);\n } else {\n console.error(\"Failed to remove ready task, not found in the ready queue\", task, readyTasks.slice());\n }\n\n\n task.state.set(TaskState.SUCCEEDED);\n task.on.completed.dispatch();\n\n self.resolveTasks();\n updateTaskCount();\n }\n\n /**\n *\n * @param {Task} task\n * @param {*} reason\n */\n function failTask(task, reason) {\n const taskIndex = readyTasks.indexOf(task);\n\n if (taskIndex !== -1) {\n readyTasks.splice(taskIndex, 1);\n } else {\n console.error(\"Failed to remove ready task, not found in the ready queue\", task, readyTasks.slice());\n }\n\n task.state.set(TaskState.FAILED);\n task.on.failed.dispatch(reason);\n\n self.resolveTasks();\n updateTaskCount();\n }\n\n function executeTimeSlice() {\n let sliceTimeLeft = self.workTime;\n\n let executionTime = 0;\n\n while (readyTaskCount > 0) {\n const task = pickNextTask();\n\n if (task === undefined) {\n console.warn('Next task not found, likely result of removing task mid-execution');\n break;\n }\n\n try {\n executionTime = runTaskForTime2(task, sliceTimeLeft, completeTask, failTask);\n } catch (e) {\n console.error(`Task threw an exception`, task, e);\n failTask(task, e);\n }\n\n //make sure that execution time that we subtract from current CPU slice is always reducing the slice\n sliceTimeLeft -= Math.max(executionTime, 1);\n\n if (sliceTimeLeft <= 0) {\n break;\n }\n }\n\n //update task count\n updateTaskCount();\n\n if (readyTaskCount > 0) {\n //schedule next time slice\n setTimeout(executeTimeSlice, self.quietTime);\n } else {\n self.busy = false;\n self.on.completed.dispatch();\n }\n }\n\n updateTaskCount();\n\n if (!this.busy && readyTaskCount > 0) {\n this.busy = true;\n executeTimeSlice();\n }\n\n }",
"title": ""
},
{
"docid": "ac8dd363ab68bf0904e0f7fc2a6b5e15",
"score": "0.5667005",
"text": "function process() {\n return this.queues.forEach((queue) => {\n queue.bull.process(queue.handle);\n\n queue.bull.on(\"failed\", (job, err) => {\n console.log(\"job failed\", queue.key, job.data);\n console.log(err);\n });\n });\n}",
"title": ""
},
{
"docid": "7695f18bc77c5e55ed5a1bd627c0bfbe",
"score": "0.5655031",
"text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n\n /**\n * então pego a fila(bee) processando com o parâmetro(handle).\n * através do .on() podemos ouvir eventos, nessa caso os de falha em fila\n */\n bee.on('failed', this.handleFailure).process(handle);\n });\n }",
"title": ""
},
{
"docid": "f9f7e946386cdc0fa119fb81b20152c9",
"score": "0.56175166",
"text": "maybeFlushQueue() {\n if (this.queue.length > 0 && this.pendingRequests.length > 0) {\n this.pendingRequests.shift()(this.queue);\n this.queue = [];\n }\n }",
"title": ""
},
{
"docid": "4185f193ca49c3e351527ffee30c5e0a",
"score": "0.56151134",
"text": "function drain(){\n async = false;\n\n while(true){\n settled = false;\n if(action = cold.shift()){\n cancel = future._fork(rejected, resolved);\n if(!settled) warmupActions();\n }else if(action = queue.shift()){\n cancel = future._fork(rejected, resolved);\n }else break;\n if(settled) continue;\n async = true;\n return;\n }\n\n cancel = future._fork(rej, res);\n }",
"title": ""
},
{
"docid": "41774be88e4e74e900bba9da41c275ec",
"score": "0.5599066",
"text": "checkQueue() {\n if (this.fnQueue.length > 0 && this.remaining !== 0) {\n let queuedFunc = this.fnQueue.splice(0, 1)[0];\n queuedFunc.callback();\n }\n }",
"title": ""
},
{
"docid": "fc74277bb1a571b11d4f1b0ae6e58c91",
"score": "0.5597962",
"text": "function check() {\n\n if (executing.length >= PARALELL_QUERIES || !queue.length) {\n return;\n }\n\n var item = queue.splice(0, 1)[0];\n\n item.instance.on(\"end\", (function () {\n\n var position = executing.indexOf(this);\n executing.splice(position, 1);\n\n check();\n }).bind(item));\n\n item.execute();\n}",
"title": ""
},
{
"docid": "3c3d90fd7174a246bd25ba3e6475ae5f",
"score": "0.5593686",
"text": "function dropEntireQueue() {\n node.debug('dropEntireQueue - Drop all queued messages');\n while (node.msgQueue.length > 0) {\n const item = node.msgQueue.shift();\n item.done();\n }\n }",
"title": ""
},
{
"docid": "8509f44e699858893b7c2dfead28f471",
"score": "0.55876696",
"text": "_orderQueue() {\n const size = this.tasks.length;\n const start = Math.trunc((size - 2) / 2);\n\n for (let i = start; i >= 0; i--) {\n this._reorder(i);\n }\n }",
"title": ""
},
{
"docid": "94ca8338536490a28ae4f118fcc08535",
"score": "0.5561429",
"text": "enqueue(ibGibs) {\n let t = this;\n ibGibs\n .filter(ibGib => !t.completedIbGibs.includes(ibGib) && !t.queue.includes(ibGib))\n .forEach(ibGib => t.queue.push(ibGib));\n }",
"title": ""
},
{
"docid": "0d5df4b2abb659b85e167dbb405c34d4",
"score": "0.5559495",
"text": "flushQueue(error, options) {\n options = (0, lodash_1.defaults)({}, options, {\n offlineQueue: true,\n commandQueue: true,\n });\n let item;\n if (options.offlineQueue) {\n while ((item = this.offlineQueue.shift())) {\n item.command.reject(error);\n }\n }\n if (options.commandQueue) {\n if (this.commandQueue.length > 0) {\n if (this.stream) {\n this.stream.removeAllListeners(\"data\");\n }\n while ((item = this.commandQueue.shift())) {\n item.command.reject(error);\n }\n }\n }\n }",
"title": ""
},
{
"docid": "6c34f2aceea5c1c12ec23bc7fa79fa37",
"score": "0.5553269",
"text": "function checkQueue() {\n\t\tvar done = true;\n\t\tfor (var i = 0, l = queue.length; i < l; i++) {\n\t\t\tif (queue[i].readyState !== 4) {\n\t\t\t\tdone = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if all xhrs are done, then fire the callbacks\n\t\tif (done) {\n\t\t\tready = true;\n\t\t\tfireCallbacks();\n\t\t}\n\t}",
"title": ""
},
{
"docid": "283cc50260a5fbd5d153333ca474d1a2",
"score": "0.55448925",
"text": "function runSchedulerQueue(queue){// do not cache length because more watchers might be pushed\n // as we run existing watchers\n for(var i=0;i<queue.length;i++){var watcher=queue[i];var id=watcher.id;has[id]=null;watcher.run();// in dev build, check and stop circular updates.\n if(\"development\"!=='production'&&has[id]!=null){circular[id]=(circular[id]||0)+1;if(circular[id]>_config2.default._maxUpdateCount){(0,_index.warn)('You may have an infinite update loop for watcher '+'with expression \"'+watcher.expression+'\"',watcher.vm);break;}}}queue.length=0;}",
"title": ""
},
{
"docid": "4c2f76abf891bdb0939dbf0966ab485e",
"score": "0.55362344",
"text": "function processQueue() {\n\tif (queue.length == 0) {\n\t\tconsole.log('queue is empty')\n\t\treturn\n\t}\n\n\tvar item = queue.splice(0,1)[0]\n\tfetchFriendIds(item, -1, function() {\n\t\tsetTimeout(processQueue, 1*60*1000) //wait 1 minute\n\t})\n}",
"title": ""
},
{
"docid": "0b62028cd8b33a563e1fb440b0cb3ba0",
"score": "0.5532418",
"text": "retry(cb = noop) {\n this.rdb.client.multi()\n .srem(this._toQueueKey('failed'), this.id)\n .lpush(this._toQueueKey('waiting'), this.id)\n .exec(cb);\n }",
"title": ""
},
{
"docid": "c38261c4cd09b20d432b1e183c894df2",
"score": "0.5527564",
"text": "function processQueue(queue) {\n // Is the queue still empty after it was last cleared? Stop the timer - the animations have\n // probably finished and will not provide any further updates.\n if (queue.length === 0) {\n clearInterval(queue.intervalId);\n queue.isProcessing = false;\n queue.intervalId = null;\n }\n else {\n // We have some DOM updates to do. Do each one in sequence, then clear the queue ready for the next round.\n try {\n for (var i = 0; i < queue.length; i++) {\n var q = queue[i];\n step(q.options, q.values);\n }\n }\n finally {\n // Truncating the array length to zero clears it.\n queue.length = 0;\n }\n }\n }",
"title": ""
},
{
"docid": "da98e98e055154fca4468310fbed1d5c",
"score": "0.5522635",
"text": "shiftQueue() {\n if (this.running >= this.max || !this.queue.length) {\n return;\n }\n\n const opts = this.queue.shift();\n\n this.running++;\n this.execute(opts);\n }",
"title": ""
},
{
"docid": "20cee1d50c026cc8b9c4ef3963a74ce0",
"score": "0.5511704",
"text": "function maybePull() {\n if (!busy) {\n doPull();\n }\n while (queue.size >= maxQueued && busy < maxConcurrent) {\n doPull();\n }\n }",
"title": ""
},
{
"docid": "0bec1826ea2774982269b4199e9bbd7c",
"score": "0.5508821",
"text": "function clearInProgressCallbacks() {\n if (url in inProgress) {\n delete inProgress[url];\n }\n } // send all currently waiting tasks their data",
"title": ""
},
{
"docid": "ce456cd948f49f8ce73db877c0069038",
"score": "0.5505507",
"text": "function drainQueue() {\n\tvar i = 0;\n\tvar task;\n\tvar innerQueue = mainQueue;\n\tmainQueue = [];\n\t/*jslint boss: true */\n\twhile (task = innerQueue[i++]) {\n\t\ttask();\n\t}\n\n}",
"title": ""
},
{
"docid": "38af1bc8b8fa1d15a974bbb15fc35774",
"score": "0.54875237",
"text": "function popTransferQueue(){\n // while we are not at max concurrency\n while(transferQueue.length > 0 && inprogress < options.concurrency){\n // increment activity counter\n inprogress++;\n\n // fetch filetranfer, method-type (isDownload) and arguments\n var args = transferQueue.pop();\n\t var ft = args.fileTransfer,\n\t isDownload = args.isDownload,\n\t serverUrl = args.serverUrl,\n\t localPath = args.localPath,\n\t trustAllHosts = args.trustAllHosts,\n\t transferOptions = args.transferOptions,\n\t win = args.win,\n\t fail = args.fail;\n\n if(ft._aborted) {\n inprogress--;\n } else if(isDownload){\n ft.download.call(ft,serverUrl,localPath,win,fail,trustAllHosts,transferOptions);\n if(ft.onprogress) ft.onprogress(new ProgressEvent());\n } else {\n ft.upload.call(ft,localPath,serverUrl,win,fail,transferOptions,trustAllHosts);\n }\n }\n // if we are at max concurrency, popTransferQueue() will be called whenever\n // the transfer is ready and there is space avaialable.\n }",
"title": ""
},
{
"docid": "810ef668e1759052d4f6ec0032889c3e",
"score": "0.5476377",
"text": "function processWaitingForMoves(trigger) {\n var deferredPool = scenario.triggers.deferredByMoves;\n var currentTrigger;\n for (var triggerName in deferredPool) {\n if (deferredPool.hasOwnProperty([triggerName])) {\n currentTrigger = deferredPool[triggerName];\n --currentTrigger.moveDelay;\n if (currentTrigger.moveDelay === 0) {\n delete scenario.triggers.deferredByMoves[triggerName];\n executeTriggerEvent(currentTrigger);\n }\n }\n }\n}",
"title": ""
},
{
"docid": "a69acacc60cce4035b3bc59a132867b2",
"score": "0.5472542",
"text": "function AsyncDelayQueue() {\n this.queue = [];\n\n this.callback_pending = false;\n}",
"title": ""
},
{
"docid": "f28a4551d49f28832d48a5468d251217",
"score": "0.54722893",
"text": "function taskEndCallback(taskResult) {\n for(var i = 0; i < tasks.length; i++){\n if(tasks[i] == currentTask){\n overall.inc();\n /*\n if(currentStatus != null){\n status.removeItem(currentStatus);\n currentStatus = null;\n }*/\n }\n }\n currentTask = undefined;\n\n // do something \n }",
"title": ""
},
{
"docid": "eb935d43aa70eef95a4c290825de2227",
"score": "0.5464752",
"text": "_pick() {\n console.log(\"PICK\");\n console.log(\"queue len:\", this.queue.length);\n if (this.doingCount >= this.limit || this.queue.length === 0) {\n console.log(\"NO?\")\n return;\n }\n console.log(\"start pick\");\n this.doingCount += 1;\n const { f, resolve, reject } = this.queue.shift();\n (async () => {\n try {\n console.log(\"DO JOB F\");\n const result = await f();\n console.log(\"RESULT:\", result);\n resolve(result);\n } catch (err) {\n reject(err);\n } finally {\n this.doingCount -= 1;\n this._pick();\n }\n })();\n }",
"title": ""
},
{
"docid": "ae3946b6661319e1374a3b7bd8226a99",
"score": "0.54566246",
"text": "start(onEnd) {\n // If a queue is present we must excecute it\n if (this.queue.length) {\n this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values\n\n if (this.localQueue) {\n this.localQueue.forEach((_ref3) => {\n let _ref3$from = _ref3.from,\n from = _ref3$from === void 0 ? {} : _ref3$from,\n _ref3$to = _ref3.to,\n to = _ref3$to === void 0 ? {} : _ref3$to;\n if (is.obj(from)) this.merged = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, from, this.merged);\n if (is.obj(to)) this.merged = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, this.merged, to);\n });\n } // The guid helps us tracking frames, a new queue over an old one means an override\n // We discard async calls in that caseÍ\n\n\n const local = this.local = ++this.guid;\n const queue = this.localQueue = this.queue;\n this.queue = []; // Go through each entry and execute it\n\n queue.forEach((_ref4, index) => {\n let delay = _ref4.delay,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref4, [\"delay\"]);\n\n const cb = finished => {\n if (index === queue.length - 1 && local === this.guid && finished) {\n this.idle = true;\n if (this.props.onRest) this.props.onRest(this.merged);\n }\n\n if (onEnd) onEnd();\n }; // Entries can be delayed, ansyc or immediate\n\n\n let async = is.arr(props.to) || is.fun(props.to);\n\n if (delay) {\n setTimeout(() => {\n if (local === this.guid) {\n if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n }\n }, delay);\n } else if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n });\n } // Otherwise we kick of the frameloop\n else {\n if (is.fun(onEnd)) this.listeners.push(onEnd);\n if (this.props.onStart) this.props.onStart();\n start(this);\n }\n\n return this;\n }",
"title": ""
},
{
"docid": "ae3946b6661319e1374a3b7bd8226a99",
"score": "0.54566246",
"text": "start(onEnd) {\n // If a queue is present we must excecute it\n if (this.queue.length) {\n this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values\n\n if (this.localQueue) {\n this.localQueue.forEach((_ref3) => {\n let _ref3$from = _ref3.from,\n from = _ref3$from === void 0 ? {} : _ref3$from,\n _ref3$to = _ref3.to,\n to = _ref3$to === void 0 ? {} : _ref3$to;\n if (is.obj(from)) this.merged = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, from, this.merged);\n if (is.obj(to)) this.merged = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, this.merged, to);\n });\n } // The guid helps us tracking frames, a new queue over an old one means an override\n // We discard async calls in that caseÍ\n\n\n const local = this.local = ++this.guid;\n const queue = this.localQueue = this.queue;\n this.queue = []; // Go through each entry and execute it\n\n queue.forEach((_ref4, index) => {\n let delay = _ref4.delay,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref4, [\"delay\"]);\n\n const cb = finished => {\n if (index === queue.length - 1 && local === this.guid && finished) {\n this.idle = true;\n if (this.props.onRest) this.props.onRest(this.merged);\n }\n\n if (onEnd) onEnd();\n }; // Entries can be delayed, ansyc or immediate\n\n\n let async = is.arr(props.to) || is.fun(props.to);\n\n if (delay) {\n setTimeout(() => {\n if (local === this.guid) {\n if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n }\n }, delay);\n } else if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n });\n } // Otherwise we kick of the frameloop\n else {\n if (is.fun(onEnd)) this.listeners.push(onEnd);\n if (this.props.onStart) this.props.onStart();\n start(this);\n }\n\n return this;\n }",
"title": ""
},
{
"docid": "718ceaeca58c3f11ad07ae3d7f609879",
"score": "0.54494447",
"text": "function repoRerunTransactionQueue(repo, queue, path) {\r\n if (queue.length === 0) {\r\n return; // Nothing to do!\r\n }\r\n // Queue up the callbacks and fire them after cleaning up all of our\r\n // transaction state, since the callback could trigger more transactions or\r\n // sets.\r\n const callbacks = [];\r\n let events = [];\r\n // Ignore all of the sets we're going to re-run.\r\n const txnsToRerun = queue.filter(q => {\r\n return q.status === 0 /* RUN */;\r\n });\r\n const setsToIgnore = txnsToRerun.map(q => {\r\n return q.currentWriteId;\r\n });\r\n for (let i = 0; i < queue.length; i++) {\r\n const transaction = queue[i];\r\n const relativePath = newRelativePath(path, transaction.path);\r\n let abortTransaction = false, abortReason;\r\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(relativePath !== null, 'rerunTransactionsUnderNode_: relativePath should not be null.');\r\n if (transaction.status === 4 /* NEEDS_ABORT */) {\r\n abortTransaction = true;\r\n abortReason = transaction.abortReason;\r\n events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true));\r\n }\r\n else if (transaction.status === 0 /* RUN */) {\r\n if (transaction.retryCount >= MAX_TRANSACTION_RETRIES) {\r\n abortTransaction = true;\r\n abortReason = 'maxretry';\r\n events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true));\r\n }\r\n else {\r\n // This code reruns a transaction\r\n const currentNode = repoGetLatestState(repo, transaction.path, setsToIgnore);\r\n transaction.currentInputSnapshot = currentNode;\r\n const newData = queue[i].update(currentNode.val());\r\n if (newData !== undefined) {\r\n validateFirebaseData('transaction failed: Data returned ', newData, transaction.path);\r\n let newDataNode = nodeFromJSON(newData);\r\n const hasExplicitPriority = typeof newData === 'object' &&\r\n newData != null &&\r\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"contains\"])(newData, '.priority');\r\n if (!hasExplicitPriority) {\r\n // Keep the old priority if there wasn't a priority explicitly specified.\r\n newDataNode = newDataNode.updatePriority(currentNode.getPriority());\r\n }\r\n const oldWriteId = transaction.currentWriteId;\r\n const serverValues = repoGenerateServerValues(repo);\r\n const newNodeResolved = resolveDeferredValueSnapshot(newDataNode, currentNode, serverValues);\r\n transaction.currentOutputSnapshotRaw = newDataNode;\r\n transaction.currentOutputSnapshotResolved = newNodeResolved;\r\n transaction.currentWriteId = repoGetNextWriteId(repo);\r\n // Mutates setsToIgnore in place\r\n setsToIgnore.splice(setsToIgnore.indexOf(oldWriteId), 1);\r\n events = events.concat(syncTreeApplyUserOverwrite(repo.serverSyncTree_, transaction.path, newNodeResolved, transaction.currentWriteId, transaction.applyLocally));\r\n events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, oldWriteId, true));\r\n }\r\n else {\r\n abortTransaction = true;\r\n abortReason = 'nodata';\r\n events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, transaction.currentWriteId, true));\r\n }\r\n }\r\n }\r\n eventQueueRaiseEventsForChangedPath(repo.eventQueue_, path, events);\r\n events = [];\r\n if (abortTransaction) {\r\n // Abort.\r\n queue[i].status = 2 /* COMPLETED */;\r\n // Removing a listener can trigger pruning which can muck with\r\n // mergedData/visibleData (as it prunes data). So defer the unwatcher\r\n // until we're done.\r\n (function (unwatcher) {\r\n setTimeout(unwatcher, Math.floor(0));\r\n })(queue[i].unwatcher);\r\n if (queue[i].onComplete) {\r\n if (abortReason === 'nodata') {\r\n callbacks.push(() => queue[i].onComplete(null, false, queue[i].currentInputSnapshot));\r\n }\r\n else {\r\n callbacks.push(() => queue[i].onComplete(new Error(abortReason), false, null));\r\n }\r\n }\r\n }\r\n }\r\n // Clean up completed transactions.\r\n repoPruneCompletedTransactionsBelowNode(repo, repo.transactionQueueTree_);\r\n // Now fire callbacks, now that we're in a good, known state.\r\n for (let i = 0; i < callbacks.length; i++) {\r\n exceptionGuard(callbacks[i]);\r\n }\r\n // Try to send the transaction result to the server.\r\n repoSendReadyTransactions(repo, repo.transactionQueueTree_);\r\n}",
"title": ""
},
{
"docid": "0078d8bea67747f1d5d39012f37b227d",
"score": "0.5447066",
"text": "finishTask(task) {\n let idx = this.me.room.memory.taskList.findIndex(t => {\n return task.taskType === t.taskType && task.targetId === t.targetId && t.prio === task.prio;\n });\n if( idx !== -1 ) {\n this.me.room.memory.taskList[idx].status = Task.STATUS.DONE;\n // console.log('Room task status after update:',this.me.room.memory.taskList[idx].status);\n }\n\n this.tasks.shift();\n console.log('Tower: tasks remaining:', this.tasks.length);\n }",
"title": ""
},
{
"docid": "0d6c367784d0b86efa93decb32f87894",
"score": "0.54465586",
"text": "async function autoQueueChallenges () {\n logger.info('Auto Sync :: Queueing existing failed challenges')\n await challengeSyncStatusService.retryFailed()\n const { total, updated } = await queueChallenges({ status: 'Active', force: false })\n return challengeSyncHistoryService.createHistoryRecord(total, updated)\n}",
"title": ""
},
{
"docid": "7dbd629262baa6d6925e274ac9ce4cfb",
"score": "0.54409325",
"text": "async handleMessage({taskId, taskGroupId, schedulerId, deadline, remove}) {\n // Query for entity for which we have exact rowKey too, limit to 1, and\n // require that deadline matches. This is essentially a conditional load\n // operation\n var {entries: [task]} = await this.Task.query({\n taskId: taskId, // Matches an exact entity\n deadline: deadline, // Load conditionally\n }, {\n matchRow: 'exact', // Validate that we match row key exactly\n limit: 1, // Load at most one entity, no need to search\n });\n\n // If the task doesn't exist we're done\n if (!task) {\n await this.dependencyTracker.updateTaskGroupActiveSet(taskId, taskGroupId, schedulerId);\n return remove();\n }\n\n // Check if this is the deadline we're supposed to be resolving for, if\n // this check fails, then the conditional load must have failed so we should\n // report error\n if (task.deadline.getTime() !== deadline.getTime()) {\n let err = new Error('Task deadline does not match deadline from ' +\n 'message, taskId: ' + taskId + ' this only happens ' +\n 'if conditional load does not work');\n err.taskId = taskId;\n err.taskDeadline= task.deadline.toJSON();\n err.messageDeadline= deadline.toJSON();\n await this.monitor.reportError(err);\n return remove();\n }\n\n // Ensure that all runs are resolved\n await task.modify((task) => {\n // If there is no run, we add a new one to signal that the task is\n // resolved. As this run is purely to signal an exception, we set\n // `reasonCreated: 'exception'`.\n if (task.runs.length === 0) {\n var now = new Date().toJSON();\n task.runs.push({\n state: 'exception',\n reasonCreated: 'exception',\n reasonResolved: 'deadline-exceeded',\n scheduled: now,\n resolved: now,\n });\n }\n\n task.runs.forEach((run, runId) => {\n // don't modify resolved runs\n if (_.includes(RESOLVED_STATES, run.state)) {\n return;\n }\n\n // If a run that isn't the last run is unresolved, it violates an\n // invariant and we shall log and error...\n if (task.runs.length - 1 !== runId) {\n let err = new Error('runId: ' + runId + ' is not the last of: ' +\n taskId + ' but it is not resolved');\n err.taskId = taskId;\n err.runId = runId;\n err.run = run;\n this.monitor.reportError(err);\n }\n\n // Resolve run as deadline-exceeded\n run.state = 'exception';\n run.reasonResolved = 'deadline-exceeded';\n run.resolved = new Date().toJSON();\n });\n\n // Clear takenUntil, for ClaimResolver\n task.takenUntil = new Date(0);\n });\n\n // Check if the last run was resolved here\n var run = _.last(task.runs);\n if (run.reasonResolved === 'deadline-exceeded' &&\n run.state === 'exception') {\n debug('Resolved taskId: %s, by deadline', taskId);\n\n // Update dependency tracker\n await this.dependencyTracker.resolveTask(taskId, task.taskGroupId, task.schedulerId, 'exception');\n\n // Publish messages about the last run\n }\n\n return remove();\n }",
"title": ""
},
{
"docid": "e012333c9e421477ed2e4f6a6ab733c4",
"score": "0.5438801",
"text": "function _reduceAwaiting() {\n --_awaitingAfterLoad;\n \n // if no items were left trigger finished event\n if (!items.length && !_awaitingAfterLoad) {\n _triggerCallback('onFinishedAll');\n }\n }",
"title": ""
},
{
"docid": "cc593d3ad1a760fa5e8774637d9c4509",
"score": "0.5428223",
"text": "function _recursive_queue() {\n currentMsg = \"Recursive queue check for task completion. Mark: \" + (performance.now() - sTime).toFixed(4).toString() + \"\\n\";\n $scope.msg += currentMsg;\n console.log(currentMsg);\n if ( checkCounter < 30) {\n recursiveTimer = $timeout(function() {\n checkCounter++;\n if (!$scope.longTaskFinishedFlag)\n _recursive_queue();\n }, 500);\n } else {\n $timeout.cancel(recursiveTimer);\n currentMsg = \"Recursive queue has reached MAX iterations. Exiting! Mark: \" + (performance.now() - sTime).toFixed(4).toString() + \"\\n\";\n $scope.msg += currentMsg;\n console.log(currentMsg);\n }\n }",
"title": ""
},
{
"docid": "f0bee1d120c8a9e32af54f5cdd0b8588",
"score": "0.54223865",
"text": "function next(error, result, payload) {\n if (error) {\n if (self.callback) {\n self.callback(error, null);\n return;\n }\n } else {\n if (payload && payload.tasks) {\n self.tasks = payload.tasks;\n }\n if (result) {\n console.log(\"taskIndex:\", depIndex, \"actionIndex:\", actionIndex, \"result:\", JSON.stringify(result));\n }\n actionIndex++;\n if (actionIndex < dep.actions.length) {\n __runAction(depIndex, actionIndex);\n } else {\n if (depIndex < self.tasks.length) {\n __runDependency(++depIndex);\n }\n }\n }\n }",
"title": ""
},
{
"docid": "cc04d3d15c2e1de7709b6b968d1d5832",
"score": "0.54191995",
"text": "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}",
"title": ""
},
{
"docid": "cc04d3d15c2e1de7709b6b968d1d5832",
"score": "0.54191995",
"text": "function flush(){release();var task;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}",
"title": ""
},
{
"docid": "b627c388c3067e21fb92e3bf5fae4c77",
"score": "0.5399633",
"text": "function next_pending_task (free_threads) {\r\n\tfor (var j = 0; j < jobs.length; j++) {\r\n\t\tvar job = jobs[j];\r\n\t\tif (solve_job_dependencies(job) == true) {\r\n\t\t\tfor (var t = 0; t < job.tasks.length; t++) {\r\n\t\t\t\tvar task = job.tasks[t];\r\n\t\t\t\t\r\n\t\t\t\tif (task.status == 'pending') {\r\n\t\t\t\t\tif (free_threads == 0 && job.threads_per_task == 0) {\r\n\t\t\t\t\t\treturn {job_index: j, task_index: t, task_threads: job.threads_per_task};\r\n\t\t\t\t\t} else if (job.threads_per_task > 0) {\r\n\t\t\t\t\t\treturn {job_index: j, task_index: t, task_threads: job.threads_per_task};\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": "b8362254f8c80fc5c96d6ada64fdd0b8",
"score": "0.5398723",
"text": "function flush() {\n\t\t\t\twhile (index < queue.length) {\n\t\t\t\t\tvar currentIndex = index;\n\t\t\t\t\t// Advance the index before calling the task. This ensures that we will\n\t\t\t\t\t// begin flushing on the next task the task throws an error.\n\t\t\t\t\tindex = index + 1;\n\t\t\t\t\tqueue[currentIndex].call();\n\t\t\t\t\t// Prevent leaking memory for long chains of recursive calls to `asap`.\n\t\t\t\t\t// If we call `asap` within tasks scheduled by `asap`, the queue will\n\t\t\t\t\t// grow, but to avoid an O(n) walk for every task we execute, we don't\n\t\t\t\t\t// shift tasks off the queue after they have been executed.\n\t\t\t\t\t// Instead, we periodically shift 1024 tasks off the queue.\n\t\t\t\t\tif (index > capacity) {\n\t\t\t\t\t\t// Manually shift all values starting at the index back to the\n\t\t\t\t\t\t// beginning of the queue.\n\t\t\t\t\t\tfor (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t\t\t\t\t\t\tqueue[scan] = queue[scan + index];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqueue.length -= index;\n\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tqueue.length = 0;\n\t\t\t\tindex = 0;\n\t\t\t\tflushing = false;\n\t\t\t}",
"title": ""
},
{
"docid": "101677853d4e1f0453c2bebb5c099d29",
"score": "0.5397836",
"text": "function _executeFromQueue() {\n if (!sails.hooks.queues.isReady(config.queue.name)) {\n return;\n }\n for (let i = 0; i < config.queue.executor.batch; i++) {\n sails.hooks.queues.pop(config.queue.name)\n .then((res) => {\n if (res && res.message) {\n _processIndexData(res.message.index, res.message.body)\n .catch(e => {\n sails.log.debug(JSON.stringify(e));\n sails.log.error(e);\n });\n }\n });\n }\n }",
"title": ""
},
{
"docid": "b6e79a90c942bd84fcd8879053aa6d1b",
"score": "0.53937376",
"text": "async waitUntilFinished(queueEvents, ttl) {\n await this.queue.waitUntilReady();\n const jobId = this.id;\n return new Promise(async (resolve, reject) => {\n let timeout;\n if (ttl) {\n timeout = setTimeout(() => onFailed(\n /* eslint-disable max-len */\n `Job wait ${this.name} timed out before finishing, no finish notification arrived after ${ttl}ms (id=${jobId})`), ttl);\n }\n function onCompleted(args) {\n removeListeners();\n resolve(args.returnvalue);\n }\n function onFailed(args) {\n removeListeners();\n reject(new Error(args.failedReason || args));\n }\n const completedEvent = `completed:${jobId}`;\n const failedEvent = `failed:${jobId}`;\n queueEvents.on(completedEvent, onCompleted);\n queueEvents.on(failedEvent, onFailed);\n this.queue.on('closing', onFailed);\n const removeListeners = () => {\n clearInterval(timeout);\n queueEvents.removeListener(completedEvent, onCompleted);\n queueEvents.removeListener(failedEvent, onFailed);\n this.queue.removeListener('closing', onFailed);\n };\n // Poll once right now to see if the job has already finished. The job may have been completed before we were able\n // to register the event handlers on the QueueEvents, so we check here to make sure we're not waiting for an event\n // that has already happened. We block checking the job until the queue events object is actually listening to\n // Redis so there's no chance that it will miss events.\n await queueEvents.waitUntilReady();\n const status = await scripts_1.Scripts.isFinished(this.queue, jobId);\n const finished = status > 0;\n if (finished) {\n const job = await Job.fromId(this.queue, this.id);\n if (status == 2) {\n onFailed(job);\n }\n else {\n onCompleted(job);\n }\n }\n });\n }",
"title": ""
},
{
"docid": "7a97f144b3a2055705a56683b8e65098",
"score": "0.5387057",
"text": "function processWbEditQueue(queue) {\n if (!queue.length || !_wbEdit) return Promise.resolve();\n\n const request = queue.pop();\n const qid = request.qid;\n const msg = request.msg;\n console.log(chalk.blue(`Updating Wikidata ${queue.length}: ${msg}`));\n delete request.qid;\n delete request.msg;\n\n if (DRYRUN) {\n return Promise.resolve()\n .then(() => processWbEditQueue(queue));\n\n } else {\n let task;\n if (request.guid && request.snaks) {\n task = _wbEdit.reference.set(request); // update reference\n } else if (request.guid && request.newValue) {\n task = _wbEdit.claim.update(request); // update claim\n } else if (request.guid && !request.newValue) {\n task = _wbEdit.claim.remove(request); // remove claim\n } else if (!request.guid && request.id && request.property && request.value) {\n task = _wbEdit.claim.create(request); // create claim\n } else if (!request.guid && request.id && request.language && request.value) {\n task = _wbEdit.label.set(request); // set label\n }\n\n return task\n .catch(e => {\n const warning = { qid: qid, msg: e };\n console.warn(chalk.yellow(warning.qid.padEnd(12)) + chalk.red(warning.msg));\n _warnings.push(warning);\n })\n .then(() => delay(300))\n .then(() => processWbEditQueue(queue));\n }\n}",
"title": ""
},
{
"docid": "9b9cdd7d83bcf27b72f263aecd2d5805",
"score": "0.538268",
"text": "clearTransformsFromQueue() {\n if (!this.done || !this._timeline || !this._timeline._runnerIds.includes(this.id)) {\n this._queue = this._queue.filter(item => {\n return !item.isTransform;\n });\n }\n }",
"title": ""
},
{
"docid": "1d6423f0a621001049e515ae5b6ba16e",
"score": "0.5361759",
"text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n }",
"title": ""
},
{
"docid": "1d6423f0a621001049e515ae5b6ba16e",
"score": "0.5361759",
"text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n }",
"title": ""
},
{
"docid": "17c46211adb2b88c8e49a1dddb4c6e1a",
"score": "0.53576845",
"text": "function squareDance(){\n let dancers = []\n const SquareDanceQueue = new Queue()\n const WaitingQueue = new Queue()\n SquareDanceQueue.enqueue('F Jane')\n SquareDanceQueue.enqueue('M Frank')\n SquareDanceQueue.enqueue('M John')\n SquareDanceQueue.enqueue('M Sherlock')\n SquareDanceQueue.enqueue('F Madonna')\n SquareDanceQueue.enqueue('M David')\n SquareDanceQueue.enqueue('M Christopher')\n SquareDanceQueue.enqueue('F Beyonce')\n\n while (SquareDanceQueue.first){\n if (WaitingQueue.first !== null &&\n (SquareDanceQueue.first.value[0]\n !== WaitingQueue.first.value[0])){\n let first = SquareDanceQueue.dequeue()\n let second = WaitingQueue.dequeue()\n dancers.push([first, second])\n } else {\n let first = SquareDanceQueue.dequeue()\n WaitingQueue.enqueue(first)\n } } console.log(dancers)\n }",
"title": ""
},
{
"docid": "8c075a27c8169ad5a2dfd942c973ab3f",
"score": "0.535249",
"text": "clean() {\n const doneKeys = Object.keys(this.promises).filter((key) => {\n const p = this.promises[key];\n return p != null && p.isDone;\n });\n\n this.remove(...doneKeys);\n }",
"title": ""
},
{
"docid": "1af4776128d143501746705a67b48c0d",
"score": "0.5350823",
"text": "function _reduceAwaiting() {\n --_awaitingAfterLoad;\n\n // if no items were left trigger finished event\n if( !items.length && !_awaitingAfterLoad ) {\n _triggerCallback(\"onFinishedAll\");\n }\n }",
"title": ""
},
{
"docid": "04aa1234ba159646cf81f699232109ca",
"score": "0.5345664",
"text": "function isSettleDone() {\n needed -= 1;\n\n if (!needed) {\n if (isFailure) {\n if (!options.sparse && Array.isArray(list)) {\n rejections = rejections.filter(() => {\n return true;\n });\n }\n\n reject(rejections);\n } else {\n resolve(result);\n }\n }\n }",
"title": ""
},
{
"docid": "a9718f990e10afa7e87c06f1d1749ec4",
"score": "0.53379047",
"text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n }",
"title": ""
},
{
"docid": "7fa1510526a5dfb8c17856756da080b5",
"score": "0.533649",
"text": "function processQueue(){var queue=nextTick.queue;var digest=nextTick.digest;nextTick.queue=[];nextTick.timeout=null;nextTick.digest=false;queue.forEach(function(queueItem){var skip=queueItem.scope&&queueItem.scope.$$destroyed;if(!skip){queueItem.callback();}});if(digest)$rootScope.$digest();}",
"title": ""
},
{
"docid": "7fa1510526a5dfb8c17856756da080b5",
"score": "0.533649",
"text": "function processQueue(){var queue=nextTick.queue;var digest=nextTick.digest;nextTick.queue=[];nextTick.timeout=null;nextTick.digest=false;queue.forEach(function(queueItem){var skip=queueItem.scope&&queueItem.scope.$$destroyed;if(!skip){queueItem.callback();}});if(digest)$rootScope.$digest();}",
"title": ""
},
{
"docid": "0420764390f06f4cccdc0dde427921b0",
"score": "0.53355616",
"text": "function checkComplete() {\n if (noMoreChunks && dbQueue.length()===0 && !didError) {\n // just in case\n setTimeout(function() {\n backupComplete(null)\n },100)\n }\n }",
"title": ""
},
{
"docid": "4b5b88b41b1214395a90b61175942475",
"score": "0.5333761",
"text": "async resolveFully() {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }",
"title": ""
},
{
"docid": "1ec5190c898cb38a042bc4993064c4bb",
"score": "0.53283393",
"text": "cycle() {\n try {\n this.checkRules();\n if (this.queue.length > 0) {\n\tvar task = this.queue.shift();\n\tthis.runTask(task);\n }\n } finally {\n var waitTime = this.minimumWaitTime + Math.random() * (this.averageWaitTime - this.minimumWaitTime) * 2;\n setTimeout(() => { this.cycle() }, waitTime)\n }\n }",
"title": ""
},
{
"docid": "78a85fa01a28256bbd78c0fca5e4b160",
"score": "0.53254753",
"text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index; // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n\n index = index + 1;\n queue[currentIndex].call(); // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n\n queue.length -= index;\n index = 0;\n }\n }\n\n queue.length = 0;\n index = 0;\n }",
"title": ""
},
{
"docid": "10b70d2750ff3e7a4bb639530e567289",
"score": "0.53243935",
"text": "function resetBatcherState(){queue=[];userQueue=[];has={};circular={};waiting=internalQueueDepleted=false}",
"title": ""
},
{
"docid": "01b0e817c1619f75a67f21a8edc781b8",
"score": "0.5322563",
"text": "function flush() {\n\t\t while (index < queue.length) {\n\t\t var currentIndex = index;\n\t\t // Advance the index before calling the task. This ensures that we will\n\t\t // begin flushing on the next task the task throws an error.\n\t\t index = index + 1;\n\t\t queue[currentIndex].call();\n\t\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t\t // shift tasks off the queue after they have been executed.\n\t\t // Instead, we periodically shift 1024 tasks off the queue.\n\t\t if (index > capacity) {\n\t\t // Manually shift all values starting at the index back to the\n\t\t // beginning of the queue.\n\t\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t\t queue[scan] = queue[scan + index];\n\t\t }\n\t\t queue.length -= index;\n\t\t index = 0;\n\t\t }\n\t\t }\n\t\t queue.length = 0;\n\t\t index = 0;\n\t\t flushing = false;\n\t\t}",
"title": ""
},
{
"docid": "7d14f6923ae5a54f35e518df4fe5ec04",
"score": "0.53136355",
"text": "function Queue(tasks)\r\n{\r\n this._Task();\r\n this.tasks = tasks;\r\n}",
"title": ""
},
{
"docid": "5f6428c729b92806079fd1807897102e",
"score": "0.53126585",
"text": "queueOutgoingUntilReadyMessage() {\n this._waitForReadyMessage = true;\n this._queueOutgoing();\n }",
"title": ""
}
] |
20d8a2c61ebdab93fa1522904dc9d4dd | Create a dropdown to replace the tabs if the tabs overflow the wrapper | [
{
"docid": "fe45e1c6ff318bb2897f83dda6d2cc56",
"score": "0.53559273",
"text": "function tertiarynavCheck(){\n if($('.tertiary-nav ul').size() > 0){\n\n var $tabs = $('.tertiary-nav ul.tabbed'),\n $dropdown = $('.tertiary-nav ul.dropdown'),\n $parent = $('.tertiary-nav .g12'),\n $wrap = $('.tertiary-nav .wrap'),\n maxWidth = $wrap.width(),\n fullWidth = 0;\n\n $.each($('.tertiary-nav ul.tabbed li'), function(i,li){\n fullWidth += $(this).outerWidth(true) + 1;\n });\n\n if(fullWidth > maxWidth && $('.dropdown-lbl',$parent).size() < 1){\n $tabs.addClass('hidden');\n var subnavLabel = ($('.sub-nav a.active-trail').size() > 1) ? $('.sub-nav a.active-trail').text() + ': ' : '';\n $wrap.prepend('<div class=\"dropdown-lbl toggle\" data-target=\"tertiary-dropdown\">'+ subnavLabel + $('.tertiary-nav ul.tabbed a.active-trail').text() +'</div>');\n }\n else if(fullWidth <= maxWidth) {\n $('.dropdown-lbl',$parent).remove();\n $dropdown.hide();\n $tabs.removeClass('hidden');\n }\n\n }\n }",
"title": ""
}
] | [
{
"docid": "7d477c555c3e2f8a2c970cdcf13aba82",
"score": "0.6656492",
"text": "function dropdownShape(el) {\n var tabNav = $(el);\n\n // puts div dropdown around the tab navigation and adds class amending style links used by dropdown toggle\n tabNav.addClass('in-dropdown ft-dropdown-nav').wrap('<div data-ft-module=\"dropdown\" class=\"ft-dropdown-tabs\">');\n\n // put all dropdown tabs items inside the dropdown mode\n // note this next code block will be ignored if do not exist any element with that class name inside the tab\n tabNav.find('.ft-dropdown-nav').each(function () {\n tabNav.append($(this).html());\n $(this).closest('li').remove();\n });\n\n // creates the link necessary to control the dropdown with the actived item text\n tabNav.parent('.ft-dropdown-tabs').prepend('<a data-ft-module=\"tabs\" class=\"ft-btn\">' + tabNav.find('li.ft-active > a').text() + '</a>');\n\n // init the tabs and dropdown modules\n frontutils.tabs.init();\n frontutils.dropdown.init();\n }",
"title": ""
},
{
"docid": "4503149aff088838eea8f411519a7cd4",
"score": "0.6645043",
"text": "didInsertElement() {\n this._super(...arguments);\n\n // initialize semantic ui tabs\n this.$('.item').tab();\n\n if (this.get('isOverflowedTabs')) {\n // Dragscroll inplementation for tabs\n const slider = document.querySelector('.dragscroll');\n let isDown = false;\n let startX;\n let scrollLeft;\n\n slider.addEventListener('mousedown', (e) => {\n isDown = true;\n slider.classList.add('active');\n startX = e.pageX - slider.offsetLeft;\n scrollLeft = slider.scrollLeft;\n });\n\n slider.addEventListener('mouseleave', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n\n slider.addEventListener('mouseup', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n\n slider.addEventListener('mousemove', (e) => {\n if (!isDown) {\n return false;\n } else {\n e.preventDefault();\n const x = e.pageX - slider.offsetLeft;\n const walk = (x - startX) * 1.5;\n slider.scrollLeft = scrollLeft - walk;\n }\n });\n\n slider.addEventListener('wheel', (e) => {\n\n // Prevent default.\n e.preventDefault();\n e.stopPropagation();\n\n // Stop link scroll.\n this.$('body').stop();\n\n // Calculate delta, direction.\n const n = this.normalizeWheel(e);\n const x = n.pixelX !== 0 ? n.pixelX : n.pixelY;\n const delta = Math.min(Math.abs(x), 150);\n const direction = x > 0 ? 1 : -1;\n\n // Scroll page.\n this.$('.dragscroll').scrollLeft(this.$('.dragscroll').scrollLeft() + delta * direction);\n });\n\n // Dropdown visibility implementation\n window.addEventListener('resize', () => {\n this.setNavDropdownVisibility();\n });\n\n this.setNavDropdownVisibility();\n }\n }",
"title": ""
},
{
"docid": "84a9bc4ebec87e4c4f08e51800897836",
"score": "0.6234309",
"text": "function updateTabs() {\n var maxWidth = $(Selectors.tabGroup).width() - $(Selectors.ellipses).width();\n var combinedWidth = 0;\n\n $(\".tabGroup .tab\").each(function (index) {\n combinedWidth = combinedWidth + $(this).width();\n if (combinedWidth >= maxWidth) {\n $(this).hide();\n $(\".tabMenu .options div:eq(\" + index + \")\").show();\n } else {\n $(this).show();\n $(\".tabMenu .options div:eq(\" + index + \")\").hide();\n }\n\n });\n\n if (combinedWidth <= maxWidth) {\n $(Selectors.ellipses).hide();\n if ($(Selectors.tabMenu).is(\":visible\")) {\n $(Selectors.tabMenu).hide();\n GlobalVars.tabMenuOpen = false;\n }\n } else {\n $(Selectors.ellipses).show();\n GlobalVars.tabMenuOpen = true;\n }\n\n // Get window size\n GlobalVars.lastInnerWidth = GlobalVars.currInnerWidth;\n}",
"title": ""
},
{
"docid": "8fb36ed7aaa70839ebabe00b3f1c2675",
"score": "0.6190054",
"text": "function tabdrop() {\n\t\t$('.tabdrop').tabdrop({\n\t\t\ttext: '<i class=\"fa fa-align-justify\"></i>'\n\t\t}).on(\"click\", function(){\n\t\t $(this).tabdrop('layout');\n\t\t});\n\t}",
"title": ""
},
{
"docid": "8fb36ed7aaa70839ebabe00b3f1c2675",
"score": "0.6190054",
"text": "function tabdrop() {\n\t\t$('.tabdrop').tabdrop({\n\t\t\ttext: '<i class=\"fa fa-align-justify\"></i>'\n\t\t}).on(\"click\", function(){\n\t\t $(this).tabdrop('layout');\n\t\t});\n\t}",
"title": ""
},
{
"docid": "c51595e39cac91451b09bfa6ed6047f4",
"score": "0.61798334",
"text": "function MegaDropdown() {\n $('.mega__dropdown').find('.submenu__dropdown:first').css({\n 'position': 'absolute'\n });\n\n $('.mega__dropdown').find('.submenu__dropdown:first').removeClass('child');\n\n $('.mega__dropdown').on('mouseover', function () {\n $(this).find('.submenu__dropdown:first').addClass('active');\n });\n\n $('.mega__dropdown').on('mouseleave', function () {\n $(this).find('.submenu__dropdown:first').removeClass('active');\n });\n\n $('.mega__dropdown').each(function () {\n $(this).find('ul:first').wrapInner('<div class=\"container no-padding\" />')\n });\n }",
"title": ""
},
{
"docid": "351acff800849f5fefa72896f086eb11",
"score": "0.61624694",
"text": "function placeDropdown(eventType){// Check for simultaneous focus and click events.\nif(eventType==='focus'){isFocused=true;}// Check html data attributes\nupdateOptions();// Set Dropdown state\nactivates.addClass('active');origin.addClass('active');// Constrain width\nif(options.constrain_width===true){activates.css('width',origin.outerWidth());}else{activates.css('white-space','nowrap');}// Offscreen detection\nvar windowHeight=window.innerHeight;var originHeight=origin.innerHeight();var offsetLeft=origin.offset().left;var offsetTop=origin.offset().top-$(window).scrollTop();var currAlignment=options.alignment;var gutterSpacing=0;var leftPosition=0;// Below Origin\nvar verticalOffset=0;if(options.belowOrigin===true){verticalOffset=originHeight;}// Check for scrolling positioned container.\nvar scrollOffset=0;var wrapper=origin.parent();if(!wrapper.is('body')&&wrapper[0].scrollHeight>wrapper[0].clientHeight){scrollOffset=wrapper[0].scrollTop;}if(offsetLeft+activates.innerWidth()>$(window).width()){// Dropdown goes past screen on right, force right alignment\ncurrAlignment='right';}else if(offsetLeft-activates.innerWidth()+origin.innerWidth()<0){// Dropdown goes past screen on left, force left alignment\ncurrAlignment='left';}// Vertical bottom offscreen detection\nif(offsetTop+activates.innerHeight()>windowHeight){// If going upwards still goes offscreen, just crop height of dropdown.\nif(offsetTop+originHeight-activates.innerHeight()<0){var adjustedHeight=windowHeight-offsetTop-verticalOffset;activates.css('max-height',adjustedHeight);}else{// Flow upwards.\nif(!verticalOffset){verticalOffset+=originHeight;}verticalOffset-=activates.innerHeight();}}// Handle edge alignment\nif(currAlignment==='left'){gutterSpacing=options.gutter;leftPosition=origin.position().left+gutterSpacing;}else if(currAlignment==='right'){var offsetRight=origin.position().left+origin.outerWidth()-activates.outerWidth();gutterSpacing=-options.gutter;leftPosition=offsetRight+gutterSpacing;}// Position dropdown\nactivates.css({position:'absolute',top:origin.position().top+verticalOffset+scrollOffset,left:leftPosition});// Show dropdown\nactivates.stop(true,true).css('opacity',0).slideDown({queue:false,duration:options.inDuration,easing:'easeOutCubic',complete:function complete(){$(this).css('height','');}}).animate({opacity:1,scrollTop:0},{queue:false,duration:options.inDuration,easing:'easeOutSine'});}",
"title": ""
},
{
"docid": "e2f46af99be79244317e85d49cb0b626",
"score": "0.6082781",
"text": "function dropdown() {\r\n var x = document.createElement('div');\r\n var node = document.createElement(\"LI\");\r\n node.setAttribute('class', 'base');\r\n\r\n var dropName = \"drop \" + String(getDrop());\r\n addDrop();\r\n x.setAttribute(\"id\", dropName);\r\n x.setAttribute('class', 'dropdown');\r\n\r\n x.innerHTML = \"<select name='' class='dropdown' id='\" + String(dropName) + \"'>\"\r\n + '<option value=\"\" disabled selected hidden>Please select</option>'\r\n +'</select>';\r\n\r\n while(x.firstChild) {\r\n node.appendChild(x.firstChild);\r\n }\r\n\r\n var y = document.createElement('button');\r\n y.setAttribute('content', 'test content');\r\n y.setAttribute('class', 'properties');\r\n y.innerHTML = 'Edit';\r\n\r\n var z = document.createElement('button');\r\n z.setAttribute('content', 'test content');\r\n z.setAttribute('class', 'delete');\r\n z.innerHTML = 'x';\r\n\r\n node.appendChild(y);\r\n node.appendChild(z);\r\n\r\n var tabID = String(getSelectedTabId());\r\n\r\n var tabContID = document.getElementById(tabID).children[0].id;\r\n\r\n document.getElementById(tabContID).appendChild(node);\r\n\r\n var active = $(\"#tabs .ui-tabs-panel:visible\").attr(\"id\");\r\n\r\n var test = document.getElementById(active).getElementsByClassName(\"fieldClass\");\r\n\r\n if(test.length > 0) {\r\n remake();\r\n }\r\n}",
"title": ""
},
{
"docid": "d1709749ca6a51a73db6981ed9f3bcca",
"score": "0.59907603",
"text": "async setupDropdown() {\n if (!this.instance || !this.anchorEl) {\n return;\n }\n this.instance.style.height = '';\n this.instance.style.maxHeight = '';\n this.instance.style.maxWidth = '';\n const anchorRect = this.anchorEl.getBoundingClientRect();\n this.setMinHeight();\n this.setDropdownDirection(anchorRect);\n this.setHeight();\n this.setMaxWidth(anchorRect);\n this.setMaxHeight(anchorRect);\n this.setDropdownPosition(anchorRect);\n this.setPointerPosition(anchorRect);\n }",
"title": ""
},
{
"docid": "b4ed4e9d0fa87eda65861bad9e65abfa",
"score": "0.5905113",
"text": "function onWindowResize(){if(!ctrl.hidden){positionDropdown();}}",
"title": ""
},
{
"docid": "515eaa1b94bdd41e23ba80e3ee170a4d",
"score": "0.5871577",
"text": "function tabs(){\n\tvar tabWrap = $('.tabs-wrap');\n\ttabWrap.each(function(){\n\t\tvar thisTabWrap = $(this);\n\t\tvar tabControl = thisTabWrap.find('.tab-controls');\n\t\tvar controlItem = tabControl.find('a');\n\t\tvar itemControl = tabControl.find('li.active').index();\n\t\ttabControl.find('li.active').prev().addClass('prev-item');\n\t\tvar tabsWrap = thisTabWrap.find('.tabs');\n\t\tvar tab = tabsWrap.find('.tab');\n\t\ttab.eq(itemControl).fadeIn(0).siblings().fadeOut(0);\n\t\tcontrolItem.on('click', function(e){\n\t\t\tvar $this = $(this);\n\t\t\tvar index = $this.parents('li').index();\n\t\t\t$this.parents('li').addClass('active').siblings().removeClass('active prev-item');\n\t\t\t$this.parents('li').prev().addClass('prev-item');\n\t\t\t$this.parents('li.active').removeClass('prev-item');\n\t\t\ttab.fadeOut(0).eq(index).fadeIn(300);\n\t\t\t$('select.cselect').multiselect(\"refresh\");\n\t\t\te.preventDefault();\n\t\t});\n\t});\n}",
"title": ""
},
{
"docid": "208a13b55cf6d6a7541f959439473d75",
"score": "0.58301103",
"text": "constraintDropDownToParent() {\r\n const parentProps = this.selectize.getBoundingClientRect();\r\n const root = document.documentElement;\r\n root.style.setProperty('--drop-down-position-top', `${parentProps.height}px`);\r\n }",
"title": ""
},
{
"docid": "fe8b429f8956439966997e95fcb9ef15",
"score": "0.5822911",
"text": "showDropdown() {\n const { buttonGroup, buttons, chart, dropdown } = this;\n if (buttonGroup && dropdown) {\n const { translateX, translateY } = buttonGroup;\n const bBox = buttons[this.currentButtonIndex()].getBBox();\n css(dropdown, {\n left: (chart.plotLeft + translateX) + 'px',\n top: (translateY + 0.5) + 'px',\n width: bBox.width + 'px',\n height: bBox.height + 'px'\n });\n this.hasVisibleDropdown = true;\n }\n }",
"title": ""
},
{
"docid": "d9408bd1013e480e4c5e76e6cdab9f7c",
"score": "0.5805961",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n } // Check html data attributes\n\n\n updateOptions(); // Set Dropdown state\n\n activates.addClass('active');\n origin.addClass('active'); // Constrain width\n\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n } else {\n activates.css('white-space', 'nowrap');\n } // Offscreen detection\n\n\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0; // Below Origin\n\n var verticalOffset = 0;\n\n if (options.belowOrigin === true) {\n verticalOffset = originHeight;\n } // Check for scrolling positioned container.\n\n\n var scrollOffset = 0;\n var wrapper = origin.parent();\n\n if (!wrapper.is('body') && wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollOffset = wrapper[0].scrollTop;\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n } // Vertical bottom offscreen detection\n\n\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n\n verticalOffset -= activates.innerHeight();\n }\n } // Handle edge alignment\n\n\n if (currAlignment === 'left') {\n gutterSpacing = options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n } else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n } // Position dropdown\n\n\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollOffset,\n left: leftPosition\n }); // Show dropdown\n\n activates.stop(true, true).css('opacity', 0).slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function complete() {\n $(this).css('height', '');\n }\n }).animate({\n opacity: 1,\n scrollTop: 0\n }, {\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutSine'\n });\n }",
"title": ""
},
{
"docid": "7b164a9ca269c79737a379b7aea1bcea",
"score": "0.579913",
"text": "function tabSelect(event) {\n subSelected = false;\n var cbdropDownDisplay = $('.cb-dropDown');\n var topic = $('.more-topic');\n if (cbdropDownDisplay.hasClass('active')) {\n cbdropDownDisplay.removeClass('active');\n topic.removeClass('active');\n }\n var target = event.target || event.srcElement;\n selectedTab = target.textContent.toLowerCase();\n isCreated = false;\n if (event.target.className.indexOf(\"open\") == -1) {\n createdropDown();\n } else {\n subSelected = true;\n var parent = document.getElementsByClassName(\"dropDown-item\");\n for (var i = 0; i < parent.length; i++) {\n parent[i].classList.remove('active');\n }\n event.target.classList.add('active');\n }\n $('.tab-content').remove();\n setTabs();\n processData();\n }",
"title": ""
},
{
"docid": "22f30361620b0059c62d3c540d05d252",
"score": "0.579501",
"text": "function setupBuilderTabs() {\n\tvar mainPanel = $(\"#tabsSelector\");\n\t$.Each(mainPanel.Children(), function (tabElement) {\n\t\tvar tabLink = tabElement.GetAttributeString(\"link\", \"-1\");\n\n\t\tif (tabLink != \"-1\") {\n\t\t\ttabElement.SetPanelEvent(\"onactivate\", function () {\n\t\t\t\tshowBuilderTab(tabLink);\n\n\t\t\t\t// No skills selected anymore\n\t\t\t\tif (currentPhase != PHASE_BANNING) {\n\t\t\t\t\tsetSelectedDropAbility();\n\t\t\t\t}\n\n\t\t\t\t// Deselect any hero\n\t\t\t\tif (currentPhase != PHASE_BANNING) {\n\t\t\t\t\tsetSelectedHelperHero();\n\t\t\t\t}\n\n\t\t\t\t// Focus to nothing\n\t\t\t\tfocusNothing();\n\t\t\t});\n\t\t}\n\t});\n\n\tvar mainContentPanel = $(\"#pickingPhaseTabsContent\");\n\t$.Each(mainContentPanel.Children(), function (panelTab) {\n\t\tif (panelTab.BHasClass(\"pickingPhaseTabContent\")) {\n\t\t\tpanelTab.visible = false;\n\t\t}\n\t});\n\n\tif (currentPhase == PHASE_SELECTION) {\n\t\tshowBuilderTab(\"pickingPhaseMainTab\");\n\t}\n\n\t// Default to no selected preview hero\n\tsetSelectedHelperHero();\n\n\tfor (var i = 1; i <= 6; ++i) {\n\t\t(function (con, slotID) {\n\t\t\t// Hook abilitys that should show info\n\t\t\thookSkillInfo(con);\n\n\t\t\tcon.SetDraggable(true);\n\n\t\t\t// Allow for dropping\n\t\t\t$.RegisterEventHandler(\"DragEnter\", con, function (panelID, draggedPanel) {\n\t\t\t\t// Are we dragging an ability?\n\t\t\t\tif (draggedPanel.GetAttributeString(\"abilityname\", \"\") != \"\") {\n\t\t\t\t\tcon.AddClass(\"potential_drop_target\");\n\t\t\t\t\tdraggedPanel.SetAttributeInt(\"activeSlot\", slotID);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$.RegisterEventHandler(\"DragLeave\", con, function (panelID, draggedPanel) {\n\t\t\t\t$.Schedule(0.01, function () {\n\t\t\t\t\tcon.RemoveClass(\"potential_drop_target\");\n\n\t\t\t\t\tif (draggedPanel.deleted == null && draggedPanel.GetAttributeInt(\"activeSlot\", -1) == slotID) {\n\t\t\t\t\t\tdraggedPanel.SetAttributeInt(\"activeSlot\", -1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// TODO: Allow for slot swapping\n\t\t\t$.RegisterEventHandler(\"DragStart\", con, function (panelID, dragCallbacks) {\n\t\t\t\tvar abName = con.GetAttributeString(\"abilityname\", \"\");\n\n\t\t\t\tif (abName == null || abName.length <= 0) return false;\n\n\t\t\t\t//setSelectedDropAbility(abName, con);\n\n\t\t\t\t// Create a temp image to drag around\n\t\t\t\tvar displayPanel = $.CreatePanel(\"DOTAAbilityImage\", $.GetContextPanel(), \"dragImage\");\n\t\t\t\tdisplayPanel.abilityname = abName;\n\t\t\t\tdragCallbacks.displayPanel = displayPanel;\n\t\t\t\tdragCallbacks.offsetX = 0;\n\t\t\t\tdragCallbacks.offsetY = 0;\n\t\t\t\tdisplayPanel.SetAttributeString(\"abilityname\", abName);\n\n\t\t\t\t// Select this slot\n\t\t\t\tcurrentSelectedSlot = slotID;\n\n\t\t\t\t// Do the highlight\n\t\t\t\thighlightDropSlots();\n\n\t\t\t\t// Hide skill info\n\t\t\t\t$.DispatchEvent(\"DOTAHideAbilityTooltip\");\n\t\t\t\t$.DispatchEvent(\"DOTAHideTitleTextTooltip\");\n\t\t\t});\n\n\t\t\t$.RegisterEventHandler(\"DragEnd\", con, function (panelId, draggedPanel) {\n\t\t\t\t// Delete the draggable panel\n\t\t\t\tdraggedPanel.deleted = true;\n\t\t\t\tdraggedPanel.DeleteAsync(0.0);\n\n\t\t\t\tvar dropSlot = draggedPanel.GetAttributeInt(\"activeSlot\", -1);\n\t\t\t\tif (dropSlot != -1 && dropSlot != slotID) {\n\t\t\t\t\tswapSlots(dropSlot, slotID);\n\t\t\t\t} else if (dropSlot == -1) {\n\t\t\t\t\tremoveAbility(slotID);\n\t\t\t\t}\n\n\t\t\t\t// Highlight nothing\n\t\t\t\tsetSelectedDropAbility();\n\t\t\t});\n\t\t})($(\"#lodYourAbility\" + i), i);\n\t}\n\n\tfor (var i = 1; i <= 16; ++i) {\n\t\tvar abCon = $(\"#buildingHelperHeroPreviewSkill\" + i);\n\t\thookSkillInfo(abCon);\n\t\tmakeSkillSelectable(abCon);\n\t\tvar label = $.CreatePanel(\"Label\", abCon, \"buildingHelperSkillTabCost\" + i);\n\t\tlabel.SetHasClass(\"skillCostLarge\", true);\n\t}\n\n\t// Hook drag and drop stuff for heroes\n\tvar heroDragEnter = function (panelID, draggedPanel) {\n\t\t// Are we dragging an ability?\n\t\tif (draggedPanel.GetAttributeString(\"heroName\", \"\") != \"\") {\n\t\t\theroDropCon.AddClass(\"potential_drop_target\");\n\t\t\theroDropConBlank.AddClass(\"potential_drop_target\");\n\t\t\tdraggedPanel.SetAttributeInt(\"canSelectHero\", 1);\n\t\t}\n\t};\n\n\tvar heroDragLeave = function (panelID, draggedPanel) {\n\t\t$.Schedule(0.1, function () {\n\t\t\theroDropCon.RemoveClass(\"potential_drop_target\");\n\t\t\theroDropConBlank.RemoveClass(\"potential_drop_target\");\n\n\t\t\tif (draggedPanel.deleted == null) {\n\t\t\t\tdraggedPanel.SetAttributeInt(\"canSelectHero\", 0);\n\t\t\t}\n\t\t});\n\t};\n\n\tvar heroDropCon = $(\"#pickingPhaseSelectedHeroImage\");\n\t$.RegisterEventHandler(\"DragEnter\", heroDropCon, heroDragEnter);\n\t$.RegisterEventHandler(\"DragLeave\", heroDropCon, heroDragLeave);\n\n\t// Display info about the hero on hover\n\thookHeroInfo(heroDropCon);\n\n\tvar heroDropConBlank = $(\"#pickingPhaseSelectedHeroImageNone\");\n\t$.RegisterEventHandler(\"DragEnter\", heroDropConBlank, heroDragEnter);\n\t$.RegisterEventHandler(\"DragLeave\", heroDropConBlank, heroDragLeave);\n\n\t$(\"#pickingPhaseSelectedHeroImageCon\").SetPanelEvent(\"onactivate\", function () {\n\t\tonYourHeroRandomed();\n\t});\n\n\t$(\"#pickingPhaseSelectedHeroImageCon\").SetPanelEvent(\"oncontextmenu\", function () {\n\t\tonYourHeroRandomed();\n\t});\n\n\t$(\"#pickingPhaseSelectedHeroText\").hittest = false;\n\n\t// Hook banning\n\t//var theSet = '';\n\tvar hookSet = function (setName) {\n\t\tvar enterNumber = 0;\n\t\tvar banningArea = $(\"#pickingPhaseBans\");\n\n\t\tvar banningDragEnter = function (panelID, draggedPanel) {\n\t\t\tbanningArea.AddClass(\"potential_drop_target\");\n\t\t\tdraggedPanel.SetAttributeInt(\"banThis\", 1);\n\n\t\t\t// Prevent annoyingness\n\t\t\t++enterNumber;\n\t\t};\n\n\t\tvar banningDragLeave = function (panelID, draggedPanel) {\n\t\t\tvar myNumber = ++enterNumber;\n\n\t\t\t$.Schedule(0.1, function () {\n\t\t\t\tif (myNumber == enterNumber) {\n\t\t\t\t\tbanningArea.RemoveClass(\"potential_drop_target\");\n\n\t\t\t\t\tif (draggedPanel.deleted == null) {\n\t\t\t\t\t\tdraggedPanel.SetAttributeInt(\"banThis\", 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t$.RegisterEventHandler(\"DragEnter\", $(setName), banningDragEnter);\n\t\t$.RegisterEventHandler(\"DragLeave\", $(setName), banningDragLeave);\n\t};\n\n\thookSet(\"#pickingPhaseBans\");\n}",
"title": ""
},
{
"docid": "e7c6fac99ff102a3222f44022d763455",
"score": "0.5789494",
"text": "function createMenu(data) {\n document.getElementById(\"selectButton\").style.display = \"block\";\n document.getElementById('dropdown1').innerHTML =\"\";\n for (var i = 0; i < data.length; i++) {\n document.getElementById('dropdown1').innerHTML +=\n `<li tabindex=\"${i}\"><a href=\"#${data[i].name.replace(/ /g,'-')}\">${data[i].name}--${data[i].abv}% ABV</a></li>`;\n };\n $('.dropdown-trigger').dropdown({\n inDuration: 300,\n outDuration: 225,\n constrain_width: false, \n hover: true, // Activate on hover\n gutter: 0, // Spacing from edge\n belowOrigin: false, // Displays dropdown below the button\n alignment: 'left' \n });\n\n}",
"title": ""
},
{
"docid": "7bb90c9be28b7aa76a01e5aea10dc37f",
"score": "0.57764167",
"text": "function updateDropdown(){\n \n var dropdown = $('#eventDrop').html('');\n for(var i=0; i<locations.length; i++){\n var li = '';\n if(i === 0){\n li = '<li id=\"autoSelect\" class=\"active\">'+\n '<a id=\"eLoco'+locations[i].id+'\" class=\"eLoco\" href=\"#tab1\" data-toggle=\"tab\">'+locations[i].name+'</a>'+\n '</li>';\n }else{\n li ='<li class=\"\">'+\n '<a id=\"eLoco'+locations[i].id+'\" class=\"eLoco\" href=\"#tab1\" data-toggle=\"tab\">'+locations[i].name+'</a>'+\n '</li>';\n }\n $(dropdown).append(li);\n }\n }",
"title": ""
},
{
"docid": "5354eb8d9f60f4289fd4770d16e7ef84",
"score": "0.5770244",
"text": "handleDropdownShow(elem) {\n const listItem = elem.nextSibling;\n const height = this.getListHeight(listItem);\n const caret = elem.querySelector(SELECTORS.DROPDOWN_CARET);\n caret.classList.add(CLASSES.ROTATE);\n elem.nextSibling.classList.add(CLASSES.SHOW);\n listItem.style.height = height;\n\n window.setTimeout(() => {\n listItem.style.height = '';\n }, 350);\n }",
"title": ""
},
{
"docid": "524afe4f2e22bf57c449c049d5fc97c8",
"score": "0.57615316",
"text": "function setupDropdown()\n{\n $('.dropdown-button').on('click', function(){\n // $panel = $(this).next();\n // $panel.css('top','54px');\n // $panel.css('left','0px');\n })\n\n $('.dropdown__option').on('click',function(){\n var html = $(this).html();\n var $sel = $(this).parent().parent().prev();\n var $panel = $(this).parent().parent();\n $sel.html(html+'<i class=\"icon arrow-style-a dropdown-arrow\"></i>');\n $panel.removeClass('open');\n $panel.css('display','none');\n return false;\n });\n}",
"title": ""
},
{
"docid": "6fb78a388121bb7c4edff160809354c6",
"score": "0.5741272",
"text": "function toggleTab(num,numelems,opennum,animate) {\n\t$('selectlist').innerHTML = \"\";\n if ($('tabContent'+num).style.display == 'none'){\n for (var i=1;i<=numelems;i++){\n if ((opennum == null) || (opennum != i)){\n var temph = 'tabHeader'+i;\n var h = $(temph);\n if (!h){\n var h = $('tabHeaderActive');\n h.id = temph;\n }\n var tempc = 'tabContent'+i;\n var c = $(tempc);\n if(c.style.display != 'none'){\n if (animate || typeof animate == 'undefined')\n Effect.toggle(tempc,'blind',{duration:0.5, queue:{scope:'menus', limit: 3}});\n else\n toggleDisp(tempc);\n }\n }\n }\n var h = $('tabHeader'+num);\n if (h)\n h.id = 'tabHeaderActive';\n h.blur();\n var c = $('tabContent'+num);\n c.style.marginTop = '2px';\n if (animate || typeof animate == 'undefined'){\n Effect.toggle('tabContent'+num,'blind',{duration:0.5, queue:{scope:'menus', position:'end', limit: 3}});\n }else{\n toggleDisp('tabContent'+num);\n }\n }\n}",
"title": ""
},
{
"docid": "6d0cd186ef867fdee5d8989e196ebd95",
"score": "0.57335055",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n // Constrain width\n if (curr_options.constrainWidth === true) {\n activates.css('width', origin.outerWidth());\n\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = curr_options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (curr_options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollYOffset = 0;\n var scrollXOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body')) {\n if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollYOffset = wrapper[0].scrollTop;\n }\n if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n scrollXOffset = wrapper[0].scrollLeft;\n }\n }\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = curr_options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n }\n else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -curr_options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollYOffset,\n left: leftPosition + scrollXOffset\n });\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: curr_options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: curr_options.inDuration, easing: 'easeOutSine'});\n\n // Add click close handler to document\n $(document).bind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'), function (e) {\n if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length) ) {\n hideDropdown();\n $(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));\n }\n });\n }",
"title": ""
},
{
"docid": "7aed8a9ce0226d7b9cb073ad78a63b7b",
"score": "0.5718316",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n var originWidth = origin[0].getBoundingClientRect().width;\n\n // Constrain width\n if (curr_options.constrainWidth === true) {\n activates.css('width', originWidth);\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = curr_options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (curr_options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollYOffset = 0;\n var scrollXOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body')) {\n if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollYOffset = wrapper[0].scrollTop;\n }\n if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n scrollXOffset = wrapper[0].scrollLeft;\n }\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = curr_options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n } else if (currAlignment === 'right') {\n // Material icons fix\n activates.stop(true, true).css({\n opacity: 0,\n left: 0\n });\n\n var offsetRight = origin.position().left + originWidth - activates.width();\n gutterSpacing = -curr_options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollYOffset,\n left: leftPosition + scrollXOffset\n });\n\n // Show dropdown\n activates.slideDown({\n queue: false,\n duration: curr_options.inDuration,\n easing: 'easeOutCubic',\n complete: function () {\n $(this).css('height', '');\n }\n }).animate({ opacity: 1 }, { queue: false, duration: curr_options.inDuration, easing: 'easeOutSine' });\n\n // Add click close handler to document\n setTimeout(function () {\n $(document).on('click.' + activates.attr('id'), function (e) {\n hideDropdown();\n $(document).off('click.' + activates.attr('id'));\n });\n }, 0);\n }",
"title": ""
},
{
"docid": "7aed8a9ce0226d7b9cb073ad78a63b7b",
"score": "0.5718316",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n var originWidth = origin[0].getBoundingClientRect().width;\n\n // Constrain width\n if (curr_options.constrainWidth === true) {\n activates.css('width', originWidth);\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = curr_options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (curr_options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollYOffset = 0;\n var scrollXOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body')) {\n if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollYOffset = wrapper[0].scrollTop;\n }\n if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n scrollXOffset = wrapper[0].scrollLeft;\n }\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = curr_options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n } else if (currAlignment === 'right') {\n // Material icons fix\n activates.stop(true, true).css({\n opacity: 0,\n left: 0\n });\n\n var offsetRight = origin.position().left + originWidth - activates.width();\n gutterSpacing = -curr_options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollYOffset,\n left: leftPosition + scrollXOffset\n });\n\n // Show dropdown\n activates.slideDown({\n queue: false,\n duration: curr_options.inDuration,\n easing: 'easeOutCubic',\n complete: function () {\n $(this).css('height', '');\n }\n }).animate({ opacity: 1 }, { queue: false, duration: curr_options.inDuration, easing: 'easeOutSine' });\n\n // Add click close handler to document\n setTimeout(function () {\n $(document).on('click.' + activates.attr('id'), function (e) {\n hideDropdown();\n $(document).off('click.' + activates.attr('id'));\n });\n }, 0);\n }",
"title": ""
},
{
"docid": "7aed8a9ce0226d7b9cb073ad78a63b7b",
"score": "0.5718316",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n var originWidth = origin[0].getBoundingClientRect().width;\n\n // Constrain width\n if (curr_options.constrainWidth === true) {\n activates.css('width', originWidth);\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = curr_options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (curr_options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollYOffset = 0;\n var scrollXOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body')) {\n if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollYOffset = wrapper[0].scrollTop;\n }\n if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n scrollXOffset = wrapper[0].scrollLeft;\n }\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = curr_options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n } else if (currAlignment === 'right') {\n // Material icons fix\n activates.stop(true, true).css({\n opacity: 0,\n left: 0\n });\n\n var offsetRight = origin.position().left + originWidth - activates.width();\n gutterSpacing = -curr_options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollYOffset,\n left: leftPosition + scrollXOffset\n });\n\n // Show dropdown\n activates.slideDown({\n queue: false,\n duration: curr_options.inDuration,\n easing: 'easeOutCubic',\n complete: function () {\n $(this).css('height', '');\n }\n }).animate({ opacity: 1 }, { queue: false, duration: curr_options.inDuration, easing: 'easeOutSine' });\n\n // Add click close handler to document\n setTimeout(function () {\n $(document).on('click.' + activates.attr('id'), function (e) {\n hideDropdown();\n $(document).off('click.' + activates.attr('id'));\n });\n }, 0);\n }",
"title": ""
},
{
"docid": "4d996d9e2feb6c8d63753a9b1efb6b31",
"score": "0.5701421",
"text": "showDropDownArea() {\n jQuery(this.dropDownArea.current).slideToggle();\n }",
"title": ""
},
{
"docid": "9fd0d0f74122c9162fd793d0be6b0dcd",
"score": "0.5674712",
"text": "function placeDropdown(eventType) {\n\t // Check for simultaneous focus and click events.\n\t if (eventType === 'focus') {\n\t isFocused = true;\n\t }\n\t\n\t // Check html data attributes\n\t updateOptions();\n\t\n\t // Set Dropdown state\n\t activates.addClass('active');\n\t origin.addClass('active');\n\t\n\t // Constrain width\n\t if (options.constrain_width === true) {\n\t activates.css('width', origin.outerWidth());\n\t\n\t } else {\n\t activates.css('white-space', 'nowrap');\n\t }\n\t\n\t // Offscreen detection\n\t var windowHeight = window.innerHeight;\n\t var originHeight = origin.innerHeight();\n\t var offsetLeft = origin.offset().left;\n\t var offsetTop = origin.offset().top - $(window).scrollTop();\n\t var currAlignment = options.alignment;\n\t var gutterSpacing = 0;\n\t var leftPosition = 0;\n\t\n\t // Below Origin\n\t var verticalOffset = 0;\n\t if (options.belowOrigin === true) {\n\t verticalOffset = originHeight;\n\t }\n\t\n\t // Check for scrolling positioned container.\n\t var scrollYOffset = 0;\n\t var scrollXOffset = 0;\n\t var wrapper = origin.parent();\n\t if (!wrapper.is('body')) {\n\t if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n\t scrollYOffset = wrapper[0].scrollTop;\n\t }\n\t if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n\t scrollXOffset = wrapper[0].scrollLeft;\n\t }\n\t }\n\t\n\t\n\t if (offsetLeft + activates.innerWidth() > $(window).width()) {\n\t // Dropdown goes past screen on right, force right alignment\n\t currAlignment = 'right';\n\t\n\t } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n\t // Dropdown goes past screen on left, force left alignment\n\t currAlignment = 'left';\n\t }\n\t // Vertical bottom offscreen detection\n\t if (offsetTop + activates.innerHeight() > windowHeight) {\n\t // If going upwards still goes offscreen, just crop height of dropdown.\n\t if (offsetTop + originHeight - activates.innerHeight() < 0) {\n\t var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n\t activates.css('max-height', adjustedHeight);\n\t } else {\n\t // Flow upwards.\n\t if (!verticalOffset) {\n\t verticalOffset += originHeight;\n\t }\n\t verticalOffset -= activates.innerHeight();\n\t }\n\t }\n\t\n\t // Handle edge alignment\n\t if (currAlignment === 'left') {\n\t gutterSpacing = options.gutter;\n\t leftPosition = origin.position().left + gutterSpacing;\n\t }\n\t else if (currAlignment === 'right') {\n\t var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n\t gutterSpacing = -options.gutter;\n\t leftPosition = offsetRight + gutterSpacing;\n\t }\n\t\n\t // Position dropdown\n\t activates.css({\n\t position: 'absolute',\n\t top: origin.position().top + verticalOffset + scrollYOffset,\n\t left: leftPosition + scrollXOffset\n\t });\n\t\n\t\n\t // Show dropdown\n\t activates.stop(true, true).css('opacity', 0)\n\t .slideDown({\n\t queue: false,\n\t duration: options.inDuration,\n\t easing: 'easeOutCubic',\n\t complete: function() {\n\t $(this).css('height', '');\n\t }\n\t })\n\t .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n\t }",
"title": ""
},
{
"docid": "95049f3c74cf37e7203c207b829f1e9b",
"score": "0.5657955",
"text": "function _ElsevierTabs(options) {\n var t = this;\n var settings = {};\n\n function init(options) {\n\n // Default settings\n settings = $.extend({\n 'selector': '.tabs-normal',\n 'type': 'normal',\n 'tabsSettings': {}\n }, options);\n\n // Create menu\n $(settings.selector).each(function () {\n createMenu($(this)); // Create menu\n $(this).tabs(settings.tabsSettings); // Initialize jQuery UI Tabs\n adjustPaddings($('.tabs-menu', $(this)));\n });\n\n }\n\n function createMenu(TabsWrapperObj) {\n var tabs = $('.tab', TabsWrapperObj);\n\n if (tabs.length) {\n var menuHTML = '<div class=\"box-header\"><ul class=\"tabs-menu tabs-number-' + tabs.length + '\">';\n for (i = tabs.length - 1; i >= 0; i--) {\n var tabObj = $(tabs[i]);\n var tabTitle = tabObj.data('title');\n var itemClass = '';\n var after = (settings['type'] == 'process') ? '<span></span>' : '';\n var itemID = (tabObj.attr('id')) ? tabObj.attr('id') : tabTitle.replace(/\\ /ig, '-');\n itemID = tabObj.data(\"useid\");\n if (i == 0) {\n itemClass = 'first';\n } else if (i == tabs.length - 1) {\n itemClass = 'last';\n after = ''; // We do not need extra span in last item\n }\n\n tabObj.attr('id', itemID);\n menuHTML += '<li class=\"' + itemClass + '\"><a href=\"#' + itemID + '\">' + unescape(tabTitle) + '</a>' + after + '</li>';\n }\n\n menuHTML += '</ul></div>';\n TabsWrapperObj.prepend(menuHTML);\n }\n }\n\n function adjustPaddings(menuObj) {\n $('a', menuObj).each(function () {\n var maxAvaiableHeight = $(this).parent().height() - 2; // -2 is for top and bottom border width\n var currentObjectHeight = $(this).height();\n\n // If link is bigger then avaiable space ...\n if (currentObjectHeight > maxAvaiableHeight) {\n $(this).css('height', maxAvaiableHeight);\n return false;\n }\n\n var paddingTop = Math.floor((maxAvaiableHeight - currentObjectHeight) / 2);\n var paddingBottom = maxAvaiableHeight - currentObjectHeight - paddingTop;\n\n // apply styles\n $(this).css({\n 'paddingTop': paddingTop,\n 'paddingBottom': paddingBottom\n });\n\n });\n\n }\n\n init(options);\n }",
"title": ""
},
{
"docid": "d8ee0fcf3bbb325ede0d285021418525",
"score": "0.5644631",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollYOffset = 0;\n var scrollXOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body')) {\n if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollYOffset = wrapper[0].scrollTop;\n }\n if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {\n scrollXOffset = wrapper[0].scrollLeft;\n }\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n } else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollYOffset,\n left: leftPosition + scrollXOffset\n });\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0).slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function complete() {\n $(this).css('height', '');\n }\n }).animate({ opacity: 1 }, { queue: false, duration: options.inDuration, easing: 'easeOutSine' });\n }",
"title": ""
},
{
"docid": "8a15b02a59c6e21532a54d659ce97fea",
"score": "0.56391937",
"text": "_renderDropdown() {\n this.selectContainer.style.display = \"none\";\n const html = `\n <div id=\"iconic7878-dropdown\" class=\"${this.prefix + \"dropdown__container\"}\">\n <input class=\"${this.prefix + \"dropdown__input\"}\" placeholder=\"${this.placeholder}\" />\n <span class=\"${this.prefix + \"dropdown__text\"}\"></span>\n <span class=\"${this.prefix + \"dropdown__arrow\"}\">${arrowDown}</span>\n </div>\n `;\n this.selectContainer.insertAdjacentHTML(\"afterend\", html);\n }",
"title": ""
},
{
"docid": "c379eb1ba383ccbda5d31dae51ffb238",
"score": "0.5638189",
"text": "function addSettingsPane() {\n // Options Menu\n $('.top-bar ol.-secondary').filter(':last').append('<li class=\"-item\"><a id=\"USER_Opt\" class=\"-link\" style=\"z-index:1; width: 36px; padding-top: 7px;\"><span style=\"display: inline-block;height: 100%;width: 100%;background-image: url(//cdn.rawgit.com/vihanb/PPCG-Design/master/assets/sprites.svg); background-position: -8px 0px;\"></span></a></li>');\n\n $('body').prepend(\n '<div id=\"USER_OptMenu\" style=\"width: inherit; height: inherit; display: none;\">' +\n ' <div id=\"USER_Backblur\" style=\"position:fixed;z-index:2000;width:100%;height:100%;background:rgba(0,0,0,0.5)\"></div>' +\n ' <div style=\"position:fixed;z-index:2001;width:40%;min-width:600px;top: 50%;left: 50%;transform: translateY(-50%) translateX(-50%);background:' + optionbox.BACKGROUND_COLOR + ';padding:1em;\" class=\"settings-page\">' +\n ' <h1>Userscript Options</h1>' +\n ' <div style=\"/*width:50%;height:100%;float:left;*/max-height: 70vh;overflow-y: scroll;/*! overflow-x: none; */\">' +\n ' <div class=\"inner-container inner-container-flex\">' +\n ' <div class=\"title-box\">' +\n ' <div class=\"title\">' +\n ' Theme' +\n ' </div></div>' +\n ' <div class=\"content\">' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.GOAT_MODE\" id=\"goat-mode\" type=\"checkbox\">' +\n ' <label for=\"goat-mode\">Use goats instead of boats</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.BACKGROUND_LIGHT\" id=\"light_bg_on\" type=\"checkbox\">' +\n ' <label for=\"light_bg_on\">Use Lighter Background</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.MODE_DARK\" id=\"dark_theme_on\" type=\"checkbox\">' +\n ' <label for=\"dark_theme_on\">Use Dark Theme <span style=\"color: #aaa;/*! font-size: 0.6em; *//*! position: center; */\">(WIP)</span>' +\n ' </label>' +\n ' </div></div>' +\n\t ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.PREFER_LIGHT_FONT\" id=\"prefer_light_fonts\" type=\"checkbox\">' +\n ' <label for=\"prefer_light_fonts\">Prefer Light Fonts</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.RUN_IN_CHAT\" id=\"chat_on\" type=\"checkbox\">' +\n ' <label for=\"chat_on\">Use modified theme in chat</label>' +\n ' </div></div></div></div>' +\n ' <div class=\"inner-container inner-container-flex\">' +\n ' <div class=\"title-box\">' +\n ' <div class=\"title\">' +\n ' Features' +\n ' </div></div>' +\n ' <div class=\"content\">' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.USE_LEADERBOARD\" id=\"useleader\" type=\"checkbox\">' +\n ' <label for=\"useleader\">Use Auto Leaderboard</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.SHOW_QOD_WIDGET\" id=\"useqod\" type=\"checkbox\">' +\n ' <label for=\"useqod\">Show the Challenge Of The Day™ widget</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.USE_AUTOTIO\" id=\"usetio\" type=\"checkbox\">' +\n ' <label for=\"usetio\">Use Auto-TryItOnline™ execution</label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.REPLACE_NAMES\" id=\"repnames\" type=\"checkbox\">' +\n ' <label for=\"repnames\">Replace common usernames <span style=\"color: #aaa;/*! font-size: 0.6em; *//*! position: center; */\">(WIP)</span></label>' +\n ' </div></div>' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <input class=\"OPT_Bool\" data-var=\"main.SHOW_BYTE_COUNTS\" id=\"showbcts\" type=\"checkbox\">' +\n ' <label for=\"showbcts\">Show byte counts</span></label>' +\n ' </div></div>' +\n ' </div></div>' +\n ' <div class=\"inner-container inner-container-flex\">' +\n ' <div class=\"title-box\">' +\n ' <div class=\"title\">' +\n ' Challenge of the day' +\n ' </div></div>' +\n ' <div class=\"content\">' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12 with-padding\">' +\n ' <p>Number of questions shown</p>' +\n ' <select id=\"qod-item-cnt\">' +\n ' <option value=\"qs-3\">3</option>' +\n ' <option value=\"qs-4\">4</option>' +\n ' <option value=\"qs-5\">5</option>' +\n ' <option value=\"qs-6\">6</option>' +\n ' <option value=\"qs-7\">7</option>' +\n ' <option value=\"qs-8\">8</option>' +\n ' <option value=\"qs-9\">9</option>' +\n ' </select>' +\n ' </div></div>' +\n ' <div class=\"row\" style=\"margin-top:1.2em;\">' +\n ' <div class=\"col-12\">' +\n ' Always show these tags: <span style=\"color: #999;\">(format is \\'tag-1,tag-2,tag-n,...\\' for as many tags as you want)</span>' +\n ' <br>' +\n ' <input id=\"qod-always-shown-tags\" type=\"text\">' +\n ' </div></div></div></div>' +\n ' <div class=\"inner-container inner-container-flex\">' +\n ' <div class=\"title-box\">' +\n ' <div class=\"title\">' +\n ' Extras' +\n ' </div></div>' +\n ' <div class=\"content\">' +\n ' <div class=\"row\">' +\n ' <div class=\"col-12\">' +\n ' <p>What text to use for the porpise challenge button?</p>' +\n ' <select id=\"proposechoice\">' +\n ' <option value=\"Porpoise\">Porpoise Challenge</option>' +\n ' <option value=\"Propose\">Propose Challenge</option>' +\n ' <option value=\"Propoise\">Propoise Challenge</option>' +\n ' </select></div></div>' +\n ' </div></div></div>' +\n ' <button onclick=\"location.reload()\" style=\"float: right;margin-top: 1em;\">Apply Changes</button>' +\n '</div></div>');\n\n $('#proposechoice').val(main.PROPOSE);\n $('#proposechoice').change(function () {\n var str = $(this).find('option:selected').val();\n GM_setValue('main.PROPOSE', str);\n });\n $('#qod-item-cnt').val('qs-' + main.QOD_NUMBER_OF_QS_SHOWN);\n $('#qod-item-cnt').change(function () {\n var n = +$(this).find('option:selected').val().slice(3);\n GM_setValue('QOD_NUMBER_OF_QS_SHOWN', +n);\n resetData();\n });\n $('#qod-always-shown-tags').val(main.QOD_ALWAYS_SHOWN_TAGS.join());\n $('#qod-always-shown-tags').keypress(function () {\n var str = $('#qod-always-shown-tags').val().split(',');\n console.log('putting', str, 'old', main.QOD_ALWAYS_SHOWN_TAGS);\n GM_setValue('QOD_ALWAYS_SHOWN_TAGS', JSON.stringify(str));\n resetData();\n });\n\n $('#USER_Opt, #USER_Backblur').click(function () {\n $('#USER_OptMenu').fadeToggle(50);\n });\n $('.OPT_Bool').prop('checked', function () {\n console.log('checking', $(this).data('var'), eval($(this).data('var')));\n return eval($(this).data('var'));\n });\n $('.OPT_Bool').change(function () {\n GM_setValue($(this).data('var'), $(this).is(':checked'));\n });\n $('<a>')\n .addClass('topbar-icon yes-hover')\n .css({\n 'z-index': 1,\n 'width': '36px',\n 'background-size': '19px 19px',\n 'background-position': '8px 7px',\n 'background-image': 'url(//i.imgur.com/n246U22.png)'\n })\n .attr({\n id: 'toggleSite',\n href: '//codegolf' + (site === 'meta' ? '' : '.meta') + '.stackexchange.com',\n title: 'Switch to ' + (site === 'meta' ? 'main' : 'meta')\n })\n .appendTo('.network-items');\n}",
"title": ""
},
{
"docid": "320e92a2b5fb02badd45210e5b0636bb",
"score": "0.5634202",
"text": "function headerLinksDropdown()\n {\n var containerWidth = jQuery(\"#HeaderLinksContainer\").innerWidth() - 30;\n var links = jQuery(\"#HeaderLinksContainer\").find(\".HeaderLink\"); // get elements that are links in the header bar\n var linksWidth = 0;\n var caretCreated = false;\n\n jQuery(\"#OverFlowLinks\").remove(); // remove the drop-down menu div\n\n \n if (jQuery(window).width() < 1200 || jQuery('#Header').hasClass('HeaderLarge'))\n {\n return;\n }\n\n if (jQuery('#OverflowListElement').is(':visible'))\n {\n caretCreated = true;\n }\n\n for (var i = 0; i < links.length; i++)\n {\n linksWidth += jQuery(links[i]).outerWidth();\n\n if (linksWidth > containerWidth)\n {\n if (!caretCreated)\n {\n jQuery(links[i- 1]).after('<li id=\"OverflowListElement\"><a href=\"#\" id=\"DropdownCaret\" onclick=\"showHideLinks();\"><span class=\"fa fa-caret-down\"></span></a></li>');\n // append a div to the document.body element that will contain the drop-down menu items\n jQuery(document.body).append('<div id=\"OverFlowLinks\"><ul id=\"HiddenLinks\"></ul></div>'); \n caretCreated = true;\n }\n // remove the li element from header links and append it to drop-down link list \n jQuery(links[i]).remove(); \n jQuery(links[i]).appendTo('#HiddenLinks');\n }\n }\n }",
"title": ""
},
{
"docid": "fc395076ee84d8c1067239825556beba",
"score": "0.5625957",
"text": "didRender() {\n this._super(...arguments);\n\n // Initialize possibly added new tabs.\n this.$('.item').tab();\n\n if (this.get('isOverflowedTabs')) {\n // Inititalize semantic ui dropdown (hidden by default)\n this.$(this.navDropdownDomString).dropdown({\n transition: 'drop',\n action: 'activate',\n onChange(newTab) {\n $.tab('change tab', newTab);\n },\n });\n }\n }",
"title": ""
},
{
"docid": "1a20ac00f99efce391fde55275894aeb",
"score": "0.5617571",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = options.alignment;\n var gutterSpacing = 0;\n var leftPosition = 0;\n\n // Below Origin\n var verticalOffset = 0;\n if (options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n // Check for scrolling positioned container.\n var scrollOffset = 0;\n var wrapper = origin.parent();\n if (!wrapper.is('body') && wrapper[0].scrollHeight > wrapper[0].clientHeight) {\n scrollOffset = wrapper[0].scrollTop;\n }\n\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n }\n else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset + scrollOffset,\n left: leftPosition\n });\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n }",
"title": ""
},
{
"docid": "56b7409c48ca9caac10e152a13a34987",
"score": "0.5608313",
"text": "function moveDropdown(){if(!elements.$.root.length)return;$mdTheming(elements.$.scrollContainer);elements.$.scrollContainer.detach();elements.$.root.append(elements.$.scrollContainer);if($animate.pin)$animate.pin(elements.$.scrollContainer,$rootElement);}",
"title": ""
},
{
"docid": "56b7409c48ca9caac10e152a13a34987",
"score": "0.5608313",
"text": "function moveDropdown(){if(!elements.$.root.length)return;$mdTheming(elements.$.scrollContainer);elements.$.scrollContainer.detach();elements.$.root.append(elements.$.scrollContainer);if($animate.pin)$animate.pin(elements.$.scrollContainer,$rootElement);}",
"title": ""
},
{
"docid": "bad0b50a8eb13c0bb86f585f12b1327d",
"score": "0.5571972",
"text": "function addTab(tabTitle,tabListID, divListID,tabID, divID,tabOnClick,divHTML,tabToolTip,selected){ \n if(!tabToolTip){tabToolTip = ''};\n var show;\n if(selected || selected === 'true'){show = 'active show'}else{show = ''};\n\n $(\"#\" + tabListID ).append(`<li class=\"nav-item\"><a onclick = '${tabOnClick}' class=\"nav-link text-left text-dark tab-nav-link ${show}\" id=\"'+tabID+'\" data-toggle=\"tab\" href=\"#${divID}\" role=\"tab\" aria-controls=\"${divID}\" aria-selected=\"false\" rel=\"txtTooltip\" data-toggle=\"tooltip\" title=\"${tabToolTip}\">${tabTitle}</a></li>`);\n\n $('#'+divListID).append($(`<div class=\"tab-pane fade ${show}\" id=\"${divID}\" role=\"tabpanel\" aria-labelledby=\"${tabID}\" rel=\"txtTooltip\" data-toggle=\"tooltip\" title=\"${tabToolTip}\"></div>`).append(divHTML))\n\n }",
"title": ""
},
{
"docid": "eee8f0b3da0c84a05f8561ee9afda3d8",
"score": "0.55646414",
"text": "function fix_submenus_overflow($element) {\n var selector = \".ui-datatable:not(.headerless-table):not(.no-min-width)\";\n\n if (!$element) {\n $element = $(\"body\");\n }\n\n //check if not already bound\n if ($element.find(selector).length > 0 && $element.find(selector).attr(\"data-fix-overflow\") === \"true\") {\n return;\n }\n else {\n $element.find(selector).attr(\"data-fix-overflow\", \"true\");\n }\n\n //add BT DD show event\n $element.find(selector + \" .btn-group\").on(\"show.bs.dropdown\", function() {\n var $btnDropDown = $(this).find(\".dropdown-toggle\");\n var $listHolder = $(this).find(\"> .dropdown-menu\");\n //reset position property for DD container\n $(this).css(\"position\", \"static\");\n\n if ($listHolder.hasClass(\"pull-right\")) {\n $listHolder.css({\n \"width\": $listHolder.outerWidth(true),\n \"top\": ($btnDropDown.offset().top + $btnDropDown.outerHeight(true)) + \"px\",\n \"left\": ($btnDropDown.offset().left - $listHolder.outerWidth(true) + $btnDropDown.outerWidth(true)) + \"px\"\n });\n }\n else {\n $listHolder.css({\n \"top\": ($btnDropDown.offset().top + $btnDropDown.outerHeight(true)) + \"px\",\n \"left\": $btnDropDown.offset().left + \"px\"\n });\n }\n\n $listHolder.data(\"open\", true);\n });\n\n //add BT DD hide event\n $element.find(selector + \" .btn-group\").on(\"hidden.bs.dropdown\", function() {\n var $listHolder = $(this).find(\"> .dropdown-menu\");\n $listHolder.data(\"open\", false);\n });\n\n //add on scroll for table holder\n $element.find(selector).scroll(function() {\n var $ddHolder = $(this).find(\".btn-group\")\n var $btnDropDown = $(this).find(\".dropdown-toggle\");\n var $listHolder = $(this).find(\"> .dropdown-menu\");\n\n if ($listHolder.data(\"open\")) {\n if ($listHolder.hasClass(\"pull-right\")) {\n $listHolder.css({\n \"width\": $listHolder.outerWidth(true),\n \"top\": ($btnDropDown.offset().top + $btnDropDown.outerHeight(true)) + \"px\",\n \"left\": ($btnDropDown.offset().left - $listHolder.outerWidth(true) + $btnDropDown.outerWidth(true)) + \"px\"\n });\n }\n else {\n $listHolder.css({\n \"top\": ($btnDropDown.offset().top + $btnDropDown.outerHeight(true)) + \"px\",\n \"left\": $btnDropDown.offset().left + \"px\"\n });\n }\n $ddHolder.toggleClass(\"open\", ($btnDropDown.offset().left > $(this).offset().left))\n }\n })\n}",
"title": ""
},
{
"docid": "912e6379370e90c7184201c9a39e0001",
"score": "0.55637544",
"text": "get vanityTopOptionsDropdown() { return $('#gpchild-1 > div.product-details > ul > li:nth-child(1) > div'); }",
"title": ""
},
{
"docid": "d7d63695faf3495efbf8a339af3fefca",
"score": "0.5559399",
"text": "afterDropdownShow (e) {\n if (this.props.size != undefined) {\n //limit dropdown menu size\n var size = parseInt(this.props.size || 0);\n var menu = $(this.refs.dropdown).children('.dropdown-menu');\n var options = $(menu).find('.mar-selectpicker-option')\n //if length exceed size\n if (options.length > size) {\n //get precise height of option\n var optionHeight = options[0].getBoundingClientRect().height;\n //calculate menu height\n var menuHeight = optionHeight * size + parseFloat(menu.css('padding-top'));\n // //check if include search box\n if (this.props.filter) {\n //include height of search input\n menuHeight += menu.children('.form-control').outerHeight(true);\n }\n //set menu height\n menu.css({ height: menuHeight + 'px' })\n if (this.state.value != null && (!Array.isArray(this.state.value) || this.state.value.length)) {\n //scroll to selected value\n var selected = menu.find(`[data-value=\"${Array.isArray(this.state.value) ? this.state.value[0] : this.state.value}\"]`);\n //if selected exists\n if (menu && selected.length) {\n var optionWrapper = this.props.filter ? menu.children('.search-results')[0] : menu[0]\n optionWrapper.scrollTop = optionWrapper.scrollTop + selected.position().top - ( Math.floor(size/2) * optionHeight )\n }\n }\n }\n }\n }",
"title": ""
},
{
"docid": "15416575d4477fed8c077afdddf91d3a",
"score": "0.5555228",
"text": "function tabControl() {\n var tabs = $('.tabbed-content').find('.tabs');\n if (tabs.is(':visible')) {\n tabs.find('a').on('click', function(event) {\n event.preventDefault();\n var target = $(this).attr('href'),\n tabs = $(this).parents('.tabs'),\n buttons = tabs.find('a'),\n item = tabs.parents('.tabbed-content').find('.item');\n buttons.removeClass('active');\n item.removeClass('active');\n $(this).addClass('active');\n $(target).addClass('active');\n });\n } else {\n $('.item').on('click', function() {\n var container = $(this).parents('.tabbed-content'),\n currId = $(this).attr('id'),\n items = container.find('.item');\n container.find('.tabs a').removeClass('active');\n items.removeClass('active');\n $(this).addClass('active');\n container.find('.tabs a[href$=\"#' + currId + '\"]').addClass('active');\n });\n }\n }",
"title": ""
},
{
"docid": "16c10f1382431d1b264b51c9e178fda6",
"score": "0.55508435",
"text": "function toggleChoiceTab(el)\n {\n var choiceTab = $(\".SidebarTabsControl li\")[1];\n // Show choice tab when type is dropdown or select\n if($(el).val() == 3 || $(el).val() == 4 || $(el).val() == 5 || $(el).val() == 6)\n {\n $(choiceTab).show();\n\n $(\".field_use_in_filter\").show();\n $(\".field_select_many\").show();\n }else{\n $(choiceTab).hide();\n $(\".field_use_in_filter\").hide();\n $(\".field_select_many\").hide();\n }\n }",
"title": ""
},
{
"docid": "41157b50e479941afa4de23b394e2c79",
"score": "0.55319095",
"text": "function tabMenuOpCl(){\r\n\t\tvar side = d3.select(\"#side_menu\"),\r\n\t\t\tsize = side.style(\"width\") != \"0px\" ? \"0px\" : \"15.6%\";\r\n\t\tside.style(\"min-width\", size);\r\n\t\td3.select(\"#sliding_frame\").style(\"margin-left\", size);\r\n\t\tside.style(\"width\", size);\r\n\t\tvar sz = d3.select(\"body\").node().getBoundingClientRect().width;\r\n\t\tif(size != \"0px\") sz-=(sz*15.6)/100;\r\n\t\tsvg.attr(\"width\", sz);\r\n\t\tupdateScale();\r\n\t}",
"title": ""
},
{
"docid": "337f0ccda7bcbad26193dd6300a4ed39",
"score": "0.55298597",
"text": "function selecAbaUp() {\n\t\t\t\t\n\t\t\t\t$('#ups-tab')\n\t\t\t\t\t.click(function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('#ups')\n\t\t\t\t\t\t\t\t.trigger('resize')\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}, 300);\n\t\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}",
"title": ""
},
{
"docid": "9bf51dcff5c8c9e9c72d8031a0b7e28d",
"score": "0.55293953",
"text": "function initCustomDropdown() {\n if ($(\".custom_dropdown_placeholder\").length && $(\".custom_list\").length) {\n var placeholder = $(\".custom_dropdown_placeholder\");\n var list = $(\".custom_list\");\n }\n\n placeholder.on(\"click\", function(ev) {\n if (list.hasClass(\"active\")) {\n list.removeClass(\"active\");\n } else {\n list.addClass(\"active\");\n }\n\n $(document).one(\"click\", function closeForm(e) {\n if ($(e.target).hasClass(\"clc\")) {\n $(document).one(\"click\", closeForm);\n } else {\n list.removeClass(\"active\");\n }\n });\n });\n\n $(\".custom_list a\").on(\"click\", function(ev) {\n ev.preventDefault();\n var index = $(this)\n .parent()\n .index();\n\n placeholder.text($(this).text()).css(\"opacity\", \"1\");\n\n if (list.hasClass(\"active\")) {\n list.removeClass(\"active\");\n } else {\n list.addClass(\"active\");\n }\n });\n\n // $(\"select\").on(\"change\", function(e) {\n // placeholder.text(this.value);\n\n // $(this).animate({ width: placeholder.width() + \"px\" });\n // });\n }",
"title": ""
},
{
"docid": "9beb0a1dd44fd8f95a1b4c36e8f25640",
"score": "0.5509408",
"text": "function tabLeft(tab) {\n document.getElementById('variableTab').style.display = 'none';\n document.getElementById('subsetTab').style.display = 'none';\n\n $(\"#leftpanelButtons\").children().addClass(\"btn btn-default\").removeClass(\"active\");\n\n switch (tab) {\n case \"variableTab\":\n document.getElementById('btnVariables').setAttribute(\"class\", \"active\");\n break;\n case \"subsetTab\":\n document.getElementById('btnSubset').setAttribute(\"class\", \"active\");\n }\n\n d3.select(\"#leftpanel\").attr(\"class\", \"sidepanel container clearfix\");\n document.getElementById(tab).style.display = 'block';\n}",
"title": ""
},
{
"docid": "f78aa060ce7e7015b845a855cd340952",
"score": "0.55091584",
"text": "function tabSwitcher() {\n\t// external js:\n\t// 1) TweetMax VERSION: 1.19.0 (widgets.js);\n\t// 2) resizeByWidth (resize only width);\n\n\t/*\n\t <!--html-->\n\t <div class=\"some-class js-tabs\" data-collapsed=\"true\">\n\t <!--if has data-collapsed=\"true\" one click open tab content, two click close collapse tab content-->\n\t <div class=\"some-class__nav\">\n\t <div class=\"some-class__tab\">\n\t <a href=\"#\" class=\"js-tab-anchor\" data-for=\"some-id-01\">Text tab 01</a>\n\t </div>\n\t <div class=\"some-class__tab\">\n\t <a href=\"#\" class=\"js-tab-anchor\" data-for=\"some-id-02\">Text tab 02</a>\n\t </div>\n\t </div>\n\n\t <div class=\"some-class__panels js-tab-container\">\n\t <div class=\"some-class__panel js-tab-content\" data-id=\"some-id-01\">Text content 01</div>\n\t <div class=\"some-class__panel js-tab-content\" data-id=\"some-id-02\">Text content 02</div>\n\t </div>\n\t </div>\n\t <!--html end-->\n\t */\n\n\tvar $main = $('.foreign-js');\n\n\tvar $container = $('.foreign__panels-js');\n\n\tif (!$container.length) return false;\n\n\tif ($main.length) {\n\t\tvar $anchor = $('.foreign__anchor-js'),\n\t\t\t$content = $('.foreign__panel-js'),\n\t\t\tactiveClass = 'active',\n\t\t\tanimationSpeed = 0.2,\n\t\t\tanimationHeightSpeed = 0;\n\n\t\t$.each($main, function () {\n\t\t\tvar $this = $(this),\n\t\t\t\t$thisAnchor = $this.find($anchor),\n\t\t\t\t$thisContainer = $this.find($container),\n\t\t\t\t$thisContent = $this.find($content),\n\t\t\t\tinitialDataAtr = $this.find('.active').data('for'),\n\t\t\t\tactiveDataAtr = false;\n\n\t\t\t// prepare traffic content\n\t\t\tfunction prepareTrafficContent() {\n\t\t\t\t$thisContainer.css({\n\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t'overflow': 'hidden'\n\t\t\t\t});\n\n\t\t\t\t$thisContent.css({\n\t\t\t\t\t'display': 'block',\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'left': 0,\n\t\t\t\t\t'right': 0,\n\t\t\t\t\t'top': 0,\n\t\t\t\t\t'width': '100%',\n\t\t\t\t\t'z-index': -1\n\t\t\t\t});\n\n\t\t\t\tswitchContent();\n\t\t\t}\n\n\t\t\tprepareTrafficContent();\n\n\t\t\t// toggle content\n\t\t\t$thisAnchor.on('click', function (e) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar $cur = $(this),\n\t\t\t\t\tdataFor = $cur.data('for');\n\n\t\t\t\tif ($this.data('collapsed') === true && activeDataAtr === dataFor) {\n\n\t\t\t\t\ttoggleActiveClass();\n\t\t\t\t\ttoggleContent(false);\n\t\t\t\t\tchangeHeightContainer(false);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (activeDataAtr === dataFor) return false;\n\n\t\t\t\tinitialDataAtr = dataFor;\n\n\t\t\t\tswitchContent();\n\t\t\t});\n\n\t\t\t// switch content\n\t\t\tfunction switchContent() {\n\t\t\t\tif (initialDataAtr) {\n\t\t\t\t\ttoggleContent();\n\t\t\t\t\tchangeHeightContainer();\n\t\t\t\t\ttoggleActiveClass();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// show active content and hide other\n\t\t\tfunction toggleContent() {\n\n\t\t\t\t$.each($thisContainer, function () {\n\t\t\t\t\tvar $currentContainer = $(this);\n\t\t\t\t\t$currentContainer.css('height', $currentContainer.outerHeight());\n\n\t\t\t\t\tvar $currentContent = $currentContainer.find($thisContent);\n\n\t\t\t\t\t$currentContent.css({\n\t\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t\t'left': 0,\n\t\t\t\t\t\t'right': 0,\n\t\t\t\t\t\t'top': 0\n\t\t\t\t\t});\n\n\t\t\t\t\tTweenMax.set($currentContent, {\n\t\t\t\t\t\tautoAlpha: 0,\n\t\t\t\t\t\t'z-index': -1\n\t\t\t\t\t});\n\n\t\t\t\t\tif (arguments[0] === false) return;\n\n\t\t\t\t\tvar $initialContent = $currentContent.filter('[data-id=\"' + initialDataAtr + '\"]');\n\n\t\t\t\t\t$initialContent.css('z-index', 2);\n\n\t\t\t\t\tTweenMax.to($initialContent, animationSpeed, {\n\t\t\t\t\t\tautoAlpha: 1\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// change container's height\n\t\t\tfunction changeHeightContainer() {\n\t\t\t\tvar $initialContent = $thisContent.filter('[data-id=\"' + initialDataAtr + '\"]');\n\n\t\t\t\t$.each($initialContent, function () {\n\t\t\t\t\tvar $currentContent = $(this);\n\t\t\t\t\tvar $currentContainer = $currentContent.closest($thisContainer);\n\n\t\t\t\t\tif (arguments[0] === false) {\n\t\t\t\t\t\tTweenMax.to($currentContainer, animationHeightSpeed, {\n\t\t\t\t\t\t\t'height': 0\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tTweenMax.to($currentContainer, animationHeightSpeed, {\n\t\t\t\t\t\t'height': $currentContent.outerHeight(),\n\t\t\t\t\t\tonComplete: function () {\n\n\t\t\t\t\t\t\t$currentContainer.css('height', 'auto');\n\n\t\t\t\t\t\t\t$currentContent.css({\n\t\t\t\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t\t\t\t'left': 'auto',\n\t\t\t\t\t\t\t\t'right': 'auto',\n\t\t\t\t\t\t\t\t'top': 'auto'\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\t\t\t}\n\n\t\t\t// toggle class active\n\t\t\tfunction toggleActiveClass() {\n\t\t\t\t$thisAnchor.removeClass(activeClass);\n\t\t\t\t$thisContent.removeClass(activeClass);\n\n\t\t\t\t// toggleStateThumb();\n\n\t\t\t\tif (initialDataAtr !== activeDataAtr) {\n\n\t\t\t\t\tactiveDataAtr = initialDataAtr;\n\n\t\t\t\t\t$thisAnchor.filter('[data-for=\"' + initialDataAtr + '\"]').addClass(activeClass);\n\t\t\t\t\t$thisContent.filter('[data-id=\"' + initialDataAtr + '\"]').addClass(activeClass);\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tactiveDataAtr = false;\n\t\t\t}\n\t\t});\n\t}\n}",
"title": ""
},
{
"docid": "38c3972780a092f1a1ddc865961fdab2",
"score": "0.550652",
"text": "handleDropdownHide(elem) {\n const listItem = elem.nextSibling;\n const caret = elem.querySelector(SELECTORS.DROPDOWN_CARET);\n\n listItem.style.height = listItem.scrollHeight + 'px';\n\n window.setTimeout(() => {\n listItem.style.height = '0';\n caret.classList.remove(CLASSES.ROTATE);\n }, 1);\n\n window.setTimeout(() => {\n listItem.classList.remove(CLASSES.SHOW);\n }, 350);\n }",
"title": ""
},
{
"docid": "b9bdc2b4f828f04b0186a75b727bf9e4",
"score": "0.5503833",
"text": "mobileTabs(isFetching, grouped, filter) {\n if (isFetching) {\n return <div></div>\n }\n \n let currentTab = this.determineCurrentTab(tabList, filter)\n\n let count = currentTab.filter in grouped ? grouped[currentTab.filter].doclist.numFound : 0\n let label = currentTab.label\n \n let rows = []\n \n _.forEach(tabList, function(value) {\n if (value.id != filter) {\n\n let count = value.filter in grouped ? grouped[value.filter].doclist.numFound : 0\n let label = value.label\n\n let row = (\n <SearchTab key={value.id} filter={value.id} active={filter == value.id} label={label} count={count} mobile={true} />\n )\n rows.push(row)\n } \n })\n\n return (\n\n <div className=\"btn-group\">\n <button type=\"button\" className=\"btn btn-primary dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n {label} ({count}) <span className=\"caret\"></span>\n </button>\n <ul className=\"dropdown-menu\">\n {rows} \n </ul>\n </div>\n\n )\n\n }",
"title": ""
},
{
"docid": "013266e5acd50bd6bac7ae9008b31919",
"score": "0.54921526",
"text": "function showDropDown(scope,element,opts){if(opts.parent!==element.parent()){element.parent().attr('aria-owns',element.attr('id'));}element.parent().find('md-select-value').attr('aria-hidden','true');opts.parent.append(element);return $q(function(resolve,reject){try{$animateCss(element,{removeClass:'md-leave',duration:0}).start().then(positionAndFocusMenu).then(resolve);}catch(e){reject(e);}});}",
"title": ""
},
{
"docid": "3ecc7a1a21af25f3e74d585e33c6302c",
"score": "0.54825944",
"text": "function placeDropdown(eventType) {\n // Check for simultaneous focus and click events.\n if (eventType === 'focus') {\n isFocused = true;\n }\n\n // Check html data attributes\n updateOptions();\n\n // Set Dropdown state\n activates.addClass('active');\n origin.addClass('active');\n\n // Constrain width\n if (options.constrain_width === true) {\n activates.css('width', origin.outerWidth());\n\n } else {\n activates.css('white-space', 'nowrap');\n }\n\n // Offscreen detection\n var windowHeight = window.innerHeight;\n var originHeight = origin.innerHeight();\n var offsetLeft = origin.offset().left;\n var offsetTop = origin.offset().top - $(window).scrollTop();\n var currAlignment = options.alignment;\n var activatesLeft, gutterSpacing;\n\n // Below Origin\n var verticalOffset = 0;\n if (options.belowOrigin === true) {\n verticalOffset = originHeight;\n }\n\n if (offsetLeft + activates.innerWidth() > $(window).width()) {\n // Dropdown goes past screen on right, force right alignment\n currAlignment = 'right';\n\n } else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {\n // Dropdown goes past screen on left, force left alignment\n currAlignment = 'left';\n }\n // Vertical bottom offscreen detection\n if (offsetTop + activates.innerHeight() > windowHeight) {\n // If going upwards still goes offscreen, just crop height of dropdown.\n if (offsetTop + originHeight - activates.innerHeight() < 0) {\n var adjustedHeight = windowHeight - offsetTop - verticalOffset;\n activates.css('max-height', adjustedHeight);\n } else {\n // Flow upwards.\n if (!verticalOffset) {\n verticalOffset += originHeight;\n }\n verticalOffset -= activates.innerHeight();\n }\n }\n\n // Handle edge alignment\n if (currAlignment === 'left') {\n gutterSpacing = options.gutter;\n leftPosition = origin.position().left + gutterSpacing;\n }\n else if (currAlignment === 'right') {\n var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();\n gutterSpacing = -options.gutter;\n leftPosition = offsetRight + gutterSpacing;\n }\n\n // Position dropdown\n activates.css({\n position: 'absolute',\n top: origin.position().top + verticalOffset,\n left: leftPosition\n });\n\n\n // Show dropdown\n activates.stop(true, true).css('opacity', 0)\n .slideDown({\n queue: false,\n duration: options.inDuration,\n easing: 'easeOutCubic',\n complete: function() {\n $(this).css('height', '');\n }\n })\n .animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});\n }",
"title": ""
},
{
"docid": "946650c5ea37afcf021685c9c388f0ac",
"score": "0.5479639",
"text": "function cws_vc_tabs_fix(){\n\tjQuery(document).off(\"click.vc.accordion.data-api\");\n\tjQuery(document).off(\"show.vc.accordion hide.vc.accordion\");\n\tjQuery(\"[data-vc-accordion]\").off(\"show.vc.accordion\");\n\tjQuery(\"[data-vc-accordion]\").off();\n\n\tif(jQuery(window).width() < 768){\n\t\tjQuery('.vc_tta-panels').find('.vc_tta-panel').removeClass('vc_active');\n\t}\n\n\tjQuery('.vc_tta-container .vc_tta-tabs .vc_tta-tabs-list a, .vc_tta-container .vc_tta-tabs .vc_tta-panel-heading a').on('click', function(e){\n\t\te.preventDefault();\n\n\t\tif(jQuery(window).width() > 767){\n\t\t\tvar tab = jQuery(this).attr('href');\n\t\t\ttab = tab.replace('#','');\n\t\t\tvar row = jQuery(this).closest('.vc_tta-tabs').find('.vc_tta-panels-container .vc_tta-panel[id=\"'+tab+'\"]');\n\t\t\t\n\t\t\tjQuery(this).closest('.vc_tta-tabs-list').find('.vc_tta-tab').removeClass('vc_active');\n\t\t\tjQuery(this).parent().addClass('vc_active');\n\n\t\t\tjQuery(this).closest('.vc_tta-tabs').find('.vc_tta-panels-container .vc_tta-panel').removeClass('vc_active');\n\t\t\trow.addClass('vc_active');\n\t\t} else {\n\t\t\tvar link = jQuery(this).closest('.vc_tta-panel');\n\t\t\tvar row = jQuery(this).closest('.vc_tta-panel').find('.vc_tta-panel-body');\n\t\t\t\n\t\t\tlink.toggleClass('tab_active');\n\t\t\tjQuery(this).closest('.vc_tta-panels').find('.vc_tta-panel').not(link).removeClass('tab_active');\n\n\t\t\trow.slideToggle(400);\n\t\t\tjQuery(this).closest('.vc_tta-panels').find('.vc_tta-panel-body').not(row).slideUp(400);\n\t\t}\n\t});\n\n\tif( jQuery(window).width() < 768 ){\n\t\tjQuery('.vc_general.vc_tta-tabs .vc_tta-panels .vc_tta-panel:first-child .vc_tta-panel-heading a').on( \"click\",);\n\t}\n}",
"title": ""
},
{
"docid": "8c5175dd8b2f82814a6e22b009bb444b",
"score": "0.54539156",
"text": "function mtsnbShowHodeChildOptions( el ) {\r\n\t var $this = $(el),\r\n\t\t\t\ttempValue = $this.val(),\r\n\t\t\t\ttargetSelector = '[data-parent-select-id=\"'+$this.attr('id')+'\"]',\r\n\t\t\t\tactiveSelector = '[data-parent-select-value*=\"'+tempValue+'\"]';\r\n\r\n\t\t\t$( targetSelector ).removeClass('active');\r\n\r\n\t if ( tempValue && activeSelector ) {\r\n\r\n\t $( targetSelector+activeSelector ).addClass('active');\r\n\t }\r\n\t }",
"title": ""
},
{
"docid": "b97482586dc8d543819c0982dcc7c7da",
"score": "0.54534835",
"text": "function setupDropdowns() {\n\n $('.dropdown-button').dropdown({\n inDuration: 300,\n outDuration: 225,\n constrain_width: false, // Does not change width of dropdown to that of the activator\n hover: true, // Activate on hover\n gutter: 0, // Spacing from edge\n belowOrigin: false, // Displays dropdown below the button\n alignment: 'left' // Displays dropdown with edge aligned to the left of button\n });\n\n}",
"title": ""
},
{
"docid": "d44787fd45385d5ef0a8e02e7656b21b",
"score": "0.5448733",
"text": "function tabFix(){\n\t\tvar $tab=$('.section-container');\n\n\t\tif($tab.parent().hasClass('widget')) {\n\t\t\tif($tab.parent().width() <= 300){\n\t\t\t\t$tab.attr('data-section','accordion').addClass('accordion').removeClass('tabs','auto');\n\t\t\t\t$('section',$tab).css('padding-top',0);\n\t\t\t\t$('section .title',$tab).outerWidth($tab.innerWidth());\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('section',$tab).css('padding-top',57);\n\t\t\t\t$('section .title',$tab).outerWidth(($tab.outerWidth()/$('section',$tab).length)+$tab.length);\n\t\t\t\t$tab.attr('data-section','tabs').addClass('tabs').removeClass('accordion');\n\t\t\t}\n\t\t} else {\n\t\t\tif($tab.parent().width() <= 300){\n\t\t\t\t$tab.attr('data-section','accordion').addClass('accordion').removeClass('tabs','auto');\n\t\t\t\t$('section',$tab).css('padding-top',0);\n\t\t\t\t$('section .title',$tab).outerWidth($tab.innerWidth());\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$tab.attr('data-section','tabs').addClass('tabs').removeClass('accordion');\n\t\t\t\t$('section',$tab).css('padding-top',53);\n\t\t\t\t$('section .title',$tab).outerWidth('auto');\n\t\t\t}\n\t\t}\n\t}",
"title": ""
},
{
"docid": "a770514ec0394002007295de072818a6",
"score": "0.5444102",
"text": "function comutaAbaFacelets(posicaoAba) {\r\n\t plc.jq('#plc-form-tab').tabs('select', posicaoAba);\r\n }",
"title": ""
},
{
"docid": "0f959ca9f20d329108cef9e425952a10",
"score": "0.5437699",
"text": "function expandTabs(selected){\n\t\tvar content = document.getElementById(\"tab-content\");\n\t\tcontent.style.display = \"inline\";\n\t\t/*$('#tab-content').show();\n\t\t//TODO: set width and animation duration\n\t\t$('#tab-content').animate({width: \"500px\"}, 1000, function(){\n\t\t\t$(this).show();\n\t\t});*/\n\t}",
"title": ""
},
{
"docid": "cb0655d6bb32c00aa7dea4ffead76cb6",
"score": "0.5422125",
"text": "function mtsnbShowHodeChildOptions( el ) {\n\t var $this = $(el),\n\t\t\t\ttempValue = $this.val(),\n\t\t\t\ttargetSelector = '[data-parent-select-id=\"'+$this.attr('id')+'\"]',\n\t\t\t\tactiveSelector = '[data-parent-select-value*=\"'+tempValue+'\"]';\n\n\t\t\t$( targetSelector ).removeClass('active');\n\n\t if ( tempValue && activeSelector ) {\n\n\t $( targetSelector+activeSelector ).addClass('active');\n\t }\n\t }",
"title": ""
},
{
"docid": "589556bd660be3d00903bc8bd5680349",
"score": "0.54181486",
"text": "function addDropdown(templates) {\n var splitButton = getSplitButton(templates[0]);\n var actionList = [];\n\n for (var iCnt = 1; iCnt < templates.length; iCnt++) {\n actionList.push(getMenuButton(templates[iCnt]));\n }\n\n var actionListElem = renderList(actionList, splitButton, scope);\n element.append($compile(actionListElem)(scope));\n }",
"title": ""
},
{
"docid": "55189d242bd210ce410012bb35b8a6ec",
"score": "0.5414191",
"text": "function ShowHideTabs(tabName) {\n if (tabName == \"mylib\") {\n $('.historyli').addClass(\"active2\");\n }\n else { $('.historyli').removeClass(\"active2\"); }\n \n if (tabName == \"mycommunication\") {\n $('.messagedocli').addClass(\"active2\");\n } else { $('.messagedocli').removeClass(\"active2\"); }\n if (tabName == \"invite\") {\n \n $('#myAdmin').click();\n $('.inviteli').addClass(\"active2\");\n } else { $('.inviteli').removeClass(\"active2\"); }\n \n if (tabName == \"inbox\") {\n $('.incommli').addClass(\"active2\");\n $('#myAdmin').click();\n } else { $('.incommli').removeClass(\"active2\"); }\n \n $('.reportingli').removeClass(\"active2\");\n $('.accountprofile').removeClass(\"active2\");\n\n if (tabName == \"communication\") {\n $('.commli').addClass(\"active2\");\n $('#myAdmin').click();\n } else { $('.commli').removeClass(\"active2\"); }\n if (tabName == \"administration\") {\n $('.administrationli').addClass(\"active2\");\n $('#myAdmin').click();\n } else { $('.administrationli').removeClass(\"active2\"); }\n if (tabName == \"globallib\") {\n $('.globallibraryli').addClass(\"active2\");\n $('#myAdmin').click();\n } else { $('.globallibraryli').removeClass(\"active2\"); }\n\n if (tabName == \"mypartner\") {\n $('.partnersli').addClass(\"active2\");\n } else { $('.partnersli').removeClass(\"active2\"); }\n \n if (tabName == \"mycalender\") {\n $('.mydashboardli').addClass(\"active2\");\n } else { $('.mydashboardli').removeClass(\"active2\"); }\n if (tabName == \"contract\") {\n $('.contractli').addClass(\"active2\");\n $('#myAdmin').click();\n } else { $('.contractli').removeClass(\"active2\"); }\n if (tabName == \"mycontract\") { \n $('.mycontractli').addClass(\"active2\");\n } else { $('.mycontractli').removeClass(\"active2\"); }\n if (tabName == \"icclient\") {\n $('.clientlistli').addClass(\"active2\");\n } else { $('.clientlistli').removeClass(\"active2\"); }\n if (tabName == \"icinvite\") {\n $('.inviteli').addClass(\"active2\");\n } else { $('.inviteli').removeClass(\"active2\"); }\n if (tabName == \"addinvite\") {\n $('.liaddinvite').addClass(\"active2\");\n } else { $('.liaddinvite').removeClass(\"active2\"); }\n if (tabName == \"MyIC\") {\n $('.limyic').addClass(\"active2\");\n } else { $('.limyic').removeClass(\"active2\"); }\n if (tabName == \"liguestapproval\") {\n $('.liguestapproval').addClass(\"active2\");\n } else { $('.liguestapproval').removeClass(\"active2\"); }\n \n}",
"title": ""
},
{
"docid": "f2bda9fa94cffe3b4b3563181b9445e8",
"score": "0.54138076",
"text": "function dropdown(e){\n e.stopPropagation();\n }",
"title": ""
},
{
"docid": "535f3defda9b31e8394d65faa4da1174",
"score": "0.5412318",
"text": "createDropDown() {\r\n this.dropDown = document.createElement('ul');\r\n this.dropDown.className = 'drop-down';\r\n this.selectize.appendChild(this.dropDown);\r\n this.constraintDropDownToParent();\r\n }",
"title": ""
},
{
"docid": "c46aeefed033bc2236aa8aeeebb3deef",
"score": "0.5407107",
"text": "function moveDropdown () {\n if (!elements.$.root.length) return;\n $mdTheming(elements.$.scrollContainer);\n elements.$.scrollContainer.detach();\n elements.$.root.append(elements.$.scrollContainer);\n if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n }",
"title": ""
},
{
"docid": "c46aeefed033bc2236aa8aeeebb3deef",
"score": "0.5407107",
"text": "function moveDropdown () {\n if (!elements.$.root.length) return;\n $mdTheming(elements.$.scrollContainer);\n elements.$.scrollContainer.detach();\n elements.$.root.append(elements.$.scrollContainer);\n if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n }",
"title": ""
},
{
"docid": "f24c294843bb5c6a0b66fcb4b32e8650",
"score": "0.540022",
"text": "tabs(options) {\n\t\tlet op = $.extend(\n\t\t\t{\n\t\t\t\tcurrentIndex: 0,\n\t\t\t\ttab$: ':scope > .tab-bar > .tab-item',\n\t\t\t\tpanel$: ':scope > .tab-panel > .panel-item',\n\t\t\t\tajaxClass: 'j-ajax'\n\t\t\t},\n\t\t\toptions\n\t\t);\n\n\t\treturn this.each(function () {\n\t\t\tlet $box = $(this),\n\t\t\t\t$tabs = $box.find(op.tab$),\n\t\t\t\t$panels = $box.find(op.panel$);\n\n\t\t\t$tabs.each(function (iTabIndex) {\n\t\t\t\tlet $tab = $(this);\n\t\t\t\tif (op.currentIndex == iTabIndex) $tab.addClass('active');\n\t\t\t\telse $tab.removeClass('active');\n\n\t\t\t\t$tab.each(function () {\n\t\t\t\t\t$tab.click(function (event) {\n\t\t\t\t\t\tswitchTab($tabs, $panels, iTabIndex);\n\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tswitchTab($tabs, $panels, op.currentIndex);\n\t\t});\n\n\t\tfunction switchTab($tabs, $panels, iTabIndex) {\n\t\t\tlet $tab = $tabs.eq(iTabIndex);\n\t\t\top.currentIndex = iTabIndex;\n\n\t\t\t$tabs.removeClass('active');\n\t\t\t$tab.addClass('active');\n\n\t\t\tlet $panel = $panels.removeClass('active').eq(op.currentIndex).addClass('active');\n\n\t\t\tif ($tab.hasClass(op.ajaxClass)) {\n\t\t\t\tlet url = $tab.attr('data-href');\n\t\t\t\tif (url && !$panel.attr('loaded')) {\n\t\t\t\t\tlet _data = url.getParams();\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\turl: url,\n\t\t\t\t\t\tdata: _data,\n\t\t\t\t\t\tsuccess: (html) => {\n\t\t\t\t\t\t\t$panel.triggerPageClear();\n\n\t\t\t\t\t\t\tconst callback = dwz.getUrlCallback(url);\n\t\t\t\t\t\t\tconst tpl = $.templateWrap(html);\n\t\t\t\t\t\t\tif (callback) {\n\t\t\t\t\t\t\t\tcallback.call($panel, tpl, _data);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$panel.html(html).initUI();\n\t\t\t\t\t\t\t\t$.execHelperFn($panel, tpl, _data);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$panel.attr('loaded', true);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"title": ""
},
{
"docid": "62317fb63627769571584d0f8a5835a7",
"score": "0.5398849",
"text": "function dropdown() {\n let dropdown=document.getElementById(\"dropdown-content-2\");\n dropdown.style.display=\"block\";\n}",
"title": ""
},
{
"docid": "ae6befd1ecff6ecaaaa84786b7dca814",
"score": "0.53931504",
"text": "function showSubTab(tab) {\n tab.css('display', 'inline-block');\n }",
"title": ""
},
{
"docid": "8e9b4e0e2b6ba539ceb90bcbd3e7a074",
"score": "0.5390334",
"text": "function technologyTabFixing() {\n let thisOffsetTop = $(this).scrollTop(),\n $tabsListWrapper = $('.js_tabs_list_wrapper'),\n $tabsList = $('.js_tabs_list'),\n tabsListWrapperTop = $tabsListWrapper.offset().top,\n tabsListWrapperHeight = $tabsListWrapper.outerHeight(),\n tabsListHeight = $tabsList.outerHeight(),\n bottomPoint = tabsListWrapperTop + tabsListWrapperHeight - tabsListHeight;\n\n if (thisOffsetTop > tabsListWrapperTop - 80) {\n $tabsList.attr('data-position', 'center')\n } else {\n $tabsList.attr('data-position', 'top')\n }\n\n if (thisOffsetTop > bottomPoint - 80) {\n $tabsList.attr('data-position', 'bottom')\n }\n}",
"title": ""
},
{
"docid": "e719aefb66d4ba2570904025956c322e",
"score": "0.5361808",
"text": "function createDropDown(parent, cellcolwhole, cellrowwhole) {\n\tif (parent == undefined || parent == null) return;\n\tlet lockButton = document.getElementById(\"finalisecells\");\n\tif (lockButton != undefined && lockButton != null && lockButton.disabled == true) return;\n\tlet ddcontent = document.createElement(\"div\");\n\tddcontent.className = \"dropdown-content\";\n\tddcontent.id = \"dropdownList\";\n\tfor (let k = 1; k <= 9; k++) {\n\t\tlet val = document.createElement(\"a\");\n\t\tval.innerHTML = k;\n\t\tval.addEventListener(\"click\", (e) => {\n\t\t\tsudokoState[cellcolwhole - 1][cellrowwhole - 1].value = k;\n\t\t\tdrawGridFromState();\n\t\t\tdocument.remove(ddcontent);\n\t\t});\n\t\tddcontent.appendChild(val);\n\t}\n\tlet clearval = document.createElement(\"a\");\n\tclearval.innerHTML = \"clear\";\n\tclearval.addEventListener(\"click\", (e) => {\n\t\tsudokoState[cellcolwhole - 1][cellrowwhole - 1].value = null;\n\t\tdrawGridFromState();\n\t\tdocument.remove(ddcontent);\n\t});\n\tddcontent.appendChild(clearval);\n\tddcontent.addEventListener(\"mouseout\", (e) => {\n\t\tconsole.log(\"Leave\");\n\t\t//document.getElementById(\"dropdownList\").remove();\n\t\t// document.remove(document.getElementById(\"dropdownList\"));\n\t});\n\tparent.appendChild(ddcontent);\n}",
"title": ""
},
{
"docid": "4299a6f05b91e5cf1eca0b07ff8d9926",
"score": "0.5361161",
"text": "function handlePageLoadTabFocus() {\n\t\t\t\t\t\t\t$('.tab-overflow').each(function () {\n\t\t\t\t\t\t\t\tvar targetWidth = $(this).width();\n\t\t\t\t\t\t\t\tvar targetInnerWidth = 0;\n\t\t\t\t\t\t\t\tvar targetTab = $(this);\n\t\t\t\t\t\t\t\tvar scrollWidth = targetWidth;\n\n\t\t\t\t\t\t\t\t$(targetTab).find('li').each(function () {\n\t\t\t\t\t\t\t\t\tvar targetLi = $(this);\n\t\t\t\t\t\t\t\t\ttargetInnerWidth += $(targetLi).width();\n\n\t\t\t\t\t\t\t\t\tif ($(targetLi).hasClass('active') && targetInnerWidth > targetWidth) {\n\t\t\t\t\t\t\t\t\t\tscrollWidth -= targetInnerWidth;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\thandleTabOverflowScrollWidth(this, 0);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}",
"title": ""
},
{
"docid": "65b0e8b718e0c4c007b8d5dca584611b",
"score": "0.5354407",
"text": "function collapseMenuOptions(menuTabAction){\r\n\tif (typeof menuTabAction == 'undefined' || menuTabAction == '') {\r\n\t\tmenuTabAction = 'open';\r\n\t}\r\n\tvar layoutWidth;\r\n\tvar collapsedWidth = 0;\n\n\t//removed padding from both left and right side\r\n\tvar layoutWidth1 = parseInt(jQuery(\".ui-layout-center-custom\").css('width')) - 200;\r\n\tvar currentIndex = parseFloat(jQuery('#tabs ul.nav-heading li.ui-state-active').index());\r\n\r\n\tvar currentAddedTabWidth = parseFloat(jQuery('#tabs ul.nav-heading li:last').outerWidth());\r\n\tvar currentAddedAnchorTabWidth = parseFloat(jQuery('#tabs ul.nav-heading li:last').children(\"a\").outerWidth());\r\n\r\n\t//the width is added only if the event is not closed.\r\n\tif (menuTabAction != 'close' && menuCloseEventTrigerred == false) {\r\n\t\tlistItemsWidth += currentAddedAnchorTabWidth;\r\n\t}\r\n\r\n\tvar currentOpenedAnchorTab = jQuery('#tabs ul.nav-heading li:last a').html() + \"_Nav\";\r\n\tarrNavigation[currentOpenedAnchorTab] = currentAddedAnchorTabWidth;\r\n\tcurrentAddedTabWidth -= 15;\r\n\tlayoutWidth -= currentAddedTabWidth;\r\n\r\n\tif (listItemsWidth > layoutWidth1) {\r\n\t\t//get dynamic width to apply on each li for shrink\r\n\t\tvar totalLi = parseInt(jQuery('#tabs ul.nav-heading li').length);\r\n\t\tcollapsedWidth = parseInt(layoutWidth1 / totalLi);\r\n\t\tcollapsedWidth = collapsedWidth - 45;\r\n\t\tif (collapsedWidth > 0) {\r\n\t\t\t//append dynamic width\r\n\t\t\tjQuery('#tabs ul.nav-heading li a').each(function(){\r\n\t\t\t\tjQuery(this).width(collapsedWidth);\r\n\t\t\t\tjQuery(this).addClass('collapsed-tab');\r\n\t\t\t});\r\n\t\t}\r\n\t\telse {\r\n\t\t\tjQuery('#tabs ul.nav-heading li a').each(function(){\r\n\t\t\t\tjQuery(this).width(1);\r\n\t\t\t\tjQuery(this).addClass('collapsed-tab');\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\t//reset the width to 0\r\n\t\tcollapsedWidth = 0;\r\n\t\tjQuery('#tabs ul.nav-heading li a').removeClass('collapsed-tab');\r\n\t\tjQuery(\"#tabs ul.nav-heading li a\").css(\"width\", \"auto\");\r\n\t}\r\n}",
"title": ""
},
{
"docid": "a75780e328e41efb897442bc9c8c3152",
"score": "0.53437555",
"text": "function jgtContentTabs(){\r\n\t\tvar tabsNav = $('#menu'),\r\n\t\t\ttabsWrap = $('#main');\r\n\r\n\t\ttabsWrap.find('.main-section:gt(0)').hide();\r\n\t\ttabsNav.find('li:first').addClass('active');\r\n\t\ttabsNav.find('a').click(function(e){\r\n\t\t\ttabsWrap.find('.main-section').hide();\r\n\t\t\ttabsWrap.find($($(this).attr('href'))).fadeIn(800);\r\n\t\t\ttabsNav.find('li').removeClass('active');\r\n\t\t\t$(this).parent().addClass('active');\r\n\t\t\te.preventDefault();\r\n\r\n if ( $('#map-canvas').length > 0 ) {\r\n mymap._onResize();\r\n }\r\n\r\n\t\t\t// Fix background\r\n\t\t\t$('.left-wrap .bg').backstretch('resize');\r\n\r\n\t\t});\r\n\t}",
"title": ""
},
{
"docid": "99aae244b5adb8d47488fd458b8d6d87",
"score": "0.5332575",
"text": "function seoNavBar()\n{\n $(\".seoNav > li > a\").click(function (e)\n { // binding onclick\n if ($(this).parent().hasClass('selected'))\n {\n $(\".seoNav .selected div div\").slideUp(100); // If clicked item is already open, close the dropdown\n $(\".seoNav .selected\").removeClass(\"selected\");\n } \n else\n {\n $(\".seoNav .selected div div\").slideUp(100); // Close all open dropdowns\n $(\".seoNav .selected\").removeClass(\"selected\");\n\n if ($(this).next(\".subs\").length)\n {\n $(this).parent().addClass(\"selected\"); // Open the clicked on dropdown\n\n // Set width of dropdown\n var parentWidth = $(this).parent().width();\n var childWidth = $(this).next(\".subs\").children().width();\n\n if (childWidth > parentWidth)\n {\n var maxWidth = childWidth;\n }\n else\n {\n var maxWidth = parentWidth;\n }\n // Show dropdown & adjust width\n $(this).next(\".subs\").children().slideDown(200).css(\"width\", maxWidth);\n $(\".seoNav .selected .subs div ul\").css(\"width\", maxWidth).css(\"left\", \"-10px\");\n }\n return false;\n }\n e.stopPropagation();\n });\n\n $(\"body\").click(function ()\n { // binding onclick to body to hide dropdown when user clicks away from dropdown\n $(\".seoNav .selected div div\").slideUp(100); // hiding popups\n $(\".seoNav .selected\").removeClass(\"selected\");\n });\n}",
"title": ""
},
{
"docid": "d71272356ff9a5d9a7606c2022f962d7",
"score": "0.5327601",
"text": "function updateTabs() {\n if (!thisElem || !thisElem.current) return;\n const minibarEl = thisElem.current.parentElement;\n const minibarWidth = minibarEl.clientWidth;\n const menuWidth = getItemWidth('...');\n const vistabs = visibleTabs.map(t => ({ ...t, display: false }));\n const len = vistabs.length;\n let changed = false; // tabs visibility changed ?\n // enough space for active tab ?\n const activeTabWidth = getItemWidth(tabs[activeTab].label.toUpperCase());\n if (activeTabWidth < minibarWidth - menuWidth) {\n let prefixWidths = activeTabWidth;\n for (let idx = 0; idx < len; idx++) {\n if (idx === activeTab) vistabs[idx].display = true;\n else {\n const w = getItemWidth(tabs[idx].label.toUpperCase());\n if (prefixWidths + w < minibarWidth - menuWidth) {\n prefixWidths += w;\n vistabs[idx].display = true;\n } else {\n vistabs[idx].display = false;\n }\n // criteria to update: tab display prop\n if (!changed)\n changed = vistabs[idx].display !== visibleTabs[idx].display;\n }\n }\n } else {\n changed = visibleTabs.filter(t => t.display).length > 0;\n }\n if (changed) {\n setVisibleTabs(vistabs);\n }\n }",
"title": ""
},
{
"docid": "fdfc9bbcf9ebb2e642b27e1fae0bbe3f",
"score": "0.53238803",
"text": "handleActiveTab(dropdown) {\n this.setState({\n activeTab: dropdown\n })\n }",
"title": ""
},
{
"docid": "ad1f2e3b9ace1508cec056db48acc385",
"score": "0.5323849",
"text": "function toggleShow() {\n const $thisDropdown = $(this).parents('.mpl-dropdown');\n const $thisDropdownMenu = $thisDropdown.children('.mpl-dropdown-menu');\n\n if (!$thisDropdown.hasClass('focus')) {\n $thisDropdown.addClass('focus');\n $thisDropdownMenu.addClass('focus');\n } else {\n $thisDropdown.removeClass('focus');\n $thisDropdownMenu.removeClass('focus');\n }\n }",
"title": ""
},
{
"docid": "c7bed99e53eee516ed776a841737ff13",
"score": "0.5313718",
"text": "function tabbedInit(){ \n\t\t$('.tabbed').each(function(){\n\t\t\tif($(this).find('.swiper-container').length == 0 && $(this).find('.testimonial_slider').length == 0 && $(this).find('.portfolio-items:not(\".carousel\")').length == 0 && $(this).find('.wpb_gallery .portfolio-items').length == 0 && $(this).find('iframe').length == 0){\n\t\t\t\t$(this).find('> ul li:first-child a').click();\n\t\t\t}\t\n\t\t\tif($(this).find('.testimonial_slider').length == 1 || $(this).find('.portfolio-items:not(\".carousel\")').length == 1 || $(this).find('.wpb_gallery .portfolio-items').length == 1 || $(this).find('iframe').length > 0 ){\n\t\t\t\tvar $that = $(this);\n\t\t\t\t\n\t\t\t\t$(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'});\n\t\t\t\t$(this).find('> ul li a').addClass('loading');\n\t\t\t\t\n\t\t\t\tsetTimeout(function(){ \n\t\t\t\t\t$that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'}); \n\t\t\t\t\t$that.find('> ul li a').removeClass('loading');\n\t\t\t\t\t$that.find('> ul li:first-child a').click(); \n\t\t\t\t},900);\n\t\t\t}\n\t\t});\n\t}",
"title": ""
},
{
"docid": "a21f4a13e214b81323100f4754004715",
"score": "0.5291516",
"text": "function togglePrimaryDropDown() {\n const applicationController = new ApplicationController();\n\n if( applicationController.pDD.innerHTML ) { // if the dropdown box already has contents \n applicationController.pDD.style.animationName = 'primary-dropdown-animate-out';\n applicationController.pDDButton.classList.remove('rotate');\n applicationController.pDD.innerHTML = ''; // empty the dropdown\n } else {\n applicationController.pDD.innerHTML = applicationController.pDDElements();\n applicationController.pDD.style.animationName = 'primary-dropdown-animate-in';\n applicationController.pDDButton.classList.add('rotate');\n }\n }",
"title": ""
},
{
"docid": "ced7a5a7093ab317d2bb8d1a4a8e110e",
"score": "0.52903616",
"text": "function group($element) {\n var list = $($element).wrap('<li class=\"hidden-xs hidden-sm\">');\n $element.parents('.ft-regroup').find('a[class*=\"ft-btn\"]').removeClass();\n $element.parents('.ft-regroup').html(frontutils.templates.dropdown(list));\n }",
"title": ""
},
{
"docid": "13662f276b46d289ff7c82de88da9942",
"score": "0.52793694",
"text": "function zobraz_tab(zalozka,tab){\r\n \r\nvar x = document.getElementsByClassName(\"tabs\");\r\nfor (var i = 0; i < x.length; i++) {\r\n if(zalozka != 'all'){\r\n x[i].classList.remove(\"w3-show\");\r\n x[i].classList.add(\"w3-hide\"); \r\n }else \r\n x[i].classList.remove(\"w3-hide\"); \r\n}\r\nif(zalozka != 'all')\r\n document.getElementById(zalozka).classList.remove(\"w3-hide\");\r\n \r\nvar zalozky = document.getElementsByClassName(\"w3-bar-item\"); \r\nfor (var i = 0; i < zalozky.length; i++) {\r\n if(i==tab)\r\n zalozky[i].classList.add(\"active\"); \r\n else\r\n zalozky[i].classList.remove(\"active\"); \r\n}\r\n \r\n}",
"title": ""
},
{
"docid": "a4f509c5923ed684136288d5f4ccc567",
"score": "0.5279303",
"text": "function showDropDown(scope,element,opts){opts.parent.append(element);return $q(function(resolve,reject){try{$animateCss(element,{removeClass:'md-leave',duration:0}).start().then(positionAndFocusMenu).then(resolve);}catch(e){reject(e);}});}",
"title": ""
},
{
"docid": "b31a7e5fc7a00d609808f8df7d257076",
"score": "0.52754384",
"text": "function ByPrecinctTabClick() {\n ShowTab('divByPrecinct');\n $('.menu-button').parent().addClass('hidden');\n $('.spacer').removeClass('hidden');\n}",
"title": ""
},
{
"docid": "f3df312d3e51f27713c212c00aacdba5",
"score": "0.5274336",
"text": "function setupTabs() {\n el = $(ko.virtualElements.firstChild(element)).parent();\n\n /* finds and hides add and more menu */\n $menu.add = $($(el).find('.tabs-add')).hide();\n $menu.more = $($(el).find('.tabs-more')).hide();\n\n /* initializes jquery tabs */\n $tabs = $($(el).find('.tabs')).tabs();\n\n /* enables editable headers */\n $.widget(\"ui.tabs\", $.ui.tabs, {\n options: { keyboard: true },\n _tabKeydown: function (e) {\n if (this.options.keyboard) { this._super('_tabKeydown'); }\n else { return false; }\n }\n });\n $tabs.delegate(\"a.ui-tabs-anchor\", \"dblclick\", function () {\n var header = ko.dataFor(this).header,\n\t\t\t\t\t $input,\n\t\t\t\t\t el = this;\n\n if (isObservable(header)) {\n $(el).find(\"[data-class='tabs-header-text']\").replaceWith(\"<input data-class='tabs-header-edit' />\");\n $input = $(el).find(\"input\");\n\n ko.applyBindings(ko.dataFor(this), $input.get(0));\n $input.focus();\n $input.bind('keyup', function (e) {\n var code = e.keyCode || e.which;\n if (code == 13) {\n $input.replaceWith(\"<div class='tabs-header-text' data-class='tabs-header-text'></div>\");\n ko.applyBindings(ko.dataFor(el), $(el).find(\"[data-class='tabs-header-text']\").get(0));\n }\n });\n\n $input.bind('blur', function () {\n $input.replaceWith(\"<div class='tabs-header-text' data-class='tabs-header-text'></div>\");\n ko.applyBindings(ko.dataFor(el), $(el).find(\"[data-class='tabs-header-text']\").get(0));\n });\n }\n });\n\n /* binds width calculation on resize */\n $(window).resize(calculateWidth);\n }",
"title": ""
},
{
"docid": "48c94a1f1e4cf7062f56f4aac805afc3",
"score": "0.52722806",
"text": "render() {\n return html `\n <div class=\"mdc-tab-bar\" role=\"tablist\"\n @MDCTab:interacted=\"${this._handleTabInteraction}\"\n @keydown=\"${this._handleKeydown}\">\n <mwc-tab-scroller><slot></slot></mwc-tab-scroller>\n </div>\n `;\n }",
"title": ""
},
{
"docid": "c9c080f6fdb2f5e17642c0c37d36150e",
"score": "0.52696824",
"text": "function refreshTabsSelector() {\n\t\tif( sidebarNavExists && sidebarNavTabsLength > 1 ) {\n\t\t\tvar initialTab = $(\"#sidebar-nav .ui-tabs-active\");\n\t\t\tactiveTabSelector.css({\n\t\t\t\t\"left\": initialTab.position().left,\n\t\t\t\t\"width\": initialTab.width(),\n\t\t\t});\n\t\t}\n\t}",
"title": ""
},
{
"docid": "44f4352dde2cff494945d21b3480a271",
"score": "0.5266006",
"text": "showTabBar() {\n document.getElementById(\"input-tabs-wrapper\").style.display = \"block\";\n document.getElementById(\"output-tabs-wrapper\").style.display = \"block\";\n document.getElementById(\"input-wrapper\").classList.add(\"show-tabs\");\n document.getElementById(\"output-wrapper\").classList.add(\"show-tabs\");\n document.getElementById(\"save-all-to-file\").style.display = \"inline-block\";\n }",
"title": ""
},
{
"docid": "f514a8ab7057d45e5071386f0dbe3995",
"score": "0.525479",
"text": "function initTabs() {\n\n $('div.sjp_jo_tab div.sjp_tab_headers ul').find('input').css('display', 'none');\n\n $('div.sjp_jo_tab div.sjp_tab_headers ul').find('input').each(function (elem) {\n\n // Get self containing the hidden active tab input\n var self = $(this);\n var headerlink = $('<a href=\"#\" class=\"small\" id=\"' + elem + '\" title=\"' + $(this).attr('value') + '\" >' + $(this).attr('value') + '</a>').click(\n function (event) {\n\n // Set the active tab class style\n $('div.sjp_jo_tab div.sjp_tab_headers ul li').removeClass('active');\n $(event.target).parent().addClass('active');\n\n // Set the highlight tab class style to be the class of this tab\n $('div.sjp_jo_tab div.sjp_tab_headers div.sjp_tab_highlight div').attr('class', $(event.target).parent().attr('class'))\n\n $('div.sjp_jo_tab div.content_wrapper div.tab').each(function (celem) {\n if (celem == $(event.target).attr('id')) {\n $(this).show().addClass('active');\n\n // Update hidden active tab input to the selected tab\n var tabValue = $(self).val();\n var hdnId = getAspElement(\"hdnActiveTab\", \"input\", $('div.sjp_jo_tab'));\n $(hdnId).val(tabValue);\n }\n else {\n $(this).hide().removeClass('active');\n }\n\n });\n\n setTimeout('updateOptionTab()', 100);\n event.preventDefault();\n });\n\n $(this).after(headerlink);\n if ($(this).parent().hasClass('active')) { $(headerlink).parent().addClass('active'); }\n });\n\n\n}",
"title": ""
},
{
"docid": "eaffe9e0b6091709543a927238904cf7",
"score": "0.52537644",
"text": "function selectItem(e) {\r\n removeBorder();\r\n removeShow();\r\n //add border to curent tab\r\n this.classList.add('tab-border');\r\n //grab content item from DOM\r\n const itid = '#' + this.id + '-content';\r\n const tabContentItems = document.querySelector(itid);\r\n tabContentItems.classList.add('show');\r\n\r\n\r\n}",
"title": ""
},
{
"docid": "e93e27daa957ce1995a539d0d23be3d4",
"score": "0.5252693",
"text": "function OuvrirOnglet_Codes_postaux()\n{\n var tabs = top.document.getElementById(\"Tous_les_onglets\");\n tabs.selectedItem = top.document.getElementById(\"Onglet_Codes_postaux\");\n}",
"title": ""
},
{
"docid": "0dc4cfb08de5d73ecbe6b26fe20ad569",
"score": "0.5252324",
"text": "setMaxWidth(anchorRect) {\n if (!this.instance) {\n return;\n }\n this.instance.style.maxWidth = '';\n const dropdownStyles = getComputedStyle(this.instance);\n const minWidth = parseInt(dropdownStyles.minWidth);\n let maxWidth = parseInt(dropdownStyles.maxWidth);\n const windowWidth = document.documentElement.clientWidth;\n if (this.currentDirection === 'left') {\n maxWidth = Math.min(maxWidth, anchorRect.left - this.borderOffset - this.offset);\n }\n else if (this.currentDirection === 'right') {\n maxWidth = Math.min(maxWidth, windowWidth - this.borderOffset - this.offset - anchorRect.right);\n }\n else {\n switch (this.alignment) {\n case 'start':\n maxWidth = Math.min(maxWidth, windowWidth - anchorRect.left - this.borderOffset);\n break;\n case 'middle':\n maxWidth = Math.min(maxWidth, (Math.min(anchorRect.left + anchorRect.width / 2, windowWidth - anchorRect.left - anchorRect.width / 2) - this.borderOffset) *\n 2);\n break;\n case 'end':\n maxWidth = Math.min(maxWidth, anchorRect.right - this.borderOffset);\n break;\n case 'auto':\n maxWidth = Math.min(maxWidth, windowWidth - this.borderOffset * 2);\n break;\n }\n }\n this.instance.style.maxWidth = `${Math.max(maxWidth, minWidth)}px`;\n }",
"title": ""
},
{
"docid": "91ee06483f9144348cce9a7544858372",
"score": "0.5243996",
"text": "function hideDropdown() {\n dropCallback = undefined;\n document.querySelector(\"#module-entries\").style.top = '0px';\n document.querySelector(\"#module-entries\").style.left = '-1000px';\n updateModuleList(\"\");\n}",
"title": ""
},
{
"docid": "e8c444704d92dea9c38e1e67f9a20fc1",
"score": "0.523717",
"text": "function create_custom_dropdowns() {\n\t $('select').each(function(i, select) {\n\t if (!$(this).next().hasClass('dropdown')) {\n\t $(this).after('<div class=\"dropdown ' + ($(this).attr('class') || '') + '\" tabindex=\"0\"><span class=\"current\"></span><div class=\"list\"><ul></ul></div></div>');\n\t var dropdown = $(this).next();\n\t var options = $(select).find('option');\n\t var selected = $(this).find('option:selected');\n\t dropdown.find('.current').html(selected.data('display-text') || selected.text());\n\t options.each(function(j, o) {\n\t var display = $(o).data('display-text') || '';\n\t dropdown.find('ul').append('<li class=\"option ' + ($(o).is(':selected') ? 'selected' : '') + '\" data-value=\"' + $(o).val() + '\" data-display-text=\"' + display + '\">' + $(o).text() + '</li>');\n\t });\n\t }\n\t});\n\n \t// Event listeners\n\n\t// Open/close\n\t$(document).on('click', '.dropdown', function(event) {\n\t $('.dropdown').not($(this)).removeClass('open');\n\t $(this).toggleClass('open');\n\t if ($(this).hasClass('open')) {\n\t $(this).find('.option').attr('tabindex', 0);\n\t $(this).find('.selected').focus();\n\t } else {\n\t $(this).find('.option').removeAttr('tabindex');\n\t $(this).focus();\n\t }\n\t});\n\t// Close when clicking outside\n\t$(document).on('click', function(event) {\n\t if ($(event.target).closest('.dropdown').length === 0) {\n\t $('.dropdown').removeClass('open');\n\t $('.dropdown .option').removeAttr('tabindex');\n\t }\n\t event.stopPropagation();\n\t});\n\t// Option click\n\t$(document).on('click', '.dropdown .option', function(event) {\n\t $(this).closest('.dropdown').find('.selected').removeClass('selected');\n\t $(this).closest('.option').addClass('selected');\n\t var text = $(this).data('display-text') || $(this).text();\n\t $(this).closest('.dropdown').find('.current').text(text);\n\t $(this).closest('.dropdown').prev('select').val($(this).data('value')).trigger('change');\n\t});\n\n\t// Keyboard events\n\t$(document).on('keydown', '.dropdown', function(event) {\n\t var focused_option = $($(this).find('.list .option:focus')[0] || $(this).find('.list .option.selected')[0]);\n\t // Space or Enter\n\t if (event.keyCode == 32 || event.keyCode == 13) {\n\t if ($(this).hasClass('open')) {\n\t focused_option.trigger('click');\n\t } else {\n\t $(this).trigger('click');\n\t }\n\t return false;\n\t // Down\n\t } else if (event.keyCode == 40) {\n\t if (!$(this).hasClass('open')) {\n\t $(this).trigger('click');\n\t } else {\n\t focused_option.next().focus();\n\t }\n\t return false;\n\t // Up\n\t } else if (event.keyCode == 38) {\n\t if (!$(this).hasClass('open')) {\n\t $(this).trigger('click');\n\t } else {\n\t var focused_option = $($(this).find('.list .option:focus')[0] || $(this).find('.list .option.selected')[0]);\n\t focused_option.prev().focus();\n\t }\n\t return false;\n\t // Esc\n\t } else if (event.keyCode == 27) {\n\t if ($(this).hasClass('open')) {\n\t $(this).trigger('click');\n\t }\n\t return false;\n\t }\n\t});\n}",
"title": ""
},
{
"docid": "cbff18b347816d8ed7552c7d0babac7f",
"score": "0.5233089",
"text": "function contentTabs() {\r\n\t// set initial tab of choice\r\n\tconst initialTab = 0;\r\n\r\n\t// -------------------------------------------------\r\n\r\n\t// declare vars\r\n\tlet i;\r\n\t// check if container/wrapper exist\r\n\tconst containerActive = document.getElementsByClassName('tabs-wrapper');\r\n\t// put all tab-items into a variable\r\n\tconst tabButton = document.querySelectorAll('.tab-item');\r\n\t// put all item-contents into a variable\r\n\tconst tabContent = document.querySelectorAll('.item-content');\r\n\r\n\tif (containerActive.length >= 1) {\r\n\t\trunTabs();\r\n\t}\r\n\r\n\tfunction runTabs() {\r\n\t\t/* maintenance mode, check amount of tab-items is same as item-content.\r\n-- if isn't, suggest \"warn\" ways to ommit error messages. */\r\n\t\tfunction initChecks() {\r\n\t\t\t// clear all active classes\r\n\t\t\tclearActive();\r\n\t\t\t// check element numbers are correct\r\n\t\t\tif (tabButton.length < tabContent.length) {\r\n\t\t\t\t// if there are less buttons than content tabs\r\n\t\t\t\tconsole.warn(\r\n\t\t\t\t\t'You need to have the same amount of tab-item\\'s as you have content-tab\\'s'\r\n\t\t\t\t);\r\n\t\t\t\tconsole.group(\r\n\t\t\t\t\t'Paste this emmet shorthand inside the \\'tabs-wrapper\\' div and press enter/tab'\r\n\t\t\t\t);\r\n\t\t\t\tconsole.log('div.tab-item{tab-title}');\r\n\t\t\t\tconsole.groupEnd();\r\n\t\t\t} else if (tabContent.length < tabButton.length) {\r\n\t\t\t\t// if there are less content tabs than buttons\r\n\t\t\t\tconsole.warn(\r\n\t\t\t\t\t'You need to have the same amount of content-tab\\'s as you have tab-items\\'s'\r\n\t\t\t\t);\r\n\t\t\t\tconsole.group(\r\n\t\t\t\t\t'Paste this emmet shorthand inside the \\'tabbed-content\\' div and press enter/tab'\r\n\t\t\t\t);\r\n\t\t\t\tconsole.log(\r\n\t\t\t\t\t'div.item-content>div.hightlights*4>h4{some title}+p{some copy}'\r\n\t\t\t\t);\r\n\t\t\t\tconsole.groupEnd();\r\n\t\t\t} else {\r\n\t\t\t\ttabContent[initialTab].classList.add('active');\r\n\t\t\t}\r\n\t\t}\r\n\t\tinitChecks();\r\n\r\n\t\t/* self calling function to clear all active classed from group of tabs\r\n -- if user has added active class for some wierd reason */\r\n\t\tfunction clearActive() {\r\n\t\t\t// cycle through all elements with class=\"tab-item\" and remove \"active\".\r\n\t\t\tfor (i = 0; i < tabContent.length; i++) {\r\n\t\t\t\ttabContent[i].classList.remove('active');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add event listeners to all elements with tab-item class and wait for click\r\n\t\tfor (let tabIndex = 0; tabIndex < tabButton.length; tabIndex++) {\r\n\t\t\ttabButton[tabIndex].addEventListener('click', function() {\r\n\t\t\t\t// clear all active class's from the group of tabs.\r\n\t\t\t\tclearActive();\r\n\t\t\t\t// select item-content with the same index as the clicked tab-item and add an active class.\r\n\t\t\t\ttabContent[tabIndex].classList.toggle('active');\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}",
"title": ""
},
{
"docid": "1fed5bf0f86251cfa06ffed4a0b58bab",
"score": "0.5228497",
"text": "function createDropDown(){\n\tif($(\"#target\").length == 0 )\n\t{\n\tvar $form = $(\".TopMenu .countrySelect #country-select form\");\n\t$form.hide();\n\tvar source = $(\".countrySelect #country-options\");\n\tsource.removeAttr(\"autocomplete\");\n\tvar selected = source.find(\"option:selected\");\n\tvar options = $(\"option\", source);\n\t$(\".TopMenu .countrySelect #country-select\").append('<dl id=\"target\" class=\"dropdown target\"></dl>')\n\t$(\".target\").append('<dt class=\"' + selected.val() + '\"><a href=\"#\"><span class=\"flag\"></span><em>' + selected.text() + '</em><img src=\"' + countrySelect + '\"></a></dt>');\n\t$(\".target\").append('<dd><ul></ul></dd>')\n\toptions.each(function(){\n\t\t$(\".target dd ul\").append('<li class=\"' + $(this).val() + '\"><a href=\"' + $(this).attr(\"title\") + '\"><span class=\"flag\"></span><em>' + $(this).text() + '</em></a></li>');\n\t\t});\n\t}\n\t//$(\".country-select\").html($(\"#country-select\").html())\n\n}",
"title": ""
},
{
"docid": "07ce0f265d2ec141feafb1bfe9889e46",
"score": "0.5225973",
"text": "function featured_page_widget_show_tab(tab) {\r\n /* Close Active Tab */\r\n activeTab = document.getElementById('active_tab').value;\r\n document.getElementById('featured_page_widget_box_' + activeTab).style.display = 'none';\r\n document.getElementById('featured_page_widget_' + activeTab).removeAttribute('class','featured-page-widget-selected');\r\n\r\n /* Open new Tab */\r\n document.getElementById('featured_page_widget_box_' + tab).style.display = 'block';\r\n document.getElementById('featured_page_widget_' + tab).setAttribute('class','featured-page-widget-selected');\r\n document.getElementById('active_tab').value = tab;\r\n}",
"title": ""
},
{
"docid": "8dacfea07b83d742ca7a9a758a282aa7",
"score": "0.5225517",
"text": "function handleTabOverflowScrollWidth(obj, animationSpeed) {\n\t\t\t\t\t\t\tvar marginLeft = parseInt($(obj).css('margin-left'));\n\t\t\t\t\t\t\tvar viewWidth = $(obj).width();\n\t\t\t\t\t\t\tvar prevWidth = $(obj).find('li.active').width();\n\t\t\t\t\t\t\tvar speed = (animationSpeed > -1) ? animationSpeed : 150;\n\t\t\t\t\t\t\tvar fullWidth = 0;\n\n\t\t\t\t\t\t\t$(obj).find('li.active').prevAll().each(function () {\n\t\t\t\t\t\t\t\tprevWidth += $(this).width();\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t$(obj).find('li').each(function () {\n\t\t\t\t\t\t\t\tfullWidth += $(this).width();\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (prevWidth >= viewWidth) {\n\t\t\t\t\t\t\t\tvar finalScrollWidth = prevWidth - viewWidth;\n\t\t\t\t\t\t\t\tif (fullWidth != prevWidth) {\n\t\t\t\t\t\t\t\t\tfinalScrollWidth += 40;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$(obj).find('.nav.nav-tabs').animate({ marginLeft: '-' + finalScrollWidth + 'px' }, speed);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (prevWidth != fullWidth && fullWidth >= viewWidth) {\n\t\t\t\t\t\t\t\t$(obj).addClass('overflow-right');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$(obj).removeClass('overflow-right');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (prevWidth >= viewWidth && fullWidth >= viewWidth) {\n\t\t\t\t\t\t\t\t$(obj).addClass('overflow-left');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$(obj).removeClass('overflow-left');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"title": ""
},
{
"docid": "d6e51dc8951483ad52909ebc83fcba21",
"score": "0.5214545",
"text": "_closeDropDown () {\n this._mainDropDownActive = false\n this._containerHeader.querySelector('.dropdown-content').style.display = 'none'\n }",
"title": ""
},
{
"docid": "a4edb0ee8d55def9ff610decd7173a00",
"score": "0.5212988",
"text": "function OuvrirOnglet_Lieu()\n{\n var tabs = top.document.getElementById(\"Tous_les_onglets\");\n tabs.selectedItem = top.document.getElementById(\"Onglet_Lieu\");\n}",
"title": ""
},
{
"docid": "b0dfe5c0dd9af0b386c94e5c04ec7447",
"score": "0.5212543",
"text": "function customize_for_this_tab() {\n $(\".menu-entry, .separator\").hide();\n\n BG.getCurrentTabInfo(function(info) {\n var shown = {};\n function show(L) { L.forEach(function(x) { shown[x] = true; }); }\n function hide(L) { L.forEach(function(x) { shown[x] = false; }); }\n\n show([\"div_options\", \"separator2\"]);\n var paused = BG.adblock_is_paused();\n if (paused) {\n show([\"div_status_paused\", \"separator0\", \"div_options\"]);\n } else if (info.disabled_site) {\n show([\"div_status_disabled\", \"separator0\", \"div_pause_adblock\", \n \"div_options\", \"div_help_hide_start\"]);\n } else if (info.whitelisted) {\n show([\"div_status_whitelisted\", \"div_show_resourcelist\", \n \"separator0\", \"div_pause_adblock\", \"separator1\", \n \"div_options\", \"div_help_hide_start\"]);\n } else {\n show([\"div_pause_adblock\", \"div_blacklist\", \"div_whitelist\", \n \"div_whitelist_page\", \"div_show_resourcelist\", \n \"div_report_an_ad\", \"separator1\", \"div_options\", \n \"div_help_hide_start\", \"separator3\",\"block_counts\"]);\n \n var page_count = info.tab_blocked || \"0\";\n $(\"#page_blocked_count\").text(page_count);\n $(\"#total_blocked_count\").text(info.total_blocked);\n \n $(\"#toggle_badge_checkbox\").attr(\"checked\", info.display_stats);\n // Don't show the checkbox when clicking it will do nothing obvious.\n $(\"#block_counts_controls\").toggle(page_count !== \"0\");\n // Show help link until it is clicked.\n $(\"#block_counts_help\").\n toggle(BG.get_settings().show_block_counts_help_link).\n click(function() {\n BG.set_setting(\"show_block_counts_help_link\", false);\n BG.openTab($(this).attr(\"href\"));\n $(this).hide();\n });\n }\n\n var eligible_for_undo = !paused && (info.disabled_site || !info.whitelisted);\n var url_to_check_for_undo = info.disabled_site ? undefined : info.tab.url;\n if (eligible_for_undo && BG.has_last_custom_filter(url_to_check_for_undo))\n show([\"div_undo\", \"separator0\"]);\n\n if (!BG.get_settings().show_advanced_options)\n hide([\"div_show_resourcelist\"]);\n \n for (var div in shown)\n if (shown[div]) \n $('#' + div).show();\n });\n}",
"title": ""
},
{
"docid": "9078bc48b7e168379b51630f5a946062",
"score": "0.5208281",
"text": "function moveDropdown () {\n if (!elements.$.root.length) return;\n $mdTheming(elements.$.ul);\n elements.$.ul.detach();\n elements.$.root.append(elements.$.ul);\n if ($animate.pin) $animate.pin(elements.$.ul, $rootElement);\n }",
"title": ""
}
] |
9f1021e96d93fb65b4ad9b83048e864c | Extracts the first syllable. (?=) is a lookahead operation. See | [
{
"docid": "066f44ca146188cdcfe324c67b95959f",
"score": "0.8063408",
"text": "function extractFirstSyllable(text){\n\t\t\t\treturn text.toLowerCase().match(/[kptnmsjwl]?[aeiou](n(?=([^aeiou]|$)))?/gi);\n\t\t\t}",
"title": ""
}
] | [
{
"docid": "6a345dd9d787cc4e4fbbe019590dcf85",
"score": "0.6063209",
"text": "function boldedFirstSyllable(match) {\n\t\tvar bolded_regexp = new RegExp(/(\\b)([bcdfghjklmnpqrstvwxz]*[aeiou]+[bcdfghjklmnpqrstvwxz]*)/);\n\t\tmatch = match.replace(bolded_regexp, \"$1<span style=\\\"background: #FF0\\\">$2</span>\");\n\t\treturn match;\n\t}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "425e081b16102cce04cea820bba7d309",
"score": "0.57590604",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n}",
"title": ""
},
{
"docid": "87a4650ac66701280f2b3c6ce7edad92",
"score": "0.5750959",
"text": "function firstStrongChar(str) {\n var match = REGEX_STRONG.exec(str);\n return match == null ? null : match[0];\n }",
"title": ""
},
{
"docid": "db5a960ce464f5a453e51b28f25f51a7",
"score": "0.5747876",
"text": "function firstStrongChar(str) {\n\t var match = REGEX_STRONG.exec(str);\n\t return match == null ? null : match[0];\n\t}",
"title": ""
},
{
"docid": "b2a5beeb97858887c3ee4397b560510a",
"score": "0.54810864",
"text": "function syllables(word){\n return RiTa.getSyllables(word);\n}",
"title": ""
},
{
"docid": "ca8a8f8a6df455882e24dd0c7fd2bf1b",
"score": "0.5476201",
"text": "function boldedFirstSyllableVerCon(match) {\n\t\tvar bolded_regexp = new RegExp(/(\\b)([bcdfghjklmnpqrstvwxz]*[aeiou]+[bcdfghjklmnpqrstvwxz]*)/);\n\t\tmatch = match.replace(bolded_regexp, \"$1<span style=\\\"background: #FF0\\\">$2</span>\");\n\t\treturn match;\n\t}",
"title": ""
},
{
"docid": "bdc1969998ab45234b25e98db469288c",
"score": "0.54383814",
"text": "function extractLanguage (s) {\n\t\treturn s.split('-')[0].toLowerCase();\n\t}",
"title": ""
},
{
"docid": "444a1aac802ec9787718a31525936ded",
"score": "0.542274",
"text": "lexProductionName(start) {\n let s = start;\n let c = this.la(s);\n if(this.isAsciiSymbol(c)) {\n return 0;\n }\n while(this.isAsciiUpperCase(c) || this.isAsciiLowerCase(c)) {\n s++;\n c = this.la(s);\n }\n return s;\n }",
"title": ""
},
{
"docid": "96e1a78f084cc44805f575915f267ced",
"score": "0.5369972",
"text": "function e$3s(e){return e.match(t$3y)?.[1]?.replace(/\\\\'/g,\"'\")??null}",
"title": ""
},
{
"docid": "0e377303e15fc1b5fc8fdf8ed1a4147e",
"score": "0.5360483",
"text": "function syllables(value) {\n var values = normalize(String(value))\n .toLowerCase()\n .replace(APOSTROPHE, '')\n .split(SPLIT)\n var length = values.length\n var index = -1\n var total = 0\n\n while (++index < length) {\n total += syllable(values[index].replace(EXPRESSION_NONALPHABETIC, ''))\n }\n\n return total\n}",
"title": ""
},
{
"docid": "0e377303e15fc1b5fc8fdf8ed1a4147e",
"score": "0.5360483",
"text": "function syllables(value) {\n var values = normalize(String(value))\n .toLowerCase()\n .replace(APOSTROPHE, '')\n .split(SPLIT)\n var length = values.length\n var index = -1\n var total = 0\n\n while (++index < length) {\n total += syllable(values[index].replace(EXPRESSION_NONALPHABETIC, ''))\n }\n\n return total\n}",
"title": ""
},
{
"docid": "523af5fcd37981e99778a7d3788808ea",
"score": "0.52865916",
"text": "function findFirstWord(content) {\n var pos = 0;\n var wordLength = 0;\n \n // no need to trim, control tokens can't have leading whitespaces \n while (pos < content.length) {\n var c = content.charAt(pos++);\n if (c >= \"a\" && c <= \"z\" || c >= \"A\" && c <= \"Z\" || c >= \"0\" && c <= \"9\" || c === \"_\") {\n wordLength++;\n }\n else break;\n }\n return wordLength > 0 ? content.substr(0, wordLength) : null;\n }",
"title": ""
},
{
"docid": "747800342852caf5cebdcc38f04b1113",
"score": "0.5284289",
"text": "firstOfProductionRule(rule) {\n return this.firstOfSymbol(rule.right.first());\n }",
"title": ""
},
{
"docid": "da0ca528a2d16a88cb9eda026e29b407",
"score": "0.52316827",
"text": "function getFirstWord(text) {\n return text.match(/^[^\\s]+/i) ? text.match(/^[^\\s]+/i)[0] : '';\n }",
"title": ""
},
{
"docid": "3e674c9b458042124966f91a9941a552",
"score": "0.516831",
"text": "sPIFirstChar() {\n const c = this.getCodeNorm();\n // This is first because in the case where the file is well-formed this is\n // the branch taken. We optimize for well-formedness.\n if (this.nameStartCheck(c)) {\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n } else if (c === QUESTION || isS(c)) {\n this.fail(\"processing instruction without a target.\");\n this.state = c === QUESTION ? S_PI_ENDING : S_PI_BODY;\n } else {\n this.fail(\"disallowed character in processing instruction name.\");\n this.piTarget += String.fromCodePoint(c);\n this.state = S_PI_REST;\n }\n }",
"title": ""
},
{
"docid": "9c5386349ae2df5b8c1234f2190a50c6",
"score": "0.51312244",
"text": "lexUnknown7() {\n if(this.isGrammarStartLookahead(this.la(1), this.la(2))) {\n return this.acceptToken(this.Token.GrammarStart, 1);\n } else {\n return this.acceptToken(this.Token.Literal, this.lexLiteral(1));\n }\n }",
"title": ""
},
{
"docid": "3b5db23d3bc8e3b99209770ee8cb4720",
"score": "0.5125652",
"text": "function checkSyllables(word){\n\tvar arr=word.split(\"-\");\n\tif(arr.length<=2){\n\t\treturn 300;\n\t}else if(arr.length==3){\n\t\treturn 400;\n\t}else if(arr.length>3){\n\t\treturn 500;\n\t}\n}",
"title": ""
},
{
"docid": "98a34ff8fdc4ef777127cc2ae0187a48",
"score": "0.51241475",
"text": "function findWord(syllables, sylArr){\n var length = sylArr[syllables].length;\n var index = Math.floor(Math.random() * length);\n return sylArr[syllables][index];\n}",
"title": ""
},
{
"docid": "5a792214d9489db39f3c2dc345094ff7",
"score": "0.5123852",
"text": "function casing(value) {\n var head = exact(value.charAt(0))\n var rest = value.slice(1)\n\n if (!rest) {\n return head\n }\n\n rest = exact(rest)\n\n if (head === rest) {\n return head\n }\n\n if (head === 'u' && rest === 'l') {\n return 's'\n }\n\n return null\n}",
"title": ""
},
{
"docid": "780883c3b4ef99172a953413387492db",
"score": "0.51208",
"text": "function numOfSyllables(layout){\n var match = layout.match(/\\d/g);\n if(match == null) return 0;\n return match.length;\n}",
"title": ""
},
{
"docid": "8087742face2beb8b4cf29813d2df084",
"score": "0.5116288",
"text": "parseSingleString() {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe);\n } else {\n return this.goto(this.parseLiteralString);\n }\n }",
"title": ""
},
{
"docid": "8894bc7c50097b2f5a1a48c1c5992521",
"score": "0.510762",
"text": "function _getFirstWord(text) {\n var res = text.split(' ');\n return res[0];\n }",
"title": ""
},
{
"docid": "912f3d6a4790655b17d20d5d3c048647",
"score": "0.50995576",
"text": "parseSingleString() {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe);\n } else {\n return this.goto(this.parseLiteralString);\n }\n }",
"title": ""
},
{
"docid": "89c8a02faddbf7aa961c7d0db786c25b",
"score": "0.5094734",
"text": "function getR1(token) {\n var match = token.match(/[aeiouyæåø]{1}[^aeiouyæåø]([A-Za-z0-9_æøåÆØÅäÄöÖüÜ]+)/);\n\n if (match) {\n var preR1Length = match.index + 2;\n\n if (preR1Length < 3 && preR1Length > 0) {\n return token.slice(3);\n } else if (preR1Length >= 3) {\n return match[1];\n } else {\n return token;\n }\n }\n\n return null;\n}",
"title": ""
},
{
"docid": "81bbf564ae735a4673cc37a3d7520562",
"score": "0.509309",
"text": "lexUnknown3() {\n if(this.isGrammarStartLookahead(this.la(1), this.la(2))) {\n return this.acceptToken(this.Token.GrammarStart, 1);\n } else {\n return this.acceptToken(this.Token.GrammarLiteral, 1);\n }\n }",
"title": ""
},
{
"docid": "bd2465b22df447e8e71add31323e84b9",
"score": "0.50857043",
"text": "function firstSymbol(equation){\n return equation.replace(/[+\\-*\\/]/, '?');\n}",
"title": ""
},
{
"docid": "82b6c5c83c4e724223a082f6f0113f3f",
"score": "0.5082062",
"text": "function syllable(value) {\n var count = 0\n var index\n var length\n var singular\n var parts\n var addOne\n var subtractOne\n\n if (value.length === 0) {\n return count\n }\n\n // Return early when possible.\n if (value.length < 3) {\n return 1\n }\n\n // If `value` is a hard to count, it might be in `problematic`.\n if (own.call(problematic, value)) {\n return problematic[value]\n }\n\n // Additionally, the singular word might be in `problematic`.\n singular = pluralize(value, 1)\n\n if (own.call(problematic, singular)) {\n return problematic[singular]\n }\n\n addOne = returnFactory(1)\n subtractOne = returnFactory(-1)\n\n // Count some prefixes and suffixes, and remove their matched ranges.\n value = value\n .replace(EXPRESSION_TRIPLE, countFactory(3))\n .replace(EXPRESSION_DOUBLE, countFactory(2))\n .replace(EXPRESSION_SINGLE, countFactory(1))\n\n // Count multiple consonants.\n parts = value.split(/[^aeiouy]+/)\n index = -1\n length = parts.length\n\n while (++index < length) {\n if (parts[index] !== '') {\n count++\n }\n }\n\n // Subtract one for occurrences which should be counted as one (but are\n // counted as two).\n value\n .replace(EXPRESSION_MONOSYLLABIC_ONE, subtractOne)\n .replace(EXPRESSION_MONOSYLLABIC_TWO, subtractOne)\n\n // Add one for occurrences which should be counted as two (but are counted as\n // one).\n value\n .replace(EXPRESSION_DOUBLE_SYLLABIC_ONE, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_TWO, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_THREE, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_FOUR, addOne)\n\n // Make sure at least on is returned.\n return count || 1\n\n // Define scoped counters, to be used in `String#replace()` calls.\n // The scoped counter removes the matched value from the input.\n function countFactory(addition) {\n return counter\n function counter() {\n count += addition\n return ''\n }\n }\n\n // Define scoped counters, to be used in `String#replace()` calls.\n // The scoped counter does not remove the matched value from the input.\n function returnFactory(addition) {\n return returner\n function returner($0) {\n count += addition\n return $0\n }\n }\n}",
"title": ""
},
{
"docid": "82b6c5c83c4e724223a082f6f0113f3f",
"score": "0.5082062",
"text": "function syllable(value) {\n var count = 0\n var index\n var length\n var singular\n var parts\n var addOne\n var subtractOne\n\n if (value.length === 0) {\n return count\n }\n\n // Return early when possible.\n if (value.length < 3) {\n return 1\n }\n\n // If `value` is a hard to count, it might be in `problematic`.\n if (own.call(problematic, value)) {\n return problematic[value]\n }\n\n // Additionally, the singular word might be in `problematic`.\n singular = pluralize(value, 1)\n\n if (own.call(problematic, singular)) {\n return problematic[singular]\n }\n\n addOne = returnFactory(1)\n subtractOne = returnFactory(-1)\n\n // Count some prefixes and suffixes, and remove their matched ranges.\n value = value\n .replace(EXPRESSION_TRIPLE, countFactory(3))\n .replace(EXPRESSION_DOUBLE, countFactory(2))\n .replace(EXPRESSION_SINGLE, countFactory(1))\n\n // Count multiple consonants.\n parts = value.split(/[^aeiouy]+/)\n index = -1\n length = parts.length\n\n while (++index < length) {\n if (parts[index] !== '') {\n count++\n }\n }\n\n // Subtract one for occurrences which should be counted as one (but are\n // counted as two).\n value\n .replace(EXPRESSION_MONOSYLLABIC_ONE, subtractOne)\n .replace(EXPRESSION_MONOSYLLABIC_TWO, subtractOne)\n\n // Add one for occurrences which should be counted as two (but are counted as\n // one).\n value\n .replace(EXPRESSION_DOUBLE_SYLLABIC_ONE, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_TWO, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_THREE, addOne)\n .replace(EXPRESSION_DOUBLE_SYLLABIC_FOUR, addOne)\n\n // Make sure at least on is returned.\n return count || 1\n\n // Define scoped counters, to be used in `String#replace()` calls.\n // The scoped counter removes the matched value from the input.\n function countFactory(addition) {\n return counter\n function counter() {\n count += addition\n return ''\n }\n }\n\n // Define scoped counters, to be used in `String#replace()` calls.\n // The scoped counter does not remove the matched value from the input.\n function returnFactory(addition) {\n return returner\n function returner($0) {\n count += addition\n return $0\n }\n }\n}",
"title": ""
},
{
"docid": "9a46a1f53e5df2682ada12efe316327e",
"score": "0.50797635",
"text": "function PR_lexOne(s) {\n var chunks = PR_chunkify(s);\n // treat it as markup if the first non whitespace character is a < and the\n // last non-whitespace character is a >\n var isMarkup = false;\n for (var i = 0; i < chunks.length; ++i) {\n if (PR_PLAIN == chunks[i].style) {\n if (PR_startsWith(PR_trim(chunks[i].token), '<')) {\n for (var j = chunks.length; --j >= 0;) {\n if (PR_PLAIN == chunks[j].style) {\n isMarkup = PR_endsWith(PR_trim(chunks[j].token), '>');\n break;\n }\n }\n }\n break;\n }\n }\n return isMarkup ? PR_lexMarkup(chunks) : PR_lexSource(chunks);\n}",
"title": ""
},
{
"docid": "08976884d86528fc4e916773f72f592f",
"score": "0.50775325",
"text": "function find_singular_regular(word) {\n if (word.endsWith('ies'))\n singular = word.substring(0,word.length-3) + 'y'\n else if (word.endsWith('es') && (word.substring(0,word.length-2).endsWith('ch') || word.substring(0,word.length-2).endsWith('sh') || word.charAt(word.length-3) == 'x' || word.charAt(word.length-3) == 's' || word.charAt(word.length-3) == 'z' || word.charAt(word.length-3) == 'o'))\n singular = word.substring(0,word.length-2)\n else if (word.endsWith('s'))\n singular = word.substring(0,word.length-1)\n else\n return \"\"\n plural_list = get_regular_plural(singular)\n for (plural of plural_list)\n if (word == plural.substring(3))\n return singular\n return \"\"\n}",
"title": ""
},
{
"docid": "6b68c7997a5f5bf01202e7951aafa63e",
"score": "0.50451005",
"text": "function first() {\n index = 0;\n c = expression.charAt(0);\n nesting_level = 0;\n conditional_level = null;\n }",
"title": ""
},
{
"docid": "6b68c7997a5f5bf01202e7951aafa63e",
"score": "0.50451005",
"text": "function first() {\n index = 0;\n c = expression.charAt(0);\n nesting_level = 0;\n conditional_level = null;\n }",
"title": ""
},
{
"docid": "6b68c7997a5f5bf01202e7951aafa63e",
"score": "0.50451005",
"text": "function first() {\n index = 0;\n c = expression.charAt(0);\n nesting_level = 0;\n conditional_level = null;\n }",
"title": ""
},
{
"docid": "a8ac86fdfe3b5b38e4f6c71a4ffb73d7",
"score": "0.50285673",
"text": "function first() {\n\t index = 0;\n\t c = expression.charAt(0);\n\t nesting_level = 0;\n\t conditional_level = null;\n\t }",
"title": ""
},
{
"docid": "3ad7c6c02f9a9058909fc478370bfaea",
"score": "0.49470225",
"text": "function step1a(token) { \n if(token.match(/(ss|i)es$/)) {\n return token.replace(/(ss|i)es$/, '$1');\n }\n\n if(token.substr(-1) == 's' && token.substr(-2, 1) != 's' && token.length > 2) {\n return token.replace(/s?$/, '');\n }\n\n return token;\n}",
"title": ""
},
{
"docid": "56a130d340bcf63fa08f41ae8398021c",
"score": "0.49386463",
"text": "function step1b(token) {\n var r1 = getR1(token);\n\n if (!r1) {\n return token;\n }\n\n if (token.match(/(b|c|d|f|g|h|j|l|m|n|o|p|r|t|v|y|z)s$/)) {\n return token.slice(0, -1);\n }\n\n if (token.match(/([^aeiouyæåø]k)s$/)) {\n return token.slice(0, -1);\n }\n\n return token;\n}",
"title": ""
},
{
"docid": "921ea81869ecdd2ba6149dbb6b49e4c9",
"score": "0.49363118",
"text": "lexGrammarLiteral$$o() {\n let s = 1;\n if(0x66 === this.la(s)) {\n if(!this.isAsciiLowerCase(this.la(++s))) {\n return this.acceptToken(this.Literal.GrammarLiteral$of, s);\n }\n } else if(0x6E === this.la(s)) {\n if(0x65 === this.la(++s)\n && !this.isAsciiLowerCase(this.la(++s))) {\n return this.acceptToken(this.Literal.GrammarLiteral$one, s);\n }\n } else if(0x70 === this.la(s)) {\n if(0x74 === this.la(++s)\n && !this.isAsciiLowerCase(this.la(++s))) {\n return this.acceptToken(this.Literal.GrammarLiteral$opt, s);\n }\n } else if(0x72 === this.la(s)) {\n if(!this.isAsciiLowerCase(this.la(++s))) {\n return this.acceptToken(this.Literal.GrammarLiteral$or, s);\n }\n }\n return this.acceptToken(this.Token.GrammarLiteral, this.lexGrammarLiteral(s));\n }",
"title": ""
},
{
"docid": "3ef0a00650483eb6bf1deb66b6f2a600",
"score": "0.4931676",
"text": "function step1a(token) {\n if(token.match(/(ss|i)es$/))\n return token.replace(/(ss|i)es$/, '$1');\n\n if(token.substr(-1) == 's' && token.substr(-2, 1) != 's')\n return token.replace(/s?$/, '');\n\n return token;\n}",
"title": ""
},
{
"docid": "bf043c9014329827e514f78ffcab9b13",
"score": "0.4924844",
"text": "static firstMatch(text, pattern, idx) {\n let match = text.match(pattern);\n return (match && match[idx])\n ? match[idx]\n : undefined;\n }",
"title": ""
},
{
"docid": "3cc71376aa85a0392e25bca458dd91e1",
"score": "0.4921845",
"text": "lexUnknown2() {\n if(this.isAsciiUpperCase(this.la(1))) {\n return this.acceptToken(this.Token.Abbreviation, this.lexAbbreviation(2));\n } else {\n return this.acceptToken(this.Token.GrammerLiteral, 1);\n }\n }",
"title": ""
},
{
"docid": "48443584fb8227bfa5042eb0bc31fa04",
"score": "0.49167585",
"text": "function boldedSecondFromEndSyllable(match) {\n\t\tvar bolded_regexp = new RegExp('([bcdfghjklmnpqrstvwxz]+[aeiou]+[bcdfghjklmnpqrstvwxz]*)' + word[i]);\n\t\tmatch = match.replace(bolded_regexp, \"<span style=\\\"background: #FF0\\\">$1</span>\" + word[i] );\n\t\treturn match;\n\t}",
"title": ""
},
{
"docid": "28ef115c2b5f422f1cba416a365ff513",
"score": "0.49115497",
"text": "function gethaikuWordWithSyllableCount( twoD_ArrayRef, syllableNum) {\n\tvar selectedWord = twoD_ArrayRef[syllableNum][Math.floor(Math.random() * twoD_ArrayRef[syllableNum].length ) + 1];\n\n\t// Strip off the (#) if the word has one\n\tif( /\\(\\d+\\)$/.test( selectedWord ) ) {\n\t\tselectedWord = selectedWord.replace( /\\(\\d+\\)$/, \"\");\n\t}\n\t\n\n\treturn selectedWord;\n}",
"title": ""
},
{
"docid": "d040ec1379bc513f3f129dbf93145293",
"score": "0.4906709",
"text": "function extractLangName(name) {\n return name.split(\"_\")[0];\n }",
"title": ""
},
{
"docid": "d040ec1379bc513f3f129dbf93145293",
"score": "0.4906709",
"text": "function extractLangName(name) {\n return name.split(\"_\")[0];\n }",
"title": ""
},
{
"docid": "4805d1f9b29339b361c9e427225ae49f",
"score": "0.48998752",
"text": "function firstToken(s) {\n if (s.length === 0) {\n return { type: 0 /* TokenType.END */, text: '' };\n }\n let m;\n const c = s.charAt(0);\n switch (c) {\n case '(':\n return { type: 1 /* TokenType.LParen */, text: '(' };\n case ')':\n return { type: 2 /* TokenType.RParen */, text: ')' };\n case '[':\n return { type: 3 /* TokenType.LBracket */, text: '[' };\n case ']':\n return { type: 4 /* TokenType.RBracket */, text: ']' };\n case ',':\n return { type: 5 /* TokenType.Comma */, text: ',' };\n case '+':\n return { type: 6 /* TokenType.Plus */, text: '+' };\n case '-':\n return { type: 7 /* TokenType.Minus */, text: '-' };\n case '*':\n return { type: 8 /* TokenType.Mul */, text: '*' };\n case '/':\n return { type: 9 /* TokenType.Div */, text: '/' };\n case '<':\n if (s.length > 1 && s.charAt(1) === '=') {\n return { type: 11 /* TokenType.LessOrEq */, text: '<=' };\n }\n return { type: 10 /* TokenType.Less */, text: '<' };\n case '>':\n if (s.length > 1 && s.charAt(1) === '=') {\n return { type: 13 /* TokenType.GreaterOrEq */, text: '>=' };\n }\n return { type: 12 /* TokenType.Greater */, text: '>' };\n case '=':\n return { type: 14 /* TokenType.Equal */, text: '=' };\n case '!':\n if (s.length > 1 && s.charAt(1) === '=') {\n return { type: 15 /* TokenType.NotEqual */, text: '!=' };\n }\n return { type: 16 /* TokenType.Not */, text: '!' };\n case '$':\n m = s.match(/^\\$[a-zA-Z_]\\w*/);\n if (m === null) {\n throw new Error('invalid field name in: ' + s);\n }\n return { type: 20 /* TokenType.Field */, text: m[0] };\n case '\"':\n m = s.match(/^\"(\\\\\\\\|\\\\\"|[^\"])*\"/);\n if (m === null) {\n throw new Error('unterminated string literal in: ' + s);\n }\n return { type: 17 /* TokenType.String */, text: m[0] };\n case \"'\":\n m = s.match(/^'(\\\\\\\\|\\\\'|[^'])*'/);\n if (m === null) {\n throw new Error('unterminated string literal in: ' + s);\n }\n return { type: 17 /* TokenType.String */, text: m[0] };\n }\n if (c >= '0' && c <= '9') {\n m = s.match(/^\\d+(\\.\\d+)?([eE][\\+\\-]?\\d+)?/);\n if (m === null) {\n throw new Error('impossible');\n }\n return { type: 18 /* TokenType.Number */, text: m[0] };\n }\n m = s.match(/^[a-zA-Z_]\\w*/);\n if (m !== null) {\n return { type: 19 /* TokenType.Ident */, text: m[0] };\n }\n if (s.match(/^\\s/) !== null) {\n throw new Error('string s has a leading whitespace');\n }\n throw new Error('unrecognized token in: ' + s);\n}",
"title": ""
},
{
"docid": "115f0fc545d1784a205f0daaaf8155c9",
"score": "0.4888758",
"text": "lexUnknown6() {\n if(this.isGrammarStartLookahead(this.la(1), this.la(2))) {\n return this.acceptToken(this.Token.GrammarStart, 1);\n } else {\n return this.acceptToken(this.Token.ProductionLiteral, this.lexProductionLiteral(1));\n }\n }",
"title": ""
},
{
"docid": "fd5bc46a8cb177803e1fb43062e96aa5",
"score": "0.48883274",
"text": "lexUnknown4() {\n if(this.isAsciiUpperCase(this.la(1))) {\n return this.acceptToken(this.Token.Abbreviation, this.lexAbbreviation(2));\n } else {\n return this.acceptToken(this.Token.ProductionLiteral, this.lexProductionLiteral(1));\n }\n }",
"title": ""
},
{
"docid": "f38e718cb6eac7889369eb6687e3eedb",
"score": "0.48751488",
"text": "function extractLanguage(string) {\n return string.slice(0,2);\n}",
"title": ""
},
{
"docid": "cc272a69b5541dfd105a12662982d96e",
"score": "0.4854708",
"text": "function tokenBase(stream, state) {\n var ch = stream.next();\n var before = \"\";\n\n curPunc = null;\n\n if (ch == \"?\") {\n before = getBefore(stream, /\\s/);\n var isAggregate = (before != \"\" && stream.peekback(before.length + 3).match(/\\s/) && stream.peekback(before.length + 2) == \"a\" && stream.peekback(before.length + 1) == \"s\");\n stream.match(/^[\\w\\d]*/);\n if (isAggregate) {\n return \"variable aggregate-variable\";\n }\n return \"variable\";\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenLiteral(ch);\n return state.tokenize(stream, state);\n } else if (/[{}\\(\\)\\[\\]]/.test(ch)) {\n curPunc = ch;\n return \"bracket\";\n } else if (/[,;\\/]/.test(ch)) {\n curPunc = ch;\n return \"control\";\n } else if (ch == \"<\") {\n before = getBefore(stream, /[\\s:]/);\n stream.match(/^[\\S]*>/);\n\n if (before.indexOf(\":\") != -1) {\n return \"prefix-declaration prefix-value\";\n }\n return \"entity\";\n } else if (ch == \"@\") {\n stream.match(/[\\w-]*@/);\n return \"string string-language\";\n } else if (ch == \"#\") {\n stream.match(/.*/);\n return \"comment\";\n } else {\n before = getBefore(stream, /:/);\n var match = stream.match(/[_\\w\\d\\.-]*(:(\\s*))?/);\n var word = stream.current();\n if (match && match[2] !== undefined) {\n if (match[2].length > 0) {\n stream.backUp(match[2].length);\n return \"prefix-declaration prefix-name\";\n }\n return \"entity prefixed-entity prefix-name\";\n } else if (word.match(/^[.|<|>|=]+$/)) {\n return \"control\";\n } else if (keywords.test(word)) {\n return \"keyword\";\n } else if (functions.test(word)) {\n return \"function\";\n } else if (before.length > 0) {\n return \"entity prefixed-entity entity-name\"\n } else if (word.match(/[\\d]+/)) {\n return \"literal\";\n }\n // console.warn(\"Could not tokenize word: \" + word);\n return \"other\";\n }\n }",
"title": ""
},
{
"docid": "71d2e197473b78fb4d7e0896c5ed7d71",
"score": "0.4838907",
"text": "function firstWord(str) {\n return str.substring(0, str.indexOf(' '));\n}",
"title": ""
},
{
"docid": "ea45bba8fb492947b1b8d5d6f0ce99d0",
"score": "0.48351738",
"text": "function generateSevenSyllableLine() {\n // use the previous function for the first words\n let firstFiveWords = generateFiveSyllableLine();\n // generate first word\n let firstWord = RiTa.randomWord({\n numSyllables: getRandomInt(2)\n }); let firstResult = RiTa.analyze(firstWord);\n // number of slashes plus one will give syllable count\n let firstSyllables = firstResult.syllables.split(\"/\").length;\n if (firstSyllables === 1) {\n let secondWord = RiTa.randomWord({\n numSyllables: 1\n });\n let concatenated = firstWord.concat(space, secondWord);\n return firstFiveWords.concat(space, concatenated);\n }\n else if (firstSyllables === 2) {\n return firstFiveWords.concat(space, firstWord);\n }\n}",
"title": ""
},
{
"docid": "06c18ffb5a215ba89a3cdbee10517ef0",
"score": "0.48169166",
"text": "headMatchPattern(string){\n for (let linearParsingNode of this.linearParsingNodes){\n let patternString = linearParsingNode.headMatchFunction.call(this, string)\n if (patternString) return patternString\n }\n return ''\n }",
"title": ""
},
{
"docid": "b6d182a8a37393e220bfc72c91fa6cdc",
"score": "0.48122826",
"text": "function countSyllables(dictionaryIndex) {\r\n if (dictionaryIndex != -1) {\r\n var countWord = getWord(dictionaryIndex);\r\n var syllablesFound = 0;\r\n var char = \"\";\r\n //trim off the spelling and spacing from the string\r\n var tempPHONEMES = CURRENTDICTIONARY[dictionaryIndex].slice(countWord.length+2);\r\n //for the found word, make an array containing each phoneme sound\r\n var phonemes = tempPHONEMES.split(\" \");\r\n for (var i = 0, phoLen = phonemes.length; i < phoLen; i++){\r\n //set char to the first letter of the phoneme\r\n char = phonemes[phoLen-i-1].charAt(0);\r\n //if the vowels array includes this character\r\n if(vowels.includes(char)){\r\n syllablesFound++;\r\n }\r\n }\r\n return syllablesFound;\r\n } else {\r\n return 0;\r\n }\r\n }",
"title": ""
},
{
"docid": "554010785f5f311c4b42465c2d5e6767",
"score": "0.4801312",
"text": "function normalizeKeepFirst(text){\n//Normalization for vars means: 1st char untouched, rest to to lower case.\n\n//By keeping 1st char untouched, we allow \"token\" and \"Token\" to co-exists in the same scope.\n//'token', by name affinity, will default to type:'Token'\n\n //return fixSpecialNames( \"#{text.slice(0,1)}#{text.slice(1).toLowerCase()}\" )\n return fixSpecialNames('' + (text.slice(0, 1)) + (text.slice(1).toLowerCase()));\n }",
"title": ""
},
{
"docid": "dd95259e3745239d1e01b91890adf673",
"score": "0.4788258",
"text": "function firstWord(seeandstop){\n let seeandstop = \"see and stop\";\n return 'see and stop'.substr(0,3);\n }",
"title": ""
},
{
"docid": "17c41db903ed71ca348ea7b8184bd7e0",
"score": "0.47757927",
"text": "get _firstMatch() {\n for (let [, variable] of this._store) {\n let match;\n if (variable._isMatch) {\n match = variable;\n } else {\n match = variable._firstMatch;\n }\n if (match) {\n return match;\n }\n }\n return null;\n }",
"title": ""
},
{
"docid": "950fec2576227d2ce4680dddc4fc26bb",
"score": "0.47746983",
"text": "doState (word, wordType) {\n const wordLength = word.length\n /* breakdown the word to find out the 2nd to last character's letter */\n const brokeWord = breakdown(word[wordLength - 2])\n const brokeLength = brokeWord.length\n const syllableEnd = brokeWord[brokeLength - 1]\n const stemWord = word.slice(0, wordLength - 2)\n let newSyllable = brokeWord.slice(0, brokeLength - 1)\n\n // If it has a bottom consonant:\n if (brokeLength > 2) {\n const medialValue = brokeWord[brokeLength - 2]\n switch (syllableEnd) {\n case 17: // ㅂ\n switch (medialValue) {\n case 0:\n case 4:\n case 8:\n case 13:\n // if ㅏ,ㅓ,ㅕ,ㅗ,ㅜ, remove ㅂ and add 운\n newSyllable = combineSymbols(newSyllable)\n return `${stemWord + newSyllable}운`\n default:\n // for all other vowels\n if (stemWord || (wordType && wordType.toLowerCase() === 'verb')) {\n return `${word.slice(0, wordLength - 1)}는`\n }\n return `${word.slice(0, wordLength - 1)}은`\n }\n default:\n if (stemWord || (wordType && wordType.toLowerCase() === 'verb')) {\n return `${word.slice(0, wordLength - 1)}는`\n }\n return `${word.slice(0, wordLength - 1)}은`\n }\n }\n // Else it ends in a vowel:\n brokeWord.push(4) // add ㄴ as bottom consonant\n return stemWord + combineSymbols(brokeWord)\n }",
"title": ""
},
{
"docid": "40687f5b59bdc3407e1b4369fdf7ef83",
"score": "0.47742626",
"text": "function firstPunctuationIndex(string) {\n let punctuationIndices= [];\n let lowestIndex = [];\n \n for (let i = 0; i < string.length; i++) {\n if (string[i] === '.') {\n punctuationIndices.push(i)\n } else if (string[i] === '?') {\n punctuationIndices.push(i);\n } else if (string[i] === '!') {\n punctuationIndices.push(i);\n }\n }\n\n if (punctuationIndices.length === 0) {\n return -1\n } else {\n return punctuationIndices[0];\n }\n}",
"title": ""
},
{
"docid": "b2cbb6d822bd0ee51fdafd09cf645a20",
"score": "0.4735693",
"text": "function lexme(str) {\n return pfSeq([pStr(str), pSkipSpace], fN0);\n}",
"title": ""
},
{
"docid": "02e12e1d654894d0b7d059a7ca02ae0e",
"score": "0.4725743",
"text": "function readWord_simple(state) {\n var _start = state.tokPos;\n ++state.tokPos;\n while (state.tokPos<state.inputLen) {\n state.ch_ = state.input.charCodeAt(state.tokPos);\n if (isIdentifierChar[state.ch_]===true) ++state.tokPos;\n else if (state.ch_ === 92)\n return readWord_Esc(state, state.input.substring(_start, state.tokPos), isIdentifierChar);\n else break;\n }\n return state.input.substring(_start, state.tokPos);\n }",
"title": ""
},
{
"docid": "a17296309011f77a9717dd8cf2641ed1",
"score": "0.47244197",
"text": "function latinWordStartCheck(contextParams) {\n var char = contextParams.current;\n var prevChar = contextParams.get(-1);\n return (// ? latin first char\n prevChar === null && isLatinChar(char) || // ? latin char preceded with a non latin char\n !isLatinChar(prevChar) && isLatinChar(char)\n );\n}",
"title": ""
},
{
"docid": "aa9e8d89c16a8cfd8db849754c056de8",
"score": "0.47144005",
"text": "firstOfSymbol(symbol) {\n if (this.NONTERMINALS.contains(symbol)) {\n // find production rules that have this nonterminal on left side\n // and grab their first symbols\n return this.PRODUCTION_RULES\n .filter(rule => rule.left === symbol)\n .map(rule => this.firstOfProductionRule(rule))\n .flatten()\n } else {\n // for a terminal a, Fi(a) = [a]\n return Immutable.Set.of(symbol);\n }\n }",
"title": ""
},
{
"docid": "904b32b9e5a314d4435d88591010d4f9",
"score": "0.4713986",
"text": "function getMaxSyllables(){\r\n var mostSyllables = 0;\r\n var maxWord = \"\";\r\n for (var i=0, len = CURRENTDICTIONARY.length; i < len; i++){\r\n if (mostSyllables < countSyllables(i)){\r\n mostSyllables = countSyllables(i);\r\n }\r\n }\r\n console.log(\"Highest syllable count in currentdictionary is: \"+mostSyllables);\r\n return mostSyllables;\r\n }",
"title": ""
},
{
"docid": "8f6e05c096379712c3d6655b583324c5",
"score": "0.47068337",
"text": "function native_JSSyntaxRegExp_firstMatch(str) {\n var re = $DartRegExpToJSRegExp(this);\n var m = re.exec(str);\n if (m != null) {\n var match = native_JSSyntaxMatch__new(this, str);\n match.match_ = m;\n match.lastIndex_ = re.lastIndex;\n return match;\n }\n return $Dart$Null;\n}",
"title": ""
},
{
"docid": "c2841836bdd2e7debf484d40ac276751",
"score": "0.4686309",
"text": "function firstString(...args) {\n for (const arg of args) {\n if (typeof arg === \"string\") {\n return arg;\n }\n }\n return null;\n}",
"title": ""
},
{
"docid": "877bd2494d4cf89472d2dc94b37d4ebc",
"score": "0.4683684",
"text": "function getFirstWordLength(string) {\n return string.match(/\\w+/)[0].length;\n }",
"title": ""
},
{
"docid": "d400d5aef842918f25dc739a19398e5e",
"score": "0.46801344",
"text": "function firstChar(str) {}",
"title": ""
},
{
"docid": "2b03086ff558991bc51a4a2b3dc9275a",
"score": "0.4677449",
"text": "function getFirstWordLength(string) {\n return string.match(/\\w+/)[0].length\n }",
"title": ""
},
{
"docid": "516648d6ab6a22d38e1968a48f6a78df",
"score": "0.46748233",
"text": "function getFirstWordLength(string) {\r\n return string.match(/\\w+/)[0].length\r\n }",
"title": ""
},
{
"docid": "36ac691fb77ec76cf2ee45e92b92530d",
"score": "0.46708325",
"text": "function positionOfFirstOccurance(string, char){\n // Your code here\n}",
"title": ""
},
{
"docid": "3b1dff2c583286038213fd66679ed8e0",
"score": "0.46585223",
"text": "function getFirstWordLength(string) {\n return string.match(/\\w+/)[0].length;\n }",
"title": ""
},
{
"docid": "3b1dff2c583286038213fd66679ed8e0",
"score": "0.46585223",
"text": "function getFirstWordLength(string) {\n return string.match(/\\w+/)[0].length;\n }",
"title": ""
},
{
"docid": "3b1dff2c583286038213fd66679ed8e0",
"score": "0.46585223",
"text": "function getFirstWordLength(string) {\n return string.match(/\\w+/)[0].length;\n }",
"title": ""
},
{
"docid": "101956da9e6a125c7ea726871299c919",
"score": "0.46558118",
"text": "function first(input) {\n\n return input.charAt(0);\n }",
"title": ""
},
{
"docid": "fa3190e3c3842500e89231ad1711fc8b",
"score": "0.46538344",
"text": "function getFirstWordLength(string) {\r\n return string.match(/\\w+/)[0].length;\r\n }",
"title": ""
},
{
"docid": "8326abbff90e6b4c8624211acd52351b",
"score": "0.46519697",
"text": "function first() {\n\t index = 0;\n\t c = dot.charAt(0);\n\t }",
"title": ""
},
{
"docid": "a25da939aec4edae357f55f445369056",
"score": "0.4651367",
"text": "function firstString(string) {\n return string.replace(/([a-z]+)|([A-Z]+)/g, function (match, chr) {\n return chr ? match.toUpperCase() : match.toLowerCase();\n });\n}",
"title": ""
},
{
"docid": "482c6cd44564919279d352c22197e036",
"score": "0.4646722",
"text": "function firstWord(words){\n\tconst n = words.split(\" \");\n return n[0];\n}",
"title": ""
},
{
"docid": "b476929bfa0e4818a096b7bfa56b5d36",
"score": "0.46374086",
"text": "function Lex(stringData)\n\t{\n\t\treturn stringData.match(universalRegExp);\n\t}",
"title": ""
},
{
"docid": "ce978fe15e2e4d5a275a8dcd97c6dfd7",
"score": "0.46368703",
"text": "function getKind(lexeme) {\n for (var key in Token.Kind) {\n var kind = Token.Kind[key];\n if (lexeme.match(kind.pattern)) {\n return kind;\n }\n }\n}",
"title": ""
},
{
"docid": "89768aaaf6f5f3f8f158b978b824c6ed",
"score": "0.46298936",
"text": "function step1c(token) {\n if(categorizeGroups(token).substr(-2, 1) == 'V') {\n if(token.substr(-1) == 'y')\n return token.replace(/y$/, 'i');\n }\n\n return token;\n}",
"title": ""
},
{
"docid": "a7af29b7d16e8853a56cc6182d19c527",
"score": "0.46208468",
"text": "getNextSymbol() {\n var result = -1;\n\n if (this.content.length > 0) {\n result = this.content.charAt(0);\n this.content = this.content.substring(1, this.content.length);\n }\n\n return result;\n }",
"title": ""
},
{
"docid": "56b62fd5f6baa474ceb0481db92ae07f",
"score": "0.4617464",
"text": "headMatchRule(string){\n let location_of_first_equals_sign = string.indexOf('=')\n if (location_of_first_equals_sign < 1){\n return ''\n }\n\n let left_of_first_equals_sign = string.substring(0, location_of_first_equals_sign)\n let trimmed_left_of_first_equals_sign = left_of_first_equals_sign.trim()\n\n let rule_name = this.grammarize_RULE_NAME(trimmed_left_of_first_equals_sign)\n if (rule_name == null){\n return ''\n }\n\n let location_of_first_left_square_bracket = string.indexOf('[')\n let string_between_equals_sign_and_first_left_square_bracket = ''\n let is_keyword = false //is it one of the keywords OR[], AND[], etc.?\n if (location_of_first_left_square_bracket >= 0){\n string_between_equals_sign_and_first_left_square_bracket = string.substring(location_of_first_equals_sign + 1, location_of_first_left_square_bracket)\n\n let trimmed_string_between_equals_sign_and_first_left_square_bracket = string_between_equals_sign_and_first_left_square_bracket.trim()\n\n if (this.keywords.indexOf(trimmed_string_between_equals_sign_and_first_left_square_bracket) >= 0){\n //This is one of the keywords\n is_keyword = true\n }\n }\n\n if (location_of_first_left_square_bracket >= 0 && is_keyword){ //if first left square bracket was found\n\n let location_of_matching_right_square_bracket = this.get_matching_right_square_bracket(string, location_of_first_left_square_bracket)\n if (location_of_matching_right_square_bracket == -1){\n return ''\n }\n \n let next_rule_string = string.substring(0, location_of_matching_right_square_bracket + 1)\n return next_rule_string\n }else{\n //This is a rule name with no brackets\n let leadingWhitespace = Strings.headMatch(string.substring(location_of_first_equals_sign + 1), Strings.whitespace_characters)\n let ruleName = Strings.headMatch(string.substring(location_of_first_equals_sign + 1 + leadingWhitespace.length), this.validRuleNameCharacters)\n if (ruleName.length > 0){\n return string.substring(0, location_of_first_equals_sign + leadingWhitespace.length + ruleName.length + 1)\n }\n }\n }",
"title": ""
},
{
"docid": "9441d90fe5723a5c466c1698e687582b",
"score": "0.45980173",
"text": "_readSimpleIdentifier () {\n let index = this.currentIndex,\n code = this.input.charCodeAt(index);\n // check if valid first char\n if ((code >= 97 && code <= 122) || (code >= 65 && code <= 90) || code === 36 || code === 95 || this._isIdentifierFirstCharUnicode(code)) {\n index++;\n } else {\n return null;\n }\n let currentIndex = this.currentIndex,\n input = this.input;\n // check remaining chars\n for (let length = this.input.length; index < length; ) {\n code = input.charCodeAt(index);\n if ((code >= 97 && code <= 122) || (code >= 65 && code <= 90) || (code >= 48 && code <= 57) || code === 36 || code === 95 || this._isIdentifierCharUnicode(code)) {\n index++;\n } else {\n break;\n }\n }\n return input.slice(currentIndex, index);\n }",
"title": ""
},
{
"docid": "363d0d1c9b164639f57a71da62bda933",
"score": "0.45956215",
"text": "function first() {\n index = 0;\n c = dot.charAt(0);\n }",
"title": ""
},
{
"docid": "655ec21258537b716c530d0f13c900b7",
"score": "0.45885321",
"text": "function getFirstLetter(word) {\n return word.split('')[0];\n}",
"title": ""
},
{
"docid": "c614a3935a653ba7b48bfbd5d4f69de0",
"score": "0.4584711",
"text": "syllableCounter(input) {\n let sylCount = 0;\n const inputArr = input.split(' ');\n inputArr.forEach((word) => {\n // stop spaces from adding to count\n const trimmed = word.replace(' ', '');\n if (trimmed !== '') {\n sylCount += Syllable(trimmed);\n }\n });\n return sylCount;\n }",
"title": ""
},
{
"docid": "ed07e8bf8a17eef83445defbd95c3d53",
"score": "0.45818728",
"text": "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }",
"title": ""
},
{
"docid": "ed07e8bf8a17eef83445defbd95c3d53",
"score": "0.45818728",
"text": "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }",
"title": ""
},
{
"docid": "ed07e8bf8a17eef83445defbd95c3d53",
"score": "0.45818728",
"text": "function getFirstWordLength( string ) {\n return string.match( /\\w+/ )[ 0 ].length\n }",
"title": ""
}
] |
8209348c00ebbf39616bab68c0d7afb1 | Initialize the bundle with the application | [
{
"docid": "f2f152fad9a163ac4565caab7eb48d71",
"score": "0.0",
"text": "function oNew(pRouter, pPict)\n\t\t{\n\t\t\tvar _Pict = pPict;\n\t\t\tvar _Router = pRouter;\n/*\n\t\t\t// Authenticate the user\n\t\t\t_Pict.session.behaviors.Authenticate = function(pUserName, pPassword, fCallback)\n\t\t\t{\n\t\t\t\tif (pPassword === 'password')\n\t\t\t\t\tfCallback(JSON.parse('{\"IDUser\":1,\"NameFirst\":\"Luser\",\"NameLast\":\"McUsryington\",\"IDCustomer\":1,\"Role\":\"User\",\"RoleIndex\":1,\"Email\":\"user@test.com\",\"Title\":\"User\"}'))\n\t\t\t\telse\n\t\t\t\t\tfCallback(false);\n\t\t\t};\n\n\t\t\t// Deauthenticate the user\n\t\t\t_Pict.session.behaviors.Deauthenticate = function(fCallback)\n\t\t\t{\n\t\t\t\tfCallback();\n\t\t\t};\n\n\t\t\t// Check the session's status\n\t\t\t_Pict.session.behaviors.CheckSessionStatus = function(fCallback)\n\t\t\t{\n\t\t\t\tfCallback(false);\n\t\t\t};\n\n\t\t\t// Setup the user interface for a user just logging in\n\t\t\t_Pict.session.behaviors.UXSetUser = function(pRecord)\n\t\t\t{\n\t\t\t};\n\n\t\t\t// Set the user interface to a non-logged-in state after a logout action\n\t\t\t_Pict.session.behaviors.UXClearUser = function()\n\t\t\t{\n\t\t\t};\n*/\n\t\t\t// Force Betty to login...\n\t\t\t_Pict.session.Login('Betty','Betty');\n\n\t\t\tvar oBundleController = (\n\t\t\t{\n\t\t\t});\n\n\t\t\treturn oBundleController;\n\t\t}",
"title": ""
}
] | [
{
"docid": "101fff771950b3831821a1ad03bf29c0",
"score": "0.68685466",
"text": "initialize() {\n console.log('app initialize');\n AppView.initialize();\n this.runApplication();\n }",
"title": ""
},
{
"docid": "26431b695bb4703be0d6d576632c0ec5",
"score": "0.67601705",
"text": "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n if(urlParams.mobileBreakPoint){\n try{\n var bp = parseInt(urlParams.mobileBreakPoint, 10);\n jimuConfig.breakPoints[0] = bp;\n }catch(err){\n console.error('mobileBreakPoint URL parameter must be a number.', err);\n }\n }\n\n if(urlParams.mode){\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n }\n //the order of initialize these managers does mater because this will affect the order of event listener.\n DataManager.getInstance(WidgetManager.getInstance());\n FeatureActionManager.getInstance();\n SelectionManager.getInstance();\n DataSourceManager.getInstance();\n FilterManager.getInstance();\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId,\n urlParams: urlParams\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n //load this module here to make load modules and load app parallelly\n require(['dynamic-modules/preload']);\n }",
"title": ""
},
{
"docid": "d4408c31288c72c14d1857390942c1b9",
"score": "0.64989096",
"text": "function init() {\n _app2.default.init.apply(_app2.default, arguments);\n}",
"title": ""
},
{
"docid": "05d7d284702395b00cd8775642ace3a5",
"score": "0.6463363",
"text": "function _initial_setup_app_init(){\n\t\t\t//initial setup config of our App\n\t\t\tneatFramework.utils_module_disable_context_menu(); // disable the context menu on all devices (desktop | mobile)\n\t\t\tneatFramework.utils_module_get_device_type(); // get current browsing device type\n\t\t\tneatFramework.utils_module_support_fullscreen(); // check if the current browsing device support fullscreen\n\t\n\t\t\tneatFramework.utils_module_support_history_api();\n\t\t\t//debug\n\t\t\tneatFramework.utils_module_read_current_history_stack();\n\t\n\t\t\t//ios specific parts of the init\n\t\t\tneatFramework.iOS_module_handle_standalone_status_bar_spacer();\n\t\t\tneatFramework.iOS_module_handle_fullscreen_support();\n\t\t\tneatFramework.iOS_module_disable_elastic_scrolling();\n\t\t\tneatFramework.iOS_module_setup_custom_scroll('longHeightContent');\n\t\t}",
"title": ""
},
{
"docid": "2400424013239b4b3d2bd9b60d6e3854",
"score": "0.6436361",
"text": "initializeApp() {\n\t\t// get all cofigurations loaded\n\t\ttry {\n\t\t\t// initialize app services\n\t\t\tthis.initializeAppServices();\n\n\t\t\t// creates the main window\n\t\t\tthis.createMainWindow();\n\n\t\t\t// subscribe to the system preferences\n\t\t\tif (this.isMac) {\n\t\t\t\tsystemPreferences.subscribeNotification(\n\t\t\t\t\t'AppleInterfaceThemeChangedNotification',\n\t\t\t\t\tfunction theThemeHasChanged() {\n\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t'The theme has been changed to ' +\n\t\t\t\t\t\t\t\tsystemPreferences.isDarkMode()\n\t\t\t\t\t\t\t\t? 'dark'\n\t\t\t\t\t\t\t\t: 'light'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\tthrow error;\n\t\t}\n\t}",
"title": ""
},
{
"docid": "e408007893ed552bfb712b66f68de3c3",
"score": "0.6362886",
"text": "function initApp()\n{\n var app = new App();\n}",
"title": ""
},
{
"docid": "5151e817a0146c10f931bf50a9053dca",
"score": "0.63276076",
"text": "function _initApp(){\n\t\t\tconsole.log('[ app_logic.js ] : ' + 'initiating app ..'); // debug message > app is launching\n\t\t\t_check_modules(); // check if the necessary modules are present\n\t\t\t_initial_setup_app_init(); // actually init the app's 'initial setup' config/params (..)\n\t\t\t\n\t\t}",
"title": ""
},
{
"docid": "2eb19c58008058e277bddc7fad28a25b",
"score": "0.6300392",
"text": "function init() {\n\t\trotateText();\n\t\tconsole.log('app init');\n\t\tsetupDimensions();\n\t\tmirrorVideo();\n\t\tinitCapture();\n\t\tupdate();\n\n\t\t\n\t}",
"title": ""
},
{
"docid": "10dad84ff6d6c624eec2425261b35843",
"score": "0.6287155",
"text": "setBundle(bundle){\n this.bundle = bundle;\n }",
"title": ""
},
{
"docid": "f1655e090abb82e36b110b55ac5d8d6e",
"score": "0.6282915",
"text": "function initializeApp() {\n setUpEventHandlers();\n}",
"title": ""
},
{
"docid": "cf3b8f7818af323f5d37444574a29c71",
"score": "0.6253562",
"text": "function initializeApp() {\n registerButtonHandlers();\n}",
"title": ""
},
{
"docid": "35c662d7accb54a45e2223cc13c42f37",
"score": "0.6129442",
"text": "function initApp() {\r\n initviewPort();\r\n}",
"title": ""
},
{
"docid": "3c1a7344040d1cea183c071aab90ea9b",
"score": "0.610529",
"text": "initializing() {\n this.log('Mobile app assimilation process has begun');\n }",
"title": ""
},
{
"docid": "8b538810b4f90a630c6c3dfb1a56545a",
"score": "0.60551095",
"text": "function init() {\n\tconsole.log('Init app.');\n\n\tvar apiReady = function(eventObj) {\n\t\tif (eventObj.isApiReady) {\n\t\t\tconsole.log('API is ready');\n\n\t\t\tattachUiHandlers();\n\n\t\t\tgapi.hangout.data.onStateChanged.add(function(eventObj) {\n\t\t\t\tupdateStateUi(eventObj.state);\n\t\t\t});\n\n\t\t\tgapi.hangout.onApiReady.remove(apiReady);\n\t\t}\n\t};\n\n\t// This application is pretty simple, but use this special api ready state\n\t// event if you would like to any more complex app setup.\n\tgapi.hangout.onApiReady.add(apiReady);\n}",
"title": ""
},
{
"docid": "491fb6240e503ae8a5e662912133d66a",
"score": "0.6005645",
"text": "function init() {\n jQuery.sap.log.debug(\"BootstrapPlugin - module loaded\");\n\n loadMessageBundleResources();\n //navigation to fiori app\n function navigate() {\n var oCrossAppNavigator;\n try {\n if (sap.ushell && sap.ushell.services && sap.ushell.services.AppConfiguration) {\n oCrossAppNavigator = sap.ushell.Container.getService(CROSS_APP_NAV_SERVICE);\n oCrossAppNavigator.toExternal({\n target: {\n semanticObject: semanticObjectName,\n action: actionName\n }\n });\n }\n } catch (e) {\n return undefined;\n }\n }\n\n /*global jQuery, sap, localStorage, window */\n var oRendererExtensions = jQuery.sap.getObject(RENDERERS_PREFIX + '.RendererExtensions');\n\n function applyRendererExtensions() {\n //if role name have the permissions\n\n jQuery.sap.log.debug(BOOTSTRAP_PLUGIN_SUCCEED_MSG);\n\n if (!oRendererExtensions) {\n oRendererExtensions = jQuery.sap.getObject(RENDERERS_PREFIX + '.RendererExtensions');\n }\n\n if (oRendererExtensions) {\n oRendererExtensions.addOptionsActionSheetButton(new sap.m.Button({\n tooltip: getString(\"invite_action_menu_btn_tooltip\"),\n text: getString(\"invite_action_menu_btn\"),\n icon: \"sap-icon://group\",\n press: function () {\n navigate();\n }\n }).addStyleClass('actionSheetButton'));\n } else {\n jQuery.sap.log.error(BOOTSTRAP_PLUGIN_FAILED_MSG);\n }\n }\n\n // the module could be loaded asynchronously, the shell does not guarantee a loading order;\n // therefore, we have to consider both cases, i.e. renderer is loaded before or after this module\n if (oRendererExtensions) {\n // fiori2 renderer already loaded, apply extensions directly\n applyRendererExtensions();\n }\n }",
"title": ""
},
{
"docid": "83f00c1e185c982bc88e6bb91e99aaad",
"score": "0.59653413",
"text": "init () {\r\n /**\r\n * This function will be called during the loading of Scenes.\r\n * You can implement this method to act on this event.\r\n */\r\n }",
"title": ""
},
{
"docid": "9b2b488f9acd2627cddb3d68e502f274",
"score": "0.59465146",
"text": "initializeAppServices() {\n\t\t// initializes menu handler\n\t\tthis.menuHandler = new MenuManagerService(Menu, app);\n\n\t\t// initialize app manager service\n\t\tthis.appManager = new AppManagerService({\n\t\t\tapp: app,\n\t\t\tdebugMode: true,\n\t\t\tmenuManager: this.menuHandler,\n\t\t});\n\t}",
"title": ""
},
{
"docid": "6e7c37b60f95e51ecfc43d2012149433",
"score": "0.59439695",
"text": "function init() {\r\n\t\tvar app = air.NativeApplication.nativeApplication;\r\n\t\t\r\n\t\t// @instantiate the cache\r\n\t\tvar appID = app.applicationID;\r\n\t\tvar uid = appID.replace(/[\\W_\\.]/g, '-'); \r\n\t\tcache = new Cache(uid);\r\n\t\t\r\n\t\t// @subscribe to 'exiting' event in order to flush cache to disk\r\n\t\tvar exitHandler = function() {\r\n\t\t\tapp.removeEventListener(air.Event.EXITING,\r\n\t\t\t\texitHandler);\r\n\t\t\tcache.flush();\r\n\t\t}\r\n\t\tapp.addEventListener(air.Event.EXITING, exitHandler);\r\n\t}",
"title": ""
},
{
"docid": "9df52bf1cfa9b6a59d9ac9b42e42f72e",
"score": "0.59307206",
"text": "function initializeBundles(options) {\n var bundles = Graft.request('bundle:defaults');\n Graft.execute('wait', buildBundles(bundles));\n}",
"title": ""
},
{
"docid": "c691719ed1b1b3f660e0cfe1e9e464f3",
"score": "0.5898208",
"text": "function initializeApp(){\n\n initializeLocalStorage();\n displayBooks();\n initializeRemove();\n\n}",
"title": ""
},
{
"docid": "3cb996805b67d0155b39773c333c43d2",
"score": "0.58646756",
"text": "function initializeApp(){\r\n \r\n createCardsOnTableGame();\r\n applyEventHandlersToDom();\r\n resetGame();\r\n displaytIntroModal();\r\n \r\n \r\n}",
"title": ""
},
{
"docid": "7a5ea7b3d10de6a430ff1b5fe23c6d1b",
"score": "0.58573663",
"text": "bundle() {\n return Build.build(this)\n .then(this.loadConfig.bind(this))\n .catch(Debug.propagate(\"Error bundling app: \"));\n }",
"title": ""
},
{
"docid": "bd96327c4870cccf8c05cb2d5fc0126b",
"score": "0.5830637",
"text": "function init_app() {\n var manager = new imgManager([\"./img/asteroid.png\", \"./img/space.png\", \"./img/sky.png\"], start);\n //console.log(manager);\n manager.init();\n //console.log(manager);\n}",
"title": ""
},
{
"docid": "a642be13b4be5bcf926e9e6a33d08873",
"score": "0.58305806",
"text": "async function initialize() {\n process.on('uncaughtException', criticalErrorHandler.processUncaughtExceptionHandler.bind(criticalErrorHandler));\n global.willAppQuit = false;\n\n // initialization that can run before the app is ready\n initializeArgs();\n await initializeConfig();\n initializeAppEventListeners();\n initializeBeforeAppReady();\n\n // wait for registry config data to load and app ready event\n await Promise.all([\n app.whenReady(),\n ]);\n\n // no need to continue initializing if app is quitting\n if (global.willAppQuit) {\n return;\n }\n\n // initialization that should run once the app is ready\n initializeInterCommunicationEventListeners();\n initializeAfterAppReady();\n}",
"title": ""
},
{
"docid": "28f194cd867d89986e81c24341d9443e",
"score": "0.5805331",
"text": "function initAppUI () {\n\t\tTi.API.info(\"init application UI\");\n\t\tvar tabGroup = createApplicationTabGroup(),\n\t\t currentUser = acs.currentUser();\n\t\tFlurry.logEvent('initAppUIforCurrentUser', {'username': currentUser.username, 'email': currentUser.email});\n\t\taddFashionistTabs(tabGroup);\t\n\t}",
"title": ""
},
{
"docid": "61cc3d6b2e12b6a6e40bff3ebad3d581",
"score": "0.57887274",
"text": "function init() {\n params = app.params;\n util = app.util;\n log = new app.Log('photoMetadata');\n PhotoItem = app.PhotoItem;\n PhotoGroup = app.PhotoGroup;\n log.d('init', 'Module initialized');\n }",
"title": ""
},
{
"docid": "df291c484d49659b186fabb10ac15a39",
"score": "0.5778214",
"text": "function initApp() {\n document.getElementById('audio').addEventListener(\"ended\", $scope.audioHandler);\n getProviders();\n getUnheardNotifications();\n getSettings(clientId, defaultSettings);\n }",
"title": ""
},
{
"docid": "0f672ab52059f966e6bd5c2607397286",
"score": "0.57780224",
"text": "function initiate_ai_app_from_React(){\n\n\n\t\t\n\t}",
"title": ""
},
{
"docid": "2e8c0b473e3ade124ec57cd19c14543b",
"score": "0.57658607",
"text": "function applicationLoaded() {\n observeEvents();\n }",
"title": ""
},
{
"docid": "4a710811d0d72ef5f2251705fdf6f488",
"score": "0.5706048",
"text": "async function init() {\n await banner.displayBanner();\n await app();\n}",
"title": ""
},
{
"docid": "0bb815f20944016542a5b9d8e990a6a3",
"score": "0.5699022",
"text": "function init() {\n\t\t\t// init code here\n\t\t}",
"title": ""
},
{
"docid": "0bb815f20944016542a5b9d8e990a6a3",
"score": "0.5699022",
"text": "function init() {\n\t\t\t// init code here\n\t\t}",
"title": ""
},
{
"docid": "f87fef4c1a3ce7155637b5af0c901b9b",
"score": "0.5690764",
"text": "function init_launcher () {\n\t\t\n\t\t_Launcher = main.get_asset_data( \"assets/modules/sections/Launcher.js\" );\n\t\t\n\t\tset_section( _Launcher );\n\t\t\n\t}",
"title": ""
},
{
"docid": "8e68d604c4259417ac818ac4d66ddd5f",
"score": "0.56902736",
"text": "static initialize() {\n this.registerPlugins(Imported);\n this._checkRequirements();\n }",
"title": ""
},
{
"docid": "2a440200314cc7adcbd0ac8b4f4396b2",
"score": "0.56830984",
"text": "function initBackboneApp(){\n\n\t// Collections\n\tUsers = new Users();\n\tSquares = new Squares();\n\n\t// App wrapper\n\tappview = new AppView({ num: 150 });\n}",
"title": ""
},
{
"docid": "58fe3c32bc9c81da0922eafc35d6fa5c",
"score": "0.5677553",
"text": "function init() {\n // Set listeners\n _setDocumentManagerListeners();\n _setViewManagerListeners();\n\n // Initialize viewmanager\n ViewManager.init();\n }",
"title": ""
},
{
"docid": "6281e1c2e8a5a8d9c2d9242139885de4",
"score": "0.56676865",
"text": "function ITSA_App() {\n ITSA_App.superclass.constructor.apply(this, arguments);\n}",
"title": ""
},
{
"docid": "a8e7bcecf4e8ba4be16d67864d69fdec",
"score": "0.5661787",
"text": "function init() {\n params = app.params;\n util = app.util;\n app.Log.initStaticFields();\n log = new app.Log('index');\n\n log.d('init');\n\n util.init();\n\n util.listen(window, 'load', onDocumentLoad);\n }",
"title": ""
},
{
"docid": "a8e7bcecf4e8ba4be16d67864d69fdec",
"score": "0.5661787",
"text": "function init() {\n params = app.params;\n util = app.util;\n app.Log.initStaticFields();\n log = new app.Log('index');\n\n log.d('init');\n\n util.init();\n\n util.listen(window, 'load', onDocumentLoad);\n }",
"title": ""
},
{
"docid": "75e840e7f4866befb60f6b0e4bccae82",
"score": "0.5659857",
"text": "constructor() {\n\t\tthis.mainWindow = null;\n\t\tthis.messageService = null;\n\t\tthis.menuHandler;\n\t\tthis.appManager;\n\n\t\tthis.isMac = process.platform === 'darwin';\n\n\t\t//register async initialization of the application window.\n\t\tapp.on('ready', () => {\n\t\t\tthis.initializeApp();\n\t\t});\n\n\t\tapp.on('window-all-closed', () => {\n\t\t\tapp.quit();\n\t\t});\n\t}",
"title": ""
},
{
"docid": "2ffecdbb22580030d4e09b785b5b9d49",
"score": "0.5653246",
"text": "constructor(){\n\n console.log(\"(1) Initializing Application\");\n\n\n\n // Initialize and pass application referance\n this.Controller = new Controller(this);\n this.Model = new Model(this);\n this.unitTester = new unitTester(this);\n\n this.id = \"CurrTrackerV5.1 Launch Application\";\n console.log(\"App Reference: \" + this.id);\n }",
"title": ""
},
{
"docid": "d2d651f24732cbe197542af6be0bfe64",
"score": "0.56422144",
"text": "async function loadApp() {\n await setupApp();\n}",
"title": ""
},
{
"docid": "8facded132e7651a116b6bc6ed2b6cea",
"score": "0.563117",
"text": "function app_init() {\n\n\t\tvar tid;\n\n\t\ttid = setInterval( function() {\n\t\t\t// all files loaded?\n\t\t\tif (bucket.templates.loaded == bucket.templates.list.length && bucket.data.ready) {\n\t\t\t\tclearInterval(tid);\n\t\t\t\tapp_run();\n\t\t\t}\n\t\t}, 50);\n\t}",
"title": ""
},
{
"docid": "fd914e6fa307df3313d9a080bb6d344a",
"score": "0.56237996",
"text": "_init() {\n if (this._initialized === undefined) {\n this._initialized = false;\n }\n if (this._initialized) return;\n this._initialized = true;\n\n // Note that the application's container (this.fwk_app_container) object (JQuery) comes\n // from the base class\n let html = `\n<p>This is a placeholder for application <span class=\"fwk-test-app-name\">`+this.fwk_app_name+`</span></p>`;\n this.fwk_app_container.html(html);\n }",
"title": ""
},
{
"docid": "e0a610a346a3d9db747005ea1a01fffd",
"score": "0.5621348",
"text": "init() {\r\n if (!this.initCalled) {\r\n this.initCalled = true;\r\n this.configure();\r\n }\r\n }",
"title": ""
},
{
"docid": "9445e51fa2b2ad0c8f0e9bacaf071c08",
"score": "0.5611138",
"text": "function Start() {\n console.log(\n `%c App Initializing...`,\n \"font-weight: bold; font-size: 20px;\"\n );\n\n Contacts = [];\n\n Main();\n }",
"title": ""
},
{
"docid": "76ccc1bd25909a83d573f7e0c458fecf",
"score": "0.56101096",
"text": "initialize() {\n _socketIO.initialize();\n _socketIO.subscribe(this.handleSocketMessage.bind(this));\n\n _appView.initialize();\n _appStore.initialize();\n _appStore.subscribe(this.reactToStoreMutation.bind(this));\n\n // will call runapp on load\n this.fetchQuestions();\n }",
"title": ""
},
{
"docid": "1656d9279d4e405c8ea66e9a56103800",
"score": "0.56093526",
"text": "async function init () {\n if (!config.dryRun) {\n generator(location, config.destination);\n location = path.resolve(config.destination);\n }\n\n let content = fs.readFileSync(path.join(location, 'package.json'), {encoding: utf});\n let packageJson = JSON.parse(content);\n\n _app.appname = packageJson.name;\n _app.version = packageJson.version;\n _app.path = location;\n _app.main = utils.entryPoint(location, packageJson.main);\n\n if (config.seeds.length === 0) {\n if (!_app.main) {\n throw new Error(\"NO_ENTRY_POINT\");\n }\n entries.push(path.join(_app.path, _app.main));\n } else {\n for (let seed of config.seeds) {\n let s = utils.entryPoint(location, seed);\n if (s) {\n entries.push(path.join(location, seed));\n } else {\n console.error(chalk.default.red(`Can not find ${seed} in ${location}`));\n }\n }\n }\n if (packageJson.dependencies) {\n _app.declaredDependencyCount = Object.keys(packageJson.dependencies).length;\n let packageLock = path.join(location, 'package-lock.json');\n if (fs.existsSync(packageLock)) {\n content = fs.readFileSync(path.join(location, 'package-lock.json'), {encoding: utf});\n packageJson = JSON.parse(content);\n packageDependencies.installedPackages(packageJson, _app.dependencies);\n _app.installedUniqueDependencyCount = Object.keys(_app.dependencies).length;\n for(let i in _app.dependencies) {\n _app.installedTotalDependencyCount += _app.dependencies[i].length;\n }\n }\n }\n\n}",
"title": ""
},
{
"docid": "1fc43b65d56e40483d6aef9722901966",
"score": "0.560716",
"text": "function init() {\n\n\t\t// Check if on mobile\n\t\tif (global.innerWidth <= 1000) {\n\t\t\tmobile = true;\n\t\t}\n\n\t\t// Load tutorials\n\t\tm.request({\n\t\t\tmethod: 'GET',\n\t\t\turl: 'config/tutorials.json',\n\t\t}).then(function (data) {\n\t\t\ttutorials = data;\n\t\t\tloaded = true;\n\t\t});\n\n\t\t// Load i18n strings\n\t\tlanguages.forEach(function (lang) {\n\t\t\tm.request({\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: `config/i18n/${lang}.json`\n\t\t\t}).then(function (data) {\n\t\t\t\tstrings[lang] = data;\n\t\t\t});\n\t\t});\n\n\t\t// Configure routes\n\t\tm.route(root, '/', {\n\t\t\t'/': HomeView,\n\t\t\t'/learn/:id': PlaygroundView,\n\t\t\t'/play/:simulator': PlaygroundView\n\t\t});\n\n\t}",
"title": ""
},
{
"docid": "f7661ec05e26dd375a891d558831b1be",
"score": "0.5588034",
"text": "initSliderVariablesApp(){\n super.initSliderVariablesApp();\n\n\n this._initAppVariable(\"Speed\", 1);\n this._initAppVariable(\"Gravity\", 1);\n }",
"title": ""
},
{
"docid": "5cc3b942bdf41b93336061f81e88bb56",
"score": "0.55875045",
"text": "function start(appSetup, appConfig, cb) {\n var app = Oskari.app;\n \n \n \n \n\n app.setApplicationSetup(appSetup);\n app.setConfiguration(appConfig);\n app.startApplication(function(startupInfos) {\n var instance = startupInfos.bundlesInstanceInfos.mapfull.bundleInstance;\n if(cb) {\n cb(instance);\n }\n });\n }",
"title": ""
},
{
"docid": "e1e97e36a851ece202198ec1f14de714",
"score": "0.55836517",
"text": "function initApp() {\n bb.pushScreen('href.html', 'href');\n}",
"title": ""
},
{
"docid": "675b86c3b57020f644c7ad2415f81a60",
"score": "0.558342",
"text": "async function AppStartup () {\n if (!ISO.isDebug) {\n global.__static = path.join(__dirname, '/static').replace(/\\\\/g, '\\\\\\\\')\n }\n\n ISO.processType = ProcessTypes.MAIN\n ISO.session = SessionUtils.take()\n // console.log('appSession', ISO.appSession)\n await app.whenReady()\n Flynn._.registFacade(MainFacade.getInstance(), configMain)\n Flynn._.unhandled.init()\n emit(AppEvents.MAIN_APP_READY)\n}",
"title": ""
},
{
"docid": "135cdb4bc57a6db56cd4a354008c0334",
"score": "0.5565117",
"text": "function initializeResources() {\n for (var resourceType in global.AppResources) {\n if (global.AppResources.hasOwnProperty(resourceType)) {\n var appResourceType = global.AppResources[resourceType];\n for (var resource in appResourceType) {\n if (appResourceType.hasOwnProperty(resource)) {\n global.Resources.load(appResourceType[resource]);\n }\n }\n }\n }\n }",
"title": ""
},
{
"docid": "db645e74e1b13d752013f4209beae8b2",
"score": "0.5552152",
"text": "static main() {\r\n\t\tthis.init();\r\n\t}",
"title": ""
},
{
"docid": "ef68f884f42c36b9e16930986220e4bd",
"score": "0.5550369",
"text": "function main() {\n console.log(\"Starting main\");\n appState.initializeState();\n\n\n}",
"title": ""
},
{
"docid": "8fc8e466b4ec1513a2be5a34ed5ada74",
"score": "0.55449903",
"text": "function onEventBridgeReady() {\n ui.sendMessage({\n app: APP_NAME,\n method: \"initializeUI\",\n data: {}\n });\n }",
"title": ""
},
{
"docid": "148d3958a7cc25027a17f29581507e22",
"score": "0.5543521",
"text": "function init() {\n \t\t\tdemobo._sendToSimulator('setData', {\n \t\t\t\tkey : 'url',\n \t\t\t\tvalue : location.href\n \t\t\t});\n \t\t\tdemobo.setController({\n \t\t\t\turl : ui.controllerUrl,\n \t\t\t\torientation : 'portrait'\n \t\t\t});\n \t\t\t// your custom demobo input event dispatcher\n \t\t\tdemobo.mapInputEvents({\n \t\t\t\t'demoboApp' : onReady,\n \t\t\t\t'outgoingCall' : outgoingCall,\n \t\t\t\t'acceptIncomingCall' : acceptIncomingCall,\n \t\t\t\t'declineIncomingCall' : declineIncomingCall,\n \t\t\t\t'gotoUrl' : gotoUrl\n \t\t\t});\n \t\t\tinitializeIncomingCall();\n preloadRingtone();\n \t\t}",
"title": ""
},
{
"docid": "351b380399605d8c46498c15c5aef0a4",
"score": "0.5529965",
"text": "function initializeObjects() {\n appcontrol=new Appcontrol(); //Construct the AppControl which in turn will start the Main Control.\n\n hotkey=new Hotkey();\n menuobjects[menuobjects.length]=hotkey;\n\n menubar=new Menubar(document.getElementById('menubar'));\n menuobjects[menuobjects.length]=menubar;\n\n toolbar=new Toolbar(maindoc.getElementById('toolbar'));\n menuobjects[menuobjects.length]=toolbar;\n\n popup=new Popup(maindoc.getElementById('popup'));\n menuobjects[menuobjects.length]=popup;\n\n // Now that we are done creating all the objects, start the application\n appcontrol.dyn=document.getElementById('app').getAttribute('dyn');\n if(!appcontrol.dyn) appcontrol.dyn='';\n window.run(); // Start the run\n apph.action('prg.'+appcontrol.startprog); // Start the default page after initialization\n}",
"title": ""
},
{
"docid": "e2a29829010b1aa6df4ab57588dee042",
"score": "0.55224246",
"text": "onLoad(){\n this.initEventHandlers();\n this.initView();\n }",
"title": ""
},
{
"docid": "18885ac877f1208b9d6efdb185dc1b02",
"score": "0.5511465",
"text": "function init() {\n new DeploymentBuilder(process.cwd())\n .addDefaultAppResources(join(__dirname, 'default-app'))\n .addDefaultLayer0Scripts();\n}",
"title": ""
},
{
"docid": "674de4f2b412d5b93c0af6add1fe88f3",
"score": "0.55058116",
"text": "function _init() {\n /* Init... */\n }",
"title": ""
},
{
"docid": "4e4ceb55dbfe1e95ae50a49390008cf8",
"score": "0.55012876",
"text": "function initRandApp()\n\t{\n\t\t// Pseudorandom number generator (PRNG)\n\t\trandApp = new RandApp(\n\t\t\t{\n\t\t\t\t\"seed\":1,\n\t\t\t\t\"distribution\":\"uniform\",\n\t\t\t\t\"persistentSeed\":false\n\t\t\t}\n\t\t);\n\t}",
"title": ""
},
{
"docid": "b0d694e8176e25ce82294161d1b87d05",
"score": "0.5492045",
"text": "function initializeMobileFabricInAppInit() {\n kony.print(\" ########## Entering into initializeMobileFabricInAppInit ########## \");\n if (kony.net.isNetworkAvailable(constants.NETWORK_TYPE_ANY)) {\n kony.application.showLoadingScreen(\"loadskin\", \"Initializing the app !!!\", constants.LOADING_SCREEN_POSITION_FULL_SCREEN, true, true, {\n enableMenuKey: true,\n enableBackKey: true,\n progressIndicatorColor: \"ffffff77\"\n });\n mobileFabricConfiguration.konysdkObject = new kony.sdk();\n mobileFabricConfiguration.konysdkObject.init(mobileFabricConfiguration.appKey, mobileFabricConfiguration.appSecret, mobileFabricConfiguration.serviceURL, initializeMobileFabricInAppInitSuccess, initializeMobileFabricFailure);\n } else alert(\"Network unavailable. Please check your network settings. \");\n kony.print(\" ########## Exiting out of initializeMobileFabricInAppInit ########## \");\n}",
"title": ""
},
{
"docid": "99f2d1dede193b645ff306e818b55eb9",
"score": "0.5491472",
"text": "function InitApplication() {\n DataExtFullTextSearchCtrl.ePage.Masters.Application = {};\n DataExtFullTextSearchCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }",
"title": ""
},
{
"docid": "8e2dafa480a3213ce80c2c9ad2f10d2e",
"score": "0.54914075",
"text": "function init(bundle, parent, options = {}) {\n const r360 = new ReactInstance(bundle, parent, {\n // Add custom options here\n fullScreen: true,\n ...options,\n });\n\n const location = new Location([0, 1, -1]);\n\n r360.renderToLocation(\n r360.createRoot('VrScene'),\n location,\n r360.getDefaultLocation(),\n );\n\n r360.compositor.setBackground(r360.getAssetURL('360_world.jpg')); \n}",
"title": ""
},
{
"docid": "5dee3ceaa86fed75bc108d5a1215b8d2",
"score": "0.5484213",
"text": "function setupApp() {\n appState.LAST_NOTIFICATION_TEXT = '';\n appState.UNREAD_EMAILS_TOTAL = getUnreadEmailsTotal();\n appState.LAST_NOTIFICATION_ID = getNotificationId();\n\n debug(`appState.LAST_NOTIFICATION_TEXT: ${appState.LAST_NOTIFICATION_TEXT}`);\n debug(`appState.UNREAD_EMAILS_TOTAL: ${appState.UNREAD_EMAILS_TOTAL}`);\n debug(`appState.LAST_NOTIFICATION_ID: ${appState.LAST_NOTIFICATION_ID}`);\n\n // configuration of the observer:\n const observerConfig = {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n };\n\n // target\n const observerTarget = getFoldersTree();\n\n // init\n initObserver(observerTarget, observerConfig);\n }",
"title": ""
},
{
"docid": "bfb842d60a3049bb5654d25d58c4e12f",
"score": "0.5476105",
"text": "constructor() {\n //Called once, it is the right place to initialize the properties in this class\n super(); //Calls the constructor of its parent class\n console.log(\"App - Constructor\");\n }",
"title": ""
},
{
"docid": "e4f172576984c0705e20b3ab45250365",
"score": "0.54721844",
"text": "function init(){\n \n }",
"title": ""
},
{
"docid": "1c222fdd03f61f1ffc062487d7941fc6",
"score": "0.54602605",
"text": "function main() {\n\t \"use strict\";\n\t\n\t var app = (0, _app2.default)();\n\t\n\t app.init();\n\t m.mount(document.body, app.widgets);\n\t}",
"title": ""
},
{
"docid": "24706472f9adf431c7a547aa2d5e40ae",
"score": "0.5458038",
"text": "init() {\n this.createView();\n }",
"title": ""
},
{
"docid": "60fe6fa564554467b3e707685ef29ebf",
"score": "0.5456633",
"text": "function init() {\n // Quit if this function has already been called\n if (arguments.callee.done)\n return;\n \n // Flag this function so we don't do the same thing twice\n arguments.callee.done = true;\n \n // kill the timer\n if (_timer)\n {\n clearInterval(_timer);\n _timer = null;\n }\n\n // Create the app and get things rolling\n theApp = new iLike.App();\n}",
"title": ""
},
{
"docid": "c375526b2b536b96fc911b772581f59b",
"score": "0.54485875",
"text": "constructor() {\n this.init();\n }",
"title": ""
},
{
"docid": "b51f42ef57418a469b949c645c1e6788",
"score": "0.5439138",
"text": "function _init() {\r\n\t\t\t// activate controller\r\n\t\t\t_activate();\r\n\t\t}",
"title": ""
},
{
"docid": "168c79a03e3607c99e04ab31487eecc5",
"score": "0.5432829",
"text": "Init(){}",
"title": ""
},
{
"docid": "168c79a03e3607c99e04ab31487eecc5",
"score": "0.5432829",
"text": "Init(){}",
"title": ""
},
{
"docid": "39462f5db0da540af15fed218eb79d8f",
"score": "0.542811",
"text": "constructor() {\n // initialize after construction\n this.init();\n }",
"title": ""
},
{
"docid": "9ae6df74733dfcb0147d840f7df5dfc4",
"score": "0.54235864",
"text": "Initialize(InInitializeCompletedHandler)\n {\n this.assetMaps = new Map();\n this.resConfigPath = Config.resPath;\n this.uiConfigPath = Config.uiPath;\n // Load resource config file.\n cc.loader.loadRes(this.resConfigPath,cc.JsonAsset,(InError,InJsonAsset)=>{\n if(InError){\n cc.error(\"can not load resource config file: \"+ InError);\n return;\n }\n this.configs = InJsonAsset.json;\n for(let _key in this.configs){\n this.assetMaps.set(_key,new Map());\n }\n\n // Initialize basic resources...\n this.loadResDirByKeyAsync(\"persistence\",function(){\n this.loadResDirByKeyAsync(cc.director.getScene().name,InInitializeCompletedHandler);\n }.bind(this));\n });\n }",
"title": ""
},
{
"docid": "ccd561c39152cbf1ebe5c3956f144910",
"score": "0.5420678",
"text": "function BundleLoader() {\n\t\t// Already loaded loaders\n\t\tthis.loaders = { };\n\t}",
"title": ""
},
{
"docid": "30acf30a9303d8fb00750ad359e4c163",
"score": "0.5416082",
"text": "function init(options) {\r\n AppConfig = EU.Utility.extend(AppConfig, options);\r\n //console.log(AppConfig);\r\n EU.CookiePreferenceUI.setup(options);\r\n }",
"title": ""
},
{
"docid": "0b26d21ef4e13ade6f11a3e31dc64a32",
"score": "0.5413091",
"text": "function initialize(instance) {\n const service = instance.lookup('service:asset-loader');\n service.pushManifest(_assetManifest.default);\n }",
"title": ""
},
{
"docid": "69bdd5f0923b5d047f264ce1bdf1083d",
"score": "0.54047",
"text": "constructor() {\n super();\n Global.init(this._stage);\n Global.assetManager.onComplete(this.OnAssetLoad, this);\n Global.assetManager.load();\n }",
"title": ""
},
{
"docid": "a417249397370e0dd08d98ad2f5cb444",
"score": "0.5402902",
"text": "function Start() {\n console.log(\n `%c App Initializing...`,\n \"font-weight: bold; font-size: 20px;\"\n );\n\n Main();\n }",
"title": ""
},
{
"docid": "c26d9a308aa11ce2f0210f331e0a0090",
"score": "0.539923",
"text": "function init() { }",
"title": ""
},
{
"docid": "fbe1f8a5489630e649ea19e4167d2c89",
"score": "0.53977495",
"text": "initialize()\n {\n this.currentState.initialize();\n }",
"title": ""
},
{
"docid": "000db1fc00f521bf1d909facac83cf87",
"score": "0.53964776",
"text": "init() {\n this.initSystemInfo();\n if (this._state.initComplete) return false;\n this._updateState({\n initComplete: true,\n });\n logger.info('TDAnalytics SDK initialize success, AppId = ' + this.config.appId + ', ServerUrl = ' + this.config.serverUrl + ', Mode = ' + this.config.model + ', DeviceId = ' + this.getDeviceId() + ', Lib = ' + Config.LIB_NAME + ', LibVersion = ' + Config.LIB_VERSION);\n }",
"title": ""
},
{
"docid": "0ce8776542b65a96bbcd7cc88e0173dc",
"score": "0.53879476",
"text": "initApp(rootTag) {\n // retrieve the auth token from the customer-auth-module\n this.getAuthToken((token) => {\n lx.controller.service.authToken = token;\n lx.controller.service.userID = this.getUsername();\n lx.controller.service.tenantID = this.getTenant();\n // overriding the address is only required on test environments\n lx.controller.service.address = this.getLXAddress();\n // required context attribute:\n lx.controller.contextAttributes.set(\"appLocation\", \"Medical Appointment\");\n // optional context attributes:\n lx.controller.contextAttributes.set(\"email\", sessionStorage.getItem('email'));\n lx.controller.contextAttributes.set(\"fullName\", sessionStorage.getItem('fullname'));\n lx.controller.contextAttributes.set(\"phone\", \"N/A\");\n if ( sessionStorage.getItem(\"UserLocation\") == null ) {\n \t\tlx.controller.contextAttributes.set(\"location\", \"Not Defined\");\n \t\t\t } else {\n \t\t\t\tlx.controller.contextAttributes.set(\"location\", sessionStorage.getItem(\"UserLocation\"));\n \t\t\t }\n\n\n // add the Live Experience web component to the page\n lx.controller.addComponent(rootTag);\n });\n }",
"title": ""
},
{
"docid": "820212f77ee8b6da246672e3ddfad0d9",
"score": "0.5383072",
"text": "function init(options) {\n\n AppConfig = EU.Utility.extend(AppConfig, options);\n\n //console.log(AppConfig);\n\n EU.CookiePreferenceUI.setup(options);\n\n }",
"title": ""
},
{
"docid": "1b7185c79440e56ecae742f280d6cd31",
"score": "0.5382034",
"text": "mountApplication() {\n window.spa.signals.emit('app.beforeInit', { app: this });\n\n let storeConstructor = new StoreConstructor(this.views);\n\n window.spa.signals.emit('app.beforeInitStore', { storeConstructor });\n\n let routerConstructor = new RouterConstructor(\n this.views,\n routerMixins.routesComponentsTemplates,\n routerMixins.customRoutesComponentsTemplates,\n );\n\n window.spa.signals.emit('app.beforeInitRouter', { routerConstructor });\n\n let i18n = new VueI18n({\n locale: guiLocalSettings.get('lang') || 'en',\n messages: this.translations,\n silentTranslationWarn: true,\n });\n\n this.application = new Vue({\n mixins: [this.appRootComponent],\n propsData: {\n info: this.api.openapi.info,\n x_menu: this.api.openapi.info['x-menu'],\n x_docs: this.api.openapi.info['x-docs'],\n a_links: false,\n },\n router: routerConstructor.getRouter(),\n store: storeConstructor.getStore(),\n i18n: i18n,\n }).$mount('#RealBody');\n\n window.spa.signals.emit('app.afterInit', { app: this });\n }",
"title": ""
},
{
"docid": "2575cb1631afe72e86c5c9f6b2d12cd6",
"score": "0.53806794",
"text": "async function initialize() {\n let config = load('config', CONFIG_VERSION)\n\n // if native interface is available, allow it to override the config values\n if (global.M2) {\n config = {\n server: global.M2.getPreference('server_hostname'),\n pin: global.M2.getPreference('server_pin'),\n secure: true\n }\n }\n if (config && window.location.pathname !== '/configuration') {\n if (config.ble) {\n config.ble = await getPairedBleDevice()\n if (!config.ble) {\n return renderConfigurationPage()\n }\n }\n renderApp(config)\n }\n else {\n // monkey patch in the configuration screen; pretty lazy, but works\n renderConfigurationPage()\n }\n}",
"title": ""
},
{
"docid": "ab864bfb173193b47db8b989d49e3fcf",
"score": "0.5378735",
"text": "initialize() {\n // Register events\n window.dataManager.eventManager.registerListener('postInitGl', OnPostInitGlListener.handle);\n window.dataManager.eventManager.registerListener('postPlayersRender', OnPostPlayerRender.handle);\n // Register command listeners\n window.dataManager.commandRegistrar.registerCommand('init', new InitCommand());\n window.dataManager.commandRegistrar.registerCommand('getServers', new GetServersCommand());\n window.dataManager.commandRegistrar.registerCommand('getWorlds', new GetWorldsCommand());\n window.dataManager.commandRegistrar.registerCommand('getChunkForPosition', new GetChunkForPositionCommand());\n window.dataManager.commandRegistrar.registerCommand('worldBorderUpdate', new WorldBorderUpdateCommand());\n // Register texture pack for rendering\n window.dataManager.texturePack = new DefaultTexturePack(window.dataManager.canvasElement[0], this.colorObj);\n }",
"title": ""
},
{
"docid": "01506f735694b47e2a615b1d0bc5fb79",
"score": "0.5373746",
"text": "function init() {\n // set Deck for App\n deck.forEach(function(v,i) {\n \tnewDeck.push({\n \t\t'suite': v.suite,\n \t\t'rank': [].concat(v.rank),\n });\n });\n\n // ** start button click event listener\n startBtn.addEventListener( 'click', startApp, false );\n // ** restart button click event listener\n restartBtn.addEventListener( 'click', restartApp, false );\n // ** remove error validation on player field\n playersField.addEventListener( 'change', function() { playersField.classList.remove('is-invalid'); }, false );\n }",
"title": ""
},
{
"docid": "cb70111465f0461fa5d1308e64f28252",
"score": "0.53697556",
"text": "function init () {\n\t\tconsole.log('all is loaded.');\n\t}",
"title": ""
},
{
"docid": "68eedb7f20e08d16efb1cea71cd362ba",
"score": "0.53532803",
"text": "initializing() {\n \n }",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
},
{
"docid": "4213fce23ce5b47c64fb6e401758bed2",
"score": "0.53524625",
"text": "function init() {}",
"title": ""
}
] |
c0109f821e5b9cedf04d553b57ef77b4 | Initializes the model viewer | [
{
"docid": "7dc638b15965b53264e6bb5f9f66e8f9",
"score": "0.5967506",
"text": "function init() \n{\n /**\n * Setting Up the scene: \n * Grabs the model-container div from template into a variable\n * named container, and sets up the scene \n */\n container = document.getElementById('model-container');\n camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 1, 100000);\n camera.position.z = 1000;\n camera.position.x = 1000;\n camera.position.y = 1000;\n \n\n scene = new THREE.Scene();\n \n /**\n * Light up the scene \n */\n \n ambient = new THREE.AmbientLight(0x555555);\n scene.add(ambient);\n directionalLight = new THREE.PointLight(0xaaaaaa);\n directionalLight.position = camera.position;\n scene.add(directionalLight);\n \n /** Axes */\n axes = new THREE.AxisHelper(10000);\n scene.add(axes);\n\n /** Grid */\n grid = new THREE.GridHelper(3000, 100);\n scene.add(grid); \t \n\n /**\n * Loader Managerial tasks\n */\n\n manager = new THREE.LoadingManager();\n manager.onProgress = function(item, loaded, total) \n {\n\tconsole.log(item, loaded, total);\n };\n\n /**\n * Adds the model to the viewer aka loads OBJ files \n * using OBJ-Loader\n */\n\n loader = new THREE.OBJLoader(manager);\n\n /**\n * Adds material to the model, which hence controls \n * how the model shall look \n */\n for (i in objList) {\n\tloader.load( objList[i], function(object) {\n\t var OBJMaterial = new THREE.MeshPhongMaterial({color: 0xeeeeee});\n\t object.traverse(function(child) {\n\t\tif (child instanceof THREE.Mesh) {\n\t\t child.material = OBJMaterial;\n\t\t}\n\t });\n\t object.position.y = 0.1;\n\t object.rotation.z = 90 * Math.PI/180;\n\t object.rotation.x = -90 * Math.PI/180;\n\t scene.add(object);\n\t});\n }\n\n /**\n * If webgl is there then use it otherwise use canvas\n */\n if (Detector.webgl) {\n\trenderer = new THREE.WebGLRenderer({antialias:true});\n } else {\n\trenderer = new THREE.CanvasRenderer(); \n }\n\n /**\n * Sets size and color to renderer\n */\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setClearColor(0x555555, 1); \n container.appendChild(renderer.domElement);\n\n \n /**\n * orbitControls for zoom in/ zoom out and other basic controls\n */\n controls = new THREE.OrbitControls(camera, renderer.domElement);\n controls.addEventListener('change', render); \n\t \n window.addEventListener('resize', onWindowResize, false);\n\n animate();\n\n}",
"title": ""
}
] | [
{
"docid": "0c4d555524335661d3035462f3295bed",
"score": "0.6976872",
"text": "function init() {\n if ($scope.data.generation.selectedModelEntitys == null) {\n if ($scope.data.models.tree) {\n if ($scope.data.models.tree[0]) {\n $scope.data.generation.selectedModel = $scope.data.models.tree[0];\n $scope.changeSelectedModel();\n }\n }\n }\n }",
"title": ""
},
{
"docid": "ec00e8716da9daaab13cc746d789aeea",
"score": "0.68263334",
"text": "constructor(modelMain, viewMain) {\n this.modelMain = modelMain;\n this.viewMain = viewMain;\n\n this.init();\n }",
"title": ""
},
{
"docid": "7e29695fe95753e3048d0648744e7944",
"score": "0.6810737",
"text": "async init() {\n this.handleEventHandlers()\n await this.model.load().then(\n res => {\n if (res) {\n this.setupView(res)\n }\n }\n )\n }",
"title": ""
},
{
"docid": "f4164cba09ed137b0f6c0b19e7ed20b5",
"score": "0.6773013",
"text": "function initView(){\n\n}",
"title": ""
},
{
"docid": "e8bccd239cc50d24e043dcac0e26d1dd",
"score": "0.6772258",
"text": "constructor() {\n\n this.model = new Model();\n this.view = new View(this.model);\n this.controller = new Controller(this.model, this.view);\n this.controller.init();\n\n }",
"title": ""
},
{
"docid": "f05211419c3cee2d5f899722d6aea806",
"score": "0.67090553",
"text": "function initView() {\n initViewMap();\n }",
"title": ""
},
{
"docid": "391cb453942a0034b779b382e1342772",
"score": "0.6666142",
"text": "function init() {\n\n // set VIEW only\n editMode = VIEW;\n\n // render form\n renderForm();\n}",
"title": ""
},
{
"docid": "90a3ae44791fbffcaa83052248b0ba97",
"score": "0.6650543",
"text": "initialize() {\n\t\t\t\tthis.render();\n\t\t\t\tBackbone.View.prototype.initialize.call( this );\n\t\t\t}",
"title": ""
},
{
"docid": "50571c6c7b1074ab7746df21f74a8a59",
"score": "0.6619208",
"text": "initModels(){\n\n\t\tif(!this.enableCollection || this._modelsInitialized) return;\n\n\t\tthis._rebuildModels();\n\n\t\tthis._modelsInitialized = true;\n\n\t}",
"title": ""
},
{
"docid": "50571c6c7b1074ab7746df21f74a8a59",
"score": "0.6619208",
"text": "initModels(){\n\n\t\tif(!this.enableCollection || this._modelsInitialized) return;\n\n\t\tthis._rebuildModels();\n\n\t\tthis._modelsInitialized = true;\n\n\t}",
"title": ""
},
{
"docid": "14e4a36a6c4e9bb23ddaada6554176d8",
"score": "0.6618637",
"text": "init() {\n\n\t\t// Might need to add 'this' etc. later, just pasted from three.js docs\n\t camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );\n\t camera.position.z = 1;\n\t \n\t scene = new THREE.Scene();\n\t \n\t geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );\n\t material = new THREE.MeshNormalMaterial();\n\t \n\t mesh = new THREE.Mesh( geometry, material );\n\t scene.add( mesh );\n\t \n\t renderer = new THREE.WebGLRenderer( { antialias: true } );\n\t renderer.setSize( window.innerWidth, window.innerHeight );\n\t document.body.appendChild( renderer.domElement );\n\t\t\n\t}",
"title": ""
},
{
"docid": "94d1b25ccee80c5a4dc1bab6013d9ad7",
"score": "0.6597804",
"text": "function init(){\n\t\tIncomingView.render({\n\t\t\tmodel : {data : 'Data that will be passed to incoming page'}\n\t\t});\n\t}",
"title": ""
},
{
"docid": "ced3570cd323864d0802cf99b44d9991",
"score": "0.65736574",
"text": "function _initialize()\n {\n // grab a reference to the canvas so we have someplace to draw\n _viewport = document.getElementById('viewport');\n _ctx = _viewport.getContext('2d');\n _canvasTopLeft = VECTOR.create(_viewport.getBoundingClientRect()[\"left\"],\n _viewport.getBoundingClientRect()[\"top\"]);\n _rootpanel = ROOTPANEL.create(_viewport.width, _viewport.height);\n // grab references to the textboxes that display model name and author\n _authorField = document.getElementById('authorField'); \n _nameField = document.getElementById('nameField');\n // set up the events that the UI will listen for\n function genericHandler(e) {\n // convert from client coordinates to canvas coordinates\n var exy = VECTOR.create(e.clientX, e.clientY);\n exy.sub(_canvasTopLeft);\n // pass along event\n _rootpanel.signal(e, exy);\n };\n function scrollHandler(e) {\n _canvasTopLeft = VECTOR.create(_viewport.getBoundingClientRect()[\"left\"],\n _viewport.getBoundingClientRect()[\"top\"]);\n }\n _viewport.onmousedown = genericHandler;\n _viewport.onmousemove = genericHandler;\n _viewport.onmouseup = genericHandler;\n window.onscroll = scrollHandler;\n _authorField.oninput = _updateAuthor;\n _nameField.oninput = _updateModelname;\n }",
"title": ""
},
{
"docid": "5ba0c71ef69a049a423f74560966cdda",
"score": "0.6567251",
"text": "function initialize() {\n\n svg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"position\",\"absolute\").attr(\"class\",\"vizuly\");\n defs = vizuly.util.getDefs(viz);\n g = svg.append(\"g\").attr(\"class\",\"vz-scroller-ui\");\n scroll = g.append(\"rect\").attr(\"class\",\"vz-scroller\");\n\n viz.on(\"zoom_change\",attachZoomHandler);\n\n // Tell everyone we are done initializing\n scope.dispatch.initialize();\n }",
"title": ""
},
{
"docid": "dd874df5e9dca2e4a47cc996e95bd814",
"score": "0.65157825",
"text": "loadModel(modelName, viewer) {\n\n }",
"title": ""
},
{
"docid": "68c9f9a0dd5f71dbd11571f54de9c988",
"score": "0.6491952",
"text": "function init() {\n\n hasModalview = APP.dom.html.hasClass(\"has-modalview\") ? true : false;\n\n attachListeners();\n }",
"title": ""
},
{
"docid": "fcfa8eb80a980aa55d44be7dd3673b99",
"score": "0.64533323",
"text": "function init() {\n nationalView();\n}",
"title": ""
},
{
"docid": "d4d621b9c873138bebf88d12ca32ccb3",
"score": "0.6450468",
"text": "init() {\n this.renderView();\n }",
"title": ""
},
{
"docid": "4d5afc164eca19498b7fe6945d4cd848",
"score": "0.64501053",
"text": "initialize() {\n this.renderRoot = this.createRenderRoot();\n this._saveInstanceProperties();\n }",
"title": ""
},
{
"docid": "4d5afc164eca19498b7fe6945d4cd848",
"score": "0.64501053",
"text": "initialize() {\n this.renderRoot = this.createRenderRoot();\n this._saveInstanceProperties();\n }",
"title": ""
},
{
"docid": "090729ab6324e5499a19a898523c4a1f",
"score": "0.6443823",
"text": "function initializeNewModel( modelName ) \n{\n\n\n\t// Reset the main api variable\n\tmodel_api = {};\n\n\t// viewer settings \n\tvar api_viewerSettings = { \n\t\t// container to use \n\t\t//container: document.getElementById(makStudio['containerNames'][modelName]), \n\t\tcontainer : document.getElementById('currentModelDisplay'),\n\t\t// when creating the viewer, we want to get back an API v2 object \n\t\tapi: {version: 2}, \n\t\t// level of log messages which will be sent to the browser console\n\t\tloggingLevel: SDVApp.constants.loggingLevels.NONE, \n\t\t// instantly show the 3D scene \n\t\tshowSceneMode: SDVApp.constants.showSceneModes.INSTANT, \n\t\t// ticket for a ShapeDiver model \n\t\tticket: 'b377b948d7f72cee5db1184551e10c1e9f8a34cae0323283b7f5f8831cedc2e26986531436453d00bbce7556061713170f148b9d879fc7e6b2454fce26e030c1c8fb9782aeaaa1fa73ed74ce6059e6daba4a3b682e769ebfe82ee516dfc6b2a0fe3fc30c2fab53476e8f1f82c895f1781fa1746ebd15-b63fe0ed951441432130ea48fe327cf7', \n\t\tmodelViewUrl : 'eu-central-1'\n\t}; \n\n\n\tmodel_api = new SDVApp.ParametricViewer(api_viewerSettings)\n\n\n\tsetTimeout(function () {\n\t\tsetDefaultModelData(modelName);\n\t\tsetPrice(modelName);\n\t}, 3000);\n\n\n}",
"title": ""
},
{
"docid": "b1a9d2a0b546a1dd97395b1824b7c931",
"score": "0.6432944",
"text": "initCameras()\r\n {\r\n this.viewNames = [];\r\n if(this.graph.defaultViewDefined){\r\n for (let key in this.graph.views)\r\n {\r\n this.viewNames.push(key);\r\n this.view = this.graph.views[key];\r\n \r\n if (this.view.id == this.graph.defaultViewID){ \r\n var V = this.view;\r\n this.selected = this.view.id;\r\n }\r\n }\r\n } else return;\r\n\r\n\r\n if (V == null) return;\r\n else if (V.type == \"perspective\") \r\n this.camera = new CGFcamera(V.angle*DEGREE_TO_RAD, V.near, V.far, V.from, V.to);\r\n else if (V.type = \"ortho\") \r\n this.camera = new CGFcameraOrtho(V.left, V.right, V.bottom, V.top, V.near, V.far, V.from, V.to, V.up);\r\n \r\n this.interface.setActiveCamera(this.camera);\r\n }",
"title": ""
},
{
"docid": "506eaf38b542c3d293290936f2bfafdd",
"score": "0.6412426",
"text": "initialize() {\n this.renderRoot = this.createRenderRoot();\n this._saveInstanceProperties();\n }",
"title": ""
},
{
"docid": "670b2100241603ac5d21af30aeaf3a63",
"score": "0.6410331",
"text": "function init() {\r\n\r\n questionsList = questions.fetch();\r\n view.init(this, questionsList);\r\n\r\n reset();\r\n\r\n if (!utils.isSmallScreen()) {\r\n utils.log(\"[DinnerClub]\", '*** Fetching About...');\r\n require(['./about'], function (about) {\r\n utils.log(\"[DinnerClub]\", '*** About Loaded, initing...');\r\n about.init();\r\n });\r\n } else {\r\n utils.log(\"[DinnerClub]\", '*** No About');\r\n }\r\n\r\n utils.ga.trackEvent('init', (utils.isMobile() ? 'mobile' : 'desktop'), utils.i18n.getLanguage());\r\n\r\n //TODO remove\r\n /* currentQuestionIndex = 1;\r\n updateView(restList);\r\n\r\n view.displayResults(restList);*/\r\n }",
"title": ""
},
{
"docid": "1df7c5942d374a0af7befd1fc0539931",
"score": "0.64100623",
"text": "function initializeController() {\n //setTableContent();\n }",
"title": ""
},
{
"docid": "b1fb4781ea64173f7dc5aa0faf053071",
"score": "0.64071226",
"text": "init() {\n this.scene = new THREE.Scene();\n this.camera = new THREE.PerspectiveCamera(\n 75,\n this.width() / this.height(),\n 1,\n 3000\n );\n this.camera.position.set(0, 0, 128);\n\n this.renderer.setPixelRatio(window.devicePixelRatio);\n this.renderer.setSize(this.width(), this.height());\n\n this.container.appendChild(this.renderer.domElement);\n\n this.raycaster = new THREE.Raycaster();\n this.simplex = new SimplexNoise();\n }",
"title": ""
},
{
"docid": "f860f77c8973cf1b7bac2df4053421f5",
"score": "0.6394257",
"text": "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\theader = svg.append('g').attr('class','vz-treemap-header');\n\t\tplot = svg.append('g').attr('class','vz-treemap-plot');\n\t\t\n\t\tviz.on('data_change',function() { dataIsDirty = true })\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}",
"title": ""
},
{
"docid": "95c268c08bc6c956e8e6332d987d4bb6",
"score": "0.63857746",
"text": "init() {\n var selfref = this;\n\n LoadOBJModel('textures/ThreeDModels/train/', 'train.obj', 'textures/ThreeDModels/train/', 'train.mtl', mesh => {\n selfref.add(mesh);\n });\n\n selfref.scale.set(8, 8, 8);\n }",
"title": ""
},
{
"docid": "7749792ab27f9701a535a36257857f3a",
"score": "0.6372126",
"text": "_init() {\n // black color\n this.gl.clearColor(0.0, 0.0, 0.0, 1.0);\n\n // clear the color buffer\n this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n\n this.gl.enable(this.gl.DEPTH_TEST);\n this.gl.depthFunc(this.gl.LEQUAL);\n\n // viewport init\n this.gl.viewport(0, 0, this.canvas.width, this.canvas.height);\n }",
"title": ""
},
{
"docid": "8f2c4c2496ca2e5e0a48fa10b7c601e0",
"score": "0.6343568",
"text": "function init() {\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n setFocus();\n\t\t}",
"title": ""
},
{
"docid": "074916db947e0e5f430597ae19af977c",
"score": "0.6342992",
"text": "function init() {\n\n initProgList();\n initProgListEvents();\n LOG.info('init program list view');\n }",
"title": ""
},
{
"docid": "fc4a0f22afd7f4c966a1bc0fb25ca462",
"score": "0.63407004",
"text": "initializeMainView() {}",
"title": ""
},
{
"docid": "51ec0da8aa37dcb5293c6450354a5620",
"score": "0.6319857",
"text": "init(){\n if (this.cameras.length == 0) alert(\"Empty camera controller.\");\n this.camera = this.cameras[0];\n }",
"title": ""
},
{
"docid": "91e6746b5da052e83bc64ffe23fd457b",
"score": "0.6303989",
"text": "function jmol_init() {\n jmolScriptWait(loadstr);\n if(DEBUG) console.log(\"Done loading models.\");\n var chi = JSON.parse(jmolGetPropertyAsJSON(\"chaininfo\")); // chainInfo object\n _initPDB(chi.chaininfo);\n _nash(pdf, 1);\n _prsh(pdf, 1);\n if(hasBB) { // only init BB if the backbone file is present\n\t_initBB(chi.chaininfo);\n }\n if(DEBUG) console.log(\"Hiding loader.\");\n document.getElementById(\"load\").style.display = \"none\";\n}",
"title": ""
},
{
"docid": "cf9c6c2e8992b0a989cd548b1259bcef",
"score": "0.62852603",
"text": "function init() {\n \n //// SCENE \\\\\\\\\n \n scene = new THREE.Scene();\n \n\n //// WINDOW \\\\\\\\\n\n WIDTH = window.innerWidth;\n HEIGHT = window.innerHeight - 22;\n\n\n //// RENDERER \\\\\\\\\n\n renderScene();\n dealWithResizing();\n\n\n //// CAMERA \\\\\\\\\n\n addCamera();\n\n\n //// CAMERA CONTROLS \\\\\\\\\n\n controls = new THREE.OrbitControls( camera, renderer.domElement );\n\n\n //// LIGHTS \\\\\\\\\n\n addLights();\n\n\n //// CREATE JSON LOADER \\\\\\\\\n\n loader = new THREE.JSONLoader();\n \n \n //// LOAD JSON OBJECTS \\\\\\\\\n \n loader.load( classroom, addClassroom );\n addTia(); // contains all the loaders for head, body etc.\n loadAllTextElements(); // loads all text and backgrounds for text\n\n\n\n}",
"title": ""
},
{
"docid": "ca9e60a5300b011e1b92bc54d7c08697",
"score": "0.6266909",
"text": "function init() {\n // Set word + line prices to default values on init\n $scope.UIModel = UIModel;\n $scope.dataModel = Converter.dataModel;\n Converter.calculateLinePrices();\n Converter.calculateWordsPerLine();\n\n }",
"title": ""
},
{
"docid": "9981a7c38d78ca8e559d38b360d3088d",
"score": "0.62656826",
"text": "function initialize() {\n loadData();\n initModal();\n new TableFilter(dataTable, searchBox);\n }",
"title": ""
},
{
"docid": "f2c1fc70d7e6ca95e4908e3317786466",
"score": "0.62652445",
"text": "function init(){\n\n $(\".popup\").hide();\n\n scene = new THREE.Scene();\n guiController = new dat.GUI();\n camera = new THREE.PerspectiveCamera(50, WIDTH / HEIGHT, 1, 1000);\n renderer = new THREE.WebGLRenderer({antialias: true});\n\n renderer.setPixelRatio( window.devicePixelRatio );\n renderer.setSize(WIDTH, HEIGHT);\n renderer.setClearColor(0x000000, 1);\n document.body.appendChild(renderer.domElement);\n\n createNeighborCells();\n loadObject();\n lightingSetUp();\n\n camera.position.set(40, 40, 40);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n renderer.render(scene, camera);\n}",
"title": ""
},
{
"docid": "4183ff7105cfcfa64928748bd0d7587d",
"score": "0.62593573",
"text": "function init() {\n // Set word + line prices to default values on init\n $scope.UIModel = UIModel;\n $scope.dataModel = Converter.dataModel;\n Converter.calculateWordPrices();\n Converter.calculateWordsPerLine();\n }",
"title": ""
},
{
"docid": "13c0d14a23b68bf98a1e4d0e6e5c88dd",
"score": "0.6256185",
"text": "function initGUI() {\n g_gui = new dat.GUI();\n var f3d = g_gui.addFolder('3D');\n f3d.addColor(g_model, 'color').name('Color');\n f3d.addColor(g_model, 'backgroundColor').name('Background color');\n f3d.add(g_model, 'lightIntensity1', 0, 1).name('Light 1');\n f3d.add(g_model, 'lightIntensity2', 0, 1).name('Light 2');\n f3d.add(g_model, 'lightIntensity3', 0, 1).name('Light 3');\n\n var fMapping = g_gui.addFolder('Mapping');\n fMapping.add(g_model, 'scaleId', {'Linear': Model.Scale.LINEAR.id, 'Logarithmic': Model.Scale.LOG.id}).name('Scale');\n fMapping.add(g_model, 'hotspotQuantile').name('Hotspot quantile').step(0.0001);\n fMapping.add(g_model, 'spotBorder', 0, 1).name('Spot border').step(0.01);\n}",
"title": ""
},
{
"docid": "6b55ddf0ac99d8d9bb6d092af0e57d44",
"score": "0.6234467",
"text": "InitSetup(){\n this.view.BlanckDisplay();\n }",
"title": ""
},
{
"docid": "09e9020525a726536b1e1f394da6a559",
"score": "0.6220079",
"text": "init(viewHolderId, nodeObj, viewList) {\n this.viewHolderId = viewHolderId;\n const { sceneSetters } = SceneGraph.initializeNodes(nodeObj.nodes);\n this.sceneData = { nodeObj, sceneSetters };\n\n this.setupViews(viewList);\n\n // Register all controls here\n this.clearControls();\n this.registerViewControls();\n this.registerObjectControls();\n EventEmitter.on(EventName.SwitchView, this.switchView.bind(this));\n }",
"title": ""
},
{
"docid": "1891fca3347d7da17254580023e2395a",
"score": "0.62181133",
"text": "function guiInits() {\n //initialize the filter\n FilterManager.init();\n MetadataHandler.init();\n\n // Initialize the advanced toolbar and tools.\n if (RAMP.config.advancedToolbar.enabled) {\n AdvancedToolbar.init();\n }\n\n Datagrid.init();\n theme.tooltipster();\n\n //start loading the layers\n RAMP.startupLayers.forEach(function (layer) {\n LayerLoader.loadLayer(layer);\n });\n }",
"title": ""
},
{
"docid": "0264122156ad857a54c9fe1fd9290610",
"score": "0.6184084",
"text": "initViews() {\r\n this.cameras = [];\r\n for (var key in this.graph.views) {\r\n if (this.graph.views[key][0] == \"perspective\") {\r\n\r\n var near = this.graph.views[key][1];\r\n var far = this.graph.views[key][2];\r\n var fov = this.graph.views[key][3];\r\n var from = this.graph.views[key][4];\r\n var to = this.graph.views[key][5];\r\n this.cameras[key] = new CGFcamera(fov, near, far, vec3.fromValues(from[0], from[1], from[2]), to);\r\n }\r\n\r\n else {\r\n var near = this.graph.views[key][1];\r\n var far = this.graph.views[key][2];\r\n var left = this.graph.views[key][3];\r\n var right = this.graph.views[key][4];\r\n var top = this.graph.views[key][5];\r\n var bottom = this.graph.views[key][6];\r\n var from = this.graph.views[key][7];\r\n var to = this.graph.views[key][8];\r\n this.cameras[key] = new CGFcameraOrtho(left, right, bottom, top, near, far, from, to, [0, 1, 0]);\r\n }\r\n }\r\n\r\n }",
"title": ""
},
{
"docid": "2d09c39466de88380b20fd9e6fa01871",
"score": "0.6175334",
"text": "function init() {\n\tself=new EditLostItemFormController();\n}",
"title": ""
},
{
"docid": "445457e88ac3808c6a36a17376c7444a",
"score": "0.61693865",
"text": "initGameObjets(){\n\t\tlet modele = this.controller.modele;\n\t\t//Init les objets\n\t\tthis.scene.add(modele.table.model);\n\t\tthis.scene.add(modele.environment.model)\n\t\tthis.scene.add(modele.board.model)\t\t\n\t}",
"title": ""
},
{
"docid": "de1a5ea70bba473bb87aa94b8d10e850",
"score": "0.61654854",
"text": "function init() {\n // console.log(\"init\")\n\n // create the model vertex data\n cubeShape = new Cube();\n\n // create the opengl buffers\n cubeRender = new Renderable(cubeShape, false);\n cubeRender.initShaders('basic');\n cubeRender.initBuffers();\n\n quadShape = new Quad();\n quadRender = new Renderable(quadShape, true);\n quadRender.initShaders('basic');\n quadRender.initBuffers();\n\n rttN = new RenderToTexture(512);\n rttN.initFrameBuffer();\n\n rttD = new RenderToTexture(512);\n rttD.initFrameBuffer();\n\n rttP = new RenderToTexture(512);\n rttP.initFrameBuffer();\n\n rttC = new RenderToTexture(512);\n rttC.initFrameBuffer();\n\n}",
"title": ""
},
{
"docid": "b6fea82c8b10591fd7bb61ad95a57f1c",
"score": "0.6156584",
"text": "initialise() {\n /* setup the model view controller */\n this.model = new DataModel(window.localStorage); // ideally the view shouldn't know about the model\n this.controller = new Controller(this, document, this.model);\n logger.log(\"changing state to next question and high scores\");\n let highScores = this.controller.getHighScores();\n logger.log(highScores);\n\n /* useful view components references */\n this.questionDisplayView = document.getElementById(\"questionDisplayView\");\n this.timerView = document.getElementById(\"timer\");\n this.questionView = document.getElementById(\"question\");\n this.answersListView = document.getElementById(\"answers\");\n this.addHighScoreView = document.getElementById(\"addHighScore\");\n this.gotoSectionView = document.getElementById(\"gotoSection\");\n this.scoreListView = document.getElementById(\"scoreList\");\n this.highScoresView = document.getElementById(\"scoreDisplayDiv\");\n this.answerFeedbackView = document.getElementById(\"answerFeedBack\");\n }",
"title": ""
},
{
"docid": "ee70953b8b0ead9f8fa1dd6690e1ac86",
"score": "0.615474",
"text": "function initialize() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE WEBPAGE LOADS\n initialView();\n }",
"title": ""
},
{
"docid": "439551ae475e7cc374fe5ddb77b6716e",
"score": "0.61507446",
"text": "function initScene () {\n\n // init all scene objects\n\n initObjects();\n\n // init user's input data\n\n initData();\n \n // bind events to the dom\n\n ( new SceneEventManager() ).bindEvent( controller );\n\n // now the creation is finished, append the 3D object to the dom\n\n controller.container.appendChild( controller.renderer.domElement );\n\n // init object and action related to selected country\n\n initSelected();\n\n // set finishing initialization sign\n\n controller.initialized = true;\n\n }",
"title": ""
},
{
"docid": "f65fe66b590c828f24dac4696826dacf",
"score": "0.6143139",
"text": "function init () {\n render();\n bindEvents();\n }",
"title": ""
},
{
"docid": "bd9bb0ccd553120358034b1e207b436e",
"score": "0.61320925",
"text": "function init() {\n vm.get(vm.config);\n\n toggle.on('click', function(){\n vm.toggle(vm.config);\n });\n\n del.on('click', function(){\n vm.delete(vm.config);\n });\n\n curtainRange.on('change', adjustCurtain);\n }",
"title": ""
},
{
"docid": "9ae41669146250cf498b0f6d974ae267",
"score": "0.6119833",
"text": "initialize() {\n this.renderRoot = this;\n this._saveInstanceProperties();\n }",
"title": ""
},
{
"docid": "8fc342aed881a8b836e596f33a9a14bd",
"score": "0.6108991",
"text": "function init(){\n\t//create model class\n\tmodel.add(tf.layers.dense({units: 3, inputShape: [3], useBias: false, kernelInitializer: 'heNormal'}));\n\tmodel.compile({loss: 'meanSquaredError', optimizer: 'sgd'});\n\tplotProbs();\n}",
"title": ""
},
{
"docid": "b750921e0d081117ad7b270823bc6584",
"score": "0.6101328",
"text": "function init(){\t\t\t\t\n\t\t\tinitGlobalErrorHandler();\n\t\t\tvar state = restoreState();\n\t\t\tfetchInitData(state, function(err, resp){\n\t\t\t\tif (err) {\n\t\t\t\t\tscope.handleError(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateModel(resp, function(err){\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tscope.handleError(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tinitView(); \n\t\t\t\t\tinitMapView();\n\t\t\t\t});\t\t\t\t\n\t\t\t});\n\t\t\tparent.onpopstate = handlePopState;\t\t\t\n\t\t}",
"title": ""
},
{
"docid": "0372297b01192a7990a22be6b39ff5bb",
"score": "0.6086613",
"text": "function camera_init()\n{\n\tCAM = new Camera(displayList.camera, camera_newFocus);\n\n\tCAM.updateResizeCamera();\n\tCAM.connectViewer(displayList.viewer);\n\t// CAM.connectViewerOther(displayList.viewer_fg);\n}",
"title": ""
},
{
"docid": "93976d8f21b3e2f4dc5bf42864131f9a",
"score": "0.608322",
"text": "setView(initView) {\n this.view = initView;\n }",
"title": ""
},
{
"docid": "93976d8f21b3e2f4dc5bf42864131f9a",
"score": "0.608322",
"text": "setView(initView) {\n this.view = initView;\n }",
"title": ""
},
{
"docid": "93976d8f21b3e2f4dc5bf42864131f9a",
"score": "0.608322",
"text": "setView(initView) {\n this.view = initView;\n }",
"title": ""
},
{
"docid": "93976d8f21b3e2f4dc5bf42864131f9a",
"score": "0.608322",
"text": "setView(initView) {\n this.view = initView;\n }",
"title": ""
},
{
"docid": "33b962dc78acea5f622b0fc2d887a213",
"score": "0.6069763",
"text": "function init() {\n $scope.people = simpleFactory.getPeople();\n }",
"title": ""
},
{
"docid": "2ca16e549095df419197783181ce0795",
"score": "0.60696006",
"text": "function init(){\n buildToolbar();\n initEditor();\n }",
"title": ""
},
{
"docid": "e711e4ef5601b9d9d2df38d51cf77327",
"score": "0.6067206",
"text": "function init () {\n var self = this\n\n // checkbox + title\n self.checkbox = new View({\n el: 'input',\n attr: {\n type: 'checkbox'\n },\n parent: self\n })\n self.title = new View({el: 'span'})\n\n // mount elements\n self.checkbox.mount(self.$el)\n self.title.mount(self.$el)\n}",
"title": ""
},
{
"docid": "17542f03bbb9a662aa4a2b62ac119354",
"score": "0.6065599",
"text": "function init(){\n\t/* CHECK FOR WEBGL */\n\t\n\t// camera\n\t// lights\n\t\n}",
"title": ""
},
{
"docid": "14077188a8d5f43797a789f0f32f2617",
"score": "0.60543305",
"text": "function init() { \n vm.facts = getFacts();\n $log.info(\"Facts created\");\n\n vm.animals = createAnimals(vm.facts);\n $log.info(\"Animals created\");\n }",
"title": ""
},
{
"docid": "c21c95f7ec035ecb1fe8186ede685121",
"score": "0.6053261",
"text": "function initializeModel() {\r\n $scope.exportDataFormBean = {};\r\n }",
"title": ""
},
{
"docid": "e6f9f9a946a93f532eda66d2bc0909fb",
"score": "0.6047235",
"text": "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }",
"title": ""
},
{
"docid": "e9abf09a323b873c17c1aaae45eaf761",
"score": "0.60320365",
"text": "function init_model () {\n setup_board ();\n setup_houses ();\n setup_clues ();\n}",
"title": ""
},
{
"docid": "2e12808ac9527493322243d25d2bd862",
"score": "0.6029437",
"text": "initialize()\r\n {\r\n this.addRegions({\r\n regionCollection: '#region-main_layoutview_model_collection',\r\n regionItem: '#region-main_layoutview_model_item'\r\n });\r\n }",
"title": ""
},
{
"docid": "972fd9b6cbf9736d9e7c9d032b3ed68f",
"score": "0.6027506",
"text": "function init() {\n //check\n console.log(\"In demo mode? \" + isDemo);\n if(isDemo) {\n ml.init();\n } else {\n //network locator loads neural network\n //for current location or tells textViewController\n //that there isn't any info for this location\n }\n }",
"title": ""
},
{
"docid": "581ec62ff5376f8af3128f878b6c3b79",
"score": "0.6025379",
"text": "function init() {\t\t\r\n\t\tthis.wtLoaded = true;\r\n\t\tfor(i = 0; i < numPanels; i++) {\r\n\t\t\tthis.viewsTracked[i] = 0;\r\n\t\t\t//alert('array sub ' + i);\r\n\t\t}\r\n\t}",
"title": ""
},
{
"docid": "6ae92e45851954b57daebee352579c8a",
"score": "0.6020131",
"text": "function init() {\n FSQueryPanel();\n\n if(typeof facets !== 'undefined' && facets.length > 0) {\n FSVoronoiLayout();\n }\n if(typeof resultItems !== 'undefined' && resultItems.length > 0) {\n FSResultLayout();\n }\n }",
"title": ""
},
{
"docid": "31bdd2a191bb4f453da54f5a7a03bac7",
"score": "0.6004983",
"text": "init() {\n this.model.init();\n document.addEventListener('categoriesRendered', e => {\n const naviList = this.view.naviList;\n if (naviList.length) {\n for (const element of naviList) {\n element.addEventListener('click', e => {\n if (element.id !== this.view.curCat) {\n const prev = document.querySelector('li[data-category].selected');\n prev.classList.remove('selected');\n this.view.curCat = element.dataset.category;\n element.classList.add('selected');\n this.model.refreshSourcesData();\n }\n });\n }\n this.model.refreshSourcesData();\n }\n });\n document.addEventListener('sourcesRendered', e => {\n const sourceList = this.view.sourceList;\n for (const element of sourceList) {\n element.addEventListener('click', e => {\n if (element.id !== this.view.curSource) {\n const prev = document.querySelector('li[data-source].selected');\n prev.classList.remove('selected');\n this.view.curSource = element.dataset.source;\n element.classList.add('selected');\n this.model.refreshSortOrderData();\n }\n });\n }\n this.model.refreshSortOrderData();\n });\n\n document.addEventListener('ordersRendered', e => {\n const sortOrder = this.view.sortOrder;\n sortOrder.addEventListener('change', e => {\n this.view.curSort = sortOrder.value;\n this.model.refreshNews(this.view.curSource, sortOrder.value);\n });\n this.model.refreshNews(this.view.curSource, this.view.curSort);\n });\n }",
"title": ""
},
{
"docid": "d145d5352747d2a295fc1ec2f33464bd",
"score": "0.60026515",
"text": "function initialize() {\n\t\t\n\t\talertBinding();\n\t\t\n\t\t//update gallery id on load\n\t\tvar locationArray = location.pathname.split('/');\n\t\tgalleryId = locationArray[locationArray.length-2];\n\t\t\n\t\tlanguages = JSON.parse(getLanguages());\n\t\tcategories = JSON.parse(getAllCategories());\n\t\t//removing ndtv\n\t\tpartners = $.grep(JSON.parse(getPartners()), function (a) { return a.id != 2; });\n\t\tloadGallery();\n\t\tcopyGalleryClickBinding();\n\t}",
"title": ""
},
{
"docid": "e3cd35329f98c6e43f050048827356f4",
"score": "0.5991957",
"text": "function _setup() {\n model2px = modelView.model2px;\n model2pxInv = modelView.model2pxInv;\n fontSizeInPixels = modelView.getFontSizeInPixels();\n modelAtoms = model.getAtoms();\n modelElectricField = model.getElectricField();\n modelElements = model.get_elements();\n modelWidth = model.get('width');\n modelHeight = model.get('height');\n aspectRatio = modelWidth / modelHeight;\n setupRendererOptions(); // Subscribe for model events.\n\n model.addPropertiesListener([\"temperatureControl\", \"keShading\"], drawSymbolImages);\n\n function redrawClickableObjects(redrawOperation) {\n return function () {\n redrawOperation(); // All objects where repainted (probably removed and added again), so\n // it's necessary to apply click handlers again.\n\n modelView.updateClickHandlers();\n };\n }\n\n function setupElectricField() {\n electricFieldRenderer.setup();\n modelView.renderCanvas();\n } // Redraw container each time when some visual-related property is changed.\n\n\n model.addPropertiesListener([\"chargeShading\", \"chargeShadingStyle\", \"showChargeSymbols\", \"useThreeLetterCode\", \"showAtomTrace\", \"atomTraceId\", \"aminoAcidColorScheme\", \"backgroundColor\", \"markColor\", \"forceVectorsDirectionOnly\"], redrawClickableObjects(_repaint)); // Vectors:\n\n model.addPropertiesListener([\"electricFieldDensity\", \"showElectricField\", \"electricFieldColor\"], setupElectricField);\n model.addPropertiesListener([\"showVelocityVectors\", \"velocityVectors\"], function () {\n velocityVectorsRenderer.setup();\n modelView.renderCanvas();\n });\n model.addPropertiesListener([\"showForceVectors\", \"forceVectors\", \"forceVectorsDirectionOnly\"], function () {\n forceVectorsRenderer.setup();\n modelView.renderCanvas();\n });\n model.addPropertiesListener([\"showVDWLines\", \"VDWLinesCutoff\"], function () {\n vdwLinesRenderer.setup();\n modelView.renderCanvas();\n });\n model.on('addAtom', redrawClickableObjects(function () {\n atomsRenderer.setup();\n velocityVectorsRenderer.setup();\n forceVectorsRenderer.setup();\n electricFieldRenderer.update();\n modelView.renderCanvas();\n }));\n model.on('removeAtom', redrawClickableObjects(function () {\n atomsRenderer.setup();\n velocityVectorsRenderer.setup();\n forceVectorsRenderer.setup();\n electricFieldRenderer.update();\n modelView.renderCanvas();\n }));\n model.on('addRadialBond', redrawClickableObjects(function () {\n bondsRenderer.setup();\n modelView.renderCanvas();\n }));\n model.on('removeRadialBond', redrawClickableObjects(function () {\n bondsRenderer.setup();\n modelView.renderCanvas();\n }));\n model.on('textBoxesChanged', redrawClickableObjects(drawTextBoxes));\n model.on('imagesChanged', redrawClickableObjects(imagesRenderer.setup));\n model.on('addElectricField', setupElectricField);\n model.on('removeElectricField', setupElectricField);\n model.on('changeElectricField', setupElectricField);\n setupBrowserWarning();\n isSetup = true;\n } // Call when model is reset or reloaded.",
"title": ""
},
{
"docid": "75daa3db18410d6549f51089fef35513",
"score": "0.59854865",
"text": "function _init() {\n\n _setStage();\n\n }",
"title": ""
},
{
"docid": "5d625eac980d63d74dbdbcdbbc810042",
"score": "0.59851754",
"text": "function init () {\n resetState();\n renderHTML();\n initComponents();\n renderInputTree();\n }",
"title": ""
},
{
"docid": "aa1bd3a75e7c72ebc14934abd214f5d5",
"score": "0.59775597",
"text": "constructor()\r\n\t{\r\n\t\tthis.models = [];\r\n\t\tthis.ambientLight = Float32Array.from([0.0, 0.0, 0.0]);\r\n\t\tthis.cameraPosition = Float32Array.from([0.0, 0.0, 0.0]);\r\n\t\tthis.cameraRotation = Float32Array.from([0.0, 0.0, 0.0]);\r\n\t}",
"title": ""
},
{
"docid": "4c9d28b2e8ee8807a67ecaca4cf4475d",
"score": "0.59755236",
"text": "function initilizeController(){\n }",
"title": ""
},
{
"docid": "782c4b8f0a1cf6e5df9cecc3630e8ed0",
"score": "0.5966425",
"text": "function init(){\n\n }",
"title": ""
},
{
"docid": "9be521815abc9caa79408f06aaf152fa",
"score": "0.5963756",
"text": "init() {\n\t\tthis.paletteConfig = new PaletteConfiguration();\n\t\tthis.preview = new Preview();\n\n\t\tnew ComponentApplication().init();\n\n\t\tthis.saveUI = new Save();\n\t\tthis.saveUI.render();\n\n\t\t// Instantiate the css loader.\n\t\tthis.styleUpdater = new StyleUpdater( document );\n\t\tthis.styleUpdater.setup();\n\n\t\tthis.renderControls();\n\n\t}",
"title": ""
},
{
"docid": "caccc69191749bf4c1f90acbc901fc7b",
"score": "0.59622496",
"text": "function initScene() {\n\tvar screenWidth = window.innerWidth;\n\tvar screenHeight = window.innerHeight;\n\tvar aspect = screenWidth / screenHeight;\n\n\tviewerParams.renderWidth = window.innerWidth;\n\tviewerParams.renderHeight = window.innerHeight;\n\n\tif (viewerParams.reset){\n\t\tviewerParams.scene = null;\n\t\tviewerParams.camera = null;\n\t} else{\n\n\t\t //keyboard\n\t\tviewerParams.keyboard = new KeyboardState();\n\n\t\t// renderer\n\t\tif ( Detector.webgl ) {\n\t\t\tviewerParams.renderer = new THREE.WebGLRenderer( {\n\t\t\t\tantialias:true,\n\t\t\t\t//preserveDrawingBuffer: true , //so that we can save the image\n\t\t\t} );\n\n\t\t} else {\n\t\t\t//Canvas Renderer has been removed, and I can't get the old version to work now\n\t\t\t//viewerParams.renderer = new THREE.CanvasRenderer(); \n\t\t\talert(\"Your browser does not support WebGL. Therefore Firefly cannot run. Please use a different browser.\");\n\n\t\t}\n\t\tviewerParams.renderer.setSize(screenWidth, screenHeight);\n\t\tviewerParams.normalRenderer = viewerParams.renderer;\n\n\t\td3.select('#WebGLContainer').selectAll(\"canvas\").remove();\n\n\t\tviewerParams.container = document.getElementById('WebGLContainer');\n\t\tviewerParams.container.appendChild( viewerParams.renderer.domElement );\n\n\t\t//stereo\n\t\tviewerParams.effect = new THREE.StereoEffect( viewerParams.renderer );\n\t\tviewerParams.effect.setAspect(1.);\n\t\tviewerParams.effect.setEyeSeparation(viewerParams.stereoSep);\n\n\t\tif (viewerParams.useStereo){\n\t\t\tviewerParams.normalRenderer = viewerParams.renderer;\n\t\t\tviewerParams.renderer = viewerParams.effect;\n\t\t}\n\t}\n\n\t// scene\n\tviewerParams.scene = new THREE.Scene(); \n\n\t// camera\n\tviewerParams.camera = new THREE.PerspectiveCamera( viewerParams.fov, aspect, viewerParams.zmin, viewerParams.zmax);\n\tviewerParams.camera.up.set(0, -1, 0);\n\tviewerParams.scene.add(viewerParams.camera); \n\n\t// events\n\tTHREEx.WindowResize(viewerParams.renderer, viewerParams.camera);\n\t//THREEx.FullScreen.bindKey({ charCode : 'm'.charCodeAt(0) });\n\n\t//viewerParams.useTrackball = true;\n\n\t//console.log(viewerParams.parts.options);\n\tsetCenter(viewerParams.parts[viewerParams.partsKeys[0]].Coordinates);\n\tviewerParams.camera.position.set(viewerParams.center.x, viewerParams.center.y, viewerParams.center.z - viewerParams.boxSize/2.);\n\tviewerParams.camera.lookAt(viewerParams.scene.position); \n\n\n\t//apply presets from the options file\n\tif (viewerParams.parts.hasOwnProperty('options')) applyOptions();\n\n\t//octree\n\t//viewerParams.octree = new THREE.Octree();//{scene:viewerParams.scene}); //add the scene if it should be visualized\n\n\t// controls\n\tinitControls();\n\n\n\t//investigating the minimum point size issue\n\t// console.log(\"context\", viewerParams.renderer.context)\n\t// //maybe glDisable(GL_POINT_SMOOTH); would solve the point size issue?\n\t// //see also GL_POINT_SIZE_RANGE\n\t// var canvas = d3.select('canvas').node();\n\t// var gl = canvas.getContext('webgl');\n\t// console.log(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE), gl.getParameter(gl.POINT_SMOOTH));\n}",
"title": ""
},
{
"docid": "7dee85cb99f941a96347d767aa72dad4",
"score": "0.5961827",
"text": "init() {\n // re-init the renderer with lighting shaders\n this.renderer.init({\n width: this.dimensions.width,\n height: this.dimensions.height,\n useLightingShaders: true,\n useOffscreenCanvas: true\n })\n }",
"title": ""
},
{
"docid": "0dd023e20e850293b0a98b2ac2b98b29",
"score": "0.59588015",
"text": "function init() {\n $('#results').parent().click(showItemDetails);\n $('#c-modify-btn').click(editItem );\n $('#c-item-editor').bind('axel-save-done', itemSaveDone );\n $('#c-item-viewer').bind('axel-delete-done', itemDeleteDone );\n patchBootstrapModals();\n // remove modal content to reuse it with different content (applies only to /stage)\n $('.more-infos').on('hidden', function() {\n $(this).data('modal').$element.removeData();\n });\n $('#editor').bind('axel-save-cancel', hideSpinningWheel).bind('axel-save-error', hideSpinningWheel);\n $('#editor').bind('axel-save-done', // special tooltips in results list\n function (ev, host) {\n hideSpinningWheel();\n $('#results').find(\"a[rel='tooltip']\").tooltip({ html: false });\n $('#results').find(\"span[rel='tooltip']\").tooltip({ html: false });\n });\n $('#results').find(\"a[rel='tooltip']\").tooltip({ html: false });\n $('#results').find(\"span[rel='tooltip']\").tooltip({ html: false });\n }",
"title": ""
},
{
"docid": "16b9be40a3004903d7f80d1ae9a7bf5c",
"score": "0.59580845",
"text": "function init() {\r\n\r\n //creating a scene.\r\n scene = new THREE.Scene();\r\n scene.background = new THREE.Color(0xbffffd);\r\n\r\n //Fog color.\r\n fogColor = new THREE.Color(0xffffff);\r\n\r\n //Fog\r\n scene.fog = new THREE.FogExp2(0xffffff, 1.5);\r\n\r\n //Creating a virtual camera so that we can see the scene.\r\n camera = new THREE.PerspectiveCamera( 75, 1000 / 700, 0.01, 1000);\r\n camera.position.z = 0.2;\r\n \r\n //Creating a renderer which helps in rendering the scene.\r\n renderer = new THREE.WebGLRenderer();\r\n renderer.setSize(1000, 700);\r\n document.body.appendChild(renderer.domElement);\r\n\r\n //Creating OrbitControls to help viewer rotate the 3D model.\r\n const controls = new THREE.OrbitControls( camera, renderer.domElement );\r\n\r\n //To load the 3D model.\r\n const loader = new THREE.GLTFLoader();\r\n\r\n loader.load('models/router.glb', object => {\r\n\r\n const router = object.scene.children[0];\r\n\r\n scene.add(object.scene);\r\n })\r\n\r\n //Adding lightings.\r\n const pointLight = new THREE.PointLight(0xffffff, 1);\r\n scene.add(pointLight); \r\n pointLight.position.set(1, 9, 1)\r\n\r\n const directional_light = new THREE.DirectionalLight(0xffffff, 2);\r\n scene.add(directional_light);\r\n\r\n const ambientLight = new THREE.AmbientLight(0xffffff, 0.5);\r\n scene.add(ambientLight);\r\n\r\n //Creating an artificial sun.\r\n const sun_geometry = new THREE.SphereBufferGeometry(0.1, 30, 30);\r\n const sun_material = new THREE.MeshBasicMaterial({color: 0xffff00});\r\n const sun = new THREE.Mesh(sun_geometry, sun_material);\r\n scene.add(sun);\r\n sun.position.set(1, 4, 1);\r\n\r\n //Calling the update function.\r\n update();\r\n }",
"title": ""
},
{
"docid": "d198e9f66003e50ea332f6175c520b06",
"score": "0.59572893",
"text": "function init() {\n\t\t\t// init code here\n\t\t\n\t\t}",
"title": ""
},
{
"docid": "1fa97a408ea373791349e67970b7d373",
"score": "0.59407663",
"text": "initialize () {\n let that = this;\n let Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"home\");\n\n let query = {\n channel: \"rent\",\n filters: {\n surroundingSuburbs: true,\n excludeTier2: true,\n geoPrecision: \"address\",\n excludeAddressHidden: \"true\",\n localities: [\n {\n searchLocation: \"Melbourne, VIC 3000\"\n },\n {\n searchLocation: \"Brunswick, VIC 3056\"\n },\n {\n searchLocation: \"Richmond, VIC 3121\"\n }\n ]\n },\n pageSize: 20\n };\n\n this.model = new RealEstateModel();\n this.fetch(query);\n }",
"title": ""
},
{
"docid": "31b50dfc8e8374d9bdf8de0a020401e7",
"score": "0.5939205",
"text": "function init() {\n\n }",
"title": ""
},
{
"docid": "31b50dfc8e8374d9bdf8de0a020401e7",
"score": "0.5939205",
"text": "function init() {\n\n }",
"title": ""
},
{
"docid": "5f61a316a297c1ea612ea9b29f8196e2",
"score": "0.5936285",
"text": "function init(){\n if(!map){\n setMap(map_init_options);\n } \n initModel();\n initView();\n addControlPanel(); \n\n}",
"title": ""
},
{
"docid": "7c7cd2808ecab0cbd844549068f1c67e",
"score": "0.5935009",
"text": "function init() { \n \n }",
"title": ""
},
{
"docid": "1f3722988f324dee3473b4eece36b0a8",
"score": "0.59226227",
"text": "constructor() {\n this.changeEvent = new Event('modelChange'); // creat an event for the view to subscribe to\n this.saver = new HistorySaver(); // use api service\n this.init();\n }",
"title": ""
},
{
"docid": "b74c1355d1f195f671e0c7a676f3f3cb",
"score": "0.59220076",
"text": "function init () {\n\n \n }",
"title": ""
},
{
"docid": "4663b1cb55b10e158558a69cfe73c85f",
"score": "0.59190077",
"text": "function onLoad() {\n\n var options = {\n language:'en', //default - en\n env: 'Local'\n };\n\n Autodesk.Viewing.Initializer (options, function () {\n\n var container = document.getElementById('viewer')\n\n var viewer = new Autodesk.Viewing.Private.GuiViewer3D(\n container);\n\n viewer.initialize();\n\n viewer.setLightPreset(8);\n viewer.setProgressiveRendering(false);\n\n viewer.load('/data/bb8/bb8.svf');\n\n viewer.loadExtension('Autodesk.ADN.Viewing.Extension.IoT', {\n apiUrl: '/api'\n });\n });\n}",
"title": ""
},
{
"docid": "7f5b7fa27674336156a27d9f692320f0",
"score": "0.59189427",
"text": "function Init(){\n \t\n \tscene = new THREE.Scene();\n \t/* FOV aspect ratio min max distance for visible objects */\n \tcamera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\n \trenderer = new THREE.WebGLRenderer();\n \tconsole.log(renderer)\n \trenderer.setSize(window.innerWidth, window.innerHeight);\n \t/* append renderer to page */\n \tdocument.body.appendChild(renderer.domElement); \n \t\n \t/* prepare box objet this is done in three phases: */\n \t/* Geometry */\n \tboxGeometry = new THREE.CubeGeometry(1,1,1);\n \t/* Material Proprieties as object */\n \tboxMaterial = new THREE.MeshBasicMaterial({ color: 0x005500, wireframe : true });\n \t/* Mesh Geometry Material */ \n \tbox = new THREE.Mesh(boxGeometry, boxMaterial);\n \t/* add box to scene */\n \tscene.add(box);\n \t\n \tcamera.position.z = 5;\n \tconsole.log(\"INIT END\")\n \t\n }",
"title": ""
},
{
"docid": "a76969fbfad5dd3ce23c8deac4c69fce",
"score": "0.59151226",
"text": "function init () {\n\t\tconsole.log(\"ENTRA-init()\");\n\t\t// Getting the uploadedFiles array\n\t\t$scope.files = ingestService.getIngestFilesArray();\n\t\t// Control flag to show or hide upload section.\n\t\t$scope.isSpecLoaded = $.isEmptyObject(specService.getSpec()) ? false : true;\n\t\t$scope.ingestFileUploaded = $.isEmptyObject(ingestService.getIngestObj()) ? false : true;\n\t // Error alerts enabled in initial state\n\t $scope.enableErrorAlerts = true;\n \t$scope.notEPG = false;\n \t$scope.notVOD = false;\n \t$scope.uploadError = false;\n\n \t$scope.fileTypeOk = ingestService.isFileTypeOk();\n\n\t\t// Toggle active navbar component\n\t \tvar selector = '.nav li';\n\n\t\tif(!$(\"#ingest-section\").hasClass('active')) {\n\t\t\t$(selector).removeClass('active');\n\t\t\t$(\"#ingest-section\").addClass('active');\n\t\t}\n\t}",
"title": ""
},
{
"docid": "efaf26d08df30e545a1baa5e96441d29",
"score": "0.5911786",
"text": "function init() {\n hideIntro();\n app.nodes.push(new Node(app.idCounter, app.initialSymbol, 0, 0));\n app.createGraph(app.nodes[0]);\n app.createWords(app.nodes[0]);\n app.insertNodes();\n app.insertEdges();\n\n renderGraph();\n}",
"title": ""
},
{
"docid": "7ca4e92fc10ba7a0dd9c9ae7e8ee7e71",
"score": "0.59099764",
"text": "function init () {\n element.css('position', 'absolute');\n hide(); \n metriCtrl.setMetroInfo(extendObjWithApi({}));\n\n if (scope.control)\n extendObjWithApi(scope.control);\n }",
"title": ""
},
{
"docid": "fdbe701453e9b1be9cbdc2edcbe9ea47",
"score": "0.59050786",
"text": "function init() {\n\n\tclock = new THREE.Clock();\n\t\n\tscene = new THREE.Scene();\n\n\trenderer = new THREE.WebGLRenderer();\n\n\trenderer.setClearColor(new THREE.Color(0.0, 0.0, 0.0));\n\trenderer.setSize(window.innerWidth*0.7, window.innerHeight*0.7);\n\n\tdocument.getElementById(\"WebGL-output\").appendChild(renderer.domElement);\n\n\tcamera = new THREE.PerspectiveCamera(60.0, 1.0, 0.1, 1000.0);\n\t\n\t// Controle de Camera Orbital\n\torbitControls = new THREE.OrbitControls(camera);\n\torbitControls.autoRotate = false;\n\n\t// Adiciona luz ambiente\n\tvar ambientLight = new THREE.AmbientLight(new THREE.Color(1.0, 1.0, 1.0));\n\tscene.add(ambientLight);\n\n\t//initGUI();\n\tloadMeshes();\n\trenderer.clear();\n}",
"title": ""
},
{
"docid": "2547661d5a0d89d532361e5803480344",
"score": "0.5902476",
"text": "function init() {\n\t\t//console.log(\"app.init()\");\n\n\t\tif(initDone) {\n\t\t\t//console.log(\"initialization already done.\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Create the scene.\n\t\tscene.init();\n\n\t\t// Initialize HTML layout and from there the GUI/UI with interaction.\n\t\t// After layout is done the canvas exists in its final size.\n\t\tlayout.init(resizeCbk);\n\n\t\t// Initialize context within the canvas.\n\t\t// Initialize rendering modules, raster and shader.\n\t\t// This must be done after layout to have the final size of the canvas.\n\t\tscene.initPipeline();\n\n\t\tinitDone = true;\n\t}",
"title": ""
}
] |
43470333a84d5cb0326b8f1bb0f3c0a9 | Convert an Arraylike object to a real Array. | [
{
"docid": "e67d69eccb833f5717a57ea2d29c66ed",
"score": "0.0",
"text": "function toArray (list, start) {\n start = start || 0;\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret\n}",
"title": ""
}
] | [
{
"docid": "c16ca201c0622a129968a1eb12a606db",
"score": "0.730102",
"text": "function makeArray(obj) {\n if (Array.isArray(obj)) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == 'object' && typeof obj.length == 'number';\n if (isArrayLike) {\n // convert nodeList to array\n return arraySlice.call(obj);\n }\n\n // array of single index\n return [obj];\n }",
"title": ""
},
{
"docid": "c16ca201c0622a129968a1eb12a606db",
"score": "0.730102",
"text": "function makeArray(obj) {\n if (Array.isArray(obj)) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == 'object' && typeof obj.length == 'number';\n if (isArrayLike) {\n // convert nodeList to array\n return arraySlice.call(obj);\n }\n\n // array of single index\n return [obj];\n }",
"title": ""
},
{
"docid": "ce4794f0241dcbd978e63541e44a5b74",
"score": "0.7274353",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n }",
"title": ""
},
{
"docid": "ce4794f0241dcbd978e63541e44a5b74",
"score": "0.7274353",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n }",
"title": ""
},
{
"docid": "48ce74e093641ce2b4609dca7f3da7d6",
"score": "0.7239749",
"text": "function convertArray(array, type, forceClone) {\n if (!array || !forceClone && array.constructor === type) return array;\n if (typeof type.BYTES_PER_ELEMENT === \"number\") return new type(array); // create typed array\n return Array.prototype.slice.call(array); // create Array\n}",
"title": ""
},
{
"docid": "37bd1acb1d328d20642f3f07249f532d",
"score": "0.719016",
"text": "function toArray(obj) {\n\t\tvar r = new Array(obj.length);\n\t\n\t\tfor(var i = 0, l = obj.length; i < l; i++) {\n\t\t\tr[i] = obj[i];\n\t\t}\n\t\t\n\t\treturn r;\n\t}",
"title": ""
},
{
"docid": "439d4ebe7b69d4c98db3ff0fe529241e",
"score": "0.71484005",
"text": "function toArray(obj) {\n var myArray = [];\n for (var m = obj.length >>> 0; m--;) {\n myArray[m] = obj[m];\n }\n return myArray;\n }",
"title": ""
},
{
"docid": "1da52b24b311e1af6132bc031981494a",
"score": "0.71300393",
"text": "function toArray(obj) {\n try {\n return slice.call(obj);\n } catch(e) {\n var ret = [];\n each(obj, function(val) {\n ret.push(val);\n });\n return ret;\n }\n }",
"title": ""
},
{
"docid": "1da52b24b311e1af6132bc031981494a",
"score": "0.71300393",
"text": "function toArray(obj) {\n try {\n return slice.call(obj);\n } catch(e) {\n var ret = [];\n each(obj, function(val) {\n ret.push(val);\n });\n return ret;\n }\n }",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "2894d0469f6be002c3a21e77bb9cd903",
"score": "0.71287966",
"text": "function makeArray( obj ) {\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n return obj;\n }\n\n var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';\n if ( isArrayLike ) {\n // convert nodeList to array\n return arraySlice.call( obj );\n }\n\n // array of single index\n return [ obj ];\n}",
"title": ""
},
{
"docid": "fc8e183b118f881d7d058aff40637ea3",
"score": "0.7102126",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n }",
"title": ""
},
{
"docid": "fc8e183b118f881d7d058aff40637ea3",
"score": "0.7102126",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n }",
"title": ""
},
{
"docid": "fc8e183b118f881d7d058aff40637ea3",
"score": "0.7102126",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n }",
"title": ""
},
{
"docid": "640ded722e81833592658bdb4279a877",
"score": "0.70787346",
"text": "function makeArray (obj) {\n var ary = [];\n if (isArray(obj)) {\n // use object if already an array\n ary = obj;\n } else if (typeof obj.length === 'number') {\n // convert nodeList to array\n for (var i = 0, len = obj.length; i < len; i++) {\n ary.push(obj[i]);\n }\n } else {\n // array of single index\n ary.push(obj);\n }\n return ary;\n }",
"title": ""
},
{
"docid": "222038bb908e02ecd678d98604a6fee0",
"score": "0.7041665",
"text": "function makeArray(obj) {\n var ary = [];\n if (isArray(obj)) {\n // use object if already an array\n ary = obj;\n } else if (typeof obj.length === 'number') {\n // convert nodeList to array\n for (var i = 0, len = obj.length; i < len; i++) {\n ary.push(obj[i]);\n }\n } else {\n // array of single index\n ary.push(obj);\n }\n return ary;\n }",
"title": ""
},
{
"docid": "6611e631892f1fc5cf1c200ba8a2985b",
"score": "0.7040362",
"text": "function asArray( obj ) {\n return Array.isArray( obj ) ? obj : [ obj ];\n}",
"title": ""
},
{
"docid": "6f5335a7814499836d8466c540542ff5",
"score": "0.7030197",
"text": "function makeArray(obj) {\n var ary = [];\n if (isArray(obj)) {\n // use object if already an array\n ary = obj;\n } else if (typeof obj.length === 'number') {\n // convert nodeList to array\n for (var i = 0, len = obj.length; i < len; i++) {\n ary.push(obj[i]);\n }\n } else {\n // array of single index\n ary.push(obj);\n }\n return ary;\n }",
"title": ""
},
{
"docid": "8b3df08d9fc2145ae0fd764474158bc0",
"score": "0.70250547",
"text": "function makeArray(obj) {\n var ary = [];\n if (isArray(obj)) {\n // use object if already an array\n ary = obj;\n } else if (obj && typeof obj.length === 'number') {\n // convert nodeList to array\n for (var i = 0, len = obj.length; i < len; i++) {\n ary.push(obj[i]);\n }\n } else {\n // array of single index\n ary.push(obj);\n }\n return ary;\n }",
"title": ""
},
{
"docid": "8b3df08d9fc2145ae0fd764474158bc0",
"score": "0.70250547",
"text": "function makeArray(obj) {\n var ary = [];\n if (isArray(obj)) {\n // use object if already an array\n ary = obj;\n } else if (obj && typeof obj.length === 'number') {\n // convert nodeList to array\n for (var i = 0, len = obj.length; i < len; i++) {\n ary.push(obj[i]);\n }\n } else {\n // array of single index\n ary.push(obj);\n }\n return ary;\n }",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "c3a86b3d8ab8445221547f90ec9085b0",
"score": "0.6981917",
"text": "function toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}",
"title": ""
},
{
"docid": "147de920cbadb933f343a5f1e78d0b7b",
"score": "0.69595695",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "147de920cbadb933f343a5f1e78d0b7b",
"score": "0.69595695",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "147de920cbadb933f343a5f1e78d0b7b",
"score": "0.69595695",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "caa1e92e6c961131972b31c96b02dfcb",
"score": "0.69554657",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "8450c6451f86e59d6f62894d40e0c140",
"score": "0.6939697",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( obj && typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "ba9a3623b4fb6c0c24214d9c62529857",
"score": "0.693477",
"text": "function toArray(arrayLike) {\r\n if (isCallable(Array.from)) {\r\n return Array.from(arrayLike);\r\n }\r\n /* istanbul ignore next */\r\n return _copyArray(arrayLike);\r\n}",
"title": ""
},
{
"docid": "ba9a3623b4fb6c0c24214d9c62529857",
"score": "0.693477",
"text": "function toArray(arrayLike) {\r\n if (isCallable(Array.from)) {\r\n return Array.from(arrayLike);\r\n }\r\n /* istanbul ignore next */\r\n return _copyArray(arrayLike);\r\n}",
"title": ""
},
{
"docid": "a9fd4e53665465a42a033411eff25f95",
"score": "0.6924441",
"text": "function toArr (arrLike) {\n return Array.prototype.slice.call(arrLike);\n}",
"title": ""
},
{
"docid": "704927fdd0b97de96e51fdc8db5799e1",
"score": "0.692077",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n }",
"title": ""
},
{
"docid": "2a302c061c0869bcba86f6626398c370",
"score": "0.6907649",
"text": "function toArray(obj) {\n return [].slice.call(obj)\n}",
"title": ""
},
{
"docid": "3777b91df666671c467d4b60d1116b53",
"score": "0.69051385",
"text": "function arrayToObject(a) {\n return expandArray(a, true);\n }",
"title": ""
},
{
"docid": "ee5446180e1c8dd0ba9501ff7e09339c",
"score": "0.68915486",
"text": "function makeArray( obj ) {\n var ary = [];\n if( Array.isArray( obj ) ) {\n /// use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ){\n // convert nodeList to array\n for ( var i = 0, len = obj.length; i < len; i++){\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "ea96c4dcf7f8a34c3f7450000abb18f3",
"score": "0.6865776",
"text": "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }",
"title": ""
},
{
"docid": "8b9e9d73b43572f0ca645cab9fc07ef1",
"score": "0.68362075",
"text": "function _setCoerce(obj) {\n return _array.call(this, Array.from(obj));\n}",
"title": ""
},
{
"docid": "c437d3c65a4a02ec1e345372cea8cf29",
"score": "0.68346477",
"text": "function convertToArray() {\n // converts an object of objects to an array of objects\n }",
"title": ""
},
{
"docid": "004690a4acce0a787761682c53f5d50e",
"score": "0.68297404",
"text": "function toArray(x) { return Array.isArray(x) ? x : [x]; }",
"title": ""
},
{
"docid": "68f90149642470a80612579a5dadc2f8",
"score": "0.6817791",
"text": "function toArray(o) {\r\n var a = [];\r\n var i = o.length;\r\n a.length = i;\r\n while (i--) { a[i] = o[i]; }\r\n return a;\r\n }",
"title": ""
},
{
"docid": "8209cea310b47e2c2047ba2a53002ee6",
"score": "0.67921513",
"text": "toArray() {\n\t const stype = this.dtype;\n\t if (stype == \"float32\") {\n\t return new Float32Array(this.toRawBytes().buffer);\n\t }\n\t else if (stype == \"float64\") {\n\t return new Float64Array(this.toRawBytes().buffer);\n\t }\n\t else if (stype == \"int32\") {\n\t return new Int32Array(this.toRawBytes().buffer);\n\t }\n\t else if (stype == \"int8\") {\n\t return new Int8Array(this.toRawBytes().buffer);\n\t }\n\t else if (stype == \"uint8\") {\n\t return new Uint8Array(this.toRawBytes().buffer);\n\t }\n\t else {\n\t throw new Error(\"Unsupported data type \" + this.dtype);\n\t }\n\t }",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "79381ed8e90cfdad5dcdb37378add09a",
"score": "0.6790168",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "c0988b33a477daf6e25a34629958ca65",
"score": "0.6756997",
"text": "function toArray(obj) {\n var arr = [];\n for (var i=0, n=obj.length; i<n; i++) {\n arr[i] = obj[i]; // about 2x faster than push() (apparently)\n // arr.push(obj[i]);\n }\n return arr;\n}",
"title": ""
},
{
"docid": "159fb80067c4ef20d2dc96018a409325",
"score": "0.6696446",
"text": "function makeArray( obj ) {\n var ary = [];\n if ( typeof obj.length === 'number' ) {\n // convert nodeList to array\n for ( var i=0, len = obj.length; i < len; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}",
"title": ""
},
{
"docid": "ff95f1e77fc23db620f486ec78f90460",
"score": "0.667839",
"text": "function as_array(v) {\r\n return setType(v, 'array');\r\n}",
"title": ""
},
{
"docid": "e713830a39f0ec13d501b570579ffccb",
"score": "0.66493315",
"text": "static forceArray(obj) {\n if (!Array.isArray(obj)) {\n return [obj];\n }\n else {\n return obj;\n }\n }",
"title": ""
},
{
"docid": "91e9cc6a8ae408a2172fb1fb51fee2a5",
"score": "0.66425145",
"text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }",
"title": ""
},
{
"docid": "91e9cc6a8ae408a2172fb1fb51fee2a5",
"score": "0.66425145",
"text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }",
"title": ""
},
{
"docid": "91e9cc6a8ae408a2172fb1fb51fee2a5",
"score": "0.66425145",
"text": "function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }",
"title": ""
},
{
"docid": "a0f77db336add07368059d1afae5189f",
"score": "0.6634059",
"text": "function asArray(a) {\r\n return Array.isArray(a) ? a : [a];\r\n }",
"title": ""
},
{
"docid": "d4650a965460ed48e5d52fce1ed8c165",
"score": "0.6611825",
"text": "function asArray(a) {\n return Array.isArray(a) ? a : [a];\n }",
"title": ""
},
{
"docid": "d4650a965460ed48e5d52fce1ed8c165",
"score": "0.6611825",
"text": "function asArray(a) {\n return Array.isArray(a) ? a : [a];\n }",
"title": ""
}
] |
8b63c4a10a2a657fa728725d0f9c6df5 | Recursively add folder contents to zip. | [
{
"docid": "79709ceb3d4674f26e8f4ec606938f49",
"score": "0.6008304",
"text": "function AddFolderWithScan( zip, name, fldr, appName, minify, isTop, noSwap )\n{\n\tvar list = app.ListFolder( fldr,\"\");\n\tfor( var i=0; i<list.length; i++ )\n\t{\n\t\tvar title = list[i];\n\t\tif( !app.IsFolder( fldr+\"/\"+title ) )\n\t\t{\n\t\t\t//Get file type.\n\t\t\tvar ext = title.substr( title.lastIndexOf(\".\") ).toLowerCase();\n\t\t\tvar isMin = ( title.toLowerCase().indexOf(\".min.js\") > -1 );\n\t\t\tvar isJs = ( ext==\".js\" );\n\t\t\tvar isHtml = ( ext==\".html\" || ext==\".htm\" );\n\n\t\t\t//Scan .js and .html files for permissions.\n\t\t\tif( isTop && !isMin && (isJs || isHtml) ) ScanFile( fldr+\"/\"+title );\n\n\t\t\t//Swap spaces for underscores (for ICS bug)\n\t\t\tvar newtitle = title;\n\t\t\tnewtitle = newtitle.replace( RegExp( \" \",\"gim\"), \"_\" );\n\n\t\t\t//Add file to zip.\n\t\t\tif( isTop )\n\t\t\t{\n\t\t\t\t//Do build-time macro substitutions.\n\t\t\t\tvar code = app.ReadFile( fldr+\"/\"+title );\n\t\t\t\tcode = Macros( code );\n\n\t\t\t\t//Minify and obfuscate if required.\n\t\t\t\tif( minify && (isJs || isHtml) && !isMin ) {\n\t\t\t\t\tif( !noSwap ) code = Swapify( code, false );\n\t\t\t\t\tif( !isHtml ) code = Uglify( title, code );\n\t\t\t\t}\n\t\t\t\tzip.AddText( name+\"/\"+newtitle, code );\n\t\t\t}\n\t\t\telse zip.AddFile( name+\"/\"+newtitle, fldr+\"/\"+title );\n\t\t}\n\t\telse\n\t\t\tAddFolderWithScan( zip, name+\"/\"+title, fldr+\"/\"+title, appName, minify, false, noSwap );\n\t}\n}",
"title": ""
}
] | [
{
"docid": "0d8608b2aba8a4522cb49ba90f26566b",
"score": "0.6691969",
"text": "function AddFolder( zip, name, fldr )\n{\n\tvar list = app.ListFolder( fldr,\"\");\n\tfor( var i=0; i<list.length; i++ )\n\t{\n\t\tvar title = list[i];\n\t\tif( !app.IsFolder( fldr+\"/\"+title ) )\n\t\t\tzip.AddFile( name+\"/\"+title.replace(\".js\",\".js.txt\"), fldr+\"/\"+title );\n\t\telse\n\t\t\tAddFolder( zip, name+\"/\"+title, fldr+\"/\"+title );\n\t}\n}",
"title": ""
},
{
"docid": "ca32bd112a3e9e27e146e9e74b1807ed",
"score": "0.64518124",
"text": "async function addContents(folder) {\n let folderBit = 1 << 14;\n let names = await fs.readdir(root + folder);\n for (let name of names) {\n let path = folder + name;\n let stat = await fs.stat(root + path);\n if ((stat.mode & folderBit) != 0) path = path + \"/\";\n paths.add(path);\n }\n}",
"title": ""
},
{
"docid": "d2d78614ee1c2d3538168cfb98635ae6",
"score": "0.6451006",
"text": "async function addContents(folder) {\n var folderBit = 1 << 14;\n var names = await fs.readdir(root + folder);\n for (var name of names) {\n var path = folder + name;\n var stat = await fs.stat(root + path);\n if ((stat.mode & folderBit) != 0) path = path + \"/\";\n paths.add(path);\n }\n}",
"title": ""
},
{
"docid": "823436cb3ec1198e90033e1a88c1066d",
"score": "0.61942136",
"text": "function getZip ()\n{\n var zip = new JSZip();\n var iptEls = document.querySelectorAll('#directory');\n [].forEach.call(iptEls, function(iptEl) {\n console.log(iptEl.files);\n $.each(iptEl.files,function(i,file){\n zip.file(file.webkitRelativePath, file, {\n createFolders: true // default value\n });\n })\n zip.folder(\".git\");\n })\n return zip;\n}",
"title": ""
},
{
"docid": "17398e7918b7436a83aba9a53e8837b7",
"score": "0.58366483",
"text": "function recursiveDownload(parentUL, parentZip, promises)\n{\n // Current zip folder\n let name = parentUL.getAttribute('data-name');\n let folderZip = parentZip.folder(name);\n\n // Iterates over the folder content\n for (let child of parentUL.children)\n {\n // Folder: recursive call\n if (child.classList.contains('folder-subfolder'))\n {\n recursiveDownload(child.children[0], folderZip, promises);\n }\n // File: downloads the associated audio file\n else if (child.classList.contains('audio-file'))\n {\n // Audio file URL\n let href = child.getAttribute('href');\n\n // Fetches the audio file\n let promise = downloadFile(href, (blob) =>\n {\n // Adds the audio file to the zip (current folder)\n let filename = filenameWithoutPath(href, true);\n folderZip.file(filename, blob);\n });\n\n // Used to wait for each download to complete\n promises.push(promise);\n }\n }\n}",
"title": ""
},
{
"docid": "f4689909950a944788958d79a746d414",
"score": "0.5812285",
"text": "async function zip() {\n /* eslint-disable no-unused-vars */\n zipdir('build', { saveTo: 'app.zip' }, (err, buffer) => {});\n /* eslint-enable no-unused-vars */\n}",
"title": ""
},
{
"docid": "6d4020178d6d5999f56f94e716ea17c6",
"score": "0.5709294",
"text": "uploadCartridges (\n pathToCartridgesDir,\n notify = () => {},\n isCartridge = false,\n isDirectory = false,\n options = {}\n ) {\n\n const rimraf = require('rimraf'),\n walk = require('walk'),\n yazl = require('yazl'),\n fs = require('fs'),\n {ignoreList = ['node_modules', '\\\\.git']} = options;\n\n const processingFolder = pathToCartridgesDir.split(path.sep).pop();\n\n const cartridgesPackagePath = path.join(pathToCartridgesDir, 'cartridges.zip');\n\n return new Promise((resolve, reject) => {\n notify('Deleting local zip');\n rimraf(cartridgesPackagePath, () => {\n notify(`[${processingFolder}] Adding files to zip`);\n const walker = walk.walk(pathToCartridgesDir, {\n filters: ignoreList\n });\n\n const zipFile = new yazl.ZipFile();\n\n walker.on('end', () => {\n zipFile.end();\n notify(`[${processingFolder}] Zipping...`);\n });\n /**\n * When we have an empty Directory(eg, newly created cartridge), walking on \"file\" doesn't work.\n * So, we walk on \"directories\" and call function \"addEmptyDirectory\" to add\n * EMPTY DIRS to ZIP\n */\n if (isDirectory) {\n walker.on('directories', function (root, stats, next) {\n stats.forEach(function (stat) {\n const file = path.resolve(root, stat.name);\n const toFile = path.relative(isCartridge ?\n pathToCartridgesDir.replace(processingFolder, '') :\n pathToCartridgesDir, path.resolve(root, stat.name));\n zipFile.addEmptyDirectory(toFile);\n });\n next();\n });\n } else {\n walker.on('file', (root, fileStat, next) => {\n console.log(\"walking file\");\n const file = path.resolve(root, fileStat.name);\n const toFile = path.relative(isCartridge ?\n pathToCartridgesDir.replace(processingFolder, '') :\n pathToCartridgesDir, path.resolve(root, fileStat.name));\n\n zipFile.addFile(file, toFile);\n next();\n });\n }\n\n walker.on('errors', (root, nodeStatsArray, next) => {\n reject(new Error('Read file error' + root));\n next();\n });\n\n zipFile.outputStream\n .pipe(fs.createWriteStream(cartridgesPackagePath)).on('close', () => {\n notify(`[${processingFolder}] Deleting remote zip`);\n this.delete(cartridgesPackagePath).then(() => {\n notify(`[${processingFolder}] Sending new zip to remote`);\n this.post(cartridgesPackagePath, pathToCartridgesDir).then(() => {\n notify(`[${processingFolder}] Unzipping remote zip`);\n this.unzip(cartridgesPackagePath, pathToCartridgesDir).then(() => {\n rimraf(cartridgesPackagePath, resolve);\n }, reject);\n },\n reject)\n });\n });\n });\n });\n }",
"title": ""
},
{
"docid": "b2645590b95e14e31e5fd5b440700f56",
"score": "0.56325436",
"text": "function initFileZip(){\n //nothing here => just set on listRelativePathZip\n}",
"title": ""
},
{
"docid": "2daf36b812d34c41ad69356c0e0b9ad6",
"score": "0.56228226",
"text": "createZipArchive (directory, zipName, ignore) {\n return new Promise((resolve, reject) => {\n const output = fs.createWriteStream(zipName);\n const archive = archiver(\"zip\", {\n zlib: { level: 9 },\n });\n\n output.on(\"close\", () => {\n // return size of archive in bytes\n resolve(archive.pointer());\n });\n\n // \"good practice to catch warnings (ie stat failures and other non-blocking errors)\"\n archive.on(\"warning\", warn => {\n if (warn.code === \"ENOENT\") {\n // log warning\n console.log(`Warning: ${warn.message}`);\n } else {\n reject(warn);\n }\n });\n\n // \"good practice to catch this error explicitly\"\n archive.on(\"error\", reject);\n\n // pipe archive data to the file\n archive.pipe(output);\n\n archive.glob(\n \"**/*\",\n {\n cwd: directory,\n ignore,\n },\n {}\n );\n\n archive.finalize();\n });\n }",
"title": ""
},
{
"docid": "c239592f2c61d244046bd2a05d8c5dd5",
"score": "0.55295664",
"text": "async function additionalFilesAddFolder() {\r\n let folder = await eel.ask_folder()();\r\n let destination;\r\n if (folder.split('/').length > 1) { // If we can find the last folder in the path, use that\r\n destination = folder.split('/').pop() + '/';\r\n } else { // If we can't find a last folder, use assets/\r\n destination = 'assets/';\r\n }\r\n additionalFilesAdd(folder, destination);\r\n}",
"title": ""
},
{
"docid": "97248e0fd5f84fa64000cf89ecda797b",
"score": "0.55234003",
"text": "function fs_JSZip (exports,data,zipWrap,JSZip,nodePath,cb) {\n \n if (!(typeof JSZip!=='undefined' && typeof JSZip.loadAsync === 'function' ) ) return;\n \n JSZip.loadAsync(data).then(function (zip) {\n var\n ab2str = function ab2str(buf) {\n return String.fromCharCode.apply(null, new Uint16Array(buf));\n },\n str2ab = function str2ab(str) {\n var buf = new ArrayBuffer(str.length*2); // 2 bytes for each char\n var bufView = new Uint16Array(buf);\n for (var i=0, strLen=str.length; i < strLen; i++) {\n bufView[i] = str.charCodeAt(i);\n }\n return buf;\n },\n cwd = \"/\";\n \n zipWrap(zip,nodePath,function(wrapped,totalBytes){\n \n var\n find_entry_from_path=function find_entry_from_path(path){\n var\n \n zip_fn = path,\n found = zip.files[zip_fn];\n \n if (!found) {\n if (!(found = zip.files[(zip_fn = path+\"/\")])) {\n if (!(found = zip.files[(zip_fn = path.substr(1))] )) {\n if (!(found = zip.files[(zip_fn = zip_fn+\"/\")])){\n zip_fn=path;\n if (zip_fn===\"/\") {\n found = {\n name : \"/\",\n dir : true\n };\n }\n }\n }\n }\n }\n \n return {\n found : found,\n zip_fn : zip_fn\n };\n },\n \n zip_fn_from_path = function zip_fn_from_path(path){return find_entry_from_path(path).zip_fn;},\n \n zip_resolve=function zip_resolve(path) {\n // 1) resolve true_path (reduce any double slashes to single slashes:\n // \".\" --> cwd (default \"/\")\n // \"./file.ext\" --> cwd/file.ext ( default \"/file.ext\")\n // \"file.text\" --> cwd/file.ext ( default \"/file.ext\")\n // \"/some/other/path/file.ext\" --> \"/some/other/path/file.ext\"\n // \"/some///other/path/file.ext\" --> \"/some/other/path/file.ext\"\n // 2) get full file list from zip.files, and fixup any entries that don't have leading /\n // \"path/file.ext\" --> \"/path/file.ext\"\n // \"file.ext\" --> \"/file.ext\"\n // \"/some/other/path/file.ext\" --> \"/some/other/path/file.ext\"\n // 3) lookup true_path in fixed file list, call any match \"found\"\n // 4) return all this info to caller in standardzed format\n \n var errpath = path;\n \n path = wrapped.true_path_from_relative_path(cwd,path);\n \n var\n dir_basename = path.split(\"/\"),\n basename = dir_basename.pop(),\n dirname = '/'+dir_basename.filter(function(f){return f.length>0;}).join(\"/\"),\n find = find_entry_from_path(path);\n return {\n path : errpath, // what user passed in\n true_path : path, // force \"path/to/sub/file.ext\" ---> \"/path/to/sub/file.ext\"\n zip_fn : find.zip_fn, // what the file is called in the zip\n // (in some cases files won't have leading slash, and may have trailing slash. true_path is normalized, zip_fn is actual fn in the zip)\n basename : basename, // \"/path/to/sub\"\n dirname : dirname, // \"file.ext\"\n ext : basename.split(\".\").pop(), //\"ext\"\n found : find.found, // directory entry (if path exists in zip)\n dir_filter: find.found && find.found.dir ? (path === \"/\" ? path:path + \"/\") : undefined,\n error : function(err,code,errno,syscall) {\n err.code = code;\n err.errno = errno;\n err.syscall = syscall;\n err.path = errpath;\n return err;\n }\n };\n \n },\n \n \n fs_process = {\n cwd : function getCwd(path) {\n return cwd;\n },\n chdir : function (path) {\n var lookup = zip_resolve(path);\n console.log({lookup});\n \n if (lookup.found && lookup.found.dir) {\n cwd=lookup.dir_filter;\n } else {\n throw lookup.error(\n new Error (\"ENOENT: no such file or directory, chdir '\"+path+\"'\"),\n 'ENOENT',\n -2,\n 'chdir'\n );\n }\n }\n },\n \n fs_constants = {\n UV_FS_SYMLINK_DIR: 1,\n UV_FS_SYMLINK_JUNCTION: 2,\n O_RDONLY: 0,\n O_WRONLY: 1,\n O_RDWR: 2,\n UV_DIRENT_UNKNOWN: 0,\n UV_DIRENT_FILE: 1,\n UV_DIRENT_DIR: 2,\n UV_DIRENT_LINK: 3,\n UV_DIRENT_FIFO: 4,\n UV_DIRENT_SOCKET: 5,\n UV_DIRENT_CHAR: 6,\n UV_DIRENT_BLOCK: 7,\n S_IFMT: 61440,\n S_IFREG: 32768,\n S_IFDIR: 16384,\n S_IFCHR: 8192,\n S_IFBLK: 24576,\n S_IFIFO: 4096,\n S_IFLNK: 40960,\n S_IFSOCK: 49152,\n O_CREAT: 64,\n O_EXCL: 128,\n UV_FS_O_FILEMAP: 0,\n O_NOCTTY: 256,\n O_TRUNC: 512,\n O_APPEND: 1024,\n O_DIRECTORY: 65536,\n O_NOATIME: 262144,\n O_NOFOLLOW: 131072,\n O_SYNC: 1052672,\n O_DSYNC: 4096,\n O_DIRECT: 16384,\n O_NONBLOCK: 2048,\n S_IRWXU: 448,\n S_IRUSR: 256,\n S_IWUSR: 128,\n S_IXUSR: 64,\n S_IRWXG: 56,\n S_IRGRP: 32,\n S_IWGRP: 16,\n S_IXGRP: 8,\n S_IRWXO: 7,\n S_IROTH: 4,\n S_IWOTH: 2,\n S_IXOTH: 1,\n F_OK: 0,\n R_OK: 4,\n W_OK: 2,\n X_OK: 1,\n UV_FS_COPYFILE_EXCL: 1,\n COPYFILE_EXCL: 1,\n UV_FS_COPYFILE_FICLONE: 2,\n COPYFILE_FICLONE: 2,\n UV_FS_COPYFILE_FICLONE_FORCE: 4,\n COPYFILE_FICLONE_FORCE: 4\n },\n \n getOptionsWithEncodingCallback = function getOptionsWithEncodingCallback(options,callback) {\n function throwOpts(){\n return new Error ( 'The \"options\" argument must be one of type string or Object. Received type '+typeof options);\n }\n switch (typeof options) {\n case 'function':\n if (callback===false) {\n throw throwOpts();\n }\n callback = options;\n options = {\n callback : callback\n };\n break;\n case 'undefined':\n options = {\n callback : callback\n };\n break;\n case 'string':\n options = {\n encoding : options,\n callback : callback\n };\n break;\n case 'object':\n options.callback = callback;\n break;\n default:\n throw throwOpts();\n }\n \n if (callback!==false && typeof options.callback!=='function') {\n throw new Error (\"Callback must be a function. Received \"+typeof options.callback);\n }\n \n options.__zipWrap_opts = {binary:[\"utf8\",\"utf-8\"].indexOf(options.encoding)<0};\n options.__zipWrap_method = options.__zipWrap_opts.binary?\"arraybuffer\":\"string\";\n \n return options;\n },\n getPromiserForOptionsWithEncodingCallback = function getPromiserForOptionsWithEncodingCallback (requester) {\n var promiser = function (path, options) {\n return new Promise(function(resolve,reject){\n options = getOptionsWithCallback(options,function(err,result){\n if (err) return reject(err);\n return resolve(result);\n });\n setTimeout(requester,0,path,options,options.callback);\n });\n };\n promiser.name=requester.name;\n return promiser;\n },\n getOptionsWithCallback = function getOptionsWithCallback(options,callback) {\n function throwOpts(){\n return new Error ( 'The \"options\" argument must be one of type string or Object. Received type '+typeof options);\n }\n switch (typeof options) {\n case 'function':\n if (callback===false) {\n throw throwOpts();\n }\n callback = options;\n options = {\n callback : callback\n };\n break;\n case 'undefined':\n options = {\n callback : callback\n };\n break;\n case 'object':\n options.callback = callback;\n break;\n default:\n throw throwOpts();\n }\n \n if (callback!==false && typeof options.callback!=='function') {\n throw file.error(\n new Error (\n \"Callback must be a function. Received \"+typeof options.callback),\n 'ERR_INVALID_CALLBACK'\n );\n }\n \n return options;\n },\n getPromiserForOptionsWithCallback = function getPromiserForOptionsWithCallback (requester) {\n var promiser = function (path, options) {\n return new Promise(function(resolve,reject){\n options = getOptionsWithCallback(options,function(err,result){\n if (err) return reject(err);\n return resolve(result);\n });\n setTimeout(requester,0,path,options,options.callback);\n });\n };\n promiser.name=requester.name;\n return promiser;\n },\n getFlagsWithCallback = function getFlagsWithCallback(flags,callback) {\n function throwOpts(){\n return new Error ( 'The \"flags\" argument must be number. Received type '+typeof options);\n }\n var options = {\n callback : callback\n };\n switch (typeof flags) {\n case 'function':\n if (callback===false) {\n throw throwOpts();\n }\n callback = flags;\n options.callback = callback;\n break;\n case 'number':\n options.COPYFILE_EXCL = (flags & fs_constants.COPYFILE_EXCL)!==0;\n break;\n default:\n throw throwOpts();\n }\n \n if (callback!==false && typeof options.callback!=='function') {\n throw file.error(\n new Error (\n \"Callback must be a function. Received \"+typeof options.callback),\n 'ERR_INVALID_CALLBACK'\n );\n }\n \n return options;\n },\n getPromiserForCopyFile = function getPromiserForCopyFile (requester) {\n var promiser = function (src,dest,flags) {\n return new Promise(function(resolve,reject){\n var options = getFlagsWithCallback(flags,function(err,result){\n if (err) return reject(err);\n return resolve(result);\n });\n setTimeout(requester,0,src,dest,flags,options.callback);\n });\n };\n promiser.name=requester.name;\n return promiser;\n },\n getPromiserForRename = function getPromiserForRename (requester) {\n var promiser = function (oldName,newName) {\n return new Promise(function(resolve,reject){\n setTimeout(requester,0,oldName,newName,function(err,result){\n if (err) return reject(err);\n return resolve(result);\n });\n });\n };\n promiser.name=requester.name;\n return promiser;\n },\n getPromiserForCallback =function getPromiserForCallback (requester) {\n var promiser = function (path) {\n return new Promise(function(resolve,reject){\n setTimeout(requester,0,path,function(err,result){\n if (err) return reject(err);\n return resolve(result);\n });\n });\n };\n promiser.name=requester.name;\n return promiser;\n },\n \n \n readdir = function readdir(path, options, callback) {\n if (typeof options==='function') {\n callback=options;\n options={};\n }\n try {\n setTimeout(callback,0,null,wrapped.view_dir(path).get_listing(options&&options.recursive));\n } catch (err) {\n return callback(err);\n }\n },\n readdirSync = function readdirSync(path,options){\n return wrapped.view_dir(path).get_listing( options && options.recursive );\n },\n \n readFile = function readFile(path, options, callback) {\n options = getOptionsWithEncodingCallback(options,callback);\n wrapped[ options.__zipWrap_method ][path](options.callback);\n },\n readFileSync = function readFileSync(path, options){\n options = getOptionsWithEncodingCallback(options,false);\n return wrapped[ options.__zipWrap_method ][path]();\n },\n \n writeFile = function writeFile(path, data, options, callback) {\n options = getOptionsWithEncodingCallback(options,callback);\n wrapped[ options.__zipWrap_method ] = data;\n setTimeout(options.callback,0,null);\n },\n writeFileSync = function writeFileSync(path, data, options) {\n options = getOptionsWithEncodingCallback(options,false);\n wrapped[ options.__zipWrap_method ] = data;\n },\n \n mkdir = function mkdir(path, options, callback){\n options = getOptionsWithCallback(options,callback);\n \n if (options.recursive) {\n wrapped.mkdirp(path,options.callback);\n } else {\n wrapped.mkdir(path,options.callback);\n }\n },\n mkdirSync = function mkdirSync(path, options) {\n options = getOptionsWithCallback(options,false);\n \n if (options.recursive) {\n wrapped.mkdirp(path);\n } else {\n wrapped.mkdir(path);\n }\n },\n exists = function exists(path, callback) {\n return wrapped.exists(path,callback );\n },\n existsSync = function exists(path) {\n return wrapped.exists(path);\n },\n \n rmdir = function rmdir(path, options, callback) {\n options = getOptionsWithCallback(options,callback);\n \n if (options.recursive) {\n wrapped.rm(path,options.callback);\n } else {\n wrapped.rmdir(path,options.callback);\n }\n },\n rmdirSync = function rmdir(path, options) {\n options = getOptionsWithCallback(options,false);\n if (options.recursive) {\n wrapped.rm(path);\n } else {\n wrapped.rmdir(path);\n }\n },\n unlink = function unlink(path, callback) {\n wrapped.rm(path,callback);\n },\n unlinkSync = function unlinkSync(path) {\n wrapped.rm(path);\n },\n stat = function stat(path, options, callback) {\n options = getOptionsWithCallback(options,callback);\n return wrapped.stat(path,options.callback);\n },\n statSync = function stat(path, options) {\n options = getOptionsWithCallback(options,false);\n return wrapped.stat(path);\n },\n appendFile = function appendFile(path, data, options, callback){\n \n options = getOptionsWithEncodingCallback(options,callback);\n wrapped.string[path](\n function (err,existingData) {\n if (err) return options.callback(err);\n if (options.__zipWrap_method!==\"string\") {\n data = ab2str(data);\n }\n wrapped.string[path] = existingData + data;\n options.callback();\n }\n );\n \n },\n appendFileSync = function appendFileSync(path, data, options) {\n options = getOptionsWithEncodingCallback(options,false);\n if (options.__zipWrap_method!==\"string\") {\n data = ab2str(data);\n }\n wrapped.string[path] = wrapped.string[path]() + data;\n },\n rename = function rename(oldPath, newPath, callback) {\n return wrapped.mv(oldPath,newPath,callback);\n },\n renameSync = function renameSync(oldPath, newPath) {\n return wrapped.mv(oldPath,newPath);\n },\n copyFile = function copyFile(src, dest, flags, callback) {\n var options = getFlagsWithCallback(flags,callback);\n if (options.COPYFILE_EXCL && wrapped.exists(dest)) {\n return options.callback(new Error(dest+\" exists (options.COPYFILE_EXCL set)\"));\n }\n return wrapped.cp(src,dest,options.callback);\n },\n copyFileSync = function copyFileSync(src, dest, flags ) {\n var options = getFlagsWithCallback(flags,false);\n if (options.COPYFILE_EXCL && wrapped.exists(dest)) {\n throw new Error(dest+\" exists (options.COPYFILE_EXCL set)\");\n }\n return wrapped.cp(src,dest);\n },\n watching = {},\n watch = function watch(filename, options, listener) {\n return wrapped.addWatcher(filename, options, function(a,b) {\n listener(a,b);\n });\n },\n watchFile = function watchFile(filename, options, listener) {\n if (typeof options === 'function') {\n listener = options;\n options = {\n interval : 5007\n };\n }\n watchFile.watchers = watchFile.watchers || {};\n var watchers = watchFile.watchers[filename]||[];\n watchFile.watchers[filename]=watchers;\n \n wrapped.stat(filename,function(err,firstStat) {\n \n var prev= firstStat;\n listener.watcher = wrapped.addWatcher(filename, options, function(a,b,curr){\n listener(curr,prev);\n prev=curr;\n });\n \n watchers.push(listener);\n \n });\n },\n unwatchFile = function unwatchFile(filename, listener) {\n if (watchFile.watchers) {\n var watchers = watchFile.watchers[filename];\n if (watchers) {\n if (listener){\n if (listener.watcher) {\n listener.watcher.close();\n delete listener.watcher;\n }\n var index = watchers.indexOf(listener);\n if (index>=0) watchers.splice(index,1);\n if (watchers.length===0) {\n delete watchFile.watchers[filename];\n }\n } else {\n // remove all listeners\n while (watchers.length>0) {\n var list = watchers.shift();\n if (list.watcher) {\n list.watcher.close();\n delete list.watcher;\n }\n }\n delete watchFile.watchers[filename];\n }\n }\n }\n },\n \n tests = function (cb) {\n \n \n console.log({testing_with:wrapped.view_dir(\"/\",true).listing});\n \n test_mkdir(function(){\n console.log(\"test_mkdir passes\");\n test_mkdirSync();\n console.log(\"test_mkdirSync passes\");\n test_exists(function(){\n console.log(\"test_exists passes\");\n test_existsSync();\n console.log(\"test_existsSync passes\");\n test_rmdir(function(){\n console.log(\"test_rmdir passes\");\n \n test_readFile(function(){\n console.log(\"test_readFile passes\");\n test_writeFile(function(){\n console.log(\"test_writeFile passes\");\n cb();\n });\n });\n \n });\n });\n });\n \n try {\n readFileSync(\"/jszip_test/hello-world.txt\",\"utf8\");\n } catch (e) {\n console.log(e.message);\n }\n \n \n \n function test_mkdirSync() {\n mkdirSync (\"newdir\");\n mkdirSync (\"newdir/more/paths/here\",{recursive:true});\n var erred;\n try {\n mkdirSync (\"badroot/more/paths/here\");\n erred=new Error(\"non recursive deep shoukd have failed\");\n } catch (e) {\n \n }\n if (erred) {\n throw erred;\n }\n \n try {\n mkdirSync (\"newdir\");\n erred=new Error(\"already exist should have failed\");\n } catch (e) {\n \n }\n if (erred) {\n throw erred;\n }\n \n try {\n mkdirSync (\"/\");\n erred=new Error(\"/ should have failed\");\n } catch (e) {\n \n }\n if (erred) {\n throw erred;\n }\n \n }\n \n function test_mkdir(cb) {\n \n mkdir(\"newdir2\",function(err){\n if (err) {\n throw err;\n }\n mkdir(\"newdir2\",function(err){\n if (!err) {\n throw new Error(\"already exist should have failed\");\n }\n mkdir (\"newdir2/more/paths/here\",{recursive:true},function(err){\n if (err) {\n throw err;\n }\n \n mkdir (\"badroot/more/paths/here\",function(err){\n if (!err) {\n throw new Error(\"non recursive deep shoukd have failed\");\n }\n setTimeout(cb,1);\n });\n });\n \n });\n });\n \n }\n \n function test_exists(cb) {\n exists(\"thisshouldnotexist\",function(EXISTS){\n if (EXISTS) {\n throw new Error (\"file should not exist\");\n }\n \n exists(\".\",function(EXISTS){\n \n \n if (!EXISTS) {\n throw new Error (\"file . should exist\");\n }\n \n \n exists(\"/\",function(EXISTS){\n if (!EXISTS) {\n throw new Error (\"file / should exist\");\n }\n \n exists(\"newdir\",function(EXISTS){\n if (!EXISTS) {\n throw new Error (\"file newdir should exist\");\n }\n \n exists(\"newdir2/more/paths/here\",function(EXISTS){\n if (!EXISTS) {\n throw new Error (\"file newdir2/more/paths/here should exist\");\n }\n exists(\"badroot/more/paths/here\",function(EXISTS){\n if (EXISTS) {\n throw new Error (\"file badroot/more/paths/here should not exist\");\n }\n \n setTimeout(cb,1);\n });\n });\n });\n });\n \n });\n });\n }\n \n function test_existsSync() {\n \n \n if (existsSync(\"thisshouldnotexist\")) {\n throw new Error (\"file should not exist\");\n }\n \n if (!existsSync(\".\")){\n throw new Error (\"file . should exist\");\n }\n \n \n if (!existsSync(\"/\")){\n throw new Error (\"file / should exist\");\n }\n \n if (!existsSync(\"newdir\")){\n throw new Error (\"file newdir should exist\");\n }\n \n if (!existsSync(\"newdir2/more/paths/here\")){\n throw new Error (\"file newdir2/more/paths/here should exist\");\n }\n if (existsSync(\"badroot/more/paths/here\")){\n throw new Error (\"file badroot/more/paths/here should not exist\");\n }\n }\n \n function test_rmdir(cb) {\n \n rmdir(\"this-path-should-not-exist\",function(err){\n if (!err) {\n throw new Error(\"rmdir on non existant path shoud fail\");\n }\n rmdir(\"newdir\",function(err){\n if (!err) {\n throw new Error(\"rmdir on non empty path should fail\");\n }\n \n \n rmdir(\"newdir2/more/paths/here\",function(err){\n if (!err) {\n throw new Error(\"rmdir on deep path - non recursive should have failed\");\n }\n \n rmdir(\"newdir2/more/paths\",{recursive:true},function(err){\n if (err) {\n throw new Error(\"recursive rmdir failed\");\n }\n \n \n setTimeout(cb,1);\n \n \n });\n \n \n });\n \n \n });\n \n });\n \n \n }\n \n function test_readFile(cb){\n readFile(\"jszip_test/hello-world.txt\",\"utf8\",function(err,data){\n if (err) throw err;\n if (data.trim()!==\"hello world\") throw \"readFile test 1 failed\";\n \n readFile(\"./jszip_test/hello-world.txt\",\"utf8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"hello world\") throw \"readFile test 2 failed\";\n \n readFile(\"jszip_test/hello-world.txt\",\"utf-8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"hello world\") throw \"readFile test 3 failed\";\n \n readFile(\"./jszip_test/hello-world.txt\",\"utf-8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"hello world\") throw \"readFile test 4 failed\";\n \n readFile(\"/jszip_test/hello-world.txt\",\"utf8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"hello world\") throw \"readFile test 5 failed\";\n \n readFile(\"/jszip_test/hello-world.txt\",\"utf-8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"hello world\") throw \"readFile test 6 failed\";\n \n readFile(\"jszip_test/subdir/under/the/main/directory/harry_potter.txt\",\"utf-8\",function(err,data){\n if (err) throw err;\n \n if (data.trim()!==\"ok it should be under the stairs.\") throw \"readFile test 7 failed\";\n \n setTimeout(cb,1);\n \n });\n \n });\n \n });\n \n });\n \n });\n \n \n });\n \n });\n }\n \n function test_writeFile(cb) {\n \n console.log(readdirSync(\"/\"));\n \n \n writeFile(\"test.txt\",\"utf8\",\"yeah\",function(err){\n if (err) throw err;\n \n console.log(readdirSync(\"/\"));\n cb(err);\n \n });\n }\n \n \n },\n \n fs = {\n /*impl*/\"appendFile\": {\n \"value\": appendFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"appendFileSync\": {\n \"value\": appendFileSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"access\": {\n \"value\": function access(path, mode, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"accessSync\": {\n \"value\": function accessSync(path, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chown\": {\n \"value\": function chown(path, uid, gid, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chownSync\": {\n \"value\": function chownSync(path, uid, gid) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chmod\": {\n \"value\": function chmod(path, mode, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chmodSync\": {\n \"value\": function chmodSync(path, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"close\": {\n \"value\": function close(fd, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"closeSync\": {\n \"value\": function closeSync(fd) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"copyFile\": {\n \"value\": copyFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"copyFileSync\": {\n \"value\": copyFileSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"createReadStream\": {\n \"value\": function createReadStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"createWriteStream\": {\n \"value\": function createWriteStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"exists\": {\n \"value\": exists,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"existsSync\": {\n \"value\": existsSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fchown\": {\n \"value\": function fchown(fd, uid, gid, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fchownSync\": {\n \"value\": function fchownSync(fd, uid, gid) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fchmod\": {\n \"value\": function fchmod(fd, mode, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fchmodSync\": {\n \"value\": function fchmodSync(fd, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fdatasync\": {\n \"value\": function fdatasync(fd, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fdatasyncSync\": {\n \"value\": function fdatasyncSync(fd) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fstat\": {\n \"value\": function fstat(fd, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fstatSync\": {\n \"value\": function fstatSync(fd, options = {}) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fsync\": {\n \"value\": function fsync(fd, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"fsyncSync\": {\n \"value\": function fsyncSync(fd) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"ftruncate\": {\n \"value\": function ftruncate(fd, len, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"ftruncateSync\": {\n \"value\": function ftruncateSync(fd, len = 0) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"futimes\": {\n \"value\": function futimes(fd, atime, mtime, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"futimesSync\": {\n \"value\": function futimesSync(fd, atime, mtime) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lchown\": {\n \"value\": function lchown(path, uid, gid, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lchownSync\": {\n \"value\": function lchownSync(path, uid, gid) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"link\": {\n \"value\": function link(existingPath, newPath, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"linkSync\": {\n \"value\": function linkSync(existingPath, newPath) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lstat\": {\n \"value\": function lstat(path, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lstatSync\": {\n \"value\": function lstatSync(path, options = {}) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"mkdir\": {\n \"value\": mkdir,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"mkdirSync\": {\n \"value\": mkdirSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"mkdtemp\": {\n \"value\": function mkdtemp(prefix, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"mkdtempSync\": {\n \"value\": function mkdtempSync(prefix, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"open\": {\n \"value\": function open(path, flags, mode, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"openSync\": {\n \"value\": function openSync(path, flags, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"opendir\": {\n \"value\": function opendir(path, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"opendirSync\": {\n \"value\": function opendirSync(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"readdir\": {\n \"value\": readdir,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"readdirSync\": {\n \"value\": readdirSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"read\": {\n \"value\": function read(fd, buffer, offset, length, position, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readSync\": {\n \"value\": function readSync(fd, buffer, offset, length, position) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"readFile\": {\n \"value\": readFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"readFileSync\": {\n \"value\": readFileSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readlink\": {\n \"value\": function readlink(path, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readlinkSync\": {\n \"value\": function readlinkSync(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"realpath\": {\n \"value\": function realpath(p, options, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"realpathSync\": {\n \"value\": function realpathSync(p, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"rename\": {\n \"value\": rename,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"renameSync\": {\n \"value\": renameSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"rmdir\": {\n \"value\": rmdir,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"rmdirSync\": {\n \"value\": rmdirSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"stat\": {\n \"value\": stat,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"statSync\": {\n \"value\": statSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"symlink\": {\n \"value\": function symlink(target, path, type_, callback_) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"symlinkSync\": {\n \"value\": function symlinkSync(target, path, type) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"truncate\": {\n \"value\": function truncate(path, len, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"truncateSync\": {\n \"value\": function truncateSync(path, len) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"unwatchFile\": {\n \"value\": unwatchFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"unlink\": {\n \"value\": unlink,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"unlinkSync\": {\n \"value\": unlinkSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"utimes\": {\n \"value\": function utimes(path, atime, mtime, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"utimesSync\": {\n \"value\": function utimesSync(path, atime, mtime) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"watch\": {\n \"value\": watch,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"watchFile\": {\n \"value\": watchFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"writeFile\": {\n \"value\": writeFile,\n \"configurable\": true,\n \"enumerable\": true\n },\n /*impl*/\"writeFileSync\": {\n \"value\": writeFileSync,\n \"configurable\": true,\n \"enumerable\": true\n },\n \"write\": {\n \"value\": function write(fd, buffer, offset, length, position, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"writeSync\": {\n \"value\": function writeSync(fd, buffer, offset, length, position) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"writev\": {\n \"value\": function writev(fd, buffers, position, callback) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"writevSync\": {\n \"value\": function writevSync(fd, buffers, position) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"Dir\": {\n \"value\": function Dir(handle, path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"Dirent\": {\n \"value\": function Dirent(name, type) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"Stats\": {\n \"value\": function Stats(dev, mode, nlink, uid, gid, rdev, blksize,\n ino, size, blocks,\n atimeMs, mtimeMs, ctimeMs, birthtimeMs) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"ReadStream\": {\n \"value\": function ReadStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"WriteStream\": {\n \"value\": function WriteStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"FileReadStream\": {\n \"value\": function FileReadStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"FileWriteStream\": {\n \"value\": function FileWriteStream(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"_toUnixTimestamp\": {\n \"value\": function _toUnixTimestamp(time, name = 'time') {\n var __native = function toUnixTimestamp(time, name = 'time') {\n // eslint-disable-next-line eqeqeq\n if (typeof time === 'string' && +time == time) {\n return +time;\n }\n if (Number.isFinite(time)) {\n if (time < 0) {\n return Date.now() / 1000;\n }\n return time;\n }\n if (isDate(time)) {\n // Convert to 123.456 UNIX timestamp\n return time.getTime() / 1000;\n }\n throw new ERR_INVALID_ARG_TYPE(name, ['Date', 'Time in seconds'], time);\n };\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"promises\": {\n \"access\": {\n \"value\": function access(path, mode = F_OK) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"copyFile\": {\n \"value\": getPromiserForCopyFile (copyFile),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"open\": {\n \"value\": function open(path, flags, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"opendir\": {\n \"value\": function opendir(...args) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"rename\": {\n \"value\": getPromiserForRename(rename),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"truncate\": {\n \"value\": function truncate(path, len = 0) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"rmdir\": {\n \"value\": getPromiserForOptionsWithCallback(rmdir),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"mkdir\": {\n \"value\": getPromiserForOptionsWithCallback(mkdir),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readdir\": {\n \"value\": getPromiserForOptionsWithCallback(readdir),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readlink\": {\n \"value\": function readlink(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"symlink\": {\n \"value\": function symlink(target, path, type_) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lstat\": {\n \"value\": function lstat(path, options = { bigint: false }) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"stat\": {\n \"value\": getPromiserForOptionsWithCallback(stat),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"link\": {\n \"value\": function link(existingPath, newPath) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"unlink\": {\n \"value\": getPromiserForCallback(unlink),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chmod\": {\n \"value\": function chmod(path, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lchmod\": {\n \"value\": function lchmod(path, mode) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"lchown\": {\n \"value\": function lchown(path, uid, gid) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"chown\": {\n \"value\": function chown(path, uid, gid) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"utimes\": {\n \"value\": function utimes(path, atime, mtime) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"realpath\": {\n \"value\": function realpath(path, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"mkdtemp\": {\n \"value\": function mkdtemp(prefix, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"writeFile\": {\n \"value\": getPromiserForOptionsWithEncodingCallback(readFile),\n \"configurable\": true,\n \"enumerable\": true\n },\n \"appendFile\": {\n \"value\": function appendFile(path, data, options) {\n throw new Error (\"not implemented\");\n },\n \"configurable\": true,\n \"enumerable\": true\n },\n \"readFile\": {\n \"value\": getPromiserForOptionsWithEncodingCallback(readFile),\n \"configurable\": true,\n \"enumerable\": true\n }\n }\n };\n \n tests(function(){\n console.log(\"tests passed\");\n cb({fs:Object.defineProperties({},fs),process:fs_process,wrapped:wrapped});\n });\n \n });\n \n }).catch(function(e){ throw(e);});\n \n \n }",
"title": ""
},
{
"docid": "3c4047c8ae636b28121d6b5ec46b7971",
"score": "0.55041075",
"text": "onAddDir(path, event) {\n console.log('Dir Created')\n TreeMaster.addDir(path)\n }",
"title": ""
},
{
"docid": "5ef4a01b406c29641d22408984ca1597",
"score": "0.54899913",
"text": "function walk(dir) {\n return new Promise((resolve, reject) => {\n fs.readdir(dir, (error, files) => {\n if (error) {\n return reject(error);\n }\n Promise.all(files.map((file) => {\n return new Promise((resolve, reject) => {\n const filepath = path.join(dir, file);\n fs.stat(filepath, (error, stats) => {\n if (error) {\n return reject(error);\n }\n if (stats.isDirectory()) {\n walk(filepath).then(resolve);\n } else if (stats.isFile()) {\n resolve(filepath);\n if(filepath.includes('.zip')) {\n FileReplacer(filepath, filepath.replace(dir_name, new_dir_name));\n }\n }\n });\n });\n }))\n .then((foldersContents) => {\n resolve(foldersContents.reduce((all, folderContents) => all.concat(folderContents), []));\n });\n });\n });\n }",
"title": ""
},
{
"docid": "0a720be6e3150eda3b7c4575a0f05bde",
"score": "0.54688776",
"text": "async installModule(app) {\n\n if (this.app.BROWSER == 1) { return; }\n\n await super.installModule(app);\n\n let fs = app.storage.returnFileSystem();\n\n if (fs != null) {\n\n const archiver = require('archiver');\n const path = require('path');\n\n //\n // get a list of module directories\n //\n const getDirectories = source =>\n fs.readdirSync(source, { withFileTypes: true })\n .filter(dirent => dirent.isDirectory())\n .map(dirent => dirent.name)\n\n let mods_dir_path = path.resolve(__dirname, '../');\n let dirs = getDirectories(mods_dir_path);\n\n if (!fs.existsSync(path.resolve(__dirname, `mods`))) {\n fs.mkdirSync(path.resolve(__dirname, `mods`));\n }\n\n //\n // zip each module and output it to modules subdir\n //\n dirs.forEach(dir => {\n\nconsole.log(\"##########################\");\nconsole.log(\"processing: \" + dir);\nconsole.log(\"##########################\");\n\n let mod_path = path.resolve(__dirname, `mods/${dir}.zip`);\n let output = fs.createWriteStream(mod_path);\n\n var archive = archiver('zip', {\n zlib: { level: 9 } // Sets the compression level.\n });\n\n archive.on('error', function (err) {\n throw err;\n });\n\n archive.pipe(output);\n\n let file_array = getFiles(`${mods_dir_path}/${dir}/`);\n\n //\n // append them to the archiver\n //\n file_array.forEach(file => {\n let fileReadStream = fs.createReadStream(file);\n var fileArray = path.relative(process.cwd(), file).split('/');\n fileArray.splice(0, 2);\n let filename = fileArray.join('/');\n // let pathBasename = path.basename(file);\n archive.append(fileReadStream, { name: filename });\n });\n\n // listen for all archive data to be written\n // 'close' event is fired only when a file descriptor is involved\n output.on('close', function () {\n\n let mod_zip_filename = path.basename(this.path);\n let mod_path = path.resolve(__dirname, `mods/${mod_zip_filename}`);\n let newtx = app.wallet.createUnsignedTransactionWithDefaultFee();\n let zip = fs.readFileSync(mod_path, { encoding: 'base64' });\n\n\t //\n\t // TODO - fix \n\t //\n\t // massive zip files bypassing tx size limits cause issues with \n\t // some versions of NodeJS. In others they over-size and fail\n\t // elegantly. adding this check to prevent issues with server\n\t // on start, particularly with Red Imperium.\n\t //\n\t if (zip.length <= 30000000) {\n\n newtx.msg = {\n module: \"AppStore\",\n request: \"submit module\",\n module_zip: zip,\n name: dir,\n };\n\n newtx = app.wallet.signTransaction(newtx);\n app.network.propagateTransaction(newtx);\n\n\t }\n\n });\n\n archive.finalize();\n });\n\n }\n }",
"title": ""
},
{
"docid": "a1b57e7953b04328b8937ede69bd03dc",
"score": "0.5448325",
"text": "function onAddFolder() {\n folderService.addFolder(vm.folder);\n vm.fileList = _getFiles();\n }",
"title": ""
},
{
"docid": "8116d4726b4c7e658893fa9a7e2fbdc3",
"score": "0.5325234",
"text": "buildUp() {\n try {\n const trailStart = this.getPath();\n const dirContent = fs_1.default.readdirSync(trailStart, { withFileTypes: true });\n dirContent.forEach(dirEnt => {\n if (dirEnt.isDirectory()) {\n this.subDirectories.push(new Directory(this, dirEnt.name));\n }\n else if (dirEnt.isFile()) {\n this.files.push(new File(this, dirEnt.name));\n }\n });\n }\n catch (e) {\n this.isLocked = true;\n console.log(\"Dir is locked: \" + this.getPath);\n }\n }",
"title": ""
},
{
"docid": "5162ae17dd63ea315c83e0c32104bfb9",
"score": "0.5292499",
"text": "function addNestedFolder(folder) {\n const ul = document.createElement('ul');\n const li = document.createElement('li');\n\n //Add the folder object to the folders array.\n folders.push(folder);\n\n //Create the DOM elements.\n const folderName = document.createTextNode(folder.name);\n li.appendChild(folderName);\n li.appendChild(ul);\n li.id = folder.name;\n ul.className = 'style';\n li.className = 'folder';\n\n ul.id = 'folder' + folder.name;\n\n //If the user wishes to add the Folder to the 'root' directory.\n if (folder.parentFolderName == 'root') {\n document.getElementsByClassName('root')[0].appendChild(li);\n } else {\n //Add the Folder to an existing folder in the DOM through the user specified folder name.\n document\n .getElementById('folder' + folder.parentFolderName)\n .appendChild(li);\n }\n //Adds in the expanding and collapsing effect of folders during an onClick Event using the slideToggle effect in JQuery.\n $('li > ul').each(function () {\n const parent = $(this).parent();\n $(this).parent().wrapInner(\"<a href='#' />\");\n parent.append($(this));\n $(this)\n .parent()\n .find('a')\n .on('click', function (e) {\n e.preventDefault();\n $(this).siblings('ul').slideToggle('slow');\n });\n });\n }",
"title": ""
},
{
"docid": "07d4c2a2301f122c303ef9511256d783",
"score": "0.5283525",
"text": "function zipFiles() {\n\tlet task = srcFolders.map(function(folder) {\n\t\tlet _src = path.join(paths.src, folder),// Path source files\n\t\t\t\t_dist = path.join(paths.dist, folder),// Path to production files\n\t\t\t\t_dest = paths.zips,\n\t\t\t\t_images = _dist+'/images/';// Path to production image files\n\t\t// Package all files in dist folder\n\t\tlet _final = gulp.src([_dist+'/**/*'],{base:_dist})\n\t\t\t.pipe(zip('_final.zip'))\n\t\t\t.pipe(rename(function(file){file.basename = folder + file.basename;}))\n\t\t\t.pipe(gulp.dest(_dest));\n\n\t\t// Package all source files except node_modules \n\t\t let _source = gulp.src(['*.{json,js,txt}', 'lib/**', paths.partials+'/**/*', _src+'/**/*', paths.zips],{base:'./'})\n\t\t\t.pipe(zip('_source.zip'))\n\t\t\t.pipe(rename(function(file){file.basename = folder + file.basename;}))\n\t\t\t.pipe(gulp.dest(_dest));\n\n\t\tlet _html = gulp.src(_dist+'/*.html').pipe(gulp.dest(_dest));\n\n\t\treturn merge(_final, _html, _source);\n\t});\n\tlet lastStream = task[task.length-1];\n\treturn lastStream;\n}",
"title": ""
},
{
"docid": "d860d1caee6aee14fbe55e6086efdea0",
"score": "0.5271331",
"text": "function makedirectory(folderData, directory, callback_one) {\n Folder.find({ parentid: folderData._id }).exec(function (err, folders) {\n if (folders && folders.length) {\n async.each(folders, function (elementss, elementssCB) {\n elementss.dir = directory + '/' + elementss.name;\n fs.mkdir(elementss.dir, function (err, res) { });\n Document.find({ folderid: elementss._id }).exec(function (err, file) {\n if (err) return elementssCB(err)\n else {\n async.each(file, function (fileInfo, fileInfoCB) {\n var old = __dirname + '/../../../' + fileInfo.path;\n var news = __dirname + '/../../../' + elementss.dir + '/' + fileInfo.name;\n fs.copyFile(old, news, (err) => { });\n fileInfoCB();\n }, function (err) {\n if ((folders.length - 1) == folders.indexOf(elementss)) {\n async.each(folders, function (elementss, elementsssCB) {\n return makedirectory(elementss, elementss.dir, callback_one)\n }, function (err) { })\n }\n })\n }\n })\n }, function (err) { })\n } else {\n return callback_one()\n }\n })\n}",
"title": ""
},
{
"docid": "dfe42a711276fd0e596aa8a227d5b5b7",
"score": "0.52404785",
"text": "function getDirectoryContents(folder, callback) {\n console.log(\"FOLDER READING: \" + folder.path);\n fs.readdir(folder.path, (err, dir) => {\n for (var i = 0; i < dir.length; i++) {\n if (fs.statSync(folder.path + slash + dir[i]).isDirectory())\n folder.subFolders.push(new FolderTab(randomIndex++, folder.path + slash + dir[i]));\n else\n folder.subFiles.push(new FileTab(randomIndex++, folder.path + slash + dir[i]));\n }\n callback();\n });\n}",
"title": ""
},
{
"docid": "3d1322ec9c0d365d0d7d2dbaa6754325",
"score": "0.5218917",
"text": "zipDownloadFolderSelectedImages() {\n console.log(\"downloading selected images: \", this.state.selectedImages)\n let selectedImages = this.state.selectedImages\n let folderName = 'meeting-backgrounds'\n let zip = new JSZip();\n // zip.file(\"Hello.txt\", \"Hello World\\n\");\n let imgFolder = zip.folder(\"meeting-backgrounds\");\n\n selectedImages.forEach( (image) => {\n imgFolder.file(image.images[0].b.url, this.imgData, {base64: true});\n })\n\n zip.generateAsync({type:\"blob\"})\n .then(function(content) {\n // Using npm library FileSaver.js\n saveAs(content, folderName);\n });\n }",
"title": ""
},
{
"docid": "786adf6077d4aadb0ee51debfdca89b4",
"score": "0.52059627",
"text": "convertFileToFolder(node) {\n const newFolder = $('<ul role=\"group\"></ul>');\n const oldData = {\n icon: $('svg.icon-tree', node).getIconName(),\n type: 'file'\n };\n if (node.is('[class^=\"icon\"]')) {\n const iconClass = node.attr('class').replace(' hide-focus', '').replace(' is-selected', '');\n oldData.iconClass = iconClass;\n node.removeClass(iconClass);\n }\n node.data('oldData', oldData);\n node.parent('li').addClass('folder').append(newFolder);\n this.setTreeIcon($('svg.icon-tree', node), this.settings.folderIconClosed);\n }",
"title": ""
},
{
"docid": "7c83bcd394cbc6a87a3caeaec4142daa",
"score": "0.51825774",
"text": "function recursiveCache(parentUL)\n{\n // Iterates over the folder content\n for (let child of parentUL.children)\n {\n // Folder: recursive call\n if (child.classList.contains('folder-subfolder'))\n {\n recursiveCache(child.children[0]);\n }\n // File: fetches and then caches the associated audio file\n else if (child.classList.contains('audio-file'))\n {\n // Audio file URL\n let href = child.getAttribute('href');\n cacheAudioFile(href);\n }\n }\n}",
"title": ""
},
{
"docid": "194e89a9e4e84a4f6dddd7485641f3f3",
"score": "0.51499605",
"text": "convertFolderToFile(node) {\n const parent = node.parent('.folder');\n parent.removeClass('folder is-open');\n $('ul:first', parent).remove();\n if (parent.length) {\n this.setTreeIcon(\n $('svg.icon-tree', node),\n node.data('oldData') ? node.data('oldData').icon : 'tree-node'\n );\n if (node.data('oldData') && node.data('oldData').iconClass) {\n node.addClass(node.data('oldData').iconClass);\n }\n node.data('oldData', null);\n }\n }",
"title": ""
},
{
"docid": "9bff786e6dac1cc615a4f98189cab4cc",
"score": "0.51340985",
"text": "function zip() {\n var dist = 'dist';\n var ext = '.html';\n\n function getHtmlFiles(dir) {\n return fs.readdirSync(dir)\n .filter(function (file) {\n let fileExt = path.join(dir, file);\n let isHtml = path.extname(fileExt) == ext;\n return fs.statSync(fileExt).isFile() && isHtml;\n });\n }\n\n var htmlFiles = getHtmlFiles(dist);\n\n var moveTasks = htmlFiles.map(function (file) {\n var sourcePath = path.join(dist, file);\n var fileName = path.basename(sourcePath, ext);\n\n var moveHTML = gulp.src(sourcePath)\n .pipe($.rename(function (path) {\n path.dirname = fileName;\n return path;\n }));\n\n var moveImages = gulp.src(sourcePath)\n .pipe($.htmlSrc({ selector: 'img' }))\n .pipe($.rename(function (path) {\n path.dirname = fileName + '/assets/img';\n return path;\n }));\n\n return merge(moveHTML, moveImages)\n .pipe($.zip(fileName + '.zip'))\n .pipe(gulp.dest('dist'));\n });\n\n return merge(moveTasks);\n}",
"title": ""
},
{
"docid": "ff8927f812d5cd00fdd6351bb406ba98",
"score": "0.5112",
"text": "function addLEADFolder(){\n \n}",
"title": ""
},
{
"docid": "e0b6cf9dc874bb099775346fb63a1374",
"score": "0.51001334",
"text": "ensureFolder() { fs.ensureDirSync(this.folder) }",
"title": ""
},
{
"docid": "ff2e9b195504cba0153c2582fb44e1e6",
"score": "0.50890464",
"text": "function npm_install_recursive(folder){\n const has_package_json = fs.existsSync(path.join(folder, 'package.json'))\n // If there is `package.json` in this folder then perform `npm install`.\n if (has_package_json && folder !== root){\n npm_install(folder)\n }\n // Recurse into subfolders\n for (let subfolder of subfolders(folder)){\n npm_install_recursive(subfolder)\n }\n}",
"title": ""
},
{
"docid": "e7ad7833df1dc86709ca76d34501b3c1",
"score": "0.5081408",
"text": "function zipFiles(files, callb) {\n var fileZip = path.join(site.DIR_ZIP, new Date().toISOString() + '.zip');\n var output = fs.createWriteStream(fileZip);\n var zipArchive = archiver('zip');\n\n output.on('close', function() {\n logger.info(zipArchive.pointer() + ' total bytes');\n logger.info('%s created', fileZip);\n callb();\n });\n\n zipArchive.on('error', function(err) {\n throw err;\n });\n zipArchive.pipe(output);\n zipArchive.bulk([{src: files, expand: true}]);\n zipArchive.finalize();\n}",
"title": ""
},
{
"docid": "145eb113ca76bac7b812110beef84a60",
"score": "0.5051671",
"text": "function CreateZipFile(pathWhereSaveZip, filesToPutOnZip) {\n\n\n return new Promise((resolve, reject) => {\n\n //=========================\n // create a file to stream archive data to.\n //===========================\n const output = fs.createWriteStream(pathWhereSaveZip);\n\n //=========================\n // create the archive stream\n //===========================\n const archive = archiver('zip', {\n zlib: {level: 9} // Sets the compression level.\n });\n\n //=========================\n // set listeners to the streams\n //===========================\n setListenersOnStreams(output, archive);\n\n // listen for all archive data to be written\n // 'close' event is fired only when a file descriptor is involved\n // archiver has been finalized and the output file descriptor has closed.\n\n output.on('close', function() {\n resolve();\n });\n\n\n //===========================\n // pipe archive data to the file\n //=============================\n archive.pipe(output);\n\n //===========================\n // append files from stream\n //===========================\n filesToPutOnZip.forEach((file) => {\n archive.append(fs.createReadStream(file), {name: path.basename(file)});\n\n })\n\n\n\n //===========================\n // finalize\n //===========================\n // finalize the archive (ie we are done appending files but streams have to finish yet)\n // 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand\n archive.finalize();\n\n\n\n });\n\n\n}",
"title": ""
},
{
"docid": "1144943761183ab41faced530c4e83c6",
"score": "0.5043952",
"text": "async function extractfolder(patharray, parentreslut, req, entry, zfilePath) {\n var zip = new AdmZip(zfilePath);\n var parentid\n var index = 0\n return new Promise(async (resolve, reject) => {\n for (const element of patharray) {\n if (index != patharray.length - 1) {\n await Folder.findOne({ $and: [{ userid: req.user._id }, { name: element }] }, { parentid: parentreslut }).exec(function (err, folder) {\n if (entry.isDirectory) patharray.pop()\n if (!folder) {\n if (parentreslut) parentid = parentreslut\n var foldercreate = {\n name: element,\n userid: req.user._id,\n parentid: parentid\n }\n Folder.create(foldercreate, function (err, folders) {\n parentreslut = folders._id;\n resolve(true)\n\n });\n } else {\n resolve(true)\n }\n });\n }\n if (index == patharray.length - 1) {\n if (!entry.isDirectory) console.log('sssssssssssss')\n zip.extractEntryTo(entry, __dirname + '/../../../uploads/', false, true);\n var file = {};\n //FOR PAGE INFO\n const pdfjs = require('pdfjs-dist');\n const bereich = require('bereich');\n const pdf = await pdfjs.getDocument(__dirname + '/../../../' + 'uploads/' + entry.name); // PDF Path\n const numPages = pdf.numPages;\n const pageNumbers = Array.from(bereich(1, numPages));\n // Start reading all pages 1...numPages\n const promises = pageNumbers.map(pageNo => pdf.getPage(pageNo));\n // Wait until all pages have been read\n const pages = await Promise.all(promises);\n var pagesInfo = []\n for (i = 0; i < numPages; i++) {\n console.log(pages[i]._pageInfo.view);\n pagesInfo[i] = pages[i]._pageInfo.view\n }\n file.pagesInfo = pagesInfo\n // for page info\n file.path = \"uploads/\" + entry.name\n file.type = 'application/pdf';\n file.name = entry.name;\n if (parentreslut) file.folderid = parentreslut\n // file.zipfileid = req.body._id;\n var encryptedid = encrypt(key, String(Date.now()));\n // file.link = \"http://localhost:4200/document/:\" + encryptedid,\n file.encryptedid = encryptedid,\n file.uid = req.user.id;\n file.copycount = 0;\n Document.create(file, function (err, document) {\n resolve(true)\n\n });\n }\n index++;\n }\n })\n\n\n}",
"title": ""
},
{
"docid": "2888737ee94b19b21599b45779ef3dc3",
"score": "0.5035723",
"text": "function copyDirContents(files) {\n\t var file = files.shift();\n\t if (!file) {\n\t return cb();\n\t }\n\t var oldFile = path.resolve(oldPath, file);\n\t var newFile = path.resolve(newPath, file);\n\t // Recursion! Should work for any nested files / folders.\n\t self.rename(oldFile, newFile, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t copyDirContents(files);\n\t });\n\t }",
"title": ""
},
{
"docid": "458802d14ae9e168047187d12ac20e48",
"score": "0.5035266",
"text": "function pack( app_path, callback ){\n\t\t\n\t\tconsole.log('Archiving...');\n\t\n\t\t// create a temporary file (.tar)\n\t\ttmp.file(function(err, tmppath, fd, cleanupCallback) {\n\t\t\t\n\t\t\tvar tarOpts = {\n\t\t\t\tignore: function(name) {\n\t\t\t\t\t\n\t\t\t\t\tif( name == path.join( app_path, 'env.json' ) ) return false\n\t\t\t\t\t\n\t\t\t\t\t// ignore dotfiles (.git, .gitignore, .mysecretporncollection etc.)\n\t\t\t\t\treturn path.basename(name).charAt(0) === '.'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttar\n\t\t\t\t.pack( app_path, tarOpts )\n\t\t\t\t.pipe( zlib.createGzip() )\n\t\t\t\t.pipe(\n\t\t\t\t\tfs\n\t\t\t\t\t\t.createWriteStream(tmppath)\n\t\t\t\t\t\t.on('close', function(){\n\t\t\t\t\t\t\tcallback( tmppath );\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\n\t\t});\n\t}",
"title": ""
},
{
"docid": "c7132126b686447384bc8d077a2c92eb",
"score": "0.5032971",
"text": "function mergeZipFromFile(file)\n {\n return JSZip.loadAsync(file).then(function(zip)\n {\n PROJECTNAME = StaticDataFactory.getProjectName();\n console.log(\"loadasync from file...\", zip);\n \n var myzipfiles = [];\n \n //removing unwanted entries\n zip.forEach(function(relativePath, file)\n {\n if(file.name.substring(0,2) !== '__' && file.name !== PROJECTNAME +'/' && file.name !== 'BuildInfo_SC.properties')\n {\n myzipfiles.push(file);\n }\n });\n \n //removing an unwanted wrapper directory ('Ibis4Student/Configuration.xml becomes 'Configuration.xml')\n for(var i=0 ; i< myzipfiles.length; i++)\n {\n if(myzipfiles[i].name.indexOf(PROJECTNAME) > -1)\n {\n console.log(\"slicing out\", myzipfiles[i].name);\n var item = myzipfiles[i].name;\n var helper = item.substring(item.lastIndexOf('/') + 1 ,item.length);\n myzipfiles[i].name = helper;\n }\n }\n\n\n /*\n Searching for possible duplicate directory names\n */\n var dirs = StorageFactory.getListOfDirectories();\n var duplicates = [];\n for ( i = 0 ; i < myzipfiles.length; i++)\n {\n if(dirs.includes(myzipfiles[i].name))\n {\n duplicates.push(myzipfiles[i].name);\n }\n }\n\n duplicates.sort(function compare (dup1, dup2)\n {\n if(dup1.split('/').length > dup2.split('/').length)\n {\n return 1;\n }\n\n else if(dup1.split('/').length === dup2.split('/').length)\n {\n return 0;\n }\n\n else \n {\n return -1;\n }\n\n });\n\n //changing duplicate names in the zipfile\n duplicates.forEach(function(duplicate)\n {\n var suffix = '(1)';\n myzipfiles.forEach(function(zipfile)\n {\n if(zipfile.name.includes(duplicate))\n {\n zipfile.name = zipfile.name.replace(duplicate, duplicate.substring(0,duplicate.length -1) + suffix + '/');\n }\n });\n\n });\n\n var files = StorageFactory.getListOfFiles();\n files.forEach(function(filename)\n {\n var suffix = '(1).';\n for(i=0 ; i < myzipfiles.length; i++)\n {\n if(myzipfiles[i].name === filename)\n {\n console.log(\"bingo\");\n if(myzipfiles[i].name.split('.').length > 0)\n {\n myzipfiles[i].name = myzipfiles[i].name.split('.')[0] + suffix + myzipfiles[i].name.split('.')[1];\n }\n else\n {\n myzipfiles[i].name = myzipfiles[i].name + createRandomSuffix();\n }\n }\n }\n });\n\n\n /*Write to local storage; to avoid collisions, the calls\n are made synchronously.*/\n \n storeZip(0);\n function storeZip(index)\n {\n if(index > myzipfiles.length-1)\n {\n return;\n }\n else\n {\n if(!(myzipfiles[index].dir))\n {\n myzipfiles[index].async(\"string\").then(function resolve(data)\n {\n var newslotname = \"slot\" + createRandomSuffix();\n StorageFactory.getSetter(myzipfiles[index].name)(newslotname);\n StorageFactory.getSetter(newslotname)(data);\n index++;\n storeZip(index++);\n });\n }\n else\n {\n index++;\n storeZip(index);\n }\n }\n } \n\n \n console.log(\"zipfiles\",myzipfiles);\n console.log(\"empty slot: \",StorageFactory.checkIfEmptyKey());\n var myjson = StorageFactory.getGetter('thejson')();\n myslots = StorageFactory.getGetter('myslots')();\n\n //creation of a flat json structure \n for(i = 0 ; i< myzipfiles.length ; i++)\n {\n if(myzipfiles[i].dir)\n {\n myjson.push({\n id : Math.ceil(Math.random() * 10000), \n isDirectory : myzipfiles[i].dir,\n title : myzipfiles[i].name.substring(0,myzipfiles[i].name.length-1),\n nodes : []\n });\n }\n else\n {\n var myobj = {\n id : Math.ceil(Math.random() * 10000),\n isDirectory : myzipfiles[i].dir,\n title : myzipfiles[i].name,\n nodes : []\n };\n myjson.push(myobj);\n myslots[myobj.id] = {title:myobj.title, isLocked:false};\n }\n }\n\n //sorting the array: highest amount of nodes first .\n myjson.sort(function compare(val1, val2)\n {\n if(val1.title.split('/').length > val2.title.split('/').length)\n {\n return -1;\n }\n if(val1.title.split('/').length < val2.title.split('/').length)\n {\n return 1;\n }\n return 0;\n });\n\n var helper1 = 0;//emergency variable to prevent a possible eternal loop\n var parentsfound = true; //escapes the while loop when we had a run with no results\n\n \n /*\n adding children to the parents node arrays; when there is a parent found myjson is changed\n and we will start the loop again\n */\n while(parentsfound && helper1 <100)\n {\n parentsfound = false;\n var copy = myjson;\n\n for(var index = 0 ; index < myjson.length; index ++)\n {\n for(var j=0 ; j< copy.length; j++)\n {\n if(isParent(myjson[index].title, copy[j].title))\n {\n // console.log(myjson[index].title, \"direct parent of \" ,copy[j].title);\n // console.log(\"myjson\",myjson);\n myjson[index].nodes.push(copy[j]);\n myjson.splice(j,1);\n parentsfound = true;\n break;\n }\n }\n if(parentsfound)\n {\n break;\n }\n }\n helper1 ++;\n }\n \n\n\n /* Main helper function of the recursive loop; \"dir1/dir2/file1.abc\" compared with \"dir1/dir2\" will\n regard this as a direct parent-child relationship. */ \n function isParent(possibleparent, candidate)\n {\n if(possibleparent === candidate)\n {\n return false;\n }\n var index = candidate.lastIndexOf('/');\n if(candidate.substring(0,index) === possibleparent)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n\n console.log(\"generated json out of zip:\\n\",myjson, myslots);\n\n //saving json and working files structure to local storage, and returning to the caller\n StorageFactory.getSetter('thejson')(myjson);\n StorageFactory.getSetter('myslots')(myslots); \n return(myjson); \n\n });//end of jszip async call\n }",
"title": ""
},
{
"docid": "1afcb018e391f947881a7e15458046fa",
"score": "0.50118446",
"text": "addModuleDir(dir){\n if(fs.existsSync(dir)){\n fs.readdirSync(dir).forEach( m => {\n this.addModule(dir + '/' + m, m);\n });\n }\n }",
"title": ""
},
{
"docid": "ad6c00eca42fc96ae2e113a716a6ac41",
"score": "0.5001449",
"text": "function copyFolderRecursiveSync(source, target, replaceCall) {\n if (!fs.existsSync(source)) {\n return;\n }\n\n //check if folder needs to be created or integrated\n var targetFolder = path.join(target, path.basename(source));\n if (!fs.existsSync(targetFolder)) {\n fs.mkdirSync(targetFolder);\n }\n //copy\n if (fs.lstatSync(source).isDirectory()) {\n const files = fs.readdirSync(source);\n files.forEach(function (file) {\n var curSource = path.join(source, file);\n if (fs.lstatSync(curSource).isDirectory()) {\n copyFolderRecursiveSync(curSource, targetFolder, replaceCall);\n } else {\n copyFileSync(curSource, targetFolder, replaceCall);\n }\n });\n }\n}",
"title": ""
},
{
"docid": "ad20a232d6e42e16d4b288850b5017e8",
"score": "0.4998155",
"text": "function folderSetup(callback) {\n fs.mkdir();\n callback();\n }",
"title": ""
},
{
"docid": "35e5e9af8fd2e2d176a6e9228623bd13",
"score": "0.49967352",
"text": "function addFolder(folderName) {\n appRootFolder.localFolder.createFolderAsync(folderName).then(\n function (newFolder) {\n protectItem(newFolder);\n });\n }",
"title": ""
},
{
"docid": "ee617ffd63b456607e47a3b76dea704a",
"score": "0.49885815",
"text": "_copyDirRecursive(dir, context) {\r\n const files = fs.readdirSync(dir);\r\n\r\n for (const file of files) {\r\n const filePath = \"\" + dir + \"/\" + file;\r\n const stat = fs.statSync(filePath);\r\n if (stat.isDirectory()) {\r\n this._copyDirRecursive(filePath, context + file + \"/\");\r\n } else {\r\n const relativePath = context + file;\r\n console.log(\"Checking if template file: \", relativePath);\r\n const isTemplateFile = this.templateToProps[relativePath];\r\n if(isTemplateFile) {\r\n console.log(\"Filling template variables: \", relativePath);\r\n // TODO: actually restrict available properties\r\n this.caller.fs.copyTpl(\r\n this.caller.templatePath(relativePath),\r\n this.caller.destinationPath(relativePath),\r\n this.configs\r\n );\r\n } else {\r\n this.caller.fs.copy(\r\n this.caller.templatePath(relativePath),\r\n this.caller.destinationPath(relativePath));\r\n }\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "31a4647efdb5aa0b011080c0c9495734",
"score": "0.49812",
"text": "function traverseFolder(path) {\n // contents of the directory\n promisedFS.readdir(path).then((files) => {\n // we want to loop over each file in the directory/array created\n // for the next call we need to set a new filePath\n for (let file of files) {\n const filePath = pathMod.join(path, file);\n // call(back) the outputDirectory with the new path for each file/folder\n outputDirectory(filePath);\n // then we call the outputDirectory function to rerun the test - this will continuously loop until all files have been targeted\n };\n }).catch((error) => {\n console.log(error);\n })\n}",
"title": ""
},
{
"docid": "bc4a48433a4bb7185f87dbc6813a60a8",
"score": "0.4973337",
"text": "function zipFiles(files, callback) {\n let fileZip = path.join(DIR_ZIP, new Date().toISOString() + '.zip');\n let output = fs.createWriteStream(fileZip);\n let zipArchive = archiver('zip');\n\n output.on('close', function() {\n logger.info(zipArchive.pointer() + ' total bytes');\n logger.info('%s created', fileZip);\n callback();\n });\n\n zipArchive.on('error', function(err) {\n throw err;\n });\n zipArchive.pipe(output);\n zipArchive.bulk([{src: files, expand: true}]);\n zipArchive.finalize();\n}",
"title": ""
},
{
"docid": "dd36d681b5b2abdb3062658947025a83",
"score": "0.49532884",
"text": "function ExtractFiles( zip, path, fldr, isSpk )\n{\n\tvar list = zip.List( path );\n\tif( !list ) { app.ShowPopup(\"Invalid package!\"); return; }\n\n\tapp.MakeFolder( fldr );\n\tvar lst = list.split(\",\");\n\tfor( var i=0; i<lst.length; i++ )\n\t{\n\t\tvar name = lst[i];\n\t\tif( name.indexOf(\"/\")==-1) {\n\t\t\tzip.Extract( (path+name).substr(1), fldr+path+name.replace(\".js.txt\",\".js\") )\n\t\t}\n\t\telse {\n\t\t\tapp.MakeFolder( fldr+(path+name).slice(0,-1) );\n\t\t\tExtractFiles( zip, path+name, fldr, isSpk );\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "6134fae29eeed7fb44604b71df0087a0",
"score": "0.49504954",
"text": "function populateDirectory(){\n\t\n}",
"title": ""
},
{
"docid": "98ca084dede9a4dd1d186a257a75bc32",
"score": "0.49427196",
"text": "readFolderRecursively(dir, filter = undefined) {\n return MonikaCore.readFolderRecursively(dir, filter);\n }",
"title": ""
},
{
"docid": "7ed08206f9865da2d164d18b479a43db",
"score": "0.4942364",
"text": "function exportDir(extdir, outDirPath, overwrite) {\n if (!ExtFile.exists()) {logmsg(\"ERROR (exportDir): Can't open firefox extension\"); return null;}\n var to = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n to.initWithPath(outDirPath + \"/\" + extdir);\n\n var toP = to.parent;\n if (!toP.exists()) toP.create(toP.DIRECTORY_TYPE, 511);\n if (ExtFile.isDirectory()) {\n var from = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n from.initWithPath(ExtFile.path + \"/\" + (INDEFAULTS ? INDEFAULTS:\"\") + extdir);\n if (!from.exists() || !from.isDirectory()) {logmsg(\"ERROR (exportDir): From directory does not exist \\\"\" + from.path + \"\\\"\"); return null;}\n if (!copyFiles(from, to, overwrite, true)) return null;\n }\n else {\n var direntry = (INDEFAULTS ? INDEFAULTS:\"\") + extdir + \"/\";\n var zReader = Components.classes[\"@mozilla.org/libjar/zip-reader;1\"].createInstance(Components.interfaces.nsIZipReader);\n try {zReader.open(ExtFile);}\n catch (er) {logmsg(er + \"\\nERROR (exportDir): cannot open \\\"\" + ExtFile.path + \"\\\"\"); return null;}\t\n/* \n // test code\t\n var entries = zReader.findEntries(null);\n while (entries.hasMore()) {\n var entry = entries.getNext();\n var eobj = zReader.getEntry(entry);\n logmsg(entry + \", isDirectory=\" + eobj.isDirectory);\n }\n*/ \n try {\n var isdir = zReader.getEntry(direntry);\n if (!isdir || !isdir.isDirectory) {logmsg(\"ERROR (exportDir): From zip directory does not exist \\\"\" + direntry + \"\\\"\"); return null;}\n }\n catch(er) {logmsg(er + \"\\nERROR (exportDir): reading zip entry \\\"\" + direntry + \"\\\"\"); return null;}\n // create output directories\t\n var entries = zReader.findEntries(null);\n while (entries.hasMore()) {\n var entry = entries.getNext();\n if (entry.indexOf(direntry) != 0) {continue;}\n try {var entryObj = zReader.getEntry(entry);}\n catch (er) {logmsg(er + \"\\nError (exportDir): Getting zip directory entry \" + entry + \". \" + er); continue;}\n var newfile = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n newfile.initWithPath(outDirPath + \"/\" + extdir);\n if (entryObj && entryObj.isDirectory && !newfile.exists()) newfile.create(newfile.DIRECTORY_TYPE, 511);\n }\n // create output files\t\n var success = true;\n var entries = zReader.findEntries(null);\n while (entries.hasMore()) {\n var entry = entries.getNext();\n if (entry.indexOf(direntry) != 0) {continue;}\n try {var entryObj = zReader.getEntry(entry);}\n catch (er) {logmsg(er + \"\\nError (exportDir): Getting zip file entry \" + entry + \". \" + er); continue;}\n var newfile = Components.classes[\"@mozilla.org/file/local;1\"].createInstance(Components.interfaces.nsILocalFile);\n newfile.initWithPath(outDirPath + \"/\" + extdir);\n if (entryObj && !entryObj.isDirectory) {\n if (newfile.exists()) {\n if (overwrite) newfile.remove(false);\n }\n if (newfile.exists()) success = false;\n \n zReader.extract(entry, newfile);\n if (!newfile.exists()) {\n logmsg(\"ERROR (exportDir): filed to extract \\\"\" + entry + \"\\\"\");\n success = false;\n }\n }\n }\n }\n \n if (!success || !to.exists()) {\n logmsg(\"ERROR (exportDir): failed to export to \\\"\" + to.path + \"\\\"\");\n return null;\n }\n \n return to;\t\n}",
"title": ""
},
{
"docid": "5ee81ab52d3b542119482281f5b5f7f5",
"score": "0.49398917",
"text": "function addDirectoryTreeToJSTree(parent, tree) {\n //if the current node is a directory\n if (tree.type === 'directory') {\n let childId = $('#file-container').jstree(true).create_node(parent, {\n 'id': getTimeStampWithMS(),\n 'text': tree.name,\n 'icon': folderIconPath,\n 'type': 'folder'\n });\n //recursive call for children\n if (tree.children) {\n tree.children.forEach((element) => {\n addDirectoryTreeToJSTree(childId, element)\n });\n }\n }\n //if the current node is a file\n if (tree.type === 'file') {\n let stats = fs.statSync(tree.path);\n let sizeInMb = stats[\"size\"] / 1000000.0;\n let modifiedDateMs = stats[\"mtimeMs\"];\n let birthtime = stats[\"birthtime\"];\n $('#file-container').jstree(tree).create_node(parent, {\n 'id': getTimeStampWithMS(),\n 'text': tree.name,\n 'type': 'file',\n 'icon': fileIconPath,\n 'data': {\n \"sourceFile\": tree.path,\n \"notes\": \"\",\n \"size\": sizeInMb,\n \"modifiedDateMs\": modifiedDateMs,\n \"birthtime\": birthtime\n },\n });\n }\n}",
"title": ""
},
{
"docid": "1fefff02da5b75507e06621741354dc8",
"score": "0.49337882",
"text": "function setUpDirectories(dir) {\n\t// console.log(dir);\n\tfor (var i = 0; i < dir.files.length; i++) {\n\t\tdir.files[i].path = createPath(dir.path, dir.files[i].name);\n\t\tdir.files[i].parent = dir;\n\t\tif (dir.files[i].directory) {\n\t\t\tsetUpDirectories(dir.files[i]);\n\t\t}\n\t};\n}",
"title": ""
},
{
"docid": "cb594b45fd9c5025b56eb418587506f3",
"score": "0.49315912",
"text": "function downloadZip(done){\n\t\tutil.download(work.zipFileUrl, function(err, data){\n\t\t\tif(err){return done(err)};\n\t\t\tvar dirpath = util.getCacheDir(work);\n\t\t\tmkdirp(dirpath, function(err){\n\t\t\t\tif(err){return done(err)};\n\t\t\t\tfs.writeFile(filepath, data, function(err){\n\t\t\t\t\tvar zip = new AdmZip(filepath);\n\t\t\t\t\tzip.extractAllTo(unzippath , /*overwrite*/true);\n\t\t\t\t\tdone(err);\n\n\t\t\t\t});\n\t\t\t});\n\t\t})\n\t}",
"title": ""
},
{
"docid": "6dc779d45d11a95e00445e7cc3df0f22",
"score": "0.4914358",
"text": "function createFolderBtn() {\n var name = $('#createfolderinput').find('input').val();\n var cdir = decodeURIComponent($('#nav').data('cdir'));\n\n $.ajax({\n url: $('body').data('optBaseUri') + '?/createfolder',\n data: { name: name, cdir: cdir },\n method: 'POST',\n\n }).fail(function(data) {\n $('#createfolderbtn').next().hide();\n $('#createfolderbtn').show();\n\n alert('Creating folder failed.');\n\n }).done(function(data) {\n if(!ajaxDataError(data)) {\n $('#createfolderbtn').next().hide();\n $('#createfolderbtn').show();\n\n return;\n }\n\n $('#infiles').append(data);\n $('#createfolderbtn').next().hide();\n $('#createfolderbtn').show();\n\n var newfolder = $('.newfolder');\n\n setFolderEvents(newfolder);\n hideNoFile();\n\n newfolder.slideDown()\n newfolder.removeClass('newfolder');\n });\n}",
"title": ""
},
{
"docid": "1080e5851ed1c2a2f92146998c54b519",
"score": "0.4907429",
"text": "function createJHipsterJSONFolder(subFolder) {\n FileUtils.createDirectory(path.join(subFolder, '.jhipster'));\n}",
"title": ""
},
{
"docid": "b705c898e03dc43af6c769b59c8a69ef",
"score": "0.48942938",
"text": "async function overwriteBaseFiles () {\n const fs = require('fs')\n const fse = require('fs-extra')\n \n const foldersToOverwrite = [\n 'Navigation',\n 'Redux',\n 'Sagas',\n 'Screens',\n 'Services',\n ]\n \n for (let folder of foldersToOverwrite) {\n const inNodeModule = fs.readdirSync('./', 'utf8').indexOf('ignite-AutoRnApp') > -1\n const pluginDir = inNodeModule ? './node_modules/' : './ignite/plugins/'\n const templateDir = `${pluginDir}ignite-AutoRnApp/boilerplate/App/${folder}`\n const destDir = `./App/${folder}`\n \n fse.emptydirSync(destDir)\n fse.copySync(templateDir, destDir)\n }\n }",
"title": ""
},
{
"docid": "b849cc854a538942fc4eb104219b7c47",
"score": "0.48916665",
"text": "function addFolder(folder, connection) {\n //Initialize operation\n if (active_connection) {\n active_sftp.mkdir(\n target + folder,\n function(err) {\n if (err) {\n //Send to logs\n errors_log.debug(err);\n }\n else {\n console.log('added folder ' + moment().format('YYYY/MM/DD h:mm:ss') + ' /' + folder);\n }\n }\n );\n }\n else { //Ok, queue file change\n fileActionsQueue.push({path: folder, action: 'addFolder'});\n }\n}",
"title": ""
},
{
"docid": "f78ed1b38382a8e26ebd4318382bcb59",
"score": "0.48742992",
"text": "createFilesAndSubDirs(dirPath) {\n //get all of the files and dirs in the passed in directory\n const allFilesAndDirs = fs.readdirSync(dirPath);\n\n //go through the contents of the dir\n for (let i = 0; i < allFilesAndDirs.length; i++) {\n //get the full path to the file or directory\n const fullPathToFileOrDir = path.join(dirPath, allFilesAndDirs[i]);\n\n //get some stats about the file/dir\n const stats = fs.statSync(fullPathToFileOrDir);\n\n //if this is a dir\n if(stats.isDirectory()) {\n //create the subdirectory\n this.createDirectory(fullPathToFileOrDir);\n\n //recurse in the subdirectories\n this.createFilesAndSubDirs(fullPathToFileOrDir);\n } else if(stats.isFile()) {\n //create the file\n this.createFile(fullPathToFileOrDir);\n }\n }\n }",
"title": ""
},
{
"docid": "0b7e3503dfff657de9c25e471994dc62",
"score": "0.4853146",
"text": "function extractFiles({ parentApp, addons, config, includeAssets, ui }) {\n return new Promise((resolve, reject) => {\n ui.writeLine(chalk.green(`Extracting assets and translations`));\n fs.createReadStream(allTranslationsZip)\n .pipe(unzipper.Parse())\n .on('entry', file => {\n // iterate through every translation file and put it in its correct place\n const folderName = file.path.split('/')[0];\n const matchedAppOrAddon = [parentApp].concat(addons).find((appOrAddon) => {\n const appOrAddonCrowdinName = loadConfig(appOrAddon.root).folderName;\n\n return folderName === appOrAddonCrowdinName;\n })\n if (file.type !== 'Directory' && matchedAppOrAddon && !file.path.includes(\"en.yaml\")) {\n const relativePath = file.path.replace(`${folderName}/`, '');\n let fullPath = path.join(matchedAppOrAddon.root, relativePath);\n const isAsset = !relativePath.includes('.yaml');\n\n if (config.assetPaths && config.assetPaths.length && isAsset) {\n if (includeAssets) {\n config.assetPaths.forEach((asset) => {\n const assetLocaleIndex = asset.exportPattern.split('/').indexOf('%locale%');\n const splitPath = relativePath.split('/');\n const locale = splitPath[assetLocaleIndex];\n splitPath[assetLocaleIndex] = locale.toLowerCase();\n const lcLocalePath = path.join(...splitPath);\n const relativeFilePath = file.path.replace(`${folderName}/`, '');\n fullPath = path.join(matchedAppOrAddon.root, lcLocalePath);\n if(relativeFilePath.toLowerCase() === lcLocalePath) {\n createFolderFor(file, fullPath);\n }\n });\n } else {\n file.autodrain();\n return;\n }\n }\n\n file.pipe(fs.createWriteStream(fullPath))\n .on('close', () => {\n ui.writeLine(chalk.green(`File successfully written: ${file.path}`));\n });\n } else {\n file.autodrain();\n }\n })\n .on('end', resolve)\n .on('error', reject);\n })\n}",
"title": ""
},
{
"docid": "624d9a7be763e5163c51519e68159445",
"score": "0.4843678",
"text": "function createFolder() {\n\n fs.mkdirSync(extensionFolderPath);\n}",
"title": ""
},
{
"docid": "58524c0600f776378ad0f2de60c3f122",
"score": "0.48411283",
"text": "function copyFolderContents(srcFolder, destFolder, slash){\n\tvar srcContents = fs.readdirSync(srcFolder);\n\tfor(var i = 0; i< srcContents.length; i++ )\n\t{\n\t\tvar srcFilename = srcFolder + srcContents[i];\n\t\tvar destFilename = destFolder + srcContents[i];\n\t\tif(fs.statSync(srcFilename).isFile())\n\t\t{\n\t\t\t//copy file if does not exists\n\t\t\tif(!fs.existsSync(destFilename))\n\t\t\t{\n\t\t\t\tfs.copyFileSync(srcFilename, destFilename);\n\t\t\t}\n\t\t}\n\t\telse if(fs.statSync(srcFilename).isDirectory())\n\t\t{\n\t\t\tcreateDirectoryIfNotExists(destFilename);\n\t\t\tcopyFolderContents(srcFilename + slash, destFilename + slash);\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "baca8550d81c68f19a8c460ba3093a23",
"score": "0.4827065",
"text": "function makeDir(dir){\n \"use strict\";\n\n\tdir.forEach((item)=>{\n //assets will go a be a sub directory, and inside he goes a create the folders\n //Using sync to rest of the files not be a create before the folders\n\t\tfs.mkdirSync(`assets/${item}`, { recursive : true }, (err)=>{\n\t\t\tif(err) throw err; //callback error\n \n\t\t\tconsole.log('Created', item); //callback success\n\t\t});\n\t});\n}",
"title": ""
},
{
"docid": "5638709dfa48cc251a8e8c2b54c1a2e9",
"score": "0.48256904",
"text": "function generateTar() {\n\t\tfstream.Reader({\n\t\t\tpath: _this.inputPath,\n\t\t\ttype: \"Directory\",\n\t\t\tfilter: function () {\n\t\t\t\tvar isDirectory = this.type == \"Directory\"\n\t\t\t\tvar willInclude = isDirectory || (_this.filesToInclude.indexOf(this.basename) != -1);\n\t\t\t\tif(willInclude && !isDirectory) console.log(\"adding \" + this.basename);\n\t\t\t\treturn willInclude;\n\t\t\t}\n\t\t})\n\t\t.pipe(tar.Pack())\n\t\t.pipe(zlib.createGzip())\n\t\t.pipe(fstream.Writer(_this.outputPath));\n\t}",
"title": ""
},
{
"docid": "b6ab19db1a2ffe72eb0c93ed90a008d1",
"score": "0.48225075",
"text": "async function copyAllJsonNotesToASeparateFolder(){\n fse.ensureDir(\"./notes/\", async (e, s) => {\n if(!e){\n for(let fileName of files){\n try{\n await fse.copyFile(`./keep/${fileName}`, `./notes/${fileName}`);\n } catch(e){\n console.log(e)\n }\n } \n }\n });\n}",
"title": ""
},
{
"docid": "e9c5b9051f60ef05df7eea4b1f4e5de4",
"score": "0.48133713",
"text": "async convertFolder(inputDirPath, outputDirPath, tagLine = \"Tags: \"){\n console.log(inputDirPath, outputDirPath);\n // Get an array of file names in the input directory\n let inputDir = await fsPromises.readdir(inputDirPath);\n // Create the output directory\n if(!fs.existsSync(outputDirPath)) await fsPromises.mkdir(outputDirPath);\n \n // Convert and write files from the input directory to the output directory\n inputDir.forEach(async inputFileName => {\n let outputFilePath = path.join(outputDirPath, inputFileName);\n let inputFilePath = path.join(inputDirPath, inputFileName);\n await this.convertIndividualFile(inputFilePath, outputFilePath, tagLine);\n });\n }",
"title": ""
},
{
"docid": "9e05724933559780b83c4bdd37819f1e",
"score": "0.4804522",
"text": "create(folder) {\n return new Promise((resolve, reject) => {\n fse.ensureDir(folder, err => {\n if (err) reject(err);\n if (!err) resolve(folder);\n });\n });\n }",
"title": ""
},
{
"docid": "10dd9dd5f0b1b0ec2d92c5d6f22d0e90",
"score": "0.47919694",
"text": "function renderFolder (folder) {\n\tlet ul = document.createElement(\"ul\"),\n\t\t\tli = document.createElement(\"li\"),\n\t\t\ttext = document.createTextNode(folder[\"title\"]),\n\t\t\ticonFolder = document.createElement(\"i\"),\n\t\t\ticonFile = document.createElement(\"i\"),\n\t\t\tempty = document.createTextNode(\"folder is empty\");\n\n\ticonFolder.className = \"material-icons\";;\n\ticonFolder.innerHTML = \"folder\";\n\ticonFile.className = \"material-icons\";\n\ticonFile.innerHTML = \"insert_drive_file\";\n\n\tli.appendChild(text);\n\tul.appendChild(li);\n\tul.style.display = \"none\";\n\n\tif (folder[\"folder\"]) {\n\t\tli.insertBefore(iconFolder, li.childNodes[0]);\n\t\tli.className = \"folder\"\n\t\tli.onclick = showContent;\n\t\tul.className = \"parent\";\n\t} else if (folder[\"title\"] !== \"Folder is empty\") {\n\t\tli.insertBefore(iconFile, li.childNodes[0]);\n\t\tli.className = \"file\";\n\t}\n\n\tif (folder[\"children\"]) {\n\t\tfor (let i = 0; i < folder[\"children\"].length; i++) {\n\t\t\tul.appendChild(renderFolder(folder[\"children\"][i]))\n\t\t}\n\t} else if (folder[\"children\"] === null || folder[\"children\"] === false) {\n\t\tul.appendChild(renderFolder({title: \"Folder is empty\"}));\n\t}\n\n\treturn ul;\n}",
"title": ""
},
{
"docid": "5a07470df59d689db1b72bfa7fafae01",
"score": "0.4790677",
"text": "function loadAllFilesInAllProjectDirs() {\n return __awaiter(this, void 0, Promise, function* () {\n let projectDirs = atom.project.getDirectories();\n let projectDirsContents = [];\n for (let dir of projectDirs) {\n // separate file set for each project dir\n let pathsAndContents = yield loadAllFilesInProjectDir(dir);\n projectDirsContents.push(pathsAndContents);\n }\n return projectDirsContents;\n });\n}",
"title": ""
},
{
"docid": "0b6a1ef0dfbb735c5a9d57790be05e6a",
"score": "0.47832456",
"text": "makeFolderTreeData (fLst) {\n if (!fLst || !Array.isArray(fLst) || fLst.length <= 0) { // empty file list\n return { isAnyDir: false, tree: [] }\n }\n\n // make files (and folders) map: map file path to folder name and item name (file name or sub-folder name)\n const fPath = {}\n let isAny = false\n\n for (let k = 0; k < fLst.length; k++) {\n if (!fLst[k].Path || fLst[k].Path === '.' || fLst[k].Path === '..') continue\n\n isAny = isAny || fLst[k].IsDir\n\n // if root folder\n if (fLst[k].Path === '/') {\n fPath[fLst[k].Path] = { base: '', name: '/', label: '/' }\n continue\n }\n\n // remove trailing / from path\n if (fLst[k].Path.endsWith('/')) fLst[k].Path = fLst[k].Path.substr(0, fLst[k].Path.length - 1)\n\n // split path to the base folder and name, use name without leading / as label\n const n = fLst[k].Path.lastIndexOf('/')\n\n fPath[fLst[k].Path] = {\n base: n >= 0 ? fLst[k].Path.substr(0, n) : '',\n name: n >= 0 ? fLst[k].Path.substr(n) : fLst[k].Path,\n label: n >= 0 ? fLst[k].Path.substr(n + 1) : fLst[k].Path\n }\n }\n\n // make href link: for each part of the path do encodeURIComponent and keep / as is\n const pathEncode = (path) => {\n if (!path || typeof path !== typeof 'string') return ''\n\n const ps = path.split('/')\n for (let k = 0; k < ps.length; k++) {\n ps[k] = encodeURIComponent(ps[k])\n }\n return ps.join('/')\n }\n\n // add top level folders and files as starting point into the tree\n const fTree = []\n const fProc = []\n const fDone = {}\n const fTopFiles = []\n\n for (const fi of fLst) {\n if (!fi.Path || fi.Path === '.' || fi.Path === '..') continue\n\n if (fPath[fi.Path].base !== '') continue // not a top level folder or file\n\n // make tree node\n const fn = {\n key: 'fi-' + fi.Path + '-' + (fi.ModTime || 0).toString(),\n Path: fi.Path,\n link: pathEncode(fi.Path),\n label: fPath[fi.Path].label,\n descr: this.fileTimeStamp(fi.ModTime) + (!fi.IsDir ? ' : ' + this.fileSizeStr(fi.Size) : ''),\n children: [],\n isGroup: fi.IsDir\n }\n fDone[fi.Path] = fn\n\n // if this is top level folder then add it to list of root folders\n if (fi.IsDir) {\n fTree.push(fn)\n fProc.push(fn)\n } else { // this is top level file\n fTopFiles.push(fn)\n }\n }\n\n // build folders and files tree\n while (fProc.length > 0) {\n const fNow = fProc.pop()\n\n // make all children of current item\n for (const fi of fLst) {\n if (!fi.Path || fi.Path === '.' || fi.Path === '..') continue\n if (fDone[fi.Path]) continue\n\n if (fPath[fi.Path].base !== fNow.Path) continue\n\n const fn = {\n key: 'fi-' + fi.Path + '-' + (fi.ModTime || 0).toString(),\n Path: fi.Path,\n link: pathEncode(fi.Path),\n label: fPath[fi.Path].label,\n descr: this.fileTimeStamp(fi.ModTime) + (!fi.IsDir ? ' : ' + this.fileSizeStr(fi.Size) : ''),\n children: [],\n isGroup: fi.IsDir\n }\n fNow.children.push(fn)\n fDone[fi.Path] = fn\n\n if (fi.IsDir) fProc.push(fn)\n }\n }\n\n // update description\n for (const p in fDone) {\n const fn = fDone[p]\n if (fn.isGroup) fn.descr = fn.descr + ' : ' + (fn.children.length || 0).toString() + ' ' + this.$t('file(s)')\n }\n\n // push top level files after top level folders\n fTree.push(...fTopFiles)\n\n return { isAnyDir: isAny, tree: fTree }\n }",
"title": ""
},
{
"docid": "d8be6e5e67929c39c695609d9883a99d",
"score": "0.47770524",
"text": "function loadDirectoryContent(fs) {\n fs.root.createReader().readEntries(function success(entries) {\n var i, files = [];\n\n for (i = 0; i < entries.length; i++) {\n if (entries[i].isFile && endsWith(entries[i].name, \".js\")) {\n files.push(entries[i].name);\n }\n }\n\n result.resolve({\n files: files,\n path: path\n });\n }, handleError);\n }",
"title": ""
},
{
"docid": "2b2087149b235198111c173f5e89566b",
"score": "0.4763155",
"text": "function walkSync (dir, parent, markForDeletion) {\n parent = typeof parent !== 'undefined' ? parent : ''\n var fs = fs || require('fs')\n var files = fs.readdirSync(dir)\n var filelist = []\n files.forEach(function (file) {\n if (fs.statSync(dir + '/' + file).isDirectory()) {\n if (file.indexOf('private') > -1) {\n // mark for deletion\n markForDeletion.push({\n name: dir + '/' + file,\n content: 'folder'\n })\n } else {\n filelist.push({\n folder: parent + file,\n items: walkSync(dir + '/' + file, parent + file + '/', markForDeletion)\n })\n }\n } else {\n if (file.indexOf('private') > -1) {\n markForDeletion.push({\n name: dir + '/' + file,\n content: base64_encode(dir + '/' + file)\n })\n }\n filelist.push(parent + file)\n }\n })\n return filelist\n}",
"title": ""
},
{
"docid": "08fbb66aa2ee762a0dbe8a394a2f7a7c",
"score": "0.47631505",
"text": "apply_to_master(recursive_to_children) {\n this.set_stats_to_master();\n if (recursive_to_children) {\n if (this.dirs) {\n this.dirs.forEach((dir_tree) => {\n dir_tree.apply_to_master(true);\n });\n }\n }\n }",
"title": ""
},
{
"docid": "eb2be458065acf888730aa1582f43c19",
"score": "0.47622523",
"text": "function loadDirectoryContent(fs) {\n fs.root.createReader().readEntries(function success(entries) {\n var i, files = [];\n\n for (i = 0; i < entries.length; i++) {\n if (entries[i].isFile) {\n files.push(entries[i].name);\n }\n }\n\n result.resolve({\n files: files,\n path: path\n });\n }, handleError);\n }",
"title": ""
},
{
"docid": "7ead0d9f71a3db83cffe41dab405c99a",
"score": "0.47541922",
"text": "function archive() {\n var time = dateFormat( new Date(),\"yyyy-mm-dd_HH-MM\" );\n var pkg = JSON.parse( fs.readFileSync( './package.json' ) );\n var title = pkg.name + '_' + time + '.zip';\n\n return gulp.src( PATHS.package )\n .pipe( $.zip( title ) )\n .pipe( gulp.dest( 'packaged' ) );\n}",
"title": ""
},
{
"docid": "541cb6c3099fb2349a659a45c45ea8ac",
"score": "0.47505888",
"text": "function createJarBackupDirectory(folder)\n {\n var res=csawar_lib.split(\"/\");\n var dir=Backup;\n dir=dir+'/'+folder;\n if (!fs.existsSync(dir)) \n {\n mkdirSync(dir);\n }\n for(var j=2;j<=res.length-1;j++)\n { \n dir=dir+'/'+res[j];\n if (!fs.existsSync(dir)) \n {\n mkdirSync(dir);\n }\n if(j==res.length-1)\n {\n console.log('......Jar BackUp Directory '+dir+' Created\\n');\n }\n }\n return dir;\n }",
"title": ""
},
{
"docid": "336c314d1b6a789c921390a80a21e8c2",
"score": "0.47486284",
"text": "function createContents (options, dir) {\n options.logger('Creating contents of package')\n options.logger(`createContents(${options}, ${dir})`)\n\n return Promise.all([\n createControl,\n copyScripts,\n createBinary,\n createDesktop,\n createIcon,\n createCopyright,\n createOverrides,\n createApplication\n ].map(func => func(options, dir)))\n .then(() => dir)\n}",
"title": ""
},
{
"docid": "287a70bebedef90ec4833594249b5c31",
"score": "0.473498",
"text": "WriteFolder(folderPath) {\n return new Promise((resolve) => {\n if (fs.existsSync(this.basePath + folderPath)) {\n resolve();\n return;\n }\n fs.mkdirSync(this.basePath + folderPath);\n resolve();\n });\n }",
"title": ""
},
{
"docid": "e4ececd21e56b1257abea72fccb470fa",
"score": "0.4731731",
"text": "function copyDir(from, to) {\r\n\treturn function (next) {\r\n\t\twrench.copyDirRecursive(from, to, {forceDelete: true}, function (err) {\r\n\t\t\tif (err) {\r\n\t\t\t\tnext(err);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnext();\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n}",
"title": ""
},
{
"docid": "d3cba0947381d3e8fd8bcf3e49d7cac5",
"score": "0.47310498",
"text": "function tempFolder() {\n buildTempFolder( (err, folder) => {\n if (err)\n finish(err);\n else {\n tmp_directory = folder;\n readSrc();\n }\n });\n }",
"title": ""
},
{
"docid": "b92fc486c544ec9286307e9e43098c4f",
"score": "0.47268477",
"text": "function rootDir(fromPath, toPath, jsFiles, cssFiles){\n\tlogging.trace('building HTML ' + fromPath + ':' + toPath);\n\tfileSys.readdir(fromPath, function(error, files){\n\t\tfor(var i = 0; i < files.length; i++){\n\t\t\tif(files[i] == 'index.html')\n\t\t\t\tbuildHTML(fromPath, toPath, jsFiles, cssFiles);\n\t\t\telse\n\t\t\t\tcopyFile(fromPath, toPath, files[i]);\n\t\t}\n\t});\n\tmoveStuff(fromPath+'images/', toPath+'images/');\n\tmoveStuff(fromPath+'images/resources/', toPath+'images/resources/');\n\tmoveStuff(fromPath+'challenge/', toPath+'challenge/');\n}",
"title": ""
},
{
"docid": "d5c1d227f6f76589f1bfd80472920b73",
"score": "0.4725307",
"text": "function toBuffer (zipMethod) {\n zipMethod = zipMethod || store;\n \n var fileBuffers = [], dirBuffers = [];\n var fileOffset = 0;\n \n files.map(function(file) {\n var data = zipMethod.compress(file.data);\n var fileHeader = getFileHeader(file, zipMethod.indicator, data);\n \n // write files\n var fileBuffer = new RollingBuffer(4 + fileHeader.length + file.name.length + data.length);\n writeBytes(fileBuffer, [0x50, 0x4b, 0x03, 0x04]); // 4\n fileBuffer.appendBuffer(fileHeader); // hmm...\n fileBuffer.write(file.name, \"ascii\");\n fileBuffer.appendBuffer(data);\n \n // now create dir\n var dirBuffer = new RollingBuffer(4 + 2 + fileHeader.length + 6 + 4 + 4 + file.name.length);\n writeBytes(dirBuffer, [0x50, 0x4b, 0x01, 0x02]);\n writeBytes(dirBuffer, [0x14, 0x00]);\n dirBuffer.appendBuffer(fileHeader);\n // comment length, disk start, file attributes\n writeBytes(dirBuffer, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);\n // external file attributes, @todo\n writeBytes(dirBuffer, [0x00, 0x00, 0x00, 0x00]);\n // relative offset of local header\n dirBuffer.writeInt32(fileOffset);\n // file name\n dirBuffer.write(file.name, \"ascii\");\n \n // update offset\n fileOffset += fileBuffer.length;\n \n fileBuffers.push(fileBuffer);\n dirBuffers.push(dirBuffer);\n });\n \n var totalDirLength = getTotalBufLength(dirBuffers);\n var totalFileLength = getTotalBufLength(fileBuffers);\n \n var dirEnd = new RollingBuffer(8 + 2 + 2 + 4 + 4 + 2);\n writeBytes(dirEnd, [0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00]);\n // total number of entries\n dirEnd.writeInt16(fileBuffers.length);\n dirEnd.writeInt16(fileBuffers.length);\n // directory lengths\n dirEnd.writeInt32(totalDirLength);\n // file lengths\n dirEnd.writeInt32(totalFileLength);\n // and the end of file\n writeBytes(dirEnd, [0x00, 0x00]);\n \n var buffer = new RollingBuffer(totalFileLength + totalDirLength + dirEnd.length);\n fileBuffers.forEach(function (b) { buffer.appendBuffer(b); });\n dirBuffers.forEach(function (b) { buffer.appendBuffer(b); });\n buffer.appendBuffer(dirEnd);\n \n return buffer.getInternalBuffer();\n }",
"title": ""
},
{
"docid": "157a8183f0abc27e29af82aa23007448",
"score": "0.47242826",
"text": "addFolder() {\n var parent = this['selected'] && this['selected'].length == 1 ? this['selected'][0] : this.placesRoot_;\n while (parent && !parent.isFolder()) {\n parent = parent.getParent();\n }\n\n if (parent) {\n createOrEditFolder(/** @type {!FolderOptions} */ ({\n 'parent': parent\n }));\n }\n Metrics.getInstance().updateMetric(PlacesKeys.ADD_FOLDER, 1);\n }",
"title": ""
},
{
"docid": "4d7a0456a54f92f26c52ac1e0d142a79",
"score": "0.46903616",
"text": "expand() {\n this.buildUp();\n if ((this.subDirectories.length > 0) || this.files.length) {\n this.isExpanded = true;\n }\n }",
"title": ""
},
{
"docid": "2e58a7c0e35f9407add8e8157a5242a6",
"score": "0.46901765",
"text": "function recurse(dir, files) {\n async.reduce(\n files, mem,\n function (memo, file, next) {\n var fullpath = path.join(dir, file);\n fs.stat(fullpath, function (err, stat) {\n if (err) {\n return err.code !== 'ENOENT' && err.code !== 'EACCES'\n ? next(err)\n : next();\n }\n\n if (base) {\n mem[base] = mem[base] || {};\n if (stat.isDirectory()) {\n return traverse(fullpath, mem[base], function (err, subtree) {\n return next(null, mem);\n });\n }\n else if (path.extname(fullpath) === '.js') {\n return traverse.parse(fullpath, function (err, ast) {\n mem[base][file] = ast;\n return next(null, mem);\n });\n }\n }\n else {\n if (stat.isDirectory()) {\n mem[file] = {};\n return traverse(fullpath, mem, function (err, subtree) {\n return next(null, mem);\n });\n }\n else if (path.extname(fullpath) === '.js') {\n return traverse.parse(fullpath, function (err, ast) {\n mem[file] = ast;\n return next(null, mem);\n });\n }\n }\n\n next(null, mem);\n });\n },\n function (err, result) {\n return err\n ? callback(err)\n : callback(null, result)\n }\n )\n }",
"title": ""
},
{
"docid": "14a41b7ff24912ffbb095c011665a10f",
"score": "0.4686176",
"text": "function formatDirectoryContent(directoryObj) {\n path = directoryObj.path;\n pathIsRoot = directoryObj.pathIsRoot;\n folders = directoryObj.folders;\n files = directoryObj.files;\n var formattedContentEntries = [];\n var setTrue = true;\n //Create a contentEntry element for each folder\n folders.forEach((folderObj) => {\n formattedContentEntries.push(\n //Wrap each folder item's elements in a div\n \"<div class='contentEntry'>\",\n //Item column: clickable folder name\n `<p class='item folder' onclick=getList('${folderObj.folderName}',${setTrue})>📁<u>${folderObj.folderName}</u></p>`,\n //Size column: folder item count\n `<p class='sizeInfo'>${folderObj.itemCount}</p>`,\n //Download column: not applicable\n \"<p class='notApplicable'>n/a</p>\",\n //Delete column\n \"<div class='deleteButtonContainer'>\",\n `<button class='deleteButton' onclick=deleteItem('${folderObj.folderName}')>Delete Item</button>`,\n \"</div>\",\n \"</div>\"\n );\n });\n //Create a contentEntry element for each file\n files.forEach((fileObj) => {\n formattedContentEntries.push(\n //Wrap each file entry's elements in a div\n \"<div class='contentEntry'>\",\n //Item column: clickable file name\n `<a class='item file' style='text-decoration:none;' href=${fileObj.fileName} target='_blank' rel='noopener noreferrer'>✨<u>${fileObj.fileName}</u></a>`,\n //Size column: file size item count\n `<p class='sizeInfo'>${fileObj.fileSize}</p>`,\n //Download column: download checkbox\n \"<input type='checkbox' class='downloadBox'>\",\n //Delete column\n \"<div class='deleteButtonContainer'>\",\n `<button class='deleteButton' onclick=deleteItem('${fileObj.fileName}')>Delete Item</button>`,\n \"</div>\",\n \"</div>\"\n );\n });\n //Display 'no results' message when appropriate\n if (formattedContentEntries.length == 0) {\n formattedContentEntries.push(\"<p class='noResults'><i>No results</i></p>\");\n }\n //Display link to navigate up one folder when appropriate\n if (!pathIsRoot) {\n var returnDirectory = path.substring(0, path.lastIndexOf(\"/\"));\n formattedContentEntries.push(\n `<p class='oneDirectoryUp' onclick=getList('${returnDirectory}',${setTrue})><u>Go to ${returnDirectory}</u></p>`\n );\n }\n return formattedContentEntries.join(\"\");\n}",
"title": ""
},
{
"docid": "df5288266e4d287d42a8ad5a19120970",
"score": "0.46833837",
"text": "static directoryTree(root, indentation) {\n const stats = fs.lstatSync(root);\n const filename = root.split('/').pop();\n\n indentation = indentation || '';\n\n if (stats.isDirectory()) {\n Logger.mkdir(indentation + filename + '/');\n\n fs.readdirSync(root).map((child) => Logger.directoryTree(`${root}/${child}`, indentation + ' '));\n } else if (!filename.match(/^\\./)) {\n Logger.createFile(indentation + filename);\n }\n }",
"title": ""
},
{
"docid": "ee38758c995247a1b703f7b6be9242e7",
"score": "0.4679834",
"text": "function organizeDirectory() {\n fs.readdir(current, (err, files) => {\n //inside inside directory ,looping every file\n files.forEach((file) => {\n //extracting the extension of file\n let fileNamePath = file.split(\".\")[1];\n\n //if extension is html\n if (fileNamePath == \"html\") {\n let path = current + `/html`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n\n //if extension is files like txt or pdf or excel\n else if (\n fileNamePath == \"txt\" ||\n fileNamePath == \"pdf\" ||\n fileNamePath == \"xlsx\" ||\n fileNamePath == \"docx\" ||\n fileNamePath == \"epub\" ||\n fileNamePath == \".org)\"\n ) {\n let path = current + `/files`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n\n //if extension is zip files files\n else if (fileNamePath == \"rar\" || fileNamePath == \"7z\") {\n let path = current + `/zipFiles`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n\n //if extension is exe files\n else if (fileNamePath == \"exe\" || fileNamePath == \"msi\") {\n let path = current + `/DownloadedApps`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n\n //if extension is mp4(videos)(.wmv)\n else if (\n fileNamePath == \"mp4\" ||\n fileNamePath == \"wmv\" ||\n fileNamePath == \"mkv\"\n ) {\n let path = current + `/video`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n\n //if extension is images like (jpg or jpeg or png)\n else if (\n fileNamePath == \"jpg\" ||\n fileNamePath == \"jpeg\" ||\n fileNamePath == \"png\"\n ) {\n let path = current + `/images`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n //any other files and folders goes to other folder\n else {\n path = current + `/others`;\n\n if (!checkFileExists(path)) {\n fs.mkdirSync(path);\n }\n\n fs.rename(current + `/${file}`, path + `/${file}`, function (err) {});\n }\n });\n });\n}",
"title": ""
},
{
"docid": "9557174876b948ad480bf5be358b6633",
"score": "0.46671683",
"text": "async doFolderFilesRefresh (upDown, folder) {\n if (!folder || !upDown) {\n return // exit on empty folder\n }\n this.loadWait = true\n let isOk = false\n let fLst = []\n\n const u = this.omsUrl + '/api/' + (upDown === 'up' ? 'upload' : 'download') + '/file-tree/' + encodeURIComponent(folder || '')\n try {\n const response = await this.$axios.get(u)\n fLst = response.data\n isOk = true\n } catch (e) {\n let em = ''\n try {\n if (e.response) em = e.response.data || ''\n } finally {}\n console.warn('Server offline or file tree retrieve failed.', em)\n }\n this.loadWait = false\n\n if (!isOk || !fLst || !Array.isArray(fLst) || fLst.length <= 0 || !Mdf.isUpDownFileTree(fLst)) {\n return\n }\n\n // update folder files tree\n const td = this.makeFolderTreeData(fLst)\n this.isAnyFolderDir = td.isAnyDir\n this.folderTreeData = Object.freeze(td.tree)\n }",
"title": ""
},
{
"docid": "93f617faa610e520498c55cbe71daf7c",
"score": "0.4661701",
"text": "function updateProjectRootFiles(tree, schema, project) {\n const destination = utils_1.getDestination(tree, schema, project);\n const newRelativeRoot = path\n .relative(path.join(app_root_1.appRootPath, destination), app_root_1.appRootPath)\n .split(path.sep)\n .join('/');\n const oldRelativeRoot = path\n .relative(path.join(app_root_1.appRootPath, project.root), app_root_1.appRootPath)\n .split(path.sep)\n .join('/');\n if (newRelativeRoot === oldRelativeRoot) {\n // nothing to do\n return;\n }\n const dots = /\\./g;\n const regex = new RegExp(oldRelativeRoot.replace(dots, '\\\\.'), 'g');\n for (const file of tree.children(destination)) {\n if (!path_1.extname(file).startsWith('.js')) {\n continue;\n }\n const oldContent = tree.read(path_1.join(destination, file)).toString();\n const newContent = oldContent.replace(regex, newRelativeRoot);\n tree.write(path_1.join(destination, file), newContent);\n }\n}",
"title": ""
},
{
"docid": "3274471d38a040c3ae8576cedf62a7c9",
"score": "0.4661056",
"text": "async addOrUpdateProjectFiles() {\r\n try {\r\n const entryFiles = glob.sync(path.join(this.config.templateDirs.entry, \"**/*\"));\r\n const staticFiles = glob.sync(path.join(this.config.templateDirs.static, \"**/*\"));\r\n const dataFiles = glob.sync(path.join(this.config.templateDirs.data, \"**/*\"));\r\n const copyFiles = async (files, source, destination) => {\r\n logger.log(`Copying ${source} to ${destination}`);\r\n\r\n for (var key in files) {\r\n const templateFilePath = pathNormalize(files[key]);\r\n const templateRelPath = path.normalize(templateFilePath.replace(pathNormalize(source), \"./\"));\r\n const projectTemplatePath = path.resolve(destination, templateRelPath);\r\n const isDirectory = fs.lstatSync(templateFilePath).isDirectory();\r\n const exists = fs.existsSync(projectTemplatePath);\r\n let answers = {\r\n continue: false\r\n };\r\n \r\n if (isDirectory) {\r\n fs.mkdirpSync(projectTemplatePath);\r\n } else {\r\n if (exists) {\r\n answers = await prompt({\r\n type: \"confirm\",\r\n name: \"continue\",\r\n message: `Update ${templateRelPath}?`\r\n });\r\n }\r\n \r\n if (!exists || answers.continue) {\r\n fs.copySync(templateFilePath, projectTemplatePath);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return await Promise.all([\r\n copyFiles(entryFiles, this.config.templateDirs.entry, this.config.dirs.entry),\r\n copyFiles(staticFiles, this.config.templateDirs.static, this.config.dirs.static),\r\n copyFiles(dataFiles, this.config.templateDirs.data, this.config.dirs.data)\r\n ]);\r\n } catch (error) {\r\n throw error;\r\n }\r\n }",
"title": ""
},
{
"docid": "b6a6a99f102e87a767be768b32874d99",
"score": "0.46509337",
"text": "function flatten() {\n return through2.obj(function(file, enc, next) {\n if(!file.isDirectory()) {\n try {\n let dir = path.dirname(file.relative).split(path.sep)[0];\n let fileName = path.normalize(path.basename(file.path));\n file.path = path.join(file.base, path.join(dir, fileName));\n this.push(file);\n } catch(e) {\n this.emit('error', new Error(e));\n }\n }\n next();\n });\n}",
"title": ""
},
{
"docid": "1e1369a1ec64287816793400ba3b9f9c",
"score": "0.46498677",
"text": "function ideaZip (callback) {\r\n const date = Math.floor(new Date() / 1000)\r\n ideaDirName = 'Idea-' + date\r\n const ideaFileName = 'IdeaFile-' + date + '.zip'\r\n zipper.sync.zip(path.join(process.cwd(), '.idea')).compress().save(path.join(process.cwd(), '.idea', ideaFileName))\r\n ideaFile = ideaFileName\r\n callback(null, ideaFileName)\r\n}",
"title": ""
},
{
"docid": "bbdacebcf6ed6e8bcd925f043c5d10e2",
"score": "0.46398386",
"text": "function ZipArchive() {\n if (CRC32TABLE.length === 0) {\n ZipArchive.initCrc32Table();\n }\n this.files = [];\n this.level = 'Normal';\n __WEBPACK_IMPORTED_MODULE_1__syncfusion_ej2_file_utils__[\"b\" /* Save */].isMicrosoftBrowser = !(!navigator.msSaveBlob);\n }",
"title": ""
},
{
"docid": "bbdacebcf6ed6e8bcd925f043c5d10e2",
"score": "0.46398386",
"text": "function ZipArchive() {\n if (CRC32TABLE.length === 0) {\n ZipArchive.initCrc32Table();\n }\n this.files = [];\n this.level = 'Normal';\n __WEBPACK_IMPORTED_MODULE_1__syncfusion_ej2_file_utils__[\"b\" /* Save */].isMicrosoftBrowser = !(!navigator.msSaveBlob);\n }",
"title": ""
},
{
"docid": "852aafcacd2f423e2acbdd6f178c0955",
"score": "0.46329755",
"text": "function copyFolder(path, targetFolder, folderName) {\n // path = path file/folder its currently foreaching\n if (!fs.lstatSync(path).isDirectory()) {\n fs.copyFileSync(path, `./${targetFolder}/${folderName}`)\n } else {\n let tempDir = fs.readdirSync(path) //Shows content of a folder\n tempDir.forEach(file => {\n if (fs.lstatSync(path).isDirectory()) {\n let extraPath = getExtendedPath(path)\n if (fs.existsSync(`${targetFolder}/${extraPath}`)) {\n // console.log('Findes allerede', )\n } else {\n // console.log('findes ikke', )\n fs.mkdirSync(`${__dirname}/${targetFolder}/${extraPath}`)\n }\n }\n if (fs.lstatSync(`${path}/${file}`).isDirectory()) {\n if (fs.existsSync(`${__dirname}/${targetFolder}/${file}`)) {\n copyFolder(`${path}/${file}`, targetFolder);\n } else {\n fs.mkdirSync(`${__dirname}/${targetFolder}/${file}`)\n copyFolder(`${path}/${file}`, targetFolder);\n }\n } else {\n let extraPath = getExtendedPath(path)\n try {\n fs.copyFileSync(`${path}/${file}`, `${__dirname}/${targetFolder}/${extraPath}/${file}`)\n } catch {\n console.log('Er du sikker på at folderne findes? Err måske start copyFolder function')\n }\n }\n });\n }\n }",
"title": ""
},
{
"docid": "ee5ba96ee14459a403bfcdc9f56d7078",
"score": "0.46327403",
"text": "function _recursiveMkDir(dir) {\n if (!fs.existsSync(dir)) {\n _recursiveMkDir(path.dirname(dir));\n fs.mkdirSync(dir);\n }\n}",
"title": ""
},
{
"docid": "a6ddc180898eee13478afd0d9d3fb795",
"score": "0.46291324",
"text": "function mkdirRecursiveSync(path) {\n if (!FS.existsSync(path)) {\n mkdirRecursiveSync(PATH.dirname(path));\n FS.mkdirSync(path, 509); //, 0775);\n }\n }",
"title": ""
},
{
"docid": "66265460feb54e48f074fd49df7d661d",
"score": "0.4608742",
"text": "function createJHipsterJSONFolder(subFolder) {\n FileUtils.createFolderIfItDoesNotExist(path.join(subFolder, '.jhipster'));\n}",
"title": ""
},
{
"docid": "6abd4cbe78412db9292232fae934f5f4",
"score": "0.46080628",
"text": "function createArchive(files, progressCallback) {\n const zip = new JSZip();\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const path = file.path;\n const data = file.data;\n zip.file(path, data);\n }\n return zip.generateAsync({\n type: 'blob',\n compression: 'DEFLATE',\n }, function(metadata) {\n if (progressCallback) {\n progressCallback(metadata.percent / 100);\n }\n });\n }",
"title": ""
},
{
"docid": "bd6c1bce5e35f95fdef18140863b538a",
"score": "0.4607024",
"text": "function getZipFromFile(file)\n {\n return JSZip.loadAsync(file).then(function(zip)\n {\n console.log(\"loadasync from file...\", zip);\n StorageFactory.deleteAll();\n var myzipfiles = [];\n \n //removing unwanted entries\n zip.forEach(function(relativePath, file)\n {\n if(file.name.substring(0,2) !== '__' && file.name !== PROJECTNAME +'/' && file.name !== 'BuildInfo_SC.properties')\n {\n myzipfiles.push(file);\n }\n });\n \n //removing an unwanted wrapper directory ('PROJECTNAME/Configuration.xml becomes 'Configuration.xml')\n for(var i=0 ; i< myzipfiles.length; i++)\n {\n if(myzipfiles[i].name.indexOf(PROJECTNAME) > -1)\n {\n console.log(\"slicing out\", myzipfiles[i].name);\n var item = myzipfiles[i].name;\n var helper = item.substring(item.lastIndexOf('/') + 1 ,item.length);\n myzipfiles[i].name = helper;\n }\n }\n\n /*Write to local storage; to avoid collisions, the calls\n are made synchronously.*/\n storeZip(0);\n \n function storeZip(index)\n {\n if(index > myzipfiles.length-1)\n {\n return;\n }\n else\n {\n if(!(myzipfiles[index].dir))\n {\n myzipfiles[index].async(\"string\").then(function resolve(data)\n {\n var newslotname = \"slot\" + Math.ceil(Math.random()*1000);\n console.log(\"data length\",myzipfiles[index].name, data.toString().length);\n StorageFactory.getSetter(myzipfiles[index].name)(newslotname);\n StorageFactory.getSetter(newslotname)(data);\n index++;\n storeZip(index++);\n });\n }\n else\n {\n index++;\n storeZip(index);\n }\n }\n } \n\n console.log(\"loaded zipfiles\",myzipfiles);\n var myjson=[];\n myslots = {};\n\n //creation of a flat json structure \n for( i =0 ; i< myzipfiles.length ; i++)\n {\n if(myzipfiles[i].dir)\n {\n myjson.push({\n id : Math.ceil(Math.random() * 10000), \n isDirectory : myzipfiles[i].dir,\n title : myzipfiles[i].name.substring(0,myzipfiles[i].name.length-1),\n nodes : []\n });\n }\n else\n {\n var myobj = {\n id : Math.ceil(Math.random() * 10000),\n isDirectory : myzipfiles[i].dir,\n title : myzipfiles[i].name,\n nodes : []\n };\n myjson.push(myobj);\n myslots[myobj.id] = {title:myobj.title, isLocked:false};\n }\n }\n\n //sorting the array: highest amount of nodes first .\n myjson.sort(function compare(val1, val2)\n {\n if(val1.title.split('/').length > val2.title.split('/').length)\n {\n return -1;\n }\n if(val1.title.split('/').length < val2.title.split('/').length)\n {\n return 1;\n }\n return 0;\n });\n\n var helper5 = 0;//emergency variable to prevent a possible eternal loop\n var parentsfound = true; //escapes the while loop when we had a run with no results\n\n \n /*\n adding children to the parents node arrays; when there is a parent found myjson is changed\n and we will start the loop again\n */\n while(parentsfound && helper5 <100)\n {\n parentsfound = false;\n var copy = myjson;\n\n for(var index = 0 ; index < myjson.length; index ++)\n {\n for(var j=0 ; j< copy.length; j++)\n {\n if(isParent(myjson[index].title, copy[j].title))\n {\n // console.log(myjson[index].title, \"direct parent of \" ,copy[j].title);\n // console.log(\"myjson\",myjson);\n myjson[index].nodes.push(copy[j]);\n myjson.splice(j,1);\n parentsfound = true;\n break;\n }\n }\n if(parentsfound)\n {\n break;\n }\n }\n helper5 ++;\n }\n \n\n\n /* Main helper function of the recursive loop; \"dir1/dir2/file1.abc\" compared with \"dir1/dir2\" will\n regard this as a direct parent-child relationship. */ \n function isParent(possibleparent, candidate)\n {\n if(possibleparent === candidate)\n {\n return false;\n }\n var index = candidate.lastIndexOf('/');\n if(candidate.substring(0,index) === possibleparent)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n\n console.log(\"generated json out of zip:\\n\",myjson);\n\n //saving json and working files structure to local storage, and returning to the caller\n StorageFactory.getSetter('thejson')(myjson);\n StorageFactory.getSetter('myslots')(myslots); \n return(myjson); \n\n });//end of jszip async call\n }",
"title": ""
},
{
"docid": "82b80ee25d0daa5e621e585786e462f9",
"score": "0.45960617",
"text": "function loadFiles() {\n\t\t// logger.trace('inside loadFiles()');\n\t\tvar allfiles = findFiles( rootpath, [ '**/*.js', '**/*.json' ] );\n\t\t// logger.debug(JSON.stringify(allfiles, null, 2));\n\n\t\t_.forEach( allfiles, function( filepath ) {\n\t\t\tregistry.files.push( filepath );\n\t\t} );\n\n\t\tvar packagepaths = _.filter( allfiles, function( filepath ) {\n\t\t\treturn( /.+(package\\.json)/.test( filepath ) );\n\t\t} );\n\t\t_.forEach( packagepaths, function( filepath ) {\n\t\t\tvar content = fs.readFileSync( path.posix.join( rootpath, filepath ), 'utf8' );\n\t\t\tvar json = JSON.parse( content );\n\t\t\tif( json.main ) {\n\t\t\t\tregistry.directories.push( {\n\t\t\t\t\tid: path.posix.dirname( filepath ),\n\t\t\t\t\tpath: path.posix.resolve( path.posix.join( path.posix.dirname( filepath ), json.main ) )\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tvar indexpaths = _.filter( allfiles, function( filepath ) {\n\t\t\treturn( /.+(index\\.js)/.test( filepath ) );\n\t\t} );\n\n\t\t_.forEach( indexpaths, function( filepath ) {\n\t\t\tvar existingdir = _.find( registry.directories, function( dir ) {\n\t\t\t\treturn dir.id === path.posix.dirname( filepath );\n\t\t\t} );\n\t\t\tif( !existingdir ) {\n\t\t\t\tregistry.directories.push( {\n\t\t\t\t\tid: path.posix.dirname( filepath ),\n\t\t\t\t\tpath: filepath\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn registry;\n\t}",
"title": ""
},
{
"docid": "1583f094dd2895c30461a46a4a9dab4f",
"score": "0.4594414",
"text": "function addPages(parentEl, jsonTree, folderURL, parentTitleEl=false) {\n // get list of files/branches in tree\n let index = 0;\n for (branch of jsonTree) {\n\n let fileSource = folderURL + \"/\" + branch.path\n\n // if it's a file (blob), add a link to it\n if (branch.type == \"blob\" && branch.path.includes(\".md\")) {\n let link = document.createElement(\"a\")\n link.href = '#' // makes the mouse look like it'll click\n\n link.addEventListener(\"click\", function() {\n displayMD(fileSource);\n // TODO: Currently not working because 'a' elements are not full width\n // for (item of document.getElementsByClassName(\"currently_selected\")) {\n // item.classList.remove(\"currently_selected\");\n // }\n // this.classList.add(\"currently_selected\");\n\n });\n\n // remove .md file extension without removing it from actual names\n // for example, replace \"About README.md files.md\" with \"About README.md files\"\n link.innerText = branch.path.substr(0,branch.path.lastIndexOf('.md'));\n\n let li\n if (parentTitleEl && index == 0) {\n // treat the parent as the first list item\n parentTitleEl.append(link)\n parentTitleEl.append(parentEl)\n }\n else {\n li = document.createElement(\"li\");\n li.appendChild(link);\n parentEl.appendChild(li);\n }\n ++index;\n }\n // else, add a new element for and recursively go deeper\n // a folder will display contained items as indented. foldet names with the same prefix as an md\n // file will be displayed below that item\n else if (branch.type == \"tree\") {\n let nextLayerParentTitle = document.createElement(\"li\")\n let nextLayerParent = document.createElement(\"ul\");\n\n // Attach new parent to a list item\n parentEl.appendChild(nextLayerParentTitle);\n \n // next layer folder url\n let nextFolderURL = fileSource + \"/\";\n fetch(branch.url)\n .then(response => response.json())\n .then(data => {\n addPages(nextLayerParent, data.tree, nextFolderURL, nextLayerParentTitle);\n })\n }\n } // end of for (branch of jsonTree)\n if (parentEl.innerHTML == '') {\n parentEl.remove();\n }\n if (parentTitleEl.innerHTML == '') {\n parentTitleEl.remove();\n }\n}",
"title": ""
},
{
"docid": "a59956f891579de00ed66a6cd82a05ed",
"score": "0.45907348",
"text": "function addFolderToGitIgnore(FolderName) {\n // use regex to remove prefixes that are not character, but leave the last /\n let FolderNameTrim = FolderName.replace(/^\\W*/, '');\n fs.appendFile('.gitignore', `\\n${FolderNameTrim}/`, function (err) {\n if (err) return console.log(err);\n console.log(`The folder ${FolderNameTrim}/ was added to .gitignore`);\n });\n}",
"title": ""
},
{
"docid": "c4b51c34b9588ec8b78b648d75af661f",
"score": "0.45830658",
"text": "static async scanAssetsInPublisherFolder(source, sourcePath, extensions, debug = false) {\n // first level = packs\n let packs = []\n if(debug) console.log(`Moulinette FileUtil | Publisher: scanning ${sourcePath} ...`)\n let dir = await FilePicker.browse(source, sourcePath, MoulinetteFileUtil.getOptions());\n if(debug) console.log(`Moulinette FileUtil | Publisher: ${dir.dirs.length} subfolders found.`)\n for(const pack of dir.dirs) {\n if(debug) console.log(`Moulinette FileUtil | Publisher: processing pack ${pack}...`)\n packs.push({ name: decodeURI(pack.split('/').pop()), path: pack, assets: await MoulinetteFileUtil.scanAssetsInPackFolder(source, decodeURI(pack), extensions, debug) })\n }\n return packs\n }",
"title": ""
},
{
"docid": "1f6268a28779b8ff8c6bb97a40db9ed7",
"score": "0.45782524",
"text": "function createJsBackupDirectory(directoryStructure,createHere)\n {\n var res=directoryStructure.split(\"/\");\n createHere=Backup+'/'+createHere;\n var dirRecursive=createHere;\n if(!fs.existsSync(createHere))\n {\n mkdirSync(createHere);\n }\n while(res[0]!='portal')\n {\n res.shift();\n }\n for(var i=0;i<res.length;i++)\n {\n dirRecursive=dirRecursive+'/'+res[i];\n if(!fs.existsSync(dirRecursive))\n {\n mkdirSync(dirRecursive);\n console.log('......Js BackUp Directory '+dirRecursive+' Created\\n');\n }\n }\n return dirRecursive;\n }",
"title": ""
}
] |
16e1fab8d93a1807b46fae3651684638 | to generate blocks with numbers and check if its need to be win combination or random | [
{
"docid": "222413307ebb52f1c78c59f2d30c312e",
"score": "0.73563325",
"text": "function generate(winComb = 'false') {\n let arrNums = [];\n let index = 0;\n \n stepCount(0);\n $('#blocks').html('');\n backgroundBlocks();\n\n arrNums = arr.map(function(el) {\n return el;\n });\n if (winComb != 'true') {\n arrNums.sort(function(a, b) {\n if (Math.random() > 0.5) {\n return 1\n } else {\n return -1\n }\n });\n }\n\n for (let row = 0; row <= 3; row++) {\n for (let col = 0; col <= 3; col++) {\n\n $('#blocks').append(`<div id=\"block_row${row}_col${col}\"></div>`);\n blocks[index] = $(`#block_row${row}_col${col}`);\n\n if (arrNums[index] === '') {\n blocks[index].addClass('empty');\n } else {\n blocks[index].addClass('block').html(`${arrNums[index]}`);\n }\n\n blocks[index].css('height', `${size}px`).css('width', `${size}px`);\n blocks[index].css('top', `${row*size}px`);\n blocks[index].css('left', `${col*size}px`);\n index++\n }\n }\n checkWin();\n }",
"title": ""
}
] | [
{
"docid": "035f46ab921afccc19d8a1333761e84e",
"score": "0.69135505",
"text": "function randomBlocks(blocks) {\n for(blocks; blocks > 0; blocks--) {\n var row = randomNum(2, App.rows - 5); // Nothing on the top row or bottom 5.\n var col = randomNum(1, App.columns);\n\n var box = $('.row' + row + '.column' + col);\n\n // Ensure unique spawns.\n if(box.attr('block') || box.attr('snake')) {\n blocks += 1;\n continue;\n } else {\n box\n .addClass('block')\n .attr('block', 'true');\n }\n }\n\n App.generated = true;\n}",
"title": ""
},
{
"docid": "96fc0e9952342dcab13b5e8770a4df2b",
"score": "0.6797097",
"text": "function generateRandomColorBlock(option) {\n var answerBlock = 0;\n if (option === 1) {\n answerBlock = Math.floor((Math.random() * 9)) + 1;\n }\n else if (option === 2) {\n answerBlock = Math.floor((Math.random() * 6)) + 1;\n }\n else if (option === 3) {\n answerBlock = Math.floor((Math.random() * 3)) + 1;\n }\n return answerBlock;\n}",
"title": ""
},
{
"docid": "7514664f2817bd20ade4c43bccd48b9a",
"score": "0.6747318",
"text": "function generateBlock() {\n\t\t// creates the div block\n\t\tvar block = document.createElement(\"div\");\n\t\tblock.className = \"blocks\";\n\n\t\t// gives us numbers 1 - 3 \n\t\tvar num = Math.floor(Math.random() * 3 + 1);\n\n\t\tif(num == 1) \n\t\t\tblock.className += \" fakeBlock\";\n\t\t/* Keep track of the size of the game area */\n\t\tvar gameArea = document.getElementById(\"game-area\");\n\t\tvar areaW = parseInt(window.getComputedStyle(gameArea).width)\n\t\tvar areaH = parseInt(window.getComputedStyle(gameArea).height);\n\t\tblock.style.left = Math.floor(Math.random() * (areaW - 50)) + \"px\";\n\t\tblock.style.top = 0 + \"px\";\n\t\tdocument.getElementById(\"game-area\").appendChild(block);\t\n\t}",
"title": ""
},
{
"docid": "2d7043e5a83d17a694a20e14c4722e16",
"score": "0.6713092",
"text": "function choose_next_block(){\n block_no=Random_no();\n from_top=0;\n from_left=4;\n rotation_no=1;\n}",
"title": ""
},
{
"docid": "3e74c53f4a89bb390dc4d0b1cbdac218",
"score": "0.6706166",
"text": "function addRandomBlock(){\n //wait = false;\n\n // if Undoing, spawn new block exacly when we spawned last time\n if(undoing){\n undoing = false;\n\n var newBlock = new Block({\n x: lastBlockSpawn.x, y: lastBlockSpawn.y, v: lastBlockSpawn.v\n });\n blocksNode.append(newBlock.node);\n\n newBlock.moveTo(lastBlockSpawn.x, lastBlockSpawn.y);\n\n blocks[lastBlockSpawn.x][lastBlockSpawn.y] = newBlock;\n\n return;\n }\n\n // prepare array to store if already looked at certain cell\n var checked = [[]];\n var x, y;\n\n for (x = 0; x < 4; x++) {\n checked[x] = [];\n for ( y = 0; y < 4; y++) {\n checked[x][y] = false;\n };\n };\n\n\n // Start seeking for empty space\n var blocksCount = blocks.length * blocks[0].length;\n var blocksChecked = 0;\n do{\n // Lottery!\n x = Math.round(Math.random() * (scene.xmax-1));\n y = Math.round(Math.random() * (scene.ymax-1));\n\n // Don't look at it again if we already checked here\n if(checked[x][y] === true){\n continue;\n }\n\n // See it it's empty\n if (blocks[x][y].v === 0) {\n break;\n }else{\n checked[x][y] = true;\n blocksChecked ++;\n }\n\n } while (blocksChecked != blocksCount);\n\n\n // We still have some place\n if(blocksChecked < blocksCount){\n\n // Decide what value we want\n // this iterates through array twice, so it's unwise to use\n // this method on bigger arrays\n var max = blocksLog.indexOf(Math.max.apply(Math, blocksLog));\n var tmpVal = [];\n // Pick between 2 lowest values, we don't wanna spawn the top most block\n if(max!==0)tmpVal.push(1);\n if(max!==1)tmpVal.push(2);\n if(max!==2)tmpVal.push(3);\n\n\n var newVal = tmpVal[Math.round(Math.random())];\n\n // update the back log\n blocksLog[newVal-1] = blocksLog[newVal-1]+1;\n\n var newBlock = new Block({\n x: x, y: y, v: newVal\n });\n blocksNode.append(newBlock.node);\n\n newBlock.moveTo(x, y);\n\n blocks[x][y] = newBlock;\n lastBlockSpawn = {x:x, y:y, v:newVal};\n\n return true;\n }else{\n return false;\n }\n\n }",
"title": ""
},
{
"docid": "6ce6a85a9627613780b4dc6ae3f42062",
"score": "0.66602135",
"text": "function generate(){\n\n // increase difficulty after it scored over 10 points\n if(variables.score > 10) {\n variables.max = Math.ceil(variables.score / 5) * 5\n }\n if(variables.score > 20){\n variables.min = Math.ceil(variables.score / 10) * 5\n }\n\n variables.leftNumber = getRandomNumber(variables.min, variables.max)\n variables.rightNumber = getRandomNumber(variables.min, variables.max)\n variables.result = getRandomBoolean()\n variables.score++\n refreshNumbers()\n}",
"title": ""
},
{
"docid": "ebda21fe53080e85b7f8db28366042a0",
"score": "0.6486591",
"text": "function generateBlocks() {\n clearCanvas();\n\n num = canvas.clientWidth / 30 - 1;\n if (num && typeof num !== \"number\") {\n alert(\"First argument must be a typeof Number\");\n return;\n }\n for (let i = 0; i < num; i++) {\n const value = Math.floor(Math.random() * (canvas.clientHeight *0.95));\n\n const block = document.createElement(\"div\");\n block.classList.add(\"block\");\n block.style.height = `${value}px`;\n block.style.transform = `translateX(${i * 30}px)`;\n\n const blockLabel = document.createElement(\"label\");\n blockLabel.classList.add(\"block__id\");\n blockLabel.innerHTML = value;\n\n block.appendChild(blockLabel);\n canvas.appendChild(block);\n }\n}",
"title": ""
},
{
"docid": "3814606f2cddb7e4a0d8eacdcfe644e7",
"score": "0.6451577",
"text": "drawEdgeBlock(){\n let allowedBlocks = [ \n () => this.drawSquare(this.x, this.y, this.dimension),\n () => this.drawDiagonalLeft(this.x, this.y, this.dimension),\n () => this.drawDiagonalRight(this.x, this.y, this.dimension)\n ]\n let hasRendered = false;\n\n do {\n hasRendered = random(allowedBlocks)()\n // console.log(hasRendered)\n } while (!hasRendered)\n }",
"title": ""
},
{
"docid": "28c1a1f1ed3dff327762cc737c70379f",
"score": "0.6356991",
"text": "function assignMine(){\n\t \t\tvar rand_num = Math.floor(Math.random() * 20);\n\t \t\tif(rand_num >= 16) {\n\t \t\t\treturn true;\n\t \t\t} else{\n\t \t\t\treturn false;\n\t \t\t}\n\t \t}",
"title": ""
},
{
"docid": "74022bf49ac743fb4a06aeb493c2c97f",
"score": "0.63495487",
"text": "function blocksChecker(randomX, y) {\n blocks.forEach(block => {\n let firstCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX - 20, y + 25)\n let secondCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX + 40, y + 25)\n let thirdCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX - 20, y - 25)\n let fourthCornerCheck = checkInside(block.x, block.y, block.bWidth, 40, randomX + 40, y - 25)\n if (firstCornerCheck || secondCornerCheck || thirdCornerCheck || fourthCornerCheck) {\n return true\n }\n })\n}",
"title": ""
},
{
"docid": "7100b92a796a6d855fcb4d1484f9c153",
"score": "0.6328425",
"text": "function spawnCoin() {\n\tdo {\n\t\trandomX = parseInt(Math.floor(Math.random()*(total_x-2))+2);\n\t\trandomY = parseInt(Math.floor(Math.random()*(total_x-2))+2);\n\t} while (parts[randomX][randomY] != 0)\n\tpaint(randomX,randomY,10000);\n}",
"title": ""
},
{
"docid": "6624d550ed30f9dd77640998c92095ae",
"score": "0.6312686",
"text": "function checkWin() {\n for (let i = 0; i < winningCombinations.length; i++) {\n let pattern = winningCombinations[i];\n let [a, b, c] = pattern;\n if ( currentCells[a] === currentCells[b] && currentCells[b] === currentCells[c] ) {\n return true;\n }\n }\n return false;\n}",
"title": ""
},
{
"docid": "255fe14f4753da67f14eacc9c6bfcbfc",
"score": "0.6300857",
"text": "function random_generate() {\r\n let ran_num = Math.floor(Math.random() * sq.length);\r\n if (sq.ran_num % 2)\r\n }",
"title": ""
},
{
"docid": "5ff54ea7718087a1db9ee9226f264d30",
"score": "0.6287789",
"text": "function _generateValidBoard(board) {\n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 9; j++) {\n\n // find a slot to fill\n if (!board[i][j]) {\n\n var numbers = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n\n _markNonAvailableNumbers(board, numbers, i, j);\n\n var availableNumbers = [];\n\n for (var k = 0; k < numbers.length; k++) {\n if (numbers[k] === 0) availableNumbers.push(k);\n }\n\n while (availableNumbers.length > 0) {\n var index = Math.floor((Math.random() * 100) + 1) % availableNumbers.length;\n board[i][j] = availableNumbers[index] + 1;\n if (_generateValidBoard(board)) return true;\n else board[i][j] = \"\";\n availableNumbers.splice(index, 1);\n }\n\n return false;;\n }\n }\n }\n\n return true;\n }",
"title": ""
},
{
"docid": "a0159e21fbffbe69a2b0b9b095de44c6",
"score": "0.6278061",
"text": "function genereCombinaison() {\n combinaisonToFind = \"\";\n for (var i = 0; i < 4; i++) {\n\tcombinaisonToFind += Math.floor((Math.random() * 6));\n }\n}",
"title": ""
},
{
"docid": "6b823c3a209ab9c69ce0dc2510145a9e",
"score": "0.6247409",
"text": "function checkCombination(int1, int2, int3, int4, int5) {\r\n \r\n let rectColor = 0xFFE401;\r\n\r\n let combination = [int1, int2, int3, int4, int5];\r\n\r\n\r\n let comboCount = 0;\r\n for (let j = 1; j < 5; j++) {\r\n\r\n if (spinners[j].value[combination[j]] == spinners[j - 1].value[combination[j - 1]]\r\n || spinners[j - 1].value[combination[j - 1]] == jokerVal) {\r\n comboCount++;\r\n } else {\r\n break;\r\n }\r\n\r\n\r\n }\r\n\r\n //activate animations for all eligible slots\r\n if (comboCount >= 2) {\r\n lastWinCount++;\r\n let rectangles = [];\r\n for (let j = 0; j <= comboCount; j++) {\r\n //spinners[j].highlightedSlots[combination[j]] = true;\r\n //spinners[j].highlight = true;\r\n\r\n rectangles.push(new Rectangle(\r\n spinners[j].x,\r\n spinners[j].imgs[combination[j]].y - spinnerWidth / 2,\r\n spinnerWidth,\r\n spinnerWidth,\r\n rectColor));\r\n }\r\n\r\n //===Avoid using the joker value unless all winning fields are jokers.\r\n let val = spinners[0].value[combination[0]];\r\n if (val == jokerVal) {\r\n for (let j = 0; j <= comboCount; j++) {\r\n if (spinners[j].value[combination[j]] != jokerVal) {\r\n val = spinners[j].value[combination[j]];\r\n }\r\n }\r\n }\r\n //===\r\n\r\n let profit = calculateProfit(comboCount + 1, val);\r\n lastWin += profit;\r\n //console.log(\"Profit: \" + profit);\r\n\r\n if (rectangles.length > 0) {\r\n RectangleGroups.push(rectangles);\r\n }\r\n\r\n //console.log(RectangleGroups.length);\r\n }\r\n}",
"title": ""
},
{
"docid": "1f3f0f0a01cf12edd1de106a8c3729fc",
"score": "0.62373394",
"text": "function randomSpawnNumber(){\r\n // Turns 4x4 grid into 1x16 array\r\n let temp = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]]\r\n let flag = 1;\r\n // Check that there is an empty element in the array\r\n // Breaks if you find a zero, if you get to the end with no zero array is full\r\n for (let i = 0; i < temp.length; i++){\r\n if (temp[i] === 0){\r\n break;\r\n } else if (temp[15] !== 0 && i === 15){\r\n flag = 0;\r\n }\r\n }\r\n // If you get to here there is an open place to insert a new number\r\n if (flag){\r\n randomNumberX = Math.trunc(Math.random() * 4);\r\n randomNumberY = Math.trunc(Math.random() * 4);\r\n // Find empty space to put new number in\r\n while (gameBoard[randomNumberX][randomNumberY] !== 0){\r\n randomNumberX = Math.trunc(Math.random() * 4);\r\n randomNumberY = Math.trunc(Math.random() * 4);\r\n }\r\n // Spawns a \"4 tile\" 10% of the time else it spawns a \"2 tile\"\r\n let spawn4 = Math.random();\r\n if (spawn4 < 0.1){\r\n gameBoard[randomNumberX][randomNumberY] = 4;\r\n } else {\r\n gameBoard[randomNumberX][randomNumberY] = 2;\r\n }\r\n }\r\n}",
"title": ""
},
{
"docid": "e58a6e7e817f4db7fed61cb02f25f475",
"score": "0.6221166",
"text": "function generateRandomBlock() {\n arrayOfBlockFunctions = [\n getIBlock,\n getJBlock,\n getLBlock,\n getOBlock,\n getSBlock,\n getTBlock,\n getZBlock,\n ];\n\n nextPiece = Math.floor(Math.random()*arrayOfBlockFunctions.length);\n arrayOfBlockFunctions[nextPiece]();\n nextPieceBoard = pieceArray;\n}",
"title": ""
},
{
"docid": "407557239a74d35cc2ad7d67757fda93",
"score": "0.6217806",
"text": "function nextGeneration(){\n\n\t// Deletes unused chunks\n\tdeleteEmptyChunks();\n\n\t// Generates new chunks where needed\n\tgenerateNewChunks();\n\n\t// Qualify cells (Keep or Kill)\n\tfor (var i = chunks.length - 1; i >= 0; i--) {\n\t\tif (chunks[i].active == 1) {\n\n\t\t\tvar chunk = chunks[i];\n\t\t\tvar cells = chunks[i].cells;\n\n\t\t\t/*\n\t\t\t* Maybe change this so that we look on the edges first and then inside the chunk\n\t\t\t* \n\t\t\t*\n\t\t\t*\n\t\t\t*/\n\n\t\t\t// for all the cells in the chunk\n\t\t\tfor (var y = cells.length - 1; y >= 0; y--) {\n\t\t\t\tfor (var x = cells[y].length - 1; x >= 0; x--) {\n\n\t\t\t\t\tvar cell = cells[y][x];\n\t\t\t\t\tvar neighbors = 0;\n\t\t\t\t\tvar bounds = game.chunkSize-1;\n\n\t\t\t\t\t// Top and Top Right neighbors\n\t\t\t\t\tif (y != 0) {\n\t\t\t\t\t\t//top block\n\t\t\t\t\t\tif (chunk.cells[y-1][x].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// right block\n\t\t\t\t\t\tif (x != bounds) {\n\t\t\t\t\t\t\tif (chunk.cells[y-1][x+1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x == bounds) {\t\n\t\t\t\t\t\t\tvar rightChunk = findChunk(chunks, {x: chunk.x+1, y: chunk.y});\n\n\t\t\t\t\t\t\tif (rightChunk != undefined && rightChunk.cells[y-1][0].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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 if (y == 0) {\n\t\t\t\t\t\tvar topChunk = findChunk(chunks, {x: chunk.x, y: chunk.y-1});\n\n\t\t\t\t\t\t//top block\n\t\t\t\t\t\tif (topChunk != undefined && topChunk.cells[bounds][x].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t//top right block\n\t\t\t\t\t\tif (x != bounds) {\n\t\t\t\t\t\t\tif (topChunk != undefined && topChunk.cells[bounds][x+1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(topChunk != undefined && x == bounds) {\t\n\t\t\t\t\t\t\tvar topRightChunk = findChunk(chunks, {x: topChunk.x+1, y: topChunk.y});\n\n\t\t\t\t\t\t\tif (topRightChunk != undefined && topRightChunk.cells[bounds][0].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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\t// Bottom and Bottom Left neighbors\n\t\t\t\t\tif (y != bounds && neighbors <4) {\n\t\t\t\t\t\t//bottom block\n\t\t\t\t\t\tif (chunk.cells[y+1][x].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// bottom Left block\n\t\t\t\t\t\tif (x != 0) {\n\t\t\t\t\t\t\tif (chunk.cells[y+1][x-1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(x == 0 && neighbors <4) {\t\n\t\t\t\t\t\t\tvar leftChunk = findChunk(chunks, {x: chunk.x-1, y: chunk.y});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (leftChunk != undefined && leftChunk.cells[y+1][bounds].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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 if (y == bounds) {\n\t\t\t\t\t\tvar bottomChunk = findChunk(chunks, {x: chunk.x, y: chunk.y+1});\n\n\t\t\t\t\t\t//bottom block\n\t\t\t\t\t\tif (bottomChunk != undefined && bottomChunk.cells[0][x].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t//bottom left block\n\t\t\t\t\t\tif (x != 0) {\n\t\t\t\t\t\t\tif (bottomChunk != undefined && bottomChunk.cells[0][x-1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(bottomChunk != undefined && x == 0 && neighbors <4) {\t\n\t\t\t\t\t\t\tvar bottomLeftChunk = findChunk(chunks, {x: bottomChunk.x-1, y: bottomChunk.y});\n\n\t\t\t\t\t\t\tif (bottomLeftChunk != undefined && bottomLeftChunk.cells[0][bounds].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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\t// Left and Left Top neighbors\n\t\t\t\t\tif (x != 0 && neighbors <4) {\n\t\t\t\t\t\t// Left block\n\t\t\t\t\t\tif (chunk.cells[y][x-1].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Left top block\n\t\t\t\t\t\tif (y != 0) {\n\t\t\t\t\t\t\tif (chunk.cells[y-1][x-1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y == 0 && neighbors <4) {\t\n\t\t\t\t\t\t\tvar leftTopChunk = findChunk(chunks, {x: chunk.x, y: chunk.y-1});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (leftTopChunk != undefined && leftTopChunk.cells[bounds][x-1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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 if (x == 0 && neighbors <4) {\n\t\t\t\t\t\tvar leftChunk = findChunk(chunks, {x: chunk.x-1, y: chunk.y});\n\n\t\t\t\t\t\t//left block\n\t\t\t\t\t\tif (leftChunk != undefined && leftChunk.cells[y][bounds].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t//left top block\n\t\t\t\t\t\tif (y != 0) {\n\t\t\t\t\t\t\tif (leftChunk != undefined && leftChunk.cells[y-1][bounds].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y == 0 && neighbors <4) {\t\n\t\t\t\t\t\t\tvar leftTopChunk = findChunk(chunks, {x: chunk.x-1, y: chunk.y-1});\n\n\t\t\t\t\t\t\tif (leftTopChunk != undefined && leftTopChunk.cells[bounds][bounds].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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\t// Right and Right Bottom neighbors\n\t\t\t\t\tif (x != bounds && neighbors <4) {\n\t\t\t\t\t\t// Right block\n\t\t\t\t\t\tif (chunk.cells[y][x+1].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Right Bottom block\n\t\t\t\t\t\tif (y != bounds) {\n\t\t\t\t\t\t\tif (chunk.cells[y+1][x+1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y == bounds && neighbors <4) {\t\n\t\t\t\t\t\t\tvar rightBottomChunk = findChunk(chunks, {x: chunk.x, y: chunk.y+1});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (rightBottomChunk != undefined && rightBottomChunk.cells[0][x+1].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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 if (x == bounds && neighbors <4) {\n\t\t\t\t\t\tvar rightChunk = findChunk(chunks, {x: chunk.x+1, y: chunk.y});\n\n\t\t\t\t\t\t//right block\n\t\t\t\t\t\tif (rightChunk != undefined && rightChunk.cells[y][0].a == 1) {\n\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t//right bottom block\n\t\t\t\t\t\tif (y != bounds) {\n\t\t\t\t\t\t\tif (rightChunk != undefined && rightChunk.cells[y+1][0].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(y == bounds && neighbors <4) {\t\n\t\t\t\t\t\t\tvar rightBottomChunk = findChunk(chunks, {x: chunk.x+1, y: chunk.y+1});\n\n\t\t\t\t\t\t\tif (rightBottomChunk != undefined && rightBottomChunk.cells[0][0].a == 1) {\n\t\t\t\t\t\t\t\tneighbors++;\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\t// Decide if I kill or keep the cell\n\t\t\t\t\tif (neighbors <= 1 || neighbors >= 4){\n\t\t\t\t\t\tcell.k = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse if (cell.a == 1 && neighbors <= 3){\n\t\t\t\t\t\tcell.k = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse if(cell.a == 0 && neighbors == 3){\n\t\t\t\t\t\tcell.k = 1;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\n\t// Kill all cells that didnt qualify\n\tkill();\n}",
"title": ""
},
{
"docid": "395940fbec955f12595d871e3e69636f",
"score": "0.6203486",
"text": "function generateWinningNumber(){\n\t\treturn Math.ceil(Math.random() * (1,100));\n\t}",
"title": ""
},
{
"docid": "25f21db8c3755044d17757bb4536fc0c",
"score": "0.6200983",
"text": "function gridLayout(blocksNumbers) {\n contain.innerHTML = ''\n gameOver.innerHTML = ''\n\n // Generazione randomica della posizione delle bombe\n let bombs = genBombs(nSquares);\n console.log(bombs);\n\n const winCounter = safeSquares(blocksNumbers, bombs.length)\n console.log(winCounter);\n\n for (let n = 1; n <= blocksNumbers; n++) {\n const blockEl = document.createElement('div');\n blockEl.classList.add('square', 'purple');\n blockEl.innerHTML = n;\n contain.append(blockEl);\n\n blockEl.addEventListener('click', function () {\n const keySelected = Number(blockEl.innerText);\n\n const keyBomb = isBomb(bombs, keySelected);\n\n\n if (keyBomb) {\n /* blockEl.classList.remove('purple')\n blockEl.classList.add('crimson') */\n\n //Game over del gioco\n //svuotare la griglia\n contain.innerHTML = \"\"\n\n //creare un contenitore dove mettere la scritta che enuncia la sconfitta e aggiungo lo stile al contenitore\n const loseContainer = document.createElement('div');\n loseContainer.classList.add('loseContainer');\n\n // Inserisco nell'HTML il mio contenitore che enuncia la sconfitta \n gameOver.append(loseContainer)\n\n // La scritta effettiva che ti dice che hai perso\n loseContainer.innerHTML = `\n <h1>You hitted a <span>Bomb</span>! Try again! <span>Click</span> again on button for <span>Start</span> new Game</h1>\n `\n } else { // Se clicchi i quadrati senza le bombe, il quadratino diventa verde tramite la classe \"selected\"\n blockEl.classList.remove('purple')\n blockEl.classList.add('selected')\n }\n\n })\n }\n\n}",
"title": ""
},
{
"docid": "47d67a32321ce0b7b95c460abb2f1800",
"score": "0.6170997",
"text": "function getNewBlock(){\n blk = [];\n nextBlk = [];\n\n blkColor = nextBlkColor;\n nextBlkColor = Math.ceil(Math.random()*7);\n\n // get tile coordinates of next blocks\n for(let i=0; i<4; i++){\n blk.push(blk_structure[ blkColor ][i].slice(0));\n nextBlk.push(next_blk_structure[ nextBlkColor ][i].slice(0));\n }\n\n // clear grid on status area\n for(let r=0; r<4; r++){\n for(let c=0; c<4; c++){\n $scope.nextGrid[r][c] = 0;\n }\n }\n\n // draw blocks on grids\n for(let i=0; i<4; i++){\n // end game if no open space for current block\n if($scope.grid[ blk[i][0] ][ blk[i][1] ] !== 0){\n clearInterval(blockFallInterval);\n gameStart = false;\n $(\"#tetris-grid\").css(\"opacity\",\"0.7\");\n $(\"#tetris-gameover\").css(\"display\", \"block\");\n }\n\n $scope.grid[ blk[i][0] ][ blk[i][1] ] = blkColor;\n $scope.nextGrid[ nextBlk[i][0] ][ nextBlk[i][1] ] = nextBlkColor;\n }\n }",
"title": ""
},
{
"docid": "44f311ab1e5af18e9cbee1d974b411b3",
"score": "0.6168244",
"text": "captureSeeds(num1) {\n if ((this.playerOne.isTurn && num1 > -1 && num1 < 6) || (this.playerTwo.isTurn && num1 > 6 && num1 < 13) ) {\n let num2 = this.getOppositeHole(num1);\n let sum = 0;\n sum = this.masterBoardArray[num1] + this.masterBoardArray[num2];\n if (this.masterBoardArray[num2] !== 0) {\n if (this.playerOne.isTurn) {\n this.masterBoardArray[6] += sum;\n }\n if (this.playerTwo.isTurn) {\n this.masterBoardArray[13] += sum;\n }\n this.masterBoardArray[num1] = 0;\n this.masterBoardArray[num2] = 0;\n }\n this.render();\n }\n }",
"title": ""
},
{
"docid": "516e5b160f2dc81594165eba6a978e95",
"score": "0.61571467",
"text": "function fillRandomPlaces(){\r\n\tvar fillArray = [];//Initialize a local array\r\n\tfor (var i = 0; i < size; i++) { \r\n\t\tfor (var j = 0; j < size; j++) { \r\n\t\t\tif(grid[i][j]==0){\r\n\t\t\t\tfillArray.push({x:i,y:j});//Storing all the blocks with zero\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t}\r\n\tvar rand = Math.random();//Getting a random value < 1 && > 0\r\n\tvar total = fillArray.length;//Length of all zero containing blocks\r\n\tvar randIndex = Math.floor(rand * total);//Getting a random Index\r\n\tvar randomGrid= fillArray[randIndex];//Getting one random spot\r\n\tgrid[randomGrid.x][randomGrid.y] = rand > 0.2 ? 2 : 4; //With 80% chance of 2 fill 2 or 4 on that empty spot\r\n}",
"title": ""
},
{
"docid": "010abfd48bac8fa7f8caef81073a637e",
"score": "0.6121915",
"text": "function generateWinningNumbers(min, max, quantity) {\n var numbers = [];\n while (numbers.length < quantity) {\n // generate new number\n var newNumber = Math.floor(Math.random() * ((max - min) + 1) + min);\n // is number in array already?\n if (numbers.indexOf(newNumber) < 0) {\n // add number to array\n numbers.push(newNumber);\n }\n };\n return numbers; // return array of unique numbers\n }",
"title": ""
},
{
"docid": "eb1553ed938eb79820578d699abb09f8",
"score": "0.61213696",
"text": "function generate()\r\n {\r\n let randomNumber = Math.floor(Math.random() * squares.length)\r\n if(squares[randomNumber].innerHTML == 0){\r\n squares[randomNumber].innerHTML = 2\r\n checkForGameOver()\r\n }else generate()\r\n\r\n }",
"title": ""
},
{
"docid": "cb41b075e155db64040269c3d06dbaf0",
"score": "0.6120115",
"text": "function generateCard(){\n //Generamos una tarjeta de 15 números, asumiendo que no opuede haber dos números iguales en ella y solamente puede haber del 0 al 99\n var bingoCard = {};\n //Array conlos números ya utilizados\n var usedNumbers = [];\n //el loop genera 15 distintas posiciones\n for (var i = 0; i <= 14; i++){\n do{\n var coincidence = false\n //Número aleatorio del 1 al 99\n bingoCard[i] = {number: (Math.round(Math.random()*98)+ 1), matched: false};\n //Check de coincidencias entre el array de números utilizados y el nuevo número\n for(var c=0; c < usedNumbers.length; c++){\n if (bingoCard[i].number == usedNumbers[c]){coincidence = true};\n };\n //Si hay coincidencias, generamos otro número aleatorio hasta que no haya coincidencias\n } while (coincidence == true);\n usedNumbers.push(bingoCard[i].number);\n };\n return bingoCard;\n }",
"title": ""
},
{
"docid": "8d463010ffbfde8c3ca651cc07b36561",
"score": "0.61144996",
"text": "function heightTest(){\r\n let heightTotal = 4 + ((startHeight - 1) * 2)\r\n for(let i = 199; i > (20-heightTotal) * width; i--){\r\n let r = Math.random() * 2\r\n if (r < 1){\r\n let rcolor = Math.floor(Math.random()*theTetrominoes.length)\r\n squares[i].classList.add('taken')\r\n squares[i].classList.add('tetromino')\r\n squares[i].style.backgroundColor = colors[rcolor]\r\n squares[i].innerHTML = \"<img id=\\\"img_block\\\" src=\\\"blocks/\" + img_colors[rcolor] + \".png\\\" width=\\\"20\\\" height=\\\"20\\\">\"\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "d125dfc671270dc220577bb7020314f6",
"score": "0.61108744",
"text": "function fillslot(len, x, y, ff, n){\n\n\tif((n<2)||(n>8)){ console.log('fillslot() error n = '+n); return -1; }\n\n\tif(n===2){\n\t\tvar vertices = [[1,1],[1,4],[2,1],[2,2],[3,1]], r = Math.floor(Math.random()*vertices.length);\n\t\taddtile(vertices[r][0], vertices[r][1], len, x, y, ff*36);\n\t}\n\t\n\tif(n===3){\n\t\tvar vertices = [[3,2],[4,1]], r = Math.floor(Math.random()*vertices.length);\n\t\taddtile(vertices[r][0], vertices[r][1], len, x, y, ff*36);\n\t}\n\t\n\tif(n===4){\n\t\tif(Math.random()>0.5){\n\t\t\tvar vertices = [[0,1],[1,2],[1,3]], r = Math.floor(Math.random()*vertices.length);\n\t\t\taddtile(vertices[r][0], vertices[r][1], len, x, y, ff*36);\n\t\t}else{\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 2);\n\t\t}\n\t}\n\t\n\tif(n===5){\n\t\tif(Math.random()>0.5){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 3);\n\t\t}else{\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 2);\n\t\t}\n\t}\n\t\n\tif(n===6){\n\t\tvar r = Math.floor(Math.random()*5);\n\t\tif(r===0){\n\t\t\taddtile(2,3, len, x, y, (ff+3)*36);\n\t\t}\n\t\tif(r===1){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 2);\n\t\t\tfillslot(len, x, y, ff+4, 2);\n\t\t}\n\t\tif(r===2){\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 3);\n\t\t}\n\t\tif(r===3){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 4);\n\t\t}\n\t\tif(r===4){\n\t\t\tfillslot(len, x, y, ff, 4);\n\t\t\tfillslot(len, x, y, ff+4, 2);\n\t\t}\n\t}\n\n\t// 7: 2 + 2 + 3 | 2 + 3 + 2 | 3 + 2 + 2 | 4 + 3 | 3 + 4\n\tif(n===7){\n\t\tvar r = Math.floor(Math.random()*5);\n\t\tif(r===0){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 2);\n\t\t\tfillslot(len, x, y, ff+4, 3);\n\t\t}\n\t\tif(r===1){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 3);\n\t\t\tfillslot(len, x, y, ff+5, 2);\n\t\t}\n\t\tif(r===2){\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 2);\n\t\t\tfillslot(len, x, y, ff+5, 2);\n\t\t}\n\t\tif(r===3){\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 4);\n\t\t}\n\t\tif(r===4){\n\t\t\tfillslot(len, x, y, ff, 4);\n\t\t\tfillslot(len, x, y, ff+4, 3);\n\t\t}\n\t}\n\n\t// 8: 2 + 2 + 2 + 2 | 2 + 2 + 4 | 2 + 4 + 2 | 4 + 2 + 2 | 3 + 3 + 2 | 3 + 2 + 3 | 2 + 3 + 3 | 2 + 6 | 6 + 2 | 4 + 4\n\tif(n===8){\n\t\tvar r = Math.floor(Math.random()*10);\n\t\tif(r===0){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 2);\n\t\t\tfillslot(len, x, y, ff+4, 2);\n\t\t\tfillslot(len, x, y, ff+6, 2);\n\t\t}\n\t\tif(r===1){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 2);\n\t\t\tfillslot(len, x, y, ff+4, 4);\n\t\t}\n\t\tif(r===2){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 4);\n\t\t\tfillslot(len, x, y, ff+6, 2);\n\t\t}\n\t\tif(r===3){\n\t\t\tfillslot(len, x, y, ff, 4);\n\t\t\tfillslot(len, x, y, ff+4, 2);\n\t\t\tfillslot(len, x, y, ff+6, 2);\n\t\t}\n\t\tif(r===4){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 3);\n\t\t\tfillslot(len, x, y, ff+5, 3);\n\t\t}\n\t\tif(r===5){\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 2);\n\t\t\tfillslot(len, x, y, ff+5, 3);\n\t\t}\n\t\tif(r===6){\n\t\t\tfillslot(len, x, y, ff, 3);\n\t\t\tfillslot(len, x, y, ff+3, 3);\n\t\t\tfillslot(len, x, y, ff+6, 2);\n\t\t}\n\t\tif(r===7){\n\t\t\tfillslot(len, x, y, ff, 4);\n\t\t\tfillslot(len, x, y, ff+4, 4);\n\t\t}\n\t\tif(r===8){\n\t\t\tfillslot(len, x, y, ff, 2);\n\t\t\tfillslot(len, x, y, ff+2, 6);\n\t\t}\n\t\tif(r===9){\n\t\t\tfillslot(len, x, y, ff, 6);\n\t\t\tfillslot(len, x, y, ff+6, 2);\n\t\t}\n\t}\n\n}// End of fillslot()",
"title": ""
},
{
"docid": "7195c95c401a36c17f08184a032ac061",
"score": "0.6098819",
"text": "function generate() {\n randomNumber = Math.floor(Math.random() * squares.length)\n if (squares[randomNumber].innerHTML == 0) {\n squares[randomNumber].innerHTML = 2\n checkForGameOver()\n } else generate()\n }",
"title": ""
},
{
"docid": "edab6f5d40c4a30804f77f8a40d0ca1d",
"score": "0.60904074",
"text": "function randomtile(param){\n\t$(\"div.endgame\").text(\"YOU CAN PLAY !\");\n\tvar y,x;\n\tvar boule=false;\n\tfor(y=0;y<param;y++){\n\t\tvar empty=false;\n\n\t\tfor(x=0;x<16;x++)\n\t\t{\n\t\t\tif(!$(\"div.square-container\").eq(x).text())\n\t\t\t\tboule=true;\n\t\t}\n\n\t\tif(boule)\n\t\t{\n\t\t\twhile(!empty)\n\t\t\t{\n\t\t\t\tvar rando = Math.floor(Math.random()*16);\n\t\t\t\tif(!$(\"div.square-container\").eq(rando).text())\n\t\t\t\t{\n\t\t\t\t\tempty=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rand = Math.floor(Math.random()*4);\n\t\t\tif(rand<2)\n\t\t\t\trand=2;\n\t\t\telse\n\t\t\t\trand=4;\n\t\t\t$(\"div.square-container\").eq(rando).text(rand);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"div.endgame\").text(\"YOU LOOSE!\");\n\t\t}\n\t\tsetcolors();\n\n\t}\n}",
"title": ""
},
{
"docid": "cd1152a3558bcb0213b34022fb5b9cd6",
"score": "0.6079659",
"text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random()*100)+1;\n}",
"title": ""
},
{
"docid": "1178c42f540ea36aebbd3ef141eac539",
"score": "0.6073313",
"text": "function lottoGenerator() {\n const arr = []\n function rando(lot) {\n const ran = Math.floor(Math.random() * (60 - 1 + 1)) + 1\n return lot.includes(ran) ? rando(lot) : ran\n }\n for (let i = 0; i < 6; i++) {\n const ran = rando(arr)\n arr.push(ran)\n }\n return arr\n}",
"title": ""
},
{
"docid": "5084dcb0535117b99800043d0e0da64d",
"score": "0.6054797",
"text": "function spawnBlock() {\r\n for(let row = 0; row < thisBlock.matrix.length; row++) {\r\n for(let col = 0; col < thisBlock.matrix[row].length; col++) {\r\n if(thisBlock.matrix[row][col]) {\r\n // If block goes off screen\r\n if(thisBlock.row + row < 0) {\r\n return userGameOver();\r\n }\r\n thisField[thisBlock.row + row][thisBlock.col + col] = thisBlock.id;\r\n }\r\n }\r\n }\r\n\r\n // Line clearing\r\n let linesCleared = 0;\r\n for(let row = thisField.length - 1; row >= 0;) {\r\n if(thisField[row].every((cell) => !!cell)) {\r\n // Drop every row above\r\n linesCleared++;\r\n for(let r = row; r >= 0; r--) {\r\n thisField[r] = thisField[r - 1]\r\n }\r\n } else {\r\n row--;\r\n }\r\n }\r\n // If cleared lines then run numbers\r\n clearLines(linesCleared);\r\n // Next block spawn\r\n thisBlock = fetchNextBlock();\r\n}",
"title": ""
},
{
"docid": "96ad59d6575807dbfff19e5ff9ae74cc",
"score": "0.6051474",
"text": "function generateWinningNumber(){\n\t\treturn Math.floor(Math.random()*100+1);\n\t}",
"title": ""
},
{
"docid": "fc1940d2fce5f383e232212dce43f3f2",
"score": "0.604204",
"text": "function createRndmSudoku(board) {\n function fillLine(line, nums) {\n nums ? nums = shuffleArr(nums) : nums = shuffleArr([1, 2, 3, 4, 5, 6, 7, 8, 9]);\n for (var i = 0; i < line.length; i++) {\n line[i].val = nums[i];\n };\n } //end fillLine\n\n var time = new Date().getTime() / 1000; //to see how long it takes to generate the board :)\n var test;\n var safetyCount = 0;\n\n //first 2 of each box are random, third a bit more calculated\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 100; j++) {\n //if it's the 3rd line of the boxes - there are alot less options (3 possible numebr for each box)\n if (i == 2 || i == 5) {\n fillLine([board.xLines[i][0], board.xLines[i][1], board.xLines[i][2]], possibleNums(board.boxes[board.xLines[i][0].boxId]));\n fillLine([board.xLines[i][3], board.xLines[i][4], board.xLines[i][5]], possibleNums(board.boxes[board.xLines[i][3].boxId]));\n fillLine([board.xLines[i][6], board.xLines[i][7], board.xLines[i][8]], possibleNums(board.boxes[board.xLines[i][6].boxId]));\n } else if (i > 5) { //once we have filled most of the board we can take the y-axis into account and eliminate many numbers\n for (var v = 0; v < board.xLines[i].length; v++) {\n board.xLines[i][v].pruneNums(board, board.xLines[i][v].origPos);\n if (board.xLines[i][v].availableNums.length == 0) {\n board.xLines[i].forEach(function(ech) {\n ech.val = ' '\n });\n i--;\n break\n }\n fillLine([board.xLines[i][v]], board.xLines[i][v].availableNums);\n };\n } else { //just brute force it//\n fillLine(board.xLines[i]);\n }\n //check the board\n if (!checkBoard(board)) { // if the line is solved then break the inner for loop\n board.print();\n console.log(i + 1 + ' out of 9');\n break\n };\n if (j == 99 && checkBoard(board)) { //if it fails try the line again\n i--;\n //break; (loop ends anyways so we don't need to break)\n };\n };\n safetyCount++; //some combos are impossible and we will restart the whole thing\n if (safetyCount > 100) {\n console.log('mission failed :(');\n document.getElementsByTagName('h1')[0].innerText = 'Error, please try again';\n document.getElementsByTagName('h1')[0].style.color = 'red';\n break;\n };\n };\n\n //final line is forced by previous numbers- faster than randomely blasting it\n for (var i = 0; i < 9; i++) {\n for (var j = 1; j < 10; j++) {\n test = board.yLines[i].every(function(e) {\n return (e.val != j)\n });\n if (test) {\n board.yLines[i][8].val = String(j)\n };\n };\n };\n\n board.print();\n console.log((new Date().getTime() / 1000 - time) + ' seconds');\n startNew.style.color = 'black';\n return !checkBoard(board);\n }",
"title": ""
},
{
"docid": "c43932d8ab1434a1d42c81f6d722bc31",
"score": "0.6035562",
"text": "function generateNumber () {\n answer = Math.floor(Math.random()*(10));\n numberInGrid = puzzles[answer];\n }",
"title": ""
},
{
"docid": "44cfb2869d95ef9c157122dedfd061c5",
"score": "0.60321975",
"text": "function getNumBlocks() {\n\tvar tempSize, badSize = true;\n\t//test for proper grid size and deny if outside specified range\n\tdo {\n\t\ttempSize = +prompt(\"Please specifiy a grid size between 16-64\", 16);\n\t\tif (tempSize >= 16 && tempSize <= 64) {\n\t\t\tbadSize = false;\n\t\t} else {\n\t\t\talert(\"Your choice of \" + tempSize + \" is outside the specified range. Please try again.\");\n\t\t}\n\t} while (badSize)\n\treturn tempSize;\n}",
"title": ""
},
{
"docid": "7ec353fdbe28f866216977abf9544ec5",
"score": "0.60318166",
"text": "function random_validor(arr){\n\tvar result = 0;\n\tfor(var i=0;i<16;i++){\n\t\tfor(var j=i+1;j<16;j++)\n\t\t\tif(arr[i]>arr[j]) result++;\n\t}\n\tfor(var i=0;i<16;i++){\n\t\tif(arr[i]===15){\n\t\t\tvar col = i%4, row = Math.ceil(i/4);\n\t\t\tresult += row + col;\n\t\t}\n\t}\n\treturn result%2===1;\n}",
"title": ""
},
{
"docid": "7c314d7a47d795474fa39373afb02590",
"score": "0.6013843",
"text": "randomize() {\n // !!!! IMPLEMENT ME !!!!\n for (let h = 0; h < this.height; h++) {\n for (let w = 0; w < this.width; w++) {\n // if (this.cells[this.activeBuffer][h][w] === undefined)\n // console.log(h, w, this.cells[this.activeBuffer][h][w]);\n this.cells[this.activeBuffer][h][w] =\n Math.random() * 100 <= probability;\n }\n }\n }",
"title": ""
},
{
"docid": "2a591e7deb9fcb3a5a1172af2d023ae6",
"score": "0.6010532",
"text": "function genWhole() {\n var val;\n var found\n do {\n val = Math.floor((Math.random() * maxNumber) + baseNumber).toString();\n found = temp.some(function (el) {\n return el.value === val;\n });\n } while(found);\n return val;\n }",
"title": ""
},
{
"docid": "4cd317f29988958503350717c9982fc0",
"score": "0.6010334",
"text": "function randomize (){\n\t\thole = Math.floor(Math.random()* 9)+1;\n\t}",
"title": ""
},
{
"docid": "2416e0783f8e98f9a76ff5b559616c61",
"score": "0.6008715",
"text": "checkWinningPattern() {\n for (let pattern of winningPattern) {\n let sameElement = false;\n let initialElement = boxCollection[pattern[0]].boxObject.innerHTML;\n for (let i = 1; i < this.totalRow; i++) {\n let nextElement = boxCollection[pattern[i]].boxObject.innerHTML;\n if (initialElement == nextElement && initialElement != \"\") {\n sameElement = true;\n initialElement = nextElement\n } else {\n sameElement = false;\n break;\n }\n }\n if (sameElement) {\n this.win = true;\n break;\n }\n }\n }",
"title": ""
},
{
"docid": "f17bb6cb641e82a3807130423a708530",
"score": "0.6008501",
"text": "function checkForWin() {\n\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n var totalMarked = 0\n for (let i = 0; i < size * size; i++) {\n if (board.cells[i].isMine && board.cells[i].isMarked) {\n //console.log(\"1 marked mine\")\n totalMarked++\n }\n }\n if (totalMarked == randomNumberMines) {\n\n return lib.displayMessage('You win!')\n }\n}",
"title": ""
},
{
"docid": "58f05c254d3a0cba831826c601ed946e",
"score": "0.60030913",
"text": "function boardGenerator() {\n for (var i = 0; i < boardSize; i++) {\n for (var j = 0; j < boardSize; j++) {\n board.cells.push({\n row: i,\n col: j,\n isMine: randomMines(),\n hidden: true,\n });\n }\n }\n}",
"title": ""
},
{
"docid": "55e4318a844a3ab2497d10f838ce4e0d",
"score": "0.5998511",
"text": "function generate(){\n var num1 = Math.round(Math.random()*10);\n var num2 = Math.round(Math.random()*10);\n correctanswer = num1 * num2; \n document.getElementById(\"question\").innerHTML=num1+\"x\"+num2;\n var correctposition = Math.round(Math.random()*3+1);\n document.getElementById(\"box\" + correctposition ).innerHTML = correctanswer;\n \n \n var answers = [correctanswer]\n \n for(var i = 1; i<5 ; i++ ){\n \n if(i!= correctposition) {\n var wronganswer;\n \n do{\n \n wronganswer= (1+Math.round(9*Math.random()))*(1+Math.round(9*Math.random())); //wrong answer\n \n }\n while(answers.indexOf(wronganswer)> -1)\n document.getElementById(\"box\" + i ).innerHTML = wronganswer;\n \n answers.push(wronganswer);\n \n \n } \n \n \n }\n \n \n \n \n \n \n \n\n \n \n \n \n \n\n}",
"title": ""
},
{
"docid": "46d3af75665e76cf5a24218884b5d5b5",
"score": "0.5994373",
"text": "function patternV() {\n\tvar t = 1;\n\tvar n = randomSP;\n\tvar spawnTotal = 2;\n\tspawn(spawnObjects[randomObj], spawnPoints[randomSP]);\n\tyield WaitForSeconds(0.5);\n\t\n\tfor (var i = 0; i < spawnTotal; i++) {\n\t\tvar left = n - t;\n\t\tvar right = n + t;\n\t\tif (left < 0) { left += 23; }\n\t\tif (right > 23) { right -= 23; }\n\t\tspawn(spawnObjects[randomObj], spawnPoints[left]);\n\t\tspawn(spawnObjects[randomObj], spawnPoints[right]);\n\t\tyield WaitForSeconds(0.5);\n\t\tt++;\n\t}\n}",
"title": ""
},
{
"docid": "17ab2e4807c0b1b690d1605d7d08114f",
"score": "0.59905106",
"text": "function botNumbersGeneretor(){\n\n for (var i = 0; i < 16; i++) {\n \n var botRndnumbers = Math.round(Math.random() * 100 )+1;\n \n if ( botNumbers.includes(botRndnumbers) ) {\n\n i--;\n \n } else {\n\n botNumbers.push(botRndnumbers);\n\n }\n }\n}",
"title": ""
},
{
"docid": "c23686a89a879faa1762c2313bb90189",
"score": "0.59770906",
"text": "function generateBoard(size){\n\n var tmp = [];\n\n // determined locations where HandiCap tokens should be put\n var hcToken = Math.round((state.size)/3);\n var hcTokenSecond;\n if(state.size == 9) {\n hcToken--;\n hcTokenSecond = 3*hcToken;\n }\n else\n hcTokenSecond = 2*hcToken;\n\n\n console.log(hcToken);\n var hc = state.handiCap;\n var set = false;\n\n for(var i = 0; i < state.size; i++){\n tmp = [];\n if(i == hcToken || i == hcTokenSecond)\n set = true;\n else\n set = false;\n for(var j = 0; j < state.size; j++){\n if(hc == true && set == true && (j == hcToken || j == hcTokenSecond))\n tmp.push(1);\n else\n tmp.push(0);\n }\n state.board.push(tmp);\n }\n\n //prevent duplicate boards\n state.refresh = true;\n sendBoard();\n\n return state;\n}",
"title": ""
},
{
"docid": "4436ec3e80e40f42a1e91c3108a401f5",
"score": "0.5973779",
"text": "function isPossibleBlock(number,block,sudoku) {\n\tfor (var i=0; i<=8; i++) {\n\t\tif (sudoku[Math.floor(block/3)*27+i%3+9*Math.floor(i/3)+3*(block%3)] == number) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}",
"title": ""
},
{
"docid": "cdc4dc8882f39eca1589462b12b394a9",
"score": "0.5969376",
"text": "generateWinState() {\n const size = this.state.dimensions.rows * this.state.dimensions.cols;\n let winSquares = [];\n\n for (let i = 0; i < size; i++) {\n winSquares.push((Math.random() < 0.5) ? SquareValue.EMPTY : SquareValue.FILLED);\n }\n \n this.setState({\n goalHints: this.getHintNumbers(winSquares),\n });\n }",
"title": ""
},
{
"docid": "bb4c48c2465f7ff9934796fce2bb98cb",
"score": "0.5963107",
"text": "function generateNumbers(){\n\tnumber1 = Math.ceil(Math.random()*maxNum);\n\tnumber2 = Math.ceil(Math.random()*maxNum);\n}",
"title": ""
},
{
"docid": "dde00b4d6aa132112313a235f11e47ab",
"score": "0.5962232",
"text": "function createBlocks(){\n\tfor(let j=1; j < 17; j++){\n\t\tif(j%2==0){\n\t\t\tfor(let i=1; i < 25; i++){\n\t\t\t\tif(i%2==0){\n\t\t\t\t\tblockArray.push(new Block((i-1)*50,(j-1)*50,50,50));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "b83e24f37a1156c869bf4a18a2944ec7",
"score": "0.59587693",
"text": "function checkWin() {\n\n var good = 0;\n for(var i=1; i <= 15; i++) {\n if( $('.block-'+i).hasClass( getXY(i) ) ) good++;\n }\n if(good == 15) alert('Поздравляем! Вы победили!');\n}",
"title": ""
},
{
"docid": "67e111e15c9a1696565f7682075624dd",
"score": "0.5955126",
"text": "function genNmb(){\n\tscrtNmb = Math.floor(Math.random()*100)+1;//create a secret number by randomizing each time the game starts or restarts\n}",
"title": ""
},
{
"docid": "fc20650b64f5e0eb8654a1091bcd6bed",
"score": "0.5954393",
"text": "function generateBricks (i, j) {\n\t\tif(i > 0 && i < 18 && j > 0 && j < 14 && Crafty.randRange(0, 50) > 40 && !(i == 1 && j == 1) && !(i == 1 && j == 2)\n\t\t\t&& !(i == 1 && j == 3) && !(i == 1 && j == 4) && !(i == 2 && j == 1) && !(i == 3 && j == 2) && !(i == 4 && j == 1)\n\t\t && !(i == 17 && j == 13) && !(i == 16 && j == 13) && !(i == 15 && j == 13) && !(i == 17 && j == 12) && !(i == 17 && j == 11)){\n\t\t\t//fill Array, return true\n\t\t\tif(Crafty.randRange(0, 50) > 45){\n\t\t\t\tbrick_array[i][j] = 4;\n\t\t\t}else {\n\t\t\t\tbrick_array[i][j] = 2;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t};\n\t}",
"title": ""
},
{
"docid": "79df40591c09daa5b1706d17237b6d0b",
"score": "0.5949517",
"text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random() * (100 - 1) + 1);\n}",
"title": ""
},
{
"docid": "7425e950e065d70a64382e68206a4734",
"score": "0.5948843",
"text": "plantMines(data, height, width, totalMines) {\n let randomx,\n randomy,\n minesPlanted = 0;\n while (minesPlanted < totalMines) {\n randomx = Math.floor(Math.random() * width);\n randomy = Math.floor(Math.random() * height);\n if (!data[randomy][randomx].isMine) {\n data[randomy][randomx].isMine = true;\n minesPlanted++;\n }\n }\n return data;\n }",
"title": ""
},
{
"docid": "0d22edf5b84c23b6d929cf80e1e28792",
"score": "0.59378904",
"text": "function generateWinningNumber(){\n return 1 + Math.floor(100*Math.random());\n}",
"title": ""
},
{
"docid": "baecc98839cbbdf9b68970f66c191516",
"score": "0.5932747",
"text": "function randomizeGrid(){\n\n\tGridGen = Math.floor((Math.random() * 100) + 1);\nconsole.log(\"board \" + GridGen);\n\t//Possible grid arrangements\n\tif (GridGen < 25){\n gameBoard = [\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n \t\t\t\t[0,0,0,0,1,1,1,1,0,0,0],\n \t\t\t\t[0,0,0,0,1,1,1,1,1,0,0],\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n \t\t\t\t[0,0,0,0,0,0,0,0,1,1,1],\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n \t\t\t\t[0,0,0,0,1,1,1,1,1,0,0],\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n \t\t\t\t[0,0,0,0,0,0,0,0,0,0,0]\n \t\t\t]\n \t\t}\n\t\telse if (GridGen > 25 && GridGen < 49){\n\t\t gameBoard = [\n\t\t\t\t\t [0,0,0,1,1,1,1,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,1,1,1,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,1,1,1,1],\n\t\t\t\t\t [0,0,0,0,0,0,0,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,1,1,0,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0]\n\t\t\t\t ]\n\t\t\t }\n\t\t\t else if (GridGen > 49 && GridGen < 75){\n\t\t\t\tgameBoard = [\n\t\t\t\t\t\t [0,1,1,1,1,0,0,0,0,0,0],\n\t\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t\t [0,0,0,0,0,0,1,0,0,0,0],\n\t\t\t\t\t\t [0,0,0,0,0,0,1,0,0,0,0],\n\t\t\t\t\t\t [0,1,0,0,0,0,1,1,0,0,0],\n\t\t\t\t\t\t [0,1,0,0,0,0,0,1,0,0,0],\n\t\t\t\t\t\t [0,1,0,0,0,0,0,1,0,0,0],\n\t\t\t\t\t\t [0,1,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t\t [0,1,0,1,1,0,0,0,0,0,0]\n\t\t\t\t\t ]\n\t\t\t\t }\n else if (GridGen > 75 && GridGen != 100){\n gameBoard = [\n\t\t\t\t[0,0,0,0,1,1,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,1,1,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,1,1,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,1,1,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,1,1,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,1,1,1,1,1,1,1],\n\t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0,0,0]\n\t\t\t]\n\t\t}\n\t\telse {\n\t\t gameBoard = [\n\t\t\t\t\t [0,0,0,0,1,1,1,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,1,0,0,0],\n\t\t\t\t\t [0,0,0,0,0,0,0,1,0,0,0],\n\t\t\t\t\t [0,1,0,0,0,0,0,1,1,1,1],\n\t\t\t\t\t [0,1,0,0,0,0,0,0,0,0,0],\n\t\t\t\t\t [0,1,0,0,0,1,0,0,0,0,0],\n\t\t\t\t\t [0,1,0,0,0,1,0,0,0,0,0],\n\t\t\t\t\t [0,1,0,0,0,0,0,0,0,0,0]\n\t\t\t\t ]\n\t\t\t }\n\t\t }",
"title": ""
},
{
"docid": "797fa07b47c6796b39d3da325d460a31",
"score": "0.59317786",
"text": "function decideToGenerate() {\n if (numberOfGuesses === 1) {\n generateNumber();\n }\n}",
"title": ""
},
{
"docid": "38a925786e0a4f0749f6be07b95c0335",
"score": "0.59296674",
"text": "function countBlocks() {\r\n\tlet question = document.createElement('h1')\r\n\tquestion.textContent = \"Count the blocks?\"\r\n\tquestionSection.appendChild(question);\r\n\r\n\tlet randomNumber = 0;\r\n}",
"title": ""
},
{
"docid": "a1e4448258977cb040988ffbe4393b75",
"score": "0.5928081",
"text": "function generateAscNum() {\n var maxNumber, baseNumber, fracChance;\n var temp = [];\n var gameInfo = {\n type: \"ascendingNumber\",\n answer: [],\n data: []\n };\n\n /* sets generation values based on the difficulty level */\n switch(difficulty){\n case 1:\n maxNumber = 10;\n baseNumber = 1;\n fracChance = 0;\n break;\n case 2:\n maxNumber = 100;\n baseNumber = 1;\n fracChance = 0.25;\n break;\n case 3:\n maxNumber = 50;\n baseNumber = -50;\n fracChance = 0.25;\n break;\n case 4:\n maxNumber = 100;\n baseNumber = -100;\n fracChance = 0.25;\n break;\n }\n\n for(var i = 0; i < 4; i++) {\n var num = {\n pos: 0,\n value: 0\n };\n num.value = Math.random() < fracChance ? genFraction() : genWhole();\n num.pos = i + 1;\n temp[i] = num;\n }\n\n gameInfo.data = temp.slice();\n temp.sort(compareNumbers);\n\n for(var i = 0; i < 4; i++) {\n gameInfo.answer[i] = temp[i].pos;\n }\n\n return gameInfo;\n\n /* function to generate a fraction */\n function genFraction() {\n var a = Math.floor((Math.random() * maxNumber) + baseNumber);\n var b = Math.floor((Math.random() * maxNumber) + baseNumber);\n return (a + \"/\" + b);\n }\n\n /* function to generate a whole number */\n function genWhole() {\n var val;\n var found\n do {\n val = Math.floor((Math.random() * maxNumber) + baseNumber).toString();\n found = temp.some(function (el) {\n return el.value === val;\n });\n } while(found);\n return val;\n }\n\n /* comparision function used to sort the array of numbers */\n function compareNumbers(a,b) {\n return eval(a.value) - eval(b.value);\n }\n}",
"title": ""
},
{
"docid": "aae40523d413931da37aaba434e51a62",
"score": "0.59276587",
"text": "function test26() {\n for (let i = 0; i < 100; i++) {\n reset();\n let num = Math.floor(Math.random() * 20);\n for (let j = 0; j < num; j++) {\n let row = Math.floor(Math.random() * 20) + 4\n while (!board[row].includes(\"#ffffff\")) row = Math.floor(Math.random() * 20) + 4\n board[row].fill(\"#420420\")\n }\n check10Row();\n if (board.some(x => !x.includes(\"#ffffff\"))) return false\n }\n return true\n}",
"title": ""
},
{
"docid": "b1c93324bdd822feec3efd8bbcf0f5cd",
"score": "0.59245",
"text": "function drawBlocks() {\n for (let c = 0; c < blockColumnCount; c++) {\n for (let r = 0; r < blockRowCount; r++) {\n if (blocks[c][r].show == 1) {\n let blockX = (c * (blockWidth + blockPadding)) + blockOffsetLeft\n let blockY = (r * (blockHeight + blockPadding)) + blockOffsetTop\n blocks[c][r].x = blockX\n blocks[c][r].y = blockY\n ctx.beginPath()\n ctx.rect(blockX, blockY, blockWidth, blockHeight)\n let red = Math.floor(Math.random() * (255 - 200) + 200);\n let green = Math.floor(Math.random() * (255 - 200) + 200);\n let blue = Math.floor(Math.random() * (255 - 200) + 200);\n ctx.fillStyle = \"rgb(\" + red + \",\" + green + \",\" + blue + \" )\"\n ctx.fill()\n ctx.closePath()\n }\n }\n }\n}",
"title": ""
},
{
"docid": "6a69130ed217dcf67fdda0be80f16c4d",
"score": "0.5922167",
"text": "function generate_random_pattern() {\n var j;\n while(generated_tile_ids.length < trial.loading_magnitude) {\n j = Math.floor(Math.random() * trial.grid_size);\n // valuex = 'tile_' + j;\n var index = generated_tile_ids.indexOf(j);\n if (index == -1) {\n generated_tile_ids.push(j);\n }\n }\n }",
"title": ""
},
{
"docid": "4fdb50978e722fe1b16528a475c9614f",
"score": "0.59221196",
"text": "function checkWin() {\n return Winning_combinations.some(combination => {\n return combination.every( index => {\n if (move % 2 !== 0) {\n return cells[index].classList.contains('x');\n }\n else {\n return cells[index].classList.contains('o');\n }\n })\n })\n}",
"title": ""
},
{
"docid": "0e398e0ba08257fb3fb6acb94f4cd6b9",
"score": "0.59199756",
"text": "function createBlocks() {\n for (let i = 1; i <= 15; i += 1) {\n const block = document.createElement('div');\n block.classList.add('block', `block-${i}`, getXY(i));\n block.innerHTML = i;\n document.getElementById('game-block').appendChild(block);\n }\n}",
"title": ""
},
{
"docid": "9b0aa5dd8fc7ca7dbacc447ed96830bb",
"score": "0.59172493",
"text": "generateBlocks () {\n\t\tvar segments = {\n\t\t\tb1 : {i:0, j:0},\n\t\t\tb2 : {i:0, j:3},\n\t\t\tb3 : {i:0, j:6},\n\t\t\tb4 : {i:3, j:0},\n\t\t\tb5 : {i:3, j:3},\n\t\t\tb6 : {i:3, j:6},\n\t\t\tb7 : {i:6, j:0},\n\t\t\tb8 : {i:6, j:3},\n\t\t\tb9 : {i:6, j:6}\t\t\n\t\t}\n\t\tfor (var block in segments) {\n\t\t\tvar rowStart = segments[block]['i'];\n\t\t\tvar colStart = segments[block]['j'];\n\t\t\tvar blockArray = [];\n\t\t\tfor (let i=rowStart; i<rowStart+3; i++) {\n\t\t\t\tvar tempArray = [];\n\t\t\t\tfor (let j=colStart; j<colStart+3; j++) {\n\t\t\t\t\ttempArray.push (this.nineByNineObj[i][j]);\n\t\t\t\t}\n\t\t\t\tfor (var el in tempArray) {\n\t\t\t\t\tblockArray.push (tempArray[el]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.blocks[block] = blockArray;\n\t\t}\n\t}",
"title": ""
},
{
"docid": "4f68c93f63f4422507e6b095d0e71a06",
"score": "0.5914391",
"text": "function generate_rndm_nums()\n{\n\trndmslot = Math.floor(Math.random()*101) % 5;\n\trndmnum = Math.floor(Math.random()*11);\n}",
"title": ""
},
{
"docid": "ff6fe08237270adecc39fb73987ab3cb",
"score": "0.59141797",
"text": "buildGameBoard() {\n // creating 2d array to act as game board\n this.board = [];\n for(var i = 0; i < this.num_rows; i++) {\n this.board[i] = [];\n for(var j = 0; j < this.num_cols; j++) {\n this.board[i][j] = \"*\";\n }\n }\n\n // populating game board\n var mine_placed;\n for(var i = 0; i < this.mine_count; i++) {\n mine_placed = false;\n do {\n var row = Math.floor(Math.random() * this.num_rows);\n var col = Math.floor(Math.random() * this.num_cols);\n if(this.board[row][col] == \"*\"){\n mine_placed = true;\n this.board[row][col] = \"M\";\n }\n } while (!mine_placed);\n }\n\n // generating adjacency counts\n var cur_mines;\n for (var i = 0; i < this.num_rows; i++) {\n for (var j = 0; j < this.num_cols; j++) {\n // if cell is a mine, don't need to generate count for it (duh)\n if (this.board[i][j] != \"M\") {\n cur_mines = 0;\n // go through all adjacent cells.\n for (var k = i-1; k <= i+1; k++) {\n for (var l = j-1; l <= j+1; l++) {\n // check is adjecent cell is within bounds\n if (k >= 0 && l >= 0 && k < this.num_rows && l < this.num_cols) {\n if (this.board[k][l] == \"M\") {\n cur_mines++;\n }\n }\n }\n }\n\n this.board[i][j] = cur_mines;\n }\n }\n }\n }",
"title": ""
},
{
"docid": "1c289852970d44220b03ee700d9fbc19",
"score": "0.5911572",
"text": "function randomizeMines(gridWidth, gridHeight, numMines) {\n for (let i = 0; i < numMines; i++) {\n while (true) {\n let randRow = Math.floor(Math.random() * gridHeight);\n let randCol = Math.floor((Math.random() * gridWidth));\n\n // set mine if not already set\n if (!grid[randRow][randCol].isMine){\n grid[randRow][randCol].isMine = true;\n break;\n }\n } // if already a mine, try again\n }\n}",
"title": ""
},
{
"docid": "4e4e3eec53691666df74147aea73aa7b",
"score": "0.5906174",
"text": "function numbersGenerator() {\n genNum1 = rNJesus();\n genNum2 = rNJesus();\n genNum3 = rNJesus();\n genNum4 = rNJesus();\n while (genNum1 === genNum2) {\n genNum2 = rNJesus();\n }\n while (genNum1 === genNum3 || genNum2 === genNum3) {\n genNum3 = rNJesus();\n }\n while (genNum1 === genNum4 || genNum2 === genNum4 || genNum3 === genNum4) {\n genNum4 = rNJesus();\n }\n console.log('right before reset', flashcardsArray);\n}",
"title": ""
},
{
"docid": "b8b0f819de7948d4bdb7d3f96e84f881",
"score": "0.59037286",
"text": "function createNewBlock() {\n\n // Create a new block object, and assign it to currentBlock.\n currentBlock = new Block(SHAPES_PATTERN[Math.floor(Math.random() * SHAPES_PATTERN.length)]);\n\n var i = 0;\n\n // Check dataBoard cells whether the positions of the new block are already occupied.\n while(i < currentBlock.currentRects.length){\n if(dataBoard[currentBlock.currentRects[i].y][currentBlock.currentRects[i].x] !== null) {\n // if yes terminate game.\n return gameOver();\n }\n i ++;\n }\n\n // if all cells are available, continue game. Map currentBlock into dataBoard cells.\n currentBlock.set();\n\n // Render dataBoard data as SVG DOM.\n stage.render();\n}",
"title": ""
},
{
"docid": "374c16a00ddd474604972fc60c0de7fc",
"score": "0.59001863",
"text": "_shouldMakeMine() {\n return Math.random() < this.mineiness;\n }",
"title": ""
},
{
"docid": "696bf5a75ea728158873e942b85099b2",
"score": "0.58993655",
"text": "function generateWinningNumber() {\n\treturn Math.floor(Math.random() * 100 + 1);\n}",
"title": ""
},
{
"docid": "ed4053f737da880fc28ed0f392de9f51",
"score": "0.5898693",
"text": "function patternSquare() {\n\tvar botLeft : int;\n\tvar botRight : int;\n\tvar topLeft : int;\n\tvar topRight : int;\n\t\n\tif (randomSP <= 5) {\n\t\tbotLeft = 0;\n\t\tbotRight = 5;\n\t\ttopLeft = 13;\n\t\ttopRight = 16;\n\t} else if (randomSP <= 11) {\n\t\tbotLeft = 6;\n\t\tbotRight = 11;\n\t\ttopLeft = 19;\n\t\ttopRight = 22;\n\t} else if (randomSP <= 17) {\n\t\tbotLeft = 12;\n\t\tbotRight = 17;\n\t\ttopLeft = 1;\n\t\ttopRight = 4;\n\t} else {\n\t\tbotLeft = 18;\n\t\tbotRight = 23;\n\t\ttopLeft = 7;\n\t\ttopRight = 10;\n\t}\n\t\n\tspawn(spawnObjects[randomObj], spawnPoints[botLeft]);\n\tspawn(spawnObjects[randomObj], spawnPoints[botRight]);\n\tspawn(spawnObjects[randomObj], spawnPoints[topLeft]);\n\tspawn(spawnObjects[randomObj], spawnPoints[topRight]);\n}",
"title": ""
},
{
"docid": "3aa705445f3d471085aa44a846437a62",
"score": "0.5896596",
"text": "async generateTestBlocks(n) {\n for (let i = 0; i <= n; i++) {\n await this.addBlock(new Block(\"test data \"+i));\n }\n }",
"title": ""
},
{
"docid": "aa8ba253d0ce93bc53dba6bc47d88fee",
"score": "0.5884394",
"text": "function generate() {\n\tfor (var i = 0; i < rows * columns; i++) {\n\t\t// Loop through every spot in our 2D array and check spots neighbors\n\t\tx = floor(random(columns));\n\t\ty = floor(random(rows));\n\t\t// pick a random orthogonal neighbor and set state to match\n\t\tvar n = floor(random(4));\n\t\tif (n == 0) board[x][y] = board[x][bounded(y-1, 0, rows-1)];\n\t\telse if (n == 1) board[x][y] = board[x][bounded(y+1, 0, rows-1)];\n\t\telse if (n == 2) board[x][y] = board[bounded(x-1, 0, columns-1)][y];\n\t\telse board[x][y] = board[bounded(x+1, 0, columns-1)][y];\n\n\t\tif ((board[x][y] == 1)) fill(0);\n\t\telse fill(255);\n\t\trect(x*w, y*w, w-1, w-1);\n\t}\n}",
"title": ""
},
{
"docid": "ba53566b889dfbdf499189647d2d515f",
"score": "0.5881848",
"text": "function hBlockCheck(){\n const tRowTest = game1.toprow.filter(element => element === \"X\");\n const mRowTest = game1.midrow.filter(element => element === \"X\");\n const bRowTest = game1.botrow.filter(element => element === \"X\");\n if (tRowTest.length === 2 && !game1.toprow.includes(\"O\")){\n const place = game1.toprow.findIndex(empty => empty != \"X\");\n switch (place){\n case 0:\n maybePlace(\"NW\");\n break;\n case 1:\n maybePlace(\"NC\");\n break;\n case -1:\n maybePlace(\"NE\");\n break;\n default:\n console.log(\"Something broke!\");\n break;\n }\n } else if (mRowTest.length === 2 && !game1.midrow.includes(\"O\")){\n const place = game1.midrow.findIndex(empty => empty != \"X\");\n switch (place){\n case 0:\n maybePlace(\"CW\");\n break;\n case 1:\n maybePlace(\"CC\");\n break;\n case -1:\n maybePlace(\"CE\");\n break;\n default:\n console.log(\"Something broke!\");\n break;\n }\n } else if (bRowTest.length === 2 && !game1.botrow.includes(\"O\")) {\n const place = game1.botrow.findIndex(empty => empty != \"X\");\n switch (place){\n case 0:\n maybePlace(\"SW\");\n break;\n case 1:\n maybePlace(\"SC\");\n break;\n case -1:\n maybePlace(\"SE\");\n break;\n default:\n console.log(\"Something broke!\");\n break;\n }\n } else {\n vBlockCheck();\n }\n}",
"title": ""
},
{
"docid": "926a066f9a6c495fc398f8f44f5ce9a5",
"score": "0.5879376",
"text": "function genMine(field, places, i) {\r\n let gen = getRandomInt(0, places.length-1)\r\n let x = places[gen][0]\r\n let y = places[gen][1]\r\n \r\n // Checks if the spot already has a mine\r\n if (field[y][x] == 12) {\r\n genMine(field, places, i);\r\n } else {\r\n // Places a mine\r\n field[y][x] = 12;\r\n places.splice(gen, 1);\r\n cycle(field, x, y, 1);\r\n }\r\n}",
"title": ""
},
{
"docid": "a4af5e5907759bc2d2c144225015f300",
"score": "0.58758104",
"text": "function randomGenerator(array, numToReturn, level){\n var bank = array;\n // return random numbers for requested amount\n var count = 0;\n var results = [];\n\n // adds random events to results array for specified amnt\n while (count < numToReturn) {\n var max;\n var min;\n var rando;\n // if second number, set max and min to within set amt\n if (count === 1){\n // ------change this function to include a min --------\n // set max equal to last chosen number + level increase allowed\n max = (bank.length -1);\n // set min equal to last chosen number - level increase allowed\n min = 0;\n // choose random number within given range\n rando = (Math.random() * (max - 0)).toFixed();\n // add first num from bank to results\n results.push(bank[rando]);\n // remove that option from bank\n bank.splice(bank.indexOf(bank[rando]), 1);\n count++;\n\n } else {\n // set max equal to last position of array entered\n max = (bank.length -1);\n min = 0;\n rando = (Math.random() * (max - 0)).toFixed();\n // add first num from bank to results\n results.push(bank[rando]);\n // remove that option from bank\n bank.splice(bank.indexOf(bank[rando]), 1);\n count++;\n }\n return results;\n // returns specified number of random elements from array without duplicates\n }\n\n // store all correct answers\n var correctAnswered = [];\n // store all incorrect answers\n var wrongAnswered = [];\n // get num of available questions and 'IDs' of those questions\n var questArray = Object.keys(questBank);\n\n\n // var zone1 = $('.optA').html();\n var playBtn = $('#play');\n\n // set initial time for timer\n var timeLeft = 15;\n // set timer to initial time\n $('#time').html(timeLeft);\n\n // on click PLAY initiate gameplay ----------------- BEGIN GAME-----------\n playBtn.click(function start(event){\n\n // timer function countdown from input time\n function timer(arg){\n var nIntervId;\n var count = arg;\n\n function changeText() {\n nIntervId = setInterval(updateText, 1000);\n }\n\n function updateText() {\n if (count > -1) {\n $('#time').html(count);\n count--;\n } else {\n stopTimer();\n outOfTime();\n }\n }\n\n function stopTimer() {\n clearInterval(nIntervId);\n }\n // changeText();\n\n return {\n startTimer:changeText,\n stopTimer:stopTimer\n };\n }\n\n // create message for out of time\n var $noTime = $( \"<p class='noTimemsg'>Sorry, out of time.</p>\" );\n $noTime.css({fontSize: '28pt'});\n\n // if timer runs out, run this function\n function outOfTime(){\n lives--;\n updateLives();\n timeLeft -= 5;\n // save the question data for return later\n wrongAnswered.push(questionData[0]);\n wrongAnswered.push(questionData[1]);\n // display failure visuals and message\n $('.optA').css({backgroundColor: \"rgb(176, 73, 67)\"});\n $('.optB').css({backgroundColor: \"rgb(176, 73, 67)\"});\n $('.timeAlert').css({display: 'block'});\n $('.timeAlert').append($noTime);\n prepNext();\n }\n\n // creates timer object which with start and stop elements\n var myTimer = timer(timeLeft);\n // calls functions within timer object\n myTimer.startTimer();\n\n // turn off play button till question is answered\n playBtn.off('click');\n // disable playbtn hover while question is being answered.\n\n\n // activate hover and pointer for answers\n $('.optA').hover(function(){\n $(this).css({opacity: '0.8', cursor: 'pointer'});\n }, function(){\n $(this).css({opacity: '1'});\n });\n $('.optB').hover(function(){\n $(this).css({opacity: '0.8', cursor: 'pointer'});\n }, function(){\n $(this).css({opacity: '1'});\n });\n\n // reset colors of answers and result message\n $('.optA').css({backgroundColor: \"#9FBACE\"});\n // $(this).append($goodAns);\n $('.optB').css({backgroundColor: \"#113856\"});\n // $(this).append($goodAns);\n $('.timeAlert').css({display: 'none'});\n $('.noTimemsg').remove();\n\n\n // set stage if previous game was Lost\n $('.gamePlay').css({display: 'block'});\n $('.postGame').css({display: 'none'});\n\n\n // get correct amount of random questions, questions left per game\n var questionIDs = randomGenerator(questArray, 2);\n // create storage for current question Data\n var questionData = [];\n // get question info from random questions\n for (var j = 0; j < questionIDs.length; j++){\n questionData.push(questBank[questionIDs[j]]);\n }\n\n // fill zones with event data from question data\n $('.optA').html(questionData[0].Event);\n // console.log(questionData[0]);\n $('.optB').html(questionData[1].Event);\n // console.log(questionData[1]);\n\n // create messages to be displayed\n var $goodAns = $( \"<p class='message'>Nice Job!</p>\" );\n $goodAns.css({fontSize: '32pt', marginTop: '1.5em'});\n var $badAns = $( \"<p class='message'>Nope. Not even close.</p>\" );\n $badAns.css({fontSize: '28pt', marginTop: '2.5em'});\n\n // on click of zone check if year is smaller\n $('.optA').click(function(event){\n myTimer.stopTimer();\n if (questionData[0].Date < questionData[1].Date){\n score++;\n updateScore();\n // save the question data for return later\n correctAnswered.push(questionData[0]);\n // delete question from bank for next round\n questArray.splice(questArray.indexOf(questionIDs[0]), 1);\n // display success visuals and message\n $(this).css({backgroundColor: \"rgb(105, 143, 90)\"});\n $(this).append($goodAns);\n prepNext();\n } else {\n lives--;\n updateLives();\n timeLeft -= 5;\n // save the question data for return later\n wrongAnswered.push(questionData[0]);\n // display failure visuals and message\n $(this).css({backgroundColor: \"rgb(176, 73, 67)\"});\n $(this).append($badAns);\n prepNext();\n // reset vars and show start over button - refreshes page.\n }\n\n });\n // on click of zone check if year is smaller\n $('.optB').click(function(event){\n myTimer.stopTimer();\n if (questionData[1].Date < questionData[0].Date){\n score++;\n updateScore();\n // save the question data for return later\n correctAnswered.push(questionData[1]);\n // delete question from bank for next round\n questArray.splice(questArray.indexOf(questionIDs[1]), 1);\n // display success visuals and message\n $(this).css({backgroundColor: \"rgb(105, 143, 90)\"});\n $(this).append($goodAns);\n prepNext();\n } else {\n lives--;\n updateLives();\n timeLeft -= 5;\n // save the question data for return later\n wrongAnswered.push(questionData[1]);\n // display failure visuals and message\n $(this).css({backgroundColor: \"rgb(176, 73, 67)\"});\n $(this).append($badAns);\n prepNext();\n // reset vars and show start over button - refreshes page.\n }\n\n });\n // after question is answered prep next question or lose\n function prepNext (){\n if (lives === 0){\n $('#play').animate({\n borderWidth: '15px'\n }, 100);\n $('#play').animate({\n borderWidth: '2px'\n }, 500);\n var over = function (){\n $('.optA').off('click');\n $('.optB').off('click');\n $('.optA').off('mouseenter mouseleave');\n $('.optB').off('mouseenter mouseleave');\n $('.optA').css({cursor: 'default', opacity: '1'});\n $('.optB').css({cursor: 'default', opacity: '1'});\n $('#play').html('<h2>NEW GAME</h2>');\n $('.noTimemsg').remove();\n $('.gamePlay').css({display: 'none'});\n $('.postGame').css({display: 'block'});\n playBtn.click(function (){\n location.reload();\n });\n };\n window.setTimeout(over, 2000);\n } else {\n $('.optA').off('click');\n $('.optB').off('click');\n $('.optA').off('mouseenter mouseleave');\n $('.optB').off('mouseenter mouseleave');\n $('.optA').css({cursor: 'default', opacity: '1'});\n $('.optB').css({cursor: 'default', opacity: '1'});\n $('#play').html('<h2>NEXT</h2>');\n $('#play').animate({\n borderWidth: '15px'\n }, 100);\n $('#play').animate({\n borderWidth: '2px'\n }, 500);\n playBtn.click(start);\n }\n }\n\n\n });\n }",
"title": ""
},
{
"docid": "2f498ed1ec3b9d1419d5c14c80bd3671",
"score": "0.5875342",
"text": "function isGameOver(){\r\n\tfor (var i = 0; i < size; i++) { \r\n\t\tfor (var j = 0; j < size; j++) { \r\n\t\t\tif(grid[i][j]==0){\r\n\t\t\t\treturn false;//If any block has zero return false\r\n\t\t\t}\r\n\t\t\t//If any consecutive blocks are same return false\r\n\t\t\tif(i!== (size-1) && grid[i][j] == grid[i+1][j]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//If any consecutive blocks are same return false\r\n\t\t\tif(j!== (size-1) && grid[i][j] == grid[i][j+1]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn true;\r\n}",
"title": ""
},
{
"docid": "0d22dce6a066d7a213877aa4626c7bb0",
"score": "0.58724535",
"text": "function generateNum(num1, num2, corner) {\r\n var holderArr = [];\r\n\r\n // return odd number between the range\r\n let randomNum = Math.round(Math.random() * 10 - 1) + 1;\r\n if (corner === undefined) {\r\n if (randomNum <= num2 && randomNum >= num1) {\r\n return randomNum;\r\n } else {\r\n return 5;\r\n }\r\n }\r\n\r\n // return only a number from 0,2,6,8 .. which are the coordinates for corner positions\r\n if (corner === true) {\r\n for (let i = num1; i < num2 + 1; i++) {\r\n if (i === 0 || i === 2 || i === 6 || i == 8) {\r\n holderArr.push(i);\r\n }\r\n }\r\n return returnOdd();\r\n }\r\n // !! for later use, return a single number from the array 0-8\r\n function returnOdd() {\r\n let match;\r\n let rndN = Math.round(Math.random() * 3 - 1) + 1;\r\n return holderArr[rndN];\r\n }\r\n }",
"title": ""
},
{
"docid": "b0dc396438ba33d749ca9d26fb5b4285",
"score": "0.58694154",
"text": "function blockTheWin(toBlock) {\n if (!(screenWin.style.display === 'block')) {\n let randomCell = document.querySelector(`#${toBlock}`);\n if (!(randomCell.classList.contains('clicked'))) {\n randomCell.classList.add('box-filled-2');\n randomCell.classList.add('clicked');\n player2Moves.push(randomCell.id);\n checkForActive(player2, player1);\n checkForWin(player2Moves);\n addRemoveEL(1);\n theCount1++\n theCount2++\n }\n }\n}",
"title": ""
},
{
"docid": "c82f78efe740d8b65035324a175c0ebc",
"score": "0.5860982",
"text": "function generateBoard() {\n var array = [], // 1-d array, with LxC, which will be ported to the main board at the end\n i, max = lines*collumns;\n \n // Put all mines in the beginning\n for (i = 0; i < max; i++) {\n if (i < mines) {\n array[i] = 1;\n }\n else {\n array[i] = 0;\n\t\t}\n }\n \n fisherYates(array); // Randomizes mine position\n \n makeBoard(array); // Passes 1-d array to 2-d board\n}",
"title": ""
},
{
"docid": "43017aa4d66e7853be59db3d8f1fc2eb",
"score": "0.58596134",
"text": "function allocate(max) {\n for (var i in blocks) {\n var number = randomInc(1,max);\n var element = document.querySelector(blocks[i]);\n document.querySelector(blocks[i]).innerHTML = number;\n numpush.push(number);\n }\n}",
"title": ""
},
{
"docid": "80da2d3f8c89c0945c2e5ebf87d0b8ad",
"score": "0.5858022",
"text": "function creatMine() {\n while (mines.length != (quantidade_bombs)) {\n let i = Math.floor(Math.random() * field_size);\n let j = Math.floor(Math.random() * field_size);\n //not repeating same spot\n if (!mines.map(x => JSON.stringify(x)).includes(\"[\" + i + \",\" + j + \"]\")) {\n mines.push([i, j]);\n }\n }\n}",
"title": ""
},
{
"docid": "302028677e28e88d1351d81a625ae0d0",
"score": "0.58577484",
"text": "function patternLine() {\n\tvar n = 0;\n\tvar spawnTotal = randomSP + 5;\n\t\n\tfor (var i = randomSP; i < spawnTotal; i++) {\n\t\tn = i;\n\t\tif (n > 23) { n -= 23; }\n\t\tspawn(spawnObjects[randomObj], spawnPoints[n]);\n\t\tyield WaitForSeconds(0.5);\n\t}\n}",
"title": ""
},
{
"docid": "dc98c693d478d13e9dbee981249448c9",
"score": "0.58564156",
"text": "getWeightedData() {\n const weightedNumber = Math.floor(Math.random(0, 13) * 13);\n let returnedNumber;\n if(weightedNumber >= 9) {\n returnedNumber = Math.floor(Math.random(10, 13) * 10);\n console.log(weightedNumber)\n } else if(weightedNumber >= 6 && weightedNumber < 9) {\n returnedNumber = Math.floor(Math.random(6,10) * 10);\n } else {\n returnedNumber = Math.floor(Math.random(1, 6) * 10);\n }\n return this.state.possibleSlots[returnedNumber];\n }",
"title": ""
},
{
"docid": "babe49dd576f9bde5763a1d22c7c4ef3",
"score": "0.5854393",
"text": "function setMines(numMines) {\n let mines = []\n for (i = 0; i < numMines; i++) {\n let mineToAdd = 0\n while (true) {\n mineToAdd = (Math.random() * 24);\n mineToAdd = Math.floor(mineToAdd);\n\n if (mineToAdd !== currentSquare && mineToAdd !== finishPoint && mines.includes(mineToAdd) === false) {\n mines.push(mineToAdd);\n break;\n };\n };\n };\n return mines;\n}",
"title": ""
},
{
"docid": "cbeb37511cb5e6f0541c94ee17134572",
"score": "0.5853802",
"text": "function createSequence() {\r\n const possible = Object.keys(thisBlocks);\r\n while(possible.length) {\r\n let random = randomNumber(0, possible.length - 1);\r\n let id = possible.splice(random, 1)[0];\r\n thisSequence.push(id);\r\n }\r\n}",
"title": ""
},
{
"docid": "5507b6e4815b7239ca361c34e070af06",
"score": "0.5851211",
"text": "function generateNum() {\n goalNumber = Math.floor((Math.random() * 120) + 19);\n }",
"title": ""
},
{
"docid": "b6354fd573f4388b92662d7a3c6065e4",
"score": "0.584674",
"text": "function generateCardNum() //this function puts values into the 5 sets and then converts them into 5 arrays\r\n{\r\n for (var i = 0; i < 5; i++) //creates a loop that incrememnts i every time the while loop's condition is met so that we have 5 sets of values (5 appropriate numbers for each column of the bingo card)\r\n {\r\n while(arrayOfSets[i].size < 5) //creates a loop that repeats until a set has 5 values inside of it\r\n {\r\n var minNum; //declares the variables in the scope of the function\r\n var maxNum; //declares the variables in the scope of the function\r\n if(i == 0) //when i = 0, change the value of minNum and maxNum to the appropriate conditions for USA bingo\r\n {\r\n minNum = 1; //B column should be a minimum of 1\r\n maxNum = 15; //B column should be a maximum of 15\r\n }\r\n else if(i == 1)\r\n {\r\n minNum = 16; //B column should be a minimum of 16\r\n maxNum = 30; //B column should be a maximum of 30\r\n }\r\n else if(i == 2)\r\n {\r\n minNum = 31; //B column should be a minimum of 31\r\n maxNum = 45; //B column should be a maximum of 45\r\n }\r\n else if(i == 3)\r\n {\r\n minNum = 46; //B column should be a minimum of 46\r\n maxNum = 60; //B column should be a maximum of 60\r\n }\r\n else if(i == 4)\r\n {\r\n minNum = 61; //O column should be a minimum of 61\r\n maxNum = 75; //O column should be a maximum of 75\r\n }\r\n\r\n let randomNumber = Math.floor(Math.random() * (maxNum - minNum +1)) +minNum; //creates a variable that holds a random number within the min/max threshholds\r\n arrayOfSets[i].add(randomNumber) //puts the number into the set\r\n }\r\n/* At this point, I realised that because of the contraints within the sets methods/properties, it would make life easier to just convert my sets into arrays so that I could continue to progress\r\n with further sprints. */\r\n\r\n var arrayFromSet = []; //creates an empty array that will hold the new arrays once they are converted from sets\r\n arrayOfSets[i].forEach(function(value1, value2, set) //goes through each index within the set and takes the value\r\n {\r\n arrayFromSet.push(value1); //pushes the value from the set and places it into the arrayFromSet array\r\n });\r\n arrayOfSets[i] = arrayFromSet; //assigns the value from arrayOfSets to arrayFromSet so that it can be used\r\n }\r\n}",
"title": ""
},
{
"docid": "523832b1d12de69f7678429db710b2ca",
"score": "0.58425486",
"text": "genNextSpot() {\r\n let countFreeSpaces = this.gameState.board.filter((i) => i === 0).length;\r\n if (countFreeSpaces === 0) {\r\n this.checkLose();\r\n } else {\r\n let locationToAdd = Math.floor(Math.random() * Math.floor(countFreeSpaces));\r\n let numEmptyTraversed = 0;\r\n for (let i = 0; i < this.gameState.board.length; i++) {\r\n if (this.gameState.board[i] === 0) {\r\n if (numEmptyTraversed === locationToAdd) {\r\n this.gameState.board[i] = this.gen2or4();\r\n break;\r\n } else {\r\n numEmptyTraversed++;\r\n }\r\n }\r\n }\r\n } \r\n }",
"title": ""
},
{
"docid": "2ea382a327a1e12dcf43dc177df3f265",
"score": "0.5837114",
"text": "function generateLotto() {\n let numbers = new Array()\n for (let i=0; i<7; i++) {\n let rng\n do {\n rng = numFormat(Math.floor(Math.random() * 40 + 1))\n }\n while (numbers.includes(rng))\n numbers.push(rng)\n }\n return numbers\n}",
"title": ""
},
{
"docid": "2fe8c525d698b13d2fbd605240c7f44b",
"score": "0.58312845",
"text": "genCode() {\n let numColors = this.state && colors[this.state.difficulty].length;\n numColors = numColors || 4;\n return new Array(4).fill().map(dummy => Math.floor(Math.random() * numColors));\n }",
"title": ""
},
{
"docid": "8e4480e3f3484b2a6495a453d25adfaa",
"score": "0.58275574",
"text": "function randFill(color) {\n var replacedBlocks = [];\n while (replacedBlocks.length < 8) { // replaced\n var rand = getRandomInt(0, options.blocksPerEdge * options.blocksPerEdge - 1, replacedBlocks.length);\n var myRand = myGetRandomInt(replacedBlocks.length)\n if (replacedBlocks.indexOf(rand) === -1) {\n var coordinate = getLocation(myRand);\n drawSquare(color, coordinate[1], coordinate[0]);\n replacedBlocks.push(myRand);\n }\n }\n }",
"title": ""
},
{
"docid": "d1b12e5e514dcc051ed77a281e47a5f7",
"score": "0.58273965",
"text": "function shuffle() {\n\tvar neighbors, spot;\n\tgameon = true;\n\tshuffling = false;\t//to avoid the win logo appear now\n\tfor (var i = 0; i < 500; i++) {\n\t\tneighbors = getNeighbors();\n\t\tspot = Math.floor(Math.random() * neighbors.length);\n\t\tsquares[neighbors[spot].identity].move();\n\t}\n\tshuffling = true;\t\t//let the function iswin() take effect\n\twinbut.id = \"isWin\";\t//to hide the win logo\n}",
"title": ""
},
{
"docid": "3cc626c790f7cc49ed1a8f235e76e8e7",
"score": "0.5826537",
"text": "function drawblocks() \n{\n\tfor (i=0; i < rows; i++) \n\t{\n\t\tcanvas.fillStyle = rowcolors[i]\n\n\t\tfor (j=0; j < columns; j++) \n\t\t{\n\t\t\tif (blocks[i][j] == 1) \n\t\t\t{\n\t\t\t\tblock((j * (blockwidth + shield)) + shield, (i * (blockheight + shield)) + shield, blockwidth, blockheight);\n\t\t\t}\n\t\t}\n\t}\n}",
"title": ""
}
] |
8880fe546b36b9294175e40e784bfc2c | Removes all occurences of elements whose XPath is provided from the document. Example: Remove all tables which use the CSS class 'toto': | [
{
"docid": "d01728066e4d6e516c790b0015c8fa8e",
"score": "0.6347531",
"text": "function removeElement(ElementXpath)\r\n {\r\n var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n for (i=0; i<alltags.snapshotLength; i++)\r\n {\r\n element = alltags.snapshotItem(i);\r\n element.parentNode.removeChild(element); // Remove this element from its parent.\r\n }\r\n }",
"title": ""
}
] | [
{
"docid": "3da75b50a6ec02312bb50b82d7b0039f",
"score": "0.75516844",
"text": "function removeElements (xPath) {\n\tvar thisElement, allElements = document.evaluate(xPath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n\tfor (f = 0; f < allElements.snapshotLength; f++) {\n thisElement = allElements.snapshotItem(f);\n thisElement.parentNode.removeChild(thisElement);\n\t}\n}",
"title": ""
},
{
"docid": "64f7ebaa2d02856c139cc9563473ac1c",
"score": "0.61116123",
"text": "function removeNodesByQuery(documentNode, query) {\r\n\tvar xpr = document.evaluate(query, documentNode, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\t\r\n\t\r\n\tfor (var i = 0; i < xpr.snapshotLength; i++) {\r\n\t\tvar node = xpr.snapshotItem(i);\r\n\t\tnode.parentNode.removeChild(node);\r\n\t}\r\n}",
"title": ""
},
{
"docid": "40f05ef412594a35ac46544bc1315c5e",
"score": "0.602111",
"text": "function removeXP(xp) {\r\nvar x,XP=document.evaluate(xp,document,null,6,null);\r\nfor(var i=0; i<XP.snapshotLength; i++) {var x=XP.snapshotItem(i);x.parentNode.removeChild(x);}\r\n}",
"title": ""
},
{
"docid": "d0e30b164623c1abfcadff720ef69de5",
"score": "0.59743965",
"text": "function seekAndDestroy(xpath, root) {\r\n forEach($x(xpath, root), destroy);\r\n}",
"title": ""
},
{
"docid": "d3a3cb26782a7e76282d3d917e742b61",
"score": "0.5909695",
"text": "function cleanDOM() {\n removeElementsFromDOM('hat');\n removeElementsFromDOM('socks');\n removeElementsFromDOM('sunglasses');\n removeElementsFromDOM('gloves');\n}",
"title": ""
},
{
"docid": "a7eabadf538223f717fef752b7b91489",
"score": "0.584539",
"text": "function removeAll(selector){\r\n var allElements = storyContainer.querySelectorAll(selector);\r\n for(var i = 0; i<allElements.length; i++) {\r\n var el = allElements[i];\r\n el.parentNode.removeChild(el);\r\n }\r\n}",
"title": ""
},
{
"docid": "d98ed5c7efb6eed0702431f60464a584",
"score": "0.5766122",
"text": "function wipeWholePage(){\n\tvar currNode = document.body.childNodes\n\tfor (var i = 0; i < currNode.length; i++) {\n\t\tconsole.log(\"curr id\", currNode[i].id);\n\t\tif(currNode[i].id !== \"ogB\" &&\n\t\tcurrNode[i].id !== undefined && currNode[i].nodeName !== \"H\"){\n\t\t\tconsole.log(\"Removing.....\", currNode[i].id)\n\t\t\tcurrNode[i].parentNode.removeChild(currNode[i])\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "4d02456e55291cce27fdf6986e476660",
"score": "0.57636297",
"text": "function cleanEmpireMenus() {\n //Clear out additional menus cause i'm tired of having multiple ones loading if you run seperate scripts\n var cleanmenus = document.evaluate(\"//table[@class='header']\",\n document, null, XPathResult.UNORDERED_NODE_TYPE, null);\n if (cleanmenus.snapshotLength > 1) {\n for (var i = 0; i < cleanmenus.snapshotLength; i++) {\n cleanmenus.parentNode.removeChild(cleanmenus.previousSibling);\n }\n }\n}",
"title": ""
},
{
"docid": "6c26b89ea6ae0b77f7f8800161a3415e",
"score": "0.5679954",
"text": "function removeEverything() {\n\twhile (document.body.firstChild) {\n\t\tdocument.body.firstChild.remove();\n\t}\n}",
"title": ""
},
{
"docid": "dcc3966ff66102530200915d6568657e",
"score": "0.5674816",
"text": "function clearTable() {\n let tableBody = document.getElementById(\"mtnSearchTable\");\n while (tableBody.childNodes.length) {\n tableBody.removeChild(tableBody.childNodes[0]);\n }\n}",
"title": ""
},
{
"docid": "ade2f31f63bd53db94cb7d16d29c90c7",
"score": "0.56703234",
"text": "function clearEvaluateTable() {\n const tableBody = document.getElementById('evaluate-tbody');\n while (tableBody.children.length > 1) {\n tableBody.removeChild(tableBody.children[1]);\n }\n}",
"title": ""
},
{
"docid": "7febf5b8fd3793207c42c5b34eff04c1",
"score": "0.56590986",
"text": "function removeAll() {\n var tBodyId = document.getElementById('TableBody');\n while (tBodyId.rows.length > 0) {\n tBodyId.removeChild(tBodyId.rows[0]);\n }\n}",
"title": ""
},
{
"docid": "0e2bd606f218b5e1fc83ceffb5545826",
"score": "0.56496614",
"text": "function removeAll(selector) {\n var allElements = storyContainer.querySelectorAll(selector);\n for (var i = 0; i < allElements.length; i++) {\n var el = allElements[i];\n el.parentNode.removeChild(el);\n }\n }",
"title": ""
},
{
"docid": "987968b35138f8dc373a655a2ab08063",
"score": "0.56469965",
"text": "function rest_table()\r\n{\r\n for (i = 0; i < 7; i++)\r\n {\r\n for (j = 0; j < 7; j++)\r\n {\r\n if (tableObj.children[0].children[i].children[j].childNodes[0] != null)\r\n tableObj.children[0].children[i].children[j].children[0].remove();\r\n\r\n }\r\n }\r\n}",
"title": ""
},
{
"docid": "6661a0d64cb161ac6e5a2783628ee64c",
"score": "0.5621449",
"text": "function clearPage() {\r\n let content = document.querySelectorAll(\".result\"); \r\n content.forEach((element)=>{\r\n element.remove();\r\n })\r\n }",
"title": ""
},
{
"docid": "db3884d02d4ab6ab302a0646c0f27ecc",
"score": "0.56156695",
"text": "function ClearTables(){\r\n\tvar mytbl = document.getElementById(\"myPartsTableBody\")\r\n\twhile(mytbl.firstChild){\r\n\t\tmytbl.removeChild(mytbl.firstChild)\r\n\t}\r\n mytbl = document.getElementById(\"partFinderTableBody\")\r\n\twhile(mytbl.firstChild){\r\n\t\tmytbl.removeChild(mytbl.firstChild)\r\n\t}\r\n\r\n\tmytbl = document.getElementById(\"assemblyReportTableBody\")\r\n\twhile(mytbl.firstChild){\r\n\t\tmytbl.removeChild(mytbl.firstChild)\r\n\t}\r\n}",
"title": ""
},
{
"docid": "1ebb9642325b72482a8a2cab1d639256",
"score": "0.5593916",
"text": "function borrarHistorialDom() {\r\n let tareasDelHistorial = document.querySelectorAll(\"#contenedorDeTareasEnHistorial li\");\r\n for (const tarea of tareasDelHistorial){\r\n tarea.remove();\r\n }\r\n}",
"title": ""
},
{
"docid": "6841bb111bce7b2aba85cc4e582280f1",
"score": "0.5571688",
"text": "function removeAll(){\n\tdocument.documentElement.innerHTML = \"\";\n}",
"title": ""
},
{
"docid": "8e23e31112912f2c1431969d53aa3bc4",
"score": "0.5530567",
"text": "function removeAllCheckBoxSelector() {\n var allCheckboxItems = document.querySelectorAll('input.scContentTreeCheckbox');\n allCheckboxItems.forEach(input => {\n var parent = input.parentNode;\n parent.removeChild(input);\n });\n}",
"title": ""
},
{
"docid": "f99a05a9c0a2bafcb746c3d661e11876",
"score": "0.55304676",
"text": "function removeEverything() {\n while (document.body.firstChild) {\n document.body.firstChild.remove();\n }\n }",
"title": ""
},
{
"docid": "74b77ffb677ab1eeeecafbebb0a6539d",
"score": "0.55169785",
"text": "function removeNodes (cssClass) {\n let selector = \"div.\" + cssClass;\n let elements = document.querySelectorAll(selector);\n Array.prototype.forEach.call(elements, function (element) {\n document.body.removeChild(element);\n });\n}",
"title": ""
},
{
"docid": "6a538c2aea7cc0de5123ebf76915b487",
"score": "0.5487649",
"text": "function $$(xpath,root) { \r\n xpath = xpath\r\n .replace(/((^|\\|)\\s*)([^/|\\s]+)/g,'$2.//$3')\r\n .replace(/\\.([\\w-]+)(?!([^\\]]*]))/g, '[@class=\"$1\" or @class$=\" $1\" or @class^=\"$1 \" or @class~=\" $1 \"]')\r\n .replace(/#([\\w-]+)/g, '[@id=\"$1\"]')\r\n .replace(/\\/\\[/g,'/*[');\r\n str = '(@\\\\w+|\"[^\"]*\"|\\'[^\\']*\\')';\r\n xpath = xpath\r\n .replace(new RegExp(str+'\\\\s*~=\\\\s*'+str,'g'), 'contains($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\^=\\\\s*'+str,'g'), 'starts-with($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\$=\\\\s*'+str,'g'), 'substring($1,string-length($1)-string-length($2)+1)=$2');\r\n var got = document.evaluate(xpath, root||document, null, 5, null);\r\n var result=[];\r\n while (next = got.iterateNext())\r\n result.push(next);\r\n return result;\r\n}",
"title": ""
},
{
"docid": "6a538c2aea7cc0de5123ebf76915b487",
"score": "0.5487649",
"text": "function $$(xpath,root) { \r\n xpath = xpath\r\n .replace(/((^|\\|)\\s*)([^/|\\s]+)/g,'$2.//$3')\r\n .replace(/\\.([\\w-]+)(?!([^\\]]*]))/g, '[@class=\"$1\" or @class$=\" $1\" or @class^=\"$1 \" or @class~=\" $1 \"]')\r\n .replace(/#([\\w-]+)/g, '[@id=\"$1\"]')\r\n .replace(/\\/\\[/g,'/*[');\r\n str = '(@\\\\w+|\"[^\"]*\"|\\'[^\\']*\\')';\r\n xpath = xpath\r\n .replace(new RegExp(str+'\\\\s*~=\\\\s*'+str,'g'), 'contains($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\^=\\\\s*'+str,'g'), 'starts-with($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\$=\\\\s*'+str,'g'), 'substring($1,string-length($1)-string-length($2)+1)=$2');\r\n var got = document.evaluate(xpath, root||document, null, 5, null);\r\n var result=[];\r\n while (next = got.iterateNext())\r\n result.push(next);\r\n return result;\r\n}",
"title": ""
},
{
"docid": "79a344caf2b312d20b4feb99343d4b1d",
"score": "0.547318",
"text": "function wmRemoveAll(cssSelector) {\n\tdocument.querySelectorAll(cssSelector).forEach((element) => {\n\t\telement.remove();\n\t});\n}",
"title": ""
},
{
"docid": "7d16da3c93c1b8f88b773b38c730a6b9",
"score": "0.54611397",
"text": "function removeElements(element, selector) {\n var elementsToRemove = element.querySelectorAll(selector);\n for (var i = 0; i < elementsToRemove.length; i++) {\n var removeElement = elementsToRemove[i];\n if (removeElement.parentNode) {\n removeElement.parentNode.removeChild(removeElement);\n }\n }\n}",
"title": ""
},
{
"docid": "5bf87ae9615b592a0e53e9dcabaadf53",
"score": "0.54378074",
"text": "function removeAll(sel) {\n var target = document.querySelectorAll(sel)\n for (var i = 0;i < target.length;i++) {\n target[i].parentNode.removeChild(target[i])\n }\n}",
"title": ""
},
{
"docid": "b13fef4b8af87f1f4b68eafa0e4533e1",
"score": "0.5435653",
"text": "function clear_table() {\n\tvar tb_row_tmp = document.querySelectorAll(\"#calendar_tb > tbody > tr:nth-of-type(3)\");\n\tvar tb = document.getElementById(\"calendar_tb\");\n\tvar tb_body = tb.childNodes[1];\n\n\twhile (tb_row_tmp[0]) {\n\t\ttb_body.removeChild(tb_row_tmp[0]);\n\t\ttb_row_tmp = document.querySelectorAll(\"#calendar_tb > tbody > tr:nth-of-type(3)\");\n\t}\n}",
"title": ""
},
{
"docid": "afc3093a0521370baa24a46c4bb74d32",
"score": "0.5416676",
"text": "function removeFakeRootElements(ast) {\n const injectedNodes = walking.queryAll(ast, predicates.predicates.AND((node) => !node.__location, predicates.predicates.hasMatchingTagName(/^(html|head|body)$/i)), undefined, \n // Don't descend past 3 levels 'document > html > head|body'\n (node) => node.parentNode && node.parentNode.parentNode ?\n undefined :\n node.childNodes);\n injectedNodes.reverse().forEach(removeNodeSaveChildren);\n}",
"title": ""
},
{
"docid": "5296620ec7413ca9207e236facbb2d25",
"score": "0.54159296",
"text": "function removerPropaganda(){\r\n $(\"body > div:nth-child(5)\").remove(); \r\n}",
"title": ""
},
{
"docid": "a8677b8a4b7a602dcfe0915bca2a0fad",
"score": "0.5379512",
"text": "function resetAll() {\n var nodes = document.querySelectorAll('*');\n [].forEach.call(nodes, function(el) {\n el.className = \"\";\n el.id = \"\";\n el.style=\"\";\n });\n}",
"title": ""
},
{
"docid": "389fbe8539f7f3e1936ebfd31808da68",
"score": "0.5364462",
"text": "function clearTags(){\n document.querySelectorAll('.tag').forEach(tag => {\n tag.parentElement.removeChild(tag);\n })\n}",
"title": ""
},
{
"docid": "b9dadb7b67a7983a44c54d098b3d5eb8",
"score": "0.535782",
"text": "function deleteAllChildren(selector) { //W4D1(0:27:)(37)\n const parent = document.querySelector(selector)\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n console.log(\"All children should be done\");\n }",
"title": ""
},
{
"docid": "d02069b578981690a3041474fcd4b38e",
"score": "0.53504753",
"text": "function deleteTable(table){\n while (table.firstChild) {\n table.firstChild.remove()\n }\n}",
"title": ""
},
{
"docid": "d37e133722bf8a18037e15c869ca2f63",
"score": "0.5348971",
"text": "function removeAttributeOfElement(attributeName,ElementXpath)\r\n {\r\n var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n for (i=0; i<alltags.snapshotLength; i++)\r\n alltags.snapshotItem(i).removeAttribute(attributeName); \r\n }",
"title": ""
},
{
"docid": "9b9dc5d14d374ec435031baa48a15fd6",
"score": "0.53367704",
"text": "clear(){\n while (document.querySelector('#tb').firstElementChild){\n document.querySelector('#tb').firstElementChild.remove();\n }\n }",
"title": ""
},
{
"docid": "48fa1ff34bd63ded4beabf58f9b2dc53",
"score": "0.5316986",
"text": "function removeGrid(){\n let rows = document.querySelectorAll(\".rows\");\n let rowsArray = Array.from(rows);\n rowsArray.forEach(element => element.remove());\n}",
"title": ""
},
{
"docid": "649b8697e358ef90483a66bee3401ce8",
"score": "0.531232",
"text": "function clearElem(element) { // clearing function\n if (document.contains(document.getElementById(element))) {\n document.body.removeChild(tableColor);\n }\n}",
"title": ""
},
{
"docid": "d8de19c60d86918ff05a822d8a00ff0a",
"score": "0.52943873",
"text": "function clearRecentSearchDom()\n{\n let search = document.getElementById('recent-searches');\n if(recentSearchesMap.size <= 0){\n return;\n }\n if(search.hasChildNodes && search.childNodes.length>5){\n search.removeChild(search.childNodes[5]);\n }\n}",
"title": ""
},
{
"docid": "ff4f9747d13b22f19b6a859b731a3961",
"score": "0.52888227",
"text": "function getElementsByXpath(xpath, node = document) {\n // Helper namespace resolver\n function nsResolver(p) {\n let group = {\n mathml: \"http://www.w3.org/1998/Math/MathML\",\n s: \"http://www.w3.org/2000/svg\",\n svg: \"http://www.w3.org/2000/svg\",\n x: \"http://www.w3.org/1999/xhtml\",\n xhtml: \"http://www.w3.org/1999/xhtml\",\n xlink: \"http://www.w3.org/1999/xlink\"\n };\n return group[p] || null;\n };\n // Initialise output\n let output = new Array();\n // Get the node snapshot\n let snapshot = document.evaluate(\n xpath,\n node,\n nsResolver,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null\n );\n // If none, return null\n if (snapshot.snapshotLength === 0) return null;\n // Loop for the snapshot length and push to the output\n for (let i = 0; i < snapshot.snapshotLength; ++i) {\n output.push(snapshot.snapshotItem(i));\n };\n return output;\n}",
"title": ""
},
{
"docid": "b6ddacc11a5dd9669c473caa0723b03d",
"score": "0.52534443",
"text": "function deleteMe(a)\n{\n\tvar duplicate = a.parentNode;\n\twhile (duplicate.nodeName.toLowerCase() != 'tr')\n\t{\n\t\tduplicate = duplicate.parentNode;\n\t}\n\tduplicate.parentNode.removeChild(duplicate);\n}",
"title": ""
},
{
"docid": "86b93c9cf45cbeb9ec7aed2a4b15fd38",
"score": "0.5244754",
"text": "clear () {\n const taskCenter = getTaskCenter(this.docId)\n /* istanbul ignore else */\n if (taskCenter) {\n this.pureChildren.forEach(node => {\n taskCenter.send(\n 'dom',\n { action: 'removeElement' },\n [node.ref]\n )\n })\n }\n this.children.forEach(node => {\n node.destroy()\n })\n this.children.length = 0\n this.pureChildren.length = 0\n }",
"title": ""
},
{
"docid": "bc92a093961b4397bfb6fd9faa9337ee",
"score": "0.5243236",
"text": "function clearPage () {\n const sxn = document.querySelectorAll('section, hr, br');\n\n sxn.forEach(s => {\n s.remove();\n });\n}",
"title": ""
},
{
"docid": "8343eb84082791cf9e815518de1e16c7",
"score": "0.524271",
"text": "function clearCart() {\n let allRowsEl = document.querySelectorAll('tr');\n console.log(allRowsEl);\n for (let i = 0; i < allRowsEl.length; i++) {\n allRowsEl[i].remove();\n }\n}",
"title": ""
},
{
"docid": "94570f70180648b7daaeaf59b11050b5",
"score": "0.523918",
"text": "function clean(elem){\n let tableElements = elem.getElementsByClassName('rte-table-container');\n\n if(tableElements.length != 0){\n let tableContainer = tableElements[0];\n\n let tableActionBar = tableContainer.getElementsByClassName('rte-table-action-bar');\n tableActionBar[0].remove();\n \n let table = tableContainer.getElementsByTagName('TABLE');\n \n table[0].id = '';\n table[0].className = '';\n \n table[0].style.border = \"1px solid #b9b9b9\";\n // table[0].style.width = \"100%\";\n table[0].style['border-collapse'] = \"collapse\";\n // table[0].style['table-layout'] = \"fixed\";\n\n let rows = table[0].getElementsByTagName('TR');\n \n for(let row of rows){\n row.id = '';\n row.className = '';\n }\n \n let columns = table[0].getElementsByTagName('TD');\n \n for(let column of columns){\n let col = document.getElementById(column.id),\n colWidth = parseFloat(window.getComputedStyle(col).getPropertyValue('width').replace(\"px\",\"\"));\n \n if(colWidth <= 60) {\n column.style[\"width\"] = \"60px\";\n }\n\n column.style.border = \"1px solid #b9b9b9\";\n column.style[\"min-width\"] = \"60px\";\n column.style[\"word-break\"] = \"break-all\";\n column.id = '';\n column.className = '';\n column.style['font-family'] = '\"Microsoft YaHei\", Arial, Helvetica, sans-serif'; \n column.style['font-size'] = \"16px\";\n\n if(column.innerHTML.length == 0){\n column.innerHTML = \" \"\n }\n }\n \n tableContainer.removeAttribute(\"id\");\n tableContainer.removeAttribute(\"class\");\n clean(elem);\n return;\n } else {\n return;\n }\n }",
"title": ""
},
{
"docid": "88b242a52755d05bcdaaa77365701fbc",
"score": "0.52376026",
"text": "clearAllTweets() {\n let tweetContainer = document.getElementById('mainLink');\n // While the tweet container has a child, remove that child\n while (tweetContainer.firstChild) {\n tweetContainer.removeChild(tweetContainer.firstChild);\n }\n }",
"title": ""
},
{
"docid": "b6684ff8fd779599aa7cb2b2dcad9e7f",
"score": "0.52309716",
"text": "function clearTable() {\n var tbody = document.getElementById(\"tbody\");\n // Remove all children of the table->tbody\n while (tbody.firstChild) {\n tbody.removeChild(tbody.firstChild);\n }\n}",
"title": ""
},
{
"docid": "d1aaaf38fe20a560aa7ce88925d2d7bb",
"score": "0.5219108",
"text": "function teardown() {\n console.log(\"Cleaning up\");\n let all = document.querySelectorAll('[id=container]');\n for (let i = 0; i < all.length; i++) {\n all[i].remove();\n }\n}",
"title": ""
},
{
"docid": "83309c030e4bbeeb39ec6b4d21bc5a22",
"score": "0.52109194",
"text": "function eraseChilds(elem){\n\t\t\tvar length = elem.childNodes.length;\n\t\t\t\n\t\t\tfor (var i = length-1; i>=0; i--){\n\t\t\t\telem.childNodes[i].remove()\n\t\t\t}\n\t\t}",
"title": ""
},
{
"docid": "f6f43fc0a24cd30836b18bde1f027d6a",
"score": "0.51996726",
"text": "function removeSelectorAll(selector) {\n var elNodeList = document.querySelectorAll('.' + selector);\n for (var i = 0; i < elNodeList.length; i++) {\n elNodeList[i].classList.remove(selector);\n // if (selector === 'marked') {\n // elNodeList[i].classList.add('wasMarked');\n // }\n }\n\n} // *** End of removeSelector",
"title": ""
},
{
"docid": "62c2d0966170ec2b69aaafd60d05d6d1",
"score": "0.5195754",
"text": "function parse_for_FF(){\n\t\t$need_to_remove = new Array();\n\t\t$elements = mainframe.document.body.getElementsByTagName(\"*\");\n\t\tvar $counter = $elements.length;\n\t\tfor (var $x=0; $x < $counter; $x++) {\n\t\t\t_remove_attributes($elements[$x]);\n\n\t\t}\n\t\t_parse_tables(mainframe.document.body.getElementsByTagName(\"TABLE\"));\n\t\t_clear_tags($elements[$x]);\n\t}",
"title": ""
},
{
"docid": "a4fcebe0537e1abebb0000868788d593",
"score": "0.519478",
"text": "function removeAll() {\n let all = $('output').children;\n for (let i = 0; i < all.length; i++) {\n $('output').removeChild(all[i]);\n }\n }",
"title": ""
},
{
"docid": "fc3cb852dc2ac92fa0f3eaeba6f64d1f",
"score": "0.518913",
"text": "removeGoneElements() {\n\t\tlet toRemove = [];\n\t\tfor (let index=0; index < this.activations.length; ++index) {\n\t\t\tif (! document.body.contains(this.activations[index].dom)) toRemove.push (index);\n\t\t}\n\t\ttoRemove.sort(function compare(a, b) { return b - a; } );\n\t\tfor (const index of toRemove) {\n\t\t this.activations.splice(index, 1);\n\t\t}\n }",
"title": ""
},
{
"docid": "e8b5b8c187acc233cdaed2f062d8d3b7",
"score": "0.51891184",
"text": "function clearDivs() {\n var divs = getElements('rita');\n for (var i = 0; i < divs.length; i++) {\n divs[i].remove();\n }\n}",
"title": ""
},
{
"docid": "fa076050f64d495539004018e9a56b56",
"score": "0.5187646",
"text": "clearList() {\n const table = document.querySelector(\"tbody\");\n\n while(table.firstChild) {\n table.removeChild(table.firstChild);\n }\n }",
"title": ""
},
{
"docid": "f63c8ea22d90afc42bff7d749df2adf7",
"score": "0.5187178",
"text": "unvisitAllNodes() {\n this.getNodes().forEach(node => {\n node.unVisit();\n });\n }",
"title": ""
},
{
"docid": "67461a8736b0cdda305fb7e2dab06493",
"score": "0.5183304",
"text": "function removeGrammarly()\n{\n\t\n\tvar body = document.getElementsByTagName('body');\n var b = body[0].childNodes;\n\n for (var i = b.length - 1; i >= 0; i--){\n\n if (!(b[i].hasAttribute('sh-section')))\n {\n b[i].remove();\n }\n };\n}",
"title": ""
},
{
"docid": "39eb4e0206dc715cd9987aad3585c069",
"score": "0.51745176",
"text": "function ga_clear_children(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}",
"title": ""
},
{
"docid": "ff9d3b68d28b9e645cb6a4aea03e6dc5",
"score": "0.51726687",
"text": "function clearTable() {\n let dir_table = getDirTable()\n while (dir_table.firstChild) {\n dir_table.firstChild.remove();\n }\n}",
"title": ""
},
{
"docid": "0ee5aa19da887a265238c3a0fc19244e",
"score": "0.51710296",
"text": "function removeGarb(element) {\n\tlet allElms = element.querySelectorAll(\"#ContentBox *\");\n\n\t// various categories to check for\n\tlet byOuterHTML = [\"<o:p></o:p>\"];\n\tlet byClass = [\"MsoNormal\"];\n\tlet byTag = [\"span\", \"div\", \"#ContentBox > br\"];\n\n\t// remove based on OuterHTML comparison\n\tfor (let i = 0; i < allElms.length; i++) {\n\t\tfor (let j = 0; j < byOuterHTML.length; j++) {\n\t\t\tif (allElms[i].outerHTML == byOuterHTML[j]) {\n\t\t\t\tallElms[i].remove();\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove based on Tag\n\tfor (let i = 0; i < byTag.length; i++) {\n\t\t// generate list of all of specified Tag\n\t\tlet tagList = element.querySelectorAll(byTag[i]);\n\t\t// iterate through list\n\t\tfor (let j = 0; j < tagList.length; j++) {\n\t\t\t// get match list of words/numbers that are not spaces/carriage returns/tabs/new lines\n\t\t\tlet temp = tagList[j].innerText.match(/[^\\s\\r\\t\\n]+/g);\n\t\t\t// if no matches exist\n\t\t\tif (temp === null) {\n\t\t\t\ttagList[j].remove();\n\t\t\t}\n\t\t\t// if only one match exists\n\t\t\telse if (temp.length == 1) {\n\t\t\t\t// is it only 1 character\n\t\t\t\tif (temp[0].length == 1) {\n\t\t\t\t\ttagList[j].remove();\n\t\t\t\t}\n\t\t\t\t// it is more than 1 character long\n\t\t\t\telse {\n\t\t\t\t\tcheckNReplace(tagList[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcheckNReplace(tagList[j]);\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove based on Class comparison\n\tallElms = element.querySelectorAll(\"#ContentBox *\");\n\tfor (let i = 0; i < allElms.length; i++) {\n\t\tallElms[i].innerHTML = allElms[i].innerHTML.replace(/<!--.*?-->/g, \"\");\n\t\tallElms[i].innerHTML = allElms[i].innerHTML.replace(/ /g, \" \");\n\t\tfor (let k = 0; k < byClass.length; k++) {\n\t\t\tif (allElms[i].className == byClass[k] && allElms[i].innerHTML === \"\") {\n\t\t\t\tallElms[i].remove();\n\t\t\t}\n\t\t}\n\t}\n\n\tallElms = element.querySelectorAll(\"#ContentBox *\");\n\n}",
"title": ""
},
{
"docid": "55139058a1cab333175baa99be217efe",
"score": "0.5169259",
"text": "function deleteElements() {\r\n\tdel('X[IMAGE_CONTAINER]');\r\n\tdel('P[/14]');\t\t// Delete Favorites\r\n\tdel('P[/17]');\t\t// Other menu\r\n\tdel('P[/18]');\t\t// Other menu\r\n\tdel('P[/34]');\t\t// User menu\r\n\tdel('P[/35]');\t\t// SAP menu\r\n\tdel('P[/36]');\t\t// SAP Business Workplace\r\n\tdel('P[/37]');\t\t// Move Favorites up\r\n\tdel('P[/38]');\t\t// Move Favorites down\r\n\tdel('P[/39]');\t\t// Change Favorites\r\n\tdel('P[/42]');\t\t// Add to Favorites\r\n\tdel('P[/45]');\t\t// Assign users\r\n\tdel('P[/47]');\t\t// Documentation\r\n\tdel('P[/48]');\t\t// Create role\r\n}",
"title": ""
},
{
"docid": "5e530c56ccb93eec7c8a2124dad5c1a7",
"score": "0.5153876",
"text": "function letsJQuery() {\r\n //alert($);\r\n // check if the dollar (jquery) function works\r\n //alert($() .jquery);\r\n // check jQuery version\r\n $('#content > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)') .remove();\r\n $('#footer') .remove();\r\n $('#content > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > a:nth-child(1)') .remove();\r\n $('#content > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > div:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(2)') .remove();\r\n $('#content > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(3) > table:nth-child(1)') .remove();\r\n $('*[height=\"970\"]') .each(function () {\r\n $(this) .attr('width', '100%');\r\n });\r\n $('*[width=\"770\"]') .each(function () {\r\n $(this) .attr('width', '100%');\r\n //alert($(this));\r\n });\r\n $('*[width=\"900\"]') .each(function () {\r\n $(this) .attr('width', '100%');\r\n //alert($(this));\r\n });\r\n $('*[src^=\"images5/banner\"]') .each(function () {\r\n $(this) .remove();\r\n });\r\n $('*[src^=\"images5/pillar\"]') .each(function () {\r\n $(this) .remove();\r\n });\r\n $('*[src^=\"images4/pillar\"]') .each(function () {\r\n $(this) .remove();\r\n });\r\n $('*[src^=\"images5/square\"]') .each(function () {\r\n $(this) .remove();\r\n });\r\n $('#content > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(1) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1)') .remove();\r\n}",
"title": ""
},
{
"docid": "34229575d2e83852bc28aabb84411183",
"score": "0.5153247",
"text": "function clearTable() {\n var mult_table = document.getElementById(\"mult-table\");\n\n // While the table has any children, remove the first child.\n while (mult_table.children.length) {\n mult_table.children[0].remove();\n }\n}",
"title": ""
},
{
"docid": "2947fe583f1568677668e1bd1d1df148",
"score": "0.51384497",
"text": "function removeChildren ( target__HTMLElem ) {\n\n\t\t\t\tlet trashBin = document.createElement('DIV');\n\n\t\t\t\tlet allElements = Array.from(target__HTMLElem.querySelectorAll('*'));\n\t\t\t\tallElements.map(x => trashBin.appendChild(x));\n\n\t\t\t\tallElements.map(function(x) { \n\t\t\t\t\ttrashBin.removeChild(x);\n\t\t\t\t\tx.innerHTML = '';\n\t\t\t\t\tObject.keys(x).map(key => x[key] = undefined);\n\t\t\t\t\tx = null;\n\t\t\t\t});\n\n\t\t\t\ttrashBin.innerHTML = '';\n\t\t\t\ttrashBin = undefined;\n\t\t\t}",
"title": ""
},
{
"docid": "9cab8b9644b1913e6556f82f477112b0",
"score": "0.5122303",
"text": "function removeAllChildren(element) {\n var length = element.childNodes.length;\n for (var i = 0; i < length; i++) {\n element.removeChild(element.childNodes[0]);\n }\n}",
"title": ""
},
{
"docid": "3d669e553478f2771134606b43ed8ec1",
"score": "0.51081985",
"text": "function clearTable() {\n let table = document.getElementById(\"table__entry-container\");\n removeAllChildren(table);\n}",
"title": ""
},
{
"docid": "9a5a92c44ca1c056753e369fcf7c2002",
"score": "0.5107784",
"text": "function removeEmptyNodes() {\r\n const HTML_Content = document.querySelector(\"#HTML-Content\");\r\n var treeWalker = document.createTreeWalker(HTML_Content, NodeFilter.SHOW_ELEMENT);\r\n var currentNode = treeWalker.currentNode\r\n var emptyNodes = []\r\n\r\n // test if a node has no text, regardless of whitespaces\r\n var isNodeEmpty = node => !node.textContent.trim()\r\n\r\n // find all empty nodes\r\n while(currentNode) {\r\n isNodeEmpty(currentNode) && emptyNodes.push(currentNode)\r\n currentNode = treeWalker.nextNode()\r\n }\r\n\r\n // remove found empty nodes\r\n emptyNodes.forEach(node => node.parentNode.removeChild(node))\r\n return;\r\n}",
"title": ""
},
{
"docid": "9a5a92c44ca1c056753e369fcf7c2002",
"score": "0.5107784",
"text": "function removeEmptyNodes() {\r\n const HTML_Content = document.querySelector(\"#HTML-Content\");\r\n var treeWalker = document.createTreeWalker(HTML_Content, NodeFilter.SHOW_ELEMENT);\r\n var currentNode = treeWalker.currentNode\r\n var emptyNodes = []\r\n\r\n // test if a node has no text, regardless of whitespaces\r\n var isNodeEmpty = node => !node.textContent.trim()\r\n\r\n // find all empty nodes\r\n while(currentNode) {\r\n isNodeEmpty(currentNode) && emptyNodes.push(currentNode)\r\n currentNode = treeWalker.nextNode()\r\n }\r\n\r\n // remove found empty nodes\r\n emptyNodes.forEach(node => node.parentNode.removeChild(node))\r\n return;\r\n}",
"title": ""
},
{
"docid": "9a5a92c44ca1c056753e369fcf7c2002",
"score": "0.5107784",
"text": "function removeEmptyNodes() {\r\n const HTML_Content = document.querySelector(\"#HTML-Content\");\r\n var treeWalker = document.createTreeWalker(HTML_Content, NodeFilter.SHOW_ELEMENT);\r\n var currentNode = treeWalker.currentNode\r\n var emptyNodes = []\r\n\r\n // test if a node has no text, regardless of whitespaces\r\n var isNodeEmpty = node => !node.textContent.trim()\r\n\r\n // find all empty nodes\r\n while(currentNode) {\r\n isNodeEmpty(currentNode) && emptyNodes.push(currentNode)\r\n currentNode = treeWalker.nextNode()\r\n }\r\n\r\n // remove found empty nodes\r\n emptyNodes.forEach(node => node.parentNode.removeChild(node))\r\n return;\r\n}",
"title": ""
},
{
"docid": "34487f4d2031190a80103efcfe81147f",
"score": "0.51042736",
"text": "function clearClass(x) {\n\n document.querySelectorAll(x).forEach(el => {\n el.classList = '';\n\n })\n}",
"title": ""
},
{
"docid": "bf1f2de4980b5e7c158019b18116cacf",
"score": "0.50859135",
"text": "function removeGrammarly()\n{\n \n var emailBody = document.getElementsByClassName('show-dynamic')[0];\n var b = emailBody.childNodes;\n\n for (var i = b.length - 1; i >= 0; i--){\n\n if (!(b[i].hasAttribute('sh-section')))\n {\n b[i].remove();\n }\n };\n\n b = emailBody.getElementsByClassName('_1BN1N');\n for (var i = b.length - 1; i >= 0; i--){\n b[i].remove(); \n };\n}",
"title": ""
},
{
"docid": "bf1f2de4980b5e7c158019b18116cacf",
"score": "0.50859135",
"text": "function removeGrammarly()\n{\n \n var emailBody = document.getElementsByClassName('show-dynamic')[0];\n var b = emailBody.childNodes;\n\n for (var i = b.length - 1; i >= 0; i--){\n\n if (!(b[i].hasAttribute('sh-section')))\n {\n b[i].remove();\n }\n };\n\n b = emailBody.getElementsByClassName('_1BN1N');\n for (var i = b.length - 1; i >= 0; i--){\n b[i].remove(); \n };\n}",
"title": ""
},
{
"docid": "9b947475a3b8d168fd24fb77fdfa9f7d",
"score": "0.5085131",
"text": "function clearProducts(){\n document.querySelector(\"#products tbody\").remove();\n}",
"title": ""
},
{
"docid": "33f30322a3a7edb5f4f99a85467c421b",
"score": "0.5082008",
"text": "function filterElements() {}",
"title": ""
},
{
"docid": "e464b93260cd83a283bc4bc5537b234b",
"score": "0.5069941",
"text": "deletePathSelector(selector) {\n // console.log(\"in deletePathSelector!\");\n\n // remove selector element from DOM\n let element = selector.getElement();\n // console.log(\"element\", element, \"parent Element\", element.parentElement);\n element.parentElement.removeChild(element);\n\n // remove selector from list\n this.pathSelectors = this.pathSelectors.filter(\n select => select !== selector\n );\n }",
"title": ""
},
{
"docid": "6e54587aff60f46c50e5e65056e2f93e",
"score": "0.50689256",
"text": "function removeRows(){\n const cleanIt = document.getElementById(\"container\");\n while (cleanIt.firstChild) {\n cleanIt.removeChild(cleanIt.lastChild);\n }\n}",
"title": ""
},
{
"docid": "7de4b30a138299067369454858119971",
"score": "0.50672895",
"text": "function unSelector(){\n for (let selector of selectors) {\n selector.classList.remove(\"active-query\")\n }\n}",
"title": ""
},
{
"docid": "8caea567ac458c61a8385027c1546c0d",
"score": "0.5067097",
"text": "function SupprimeFils (oElement)\n{\n\tvar tabChildNodes = oElement.childNodes;\n\twhile (tabChildNodes.length > 0)\n\t{\n\t\toElement.removeChild(tabChildNodes[0]);\n\t}\n}",
"title": ""
},
{
"docid": "af6ea2bcbc60a9febe2b213b188b1d1d",
"score": "0.5059327",
"text": "function clear_td($td) {\n $td.removeClass('call-range');\n $td.removeClass('fold-range');\n $td.removeClass('raise-range');\n $td.removeClass('bluff-range'); \n }",
"title": ""
},
{
"docid": "663bfd987de77c47d60cd50b9c10499e",
"score": "0.5057279",
"text": "function removerTodosCanvas(){\r\n document.querySelectorAll(\".canvas\").forEach((element) => {\r\n element.parentElement.removeChild(element);\r\n })\r\n}",
"title": ""
},
{
"docid": "1dcee1d1a235e7c97efdac7aae5c967f",
"score": "0.5057226",
"text": "function $x(xpath) {\r\n xpath=xpath.replace(/((^|\\|)\\s*)([^/|]+)/g,'$2//$3').replace(/([^.])\\.(\\w*)/g,'$1[@class=\"$2\"]').replace(/#(\\w*)/g,'[@id=\"$1\"]').replace(/\\/\\[/g,'/*[');\r\n var got=document.evaluate(xpath,document,null,0,null), result=[];\r\n while(next=got.iterateNext()) result.push(next);\r\n return result;\r\n}",
"title": ""
},
{
"docid": "69302c21ea9a97c4a663104d8b619a03",
"score": "0.50571305",
"text": "function topics_remove_ad_empty_row() {\r\n xpathl('//div[@class=\"Topic_ListPanel\"]//td[@height=\"52\"]').each(function() {\r\n this.parentNode.parentNode.removeChild(this.parentNode);\r\n });\r\n}",
"title": ""
},
{
"docid": "17125a3b8c41d7a61bf4b31019b557e8",
"score": "0.5051564",
"text": "removeCruft() {\n let $ = Strategy.$;\n $('table, pre').remove();\n\n $('p').each((index, p) => {\n let $p = $(p);\n let text = helper.getNodeContent($p);\n if (!text) {\n $p.remove();\n }\n });\n\n return Promise.resolve();\n }",
"title": ""
},
{
"docid": "e00829cf972bfabd50344f3d18aa45f6",
"score": "0.5043012",
"text": "removeClassFromAllElements(selector) {\n\n var elems = document.querySelectorAll(selector);\n\n [].forEach.call(elems, function(el) {\n el.className = el.className.replace(/waitContentLoaderHidden|waitContentLoaderNone/gi, \"\");\n });\n\n }",
"title": ""
},
{
"docid": "50d88628f4b2930822c5c6af26692695",
"score": "0.5040833",
"text": "function deleteall(){\nwhile(document.querySelector(\".board_tile\")){\n var remove = document.querySelector(\".board_tile\");\n remove.parentNode.removeChild(remove);\n }\n}",
"title": ""
},
{
"docid": "b4d0904e9a263d6b8df322869547547a",
"score": "0.5039386",
"text": "function updateShelf(){\n let temp = document.querySelectorAll(\".mainBook\");\n for(let j = 0; j < temp.length; j++){\n temp[j].parentNode.removeChild(temp[j]);\n }\n}",
"title": ""
},
{
"docid": "ce947f5b7c54c6e1bdc1473258e5d2c7",
"score": "0.50387377",
"text": "function filterDoc() {\n // Clone root element before we filter the document. It is useful when we have\n // multiple selections for the content loaded in the same page instance.\n \n clonedDocumentElement = document.documentElement.cloneNode(true);\n\n // Our strategy starts with an include as a top node.\n // 1. Remove ALL exclude__-s that do not have a hasinclude__\n $(clonedDocumentElement).find('[exclude__]:not([hasinclude__])').remove();\n \n // 2. Remove elements in exclude__ that are not to be include__-ed\n cleanAnExclude(clonedDocumentElement);\n $(clonedDocumentElement).find('[exclude__][hasinclude__]').each(function() {\n visitEls(this, cleanAnExclude);\n });\n\n // 3. Now, starting from top, remove element that is not included. At top-\n // most level, we allow having includes. Excludes are inside includes.\n visitEls(clonedDocumentElement, removeNonIncludes);\n\n removeMarkers(clonedDocumentElement);\n removeMarkers(document.documentElement);\n\n function cleanAnExclude(el) {\n // Skip include__\n if(el.hasAttribute('include__')) return false;\n\n // Remove elements that do not have hasinclude__\n if(!el.hasAttribute('hasinclude__')) {\n $(el).remove();\n return false;\n } else {\n removeTexts(el);\n }\n }\n\n function removeNonIncludes(el) {\n if(el.hasAttribute('include__')) return false;\n if(!el.hasAttribute('hasinclude__')) {\n $(el).remove();\n return false;\n } else {\n removeTexts(el);\n }\n }\n\n function removeTexts(el) {\n $(el).contents().filter(function() {\n return isText(this);\n }).remove();\n }\n}",
"title": ""
},
{
"docid": "eaf3f020d1364b51e4a988fabc240111",
"score": "0.50263566",
"text": "function deleteNodes(classname){\n var elmnts = document.getElementsByClassName(classname);\n if (elmnts.length > 0){\n var parent = elmnts[0].parentNode;\n }\n while (elmnts.length > 0){\n elmnts[0].parentNode.removeChild(elmnts[0]);\n }\n removeEmptyRows();\n}",
"title": ""
},
{
"docid": "3d4518a5aff4aa73827390c2cfb8222c",
"score": "0.5023088",
"text": "function clearAll() {\n [...document.querySelectorAll(\"td\")].forEach((box, i) => {\n box.style.backgroundColor = \"#fff\";\n });\n}",
"title": ""
},
{
"docid": "86e03e50647b418861f770a11f7b1da2",
"score": "0.5007727",
"text": "function removeJunk () {\n\t\tlet junk = document.querySelectorAll('#user-nav .status, #user-menu');\n\t\tfor (let elem of junk) {\n\t\t\telem.remove();\n\t\t}\n\t}",
"title": ""
},
{
"docid": "c488dd1a0397aa7482344c8c2b3e30eb",
"score": "0.50044984",
"text": "function killTables(){\n while (cookieTable.firstChild) {\n cookieTable.removeChild(cookieTable.firstChild);\n }\n while (tosserTable.firstChild) {\n tosserTable.removeChild(tosserTable.firstChild);\n }\n}",
"title": ""
},
{
"docid": "477243d4d4e36862f9fe523fb4cd5967",
"score": "0.49974513",
"text": "function clearBody() {\n while (tableBodyElement.firstChild) {\n tableBodyElement.removeChild(tableBodyElement.firstChild);\n }\n }",
"title": ""
},
{
"docid": "f612c288fec99972db1693f8ea815fac",
"score": "0.49888894",
"text": "function clearCart() {\n var body = document.getElementsByTagName('tbody')[0];\n\n while (body.firstChild){\n body.removeChild(body.firstChild);\n }\n}",
"title": ""
},
{
"docid": "9ea0e27d98277868cb6956a9ae2bb7a1",
"score": "0.49800456",
"text": "function kill_xml(wiki){\n //https://en.wikipedia.org/wiki/Help:HTML_in_wikitext\n //luckily, refs can't be recursive..\n wiki=wiki.replace(/<ref>[\\s\\S]{0,500}?<\\/ref>/gi,' ')// <ref></ref>\n wiki=wiki.replace(/<ref [^>]{0,200}?\\/>/gi,' ')// <ref name=\"\"/>\n wiki=wiki.replace(/<ref [^>]{0,200}?>[\\s\\S]{0,500}?<\\/ref>/ig,' ')// <ref name=\"\"></ref>\n //other types of xml that we want to trash completely\n\n wiki=wiki.replace(/< ?(table|code|score|data|categorytree|charinsert|gallery|hiero|imagemap|inputbox|math|nowiki|poem|references|source|syntaxhighlight|timeline) ?[^>]{0,200}?>[\\s\\S]{0,700}< ?\\/ ?(table|code|score|data|categorytree|charinsert|gallery|hiero|imagemap|inputbox|math|nowiki|poem|references|source|syntaxhighlight|timeline) ?>/gi,' ')// <table name=\"\"><tr>hi</tr></table>\n\n //some xml-like fragments we can also kill\n //\n wiki=wiki.replace(/< ?(ref|span|div|table|data) [a-z0-9=\" ]{2,20}\\/ ?>/g, \" \")//<ref name=\"asd\"/>\n //some formatting xml, we'll keep their insides though\n wiki=wiki.replace(/<[ \\/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \\/]?>/g, \" \")//<sub>, </sub>\n wiki=wiki.replace(/<[ \\/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s)[ \\/]?>/g, \" \")//<abbr>, </abbr>\n wiki=wiki.replace(/<[ \\/]?h[0-9][ \\/]?>/g, \" \")//<h2>, </h2>\n //a more generic + dangerous xml-tag removal\n wiki=wiki.replace(/<[ \\/]?[a-z0-9]{1,8}[ \\/]?>/g, \" \")//<samp>\n\n return wiki\n }",
"title": ""
},
{
"docid": "4806a55cdc726b2cbcb38449d3edb4a6",
"score": "0.49800286",
"text": "function clearElements(element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild)\n }\n}",
"title": ""
},
{
"docid": "482414319c8e357ebfa5ce5aa65fd8ca",
"score": "0.4976738",
"text": "function removeSearchFields(){\n while (searchRow.firstChild) {\n searchRow.removeChild(searchRow.firstChild);\n }\n}",
"title": ""
},
{
"docid": "649c62749d819329cd2d9756c04af72d",
"score": "0.4963763",
"text": "function eraseInfoFromDom() {\n var reviewData = document.getElementsByClassName('review');\n while (reviewData[0]) {\n masterArray = [];\n reviewData[0].parentNode.removeChild(reviewData[0]);\n }\n}",
"title": ""
},
{
"docid": "bf130b09147d10758b36f7c393ab58a1",
"score": "0.49622577",
"text": "function clearBidTable(){\n let bidTable=document.getElementById(\"bids-table\").querySelector(\"tbody\");\n for(let bidTableRow of bidTable.children)\n for(let bidTableColumn of bidTableRow.children)\n bidTableColumn.innerHTML=\"\";\n}",
"title": ""
},
{
"docid": "437b0b313157b9f315198323465a7d86",
"score": "0.49617338",
"text": "function deleteByClassName(matchClass) {\n var elems = document.getElementsByTagName('*'), i;\n for (i in elems) {\n if((' ' + elems[i].className + ' ').indexOf(' ' + matchClass + ' ')\n > -1) {\n {\n elems[i].parentNode.removeChild(elems[i]);\n break;\n }\n }\n }\n}",
"title": ""
},
{
"docid": "b34a36f9230b590ccab7c32eb73a68e6",
"score": "0.496133",
"text": "function cxText(){\n let queryConArr = Array.from(document.querySelectorAll(\".a input, .b input,.c input\")).map(i => i.value);\n Array.from(document.getElementById(\"showTable\").children[0].children).filter((a,b) => b != 0 ).filter(i => \n (queryConArr[0] != \"\" \n && i.children[0].innerText != queryConArr[0])\n ||\n (i.children[4].innerText.search(queryConArr[1]) == -1)\n ||\n (i.children[2].innerText != queryConArr[2])\n ).forEach(i => i.parentNode.removeChild(i));\n}",
"title": ""
},
{
"docid": "0edd8ef27414b0bf21f936bfddbce506",
"score": "0.4953788",
"text": "function removeGridElements(){\n let items = document.querySelectorAll('.item');\n items.forEach(element => element.remove());\n}",
"title": ""
}
] |
f997eaa041ddf11dd7d2c79d17ca6e45 | Collision Detection bullets Detection | [
{
"docid": "1035acc6d602f9c29e1d94e5e9b1589f",
"score": "0.7695894",
"text": "function bulletDetection() {\n for (let i = 0; i < playerBullets.length; i++) {\n if (playerBullets[i].isPlayer) {\n let pBullet = playerBullets[i];\n for (let j = 0; j < Enemies.length; j++) {\n let e = Enemies[j];\n if (\n pBullet.x + pBullet.width / 2 >= e.positionX - e.width / 2 &&\n pBullet.x - pBullet.width / 2 <= e.positionX + e.width / 2 &&\n pBullet.y >= e.positionY - e.height * 2 &&\n pBullet.y <= e.positionY + e.height\n ) {\n score++;\n Enemies.splice(j, 1);\n playerBullets.splice(i, 1);\n }\n }\n }\n }\n}",
"title": ""
}
] | [
{
"docid": "6a8a96f2601918822034a7a9942eca24",
"score": "0.8142081",
"text": "checkBulletCollide() {\r\n for(let b of bullets) {\r\n if(p.collideCircleCircle( this.x, this.y, this.r, b.getX(), b.getY(), b.getR() )) {\r\n this.isHit = true;\r\n\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "5e4c5e09251536780ad09a14ce9e7986",
"score": "0.8067406",
"text": "function collisionDetection() {\n bullets.forEach((bullet, b) => {\n if (b === 0) {\n nul = null;\n } else {\n cats.forEach((cat, c) => {\n if (c === 0) {\n nul = null;\n } else {\n const bulletX = bullet.getPosition().x;\n const bulletY = bullet.getPosition().y;\n const catX = cat.getPosition().x;\n const catY = cat.getPosition().y;\n if (bulletX < catX + 100 &&\n bulletX + 15 > catX &&\n bulletY < catY + 59 &&\n 30 + bulletY > catY) {\n bullet.removeBullet();\n bullets.splice(b, 1);\n cat.removeCat();\n cats.splice(c, 1);\n $('#scores').html($('#scores').html() - (-5));\n }\n }\n });\n }\n });\n }",
"title": ""
},
{
"docid": "0190579b7849ae939d482da549d46e23",
"score": "0.79459965",
"text": "function bulletCollision(_a) {\n var hitObject = _a.hitObject, mainGameObject = _a.mainGameObject;\n if (this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"enemy\" && hitObject.objectOwner == \"player\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"player\" && hitObject.objectOwner == \"enemy\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"enemy\" && hitObject.objectOwner == \"hangar\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"hangar\" && hitObject.objectOwner == \"enemy\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"enemy\" && hitObject.objectOwner == \"hangarbullet\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"hangarbullet\" && hitObject.objectOwner == \"enemy\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"player\" && hitObject.objectOwner == \"environment\" && hitObject.hasOwnProperty('healthPoint') ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"enemy\" && hitObject.objectOwner == \"environment\" && hitObject.hasOwnProperty('healthPoint') ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"player\" && hitObject.objectOwner == \"collide\" && hitObject.hasOwnProperty('healthPoint') ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"enemy\" && hitObject.objectOwner == \"collide\" && hitObject.hasOwnProperty('healthPoint')) {\n gameSideObjectsModule_1.explosionFire({\n targetData: this,\n mainGameObject: mainGameObject,\n hitObject: hitObject,\n SideObject: constructors.SideObject,\n explosion: \"explosion\"\n });\n if (this.type === \"nuclear_blast\" || this.type === \"defence_shield\") {\n return false;\n }\n ;\n this.objectPresent = false;\n return true;\n }\n return true;\n}",
"title": ""
},
{
"docid": "43ec94372d6e08e589b9c614c6d20bab",
"score": "0.7527698",
"text": "CheckBulletEnemyCollision() {\n let enemies_to_remove = [];\n let bullets_to_remove = [];\n for (let i = 0; i < this.bullets_.length; i++) {\n for (let j = 0; j < this.enemies_.length; j++) {\n const enemy_check = this.enemies_[j].enemy_box;\n if (\n enemy_check.intersectsBox(this.bullets_[i].bullet_box)\n ) {\n enemies_to_remove.push(j);\n bullets_to_remove.push(i);\n }\n }\n }\n for (let i of enemies_to_remove) {\n if (this.enemies_[i])\n this.SpawnStar_(0.01, 0.0, this.enemies_[i].position);\n this.RemoveEnemy(i);\n }\n for (let i of bullets_to_remove) this.RemoveBullet(i);\n }",
"title": ""
},
{
"docid": "78c1792e15a67fdb6cb755d4811c2415",
"score": "0.75202435",
"text": "function bulletLogic(){\n if(bulletLoader === 5){\n bullet = true;\n bulletLoader = 0;\n fireBulletText.style.display = \"block\";\n fireBulletText.innerText = \"Press space bar to fire!\";\n }\n\n if(bulletFired){\n bulletObj = new Bullet();\n bulletObj.bulletInit(canvas, playerObj.positionX);\n bulletFired = false;\n bulletMoving = true;\n }\n\n if(bulletMoving){\n if(bulletObj.positionY >= -bulletObj.sizeY){\n bulletObj.drawBullet(ctx, allAssets[7]);\n (bulletObj.collision(vehicles)) ? bulletMoving = false : 1;\n } else {\n bulletMoving = false;\n }\n }\n}",
"title": ""
},
{
"docid": "cb931682bc59af64741f5ade0cc968ce",
"score": "0.74515307",
"text": "function bulletColliderCheck(){\n var Collider = getBulletCollider();\n if(lost != true){\n if(playerTurn==1&&Collider!=null){\n if(Collider.getColor()==Color.black){\n remove(bullet);\n bulletShot = false;\n wind=Randomizer.nextInt(1,75);\n updateWind();\n canShoot = true;\n playerTurn = 2;\n editPillar();\n return;\n \n }\n if(Collider.getColor() == player2Color||Collider.getColor()==\"#696969\"){\n remove(bullet);\n removeLives();\n playerTurn=2;\n bulletShot=false;\n wind=Randomizer.nextInt(0,75);\n updateWind();\n canShoot = true;\n editPillar();\n return;\n }\n \n }\n if(playerTurn ==2 && Collider !=null){\n if(Collider.getColor() == player1Color){\n remove(bullet);\n removeLives();\n playerTurn=1;\n bulletShot=false;\n wind=Randomizer.nextInt(0,75);\n updateWind();\n canShoot = true;\n editPillar();\n return;\n }\n if(Collider.getColor()== Color.black||Collider.getColor()==\"#696969\"){\n remove(bullet);\n playerTurn =1;\n bulletShot = false;\n wind=Randomizer.nextInt(0,75);\n updateWind();\n canShoot = true;\n editPillar();\n return;\n }\n }\n }\n}",
"title": ""
},
{
"docid": "1a39d1be0c65e7e289568342a551b8d7",
"score": "0.7448322",
"text": "function groundBulletCollision(_a) {\n var hitObject = _a.hitObject, mainGameObject = _a.mainGameObject;\n if (!hitObject.objectPresent && hitObject.objectOwner)\n return false;\n if (this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"groundEnemyBullet\" && hitObject.objectOwner == \"groundPlayer\") {\n // if(this.details.type == \"hidden_enemy_spawner\" && hitObject.objectOwner == \"groundEnemy\") return false\n return bulletExplosion.call(this);\n }\n if (!mainGameObject.gameInitData.dynamicLevelsActive || !hitObject.details && hitObject.objectOwner != \"groundEnemy\" || !hitObject.details && hitObject.objectOwner != \"groundNPC\" ||\n !hitObject.details && hitObject.objectOwner != \"groundEnemyBullet\")\n return true;\n if (this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"player\" && hitObject.details.collision ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"player\" && hitObject.objectOwner == \"groundEnemy\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"groundEnemyBullet\" && hitObject.details.collision && hitObject.objectOwner != \"groundEnemy\" ||\n this.objectPresent && this.hasOwnProperty('bulletType') && this.objectOwner == \"groundEnemyBullet\" && hitObject.objectOwner == \"groundNPC\") { // groundNPC\n if (hitObject.details) {\n if (hitObject.details.type == \"hidden_enemy_spawner\" && hitObject.objectOwner == \"groundEnemy\"\n && this.objectOwner == \"groundEnemyBullet\")\n return false;\n //console.log(1, hitObject.details.type, hitObject.objectOwner, this.objectOwner)\n }\n return bulletExplosion.call(this);\n }\n return true;\n function bulletExplosion() {\n gameSideObjectsModule_1.explosionFire({\n targetData: this,\n mainGameObject: mainGameObject,\n hitObject: hitObject,\n SideObject: constructors.SideObject,\n explosion: \"explosion\"\n });\n if (hitObject.objectOwner == \"groundEnemy\" || hitObject.objectOwner == \"groundNPC\") {\n hitObject.currentBehavior = (hitObject.currentBehavior === \"static\") ? \"static\" : \"destroy\";\n //hitObject.playerInRange = true;\n var angleFinder_1 = this.degree - 180;\n if (hitObject.details.role != \"military\" && hitObject.objectOwner != \"groundEnemy\") {\n hitObject.playerDirectionHorizontal = (angleFinder_1 > 90 && angleFinder_1 < 270) ? 'left' : 'right';\n hitObject.currentBehavior = (hitObject.currentBehavior === \"static\") ? \"static\" : \"patrol\";\n }\n else {\n hitObject.currentBehavior = (hitObject.currentBehavior === \"static\") ? \"static\" : \"destroy\";\n hitObject.playerInRange = true;\n hitObject.playerDirectionHorizontal = (angleFinder_1 > 90 && angleFinder_1 < 270) ? 'right' : 'leftt';\n hitObject.targetAngle = (Math.sign(angleFinder_1) < 0) ? 360 + angleFinder_1 : angleFinder_1;\n }\n }\n ;\n this.objectPresent = false;\n return true;\n }\n}",
"title": ""
},
{
"docid": "20df310c06c8bf5d1089ef81b09c32b7",
"score": "0.7390117",
"text": "function bullletToBulletCollision() {\n for (i = 0; i < weapons.length; i++) {\n for (j = 0; j < enemyWeapon.length; j++) {\n if (\n enemyWeapon[j].top + 15 >= weapons[i].top &&\n enemyWeapon[j].top <= weapons[i].top + 15 &&\n enemyWeapon[j].left + 42 >= weapons[i].left &&\n enemyWeapon[j].left <= weapons[i].left + 42\n ) {\n bullets++;\n Bullet_collision.play();\n enemyWeapon.splice(j, 1);\n weapons.splice(i, 1);\n score += 5;\n break;\n }\n }\n }\n}",
"title": ""
},
{
"docid": "5e21bced95454e1c7eb43576048a8f4c",
"score": "0.73740256",
"text": "function checkCollision(){\n var xDifference;\n var yDifference;\n for(var i = 0; i < window.bullets.length; i++){\n for(var n = 0; n < window.dancers.length; n++){\n xDifference = $(window.bullets[i].$node).position().left - $(window.dancers[n].$node).position().left;\n yDifference = $(window.bullets[i].$node).position().top - $(window.dancers[n].$node).position().top;\n if(Math.abs(xDifference) < 20 && Math.abs(yDifference) < 20){\n window.bullets[i].used = true;\n window.dancers[n].killed = true;\n if(window.dancers[n] === window.fred && window.fred.durability > 0) {\n window.fred.killed = false;\n window.fred.durability--;\n console.log(\"Fred has been wounded\");\n }\n break;\n }\n }\n }\n if(window.player){\n for(var s = 1; s < window.dancers.length; s++){\n xDifference = window.player.xPos - window.dancers[s].$node.position().left;\n yDifference = window.player.yPos - window.dancers[s].$node.position().top;\n if(Math.abs(xDifference) < 40 && Math.abs(yDifference) < 20){\n console.log(\"Player should be dead\");\n window.player.killed = true;\n break;\n }\n }\n }\n}",
"title": ""
},
{
"docid": "72bedd837e20a151f1c6a9c6c79dfe8b",
"score": "0.73287195",
"text": "function checkBulletCollisions() {\n var hit = false;\n\n for (var i = 0; i < myShip.bullets.length; i++) {\n if (myShip.bullets[i].active) {\n for (var j = 0; j < asteroids.length; j++) {\n\n // collide functions return a bool whether these objects are colliding\n hit = collideCircleCircle(\n asteroids[j].position.x, asteroids[j].position.y,\n asteroids[j].diameter,\n myShip.bullets[i].position.x, myShip.bullets[i].position.y,\n myShip.bullets[i].diameter\n )\n if (hit) {\n explodeAsteroid(j);\n game.addScore(100 + asteroids[j].diameter - asteroids[j].diameter%20);\n hit = false;\n var size = '';\n if (asteroids[j].diameter > 233) size = 'Large';\n else if (asteroids[j].diameter > 166) size = 'Medium';\n else size = 'Small';\n playHitSound(size);\n // remove bullet so it doesn't hit another\n myShip.bullets[i].active = false;\n break;\n }\n }\n }\n }\n}",
"title": ""
},
{
"docid": "83cff957bc9d7ce82c37620422a21597",
"score": "0.7210981",
"text": "function checkBullets() {\n let bullet1 = 0;\n for (let index = 0; index < bullets.size(); index++) {\n let bullet = bullets.get(index);\n if(bullet.position.y < 0){\n bullet.remove();\n \n }\n if(bullet.overlap(enemies)){\n bullet1 = bullet;\n \n }\n \n }\n for (let index = 0; index < enemies.size(); index++) {\n let enemyCheck = enemies.get(index);\n if(enemyCheck.overlap(bullets)){\n enemyCheck.remove();\n destroyedSound.play();\n destroyedSound.setVolume(0.2);\n if(bullet1 != 0){\n bullet1.remove();\n\n }\n \n enemiesDead++;\n if(!(enemiesDead == 0 && shotsUsed == 0)){perfectScore = (enemiesDead/shotsUsed) *100 ;}\n \n perfectScore = round(perfectScore);\n scoreForEnemies = 100 * perfectScore/100;\n score += scoreForEnemies;\n \n }\n \n }\n if(enemies.size() == 0){allDead = true}\n \n}",
"title": ""
},
{
"docid": "c14978fa890125446cc3feb5aff1fb9e",
"score": "0.71626556",
"text": "function bulletWall() {\r\n if(!settings.bossTime && !settings.gameOverVictory && settings.bulletArray.length !== 0)\r\n // Bullet collision detection for normal monsters\r\n for(var i=0;i<settings.monsterObjArray.length;i++) {\r\n var bulletRect = null;\r\n bossElement = document.getElementById('iglor');\r\n // loop through bullet array and get the bullets and perform collision detection check between bullets and monsters\r\n for(var j=0;j<settings.bulletArray.length;j++) {\r\n settings.bulletArray = document.getElementsByClassName('bullet');\r\n bulletRect = settings.bulletArray[j].getBoundingClientRect();\r\n\r\n // Collision detection between bullet and monster\r\n if(parseInt(settings.monsterArray[i].style.left) <= bulletRect.right){ //collision conditional\r\n $(settings.bulletArray[j]).remove();\r\n settings.bulletMoving = false;\r\n bulletHitMonster = true;\r\n }\r\n } // End of for loop for bullets hitting monsters\r\n\r\n // when bullets have collided and reduce monster HP\r\n if(bulletHitMonster){\r\n settings.monsterObjArray[i].monsterHP -= settings.bulletDamage;\r\n bulletHitMonster = false;\r\n if(settings.monsterObjArray[i].monsterHP <= 0) {\r\n settings.monsterObjArray.splice(i,1);\r\n $(settings.monsterArray[i]).remove();\r\n settings.killCount++;\r\n settings.currentScore += 10;\r\n }\r\n }\r\n\r\n } // End of bullet/monsters for loop\r\n\r\n if(settings.bossTime && settings.bulletArray.length !== 0) {\r\n // loop through bullet array and get the bullets and perform collision detection check between bullets and boss\r\n for(var j=0;j<settings.bulletArray.length;j++) {\r\n bossElement = document.getElementById('iglor');\r\n settings.bulletArray = document.getElementsByClassName('bullet');\r\n bulletRect = settings.bulletArray[j].getBoundingClientRect();\r\n\r\n if(parseInt(bossElement.style.left) <= bulletRect.right) {\r\n $(settings.bulletArray[j]).remove();\r\n settings.bulletMoving = false;\r\n bulletHitBoss = true;\r\n }\r\n } // End of for loop for bullets hitting Boss\r\n\r\n if(bulletHitBoss) {\r\n console.log(\"Remaining Boss HP: \", settings.bossHP);\r\n settings.bossHP -= settings.bulletDamage;\r\n bulletHitBoss = false;\r\n if(settings.bossHP <= 0) {\r\n $('#iglor').remove();\r\n settings.killCount++;\r\n settings.currentScore += 100;\r\n settings.gameOverVictory = true;\r\n }\r\n }\r\n }\r\n } // End of bulletWall",
"title": ""
},
{
"docid": "5c861aeed5d19154cfb1e942980df4dc",
"score": "0.7123015",
"text": "function checkCollision() {\r\n \r\n for (var indexr = 0; indexr < enemies.length; indexr++ ) {\r\n \r\n var enemyLocation = createVector(enemies[indexr].x, enemies[indexr].y, 0);\r\n var bulletLocation = createVector()\r\n var playerLocation = createVector(player.x, player.y, 0);\r\n \r\n\r\n if(enemyLocation.dist(playerLocation) <= 50) {\r\n \r\n isDead = true;\r\n \r\n }\r\n \r\n }\r\n}",
"title": ""
},
{
"docid": "fd4ee1e910cd73fc1c3139d4f0dbab70",
"score": "0.710302",
"text": "function bullet_loop() {\n for (let i = 0; i < bullets.length; i++) {\n //go through each bullet and transform it/check for collision\n cbul = bullets[i];\n cbul.colbox[0] += cos(cbul.dir) * cbul.speed;\n cbul.colbox[1] += sin(cbul.dir) * cbul.speed;\n\n push();\n translate(cbul.colbox[0], cbul.colbox[1], 80);\n box(cbul.colbox[2], cbul.colbox[3], 20);\n pop();\n\n //delete offscreen bullets and hit bullets \n for (let k = 0; k < enemies.length; k++) {\n let enemybox = enemies[k].colbox;\n if (collides(cbul.colbox, enemybox)) {\n bullets.splice(i, 1);\n enemies.splice(k, 1);\n i--;\n break;\n }\n }\n if (cbul.colbox[1] < -height / 2) {\n bullets.splice(i, 1);\n i--;\n }\n }\n}",
"title": ""
},
{
"docid": "03111bb8a2a66cc237e83eb84276d3b3",
"score": "0.70695347",
"text": "function bulletImpact(bullet, index) {\n var x = bullet.x;\n var y = bullet.y;\n \n var liveBullet = true;\n \n for(var i = 0; i < enemies.length; i++) {\n var square = enemies[i];\n if(Math.abs(square.x - x) <= square.size / 2 && Math.abs(square.y - y) <= square.size / 2) {\n square.live = false;\n \n // Bullet's no longer alive!\n bullet.live = false;\n liveBullet = false;\n break;\n }\n }\n \n // Check if it's hit us.\n if(liveBullet) {\n if(Math.abs(x - ball.x) <= ball.size && Math.abs(y - ball.y) <= ball.size) {\n playerDeath();\n bullet.live = false;\n }\n }\n \n}",
"title": ""
},
{
"docid": "4de1023d524a1ed8d565f8956b4b18df",
"score": "0.70333284",
"text": "Update() {\r\n\r\n //Add velocity to the bullet's position\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n\r\n\r\n //If the bullet goes out the top of the canvas\r\n if (this.y - this.height / 2 < -200) {\r\n //Delete it\r\n delete bullets[this.index];\r\n }\r\n\r\n //If the bullet goes out the right of the canvas\r\n if (this.x - this.width / 2 > playWidth) {\r\n\r\n //Delete it\r\n delete bullets[this.index];\r\n }\r\n\r\n //If the bullet goes out the left of the canvas\r\n if (this.x + this.width / 2 < 0) {\r\n\r\n //Delete it\r\n delete bullets[this.index];\r\n }\r\n\r\n //Loop throught every block in the blocks array\r\n for (var i = 0; i < blocks.length; i++) {\r\n\r\n //Skip if the block is null\r\n if (blocks[i] == null) {\r\n continue;\r\n }\r\n\r\n //If the bullet intersects with any blocks this frame\r\n if (!((this.y - this.height / 2 >= blocks[i].y + blocks[i].height / 2) ||\r\n (this.y + this.height / 2 <= blocks[i].y - blocks[i].height / 2) ||\r\n (this.x - this.width / 2 >= blocks[i].x + blocks[i].width / 2) ||\r\n (this.x + this.width / 2 <= blocks[i].x - blocks[i].width / 2))) {\r\n\r\n //Tell the block it was hit\r\n blocks[i].Hit(this);\r\n\r\n //Delete this bullet\r\n if (this.charge <= 50) {\r\n delete bullets[this.index];\r\n }\r\n else {\r\n this.charge -= 20;\r\n }\r\n }\r\n }\r\n\r\n //If friendly fire is on\r\n if (friendlyFire) {\r\n\r\n //Loop through all the players\r\n for (var i = 0; i < players.length; i++) {\r\n\r\n //If the bullet intersects with any players this frame\r\n if (!((this.y - this.height / 2 >= players[i].y + players[i].height / 2) ||\r\n (this.y + this.height / 2 <= players[i].y - players[i].height / 2) ||\r\n (this.x - this.width / 2 >= players[i].x + players[i].width / 2) ||\r\n (this.x + this.width / 2 <= players[i].x - players[i].width / 2))) {\r\n\r\n //Tell the player they were hit\r\n players[i].Hit();\r\n\r\n //Transfer this bullets velocity to the player\r\n players[i].vx += this.vx;\r\n players[i].vy += this.vy;\r\n\r\n //Delete this bullet\r\n if (this.charge <= 50) {\r\n delete bullets[this.index];\r\n }\r\n else {\r\n this.charge -= 20;\r\n }\r\n }\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "8332b07019d179a58881a1f18ccaf2d7",
"score": "0.7028575",
"text": "collision(a, b) {\n a.forEach((bullet, bulletIndex) => {\n b.forEach((invader, index) => {\n if (this.collisionDetector(invader, bullet)) {\n this.points += 1;\n this.theInvaderCounter -= 1;\n b.splice(index, 1);\n a.splice(bulletIndex, 1);\n this.player1.invaderShotSound();\n this.levelIncrease()\n }\n })\n })\n }",
"title": ""
},
{
"docid": "a2c649f8c49b486f3b9aa8e24487c5bb",
"score": "0.7016818",
"text": "function isBullet_Clash_obstacle(){\r\n for(let j in stages.obstacles){ \r\n for(let i in rocket1.bullet){\r\n if((rocket1.bullet[i].y>=stages.obstacles[j].y&&rocket1.bullet[i].y<=stages.obstacles[j].y+stages.obstacles[j].height)&&rocket1.bullet[i].x+40>=stages.obstacles[j].x && rocket1.bullet[i].x<=stages.obstacles[j].x){\r\n soundDestroy();\r\n drawBlast(imageBlast, stages.obstacles[j].x+10,stages.obstacles[j].y,stages.obstacles[j].width+20,stages.obstacles[j].height+20);\r\n stages.obstacles[j].x=-100;\r\n rocket1.bullet[i].x=context1.width+10;\r\n score+=10;\r\n }\r\n }\r\n } \r\n }",
"title": ""
},
{
"docid": "d69a886728f509cb28e2412792f61949",
"score": "0.701486",
"text": "function invaderBulletShipCollision() {\n if (collideRectRect(\n invaderBullet.xpos,\n invaderBullet.ypos,\n invaderBullet.width,\n invaderBullet.height,\n player.xpos,\n player.ypos,\n player.width,\n player.height\n )) {\n player.kill();\n }\n}",
"title": ""
},
{
"docid": "81219c09a32719bbf8b853be0fdf4609",
"score": "0.7006987",
"text": "function Bullet( _screenSizes, _parent, _player )\n {\n DE.GameObject.call( this, {\n \"x\": _parent.position.x, \"y\": _parent.position.y, \"zindex\": _parent.zindex + 1\n , \"tag\": _parent.tag == \"player\" ? \"b-p\" : \"b-e\"\n , \"renderer\": new DE.SpriteRenderer( { \"spriteName\": ( _parent.tag == \"player\" ? \"p\" : \"e\" ) + \"-fire\"\n , \"scale\": 0.7 } )\n , \"collider\": new DE.CircleCollider( 30 )\n } );\n this.vector = { x: 0, y: 0 };\n \n if ( _parent.tag == \"player\" )\n {\n this.vector.y = -10;\n this.position.y -= 50;\n this.tag = \"p-bullet\";\n this.renderers[ 0 ].onAnimEnd = function()\n {\n this.startFrame = 8;\n this.isLoop = true;\n this.restartAnim();\n }\n }\n else\n {\n this.position.y += datas.enemies[ _parent.name ].bulletOffset;\n this.vector.y = 10;\n this.tag = \"e-bullet\";\n }\n \n this.gameLogic = function()\n {\n this.translate( this.vector );\n \n if ( this.position.y < -50 || this.position.y > _screenSizes.h + 50 )\n this.askToKill();\n \n if ( _player )\n {\n if ( _player.enable && !_player.flipping\n && DE.CollisionSystem.circleCollision( this.collider, _player.collider ) )\n {\n this.askToKill();\n _player.getDamage();\n }\n }\n else\n {\n // player bullets, checking collisions with all objects in the scene\n var gos = this.scene.gameObjects;\n for ( var n = 0, t = gos.length, g; n < t; ++n )\n {\n g = gos[ n ];\n if ( g.tag == \"enemy\" && DE.CollisionSystem.circleCollision( this.collider, g.collider ) )\n {\n g.getDamage();\n this.askToKill();\n return;\n }\n }\n }\n }\n \n this.addAutomatism( \"logic\", \"gameLogic\" );\n }",
"title": ""
},
{
"docid": "fa8f64626b8dca1baaf1b6f8a22e938d",
"score": "0.7000399",
"text": "function bulletCollide (bullet, layer) {\n bullet.kill();\n}",
"title": ""
},
{
"docid": "9549f56f6607d023dcd24f2b7539e8ab",
"score": "0.69776225",
"text": "function checkCollisions () {\n\n var i = 0;\n var p = 0;\n if (playerList[0].bottomOf > lootBagList) {};\n\n //Player bullets\n for (var k = 0; k < bulletList.length; k++) {\n //Map and bullet\n if (!(bulletList[i].bottomOf() > mapBorder[topOf] && bulletList[i].topOf() < mapBorder[bottomOf] && bulletList[i].leftSide() < mapBorder[right] && bulletList[i].rightSide() > mapBorder[left])) {\n\n bulletList.splice(i, 1);\n i--;\n\n };\n //Enemies and bullet\n for (var j = 0; j < enemyList.length; j++) {\n\n if (i >= 0 && bulletList[i].bottomOf() > enemyList[j].topOf() && bulletList[i].topOf() < enemyList[j].bottomOf() && bulletList[i].leftSide() < enemyList[j].rightSide() && bulletList[i].rightSide() > enemyList[j].leftSide()) {\n\n enemyList[j].HP = enemyList[j].HP - bulletList[i].damage;\n damageNumberList.push([bulletList[i].damage.toFixed(0), enemyList[j].Xpos, enemyList[j].Ypos - 10, 0, j]);\n bulletList.splice(i, 1);\n i--;\n\n if (enemyList[j].HP < 1) {\n\n enemyList[j].dropLoot();\n enemyList.splice(j, 1);\n killCount++;\n if (playerList[0].EXP >= playerList[0].levelExpReq && playerList[0].level < 50) { playerList[0].levelUP(); };\n playerList[0].glory = playerList[0].EXP / 2000;\n j--;\n\n };\n };\n };\n i++;\n };\n //Enemy Bullets\n for (var k = 0; k < enemyBulletList.length; k++) {\n //Map and enemy bullet\n if (!(enemyBulletList[p].bottomOf() > mapBorder[topOf] && enemyBulletList[p].topOf() < mapBorder[bottomOf] && enemyBulletList[p].leftSide() < mapBorder[right] && enemyBulletList[p].rightSide() > mapBorder[left])) {\n\n enemyBulletList.splice(p, 1);\n p--;\n\n };\n //Players and enemy bullet\n for (var j = 0; j < playerList.length; j++) {\n\n if (p >= 0 && enemyBulletList[p].bottomOf() > playerList[j].topOf() && enemyBulletList[p].topOf() < playerList[j].bottomOf() && enemyBulletList[p].leftSide() < playerList[j].rightSide() && enemyBulletList[p].rightSide() > playerList[j].leftSide()) {\n\n playerList[j].HP = playerList[j].HP - enemyBulletList[p].damage;\n playerDamageNumberList.push([enemyBulletList[p].damage, playerList[j].Xpos, playerList[j].Ypos - 10, 0, j]);\n enemyBulletList.splice(p, 1);\n p--;\n\n if (playerList[j].HP <= 0) { playerList[j].deathScene(); };\n\n };\n };\n p++;\n };\n}",
"title": ""
},
{
"docid": "638f7b049a3c22b393bc1b642e43dfb5",
"score": "0.69089264",
"text": "static forEachBullet() {\n const context = GameState.current;\n const pool = GroupPool.bullet();\n\n pool.forEach(context, Helper.checkSpritePosition);\n pool.members.map((member) => {\n CollisionDelection.bulletCollideWithCube(member);\n CollisionDelection.bulletCollideWithCircle(member);\n CollisionDelection.bulletCollideWithCylinder(member);\n CollisionDelection.bulletCollideWithRhombus(member);\n CollisionDelection.bulletCollideWithRhombusSplinter(member);\n });\n }",
"title": ""
},
{
"docid": "9fca6cfebc2492a35d5d297f8a4a26e5",
"score": "0.6906605",
"text": "function bulletHitObject()\n{\n\tconsole.log(\"Hit!\");\n}",
"title": ""
},
{
"docid": "ec2f871e869facc184cd3e119848dd9c",
"score": "0.6902306",
"text": "_CheckCollision(bullet_pos, player_pos){\n\t\tvar x1 = bullet_pos.x;\n\t\tvar y1 = bullet_pos.y;\n\t\tvar r1 = 5;\n\t\tvar x2 = player_pos.x;\n\t\tvar y2 = player_pos.y;\n\t\tvar r2 = 50;\n\t\treturn Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) <= Math.pow(r1 + r2, 2)\n\t}",
"title": ""
},
{
"docid": "3bbdc575e0c3d5ef9df2f3a239ae7cb9",
"score": "0.6899204",
"text": "collide(obj) {\n // Implement the behavior of collision here\n }",
"title": ""
},
{
"docid": "5156bdc3f733def0076c366d2b02158f",
"score": "0.689036",
"text": "collision(enemy_list) {\n var self = this;\n // this is just a simple version NEED TO IMPROVE\n if (this.getNorm(this.target.position.x, this.target.position.y) <= 15) {\n // set debuff\n this.target.addDebuff(this.debuff);\n\n // if it is a fire bullet, explode (hit every enemies in exlposion range)\n if (this.type == towerType.FIRE) {\n //console.log(\"explode!!!!!!!!!!!!!!!\");\n enemy_list.forEach(function(enemy) {\n if (self.getNorm(enemy.position.x, enemy.position.y) <= self.type[9] && enemy.health > 0) {\n enemy.setHealth(self.damage);\n }\n });\n return true;\n }\n\n // reduce target's health\n this.target.setHealth(this.damage);\n //console.log(\"hit!!!: health = \", this.target.health);\n \n return true;\n }\n return false;\n }",
"title": ""
},
{
"docid": "5280b7491cedf2f577697bed62854dc4",
"score": "0.68875635",
"text": "function detect_tankBulletCollision(){\n\nconsole.log(Math.pow(other_center_x[1]-ammo[bulletcount-1].x,2) + Math.pow(other_center_y[1]-ammo[bulletcount-1].y,2) + \" \" + myID + \"dtbc\");\n\nif(Math.pow(other_center_x[0]-ammo[bulletcount-1].x,2) + Math.pow(other_center_y[0]-ammo[bulletcount-1].y,2) <= 900 && myID != 0){\n return true;\n}\nelse if(Math.pow(other_center_x[1]-ammo[bulletcount-1].x,2) + Math.pow(other_center_y[1]-ammo[bulletcount-1].y,2) <= 900 && myID != 1){\n return true;\n}\nelse if(Math.pow(other_center_x[2]-ammo[bulletcount-1].x,2) + Math.pow(other_center_y[2]-ammo[bulletcount-1].y,2) <= 900 && myID != 2){\n return true;\n}\nelse if(Math.pow(other_center_x[3]-ammo[bulletcount-1].x,2) + Math.pow(other_center_y[3]-ammo[bulletcount-1].y,2) <= 900 && myID != 3){\n return true;\n}\nelse{\n return false;\n}\n}",
"title": ""
},
{
"docid": "8bcc38ed7e2311cc2f1eb7e739634862",
"score": "0.6882423",
"text": "function updateBullets() {\n for (let i = bullets.length - 1; i >= 0; i--) {\n if (bullets[i].x < 0 || bullets[i].x > width/1.5 ||\n bullets[i].y < 0 || bullets[i].y > height/1.5) {\n bullets.splice(i, 1);\n }\n else {\n for (let j = 0; j < 10; j ++){\n for (let g = 0; g < enemies.length; g++){\n enemies[g].didHit(g)\n\n }\n bullets[i].x += bullets[i].speed * cos(bullets[i].angle);\n bullets[i].y += bullets[i].speed * sin(bullets[i].angle);\n }\n circle(bullets[i].x, bullets[i].y, bullets[i].radius);\n }\n }\n }",
"title": ""
},
{
"docid": "2ce1ab59c8eac80af3961cc774eae446",
"score": "0.6870893",
"text": "handleCollisions () {\n\t\tvar v = new Vector( 0, 0 );\n\n\t\tvar dragCircle = this.draggedCircle;\n\t\tvar circleList = this.allCircles;\n\t\tvar circleCount = circleList.length;\n\n\t\t// Collide circles\n\t\tfor ( var n = 0; n < this.numberOfCollisionPasses; n++ ) {\n\t\t\tfor ( var i = 0; i < circleCount; i++ ) {\n\t\t\t\tvar circleA = circleList[i];\n\t\t\t\t\n\t\t\t\tfor ( var j = i + 1; j < circleCount; j++ ) {\n\t\t\t\t\tvar circleB = circleList[j];\n\n\t\t\t\t\tconst isCircleAPinned = this.isCirclePinned( circleA.id );\n\t\t\t\t\tconst isCircleBPinned = this.isCirclePinned( circleB.id );\n\n\t\t\t\t\t// Kinematic circles can't be pushed around.\n\t\t\t\t\tconst isCircleAKinematic = circleA === dragCircle || isCircleAPinned;\n\t\t\t\t\tconst isCircleBKinematic = circleB === dragCircle || isCircleBPinned;\n\t\t\t\t\t\n\t\t\t\t\tif (\n\t\t\t\t\t\t// It's us!\n\t\t\t\t\t\tcircleA === circleB ||\n\n\t\t\t\t\t\t// Kinematic circles don't interact with eachother\n\t\t\t\t\t\t( isCircleAKinematic && isCircleBKinematic )\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue; \n\t\t\t\t\t}\n\n\t\t\t\t\tvar dx = circleB.position.x - circleA.position.x;\n\t\t\t\t\tvar dy = circleB.position.y - circleA.position.y;\n\n\t\t\t\t\t// The distance between the two circles radii, \n\t\t\t\t\t// but we're also gonna pad it a tiny bit \n\t\t\t\t\tvar r = ( circleA.radius + circleB.radius ) * 1.08;\n\t\t\t\t\tvar d = circleA.position.distanceSquared( circleB.position );\n\n\t\t\t\t\tif ( d < ( r * r ) - 0.02 ) {\n\t\t\t\t\t\tv.x = dx;\n\t\t\t\t\t\tv.y = dy;\n\t\t\t\t\t\tv.normalize();\n\n\t\t\t\t\t\tvar inverseForce = ( r - Math.sqrt( d ) ) * 0.5;\n\t\t\t\t\t\tv.mul( inverseForce );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( ! isCircleBKinematic ) {\n\t\t\t\t\t\t\tif ( isCircleAKinematic ) {\n\t\t\t\t\t\t\t\t// Double inverse force to make up \n\t\t\t\t\t\t\t\t// for the fact that the other object is fixed\n\t\t\t\t\t\t\t\tv.mul( 2.2 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcircleB.position.x += v.x;\n\t\t\t\t\t\t\tcircleB.position.y += v.y;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! isCircleAKinematic ) {\n\t\t\t\t\t\t\tif ( isCircleBKinematic ) {\n\t\t\t\t\t\t\t\t// Double inverse force to make up \n\t\t\t\t\t\t\t\t// for the fact that the other object is fixed\n\t\t\t\t\t\t\t\tv.mul( 2.2 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcircleA.position.x -= v.x;\n\t\t\t\t\t\t\tcircleA.position.y -= v.y;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"title": ""
},
{
"docid": "93a8049c2cab0cdb0d659baf621ce0d8",
"score": "0.6863794",
"text": "function detectCollision(){\n for(let i = 0; i < bullets.length; i++){\n if(Math.abs(bullets[i].x - bosses.x) < 1000 && Math.abs(bullets[i].y - bosses.y) < 450 && bossAttack == true){\n explosionBoss = [bullets[i].x , bullets[i].y];\n bullets[i] = bullets[bullets.length-1];\n explosions.push({x: explosionBoss[0] , y: explosionBoss[1]});\n displayExplosions();\n endExplosions();\n bullets.pop();\n bosses.health = bosses.health - 3;\n if(bosses.health <= 0){\n bossAttack = false;\n explosions.push({x: bosses.x, y: bosses.y + 100});\n explosions.push({x: bosses.x + 200, y: bosses.y + 100});\n explosions.push({x: bosses.x, y: bosses.y + 100});\n explosions.push({x: bosses.x + 300, y: bosses.y + 50});\n explosions.push({x: bosses.x + 500, y: bosses.y + 600});\n explosions.push({x: bosses.x + 600, y: bosses.y});\n explosions.push({x: bosses.x + 400, y: bosses.y + 300});\n explosions.push({x: bosses.x + 350, y: bosses.y + 500});\n explosions.push({x: bosses.x + 400, y: bosses.y + 500});\n explosions.push({x: bosses.x + 300, y: bosses.y + 300});\n explosions.push({x: bosses.x + 200, y: bosses.y + 400});\n explosions.push({x: bosses.x + 100, y: bosses.y + 200});\n explosions.push({x: bosses.x + 800, y: bosses.y + 300});\n explosions.push({x: bosses.x + 400, y: bosses.y});\n explosions.push({x: bosses.x + 600, y: bosses.y + 500});\n explosions.push({x: bosses.x + 900, y: bosses.y + 400});\n explosions.push({x: bosses.x + 500, y: bosses.y + 350});\n explosions.push({x: bosses.x + 500, y: bosses.y + 400});\n explosions.push({x: bosses.x + 400, y: bosses.y + 400});\n explosions.push({x: bosses.x + 400, y: bosses.y + 200});\n explosions.push({x: bosses.x + 200, y: bosses.y + 100});\n explosions.push({x: bosses.x + 300, y: bosses.y + 50});\n explosions.push({x: bosses.x + 500, y: bosses.y + 600});\n explosions.push({x: bosses.x, y: bosses.y + 100});\n explosions.push({x: bosses.x + 400, y: bosses.y + 300});\n explosions.push({x: bosses.x + 350, y: bosses.y + 500});\n explosions.push({x: bosses.x + 500, y: bosses.y + 400});\n explosions.push({x: bosses.x + 400, y: bosses.y + 400});\n explosions.push({x: bosses.x, y: bosses.y + 300});\n explosions.push({x: bosses.x + 400, y: bosses.y + 200});\n explosions.push({x: bosses.x + 200, y: bosses.y + 100});\n explosions.push({x: bosses.x + 300, y: bosses.y + 50});\n explosions.push({x: bosses.x, y: bosses.y + 600})\n explosions.push({x: bosses.x + 500, y: bosses.y + 600});\n explosions.push({x: bosses.x + 400, y: bosses.y + 300});\n explosions.push({x: bosses.x + 350, y: bosses.y + 500});\n explosions.push({x: bosses.x, y: bosses.y});\n explosions.push({x: bosses.x + 10, y: bosses.y + 400});\n explosions.push({x: bosses.x + 100, y: bosses.y});\n explosions.push({x: bosses.x, y: bosses.y + 10});\n displayExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n setTimeout(() => {\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n },400);\n setTimeout(() => {\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n endExplosions();\n },600)\n }\n }\n for(let j = 0; j < enemies.length; j++){\n if(Math.abs(enemies[j].x - bosses.x) < 300 && Math.abs(enemies[j].y - bosses.y) < 300 && bossAttack == true){\n explosionEnemy = [enemies[j].x , enemies[j].y];\n enemies[j] = enemies[enemies.length-1];\n explosions.push({x: explosionEnemy[0] , y: explosionEnemy[1]})\n displayExplosions();\n endExplosions();\n enemies.pop();\n enemies.push({x: Math.random() * 800, y: 0});\n }\n if(Math.abs(bullets[i].x - enemies[j].x) < 60 && Math.abs(bullets[i].y - enemies[j].y) < 60){\n explosionSpot = [enemies[j].x , enemies[j].y]\n displayScore();\n bullets[i] = bullets[bullets.length-1];\n enemies[j] = enemies[enemies.length-1];\n explosions.push({x: explosionSpot[0] , y: explosionSpot[1]})\n displayExplosions();\n endExplosions();\n enemies.pop();\n bullets.pop();\n enemies.push({x: Math.random() * 800, y: 0});\n }\n }\n }\n \n}",
"title": ""
},
{
"docid": "8a4d6f7204a9241aa1312de189e99e7b",
"score": "0.6860255",
"text": "function bulletmove(){\n \n if(ammo[bulletcount-1].x > 920 || ammo[bulletcount-1].x <-10 || ammo[bulletcount-1].y>920 || ammo[bulletcount-1].y<-10 || bullet_fired == false){\n \n return;\n }\n\n if(detect_tankBulletCollision()){ //if bullet fired by tank hit othr=er tank then make bullet invisible\n \tammo[bulletcount-1].visible = false;\n console.log(\"bullet collided with tank\");\n bullet_fired = false;\n state= play;\n }\n\n if(check_bul_col(bul_mov_state)){\n ammo[bulletcount-1].visible = false;\n console.log(\"bullet collided with wall\")\n bullet_fired = false;\n state= play;\n }\n requestAnimationFrame(bulletmove); //smooothen the motion of bullet\n ammo[bulletcount-1].x += 0.5*tank.vx*Math.sin(angle_1);\n ammo[bulletcount-1].y -= 0.5*tank.vy* Math.cos(angle_1);\n\n }",
"title": ""
},
{
"docid": "b7859c5eb30e6e4c5191b4005f54d08a",
"score": "0.684496",
"text": "function moveBullet() {\n\n if (state === \"game\") {\n stroke(0, 0, 255);\n\n //moves each bullet in the array bullets, defined at the beginning, according to the class code above\n for (let i = 0; i < bullets.length; i++) {\n if (!shopSubstate) {\n bullets[i].move();\n }\n\n //display the bullets that are on screen\n if (bullets[i].x > 0) {\n bullets[i].display();\n }\n\n //gameover if the bullet is colliding with the character\n if ((bullets[i].x - 0.5 * bullets[i].diameter >= charpos.x && bullets[i].x - 0.5 * bullets[i].diameter <= charpos.x + width / 16 && bullets[i].y >= charpos.y && bullets[i].y <= charpos.y + height / 8 ||\n bullets[i].x + 0.5 * bullets[i].diameter >= charpos.x && bullets[i].x + 0.5 * bullets[i].diameter <= charpos.x + width / 16 && bullets[i].y >= charpos.y && bullets[i].y <= charpos.y + height / 8 ||\n bullets[i].x >= charpos.x && bullets[i].x <= charpos.x + width / 16 && bullets[i].y + 0.5 * bullets[i].diameter >= charpos.y && bullets[i].y + 0.5 * bullets[i].diameter <= charpos.y + height / 8 ||\n bullets[i].x >= charpos.x && bullets[i].x <= charpos.x + width / 16 && bullets[i].y - 0.5 * bullets[i].diameter >= charpos.y && bullets[i].y - 0.5 * bullets[i].diameter <= charpos.y + height / 8) &&\n ! abilities.invincibilitys) {\n stats.health -= 50;\n bullets.splice(i, 1);\n if (volumeControl){\n sound.clickItem.setVolume(0.1);\n sound.clickItem.play();\n }\n }\n\n }\n }\n}",
"title": ""
},
{
"docid": "b11200965b1058be04c246725ddaabeb",
"score": "0.68429947",
"text": "function groundLevelBackgroundBulletDetect(_a) {\n var hitObject = _a.hitObject, mainGameObject = _a.mainGameObject, GrappleObject = _a.GrappleObject;\n if (!mainGameObject.gameInitData.dynamicLevelsActive) {\n this.atBackground = false;\n return false;\n }\n var allBlocks = mainGameObject.gameInitData.dynamicLevelMapBlocks;\n var collision;\n for (var _i = 0, allBlocks_1 = allBlocks; _i < allBlocks_1.length; _i++) {\n var background = allBlocks_1[_i];\n if (Math.max(background.x, this.x) - Math.min(background.x, this.x) > 200 ||\n Math.max(background.y, this.y) - Math.min(background.y, this.y) > 200) {\n if (!background.objectNameFlag && !this.objectNameFlag)\n continue;\n }\n collision = objectIntersectionDetect({\n object: {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n },\n target: {\n x: background.x,\n y: background.y,\n width: background.width,\n height: background.height\n }\n });\n if (collision)\n break;\n }\n this.atBackground = (collision) ? true : false;\n hitObject.atBackground = (collision) ? true : false;\n return (collision) ? true : false;\n}",
"title": ""
},
{
"docid": "66671f8095362df8e554a8604c28a0bc",
"score": "0.68363047",
"text": "function collision(){ \r\n isObstacle_Clash_leftofWindow();\r\n isBullet_Clash_obstacle();\r\n isRocket_Clash_obstacle(); \r\n if(lives<=0){\r\n endGame();\r\n }\r\n draw_Score_Lives();\r\n isRocket_Clash_Bomb();\r\n isBullet_Clash_Ship();\r\n }",
"title": ""
},
{
"docid": "928c2b133c796b1a3829b605cd899715",
"score": "0.6832334",
"text": "function onCollision(entity, entity2) {}",
"title": ""
},
{
"docid": "7ca1ada6b0eb19c3df34b429854a2fdd",
"score": "0.6831091",
"text": "collide(obj) {\n if (obj instanceof Bullet && obj.belongsTo instanceof Ship) {\n this.game.score += 5;\n this.remove();\n obj.remove();\n this.game.playDestroyedSound();\n this.game.objects.push(new Explosion(this.x, this.y, this.game));\n }\n }",
"title": ""
},
{
"docid": "75561ca9148136b68728b0a6e9d9882b",
"score": "0.6829536",
"text": "function fireBullets() {\n for(var i = 0; i < enemies.length; i++) {\n var square = enemies[i];\n var startX = ball.x - square.x;\n var startY = ball.y - square.y;\n \n var normalizer = Math.sqrt(Math.pow(startX, 2) + Math.pow(startY, 2));\n startX /= normalizer;\n startY /= normalizer;\n \n // Now put it outside of the shooter.\n startX *= (SQUARE_SIZE + 1);\n startY *= (SQUARE_SIZE + 1);\n \n createBullet(square.x + startX, square.y + startY, ball.x, ball.y);\n }\n}",
"title": ""
},
{
"docid": "be735c69d652bc0c3468f3df7b047782",
"score": "0.6828185",
"text": "function Bullets(x, y) {\n this.x = x;\n this.y = y;\n this.radius = 5;\n this.bulletSpeed = 3;\n this.gone = false;\n\n this.drawBullets = function() {\n noStroke();\n fill(255);\n ellipse(this.x, this.y, this.radius * 2, this.radius * 2);\n }\n\n this.move = function() {\n this.y = this.y - this.bulletSpeed;\n }\n\n this.hit = function(ball) {\n var d = dist(this.x, this.y, ball.x, ball.y);\n if (d < this.radius + ball.radius) {\n return true;\n }\n else {\n return false;\n }\n }\n\n this.disappear = function() {\n this.gone = true;\n }\n}",
"title": ""
},
{
"docid": "c09af7c8456584e264b9e1580b31f010",
"score": "0.68212014",
"text": "function fireBullet() {\n if(game.time.now > bulletTime) {\n bullet = bullets.getFirstExists(false);\n if(bullet) {\n bullet.reset(player1.x, player1.y);\n bullet.rotation = game.physics.arcade.angleToPointer(bullet);\n cargador = cargador -1;\n \n switch(player1.armas[0]) {\n\t case \"pistola\":\n\t \tvelocidad = 300;\n\t \tbulletTime = game.time.now + 600;\n\t \tbullet.daño = 40;\n\t balaPistola.play();\n\t \tbreak;\n\t case \"subfusil\":\n\t \tvelocidad = 400;\n\t \tbulletTime = game.time.now + 100;\n\t \tbullet.daño = 10;\n\t \tbalaSubfusil.play();\n\t \tbreak;\n\t case \"fusil\":\n\t \tvelocidad = 400;\n\t \tbulletTime = game.time.now + 200;\n\t \tbullet.daño = 20;\n\t \tbalaFusil.play();\n\t \tbreak;\n\t case \"ballesta\":\n\t \tvelocidad = 200;\n\t \tbulletTime = game.time.now + 6000;\n\t \tbullet.daño = 100;\n\t \tbalaBallesta.play();\n\t \tbreak;\n }\n \n game.physics.arcade.moveToPointer(bullet, velocidad);\n \n putDisparo(game.input.worldX, game.input.worldY, bullet.daño, velocidad);\n }\n }\n}",
"title": ""
},
{
"docid": "4b84536f11766e69ddf12a5caf03fe0a",
"score": "0.6820136",
"text": "function collision() {\n let list = $('.bullet').collision('.asteroid');\n let list2 = $('.asteroid').collision('.bullet');\n let list3 = $('.earth').collision('.asteroid');\n let ufoCollision = $('.ufo').collision('.bullet');\n let dollar = $('.dollar').collision('.ship');\n let timer = $('.timer').collision('.ship');\n let weapone = $('.better-bullets').collision('.ship');\n if (list.length > 0) {\n list.remove();\n list2.remove();\n countScore()\n } else if (list3.length > 0) {\n setTimeout(function () {\n clearTimeout($createUfo);\n clearTimeout($bonusDollar);\n clearTimeout($bonusTimer);\n clearTimeout($bonusWeapone);\n clearInterval($moveAsteroid);\n clearInterval($asteroid);\n clearInterval($update);\n $fire.unbind('click');\n $(document).unbind('mousemove');\n $('.asteroid').remove()\n $('.bullet').remove()\n $galaxy.addClass('hide');\n $('.main-menu').css('display','flex');\n $('.first-ul').addClass('hide');\n $('.game-over').removeClass('hide');\n $('.nick-over span').text($('.input-first input').val())\n $('.score-over span').text($scoreScore);\n $('.stage-over span').text($stageScore);\n document.getElementById(\"music\").play();\n $('.earth-explode').remove()\n },5000);\n $('.earth-end').append('<div>').addClass('earth-explode');\n $('.earth').fadeOut()\n earthSound()\n } else if (ufoCollision.length > 0) {\n $scoreScore += 1000;\n $('.ufo-move').remove();\n countScore();\n stopUfoSound()\n } else if (dollar.length > 0) {\n $('.dollar').remove();\n $scoreScore += 200;\n countScore();\n collectSound();\n } else if (timer.length > 0) {\n $('.timer').remove();\n topPos -= 1;\n moveAsteroid();\n timerSound()\n } else if (weapone.length > 0) {\n $('.better-bullets').remove();\n $bulletWidth += 3;\n $bulletHeight += 2;\n weaponeReload();\n }\n }",
"title": ""
},
{
"docid": "952c014b9ef9946d40f10de5a3d08cb4",
"score": "0.6801692",
"text": "function collisionDetection() {\n\n // collision detection for the pipes and the character\n for (var i = 0; i < pipes.length; i++) {\n\n if (character.x + character.sxd * 1.8 > pipes[i].x && character.x < pipes[i].x + PIPESPRITE.width * 1.8) {// lining up on x axis\n\n if (character.y < pipes[i].topY || character.y + character.syd * 1.8 > pipes[i].topY + PIPECONSTS.GAPHEIGHT) { // lining up on y axis\n\n HIT.play();\n DIESOUND.play();\n lives = 0;\n\n }\n }\n }\n\n // collision detection for the floating obstacles and the character\n for (var i = 0; i < obstacles.length; i++) {\n\n if (character.x + character.sxd * 1.8 > obstacles[i].x && character.x < obstacles[i].x + OBSTACLESPRITE.width * 0.8) {// lining up on x axis\n\n if (character.y < obstacles[i].y + OBSTACLESPRITE.height * 0.8 && character.y + character.syd * 1.8 > obstacles[i].y) { // lining up on y axis\n\n lives -= 1;\n\n if (lives <= 0) {\n\n HIT.play();\n DIESOUND.play();\n\n }else if (lives > 0){\n\n HIT.play();\n\n }\n\n obstacles.splice(i,1);\n\n }\n }\n }\n\n // collision detection for the fruit and the character\n for (var i = 0; i < fruits.length; i++) {\n\n if (character.x + character.sxd * 1.8 > fruits[i].x && character.x < fruits[i].x + fruits[i].sxd * 1.3) { // if the fruit and character line up on the x axis\n\n if (character.y < fruits[i].y + fruits[i].syd * 1.3 && character.y + character.syd * 1.8 > fruits[i].y) { // if they line up on the y\n\n score += fruits[i].value;\n fruits.splice(i,1);\n POINT.play();\n\n }\n }\n }\n\n // collision detection between the fruits and obstacles\n for (var i = 0; i < obstacles.length; i++) {\n if (obstacles[i].x < fruits[0].x + fruits[0].sxd * 1.5 && obstacles[i].x + OBSTACLESPRITE.width > fruits[0].x) { // checking x axis\n\n if (obstacles[i].y - 20 < fruits[0].y + fruits[0].syd * 1.5 && obstacles[i].y + OBSTACLESPRITE.height + 20 > fruits[0].y) { // checking y axis\n\n obstacles.splice(i,1);\n makeObstacle();\n\n }\n }\n }\n}",
"title": ""
},
{
"docid": "bc8c89fa4f4b11ed3b82a8024ff8626b",
"score": "0.67887646",
"text": "function kill(oBullet)\n\t\t\t{\n\t\t\t//colletion between bullet1 and tank2\n\t\t\tif(oBullet.y>=oTank2.y && oBullet.y<oTank2.y+48 && oBullet.x>=oTank2.x && oBullet.x<oTank2.x+48)\n\t\t\t\t\t{\n\t\t \t imgTank2.src = 'images/tankburn.png';\n\t\t\t\t\tstop(oBullet);\n\t\t\t\t\tgameover(2);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t//colletion between bullet2 and tank1\n\t\t\t\tif(oBullet.y>=oTank1.y && oBullet.y<oTank1.y+48 && oBullet.x>=oTank1.x && oBullet.x<oTank1.x+48)\n\t\t\t\t\t{\n\t\t\t\t imgTank1.src = 'images/tankburn.png';\n\t\t\t\t\tstop(oBullet);\n\t\t\t\t\tgameover(1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//colletion between life1 and bullet\n\t\t\tif(oBullet.y>=36*iCellSize && oBullet.y<=36*iCellSize+48 && oBullet.x>=18.5*iCellSize && oBullet.x<=18.5*iCellSize+48)\n\t\t\t\t\t{\n\t\t\t\t imgLife2.src = 'images/die.png';\n\t\t\t\t\tstop(oBullet);\n\t\t\t\t\tgameover(1);\n\t\t\t\t\t}\n\t\t\t//colletion between life2 and bullet\n\t\t\tif(oBullet.y>=0 && oBullet.y<=48 && oBullet.x>=18.5*iCellSize && oBullet.x<=18.5*iCellSize+48)\n\t\t\t\t\t{\n\t\t \t imgLife1.src = 'images/die.png';\n\t\t\t\t\tstop(oBullet);\n\t\t\t\t\tgameover(2);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t}",
"title": ""
},
{
"docid": "400144fc5d4f45346b6944f44949623a",
"score": "0.67829263",
"text": "function bulletInvaderCollision() {\n let inv;\n if (!bullet.active) {\n return;\n }\n for (let i = 0; i < invaders.rows.length; i++) {\n for (let j = 0; j < invaderRowLength; j++) {\n inv = invaders.rows[i].row[j]\n if (!inv.alive) {\n continue;\n }\n if (collideRectRect(\n bullet.xpos,\n bullet.ypos,\n bullet.width,\n bullet.height,\n inv.xpos,\n inv.ypos,\n inv.width,\n inv.height,\n )) {\n invaders.kill(i, j);\n bullet.reset();\n break;\n }\n }\n }\n}",
"title": ""
},
{
"docid": "1787120caafe2cb090209a0d779cad5f",
"score": "0.6776579",
"text": "function collision_deprived(obj) {\n\tvar hits = 0;\n\tfor (var k in bullet_positions) {\n\t\tif (k[0] == obj[0]) { continue; }\n\t\tif (Math.abs(obj[1]-k[1]) < EP && Math.abs(obj[2]-k[2]) < EP) { hits ++; }\n\t}\n\treturn hits;\n}",
"title": ""
},
{
"docid": "8e3850aaf7b5125650683caeee7bb41b",
"score": "0.6776552",
"text": "function detect_tb()\n{\n if(Math.pow(update.bullet_x -center_x ,2) + Math.pow(update.bullet_y -center_y ,2) <=900 && other_ammo[100*update.id + other_bulletcount-1].visible ==true){\n\n //console.log(\"bullet tank collision detected\");\n console.log(\"health decrease due to detect_tb()\");\n other_ammo[100*update.id + other_bulletcount-1].visible = false ;\n healthbar-- ;\n //collide.play();\n healthstatus.outer.width -=25 ; \n idle();\n console.log(\"in the idle state \");\n console.log(healthbar);\n\n }\n\n\n}",
"title": ""
},
{
"docid": "524cc4219a548da3294164a7d9852162",
"score": "0.677478",
"text": "function find() {\n if (collision($('.Alien-ship'), $('.bullets'))) {\n console.log(\"Bullet hit ,ship destroyed\");\n // $(\".Alien-ship\").animate({ 'height': 'toggle' });\n $(\".Alien-ship\").css(\"left\", \"30px\");\n $(\".Alien-ship\").remove();//Delete / destroy Alien ship\n TotalShipsHit++;\n console.log(TotalShipsHit);\n $('.score').empty();\n $('.score').append(`<h3>Score - ${TotalShipsHit}/5 </h3>`);\n\n if (TotalShipsHit == 5) {\n $('#winText').empty();\n $('#winText').append(`<h1>YOU WIN !!SAVED THE WORLD FROM ALIENS</h1>`);\n } else {\n //Create new Ship\n createAlienShip();\n }\n } else {\n console.log(\"Damn it!Just missed!\");\n //Create new bullet\n var $div = $(\"<div>\", { \"class\": \"bullets\" });\n $(\".ship\").after($div);\n setTimeout(function () { \n if($(\".Alien-ship\").css(\"left\") == \"600px\"){\n $('#winText').empty();\n $('#winText').append(`<h1>YOU LOST</h1>`);\n }\n }, 500);\n }\n}",
"title": ""
},
{
"docid": "99ea1e62733fe36a41fcfa2178e53e5b",
"score": "0.67377603",
"text": "onCollision() {}",
"title": ""
},
{
"docid": "ac4a3c691c56064761d1d32b258189c7",
"score": "0.6735961",
"text": "detectShootingEvent() {\n // shoot key for player A\n if (this.keyPressedStates[67 /* C */]) {\n if (this.children.indexOf(this.playerA) !== -1) {\n // aim specifies the direction of shooting\n let aim = objects.Vector2.right();\n let bulletsA = this.playerA.shoot(util.GameConfig.ATLAS, \"missileA\", aim);\n this.ScoreBorad.BulletsA = this.playerA.bulletNum;\n // push all bullets in bulletsA and add to the scene\n if (bulletsA) {\n bulletsA.forEach((b) => {\n this.bulletAList.push(b);\n this.addChild(b);\n });\n }\n }\n }\n // shoot key for player B\n if (this.keyPressedStates[77 /* M */]) {\n if (this.children.indexOf(this.playerB) !== -1) {\n // aim specifies the direction of shooting\n let aim = objects.Vector2.left();\n let bulletsB = this.playerB.shoot(util.GameConfig.ATLAS, \"missileB\", aim);\n this.ScoreBorad.BulletsB = this.playerB.bulletNum;\n // push all bullets in bulletsB and add to the scene\n if (bulletsB) {\n bulletsB.forEach((b) => {\n this.bulletBList.push(b);\n this.addChild(b);\n });\n }\n }\n }\n }",
"title": ""
},
{
"docid": "e592443072d5648e4452c8b8bd792331",
"score": "0.6724246",
"text": "function bulletHitWall(body1, body2, fixture1, fixture2, begin) {\n \n if ( !begin ) {\n return;\n }\n \n // It is possible for the bullet to collide with more than one tile body \n // in the same timestep, in which case this will run twice, so we need to\n // check if the sprite has already been destroyed.\n if (body1.sprite) {\n \n // Create a small explosion at the bullet location \n var explosionAnimation = smallExplosions.getFirstExists(false);\n if (explosionAnimation) {\n explosionAnimation.reset(body1.x, body1.y);\n explosionAnimation.play('smallboom', 30, false, true);\n }\n \n body1.sprite.destroy(); \n sound_wallHit.play();\n }\n \n}",
"title": ""
},
{
"docid": "2dbe90a9cada03667eef80bdbdf5b9ea",
"score": "0.67220455",
"text": "drawBullets() {\r\n for(let i = 0; i < this.world.bullets.length; i++) {\r\n if(this.world.bullets[i].isImageLoaded && this.world.bullets[i].live) {\r\n this.world.bullets[i].draw(this.ctx, this.world.camera);\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "a66581278195083842171f2f2df893ae",
"score": "0.67213625",
"text": "function enemyFireBullet(enemy) {\n \n // This position is first given in local coordinates of the enemy sprite, \n // then we convert it to a world position. The toWorldPoint takes into\n // account the position and rotation of the enemy.\n var offset = Math.random() > 0.5 ? 10 : -10;\n var point = new box2d.b2Vec2(-30, offset); // a bit in front of the enemy\n enemy.body.toWorldPoint( point, point );\n \n // Create the bullet body and set the angle\n var bullet = game.add.sprite(point.x, point.y, 'enemybullet');\n game.physics.box2d.enable(bullet);\n bullet.body.setCircle(2);\n bullet.body.angle = enemy.body.angle;\n \n // Start the bullet moving in the same direction as the enemy\n // is facing. The direction is first given in local coordinates\n // of the enemy sprite, then we convert it to a world direction.\n var direction = new box2d.b2Vec2(-1, 0); // up\n enemy.body.toWorldVector( direction, direction );\n \n // Multiply direction by bullet speed\n direction.x *= 100;\n direction.y *= 100;\n \n // Set velocity\n bullet.body.velocity.x = direction.x;\n bullet.body.velocity.y = direction.y;\n \n // Set up the contact callbacks for when the bullet hits something\n bullet.body.setCategoryContactCallback(1, bulletHitWall, this);\n bullet.body.setCategoryContactCallback(2, bulletHitEnemy, this);\n bullet.body.setCategoryContactCallback(3, bulletHitPlayer, this);\n \n sound_enemyFire.play();\n \n // Give the bullet sprite a tag, so we can identify it. This is needed\n // because we want to ignore bullets when checking line-of-sight between\n // the enemies and the enemy.\n bullet.tag = 123;\n}",
"title": ""
},
{
"docid": "3ec9b13fa78f6747ebd2655def793a11",
"score": "0.6701502",
"text": "function Bullet(){\n\t//true if bullet is in use\n\tthis.alive = false;\n\t//set bullet values when fired\n\tthis.spawn = function(x,y,speed){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.alive = true;\n\t}\n\t//draw method return true if moved offscreen --> bullet is ready to be cleared by the pool\n\tthis.draw = function(){\n\t\tthis.ctx = this.canvas.getContext(\"2d\");\n\t\tthis.ctx.clearRect(this.x,this.y,this.width,this.height);\n\t\tthis.y -= this.speed;\n\t\tif(this.y <= (0 - this.height) || this.isColliding){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tthis.ctx.drawImage(this.image,this.x,this.y);\n\t\t}\n\t}\n\t//resets the bullet values\n\tthis.clear = function(){\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.speed = 0;\n\t\tthis.alive = false;\n\t\tthis.isColliding = false;\n\t}\n}",
"title": ""
},
{
"docid": "ffe9a786c9af02ea0ae1d1ece0791c65",
"score": "0.67010474",
"text": "enemyShootTargeted (enemy, bullets) {\n console.log('enemy shoots, targeted!');\n if(enemy.active){\n var betweenPoints = Phaser.Math.Angle.BetweenPoints;\nvar angle = betweenPoints(enemy, this.player);\nvar velocityFromRotation = this.physics.velocityFromRotation;\n//create variable called velocity from a vector2\nvar velocity = new Phaser.Math.Vector2();\nvelocityFromRotation(angle, 500, velocity);\n//get bullet group\n var bullet = bullets.get();\n bullet.setAngle(Phaser.Math.RAD_TO_DEG * angle);\n bullet.enableBody(true, enemy.x, enemy.y, true, true)\n .setVelocity(velocity.x, velocity.y);\n}\n}",
"title": ""
},
{
"docid": "23275c4a3cfd29447cfd3f83f5cfb818",
"score": "0.67005634",
"text": "function fireBullet(e, enemyOrFriendly = 0) {\n //let rect = app.view.getBoundingClientRect();\n //let mouseX = e.clientX - rect.x;\n //let mouseY = e.clientY - rect.y;\n if (enemyOrFriendly != 0) {\n\n let b = new Bullet(0xFFFFFF, e.x, e.y);\n b.fwd = { x: 0, y: 1 }\n enemyBullets.push(b);\n enemyShootSound.play();\n gameScene.addChild(b);\n return;\n }\n if (bullets.length == 3) {\n return;\n }\n let b = new Bullet(0xFFFFFF, ship.x, ship.y);\n bullets.push(b);\n gameScene.addChild(b);\n shootSound.play();\n}",
"title": ""
},
{
"docid": "ba7a90accc6bb60a5ffe16e1456c6486",
"score": "0.6694861",
"text": "function checkBulletColls() {\r\n if(bullets.countLiving() > 0){\r\n bullets.forEach(function(item) {\r\n console.log(bullets.countLiving());\r\n if(checkBulletCollideAsteroid(item)){\r\n //Bullet collided with an asteroid\r\n bullets.remove(item);\r\n bulletsLeft += 1;\r\n updateScore();\r\n }\r\n if(item.lifetime <= 0){\r\n bullets.remove(item);\r\n }\r\n });\r\n }\r\n\r\n}",
"title": ""
},
{
"docid": "a5dd2528802abebe4c9eea1bde7845ff",
"score": "0.6692726",
"text": "function manageBullets(self) {\n let width = config.width;\n let height = config.height;\n for (let i = 0; i < bulletList.length; ++i) {\n let bullet = bulletList[i];\n\n // destroy bullet if it exists for a certain time\n if (self.time.now - bullet.createdAt > bulletMaxLifespan) {\n bullet.destroy();\n bulletList.splice(i, 1);\n --i;\n continue;\n }\n\n // wrap bullet around bounds\n if (bullet.x > width) {\n bullet.x -= width;\n } else if (bullet.x < 0) {\n bullet.x += width;\n }\n\n if (bullet.y > height) {\n bullet.y -= height;\n } else if (bullet.y < 0) {\n bullet.y += height;\n }\n }\n}",
"title": ""
},
{
"docid": "efe94ab133e77a75f3f55e89a1af8be1",
"score": "0.66852725",
"text": "detectCollision() {\n PLAYERS.forEach(player => {\n const distance = this.position.subtract(player.position).magnitude;\n if (distance <= (this.radius + player.radius + player.radius / 2)) {\n switch (HANDLES[`${player.side + player.tacticalPos}`].state) {\n case \"default\": // Do nothing if ball is coming from behind, else soft kick\n if((this.position.x < (player.position.x + player.radius) && player.side === 'L') || (this.position.x > (player.position.x - player.radius) && player.side === 'R')) \n return\n else\n player.velocity = player.side === 'L' ? new Vector(5, 0) : new Vector(-5, 0)\n this.velocity = collisionVector(this, player);\n break\n case \"kick\": // Get +20 velocity towards opposite goal bar\n if((player.side === 'L' && this.position.x > player.position.x) || (player.side === 'R' && this.position.x < player.position.x))\n this.velocity = this.velocityTowardsGoal(player.side)\n return\n case \"leave\": // Ignore collision (ball will go underneath)\n return\n case \"hold\": // Attach ball to player if close enough\n if((player.side === 'L' && this.position.x < (player.position.x + player.radius)) || (player.side === 'R' && this.position.x > (player.position.x - player.radius)))\n this.velocity = new Vector(0, 0)\n this.position = new Vector(this.position.x, player.position.y)\n break\n case \"backpass\": // Get +5 velocity towards self goal bar\n if(player.side === 'L' && this.position.x < player.position.x)\n this.velocity = new Vector(-5, 0)\n if(player.side === 'R' && this.position.x > player.position.x)\n this.velocity = new Vector(5, 0)\n break\n default:\n return;\n }\n } \n })\n }",
"title": ""
},
{
"docid": "f92a332bba4abcf317170961d1fc4062",
"score": "0.6682001",
"text": "enemyShoot (enemy, bullets) {\n console.log('enemy shoots!');\n if(enemy.active){\n if(enemy.flipX == false){\n var velocity = {x: 700, y: 0};\n }\n else{\n var velocity = {x: -700, y: 0};\n }\n var bullet = bullets.get();\n bullet.enableBody(true, enemy.x, enemy.y, true, true)\n .setVelocity(velocity.x, velocity.y);\n}\n}",
"title": ""
},
{
"docid": "6a7dd055e21accc339d103d7a00e4763",
"score": "0.6662281",
"text": "function collision(){\n\tfor(var j=0; j<particles.length; j++){\t\t\n\t\tfor(i=0; i<fire.length; i++){\t\n\t\t\tif(particles[j] && fire[i]){ // this ensures that the code below is not executed when the array is empty\n\t\t\t\tM = Math.sqrt(Math.pow((particles[j].x2 - fire[i].x3),2) + Math.pow((particles[j].y2 - fire[i].y3),2));\n\t\t \t\tif(M < particles[j].radius){\n\t\t\t\t\texplosion = true;\n\t\t\t\t\ts = particles[j].x2;\n\t\t\t\t\tw = particles[j].y2;\n\t\t\t\t\tcircleHit.currentTime = 0;\n\t\t\t\t circleHit.play();\n\t\t\t\t\tscore = score + 50;\n\t\t\t\t\tfire.splice(i,1); // makes bullet disappear on impact \n\t\t\t\t\tparticles.splice(j,1); // makes circle disappear on impact \n\t\t\t\t\tshotsHittingTarget +=1;\n\t\t\t\t}\t \n\t\t\t}\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "724a3f7c18eacbe6d79ba8309820f61a",
"score": "0.665584",
"text": "collide (barrier, pbullet)\n {\n pbullet.destroy();\n }",
"title": ""
},
{
"docid": "08e19f9c3cd5005064b1ef1197d41b98",
"score": "0.6646769",
"text": "async onHit(props)\n {\n // @TODO: clean up and simplify.\n let execute = false;\n // if the hit has a player then the second body will be always the bullet:\n if({}.hasOwnProperty.call(props, 'playerBody')){\n // @TODO: validate if current hit is the target player.\n // bullet hit player: {playerBody: playerBody, objectBody: otherBody, room: this.room}\n this.removeBullet(props.objectBody);\n execute = true;\n }\n // if both bodies are non-players bodies and the defender is also an object then validate if the hit object is\n // the same registered as defender:\n if(\n {}.hasOwnProperty.call(props, 'bodyA')\n && {}.hasOwnProperty.call(props, 'bodyB')\n // @NOTE: defender could be a player and don't have an objectBody.\n && {}.hasOwnProperty.call(this.defender, 'objectBody')\n ){\n // bullet hit object: {bodyA: bodyA, bodyB: bodyB, room: this.room}\n // if one body is the bullet we need to validate that the second one is the target object (or defender):\n if(props.bodyA.isBullet && props.bodyB.id === this.defender.objectBody.id){\n this.removeBullet(props.bodyA);\n execute = true;\n }\n if(props.bodyB.isBullet && props.bodyA.id === this.defender.objectBody.id){\n this.removeBullet(props.bodyB);\n execute = true;\n }\n }\n if(execute){\n this.room.broadcast({act: GameConst.HIT, x: this.defender.state.x, y: this.defender.state.y});\n await super.execute(this.attacker, this.defender);\n if(\n {}.hasOwnProperty.call(this.attacker, 'player_id')\n && {}.hasOwnProperty.call(this.defender, 'objectBody')\n && this.currentBattle\n ){\n if(this.defender.stats.hp > 0){\n await this.currentBattle.startBattleWith(this.attacker, this.room);\n } else {\n await this.currentBattle.battleEnded(this.attacker, this.room);\n }\n } else {\n if({}.hasOwnProperty.call(this.defender, 'player_id')){\n let targetClient = this.room.getClientById(this.defender.sessionId);\n if(targetClient){\n await this.currentBattle.updateTargetClient(\n targetClient,\n this.defender,\n this.attacker.sessionId,\n this.room\n );\n }\n }\n }\n } else {\n // the bullet hit something else:\n let bulletBody = props.bodyA.isBullet ? props.bodyA : props.bodyB;\n // destroy the bullet and run the hit animation:\n this.removeBullet(bulletBody);\n this.room.broadcast({act: GameConst.HIT, x: bulletBody.position[0], y: bulletBody.position[1]});\n }\n return false;\n }",
"title": ""
},
{
"docid": "185e4c1299caf3088babc45c9f9e642e",
"score": "0.66412675",
"text": "function game(){\n shoot();\n bulletColliderCheck();\n getBulletPosition();\n}",
"title": ""
},
{
"docid": "dac41387ed0001df2c9ffe1f363d98fe",
"score": "0.66334957",
"text": "function shootBullet(entity) {\n var myBullets = Entities.find({type: 'bullet', playerId: MY_ID});\n if (myBullets.count() >= MAX_NUMBER_OF_BULLETS)\n {\n return;\n }\n var offsetAngle = entity.angle + 90;\n var vectorX = Math.cos(offsetAngle * Math.PI / 180);\n var vectorY = Math.sin(offsetAngle * Math.PI / 180);\n Entities.insert({\n\n type: 'bullet',\n x: entity.x + vectorX * TILE_SIZE_PX,\n y: entity.y + vectorY * TILE_SIZE_PX,\n xDirection: vectorX,\n yDirection: vectorY,\n speed: 800,\n health: 1,\n angle: entity.angle,\n isMovable: true,\n isAnimatable: true,\n animation: 'idle',\n playerId: MY_ID\n\n });\n}",
"title": ""
},
{
"docid": "def5feb2a385ea3c6012456bc9be74d0",
"score": "0.6620281",
"text": "function collision() {\n console.log(\"hit\");\n }",
"title": ""
},
{
"docid": "7f0cf3ba277704a651f41edd1691265c",
"score": "0.6612435",
"text": "function updateBullet(){\r\n if(bullets.length==0){\r\n shoot()\r\n }\r\n for(var i=0;i<bullets.length/3;i++){\r\n for(var j=0;j<3; j++) {\r\n bullets[3*i+j]=vec2(bullets[3*i+j][0],bullets[3*i+j][1]-0.005);\r\n }\r\n edgeRight=canon[1][0]+0.005\r\n edgeLeft=canon[0][0]-0.005\r\n if(bullets[i*3+2][0]< edgeRight && bullets[i*3+2][0]>edgeLeft && bullets[i*3+2][1]<canon[0][1]){\r\n if(confirm('You lose! during the game you can restart any time by press\"R\". click \"ok\" to restart. \"cancel\" to quit. ')){\r\n window.location.reload(); }\r\n else{\r\n window.close();\r\n } \r\n }\r\n if(bullets[2][1]<=-1){\r\n bullets=[]\r\n bulletsColor=[]\r\n }\r\n}}",
"title": ""
},
{
"docid": "64d9214aac0c4fcc89043472ea74cb8d",
"score": "0.6608918",
"text": "onCollision(){ }",
"title": ""
},
{
"docid": "805605904a00d1f2258e4c1783695ec0",
"score": "0.6599347",
"text": "function collisionDetection() {\n\tif(catchedPara(0)){\n\t\tscore += 10\n\t\tremovePara();\n\t}\n\telse if(missedPara(0)){\n\t\tif(--lives <= 0)\n\t\t\tgameOver = true;\n\t\tremovePara();\n\t}\n}",
"title": ""
},
{
"docid": "1693181eeadc650824022fe5b5b622ad",
"score": "0.659671",
"text": "function OnCollisionEnter2D(other : Collision2D){\n\t//if(other.gameObject.name == \"bullet1\" || other.gameObject.name == \"bullet2\" || other.gameObject.name == \"bullet3\" || other.gameObject.name == \"bullet4\" || other.gameObject.name == \"bullet5\" || other.gameObject.name == \"bullet6\"){//Nur auslöden, wenn eine Kugel trifft KLAPPT NICHT! TREFFER WIRD GEGEBEN, ABER SCHADEN WIRD NICHT MEHR ABGEZOGE\n\t\tantHPfkt.antHealthPoints -= damageOnThisBody;\n\t\tDebug.Log(\"Treffer\");\n\t\tantSoundState=Random.Range(1,4);\n\t\tGetComponent.<AudioSource>().PlayOneShot(antSoundFinal);\t\t\n\t//}\n}",
"title": ""
},
{
"docid": "8aa58d6bcafb164f248f60455718010c",
"score": "0.6593013",
"text": "detectorCollision(liste) {\r\n let val = 0;\r\n const that = this;\r\n liste.forEach(function (el, index) {\r\n if (that.collisionWith(el)) {\r\n el.deltaX = 0;\r\n el.deltaY = 3;\r\n val += 1;\r\n }\r\n });\r\n if (val != 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"title": ""
},
{
"docid": "f1686685ede7dc0a66004c282a5d0711",
"score": "0.65867347",
"text": "checkCollisionBetweenObjects() {\n for (let i = 0; i < this.objects.length; i++) {\n const obj1 = this.objects[i];\n if (!(obj1 instanceof Collidable)) continue;\n\n for (let j = i + 1; j < this.objects.length; j++) {\n const obj2 = this.objects[j];\n if (!(obj2 instanceof Collidable)) continue;\n obj1.checkCollision(obj2);\n }\n }\n }",
"title": ""
},
{
"docid": "51670b3833ce6677fd415620db14805f",
"score": "0.65504575",
"text": "function bulletHitPlayer(body1, body2, fixture1, fixture2, begin) {\n \n if ( !begin ) {\n return;\n }\n \n // Reduce life of the player\n body2.sprite.life -= 1;\n \n // Check if player has been killed\n if ( body2.sprite.life <= 0 ) { \n \n // Create a large explosion at the player location\n var explosionAnimation = largeExplosions.getFirstExists(false);\n explosionAnimation.reset(body2.x, body2.y);\n explosionAnimation.play('bigboom', 30, false, true);\n \n body2.sprite.destroy();\n sound_wallHit.play();\n \n ship = null;\n }\n \n // Also do the same as when bullet hits wall (small explosion, remove bullet)\n bulletHitWall(body1, body2, fixture1, fixture2, begin);\n \n}",
"title": ""
},
{
"docid": "d72cfa5c1a056e0ac94565350fec1c36",
"score": "0.6546274",
"text": "function Bullet() {\n this.active = true;\n this.x = Player1.x;\n this.y = Player1.y;\n this.xVelocity = 2;\n this.yVelocity = 2;\n this.xtarget = mouseX;\n this.ytarget = mouseY;\n this.w = 2;\n this.h = 2;\n this.color = \"#000\";\n this.angle = getBulletAngle();\n\n this.bulletUpdate = function() {\n this.x += this.xVelocity;\n this.y += this.yVelocity;\n };\n\n this.bulletDraw = function() {\n c.beginPath();\n c.save();\n c.translate(this.x, this.y);\n if (deltaX < 0) {\n c.rotate(this.angle);\n } else {\n c.rotate(this.angle);\n c.scale(-1, 1);\n }\n c.translate(-this.x, -this.y);\n c.fillStyle = \"#000000\";\n c.rect(this.x, this.y, 2, 2);\n c.fill();\n c.restore();\n c.closePath();\n };\n } // bullet",
"title": ""
},
{
"docid": "97ad6ad1ad6fb559069ac1238f3ce0c3",
"score": "0.6546091",
"text": "collision(b) {\r\n if (this.cross(b)) {\r\n // s'il y des collision, diminuer le hp de cible\r\n if(this.isPig && this.type ==2 && b.isDesk){\r\n this.on = b\r\n if(this.velocity.norm() < Constants.limit){\r\n this.velocity = new Vector(0.3,0)\r\n }\r\n return false\r\n }else if (this.isDesk && b.isPig && b.type ==2){\r\n b.on =this\r\n return false\r\n }\r\n\r\n if (b.hasHp) {\r\n if (this.isStatic || this.velocity == Vector.ZERO) {\r\n if (b.velocity.norm() > 0.2) {\r\n b.hp = 0;\r\n // if (this.hasHp) this.hp = 0;\r\n } else if (b.velocity.norm() >= Constants.limit) {\r\n b.hp--;\r\n b.changeImg();\r\n if (this.hasHp) {\r\n this.hp--;\r\n this.changeImg();\r\n }\r\n }\r\n } else {\r\n if (this.velocity.norm() > 0.2) {\r\n b.hp = 0;\r\n // if (this.hasHp) this.hp = 0;\r\n } else if (this.velocity.norm() >= Constants.limit) {\r\n b.hp--;\r\n b.changeImg();\r\n if (this.hasHp) {\r\n this.hp--;\r\n this.changeImg();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (this.hasHp) {\r\n if (b.isStatic || b.velocity == Vector.ZERO) {\r\n if (this.velocity.norm() > 0.2) {\r\n this.hp = 0;\r\n // if (b.hasHp) b.hp = 0;\r\n } else if (this.velocity.norm() >= Constants.limit) {\r\n this.hp--;\r\n this.changeImg();\r\n if (b.hasHp) {\r\n b.hp--;\r\n b.changeImg()\r\n }\r\n }\r\n } else {\r\n if (b.velocity.norm() > 0.2) {\r\n this.hp = 0;\r\n // if (b.hasHp) b.hp = 0;\r\n } else if (b.velocity.norm() >= Constants.limit) {\r\n this.hp--;\r\n this.changeImg();\r\n if (b.hasHp) {\r\n b.hp--;\r\n b.changeImg()\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** si l'oiseau touche le porc, le hp de porc sera zero */\r\n if (this.isBird && b.isPig) {\r\n // console.log(\"进入测试\")\r\n b.hp = 0;\r\n }\r\n\r\n if (b.isBird && this.isPig) {\r\n // console.log(\"\")\r\n this.hp = 0;\r\n }\r\n\r\n if (b.hasHp && b.hp <= 0 && b.removeCount > 30) {\r\n // console.log(\"b.hp\", b, b.hp);\r\n b.changeImg();\r\n b.removeCount = 30;\r\n }\r\n\r\n if (this.hasHp && this.hp <= 0 && this.removeCount > 30) {\r\n // console.log(\"this.hp\", this, this.hp);\r\n this.changeImg();\r\n this.removeCount = 30;\r\n }\r\n\r\n let mdiff = this.mDiff(b);\r\n let vectors = [\r\n new Vector(0, mdiff.origin.y),\r\n new Vector(0, mdiff.origin.y + mdiff.height),\r\n new Vector(mdiff.origin.x, 0),\r\n new Vector(mdiff.origin.x + mdiff.width, 0),\r\n ];\r\n\r\n let n = vectors[0];\r\n\r\n for (let i = 1; i < vectors.length; i++) {\r\n if (vectors[i].norm() < n.norm()) n = vectors[i];\r\n }\r\n\r\n let norm_v = this.velocity.norm();\r\n let norm_vb = b.velocity.norm();\r\n let kv = norm_v / (norm_v + norm_vb);\r\n let kvb = norm_vb / (norm_v + norm_vb);\r\n\r\n if (norm_v == 0 && norm_vb == 0) {\r\n if (this.invMass == 0 && b.invMass == 0) return null;\r\n else {\r\n if (this.mass <= b.mass) kv = 1;\r\n else kvb = 1;\r\n }\r\n }\r\n this.move(n.mult(kv));\r\n b.move(n.mult(-kvb));\r\n\r\n n = n.normalize();\r\n\r\n // (2) On calcule l'impulsion j :\r\n let v = this.velocity.sub(b.velocity);\r\n let e = Constants.elasticity; // pour les étudiants, juste faire let e = 1;\r\n\r\n let j = (-(1 + e) * v.dot(n)) / (this.invMass + b.invMass);\r\n\r\n // (3) On calcule les nouvelle vitesse:\r\n let new_v = this.velocity.add(n.mult(j * this.invMass));\r\n let new_bv = b.velocity.sub(n.mult(j * b.invMass));\r\n\r\n b.setCollision(true);\r\n this.setCollision(true);\r\n this.velocity = new_v;\r\n b.velocity = new_bv;\r\n\r\n let v1 = this.velocity;\r\n let v2 = b.velocity;\r\n //\r\n if (((b.isStatic || b.on != null ) && b.isOn(this) || b.isFalldown())) {\r\n // console.log(\"测试this 在上\", this, this.hp, b, b.hp);\r\n if (!b.isPig && !b.isBird) {\r\n this.on = b;\r\n // console.log(\"this on b\", this, b);\r\n if (this.velocity.norm() < Constants.limit) {\r\n this.velocity = Vector.ZERO;\r\n } else {\r\n this.velocity = v1.sub(new Vector(0.2 * v1.x, 0));\r\n }\r\n } else {\r\n // if(this.isBird || this.isPig) console.log(\"测试this\", this, this.velocity, b, b.velocity);\r\n if (this.velocity.norm() > 0.3) {\r\n console.log(\">0.3\")\r\n this.velocity = v1.sub(new Vector(0.2 * v1.x, 0.2 * v1.y));\r\n b.velocity = v2.add(new Vector(0.2 * v1.x, 0.2 * v1.y));\r\n }else if(this.velocity.norm() >= Constants.limit){\r\n this.velocity = v1.sub(new Vector(1.5 * v1.x, 1.5 * v1.y));\r\n b.velocity = v2.add(new Vector(0.5 * v1.x, 0.5 * v1.y));\r\n }else if(this.velocity.norm() < Constants.limit ){\r\n // && b.velocity.norm() < Constants.limit\r\n this.velocity = Vector.ZERO;\r\n this.on = b;\r\n }\r\n }\r\n } else if (((this.isStatic || this.on != null ) && this.isOn(b)) || this.isFalldown()) {\r\n // console.log(\"测试b 在上\", b, b.hp, this, this.hp);\r\n if (!this.isBird && !this.isPig) {\r\n b.on = this;\r\n // console.log(\"b on this\", b, this);\r\n if (b.velocity < Constants.limit) {\r\n b.velocity = Vector.ZERO;\r\n } else {\r\n b.velocity = v2.sub(new Vector(0.2 * v2.x, 0));\r\n }\r\n } else {\r\n // if(b.isBird || b.isPig) console.log(\"测试b 在上\", b, b.hp, this, this.hp);\r\n\r\n if (b.velocity.norm() > 0.3) {\r\n b.velocity = v2.sub(new Vector(0.2 * v2.x, 0.2 * v2.y));\r\n this.velocity = v1.sub(new Vector(0.2 * v2.x, 0.2 * v2.y));\r\n } else if(b.velocity.norm() >= Constants.limit){\r\n b.velocity = v2.sub(new Vector(1.5 * v2.x, 1.5 * v2.y));\r\n this.velocity = v1.sub(new Vector(0.5 * v2.x, 0.5 * v2.y));\r\n }else if( b.velocity.norm() < Constants.limit){\r\n // this.velocity.norm() < Constants.limit &&\r\n b.velocity = Vector.ZERO;\r\n b.on = this;\r\n }\r\n console.log(\"on this, b is pig/bird \", this,this.velocity,b, b.velocity)\r\n }\r\n }\r\n\r\n\r\n if(this.isSpring){\r\n b.canDown = true;\r\n console.log(\"鸟速度before\",b.velocity)\r\n // b.velocity = b.force.add(new Vector(3 * Constants.addforce * Constants.elasticity, 3 * Constants.addforce * Constants.elasticity))\r\n b.velocity = b.velocity.add(new Vector( 5 * v2.x,-10* v2.y))\r\n console.log(\"鸟速度\",b.velocity)\r\n return true\r\n }else if(b.isSpring){\r\n this.canDown = true;\r\n console.log(\"鸟速度before\",this.velocity)\r\n // this.force = b.force.add(new Vector(3 * Constants.addforce * Constants.elasticity, 3 * Constants.addforce * Constants.elasticity))\r\n this.velocity = this.velocity.add(new Vector( 5 * v1.x,-10* v1.y))\r\n console.log(\"鸟速度\",this.velocity)\r\n return true\r\n }\r\n\r\n if (this.isDesk) {\r\n if(b.origin.x+b.w < this.origin.x){\r\n b.canDown = true\r\n b.velocity = new Vector(0, b.velocity.y)\r\n }else{\r\n b.canDown = false;\r\n if (b.velocity.norm() < Constants.limit) {\r\n b.velocity = Vector.ZERO\r\n // new_bv = Vector.ZERO;\r\n }\r\n }\r\n this.velocity = Vector.ZERO;\r\n this.canDown = false\r\n // console.log(\"this 桌子碰撞 b:\",this, b, b.canDown);\r\n } else if (b.isDesk) {\r\n if(this.origin.x+b.w < b.origin.x){\r\n b.canDown = true\r\n b.velocity = new Vector(0, b.velocity.y)\r\n }else{\r\n this.canDown = false;\r\n if (this.velocity.norm() < Constants.limit) {\r\n this.velocity = Vector.ZERO\r\n // new_v = Vector.ZERO;\r\n }\r\n b.velocity = Vector.ZERO\r\n }\r\n this.velocity = Vector.ZERO;\r\n this.canDown = false\r\n // console.log(\"b 桌子碰撞 this:\",b, this, this.canDown);\r\n }\r\nreturn true\r\n // return { v_this: new_v, v_b: new_bv };\r\n }\r\n return false;\r\n }",
"title": ""
},
{
"docid": "38e549b2e56f1f98167e591db482522d",
"score": "0.6543548",
"text": "function EnemyBullet(speed, pos, rot) {\n this.sprite = new BABYLON.Sprite(\"bullet\", bulletSprites);\n this.sprite.size = 5;\n this.sprite.position = pos;\n this.speed = speed;\n\n // this mesh is only used for BABYLON.Mesh's built in functions like local axis movement which sprites dont have (simpler than doing the math myself)\n this.mesh = BABYLON.Mesh.CreateSphere(\"empty\", 1, 5, scene);\n this.mesh.position = pos;\n //this.mesh.rotationQuaternion = new BABYLON.Quaternion(rot.x,rot.y,rot.z,rot.w);\n this.mesh.rotation = rot;\n\n this.mesh.isVisible = false;\n this.lifeTime = 3000;\n\n this.mesh.physicsImpostor = new BABYLON.PhysicsImpostor(this.mesh, BABYLON.PhysicsImpostor.SphereImpostor, {\n mass: 0,\n restitution: 0,\n nativeOptions: {\n collisionFilterMask: PLAYER_MASK + GROUND_MASK,\n collisionFilterGroup: ENEMY_BULLET_MASK,\n }\n }, scene);\n\n var that = this;\n for (var i=0; i<walls.length; i++) {\n this.mesh.physicsImpostor.registerOnPhysicsCollide(walls[i].physicsImpostor, function (main, collided) {\n that.dead = true;\n });\n }\n\n this.mesh.physicsImpostor.registerOnPhysicsCollide(player.mesh.physicsImpostor, function(main, collided) {\n if(!that.dead) {\n player.hurt(1);\n that.dead = true;\n }\n });\n simonBulletList.push(this);\n}",
"title": ""
},
{
"docid": "cc287c4e13659119f7493a7f89eeb7cd",
"score": "0.65368426",
"text": "checkCollision() {\n if (this.state === __WEBPACK_IMPORTED_MODULE_1__HeroStates__[\"a\" /* default */].IDLE_STATE) return;\n this.game.heroes.forEach((hero) => {\n if (hero === this) return;\n if (this.isColliding(this.sprite, hero.sprite)) {\n if (this.state === __WEBPACK_IMPORTED_MODULE_1__HeroStates__[\"a\" /* default */].ATTACK_STATE || this.state === __WEBPACK_IMPORTED_MODULE_1__HeroStates__[\"a\" /* default */].JUMP_ATTACK_STATE) {\n hero.onHit(this.normalAttack);\n }\n }\n });\n }",
"title": ""
},
{
"docid": "2f5ae052cbe7a3c5871e499aaddd991d",
"score": "0.65366143",
"text": "function detectCollision() {\n\tvar object = [];\n\tgame.quadTree.getAllObjs(object);\n\tfor (var x = 0, len = object.length; x < len; x++) {\n\t\tgame.quadTree.findObjs(obj = [], object[x]);\n\t\tfor (y = 0, length = obj.length; y < length; y++) {\n\t\t\tif (object[x].collidableWith === obj[y].type &&\n\t\t\t\t(object[x].x < obj[y].x + obj[y].width &&\n\t\t\t object[x].x + object[x].width > obj[y].x &&\n\t\t\t\t object[x].y < obj[y].y + obj[y].height &&\n\t\t\t\t object[x].y + object[x].height > obj[y].y)) {\n\t\t\t\tobject[x].isColliding = true;\n\t\t\t\tobj[y].isColliding = true;\n\t\t\t}\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "b71020b2436ac557055574e0261db3e2",
"score": "0.6536281",
"text": "function checkCollision(player1, player2) {\n playerOne.liveAmmo\n .filter(function (e) {\n return utils.hasCollided(e, playerTwo);\n })\n .forEach(function (e) {\n // explosion at the center of ammo\n explosionArr.push(new Explosion(e.x+e.halfWidth, e.y+e.halfHeight));\n impactSound.play();\n e.remove = true;\n playerTwoLife.update(e.damage);\n });\n\n playerTwo.liveAmmo\n .filter(function (e) {\n return utils.hasCollided(e, playerOne);\n })\n .forEach(function (e) {\n explosionArr.push(new Explosion(e.x+e.halfWidth, e.y+e.halfHeight));\n impactSound.play();\n e.remove = true;\n playerOneLife.update(e.damage);\n });\n\n explosionArr = explosionArr.filter(\n function(e) {\n return (!e.remove);\n });\n\n explosionArr.forEach(\n function(e) {\n e.render(context);\n })\n playerOneLife.render(context);\n playerTwoLife.render(context);\n }",
"title": ""
},
{
"docid": "cea657817d8ac72e27edcffb2de32823",
"score": "0.65307695",
"text": "function sbCollideBullets(bullet, sb)\n\t{\n\t\tvar x = sb.x;\n\t\tvar y = sb.y;\n\t\t\n\t\tsb.kill();\n\t\tbullet.kill();\n\t\t\n\t\tvar explosion = explosions.getFirstExists(false);\n\t\t\texplosion.reset(x, y);\n\t\t\texplosion.animations.add('explosion',[0,1,2,3,4,5,6,7,8,9,10]);\n\t\t\texplosion.animations.play('explosion',30,false,true);\n\t\t\t\n\t\texplosion_sound.play();\n\t}",
"title": ""
},
{
"docid": "afb59d5b690257b4d31407a5d79f4a6b",
"score": "0.65179557",
"text": "function PlayerBullet(){}",
"title": ""
},
{
"docid": "3aa489abff770f87a1db95c973988fbb",
"score": "0.6517298",
"text": "hitPlayer(bullet, player){\n console.log('hitt');\n this.healthHurt();\n this.screamSound.play();\n //player.disableBody(true, true);\n bullet.disableBody(true, true);\n\n }",
"title": ""
},
{
"docid": "ff87b483de6e40441c88ea3c481480f1",
"score": "0.65166306",
"text": "testCollide(entity, test = {ship: true, wall: true, bullet: true}) {\n var bounds = this.getBounds(entity);\n\n var collisions = {\n ship: [],\n wall: [],\n bullet: [],\n }\n\n var result = false;\n\n for (var x = bounds.x1; x <= bounds.x2; x++) {\n for (var y = bounds.y1; y <= bounds.y2; y++) {\n //console.log(x + \" | \" + y);\n if (!this.grid[x] || !this.grid[x][y])\n continue;\n\n var ships = this.grid[x][y].ships;\n var bullets = this.grid[x][y].bullets;\n var walls = this.grid[x][y].walls;\n\n for (var i = 0; i < Math.max(ships.length, bullets.length, walls.length); i++) {\n if (test.ship && i < ships.length && ships[i].collide(entity) && collisions.ship.indexOf(ships[i]) == -1) {\n collisions.ship.push(ships[i]);\n }\n if (test.wall && i < walls.length && walls[i].collide(entity) && collisions.wall.indexOf(walls[i]) == -1) {\n collisions.wall.push(walls[i]);\n ///console.log(bounds);\n }\n if (test.bullet && i < bullets.length && bullets[i].collide(entity) && collisions.bullet.indexOf(bullets[i]) == -1) {\n collisions.bullet.push(bullets[i]);\n }\n }\n }\n }\n return collisions;\n }",
"title": ""
},
{
"docid": "2e2210fe756bdc2a95a0a97729f242ac",
"score": "0.6515319",
"text": "function createCollision() {\r\n\r\n}",
"title": ""
},
{
"docid": "fa134aa688a33f5f482932b74d2c4e62",
"score": "0.6507525",
"text": "collision() {\n if (this.gameState === gameState.RUNNING) {\n this.characterCollision(this.char);\n if (this.level.levelItems.length > 0 && this.interact) {\n this.itemCollision(this.char, this.level);\n this.interact = false;\n }\n }\n }",
"title": ""
},
{
"docid": "d4fd549b67d90d29c0f0c49ff6359bf1",
"score": "0.6497001",
"text": "function checkCollision() {\n dots.forEach( dot => {\n if (dot.pos.x >= canvas.width - 1 || dot.pos.x <= 0) {\n dot.speed.x = dot.speed.x * -1\n } else if (dot.pos.y >= canvas.height - 1 || dot.pos.y <= 0) {\n dot.speed.y = dot.speed.y * -1\n }\n })\n}",
"title": ""
},
{
"docid": "8c11418d01ed950be24d71348fe473a4",
"score": "0.6495833",
"text": "fire() {\r\n function makeFlechette(angle = mech.angle + 0.02 * (Math.random() - 0.5)) {\r\n const me = bullet.length;\r\n bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45, 1.4, b.fireAttributes(angle));\r\n bullet[me].collisionFilter.mask = tech.pierce ? 0 : cat.body; //cat.mobShield | //cat.map | cat.body |\r\n Matter.Body.setDensity(bullet[me], 0.00001); //0.001 is normal\r\n bullet[me].endCycle = simulation.cycle + 180;\r\n bullet[me].dmg = 0;\r\n bullet[me].immuneList = []\r\n bullet[me].do = function() {\r\n const whom = Matter.Query.collides(this, mob)\r\n if (whom.length && this.speed > 20) { //if touching a mob \r\n who = whom[0].bodyA\r\n if (who && who.mob) {\r\n if (tech.pierce) {\r\n let immune = false\r\n for (let i = 0; i < this.immuneList.length; i++) {\r\n if (this.immuneList[i] === who.id) immune = true\r\n }\r\n if (!immune) {\r\n this.immuneList.push(who.id)\r\n who.foundPlayer();\r\n if (tech.isFastDot) {\r\n mobs.statusDoT(who, 3.78, 30)\r\n } else {\r\n mobs.statusDoT(who, 0.63, tech.isSlowDot ? 360 : 180)\r\n }\r\n simulation.drawList.push({ //add dmg to draw queue\r\n x: this.position.x,\r\n y: this.position.y,\r\n radius: 40,\r\n color: \"rgba(0,80,80,0.3)\",\r\n time: simulation.drawTime\r\n });\r\n }\r\n } else {\r\n this.endCycle = 0;\r\n if (tech.isFlechetteExplode && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {\r\n // mobs.statusStun(who, 120)\r\n this.explodeRad = 300 + 60 * Math.random();\r\n b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end\r\n }\r\n who.foundPlayer();\r\n if (tech.isFastDot) {\r\n mobs.statusDoT(who, 3.78, 30)\r\n } else {\r\n mobs.statusDoT(who, 0.63, tech.isSlowDot ? 360 : 180)\r\n }\r\n simulation.drawList.push({ //add dmg to draw queue\r\n x: this.position.x,\r\n y: this.position.y,\r\n radius: 40,\r\n color: \"rgba(0,80,80,0.3)\",\r\n time: simulation.drawTime\r\n });\r\n }\r\n }\r\n } else if (Matter.Query.collides(this, map).length) { //stick in walls\r\n this.collisionFilter.mask = 0;\r\n Matter.Body.setAngularVelocity(this, 0)\r\n Matter.Body.setVelocity(this, {\r\n x: 0,\r\n y: 0\r\n });\r\n this.do = function() {}\r\n } else if (this.speed < 30) {\r\n this.force.y += this.mass * 0.0007; //no gravity until it slows down to improve aiming\r\n }\r\n };\r\n const SPEED = 50\r\n Matter.Body.setVelocity(bullet[me], {\r\n x: mech.Vx / 2 + SPEED * Math.cos(angle),\r\n y: mech.Vy / 2 + SPEED * Math.sin(angle)\r\n });\r\n World.add(engine.world, bullet[me]); //add bullet to world\r\n }\r\n makeFlechette()\r\n if (tech.isFlechetteMultiShot) {\r\n makeFlechette(mech.angle + 0.02 + 0.005 * Math.random())\r\n makeFlechette(mech.angle - 0.02 - 0.005 * Math.random())\r\n }\r\n\r\n const CD = (mech.crouch) ? 50 : 20\r\n if (this.lastFireCycle + CD < mech.cycle) this.count = 0 //reset count if it cycles past the CD\r\n this.lastFireCycle = mech.cycle\r\n if (this.count > ((mech.crouch) ? 8 : 1)) {\r\n this.count = 0\r\n mech.fireCDcycle = mech.cycle + Math.floor(CD * b.fireCD); // cool down\r\n const who = bullet[bullet.length - 1]\r\n Matter.Body.setDensity(who, 0.00001);\r\n } else {\r\n this.count++\r\n mech.fireCDcycle = mech.cycle + Math.floor(2 * b.fireCD); // cool down\r\n }\r\n }",
"title": ""
},
{
"docid": "ed481793bb351a2f34ffd7d4245e4dae",
"score": "0.6494538",
"text": "Update() {\n // detect keys to make movement\n this.detectPressedKeys();\n // detect the bullet collision\n this.detectBulletCollision(this.bulletAList, this.playerB);\n this.detectBulletCollision(this.bulletBList, this.playerA);\n // detect the base collision\n this.detectBaseCollision(this.baseA, this.playerA);\n this.detectBaseCollision(this.baseB, this.playerB);\n // detect bullet collision with each other\n this.detectDestructablesBulletCollision(this.bulletAList, this.bulletBList);\n // detect bullet collision with jellyfish from player A\n this.detectJellyfishAndBulletCollision(this.bulletAList, this.jellyfish);\n // detect bullet collision with jellyfish from player B\n this.detectJellyfishAndBulletCollision(this.bulletBList, this.jellyfish);\n // update health and bullet label\n this.detectPlayerHealth();\n }",
"title": ""
},
{
"docid": "d6750688f11d5d406f4be3be24ae03c3",
"score": "0.6486654",
"text": "function check_collisions()\n\t{\n\t\tfor (var i = 1; i < obj_arr.length; i++)\n\t\t\tfor (var j = 0; j < i; j++)\n\t\t\t\thandle_collision_check(obj_arr[i], obj_arr[j]);\n\t\t\n\t\tfunction handle_collision_check(a, b)\n\t\t{\n\t\t\tif (a.shape == b.shape)\n\t\t\t{\n\t\t\t\tswitch (a.shape)\n\t\t\t\t{\n\t\t\t\t\tcase 'circle':\n\t\t\t\t\t\thandle_circle(a, b);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'rectangle':\n\t\t\t\t\t\thandle_rect(a, b);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (a.shape == 'circle')\n\t\t\t\t\thandle_circle_rectangle(a, b);\n\t\t\t\telse\n\t\t\t\t\thandle_circle_rectangle(b, a);\n\t\t\t}\n\t\t}\n\n\t\tfunction handle_circle(a, b)\n\t\t{\n\t\t\tvar dim_a = a.get_real_dimensions(),\n\t\t\t\tdim_b = b.get_real_dimensions();\n\n\t\t\tfunction square(x)\n\t\t\t{\n\t\t\t\treturn x * x;\n\t\t\t}\n\n\t\t\tvar dis_sqrd = square(dim_a.position.x - dim_b.position.x) + square(dim_a.position.y - dim_b.position.y);\n\t\t\tvar rad_sum_sqrd = square(dim_a.radius + dim_b.radius);\n\n\t\t\tif (dis_sqrd <= rad_sum_sqrd)\n\t\t\t\thandle_callbacks(a, b);\n\t\t}\n\n\t\tfunction handle_rectangle(a, b)\n\t\t{\n\t\t}\n\n\t\t// a is circle, b is rectangle\n\t\tfunction handle_circle_rectangle(a, b)\n\t\t{\n\t\t}\n\n\t\tfunction handle_callbacks(a, b)\n\t\t{\n\t\t\ta.game_object.run_physics_cb(b.game_object);\n\t\t\tb.game_object.run_physics_cb(a.game_object);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "74ba4971d5e05d2644b24f517b85869a",
"score": "0.6479746",
"text": "collisionOps () {\n const collidedObject = this.checkForCollisions() || {}\n if (collidedObject.id) {\n Ui.triggerByCollision('PLAYER', collidedObject.id)\n } else {\n Ui.triggerByCollision('PLAYER')\n }\n }",
"title": ""
},
{
"docid": "16595dd3ad49f76d138d80ce901ea696",
"score": "0.64780706",
"text": "shootAI(){\r\n\t\tvar ebullet = enemyBullets.create(this.x, this.y).setScale(0.3);\r\n var direction = Math.atan((player.y-this.y)/(player.x-this.x));\r\n ebullet.setVelocityX(175 * Math.cos(direction));\r\n ebullet.setVelocityY(175 * Math.sin(direction));\r\n if(player.x - this.x < 0 && player.y - this.y >= 0) {\r\n ebullet.setVelocityY(-175 * Math.sin(direction));\r\n ebullet.setVelocityX(-175 * Math.cos(direction));\r\n }\r\n if(player.x - this.x < 0 && player.y - this.y < 0) {\r\n ebullet.setVelocityY(-175 * Math.sin(direction));\r\n ebullet.setVelocityX(-175 * Math.cos(direction));\r\n }\r\n ebullet.body.setCollideWorldBounds(true).setBounce(1);\r\n }",
"title": ""
},
{
"docid": "c0e2a999d604fedffc3aeaaf21460b99",
"score": "0.64668775",
"text": "drawPlayerBullet (context) {\n for (let i = 0; i < this.bullets.length; i++) {\n this.bullets[i].draw(context);\n this.bullets[i].moveBullet()\n }\n }",
"title": ""
},
{
"docid": "bf2a7888f7743c4ed3e019fe2c3266f3",
"score": "0.6464035",
"text": "function detectCollision() {\n\tvar vector = new THREE.Vector3( 1, camera.position.y, 1 );\n\tvar ray = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize());\n\tvar intersects = ray.intersectObjects( collisionList );\n\t// Stop movement if less than 5 units away from collidable object\n\tif ( intersects.length > 0 && intersects[0].distance < 5) {\n\t\t// Disable all movement except backwards\n\t\tcontrols.moveForward = false;\n\t\tcontrols.moveRight = false;\n\t\tcontrols.moveLeft = false;\n\t}\n\n}",
"title": ""
},
{
"docid": "0c9dafed5ac7eb7a93a16410582b05b2",
"score": "0.6461952",
"text": "function checkPlayerCollision() {\n // When the player touches a character, store the character object in an \"array\", in a variable\n let touchedCharacter = $($playerCharacter).collision('.characterPerimeter'); // function from the library extension \"jquery-collision\"\n // When the player touches a paper roll, store the paper roll object in an \"array\", in a variable\n let touchedPaperRoll = $($playerCharacter).collision('.paperRollPerimeter');\n // When the player touches a hand sanitizer, store it in an \"array\", in a variable\n let touchedSanitizer = $($playerCharacter).collision('.sanitizerPerimeter');\n // When the player touches a glove, store it in an \"array\", in a variable\n let touchedGlove = $($playerCharacter).collision('.glovePerimeter');\n // When the player touches a mask, store it in an \"array\", in a variable\n let touchedMask = $($playerCharacter).collision('.maskPerimeter');\n // When the player touches an overall, store it in an \"array\", in a variable\n let touchedOverall = $($playerCharacter).collision('.overallPerimeter');\n\n // If the \"array\" with the touched character contains more than 0 object...\n if (touchedCharacter.length > 0) {\n if (playerProtected === false) {\n contactWithVirus += 10;\n }\n }\n\n // If the \"array\" with the touched toilet paper rolls contains more than 0 object...\n if (touchedPaperRoll.length > 0) {\n // Add 1 to the score\n score += 1;\n // And change its position and roatation angle to a random one\n displayElement($(touchedPaperRoll[0]));\n // Display the new score\n $('#score').html(score);\n // Display protection equipment according to the score\n displayProtection();\n }\n\n // If the \"array\" with the touched hand sanitizer contains more than 0 object...\n if (touchedSanitizer.length > 0) {\n // Remove the sanitizer\n $('.sanitizerPerimeter').remove();\n // After a delay of 8 seconds, display another sanitizer randomly in the body\n displaySanitizer();\n // Lower the level of contact with the virus\n contactWithVirus -= 20;\n }\n\n // If the \"array\" with the touched glove contains more than 0 object...\n if (touchedGlove.length > 0) {\n // Set the gotGlove state to true;\n gotGlove = true;\n // Remove the glove\n $('.glovePerimeter').remove();\n // Change the opacity of the glove image in the protection items box\n $('#protectionGlove').css(\"opacity\", \"1\");\n }\n\n // If the \"array\" with the touched mask contains more than 0 object...\n if (touchedMask.length > 0) {\n // Set the gotMask state to true;\n gotMask = true;\n // Remove the mask\n $('.maskPerimeter').remove();\n // Change the opacity of the mask image in the protection items box\n $('#protectionMask').css(\"opacity\", \"1\");\n }\n\n // If the \"array\" with the touched overall contains more than 0 object...\n if (touchedOverall.length > 0) {\n // Set the gotOverall state to true;\n gotOverall = true;\n // Remove the overall\n $('.overallPerimeter').remove();\n // Change the opacity of the overall image in the protection items box\n $('#protectionOverall').css(\"opacity\", \"1\");\n }\n\n // If the player collected the glove, the mask and the overall...\n if (gotGlove === true && gotMask === true && gotOverall === true) {\n // Set the timer bar (green div) opacity to 0.8\n $('#timerBar').css(\"opacity\", \"0.8\");\n // Write text in the timer bar to tell the player he has to press a key\n $('#timerBar').html(\"Press any key for immunity\");\n $('.protectionCollected').css(\"opacity\", \"0.25\");\n }\n}",
"title": ""
},
{
"docid": "39d6f872bda4d43a77a2cf742b6c47a7",
"score": "0.6452393",
"text": "function handleProjectileCollision(other_object){\n // If collided with brick, set correct flag\n if(other_object.name === \"BRICK\"){\n hasBallHitStructure = true;\n }\n }",
"title": ""
},
{
"docid": "29ac29f14ab586d15c8d5c0b6b0ebcdd",
"score": "0.6447814",
"text": "function collisionHandler (bullet, bubble) {\n\n bullet.kill();\n\n if (bubble.width * 0.5 > 20) {\n\n bubble.scale.setTo(0.3, 0.3);\n }\n else {\n\n bubble.kill(); \n bubbles.remove(bubble);\n }\n}",
"title": ""
},
{
"docid": "947fb79c50f783f77615745b8c15cd2a",
"score": "0.64454913",
"text": "function Bullet(x, y, game) {\n this.x = x;\n this.y = y;\n this.done = false;\n \n this.draw = function(ctx){\n ctx.fillStyle = \"green\";\n if (this.done == false){\n ctx.fillRect(this.x, this.y-18, 1, 2);\n }\n }\n \n this.move = function(ctx, invaders) {\n ctx.clearRect(this.x, this.y-18, 1, 2);\n this.y -= 18;\n this.draw(ctx);\n this.hit(ctx, invaders);\n }\n \n //check whether the invaders are hit by Bullet, and if so, increase the game score\n this.hit = function(ctx, invaders) {\n for(var i = 0; i < invaders.length; i++){\n if(this.x >= (invaders[i].x - invaders[i].width/2) && \n this.x <= (invaders[i].x + invaders[i].width/2) &&\n this.y >= (invaders[i].y - invaders[i].height/2) && \n this.y <= (invaders[i].y + invaders[i].height/2)\n && invaders[i].dead == false && this.done == false) { \n game.score += invaders[i].type;\n //update the front invader\n if (invaders[i].isFront==true){\n game.updateFront(invaders[i].row, invaders[i].column);\n }\n invaders[i].remove(ctx); \n this.remove(ctx);\n break;\n }\n }\n }\n \n this.remove = function(ctx) {\n ctx.clearRect(this.x, this.y-18, 1, 2);\n this.done = true;\n delete this.x;\n delete this.y;\n }\n}",
"title": ""
},
{
"docid": "a0f56623f1396ae8d4c1aa8a94e37616",
"score": "0.6445346",
"text": "function Bullet(){\n this.scrX = 225;\n this.scrY = 1080;\n this.width = 30;\n this.height = 20;\n this.speed = 3;\n this.drawX = -20;\n this.drawY = 0;\n this.explosion = new Explosion();\n}",
"title": ""
},
{
"docid": "2b46c531037b20f1dd68f76ce1a13097",
"score": "0.64448166",
"text": "function EnemyBullet(){}",
"title": ""
},
{
"docid": "0513a1b6ec9f832cddb5dd9a0e1eeacc",
"score": "0.6436492",
"text": "static bulletCalculator(drones) {\n if (Array.isArray(drones)) {\n for(let i = 0;i < drones.length; i ++) {\n let curDrone = drone[i];\n let curBullets = curDrone.bullets;\n // Calculate bullets coords\n if (curDrone.firing && curBullets) {\n\n } else {\n \n }\n }\n }\n }",
"title": ""
},
{
"docid": "1bc339b42bf8c6c4a9158ea26c4c4c12",
"score": "0.64361566",
"text": "collides(ptl, pbr) {//player dimensions\r\n\r\n var topLeft = createVector(this.position.x - this.diameter/2, this.position.y-this.diameter/2);\r\n var bottomRight = createVector(this.position.x + this.diameter/2, this.position.y + this.diameter/2);\r\n var playerSize = bottomRight.x - topLeft.x;\r\n if ((ptl.x <bottomRight.x && pbr.x > topLeft.x) &&( ptl.y < bottomRight.y && pbr.y > topLeft.y)) {\r\n\r\n if (dist(this.position.x, this.position.y, (ptl.x + pbr.x) /2.0, (ptl.y + pbr.y) /2.0)< this.diameter/2 + sqrt(playerSize*playerSize *2)/2) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"title": ""
}
] |
ee722a593fd606f0712a5f58ce14bc41 | Identify Polynomial Power (n) If it is a symbol x returns its degree 1, if it is a power of integer returns its exponent otherwise returns null | [
{
"docid": "2ddb63a182b3db219298eca6edb6ea76",
"score": "0.8908409",
"text": "function identify_polynomial_power(n)\n{\n if(kind(n) == OP_POW && is_symbol(n.children[0], \"x\"))\n {\n if(kind(n.children[1]) == NODE_INT && n.children[1].value >= 0)\n {\n return n.children[1].value;\n }else{\n return null;\n }\n }\n else if(is_symbol(n, \"x\"))\n {\n return 1;\n }else\n {\n return null;\n }\n}",
"title": ""
}
] | [
{
"docid": "b80ddab962b071587f56f6e6c468759a",
"score": "0.77396065",
"text": "function identify_polynomial_mul(n)\n{\n if(free_of_symbol(n, \"x\"))\n {\n return 0; // 0 degree\n }\n else if(kind(n) == OP_MUL)\n {\n var d;\n for(var i=0; i<n.children.length; i++)\n {\n d = identify_polynomial_power(n.children[i]);\n if(d != null)\n {\n return d;\n }\n }\n }else{\n var d = identify_polynomial_power(n);\n if(d != null)\n {\n return d;\n }\n }\n return null;\n}",
"title": ""
},
{
"docid": "56cc536d2ce3e0643b8d3a4f3dfc2451",
"score": "0.6744368",
"text": "function pow(x, n){\n let r = x;\n if (n === 0){\n r = tenToBits(1);\n } else {\n for (let i = 1; i < n; i++){\n r = mult(r, x);\n }\n }\n return r;\n }",
"title": ""
},
{
"docid": "74484ca96ccb9b5924ab8d3a7ea30f75",
"score": "0.66641605",
"text": "function identify_polynomial_degree(node)\n{\n var degree = 0;\n if(kind(node) == OP_ADD)\n {\n for(var i=0; i<node.children.length; i++)\n {\n var n = operand(node, i);\n var d = identify_polynomial_mul(n);\n if(d == null) return null;\n if(d > degree)\n {\n degree = d;\n }\n }\n return degree;\n }\n else if(kind(node) == OP_MUL)\n {\n var d = identify_polynomial_mul(node);\n if(d == null) return null;\n if(d > degree)\n {\n degree = d;\n }\n return degree;\n }\n else\n {\n var d = identify_polynomial_power(node);\n if(d == null) return null;\n if(d > degree)\n {\n degree = d;\n }\n return degree;\n }\n return null;\n}",
"title": ""
},
{
"docid": "c84d01acc7d693430d5af7bc3592c688",
"score": "0.66102546",
"text": "function specialPolynomial(x, n) {\n let sum = 0;\n let k = 0;\n \n while(true) {\n sum += Math.pow(x, k);\n if(sum > n) {\n return --k;\n } else {\n k++;\n }\n }\n}",
"title": ""
},
{
"docid": "f68aabc6938639a318586e7f36783e0c",
"score": "0.6498358",
"text": "function pow(n,x) {\n\treturn Math.pow(n,x);\n}",
"title": ""
},
{
"docid": "3e25730ab96cea4db07b081b93694e4d",
"score": "0.64449763",
"text": "function coefficients_of_polynomial(node)\n{\n var degree = identify_polynomial_degree(node);\n // maximum of polynomial x^100\n if(degree > 100) return null;\n if(degree != null && degree)\n {\n var coefficients = [];\n for(var i=0; i<=degree; i++){ coefficients[i] = [createInteger(0)]; }\n if(kind(node) == OP_ADD)\n {\n for(var i=0; i<node.children.length; i++)\n {\n if(free_of_symbol(node.children[i], \"x\"))\n {\n coefficients[0].push(node.children[i]);\n }\n else\n {\n coefficients[1].push(term_of(node.children[i], createNode(NODE_SYM, \"x\")));\n for(var j=2; j<=degree; j++)\n {\n coefficients[j].push(term_of(node.children[i], construct(OP_POW, createNode(NODE_SYM, \"x\"), createNode(NODE_INT, j))));\n }\n }\n }\n }\n else\n {\n if(free_of_symbol(node, \"x\"))\n {\n coefficients[0].push(node);\n }\n else\n {\n coefficients[1].push(term_of(node, createNode(NODE_SYM, \"x\")));\n for(var j=2; j<=degree; j++)\n {\n coefficients[j].push(term_of(node, construct(OP_POW, createNode(NODE_SYM, \"x\"), createNode(NODE_INT, j))));\n }\n }\n }\n for(var i=0; i<=degree; i++){ coefficients[i] = automatic_simplify(construct(OP_ADD, coefficients[i])); }\n return coefficients;\n }\n return null;\n}",
"title": ""
},
{
"docid": "cf6962c29946308e1beff8b29846acf5",
"score": "0.63987124",
"text": "function pow(x,n) {\n return x ** n ;\n}",
"title": ""
},
{
"docid": "0d640b316b54c4a03505da8059db9f0a",
"score": "0.6288681",
"text": "function powerOfNumber(number, p) { return Math.pow(number, p); }",
"title": ""
},
{
"docid": "5f32e33b55f160b775240278a11dd6fe",
"score": "0.62686706",
"text": "function pow(x, n) {\n if (n != 1) return x * pow(x, n - 1);\n else return x;\n \n }",
"title": ""
},
{
"docid": "57a96db7e0936006d072a714c109f1a3",
"score": "0.6257069",
"text": "function exponenet(n, pow) {\n console.log(n);\n while(n >= pow) {\n return;\n }\n \n return exponenet(n**pow, pow)\n}",
"title": ""
},
{
"docid": "0146cde50c8d3b65c8a2a04f21805b03",
"score": "0.6253604",
"text": "function pow(x, n) {\n return n > 0 ? x ** n : alert(\"степень n < 0\");\n}",
"title": ""
},
{
"docid": "653780e917d070f6d798f52ac4323658",
"score": "0.6246074",
"text": "function pow(x, n){\n if (n == 1){\n return x;\n }\n else{\n return x * pow(x, n - 1);\n }\n}",
"title": ""
},
{
"docid": "57c04217749745ed4b35d55186576fd2",
"score": "0.6212831",
"text": "function poly(w,x) {\n s = 0\n for (var i = 0; i < w.length; i++) { s = s + w[i]*Math.pow(x,i) }\n return s\n }",
"title": ""
},
{
"docid": "2502791470529fd04569b62ccfdf868f",
"score": "0.619527",
"text": "function poly(w,x) {\n\ts = 0\n\tfor (var i = 0; i < w.length; i++) { s = s + w[i]*Math.pow(x,i) }\n\treturn s\n}",
"title": ""
},
{
"docid": "8dcd2eb97b5a9f722d65127ea153152b",
"score": "0.61840016",
"text": "function solve_polynomial(node)\n{\n // verify if it is a simple polynomial with one element\n if(kind(node) == OP_POW && is_symbol(node.children[0], \"x\"))\n {\n return { symbolic: [createInteger(0)], numeric: [] };\n }\n var hash = {};\n var roots = [];\n var numeric_roots = [];\n var coefficients = coefficients_of_polynomial(node);\n // maximum of x^100 in polynomial_degree\n while(coefficients != null && coefficients.length > 0)\n {\n var root = get_polynomial_root(coefficients);\n if(Array.isArray(root))\n {\n // if fails with symbolic method, uses bairstows\n if(root.length == 0)\n {\n numeric_roots = numeric_roots.concat(numeric_solve_polynomial(coefficients));\n return { symbolic: roots.sort(compare), numeric: numeric_roots.sort(compare) };\n }\n for(var i=0; i<root.length; i++)\n {\n var s = stringEquation(root[i]);\n if(!(s in hash))\n {\n hash[s] = 1;\n roots = roots.concat(root[i]);\n }\n }\n }\n else\n {\n var s = stringEquation(root);\n if(!(s in hash))\n {\n hash[s] = 1;\n roots = roots.concat(root);\n }\n }\n if(coefficients.length <= 3) return { symbolic: roots.sort(compare), numeric: numeric_roots.sort(compare) };\n coefficients = briot_ruffini(coefficients, root);\n }\n return { symbolic: roots.sort(compare), numeric: numeric_roots.sort(compare) };\n}",
"title": ""
},
{
"docid": "b93fbb42663d18f61c614d31d72ca01d",
"score": "0.6163546",
"text": "function recursiveExponent(n, pow) {\n console.log(n);\n if(n >= pow) return;\n return recursiveExponent((n ** pow), pow)\n}",
"title": ""
},
{
"docid": "44be91f2412107edbae87365cd54c898",
"score": "0.6153852",
"text": "function legendre_symbol(a, p) {\n ls = mod_exp(a, (p - 1n) / 2n, p)\n if (ls == p - 1n)\n return -1n\n return ls\n}",
"title": ""
},
{
"docid": "b27a88203f82d34131b356c22e9fac6e",
"score": "0.6125382",
"text": "function powerOfNumber(x, n) {\r\n\tconsole.log(\"x = \" + x + \"; n = \" + n);\r\n\treturn (n != 1) ? x * powerOfNumber(x, n - 1) : x;\r\n}",
"title": ""
},
{
"docid": "fc1d6b80cc73b8f83035e50a8524de0b",
"score": "0.6120801",
"text": "function power(base, power, n) {\n let result = BigInt(1);\n const twoBN = BigInt(2);\n\n while (power > 0) {\n // if power id odd\n if (power % twoBN == 1) {\n result = (result * base) % n;\n }\n\n power = power / twoBN;\n base = (base * base) % n;\n }\n\n return result;\n}",
"title": ""
},
{
"docid": "ea918eb577745c532f29c1cd6fc288be",
"score": "0.6111533",
"text": "function mathPow(n) {\n let num = Math.pow(n, 420);\n console.log(num);\n\n}",
"title": ""
},
{
"docid": "572c465549a55c8f10c3d8e3455dbec9",
"score": "0.60888",
"text": "function pow(p) {\n if (p) {\n return math.pow(10, p);\n } else {\n return 1;\n }\n }",
"title": ""
},
{
"docid": "837205a1fa4ba70eec6dedc263196580",
"score": "0.6074394",
"text": "function pow (base, exponent){\n if ( exponent!= 0 )\n return (base * pow ( base, exponent-1 ));\n else \n \n return 1;\n \n }",
"title": ""
},
{
"docid": "96ed3d0ac098db6fd75368884602f0ad",
"score": "0.60564005",
"text": "function pow(n){\n return Math.pow(this,n);\n}",
"title": ""
},
{
"docid": "3bbb9f7735c6e4ab5da22f3e9acfc7be",
"score": "0.6050521",
"text": "function toTheNthPower(number, power) {\nvar x = 1;\nfor (var i = 0; i < power; i++) {\n x *= number;\n }\n return x;\n}",
"title": ""
},
{
"docid": "c6081eb97d73a164b0546ae90b08edae",
"score": "0.6039637",
"text": "function pow(x, n) {\n let result = x;\n for (let i = 1; i < n; i++) {\n result *= x;\n }\n alert(x + \" ^ \" + n + \" = \" + result);\n}",
"title": ""
},
{
"docid": "8936fd40262cb7be776171fb77700405",
"score": "0.6037016",
"text": "function pow (x, n){\n return false;\n}",
"title": ""
},
{
"docid": "43d666a49fb90f1945b6787ac289cfbc",
"score": "0.5992684",
"text": "function power(base,exponent) {\n return base ** exponent\n}",
"title": ""
},
{
"docid": "2f782c2a1d6b090eb651fa28b8f8f02b",
"score": "0.5954554",
"text": "function power(base, exp){\n if (exp === 0) return 1\n if (exp === 1) return base\n return base * power(base, exp - 1)\n}",
"title": ""
},
{
"docid": "fa5ed3dde03741d48953daeb718163ac",
"score": "0.59510666",
"text": "function power(base, expon) {\n if (expon == 0) {\n return 1;\n } else {\n return base * power(base, expon--);\n }\n }",
"title": ""
},
{
"docid": "993bc5ab25e265fdd05834163476270b",
"score": "0.5939356",
"text": "function selfpow(num, power) {\r\n \"use strict\";\r\n let n = Number(num);\r\n let p = Number(power);\r\n if(n >= -Infinity && n <= Infinity && p >= -Infinity && p <= Infinity) {\r\n if(n == 0)\r\n return 0;\r\n if(p == 0)\r\n return 1;\r\n if(n == 1 || p == 1)\r\n return n;\r\n if(p < 0)\r\n return 1/(selfpow(n, -p));\r\n if(Number(isFinite(n)) == 0 )\r\n return n;\r\n if(Number(isFinite(p)) == 0)\r\n return p;\r\n if((n < 0 ) && (p > 0 && p < 1))\r\n return NaN;\r\n if(ifdecimalnumber(p))\r\n return n**p;\r\n let pow1=n;\r\n while (p > 1)\r\n {\r\n p=p-1;\r\n pow1=pow1*n;\r\n }\r\n return pow1;\r\n }\r\n return NaN;\r\n}",
"title": ""
},
{
"docid": "d51ae0932879d972082a646e9b202e55",
"score": "0.59368116",
"text": "function pow(x, n) {\n\tvar result = x;\n\n\twhile (--n) result *= x;\n\n\tlogger(result);\n\treturn result;\n}",
"title": ""
},
{
"docid": "d911bbd4eadc744512313cde4943763d",
"score": "0.5934502",
"text": "function power(base, exponent){\r\n\tif(exponent === 0){\r\n\t\treturn 1;\r\n\t} else{\r\n\t\treturn base*power(base, exponent-1);\r\n\t}\r\n}",
"title": ""
},
{
"docid": "6ccf6cba74e6c1e6ed94c4fd19282e22",
"score": "0.5929745",
"text": "function largestPower(n) {\n\n if (n === 1) {\n return [0, -1];\n }\n else if (n <= 4) {\n return [1, -1];\n }\n\n var root = Math.sqrt(n - 1);\n var array = [];\n\n for (var i = 2; i <= root; i++) {\n var j = Math.floor(Math.log(n) / Math.log(i));\n var curPower = i ** j;\n if (curPower < n) {\n array[curPower] ? array[curPower]++ : array[curPower] = 1;\n }\n }\n\n var keys = Object.keys(array);\n var lastKey = keys.pop();\n\n return [+lastKey, array[lastKey]];\n}",
"title": ""
},
{
"docid": "549b8d0eded2207a84cf3fe303f95e27",
"score": "0.590767",
"text": "function pow(a, n) {\r\n return Math.pow(a, n);\r\n}",
"title": ""
},
{
"docid": "0d6529f87d487c86fd72723a30124dc8",
"score": "0.58998233",
"text": "function getModofHighPow(n1, SX, n2) {\n maxExp = 2; //maximum power to compute at a time\n if (SX > maxExp) {\n return (\n ((Math.pow(n1, maxExp) % n2) *\n (getModofHighPow(n1, SX - maxExp, n2) % n2)) %\n n2\n );\n } else {\n return Math.pow(n1, SX) % n2;\n }\n}",
"title": ""
},
{
"docid": "a6c2149cffec97a2c76e93e9dd9657d3",
"score": "0.5894892",
"text": "function getPower(x,y) {\n\treturn Math.pow(x,y);\n}",
"title": ""
},
{
"docid": "92d32b123c93e8cd21e65fb484f482e2",
"score": "0.58866173",
"text": "function pow10(exp) {\n // Positive & zero\n if (exp >= 0) {\n if (exp < Double.POSITIVE_POWERS.length) {\n return Double.POSITIVE_POWERS[exp];\n }\n else {\n return Infinity;\n }\n }\n // Negative\n exp = -exp;\n if (exp > 0 && exp < Double.NEGATIVE_POWERS.length) {\n return Double.NEGATIVE_POWERS[exp];\n }\n else {\n return 0;\n }\n }",
"title": ""
},
{
"docid": "92d32b123c93e8cd21e65fb484f482e2",
"score": "0.58866173",
"text": "function pow10(exp) {\n // Positive & zero\n if (exp >= 0) {\n if (exp < Double.POSITIVE_POWERS.length) {\n return Double.POSITIVE_POWERS[exp];\n }\n else {\n return Infinity;\n }\n }\n // Negative\n exp = -exp;\n if (exp > 0 && exp < Double.NEGATIVE_POWERS.length) {\n return Double.NEGATIVE_POWERS[exp];\n }\n else {\n return 0;\n }\n }",
"title": ""
},
{
"docid": "92d32b123c93e8cd21e65fb484f482e2",
"score": "0.58866173",
"text": "function pow10(exp) {\n // Positive & zero\n if (exp >= 0) {\n if (exp < Double.POSITIVE_POWERS.length) {\n return Double.POSITIVE_POWERS[exp];\n }\n else {\n return Infinity;\n }\n }\n // Negative\n exp = -exp;\n if (exp > 0 && exp < Double.NEGATIVE_POWERS.length) {\n return Double.NEGATIVE_POWERS[exp];\n }\n else {\n return 0;\n }\n }",
"title": ""
},
{
"docid": "59b7a45d31738101eeece722f5cecee4",
"score": "0.58839077",
"text": "pow(a, x) {\n throw new Error(\"not supported operation\");\n }",
"title": ""
},
{
"docid": "59b7a45d31738101eeece722f5cecee4",
"score": "0.58839077",
"text": "pow(a, x) {\n throw new Error(\"not supported operation\");\n }",
"title": ""
},
{
"docid": "939e5e232e26e04d634f404de05f3543",
"score": "0.5877913",
"text": "function powMod(x, y, n) {\n var ans = expand(x, n.length);\n powMod_(ans, trim(y, 2), trim(n, 2), 0); //this should work without the trim, but doesn't\n return trim(ans, 1);\n }",
"title": ""
},
{
"docid": "77f4809dd4b36d247a04ce6c575521a3",
"score": "0.5868466",
"text": "function power(base, powerOf) {\n return Math.pow(base, powerOf)\n}",
"title": ""
},
{
"docid": "67291ddcc02cb84f954a2aed11ed8845",
"score": "0.586313",
"text": "function power(base, exponent){\n if(exponent === 0)\n return 1;\n else\n return base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "a0fe374c046428d7923b00037e5b0cee",
"score": "0.58531183",
"text": "function pow(base, exponent)\n{\n return Math.pow(base, exponent);\n}",
"title": ""
},
{
"docid": "72eff50c8936b065ddc47ecb8d66a5ab",
"score": "0.5847753",
"text": "function power(base, exp){\n if (exp === 0) return 1;\n return base * power(base, exp - 1)\n}",
"title": ""
},
{
"docid": "ac27a013889246ebf876ba9bf0577db2",
"score": "0.5840407",
"text": "function power(base, exp){\n if(exp === 0) return 1;\n return base * power(base, exp - 1)\n}",
"title": ""
},
{
"docid": "e83977e94758f8a280eb5b466df583bb",
"score": "0.58377075",
"text": "function pow(x,n)\n{\n var result = 1;\n for(var i=0;i<n;i++) {\n result*=x;}\n return result;\n}",
"title": ""
},
{
"docid": "3e1b03f2766fd565ca9a181887c274b7",
"score": "0.58048",
"text": "function power(base, exponent){\n if(exponent === undefined)\n exponent = 2;\n var result = 1;\n for(var count = 0; count < exponent; count++)\n result *= base;\n return result;\n}",
"title": ""
},
{
"docid": "a2869c82d6850500a5cec589865554a2",
"score": "0.58035904",
"text": "function power(base, exponent){\r\n if (exponent == undefined)\r\n exponent = 2;\r\n var result = 1;\r\n for(var count = 0; count < exponent; count++)\r\n result *=base;\r\n return result;\r\n}",
"title": ""
},
{
"docid": "ca19cdc684f693adaa9934baa697552f",
"score": "0.5801153",
"text": "toThePowerOf(exponent) {\n // Compute the results up until the requested exponent, where every value is computed from its\n // predecessor. This is because `this.base^(exponent - 1)` only has to be multiplied by `base`\n // to reach `this.base^exponent`.\n for (let i = this.exponents.length; i <= exponent; i++) {\n const value = this.exponents[i - 1].multiplyBy(this.base);\n this.exponents[i] = new BigIntForMultiplication(value);\n }\n return this.exponents[exponent];\n }",
"title": ""
},
{
"docid": "40f05df38b5bd89e9dedf80290caf078",
"score": "0.58000875",
"text": "toThePowerOf(exponent) {\n // Compute the results up until the requested exponent, where every value is computed from its\n // predecessor. This is because `this.base^(exponent - 1)` only has to be multiplied by `base`\n // to reach `this.base^exponent`.\n for (let i = this.exponents.length; i <= exponent; i++) {\n const value = this.exponents[i - 1].multiplyBy(this.base);\n this.exponents[i] = new BigIntForMultiplication(value);\n }\n return this.exponents[exponent];\n }",
"title": ""
},
{
"docid": "1a981c29cbc2d1185c1bc649464fe140",
"score": "0.57982904",
"text": "function NthPower(num, power){\n var result = 1\n for(var i = 0; i < power; i++) {\n result *= number;\n }\n return results;\n}",
"title": ""
},
{
"docid": "32b406466f07272f98f9c0a926aa8d1e",
"score": "0.57974666",
"text": "function power(num, pow){\r\n if(pow === 0) {\r\n return 1\r\n }\r\n return num*power(num,(pow-1))\r\n}",
"title": ""
},
{
"docid": "1bad887a1f0ac37d4133114cff4b1616",
"score": "0.5789232",
"text": "exponent() { // Prestige currency exponent\n\t\texp = new Decimal(1)\n\t\tif(inChallenge(\"w\", 11)) {exp = exp.div(2)}\n if(inChallenge(\"s\", 12)) {\n if(getBuyableAmount(\"p\", 21).eq(1)) exp = exp.div(1.30)\n }\n\t\treturn exp\n\t}",
"title": ""
},
{
"docid": "010605c07ab089b97c890cb0367176f4",
"score": "0.5777816",
"text": "function Power(x, n) {\n let ans = 1\n for (let counter = 0; counter < n; counter += 1) {\n ans = Multiply(ans, x)\n }\n return ans\n}",
"title": ""
},
{
"docid": "e8f78a3b10b710526cc7d49138a8760d",
"score": "0.57722145",
"text": "findPower(equationString){\n var power = equationString.match(/(\\d+)\\^(\\d+)/)\n var powerAsString = power[0].replace(/(\\d+)\\^(\\d+)/, \"Math.pow($1,$2)\")\n var powerResult = eval(powerAsString)\n var newEquation = equationString.replace(/(\\d+)\\^(\\d+)/, powerResult)\n return newEquation\n }",
"title": ""
},
{
"docid": "2260cbaba182be17c6be2d0708b5bb75",
"score": "0.57677233",
"text": "function pow2(n){\n var i = 0;\n var powers = [];\n while (i <= n){\n powers.push(Bin.bitsToString(pow(Bin.tenToBits(2), i)));\n i++;\n }\n return powers;\n}",
"title": ""
},
{
"docid": "d96ac6a224e49c72d8319295d6e9e46b",
"score": "0.576482",
"text": "function pow (r,e) {\n let power = r**e;\n return power;\n}",
"title": ""
},
{
"docid": "4ef17cf0347a418b2814bee743890f66",
"score": "0.57642406",
"text": "function power(number, exponent) {\n var result = 1;\n var counter = 0;\n while (counter < 10) {\n result = result * number;\n counter = counter + 1;\n }\n return result;\n}",
"title": ""
},
{
"docid": "78eed9c5742bb41c368104a443b6b7d9",
"score": "0.5759184",
"text": "function power(base, exponent) {\r\n\tif(exponent === undefined){\r\n\t\texponent = 2;\r\n\t}\r\n\tvar result = 1;\r\n\tfor (i=0; i<exponent; i++){\r\n\t\tresult*=base;\r\n\t}\r\n\treturn result;\r\n}",
"title": ""
},
{
"docid": "26f42c37bc8c61f206e9d2f230e43731",
"score": "0.57585466",
"text": "function pow(base, exponent) {\n if (exponent > 1) {\n return base * pow(base, exponent-1);\n } else if (exponent==0) {\n return 1;\n } else {\n return base;\n }\n}",
"title": ""
},
{
"docid": "005d51f6e461f1321b94156430dbdce4",
"score": "0.5751749",
"text": "function power(number, exponent) {\n if (exponent == 1)\n return number;\n else\n return number * power(number, exponent - 1);\n}",
"title": ""
},
{
"docid": "cee90a20a0ff8f47ccf0b7dec26efc05",
"score": "0.57472587",
"text": "function pow(a)\n{\n return a**a;\n}",
"title": ""
},
{
"docid": "ddcb188402a056eda703dc5a76356a14",
"score": "0.57467425",
"text": "function power(base, exponent) {\n if (exponent === 0) {\n return 1;\n } else if (exponent === 1) {\n return base;\n } else {\n return base * power(base, exponent - 1);\n }\n}",
"title": ""
},
{
"docid": "a636b042c2a3eb78ed36337040e5c89a",
"score": "0.57446015",
"text": "function power(base, exponent) {\n if (exponent == 0) {\n return 1;\n } else {\n return base * power(base, exponent - 1);\n }\n}",
"title": ""
},
{
"docid": "c761c7d65445e9d1296c5e66342d0637",
"score": "0.5743073",
"text": "function power(base, exponent) {\n\tif (exponent == 0)\n\t\treturn 1;\n\telse \n\t\treturn base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "bd1ca0cd2b7859d05ad8da9729052247",
"score": "0.57406914",
"text": "function power(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp % 2 === 0) {\n return power(base, parseInt(exp / 2)) * power(base, parseInt(exp / 2));\n } else {\n return (\n base * power(base, parseInt(exp / 2)) * power(base, parseInt(exp / 2))\n );\n }\n}",
"title": ""
},
{
"docid": "e06fe9fb886908fcccc88ef942a64bce",
"score": "0.57388204",
"text": "function pow2(x, n) {\n return (n == 1) ? x : (x * pow2(x, n - 1));\n}",
"title": ""
},
{
"docid": "ab1af83c8fe3e9d1a81c9f568646f1ce",
"score": "0.5732258",
"text": "function powMod(x, y, n) {\n var ans = expand(x, n.length);\n powMod_(ans, trim(y, 2), trim(n, 2), 0); //this should work without the trim, but doesn't\n return trim(ans, 1);\n}",
"title": ""
},
{
"docid": "9f7a50dcd4c666de194c644d633f64a5",
"score": "0.5723612",
"text": "function power(base, exponent) {\n if (exponent == 0) {\n return 1;\n } else {\n return base * power(base, exponent - 1);\n }\n}",
"title": ""
},
{
"docid": "bff778e31cf39c4a88f8d3700b3304c1",
"score": "0.5718893",
"text": "function getExponent (base, exponent) {\n return Math.pow(base, exponent)\n}",
"title": ""
},
{
"docid": "56f79d3edbf8805559aeacec743463ae",
"score": "0.5714674",
"text": "function pow(x,k) {\n return x.log().mul(k).exp()\n }",
"title": ""
},
{
"docid": "dfce2a0726278fea32435c10faf98b33",
"score": "0.5712611",
"text": "function power(base, exponent) {\n if (exponent === 0) return 1;\n return base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "1fa78ce6b38190a57b73b81c3ac5526a",
"score": "0.5701083",
"text": "function power(base, exponent) {\n // base : when exponent is equal to 1 stop function\n if (exponent === 0) {\n return 1;\n }\n\n return base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "c374a0a3d42789ee3bb9f81841eff642",
"score": "0.56986195",
"text": "function raiseToPower(exponent, number) {\n return number**exponent;\n}",
"title": ""
},
{
"docid": "13bb01c8962d4d30de79e83793acd0db",
"score": "0.569681",
"text": "function base(n){\n return function power(p){\n var result = 1;\n for(var i=0; i<n; i++){\n result *= p;\n }\n return result;\n };\n}",
"title": ""
},
{
"docid": "b458933cc140be789b1f8709fdf571bf",
"score": "0.56919795",
"text": "function power(base, exponent) {\n\tif (exponent === 0) {\n\t\treturn 1; \n\t}\n\treturn base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "484cc4d22966a4029e2f81c42f42e48e",
"score": "0.56767654",
"text": "function intPow(Ctor, x, n, pr) {\r\n\t var isTruncated,\r\n\t r = new Ctor(1),\r\n\r\n\t // Max n of 9007199254740991 takes 53 loop iterations.\r\n\t // Maximum digits array length; leaves [28, 34] guard digits.\r\n\t k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n\t external = false;\r\n\r\n\t for (;;) {\r\n\t if (n % 2) {\r\n\t r = r.times(x);\r\n\t if (truncate(r.d, k)) isTruncated = true;\r\n\t }\r\n\r\n\t n = mathfloor(n / 2);\r\n\t if (n === 0) {\r\n\r\n\t // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n\t n = r.d.length - 1;\r\n\t if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n\t break;\r\n\t }\r\n\r\n\t x = x.times(x);\r\n\t truncate(x.d, k);\r\n\t }\r\n\r\n\t external = true;\r\n\r\n\t return r;\r\n\t}",
"title": ""
},
{
"docid": "ebec4b6d5afcad08dfac6291d07d790d",
"score": "0.5675804",
"text": "function power(base, exp) {\n if(exp === 0) return 1;\n return base * power(base, exp - 1);\n}",
"title": ""
},
{
"docid": "93471fadecd9553eee6a0b364ffa6831",
"score": "0.5672063",
"text": "function power(num, pow) {\n if (pow === 0) {\n return 1;\n }\n\n return 2 * power(num, pow - 1);\n}",
"title": ""
},
{
"docid": "92423c2b852165b62dee3c423adacd2a",
"score": "0.5667323",
"text": "function power(base, exp) {\n let val = 1;\n if (exp === 0) return 1;\n\n val = base * power(base, exp - 1);\n return val;\n}",
"title": ""
},
{
"docid": "4a4bceabb4a014c7d30c63b4efa0fd94",
"score": "0.56586397",
"text": "function getPower(arr) {\n let power;\n const lessSignificantBits = arr.map(value => {\n if(value % 4 === 2 || value % 4 === 3) {\n return 1;\n }\n return 0;\n })\n\n return Math.floor(((lessSignificantBits[0] + 2 * lessSignificantBits[1] + 4 * lessSignificantBits[2] + 8 * lessSignificantBits[3] + 16 * lessSignificantBits[4] + 32 * lessSignificantBits[5]) * 40 / 63) + 30);\n}",
"title": ""
},
{
"docid": "9a37761d6feec76b21e48a46ade0107d",
"score": "0.56584185",
"text": "function power(base, exponent) {\n if (exponent === 0) {\n return 1;\n }\n return base * power(base, exponent - 1);\n}",
"title": ""
},
{
"docid": "04a9747b8352180ccf29dacfb5ea362d",
"score": "0.56582296",
"text": "function power(val, pow){\n if (pow == 1){\n return val;\n }\n else {\n return val * power(val, pow - 1);\n }\n}",
"title": ""
},
{
"docid": "abbf9fd211bdaf3eb8b5a61185dc1876",
"score": "0.56562096",
"text": "function power(x) \n{\n return function(power) \n {\n return Math.pow(x,power);\n }\n}",
"title": ""
},
{
"docid": "221c8a75b52004f0f8e92959076a58d8",
"score": "0.5650825",
"text": "function power(x,y){\n return console.log(Math.pow(x,y))\n }",
"title": ""
},
{
"docid": "498aeb8395dca8e527f94aaba44de3bb",
"score": "0.5650058",
"text": "findExponentialOf2(exponent) \n {\n try\n {\n var i;\n if (exponent > 0 && exponent < 31) \n {\n for (i = 0; i <= exponent; i++) \n {\n console.log(\"powerof2=\" + \"2^\" + i + \"=\" + Math.pow(2, i));\n }\n }\n else \n {\n console.log(\"enter valid number\")\n }\n }\n\n catch(err)\n {\n console.log(err);\n }\n }",
"title": ""
},
{
"docid": "fd869679acf25e96bbdd4fe2e1261e71",
"score": "0.5639254",
"text": "function power(base, exponent) {\r\n if (exponent == 0)\r\n return 1;\r\n\r\n return base * power(base, exponent - 1);\r\n}",
"title": ""
},
{
"docid": "05bba1935eaf81bf1f761cadbb19d424",
"score": "0.56336623",
"text": "function power(x) {\n return function(y) {\n return Math.pow(y, x);\n };\n}",
"title": ""
},
{
"docid": "310710dc75e69c250e39ab8cbfc2aec0",
"score": "0.5632277",
"text": "function exponent(expo, base){\n //write code here\n}",
"title": ""
},
{
"docid": "29a8b9c289773e840b98961357e5f5ea",
"score": "0.5626751",
"text": "function intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n }",
"title": ""
},
{
"docid": "29a8b9c289773e840b98961357e5f5ea",
"score": "0.5626751",
"text": "function intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n }",
"title": ""
},
{
"docid": "29a8b9c289773e840b98961357e5f5ea",
"score": "0.5626751",
"text": "function intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n }",
"title": ""
},
{
"docid": "29a8b9c289773e840b98961357e5f5ea",
"score": "0.5626751",
"text": "function intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n }",
"title": ""
},
{
"docid": "2149c90ef6e4f1b88778143c10d28fbf",
"score": "0.56248754",
"text": "function make_pow(n) {\n return function (x) {\n return Math.pow(x, n);\n }\n}",
"title": ""
},
{
"docid": "fa1acdf68f1623cfc50900c7ceb6958a",
"score": "0.5622839",
"text": "function power2(n) {\n if (typeof n !== 'number') \n return 'Not a number'; \n\n return n && (n & (n - 1)) === 0;\n}",
"title": ""
},
{
"docid": "17290425000d815d8630797ef07e6acb",
"score": "0.56217045",
"text": "function intPow(Ctor, x, n, pr) {\n var isTruncated,\n r = new Ctor(1),\n\n // Max n of 9007199254740991 takes 53 loop iterations.\n // Maximum digits array length; leaves [28, 34] guard digits.\n k = Math.ceil(pr / LOG_BASE + 4);\n\n external = false;\n\n for (;;) {\n if (n % 2) {\n r = r.times(x);\n if (truncate(r.d, k)) isTruncated = true;\n }\n\n n = mathfloor(n / 2);\n if (n === 0) {\n\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\n n = r.d.length - 1;\n if (isTruncated && r.d[n] === 0) ++r.d[n];\n break;\n }\n\n x = x.times(x);\n truncate(x.d, k);\n }\n\n external = true;\n\n return r;\n }",
"title": ""
},
{
"docid": "17290425000d815d8630797ef07e6acb",
"score": "0.56217045",
"text": "function intPow(Ctor, x, n, pr) {\n var isTruncated,\n r = new Ctor(1),\n\n // Max n of 9007199254740991 takes 53 loop iterations.\n // Maximum digits array length; leaves [28, 34] guard digits.\n k = Math.ceil(pr / LOG_BASE + 4);\n\n external = false;\n\n for (;;) {\n if (n % 2) {\n r = r.times(x);\n if (truncate(r.d, k)) isTruncated = true;\n }\n\n n = mathfloor(n / 2);\n if (n === 0) {\n\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\n n = r.d.length - 1;\n if (isTruncated && r.d[n] === 0) ++r.d[n];\n break;\n }\n\n x = x.times(x);\n truncate(x.d, k);\n }\n\n external = true;\n\n return r;\n }",
"title": ""
},
{
"docid": "17290425000d815d8630797ef07e6acb",
"score": "0.56217045",
"text": "function intPow(Ctor, x, n, pr) {\n var isTruncated,\n r = new Ctor(1),\n\n // Max n of 9007199254740991 takes 53 loop iterations.\n // Maximum digits array length; leaves [28, 34] guard digits.\n k = Math.ceil(pr / LOG_BASE + 4);\n\n external = false;\n\n for (;;) {\n if (n % 2) {\n r = r.times(x);\n if (truncate(r.d, k)) isTruncated = true;\n }\n\n n = mathfloor(n / 2);\n if (n === 0) {\n\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\n n = r.d.length - 1;\n if (isTruncated && r.d[n] === 0) ++r.d[n];\n break;\n }\n\n x = x.times(x);\n truncate(x.d, k);\n }\n\n external = true;\n\n return r;\n }",
"title": ""
}
] |
12193370b1667ad2ba84416dd307bfa5 | Click on an individual canvas box. IF you're not recording it'll allow you to edit a certain measure. | [
{
"docid": "2e4ded046a1a8084f243d61b17e9f73a",
"score": "0.66755784",
"text": "function clickToEdit() {\n jQuery(\"#sheet\").on('click', \".notesCanvas\", function() {\n console.log(\"ID\", this.id);\n if (playOption === \"stop\") editMeasure(this.id);\n })\n}",
"title": ""
}
] | [
{
"docid": "75fa221ba3bd2340153f6a27cd586646",
"score": "0.64693123",
"text": "function clickCanvas(e){\n let p = getEventPosition(e);\n emitter.emit('canvasClick', {\n x: p.x/1100,\n y: p.y/750,\n });\n}",
"title": ""
},
{
"docid": "f7cec862406f1ffb8d3e2de340443bd3",
"score": "0.6269123",
"text": "static function clicked(var mx, var my) {\n if(!draw_controls) return;\n if(draw_x<=mx && mx <=draw_x+volume_overlay.width && draw_y<=my && my <=draw_y+volume_overlay.height) {\n mute(!muted);\n }\n }",
"title": ""
},
{
"docid": "6f6b3dbb95b605ba24dc7a52db275166",
"score": "0.6249993",
"text": "function handleCanvasClick(event) {\n console.log('canvas clicked!');\n }",
"title": ""
},
{
"docid": "1f05118b1a1888f68f74f1553072ca41",
"score": "0.6174682",
"text": "onCanvasClick(event) {\n var x = event.pageX - this.canvas.offsetLeft - this.canvas.clientLeft;\n var y = event.pageY - this.canvas.offsetTop - this.canvas.clientTop;\n \n // When treasure chest is shown make new game\n if (this.treasureChest.isShown){\n this.newGame();\n }\n // Win the game when mouse click is close to treasure\n else if (this.treasureChest.getDistance(x, y) <= 48){\n this.updateUi(\"You won\");\n this.treasureChest.isShown = true;\n this.fireworks.isEnabled = true;\n }\n // Lose the game when no life is left\n else if (this.life == 0){\n this.updateUi(\"You lost\");\n this.treasureChest.isShown = true;\n }\n // Update life counter on wrong guess\n else{\n this.life--;\n this.updateUi(this.treasureChest.getHintMessage(x, y));\n }\n \n this.updateCanvas();\n }",
"title": ""
},
{
"docid": "3e5cdb22b61f6b67d01fc8dda8ddc415",
"score": "0.6150347",
"text": "function onClick(ev){\n var coords = getCanvasXY(ev);\n var x = coords[0];\n var y = coords[1];\n\n//here is the problem....how do we know we clicked on canvas\n/*var fig=stack.figures[stack.figureGetMouseOver(x,y,null)];\n if(CNTRL_PRESSED && fig!=null){\n TEMPORARY_GROUP.addPrimitive();\n stack.figureRemove(fig);\n stack.figureAdd(TEMPORARY_GROUP);\n }\n else if(stack.figureGetMouseOver(x,y,null)!=null){\n TEMPORARY_GROUP.primitives=[];\n TEMPORARY_GROUP.addPrimitive(fig);\n stack.figureRemove(fig);\n }*/\n//draw();\n}",
"title": ""
},
{
"docid": "ceb248745a4570badd8c3fbe8145caae",
"score": "0.60940063",
"text": "click(uictx){\n const curve = uictx.getHITTarget();\n if(curve){\n uictx.updateSelection(curve);\n } else {\n uictx.clearSelection();\n }\n }",
"title": ""
},
{
"docid": "9a22bbe31ff99b8cd392cc394482d7b8",
"score": "0.6056349",
"text": "function canvasClick() {\n drag = true;\n}",
"title": ""
},
{
"docid": "02fde3b0ffdaf5a8f7acf9d6542dc47c",
"score": "0.60456306",
"text": "function checkCanvasOn(e) {\n OPTIONS.canvasOn = ((e.target.id == OPTIONS.canvasID) && (document.activeElement.id != \"file-name-input\"));\n}",
"title": ""
},
{
"docid": "e953854c97e760524d30db42037f1957",
"score": "0.58267784",
"text": "function clickDown(event){\n x1 = event.clientX - canvas.offsetLeft;\n y1 = event.clientY;\n focus = dl.getObjectContaining(x1,y1);\n if (focus !== null){\n focus.change();\n\n for (var n=0; n<30; n++){\n var object = dl.getObject(n);\n if (focus === object){\n var i = n;\n }\n }\n currAudio = audio[i];\n currAudio.currentTime = 0;\n if (clicked){\n currAudio.play();\n }\n if (!clicked){\n currAudio.pause();\n }\n //gets the position in the array of the bubble Object that has been clicked on, so it plays or pauses a unique audio file that is in the same position in its own array\n //clicked keeps track of whether the bubble has been clicked on or not so it acts appropriately\n }\n}",
"title": ""
},
{
"docid": "dd01e2a0e1305dcf5569ddd604dfad0e",
"score": "0.58134115",
"text": "function handleCanvasClick(_event) {\n if (_event.shiftKey || _event.altKey) { //if one of the keys is pressed, get the player if there is one\n getPlayer(_event);\n }\n else if (EIA2_Endaufgabe_HannahDuerr.animation == false) { //only possible to shoot the ball if someone is at the ball\n shootBall(_event);\n }\n }",
"title": ""
},
{
"docid": "d3d8ab7c1ee463f4a09a437e201a193a",
"score": "0.57941645",
"text": "click(){\n updateToScreen(screens.gameScreen);\n }",
"title": ""
},
{
"docid": "7b1cb3c564f42bee1c2cd6917c9c1549",
"score": "0.57884806",
"text": "function click(ev, gl, canvas, a_Position) { \n var x = ev.clientX; // x coordinate of a mouse pointer\n var y = ev.clientY; // y coordinate of a mouse pointer\n var rect = ev.target.getBoundingClientRect();\n\n x = ((x - rect.left) - canvas.width / 2) / (canvas.width / 2);\n y = (canvas.height / 2 - (y - rect.top)) / (canvas.height / 2);\n coords = \"X: \" + x + \", Y: \" + y; //gets the x and y coordinate \n sendTextToHTML(coords, \"coord\"); //send the x and y coordinate to the html\n // Store the coordinates to g_points array\n g_points.push([x,y]);\n\n render(); // sends to render to draw\n}",
"title": ""
},
{
"docid": "ac5866270bfcae965174aa61fcb51b07",
"score": "0.5785897",
"text": "Click() {\n if (this.Handle)\n this.Handle.click();\n }",
"title": ""
},
{
"docid": "763aaf995b816ecab5340d6f19951b8f",
"score": "0.5729278",
"text": "onCanvasClick(e) {\n e.persist();\n\n this.setState({mouseIsDown:true});\n\n }",
"title": ""
},
{
"docid": "d374c2daac714fd4a95841ac774c1388",
"score": "0.57268095",
"text": "function respondToMouseDown(event){\n canvasMouseDown = 1;\n}",
"title": ""
},
{
"docid": "5ae66a4fe33debe09f0c8faedd417ba1",
"score": "0.5723043",
"text": "function clickReporter(event)\n{\n\tvar rect = canDiv.getBoundingClientRect();\n\tmouseX = event.clientX - rect.left;\n\tmouseY = event.clientY - rect.top;\n\t\n\tfor(var i = 0; i < screens.length; i++)\n\t{\n\t\tscreens[i].clickUpdate(mouseX, mouseY);\n\t}\n\t\n}",
"title": ""
},
{
"docid": "5c65d213c599d92894724221567761f2",
"score": "0.5714582",
"text": "function mouseClicked() {\r\n screens.onClick();\r\n if (!dragging) {\r\n if (m) m.checkFocus();\r\n }\r\n dragging = false;\r\n}",
"title": ""
},
{
"docid": "b97f32afd01c6a296eac437b86321e01",
"score": "0.5651354",
"text": "function ev_canvas(ev){\n\n\tev._x = ev.layerX;\n ev._y = ev.layerY;\n\n// user must select a tool before the function executes\t\n\tif (!tool_default){\n\t//alert('got to tool_default');\n\ttool= new draw_Pencil();\n\ttool_default = true;\n\t}\n\telse{\n\tvar func = tool[ev.type];\n if (func) {\n func(ev);\n }\n\t}\n// note:later add if !(func) send an alert \"you must select a tool\"\t\t\t\n}",
"title": ""
},
{
"docid": "0f07240fcd5160ac66c0fa2a05bd0263",
"score": "0.5651084",
"text": "click(event) {\n // Changes scoreboard\n event.target.value ? this.scoreboard[event.target.value]++ : null;\n\n // Updates counter\n this.answerCounter += 1;\n\n // If that is still questions to be printed,\n // prints next question, else\n // captures lead\n this.answerCounter !== this.contentArray.length ? this.printQuiz() : this.leadGenerator();\n\n // Gets the focus out of the button\n event.target.blur()\n }",
"title": ""
},
{
"docid": "05260117a79cf3fbc96eb33e543bd73b",
"score": "0.56381476",
"text": "function onObjectSelected(e) {\n \n console.log(e.target.get('type'));\n if (e.target.get('type') === 'textbox'){\n document.getElementById(\"canvas_panel\").style.display=\"none\";\n document.getElementById(\"text_panel\").style.display=\"block\";\n \n }\n else if (e.target.get('type') === 'image'){\n console.log(e.target.isType) \n document.getElementById(\"canvas_panel\").style.display=\"none\";\n document.getElementById(\"text_panel\").style.display=\"none\";\n document.getElementById(\"image_panel\").style.display=\"block\";\n }\n \n }",
"title": ""
},
{
"docid": "a17169189f2545d85d5f604bc88644fd",
"score": "0.5633658",
"text": "handleCanvasClick(canvas){\n const ctx = canvas.getContext('2d');\n\n if(this.filling){\n ctx.fillRect(0, 0, this.CANVAS_SIZE_WIDTH, this.CANVAS_SIZE_HEIGHT);\n }\n }",
"title": ""
},
{
"docid": "f71d64dad5267edd4606f73ecb5da3fa",
"score": "0.5633433",
"text": "function setup_click(context, pageNumber)\r\n{\r\n\t//clears googledrive save timer \r\n\tclearSaveTimer(); \r\n\t\t\r\n\t//closes css/submenu tabs\r\n\t//CanvasInfo[pageNumber].canvas.focus();\r\n\r\n\t//settings for user in case of collaboration/change\r\n\tcontext.globalCompositeOperation = PaintType.erase; \r\n\t\t\r\n\tcontext.lineWidth = DrawContext.lineWidth = PaintType.size*(MaxZoom - GlobalScale + 1);\t\r\n\t\t\r\n\tcontext.strokeStyle = DrawContext.strokeStyle = PaintType.color;\t\t\r\n\t\r\n\tcontext.globalAlpha = PaintType.opacity;\r\n\t\r\n\t//clears the redolist because the person made a change after the last undo/redo; prevents weird issues regarding non-chronological redo \r\n\tCanvasInfo[pageNumber].RedoList = new Array();\r\n}",
"title": ""
},
{
"docid": "24ab46bf53068636c2ab2bdd847af34d",
"score": "0.55929554",
"text": "function mouseClicked() {\n if(graphic) {\n gui_mouseClicked();\n }\n}",
"title": ""
},
{
"docid": "56a0466b5738db22273e278f6028c577",
"score": "0.5589555",
"text": "onCanvasClickUp(e) {\n e.persist();\n\n var mouseCoords = this.getMouseCoords(e);\n\n if (this.props.brush != Brushes.TEXT) {\n this.createDrawing(mouseCoords);\n }\n\n\n\n this.setState({mouseIsDown:false});\n }",
"title": ""
},
{
"docid": "cbe9963ab7fdec94aad5042c7f1d8b4a",
"score": "0.5580184",
"text": "function clickOn(el) {\n var xy = Ext.fly(el).getXY();\n jasmine.fireMouseEvent(el, 'click', xy[0], xy[1]);\n }",
"title": ""
},
{
"docid": "728180b8f87e0509a94a01920fc66340",
"score": "0.55792457",
"text": "function ev_canvas(ev) {\n if (ev.layerX || ev.layerX == 0) { // Firefox\n ev._x = ev.layerX;\n ev._y = ev.layerY;\n } else if (ev.offsetX || ev.offsetX == 0) { // Opera\n ev._x = ev.offsetX;\n ev._y = ev.offsetY;\n }\n\n // Call the event handler of the tool.\n var func = tool[ev.type];\n if (func) {\n func(ev);\n }\n }",
"title": ""
},
{
"docid": "d61aa5789b3a1cb61d2437ef301157ff",
"score": "0.5573069",
"text": "function ev_canvas (ev) {\n\t if (ev.layerX || ev.layerX == 0) { // Firefox\n\t ev._x = ev.layerX;\n\t ev._y = ev.layerY;\n\t } else if (ev.offsetX || ev.offsetX == 0) { // Opera\n\t ev._x = ev.offsetX;\n\t ev._y = ev.offsetY;\n\t }\n\n\t // Call the event handler of the tool.\n\t var func = tool[ev.type];\n\t if (func) {\n\t func(ev);\n\t }\n\t }",
"title": ""
},
{
"docid": "b7928e12441bb232e3ffa8d2b24077f9",
"score": "0.5564365",
"text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\t//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 35) {\n\t\t//Wrong ans 1\n\t\tif(mouseX >= 120 && mouseY >= 610 && mouseX <= 160 && mouseY <= 645)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 130 && mouseY >= 725 && mouseX <= 170 && mouseY <= 765)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 135 && mouseY >= 825 && mouseX <= 175 && mouseY <= 855)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 145 && mouseY >= 900 && mouseX <= 180 && mouseY <= 935)\n\t\t\tgreeting.html('Incorrect!');\n\t }\n}",
"title": ""
},
{
"docid": "36587e1feae08a9c8e4f9b0b6a1bbac1",
"score": "0.5559613",
"text": "function toolclick()\r\n{\t\r\n\tif (battleResultsBox.isVisible()) {\r\n\t\tbattleResultsBox.close();\r\n\t\t} else {\r\n\t\tbattleResultsBox.open();\r\n\t}\r\n calcResources(); //calculates the resources of the base clicked on\r\n}",
"title": ""
},
{
"docid": "2d6a8219e3c01d2ecfab1e72eae3e850",
"score": "0.5554988",
"text": "click() {\n this.game.click();\n }",
"title": ""
},
{
"docid": "167fe8cedfb6d4088d3c93e11e268946",
"score": "0.55500495",
"text": "function click(elm){\r\n var evt = document.createEvent('MouseEvents');\r\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n elm.dispatchEvent(evt);\r\n}",
"title": ""
},
{
"docid": "8881bbf989b1ed15e2f9568bfe50da85",
"score": "0.5547367",
"text": "function ev_canvas (ev) {\n if (ev.layerX || ev.layerX == 0) { // Firefox\n ev._x = ev.layerX;\n ev._y = ev.layerY;\n } else if (ev.offsetX || ev.offsetX == 0) { // Opera\n ev._x = ev.offsetX;\n ev._y = ev.offsetY;\n }\n\n // Call the event handler of the tool.\n var func = tool[ev.type];\n if (func) {\n func(ev);\n }\n\t\n }",
"title": ""
},
{
"docid": "cfca934c2a936571d39ce5713a20c2f6",
"score": "0.55407166",
"text": "click (e) {\n if (!this.dataExtents) return\n const x = e.clientX - this.rect.left\n const y = e.clientY - this.rect.y\n if (this.zoomInBttn.contains(x, y)) { this.zoom(true); return }\n if (this.zoomOutBttn.contains(x, y)) { this.zoom(false); return }\n const translator = this.plotRegion.translator(this.dataExtents)\n this.reporters.price(translator.unx(x))\n }",
"title": ""
},
{
"docid": "1351b2aa3baee50ed9970075c1a11041",
"score": "0.5533296",
"text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\t//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 137) {\n\t\t//Wrong ans 1\n\t\tif(mouseX >= 80 && mouseY >= 385 && mouseX <= 113 && mouseY <= 422)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 85 && mouseY >= 527 && mouseX <= 117 && mouseY <= 575)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 90 && mouseY >= 675 && mouseX <= 125 && mouseY <= 705)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 100 && mouseY >= 820 && mouseX <= 130 && mouseY <= 855)\n\t\t\tgreeting.html('Incorrect!');\n\t }\n}",
"title": ""
},
{
"docid": "cccddec226b7cd0d11bcf01f18079fe8",
"score": "0.55284333",
"text": "_onMouseDownSave(){\n const canvas = this._experimentWrapper.querySelector('canvas')\n canvas\n ?this._downloadFromAnchor(canvas)\n :this._htmlScreenshot()\n }",
"title": ""
},
{
"docid": "8407706661124e14b42c62505a7420ed",
"score": "0.5528146",
"text": "function clickCanvas(event)\n{\n var xVal = event.clientX;\n var yVal = event.clientY;\n\n if (xVal != null && yVal != null)\n {\n drawRect(xVal-10,yVal-10);\n\n var point = {x:xVal-10, y:yVal-10};\n points.push(point);\n }\n}",
"title": ""
},
{
"docid": "c887b84dd8155e91e569ef8003e770c0",
"score": "0.5527747",
"text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\t//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 168) {\n\t\t//Wrong ans 1\n\t\tif(mouseX >= 160 && mouseY >= 455 && mouseX <= 195 && mouseY <= 500)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 165 && mouseY >= 560 && mouseX <= 200 && mouseY <= 605)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 170 && mouseY >= 670 && mouseX <= 210 && mouseY <= 710)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 185 && mouseY >= 780 && mouseX <= 230 && mouseY <= 820)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 5\n\t\tif(mouseX >= 186 && mouseY >= 860 && mouseX <= 220 && mouseY <= 905)\n\t\t\tgreeting.html('Incorrect!');\n\t }\n}",
"title": ""
},
{
"docid": "6a8d78507822c6d232122d0db82e4fd2",
"score": "0.5523493",
"text": "clicked() {\n // console.log(\"sets the global removeDom to false\")\n removeDom = false\n\n\n this.selected = true\n // this.selected = false\n // console.log(\"show me info about this shape, remain selected?\")\n if(!this.openDOM) {\n this.DOM_mechInterface.display()\n this.openDOM = true\n }\n }",
"title": ""
},
{
"docid": "c20403615670343b67cf40efcc40aa74",
"score": "0.5513753",
"text": "function ev_canvas (ev) {\r\n if (ev.layerX || ev.layerX == 0) { // Firefox\r\n ev._x = ev.layerX;\r\n ev._y = ev.layerY;\r\n } else if (ev.offsetX || ev.offsetX == 0) { // Opera\r\n ev._x = ev.offsetX;\r\n ev._y = ev.offsetY;\r\n }\r\n\r\n // Call the event handler of the tool.\r\n var func = tool[ev.type];\r\n if (func) {\r\n func(ev);\r\n }\r\n }",
"title": ""
},
{
"docid": "582b8eaeb78c86f5e01974b5f58e3fe0",
"score": "0.55122316",
"text": "function focusCanvas () {\n canvas.focus();\n }",
"title": ""
},
{
"docid": "06cff6498317dd2a97c0adf0813e0aaa",
"score": "0.5505821",
"text": "clicked(evt) {\n if (!this.isInteractive) { return }\n \n const obj = evt.object3D\n this.raycaster.ray.set(obj.position, \n this.webLayer3D.getWorldDirection(new THREE.Vector3()).negate())\n const hit = this.webLayer3D.hitTest(this.raycaster.ray)\n if (hit) {\n hit.target.click()\n hit.target.focus()\n console.log('hit', hit.target, hit.layer)\n } \n }",
"title": ""
},
{
"docid": "f237bc0f4f025c15b6ce1facb2434d79",
"score": "0.55040485",
"text": "function mouseClicked() { // For testing\n}",
"title": ""
},
{
"docid": "7796d75ff719eb7ed2665d37f0d4ff3b",
"score": "0.55024385",
"text": "function editMouseUp(e) {\n\tallowDraw = false;\n\n\tif(erasing2) {\n\t\tvar ctx2 = document.getElementById(\"ElementCanvas\").getContext(\"2d\");\n\t\tEditInfo.data = ctx2.getImageData(0, 0, EditInfo.width, EditInfo.height);\n\t}\n}",
"title": ""
},
{
"docid": "f71e7ad43750b092e38b3cb56d7b4b13",
"score": "0.548932",
"text": "function overlay_click() {\n update_overlay_element(currently_selected_match_box_text, '', null, overlay_clicked_class, overlay_initial_class);\n }",
"title": ""
},
{
"docid": "673df60e3eb8bfb2b70d5ba84531aebf",
"score": "0.548525",
"text": "function toggleAframe() {\n $(document.activeElement).blur();\n $(layer2D).click();\n if (layer2D.checked) {\n setTimeout(function() {\n $(window).focus().click();\n }, 100);\n } else {\n setTimeout(function() {\n $(aframe).focus().click();\n }, 100);\n }\n }",
"title": ""
},
{
"docid": "e9a8c6f1393ac47b98e83cba0655e057",
"score": "0.54817563",
"text": "function toggleComplextvBox() {\n if (this.pressed == true) {\n tb_remain_open = false;\n cmnComplextvBoxClose();\n destroytb300ad();\n }\n else {\n tb_remain_open = true;\n tb300ad();\n closeAllOtherBoxes();\n cmnComplextvBoxOpen();\n }\n}",
"title": ""
},
{
"docid": "302906815f64164034e61baef8d70299",
"score": "0.5476838",
"text": "function Card_OnClick(e, args)\n\t{\t\n\t\tselectedcard = GameScene.items[ArrayFindIndexByName(GameScene.items, args[0])];\n\n\t\t//can't select after 2 are in use\n\t\tif (numcardsselected >= 2)\n\t\t\treturn;\n\t\t//can't select same card twice\n\t\tif (selectedcard == lastselectedcard)\n\t\t\treturn;\n\n\t\tif (selectedcard.IsFront == false)\n\t\t\tselectedcard.IsFront = true;\n\t\t\t\n\t\tUpdateCardDrawingList(selectedcard);\n\t\tnumcardsselected ++;\n\t\tif (numcardsselected == 1)\n\t\t{\n\t\t\tlastselectedcard = selectedcard;\n\t\t}\n\t\tif (numcardsselected == 2)\n\t\t{\n\t\t\t//pause inputs until lose/win animations are done\n\t\t\tMouseInputPaused = true;\n\t\t\t\n\t\t\tif (selectedcard.cardvalue == lastselectedcard.cardvalue)\n\t\t\t{\n\t\t\t\tAddCardWinGraphic(selectedcard);\n\t\t\t\tAddCardWinGraphic(lastselectedcard);\n\t\t\t\tsetTimeout(\"ClearMatchCardAnimation(true)\", CLEARCARDANIMATION_TIMEOUT);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsetTimeout(\"ClearMatchCardAnimation(false)\", CLEARCARDANIMATION_TIMEOUT);\n\t\t\t}\n\t\t}\n\t}",
"title": ""
},
{
"docid": "d4f7ffb56c82020f4bc9aa40180acb94",
"score": "0.5471043",
"text": "function mouseClicked() {\n click = true;\n scene = 2;\n}",
"title": ""
},
{
"docid": "d865a2237f42dda8f135ffbe6cd825e8",
"score": "0.5470368",
"text": "function mouseClicked(){//\n gameMan.mouseClick();\n}",
"title": ""
},
{
"docid": "3d61e5201985209c43036af220eb4b7c",
"score": "0.5468248",
"text": "function boxClick(numId) {\n box = document.getElementById(numId);\n ctx = box.getContext(\"2d\");\n\n switch (numId) {\n case \"canv1\":\n num = 1;\n break;\n case \"canv2\":\n num = 2;\n break;\n case \"canv3\":\n num = 3;\n break;\n case \"canv4\":\n num = 4;\n break;\n case \"canv5\":\n num = 5;\n break;\n case \"canv6\":\n num = 6;\n break;\n\n case \"canv7\":\n num = 7;\n break;\n case \"canv8\":\n num = 8;\n break;\n case \"canv9\":\n num = 9;\n break;\n }\n\n if (filled[num - 1] === false) {\n if (gameOver === false) {\n if (turn % 2 !== 0) {\n drawX();\n turn += 1;\n filled[num - 1] = true;\n\n if (winnerCheck(symbol, symbol[num - 1]) === true) {\n document.getElementById(\"result\").innerHTML =\n \"Player \" + symbol[num - 1] + \" won!\";\n speak(\"You can never win me \");\n speak(\"ha ha ha\");\n gameOver = true;\n }\n\n if (turn > 9 && gameOver !== true) {\n document.getElementById(\"result\").innerHTML =\n \"GAME OVER! IT WAS A DRAW\";\n speak(\"A competitive game I will admit\");\n return;\n }\n\n if (turn % 2 == 0) {\n playAI();\n }\n }\n } else {\n alert(\"GAME OVER, PLEASE START A NEW GAME\");\n }\n } else {\n alert(\"This box is already filled, Please select an empty box\");\n }\n }",
"title": ""
},
{
"docid": "d54497cc5b1f953145339c891d2456eb",
"score": "0.54677564",
"text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\tcreateDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 75) {\n\t\t//Right ans 1\n\t\tif(mouseX >= 45 && mouseY >= 430 && mouseX <= 85 && mouseY <= 470)\n\t\t\tgreeting.html('Correct!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 50 && mouseY >= 540 && mouseX <= 85 && mouseY <= 575)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 60 && mouseY >= 650 && mouseX <= 105 && mouseY <= 670)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 55 && mouseY >= 740 && mouseX <= 100 && mouseY <= 780)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 5\n\t\tif(mouseX >= 60 && mouseY >= 865 && mouseX <= 100 && mouseY <= 905)\n\t\t\tgreeting.html('Incorrect!');\n\t }\n}",
"title": ""
},
{
"docid": "8047f6fc8a801c1b85407b9d1851e5f7",
"score": "0.5451604",
"text": "function allowClick() {\n openCards[0].click(toggleCard);\n}",
"title": ""
},
{
"docid": "dce966ef9b88002a962147dfaed18baf",
"score": "0.54406536",
"text": "function canvasClicked(canvasNumber) {\n\ttheCanvas = \"canvas\"+canvasNumber;\n\tc = document.getElementById(theCanvas);\n\tcxt = c.getContext(\"2d\");\n\tif(sessionStorage.getItem(\"status\")=='playing' && !(box.classList.contains('disable')) ) {\n\t\tmHandler(canvasNumber, cxt);\n\t\treturn;\n\t}\n\tif(painted[canvasNumber-1] ==false) {\n\t\tif(turn%2==0) {\n\t\t\tcxt.beginPath();\n\t\t\tcxt.lineWidth = 5;\n\t\t\tcxt.moveTo(5,5);\n\t\t\tcxt.lineTo(45,45);\n\t\t\tcxt.moveTo(45,5);\n\t\t\tcxt.lineTo(5,45);\n\t\t\tcxt.stroke();\n\t\t\tcxt.closePath();\n\t\t\tcontent[canvasNumber-1] = 'X';\n\n\t\t\t//if cpu state is ON\n\t\t\tif(cpu.classList.contains(\"on\")) {\n\t\t\t\t// for the X who played before\n\t\t\t\tcontent[canvasNumber-1] = 'X';\n\t\t\t\tpainted[canvasNumber-1] = true;\n\t\t\t\tsquaresFilled++;\n\t\t\t\tturn++\n\t\t\t\tcheckForWinners(content[canvasNumber-1]);\n\t\t\t\tif(squaresFilled==9){\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttitle: \"Game Over\",\n\t\t\t\t\t\ttext: \"Want to try again?\",\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\tno: false,\n\t\t\t\t\t\t\tconfirm: \"Yes\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}).then( function(e) {\n\t\t\t\t\t\tif(e)\n\t\t\t\t\t\tclearCanvas();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//cpu turn\n\t\t\t\tvar move = getOptimalLocation(content);\n\t\t\t\tconsole.log(\"optimal value: \"+move);\n\t\t\t\tvar cxtn = document.getElementById(\"canvas\"+move).getContext(\"2d\");\n\t\t\t\tcxtn.beginPath();\n\t\t\t\tcxtn.lineWidth = 5;\n\t\t\t\tcxtn.arc(25,25,21,0,Math.PI*2,true);\n\t\t\t\tcxtn.stroke();\n\t\t\t\tcxtn.closePath();\n\n\t\t\t\tcontent[move-1] = 'O';\n\t\t\t\tpainted[move-1] = true;\n\t\t\t\tsquaresFilled++;\n\t\t\t\tturn++;\n\t\t\t\tcheckForWinners(content[move-1]);\n\n\t\t\t\tif(squaresFilled==9){\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttitle: \"Game Over!\",\n\t\t\t\t\t\ttext: \"Want to try again?\",\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\tno: false,\n\t\t\t\t\t\t\tconfirm: \"Yes\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}).then( function(e) {\n\t\t\t\t\t\tif(e)\n\t\t\t\t\t\tclearCanvas();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tcxt.beginPath();\n\t\t\tcxt.lineWidth = 5;\n\t\t\tcxt.arc(25,25,21,0,Math.PI*2,true);\n\t\t\tcxt.stroke();\n\t\t\tcxt.closePath();\n\t\t\tcontent[canvasNumber-1] = 'O';\n\t\t}\n\n\t\tturn++;\n\t\tpainted[canvasNumber-1] = true;\n\t\tsquaresFilled++;\n\t\tcheckForWinners(content[canvasNumber-1]);\n\n\t\tif(squaresFilled==9){\n\t\t\tswal({\n\t\t\t\ttitle: \"Game Over\",\n\t\t\t\ttext: \"Want to try again?\",\n\t\t\t\tbuttons: {\n\t\t\t\t\tno: false,\n\t\t\t\t\tconfirm: \"Yes\"\n\t\t\t\t}\n\t\t\t}).then( function(e) {\n\t\t\t\tif(e)\n\t\t\t\tclearCanvas();\n\t\t\t});\n\t\t}\n\t\n\t} \n\t// when canvas is already filled\n\telse {\n\t\tswal(\"Oops!\",\"The space is already occupied\",\"error\");\n\t}\n\n}",
"title": ""
},
{
"docid": "fd4809edb0f3661ea34d5b984e8751ac",
"score": "0.5437536",
"text": "function mouseClicked() {\n // If the mouse click happened on the painting area(not the button area)\n // Draw the selected figure over there.\n if(mouseY < startingButtonYPosition) {\n\t\tdrawSpiral(mouseX, mouseY, scaleSlider.value(), spiralRadio.value())\n }\n}",
"title": ""
},
{
"docid": "aadaf19d68fe17f3c78d072a8314863f",
"score": "0.5434769",
"text": "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\tcreateDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 45) {\n\t\t//Right ans 1\n\t\tif(mouseX >= 140 && mouseY >= 470 && mouseX <= 180 && mouseY <= 515)\n\t\t\tgreeting.html('Correct!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 155 && mouseY >= 590 && mouseX <= 190 && mouseY <= 630)\n\t\t\tgreeting.html('Correct!');\n\t\t//Right ans 3\n\t\tif(mouseX >= 165 && mouseY >= 685 && mouseX <= 195 && mouseY <= 730)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 165 && mouseY >= 790 && mouseX <= 205 && mouseY <= 825)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 4\n\t\tif(mouseX >= 180 && mouseY >= 880 && mouseX <= 210 && mouseY <= 930)\n\t\t\tgreeting.html('Correct!');\n\t }\n}",
"title": ""
},
{
"docid": "8ec600e841eb49afeb164ba0496254df",
"score": "0.5433898",
"text": "function click($event)\n {\n $event.stopPropagation();\n if (config.edit)\n {\n var width;\n\n if ($event.srcElement.className == 'rating_background') // clicked background\n {\n width = $event.srcElement.clientWidth;\n }\n else // clicked foreground\n {\n width = $event.srcElement.parentElement.clientWidth;\n }\n\n var rating = util.round( $event.offsetX / width , 2 );\n if (!isNaN(rating))\n {\n vm.game.rating = rating;\n calcStars();\n GameService.mdChanged('rating', vm.autosave, vm.game);\n }\n }\n }",
"title": ""
},
{
"docid": "3ae9b643cc19b392d9f41369d542733c",
"score": "0.5427541",
"text": "function firstCanvasMouseDown(ev) {\n app.x1 = (ev.offsetX * app.firstCanvas.width) / app.firstCanvas.clientWidth;\n app.y1 = (ev.offsetY * app.firstCanvas.height) / app.firstCanvas.clientHeight;\n\n app.clX = ev.clientX;\n app.clY = ev.clientY;\n app.isSelected = true;\n}",
"title": ""
},
{
"docid": "350db584d03325038d6dc33769f93f2b",
"score": "0.54255253",
"text": "addClickHandler() {\n this.renderer.canvas.addEventListener('click', (e) => {\n this.userRoll()\n })\n }",
"title": ""
},
{
"docid": "344823ec60c130ee17794d0ac4af53ed",
"score": "0.5417167",
"text": "function clickOnArea(evt) {\n\t\t\tnameOfChoosenArea = evt.currentTarget.name;\n\t\t\thoverAreaOut(evt);\n\t\t\t//לשנות את ה-IF ו ELSE שהתנאי ישאר נכון או יהפול לשקר בתלות בשאלה\n\t\t\tif (evt.currentTarget.clickR != true) {\n\t\t\t\tboard.getChildByName(nameOfChoosenArea).gotoAndStop(1);\n\t\t\t\tevt.currentTarget.clickR = true;\n\t\t\t\trandomQ();\n\t\t\t}\n\t\t} //clickOnArea Func",
"title": ""
},
{
"docid": "f726c85cecd76ea86e509f113556ce49",
"score": "0.5411472",
"text": "function clickedCase(square) {\n if(typeof blankTable[square.target.id] == 'number') {\n clicked(square.target.id, humanPlayer)\n if(!VerifyEgality()) clicked(bestTentative(), pcPlayer);\n }\n}",
"title": ""
},
{
"docid": "4df182ab9fa37dda2a2784c1fd5194c3",
"score": "0.5402028",
"text": "function open_failed_box(){ \n document.getElementById('canvas').style.display = 'none'; \n document.getElementById('model_failed').style.display = 'inline'; \n}",
"title": ""
},
{
"docid": "7000ce34ae8468d6ed4e301497ff38bb",
"score": "0.5390282",
"text": "mouseClick(ev) {\n // Print x,y coordinates.\n console.log(ev.clientX, ev.clientY);\n\n var shape = new Square(shader);\n this.scene.draw(shape);\n }",
"title": ""
},
{
"docid": "5c1f359ea15be66bf40a8164f3227eb7",
"score": "0.53884363",
"text": "mouseDown(event) {\n this.mouseIsDown = true;\n let image = new Image();\n image.src = this.canvasElement.toDataURL();\n let o = this.getXYFromEvent(event);\n this.clickPosition = {\n x: o.x,\n y: o.y,\n image,\n };\n this.pencilArray = [{ x: o.x, y: o.y }];\n }",
"title": ""
},
{
"docid": "a02b0f3650501d0f56b12950564e9861",
"score": "0.53859425",
"text": "function leftClick() {\n this.sprite.alpha = 0;\n box2 = new Box('box2.png');\n console.log('opened box');\n}",
"title": ""
},
{
"docid": "4591f3dbb5e62bc0dcae80d525550c66",
"score": "0.5385653",
"text": "function _onClickCanvas(evt) {\n\t// Validate game state.\n\tif(_numGameState == _enumGameState.ENDED || _numGameState == _enumGameState.NEW) {return;}\n\t// Declare and init prerequisites.\n\tvar objCell = _onGetCursorPosition(evt);\n\tvar objPiece = _objBoardCells[objCell.numRow][objCell.numColumn].objPiece;\n\t// Validate piece.\n\tif(objPiece && _objPlayerCurrent.numId == objPiece.numPlayerId) {\n\t\t_removePiece(objCell);\n\t\t_setPlayerScore(_objPlayerCurrent, objPiece);\n\t}\n\t// Prevent default action.\n\treturn false;\n}",
"title": ""
},
{
"docid": "230cc764f04658d52800739197f1170e",
"score": "0.5379032",
"text": "function pickBlock(evt){\n /* Get the mouse coordinates */\n var x = evt.pageX - canvas.offsetLeft;\n var y = evt.pageY - canvas.offsetTop;\n var panelSize = 50;\n /* Check if the click was within the side panel */\n if(x > 800 && x < 840){\n if(y > 35 && y < 85){ // Clicked on the penguin\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 35, panelSize, panelSize);\n selected = 'player';\n }else if(y > 120 && y < 170){ // Block\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 120, panelSize, panelSize);\n selected = 'block';\n }else if(y > 200 && y < 250){ // Slider\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 200, panelSize, panelSize);\n selected = 'slide';\n }else if(y > 280 && y < 330){ // Bomb\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 280, panelSize, panelSize);\n selected = 'bomb';\n }else if (y > 360 && y < 410){ // Finish\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 360, panelSize, panelSize);\n selected = 'finish';\n }else if (y > 440 && y < 490){ // Up Arrow\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 440, panelSize, panelSize);\n selected = 'up';\n }else if (y > 520 && y < 570){ // Right Arrow\n drawPanel(panelSize);\n ctx.fillStyle = \"rgba(128,128,128,0.75)\";\n ctx.fillRect(canvas.width - panelSize, 520, panelSize, panelSize);\n selected = 'right';\n }else if (y > 600 && y < 650){ // Play button\n playEditedGame();\n }\n }\n \n // If the user clicked somewhere in the canvas, place the selected block\n if(x < 800){\n var gridX, gridY;\n if(selected !== null && selected !== undefined){\n gridY = Math.floor(x/cellSize);\n gridX = Math.floor(y/cellSize);\n if(editGrid[gridX][gridY] !== undefined){\n return;\n }\n switch(selected){\n case 'player':{\n var p = new PlayerObj(gridX, gridY, cellSize, cellSize);\n p.drawFn();\n editGrid[gridX][gridY] = types.PLAYER;\n break;\n }\n case 'block':{\n var p = new BlockObj(gridX, gridY, cellSize, cellSize);\n p.drawFn();\n editGrid[gridX][gridY] = types.BLOCK;\n break;\n }\n case 'slide':{\n var p = new SlideObj(gridX, gridY, cellSize, cellSize);\n p.drawFn();\n editGrid[gridX][gridY] = types.SLIDE;\n break;\n }\n case 'bomb':{\n var p = new BombObj(gridX, gridY, cellSize, cellSize);\n p.drawFn();\n editGrid[gridX][gridY] = types.BOMB;\n break;\n }\n case 'finish':{\n var p = new FinishObj(gridX, gridY, cellSize, cellSize);\n p.drawFn();\n editGrid[gridX][gridY] = types.FINISH;\n break;\n }\n case 'up':{\n var p = new ArrowObj(gridX, gridY, cellSize, cellSize, \"u\");\n p.drawFn();\n editGrid[gridX][gridY] = \"u\";\n break;\n }\n case 'right':{\n var p = new ArrowObj(gridX, gridY, cellSize, cellSize, \"r\");\n p.drawFn();\n editGrid[gridX][gridY] = \"r\";\n break;\n }\n }\n }\n }\n}",
"title": ""
},
{
"docid": "5def562a0f1cf1633a83dadf5e2fca2c",
"score": "0.53683114",
"text": "function handleClicks(evt) {\n clicked = true;\n var mousePos = getMousePos(canvas, evt);\n mouseX = mousePos.x;\n mouseY = mousePos.y;\n}",
"title": ""
},
{
"docid": "dd967e7743dac0550ef8ea274b81129e",
"score": "0.53658926",
"text": "function focusCanvas(canvasName, self) {\n //setting the global focus\n focus = canvasName;\n //selecting all HTML elements with class name buttonx, in the form of an array\n var buttons = document.getElementsByClassName('buttonx');\n //itterating over elements to change their state\n for (var i = 0; i < buttons.length; i++) {\n //Removing classes\n if (buttons[i].classList.contains('bg--primary')) {\n buttons[i].classList.remove('bg--primary');\n } else {\n buttons[i].classList.remove('button-muted');\n }\n //Inserting the classes for visual representation of the button\n if (buttons[i] === self) {\n buttons[i].classList.add('bg--primary');\n } else {\n buttons[i].classList.add('bg--muted');\n }\n }\n //searching for the selected element and giving it focus\n part1Objects.forEach(function (element) {\n if (element.canvasName === canvasName) {\n element.canvas.focus();\n\n }\n });\n}",
"title": ""
},
{
"docid": "fdf7ff470a0aa77261075fd494f1250c",
"score": "0.5364642",
"text": "function ev_canvas (ev) {\n /*if (ev.layerX || ev.layerX == 0) { // Firefox\n ev._x = ev.//ev.layerX;\n ev._y = ev.layerY;\n } else if (ev.offsetX || ev.offsetX == 0) { // Opera\n ev._x = ev.offsetX;\n ev._y = ev.offsetY;\n }*/\n\tev._x = ev.pageX - canvas.offsetLeft;\n\tev._y = ev.pageY - canvas.offsetTop\n\n // Call the event handler of the tool.\n var func = tool[ev.type];\n if (func) {\n func(ev);\n }\n }",
"title": ""
},
{
"docid": "579e07a6b7eeb41f08ab3a2964068609",
"score": "0.53584605",
"text": "function canvasClick(event) {\n\t\t\n\t\tinitalX = event.pageX;\n\t\tinitalY = event.pageY;\n\t\tisMouseDown = true;\n\t\t\n\t\t\n\n\t\t$(document).ready(function(event){\n\t\t $(\"canvas\").bind(\"mousemove\",function(event){\n\t\t\t\t\n\t\t\t\t// In the drawing mode\n\t\t\t\tif (currentMode == \"Draw\") {\n\t\t\t\t\tif (isMouseDown){\n\t\t\t\t\tcanvas = document.getElementById(\"canvas\");\n\t\t\t\t\tcheckShape(event);\n\t\t\t\t\tdraw = canvas.getContext(\"2d\");\n\t\t\t\t\tdraw.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\tcurrentShape.draw();\n\t\t\t\t\tdrawShapes();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// On mouse Move move the selected Shape\n\t\t\t\tif (currentMode == \"Select\"){\n\t\t\t\t\tif (isMouseDown && currShape != null &&!enableCopy && !enableResize) {\n\t\t\t\t\tdraw.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\tcurrShape.x1 = event.pageX - x1Dif;\n\t\t\t\t\tcurrShape.y1 = event.pageY - y1Dif;\n\t\t\t\t\tcurrShape.x2 = event.pageX - x2Dif;\n\t\t\t\t\tcurrShape.y2 = event.pageY - y2Dif;\n\t\t\t\t\tdrawShapes();\n\t\t\t\t\tcurrShape.draw();\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// The Resize button is pressed\n\t\t\t\t\tif (isMouseDown && !enableCopy && enableResize){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tcoord1 = false;\n\t\t\t\t\t\t\tcoord2 = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ((Math.sqrt(Math.pow(newReSize.x1 - event.pageX, 2) + Math.pow(newReSize.y1 - event.pageY, 2))) < 30)\n\t\t\t\t\t\t\t\tcoord1 = true;\n\t\t\t\t\t\t\tif ((Math.sqrt(Math.pow(newReSize.x2 - event.pageX, 2) + Math.pow(newReSize.y2 - event.pageY, 2))) < 30){\n\t\t\t\t\t\t\t\tcoord2 = true;\n\t\t\t\t\t\t\t\tcoord1 = false;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\tif (coord1 || coord2){\n\t\t\t\t\t\t\t\tif (coord1){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tnewReSize.x1 = event.pageX;\n\t\t\t\t\t\t\t\t\tnewReSize.y1 = event.pageY;\n\t\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\n\t\t\t\t\t\t\t\tif (coord2){\n\t\t\t\t\t\t\t\t\tnewReSize.x2 = event.pageX;\n\t\t\t\t\t\t\t\t\tnewReSize.y2 = event.pageY;\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\n\t\t\t\t\t\t\t\tcanvas = document.getElementById(\"canvas\");\n\t\t\t\t\t\t\t\tdraw = canvas.getContext(\"2d\");\n\t\t\t\t\t\t\t\tdraw.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tnewReSize.draw();\n\t\t\t\t\t\t\t\tdrawSelectors(newReSize);\n\t\t\t\t\t\t\t\tdrawShapes();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t });\n\t\t $(\"canvas\").bind(\"mousedown\",function(event){\n\t\t\t// While Mouse Down get the Selected Event\n\t\t\tisMouseDown = true;\n\t\t\tif (currentMode == \"Select\"){\n\t\t\t\tif (currShape == null && !enableCopy && !enableResize){\n\t\t\t\tgetSelected(event);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// While Mouse is Down and Copy is enabled\n\t\t\tif (enableCopy){\n\t\t\t\tnewCopyShape = copy(copiedShape);\n\t\t\t\ttemp1 = copiedShape.x1;\n\t\t\t\ttemp2 = copiedShape.y1;\n\t\t\t\tnewCopyShape.x1 = event.pageX;\n\t\t\t\tnewCopyShape.y1 = event.pageY;\n\t\t\t\tnewCopyShape.x2 = event.pageX + Math.abs(temp1 - copiedShape.x2);\n\t\t\t\tnewCopyShape.y2 = event.pageY + Math.abs(temp2 - copiedShape.y2);\n\t\t\t\tdrawShapes();\n\t\t\t}\n\t\t\t\n\t\t\n\t\t });\n\t\t \n\t\t $(\"canvas\").bind(\"mouseup\",function(event){\n\t\t\t// On Mouseup draw the shape\n\t\t\t if (currentMode == \"Draw\"){\n\t\t\t\t if (isMouseDown) {\n\t\t\t\t\tisMouseDown = false;\n\t\t\t\t\tcheckShape(event);\n\t\t\t\t\t\n\t\t\t\t\tcanvas = document.getElementById(\"canvas\");\n\t\t\t\t\tdraw = canvas.getContext(\"2d\");\n\t\t\t\t\tif (currentMode == \"Draw\") {\n\t\t\t\t\t\tif ((currentShape.x1 != currentShape.x2) && (currentShape.y2 != currentShape.y1)){\n\t\t\t\t\t\t\tdrawnShapes.push(currentShape);\n\t\t\t\t\t\t\tdrawShapes();\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}\n\t\t\tif (currentMode == \"Select\"){\n\t\t\t\t\n\t\t\t\tnewShape = copy(currShape);\n\t\t\t\t//On Mouse up add the moved shaped to the drawnShapes array\n\t\t\t\tif (isMouseDown && currShape !== null && !enableResize && !enableCopy){\n\t\t\t\t\tisMouseDown = false;\n\t\t\t\t\tif (newShape !== null) {\n\n\t\t\t\t\t\tif (lastShape !== null && lastShape === currShape) {\n\t\t\t\t\t\tlastShape = newShape;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewShape.isSelected = true;\n\t\t\t\t\t\tdrawnShapes.push(newShape);\n\t\t\t\t\t\t\n\t\t\t\t\t\tcanvas = document.getElementById(\"canvas\");\n\t\t\t\t\t\tdraw = canvas.getContext(\"2d\");\n\t\t\t\t\t\tdraw.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tdrawShapes();\n\t\t\t\t\t\tcurrShape = null;\n\t\t\t\t\t\tx1Dif = 0;\n\t\t\t\t\t\tx2Dif = 0 ;\n\t\t\t\t\t\ty1Dif = 0;\n\t\t\t\t\t\ty2Dif = 0;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//on Mouse up add the resized shape to the drawnShapes\n\t\t\t\tif (enableResize && isMouseDown && newReSize != null && !enableCopy) {\n\t\t\t\t\n\t\t\t\t\tdrawnShapes.push(newReSize);\n\t\t\t\t\tnewReSize = null;\n\t\t\t\t\tdraw = canvas.getContext(\"2d\");\n\t\t\t\t\tdraw.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\t\tdrawShapes();\n\t\t\t\t\tisMouseDown = false;\n\t\t\t\t\tenableResize = false;\n\t\t\t\t\tconfirmResize();\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//on Mouse up add the copied shape to the drawnShapes\n\t\t\t\tif ( isMouseDown && enableCopy && !enableResize && newCopyShape != null){\n\t\t\t\t\t\tisMouseDown = false;\n\t\t\t\t\t\tdrawnShapes.push(newCopyShape);\n\t\t\t\t\t\tdrawShapes();\n\t\t\t\t\t\tnewCopyShape = null;\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\n\t\t\t});\n\t\t});\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"title": ""
},
{
"docid": "53e138f706f07e64ec69f1d8341920d4",
"score": "0.53575855",
"text": "mouseClick(x,y){\n var canvasPosition=new Pair(x,y);\n this.mapCanvasToWorld(canvasPosition);\n\t\t//var worldPosition=this.mapCanvasToWorld(canvasPosition);\n\t\tthis.player.setFire(true);\n\t}",
"title": ""
},
{
"docid": "094ea7684958719604f1f0fe4fc940eb",
"score": "0.5355773",
"text": "function mouseDown(event) {\n clickedX = event.pageX;\n moveableX = extendedCam.left;\n if (clickedX >= extendedCam.left && clickedX <= (extendedCam.left + extendedCam.width))\n clicked = 1;\n}",
"title": ""
},
{
"docid": "10857883517bf98c7f722826f60d317a",
"score": "0.5352177",
"text": "function mouseClicked() {\n\tvar size = random(0, width / 5); \n\tdrawEye(mouseX, mouseY, size);\n}",
"title": ""
},
{
"docid": "0bf4990353c383141c3886a3e6e4d528",
"score": "0.5348007",
"text": "function board_click(event) {\r\n var x = event.clientX - canvas.offsetLeft,\r\n y = event.clientY - canvas.offsetTop,\r\n clickedBlock = screenToBlock(x, y);\r\n\r\n if (selectedPiece === null) {\r\n checkIfPieceClicked(clickedBlock);\r\n } else {\r\n processMove(clickedBlock);\r\n }\r\n}",
"title": ""
},
{
"docid": "b226292fbd644dde89fb895b05eb135f",
"score": "0.5343819",
"text": "function onMouseUpCanvas(e) {\n var obj = canvas.getActiveObject();\n if(obj){\n if(obj.type == 'activeSelection'){\n var objs = obj._objects.filter(function(o) {\n if((o.type == 'text' && o.name == 'measurement') || o.type == 'line' || o.type == 'guideline'){\n o.opacity = 0;\n o.hasBorders = false;\n o.borderColor = 'transparent';\n }\n else {\n o.borderColor = '#eb2cf6';\n }\n });\n canvas.renderAll();\n canvas.setActiveObject(obj);\n var objsCheck = obj._objects.filter(function(oc){\n if((oc.type == 'text' && oc.name != 'measurement') && oc.type != 'line' && oc.type != 'guideline'){\n return o;\n }\n });\n if(objsCheck.length == 0){\n canvas.discardActiveObject().renderAll();\n }\n }\n if(obj && obj.type == 'ImageContainer'){\n if(obj.containerImage !== ''){\n obj.lockScalingX = true;\n obj.lockScalingY = true;\n obj.lockRotation = true;\n }\n }\n if(obj && typeof obj.hide_container !== 'undefined'){\n if(obj.hide_container == 1){\n obj.lockMovementX = true;\n obj.lockMovementY = true;\n obj.lockScalingX = true;\n obj.lockScalingY = true;\n obj.lockRotation = true;\n obj.selectable = false;\n obj.hasControls = false;\n obj.hasBorders = false;\n obj.set({\n opacity: 1,\n active: true,\n });\n console.log(\"hide_container refresh = \"+activeObject.hide_container);\n canvas.discardActiveObject();\n canvas.renderAll();\n }\n }\n updateCanvasState();\n }\n}",
"title": ""
},
{
"docid": "06b871c15f0b450e01a3a1f010dbe233",
"score": "0.5341749",
"text": "function click() {\n\n}",
"title": ""
},
{
"docid": "11571774957f7b7d8601f2b340e2ac8c",
"score": "0.5328013",
"text": "handleClick(event) {\n const { offsetX, offsetY } = event.nativeEvent;\n\n for (const box of this.state.boxes) {\n if (box.collidesWith(offsetX, offsetY)) {\n ipcRenderer.send('update-selection', box);\n }\n }\n }",
"title": ""
},
{
"docid": "c7d66cbf2d9d521dc586221138a0bed8",
"score": "0.5322364",
"text": "function mineFieldAreaClicked(row, col) {\n // Make sure the timer has started.\n startTimer();\n \n // get the mine field area button that was clicked\n var mineFieldAreaButton = document.getElementById('row' + row + 'col' + col);\n // if this button has already been disabled, there is no need to continue.\n if (mineFieldAreaButton.disabled == true) {\n\t return;\n }\n // if this button has been flagged, then do nothing.\n if (mineFieldAreaButton.innerHTML == 'F') {\n\t return;\n }\n // set the button text to show the mineFieldArray\n mineFieldAreaButton.innerHTML = mineFieldArray[col - 1][row - 1];\n \n // disable the button so it can't be clicked again\n mineFieldAreaButton.disabled = true;\n \n // if a bomb was clicked, show it.\n if (mineFieldArray[col - 1][row - 1] == 'B') {\n\t bombClicked();\n\t // there is nothing more to do\n\t return;\n }\n \n // if the area we clicked is a 0, then click all spots around it.\n if(mineFieldArray[col - 1][row - 1] == 0) {\n\t//top left\n\tif(col > 1 && row > 1) {\n\t\tmineFieldAreaClicked(row - 1, col - 1);\n\t}\n\t//top middle\n\tif(row > 1) {\n\t\tmineFieldAreaClicked(row - 1, col);\n\t}\n\t//top right\n\tif(col < cols && row > 1) {\n\t\tmineFieldAreaClicked(row - 1, col + 1);\n\t}\n\t//center left\n\tif(col > 1) {\n\t\tmineFieldAreaClicked(row, col - 1);\n\t}\n\t//center right\n\tif(col < cols) {\n\t\tmineFieldAreaClicked(row, col + 1);\n\t}\n\t//bottom left\n\tif(col > 1 && row < rows) {\n\t\tmineFieldAreaClicked(row + 1, col - 1);\n\t}\n\t//bottom middle\n\tif(row < rows) {\n\t\tmineFieldAreaClicked(row + 1, col);\n\t}\n\t//bottom right\n\tif(col < cols && row < rows) {\n\t\tmineFieldAreaClicked(row + 1, col + 1);\n\t}\n }\n\t\n\tareasNeededToClear = areasNeededToClear - 1;\n\tif (areasNeededToClear == 0) {\n\t\tgameWon();\n\t}\n}",
"title": ""
},
{
"docid": "d0b67281ce6b26acbda4ccecb95d51c9",
"score": "0.5322009",
"text": "function attack(monster) {\r\n document.getElementById('pane_monster').children[monster].click();\r\n}",
"title": ""
},
{
"docid": "7b7c9fcaf953f112e83cef2c1b2d91e7",
"score": "0.53203535",
"text": "function onMouseDownCanvas(e) {\n\tconsole.log(user_roles);\n jQuery(\"#left-sidebar .media-kit-images \").addClass(\"disabled\");\n jQuery(\"#toolbar .textbox-tool\").addClass(\"d-none\");\n jQuery(\"#toolbar .image-tool\").addClass(\"d-none\");\n jQuery(\"#toolbar .shape-tool\").addClass(\"d-none\");\n jQuery(\"#toolbar .lineshape-tool\").addClass(\"d-none\");\n var activeObject = e.target;\n if(activeObject && activeObject.type == 'activeSelection'){\n canvas.discardActiveObject();\n canvas.renderAll();\n }\n if(activeObject && activeObject.type == 'PageMediaBox'){\n canvas.sendToBack(activeObject);\n }\n\tvar obj = canvas.getActiveObject();\n if(obj){\n if(obj.lock_position == 1){\n lockCanvasObjects();\n jQuery(\".km-smart-guides\").prop( \"checked\", false);\n smartGuideStatus = 0;\n }\n /*obj.lockMovementX = true;\n obj.lockMovementY = true;\n obj.lockScalingX = true;\n obj.lockScalingY = true;\n obj.lockRotation = true;\n obj.hasControls = false;\n obj.selectable = true;\n obj.hasBorders = true;\n obj.borderColor = '#eb2cf6';\n obj.editable = true;\n canvas.renderAll();\n canvas.setActiveObject(obj);*/\n if(obj.type == \"textbox\"){\n if(!obj.hide_data || obj.hide_data == 0){\n jQuery(\"#left-sidebar .media-kit-images \").addClass(\"disabled\");\n\t\t\t\tif(jQuery.inArray('advanced_content_creator', user_roles ) !== -1 || jQuery.inArray('administrator', user_roles ) !== -1 || jQuery.inArray('enterprise', user_roles ) !== -1 || jQuery.inArray('designer', user_roles ) !== -1 || jQuery.inArray('content_creator', user_roles ) !== -1){\n\t\t\t\t\tjQuery(\"#toolbar .textbox-tool\").removeClass(\"d-none\");\n\t\t\t\t\tjQuery(\"#toolbar .textbox-tool .textbox-add-text\").addClass(\"d-none\");\n\t\t\t\t}\n updateTextAppearance();\n applyTextcolorPicker();\n }\n }\n else if(obj.type == \"image\" || obj.type == \"ImageContainer\"){\n if(!obj.hide_data || obj.hide_data == 0){\n jQuery(\"#left-sidebar .media-kit-images \").removeClass(\"disabled\");\n jQuery(\"#toolbar .image-tool\").removeClass(\"d-none\");\n //jQuery('input[type=\"range\"]').rangeslider('update', true);\n updateTextAppearance();\n applyTextcolorPicker();\n }\n }\n else if(obj.type == \"Rectshape\" || obj.type == \"circle\" || obj.type == \"polygon\" || obj.type == \"triangle\" || obj.type == \"star\" || obj.type == \"Lineshape\"){\n if(!obj.hide_data || obj.hide_data == 0){\n jQuery(\"#left-sidebar .media-kit-images \").addClass(\"disabled\");\n\t\t\t\tif(jQuery.inArray('advanced_content_creator', user_roles ) !== -1 || jQuery.inArray('administrator', user_roles ) !== -1 || jQuery.inArray('enterprise', user_roles ) !== -1 || jQuery.inArray('designer', user_roles ) !== -1 || jQuery.inArray('content_creator', user_roles ) !== -1){\n\t\t\t\t\tif(obj.type == \"Lineshape\"){\n jQuery(\"#toolbar .lineshape-tool\").removeClass(\"d-none\");\n }else{\n jQuery(\"#toolbar .shape-tool\").removeClass(\"d-none\");\n jQuery(\"#toolbar .shape-tool .shape-add-shape\").addClass(\"d-none\");\n }\n\t\t\t\t}\n updateTextAppearance();\n applyTextcolorPicker();\n }\n }\n //updateRangeSlider();\n }\n else {\n lockCanvasObjects();\n }\n}",
"title": ""
},
{
"docid": "6999d7c20b0a2bfde5f64491d2bcce87",
"score": "0.5313744",
"text": "function click(ev, gl, canvas, a_Position) {\n var x = ev.clientX; // x coordinate of a mouse pointer\n var y = ev.clientY; // y coordinate of a mouse pointer\n var rect = ev.target.getBoundingClientRect() ;\n\n x = ((x - rect.left) - canvas.width/2)/(canvas.width/2);\n y = (canvas.height/2 - (y - rect.top))/(canvas.height/2);\n // Store the coordinates to g_points array\n g_points.push(x); g_points.push(y);\n\n // Clear <canvas>\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n var len = g_points.length;\n for(var i = 0; i < len; i += 2) {\n // Pass the position of a point to a_Position variable\n gl.vertexAttrib3f(a_Position, g_points[i], g_points[i+1], 0.0);\n\n // Draw\n gl.drawArrays(gl.POINTS, 0, 1);\n }\n}",
"title": ""
},
{
"docid": "89ba935b41bbea806f6d84258ed2a673",
"score": "0.53136486",
"text": "function boxClick ($obj) {\n\n $obj.addClass('clicked').removeClass('clickable');\n $obj.find('.text').addClass('clicked');\n $obj.find('.desc-text').addClass('clicked');\n $obj.css('z-index', 0);\n var $boxesClicked = $('.box.clicked');\n $boxesClicked.css('background-color');\n \n if ($boxesClicked.length === 4) {\n $('.circle').addClass('clickable').addClass('front');\n $('#success').addClass('show');\n setTimeout(function() {\n $('.circle').focus();\n }, 0);\n }\n}",
"title": ""
},
{
"docid": "149a4956cf34a406d23eb2b546e8cef5",
"score": "0.5311476",
"text": "click() {\n this.$refs[this.__field].click();\n }",
"title": ""
},
{
"docid": "1aabe8807423d111279d6363a8f56490",
"score": "0.5311447",
"text": "function mouseClicked(){\n //determines the little guy's size and makes him appear wherever the mous clicks\n image(littleGuy, mouseX, mouseY, 100, 100)\n}",
"title": ""
},
{
"docid": "dbc2102b0facdafe953e385582a4c1fb",
"score": "0.5302078",
"text": "function click(ev, gl, canvas, a_Position)\n {\n var x = ev.clientX; // x coord of mouse pointer\n var y = ev.clientY; // y coord if mouse pointer\n var rect = ev.target.getBoundingClientRect();\n\n x = ((x - rect.left) - canvas.width/2)/(canvas.width/2);\n y = (canvas.height/2 - (y - rect.top)) / (canvas.height/2);\n\n // store the coordinates to a point array\n g_points.push([x, y]);\n\n // clear canvas\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n var len = g_points.length;\n\n for (var i=0; i<len; i++ )\n {\n var xy = g_points[i]\n gl.vertexAttrib3f(a_Position, xy[0], xy[1], 0.0);\n gl.drawArrays(gl.POINTS, 0, 1);\n }\n\n}",
"title": ""
},
{
"docid": "97bd550c63b9fa67a404b5304393b78c",
"score": "0.5301786",
"text": "function handleClick(care, scale) {\n // Inform with an alert what are the needs for the clicked plant\n if (scale === 3) {\n alert(`This plant needs very much ${care}.`)\n } else if (scale == 2) {\n alert(`This plant needs some ${care}.`)\n } else {\n alert(`This plant needs only few ${care}.`)\n }\n}",
"title": ""
},
{
"docid": "c09d27405e1c042b230302d3cc12eaf8",
"score": "0.5301369",
"text": "function mousedown_canvas(event){\n selected_idx = get_closest_point_idx();\n\n}",
"title": ""
},
{
"docid": "50207974b776a3090a5c63d5f8ae5ac0",
"score": "0.5298395",
"text": "function click(e)\n{\n\tvar pos = findPos(this);\n\tvar cord = findCord(e.pageX - pos.x, e.pageY - pos.y);\n\tif (cord) {\n\t\t//if line is added to board, redraw lines\n\t\tif (attemptMove(cord.vertical, cord.x, cord.y)) {\n\t\t\tdrawBoard();\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "f5b19881929213518162b5e969fe0afa",
"score": "0.52959",
"text": "function canvasClick(e)\n{\n var x;\n var y;\n\n if (e.pageX != undefined && e.pageY != undefined)\n {\n x = e.pageX;\n y = e.pageY;\n }\n else\n {\n x = e.clientX + document.body.scrollLeft +\n document.documentElement.scrollLeft;\n y = e.clientY + document.body.scrollTop +\n document.documentElement.scrollTop;\n }\n\n x -= canvas.offsetLeft;\n y -= canvas.offsetTop;\n\n var cell =\n [\n Math.floor(x/tileWidth),\n Math.floor(y/tileHeight)\n ];\n console.log('we clicked tile '+cell[0]+','+cell[1]);\n\n pathStart = pathEnd;\n pathEnd = cell;\n\n // calcular o path\n currentPath = findPath(world,pathStart,pathEnd);\n redraw();\n}",
"title": ""
},
{
"docid": "c0ce3827c9526c015586f917c9efc01c",
"score": "0.52935964",
"text": "function answerBtn() {\n\tfor (var i = 0; i < canvas.length; i++) {\n\t\tcanvas[i].addEventListener('click', updateValues); \t\t//for every click run updateValues function\n\t}\n}",
"title": ""
},
{
"docid": "e5168b194d6df117a3e218a5c1d7bc8e",
"score": "0.5293055",
"text": "function click(x, y)\n{\n}",
"title": ""
},
{
"docid": "032930a75463a0e0d5f7f1b837c422a3",
"score": "0.52869576",
"text": "function canvasClick(event) {\r\n\tvar click = windowToCanvas(canvas, event.clientX, event.clientY);\r\n\tvar loc = coordToCell(click.x, click.y);\r\n\tvar x = loc.x, y = loc.y;\r\n\t$(\"cell\").innerHTML = \"Cell (\"+x+\",\"+y+\")<br/>Current:\"+cells[x][y].current+\"<br/>Future:\"+cells[x][y].future+\"<br/>Age:\"+cells[x][y].age+\"<br/>Colors:\"+cells[x][y].color+\"<br/>Neighbors:\"+checkNeighbors(cells[x][y]);\r\n\t//console.log(\"Cell (\"+x+\",\"+y+\")\\nCurrent:\"+cells[x][y].current+\"\\nFuture:\"+cells[x][y].future+\"\\nAge:\"+cells[x][y].age+\"\\nColors:\"+cells[x][y].color+\"\\nNeighbors:\"+checkNeighbors(cells[x][y]));\r\n}",
"title": ""
},
{
"docid": "53aa74f943d6ddae4a0114ca2db44f40",
"score": "0.5282975",
"text": "function onSelectedImg(ev, imgId) {\n //console.log(ev, +imgId);\n let elCanvasContainer = document.querySelector('.canvas-container');\n elCanvasContainer.style.display = 'block';\n setSelectedImg(imgId);\n displayOnlyCanvas();\n renderModal(ev);\n}",
"title": ""
},
{
"docid": "d42478cb9c324f1ba73f33625151429e",
"score": "0.5281114",
"text": "function myCheckedEvent() {\n if (this.checked()) {\n console.log('Checking!');\n button = createButton(\"Print your canvas at the cutest moment.\");\n button.mouseClicked(printCanvas);\n } else {\n console.log('Unchecking!');\n }\n}",
"title": ""
},
{
"docid": "97bd7ba89c0bc975d95058aeadfac131",
"score": "0.5279157",
"text": "click(ev) {\r\n const mX = ev.clientX;\r\n const mY = ev.clientY;\r\n const width = this.canvas.clientWidth;\r\n const height = this.canvas.clientHeight;\r\n\r\n const xMouse = 2*(mX/width) - 1.0\r\n const yMouse = -1*(2*(mY/height) - 1.0)\r\n\r\n console.log(xMouse, yMouse, yRafi)\r\n\r\n if(xMouse < 0.1 && xMouse > -0.1 && yMouse > yRafi - 0.1 && yMouse < yRafi + 0.1){\r\n document.getElementById(\"Points\").textContent = ++this.score; \r\n } else {\r\n console.log(\"LOSER\");\r\n document.getElementById(lives--).remove();\r\n }\r\n \r\n \r\n // // Print x,y coordinates.\r\n // console.log(ev.clientX, ev.clientY);\r\n\r\n // const mX = ev.clientX;\r\n // const mY = ev.clientY;\r\n // const width = this.canvas.clientWidth;\r\n // const height = this.canvas.clientHeight;\r\n\r\n // const xMouse = 2*(mX/width) - 1.0\r\n // const yMouse = -1*(2*(mY/height) - 1.0)\r\n \r\n\r\n\r\n // // console.log(textureFilebol);\r\n // // var shape = new Triangle(shader, this.image);\r\n // // this.scene.addGeometry(shape);\r\n\r\n\r\n // const buttonTypeVal = document.getElementById(\"buttonColorType\").innerHTML\r\n // // console.log(buttonTypeVal);\r\n\r\n\r\n // switch(this.state) {\r\n \r\n \r\n\r\n // case 'square':\r\n // // var shape = new Square(shader,ev.clientX,ev.clientY,width,height);\r\n // var shape = new Square(oldshader,xMouse,yMouse);\r\n // break;\r\n \r\n // case 'triangle':\r\n // // var shape = new Triangle(shader, this.image);\r\n // var shape = new Oldtriangle(oldshader, xMouse,yMouse);\r\n // break;\r\n \r\n // case 'circle':\r\n // // var shape = new Circle(shader,xMouse,yMouse);\r\n // var shape = new Circle(oldshader,xMouse,yMouse);\r\n // // var shape = new Circle(shader,ev.clientX,ev.clientY,width,height);\r\n // break;\r\n\r\n // case 'cube':\r\n\r\n // if(!textureFilebol) {\r\n // var shape = new Cube(oldshader,xMouse,yMouse);\r\n // } else if(textureFilebol) {\r\n // // var shape = new Triangle(shader, this.image);\r\n // // console.log(this.image);\r\n // var shape = new Cubetextured(shader, this.image, xMouse, yMouse);\r\n // }\r\n // break;\r\n\r\n\r\n \r\n \r\n // default:\r\n // // var shape = new Square(shader,ev.clientX,ev.clientY,width,height);\r\n // break;\r\n // // var shape = new Triangle(shader,xMouse,yMouse);\r\n // }\r\n // if(shape) this.scene.addGeometry(shape);\r\n }",
"title": ""
},
{
"docid": "13466cad2245bcbaf8ba2379fa5491bd",
"score": "0.5275654",
"text": "function click(){\n rect = leinwand.getBoundingClientRect();\n mouseX = event.clientX - rect.left;\n mouseY = event.clientY - rect.top;\n tileX = Math.floor(mouseX/tileSize);\n tileY = Math.floor(mouseY/tileSize);\n\n if(tileX>=0&&tileX<=7&&tileY>=0&&tileY<=7){\n board.tileClicked(context, tileSize, tileX, tileY);\n }\n}",
"title": ""
},
{
"docid": "97c5039d47741ea638e72508c6a206ab",
"score": "0.5275649",
"text": "function checkCursorPositionOnClick(e)\n\t{ \n\t\tfunction onCanvasClick(e) \n\t\t{\t\n\t\t\t//alert(getCursorPosition(e)); //use this to find coords of play button\n\t\t \ttestCoords = getCursorPosition(e);\n\t\t \tif(playClick && testCoords[0] >= 300 && testCoords[0] <= 520 && testCoords[1] >=364 && testCoords[1] <=464) //play button coords\n\t\t \t{\t\n\t\t \t\t//code goes here if click hits target\n\t\t \t\t\n\t\t \t\tsetTimeout(function(){\n\t\t \t\t\tctx.drawImage(instructPressed, 0,0, canvas.width, canvas.height);}, 0);\n\t\t \t\tplayClick = false;\n\t\t \t\tsetTimeout(function(){playGame();}, 1000);\n\n\t\t \t};\n\t\t \t//replay button\n\t\t \tif(testCoords[0] >= 735 && testCoords[0] <= 793 && testCoords[1] >=550 && testCoords[1] <=600){\n\t\t \t\t\n\t\t \t\ttoolCtx.clearRect(0,0,toolCanvas.width, toolCanvas.height);\n\t\t \t\tsetTimeout(function(){\n\t\t \t\t\ttoolCtx.drawImage(replayImgPressed, toolCanvas.width-120, 0, toolCanvas.height, toolCanvas.height);}, 0);\n\n\t\t \t\tsetTimeout(function(){\n\t\t \t\t\tlocation.reload();},500);\n\t\t \t}\n\t\t};\n\t\t \n\t\tfunction getCursorPosition(e) \n\t\t{\n\t\t \tvar x;\n\t\t var y;\n\t\t if (e.pageX != undefined && e.pageY != undefined) {\n\t\t\t\tx = e.pageX;\n\t\t\t\ty = e.pageY;\n\t\t }\n\t\t else {\n\t\t\t\tx = e.clientX + document.body.scrollLeft +\n\t\t document.documentElement.scrollLeft;\n\t\t\t\ty = e.clientY + document.body.scrollTop +\n\t\t document.documentElement.scrollTop;\n\t\t }\n\t\t \tx -= canvas.offsetLeft;\n\t\t y -= canvas.offsetTop;\n\t\t \n\t\t return [x,y];\n\t\t};\n\n\t\tcanvas.addEventListener(\"mouseup\", onCanvasClick, false);\n\t\ttoolCanvas.addEventListener(\"mouseup\", onCanvasClick, false);\n\t}",
"title": ""
},
{
"docid": "6f5401eb2a4dbd5c5c051ce78dac4ba3",
"score": "0.5275465",
"text": "function processCanvasMouseClick(click_x, click_y){\n\tvar hit = false;\n\tconsole.log(\"falsified\");\n\tfor(var i in patch.frames[frame]){\n\t\tvar target = patch.frames[frame][i];\n\t\tconsole.log(\"click at [\"+click_x+\",\"+click_y+\"]. x = \"+target.x+\" x+w = \"+ (target.x + target.width)+\" y = \"+ target.y +\" y+h = \"+ (target.y + target.height) )\n\t\tif(click_x > target.x && click_x < target.x + target.width && click_y > target.y && click_y < target.y + target.height){\n\n\t\t\thit = true;\n\t\t\t\n\t\t\tconsole.log(\"canvasSelectionIndex = \"+canvas_selection_index);\n\t\t\tif(canvas_selection_index == i){\n\t\t\t\tconsole.log(\"startDrag\");\n\t\t\t\tcanvas_drag = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log(\"set to \"+i);\n\t\t\t\tcanvas_selection_index = i;\n\t\t\t\tcanvas_selection_x_offset = target.x - click_x;\n\t\t\t\tcanvas_selection_y_offset = target.y - click_y;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\tconsole.log(\"hit?\"+hit);\n\tif(!hit){\n\t\tconsole.log(\"nullified\");\n\t\tcanvas_selection_index = null;\n\t\tcanvas_selection_x_offset = 0;\n\t\tcanvas_selection_y_offset = 0;\n\t}\n\n}",
"title": ""
},
{
"docid": "96a836fb9716b60793e1f9c1750395c5",
"score": "0.5274276",
"text": "function onClick(tracker, id, position, quick, shift, input) {\n // ignore clicks where mouse moved, or clicks on HTML input elements\n if (quick && self.isZoomable && !input) {\n var zoomPerClick = self.zoomPerClick;\n var factor = shift ? 1 / zoomPerClick : zoomPerClick;\n zoom(factor, position);\n }\n }",
"title": ""
},
{
"docid": "385ed9ec380572c8160a923285d51d9d",
"score": "0.5269755",
"text": "function myMouseDown(ev, gl, canvas) {\n//==============================================================================\n var rect = ev.target.getBoundingClientRect();\t\n var xp = ev.clientX - rect.left;\t\t\t\t\t\n var yp = canvas.height - (ev.clientY - rect.top);\t\n var x = (xp - canvas.width/2) / (canvas.width/2);\t\n\tvar y = (yp - canvas.height/2) / (canvas.height/2);\n\t\n\tisDrag = true;\n\txMclik = x;\n\tyMclik = y;\n}",
"title": ""
}
] |
1acbf34689961f51f2688a7a0140ca42 | Method to get activity weight data | [
{
"docid": "e25f18a48b391645ce5ed04001edf403",
"score": "0.5944373",
"text": "async getWeightData(){\n return axios.get(`${SpringHostURL}/api/activities/weight`,{\n headers: {\n //Set the post content as application/json (Spring will not recognise text for this auth endpoint PostMapping)\n 'Content-Type': 'application/json;charset=UTF-8',\n //Set Bearer Token JWT auth\n 'Authorization': `Bearer ${sessionStorage.getItem('token')}`\n }\n }).then(response => response.data)\n //The post method was not successful and some error has occured\n\n //To get error status, we can log it to the console using console.log(error.response.status)\n //To get the error msg, we can log it to the console using console.log(error.response.data.error)\n .catch(error => console.error(error))\n }",
"title": ""
}
] | [
{
"docid": "820a26dae220339892aecd2bba39a577",
"score": "0.6876137",
"text": "async getUserActivity(){\n //Get Activity Data\n const activityDataRes = await this.getActivityData()\n\n //Filter just results by this user\n const userActivityRes = activityDataRes.filter(function(item){\n return item.userID == sessionStorage.getItem('UserID'); \n });\n\n //Finally, filter results by weight measurements\n const userActivityWeight = userActivityRes.filter(function(item){\n return item.activityType == 'weight' \n });\n\n return userActivityWeight\n }",
"title": ""
},
{
"docid": "97b6ae9dafa7bab6c003beb6e1bd5d35",
"score": "0.65319264",
"text": "async getUserData(){\n //Get Activity User Response\n const activityDataFilter = await this.getUserActivity()\n\n //Get those activity Weight data now\n const weightDataFilterMerge = await this.getUserWeight(activityDataFilter)\n\n return weightDataFilterMerge\n }",
"title": ""
},
{
"docid": "13906940a2b127f02d93bec84fea91fc",
"score": "0.6199291",
"text": "function getWeight()\n{\n\tvar currentWeight;\n\tvar intWeight;\n\tvar xhr = Ti.Network.createHTTPClient();\n\txhr.onload = function()\n\t{\n\t\t// parse JSON from the server\n\t\tvar weight = JSON.parse(this.responseText);\n\t\t\n\t\t\n\t\t\t\t// create an empty array\n\t\tvar weightData = [];\n\n \t\tif(weight)\n\t\t{\n\t\t\t// loop through all messages\n\t \t\tfor (var i = 0; i < weight.length; i++) \n\t \t\t{\n\t \t\t\tcurrentWeight = weight[i].CurWeight;\n\t \t\t\tintWeight = weight[i].IntWeight;\n\t \t\t\tvar percentLeft = currentWeight/intWeight *100;\n\t \t\t\t\n\t \t\t\t\n\t \t\t\t// add message onto the array\n\t \t\t\tweightData.push({\n\t \t\t\t\tContainerID: weight[i].ContainerID,\n\t \t\t\t\tinitialWeightBind: {id: weight[i].IntWeight} ,\n\t \t\t\t\tCurWeightBind: {id: weight[i].CurWeight},\n\t \t\t\t\tcontainerLabelBind: {text: weight[i].LabelName},\n\t\t\t\t CurWeightPercent: {text: 'Percent left: '+ percentLeft + \"%\"},\n\t\t\t\t\n\t \t\t\t});\n\t\t\t}\n\n\t\t\t// add messages to the listView\n\t\t\t\n\t\t\t\n\t\t\t$.containerView.sections[0].setItems(weightData);\t\t\t\n\t\t} \n\t};\n\t\n\txhr.onerror = function()\n\t{\n\t\talert('Could not get messages');\n\t};\n\n\txhr.open('GET', 'http://52.24.159.58/getWeight.php');\n\txhr.setRequestHeader('User-Agent','SmartTray');\n\txhr.send();\t\t\n}",
"title": ""
},
{
"docid": "3e7a8fbed3dea0a9229abfbcae01bfe0",
"score": "0.61051863",
"text": "async getUserWeight(userActivityWeight){\n //Get filtered data from the user that only contains weight measurements\n const weightDataRes = await this.getWeightData()\n\n //Filter out just the activityID's from WeightData\n var userActivities = userActivityWeight.map(a => a.activityID);\n\n //Filter just results from the filtered UserID and WeightMeasurement from previous filter\n const filteredWeights = weightDataRes.filter(item => userActivities.includes(item.activityID));\n\n //Merge the userActivity object with the userWeight object using the arrays.map function\n const mergedResponses = userActivityWeight.map(activityMapping => ({...activityMapping, ...filteredWeights.find(weightMapping => weightMapping.activityID === activityMapping.activityID)}))\n\n return mergedResponses\n }",
"title": ""
},
{
"docid": "4d783374f8fd67ebc5d1d796f5945f18",
"score": "0.6089606",
"text": "function getWeights(workoutId, weights){\n console.log('getting my lifting info')\n var workoutId = $stateParams.workoutId\n console.log(workoutId)\n $http.get(`${server}/workouts/${workoutId}/weights`)\n .then(function(response){\n console.log(response)\n console.log(response.data)\n self.allWeights = response.data;\n console.log(self.allWeights);\n })\n}",
"title": ""
},
{
"docid": "400bdb756c861475f3c59555660a72da",
"score": "0.60620654",
"text": "get separateWeight() {\n return this._bufferData.subarray(0, 1)[0];\n }",
"title": ""
},
{
"docid": "aea4fbf73cda38cd3ec7696bc070fdae",
"score": "0.5960888",
"text": "get_weight(times=3) {\n return this.get_weight_A(times);\n }",
"title": ""
},
{
"docid": "82f7762051cc0a0ceb37caf0e35e1be1",
"score": "0.5933831",
"text": "get weight() {return this._weight || 0 }",
"title": ""
},
{
"docid": "cf7ec3e24ccb1fab3f97c2ab36df6ba7",
"score": "0.58532983",
"text": "getData(weightId) {\n const data = {};\n const results = this.state.results;\n if (!results[weightId].aggregationData) {\n // cache the results if reading from the buffer (WebGL2 path)\n results[weightId].aggregationData = results[weightId].aggregationBuffer.getData();\n }\n data.aggregationData = results[weightId].aggregationData;\n\n // Check for optional results\n for (const arrayName in ARRAY_BUFFER_MAP) {\n const bufferName = ARRAY_BUFFER_MAP[arrayName];\n\n if (results[weightId][arrayName] || results[weightId][bufferName]) {\n // cache the result\n results[weightId][arrayName] =\n results[weightId][arrayName] || results[weightId][bufferName].getData();\n data[arrayName] = results[weightId][arrayName];\n }\n }\n return data;\n }",
"title": ""
},
{
"docid": "cf7ec3e24ccb1fab3f97c2ab36df6ba7",
"score": "0.58532983",
"text": "getData(weightId) {\n const data = {};\n const results = this.state.results;\n if (!results[weightId].aggregationData) {\n // cache the results if reading from the buffer (WebGL2 path)\n results[weightId].aggregationData = results[weightId].aggregationBuffer.getData();\n }\n data.aggregationData = results[weightId].aggregationData;\n\n // Check for optional results\n for (const arrayName in ARRAY_BUFFER_MAP) {\n const bufferName = ARRAY_BUFFER_MAP[arrayName];\n\n if (results[weightId][arrayName] || results[weightId][bufferName]) {\n // cache the result\n results[weightId][arrayName] =\n results[weightId][arrayName] || results[weightId][bufferName].getData();\n data[arrayName] = results[weightId][arrayName];\n }\n }\n return data;\n }",
"title": ""
},
{
"docid": "79622f092135a3da259fe295aaf1b0e0",
"score": "0.5807835",
"text": "get weights() {\n return this.trainableWeights.concat(this.nonTrainableWeights);\n }",
"title": ""
},
{
"docid": "128d8135ff59a27cb93c72625f13377e",
"score": "0.5803637",
"text": "function getWeight(isLast) {\n if (utils.isUndefinedOrNull(isLast)) {\n isLast = true;\n }\n return rest.one(\"weighting\", isLast).get();\n }",
"title": ""
},
{
"docid": "3ef268145e23cde820af2a2197f57a66",
"score": "0.5698282",
"text": "getEffectiveWeight() {\n\n \t\treturn this._effectiveWeight;\n\n \t}",
"title": ""
},
{
"docid": "95c4b046a0330cef7601dfa14607e49e",
"score": "0.5638008",
"text": "function getData(){\n console.log(JSON.parse(localStorage.getItem('res')))\n if(localStorage.getItem('res')){\n let workouts = JSON.parse(localStorage.getItem('res'))\n }\n const sumWeight = localStorage.getItem(\"sumWeight\")\n const sumDuration = localStorage.getItem(\"sumDuration\")\n \n // document.querySelector(\".durationOutput\").textContent = sumDuration;\n \n //let weight7 = parseInt(workouts[workouts.length-1].weight) + parseInt(workouts[workouts.length-2].weight) + parseInt(workouts[workouts.length-3].weight) + parseInt(workouts[workouts.length-4].weight) + parseInt(workouts[workouts.length-5].weight) + parseInt(workouts[workouts.length-6].weight) + parseInt(workouts[workouts.length-7].weight)\n //console.log(weight7);\n // document.querySelector(\".weightOutput\").textContent = sumWeight;\n}",
"title": ""
},
{
"docid": "a36ac9e0b98fbb9de11bc865aefd1e2a",
"score": "0.5635749",
"text": "getEffectiveWeight() {\n return this._effectiveWeight;\n }",
"title": ""
},
{
"docid": "f44f50006215a38003dc0c95d8811b1e",
"score": "0.5623039",
"text": "get totalWeights() { return this._totalWeights; }",
"title": ""
},
{
"docid": "a6d81b3dfc28b20ea982952df3cf024e",
"score": "0.56001854",
"text": "function getActivitiesCountPerDayOfWeek(activity){\n\t\tsearch_activity = activity;\n\t\t$.get('/api/user/'+user_id+'/activityperweek/'+activity, function(data){\n\t\t\tloadDoWDataIntoYear(data, activity, function(){\n\t\t\t\tloadDayOfWeekGraph(['2016', '2015', '2014', '2013', '2012'], activity);\n\t\t\t});\n\t\t});\n\t}",
"title": ""
},
{
"docid": "4d58b3b5cdc5ceab772ad7345d50ae9b",
"score": "0.5553931",
"text": "get weight() {\n return this._weight; // We won't modify the getter in this example\n }",
"title": ""
},
{
"docid": "db30cc273bd7627f6d2b92812da32e68",
"score": "0.5460602",
"text": "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}",
"title": ""
},
{
"docid": "db30cc273bd7627f6d2b92812da32e68",
"score": "0.5460602",
"text": "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}",
"title": ""
},
{
"docid": "db30cc273bd7627f6d2b92812da32e68",
"score": "0.5460602",
"text": "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}",
"title": ""
},
{
"docid": "db30cc273bd7627f6d2b92812da32e68",
"score": "0.5460602",
"text": "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}",
"title": ""
},
{
"docid": "db30cc273bd7627f6d2b92812da32e68",
"score": "0.5460602",
"text": "getEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}",
"title": ""
},
{
"docid": "79c408094ad460e6ffe6ac35dc68e6f0",
"score": "0.5415111",
"text": "getWeights() {\n const weights = [];\n for (const cell of this.cells) {\n weights.push(...cell.weights);\n }\n return batchGetValue(weights);\n }",
"title": ""
},
{
"docid": "5720d45d002137c7d4c96b7489e135af",
"score": "0.5382516",
"text": "function getResults() {\n let results = myContext.getFeedbackOnSpecificActivity(\n parseInt(ageBand),\n underlyingHealthCond === \"true\",\n otherPeopleInteraction === \"true\",\n parseInt(timeSpentOnActivity),\n activityType,\n activityTimeExecution\n );\n setFinalResults(results);\n setResultsModalVisible(true);\n }",
"title": ""
},
{
"docid": "6ff2d33b5551bc49f0c9287c9b8c3652",
"score": "0.5311656",
"text": "function getWeight () {\n var weight = Math.round(Math.random() * (12000 - 1200) + 1200);\n return weight.toString();\n}",
"title": ""
},
{
"docid": "27c29378036d487f313912a540d19e6e",
"score": "0.5285116",
"text": "function getData1() {\r\n\treturn statistics[2].count;\r\n\t}",
"title": ""
},
{
"docid": "153e71e743723240c4c1e60fdd5147a7",
"score": "0.5221051",
"text": "function calcExerciseWeight(data) {\n let exerciseWeight = {};\n // Go through each workout and add workout type/name to the workouts object if it's not already captured\n // Add workout weight as a value for each workout, if it already exists add it to the existing value to update total\n data.forEach(workout => {\n workout.exercises.forEach(exercise => {\n if (exerciseWeight[exercise.name]) {\n exerciseWeight[exercise.name] = exerciseWeight[exercise.name] + exercise.weight\n } else {\n exerciseWeight[exercise.name] = exercise.weight;\n }\n });\n });\n console.log(\"exercise weight:\" + exerciseWeight);\n return exerciseWeight;\n}",
"title": ""
},
{
"docid": "209f1c20df0fdaeeb1f706a5dba03599",
"score": "0.5215773",
"text": "function getAnimalWeight(animal){\n for(i in animalData){\n if(animalData[i].name == animal){\n return animalData[i].weight;\n }\n }\n}",
"title": ""
},
{
"docid": "8f1b5606df6b9b6036a82b879ebcb91c",
"score": "0.5172709",
"text": "function getLearnedInfo() {\n return get('/cview/get/learned/json');\n }",
"title": ""
},
{
"docid": "6e1ba00dc74952f9d70a1a8e70d5f377",
"score": "0.51511204",
"text": "get_bandwidth()\n {\n return this.liveFunc._bandwidth;\n }",
"title": ""
},
{
"docid": "6e1ba00dc74952f9d70a1a8e70d5f377",
"score": "0.51511204",
"text": "get_bandwidth()\n {\n return this.liveFunc._bandwidth;\n }",
"title": ""
},
{
"docid": "6e1ba00dc74952f9d70a1a8e70d5f377",
"score": "0.51511204",
"text": "get_bandwidth()\n {\n return this.liveFunc._bandwidth;\n }",
"title": ""
},
{
"docid": "4b77b5921d971b3f1364aec146e8bfa6",
"score": "0.51503336",
"text": "function getSleepData(AccessToken) {\r\n var data_fields ='remsleepduration,lightsleepduration,deepsleepduration,durationtosleep';\r\n\r\n var enddateymd = new Date();\r\n var endString = enddateymd.getUTCFullYear()+'-'+(enddateymd.getUTCMonth()+1) +'-'+enddateymd.getUTCDate();\r\n console.log(endString);\r\n\r\n var startdateymd = new Date();\r\n startdateymd.setDate(enddateymd.getDate()-6);\r\n var startString = startdateymd.getUTCFullYear()+'-'+(startdateymd.getUTCMonth()+1) +'-'+startdateymd.getUTCDate(); \r\n console.log(startString);\r\n\r\n\r\n // get sleep data (7 days)\r\n var Url = \"https://wbsapi.withings.net/v2/sleep?\" + \"action=getsummary\" + \"&startdateymd=\" + startString + \"&enddateymd=\" + endString + \"&data_fields=\" + data_fields;\r\n\r\n var request = new XMLHttpRequest();\r\n request.open(\"GET\", Url, true);\r\n request.setRequestHeader('Authorization','Bearer '+ AccessToken);\r\n\r\n request.send();\r\n console.log(request);\r\n var res = request.responseXML;\r\n console.log(res);\r\n return res;\r\n }",
"title": ""
},
{
"docid": "1623ffee3b5ed455fca9cbcb7a75fb1d",
"score": "0.5147181",
"text": "get weights() {\r\n //loop through each neurons weights copying them into our ret value.\r\n var layerWeights = [];\r\n //for neurons in layer\r\n for(let neuron of this.neurons) {\r\n //for weights of neuron\r\n for(let weight of neuron.weights) {\r\n layerWeights.push(weight);\r\n }\r\n }\r\n return layerWeights;\r\n\r\n }",
"title": ""
},
{
"docid": "fdeef36095a16965bd5a81548f33d1db",
"score": "0.51281506",
"text": "function getweight(){\n return \"abc\";\n}",
"title": ""
},
{
"docid": "215c80fb6873fdd0f1bc202295aa3a78",
"score": "0.5114513",
"text": "function calculateTotalWeight(data) {\n let total = [];\n // Calculate the total weight for each workout by adding all exercise weights for a day. \n // Push them to the total array which stores total weight for each day of the week.\n data.forEach(workout => {\n let dayWeight = 0;\n workout.exercises.forEach(exercise => {\n if (exercise.weight) {\n dayWeight += (exercise.weight)\n };\n });\n total.push(dayWeight);\n });\n\n return total;\n}",
"title": ""
},
{
"docid": "c8a1221bfde5cde540e0f7f677721c5f",
"score": "0.51111233",
"text": "calculateBMI(){\n\n let bmi = this.weight/(this.height**2);\n return bmi;\n }",
"title": ""
},
{
"docid": "adb2e7f235ceea44fbd9825aa60d7048",
"score": "0.51107126",
"text": "function parseWeight(element) {\n return parseInt($('img', element).attr('data-weight'));\n }",
"title": ""
},
{
"docid": "14e8358b7ebafa17b78e1f8e4537ede5",
"score": "0.5108103",
"text": "function getWeight$1(node){var classes=node.attr('class');var id=node.attr('id');var score=0;if(id){// if id exists, try to score on both positive and negative\nif(POSITIVE_SCORE_RE$1$1.test(id)){score+=25;}if(NEGATIVE_SCORE_RE$1$1.test(id)){score-=25;}}if(classes){if(score===0){// if classes exist and id did not contribute to score\n// try to score on both positive and negative\nif(POSITIVE_SCORE_RE$1$1.test(classes)){score+=25;}if(NEGATIVE_SCORE_RE$1$1.test(classes)){score-=25;}}// even if score has been set by id, add score for\n// possible photo matches\n// \"try to keep photos if we can\"\nif(PHOTO_HINTS_RE$1$1.test(classes)){score+=10;}// add 25 if class matches entry-content-asset,\n// a class apparently instructed for use in the\n// Readability publisher guidelines\n// https://www.readability.com/developers/guidelines\nif(READABILITY_ASSET$1$1.test(classes)){score+=25;}}return score;}// returns the score of a node based on",
"title": ""
},
{
"docid": "7f27dab5a1a2e47b90bf3c8a5d8ee4d6",
"score": "0.5103723",
"text": "function data_from_analyser(){\n return analyser.getFrequencyData();\n}",
"title": ""
},
{
"docid": "5e287e690e3386e4534dd2d4ec2cc09f",
"score": "0.5103495",
"text": "calculateBMI() {\n let bmi = this.weight / (this.height ** 2);\n return bmi;\n }",
"title": ""
},
{
"docid": "0dc4035c3355bfe314b6bdf64d512ce4",
"score": "0.5098871",
"text": "function getTrainingCount() {\n return sendGetRequest('/summary/training/count');\n }",
"title": ""
},
{
"docid": "c2b75f6c52a69050c8ffe4dd5b43a8d3",
"score": "0.50963026",
"text": "static getMetrics() {\n return sendRequest(`/admin/metrics`, {}, \"GET\", true);\n }",
"title": ""
},
{
"docid": "194b9bc3bcfa6c0553db5433e1d599ca",
"score": "0.5093724",
"text": "function getSleepData() {\n const key = 'shortcuts:sleep'\n if (!Keychain.contains(key)) {\n return 'Sleep data is null.'\n }\n let list = JSON.parse(Keychain.get(key))\n let yesterday = list.pop()\n return 'Sleep duration ' + yesterday.duration + ' hours, target ' + yesterday.target + '%'\n}",
"title": ""
},
{
"docid": "7d6b58e366618da4a159deca7e9eb31f",
"score": "0.5083001",
"text": "function requestData() {\n /* as native module requests are rendered asynchronously, add and return a promise */\n //before.getTime(), date,\n return new Promise((resolve, reject) => {\n FitnessData.getStepStats();\n resolve(true);\n reject(false);\n });\n}",
"title": ""
},
{
"docid": "4686619d0f3c4d86b5391a6baea53e62",
"score": "0.5059883",
"text": "_getStatistics(){\n return statistics;\n }",
"title": ""
},
{
"docid": "5c5550498b301b212c8ee465b2019a19",
"score": "0.5056147",
"text": "function calcFeedDaily(weight, age) {\n // at the least 1 year\n if(age >= 1) {\n // First condition weight is up to 5 lb\n if(weight <= 5) {\n return 0.05*weight;\n }\n // Second condition weight is above 6 and below 10 lb\n else if(weight >= 6 && weight <= 10) {\n return 0.04*weight;\n }\n // weight between 11 and 15 lb\n else if(weight >= 11 && weight <= 15) {\n return 0.03*weight;\n }\n // weight is over 15 lb\n else if (weight > 15) {\n return 0.02*weight;\n }\n // weight is not equal to or under or over 15 lb\n else {\n return null;\n }\n\n }\n // Less than one year\n else if (age < 1) {\n // use number of months to determine percent of body weight to feed puppy\n if(age*12 < 2) {\n return null;\n }\n else if(age*12 >= 2 && age*12 <= 4) {\n return 0.10*weight;\n }\n else if(age*12 > 4 && age*12 <= 7) {\n return 0.05*weight;\n }\n else if(age*12 > 7 && age*12 <= 12) {\n return 0.04*weight;\n }\n else {\n return null;\n }\n }\n}",
"title": ""
},
{
"docid": "4c3a73a79e9455e2fb582198ca10c241",
"score": "0.5054212",
"text": "get weight() {\n let weight = 53000;\n // assumption: extra weight due to wheelSizes is calculated at 5% per extra inch, then 5% of the new weight (not linear) - increasein wheelSize size greatly increases weight\n const extraInches = this.wheelSize - 60;\n for (let i = 0; i < extraInches; i++) {\n weight += (.05 * weight);\n }\n // assumption: weight increses by 8% for each 1 foot of augerLength length - this can result in a combine that weighs nearly 4X as much as the base model\n const extraFeet = this.augerLength - 8.7;\n for (let i = 0; i < extraFeet; i++) {\n weight += (.08 * weight);\n }\n return weight;\n }",
"title": ""
},
{
"docid": "0fd2e4cf24b2e8c349deaaf21dd433f2",
"score": "0.50527304",
"text": "function activityStatistic(value) {\n\tthis.max_value = value;\n\tthis.current_value = value;\n}",
"title": ""
},
{
"docid": "373f42d06f805b40eac4ebcd66cd541d",
"score": "0.5052208",
"text": "function getData(data) {\n console.log(data);\n dataFeed = data;\n console.log(\"Connection Count:\", data[0].probe_requests[0].count);\n\n number = data[0].probe_requests[0].count;\n\n var displayMin = document.getElementById('displayMin');\n displayMin.innerHTML = data[0].probe_requests[0].min_signal;\n\n var displayMax = document.getElementById('displayMax');\n displayMax.innerHTML = data[0].probe_requests[0].max_signal;\n\n var displayAvg = document.getElementById('displayAvg');\n displayAvg.innerHTML = data[0].probe_requests[0].avg_signal;\n}",
"title": ""
},
{
"docid": "40bc8d61bbb5f19f272ad412b9a0a1fe",
"score": "0.50455916",
"text": "showWeight() {}",
"title": ""
},
{
"docid": "87ef9da8cab66ac7cfc5805b22f81016",
"score": "0.502544",
"text": "function processData(data){\r\n\tvar attributes = [];\r\n\tvar properties = data.features[0].properties;\r\n\tfor (var attribute in properties){\r\n\t\tif (attribute.indexOf(\"TotalWorkersPTPer\")>-1){\r\n\t\t\tattributes.push(attribute);\r\n\t\t};\r\n\t};\r\n\tconsole.log(attributes);\r\n\treturn attributes;\r\n}",
"title": ""
},
{
"docid": "da2b9d343da23d4b355f92c8b33e9ab8",
"score": "0.50222486",
"text": "get weight (){\n\t\tlet totalWeight = 0;\n\n\t\ttotalWeight += pizzaConfig.weight ( this.diameter ) ;\n\t\ttotalWeight += pizzaConfig.weight ( this.width ) ;\n\t\ttotalWeight += pizzaConfig.weight ( this.base ) ;\n\t\t\n\t\t//Добавляем цену ингредиентов\n\t\tfor( let ingredient of this.ingredients ){\n\t\t\ttotalWeight += pizzaConfig.weight(ingredient.id) * ingredient.quantity;\n\t\t}\n\n\t\treturn totalWeight;\n\t}",
"title": ""
},
{
"docid": "7c29f1febdc6a78039ea772a664f2c5b",
"score": "0.50010693",
"text": "function getDistances() {\r\n // Metric\r\n if (units.distance === \"metric\") {\r\n return new Activity(today.adjusted.distance, goals.distance);\r\n }\r\n // Us\r\n // Then metric->miles\r\n return new Activity(metrics2Miles(today.adjusted.distance), metrics2Miles(goals.distance));\r\n}",
"title": ""
},
{
"docid": "d48a9ef1ad5de3efb68f941c3a543c30",
"score": "0.49867597",
"text": "computeWeight( node ) {\n\n\t\tif ( node.win ) {\n\n\t\t\tif ( node.winPlayer === this.aiPlayer ) {\n\n\t\t\t\tnode.weight = 100;\n\n\t\t\t} else {\n\n\t\t\t\tnode.weight = - 100;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tnode.weight = 0;\n\n\t\t}\n\n\t}",
"title": ""
},
{
"docid": "818cb90f258c5d2fb6209c960d3e8dd7",
"score": "0.49855772",
"text": "function loadInformation() {\n const info = {\n totalClient: data.length,\n totalWeight: data.reduce((total, item) => total + item.weight, 0),\n };\n\n info.ticket = (info.totalWeight / info.totalClient).toFixed(2);\n\n setInformation(info);\n }",
"title": ""
},
{
"docid": "e1fa00fb91a6d2420bdd32a38ad9541c",
"score": "0.49744904",
"text": "function getWeight() {\n var userWeight = document.getElementById('weight').value;\n weight = userWeight;\n}",
"title": ""
},
{
"docid": "53a2dd1f7a6bf6a993c3d046874b3801",
"score": "0.49727222",
"text": "static get observedAttributes () {\n return ['looplength', 'currentbeat']\n }",
"title": ""
},
{
"docid": "701d56f7e25cf4aa9f792c3298030b8d",
"score": "0.49672282",
"text": "calcBMI(){\n let bmi = this.weight/(this.height*2);\n return bmi;\n }",
"title": ""
},
{
"docid": "dc17e895dd03bf1ea7cc30bf19f29997",
"score": "0.49670368",
"text": "getMetrics() {\n return this._metrics;\n }",
"title": ""
},
{
"docid": "cb463d17e787447574d29b62935dcc41",
"score": "0.49630457",
"text": "getMetrics() {\n\t \treturn this.metrics;\n\t }",
"title": ""
},
{
"docid": "32984da608c908aebf99e4cccd1c5b49",
"score": "0.49530324",
"text": "function getWeightModifier(data, iterator, array, wm = 1, interval) {\n\n let weightModifier = wm;\n let wmIterator = iterator;\n let nextResult;\n\n {\n array[wmIterator + interval] ?\n nextResult = array[wmIterator + interval].result :\n nextResult = upwardTrend(minuteIndicatorsData, wmIterator, interval);\n }\n\n if (data.result === nextResult) {\n weightModifier += .2;\n wmIterator++;\n getWeightModifier(data, wmIterator, array, weightModifier, interval);\n }\n\n return weightModifier;\n }",
"title": ""
},
{
"docid": "2483adcdd735ac25539262479f3b776b",
"score": "0.4939728",
"text": "function SupportFleetScorePrior_get_reci_weight(length){\n\tlet weight = [];\n\tfor (let i=0; i<length; i++) weight[i] = 1 / (i + 1);\n\treturn weight;\n}",
"title": ""
},
{
"docid": "323b7314e252ed9df171e02f5a65f5b7",
"score": "0.49376115",
"text": "dataCallback(userid){\n fetch(\"/API/myWeight/\"+userid)\n .then((res)=>{\n return (res.json());\n })\n .then((user)=>{\n let weights= user[0].weights;\n let i = 0;\n console.log(weights);\n weights.forEach((w) => {\n let date = new Date(user[0].dates[i]*1000*60*60);\n let format = \"\"+date.getDate().toString()+\"/\"+(date.getMonth()+1).toString()+\"/\"\n +date.getFullYear().toString().replace(\"20\",\"\");\n let wei = { x: format, weight: w};\n let currState = this.state.data.slice();\n this.setState({\n data: currState.concat(wei)\n });\n i++;\n });\n })\n .catch((err) => console.log(err) );\n }",
"title": ""
},
{
"docid": "6179b100b2a8798dbc85ddb4039a0905",
"score": "0.49316126",
"text": "function getData() {\n\t// TODO: error handling should try again\n\tgetMeasure( this )\n\t\t.then( parseMeasure.bind( this ) )\n\t\t.then( emitChange )\n\t\t.then( updateCache )\n\t\t.then( waitAndRefresh )\n\t\t.catch( logError );\n}",
"title": ""
},
{
"docid": "c71e01a2fdf2a563110a38ac1318da95",
"score": "0.49170512",
"text": "function weightToMetric(lbs) {\n return lbs * 0.453592;\n}",
"title": ""
},
{
"docid": "30751d4eb2f339faada01ab847d809c3",
"score": "0.4915535",
"text": "function addWeightAnnotation(e) {\n var annotation = document.getElementById('annotation').value;\n // get observation resoruce values\n // you will need to update the below to retrive the weight and height values\n var query = new URLSearchParams();\n\n query.set(\"patient\", client.patient.id);\n query.set(\"_count\", 1);\n query.set(\"_sort\", \"-date\");\n query.set(\"code\", [\n 'http://loinc.org|29463-7',\n ].join(\",\"));\n\n client.request(\"Observation?\" + query, {\n pageLimit: 0,\n flat: true\n }).then(\n function(ob) {\n\n // group all of the observation resoruces by type into their own\n var byCodes = client.byCodes(ob, 'code');\n var weight = byCodes('29463-7');\n\n var weight_json = weight[0]\n //YYYY-MM-DDThh:mm:ss+zz:zz\n var new_note = {\n authorString: \"Junle Lu\",\n text : annotation,\n time : new Date().toISOString()\n }\n weight_json.note.push(new_note);\n client.update(weight_json);\n console.log(weight);\n });\n displayAnnotation(annotation);\n}",
"title": ""
},
{
"docid": "636290d79d80ec1d0215eeef97931bbb",
"score": "0.49125093",
"text": "get activity() {\n\t\treturn this.__activity;\n\t}",
"title": ""
},
{
"docid": "a79d17fcd4482050655f5bd2c82cc27a",
"score": "0.4896097",
"text": "function GetTECount(){\r\n var teCount = 0;\r\n var activityCount = 0;\r\n var unitCount = 0;\r\n var lessonCount = 0;\r\n var teResources = {};\r\n var result = {};\r\n\r\n if(CurrentNetworkMode == NetworkModes.GRADEBAND){\r\n for(var i = 0; i < graph.numVertices; i++){\r\n var aligned = graph.vertices[i].alignedResources;\r\n for(var j = 0; j < aligned.length; j++){\r\n var resource = NGSSResources[aligned[j]];\r\n if(resource.nodeType == 'TeachEngineering' && !teResources[resource.document]){\r\n teResources[resource.document] = resource.document;\r\n\r\n if(resource.docType == \"curricularUnit\"){\r\n unitCount ++;\r\n }\r\n else if(resource.docType == \"lesson\"){\r\n lessonCount++;\r\n }\r\n else if(resource.docType == \"activity\"){\r\n activityCount++\r\n }\r\n teCount++;\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n else {\r\n var resourceHash = {};\r\n for(var i = 0; i < NGSSGraph.length; i++){\r\n var node = NGSSGraph[i];\r\n if(GraphDataStructure.containsStandardNode(node.sCode) == false) continue;\r\n var resourceIndexList = node.alignedResources;\r\n for(var j = 0; j < resourceIndexList.length; j++){\r\n var teNode = NGSSResources[resourceIndexList[j]];\r\n if(teNode.nodeType == \"TeachEngineering\" && !resourceHash[teNode.document]){\r\n resourceHash[teNode.document] = teNode.document;\r\n teCount++;\r\n if(teNode.docType == \"activity\") activityCount++;\r\n else if(teNode.docType == \"lesson\") lessonCount++;\r\n else if(teNode.docType == \"curricularUnit\") unitCount++;\r\n }\r\n }\r\n }\r\n }\r\n result.docCount = teCount;\r\n result.activityCount = activityCount;\r\n result.lessonCount = lessonCount;\r\n result.unitCount = unitCount;\r\n return result;\r\n}",
"title": ""
},
{
"docid": "cf439e3a3e109057c4bb9939bc57c797",
"score": "0.4881525",
"text": "function getTotalAttributes(person){\r\n let attributes = person.attributes;\r\n let totalAttributes = attributes.intelligence + attributes.strength + attributes.endurance + attributes.spicyFoodTolerance;\r\n //console.log(`total Attributes : ${totalAttributes}`);\r\n return totalAttributes;\r\n}",
"title": ""
},
{
"docid": "aff43495e238abb5a27357376eee55f2",
"score": "0.4881273",
"text": "function statistics() {\r\n\t\r\n\tvar tricksWon;\r\n\tvar extraTricksBagged;\r\n}",
"title": ""
},
{
"docid": "8170cc1c4ce0c2c41946484b143d6603",
"score": "0.48778275",
"text": "setupWeightAttributes(opts) {\n const {weightAttributes, vertexCount, weights, resources} = this.state;\n for (const id in weights) {\n const {values} = weights[id];\n // values can be Array, Float32Array or Buffer\n if (Array.isArray(values) || values.constructor === Float32Array) {\n log.assert(values.length / 3 === vertexCount);\n const typedArray = Array.isArray(values) ? new Float32Array(values) : values;\n if (weightAttributes[id] instanceof Buffer) {\n weightAttributes[id].setData(typedArray);\n } else {\n resources[`${id}-buffer`] = new Buffer(this.gl, typedArray);\n weightAttributes[id] = resources[`${id}-buffer`];\n }\n } else {\n // log.assert((values instanceof Attribute) || (values instanceof Buffer));\n log.assert(values instanceof Buffer);\n weightAttributes[id] = values;\n }\n }\n }",
"title": ""
},
{
"docid": "7cb1ca9d4fecd256504e959d93f43274",
"score": "0.4869197",
"text": "function getTacticsData(name,time,hmt,freq){\r\n d={'name':name,'duration':time,'doTimes':hmt,'frequency':freq};\r\n return d;\r\n}",
"title": ""
},
{
"docid": "33573016bfc42a3f6586cfda410cd4d7",
"score": "0.48617736",
"text": "calculateBMI() {\n //BMI calculating formula\n let bmi = this.weight / (this.height ** 2); \n return bmi;\n }",
"title": ""
},
{
"docid": "84d4c7becb56448d96e5c70a29755de5",
"score": "0.48515838",
"text": "function getCost(type, weight) {\n switch (type) {\n case \"stamped\": return calcStamped(weight);\n case \"metered\": return calcMetered(weight);\n case \"flat\": return calcFlat(weight);\n case \"parcel\": return calcParcel(weight);\n }\n // if error retutn this\n return NaN;\n}",
"title": ""
},
{
"docid": "91122df563e9ac32a7206a4ab5d1dcb5",
"score": "0.48457447",
"text": "function getData(){\n fetch('https://www.boredapi.com/api/activity/')\n .then((response) => response.json())\n .then((data) => {\n console.log(data)\n const activity = data.activity\n console.log(activity)\n activityDisplay.innerHTML = activity\n const type = data.type\n console.log(type)\n typeDisplay.innerHTML = type\n const participants = data.participants\n console.log(participants)\n participantsDisplay.innerHTML = participants\n const price = data.price\n console.log(price)\n priceDisplay.innerHTML = price\n })\n}",
"title": ""
},
{
"docid": "259dad7eab164a021f4a02f300b3b1c6",
"score": "0.48401994",
"text": "getBandwidth() {\n\t \treturn this.bandwidth;\n\t }",
"title": ""
},
{
"docid": "259dad7eab164a021f4a02f300b3b1c6",
"score": "0.48401994",
"text": "getBandwidth() {\n\t \treturn this.bandwidth;\n\t }",
"title": ""
},
{
"docid": "6b39c6cca12b4a7d810cceaf34d4a6aa",
"score": "0.48399872",
"text": "getTrend(weight, id) \n {\n const assessments = assessmentStore.getUserAssessment(id);\n const newWeight = weight;\n const idealWeight = this.getIdealBodyWeight(id);\n if (typeof assessments != \"undefined\" && assessments.length > 0) {\n if (Math.abs(newWeight - idealWeight) < Math.abs(assessments[assessments.length -1].weight - idealWeight))\n {\n return true;\n }\n }\n else return false;\n }",
"title": ""
},
{
"docid": "259dad7eab164a021f4a02f300b3b1c6",
"score": "0.48398587",
"text": "getBandwidth() {\n\t \treturn this.bandwidth;\n\t }",
"title": ""
},
{
"docid": "6f236955fe75ecedb3c888f6ab6ad41a",
"score": "0.48287237",
"text": "function getTreatment(dataNode){\n}",
"title": ""
},
{
"docid": "a67e1119e1bcaa78c2293b59300f1993",
"score": "0.4817652",
"text": "function calcStatWeights(gear) {\n var iters = parseInt(document.getElementById(\"switer\").value);\n var dur = parseInt(document.getElementById(\"swdur\").value);\n var opts = getOptions();\n \n var baseDPS = 0.0;\n var baseConf = 0.0;\n\n var sp_hitModDPS = 0.0;\n var sp_hitModConf = 0.0;\n\n var modDPS = [0, 0, 0, 0, 0, 0]; // SP, Int, Crit, Hit, Haste, MP5\n var modConf = [0, 0, 0, 0, 0, 0]\n var weights = [0, 0, 0, 0, 0, 0, 0]; // Int, X, Crit, Hit, Dmg, Haste, MP5\n modDPS.forEach((v, i)=>{\n var cell = document.getElementById(\"w\"+i.toString());\n cell.innerHTML = \"<div uk-spinner=\\\"ratio: 1\\\"></div>\";\n });\n\n // A base DPS without any modified stats.\n statweight(iters, dur, gear, opts, 0, 0, (res) => {\n var resVals = res.split(\",\")\n baseDPS = parseFloat(resVals[0]);\n baseConf = parseFloat(resVals[2]);\n if (baseDPS < 1) {\n // we failed.\n modDPS.forEach((v, i)=>{\n var cell = document.getElementById(\"w\"+i.toString());\n cell.innerHTML = `<text style=\"color:#FF6961\">OOM</text>`;\n }); \n var uptab = document.getElementById(\"upgrades\");\n var nr = document.createElement(\"text\");\n nr.innerText = `Simulations went OOM and so weights will be incorrect as downranking is not yet implemented.`;\n uptab.appendChild(nr);\n }\n console.log(`Base DPS: ${baseDPS} +/- ${baseConf}`);\n }); // base\n\n\n var done = [];\n var onfinish = () => {\n done.push(true);\n if (baseDPS < 1) {\n return;\n }\n if (modDPS[0] == 0) {\n return;\n }\n var baseMax = baseDPS + baseConf\n var baseMin = baseDPS - baseConf\n\n var ddpsMax = (modDPS[0]+modConf[0]) - baseMin;\n var ddpsMin = (modDPS[0]-modConf[0]) - baseMax;\n\n modDPS.forEach((v, i)=>{\n if (v == 0) {\n return;\n }\n var cell = document.getElementById(\"w\"+i.toString());\n var cellConf = document.getElementById(\"wc\"+i.toString());\n if (v == -1) {\n cell.innerHTML = `<text style=\"color:#FF6961\">OOM</text>`;\n return;\n }\n // sphit uses different value;\n if (i == 3 && sp_hitModDPS != 0.0) {\n var sphitMax = sp_hitModDPS+sp_hitModConf - baseMin;\n var sphitMin = sp_hitModDPS-sp_hitModConf - baseMax;\n \n var wmax = (v + modConf[i] - baseMin) / sphitMax;\n var wmin = (v - modConf[i] - baseMax) / sphitMin;\n var weight = (wmax + wmin) / 2;\n if (weight < 0.01) {\n weight = 0.0;\n }\n if (currentFinalStats[3] > 202) {\n weight = 0.0; // Just going to force 0 weight if you are hit capped.\n }\n\n weights[3] = weight;\n cell.innerText = weight.toFixed(2);\n cellConf.innerText = wmin.toFixed(2) + \" - \" + wmax.toFixed(2);\n return; \n }\n \n var wmax = (v + modConf[i] - baseMin) / ddpsMax;\n var wmin = (v - modConf[i] - baseMax) / ddpsMin;\n\n var weight = (wmax + wmin) / 2;\n if (weight < 0.01) {\n weight = 0.0;\n }\n \n if (i == 0) {\n weights[4] = weight;\n } else if (i == 1) {\n weights[0] = weight;\n } else if (i == 2) {\n weights[2] = weight;\n } else if (i == 4) {\n weights[5] = weight;\n } else if (i == 5) {\n weights[6] = weight;\n }\n cell.innerText = weight.toFixed(2);\n if (wmax != wmin) {\n cellConf.innerText = wmin.toFixed(2) + \" - \" + wmax.toFixed(2);\n }\n });\n\n if (done.length == 7) {\n var oomed = true;\n modDPS.forEach((v) => {\n if (v > 0) {\n oomed = false;\n }\n });\n if (oomed) {\n return;\n }\n showGearRecommendations(weights);\n }\n };\n\n statweight(iters, dur, gear, opts, 4, 20, (res) => {\n var resVals = res.split(\",\");\n sp_hitModDPS = parseFloat(resVals[0]);\n sp_hitModConf = parseFloat(resVals[2]);\n onfinish();}); // sp\n statweight(iters, dur, gear, opts, 3, 20, (res) => {\n var resVals = res.split(\",\");\n modConf[3] = parseFloat(resVals[2])\n modDPS[3] = parseFloat(resVals[0]);\n onfinish();}); // hit\n statweight(iters, dur, gear, opts, 4, 50, (res) => {\n var resVals = res.split(\",\");\n modConf[0] = parseFloat(resVals[2])\n modDPS[0] = parseFloat(resVals[0]);\n onfinish();}); // sp\n statweight(iters, dur, gear, opts, 0, 50, (res) => {\n var resVals = res.split(\",\");\n modConf[1] = parseFloat(resVals[2])\n modDPS[1] = parseFloat(resVals[0]);\n onfinish();}); // int\n statweight(iters, dur, gear, opts, 2, 50, (res) => {\n var resVals = res.split(\",\");\n modConf[2] = parseFloat(resVals[2])\n modDPS[2] = parseFloat(resVals[0]);\n onfinish();}); // crit\n statweight(iters, dur, gear, opts, 5, 50, (res) => {\n var resVals = res.split(\",\");\n modConf[4] = parseFloat(resVals[2])\n modDPS[4] = parseFloat(resVals[0]);\n onfinish();}); // haste\n statweight(iters, dur, gear, opts, 6, 50, (res) => {\n var resVals = res.split(\",\");\n modConf[5] = parseFloat(resVals[2])\n modDPS[5] = parseFloat(resVals[0]);\n onfinish();}); // mp5\n}",
"title": ""
},
{
"docid": "87a9790e118def5f03f08ed249e8eb77",
"score": "0.48013332",
"text": "function calculateRating(data) {\n\n var totalCalories = data.calories ? data.calories.summary.calories : 2000;\n\n var sleep = data.sleep.summary.totalMinutesAsleep;\n var BMR = 1600;\n var total = 0;\n var activeTime = data.activity.summary.fairlyActiveMinutes;\n var gender = 0;\n\n if ((gender = 0)) {\n totalCalories = 2200 - (BMR + activeTime * 100);\n } else {\n totalCalories = 2000 - (BMR + activeTime * 160);\n }\n\n if (totalCalories <= 200) {\n total += 2;\n } else if (totalCalories >= 200 && totalCalories <= 400) {\n total += 1;\n }\n\n if (sleep >= 8 && sleep <= 10) {\n total += 4;\n } else if (sleep >= 7 && sleep <= 11) {\n total += 2;\n }\n\n if (activeTime >= 1) {\n total += (activeTime / 2) * 4;\n }\n document.getElementById(\"righthead\").innerHTML =\n \"Overall health rating: \" + total + \"/10\";\n\n}",
"title": ""
},
{
"docid": "3fcda890dacd13c77df15aa9bbe8cabb",
"score": "0.48010415",
"text": "calculationBMI() {\n //calc\n let bmi = this.weight / (this.height ** 2);\n return bmi;//return answer when method is called\n }",
"title": ""
},
{
"docid": "62c1ac85c9f4ca31b56c5405a788c6c0",
"score": "0.47945255",
"text": "function getStatistics() {\n statistics.maxWebWorkers = config.maxWebWorkers;\n statistics.numWebWorkers = webWorkers.length;\n statistics.numTasksQueued = tasks.length;\n return statistics;\n }",
"title": ""
},
{
"docid": "2bc7f627cf05b8f5c79d541e97f36f55",
"score": "0.47898933",
"text": "getStatistics() {\n\t\treturn {\n\t\t\ttotal: this.count,\n\t\t\tok: ((this.ok / this.count) * 100 || 0).toFixed() + '%',\n\t\t\terror: ((this.error / this.count) * 100 || 0).toFixed() + '%',\n\t\t\tinvalid: ((this.invalid / this.count) * 100 || 0).toFixed() + '%',\n\t\t\tlengths: this.lengths,\n\t\t\tpayloads: this.payload,\n\t\t\tdebug: this.debuginfo,\n\t\t\tlast: this.result\n\t\t}\n\t}",
"title": ""
},
{
"docid": "84d01f151a540d7a5e3698c7f415bdef",
"score": "0.47826207",
"text": "runWatts () {\n var x = (this.props.intensity * (this.props.run.lengthFt + (this.props.run.lengthIn / 12)))\n return x\n }",
"title": ""
},
{
"docid": "64defad6848bbd1379961184a0b9c8b3",
"score": "0.47782624",
"text": "getDailyGatewayStats(start = null, end = null, attribs = null) {\n if (end === null) {\n end = Date.now();\n }\n\n if (start === null) {\n start = end - (52 * 7 * 24 * 3600 * 1000);\n }\n\n attribs = attribs === null ? ['time',\n 'mem',\n 'cpu',\n 'loadavg_5'] : ['time', ...attribs];\n\n const payload = {attrs: attribs,\n start,\n end};\n\n return this._request('/api/s/<SITE>/stat/report/daily.gw', payload);\n }",
"title": ""
},
{
"docid": "1b919f31d619b371871be41ec6b0bbd6",
"score": "0.47747755",
"text": "function getChairWeight(chair) {\n var frame = getChairFrame(chair);\n var baseWeight = frame.baseWeight;\n\n var partIDs = _.map(frame.parts, 'partID');\n var measureIDs = _.map(frame.measures, 'measureID');\n\n var partsWeight = _.sumBy(partIDs, partID => {\n var partOption = getChairPartOption(chair, partID);\n return (partOption.weight || 0);\n });\n\n var measuresWeight = _.sumBy(measureIDs, measureID => {\n var measure = getChairMeasureOption(chair, measureID);\n return measure.weight;\n });\n\n return baseWeight + partsWeight + measuresWeight;\n}",
"title": ""
},
{
"docid": "9f8d3e2b30c4117d8193643d9e60cd2d",
"score": "0.47736022",
"text": "async findPower(id, liveData) {\n\n if(id >= 0){\n var watts = liveData.DataPoints[id].Power;\n var currentTime = new Date(liveData.DataPoints[id].Timestamp*1000).toLocaleString();\n this.liveData = watts;\n this.liveTime = currentTime;\n return [watts, currentTime];\n }\n }",
"title": ""
},
{
"docid": "aecfba2244f0cd96d05d57b425640804",
"score": "0.47719195",
"text": "function getData ( ) {\n console.log( connector.deviceIsConnected );\n if ( connector.deviceIsConnected ) {\n connector.requestPower();\n \n /*\n connector.requestPower().then( (power) => {\n console.log ( \"Power: \" + power );\n });\n connector.requestVoltage().then( ( voltage ) => {\n console.log( \"Voltage: \" + voltage );\n });\n\n connector.requestCurrent().then( ( current ) => {\n console.log( \"Current: \" + current );\n });\n */\n //console.log(\" Power: \" + power + \", Voltage: \" + voltage + \", Current: \" + current );\n }\n}",
"title": ""
},
{
"docid": "99cf386185671419f1e576564c374f7a",
"score": "0.4767694",
"text": "function getActivities(){\n\tvar db = Ti.Database.install('dog.sqlite', 'db');\n\t\n\tvar activities = [];\n\t\n\tvar sql = 'select id,start_date, start_time, end_time,type_id, activity_id from activities order by id desc';\n\tvar rows = db.execute(sql);\n\twhile (rows.isValidRow()){\n\t\t\n\t\tvar duration = rows.field(3) - rows.field(2);\n\t\t\n\t\tvar obj = {\n\t\t\tid:rows.field(0),\n\t\t\tstart_date:rows.field(1),\n\t\t\tstart_time:rows.field(2),\n\t\t\tend_time:rows.field(3),\n\t\t\tactivity_id:rows.field(5),\n\t\t\tduration:duration,\n\t\t\tdogs:getActivityDetails(rows.field(0))\n\t\t};\n\t\t\n\t\tactivities.push(obj);\n\t\trows.next();\n\t}\n\t\n\trows.close();\n\tdb.close();\n\t\n\treturn activities;\n}",
"title": ""
},
{
"docid": "9bebc54104a62213bfdc349f1d9d6d4c",
"score": "0.47598618",
"text": "function calcPostage(type, weight, callback) {\n var data = {\n type: getType(type),\n weight: weight,\n cost: getCost(type, weight)\n };\n\n if (callback) callback(null, data);\n if (data.type == \"Parcel\") {\n console.log(data.type +\" at \" + weight + \" lbs = $\" + data.cost);\n }\n else {\n console.log(data.type +\" at \" + weight + \" oz = $\" + data.cost);\n }\n\n return data;\n}",
"title": ""
},
{
"docid": "064c64756ed35c703da5acc2e0503fdf",
"score": "0.47564924",
"text": "function Weight (obj) {\n\tthis.userId = undefined;\n\tthis.date = undefined;\n\tthis.weight = undefined;\n\tthis.seq = undefined;\n\tthis.timezone = undefined;\n\t\n\tif( obj !== undefined ) {\n\t\tfor (var prop in obj) { //TODO: eliminate warning\n\t\t\tthis[prop] = obj[prop];\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "4acd26eed70286b09e4fe3c8c3c234ce",
"score": "0.47440436",
"text": "constructor (name, weight) {\n this.name = name;\n this.weight = weight;\n }",
"title": ""
},
{
"docid": "3a412988b4c119d794caed65a6c0004d",
"score": "0.47361884",
"text": "info()\n {\n return {\n state: [ this._state, this._bucketOf(this._state).average ],\n data: JSON.stringify(this._bucket.map(b => b.average)),\n };\n }",
"title": ""
},
{
"docid": "f823199be91337da6cbfcd6b56247c34",
"score": "0.47319207",
"text": "function getStateInfo(data, state, chosenXAxis, chosenCategory) {\n var stateInfo = [];\n\n st = data.filter((d) => {\n if (state === 'United States') {\n return d;\n } else {\n return d.state === state;\n };\n });\n // console.log(st);\n\n var totalWeight = d3.sum(st.map(d => d.weight));\n console.log(totalWeight);\n\n chosenCategory.forEach((item) => {\n var x = 0;\n var selected = st.filter((d) => {\n return d[chosenXAxis] === item;\n });\n // console.log(selected);\n for (i in selected) {\n x += selected[i].weight\n };\n stateInfo.push({\n \"percent\" : (x / totalWeight)*100,\n \"category\" : item \n });\n });\n console.log(stateInfo);\n return stateInfo\n}",
"title": ""
},
{
"docid": "dc0f0e997f9c903b1fab7a093bcf6817",
"score": "0.47242305",
"text": "getStats() {\n return computeArrayStats(this.samples.asArray());\n }",
"title": ""
},
{
"docid": "dc0f0e997f9c903b1fab7a093bcf6817",
"score": "0.47242305",
"text": "getStats() {\n return computeArrayStats(this.samples.asArray());\n }",
"title": ""
}
] |
8af2578fd522c58849acac46f1ae2c5e | Base inspection function for prefilters and transports | [
{
"docid": "ef8dc33ce532e008e91565884108dbd4",
"score": "0.0",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
}
] | [
{
"docid": "0f9d4b6c9f33771d848ab8d4258e8e54",
"score": "0.61725205",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n \n \tvar inspected = {},\n \t\tseekingTransport = ( structure === transports );\n \n \tfunction inspect( dataType ) {\n \t\tvar selected;\n \t\tinspected[ dataType ] = true;\n \t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n \t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n \t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n \t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n \t\t\t\tinspect( dataTypeOrTransport );\n \t\t\t\treturn false;\n \t\t\t} else if ( seekingTransport ) {\n \t\t\t\treturn !( selected = dataTypeOrTransport );\n \t\t\t}\n \t\t});\n \t\treturn selected;\n \t}\n \n \treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }",
"title": ""
},
{
"docid": "288833d7a21825f5577e67c53d9bd55b",
"score": "0.6129813",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\t\tvar inspected = {},\n\t\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\t\tfunction inspect( dataType ) {\n\t\t\t\tvar selected;\n\t\t\t\tinspected[ dataType ] = true;\n\t\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn selected;\n\t\t\t}\n\t\n\t\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t\t}",
"title": ""
},
{
"docid": "6e11d125823002cf7d416714ded89a69",
"score": "0.6105363",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n \n var inspected = {},\n seekingTransport = ( structure === transports );\n \n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n \n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n \n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "bddf892b0661276f0493e8f285ba0e5d",
"score": "0.6089844",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "1fed377c59a482fcd4272d902d208dbf",
"score": "0.607385",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n \tvar inspected = {},\n \t\tseekingTransport = ( structure === transports );\n\n \tfunction inspect( dataType ) {\n \t\tvar selected;\n \t\tinspected[ dataType ] = true;\n \t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n \t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n \t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n \t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n \t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n \t\t\t\tinspect( dataTypeOrTransport );\n \t\t\t\treturn false;\n \t\t\t} else if ( seekingTransport ) {\n \t\t\t\treturn !( selected = dataTypeOrTransport );\n \t\t\t}\n \t\t} );\n \t\treturn selected;\n \t}\n\n \treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }",
"title": ""
},
{
"docid": "a0a6e15c8c12e8d2f406c3eee50028c5",
"score": "0.60586876",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\t\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\t\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\t\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "f19583c5af1b83e184dd9dfef82ae506",
"score": "0.60159165",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "af79caf9f7f908feff30d5101423dc62",
"score": "0.601241",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "af79caf9f7f908feff30d5101423dc62",
"score": "0.601241",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "af79caf9f7f908feff30d5101423dc62",
"score": "0.601241",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "af79caf9f7f908feff30d5101423dc62",
"score": "0.601241",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "af79caf9f7f908feff30d5101423dc62",
"score": "0.601241",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "91161f993024c23c951889bb1437ded8",
"score": "0.601093",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "91161f993024c23c951889bb1437ded8",
"score": "0.601093",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "91161f993024c23c951889bb1437ded8",
"score": "0.601093",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n });\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "22ad7f3a0dbae2cb5129ccddbf0b21fc",
"score": "0.6002863",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "c2818817545a268d96235051a5680381",
"score": "0.5991916",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\t\tvar inspected = {},\n\t\t\tseekingTransport = ( structure === transports );\n\n\t\tfunction inspect( dataType ) {\n\t\t\tvar selected;\n\t\t\tinspected[ dataType ] = true;\n\t\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\t\treturn false;\n\t\t\t\t} else if ( seekingTransport ) {\n\t\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn selected;\n\t\t}\n\n\t\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n\t}",
"title": ""
},
{
"docid": "df5b133fc86bd77d2861b3787459fff8",
"score": "0.5987543",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}",
"title": ""
},
{
"docid": "df5b133fc86bd77d2861b3787459fff8",
"score": "0.5987543",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}",
"title": ""
},
{
"docid": "05b68b4527ce98b9905f038e5aad4738",
"score": "0.5984727",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}",
"title": ""
},
{
"docid": "77b1696a29976c275598fe810d407abf",
"score": "0.59711784",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\r\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t} );\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}",
"title": ""
},
{
"docid": "77b1696a29976c275598fe810d407abf",
"score": "0.59711784",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r\n\r\n\tvar inspected = {},\r\n\t\tseekingTransport = ( structure === transports );\r\n\r\n\tfunction inspect( dataType ) {\r\n\t\tvar selected;\r\n\t\tinspected[ dataType ] = true;\r\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\r\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r\n\r\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\r\n\t\t\t\tinspect( dataTypeOrTransport );\r\n\t\t\t\treturn false;\r\n\t\t\t} else if ( seekingTransport ) {\r\n\t\t\t\treturn !( selected = dataTypeOrTransport );\r\n\t\t\t}\r\n\t\t} );\r\n\t\treturn selected;\r\n\t}\r\n\r\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\r\n}",
"title": ""
},
{
"docid": "410d850d2da44fc3756844ebcd75af66",
"score": "0.59552187",
"text": "function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\n\n\t\t\t\tvar inspected = {},\n\t\t\t\t seekingTransport = structure === transports;\n\n\t\t\t\tfunction inspect(dataType) {\n\t\t\t\t\tvar selected;\n\t\t\t\t\tinspected[dataType] = true;\n\t\t\t\t\tjQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {\n\t\t\t\t\t\tvar dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\n\t\t\t\t\t\tif (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[dataTypeOrTransport]) {\n\n\t\t\t\t\t\t\toptions.dataTypes.unshift(dataTypeOrTransport);\n\t\t\t\t\t\t\tinspect(dataTypeOrTransport);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} else if (seekingTransport) {\n\t\t\t\t\t\t\treturn !(selected = dataTypeOrTransport);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn selected;\n\t\t\t\t}\n\n\t\t\t\treturn inspect(options.dataTypes[0]) || !inspected[\"*\"] && inspect(\"*\");\n\t\t\t}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "e991f2142668b860185c13181c3fe59a",
"score": "0.5951495",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "a54369a19649e98448105b6ca27daf37",
"score": "0.5948276",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }",
"title": ""
},
{
"docid": "a54369a19649e98448105b6ca27daf37",
"score": "0.5948276",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n var inspected = {},\n seekingTransport = ( structure === transports );\n\n function inspect( dataType ) {\n var selected;\n inspected[ dataType ] = true;\n jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n if ( typeof dataTypeOrTransport === \"string\" &&\n !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n options.dataTypes.unshift( dataTypeOrTransport );\n inspect( dataTypeOrTransport );\n return false;\n } else if ( seekingTransport ) {\n return !( selected = dataTypeOrTransport );\n }\n } );\n return selected;\n }\n\n return inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n }",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
},
{
"docid": "51d87999b149de43d85ebdc795e7b853",
"score": "0.5947033",
"text": "function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}",
"title": ""
}
] |
e84eb22ecd5461660cdbe88e8c811a13 | Mark scripts as having already been evaluated | [
{
"docid": "1e114daa41c1be96898a002af8bc7154",
"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\tdata_priv.set(\n\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.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": ""
}
] |
52df0f0c63e29f61159776805a751cdc | Function to fetch the cast detail | [
{
"docid": "83c7e86d1299766aba0b6f4e236efe52",
"score": "0.44290847",
"text": "function getInfo(url){\n fetch(url).then(res => res.json()).then(data => {\n console.log(data.results)\n \n const movieId = data.results[0].id\n getMovieInfo(movieId)\n console.log(movieId)\n })\n}",
"title": ""
}
] | [
{
"docid": "22b2c91bf7bfe90ad44d1e4ff8e90396",
"score": "0.66533273",
"text": "function getCast(cast) {\n let castArr = [];\n for(let i=0; i<4;i++){\n castArr.push(cast.cast[i].name)\n }\n return castArr.join('<br>')\n}",
"title": ""
},
{
"docid": "7c360512a7e45d2a0e7e75135218d1fd",
"score": "0.61075765",
"text": "function getCastDetails(queryUrl) {\n console.log(\"query URL\", queryUrl);\n return new Promise( (resolve, reject) => {\n $.ajax({\n url: queryUrl\n }).done( (movie) => {\n // console.log(\"movie\", movie);\n resolve(movie);\n }).fail( (err) => {\n console.log(\"error getting details\", err);\n reject(err);\n });\n });\n}",
"title": ""
},
{
"docid": "8c624b36cdc11495be3f665d1f30c1b2",
"score": "0.59922194",
"text": "function get_individual_cast(movie_cast,my_api_key) {\r\n cast_bdays = [];\r\n cast_bios = [];\r\n cast_places = [];\r\n for(var cast_id in movie_cast.cast_ids){\r\n $.ajax({\r\n type:'GET',\r\n url:'https://api.themoviedb.org/3/person/'+movie_cast.cast_ids[cast_id]+'?api_key='+my_api_key,\r\n async:false,\r\n success: function(cast_details){\r\n cast_bdays.push((new Date(cast_details.birthday)).toDateString().split(' ').slice(1).join(' '));\r\n cast_bios.push(cast_details.biography);\r\n cast_places.push(cast_details.place_of_birth);\r\n }\r\n });\r\n }\r\n return {cast_bdays:cast_bdays,cast_bios:cast_bios,cast_places:cast_places};\r\n }",
"title": ""
},
{
"docid": "82c3e23b5dd9866ce4ed24c3b7b1e417",
"score": "0.59780633",
"text": "function get_movie_cast(sender, movieID) {\n\n\tconsole.log(\"Filme ID: \" + movieID);\n\n\tvar options = { method: 'GET',\n \t\t\t\t\turl: 'https://api.themoviedb.org/3/movie/'+ movieID + '/casts',\n \t\t\t\t\tqs: { \n \t\t\t\t\t\tlanguage: 'pt-BR',\n \t\t\t\t\tapi_key: config.TMDB_API_KEY \n \t\t\t\t},\n \t\t\t\t\tbody: '{}' \n \t};\n\n\trequest(options, function (error, response, body) {\n \t\tif(!error && response.statusCode == 200){ \t\t\t\t\t\t\n \t \tmovie_inf_cast = JSON.parse(body);\n\t \t\n\t \tsend_movie_cast(sender, movie_inf_cast);\n\t \n \t} else {\n \t\t\tconsole.error(response.error);\n \t \t} \n \t});\t\n\t\t\n}",
"title": ""
},
{
"docid": "0156fd954257245771da896575612a7a",
"score": "0.5898482",
"text": "static get casts () {\n return {\n redrawable: 'boolean',\n logged_in_user_liked: 'boolean',\n logged_in_user_is_follower: 'boolean'\n }\n }",
"title": ""
},
{
"docid": "2ce808ab227088717b841fefc68d1cba",
"score": "0.5806152",
"text": "function getCastingsData(state) {\n return state.castings.data;\n}",
"title": ""
},
{
"docid": "6cd0118b1fdcbbeac2c2548ef2253c52",
"score": "0.5741026",
"text": "infoCast ( film_id ) {\n axios\n .get( 'https://api.themoviedb.org/3/movie/' + film_id + '/casts', {\n\n params: {\n api_key: '3414ee67882ebd632253f10b916225d8',\n language: 'it',\n }\n\n } )\n .then( ( response ) => {\n this.arrayCast = response.data.cast;\n } );\n }",
"title": ""
},
{
"docid": "c6069f740d061e4fca17c85db89de401",
"score": "0.5682385",
"text": "function getCastAndCrew (cb, movieId) {\n\tlet url = `${API_URL}movie/${movieId}/credits?api_key=${API_KEY}`;\n\tfetch(url, {\n\t\tmethod: 'GET'\n\t}).then(response => response.json()).then(data => {\n\t\tcb(data);\n\t}).catch(err => {\n\t\tconsole.log('error while fetching details', err);\n\t})\n\n}",
"title": ""
},
{
"docid": "21c5a9bb59bfcf461a94df430333cb4d",
"score": "0.5592209",
"text": "function getMovieCast(movieId){\n return $http({\n method: 'GET', \n url: 'http://api.themoviedb.org/3/movie/' + movieId + '/credits?api_key=' + movieDb.apiKey})\n .then(function successCallback(response){\n return response.data.cast; \n }, function errorCallback(response){\n console.log(response); \n });\n }",
"title": ""
},
{
"docid": "159b19d88ed3c731ba9f21befb9265cb",
"score": "0.55246",
"text": "function get_movie_cast(movie_id,my_api_key){\r\n cast_ids= [];\r\n cast_names = [];\r\n cast_chars = [];\r\n cast_profiles = [];\r\n\r\n top_10 = [0,1,2,3,4,5,6,7,8,9];\r\n $.ajax({\r\n type:'GET',\r\n url:\"https://api.themoviedb.org/3/movie/\"+movie_id+\"/credits?api_key=\"+my_api_key,\r\n async:false,\r\n success: function(my_movie){\r\n if(my_movie.cast.length>=10){\r\n top_cast = [0,1,2,3,4,5,6,7,8,9];\r\n }\r\n else {\r\n top_cast = [0,1,2,3,4];\r\n }\r\n for(var my_cast in top_cast){\r\n cast_ids.push(my_movie.cast[my_cast].id)\r\n cast_names.push(my_movie.cast[my_cast].name);\r\n cast_chars.push(my_movie.cast[my_cast].character);\r\n cast_profiles.push(\"https://image.tmdb.org/t/p/original\"+my_movie.cast[my_cast].profile_path);\r\n }\r\n },\r\n error: function(){\r\n alert(\"Invalid Request!\");\r\n $(\"#loader\").delay(500).fadeOut();\r\n }\r\n });\r\n\r\n return {cast_ids:cast_ids,cast_names:cast_names,cast_chars:cast_chars,cast_profiles:cast_profiles};\r\n }",
"title": ""
},
{
"docid": "aa53bcf953ad00c2d30e3055acbf4e97",
"score": "0.5518533",
"text": "infoCastTelefilm ( film_id ) {\n axios\n .get( 'https://api.themoviedb.org/3/tv/' + film_id + '/credits', {\n\n params: {\n api_key: '3414ee67882ebd632253f10b916225d8',\n language: 'it',\n }\n\n } )\n .then( ( response ) => {\n this.arrayCast = response.data.cast;\n } );\n }",
"title": ""
},
{
"docid": "96588458b16fe404337def4c95158bb6",
"score": "0.54427034",
"text": "componentDidMount() {\n this.getCast();\n }",
"title": ""
},
{
"docid": "fd551f1df46dc718a083104f87d34a1c",
"score": "0.53751284",
"text": "function castItemForDB({id, chat_link, name, icon, description, type, rarity,\n level, vendor_value, default_skin, details}) {\n return {\n item_id: id,\n chat_link,\n name,\n icon,\n description,\n type,\n rarity,\n level,\n vendor_value,\n default_skin,\n details: JSON.stringify(details)\n }\n}",
"title": ""
},
{
"docid": "cdc7c020e8284dd1cf03b51f1658726f",
"score": "0.5328643",
"text": "function cast(object){\n var castStr = ''\n for(var i = 0; i < object.cast.length; i++) {\n castStr += '<li class=\"cast\">' + object.cast[i] + '</li>';\n }\n return '<div> Starring: <ul>' + castStr + '</ul> </div>';\n }",
"title": ""
},
{
"docid": "2254d6608e098a98bde1b678d78d604c",
"score": "0.5328132",
"text": "cast(value, cast) {\n return cast ? cast(value) : value;\n }",
"title": ""
},
{
"docid": "f082225cdb26be47bdb1e905c87ec0c5",
"score": "0.5203545",
"text": "function recupera_cast(id_elemento, tipologia) {\n $.ajax({\n //https://api.themoviedb.org/3/tv/{tv_id}/credits?api_key=<<api_key>>&language=en-US\n //chiamata cast film --> /movie/{tv_id}/credits\n //chiamata cast serie --> /tv/{tv_id}/credits\n 'url': api_base + tipologia,\n 'data' : {\n 'api_key': api_key,\n },\n 'method':'get',\n 'success': function(response_cast){\n // stampa_risultati(risultati);\n //mi restituisce un array con la lista del cast del fiml\n var lista_cast = response_cast.cast;\n //inserisci in una lista ogni attore\n //devo creare un oggetto così gli do i valori data-id/codice_film e nomi cast\n var nomi_cast = '';\n if (lista_cast.length == 0) {\n console.log('Info cast non presenti');\n $('.card[data-id=\"' + id_elemento + '\"]').find('.cast').text('Info cast non presenti');\n } else {\n //scorri gli elementi della lista e prendi il nome\n for (var k = 0; k < lista_cast.length && k < 5; k++) {\n nomi_cast += lista_cast[k].name + ', ';\n }\n console.log(nomi_cast);\n //prendi la card che ha data-id uguale a codice, prendi suo figlio cast e riempilo con nomi_cast\n $('.card[data-id=\"' + id_elemento + '\"]').find('.cast').text('Cast: ' + nomi_cast);\n // $('.card').find('.cast').text('Cast: ' + nomi_cast);\n }\n },\n 'error':function(){\n alert('error');\n }\n });\n }",
"title": ""
},
{
"docid": "a8166ef6d18df17b8c50199b49298a13",
"score": "0.5201666",
"text": "cast({ id, url }) {\n this.props.showCasting();\n chrome.runtime.sendMessage(\n {\n type: 'cast',\n url: url,\n ip: this.props.ip,\n title: this.state.title\n },\n error => {\n this.props.showCasting();\n if (!error) return;\n // Change the icon to casting\n // map and update\n const newTable = this.state.table.map(item => {\n item.casting = false;\n if (item.id === id) {\n item.casting = true;\n }\n return item;\n });\n this.setState({ table: newTable });\n }\n );\n }",
"title": ""
},
{
"docid": "687b274848338f9e789b60661923fa28",
"score": "0.518514",
"text": "function getReaderInformationDetail() {\n var packet = getReaderInformation(0xB0);\n return packet;\n }",
"title": ""
},
{
"docid": "c6daebb443b072ed6f352d323a6a824b",
"score": "0.5137926",
"text": "__cast(field){\n const {columns, relax_column_count} = this.options\n const isColumns = Array.isArray(columns)\n // Dont loose time calling cast\n // because the final record is an object\n // and this field can't be associated to a key present in columns\n if( isColumns === true && relax_column_count && this.options.columns.length <= this.state.record.length ){\n return [undefined, undefined]\n }\n if(this.state.castField !== null){\n try{\n const info = this.__infoField()\n return [undefined, this.state.castField.call(null, field, info)]\n }catch(err){\n return [err]\n }\n }\n if(this.__isFloat(field)){\n return [undefined, parseFloat(field)]\n }else if(this.options.cast_date !== false){\n const info = this.__infoField()\n return [undefined, this.options.cast_date.call(null, field, info)]\n }\n return [undefined, field]\n }",
"title": ""
},
{
"docid": "c6daebb443b072ed6f352d323a6a824b",
"score": "0.5137926",
"text": "__cast(field){\n const {columns, relax_column_count} = this.options\n const isColumns = Array.isArray(columns)\n // Dont loose time calling cast\n // because the final record is an object\n // and this field can't be associated to a key present in columns\n if( isColumns === true && relax_column_count && this.options.columns.length <= this.state.record.length ){\n return [undefined, undefined]\n }\n if(this.state.castField !== null){\n try{\n const info = this.__infoField()\n return [undefined, this.state.castField.call(null, field, info)]\n }catch(err){\n return [err]\n }\n }\n if(this.__isFloat(field)){\n return [undefined, parseFloat(field)]\n }else if(this.options.cast_date !== false){\n const info = this.__infoField()\n return [undefined, this.options.cast_date.call(null, field, info)]\n }\n return [undefined, field]\n }",
"title": ""
},
{
"docid": "b8b7bf09b99ce347488f5489ab829cff",
"score": "0.5120272",
"text": "reportActors(display = false) {\n console.log(`\\nnarrative.reportActors() display=${display}`);\n if (display) {\n for (const [k, v] of Object.entries(cast)) {\n console.log(`cast contains actor ${v} with name ${k}`);\n // and actor.name ${v.name}`);\n }\n }\n return cast;\n }",
"title": ""
},
{
"docid": "309128688cac335b6c9f160a23143f19",
"score": "0.5075544",
"text": "function displayCasts(movie) {\n\nvar casts = '';\t\n\n\tfor(var i = 0; i < movie.actors.length; i = i + 1) {\n\n\tcasts = casts + movie.actors[i].name + ' is a ' + movie.actors[i].sex + ' person which is ' + movie.actors[i].age + ' years old.\\n';\n\n\t}\n\nreturn casts;\n\n}",
"title": ""
},
{
"docid": "c487a96a5b0931dc552607fffd40f0cd",
"score": "0.50333166",
"text": "function nextValidCast(currentCast) {\n if (currentCast == \"source\") {\n return [\"mana\"];\n } else if (currentCast == \"mana\") {\n return [\"action\"];\n } else if (currentCast == \"action\") {\n return [\"mana\", \"source\"];\n } else {\n return [];\n }\n }",
"title": ""
},
{
"docid": "71c1f2ec6c742eb4bde123bc1db63cfd",
"score": "0.5030429",
"text": "function convertDetail(detail, type) {\n\t\tif (type === \"settlement\") {\n\t\t\t// Convert to settlement and add to settlementData\n\t\t\tvar s = {\n\t\t\t\t\"Unit\": detail.UnitNo,\n\t\t\t\t\"ProNo\": detail.LocationCode + \"-\" + detail.ProNo + \"-\" + detail.LineNo + \"-\" + detail.MoveNo,\n\t\t\t\t\"Equipment#\": detail.EquipmentNo,\n\t\t\t\t\"Account\": detail.AccountCode,\n\t\t\t\t\"Net Price\": detail.Amount.toFixed(2).toString()\n\t\t\t};\n\t\t\tsettlementData.push(s);\n\t\t} else if (type === \"deduction\") {\n\t\t\t// Convert to deduction and add to deductionData\n\t\t\tvar d = {\n\t\t\t\t\"Unit\": detail.UnitNo,\n\t\t\t\t\"Account\": detail.AccountCode,\n\t\t\t\t\"Description\": detail.Description,\n\t\t\t\t\"Net Price\": detail.Amount.toFixed(2).toString()\n\t\t\t}\n\t\t\tdeductionData.push(d);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "ea29061a3acdd7f2f74802e0c54a5124",
"score": "0.50094044",
"text": "getMoreCast() {\n\t\tconst { hero } = this.props.match.params;\n\t\tconst { actors } = this.props;\n\t\treturn Object.keys(actors)\n\t\t\t.filter(key => key !== hero)\n\t\t\t.map(key => actors[key]);\n\t}",
"title": ""
},
{
"docid": "d4fbc09e2d916f62e7bd0b6f2b2a0bab",
"score": "0.4981815",
"text": "_onCast(event) {\n\t\tconst actionId = event.ability.guid\n\n\t\tconst action = getDataBy(ACTIONS, 'id', actionId)\n\t\tif (action && action.onGcd) {\n\t\t\tthis._tryConsumeSharpcast(event)\n\t\t}\n\t}",
"title": ""
},
{
"docid": "07d81f736a62fc4ff323ab809dd004e7",
"score": "0.4969698",
"text": "function getInfo(type, element) {\n if (type == 'artist') {\n getArtistDetails(element);\n } else if (type == 'album') {\n getArtistDetails(element);\n getAlbumDetails(element);\n } else if (type == 'track') {\n getArtistDetails(element);\n getTrackDetails(element);\n }\n}",
"title": ""
},
{
"docid": "6347e7ce80c73a5a90eda129dddf9f07",
"score": "0.49348876",
"text": "async function getPodcast()\n{\n let result = await Podcast.find();\n console.log('displaying podcast',result);\n console.log('called getPodcast()');\n}",
"title": ""
},
{
"docid": "09cdc43f919cd2fda00c9144f9901f42",
"score": "0.4873999",
"text": "function getForcast(locations) {\n fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${locations.lat}&lon=${locations.lon}&appid=${apiKey.key2}&units=imperial`)\n .then((response) => response.json())\n .then((data) => loadForcast(data))\n}",
"title": ""
},
{
"docid": "1fc2073c47af1f895ce6608d73ae1634",
"score": "0.4844546",
"text": "function displayForcast(i){\n date = response.list[i].dt_txt;\n date = date.substring(0,10);\n temp = response.list[i].main.temp;\n humidity =response.list[i].main.humidity;\n weather = response.list[i].weather[0].main;\n\n //Logic for adding icons\n if(weather.toString() === \"Clouds\"){\n //console.log(\"itClouds\");\n weather = cloud;\n }\n else if(weather.toString() === \"Clear\"){\n // console.log(\"itclear\");\n weather = sun;\n }\n else if(weather.toString() === \"Rain\"){\n //console.log(\"itRain\");\n weather = rain;\n }\n else if(weather.toString() === \"Snow\"){\n weather = snow;\n }\n\n //console.log(weather);\n //console.log(response);\n // console.log(date);\n //console.log(temp);\n // console.log(humidity);\n\n\n \n }",
"title": ""
},
{
"docid": "d71e6ded9fa361854ad0e4c0e05bafc6",
"score": "0.48186532",
"text": "function selectedCast(n) {\n cast = n;\n drawShapes();\n\n}",
"title": ""
},
{
"docid": "9d6586d676b8fbdfa2cf5fe5b7361124",
"score": "0.48139748",
"text": "function getNames(result) {\n var names = [],\n obj = {};\n for (var i = 0, length = result.abridged_cast.length; i < length; i += 1) {\n obj = {};\n obj.name = result.abridged_cast[i].name;\n obj.id = result.abridged_cast[i].id;\n names.push(obj);\n }\n return names;\n }",
"title": ""
},
{
"docid": "d0a3f2300a7397449e832e25f9f0db19",
"score": "0.4771421",
"text": "function stampaCast() {\n //ritardo la funzione così da dare il tempo alle chiamate ajax di essere effettuate\n setTimeout(function(){\n //per ogni locandina\n $(\"#container-films .container-locandina\").each(function(){\n //per ogni elemento dell'array di oggetti\n for (var i = 0; i < objCastFiltrato.length; i++){\n //se id della locandina è uguale all'id dell'array di oggetti\n if($(this).data('id') == objCastFiltrato[i].id){\n //scrivo nell'html gli attori in quella determinata locandina\n $('[data-id=' + objCastFiltrato[i].id + ']').find('.cast').text(objCastFiltrato[i].actors);\n }\n }\n })\n },300)\n }",
"title": ""
},
{
"docid": "71ec496610c073805f1cc21219838de2",
"score": "0.4767077",
"text": "function castFilmSerie(idFilmSerie, tipo){\n var attori = []; //array dove verranno inseriti gli attori\n var isFilm = true; \n if (tipo === isFilm){ //se isFilm è true\n tipo = 'movie'; //valorizzo con movie\n }else{\n tipo = 'tv'; // valorizzo con tv\n }\n $.ajax({ \n url: 'https://api.themoviedb.org/3/'+ tipo + '/' + idFilmSerie + '/credits', //adeguo url\n method: \"GET\",\n data: {\n api_key: api_key,\n }, \n success: function(data){\n // ciclo ogni risultato della query\n var maxCast = 5; // massimo di attori\n var stringaAttori = \"\";\n for (var i = 0; i < data.cast.length; i++) {\n if(i == maxCast){ //se i arriva al maxCast\n i = data.cast.length; // cambia i al max dell'array\n }else{\n attori.push(data.cast[i].name); // aggiungo all'array\n stringaAttori += data.cast[i].name + \", \" //aggiungo alla stringa\n }\n }\n //ottengo stringa con tutti gli attori\n stringaAttori = stringaAttori.slice(0, stringaAttori.length - 2);\n //ottengo oggetto con id del film-serie e 5 attori \n objCastFiltrato.push(\n {\n 'id': idFilmSerie,\n 'actors': stringaAttori\n });\n },\n error: function(req, err){\n console.log(\"Errore nella funzione CastFilmSerie()\", err);\n } \n }) \n }",
"title": ""
},
{
"docid": "42d90ce24659e7e1944fe03063874238",
"score": "0.4766076",
"text": "function uviForcasts(lat, lon, apid) {\n var queryURL = 'https://api.openweathermap.org/data/2.5/onecall?lat=' + lat + '&lon=' + lon + '&exclude=hourly&units=imperial&appid=' + APIKEY;\n console.log('uvi link: ', queryURL);\n fetch(queryURL)\n .then(function (response) {\n var accessCityData = response.json;\n return response.json();\n })\n .then(function (data) {\n console.log('Data: ', data);\n var uvi = data.current.uvi;\n console.log('uvi: ', data.current.uvi);\n return uvi;\n });\n}",
"title": ""
},
{
"docid": "1a8776c4119ed342e82f911574540cb2",
"score": "0.4763046",
"text": "function GetActorDirectorInfo(id){\n //call \n actordirectorulr= 'https://api.themoviedb.org/3/person/'+id+'?api_key=77c9133483df2cf7a1eb322d38433453&language=en-US'\n fetch(actordirectorulr)\n .then(function(msg){\n return msg.json();\n })\n \n .then((msg)=>{\n \n ActorDirector(msg)\n \n })\n }",
"title": ""
},
{
"docid": "a5fac72848d63ec3eef7475e94fcf612",
"score": "0.47541738",
"text": "function retrieveStatus(){\n request(icecastUrl, function (error, response, body) {\n // If error, log it\n var mountpointList = JSON.parse(body).icestats.source;\n // Check for all three mountpoints\n checkStatus(mountpointList, 'listen');\n checkStatus(mountpointList, 'hub');\n checkStatus(mountpointList, 'harrow');\n });\n}",
"title": ""
},
{
"docid": "cbe421bfd4c8b804741980bc7ee39f21",
"score": "0.47528803",
"text": "function getCasts(type) {\n let validCasts = nextValidCast(type);\n let stringBuilder = \"\";\n validCasts.forEach((item) => {\n validTypes[item].typesList.forEach((property) => {\n stringBuilder += ` ${property}`;\n });\n });\n stringBuilder += \".\";\n return stringBuilder;\n }",
"title": ""
},
{
"docid": "831108925e90260da8709daed3b528e6",
"score": "0.47129637",
"text": "function show_details(movie_details,arr,movie_title,my_api_key,movie_id){\r\n var imdb_id = movie_details.imdb_id;\r\n var poster = 'https://image.tmdb.org/t/p/original'+movie_details.poster_path;\r\n var overview = movie_details.overview;\r\n var genres = movie_details.genres;\r\n var rating = movie_details.vote_average;\r\n var vote_count = movie_details.vote_count;\r\n var release_date = new Date(movie_details.release_date);\r\n var runtime = parseInt(movie_details.runtime);\r\n var status = movie_details.status;\r\n var genre_list = []\r\n for (var genre in genres){\r\n genre_list.push(genres[genre].name);\r\n }\r\n var my_genre = genre_list.join(\", \");\r\n if(runtime%60==0){\r\n runtime = Math.floor(runtime/60)+\" hour(s)\"\r\n }\r\n else {\r\n runtime = Math.floor(runtime/60)+\" hour(s) \"+(runtime%60)+\" min(s)\"\r\n }\r\n arr_poster = get_movie_posters(arr,my_api_key);\r\n \r\n movie_cast = get_movie_cast(movie_id,my_api_key);\r\n \r\n ind_cast = get_individual_cast(movie_cast,my_api_key);\r\n \r\n details = {\r\n 'title':movie_title,\r\n 'cast_ids':JSON.stringify(movie_cast.cast_ids),\r\n 'cast_names':JSON.stringify(movie_cast.cast_names),\r\n 'cast_chars':JSON.stringify(movie_cast.cast_chars),\r\n 'cast_profiles':JSON.stringify(movie_cast.cast_profiles),\r\n 'cast_bdays':JSON.stringify(ind_cast.cast_bdays),\r\n 'cast_bios':JSON.stringify(ind_cast.cast_bios),\r\n 'cast_places':JSON.stringify(ind_cast.cast_places),\r\n 'imdb_id':imdb_id,\r\n 'poster':poster,\r\n 'genres':my_genre,\r\n 'overview':overview,\r\n 'rating':rating,\r\n 'vote_count':vote_count.toLocaleString(),\r\n 'release_date':release_date.toDateString().split(' ').slice(1).join(' '),\r\n 'runtime':runtime,\r\n 'status':status,\r\n 'rec_movies':JSON.stringify(arr),\r\n 'rec_posters':JSON.stringify(arr_poster),\r\n }\r\n\r\n $.ajax({\r\n type:'POST',\r\n data:details,\r\n url:\"/recommend\",\r\n dataType: 'html',\r\n complete: function(){\r\n $(\"#loader\").delay(500).fadeOut();\r\n },\r\n success: function(response) {\r\n $('.results').html(response);\r\n $('#autoComplete').val('');\r\n $(window).scrollTop(0);\r\n }\r\n });\r\n}",
"title": ""
},
{
"docid": "d5d0b4aba0e427bff955b8198b84235a",
"score": "0.4701484",
"text": "function castStats(movieData, item) {\n getGenderCount(movieData, movieData[item]['cast'], 'cast', item);\n getGenderCount(movieData, movieData[item]['crew'], 'crew', item);\n getGenderCount(movieData, movieData[item]['cast_crew'], 'overall', item);\n} // END: castStats",
"title": ""
},
{
"docid": "d5d0b4aba0e427bff955b8198b84235a",
"score": "0.4701484",
"text": "function castStats(movieData, item) {\n getGenderCount(movieData, movieData[item]['cast'], 'cast', item);\n getGenderCount(movieData, movieData[item]['crew'], 'crew', item);\n getGenderCount(movieData, movieData[item]['cast_crew'], 'overall', item);\n} // END: castStats",
"title": ""
},
{
"docid": "7e6ec11dabc77b248a1dc0769e7e24ba",
"score": "0.46968955",
"text": "function fetchPacket(packetInfo, cb) {\n Packet.find({ where: packetInfo })\n .success(function(result) {\n if (result == null) cb(msg.packetNotFound());\n else cb(msg.success(result));\n }).error(function(err) {\n cb(msg.unknownError(err)); \n });\n}",
"title": ""
},
{
"docid": "0c2d99b4387e0cf87c2c60888fcee78b",
"score": "0.4680978",
"text": "function getMovieInfo(data) {\n var thumbnail = data.poster_path == null ? \"Images/not_available_icon.jpg\" : \"http://image.tmdb.org/t/p/w500\" + data.poster_path;\n var runtime = data.runtime == null ? \"Seasons not availiable\" : data.runtime;\n var revenue = data.revenue == null ? \"Status not available\" : data.revenue;\n var revenue = revenue.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n var dollarSign = \"$\";\n var revenue = dollarSign.concat(revenue);\n var reldate = data.release_date == null ? \"ReleaseDate not availiable\" : data.release_date; \n var vote = data.vote_average == null ? \"vote Average is not available\" : data.vote_average;\n\n $(\"#thumbnail\").append(\"<img src ='\" + thumbnail + \"'></img>\");\n $(\"#reldate\").append(reldate);\n $(\"#runtime\").append(runtime);\n $(\"#revenue\").append(revenue);\n $(\"#vote\").append(vote);\n $(\"#overview\").append(data.overview);\n $(\"#name\").append(data.title); \n $(\"#tagline\").append(data.tagline);\n\n $.each(data.credits.cast, function (index, value) {\n var actor = value.name == null ? \"Not available\" : value.name;\n var createProfileImage = value.profile_path == null ? \"Images/not_available_icon.jpg\" : \"http://image.tmdb.org/t/p/w500\" + value.profile_path;\n var character = value.character == null ? \"Not available\" : value.character;\n var imageTag = \"<img src='\" + createProfileImage + \"' class='img-responsive'></img>\";\n var actorNameCharacter = \"<p><a href='actor.html?id=\" + value.id + \"'>\" + actor + \"</a> as \" + character + \"</p>\";\n $(\"#cast table\").append(\"<tr><td>\" + imageTag + \"</td><td>\" + actorNameCharacter + \"</td></tr>\");\n });\n }",
"title": ""
},
{
"docid": "9ec2d11745ec8ef5afd28d7ab19584b1",
"score": "0.46773916",
"text": "function getInfo(){\r\n var result = {};\r\n var usr = isMel()?GetCurrentUserInfo():{FullName:\"Demo Data\",LoginName:\"dData\"};\r\n var pat = isMel()?GetDemographics():{patientKey:\"1000000000000000\"};\r\n var doc = isMel()?GetChartData(GetPatientId(),true).PatientData.chart.documentList[0]:{documentTypeDetail:{description:\"Demo Description\"},documentType:\"Demo Type\",summary:\"Demo Summary\"};\r\n result.docType = doc.documentTypeDetail.description;\r\n result.docTypeID = doc.documentType;//Get the Encounter Type SELECT * FROM ENCTYPE WHERE DOCTYPEID = '1878934079517780'\r\n result.docSum = doc.summary;\r\n result.fullname = usr.FullName;\r\n result.username = usr.LoginName;\r\n result.useremail = usr.LoginName+\"@valleymedicalcenter.com\";\r\n result.pid = pat.patientKey;\r\n return result;\r\n }",
"title": ""
},
{
"docid": "41ad0ebf4e11bfc799000c4a76c411cc",
"score": "0.46762437",
"text": "function parseNewsDetail(axiosResponse) {\n const details = axiosResponse.data;\n\n const {\n id,\n time,\n title,\n } = details;\n\n const timeIso = new Date(time * 1000).toISOString();\n\n const storyDetail = {\n id, // id: id\n time: timeIso,\n title,\n };\n\n return storyDetail;\n}",
"title": ""
},
{
"docid": "73dc2ef35f3e04532df6c17ce222d5aa",
"score": "0.46628273",
"text": "function DisplayCastMovie(actor)\n{\n\tvar DivCastMovie = $(\"#cast\"); \n\tvar DivActor = '<div class=\"col-xs-6 col-sm-3\"><div class=\"item cast\" style=\"cursor:pointer\" onClick=\"SeeDetailsActor('+actor.id+',\\''+actor.name+'\\')\" ><div class=\"pos-rlt\">'+\n\t\t'<div class=\"item-overlay opacity r r-2x bg-black\"><div class=\"center text-center m-t-n\"></div></div>'+\n '<img src=\"https://image.tmdb.org/t/p/w185'+actor.profile_path+'\"alt=\"\" height=\"241px\" width=\"160px\" class=\"r r-2x img-full\"></div>'+\n '<div class=\"padder-v\"><a class=\"text-ellipsis\">'+actor.name+'</a><small class=\"text-muted clear text-ellipsis\">'+actor.character+'</small></div></div></div>'; \n\tDivCastMovie.append(DivActor); \n}",
"title": ""
},
{
"docid": "b670b1d2c911b274cd6590b68b724319",
"score": "0.4658294",
"text": "function GetEventDetailsByID(id) {\n try {\n var data = { \"ID\": id };\n var ds = {};\n ds = GetDataFromServer(\"Event/GetEvent/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n }",
"title": ""
},
{
"docid": "c2ad29dca6f60fea2cf0a4771def2cad",
"score": "0.46501404",
"text": "function getPodcast(event) {\n event.preventDefault();\n const target = this.childNodes;\n const targetUrl = target[3].id;\n\n fetch(`https://gpodder.net/api/2/data/podcast.json?url=${targetUrl}`)\n .then(function(response){\n return response.json();\n }).then(function(json){\n let results = json;\n displayPodcast(results);\n }).catch(function(error){\n res.status(500).json({error: 'Failed to get data'});\n });\n}",
"title": ""
},
{
"docid": "bbc3a31a166916a411d560cf7dfe18d1",
"score": "0.4649031",
"text": "dodeadeffect(skill, cast, target) {\n var dinfo = []\n if (cast.hpnow > -9900) {\n cast.hpnow = cast.gethpmax()\n dinfo.push(cast.name + \"受到的伤害并未至死,并且受到玄武真神[\" + skill.name + \"]神力的庇护,伤势痊愈。玄武真道,齐天寿甲!\")\n }\n return dinfo\n }",
"title": ""
},
{
"docid": "0a34ba82cca5499c5448c7140ce99253",
"score": "0.4647177",
"text": "function getFoodDetail (id) {\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${id}`)\n .then(response => response.json())\n .then(data => foodDetails(data.meals[0]))\n}",
"title": ""
},
{
"docid": "327b0ede66e33c137e921a302b9de120",
"score": "0.46438292",
"text": "function getMetaData() {\n const params = {\n ids: store.detailId\n }\n\n const metatDataQuery = formatSearchQuery(params);\n const url = baseURL + '/get-meta-data?' + metatDataQuery;\n\n fetch(url, options)\n .then(response => {\n if(!response.ok) {\n alert(\"Error\")\n throw Error(response.status + \": \" + response.message)\n }\n return response.json();\n })\n .then(responseJson => displayStreamDetails(responseJson))\n .catch(error => {\n alert(\"Something went wrong. Please try again later.\")\n })\n}",
"title": ""
},
{
"docid": "c99ea6a526e9b1f00bd69f2b2aebc239",
"score": "0.46389613",
"text": "function getDetailDatum(info, index) {\n return info.values[index];\n }",
"title": ""
},
{
"docid": "fdb07f61c068f1ca1112d865edc5a778",
"score": "0.463785",
"text": "async getDetail() {\n\n let dets = await getBookDetail(this.url_a, this.key, this.isbn, this.url_b);\n this.detail = dets[this.key + this.isbn];\n\n }",
"title": ""
},
{
"docid": "0013d9b02ef2585a98c4da11155f9393",
"score": "0.46345034",
"text": "function getDetails(event) {\n var id = event.target.id;\n $.get(\"http://omdbapi.com/?plot=full&i=\" + id, null, null, \"json\")\n .done(onDetailsResult)\n .fail(onSearchFail);\n}",
"title": ""
},
{
"docid": "5b1d636ccd92a45106d972710e506e01",
"score": "0.46073562",
"text": "function hasActedIn(cast, name){\r\n let movie = null;\r\n let i = 0;\r\n while(i<cast.length && movie==null){\r\n if(cast[i].title.toLowerCase() == name.toLowerCase()){\r\n movie=cast[i];\r\n }\r\n i = i + 1;\r\n }\r\n return movie;\r\n}",
"title": ""
},
{
"docid": "8b969422d3c2f5a453462c7b0aa16763",
"score": "0.45892555",
"text": "function getMovieImage() {\n console.log(movie)\n var getMovieID = \"https://api.themoviedb.org/3/search/movie?api_key=20748fb6c1ff9fc0bd764838374d9f26&language=en-US&query=\" + movie + \"&page=1&include_adult=false\"\n\n $.ajax({\n \"async\": true,\n \"crossDomain\": true,\n url: getMovieID,\n method: \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n })\n .then(function (resp) {\n console.log(\"getmovieimage\")\n console.log(resp)\n movieID = resp.results[0].id\n getCast();\n console.log(movieID)\n\n })\n\n\n}",
"title": ""
},
{
"docid": "5783fede6aae3a243f099e887337dc83",
"score": "0.45777732",
"text": "function getDetails(res, mysql, context, interactId, complete){\r\n var sql = \"SELECT I.detailsId, I.startTime, I.details, C.type FROM interactionDetails AS I LEFT JOIN communicationModes AS C ON I.comId=C.comId WHERE I.interactId=? ORDER BY I.startTime;\";\r\n var inserts = [interactId];\r\n\r\n mysql.pool.query(sql, inserts, function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n // This formats the time attribute:\r\n for (index = 0; index < results.length; index++) { \r\n let time = results[index].startTime;\r\n let hour = time.slice(0, 2);\r\n let minutes = time.slice(3, 5)\r\n let halfOfDay = (hour <= \"12\") ? \"AM\" : \"PM\";\r\n if (halfOfDay == \"PM\") {\r\n hour = hour - 12;\r\n }\r\n hour = hour * 1; // Coerce to a number to get rid of leading zero.\r\n results[index].startTime = hour + \":\" + minutes + \" \" + halfOfDay;\r\n }\r\n context.noResults = (results.length == 0) ? true : false;\r\n context.details = results;\r\n complete();\r\n });\r\n }",
"title": ""
},
{
"docid": "434b4e1516bc23d8743b36c2414b822c",
"score": "0.45769012",
"text": "function retrievePodcastData(rss) {\r\n\tcreatePodcast(getChannelData(rss));\r\n }",
"title": ""
},
{
"docid": "f6c078a39a48801a01fe999ad18d7965",
"score": "0.456905",
"text": "function getDetailObjFromDB(){\n webdb.getDetail(function(tx,rs){\n if (rs.rows.length) {\n console.log('DETAILS OBJECT >>>', JSON.parse(rs.rows.item(0).shift_detail));\n //selectedDetails.ids = JSON.parse(rs.rows.item(0).shift_detail).ids;\n shiftDetails.ids = JSON.parse(rs.rows.item(0).shift_detail).ids;\n shiftDetails.names = JSON.parse(rs.rows.item(0).shift_detail).names;\n shiftDetails.names.date = \"\";\n $rootScope.$broadcast('WEB_DATA_UPDATED');\n //console.log(\">>>>>>>>\", selectedDetails.ids);\n }\n });\n }",
"title": ""
},
{
"docid": "39c566c8f02c54b0cdef2ebc3dc4f63b",
"score": "0.456084",
"text": "function getMovieDetails(cb, movieId) {\n\tlet url = `${API_URL}movie/${movieId}?api_key=${API_KEY}&language=en-US`\n\tfetch(url, {\n\t\tmethod: 'GET'\n\t}).then(response => response.json()).then(data => {\n\t\tcb(data);\n\t}).catch(err => {\n\t\tconsole.log('error while fetching details', err);\n\t})\n}",
"title": ""
},
{
"docid": "6a385a916402f00d509b03cbffb0ed75",
"score": "0.4556784",
"text": "function previousValidCast(currentCast) {\n if (currentCast == \"source\") {\n return [\"action\"];\n } else if (currentCast == \"mana\") {\n return [\"source\", \"action\"];\n } else if (currentCast == \"action\") {\n return [\"mana\"];\n } else {\n return [];\n }\n }",
"title": ""
},
{
"docid": "634da7baad539cbd8cf942a4b07ff347",
"score": "0.45422417",
"text": "function getMovieInfo(title){\n return fetch(`${MOVIEINFO}&t=${title}`)\n .then(res => res.json())\n .then(data2 => {\n return data2\n })\n .catch(console.error);\n }",
"title": ""
},
{
"docid": "400260cf9b8481e86dbe5aa4efb6addc",
"score": "0.4541922",
"text": "function get_details(id){\n console.log(\"You clicked Game ID: \" + id);\n fetch_by_id(id);\n}",
"title": ""
},
{
"docid": "a0dde5e56ce980128163027f013db240",
"score": "0.4532953",
"text": "static fromMysql(result) { \n const [rows, fields] = result;\n const rowsCast = rows.map(row => {\n fields.forEach(field => { // note 0x01 = TINYINT, 0x10 = BIT; how best to access mysql.Types from here?\n const boolean = (field.columnType == 0x01 || field.columnType == 0x10) && field.columnLength == 1;\n if (boolean) row[field.name] = row[field.name] === null ? null : row[field.name] == 1;\n });\n return row; \n });\n\n let temp = [rowsCast];\n let a = temp[0];\n // let ret = [];\n // console.log(temp[0]['TextRow']);\n\n // for (let rowName in temp) {\n // console.log(rowName);\n // }\n\n // return temp[0];\n return a;\n }",
"title": ""
},
{
"docid": "3e7fb7c8edb7ccfabe5379084a4ba718",
"score": "0.4528384",
"text": "function turbulenzFlashBridgeGetData()\n{\n return Turbulenz.Data;\n}",
"title": ""
},
{
"docid": "5aca8a94769281308290bb4726876447",
"score": "0.44996452",
"text": "function getDetailsBasedOnCategory(category){\t\n\tvar res = \"\";\n\t$.when(getJson()).done(function(data){\n\t\tfindMatchingCategory(data.url_group[OUR_ADVENTURES], category);\n\t});\n}",
"title": ""
},
{
"docid": "cf981599c36f4fb486c179b7b1c188ca",
"score": "0.44932923",
"text": "function getMovieDetail(movie) {\n\n\t\t\tMovieSrv.getMovieDetail(movie)\n\t\t\t.then(function (data) {\n\t\t\t\t_this.movieDetail = data.data;\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\tconsole.log(\"Request Error in getMovieDetail\"+ error);\n\t\t\t});\n\t\t}",
"title": ""
},
{
"docid": "6c2c8c44d5e3ab65fe4ccce27967cc99",
"score": "0.44923338",
"text": "static async fetchActors(movie) {\r\n const url = APIService._constructUrl(`movie/${movie.id}/credits`);\r\n const response = await fetch(url);\r\n const data = await response.json();\r\n return data.cast.map((x) => new Credit(x));\r\n }",
"title": ""
},
{
"docid": "46ae4e9916df4e2f24a333be553793a0",
"score": "0.4474634",
"text": "function getMovieCast() {\n let movieId = window.location.href.replace(\n \"http://localhost:3000/movies/\",\n \"\"\n ); // Find the movie_id at href\n\n $.getJSON(`/api/castApi/${movieId}`, \n function (data) {\n // Showing the five first actor names\n let movieCast = data.cast\n let movieCastName = []\n movieCast.forEach(movieCast5 => {\n movieCastName.push(movieCast5.name)\n })\n const movieCastName1= movieCastName.slice(0,5)\n const movieCastName2 = movieCastName1.join(\", \")\n $(\"#movieCast\").append(movieCastName2) ;\n\n // Trying to get the director name here. Not working yet!\n // if (data.crew.length > 0) {\n // let director = \"\"\n // // data.crew.job.forEach((Director) => {\n // // director.push(data.crew.name)\n // // })\n \n // // for (let i=0; i<data.crew.length; i++) {\n // // if data.crew[i].job == \"Director\" {\n // // director.push(data.crew[i].name)\n // // }\n // // }\n\n // console.log (director)\n // $(\"#director\").append(director) ;\n\n }\n )\n}",
"title": ""
},
{
"docid": "4637285d32981b34dae6bb458d538570",
"score": "0.4467022",
"text": "function callGetDetailData(loc, res) {\n getNeighborhood(loc, res, getDetailData);\n}",
"title": ""
},
{
"docid": "b561105815cd9c0625b244eecbbebad3",
"score": "0.44611084",
"text": "function get_card(obj) {\n if (obj.mode == 'normal') {\n return new EventCard(obj);\n }\n else if (obj.mode == 'repost') {\n return new RepostCard(obj);\n }\n else { alert(\"Wrong Object received: \" + obj.mode) }\n\n}",
"title": ""
},
{
"docid": "a6caac14047228ec460c1e417d2b6bde",
"score": "0.4455949",
"text": "async sortDetails(detailsObj) {\n const type = this.props.match.params.type;\n\n if (type === 'person') {\n const movies = await this.getDetailResults(detailsObj.films);\n\n return {\n name: detailsObj.name,\n birthYear: detailsObj.birth_year,\n gender: detailsObj.gender,\n eyeColor: detailsObj.eye_color,\n hairColor: detailsObj.hair_color,\n height: detailsObj.height,\n mass: detailsObj.mass,\n movies: movies\n }\n } else if (type === 'movie') {\n const characters = await this.getDetailResults(detailsObj.characters);\n\n return {\n title: detailsObj.title,\n openingCrawl: this.formatCrawlString(detailsObj.opening_crawl),\n characters: characters\n } \n }\n }",
"title": ""
},
{
"docid": "02910c6595806853f727b6385211d03e",
"score": "0.4453009",
"text": "getAlternate() {\n console.log(this.state.selectedTitle);\n const myUrlWithParams = `http://localhost:8081/movie/alt/${this.state.selectedName}`;\n console.log(myUrlWithParams);\n fetch(myUrlWithParams,\n {method: 'GET'\n }).then(res => {\n return res.json();\n }, err => {\n console.log(err);\n }).then(charList => {\n if (!charList) return;\n\n const cha = charList.map((comicObj, i) => (\n <Altrow // alternative cast rows consists of cast name and alignment\n name={comicObj.name}\n Alignment={comicObj.alignment}\n />\n\n ));\n this.setState({\n alt: cha\n })\n ;\n })\n }",
"title": ""
},
{
"docid": "3444ab19403c06a018804a352b65ba7f",
"score": "0.44486207",
"text": "static getSpellcastingStats(text) {\n const spellcastingLevel = text.match(/(?<level>[\\dlO]+)\\w{1,2}[ -]level[ -]spell ?caster/);\n const spellcastingModifier = text.match(/(spell ?casting ability is|spellcaster (that|who) uses) (?<mod>\\w+)/);\n return {\n level: spellcastingLevel ? Number(spellcastingLevel.groups.level.replace('l', '1').replace('O', '0')) : 0,\n modifier: spellcastingModifier.groups.mod\n };\n }",
"title": ""
},
{
"docid": "047e96c60911a40ecfb53ce8bc6c6be0",
"score": "0.44404295",
"text": "function getDriverInfo(driverId,calfn){\n\tconnection.query('select * from driver where driver_id=?',[driverId], function(err, docs) {\n\t\t\tif(err){console.log('err>> '+err);calfn(null);}\n\t\t\telse{\n\t\t\t\tcalfn(docs);\n\t\t\t}\n\t\t});\n }",
"title": ""
},
{
"docid": "4a8a2bebd1fe452acb440c66b06f4feb",
"score": "0.4425213",
"text": "function send_movie_cast(sender, movie_inf_cast) {\n\n\tif (count_cast < movie_inf_cast[\"cast\"].length) {\n\t\t\n\t\tvar movie_cast = movie_inf_cast[\"cast\"][count_cast];\n\t\t\n\t\tsendGenericMessage(sender, \n \t\t \t\t\t\t\t[{ title: movie_cast[\"name\"], \n \t\t\t\t\t\t\t image_url: \"https://image.tmdb.org/t/p/w500\" + movie_cast[\"profile_path\"], \n \t\t\t\t\t\t\t subtitle: \"personagem: \" + movie_cast[\"character\"],\n \t\t\t\t\t\t\t buttons: [{\n \t\t\ttype: \"postback\",\n \ttitle: \"próximo\",\n \tpayload: \"next\" \t\t\t \t\t\t\n \t }]\n\t\t\t\t\t\t\t}]\n\t\t);\n } \t\t\t\n\n}",
"title": ""
},
{
"docid": "145bc8ec6c50f99f0119509f4ffa1331",
"score": "0.44241863",
"text": "function _getEventDetail() {\n eventDetailsLoad.start();\n getEventDetail().then(function () {\n eventDetailsLoad.stop();\n }, function () {\n eventDetailsLoad.stop();\n });\n }",
"title": ""
},
{
"docid": "2ebd6325c3d910eb6d470a3dad5547bd",
"score": "0.4420606",
"text": "function isActor(cast, name){\r\n let actor = null;\r\n let i = 0;\r\n while(i<cast.length && actor==null){\r\n if(cast[i].name.toLowerCase() == name.toLowerCase()){\r\n actor=cast[i];\r\n }\r\n i = i + 1;\r\n }\r\n return actor;\r\n}",
"title": ""
},
{
"docid": "18ad1522fd9df55df35b2e75db2f8364",
"score": "0.44199273",
"text": "getEpisodeData(podcast) {\n rp(podcast)\n .then((response) => {\n parseString(response, (err, result) => {\n let data = result.rss.channel[0];\n this.setState({\n episodeData: {\n podcast: data.title[0],\n link: data.link[0],\n ep1: data.item[0],\n ep2: data.item[1],\n ep3: data.item[3]\n }\n });\n });\n })\n .catch((error) => {\n console.log(error);\n });\n }",
"title": ""
},
{
"docid": "3e83736dd7b9a69a1d002a11ebad9956",
"score": "0.4412967",
"text": "function fetchForeCastInfo(city) {\r\n \t\tvar address =\r\n\t\t\t// \"https://jsonp.nodejitsu.com/?url=\" + \r\n\t\t\t\"http://api.wunderground.com/api/e0d2b72c995eb908/forecast10day/q/\" + \t// Optional cors proxy\r\n\t\t\tparams.zip_code + \".json\";\r\n\r\n \t\treturn $.ajax({\r\n\t\t url : address,\r\n\t\t dataType : \"jsonp\"\r\n\t\t});\r\n \t}",
"title": ""
},
{
"docid": "1e74a014c4538a9dcaaaa21ebbd88824",
"score": "0.44118014",
"text": "getReading(){\n console.log('getReading (one) for dev:', this.state.selectedDevice, ' sens: ', this.state.selectedSensor);\n let from_date = (this.state.selectedFromDate).toISOString().slice(0,10);\n let to_date = (this.state.selectedToDate).toISOString().slice(0,10);\n\n let url = \"https://api.smartcitizen.me/v0/devices/\" + this.state.selectedDevice +\n \"/readings?sensor_id=\" + this.state.selectedSensor + \"&rollup=4h&from=\" + from_date +\n \"&to=\" + to_date;\n return fetch(url)\n .then((response) => response.json())\n .then((responseJson) => {\n this.setState({\n theReading: responseJson.readings\n })\n }).catch(err => {\n console.log(err)\n })\n\n }",
"title": ""
},
{
"docid": "2dc1ca914ee9cfdf33e361942e47c813",
"score": "0.4410274",
"text": "Type() {\n return ActionCode.CodeBallotCast;\n }",
"title": ""
},
{
"docid": "b678a950ade04ec0faaadb47474020e7",
"score": "0.4405368",
"text": "async function findPodcastByNAME(name)\n{\n let result = await Podcast.find({name: name})\n .select(\"name status\")\n console.log('podcast found:',result);\n\n}",
"title": ""
},
{
"docid": "ef16aeed2f69132a1e7f54ce5067bdcc",
"score": "0.44033653",
"text": "function read_artikel()\r\n{\r\n/* Erstes Auto aus der Kategorie Present wird abgefragt*/\r\n\r\nalert(present.fzglist[0].p_name);\r\n\r\n}",
"title": ""
},
{
"docid": "2396c60fd861bee282a1269dcb8e0d3c",
"score": "0.43994015",
"text": "enterCastExpression(ctx) {\n\t}",
"title": ""
},
{
"docid": "2c25181a952af7ba26cc1872dd02e77f",
"score": "0.4398894",
"text": "static async getAllInfo(){\n const info = await fetchData();\n return info.results.map((charInfo) => {\n return {\n id: charInfo.id,\n name: charInfo.name,\n status: charInfo.status,\n species: charInfo.species\n };\n });\n }",
"title": ""
},
{
"docid": "5e21f736c7270caf0183998e1ce831f6",
"score": "0.43974435",
"text": "_getTelemetryInfo() {\n // Filter out \"history\" type for being the default\n if (this.props.link.type !== \"history\") {\n return {\n value: {\n card_type: this.props.link.type\n }\n };\n }\n\n return null;\n }",
"title": ""
},
{
"docid": "88446750d7185dc235f16fda0994b25d",
"score": "0.43934935",
"text": "function actors(cast, id) {\n // creo due variabili che mi servono nel ciclo for\n var thisfilm;\n var nameactor;\n // console.log('film ' + id);\n\n // creo variabile con valore 5 perchè mi servono massimo 5 attori\n var num = 5;\n\n // imposto la condizione di partenza del ciclo; parte solo se la lunghezza del cast è minore alla variabile scritta prima\n if (cast.length < num) {\n num = cast.length\n }\n // imposto la condizione che se il cast è vuoto, appendo in pagina la scritta \"non disponibile\"\n if (num == 0) {\n $('.cast[data-id='+id+']').append('non disponibile');\n }\n\n for (var i = 0; i < num; i++) {\n\n thisfilm = cast[i];\n nameactor = thisfilm.name;\n // console.log(nameactor);\n // appendo ogni volta i nomi degli attori, li associo grazie all'id\n $('.cast[data-id='+id+']').children('span').append(nameactor + ', ')\n }\n\n }",
"title": ""
},
{
"docid": "8d2cd6904ffe3b42e679df424ce6a8d2",
"score": "0.43845055",
"text": "getCardInfo(reader) {\r\n return this.channel.send(new Request(new Command(Method.GetCardInfo, Base64Url.fromJSON({ Reader: reader }))))\r\n .then(response => {\r\n const cardInfo = JSON.parse(Utf8.fromBase64Url(response.Data || \"null\"));\r\n return cardInfo;\r\n });\r\n }",
"title": ""
},
{
"docid": "dc00f248e7ff9a8572e9e9bef05db1f7",
"score": "0.43749267",
"text": "function getInfo(symbol){\n return new Promise((resolve, reject) => {\n \n const URL = ' https://www.alphavantage.co/query?function=OVERVIEW&symbol=' + symbol + '&apikey=' + stockey;\n fetch(URL)\n .then(res => res.json())\n .then((res) => {\n\n resolve(res)\n\n }).catch((err) => reject(err));\n\n });\n}",
"title": ""
},
{
"docid": "c22579d66b66d60911bb594d44fca32d",
"score": "0.4367241",
"text": "function getForeCastDesc(forecast) {\n var desc = \"\";\n switch (forecast) {\n case \"BR\": desc=\"Mist\"; BR++; break;\n case \"CL\": desc=\"Cloudy\"; CL++; break;\n case \"DR\": desc=\"Drizzle\"; DR++; break;\n case \"FA\": desc=\"Fair (Day)\"; FA++; break;\n case \"FG\": desc=\"Fog\"; FG++; break;\n case \"FN\": desc=\"Fair (Night)\"; FN++; break;\n case \"FW\": desc=\"Fair & Warm\"; FW++; break;\n case \"HG\": desc=\"Heavy Thundery Showers with Gusty Winds\"; HG++; break;\n case \"HR\": desc=\"Heavy Rain\"; HR++; break;\n case \"HS\": desc=\"Heavy Showers\"; HS++; break;\n case \"HT\": desc=\"Heavy Thundery Showers\"; HT++; break;\n case \"HZ\": desc=\"Hazy\"; HZ++; break;\n case \"LH\": desc=\"Slightly Hazy\"; LH++; break;\n case \"LR\": desc=\"Light Rain\"; LR++; break;\n case \"LS\": desc=\"Light Showers\"; LS++; break;\n case \"OC\": desc=\"Overcast\"; OC++; break;\n case \"PC\": desc=\"Partly Cloudy (Day)\"; PC++; break;\n case \"PN\": desc=\"Partly Cloudy (Night)\"; PN++; break;\n case \"PS\": desc=\"Passing Showers\"; PS++; break;\n case \"RA\": desc=\"Moderate Rain\"; RA++; break;\n case \"SH\": desc=\"Showers\"; SH++; break;\n case \"SK\": desc=\"Strong Winds, Showers\"; SK++; break;\n case \"SN\": desc=\"Snow\"; SN++; break;\n case \"SR\": desc=\"Strong Winds, Rain\"; SR++; break;\n case \"SS\": desc=\"Snow Showers\"; SS++; break;\n case \"SU\": desc=\"Sunny\"; SU++; break;\n case \"SW\": desc=\"Strong Winds\"; SW++; break;\n case \"TL\": desc=\"Thundery Showers\"; TL++; break;\n case \"WC\": desc=\"Windy, Cloudy\"; WC++; break;\n case \"WD\": desc=\"Windy\"; WD++; break;\n case \"WF\": desc=\"Windy, Fair\"; WF++; break;\n case \"WR\": desc=\"Windy, Rain\"; WR++; break;\n case \"WS\": desc=\"Windy, Showers\"; WS++; break;\n default: desc=\"Unknown\"; icon = \"img/SU.png\"; SU++; \n }\n return desc;\n}",
"title": ""
},
{
"docid": "dade55c3e32f07c69ab1ddfdc746ae8a",
"score": "0.43651676",
"text": "function getInfoFromUID(uid) {\n var err = 0;\n var side = \"\";\n var year = \"\";\n var day = \"\";\n var line = \"\";\n var reference = \"\";\n var cavity = \"\";\n var pouring = \"\";\n if ((uid.length == 13) && ((uid.charAt(0) == \"L\") || (uid.charAt(0) == \"R\"))) {\n err = 0;\n side = uid.substring(0, 1);\n year = uid.substring(1, 3);\n day = uid.substring(3, 6);\n line = (uid.substring(6, 7));\n reference = (uid.substring(7, 8));\n cavity = uid.substring(8, 10);\n pouring = uid.substring(10, 13);\n } else if ((uid.length == 12)) {\n err = 0;\n side = \"\";\n year = uid.substring(0, 2);\n day = uid.substring(2, 5);\n line = (uid.substring(5, 6));\n reference = (uid.substring(6, 7));\n cavity = uid.substring(7, 9);\n pouring = uid.substring(9, 12);\n } else {\n err = -1;\n side = \"\";\n year = \"\";\n day = \"\";\n line = \"\";\n reference = \"\";\n cavity = \"\";\n pouring = \"\";\n }\n\n return {\n err: err,\n uid: uid,\n side: side,\n year: year,\n day: day,\n line: line,\n reference: reference,\n cavity: cavity,\n pouring: pouring\n }\n}",
"title": ""
},
{
"docid": "f48b3a169ec8ef67717069d45f2a9bc9",
"score": "0.43643633",
"text": "function isCasting (state) {\n return state.playing.location === 'chromecast' ||\n state.playing.location === 'airplay' ||\n state.playing.location === 'dlna'\n}",
"title": ""
},
{
"docid": "248c3a01fca5e895f54fcdd9682afa0a",
"score": "0.43613815",
"text": "get detail () {\r\n\t\treturn this._detail;\r\n\t}",
"title": ""
},
{
"docid": "9cb1c0b1e09f08593c6ed07a201082a6",
"score": "0.4350707",
"text": "getzoneDetails(id, type) {\n API.getDevice(id, type)\n .then(res => res.json()\n .then((res) => {\n console.log(res);\n this.setState({\n device: {\n deviceId: id,\n deviceType: res.Item.deviceType.S,\n frequency: res.Item.frequency.S,\n group: res.Item.group.S,\n hardware_model: res.Item.hardware_model.S,\n host_name: res.Item.host_name.S,\n memory: res.Item.memory.S,\n operating_system_name: res.Item.operating_system_name.S,\n operating_system_version: res.Item.operating_system_version.S,\n processor: res.Item.processor.S,\n region: res.Item.region.S\n },\n })\n if (res.Item.certId) {\n this.setState({\n device: {...this.state.device,\n certId: res.Item.certId.S\n }\n });\n this.getShadowStatus(this.state.device.certId);\n }\n if (res.Item.telemetry) {\n let prettyTimestamp = new Date(parseInt(res.Item.timestamp.N) * 1000).toLocaleString();\n this.setState({\n device: {...this.state.device,\n timestamp: prettyTimestamp\n },\n telemetry: res.Item.telemetry.L\n })\n this.formatData();\n }\n })\n .catch(function (err) {\n console.log(err);\n }));\n }",
"title": ""
},
{
"docid": "7a7ee50d832e0a67119a331881832716",
"score": "0.4337491",
"text": "async getConv(id1, id2){\n let request = \"getConvFromId/\" + id1 + \"/\" + id2;\n this.convList = await Comm.get(request);\n return this.convList.response.return;\n }",
"title": ""
},
{
"docid": "7e8d15a9d1981df94525e071e2237957",
"score": "0.43303788",
"text": "function showByType(req, res){\n db.Disaster.find({type: req.params.type}, function(err, disasters){\n if (err) { console.log(\"get disaster by type error\"); }\n res.json(disasters);\n });\n}",
"title": ""
},
{
"docid": "1435353fb96b7581a45872e3a99aa5c0",
"score": "0.43298605",
"text": "function getInfo(obj){\n\t\t\tobj = this.object;\n\t\t\tconsole.log(\"From get info\", obj.constructor);\n\t\t}",
"title": ""
},
{
"docid": "babf9fb7dcd1c6b4b029abb89e680eca",
"score": "0.43252343",
"text": "function getMusicTrends(country){\n //fetch data using api url -> use country code we got from the open weather app api as a param-> other params (type and format) -> get method -> header parameters taken from rapid api (api key and host name). Then return response as json object. \n fetch(music_api.mURL + country + music_api.mURLparam, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": music_api.mKey,\n \"x-rapidapi-host\": \"theaudiodb.p.rapidapi.com\"\n }\n }).then(response => {\n return response.json();\n }).then(displayTrends);\n}",
"title": ""
},
{
"docid": "8baef8ff087614d3a83e5e655d10e111",
"score": "0.43252084",
"text": "static NetworkCollect()\n {\n\n /** Data structure\n * uid: {\n * feild_0: value,\n * feild_1: {\n * subFeild_1: value,\n * subFeild_0: value\n * }\n * }\n */\n\n var data = {};\n\n Object.keys( ComponentManager.networkComponents.collect ).forEach( element => {\n data[ element ] = ComponentManager.networkComponents.collect[ element ]();\n });\n\n if ( Object.keys( data ).length == 0 )\n return null;\n \n //console.log( \"Collected:\", packet );\n\n return data; // return the payload\n\n }",
"title": ""
}
] |
81b5d315e77acf53c6f1d9c8ac3d9594 | If correct answer is chosen.. | [
{
"docid": "1f78ba8a11a77ff4ae63bd9539b9ec7a",
"score": "0.0",
"text": "function correctAns(){\n \n document.querySelector(\"hr\").style.display = \"flex\";\n var newP = document.createElement(\"p\");\n var correct = document.createTextNode(\"Correct!\");\n newP.appendChild(correct);\n quiz.appendChild(newP);\n // Can't figure out how to remove an appended p tag that was added dynamically with vanillas javascript\n // if(runningQuestion){\n // newP.parentElement.removeElement(choices[5]);\n // }\n}",
"title": ""
}
] | [
{
"docid": "51d792b40f8e78b5225e66420ffcae04",
"score": "0.7887142",
"text": "function isCorrect(choice, answer) {\n\n if ((parseInt(choice)) === answer) {\n\n score++;\n\n displayCorrect();\n\n\n } else {\n wrong++;\n displayWrong();\n }\n\n\n }",
"title": ""
},
{
"docid": "4f4a51081f0cadad4c04c6a7315dbb22",
"score": "0.7679456",
"text": "function evaluateAnswer() {\n \tvar userGuess = $('input[type=\"radio\"][value=\"questions[currentQuestions].correct\"]').prop(\"checked\", true);\n \t//var userGuess = $('input[type=\"radio\"]:\"checked\"').val();\n \tif ( questions[currentQuestion].correct === userGuess) {\n \t\t//correctGuesses += 1;\n \t\tcorrectGuesses++;\n \t}\n }",
"title": ""
},
{
"docid": "3e59b45546312bda94120355db5aafb1",
"score": "0.7607938",
"text": "function checkAnswer() {\n var temp = $(\"#userAnswer\").val();\n var temp2 = $(\"#remainder\").val();\n if(questionGenerator.getAnswer()==0) {\n \tif(temp === \" \")\n \t\treturn false; // the user has to enter 0 for a zero answer\n }\n if(typeControl.getIsHard()||typeControl.getIsCrazy()) {\n if(typeControl.getOperation()==4)// check for remainders in the more difficult divisions\n return parseInt(temp) == questionGenerator.getAnswer() && parseInt(temp2) == questionGenerator.getRemainder();\n }\n return temp == questionGenerator.getAnswer();\n}// end checkAnswer",
"title": ""
},
{
"docid": "159d50e0460c75cc643f9ddb32c64834",
"score": "0.75694793",
"text": "isCorrect() {\n let correct = false;\n const selected = this.state.selected;\n const correctAnswer = this.props.question.answer;\n if (selected != null && this.answers[selected] === correctAnswer) {\n correct = true;\n }\n return correct;\n }",
"title": ""
},
{
"docid": "d732a0c8a83257f4d689c26a902a4bfc",
"score": "0.74268377",
"text": "function evaluateChoice(){\n TriviaGame.stopCountdown();\n showResult(TriviaGame.checkAnswer($(this).val()));\n setupNextRound();\n}",
"title": ""
},
{
"docid": "fdd645c4a05cd3e554daf8764a9e3235",
"score": "0.7311417",
"text": "function checkAnswer(answer) {\n correct = questions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex) {\n score++;\n // alert(\"Correct!\");\n displayQuestionResult(\"correct\");\n currentQuestionIndex++;\n generateQuestions();\n }\n else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex) {\n // alert(\"Wrong!\");\n displayQuestionResult(\"wrong\");\n timeLeft = timeLeft - 10;\n currentQuestionIndex++;\n generateQuestions();\n }\n else {\n displayScore();\n }\n}",
"title": ""
},
{
"docid": "1f2d81ccd95dbcd33a3251a1483d1858",
"score": "0.73104405",
"text": "function checkAnswer() {\r\n\t\tif (this.value == correctAnswer) {\r\n\t\t\tnumberCorrect++;\r\n\t\t}\r\n\t\tloadQuestion();\r\n\t}",
"title": ""
},
{
"docid": "f6bef6f3fe0c3a3ede996a225956b5ba",
"score": "0.73002446",
"text": "function checkAnswer(){\n if(answerObject.value === ans.toString()){\n generateQuestion();\n answerObject.value = \"\"; \n score++;\n updateScoreText();\n }\n}",
"title": ""
},
{
"docid": "4cbff9aaaa9c533662b35563af3fb506",
"score": "0.72932273",
"text": "function checkAnswer(answer) {\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex) {\n score++;\n alert(\"That Is Correct!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is correct.\n } else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex) {\n alert(\"That Is Incorrect.\")\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is wrong.\n } else {\n showScore();\n }\n}",
"title": ""
},
{
"docid": "c3d8022506309aaca44476624b0d57ae",
"score": "0.7279601",
"text": "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex){\n score++;\n alert(\"That Is Correct!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is correct.\n }else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n alert(\"That Is Incorrect.\")\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is wrong.\n }else{\n showScore();\n }\n}",
"title": ""
},
{
"docid": "d2c5fce0faf4d25027fdf72859ac726c",
"score": "0.7273138",
"text": "checkAnswer(){\r\n\r\n\t\t// we check the answer only if it's not game over yet\r\n\t\tif(!this.scene.isGameOver){\r\n\r\n\t\t\t// button frame is equal to randomSum means the answer is correct\r\n\t\t\tif(this.frame.name == this.scene.randomSum){\r\n\r\n\t\t\t\t// score is increased according to the time spent to answer\r\n \t\t\tthis.scene.score += Math.floor((this.scene.buttonMask.x + 350) / 4);\r\n\r\n // one more correct answer\r\n this.scene.correctAnswers++;\r\n\r\n // moving on to next question\r\n this.scene.correct(this.frame.name + 1);\r\n \t\t}\r\n\r\n\t\t\t// wrong answer\r\n \t\telse{\r\n\r\n\t\t\t\t// if it's not the first question...\r\n \t\t\tif(this.scene.correctAnswers > 1) {\r\n\r\n\t\t\t\t\t// stop the tween\r\n\t\t\t\t\tthis.scene.timeTween.stop();\r\n \t\t\t}\r\n\r\n\t\t\t\t// calling \"gameOver\" method. \"this.frame.name + 1\" is the string to display\r\n \t\t\tthis.scene.gameOver(this.frame.name + 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"title": ""
},
{
"docid": "c8166338946a9434bceb6e5a86b1b016",
"score": "0.7272295",
"text": "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex){\n score++;\n alert(\"That Is Correct!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is correct.\n }else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n alert(\"That Is Incorrect.\")\n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is wrong.\n }else{\n showScore();\n }\n}",
"title": ""
},
{
"docid": "dfb7a438de796c974d9ebb1bf0c87ec0",
"score": "0.7267423",
"text": "function checkAnswer(question,optionA,optionB,optionC,answer)\n{\n console.log(\"\\nselect ONE OPTION from A,B,C \");\n console.log(question+\"\\nA: \"+optionA+\"\\nB: \"+optionB+\"\\nC: \"+optionC);\n \n \n var userAnswer=readlineSync.question(\"Your answer: \");\n if(userAnswer.toUpperCase()==answer.toUpperCase()) \n {\n console.log(\"\\nKudos to you!! \");\n countScore++;\n console.log(\"Current score: \"+countScore);\n }\n else\n console.log(\"\\nBetter luck next time..\");\n\nconsole.log(\"---------------------\");\n\n}",
"title": ""
},
{
"docid": "e095ded85cc52815d35e48bff74bf1bb",
"score": "0.7235703",
"text": "function check_answer(selected_answer){\n\n let correct = current_question[\"answer\"] === selected_answer\n return correct;\n}",
"title": ""
},
{
"docid": "69cc53efd46dc41b224c5aa9bfa6e51d",
"score": "0.7225113",
"text": "function rightWrongDecide(){\n\n if(this.innerHTML === answer[count]){\n $(\"#questionSpace\").html(\"Correct\");\n correct++;\n displayAnswer();\n }else{\n $(\"#questionSpace\").html(\"Incorrect\");\n wrong++;\n displayAnswer();\n };\n\n }",
"title": ""
},
{
"docid": "bff596d36a706578d8c129e89823f240",
"score": "0.7205255",
"text": "function ifAnswerIsCorrect () {\n correctFeedback();\n updateScore();\n \n}",
"title": ""
},
{
"docid": "db4791c34a8eb322cf5f1e7e03602321",
"score": "0.7205064",
"text": "function checkAnswer(answer) {\n var correct = quizQuestions[currentQuestionIndex].correctAnswer;\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex) {\n score++;\n alert(\"the answer is correct\");\n currentQuestionIndex++;\n renderQuestion();\n } else if (\n answer !== correct &&\n currentQuestionIndex !== finalQuestionIndex\n ) {\n alert(\"the answer is incorrect\");\n currentQuestionIndex++;\n timeLeft = timeLeft - 20;\n renderQuestion();\n } else {\n showScore();\n }\n}",
"title": ""
},
{
"docid": "1460a90dc97b05c12b217ccb3f84dff3",
"score": "0.71966845",
"text": "function trueOrnot(){\n var trueAnswer;\n var value = $(this).attr(\"data-answer\");\n console.log(\"selected answer: \"+ value);\n \n if(choice == 0 ){\n trueAnswer = playerList[key];\n }\n if(choice == 1 ){\n trueAnswer = teamList[key];\n }\n if(choice == 2){\n trueAnswer = positionList[key];\n }\n \n //if answer is correct then score +=1, and go to the result page\n if(value==trueAnswer){\n Wscore += 1;\n console.log(\"YES\")\n changePage(2);\n }else{\n console.log(\"NO\")\n changePage(1);\n }\n\n stopwatch.stop();\n\n }",
"title": ""
},
{
"docid": "0ea6a58f55537fb16fcbbaab49d7d200",
"score": "0.7190693",
"text": "function checkAnswer(){\n const userAnswer = $('input[name=\"answer-option\"]:checked').val();\n let qNum = getQuestionNumber();\n const correctAnswer = STORE.questions[qNum].answer;\n\n if(userAnswer === correctAnswer){\n console.log(\"condition met\");\n return true;\n }\n\n return false;\n}",
"title": ""
},
{
"docid": "b1e238eb318313b285b3a6ae7cd1c5a9",
"score": "0.71803",
"text": "function checkInput() {\n if (selectedAnswer == \"\") {\n\n }\n else if (selectedAnswer == $(\"<div>\").html(correctAnswer).text())\n {\n console.log(\"Selected: \" + selectedAnswer.replace(/[^a-z0-9\\s]/gi, ''));\n console.log(\"Correct: \" + correctAnswer.replace(/[^a-z0-9\\s]/gi, ''));\n correct ++;\n correctAnswerArea.append(\"<p>Q: \" + trivia.results[triviaQuestionCount].question + \"<br/>A: \" + trivia.results[triviaQuestionCount].correct_answer);\n correctCount.text(correct);\n nextQuestion.show();\n triviaQuestionCount++;\n showCorrectPic();\n clearInterval(interval);\n\n } \n else if (selectedAnswer != $(\"<div>\").html(correctAnswer).text()) \n {\n console.log(\"Selected: \" + selectedAnswer.replace(/[^a-z0-9\\s]/gi, ''));\n console.log(\"Correct: \" + correctAnswer.replace(/[^a-z0-9\\s]/gi, ''));\n wrong++;\n wrongAnswerArea.append(\"<p>Q: \" + trivia.results[triviaQuestionCount].question + \"<br/>A: \" + trivia.results[triviaQuestionCount].correct_answer);\n wrongCount.text(wrong);\n nextQuestion.show();\n triviaQuestionCount++;\n showWrongPic();\n clearInterval(interval);\n }\n }",
"title": ""
},
{
"docid": "4787b5283a3a78fb9ea3817293948d77",
"score": "0.71603405",
"text": "function checkAnswerNextStage (correctAnswer, userResponse, questionNum){\n\t\tif( correctAnswer === userResponse){\n\t\t\t//guessed correctly\n\n\t\t}\n\t\telse {\n\n\t\t}\n\n\n\t}",
"title": ""
},
{
"docid": "4dfcaa0e0ddb7707c62d441ad7b641bb",
"score": "0.71521145",
"text": "function choose0() {\n checkAnswer(0);\n}",
"title": ""
},
{
"docid": "987860855c695389d0ce741f2db715b0",
"score": "0.71446776",
"text": "function answerChecker() {\n if (answers === \"right\") {\n correct++;\n } else if (answers === \"wrong\") {\n wrong++;\n } else {\n notAnswered++;\n }\n}",
"title": ""
},
{
"docid": "b13b261dc2b0f0f3b40f0f27810d3bf2",
"score": "0.71322525",
"text": "function checkAnswer() {\n var userAnswer = document.getElementById('answer').value;\n isCorrectAnswer(userAnswer);\n}",
"title": ""
},
{
"docid": "c97b814ebb213d1c9faec8dd154eabab",
"score": "0.71284777",
"text": "function questionAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctChoice;\n\n if (answer === correct && currentQuestionIndex !== quizQuestions.length){\n score++;\n alert(\"That Is Correct!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n }else if (answer !== correct && currentQuestionIndex !== quizQuestions.length){\n alert(\"That Is Incorrect.\")\n timeLeft -= 5\n currentQuestionIndex++;\n generateQuizQuestion();\n }else{\n showScore();\n }\n}",
"title": ""
},
{
"docid": "8bd76b8663bb126b82c294b9c9435d10",
"score": "0.71270096",
"text": "function checkAnswer() {\n // check the inputs values against the store\n const userSelectedAnswer = $(\"form input[type='radio']:checked\").val();\n // turned user input value into an integer.\n const userAnswerInt = parseInt(userSelectedAnswer);\n // if correct call correct view \n // otherwise call incorrect view\n if (userAnswerInt === STORE.questions[STORE.questionNumber].correctAnswer) {\n STORE.score++;\n const correct = generateCorrectView();\n $(\".container\").html(correct);\n } else {\n const incorrect = generateInCorrectView();\n $(\".container\").html(incorrect);\n }\n \n STORE.questionNumber++;\n}",
"title": ""
},
{
"docid": "2ca7a2ed3cab4be9100162f75a4c9662",
"score": "0.71219665",
"text": "_checkAnswer (answer) {\n if (answer !== 0 && answer !== 1)\n return false\n\n return true\n }",
"title": ""
},
{
"docid": "40834be56b8317154ad2689a2c6c1544",
"score": "0.7119919",
"text": "function checkResult(playerChoice) {\n resetSelected();\n computerRandomChoice();\n displayComputerChoice();\n updateScore(playerChoice);\n}",
"title": ""
},
{
"docid": "d98108936f6c3ca8de900de1cbc1eb3b",
"score": "0.71061313",
"text": "function check()\n{\n var radios = document.getElementsByName('option');\n var value;\n var corAns = allQuestions[counter-1].choices[allQuestions[counter-1].correctAnswer];\n for (var i = 0; i < radios.length; i++) {\n if (radios[i].type === 'radio' && radios[i].checked) {\n // get value, set checked flag or do whatever you need to\n var ans = radios[i].value;\n }\n }\n if (ans == corAns) {\n ++score;\n }\n}",
"title": ""
},
{
"docid": "9cf72ab76c33275d4429561835c0f90f",
"score": "0.7081547",
"text": "function CheckAnswer(ans) {\n var isRight;\n var ansKorChar = koreanKey.characterCode.indexOf(ans);\n if ($(\"#question-text\").text() === koreanKey.koreanCharacter[ansKorChar]) {\n isRight = 1;\n score.answered[ansKorChar] += 1;\n console.log(\"boo\")\n } else {\n isRight = 0;\n }\n // console.log(isRight);\n return(isRight)\n }",
"title": ""
},
{
"docid": "e2797a60a6266271b49d4c458693629a",
"score": "0.707602",
"text": "function CheckAnswer() {\r\n\t/*assign random integers between 2 and 9 to the number of animals there are */\r\n\t/* Gather student input about how many animals they think there are */\r\n var theAnswer = document.getElementById(\"AnswerInput\").value;\r\n\tvar AnswerHolder = \"\";\r\n\t/* Output correct or incorrect depending on student answer */\r\n\tif ( theAnswer == ((\"(x+12)(x+6)\")||(\"(x+6)(x+12)\")||(\"(x + 6)(x + 12)\")||(\" ( x + 6 ) ( x + 12 )\" ))) {\r\n\t\tAnswerHolder = \"Correct!\";\r\n\t\thideShowHolder.style.display = \"block\";\r\n\t}\r\n\telse {\r\n\t\tAnswerHolder = \"Try again\";\r\n\t}\r\n\t\tdocument.getElementById(\"DisplayAnswerMarkingOne\").innerHTML = AnswerHolder;\r\n}",
"title": ""
},
{
"docid": "c164ab94c9b33cde7385c3feea9de66c",
"score": "0.70756483",
"text": "function checkAnswer(){\n\n // Enable continue button if answer correctly\n if (Q1Ans.value() == 0.2 || Q1Ans.value().substring(0,2) == 20){\n\n // Hide submit\n Submit.hide();\n\n // Correct message\n var CorrectMsg = createP(\"Correct Answer!\");\n CorrectMsg.position(1230,358);\n CorrectMsg.style('color','blue');\n\n // Enable button\n keyprop_button.removeAttribute('disabled');\n }\n else{\n Submit.html(\"Try Again\");\n }\n }",
"title": ""
},
{
"docid": "ad71b2fafe8b053dbe6e33c1d38bdba4",
"score": "0.70559394",
"text": "function selectAnswer() {\n\t\tcorrectAnswer = answerArray[0];\n\t\tshuffle(answerArray);\n\t}",
"title": ""
},
{
"docid": "0c5508a18dd4bdbff8115e93de547cee",
"score": "0.70423543",
"text": "function evaluateAnswer(selectedAnswer) {\n //Check if an answer is picked\n if (selectedAnswer !== undefined) {\n $('html').off(\"keydown\");\n return store.questionPool[store.questionNumber].correctAnswer === selectedAnswer;\n\n }\n //Request user to pick an answer\n throw Error(\"No answer.\");\n}",
"title": ""
},
{
"docid": "d5ea850e76b41adb800aa246eba830df",
"score": "0.7040959",
"text": "function yesOrNo(question, correct) {\n var answer = prompt(question);\n if (answer === correct) {\n alert('Correct');\n score++;\n } else {\n alert('Wrong');\n }\n return answer;\n}",
"title": ""
},
{
"docid": "c37500c80a6f0fca1186ae466b715b3e",
"score": "0.7040387",
"text": "function answerChecker(correct) {\n if (correct) {\n right++\n } else {\n wrong++;\n }\n}",
"title": ""
},
{
"docid": "9a2cf27cd8b3ee5e4b512a2724cd0bbd",
"score": "0.7023327",
"text": "function ifAnswerCorrect(){\n userAnswerFeedbackCorrect();\n updateScore();\n}",
"title": ""
},
{
"docid": "ee803ac7c2c091f86c7d9ce19b0651c6",
"score": "0.7022892",
"text": "function checkAnswer() {\n choices = document.getElementsByName(\"choices\");\n for (var i = 0; i < choices.length; i++) {\n if (choices[i].checked) {\n choice = choices[i].value; \n }\n }\n if (choice == questions[pos][5]) {\n correct++; \n }\n pos++; \n renderQuestion(); \n\n }",
"title": ""
},
{
"docid": "945e7e1804be1a4c2799588f746960a1",
"score": "0.7022225",
"text": "checkAnswer (playerAnswer) {\n const questionProps = this.unsolvedQuestionsState.questionProps[this.unsolvedQuestionsState.questionNumber]\n\n switch (playerAnswer) {\n // Question unanswered\n case emptyAnswer:\n return null\n // Answer is correct\n case questionProps.correctAnswer:\n return true\n // Answer is incorrect\n default:\n return false\n }\n }",
"title": ""
},
{
"docid": "2b7b2efa4b0f2812400fec89c1efe1af",
"score": "0.7011721",
"text": "function isYesAnswer(answer){\n if (answer == 'yes' || answer == 'y') {\n return 1;\n }\n\n // if it's not correct, tell them to try again\n alert('Wrong! try again');\n return 0;\n}",
"title": ""
},
{
"docid": "dccc8482e387655ee0bf55dcf08dd43c",
"score": "0.7009646",
"text": "function checkResponse() {\n var choice = getChoice();\n if (choice < 0) {\n alert('Please make a selection!');\n } else if (choice === currentQuestion().correctAnswer) {\n alert('Correct!');\n } else {\n alert('Sorry, try again!');\n }\n return false;\n }",
"title": ""
},
{
"docid": "dccc8482e387655ee0bf55dcf08dd43c",
"score": "0.7009646",
"text": "function checkResponse() {\n var choice = getChoice();\n if (choice < 0) {\n alert('Please make a selection!');\n } else if (choice === currentQuestion().correctAnswer) {\n alert('Correct!');\n } else {\n alert('Sorry, try again!');\n }\n return false;\n }",
"title": ""
},
{
"docid": "a528f3dbd6eff575888cba5218f30a00",
"score": "0.7004887",
"text": "function checkAnswer(answer) {\n const rightAnswerPoints = 10; // POINTS FOR RIGHT ANSWER\n const wrongAnswerPoints = 5; // POINTS REMOVE FOR WRONG ANSWER\n questionNumber++;\n\n if (answer == currentAskQuestion.answer) {\n showAnswer();\n score = score + rightAnswerPoints;\n } else {\n alert('This is the wrong answer'); // TELL THE PLAYER THE ANSWER IS WRONG\n showAnswer();\n score = score - wrongAnswerPoints;\n }\n}",
"title": ""
},
{
"docid": "c4ddbd5dff75c7fd754455eaeba7de98",
"score": "0.6995654",
"text": "function checkAnswer(event) {\n response = event.target.id\n if (response == correctAns) {\n questionNumber = questionNumber + 1\n genQuestion(questionNumber)\n } else {\n clock = clock - 5\n }\n }",
"title": ""
},
{
"docid": "cf998ac6cc12822cc3fdd66ef26c4dc9",
"score": "0.69955045",
"text": "function q1() {\n let catLower = prompt(arrayOfQuestions[0][0]).toLowerCase();\n // Checking to see if user answer comes out as 'yes' or 'y'\n if (catLower === arrayOfAnswers[0][0] || catLower === arrayOfAnswers[0][1]) {\n correctQuest++; //Adds a point when answered correctly\n return alert(arrayOfReturns[0][0]);\n } else {\n return alert(arrayOfReturns[0][1]);\n }\n}",
"title": ""
},
{
"docid": "cf02b24ec1b23c0bbb938932cf6d1cb1",
"score": "0.6977944",
"text": "function checkAnswer() {\n\n // get radio button values\n let answerPicked1 = document.getElementById(answer1).value;\n let answerPicked2 = document.getElementById(answer2).value;\n let answerPicked3 = document.getElementById(answer3).value;\n let answerPicked4 = document.getElementById(answer4).value;\n\n // get radio button picked ie answer chosen\n if (answerPicked1.checked) {\n let answerChosen = answerPicked1.textContent;\n } else if (answerPicked2.checked) {\n let answerChosen = answerPicked2.textContent;\n } else if (answerPicked3.checked) {\n let answerChosen = answerPicked3.textContent;\n } else {\n let answerChosen = answerPicked4.textContent;\n }\n }",
"title": ""
},
{
"docid": "255c75dc38afcc49d0121b9f2e6a3e47",
"score": "0.6969385",
"text": "function correctAnswer() {\n // function is called when question timer has tripped...therefore bump up total incorrect answers\n totalCorrect++;\n\n // clear all answers\n // make sure previous answers are removed\n $(\"#userChoices\").text(\"\");\n\n // message the player correct and incorrect counts, as well as current question status\n $(\"#userMessage\").text(\"The answer is CORRECT. You have answered \" + totalCorrect + \" questions correctly, and \" + totalIncorrect + \" incorrectly!\");\n\n // start the question transition timer\n startQuestionTransition();\n }",
"title": ""
},
{
"docid": "1d71f71e1aac75aa7cda95f509e88a20",
"score": "0.6960496",
"text": "checkAnswer (playerAnswer) {\n const questionProps = this.friendState.questionProps[this.friendState.questionNumber]\n\n switch (playerAnswer) {\n // Question unanswered\n case emptyAnswer:\n return null\n // Answer is correct\n case questionProps.correctAnswer:\n return true\n // Answer is incorrect\n default:\n return false\n }\n }",
"title": ""
},
{
"docid": "ae0281bf456b54279d2033256f65be21",
"score": "0.69514483",
"text": "function checkResult(playerChoice) {\r\n resetSelected();\r\n computerRandomChoice();\r\n displayComputerChoice();\r\n updateScore(playerChoice);\r\n}",
"title": ""
},
{
"docid": "e22a7febf11e09242457e5c0abfac919",
"score": "0.6947574",
"text": "function checkAnswered(question){\n var anyAnswered = false;\n var answers = $('[name='+question.id+']');\n // the for loop creates a condition to check if the buttons were checked and and then sets\n // the anyAnswered variable to true if they were\n for (var i = 0; i < answers.length; i++) {\n if (answers[i].checked) {\n anyAnswered = true;\n }\n }\n // then return the anyAnswered variable so it can be tabulated in the last function to distinguish\n // between incorrect answers and those answers that were not attempted\n return anyAnswered;\n \n }",
"title": ""
},
{
"docid": "c031d7fe581290276f8b86f331a13291",
"score": "0.6943359",
"text": "check_answers(){\n //quiz continue if answer is correct. Quiz ends otherwise.\n\n let j=this.state.question.options.length;\n let k= this.state.answer;\n //alert(this.state.question.options[0].label);\n for(let i=0; i<j; i++){\n if(this.state.question.options[i].label == k && this.state.question.options[i].isCorrect)\n return true;\n }\n\n return false;\n\n }",
"title": ""
},
{
"docid": "56075902caf17712642041cd6f4ef9cb",
"score": "0.694097",
"text": "function questionOne() {\n var OwnerName = prompt('The First Question is , Is The Name Of OwnerSite Mohammed ?');\n //console.log(checkAnswer(OwnerName));\n\n if (checkAnswer(OwnerName) === 'y' || checkAnswer(OwnerName) === 'yes') {\n alert('Your Answer Is Wrong');\n } else {\n alert('Your Answer Is Right');\n score++;\n }\n}",
"title": ""
},
{
"docid": "32f7028a1ab11f5958871c8b59d2a1dc",
"score": "0.6929418",
"text": "function checkAnswer() {\n\tlet answers = document.getElementsByName(\"question\");\n\tlet selectedAnswer;\n\n\tfor (let i = 0; i < answers.length; i++) {\n\t\tif (answers[i].checked) {\n\t\t\tselectedAnswer = i;\n\t\t}\n\t}\n\n\tif (selectedAnswer == questions[currentQuestion].correctAnswer) {\n\t\talert(\"Correct!\");\n\t\tscore++;\n\t} else {\n\t\talert(\"Wrong\");\n\t\tremainingTime = remainingTime - 10;\n\t}\n\n\tshowNextQuestion();\n}",
"title": ""
},
{
"docid": "1d9c27971d9fcdd552eb1487fcaf948c",
"score": "0.69240427",
"text": "function isAnswerSelect() {\n if (questionRadio.style.display == \"block\"){\n var radios = document.getElementsByName(\"answerRadio\");\n var isChecked = false;\n var selectedAnswer = undefined;\n var correctAnswer = questionsData[(questionsNumbers[(currentQuestion-1)])].correct;\n for (var i = 0; i < radios.length; i++) {\n if (radios[i].checked) {\n isChecked = true;\n radios[i].checked = false;\n selectedAnswer = radios[i].id;\n if (selectedAnswer === correctAnswer) {\n score ++;\n }\n showNextQuestion();\n break;\n }\n }\n if (!isChecked) {\n alert (\"Es necesário elegir al menos una opción.\");\n }\n\n } else if (questionCheckbox.style.display == \"block\") {\n var checkboxs = document.getElementsByName(\"answerCheckbox\");\n var isChecked1 = false;\n var selectedAnswers = [];\n var correctAnswers = questionsData[(questionsNumbers[(currentQuestion-1)])].correct;\n var internalScore = 0;\n for (var i = 0; i < checkboxs.length; i++) {\n if (checkboxs[i].checked) {\n isChecked1 = true;\n checkboxs[i].checked = false;\n selectedAnswers.push(checkboxs[i].id);\n }\n }\n if (!isChecked1) {\n alert (\"Es necesário elegir al menos una opción.\");\n } else {\n for (var i = 0; i < correctAnswers.length; i++) {\n if (selectedAnswers[i] === correctAnswers[i]) {\n internalScore ++;\n }\n }\n if (internalScore === correctAnswers.length && correctAnswers.length === selectedAnswers.length) {\n score ++;\n }\n showNextQuestion();\n }\n\n } else if (questionDropdown.style.display == \"block\") {\n var dropdowns = document.getElementById(\"dropdownAnswer\");\n var correctDDAnswer = questionsData[(questionsNumbers[(currentQuestion-1)])].correct;\n if (dropdowns.value != \"Default\") {\n if (dropdowns.value === correctDDAnswer) {\n score ++;\n }\n dropdowns.value = \"Default\";\n showNextQuestion();\n } else {\n alert (\"Es necesário elegir al menos una opción.\");\n }\n } else {\n showNextQuestion();\n }\n}",
"title": ""
},
{
"docid": "9664fde25066cec908c952352a384e02",
"score": "0.691986",
"text": "function checkAnswer(){\n if($(\"#studentAnswer\").valid()){\n var userAnswer = document.getElementById(\"answer\").value,\n actualAnswer = val1 * val2;\n numTry += 1;\n document.getElementById(\"answer\").value = null;\n\n if (userAnswer == actualAnswer){\n document.getElementById(\"userResult\").innerHTML =\n \"Your answer, \" + userAnswer + \",was correct!\"; \n continueGame();\n \n } else {\n document.getElementById(\"userResult\").innerHTML =\n \"Your answer, \" + userAnswer + \",was incorrect!\" +\n \"<br>\" + \"Please enter another answer and submit again.\"; \n }\n } else {alert(\"Please enter valid values for input\");}\n}",
"title": ""
},
{
"docid": "243245c24de98d139da97cb7047b6e1a",
"score": "0.69180423",
"text": "function evaluateAnswer() {\n // find the id of the option of the radio button the user has selected\n var rightOptionId = $('#question-options input:radio:checked').attr('id');\n var optionIdTextId = rightOptionId + '-text';\n var attemptedAnswer = $('#' + optionIdTextId).html();\n var correctAnswer = questions[currentQuestion - 1].correctAnswer;\n\n if (correctAnswer == attemptedAnswer) {\n // correct answer\n\n // update progress value\n progress = (currentQuestion / totalNumberOfQuestions) * 100;\n var newValue = progress;\n $('#progress-bar-question').css('width', newValue + '%').attr('aria-valuenow', newValue);\n $('#progress-bar-question').html(parseInt(progress) + \"%\");\n\n loadNextQuestion();\n // for testing purpose\n return 1;\n }\n else{\n // wrong answer\n swal(\"Wrong!\", \"Try a hint?\", \"error\");\n return 0;\n }\n\n\n\n\n}",
"title": ""
},
{
"docid": "6c26991512dde0fc064c9af730c28198",
"score": "0.69148064",
"text": "function checkAnswer() {\n\t\tvar userChoice = $('input[name=\"choice\"]:checked').val();\n\t\tvar currentQuestion = questions[questionNumber];\n\t\t$(\"#questionNumber\").hide();\n\t\t$(\"#question\").hide();\n\t\t$(\"#choices\").hide();\n\t\t$(\"#submitButton\").hide();\n\t\t$(\"#choices\").empty();\n\t\tif (!(userChoice)){\n\t\t\talert(\"Select an answer\");\n\t\t\t$(\"#question\").text(currentQuestion.question);\n\t\t\tfor (i = 0; i < currentQuestion.choices.length; i++){\n\t\t\t\t$(\"#choices\").append('<input type=\"radio\" name=\"choice\" value=' + currentQuestion.choice[i] + ' class=\\'choices\\' id=' + currentQuestion.choices[i] + '><label for=' + currentQuestion.choices[i] + '>' + currentQuestion.choices[i] + '</label><br>');\n\t\t\t}\n\t\t\t$(\"#choices\").show();\n\t\t\t$(\"#submitButton\").show();\n\t\t\t$(\"#question\").show();\n\t\t\t$(\"#questionNumber\").show();\n\t\t\tuserChoice = $('input[name=\"choice\"]:checked').val();\n\t\t} else if (userChoice == questions[questionNumber].answer){\n\t\t\tresultMessage();\n\t\t\tcorrectAnswers++;\n\t\t} else {\n\t\t\tresultMessage();\n\t\t}\n\n\t}",
"title": ""
},
{
"docid": "5f852d422f1264bc119e1907c18ab480",
"score": "0.69104356",
"text": "function checkAnswersOne(){\n if(document.getElementById(\"q1_1\").checked === true){\n numWrong = numWrong + 1;\n }\n else if(document.getElementById(\"q1_2\").checked === true){\n numWrong = numWrong + 1;\n }\n else if(document.getElementById(\"q1_3\").checked === true){\n numCorrect = numCorrect + 1;\n }\n else if(document.getElementById(\"q1_4\").checked === true){\n numWrong = numWrong + 1;\n }\n else{\n numSkip= numSkip + 1;\n }\n }",
"title": ""
},
{
"docid": "87dd8af6fc88643cb8e7a69cd15162eb",
"score": "0.6908591",
"text": "function rightAnswers() {\n\n}",
"title": ""
},
{
"docid": "605a523902a27688ceb0daa60937fe3a",
"score": "0.69072944",
"text": "function check(response, answer) {\n if (response === answer) {\n // if correct let the user know and add a point to score\n alert(\"Correct\");\n\n // user gets 1 for point\n return 1;\n }\n else {\n // if incorrect let the user know and display the correct answer\n alert(`Wrong! The correct answer ${answer}`);\n\n // user gets no points\n return 0;\n }\n}",
"title": ""
},
{
"docid": "0736c2f753d7b8762e982d4ca1e9d8ef",
"score": "0.6903705",
"text": "function checkUserAnswer(answerSelected) {\n if (answerSelected === store[questionIndex].correctAnswer) {\n return true;\n } else {\n return false;\n }\n}",
"title": ""
},
{
"docid": "0e5ac1031f0af8a45f3b70f7e975c629",
"score": "0.6892869",
"text": "function check(response, answer){\n if(response === answer){\n alert(`You answered, \"${response}\" which is correct!`);\n score++;\n } else {\n alert(`Wrong! The correct answer was ${answer}.`)\n }\n }",
"title": ""
},
{
"docid": "71a983b5aebc5dc2240d40fb49752f28",
"score": "0.6890004",
"text": "function optionIsCorrect(optionButton) {\n return optionButton.textContent === questions[currentQuestion].answer;\n}",
"title": ""
},
{
"docid": "891c0a40d60b0d752f82e9846a0f97f7",
"score": "0.68824553",
"text": "function checkAnswer(t) {\n userAnswer = qstns[currentQstn].answer;\n var answerInput = t.value;\n console.log(userAnswer);\n console.log(answerInput);\n if (answerInput === userAnswer) {\n score++;\n correctWrongSection.innerHTML = \"Correct! Good Job!\";\n currentQstn++;\n // displayQ();\n } else if (answerInput !== userAnswer) {\n correctWrongSection.innerHTML = \"Wrong! Nice Try!\";\n currentQstn++;\n // displayQ();\n }\n if (currentQstn === qstns.length) {\n scoreDisplay();\n } else {\n displayQ();\n }\n}",
"title": ""
},
{
"docid": "c75798a529a8a8a62e21fb6b1c00cda5",
"score": "0.68755424",
"text": "function choose() {\n selections[counter] = $(\"input[type='radio'][name='answer']:checked\").val() === \"right\";\n }",
"title": ""
},
{
"docid": "de3bc11a8bfa9faabb70f31b625e56ef",
"score": "0.6873253",
"text": "function checkAnswer(val) {\n if (val === STORE.questions[STORE.questionNumber].correctAnswer) {\n STORE.score++;\n return 'correct';\n } else {\n return 'wrong';\n }\n}",
"title": ""
},
{
"docid": "524d53f8e1080a6b7f0c3b8327beb298",
"score": "0.68728703",
"text": "function check(response,answer){\n if(response === answer){\n alert('Correct!');\n score++;\n } else {\n alert(`Wrong! The correct answer was ${answer}`);\n }\n }",
"title": ""
},
{
"docid": "c21b53e463d70a4e35e06e9b2120987e",
"score": "0.6872393",
"text": "function checkAnswer(){\r\n var n1 = parseInt(num1.innerHTML);\r\n var n2 = parseInt(num2.innerHTML);\r\n answer = n1 + n2;\r\n if(parseInt(guess.value)=== answer){\r\n response.innerHTML=\"<div class='right'>good!</div>\";\r\n setNumbers();\r\n }\r\n else{\r\n response.innerHTML=\"<div class='wrong'>oups try again!</div>\";\r\n }\r\n}",
"title": ""
},
{
"docid": "d482ea5d2f831810e28ea80a953f342b",
"score": "0.68695253",
"text": "function check() {\n\n\n if ((userGuessOne === \"\") || (userGuessTwo === \"\") || (userGuessThree === \"\") || (userGuessFour === \"\") || (userGuessFive === \"\")) {\n reset();\n alert(\"Please answer all questions!\");\n\n\n }\n else {\n if (userGuessOne == \"false\") {\n correct++;\n }\n else {\n wrong++;\n //console.log(userGuessOne)\n }\n if (userGuessTwo !== \"false\") {\n correct++;\n\n }\n else {\n wrong++;\n }\n if (userGuessThree !== \"false\") {\n correct++;\n }\n else {\n wrong++;\n }\n if (userGuessFour !== \"false\") {\n correct++;\n }\n else {\n wrong++;\n }\n if (userGuessFive !== \"true\") {\n correct++;\n }\n else {\n wrong++;\n };\n }\n $(\".correct\").html(\"Correct: \" + correct);\n $(\".wrong\").html(\"wrong: \" + wrong);\n }",
"title": ""
},
{
"docid": "5bfc5efbde9193c495eab0072273092a",
"score": "0.685716",
"text": "function checkAnswer(name) {\n\n // Positive number == answered correctly.\n // 0 == Not answered\n // Negative number == answered incorrectly.\n\n var slt = 'input[name=' + name + ']:checked';\n\n var results = $(slt);\n\n if (results.length === 0) {\n\n return 0;\n\n }\n \n if (results[0].value === answers[name]) {\n\n return 1;\n\n }\n \n return -1;\n\n }",
"title": ""
},
{
"docid": "b14ef5a095c903adff2dc6342158b138",
"score": "0.685094",
"text": "function check(qIndex, choiceText) {\n var selectChoice = (choiceText === dunderQuestions[qIndex].correct);\n console.log(selectChoice)\n if (selectChoice) {\n alert(\"Admirable, friend!\")\n admirableScore++;\n admirableEl.textContent = admirableScore;\n timeLeft -= 1;\n } else {\n alert(\"Impish! WRONG\")\n impishScore++;\n impishEl.textContent = impishScore;\n console.log(choiceText)\n timeLeft -= 15;\n\n }\n}",
"title": ""
},
{
"docid": "85a21cbe41f9ed4b999f600ca4f7d749",
"score": "0.68482035",
"text": "function CheckAnswer2() {\r\n\t/*assign random integers between 2 and 9 to the number of animals there are */\r\n\t/* Gather student input about how many animals they think there are */\r\n var theAnswer2 = document.getElementById(\"AnswerInput2\").value;\r\n\tvar AnswerHolder2 = \"\";\r\n\t/* Output correct or incorrect depending on student answer */\r\n\tif ( theAnswer2 == ((\"(x-12)(x-6)\")||(\"(x-6)(x-12)\")||(\"(x - 6)(x - 12)\")||(\" ( x - 6 ) ( x - 12 )\" ))) {\r\n\t\tAnswerHolder2 = \"Correct!\";\r\n\t\thideShowHolder2.style.display = \"block\";\r\n\t}\r\n\telse {\r\n\t\tAnswerHolder2 = \"Try again\";\r\n\t}\r\n\t\tdocument.getElementById(\"DisplayAnswerMarkingTwo\").innerHTML = AnswerHolder2;\r\n}",
"title": ""
},
{
"docid": "09caf2a88d309a16499c907dec7e0168",
"score": "0.68473536",
"text": "function checkUserAnswer(answer) {\n if (answer === ANSWERS[questionNum -1]) {\n return true;\n } else {\n return false;\n }\n}",
"title": ""
},
{
"docid": "43516bacc9beb7be2affe0dcc28fa539",
"score": "0.6847258",
"text": "function check() {\n if ($(\"input[name=option]:checked\").val() == all[currentQ].correct) {\n correctA++;\n }\n }",
"title": ""
},
{
"docid": "eeb98cde4df724e365c3755cf3854eba",
"score": "0.6839655",
"text": "function checkAnswer(guess) {\n if(current.correctAnswer === guess){\n score++;\n }\n//goes to next question by incrementing the number of the var currentQuestion\n currentQuestion++;\n if(currentQuestion >= question.length){\n showSummary();\n } else{\n showQuestion();\n };\n}",
"title": ""
},
{
"docid": "f5f49d56315004d6ccee20c44af802c2",
"score": "0.68358827",
"text": "function correctAnswer() {\n correctAnswers++;\n $('.timeRemaining').text(\"Very good, you may take a sip!\")\n resetRound();\n }",
"title": ""
},
{
"docid": "ff18a4c7206e84d45138d40195394aad",
"score": "0.68334466",
"text": "function checkAnswer(questionNum) {\n var $answer = $('#' + questionNum).find('input:checked').parent().text();\n var counter = 0;\n\n if (quiz[questionNum - 1].answer === $answer) {\n return true;\n } else {\n return false;\n }\n }",
"title": ""
},
{
"docid": "29d6702022ac95395806e809868cf3f4",
"score": "0.68306553",
"text": "function checkQuestion(){\n // check to see if clicked correctly now add value\n //userinput = this.value\n console.log(this.value);\n \n //click on a correct choice score goes up by 1 correct point\n \n\n if(this.value == trivia.answers[questionIndex])\n {\n score++; //score=score+1\n //display score update in console\n document.querySelector(\"#score\").textContent =\"Score: \"+ score;\n }\n else{\n //what happens wrong\n //reduce time by 10sec\n console.log(\"Incorrect!!\");\n }\n\n //update the questionIndex\n questionIndex++;\n\n //render out the next card\n renderQuestion();\n \n }",
"title": ""
},
{
"docid": "002762ae156aa872f43bba18f1047f89",
"score": "0.68291384",
"text": "function question1() {\n\tvar answerInteger = parseInt(answerInput.value);\n\t if (answerInteger === 0) {\n\t\th2outcome.innerText = 'True';\n\t\tquestion2prep();\n\t} else {\n\t\talert(\"You can't always get what you want\");\n\t\th2outcome.innerText = 'False';\n\t} \n}",
"title": ""
},
{
"docid": "201e705c107e2b786e16626d93854448",
"score": "0.6828544",
"text": "function validateAnswer() {\n var currentQuestion = questions[questionIndex];\n var selectedAnswer = this.value;\n\n if (selectedAnswer === currentQuestion.answer) {\n questionResultEl.textContent = 'Correct!';\n questionResultEl.setAttribute('class', 'question-results');\n }\n else {\n questionResultEl.textContent = 'Wrong!';\n questionResultEl.setAttribute('class', 'question-results');\n\n timeLeft -= 10;\n clockTick;\n\n userScoreEl.textContent = userScore -= randomNumber(9, 21);\n };\n\n questionIndex++;\n\n generateNewQuestion();\n}",
"title": ""
},
{
"docid": "8991933fb0f829b35984025a9a55eb6a",
"score": "0.6826999",
"text": "function correctAnswer() {\t\n\t\tgetGiphy(\"yes\", true);\n\t}",
"title": ""
},
{
"docid": "bf334c6b4bc1d1503b49af4d6c8e0d7d",
"score": "0.6826688",
"text": "function checkAnswer(event) {\n var chosenAnswer = event.target.textContent\n \n if (chosenAnswer === questions[currentQuestionIndex].answer && currentQuestionIndex !==finishedQuizQuestions) {\n points += 20; \n displayScore ();\n currentQuestionIndex ++; \n displayQuestion ();\n } else if (chosenAnswer !== questions[currentQuestionIndex].answer && currentQuestionIndex !==finishedQuizQuestions) {\n currentQuestionIndex ++;\n timerCount -= 20;\n displayQuestion();\n } else if (chosenAnswer === questions[currentQuestionIndex].answer && currentQuestionIndex === finishedQuizQuestions) { \n points += 20; \n displayScore ();\n endQuiz();\n } else if (chosenAnswer !== questions[currentQuestionIndex].answer && currentQuestionIndex === finishedQuizQuestions) { \n displayScore ();\n endQuiz();\n storePoints ();\n } \n}",
"title": ""
},
{
"docid": "9686164fc712f7e3755bfda2831a16ae",
"score": "0.68257517",
"text": "function determineSelectedChoice(){\n let selectedOption = $(\"input:checked\").val();\n let selectedIndex = findIndexByKeyValue(methods, \"method\", selectedOption);\n let indexCounter = countCorrectAnswersAttemptedQuestions(methods, 'status');\n let correctAnswer = methods[indexCounter].method;\n if(selectedIndex !== null ) {\n $('.submitButton').attr('disabled',true);\n $('.nextButton').attr(\"disabled\", false);\n $('.labelContaner label, .labelContainer input').attr('disabled',true);\n if (selectedOption === correctAnswer){\n methods[indexCounter].correct = true;\n $('.info').html(\"Good job! You got that right!\");\n $('.info').css(\"color\",\"blue\");\n } else {\n $('.info').html(`Sorry, the correct answer was ${correctAnswer}`);\n $('.info').css(\"color\",\"red\");\n }\n indexCounter = countCorrectAnswersAttemptedQuestions(methods, 'status');\n correctScore = countCorrectAnswersAttemptedQuestions(methods, \"correct\");\n let incorrectScore = indexCounter + 1 - correctScore;\n $('.score span').html(`${correctScore} correct, ${incorrectScore} incorrect`);\n $('.labelContainer input, .labelContainer label').attr('disabled',true);\n methods[indexCounter].status = true;\n \n } else {\n $('.info').html(\"Please choose one of the JavaScript methods first!\");\n $('.labelContainer')[0].focus();\n $('.info').css(\"color\",\"red\");\n }\n}",
"title": ""
},
{
"docid": "b4e716c0f40ae68be97a1c7d59a595cb",
"score": "0.6821958",
"text": "function pickAnswer(currentQuestion, selectedAnswer) {\n\n //correct answer selected\n if (selectedAnswer === questions[currentQuestion].correctAnswer) {\n correctAnswers++;\n $(\"#results\").html(\"<h2 class='heading'>Correct!</h2>\")\n displayAnswer();\n }\n //wrong answer selected\n else {\n wrongAnswers++;\n $(\"#results\").html(\"<h2 class='heading'>Nope!</h2>\")\n $(\"#results\").append(\"<p>The correct answer was <strong>\" + questions[currentQuestion].correctAnswer + \"</strong>.\")\n displayAnswer();\n\n }\n}",
"title": ""
},
{
"docid": "8e99d2862af171ee736dbe564dfd85f9",
"score": "0.68194485",
"text": "function checkAnswer() {\n\t\t\n\tif (answerGuessed === currentCorrectAnswer) {\n\n\t\tcorrectAnswers++;\n\t\t$(\"#question\").html(\"<p class='correct'>Correct!</p>\");\n\t\tif (currentObject === ledZeppelin.length-1) {\n\t\t\tfinalFactoid();\n\t\t}\n\t\telse {\n\t\t\tfactoid();\n\t\t}\n\t} \n\telse if (answerGuessed === \"\") {\n\t\tanswerGuessed = \"<NONE>\";\n\t\tincorrectAnswers++;\n\t\t$(\"#question\").html(\"<p class='wrong'>Wrong!</p>\");\n\t\tif (currentObject===ledZeppelin.length-1) {\n\t\t\tfinalFactoid();\n\t\t}\n\t\telse { factoid();\n\t\t}\n\t}\n\telse {\n\t\tincorrectAnswers++;\n\t\t$(\"#question\").html(\"<p class='wrong'>Wrong!</p>\");\n\t\tif (currentObject===ledZeppelin.length-1) {\n\t\t\tfinalFactoid();\n\t\t}\n\t\telse { factoid();\n\t\t}\n\t}\n\t$(\".timer\").html(\"You answered: \" + answerGuessed);\n\tconsole.log(answerGuessed);\n\n}",
"title": ""
},
{
"docid": "7f2c498268cebc419b02cd78f58bc14a",
"score": "0.68160826",
"text": "function answerEval(guess) {\n //advance the question\n\n //is correct\n if (guess == currentQuestion.correctAnswer) {\n rights++;\n answerScreen(\"true\");\n }\n //is wrong\n else {\n wrongs++;\n answerScreen(\"false\");\n }\n}",
"title": ""
},
{
"docid": "0b2bbe4da700dbe5b6f65c37921113d7",
"score": "0.6814105",
"text": "function correctAnswer() {\n \n setUpResp();\n emptyQuestionDiv();\n $('#score').text('Correct!');\n points++;\n responseInterval();\n }",
"title": ""
},
{
"docid": "41e46e83c3632000777093bf58fb266b",
"score": "0.6806804",
"text": "function showAnswers(trialNum) {\n\tvar correct = false;\n\tvar smallerBar = $(\"#smallerBar\").val();\n\tvar practiceAnswer = $(\"input[@name=practiceAnswer]:checked\").val();\n\tif (practiceAnswer == undefined || smallerBar == \"noAnswer\") {\n\t\talert(\"Please answer all the questions!\");\n\t\treturn false;\n\t}\n\n\tvar correctArray = practiceOptions[trialNum - 1][1];\n\tvar optionsArray = practiceOptions[trialNum - 1][0];\n\tvar correctPer = optionsArray[correctArray[1]];\n\tif (smallerBar == correctArray[0] && practiceAnswer == correctPer) {\n\t\tcorrect = true;\n\t}\n\t\n\tif (!correct) {\n\t\tshowIncorrectMessage();\n\t}\n\treturn correct;\n}",
"title": ""
},
{
"docid": "458bb5e9f224df2b1e6b5697e089b828",
"score": "0.67986774",
"text": "function checkAnswer(answer) {\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex) {\n score++;\n currentQuestionIndex++;\n generateQuestion();\n //Deduct 10 sections if answer in incorrect or continue if correct\n } else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex) {\n timeLeft = timeLeft - 10;\n currentQuestionIndex++;\n generateQuestion();\n } else {\n showScore();\n } \n}",
"title": ""
},
{
"docid": "d2d45049aed6bf20e2ca9accf43d6e7c",
"score": "0.67898303",
"text": "function checkAnswer() {\n givenAnswer = parseInt(this.id);\n correct = givenAnswer === questionList[currentQuestion].correct;\n outcome.classList.remove(\"hide\");\n if (correct) {\n optionsContainer.classList.add(\"hide\");\n outcome.innerText = \"correct!\";\n guesses === 1 ? score++ : score = score + 0.5;\n updateScore();\n setTimeout(playQuestion, 1000);\n } else if (!correct && guesses === 1) {\n this.classList.add(\"invisible\")\n outcome.innerText = \"try again\";\n guesses++;\n updateLives()\n } else {\n optionsContainer.classList.add(\"hide\");\n outcome.innerText = \"bad luck\";\n updateLives()\n if (lives > 0) {\n setTimeout(playQuestion, 1000)\n };\n }\n}",
"title": ""
},
{
"docid": "552f756d17d4a5d3880987c96eff3557",
"score": "0.6789769",
"text": "function evaluateAnswer(userSelectedAnswer){\n\treturn questions_arr[currentQIndex].answer===userSelectedAnswer;\n}",
"title": ""
},
{
"docid": "b073b67ae84f742b937ff84209228a18",
"score": "0.6788847",
"text": "function checkAnswer(e) {\n // Assign variable to get element more quickly\n let choice = e.target.value;\n // Create a for loop to check choices against answers\n // If choice = answer, then increase score\n if (choice === questions[currentQuestionIndex].answer) {\n score++;\n answerConfirmEl.textContent = \"Correct!\"\n } else {\n // If choice =/= answer, decrease time\n timeLeft = timeLeft - 15;\n answerConfirmEl.textContent = \"Incorrect...\"\n };\n // Add 1 to the current question index\n currentQuestionIndex++;\n\n // Run showQuestion function\n showQuestion();\n}",
"title": ""
},
{
"docid": "4405f718227581a0d5424a86a5e3f9a7",
"score": "0.67879593",
"text": "function goodAnswer(answer) {\n if (event.target.textContent === answer) {\n corrIncor.textContent = `Correct`;\n qAndA.score++;\n } else {\n corrIncor.textContent = `Incorrect`;\n qAndA.secondsLeft = qAndA.secondsLeft - 10;\n }\n}",
"title": ""
},
{
"docid": "2c803935b06445c3efae1a4604b0237c",
"score": "0.6784917",
"text": "function isCorrectAnswer(userAnswer) {\n console.log(userAnswer,answer);\n if (userAnswer == answer) {\n console.log(\"You are correct sir.\");\n newGame();\n }\n else if (userAnswer != answer){\n document.getElementById(\"answer\").style.borderColor = \"red\";\n runAgain = 0;\n console.log(\"Nope, guess again.\");\n }\n\n}",
"title": ""
},
{
"docid": "17e29c556eb69d3c42602e6519963ad4",
"score": "0.6774928",
"text": "function checkAnswer() {\n\tvar answer = parseInt(document.forms[\"myform\"].elements[\"check\"].value);\n\tvar corAnswer = number1 * number2;\t\n\n\tif (corAnswer == answer) {\n\t\tdocument.getElementById(\"result\").innerHTML = (\"Very Good! Do you want to try again?\");\n\t\t$(\"#myform\")[0].reset();\n\t\t\n\t} \n\telse \n\t{\t\n\t\tdocument.getElementById(\"result\").innerHTML = (\"No. Please try again.\");\n\t\t$(\"#myform\")[0].reset();\n\t}\n}",
"title": ""
},
{
"docid": "4c5405cda60d4d9945b41d49894d2668",
"score": "0.67737037",
"text": "function scorerPrompt() {\n let scoringAlgorithm = input.question( `Which Scoring Algorithm would you like to use ?\n\n 0 - Simple: One point per character\n 1 - Vowel Bonus: Vowels are worth 3 points\n 2 - Scrabble: Uses scrabble point system\n Enter 0, 1, or 2 : `);\n const validOptions = ['0','1','2'];\n if(!validOptions.includes(scoringAlgorithm)){\n console.log(\"Please enter only 0 1 and 2\");\n return -1;\n }\n //console.log(scoringAlgorithm);\n return scoringAlgorithm;\n\n}",
"title": ""
},
{
"docid": "f5432066bd12427571c82d154d488b35",
"score": "0.6773155",
"text": "function checkAnswer()\n{\n\tchoices = document.getElementsByName(\"choices\"); // Creates an array\n\tfor(var i=0; i<choices.length; i++)//variable i=0, when i is less than the length of the choices, increment it by one\n\t{\n\t\tif(choices[i].checked) //if a choice is checked\n\t\t{\n\t\tchoice = choices[i].value; //take the value of that choice and put it into choice\n\t\t}\n\t}\n\tif(choice == questions[pos].correctAnswer) //if the value of choice is equal to position 4\n\t{\n\t\talert('Correct!'); //After correct\n\t\tcorrect++; //increment your correct answers by one\n\t}\n\telse//or else\n\t{\n\t\talert('Sorry wrong answer. The correct answer is ' + questions[pos].correctAnswer);\n\t}\n\tpos++; //Increment positionby oneb go on to the next question\n\n\trenderQuestion(); //go to render question again\n}",
"title": ""
},
{
"docid": "0688a6c5d180d6d3f7ac68038a748556",
"score": "0.67691815",
"text": "function correct() {\n points += 20;\n nextQuestion();\n }",
"title": ""
},
{
"docid": "836664f976ed032ac577bebf31658a42",
"score": "0.67688644",
"text": "function checkAnswer(){\n var options = document.getElementsByName(\"options\");\n //loop that will check check what answer was checked by the user and assign it to 'option'\n for(var i=0; i<options.length; i++){\n if(options[i].checked){\n option=options[i].value;\n }\n }\n //the last element in the array within the array is the correct answer\n //so this will compare the user answer against this correct answer\n if(option==questions[position][5]){\n //if the answer is correct, the number of correct answers by the user increases by one\n correct = correct + 1;\n }\n //user's position in the quiz is advanced by one after answering each question\n position = position + 1;\n //call the nextQuestion function at the end to show the next question\n nextQuestion();\n //return the number of correct answers to the function call so the score can be displayed at the end\n return correct;\n}",
"title": ""
},
{
"docid": "9b5f859d69e3d9d4ba085c3a0d26b921",
"score": "0.67668676",
"text": "function checkAnswer(ans) {\n if (isNaN(Number(ans)) || Number(ans) !== answer) {\n entries.incorrect_entry();\n return;\n }\n entries.correct_entry();\n return;\n}",
"title": ""
},
{
"docid": "be859cf2942d1295cc5af05f9a1c0c18",
"score": "0.6765467",
"text": "function questionThree() {\n\n var anaDrive = prompt('Do you think Ana knows how to drive?', 'type yes or no').toLowerCase();\n console.log(anaDrive);//prints the answer in the console\n\n if (anaDrive === 'yes' || anaDrive === 'y') {\n //if its correct give them a point\n userPoints++; //If the answer is yes, they're going to get a point\n } else {\n //if its not correct, tell them to try again\n alert('Wrong again! ..but I do hate to drive so I avoid it as much as I can. Please try again!');\n }\n //alert below lets user know how many points they have\n alert(' You have ' + userPoints + ' points.');\n\n}",
"title": ""
}
] |
df5dbd738bbb8ed410e66240feabac8f | build a simple object with a toString function attached | [
{
"docid": "b49ff98dd2b212d6d13cc22cf752ba67",
"score": "0.0",
"text": "function Test () {}",
"title": ""
}
] | [
{
"docid": "c3bac65ecd0518460965354c7ffcc52c",
"score": "0.75454944",
"text": "toString() {}",
"title": ""
},
{
"docid": "438aeeb497f68136147d249ff08ebf3a",
"score": "0.7176436",
"text": "ToString() {}",
"title": ""
},
{
"docid": "438aeeb497f68136147d249ff08ebf3a",
"score": "0.7176436",
"text": "ToString() {}",
"title": ""
},
{
"docid": "438aeeb497f68136147d249ff08ebf3a",
"score": "0.7176436",
"text": "ToString() {}",
"title": ""
},
{
"docid": "48990dee981431074da7e387d01f1497",
"score": "0.69512093",
"text": "toString() { return `${this.name} ${utils.print(this.data)}`; }",
"title": ""
},
{
"docid": "48990dee981431074da7e387d01f1497",
"score": "0.69512093",
"text": "toString() { return `${this.name} ${utils.print(this.data)}`; }",
"title": ""
},
{
"docid": "57844dd0d2cff07bbef2c519f73af2dd",
"score": "0.69322515",
"text": "ToString() {\n\n }",
"title": ""
},
{
"docid": "57844dd0d2cff07bbef2c519f73af2dd",
"score": "0.69322515",
"text": "ToString() {\n\n }",
"title": ""
},
{
"docid": "57844dd0d2cff07bbef2c519f73af2dd",
"score": "0.69322515",
"text": "ToString() {\n\n }",
"title": ""
},
{
"docid": "e3dbf14d459c9a7cd3448103aa71be21",
"score": "0.6919305",
"text": "toString() {\n\n }",
"title": ""
},
{
"docid": "5e62c50a681370410d563f97be1651af",
"score": "0.6876317",
"text": "toString() {\n return 'Hello, world!';\n }",
"title": ""
},
{
"docid": "b00ec5b230db6225c27ca8cedcd79032",
"score": "0.6791576",
"text": "function toString() {\n return this._render(this);\n}",
"title": ""
},
{
"docid": "56cf9bd6f6f43cb113cab262a8a80982",
"score": "0.6700699",
"text": "function Person(name, age){\n this.name=name;\n this.age=age;\n this.sayHello = function (){\n console.log('saying hello')\n };\n this.toString = function (){\n return `this is me, my name is ${this.name}, and I am ${this.age}`\n }\n}",
"title": ""
},
{
"docid": "9ac1b7f95b7361a5f858068cc154a0ae",
"score": "0.6591474",
"text": "function buildStringBuilder() {\n return {\n strs: [],\n len: 0,\n append: function (str) {\n this.strs[this.len++] = str;\n return this;\n },\n toString: function () {\n return this.strs.join(\"\");\n }\n };\n}",
"title": ""
},
{
"docid": "5853e11bec3d5d42888cc188a77b4f28",
"score": "0.6493726",
"text": "toString() {\n let strInfo = \"\";\n strInfo = strInfo + \" Name : \" + this.name;\n strInfo = strInfo + \" Age : \" + this.age;\n strInfo = strInfo + \" Breed : \" + this.breed;\n strInfo = strInfo + \" Price : \" + this.price;\n\n return strInfo;\n }",
"title": ""
},
{
"docid": "f9887b6ab7ddda945f2765fe02c678ad",
"score": "0.6472585",
"text": "toString() {\n return `{name: \"${this.name}\"}`;\n }",
"title": ""
},
{
"docid": "b75df715ef51859573154667bfd12f6a",
"score": "0.64559287",
"text": "toString() {\n return `Person { person ID: ${this.personId}, name: ${this.name}`;\n }",
"title": ""
},
{
"docid": "8b624fc7be5a9bd5258df9a07a9924b7",
"score": "0.64411724",
"text": "function toString() {\n return static_1.html(this, this.options);\n}",
"title": ""
},
{
"docid": "002789fdc72baa010edf0e80051e1bdf",
"score": "0.6440421",
"text": "toString() {\n return `${this} ${this._type} ${this._bubbles}`\n // todo: make it prettier\n //return StringUtil.format('[{0} type=\"{1}\" bubbles={2}]',\n // getQualifiedClassName(this).split('::').pop(), _type, _bubbles);\n }",
"title": ""
},
{
"docid": "35bc0d2e62eba0e9731744aa0ea75d9b",
"score": "0.641732",
"text": "toString()\r\n {\r\n return \"JavaScript Object: \" + this.__text;\r\n }",
"title": ""
},
{
"docid": "016fc54636d3c99207bc7652c09d0579",
"score": "0.6364433",
"text": "function toString(any) { \n return '' + any; \n}",
"title": ""
},
{
"docid": "7473bbbed0eaeb4222335931d4dd1398",
"score": "0.63500506",
"text": "function toString(obj) {\n\t return obj.toString()\n\t}",
"title": ""
},
{
"docid": "7473bbbed0eaeb4222335931d4dd1398",
"score": "0.63500506",
"text": "function toString(obj) {\n\t return obj.toString()\n\t}",
"title": ""
},
{
"docid": "7473bbbed0eaeb4222335931d4dd1398",
"score": "0.63500506",
"text": "function toString(obj) {\n\t return obj.toString()\n\t}",
"title": ""
},
{
"docid": "7473bbbed0eaeb4222335931d4dd1398",
"score": "0.63500506",
"text": "function toString(obj) {\n\t return obj.toString()\n\t}",
"title": ""
},
{
"docid": "6e410dbf0f3c42e1b92f743d69dedfc6",
"score": "0.62810284",
"text": "toString(){ return this.valueOf() }",
"title": ""
},
{
"docid": "9ab8394909d5bca3d0280eee5ceba3b8",
"score": "0.6245864",
"text": "ToString() {\n return toString$$1(this.value);\n }",
"title": ""
},
{
"docid": "c7594a4fff7d73c201af04d0a42391cd",
"score": "0.62389356",
"text": "toString() {\n return \"I am a \" + this.color + \" circle with a \" + \"radius of \" + this.radius;\n }",
"title": ""
},
{
"docid": "fd66137bc93ad4b2874d5c8c9b59511c",
"score": "0.6226059",
"text": "function toString(obj) {\n return obj.toString();\n }",
"title": ""
},
{
"docid": "5630b595a8ede6a30033bd008b7cd634",
"score": "0.6224888",
"text": "toString() {\n return `Name of person: ${this.name}`;\n }",
"title": ""
},
{
"docid": "67b5c0c92e229f26e2519015f2b80c53",
"score": "0.62233734",
"text": "toString() {\n return `${this.title} (${this.url}). Author: ${this.author}`;\n }",
"title": ""
},
{
"docid": "4f9797dbaf12ecc1321b8bb7c3c74458",
"score": "0.6222204",
"text": "toString() {\n return `AttributeIdentity<${ this.M.name }.${ \n this.attribute \n }> {\\n type: ${\n this.type.constructor.name\n }\\n}`;\n }",
"title": ""
},
{
"docid": "7ea2c2ff37bb63cdc3318476d577ef3e",
"score": "0.62204117",
"text": "toString() {\n return toString(this);\n }",
"title": ""
},
{
"docid": "7ea2c2ff37bb63cdc3318476d577ef3e",
"score": "0.62204117",
"text": "toString() {\n return toString(this);\n }",
"title": ""
},
{
"docid": "74f2b8430ee2db3b485a4d96a585ae2d",
"score": "0.62129277",
"text": "toString() {\n return \"This is document class\\n\" +\n \"Archived: \" + this._archived + \"\\n\" +\n \"Dcoument no: \" + this._documentNo + \"\\n\" +\n \"Supplier address: \" + this._supplierAddress + \"\\n\" +\n \"Supplier no: \" + this._supplierNo;\n }",
"title": ""
},
{
"docid": "b93f2326baae60ffed268552a11b6adb",
"score": "0.61943966",
"text": "function simpleToString() {\n var arr = [];\n forEachOwnProperty(this, function(ob, prop) {\n arr.push(prop + \": \" + this[prop]);\n }, this);\n if (arr.length > 0) {\n return arr.join(\", \");\n }\n return \"\";\n }",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "5c6b1c53aef13a46cb751666f58c22d6",
"score": "0.61852586",
"text": "function toString(value){return''+value;}",
"title": ""
},
{
"docid": "4ef84f37f851e919aca15dda6b4ee123",
"score": "0.6135545",
"text": "function toString()\n{\n let obj=new Object()\n obj.method=\"GET / HTTP/1.1\"\n obj.Accept=\"text/html\"\n obj.Host=\"zum.com\"\n obj.User_Agent=\"Mozilla/5.0\"\n str=`${obj.method}\\nAccept: ${obj.Accept}\\nHost: ${obj.Host}\\nUser-Agent: ${obj.User_Agent}\\r\\n\\r\\n`\n console.log(str)\n return str \n}",
"title": ""
},
{
"docid": "b8ec61632b704b17cb180afaa804c87d",
"score": "0.6129107",
"text": "toString() {\n return `${this.header()}${this.body()}\\n${this.population()}\\n${this.recommendation()}\\n${this.rationale()}\\n` +\n `${this.errors()}`;\n }",
"title": ""
},
{
"docid": "9b68d0be7332545b33f32fac399a2884",
"score": "0.6110547",
"text": "toString() {\r\n return JSON.stringify({\r\n id: this.id,\r\n name: this.name,\r\n createdIn: this.createdIn,\r\n createdBy: this.createdBy,\r\n deactivatedIn: this.deactivatedIn,\r\n deactivatedBy: this.deactivatedBy,\r\n modifiedIn: this.modifiedIn,\r\n modifiedBy: this.modifiedBy,\r\n active: this.active\r\n })\r\n }",
"title": ""
},
{
"docid": "2a566083507a814036d1219e38f41ab1",
"score": "0.6108954",
"text": "function toString(obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "2a566083507a814036d1219e38f41ab1",
"score": "0.6108954",
"text": "function toString(obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "2a566083507a814036d1219e38f41ab1",
"score": "0.6108954",
"text": "function toString(obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "66ee7122d060d44d4e08d5e448f407e2",
"score": "0.61027837",
"text": "function toString (obj) {\n return obj.toString()\n}",
"title": ""
},
{
"docid": "f6c98ad3f814cd17d56563c302c9d6ef",
"score": "0.6088858",
"text": "constructor() {\r\n\t\tlet a = 0;\r\n\t\tthis['toString'] = () => a +++ a;\r\n\t\r\n\t}",
"title": ""
},
{
"docid": "5a614ebafc7fefb3ad4d1add5595bd28",
"score": "0.60845983",
"text": "toString(){\n var result = super.toString();\n return `${result} is of type ${this.type}` \n }",
"title": ""
},
{
"docid": "07f42276d52ddfdab534665e48699799",
"score": "0.6083392",
"text": "function toString(obj) {\n return obj.toString();\n}",
"title": ""
},
{
"docid": "07f42276d52ddfdab534665e48699799",
"score": "0.6083392",
"text": "function toString(obj) {\n return obj.toString();\n}",
"title": ""
},
{
"docid": "8cec83f3fda1a270b0731b43b535f6f2",
"score": "0.6066966",
"text": "toString(){\n return '('+ this._year + ', ' + this._make + ', ' + this._model + ', ' + this._color + ', ' + this._engineSize + ', ' + this._transmission + ', ' + this._numOfDoors + ',' + this._seatingCapacity + ')';\n }",
"title": ""
},
{
"docid": "3a29a41b58ef1cc046da6f344ddbda6b",
"score": "0.60666656",
"text": "function toStringOperationExamples()\n{\n // primitives values have natural Stringification\n console.log(null + ''); // 'null'\n\n console.log(undefined + ''); // 'undefined'\n\n console.log(true + ''); // 'true'\n\n console.log(false + ''); // 'false'\n\n console.log(45 + ''); // '45'\n\n // numbers are expressed in its natural way but small/large number are\n // stringified to exponential form.\n let largeNumber = 234.45 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;\n\n let smallNumber = -234.45 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;\n\n console.log(largeNumber + '');\n\n console.log(smallNumber + '');\n\n // toString operation on Objects returns the internal `[[class]]` property, which\n // is a default located at Object.protoype.toString()\n // if a object contains toString method in it, it will be called.\n let obj = {};\n\n console.log(obj.toString());\n\n // array default have an overridden default toString(), which stringifies as its string\n // concatenation of all its values.\n let a = [4,5,6];\n\n console.log(a.toString());\n}",
"title": ""
},
{
"docid": "3938236995d5a7023b2dded95e502003",
"score": "0.6052414",
"text": "function toString() {\n return \"Circle {radius: \" + this.radius\n + \", dateCreated: \" + this.dateCreated + \"}\";\n}",
"title": ""
},
{
"docid": "18f11ff3b486b436bfdce3a7becbb036",
"score": "0.6051323",
"text": "toString() {\n return this.serialize();\n }",
"title": ""
},
{
"docid": "480de37b3e3cb212f8b9591a02ad1c96",
"score": "0.60245746",
"text": "toString() {\n return JSON.stringify(this.toJSON());\n }",
"title": ""
},
{
"docid": "480de37b3e3cb212f8b9591a02ad1c96",
"score": "0.60245746",
"text": "toString() {\n return JSON.stringify(this.toJSON());\n }",
"title": ""
},
{
"docid": "880c0da020db732b1572e5afa4c3952f",
"score": "0.6022582",
"text": "toString() {\n return `${this.name} <${this.email}>`;\n }",
"title": ""
},
{
"docid": "0acdcebf68e4a256cb952a5dbd5e1b2a",
"score": "0.60221475",
"text": "toString() {\n return this._string;\n }",
"title": ""
},
{
"docid": "942b3ca08c6feef1141e7566bec28108",
"score": "0.60128355",
"text": "toString(options = defaultToStringOptions) {\n const {linebreak} = getWhitespaceSymbols(options)\n if (options.indent == null) options.indent = defaultToStringOptions.indent\n if (options.children == null) options.children = defaultToStringOptions.children\n if (options.children === false) {\n return `${this.at} ${this.id} {}`\n }\n let children = this.rules.toString(options)\n if (children) children = `${linebreak}${children}${linebreak}`\n return `${this.at} ${this.id} {${children}}`\n }",
"title": ""
},
{
"docid": "369ef104b4b70b4f7355aa65d5f68373",
"score": "0.5992652",
"text": "function Animal() {\n this.name = \"Animal\";\n //toString exsits in main javascript Object\n //this is function over-rinding\n this.toString = function () {\n return \"My name is \" + this.name;\n };\n }",
"title": ""
},
{
"docid": "da1a836439cd36cbcd1addb4f08c570f",
"score": "0.5961312",
"text": "toString() {\n if (isObject(this._value) && ! isObjectLiteral(this._value)) {\n return __jymfony.sprintf('is identical to an object of class \"%s\"', ReflectionClass.getClassName(this._value));\n }\n\n return 'is identical to ' + this.export(this._value);\n }",
"title": ""
},
{
"docid": "cdc5f61affef3b4423ec0672d3641d29",
"score": "0.5930486",
"text": "function toString(value){return ''+value;}",
"title": ""
},
{
"docid": "7d1e0b66bf7e2714a0a9b083c5beaaa5",
"score": "0.59228826",
"text": "toString() {\n return `Vehicle { health: ${this.health.toFixed(2)}, recharge: ${this.recharge.toFixed(2)}, \n operators: ${this.operators} }`;\n }",
"title": ""
},
{
"docid": "3cf65e98e2021471f50dbb3c7c750ad9",
"score": "0.59205484",
"text": "toString() {\n return this.name\n }",
"title": ""
},
{
"docid": "9820a73bfe87801b66842e2cfa26612a",
"score": "0.59138906",
"text": "toString(ctx) {\n return Alias.stringify(this, ctx);\n }",
"title": ""
},
{
"docid": "9820a73bfe87801b66842e2cfa26612a",
"score": "0.59138906",
"text": "toString(ctx) {\n return Alias.stringify(this, ctx);\n }",
"title": ""
},
{
"docid": "9820a73bfe87801b66842e2cfa26612a",
"score": "0.59138906",
"text": "toString(ctx) {\n return Alias.stringify(this, ctx);\n }",
"title": ""
},
{
"docid": "9820a73bfe87801b66842e2cfa26612a",
"score": "0.59138906",
"text": "toString(ctx) {\n return Alias.stringify(this, ctx);\n }",
"title": ""
},
{
"docid": "e7793ae423d3a04c5ff64cae023ce043",
"score": "0.58750755",
"text": "toString() {\n return `${this.operator} ${this.target.toString()}`;\n }",
"title": ""
},
{
"docid": "cde3920620547a9f93a66fd6831034d0",
"score": "0.58618546",
"text": "function my_function() { \n document.getElementById(\"New_and_This\").innerHTML = // prints constructors within sentence\n \"Jacob drives a \" + Jacob.vehicle_color + \"-colored \" + Jacob.vehicle_make + \" \" + Jacob.vehicle_model + \" manufactured in \" + Jacob.vehicle_year;\n}",
"title": ""
},
{
"docid": "8983edf126e9ee8120cc9938a91a656d",
"score": "0.58614576",
"text": "toString() {\r\n return \"Add \";\r\n }",
"title": ""
},
{
"docid": "93729d1da342f01820250a204d1ccb3c",
"score": "0.5835689",
"text": "function toString(value){\nreturn ''+value;\n}",
"title": ""
},
{
"docid": "b82f1bddd5d5aba268e297e033a6ae78",
"score": "0.58340424",
"text": "toString() {\r\n\t\t\treturn `t3: ${this.t3}, t5: ${this.t5}, t6: ${this.t6}, t7: ${this.t7}, t8: ${this.t8}, linktest: ${this.linkTest}`;\r\n\t\t}",
"title": ""
},
{
"docid": "6aea5b077a537346ccc9e0721d6f5b83",
"score": "0.58268005",
"text": "toString()\r\n {\r\n let printString = '';\r\n\r\n // print name.\r\n printString += \"name: \" + this._name + \"\\n\";\r\n\r\n // print waypoints.\r\n for (let waypoint of this._waypoints){\r\n printString += \"coords: \" + waypoint.lat() + \", \" + waypoint.lng() + \"\\n\";\r\n }\r\n\r\n // print total distance.\r\n printString += \"total distance: \" + this._totalDistance + \"\\n\";\r\n\r\n return printString\r\n }",
"title": ""
},
{
"docid": "ff1a29a358e4f48cc91c8eee3316c143",
"score": "0.5824821",
"text": "toString() {\n return \"LearningUnit{ No: \" + this.learnUnitId +\n \", Title: \" + this.learnUnitTitle +\n \", Description: \" + this.learnUnitDescription +\n \", Course(s): \" + this.courses +\n \"}\";\n }",
"title": ""
},
{
"docid": "12d225b650c978673d54be37ea91568d",
"score": "0.58207065",
"text": "toString() {\n return this.name;\n }",
"title": ""
},
{
"docid": "12d225b650c978673d54be37ea91568d",
"score": "0.58207065",
"text": "toString() {\n return this.name;\n }",
"title": ""
},
{
"docid": "12d225b650c978673d54be37ea91568d",
"score": "0.58207065",
"text": "toString() {\n return this.name;\n }",
"title": ""
},
{
"docid": "12d225b650c978673d54be37ea91568d",
"score": "0.58207065",
"text": "toString() {\n return this.name;\n }",
"title": ""
}
] |
6945b4d00f799193537c7e1e9df56213 | add tags are line breaker | [
{
"docid": "5264f17c14b966f6f8415df6b5e24745",
"score": "0.0",
"text": "render() {\n if (this.props.entry === null) {\n return (<div></div>);\n } else {\n //confirm modal \"x\" button\n const closeBtnConfirm = <button className=\"close\" onClick={this.toggleConfirmModal}>×</button>;\n\n //edit modal \"x\" button\n const closeBtnEdit = <button className=\"close\" onClick={this.toggleEditModal}>×</button>;\n\n //regex to validate editing form\n const required = (val) => val && val.length;\n const isPhoneNumber = (val) => /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/g.test(val);\n\n //update user when finish editing\n const updatedUser = this.props.user.filter((user) => user.id === this.props.entry.id)[0];\n return (\n <div className=\"container border-inputgroup\">\n {RenderEntryInfo(updatedUser)}\n <div className=\"row d-flex justify-content-end pr-2\">\n <Button color=\"primary\" className=\"m-1\" onClick={this.toggleEditModal}>Chỉnh sửa</Button>\n <Button color=\"danger\" className=\"m-1\" onClick={this.toggleConfirmModal}>Xóa liên hệ</Button>\n </div>\n {/* confirmation modal */}\n <Modal isOpen={this.state.isConfirmModalOpen} toggle={this.toggleConfirmModal}>\n <ModalHeader close={closeBtnConfirm}>Xóa liên hệ</ModalHeader>\n <ModalBody>\n Xác nhận xóa liên hệ <b>{this.props.entry.firstName.concat(\" \", this.props.entry.lastName)}</b>\n </ModalBody>\n <ModalFooter>\n <Button color=\"primary\" onClick={this.toggleConfirmModal}>Hủy</Button>{' '}\n <Button color=\"secondary\" onClick={this.deleteUser}>Xác nhận</Button>\n </ModalFooter>\n </Modal>\n {/* editing modal */}\n <Modal isOpen={this.state.isEditModalOpen} toggle={this.toggleEditModal} className=\"modal-lg\">\n <ModalHeader close={closeBtnEdit}>\n Chỉnh sửa địa chỉ liên hệ\n </ModalHeader>\n <hr className=\"w-100 border border-primary\" />\n <ModalBody>\n <div className=\"container-fluid\">\n <div classname=\"row\">\n <div classname=\"col-12\">\n {/* avatar upload */}\n <div class=\"avatar-wrapper\">\n <img class=\"profile-pic\" src={this.state.avatar} alt=\"avt\" />\n </div>\n <div class=\"container-fluid\">\n <div className=\"row\">\n <input class=\"file-upload\" type=\"file\" id=\"upload\" accept=\"image/*\"\n onChange={this.handleAvatar} />\n </div>\n <div className=\"row d-flex justify-content-center\">\n <label className=\"btn btn-primary\" for=\"upload\">\n Upload\n </label>\n </div>\n </div>\n </div>\n {/* edit form */}\n <div className=\"col-12\">\n <LocalForm onSubmit={(values) => this.handleInfo(values)}>\n <Row className=\"form-group\">\n <Label htmlFor=\"firstName\" md={2}>Họ*</Label>\n <Col md={10}>\n <Control.text\n model=\".firstName\" id=\"firstName\"\n name=\"firstName\" placeholder={this.props.entry.firstName}\n defaultValue={this.props.entry.firstName}\n className=\"form-control\"\n ></Control.text>\n <Errors\n className=\"text-danger\"\n model=\".firstName\"\n show=\"touched\"\n messages={{\n required: \"Trường này không được bỏ trống\"\n }}\n />\n </Col>\n </Row>\n <Row className=\"form-group\">\n <Label htmlFor=\"lastName\" md={2}>Tên*</Label>\n <Col md={10}>\n <Control.text\n model=\".lastName\" id=\"lastName\"\n name=\"lastName\" placeholder={this.props.entry.lastName}\n defaultValue={this.props.entry.lastName}\n className=\"form-control\"\n validators={{\n required\n }}\n ></Control.text>\n <Errors\n className=\"text-danger\"\n model=\".lastName\"\n show=\"touched\"\n messages={{\n required: \"Trường này không được bỏ trống\"\n }}\n />\n </Col>\n </Row>\n <Row className=\"form-group\">\n <Label htmlFor=\"company\" md={2}>Công ty</Label>\n <Col md={10}>\n <Control.text\n model=\".company\" id=\"company\"\n name=\"company\"\n placeholder={this.props.entry.company === null ? '' : this.props.entry.company}\n defaultValue={this.props.entry.company === null ? '' : this.props.entry.company}\n className=\"form-control\"></Control.text>\n </Col>\n </Row>\n <Row className=\"form-group\">\n <Label htmlFor=\"phone\" md={2}>Di động*</Label>\n <Col md={10}>\n <Control.text\n model=\".phone\" id=\"phone\"\n name=\"phone\" placeholder={this.props.entry.phone}\n className=\"form-control\"\n defaultValue={this.props.entry.phone}\n validators={{\n isPhoneNumber\n }}></Control.text>\n <Errors\n className=\"text-danger\"\n model=\".phone\"\n show=\"touched\"\n messages={{\n isPhoneNumber: \"Số điện thoại không hợp lệ \"\n }}\n />\n </Col>\n </Row>\n <div className=\"container\">\n <hr className=\"w-100 border border-primary\" />\n </div>\n <Row className=\"form-group\">\n <Label htmlFor=\"note\" md={2}>Ghi chú</Label>\n <Col md={10}>\n <Control.textarea\n model=\".note\" id=\"note\"\n name=\"note\"\n placeholder={this.props.entry.note === null ? '' : this.props.entry.note}\n defaultValue={this.props.entry.note === null ? '' : this.props.entry.note}\n className=\"form-control\"\n rows={5}></Control.textarea>\n </Col>\n </Row>\n <div className=\"container\">\n <hr className=\"w-100 border border-primary\" />\n </div>\n <Row className=\"form-group\">\n <Col className=\"d-flex justify-content-end\">\n <Button color=\"primary\" className=\"m-1\" onClick={this.toggleEditModal}>\n Hủy\n </Button>\n <Button type=\"submit\" color=\"primary\" className=\"m-1\">\n Xong\n </Button>\n </Col>\n </Row>\n </LocalForm>\n </div>\n </div>\n </div>\n </ModalBody>\n </Modal>\n </div>\n );\n }\n }",
"title": ""
}
] | [
{
"docid": "92c48bdc184a8977e0ec2ec007d2ece4",
"score": "0.64242077",
"text": "function vchat_newLine(vdata, vxml) { var createNewLines = (vxml || typeof vxml === 'undefined') ? '<br ' + '/>' : '<br>'; return (vdata + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + createNewLines + '$2'); }",
"title": ""
},
{
"docid": "7f14c0e86bc91ec72d898cd72386f2ce",
"score": "0.63380605",
"text": "function addLineBreak(){\n\tvar br = document.createElement(\"BR\");\n\tdocument.getElementById(\"mainBody\").appendChild(br);\n}",
"title": ""
},
{
"docid": "3067f46b3f8c1f98b9aae0ab78b810ad",
"score": "0.6234927",
"text": "add_newline(){\n var elm = document.createElement(\"br\");\n this.children.push(elm);\n this.elm.appendChild(elm)\n return this.elm;\n }",
"title": ""
},
{
"docid": "f86c9088d46a9818c56d9ffe8ed78604",
"score": "0.62322414",
"text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }",
"title": ""
},
{
"docid": "f86c9088d46a9818c56d9ffe8ed78604",
"score": "0.62322414",
"text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }",
"title": ""
},
{
"docid": "f86c9088d46a9818c56d9ffe8ed78604",
"score": "0.62322414",
"text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }",
"title": ""
},
{
"docid": "f86c9088d46a9818c56d9ffe8ed78604",
"score": "0.62322414",
"text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }",
"title": ""
},
{
"docid": "5b3bf1140da8a72bb68f952531f1235f",
"score": "0.6193366",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] === \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 )\n inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what === \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] === \"string\" )\n add_to[ add_to.length-1 ] += what;\n else\n add_to.push( what );\n }\n }",
"title": ""
},
{
"docid": "5b3bf1140da8a72bb68f952531f1235f",
"score": "0.6193366",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] === \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 )\n inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what === \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] === \"string\" )\n add_to[ add_to.length-1 ] += what;\n else\n add_to.push( what );\n }\n }",
"title": ""
},
{
"docid": "5b3bf1140da8a72bb68f952531f1235f",
"score": "0.6193366",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] === \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 )\n inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what === \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] === \"string\" )\n add_to[ add_to.length-1 ] += what;\n else\n add_to.push( what );\n }\n }",
"title": ""
},
{
"docid": "2c6aa8492ce021f77281ef851fc0cbb5",
"score": "0.6166594",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }",
"title": ""
},
{
"docid": "2c6aa8492ce021f77281ef851fc0cbb5",
"score": "0.6166594",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }",
"title": ""
},
{
"docid": "2c6aa8492ce021f77281ef851fc0cbb5",
"score": "0.6166594",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }",
"title": ""
},
{
"docid": "2c6aa8492ce021f77281ef851fc0cbb5",
"score": "0.6166594",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }",
"title": ""
},
{
"docid": "2c6aa8492ce021f77281ef851fc0cbb5",
"score": "0.6166594",
"text": "function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }",
"title": ""
},
{
"docid": "45f43d9672d2f4c15eccca876d03d135",
"score": "0.6136961",
"text": "function add(li, loose, inline, nl) {\n if (loose) {\n li.push([\"para\"].concat(inline));\n return;\n } // Hmmm, should this be any block level element or just paras?\n\n\n var add_to = li[li.length - 1] instanceof Array && li[li.length - 1][0] == \"para\" ? li[li.length - 1] : li; // If there is already some content in this list, add the new line in\n\n if (nl && li.length > 1) inline.unshift(nl);\n\n for (var i = 0; i < inline.length; i++) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n\n if (is_str && add_to.length > 1 && typeof add_to[add_to.length - 1] == \"string\") {\n add_to[add_to.length - 1] += what;\n } else {\n add_to.push(what);\n }\n }\n } // contained means have an indent greater than the current one. On",
"title": ""
},
{
"docid": "1e8a4dc06b4e453406f12c225033f89f",
"score": "0.6055609",
"text": "function add(li, loose, inline, nl) {\n\t\t\t\t\tif (loose) {\n\t\t\t\t\t\tli.push([\"para\"].concat(inline));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Hmmm, should this be any block level element or just paras?\n\t\t\t\t\tvar add_to = li[li.length - 1] instanceof Array && li[li.length - 1][0] == \"para\" ? li[li.length - 1] : li;\n\n\t\t\t\t\t// If there is already some content in this list, add the new line in\n\t\t\t\t\tif (nl && li.length > 1) inline.unshift(nl);\n\n\t\t\t\t\tfor (var i = 0; i < inline.length; i++) {\n\t\t\t\t\t\tvar what = inline[i],\n\t\t\t\t\t\t is_str = typeof what == \"string\";\n\t\t\t\t\t\tif (is_str && add_to.length > 1 && typeof add_to[add_to.length - 1] == \"string\") {\n\t\t\t\t\t\t\tadd_to[add_to.length - 1] += what;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tadd_to.push(what);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"title": ""
},
{
"docid": "50bf714e2372e8605fe2b31aa565314a",
"score": "0.60531855",
"text": "function add(li, loose, inline, nl) {\n if (loose) {\n li.push([\"para\"].concat(inline));\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length - 1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length - 1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if (nl && li.length > 1) inline.unshift(nl);\n\n for (var i = 0; i < inline.length; i++) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if (is_str && add_to.length > 1 && typeof add_to[add_to.length - 1] == \"string\") {\n add_to[add_to.length - 1] += what;\n }\n else {\n add_to.push(what);\n }\n }\n }",
"title": ""
},
{
"docid": "3b10f569f637caf510294a57f9ca547a",
"score": "0.6042702",
"text": "function addLines(code) {\n\t\treturn '<ol class=\"pandaCode\"><li>' + code.split(/\\n/).join('</li><li>') + '</li></ol>';\n\t}",
"title": ""
},
{
"docid": "a602f234c11c4dbe4cee65ef2921f8f7",
"score": "0.6017031",
"text": "parseLine(l, ln) {\n\n /*\n We create a new Tag for that line\n */\n let tag = new Tag({\n value: l,\n ln: ln\n }, this.styles);\n\n /* We check if the Tag is a variable */\n if(tag.is.var){\n this.scope.push(utils.parseVar(tag.value));\n tag.isClosed = true;\n return tag;\n }\n\n /* We check if the Tag is a function */\n if(tag.is.function){\n tag.isClosed = true;\n let v = this.interpreteSTMLFunction(tag.value, this.lines[ln - 1], this.lines, l, ln);\n tag.tag = v;\n tag.isClosed = true;\n return tag;\n }\n\n /* We check if the Tag is a comment */\n if(tag.is.comment){\n let commentValue = utils.getComment(tag.value);\n tag.tag = utils.formatComment(commentValue);\n tag.isClosed = true;\n return tag;\n }\n\n /* Else it is \"tag\" */\n else{\n\n /* We check if the Tag has id */\n if(tag.has.id){\n let res = tag.getId();\n tag.id = res.id;\n tag.tag += res.format();\n }\n\n /* We check if the Tag has classes */\n if(tag.has.class){\n let res = tag.getClasses();\n tag.classes = res.classes;\n tag.tag += res.format();\n }\n\n /* We check if the Tag has attributes */\n if(tag.has.attr){\n let res = tag.getAttr();\n tag.tag += \" \" + res;\n }\n\n /* We check if the Tag is not selfClosing */\n if(!this.lex.selfClosing.includes(tag.name)){\n\n /* We check if the tag has text */\n if(tag.has.text){\n let res = tag.getTextStuff();\n\n /*\n here we check if it has any variable in the text and replace it\n with the value that is in the scope\n */\n if(res.match(/\\$[a-z][A-Z]*/)){\n res = this.getVarFromScope(res);\n }\n\n tag.tag +=`>${res}</${tag.name}>`;\n tag.isClosed = true;\n }\n else{\n tag.tag +=`>@replace@</${tag.name}>`;\n }\n }\n\n /* else its selfClosing */\n else{\n tag.tag +=`>`;\n tag.isClosed = true;\n }\n\n /* We return the tag */\n return tag\n }\n }",
"title": ""
},
{
"docid": "43a7499bcfe11e877e247f918d1461f9",
"score": "0.59785193",
"text": "function newNewLineElem() {\n\tconsole.log('<br>');\n\treturn createNewTextSlice(\"br\");\n}",
"title": ""
},
{
"docid": "42f91528a852c01b1c4e45c475c57491",
"score": "0.5963035",
"text": "addTag() {\n var text = document.getElementById(\"myTag\");\n var label = document.createElement(\"LABEL\");\n var text = document.createTextNode(text.value);\n label.appendChild(text);\n document.getElementById(\"tags\").appendChild(label);\n document.getElementById(\"myTag\").value=\"\";\n\n }",
"title": ""
},
{
"docid": "0d41d188c33b7c5411f20e930d78a79b",
"score": "0.59611034",
"text": "static writeXML(xml) {\n const s0 = xml.replace(/</g, '\\n<');\n const s1 = xmlEscapeText(s0);\n const s2 = s1.replace(/\\s*\\n(\\s|\\n)*/g, '<br/>');\n this.lines.push(s2);\n this.show();\n }",
"title": ""
},
{
"docid": "c5a27401be47ed5c16dc5197fcf4b91f",
"score": "0.59272826",
"text": "function R(e){return e.replace(/([^>])([\\n\\r]+)/g,\"$1<br/>$2\")}",
"title": ""
},
{
"docid": "415cdfe006919b47ac52776c39ab5a52",
"score": "0.59240925",
"text": "function add_tag(tag, autoupdate) {\n tag = Drupal.checkPlain(tag);\n $(wrapper_sel).append(\"<span class='\"+tag_class+\"'>\"+tag+\"</span>\");\n if(autoupdate) {\n update_tags();\n }\n }",
"title": ""
},
{
"docid": "9062321c05bae5f6dc64daa9e4a6851d",
"score": "0.5863104",
"text": "function x_addLineBreaks(text, override) {\n\tif (override != true) { // override only used when text being tested isn't from xml (e.g. modelAnswer page)\n\t\t// First test for new editor\n\t\tif (x_params.editorVersion && parseInt(\"0\" + x_params.editorVersion, 10) >= 3)\n\t\t{\n\t\t\treturn text; // Return text unchanged\n\t\t}\n\n\t\t// Now try to identify v3beta created LOs\n\t\tvar trimmedText = $.trim(text);\n\t\tif ((trimmedText.indexOf(\"<p\") == 0 || trimmedText.indexOf(\"<h\") == 0) && (trimmedText.lastIndexOf(\"</p\") == trimmedText.length-4 || trimmedText.lastIndexOf(\"</h\") == trimmedText.length-5))\n\t\t{\n\t\t\treturn text; // Return text unchanged\n\t\t}\n\t}\n\n // Now assume it's v2.1 or before\n if (text.indexOf(\"<math\") == -1 && text.indexOf(\"<table\") == -1)\n {\n return text.replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n }\n else { // ignore any line breaks inside these tags as they don't work correctly with <br>\n var newText = text;\n if (newText.indexOf(\"<math\") != -1) { // math tag found\n var tempText = \"\",\n mathNum = 0;\n\n while (newText.indexOf(\"<math\", mathNum) != -1) {\n var text1 = newText.substring(mathNum, newText.indexOf(\"<math\", mathNum)),\n tableNum = 0;\n while (text1.indexOf(\"<table\", tableNum) != -1) { // check for table tags before/between math tags\n tempText += text1.substring(tableNum, text1.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += text1.substring(text1.indexOf(\"<table\", tableNum), text1.indexOf(\"</table>\", tableNum) + 8);\n tableNum = text1.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += text1.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += newText.substring(newText.indexOf(\"<math\", mathNum), newText.indexOf(\"</math>\", mathNum) + 7);\n mathNum = newText.indexOf(\"</math>\", mathNum) + 7;\n }\n\n var text2 = newText.substring(mathNum),\n tableNum = 0;\n while (text2.indexOf(\"<table\", tableNum) != -1) { // check for table tags after math tags\n tempText += text2.substring(tableNum, text2.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += text2.substring(text2.indexOf(\"<table\", tableNum), text2.indexOf(\"</table>\", tableNum) + 8);\n tableNum = text2.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += text2.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n newText = tempText;\n\n } else if (newText.indexOf(\"<table\") != -1) { // no math tags - so just check table tags\n var tempText = \"\",\n tableNum = 0;\n while (newText.indexOf(\"<table\", tableNum) != -1) {\n tempText += newText.substring(tableNum, newText.indexOf(\"<table\", tableNum)).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n tempText += newText.substring(newText.indexOf(\"<table\", tableNum), newText.indexOf(\"</table>\", tableNum) + 8);\n tableNum = newText.indexOf(\"</table>\", tableNum) + 8;\n }\n tempText += newText.substring(tableNum).replace(/(\\n|\\r|\\r\\n)/g, \"<br />\");\n newText = tempText;\n }\n\n return newText;\n }\n}",
"title": ""
},
{
"docid": "4b486aed9cb29ffcb0dad88731a9d9f9",
"score": "0.58495754",
"text": "function insertBr() {\n\t\t\t\teditor.execCommand(\"InsertLineBreak\", false, evt);\n\t\t\t}",
"title": ""
},
{
"docid": "dde68b1cee311f1cf0a3e929f784e246",
"score": "0.5837442",
"text": "function vpb_wall_nl2br(vdata, vxml) { var createNewLines = (vxml || typeof vxml === 'undefined') ? '<br ' + '/>' : '<br>'; return (vdata + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + createNewLines + '$2'); }",
"title": ""
},
{
"docid": "6e29388de4b8165c20ba846fb38b89c1",
"score": "0.5823806",
"text": "function add_tag(tag, element){\n var new_node = element.children().last().clone(true);\n new_node.show();\n new_node.children().first().text(tag);\n element.append(new_node);\n }",
"title": ""
},
{
"docid": "2811f2622d69e4053491f5fbbd24b4e4",
"score": "0.5819219",
"text": "function addTags(tag){\n var level = $(tag).attr('level'),\n selection = tag,\n content = '<span asset=\"'+ $(tag).attr('asset') +'\" level=\"'+ $(tag).attr('level') +'\" '\n +'onclick=\"removeTags(this)\">' + $(tag).find('.tag-name').html() + ' <b>x</b></span>';\n\n if(level !== 1) {\n for (var i = 1; i < level; i++) {\n content = '<span asset=\"'+ $(getParent(selection)).attr('asset') +'\" level=\"'\n + $(getParent(selection)).attr('level')\n +'\" onclick=\"removeTags(this)\">' + $(getParent(selection)).find('.tag-name').html() + ' <b>x</b></span>'\n +content;\n\n selection = getParent(selection);\n }\n $(tagsContainer).html(content);\n }\n addingIdentity();\n}",
"title": ""
},
{
"docid": "6992726b06a0e09409a7e3ec4b192e1e",
"score": "0.5816935",
"text": "function insertLineBreak()\n{\n var theDOM = null;\n // If user is in CI, use the top level doc.\n if (dw.getFocus(true) == 'html')\n theDOM = dw.getActiveWindow();\n else\n theDOM = dw.getDocumentDOM();\n\n // Get the offsets of the selection\n var theSel = theDOM.source.getSelection();\n //Get the selected Lines\n var arrLines = theDOM.source.getCurrentLines();\n // Get the outerHTML of the HTML tag (the\n // entire contents of the document)\n var theDocEl = theDOM.documentElement;\n var theWholeDoc = theDocEl.outerHTML;\n var tagToInsert;\n var tagToInsertEOL;\n if (theDOM.getIsXHTMLDocument())\n {\n tagToInsert = \"<br />\";\n tagToInsertEOL = \"<br />\\r\";\n }\n else\n {\n tagToInsert = \"<br>\";\n tagToInsertEOL = \"<br>\\r\";\n }\n var selText = \"\"; \n var regExp = /\\n/g;\n if (navigator.platform == \"Win32\")\n \tregExp = /\\r/g;\n\t\n selText = theDOM.source.getText(theSel[0],theSel[1]);\n \n //add <br> at the end of every line.\n if(regExp.test(selText))\n selText = selText.replace(regExp, tagToInsertEOL);\n \n //add <br> at the end of selection \n selText = selText + tagToInsert;\n \n //replace the selected text with the modified text.\n if(dw.canShowDesignView(theDOM))\n theDocEl.outerHTML = theWholeDoc.substring(0,theSel[0]) + selText + theWholeDoc.substr(theSel[1]);\n else\n theDOM.source.replaceRange(theSel[0],theSel[1],selText);\n \n // Set the selection at the end point of modified text\n theDOM.source.setSelection((theSel[0] + selText.length),(theSel[0] + selText.length));\n}",
"title": ""
},
{
"docid": "97aca04164e139b1a02fe7f510c77214",
"score": "0.5803372",
"text": "function addTagList () {\n\tvar tag = new Array;\n\tvar posx = posicaoX.toString();\n\tposx = posx.split(\",\");\n\tvar posy = posicaoY.toString();\n\tposy = posy.split(\",\");\n\tvar t = tempoTag.toString();\n\tt = t.split(\",\");\n\ttag.push(parent.tagName, parent.tagLink, posx, posy, t, width, height);\n\ttagList.push(tag);\n}",
"title": ""
},
{
"docid": "6b1aa7ecfff0ad69edc16423cb59f2d4",
"score": "0.5792356",
"text": "function addLine() {\n\tformatText('inserthorizontalrule', null);\n}",
"title": ""
},
{
"docid": "a426b8e9d58a1d87041877565dc7c241",
"score": "0.5762385",
"text": "function add(tag) {\n const tagsContainer = document.getElementById(\"myTags\");\n\n var nodeListLength = tagsContainer.getElementsByClassName(tag).length;\n if(nodeListLength === 0)\n {\n var span = document.createElement(\"SPAN\");\n var span2 = document.createElement(\"SPAN\");\n var lineBreak = document.createElement(\"BR\");\n\n var button = document.createElement(\"BUTTON\");\n button.innerHTML = tag;\n button.classList.add(\"btn\");\n button.classList.add(\"btn-info\");\n button.classList.add(\"tagEnabled\");\n button.classList.add(tag);\n\n tagsContainer.append(span);\n span.append(span2);\n span2.append(button);\n span2.append(lineBreak);\n }\n}",
"title": ""
},
{
"docid": "6db5dccd9000374931bae0942e1427b1",
"score": "0.57490546",
"text": "function linebreak(){\n\treturn document.createElement(\"br\");\n}",
"title": ""
},
{
"docid": "920630a641ec01744a2f6edbe04795dc",
"score": "0.56603175",
"text": "function pushTextNode(list, html, level, start, ignoreWhitespace) {\n\t // calculate correct end of the content slice in case there's\n\t // no tag after the text node.\n\t var end = html.indexOf('<', start);\n\t var content = html.slice(start, end === -1 ? undefined : end);\n\t // if a node is nothing but whitespace, collapse it as the spec states:\n\t // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n\t if (/^\\s*$/.test(content)) {\n\t content = ' ';\n\t }\n\t // don't add whitespace-only text nodes if they would be trailing text nodes\n\t // or if they would be leading whitespace-only text nodes:\n\t // * end > -1 indicates this is not a trailing text node\n\t // * leading node is when level is -1 and list has length 0\n\t if ((!ignoreWhitespace && end > -1 && level + list.length >= 0) || content !== ' ') {\n\t list.push({\n\t type: 'text',\n\t content: content\n\t });\n\t }\n\t}",
"title": ""
},
{
"docid": "9f43d5417e4557b529657206c8053c54",
"score": "0.5655165",
"text": "function elTextBreakForEach(parent, text) {\n const textArr = text.split('\\n');\n textArr.forEach((elem) => {\n const elTag = document.createElement('p');\n elTag.appendChild(document.createTextNode(elem));\n parent.appendChild(elTag);\n });\n}",
"title": ""
},
{
"docid": "a7c3b888b03adc9db54ac393ca3e60df",
"score": "0.5655039",
"text": "lineBreak(arg1) {\n /** Create new element */\n const lineBreak = new strapped.LineBreak();\n \n /** Add to last container of indicated type */\n if ( typeof arg1 == 'string' && arg1.length > 0 )\n this.last(arg1).append(lineBreak);\n else if ( this.last('Col') )\n this.last('Col').append(lineBreak);\n else\n this.last('Body').append(lineBreak);\n \n /** Allow for call chaining */\n return lineBreak;\n }",
"title": ""
},
{
"docid": "26e53fe6acd79ce1f174e573846931e2",
"score": "0.5653778",
"text": "function add_pre(content) {\n add_html(`<div class=\"pre\">${content}</div>`);\n}",
"title": ""
},
{
"docid": "2db120b3d8a002b13d259bd2097698eb",
"score": "0.56328225",
"text": "function do_insertTag(tag, value){\r\n vB_textarea.init();\r\n vB_textarea.wrapValue(tag, (value ? value :null) ); // phpBB no need this: (isNaN(value)?'\"':'')\r\n}",
"title": ""
},
{
"docid": "8b8cf78b915203a4f6e7b73427140d1b",
"score": "0.5627666",
"text": "function addLine() {\n\tbefore = findCurrentText();\n\tvar currentTime = $('#media video')[0].currentTime;\n\tdata = {'time':currentTime,'text':''};\n\t$(before).parent().after($(\"#lineTemplate\").tmpl(data));\n\tfindCurrentText();\n} // addLine",
"title": ""
},
{
"docid": "1b4a10fc41decbb9671ee0e17b2767d4",
"score": "0.56081635",
"text": "function addpara() {\n\tvar ptags = document.createElement(\"P\");\n\tvar text = document.createTextNode(\"and then... \");\n\tptags.appendChild(text);\n\tdocument.body.appendChild(ptags);\n}",
"title": ""
},
{
"docid": "6b2f03f910a13f4f2c2a3a63d9c69181",
"score": "0.55994093",
"text": "function pushTextNode(list, html, level, start, ignoreWhitespace) {\n // calculate correct end of the content slice in case there's\n // no tag after the text node.\n var end = html.indexOf('<', start);\n var content = html.slice(start, end === -1 ? undefined : end); // if a node is nothing but whitespace, collapse it as the spec states:\n // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n\n if (/^\\s*$/.test(content)) {\n content = ' ';\n } // don't add whitespace-only text nodes if they would be trailing text nodes\n // or if they would be leading whitespace-only text nodes:\n // * end > -1 indicates this is not a trailing text node\n // * leading node is when level is -1 and list has length 0\n\n\n if (!ignoreWhitespace && end > -1 && level + list.length >= 0 || content !== ' ') {\n list.push({\n type: 'text',\n content: content\n });\n }\n}",
"title": ""
},
{
"docid": "d2990db381f42a4acfe889b6dd2c38e9",
"score": "0.5587996",
"text": "function addInfoToDiv(div,info,nobrk){\r\n info.map(e =>{\r\n div.appendChild(createTextNode(`${e[0]} ${e[1]}`));\r\n div.appendChild(createNode(\"br\"));\r\n });\r\n return div;\r\n}",
"title": ""
},
{
"docid": "e92c76f79cd141a23886c093970482bc",
"score": "0.55782384",
"text": "function addHtmlTags(open, close) {\r\n\tvar openTag = open;\r\n\tvar closeTag = close;\r\n\tvar el = $('#post')[0];\r\n\tvar selectedText = getInputSelection(el);\r\n\tvar start = selectedText.start;\r\n\tvar end = selectedText.end;\r\n\tvar content = $('.postContent');\r\n\tvar contentVal = content.val();\r\n\tvar stringFirst = contentVal.slice(0, start);\r\n\tvar stringSelect = contentVal.slice(start, end);\r\n\tvar stringLast = contentVal.slice(end, contentVal.length);\r\n\tcontent.val(stringFirst + openTag + stringSelect + closeTag + stringLast)\r\n\treturn false;\r\n}",
"title": ""
},
{
"docid": "61b1e7aace18c7182a79e0227972c72a",
"score": "0.5570399",
"text": "function createTags(a){var b,c,d,e=this;e.key=a.key||\"\",e.keyAsVal=a.keyAsVal,\n//_t.text = ob.text.toLowerCase();\ne.text=a.text.replace(/\\\\/g,\"\"),e.contId=a.contId,e.sugElm=a.suggestorNode,e.deleteIcon=a.deleteIcon!==!1||a.deleteIcon,e.tagType=a.tagType||\"li\",e.onClick=a.onClick||function(){},e.onCreate=a.onCreate||function(){},e.onDelete=a.onDelete||function(){},e.placeTagEnd=a.placeTagEnd||!1,e.retainText=a.retainText||!1,e.hiddenAttr=a.hiddenAttr||!1;var f,g=e.text.replace(/\\s/g,\"-\").replace(/\\_/g,\"|xudrScrx|\").toLowerCase();b=e.deleteIcon?'<a class=\"dCross\" href=\"javascript:void(0)\"></a>':\"\",d=e.hiddenAttr?\"data-hidden='\"+e.hiddenAttr+\"'\":\"\",\"a\"==e.tagType?(c='href=\"javascript:void(0)\"',f=$('<li class=\"tagit\" data-id='+e.key+\"_\"+g+\"><\"+e.tagType+\" \"+c+' class=\"tagTxt\">'+e.text+\"</span>\"+b+\"</\"+e.tagType+\">\")):f=$(\"<li \"+d+' class=\"tagit\" data-id='+e.key+\"_\"+g+' > <span class=\"tagTxt\">'+e.text+\"</span>\"+b+\"</li>\"),f.on(\"click\",function(){e.onClick(f)}).children(\".dCross\").on(\"click\",function(){e.onDelete(f)}),e.container=e.contId,e.hdElm=a.hiddenTag||e.container.children(\"input\"),\n//_t.hdElm \t\t= _t.container.children('input');\ne.setValue(e.keyAsVal?e.key:e.text,f),// set value in hidden field\ne.bindEvent_cross(f)}",
"title": ""
},
{
"docid": "6d19d481838b774e089d2a0cff1efb86",
"score": "0.5570369",
"text": "function addWhiteSpace()\n \t\t{\n\t \t\ttinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, '');\n \t\t}",
"title": ""
},
{
"docid": "89120af7c8a6934bde9adf8e4b42d765",
"score": "0.55672264",
"text": "function setHTML(obj, lines) {\n\t\tvar str = \"\", arr = obj.split(\"\\n\");\n\t\tfor(var i = 0; i < lines; i++) {\n\t\t\tstr += arr[i] + \"<br>\";\n\t\t}\n\t\treturn str;\n\t}",
"title": ""
},
{
"docid": "8f18c36cc201fd59e63410ee756d51cc",
"score": "0.5562569",
"text": "function wrapTags(message) { \n return message.split(\" \").map((str)=>{\n return str[0] === '#' ? `<div class=\"tag\">${str}</div>` : str; \n }).join(\" \");\n }",
"title": ""
},
{
"docid": "3f0180f6050d0a87d3e6ba3ea4b6e3df",
"score": "0.5561773",
"text": "function insertTag(startTag, endTag, tag, tagType) {\n\tvar field = document.getElementById(tag);\n\tvar scroll = field.scrollTop;\n\tfield.focus();\n\n\tif (window.ActiveXObject) { // C'est IE\n\t\tvar textRange = document.selection.createRange(); \n\t\tvar currentSelection = textRange.text;\n\n\t\ttextRange.text = startTag + currentSelection + endTag;\n\t\ttextRange.moveStart(\"character\", -endTag.length - currentSelection.length);\n\t\ttextRange.moveEnd(\"character\", -endTag.length);\n\t\ttextRange.select(); \n\t} else { // c'est pas IE.\n\t\tvar startSelection = field.value.substring(0, field.selectionStart);\n\t\tvar currentSelection = field.value.substring(field.selectionStart, field.selectionEnd);\n\t\tvar endSelection = field.value.substring(field.selectionEnd);\n\t\tif (currentSelection == \"\") { currentSelection = \"TEXTE\"; }\n\t\tfield.value = startSelection + startTag + currentSelection + endTag + endSelection;\n\t\tfield.focus();\n\t\tfield.setSelectionRange(startSelection.length + startTag.length, startSelection.length + startTag.length + currentSelection.length);\n\t}\n\tfield.scrollTop = scroll;\n}",
"title": ""
},
{
"docid": "036bdcdcd6d98d04129e54fdfb759549",
"score": "0.55517244",
"text": "function addTagLabel(group, type) {\n if (!isTagPresent(group) && group) {\n var close = '<a href=\"#\" class=\"remove removeTag\" title=\"remove this item\"><i class=\"remove fa fa-close fa-inverse\"></i></a>';\n var input = '<input type=\"hidden\" value=\"' + group + '\" name=\"tags\" class=\"tags ' + type + '\"/>';\n var label = $('<span class=\"tag label label-default\"/>').append(input + '<span>' + group + '</span> ' + close).after(' ');\n $('#tagsBlock').append(label).append(' ');\n }\n}",
"title": ""
},
{
"docid": "c24070669d0120ceb19354cfb180f529",
"score": "0.55443674",
"text": "createTags() {\n const tagsData = this.getTagsData();\n const tagsElement = this.getAllTagsLinks(tagsData, this.category);\n\n tagsElement.map((element) => {\n this.parentElement.append(element);\n });\n }",
"title": ""
},
{
"docid": "89aba673253a3d7e6ead7202cd398c70",
"score": "0.554111",
"text": "parseHtml(el, html) {\n el.insertAdjacentHTML('afterbegin', html.trim());\n }",
"title": ""
},
{
"docid": "991b3cfd21f54ee81dd011e45e0ca874",
"score": "0.5522077",
"text": "function makeSpans() {\n $('.poemLine').each(function(){\n var elements = $(this).text().split('');\n $(this).text('');\n var line = $('<span class=\"line col-md-11\">');\n $(this).append(line);\n for (var i = 0; i < elements.length; i++) {\n if (elements[i-1] === ' ' || i === 0){\n var syllable=$('<span class=syllable>')\n var word = $('<span class=word>');\n $(word).append(syllable);\n $(line).append(word);\n }\n if (elements[i] === ' '){\n $(line).append('<span class=space>' + elements[i] + '</span>');\n } \n else{\n $(syllable).append('<span class=letter>' + elements[i] + '</span>');\n }\n if (i == elements.length - 1){\n //make linebreak space wide enough to prepend breaks to\n //only works if no spaces at end of line already!\n var linebreak = $('<span class=space > </span>');\n linebreak.css('padding-left', '1px');\n $(line).append(linebreak);\n }\n }\n var lineCount = $('<span class=lineCount style=\"color:blue; font-weight:bold\">');\n $(this).append(lineCount);\n });\n \n }",
"title": ""
},
{
"docid": "72f6804a2e1d1bb75d633fa920349f37",
"score": "0.5520797",
"text": "function pushTextNode(list, html, level, start, ignoreWhitespace) {\n // calculate correct end of the content slice in case there's\n // no tag after the text node.\n var end = html.indexOf('<', start);\n var content = html.slice(start, end === -1 ? undefined : end);\n // if a node is nothing but whitespace, collapse it as the spec states:\n // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n if (/^\\s*$/.test(content)) {\n content = ' ';\n }\n // don't add whitespace-only text nodes if they would be trailing text nodes\n // or if they would be leading whitespace-only text nodes:\n // * end > -1 indicates this is not a trailing text node\n // * leading node is when level is -1 and list has length 0\n if ((!ignoreWhitespace && end > -1 && level + list.length >= 0) || content !== ' ') {\n list.push({\n type: 'text',\n content: content\n });\n }\n}",
"title": ""
},
{
"docid": "7a8b642fc14ae8176682bfecb9433864",
"score": "0.55122596",
"text": "addContent(otherContent)\n\t{\n\t\tthis.contentString += '<hr>'; //Add horizontal line\n\t\tthis.contentString += otherContent;\n\t}",
"title": ""
},
{
"docid": "5e23fad7e01bf1cb59ee38680dc3ed94",
"score": "0.5498344",
"text": "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}",
"title": ""
},
{
"docid": "36b388b9406c7dbec0e120fa7e26bbd0",
"score": "0.5490157",
"text": "function placeTagText(text) {\r\n\tvar replacedText = text;\r\n\tvar nbBold = (text.match(/<span style=\"font-weight: bold;\">/g) || []).length\r\n\tvar nbUnderline = (text.match(/<span style=\"text-decoration: underline;\">/g) || []).length;\r\n\tfor (i = 0; i < nbBold; ++i) {\r\n\t\treplacedText = replacedText.replace('<span style=\"font-weight: bold;\">', \"**\");\r\n\t\treplacedText = replacedText.replace(\"</span>\", \"**\");\r\n\t}\r\n\tfor (i = 0; i < nbUnderline; ++i) {\r\n\t\treplacedText = replacedText.replace('<span style=\"text-decoration: underline;\">', \"__\");\r\n\t\treplacedText = replacedText.replace(\"</span>\", \"__\");\r\n\t}\r\n\treturn replacedText;\r\n}",
"title": ""
},
{
"docid": "f392c7c185ba525915d7aac10b05a338",
"score": "0.5486685",
"text": "function appendText(textArray, elm) {\r\n\t\t\t\tfor (i = 0, l = textArray.length; i < l; i += 1) {\r\n\t\t\t\t\telm.appendChild(textArray[i]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Append line break after element.\r\n\t\t\t\t\telm.appendChild(document.createElement('br'));\r\n\t\t\t\t}\r\n\t\t\t}",
"title": ""
},
{
"docid": "8c264dece20bf6af19ae0469e137bfc5",
"score": "0.54832333",
"text": "function newLine(){\n return document.createElement(\"br\");\n}",
"title": ""
},
{
"docid": "c669f3652538f24488b7d74d60cabc3e",
"score": "0.54457617",
"text": "function newLine(){\n\t\tchars.push([]);\n\t\tif(cury == maxy){\n\t\t\tchars.shift();\n\t\t}\n\t\tvar elNewLine = document.createElement(\"span\");\n\t\tfor(var j = 0; j < maxx; j++){\n\t\t\tvar newch = \n\t\t\t\tdocument.createElement(\"span\");\n\t\t\tnewch.textContent = \"\";\n\t\t\tchars[chars.length-1].push(newch);\n\t\t\telNewLine.appendChild(newch);\n\t\t}\n\t\tvar oldcurx = curx, oldcury = cury;\n\t\tcury = chars.length-1;\n\t\tcurx = 0;\n\t\tputStr(\" \");\n\t\tcurx = oldcurx;\n\t\tcury = oldcury;\n\t\tif(cury == maxy){\n\t\t\telTerm.removeChild(elTerm.firstChild);\n\t\t\telTerm.removeChild(elTerm.firstChild);\n\t\t}\n\t\telTerm.appendChild(elNewLine);\n\t\telTerm.appendChild(document.createElement(\"br\"));\n\t}",
"title": ""
},
{
"docid": "ceafc8dc7727f7015bae27849f85d4de",
"score": "0.54387116",
"text": "function addTag(tagsFile, fileName, tag) {\n var fileReader = new java.io.FileReader(tagsFile);\n var bufferedReader = new java.io.BufferedReader(fileReader);\n var line = bufferedReader.readLine();\n var lines = [];\n while (line != null) {\n if (line.search(fileName) == -1) {\n lines.push(line);\n }\n line = bufferedReader.readLine();\n }\n fileReader.close();\n bufferedReader.close();\n lines.push(tag);\n var fileWriter = new java.io.FileWriter(tagsFile);\n var bufferedWriter = new java.io.BufferedWriter(fileWriter);\n for (var i = 0; i < lines.length; i++) {\n bufferedWriter.write(lines[i]);\n bufferedWriter.newLine();\n }\n bufferedWriter.flush();\n bufferedWriter.close();\n}",
"title": ""
},
{
"docid": "f94612b86f83abe28433556eb7f110a1",
"score": "0.54357445",
"text": "function ms_addTags(tags,type,text,box) {\n switch (type) {\n // Bold, italic & underline..\n case 'bold':\n case 'italic':\n case 'underline':\n ms_insertAtCursor(box,tags);\n break;\n // Other..\n case 'url':\n case 'img':\n case 'email':\n case 'youtube':\n case 'vimeo':\n alertify.prompt(text,function (e,str) {\n if (str!='' && str!='http://' && str!=null && str!=' ') {\n ms_insertAtCursor(box,'['+type+']'+str+'[/'+type+']');\n }\n\t},(type=='img' || type=='url' ? 'http://' : (type=='email' ? 'email@example.com' : ''))); \n break;\n }\n}",
"title": ""
},
{
"docid": "8341431981b38fffd06a89184a876c1d",
"score": "0.54231936",
"text": "function createItem(x){\r\n let myText = ` ${x} `\r\n myTagline.insertAdjacentText(\"beforeend\", myText)\r\n // adjectiveInput.value = ''\r\n // roleInput.value = ''\r\n // reputationInput.value = ''\r\n // hobbyInput.value = ''\r\n}",
"title": ""
},
{
"docid": "aca37a48389be2a7bd346a2cbd490cef",
"score": "0.54217744",
"text": "createTag(text, type) {\n return DOMTools.parseHTML(`<span class=\"cktag ${type}\">${text}</span>`)\n }",
"title": ""
},
{
"docid": "252c7f3b9f66e43b8d3cd78813249456",
"score": "0.5415463",
"text": "function registertags(){\n // reset the tagresult content.\n var tagresult = $('#tagresult');\n tagresult.val('');\n\t\t// for each tag, add it to the value field.\n $(\".listtags a span\").each(function(i){\n \t// if first do not add a comma\n if(i > 0) {\n tagresult.val( tagresult.val() + ', ');\n }\n tagresult.val( tagresult.val() + $(this).html() );\n });\n }",
"title": ""
},
{
"docid": "55a1b1fb8a6e8a5bbe856612f36787c1",
"score": "0.541299",
"text": "function createNewLine(){\n\t\tthat.newLinePos++;\n\t\tthat.newLine[that.newLinePos] = that.wordStart;\n\t\t\t\n\t\t//Check for a leading space\n\t\tif (msg[i+ 1] == ' '){\n\t\t\tmsg = removeChar(msg, i + 1, 1);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "9ea74ebdf0bec98cafd0be6a74fc2788",
"score": "0.5396821",
"text": "function createTags(input) {\n console.log(input);\n // je split nu met een comma en creert een Array, van een string naar een Array\n // de filter haalt de space eruit\n const tags = input.split(',').filter(tag => tag.trim()!== '').map(tag => tag.trim())\n console.log(tags);\n\n // clear de input\n tagsEl.innerHTML = ''\n\n\n\n // create Tags\n tags.forEach(tag => {\n const tagEl = document.createElement('span')\n tagEl.classList.add('tag')\n tagEl.innerText = tag\n // je maakt het vast aan de div.tag\n tagsEl.appendChild(tagEl)\n })\n}",
"title": ""
},
{
"docid": "85cf8ac1d8e94836ce8867c4b9f0e234",
"score": "0.53945005",
"text": "function appendRaw(tag, innertxt, parentnode, rowspan){\n let r = document.createElement(tag);\n if(rowspan != undefined){\n r.setAttribute('rowspan', rowspan);\n }\n let txt = document.createTextNode(innertxt);\n r.appendChild(txt);\n parentnode.appendChild(r);\n}",
"title": ""
},
{
"docid": "ca4d21baada0f02712de0a706f6abf3c",
"score": "0.5383024",
"text": "addLine(newLine) {\n this.script.push(newLine);\n }",
"title": ""
},
{
"docid": "121901b55d14665375fb2b74f42b350c",
"score": "0.53795975",
"text": "function boxDecorationBreak(el) {\n\tconst $el = $(el);\n\tconst $parent = $el.parent();\n\tconst strings = $(el).html().split('<br>');\n\n\t$el.remove();\n\n\t$.each(strings, (i, string) => {\n\t\t// Remove breaks\n\t\tstring = string.replace(/\\n/, '');\n\t\t$parent.append($('<span>').text(string));\n\n\t\t// Readd the <br> tags\n\t\tif (i < strings.length -1) {\n\t\t\t$parent.append('<br>');\n\t\t}\n\t});\n\n}",
"title": ""
},
{
"docid": "eaf5752ffe29b5297d39d329c4160680",
"score": "0.5378624",
"text": "function addHTag(item, property){\n let insert = $(\"<h4>\" + property + item + \"</h4><br>\");\n if(item !== undefined) $(\"#postHldr\").append(insert);\n \n }",
"title": ""
},
{
"docid": "67997342e7c24c8d96d4320b3bf0d036",
"score": "0.53731257",
"text": "function insertBr() {\r\n\t\t\t\tvar brElm, extraBr;\r\n\r\n\t\t\t\tif (container && container.nodeType == 3 && offset >= container.nodeValue.length) {\r\n\t\t\t\t\t// Insert extra BR element at the end block elements\r\n\t\t\t\t\tif (!tinymce.isIE && !hasRightSideBr()) {\r\n\t\t\t\t\t\tbrElm = dom.create('br');\r\n\t\t\t\t\t\trng.insertNode(brElm);\r\n\t\t\t\t\t\trng.setStartAfter(brElm);\r\n\t\t\t\t\t\trng.setEndAfter(brElm);\r\n\t\t\t\t\t\textraBr = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbrElm = dom.create('br');\r\n\t\t\t\trng.insertNode(brElm);\r\n\r\n\t\t\t\t// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \\n before it\r\n\t\t\t\tif (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {\r\n\t\t\t\t\tbrElm.parentNode.insertBefore(dom.doc.createTextNode('\\r'), brElm);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!extraBr) {\r\n\t\t\t\t\trng.setStartAfter(brElm);\r\n\t\t\t\t\trng.setEndAfter(brElm);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trng.setStartBefore(brElm);\r\n\t\t\t\t\trng.setEndBefore(brElm);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tselection.setRng(rng);\r\n\t\t\t\tundoManager.add();\r\n\t\t\t}",
"title": ""
},
{
"docid": "d7aab694567f74ac4745266d1f1f1362",
"score": "0.5370815",
"text": "function sendNewTags(tags) {\n $.each(tagsArr, function(index, element) {\n var index = tags.indexOf(element);\n if (index != -1) {\n tags = tags.substring(0, index) + tags.substring(index + element.length + 1);\n }\n });\n\n if (tags.charAt(tags.length - 1) == \" \") {\n tags = tags.slice(0, -1);\n }\n\n if (tags.match('/\\S/g')) {\n $.each(tags.split(\" \"), function(index, element) {\n tagsArr.push(element);\n });\n ajax_addTags(tags);\n displayTags();\n }\n}",
"title": ""
},
{
"docid": "18909d37509db2ef988b2fad3f6c8d30",
"score": "0.5365214",
"text": "function addNewTag(pillInput) {\n\t\tvar targetEl = $(pillInput).children().last();\n\t\tif ($(targetEl).hasClass('add')) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar addTagMarkup = '<div class=\"altered-pill add\"><span>+</span>Add Tag <input class=\"remove\" type=\"text\" placeholder=\"Add Tag\"></div>';\n\t\t\t$(pillInput).append(addTagMarkup);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "18909d37509db2ef988b2fad3f6c8d30",
"score": "0.5365214",
"text": "function addNewTag(pillInput) {\n\t\tvar targetEl = $(pillInput).children().last();\n\t\tif ($(targetEl).hasClass('add')) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar addTagMarkup = '<div class=\"altered-pill add\"><span>+</span>Add Tag <input class=\"remove\" type=\"text\" placeholder=\"Add Tag\"></div>';\n\t\t\t$(pillInput).append(addTagMarkup);\n\t\t}\n\t}",
"title": ""
},
{
"docid": "0a8fe1e12a58ee1c77eb9b5396be3d1b",
"score": "0.5363375",
"text": "addDelimiter(type, from, to, open, close) {\n return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Open */ : 0) | (close ? 2 /* Close */ : 0)));\n }",
"title": ""
},
{
"docid": "021e7bb22c95473ba0f12db659f4fcbe",
"score": "0.53551376",
"text": "function createInnerHtmlForNewTags(divElement){\r\n // Calculate old and current tags\r\n var oldTagArray = createTagArray(divElement, true);\r\n var newTagArray = createTagArray(divElement, false);\r\n\r\n // _log(\"old tags: \" + oldTagArray);\r\n // _log(\"new tags: \" + newTagArray);\r\n\r\n // create a unique sorted list with all - old and new - tags\r\n var uniqueArray = oldTagArray.concat(newTagArray).filter(onlyUnique).sort(compareStringIgnoreCase);\r\n\r\n var result = \"\";\r\n for(i =0; i < uniqueArray.length; i++) {\r\n tagString = uniqueArray[i];\r\n\r\n if (result.length > 0) {\r\n result += \", \";\r\n }\r\n\r\n var isOld = includes(oldTagArray, tagString);\r\n var isNew = includes(newTagArray, tagString);\r\n\r\n var isDeleted = isOld && !isNew;\r\n var isAdded = isNew && !isOld;\r\n\r\n if (isAdded) {\r\n result += \"<span class=\\\"merge-added\\\">\";\r\n } else if (isDeleted) {\r\n result += \"<span class=\\\"merge-deleted\\\">\";\r\n }\r\n\r\n result += tagString;\r\n\r\n if (isAdded || isDeleted) {\r\n result += \"</span class>\";\r\n }\r\n }\r\n return result;\r\n}",
"title": ""
},
{
"docid": "e2d2faa4a4b6a4af84ce4e5561ed723c",
"score": "0.5351947",
"text": "function addNewLine(size = 40) {\n gMeme.lines.push({\n txt: 'Put your text here',\n size,\n font: 'Impact',\n align: 'middle',\n color: 'white',\n strokeColor: 'black',\n isUnderline: false,\n isBold: false,\n isSticker: false,\n });\n\n gMeme.selectedLineIdx++;\n}",
"title": ""
},
{
"docid": "60f167122231e328ec73c5043652ea2b",
"score": "0.5343168",
"text": "function pad(nodes) {\n\t\t\tconst tail = nodes[nodes.length - 1];\n\n\t\t\tif (typeof tail === 'string' && tail.charAt(tail.length - 1) === '\\n') {\n\t\t\t\tnodes.push(h('br', { key: 'break' }));\n\t\t\t}\n\n\t\t\treturn nodes;\n\t\t}",
"title": ""
},
{
"docid": "79f08090a4a6dc5f6cb0fed02cecdea7",
"score": "0.5333838",
"text": "function createTags(input) {\n // filter blank spaces and multiple comma\n const tags = input\n .split(',')\n .filter((tag) => tag.trim() !== '')\n .map((tag) => tag.trim());\n\n tagsEl.innerHTML = '';\n tags.forEach((tag) => {\n const tagEl = document.createElement('span');\n tagEl.classList.add('tag');\n tagEl.innerText = tag;\n tagsEl.appendChild(tagEl);\n });\n}",
"title": ""
},
{
"docid": "f385989d819f416a350dce33804dc85b",
"score": "0.5333123",
"text": "function nl()\n{ _outputBuffer += ('<br />');\n}",
"title": ""
},
{
"docid": "ad7c36489933d59291af88d0e43b3825",
"score": "0.5314789",
"text": "function addBR( node ) {\n\tnode.appendChild( document.createElement( 'br' ));\n\tnode.appendChild( document.createElement( 'br' ));\n}",
"title": ""
},
{
"docid": "08711cac0093a300dba568781b2a6837",
"score": "0.5312815",
"text": "function createTag(value, index){\n\t\t\tvar tagsMarkup = '<span id=\"tag_'+index+'\" class=\"tag\">'+value+'  <a id=\"close_'+index+'\" href=\"#\" title=\"remove tag\">x</a></span>';\n\t\t\t\t$(tagsMarkup).insertBefore('#add_tag');\t\t\t\t\n\t\t\t\t\t$('#close_'+index).click(function(){\n\t\t\t\t\t\t$('#tag_'+index).remove();\n\t\t\t\t\t});\n\t\t}",
"title": ""
},
{
"docid": "579bec92cbffc7f24c94c09ac4ef3304",
"score": "0.5305785",
"text": "function tag() {\n let ele = document.createElement(arguments[0]);\n if (arguments.length > 1 && arguments[1]) {\n for (let a in arguments[1]) { ele.setAttribute(a, arguments[1][a]); }\n }\n if (arguments.length > 2) {\n for (let i = 2; i < arguments.length; i++) {\n if (typeof arguments[i] === \"string\") {\n ele.insertAdjacentText('beforeend', arguments[i]);\n } else {\n ele.insertAdjacentElement('beforeend', arguments[i]);\n }\n }\n }\n return ele;\n }",
"title": ""
},
{
"docid": "a30eaf707bda489740528813516fc5f0",
"score": "0.5299384",
"text": "addText(text) {\n if (!text) return;\n const nodes = this.top().content;\n const last = nodes[nodes.length - 1];\n const node = this.schema.text(text, this.marks);\n let merged;\n\n if (last && (merged = maybeMerge(last, node))) {\n nodes[nodes.length - 1] = merged;\n } else {\n nodes.push(node);\n }\n }",
"title": ""
},
{
"docid": "3b404934fc6d6edf3df5b5995506c02d",
"score": "0.52814627",
"text": "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }",
"title": ""
},
{
"docid": "3b404934fc6d6edf3df5b5995506c02d",
"score": "0.52814627",
"text": "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }",
"title": ""
},
{
"docid": "3b404934fc6d6edf3df5b5995506c02d",
"score": "0.52814627",
"text": "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }",
"title": ""
},
{
"docid": "3b404934fc6d6edf3df5b5995506c02d",
"score": "0.52814627",
"text": "valueReformattedForMultilines(value) {\n if (typeof(value)==\"string\") return(value.replace(/\\n/ig,\"<br/>\"));\n else return(value);\n }",
"title": ""
},
{
"docid": "0d6e5af767dd855410cac849b913b6ca",
"score": "0.52790666",
"text": "function createLine(data) {\n const line = document.createElement('p')\n const text = document.createTextNode(data)\n line.append(text)\n content.appendChild(line)\n}",
"title": ""
},
{
"docid": "8790e8e0ca404b888e8d75199dbc5745",
"score": "0.52672917",
"text": "function JOSC_insertTags(bbStart, bbEnd) {\r\n var txtarea = document.joomlacommentform.tcomment;\r\n JOSC_scrollToCursor(txtarea, 0);\r\n txtarea.focus();\r\n\r\n if ((JOSC_clientVer >= 4) && JOSC_is_ie && JOSC_is_win) {\r\n theSelection = document.selection.createRange().text;\r\n if (theSelection) {\r\n document.selection.createRange().text = bbStart + theSelection + bbEnd;\r\n theSelection = '';\r\n return;\r\n } else {\r\n JOSC_pasteAtCursor(txtarea, bbStart + bbEnd);\r\n\t}\r\n } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) {\r\n var selLength = txtarea.textLength;\r\n var selStart = txtarea.selectionStart;\r\n var selEnd = txtarea.selectionEnd;\r\n var s1 = (txtarea.value).substring(0,selStart);\r\n var s2 = (txtarea.value).substring(selStart, selEnd)\r\n var s3 = (txtarea.value).substring(selEnd, selLength);\r\n txtarea.value = s1 + bbStart + s2 + bbEnd + s3;\r\n txtarea.selectionStart = selStart + (bbStart.length + s2.length + bbEnd.length);\r\n txtarea.selectionEnd = txtarea.selectionStart;\r\n JOSC_scrollToCursor(txtarea, 1);\r\n return;\r\n } else {\r\n JOSC_pasteAtCursor(txtarea, bbStart + bbEnd);\r\n\tJOSC_scrollToCursor(txtarea, 1);\r\n }\r\n}",
"title": ""
},
{
"docid": "ad595f2df135f81bf95885425d775c91",
"score": "0.5259167",
"text": "function createTags(input) {\n const tagsElement = document.getElementById(\"tags\");\n const tags = input\n .split(\",\")\n .map((word) => word.trim())\n .filter((word) => word.trim() !== \"\");\n tagsElement.innerHTML = \"\";\n generateSpans(tags, \"tag\", tagsElement);\n}",
"title": ""
},
{
"docid": "a90561a4c05cae7878fe0a4c1f960299",
"score": "0.52547663",
"text": "function insertLine(text) {\n const newLine = document.createElement(\"p\");\n newLine.classList.add(\"output\");\n newLine.insertAdjacentHTML(\"afterbegin\", `<span class=\"line\">${text}</span>`);\n myConsole.appendChild(newLine);\n}",
"title": ""
},
{
"docid": "8fb84721ac9572f7ddee07e52d500b44",
"score": "0.52515656",
"text": "addNewLines() {\n }",
"title": ""
},
{
"docid": "31b94567d673169e05b54db756e330d2",
"score": "0.5245722",
"text": "function wrapHTMLTag(text, tagName) {\n\t\treturn '<' + tagName + '>' + text + '</' + tagName + '>';\n\t}",
"title": ""
},
{
"docid": "cb20a0614f529bc4788f240d648ed6aa",
"score": "0.52322733",
"text": "setTexteBraille(texte){\n var noeud = document.createElement(DictionnaireXml.getTagTexteBraille());\n noeud.setAttribute(DictionnaireXml.getAttTexteBraille(), texte);\n this.metadonnees.append(noeud);\n }",
"title": ""
},
{
"docid": "bc1206bffaa7ed840b561e86550ad352",
"score": "0.5230622",
"text": "function insertTag(data, tag) {\n if (data.length > 0) {\n data.unshift(tag);\n }\n}",
"title": ""
},
{
"docid": "4008a5e1d63466508c455f7b7381f09b",
"score": "0.5226511",
"text": "addBoldTags(desc, currentStep, historyStep) {\n return (currentStep === historyStep) ? <b>{desc}</b> : desc\n }",
"title": ""
},
{
"docid": "f65aedf4c51204d01a8a7c252462c3c5",
"score": "0.5224272",
"text": "newLine() {\n this.lines.push('');\n return this;\n }",
"title": ""
},
{
"docid": "f375361c909c2400cebb5ae79956d509",
"score": "0.52172464",
"text": "handleAddTag(cardId, text = '') {}",
"title": ""
}
] |
f3af984e3d2153dac07882acab1d6c98 | Save the configuration to the file. | [
{
"docid": "3158c132e4071297456452a61a8d465b",
"score": "0.68493587",
"text": "function save(configData) {\n\t\n\t// update the file\n\tvar str = JSON.stringify(configData);\n\tfs.writeFile(path.join(__dirname, CONFIG_DIR, _cfgFile), str, function() {\n\t\t//\n\t});\n}",
"title": ""
}
] | [
{
"docid": "3c8dc73f65e3214817a3edffd17480a2",
"score": "0.8244713",
"text": "saveConfig() {\n fs.writeFile(this.configPath, JSON.stringify(this.config), e => {});\n }",
"title": ""
},
{
"docid": "92cdac66f1ed2e3e12aea68b8226cae7",
"score": "0.78192604",
"text": "function save() {\n writeFileSync(__dirname + \"/../config.json\", JSON.stringify(config, null, 4));\n}",
"title": ""
},
{
"docid": "5516845450dedbb4a581907bc71195db",
"score": "0.7711668",
"text": "save() {\n fs.writeFile('./config.json', JSON.stringify(this, null, 4), (err) => {\n if(err)\n console.error(err);\n });\n }",
"title": ""
},
{
"docid": "6aa2b256567bc91e708aa127c34b571f",
"score": "0.73992085",
"text": "function writeConfig() {\n fs.writeFile(configPath, prettyPrintConfig(), function(err) {\n if (err) {\n message.channel.send('There was an error saving the config file!');\n return console.log(err);\n }\n });\n }",
"title": ""
},
{
"docid": "71e01ace8cb436b2ae441616797156d5",
"score": "0.71205527",
"text": "function saveConfigs() {\n var projectConfig = JSON.stringify(self.projectConfig, null, 4);\n fs.writeFileSync(self.projectConfigPath, projectConfig);\n\n var npmConfig = JSON.stringify(self.npmConfig, null, 4);\n fs.writeFileSync(self.npmConfigPath, npmConfig);\n\n var bowerConfig = JSON.stringify(self.bowerConfig, null, 4);\n fs.writeFileSync(self.bowerConfigPath, bowerConfig);\n }",
"title": ""
},
{
"docid": "3dd02f727c6509fce7c15acad6840e61",
"score": "0.70851547",
"text": "function save(loc) {\n fs.writeFile(loc, JSON.stringify(config), (err) => {\n if (err) throw err;\n });\n }",
"title": ""
},
{
"docid": "cf78b4d54a3b2d915b5e0ebacd23e887",
"score": "0.7022883",
"text": "function saveSettings() {\r\n\t\tvar dir = saveOptions.path.match(/(.*)(\\/)/)[1];\r\n\t\tif(!new Folder(dir).exists) {\r\n\t\t\tnew Folder(dir).create();\r\n\t\t}\r\n\t\tvar settingFile = new File(saveOptions.path);\r\n\t\tsettingFile.open('w');\r\n\t\tsettingFile.write(settings.toSource());\r\n\t\tsettingFile.close();\r\n\t}",
"title": ""
},
{
"docid": "8db0a3b803630e9c66100b015a978199",
"score": "0.7017432",
"text": "function saveConfig() {\n\n var path = dialog.showSaveDialog(theWindow, {\n title: \"Save Configuration\",\n defaultPath: \"./Untitled.mcconf\",\n filters: [\n {name: 'Mission Control Saved Configuration', extensions: ['mcconf']},\n {name: 'All Files', extensions: ['*']}\n ]\n });\n if(path == undefined) return; //user canceled operation\n\n var data = {};\n var fileInfo = { fname: path, dataToWrite: data };\n\n /*\n Because of the async nature of the configuration save, there is no\n way to know when all the modules responding to the notification are\n finished processing the data. Thus, each responding module must put the\n data in the shared object, and write it to file.\n */\n theWindow.webContents.send(\"saveConfig\", fileInfo);\n}",
"title": ""
},
{
"docid": "5345b49f11cd546decc22599f18c6bd8",
"score": "0.7014844",
"text": "saveConfig() {\n fs.writeFile(`${CONFIG_DIR}/${this.guildId}.json`, JSON.stringify(this.config), (err) => {\n if (err) {\n console.error(err);\n }\n });\n }",
"title": ""
},
{
"docid": "ce3fc509ad928577b2955c2628b21fef",
"score": "0.6995931",
"text": "save () {\n const backupPath = this._backup();\n\n if (!fse.existsSync(this._configPath)){\n fse.mkdirSync(this._configPath);\n }\n\n try {\n fse.writeJSONSync(this._configPath, this._config);\n fse.removeSync(backupPath);\n\n return true;\n } catch (err) {\n console.log(`Failed to save config file: ${err}`);\n\n return false;\n }\n }",
"title": ""
},
{
"docid": "ca9f948c90857113444b56ad1ec725fa",
"score": "0.69118357",
"text": "function storeConfig(data) {\n // + original by: Spin0us (https://github.com/spin0us)\n fs.writeFile(CONFIGURATION_FILENAME, JSON.stringify(data), function (err) {\n if (err) console.log(err);\n });\n}",
"title": ""
},
{
"docid": "22de2d18616ce0207ed088eab9490117",
"score": "0.682432",
"text": "saveConfig() {\n\t\tfs.writeFile('./PortGroups.json', JSON.stringify(portGroups, [\"beschreibung\", \"quelle\", \"ports\", \"community\", \"ziele\", \"snmpGetIntervalTime\"], 4), 'utf-8', err => {\n\t\t\tif (err)\n\t\t\t\tconsole.error(err);\n\t\t});\n\t}",
"title": ""
},
{
"docid": "2acc790a2319ae84be569b02ff8b1a36",
"score": "0.6818776",
"text": "function saveSettings() {\n fs.writeFileSync(SETTINGS_FILE, settings, SETTINGS_TYPE);\n}",
"title": ""
},
{
"docid": "2900e75ca30c327da03b3e3453af0ca7",
"score": "0.67422336",
"text": "function saveSettings() {\n if(!Folder(SETTINGS.folder).exists) Folder(SETTINGS.folder).create();\n var $file = new File(SETTINGS.folder + SETTINGS.name);\n $file.encoding = 'UTF-8';\n $file.open('w');\n var pref = {};\n pref.copies = copiesVal.text;\n pref.spacing = spacingVal.text;\n var data = pref.toSource();\n $file.write(data);\n $file.close();\n }",
"title": ""
},
{
"docid": "5da6605a0f79ffbc08ad60a6df86d4e5",
"score": "0.66665035",
"text": "function saveConfigurables() {\n fs.writeFile(\"configurablesreloaded.txt\", JSON.stringify(configurables, null, 4), {encoding: \"utf8\"}, function() {});\n}",
"title": ""
},
{
"docid": "83e88236590a0383134ec936d802c75b",
"score": "0.6619486",
"text": "function saveSettings() {\n if (fileOps.saveFile(FILENAME, settingsList)) {\n t.emitMessage('Successfuly saved current settings to file');\n }\n else {\n t.emitMessage('Error saving settings to file');\n toaster.showToast('Error saving settings to file.')\n }\n}",
"title": ""
},
{
"docid": "fa8ded18382283b9e1f5a7a0b923b86e",
"score": "0.6558043",
"text": "function saveConfig() {\n if ( hasdata ) { // has local data and program settings\n var configFile = \"config.json\";\n storage.storage ( configFile, JSON.stringify(pgmSettings));\n }\n}",
"title": ""
},
{
"docid": "d87327acab1d6797fe7633a3915de2b0",
"score": "0.65389717",
"text": "writeFile() {\n fs.writeFileSync(this.config.file, JSON.stringify(this.results, null, 2))\n }",
"title": ""
},
{
"docid": "2350f19a8a09de9efbd614249f882a1a",
"score": "0.6524473",
"text": "function saveSettings() {\n if(!Folder(SETTINGS.folder).exists) Folder(SETTINGS.folder).create();\n var $file = new File(SETTINGS.folder + SETTINGS.name);\n $file.encoding = 'UTF-8';\n $file.open('w');\n var pref = {};\n pref.range = absInp.text;\n pref.isFront = isFront.value;\n pref.isSelAfter = isSelAfter.value;\n var data = pref.toSource();\n $file.write(data);\n $file.close();\n }",
"title": ""
},
{
"docid": "0ac98b602d6a54aa554e542f7843c8d6",
"score": "0.6500251",
"text": "function saveConfigurationToServer() {\n if (userState.configuration) {\n $('.modal').modal('hide'); // close all opened popups\n var xmlText = exports.getXmlOfConfiguration(BRICKLY.getBricklyWorkspace());\n CONFIGURATION.saveConfigurationToServer(userState.configuration, xmlText, function(result) {\n if (result.rc === 'ok') {\n userState.configurationSaved = true;\n $('#menuSaveConfig').parent().addClass('disabled');\n BRICKLY.getBricklyWorkspace().robControls.disable('saveProgram');\n LOG.info('save brick configuration ' + userState.configuration);\n }\n MSG.displayInformation(result, \"MESSAGE_EDIT_SAVE_CONFIGURATION\", result.message, userState.configuration);\n });\n }\n }",
"title": ""
},
{
"docid": "b3f2ac77b1b6d54876bedde925fbb60a",
"score": "0.6435363",
"text": "async saveConfig(file, config) {\n let content = await readFileAsync(file, 'utf8');\n let doc = YAML.parseDocument(content);\n let configs = doc.get('configs');\n if (! configs) {\n configs = doc.createNode({});\n doc.set('configs', configs);\n }\n let mmConfig = Object.assign({}, config);\n delete mmConfig.server;\n configs.set('multimeter', mmConfig);\n await writeFileAsync(file, doc.toString());\n }",
"title": ""
},
{
"docid": "273f8c020a9279201f4cfa36e14f84af",
"score": "0.6425269",
"text": "function saveSettings() {\n require(\"Storage\").writeJSON(\"vernierrespirate.json\", settings);\n}",
"title": ""
},
{
"docid": "a5de56a5f9138f3873b5f18698fb9851",
"score": "0.6419272",
"text": "function saveConfig() {\n\t\t// Set settings\n\t\tlocalStorage.setItem(\"frameAddress\", frameAddress);\n\t}",
"title": ""
},
{
"docid": "4cb77764a4f4dd21cbbcf7ca58034493",
"score": "0.63852054",
"text": "function saveSettings() {\r\n\t\tif (!parseSettings())\r\n\t\t\treturn;\r\n\t\t\r\n\t\twriteDataFile();\r\n\t\tsetDps();\r\n\t\tshowMainForm();\r\n\t}",
"title": ""
},
{
"docid": "bf2cc95f8a54c788a66398ec4367839f",
"score": "0.6371476",
"text": "save(filePath) {\r\n node_core_library_1.FileSystem.writeFile(filePath, this.serialize());\r\n }",
"title": ""
},
{
"docid": "12c1ed3cd891c0e0e9971cba628d328a",
"score": "0.63628256",
"text": "function writeConfiguration ( fpath ) {\n\n var confObj = {};\n if (desktop) confObj['Desktop'] = desktop;\n if (fe_server) confObj['FrontEnd'] = fe_server;\n if (nc_servers) confObj['NumberCrunchers'] = nc_servers;\n if (emailer) confObj['Emailer'] = emailer;\n\n if (utils.writeObject(fpath,confObj))\n log.standard ( 3,'configuration written to ' + fpath );\n else log.error ( 4,'error writing to ' + fpath );\n\n}",
"title": ""
},
{
"docid": "624bebf2b1bc4f08a528a6bd8e5c3946",
"score": "0.6333381",
"text": "save() {\n fs.outputFileSync(\n this.getAbsoluteFilePath(),\n this.content\n );\n }",
"title": ""
},
{
"docid": "e863bc449fd74946cad183d1c95454ac",
"score": "0.6292822",
"text": "function saveSettings() {\n fileUtils.saveSettings(g_settings);\n}",
"title": ""
},
{
"docid": "a8a08c7d501b6a2042a12d58a231405c",
"score": "0.6279834",
"text": "function saveConfiguration( updatedConfig ) {\n debug && console.log( \"Config.saveConfiguration: Saving updated configuration\" );\n JSONData.saveJSON( \"configuration\", updatedConfig, true );\n }",
"title": ""
},
{
"docid": "982ca9362bb136c4666d2406f397ae03",
"score": "0.6261993",
"text": "function saveAsConfigurationToServer() {\n $formSingleModal.validate();\n if ($formSingleModal.valid()) {\n var confName = $('#singleModalInput').val().trim();\n var xmlText = exports.getXmlOfConfiguration(BRICKLY.getBricklyWorkspace());\n CONFIGURATION.saveAsConfigurationToServer(confName, xmlText, function(result) {\n if (result.rc === 'ok') {\n setConfiguration(confName);\n $('.modal').modal('hide'); // close all opened popups\n LOG.info('save brick configuration ' + userState.configuration);\n }\n MSG.displayInformation(result, \"MESSAGE_EDIT_SAVE_CONFIGURATION_AS\", result.message, userState.configuration);\n });\n }\n }",
"title": ""
},
{
"docid": "e5f0061751c454437a12275e2a9df284",
"score": "0.62597674",
"text": "saveSettings(){\r\n if(!_fs.existsSync(this.appFolder)){\r\n _fs.mkdirSync(this.appFolder, {recursive: true});\r\n }\r\n _fs.writeFileSync(this.settingsPath, JSON.stringify(this.GlobalSettings, null, '\\t'));\r\n }",
"title": ""
},
{
"docid": "432b60b106ca536f825e335557d96d47",
"score": "0.6189351",
"text": "save(_filename) {\n var self = this;\n this.updated = new Date();\n function replacer(key, value) {\n if (key.endsWith('_timeout')) return undefined; // these keys are internal timers that we dont want to save\n if (key == 'commandResponses') return undefined;\n if (key == 'bound_to') return undefined;\n if (key == 'world') return undefined;\n if (key == 'guild') return undefined;\n if (key == 'keepQueue') return undefined;\n if (key == 'switchQueue') return undefined;\n if (key == 'twitch') return undefined;\n if (key == 'connection') return undefined;\n if (key == 'player') return undefined;\n else return value;\n }\n\n if (!_filename) _filename = paths.config + '/' + self.server_id + '.server';\n fs.writeFileSync(_filename, JSON.stringify(self, replacer), 'utf-8');\n }",
"title": ""
},
{
"docid": "f663bea9496ac1cf3119104fbe5ab395",
"score": "0.6174146",
"text": "function saveSettings(newSettings){\n fs.writeFile(settingsFile, JSON.stringify(newSettings), function(err){\n if(err) console.log(\"err in saveSettings: \"+err);\n else console.log(\"saved settings file!\");\n });\n}",
"title": ""
},
{
"docid": "e05d0713ae55f152f8c97990b6e68782",
"score": "0.6140334",
"text": "function saveChartConfiguration(){\n\t\tvar idplot = document.getElementById(CONST_ID_PLOT).value;\n\t\tvar id = '';\n\t\tif(idplot != null || idplot != ''){\n\t\t\tid = Number(idplot);\n\t\t}\n\t\tvar chart_configuration = getJsonWithValuesOfChart(id);\n\t\tonSaveChartConfiguration(chart_configuration, callbackfunctionOnSave);\n\t}",
"title": ""
},
{
"docid": "26c5fc0b775b233c044bfd327e973ff0",
"score": "0.61399996",
"text": "function saveAsConfigurationToServer() {\n var confName = $('#configurationNameSave').val();\n if (!confName.match(/^[a-zA-Z][a-zA-Z0-9]*$/)) {\n displayMessage(\"MESSAGE_INVALID_NAME\", \"POPUP\", \"\");\n return;\n }\n setConfiguration(confName);\n $('#menuSaveConfig').parent().removeClass('login');\n $('#menuSaveConfig').parent().removeClass('disabled');\n document.getElementById('bricklyFrame').contentWindow.Blockly.getMainWorkspace().saveButton.enable();\n if (userState.configuration) {\n userState.configurationSaved = true;\n $('.modal').modal('hide'); // close all opened popups\n var xml_text = document.getElementById('bricklyFrame').contentWindow.getXmlOfConfiguration(userState.configuration);\n LOG.info('save brick configuration ' + userState.configuration);\n COMM.json(\"/conf\", {\n \"cmd\" : \"saveAsC\",\n \"name\" : userState.configuration,\n \"configuration\" : xml_text\n }, function(result) {\n if (result.rc === 'ok') {\n userState.configurationModified = false;\n displayMessage(\"MESSAGE_EDIT_SAVE_CONFIGURATION_AS\", \"TOAST\", userState.configuration);\n } else {\n displayMessage(result.message, \"POPUP\", \"\");\n }\n });\n }\n}",
"title": ""
},
{
"docid": "2a738860b269ce1602085a91ee758d33",
"score": "0.6134245",
"text": "function saveConfig() {\n let dirname = path.dirname(CONF_FILE);\n let current = {};\n for (let cm of configuredControllers) {\n // Log( cm.getInfo() );\n if (cm == globalController) continue;\n\n // convert to array if another one by this key already exists\n if (cm.moduleName in current) {\n current[cm.moduleName] = [current[cm.moduleName]];\n current[cm.moduleName].push(cm.config);\n } else {\n current[cm.moduleName] = cm.config;\n }\n }\n config.controllers = current;\n\n fs.mkdir(dirname, { recursive: true }, (err) => {\n if (err && err.code != 'EEXIST') {\n Log(`ERROR: Could not save settings to ${CONF_FILE}`);\n Log(err);\n } else {\n fs.writeFile(CONF_FILE, JSON.stringify(config, null, 2), 'utf8', (err) => {\n if (err) Log(err);\n else Log(`SUCCESS: Settings saved to ${CONF_FILE}`);\n });\n }\n });\n}",
"title": ""
},
{
"docid": "f95b6453c6a2c518cc19e3b4feff1176",
"score": "0.61333704",
"text": "function saveSettings() {\r\n fs.writeFile(process.cwd() + \"/settings.json\", JSON.stringify(SETTINGS, null, 4), (err) => {\r\n if (err) {\r\n logError(err);\r\n return false;\r\n };\r\n });\r\n return true;\r\n}",
"title": ""
},
{
"docid": "12d6b0958f5ccc8c3e3cdfbb35a60ffd",
"score": "0.61289877",
"text": "function saveSettings() {\n settings.currentPrinterName = \"DYMO LabelWriter 450 Twin Turbo @ terminal.adventsys.com\";\n //settings.save();\n }",
"title": ""
},
{
"docid": "2b674892afc02fe1f431cbcf74863eee",
"score": "0.6107279",
"text": "writing() {\n this._spConfFile();\n this._romFiles();\n this._annotationFile();\n this._tapeFile();\n this._codeFile();\n this._floppyFile();\n }",
"title": ""
},
{
"docid": "0d1af4ae2aefdb130f7701986397bcaa",
"score": "0.6060502",
"text": "async function writeConfig(config) {\r\n fs.writeFile(configPath, JSON.stringify(config));\r\n}",
"title": ""
},
{
"docid": "b1737b036760aa2c1307410653285d09",
"score": "0.604825",
"text": "function saveSettings() {\n\tsaveBoolSetting(\"whole_words_only\");\n\tsaveBoolSetting(\"include_title\");\n\tsaveBoolSetting(\"show_blockers\");\n\tsaveBoolSetting(\"konami\");\n\tsaveStringSetting(\"placeholder_background\");\n\tsaveStringSetting(\"placeholder_border\");\n\tsaveStringSetting(\"placeholder_text\");\n\t\n\tsaveBlockers(\"blockers\");\n\t\n\tdoExport();\n}",
"title": ""
},
{
"docid": "acf157b1200f82e964af1edcb2d7131f",
"score": "0.6025914",
"text": "function save_configuration()\n {\n var configuration_panel = document.querySelector('#d2ne_configuration_panel > div:nth-child(2)');\n\n for (var i = 0, max = configuration_panel.childElementCount; i < max; i += 1) {\n var el = configuration_panel.childNodes[i];\n\n // skip if not div\n if (el.tagName !== 'DIV') {\n continue;\n }\n\n // Grab input dom element\n var input_node = el.firstChild;\n var module_name = input_node.getAttribute(INPUT_DATA_MODULE_KEY);\n var module = Module.get(module_name);\n var property = input_node.getAttribute(INPUT_DATA_MODULE_PROPERTY_KEY);\n\n // Get the value\n var input_data;\n switch (module.configurable[property].type) {\n case Module.PROPERTY.BOOLEAN:\n input_data = input_node.checked;\n break;\n\n default:\n input_data = null;\n break;\n }\n\n // Inject it into the object and save\n module.properties[property] = input_data;\n module.save_properties();\n }\n }",
"title": ""
},
{
"docid": "796a32215322c69f88a884ac3d516289",
"score": "0.60250634",
"text": "savings() {\n this.config.set(this.props);\n this.config.save();\n }",
"title": ""
},
{
"docid": "1a9b7fcc3183161294aa0d9581ca23b9",
"score": "0.60144246",
"text": "function saveCodepointsToFile() {\n if (!defaultOptions.codepointsFile) return;\n\n const codepointsToString = JSON.stringify(defaultOptions.codepoints, null, 4);\n\n try {\n fs.writeFileSync(defaultOptions.codepointsFile, codepointsToString);\n logger.verbose('Codepoints saved to file \"' + defaultOptions.codepointsFile + '\".');\n } catch (err) {\n logger.error(err.message);\n }\n }",
"title": ""
},
{
"docid": "ff8be86c789988b192260a3e2b5470e4",
"score": "0.5995478",
"text": "function save() {\n window.extensions.KJSLINT.KomodoAdaptor.updatePreferencesObject(preferences);\n }",
"title": ""
},
{
"docid": "0e583d686fba50651a6b3eb08dedb520",
"score": "0.5988685",
"text": "function writeConfig(file, config) {\n\n var fullPath = __dirname;\n var fullFile = path.join(fullPath,file);\n console.log(\"writing config path \"+fullFile+\" config \"+JSON.stringify(config));\n writeFile(fullFile, JSON.stringify(config));\n}",
"title": ""
},
{
"docid": "23d13f0b6fe5d1c0e6d492be7dc143b9",
"score": "0.5983112",
"text": "function saveCodepointsToFile(){\n\t\t\tif (!o.codepointsFile) return;\n\t\t\tvar codepointsToString = JSON.stringify(o.codepoints, null, 4);\n\t\t\ttry {\n\t\t\t\tfs.writeFileSync(o.codepointsFile, codepointsToString);\n\t\t\t\tlogger.verbose('Codepoints saved to file \"' + o.codepointsFile + '\".');\n\t\t\t} catch (err) {\n\t\t\t\tlogger.error(err.message);\n\t\t\t}\n\t\t}",
"title": ""
},
{
"docid": "859b6732389bdac8a4122ca866a3c13f",
"score": "0.59792405",
"text": "function saveConfigurationToServer() {\n if (userState.configuration) {\n userState.configurationSaved = true;\n $('.modal').modal('hide'); // close all opened popups\n var xml_text = document.getElementById('bricklyFrame').contentWindow.getXmlOfConfiguration(userState.configuration);\n LOG.info('save brick configuration ' + userState.configuration);\n COMM.json(\"/conf\", {\n \"cmd\" : \"saveC\",\n \"name\" : userState.configuration,\n \"configuration\" : xml_text\n }, function(result) {\n if (result.rc === 'ok') {\n userState.configurationModified = false;\n displayMessage(\"MESSAGE_EDIT_SAVE_CONFIGURATION\", \"TOAST\", \"\");\n } else {\n displayMessage(result.message, \"POPUP\", \"\");\n }\n });\n }\n}",
"title": ""
},
{
"docid": "544d2343595198d0d204873ebfa56651",
"score": "0.59737676",
"text": "saveOptions() {\n\n this.app.options = Object.assign({}, this.app.options);\n\n try {\n fs.writeFileSync(`${this.config_dir}/options`, JSON.stringify(this.app.options), null, 4);\n } catch (err) {\n // this.app.logger.logError(\"Error thrown in storage.saveOptions\", {message: \"\", stack: err});\n console.error(err);\n return;\n }\n\n }",
"title": ""
},
{
"docid": "fc3ae60025da47bc8613027b54e4ae77",
"score": "0.59544593",
"text": "_spConfFile() {\n const filename = `${this.projectName}/${SETTINGS_FOLDER}/${SPCONF_FILE}`;\n const item = _.find(acceptedProjectTypes, i=> i.value === this.spectrumType);\n this.fs.writeJSON(filename, {\n model: item.model,\n edition: item.edition\n });\n }",
"title": ""
},
{
"docid": "6f5b77e30b82d7c0af80f297d8c6f2ce",
"score": "0.59523326",
"text": "async save() {\n await writeFileAsync(this.getProfileFilePath(), this.encode());\n }",
"title": ""
},
{
"docid": "cec5538297b3c6956e43c03c46681168",
"score": "0.5945575",
"text": "save() {\n if (this.filePath) {\n fs.writeFileSync(this.filePath, jsonView.toString(this.content), \"utf-8\");\n }\n }",
"title": ""
},
{
"docid": "6c31b175eb1524452b13800ac3fb0444",
"score": "0.59444296",
"text": "async _writeConfig(data) {\n try {\n await fs_extra_1.writeFile(filePath, data, 'utf8');\n }\n catch (err) {\n log.error('_readConfigCb', err);\n throw err;\n }\n }",
"title": ""
},
{
"docid": "03fbd7c47eaa8665183d79e050f05518",
"score": "0.59377104",
"text": "persist() {\n fs.writeFileSync(\n this._path,\n Object.keys(this._profiles).map(profile => this.getProfile(profile)).join(os.EOL + os.EOL)\n );\n }",
"title": ""
},
{
"docid": "2a6d634210f65241e02c46df3bc822a7",
"score": "0.590844",
"text": "function saveOptions() {\n\t// Get new settings values\n\tvar size = getSizeValue();\n\tvar color = getColorValue();\n\tvar autoDisplay = getAutoDisplayValue();\n\tvar verticalPosition = getVerticalPositionValue();\n\tvar horizontalPosition = getHorizontalPositionValue();\n\n\tsaveAndNotice({\n\t\tsize : size,\n\t\tcolor : color,\n\t\tautoDisplay : autoDisplay,\n\t\tverticalPosition : verticalPosition,\n\t\thorizontalPosition : horizontalPosition\n\t});\n}",
"title": ""
},
{
"docid": "924ef6c251c58fa477f9aedcf831f7ad",
"score": "0.58958954",
"text": "function download_current_config(){\n\tsave_patient_changes() //get changes to configuration from editor\n\tsave_simulation_changes()\n\tvar config = {\"patient_config\" : patient_config, \"ward_config\" : ward_config, \"simulation_config\" : simulation_config}\n\tvar config_text = JSON.stringify(config)\n\tvar blob = new Blob([config_text], {type: \"text/plain;charset=utf-8\"});\n\tsaveAs(blob, 'patient_flow_config.json.txt');\n}",
"title": ""
},
{
"docid": "8497afd9f1c9753653ddd677aa31b0a8",
"score": "0.58917695",
"text": "function saveSensorsFile () {\n // TODO: No need to save status, statusId or type\n fs.writeFile(sensorfilename, JSON.stringify(sensors), function (err) {\n if (err) return debug('error saving sensors file:', err);\n });\n}",
"title": ""
},
{
"docid": "2b5301923d09fd7adf468f9850b9093e",
"score": "0.5865592",
"text": "function writeToFile(filepath, text) {\n const fs = require(\"fs\");\n fs.writeFile(filepath, text, (err) => {\n if (err) throw err;\n console.log('Auction settings have been saved!');\n });\n}",
"title": ""
},
{
"docid": "a3b368187cd31ab8327c910527844589",
"score": "0.58640844",
"text": "function writeAppSettings(settings, appPath) {\n\tvar path = PATH.join(appPath, 'evothings.json')\n\tvar data = JSON.stringify(settings, null, 2)\n\tFS.writeFileSync(path, data, {encoding: 'utf8'})\n}",
"title": ""
},
{
"docid": "65d93093c9b771c43e1f8485c6233fd2",
"score": "0.58609635",
"text": "function saveState () {\n winston.info('Saving current state');\n\tfs.ensureDir(path.join(CONFIG_DIR,'data'));\n jsonfile.writeFileSync(STATE_FILE, {\n version: CURRENT_VERSION,\n callback: callback,\n subscriptions: subscriptions,\n\t\tsubscribe: subscribe,\n\t\tpublications: publications,\n history: history,\n\t\tst_request: st_request,\n\t\tdevices: devices\n }, {\n spaces: 4\n });\n jsonfile.writeFileSync(STATE_SUMMARY_FILE, {\n version: CURRENT_VERSION,\n callback: callback,\n subscriptions: subscriptions,\n\t\tsubscribe: Object.keys(subscribe),\n\t\tpublications: Object.keys(publications),\n history: history,\n\t\tdevices: (devices) ? Object.keys(devices) : devices\n }, {\n spaces: 4\n });\n}",
"title": ""
},
{
"docid": "1d8a671a347b7408f3d96c6d1e3be658",
"score": "0.5855491",
"text": "function saveFile() {\n var editor = IDE.editorTabView.getActiveEditor();\n if (editor)\n editor.save();\n }",
"title": ""
},
{
"docid": "8fee3068d179cd99ad7b611ce3f273ff",
"score": "0.5855019",
"text": "function save (saveFile) {\r\n if (!saveFile) return;\r\n\r\n let saveData = {\r\n \"nodeIndex\": currentNodeIndex,\r\n \"dialogIndex\": currentDialogIndex-1,\r\n \"backlog\": Backlog.getAsArray(),\r\n \"customVariables\": game.customVariables\r\n };\r\n\r\n localStorage.setItem(saveFile, JSON.stringify(saveData));\r\n needToUpdateSavefilesScreen = true;\r\n }",
"title": ""
},
{
"docid": "bacba353ded8aca6328aff8fb97af4cb",
"score": "0.58546835",
"text": "function saveData(){\n fs.writeFile('output.json', JSON.stringify(json, null, 4), function(err){\n\n //console.log('File successfully written! - Check your project directory for the output.json file');\n\n });\n }",
"title": ""
},
{
"docid": "b518d423187c515589eeee039c4204d7",
"score": "0.584097",
"text": "static writeToPlayerConfig () {\n let data = 'var playerConfig = ' + JSON.stringify(Restreamer.data.options.player);\n\n fs.writeFileSync('src/webserver/public/config.js', data, 'utf8');\n }",
"title": ""
},
{
"docid": "998053b5564ae0bd3cb09068e8c2e0d5",
"score": "0.5828183",
"text": "static saveConfig() {\n for (const name in this.paramValues) {\n const value = this.paramValues[name]\n /*if (\n typeof this.paramDeclarations[name] === 'undefined' ||\n this.paramDeclarations[name].noConfig\n ) {\n continue\n }\n if (\n value.paramType === 'arg' ||\n value.paramType === 'default' ||\n value.paramType === 'config'\n ) {*/\n const camelCase = changeCase.camelCase(name)\n this.configFile.set(camelCase, value.value)\n //}\n }\n }",
"title": ""
},
{
"docid": "bb26960ca32092eb67d5ea580f4b8948",
"score": "0.582736",
"text": "function writeConfig() {\n _config.feeder.servers = [];\n for (var addr in _statsConnections) {\n if (!_statsConnections.hasOwnProperty(addr)) continue;\n var conn = _statsConnections[addr];\n _config.feeder.servers.push(conn.owner + \":\" + addr + \"/\" + conn.pass);\n }\n _config.feeder.servers.sort();\n\n _ignoreConfigChange = true;\n fs.writeFile(__dirname + \"/\" + _configFileName, JSON.stringify(_config, null, 2));\n}",
"title": ""
},
{
"docid": "50a6f3783a364290732554ae9a391c3f",
"score": "0.58050126",
"text": "async saveRuntimeConfig(name, config) {\n const file = this.getRuntimeConfigFileName(name);\n log.info(`Save runtime config ${name} to file ${file}`);\n await fs.writeJson(file, config, {\n spaces: 2\n });\n this.configs.set(name, config);\n }",
"title": ""
},
{
"docid": "362e2b1adae602551396c6f44fe36186",
"score": "0.5799757",
"text": "writeRobotsFile() {\n\t\tfs.writeFile(this.root + '/app/robots.txt', this.config.robots, (e) => { if (e) console.error(e); });\n\t}",
"title": ""
},
{
"docid": "1c6fc187917a98281df5d92eddcadf72",
"score": "0.5790736",
"text": "function saveState () {\n\twinston.info('Saving current state');\n\tjsonfile.writeFileSync(STATE_FILE, {\n\t\tsubscriptions: subscriptions,\n\t\tcallback: callback,\n\t\thistory: history,\n\t\tversion: CURRENT_VERSION\n\t}, {\n\t\tspaces: 4\n\t});\n}",
"title": ""
},
{
"docid": "a106996164c635cd98a22ce3c02b9d67",
"score": "0.57757217",
"text": "function storeSettings(settings) {\n try {\n const output = JSON.stringify(settings, null, 2);\n fs.writeFileSync(Constants.GLOBAL_SETTINGS_PATH, output, {mode: 0o600});\n } catch (e) {\n console.warn(\"Couldn't write settings file at\", Constants.GLOBAL_SETTINGS_PATH, e);\n }\n}",
"title": ""
},
{
"docid": "9dabf531e25b47f5979c1b6763841446",
"score": "0.5760661",
"text": "function saveStorage() {\r\n\tlocalStorage.setItem(\"Config\", JSON.stringify(Config));\r\n}",
"title": ""
},
{
"docid": "faaea0ed3e910aa27daa464ec25b279b",
"score": "0.57487804",
"text": "function saveSettings() {\n s.add(STORAGE_KEY, settings);\n }",
"title": ""
},
{
"docid": "580381fa1b0176a290b7b05d4ad4109a",
"score": "0.5740689",
"text": "function saveSettings()\n {\n settings.currentPrinterName = printersComboBox.value;\n \n settings.save();\n }",
"title": ""
},
{
"docid": "5366cf72e5548bb4d87dde7875b49a01",
"score": "0.5733056",
"text": "function writeConfigProperties() {\n try {\n const configProperties = JSON.stringify(parsedEnv, null, 2);\n\n fs.writeFileSync(\n `${syspath.config}/${targetConfigFile}`,\n configProperties,\n 'utf8'\n );\n\n console.info(\n 'Config file [%s] was written in location [%s]!',\n targetConfigFile,\n slash(syspath.config)\n );\n } catch (err) {\n console.error('Failed to write config file [%s]', targetConfigFile);\n console.error(err);\n process.exit(-1);\n }\n}",
"title": ""
},
{
"docid": "6393080711f8275b82c570136c2b3090",
"score": "0.5729791",
"text": "function writeFile(modelConfig, table) {\n fs.writeFile(\"./models/\" + table.toLowerCase() + \".json\", JSON.stringify(modelConfig), function (err) {\n if (err)\n console.log(err);\n else\n console.log('Successfully created model ' + table.toLowerCase() + \".json!\");\n });\n}",
"title": ""
},
{
"docid": "9865a5b838cfbb7b9f512cf05f8f0501",
"score": "0.57115686",
"text": "saveInConfig() {\n\t\tlet a = []\n\t\t\n\t\tfor(let w of this.wspaces)\n\t\t\ta.push(w.path)\n\t\t\n\t\tsetConfig('workspaces', a)\n\t}",
"title": ""
},
{
"docid": "465f0229a8ab9675c9bb6ee46dfa0f93",
"score": "0.56826997",
"text": "function saveConfig(config) {\n const configAsString = JSON.stringify(config);\n localStorage.setItem(\"readerConfig\", configAsString);\n}",
"title": ""
},
{
"docid": "6e795dbdba2bbb42ea1b029bd8128114",
"score": "0.5681512",
"text": "save() {\r\n this.numRowsOnMap = ~~this.ui.rngMaxRowsOnMap.val();\r\n this.numColumnsOnMap = ~~this.ui.rngMaxColsOnMap.val();\r\n this.numPlayersMoves = ~~this.ui.rngPlayersMoves.val();\r\n this.numWeaponsOnMap = ~~this.ui.rngWeapons.val();\r\n this.numObstacles = ~~this.ui.rngObstacles.val();\r\n this.moveByMouse = this.ui.chkUseMouse.prop(\"checked\");\r\n localStorage.setItem('config',\r\n JSON.stringify({\r\n numRowsOnMap: this.numRowsOnMap,\r\n numColumnsOnMap: this.numColumnsOnMap,\r\n numPlayersMoves: this.numPlayersMoves,\r\n numWeaponsOnMap: this.numWeaponsOnMap,\r\n numObstacles: this.numObstacles,\r\n moveByMouse: this.moveByMouse\r\n }));\r\n }",
"title": ""
},
{
"docid": "fe9e790beea9fbe9abf344e62de0bbe7",
"score": "0.56744814",
"text": "function save(){\n\t//salva em 'dados.txt' no formato JSON, para futuras analises dos dados\n\tfs.writeFile('dados.txt',JSON.stringify(itens),'utf8',function(data){\n\t\tconsole.log('dados gravados com sucesso');\n\t});\n}",
"title": ""
},
{
"docid": "89f26b03ebd52a060eb962c8eb8203eb",
"score": "0.56446755",
"text": "function saveConfigurations(options, callback) {\n api({\n resource: 'settingsResource',\n method: 'saveConfigurations',\n data: options,\n success: callback\n });\n }",
"title": ""
},
{
"docid": "d3c99c3b259980c18ef264c09bc26a70",
"score": "0.5636088",
"text": "save(filename) {}",
"title": ""
},
{
"docid": "6d4cc0f2e5fa335b9ff1d56986133c64",
"score": "0.5606507",
"text": "function saveFile() {\n\tconsole.log(editor.getValue());\n model.setFile(filepath,editor.session.doc.getValue());\n }",
"title": ""
},
{
"docid": "0132c282ece15d7797978b1d63137f8c",
"score": "0.560477",
"text": "save() {\n /**\n * save account to file \n */\n var res = JSON.stringify(arrayOfObjects)\n fs.writeFileSync('/home/admin1/HitheshGR/OopsPrograms/JSONfiles/commercial.json', res, 'utf-8')\n }",
"title": ""
},
{
"docid": "e53894415a42131a3d88f15b075f1079",
"score": "0.56042475",
"text": "function savePreferences() {\n // save all preferences\n persistentStorage.setItem(preferencesKey, JSON.stringify(prefStorage));\n }",
"title": ""
},
{
"docid": "a66ce541aa85a388e1db3b231ae0faf2",
"score": "0.5601427",
"text": "function saveConfiguration() {\r\n \r\n // Sets videoSize depending on the value of the video size select (or the value of the custom video size input if a custom size is chosen)\r\n var vsSelect = $id(\"ytf-conf-video-size-sel\"), vsCustomInput = $id(\"ytf-conf-size-custom\");\r\n var vsValue = (vsSelect.value === \"\") ? vsCustomInput.value : vsSelect.value, vsValValue = VideoAdapter.valVideoSize(vsValue);\r\n if (vsValValue === null) { // Doesn't continue if the chosen video size is invalid\r\n window.alert(\"Invalid default video size\");\r\n switchToTab(0);\r\n vsCustomInput.focus();\r\n return;\r\n }\r\n lockDialogInputs(); // Disables all input/select fields before saving\r\n GM_setValue(\"videoSize\", vsValValue);\r\n \r\n // Sets autoplayMode depending on the state of the relevant radio inputs\r\n var apMode = parseInt(getRadioValue(\"ytf-conf-autoplay-choice\"), 10);\r\n GM_setValue(\"autoplayMode\", (isNaN(apMode)) ? 0 : apMode);\r\n \r\n // Sets channelAutoplayMode depending on the state of the relevant radio inputs\r\n var channelApMode = parseInt(getRadioValue(\"ytf-conf-autoplay-channel-choice\"), 10);\r\n GM_setValue(\"channelAutoplayMode\", (isNaN(channelApMode)) ? 0 : channelApMode);\r\n \r\n // Sets controlsAutohideMode depending on the value of the relevant select\r\n var ahMode = parseInt($id(\"ytf-conf-controls-autohide-mode-sel\").value, 10);\r\n GM_setValue(\"controlsAutohideMode\", (isNaN(ahMode)) ? -1 : ahMode);\r\n GM_setValue(\"flashWMode\", $id(\"ytf-conf-flash-wmode-sel\").value);\r\n GM_setValue(\"removeAds\", $id(\"ytf-conf-remove-ads\").checked);\r\n \r\n // Reloads page and script\r\n window.location.reload();\r\n \r\n }",
"title": ""
},
{
"docid": "78da73e0b00b38fa3a5604c0bd23a475",
"score": "0.5596489",
"text": "async writeServerSettings() {\n\t\tlet serverSettings = await this.resolveServerSettings(this.config.get(\"factorio.settings\"));\n\t\tawait fs.writeFile(\n\t\t\tthis.server.writePath(\"server-settings.json\"),\n\t\t\tJSON.stringify(serverSettings, null, 4)\n\t\t);\n\t}",
"title": ""
},
{
"docid": "ec249586553548df15fac418e33666a8",
"score": "0.55799884",
"text": "write() {\n const fullPath = `${Config.assetCatalogRoot}/${this.path}/Contents.json`;\n\n fs.writeFile(fullPath, JSON.stringify(this.contents, null, 2), (err) => {\n if (err) {\n console.error(err);\n return;\n }\n // File was created.\n });\n }",
"title": ""
},
{
"docid": "232d966bfeceae1c8b99661d7989d482",
"score": "0.5568863",
"text": "function saveAppState(socket, fileName) {\n\n // If socket is not passed don't echo to client\n socket = socket ? socket : false;\n // If fileName is passed read from that config file\n //\n fileName = fileName ? fileName : './config/rest_moog_reader.conf';\n\n var appStateFileContent = JSON.stringify(appState, null, '\\t');\n\n //console.log(appStateFileContent);\n\n fs.writeFile(fileName, appStateFileContent, function (err) {\n if (err) {\n console.log('Config file write error ' + fileName);\n if (socket) {\n socket.emit('message', {status: 'D', text: 'File Save ERROR.'});\n }\n }\n else {\n console.log('Config file saved ' + fileName);\n if (socket) {\n socket.emit('message', {status: 'S', text: 'Config saved okay.'});\n }\n }\n });\n\n // Broadcast new state\n io.emit('stateData', {confLoad: true, data: JSON.stringify(appState)});\n}",
"title": ""
},
{
"docid": "9173503981d1736c20de7ca513bf8458",
"score": "0.5566761",
"text": "saveConfig(req, res, next)\n {\n if(!(\"path\" in req.body)) {\n res.json(false);\n return;\n }\n\n this.config.set(\"scenes\", this.sceneManager.export());\n this.config.save(req.body.path);\n res.json(true);\n\n }",
"title": ""
},
{
"docid": "57be531f5ffbb362d20d37716bb4fda6",
"score": "0.55659384",
"text": "function saveConfiguration(evt) {\r\n\r\n\t\t// Disables the input fields\r\n\t\tsetDialogInputState(true);\r\n\r\n\t\t// Checks default video size\r\n\t\tvar valvs = valVideoSize($(\"gsconfvideoSize\").value);\r\n\t\tif (valvs === null) {\r\n\t\t\twindow.alert(\"Invalid default video size\");\r\n\t\t\tsetDialogInputState(true); // Re-enables the input fields\r\n\t\t\t$(\"gsconfvideoSize\").focus();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tGM_setValue(\"videoSize\", valvs);\r\n\r\n\t\t// Sets other configuration variables\r\n\t\tGM_setValue(\"removeMore\", $(\"gsconfremoveMore\").checked);\r\n\t\tGM_setValue(\"removeRelated\", $(\"gsconfremoveRelated\").checked);\r\n\t\tGM_setValue(\"removeBrand\", $(\"gsconfremoveBrand\").checked);\r\n\t\tGM_setValue(\"removeAlsoWatching\", $(\"gsconfremoveAlsoWatching\").checked);\r\n\t\tGM_setValue(\"removeEmbed\", $(\"gsconfremoveEmbed\").checked);\r\n\t\tGM_setValue(\"removeURL\", $(\"gsconfremoveURL\").checked);\r\n\t\tGM_setValue(\"removeRatings\", $(\"gsconfremoveRatings\").checked);\r\n\t\tGM_setValue(\"removeActions\", $(\"gsconfremoveActions\").checked);\r\n\t\tGM_setValue(\"removeFooter\", $(\"gsconfremoveFooter\").checked);\r\n\t\tGM_setValue(\"removeCopyright\", $(\"gsconfremoveCopyright\").checked);\r\n\t\tGM_setValue(\"expandInfo\", $(\"gsconfexpandInfo\").checked);\r\n\t\tGM_setValue(\"hideCollapse\", ($(\"gsconfexpandInfo\").checked ? $(\"gsconfhideCollapse\").checked : false));\r\n\t\tGM_setValue(\"biggerComments\", $(\"gsconfcommentsBigger\").checked ? true : false);\r\n\t\tGM_setValue(\"removeComments\", $(\"gsconfcommentsNone\").checked ? true : false);\r\n\t\tGM_setValue(\"videoToIcon\", $(\"gsconfvideoToIcon\").checked);\r\n\t\tGM_setValue(\"addCharCounter\", $(\"gsconfaddCharCounter\").checked);\r\n\t\tGM_setValue(\"forceHDMode\", $(\"gsconfforceHDMode\").checked);\r\n\r\n\t\t// Reloads page and script\r\n\t\twindow.location.reload();\r\n\r\n\t}",
"title": ""
},
{
"docid": "bf3bc6cab4f326c82b14adf98b052f1b",
"score": "0.5554768",
"text": "function save(){\r\n\t\tvar s = Storage.getDefault();\r\n\t\tvar ud = that.exportUserData();\r\n\t\ts.saveUserData(ud);\r\n\t}",
"title": ""
},
{
"docid": "8a8382dacb5445a40722edb5a566ff0e",
"score": "0.5554653",
"text": "function save() {\n var xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var data = Blockly.Xml.domToText(xml);\n\n // Store data in blob.\n var builder = new BlobBuilder();\n builder.append(data);\n saveAs(builder.getBlob('text/plain;charset=utf-8'), 'block.xml');\n}",
"title": ""
},
{
"docid": "385728ac230c81010d7af1ebf5502938",
"score": "0.5554543",
"text": "function saveConfig() {\n console.log(\"Saving config\");\n try {\n\n setSetting(PROFIT_SUM_KEY, document.getElementById(PROFIT_SUM_KEY).checked);\n setSetting(HIGHLIGHT_COMMANDERS_KEY, document.getElementById(HIGHLIGHT_COMMANDERS_KEY).checked);\n setSetting(HIGHLIGHT_COMMANDER_CONSTRUCTION, document.getElementById(HIGHLIGHT_COMMANDER_CONSTRUCTION).value);\n setSetting(HIGHLIGHT_COMMANDER_RESEARCH, document.getElementById(HIGHLIGHT_COMMANDER_RESEARCH).value);\n setSetting(HIGHLIGHT_COMMANDER_PRODUCTION, document.getElementById(HIGHLIGHT_COMMANDER_PRODUCTION).value);\n setSetting(HIGHLIGHT_COMMANDER_DEFENSE, document.getElementById(HIGHLIGHT_COMMANDER_DEFENSE).value);\n setSetting(HIGHLIGHT_COMMANDER_TACTICAL, document.getElementById(HIGHLIGHT_COMMANDER_TACTICAL).value);\n setSetting(HIGHLIGHT_COMMANDER_LOGISTICS, document.getElementById(HIGHLIGHT_COMMANDER_LOGISTICS).value);\n setSetting(QUICK_BAR, document.getElementById(QUICK_BAR).checked);\n setSetting(QUICK_BAR_FIX, document.getElementById(QUICK_BAR_FIX).checked);\n setSetting(HIDE_ALLI_FLEETS, document.getElementById(HIDE_ALLI_FLEETS).checked);\n\n setSetting(HIGHLIGHT_TRADE_PARTNERS_KEY, $$(HIGHLIGHT_TRADE_PARTNERS_KEY).checked);\n setSetting(HIGHLIGHT_POOR_TRADES_KEY, $$(HIGHLIGHT_POOR_TRADES_KEY).checked);\n setSetting(POOR_TRADE_UPPER_THRESHOLD_KEY, $$(POOR_TRADE_UPPER_THRESHOLD_KEY).value);\n setSetting(POOR_TRADE_LOWER_THRESHOLD_KEY, $$(POOR_TRADE_LOWER_THRESHOLD_KEY).value);\n setSetting(HIGHLIGHT_DUPLICATE_TRADE_PARTNERS_KEY, $$(HIGHLIGHT_DUPLICATE_TRADE_PARTNERS_KEY).checked);\n setSetting(SHOW_TOTAL_FLEET_ROW_KEY, $$(SHOW_TOTAL_FLEET_ROW_KEY).checked);\n setSetting(SHOW_ATTACK_SIZE_KEY, $$(SHOW_ATTACK_SIZE_KEY).checked);\n setSetting(ADD_FLEET_MOVE_LINK_KEY, $$(ADD_FLEET_MOVE_LINK_KEY).checked);\n setSetting(ENABLE_PRODUCTION_PRESETS_KEY, $$(ENABLE_PRODUCTION_PRESETS_KEY).checked);\n setSetting(ADD_EMPIRE_SUBMENU_KEY, $$(ADD_EMPIRE_SUBMENU_KEY).checked);\n setSetting(MOVE_EMPIRE_SUBMENU_KEY, $$(MOVE_EMPIRE_SUBMENU_KEY).checked);\n setSetting(INSERT_BATTLECALC_LINK_KEY, $$(INSERT_BATTLECALC_LINK_KEY).checked);\n setSetting(ADJUST_TITLES_KEY, $$(ADJUST_TITLES_KEY).checked);\n setSetting(FIX_QUEUES_KEY, $$(FIX_QUEUES_KEY).checked);\n setSetting(MAX_QUEUES_KEY, $$(MAX_QUEUES_KEY).value);\n setSetting(HIGHLIGHT_PLAYERS_KEY, $$(HIGHLIGHT_PLAYERS_KEY).checked);\n setSetting(PLAYER_COLORS_KEY, escape($$(PLAYER_COLORS_KEY).value));\n setSetting(MY_GUILD_KEY, escape($$(MY_GUILD_KEY).value));\n setSetting(MY_NAME_KEY, escape(document.getElementById(MY_NAME_KEY).value));\n setSetting(ALLIED_GUILDS_KEY, escape($$(ALLIED_GUILDS_KEY).value));\n setSetting(NAPPED_GUILDS_KEY, escape($$(NAPPED_GUILDS_KEY).value));\n setSetting(ENEMY_GUILDS_KEY, escape($$(ENEMY_GUILDS_KEY).value));\n setSetting(MY_GUILD_COLOUR_KEY, escape($$(MY_GUILD_COLOUR_KEY).value));\n setSetting(ENEMY_GUILDS_COLOUR_KEY, escape($$(ENEMY_GUILDS_COLOUR_KEY).value));\n setSetting(NAPPED_GUILDS_COLOUR_KEY, escape($$(NAPPED_GUILDS_COLOUR_KEY).value));\n setSetting(ALLIED_GUILDS_COLOUR_KEY, escape($$(ALLIED_GUILDS_COLOUR_KEY).value));\n setSetting(HIGHLIGHT_TRADE_COLOUR_KEY, escape($$(HIGHLIGHT_TRADE_COLOUR_KEY).value));\n setSetting(HIGHLIGHT_BASE_COLOUR_KEY, escape($$(HIGHLIGHT_BASE_COLOUR_KEY).value));\n setSetting(HIGHLIGHT_SYSTEM_COLOUR_KEY, escape($$(HIGHLIGHT_SYSTEM_COLOUR_KEY).value));\n setSetting(HIGHLIGHT_CUS_SCANNER_KEY, escape($$(HIGHLIGHT_CUS_SCANNER_KEY).value));\n setSetting(HIGHLIGHT_CUSBASE_COLOUR_KEY, escape($$(HIGHLIGHT_CUSBASE_COLOUR_KEY).value));\n setSetting(HIGHLIGHT_CUSSYSTEM_COLOUR_KEY, escape($$(HIGHLIGHT_CUSSYSTEM_COLOUR_KEY).value));\n setSetting(STRUCT_COLOUR1_KEY, escape($$(STRUCT_COLOUR1_KEY).value));\n setSetting(STRUCT_COLOUR2_KEY, escape($$(STRUCT_COLOUR2_KEY).value));\n setSetting(STRUCT_COLOUR3_KEY, escape($$(STRUCT_COLOUR3_KEY).value));\n setSetting(SUM_FLEETS_KEY, $$(SUM_FLEETS_KEY).checked);\n setSetting(SUM_FLEETS_BASE, $$(SUM_FLEETS_BASE).checked);\n setSetting(FLEET_INFO_POPUP, $$(FLEET_INFO_POPUP).checked);\n setSetting(FLEET_INFO_POPUP_TIMER, $$(FLEET_INFO_POPUP_TIMER).value);\n setSetting(FLEET_INFO_POPUP_FADE, $$(FLEET_INFO_POPUP_FADE).checked);\n setSetting(SUM_CREDITS_KEY, $$(SUM_CREDITS_KEY).checked);\n setSetting(FORMAT_NUMBERS_KEY, $$(FORMAT_NUMBERS_KEY).checked);\n setSetting(NUMBER_DELIMETER_KEY, escape($$(NUMBER_DELIMETER_KEY).value));\n setSetting(CLONE_BASE_LINKS_KEY, $$(CLONE_BASE_LINKS_KEY).checked);\n setSetting(CLONE_FLEET_LINKS_KEY, $$(CLONE_FLEET_LINKS_KEY).checked);\n setSetting(MOVE_GALAXY_LINKS_KEY, $$(MOVE_GALAXY_LINKS_KEY).checked);\n setSetting(STRUCTURES_GOALS_KEY, $$(STRUCTURES_GOALS_KEY).checked);\n setSetting(INSERT_MOVE_PRESETS_KEY, $$(INSERT_MOVE_PRESETS_KEY).checked);\n setSetting(SHOW_EXECUTION_TIME_KEY, $$(SHOW_EXECUTION_TIME_KEY).checked);\n setSetting(AUTOSET_GUILD_KEY, $$(AUTOSET_GUILD_KEY).checked);\n setSetting(CONSTRUCT_ENHANCE_KEY, $$(CONSTRUCT_ENHANCE_KEY).checked);\n setSetting(SCRIPT_BATTLECALC_KEY, $$(SCRIPT_BATTLECALC_KEY).checked);\n setSetting(AUTOSET_GUILD_NOTIFY_KEY, $$(AUTOSET_GUILD_NOTIFY_KEY).checked);\n\n setSetting(NAME_LOCATIONS_KEY, $$(NAME_LOCATIONS_KEY).checked);\n setSetting(LOCATION_NAMES_KEY, escape($$(LOCATION_NAMES_KEY).value));\n\n setSetting(SHOW_PILLAGE_KEY, $$(SHOW_PILLAGE_KEY).checked);\n setSetting(FORMAT_SCANNER_KEY, $$(FORMAT_SCANNER_KEY).checked);\n setSetting(REMOVE_REDIRECT_KEY, $$(REMOVE_REDIRECT_KEY).checked);\n setSetting(DEBUG_KEY, $$(DEBUG_KEY).checked);\n\n var logLevel = LOG_LEVEL_WARN;\n var radioButtons = document.evaluate(\n \"//input[@type='radio']\",\n document,\n null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null);\n //console.log(redCells.snapshotLength);\n for (var i = 0; i < radioButtons.snapshotLength; i++) {\n //console.log(radioButtons.snapshotItem(i));\n if (radioButtons.snapshotItem(i).checked == true) {\n logLevel = radioButtons.snapshotItem(i).value;\n }\n\n }\n setSetting(LOG_LEVEL_KEY, logLevel);\n } catch (e) {\n console.log(\"Save settings on \" + getServer() + \": \" + e);\n }\n notify(\"Settings successfully saved.\");\n}",
"title": ""
},
{
"docid": "e1a5bdf1a62ab372c6e47502d9761cca",
"score": "0.5550745",
"text": "onSave() {\n\t\tFileSaver.saveAs(\n\t\t\tnew Blob(\n\t\t\t\t[FILE_PREFIX + JSON.stringify(this.props.state)],\n\t\t\t\t{type: 'text/plain;charset=utf-8'}\n\t\t\t),\n\t\t\t'Predict_data.json'\n\t\t);\n\t}",
"title": ""
},
{
"docid": "710e7cda2d45277d7b98fd9bdf040a40",
"score": "0.5533423",
"text": "function save() {\n\t\tvar json = JSON.stringify(canvas);\n\t\tlocalStorage.canvasApp = json;\n\t}",
"title": ""
},
{
"docid": "f9b7d8cae202c64e07ac133856d8dc12",
"score": "0.55307543",
"text": "function saveSettings(settingsData) {\n\n saveFile(SETTINGS_FILE, settingsData);\n\n}",
"title": ""
},
{
"docid": "c24e3508aff3a7435aadf66d151fdec9",
"score": "0.55295455",
"text": "saveFile(){\n var file = {\n score: this.score,\n levelmarket: this.levelmarket,\n leveldev: this.leveldev,\n leveldesign: this.leveldesign,\n prixmarket: this.prixmarket,\n prixdev: this.prixdev,\n prixdesign: this.prixdesign,\n temps: this.temps,\n timer: this.timer,\n };\n console.log(\"Fichier enregistré\");\n localStorage.setItem('saveFile',JSON.stringify(file));\n }",
"title": ""
},
{
"docid": "2e9cb4870035111721765daa30f40b8b",
"score": "0.55290204",
"text": "function saveState () {\n ipcRenderer.send('log', 'saving state to ' + cfg.filePath)\n cfg.write(state.saved, function (err) {\n if (err) console.error(err)\n update()\n })\n}",
"title": ""
},
{
"docid": "d944d48fd71b218aaaa16a6764165bd3",
"score": "0.55284315",
"text": "function saveSettings() {\n $cookies.putObject(DICESTREAM_COOKIE, settingsService.settings, {expires:new Date(2020, 1, 1, 1, 1, 1)});\n }",
"title": ""
},
{
"docid": "6a323bd7100e7e568e15dd2518cc28e1",
"score": "0.5519804",
"text": "function createConfigFile( obj ) {\n fs.writeFile( path.join( process.env.HOME, config.installDir, 'config.json' ), JSON.stringify( obj, null, 2 ), function( err ) {\n if ( err ) {\n new Error( 'Error writing config file' );\n return;\n }\n\n logger.log( 'Success', chalk.green( '✔' ) );\n final();\n });\n}",
"title": ""
}
] |
8f384e69bceabd9e1d2012bafb64a4b8 | [END welcomeIntent] [START futureJobIntent] | [
{
"docid": "cb7623c287b5f51f0a1cd690fe63c18f",
"score": "0.670807",
"text": "function futureJobIntent(agent) {\n const futureJob = agent.parameters['FutureJob_theme'];\n const gotFutureJob = futureJob.length > 0;\n\n if (gotFutureJob) {\n agent.add(` ${futureJob} 분야의 미래 직업 정보는 다음과 같습니다.`);\n agent.add(customSuggestions);\n } else if (!gotFutureJob) {\n const jobTypeSuggestions = new Suggestion({\n title: \"분야를 골라주세요.\",\n reply: \"의식주\",\n });\n jobTypeSuggestions.addReply_(\"건강\");\n jobTypeSuggestions.addReply_(\"디자인\");\n jobTypeSuggestions.addReply_(\"로봇\");\n jobTypeSuggestions.addReply_(\"바이오\");\n jobTypeSuggestions.addReply_(\"안전\");\n jobTypeSuggestions.addReply_(\"에너지\");\n jobTypeSuggestions.addReply_(\"연결\");\n\n agent.add(jobTypeSuggestions);\n\n\n }\n\n }",
"title": ""
}
] | [
{
"docid": "330e140ee5ab7261a28afa7f98986df5",
"score": "0.6028583",
"text": "function scheduleJob() {\n from_cl = document.getElementById('from_cl');\n\n parseCommand(from_cl.value, data => {\n getProjectId(projectId => {\n getApiKey(apiKey => {\n data.append('project', projectId);\n\n errback = data => from_cl.value = 'An error occurred. ' + data['message']\n callback = data => from_cl.value = 'Scheduled: ' + data['jobid']\n onLoad = () => load(from_cl)\n\n response = makeRequest(SCHEDULE_URL, 'POST', data, apiKey, callback, errback, onLoad);\n })\n })\n })\n}",
"title": ""
},
{
"docid": "5ef93f35455362d11bb39b660f222752",
"score": "0.5790689",
"text": "initJobs () {\n this.agenda.define('Send reminders', (job, done) => {\n const dataIn = job.attrs.data\n console.log(`data received...`)\n console.log(dataIn)\n done()\n })\n\n return this\n }",
"title": ""
},
{
"docid": "f6448095b81c00d67759e847b66c0662",
"score": "0.57701236",
"text": "function done() {\n console.log(\"Job's done!\");\n}",
"title": ""
},
{
"docid": "762d679110305337454a9413f52e5a75",
"score": "0.56874985",
"text": "function goodJob() {\n say('Good job exercising today!');\n minuteChecker.stop();\n}",
"title": ""
},
{
"docid": "98b16d7da64f06698668dc6ada989ba1",
"score": "0.56807035",
"text": "function start() { \n \tgw_job_process.UI(); \n \tgw_job_process.procedure();\n }",
"title": ""
},
{
"docid": "a163a01ec2b1bb691ef307852da22869",
"score": "0.5552165",
"text": "function spawn_job(_parent, job, a_contract_TwitterOracle, a_twitterAgent) {\n\treturn start_actor(_parent)(`_job-${job.queryId}`, Query, {\n\t\ta_contract_TwitterOracle,\n\t\ta_twitterAgent,\n\t\tjob,\n\t});\n}",
"title": ""
},
{
"docid": "261b4a186450792892c8e3cf5e192e9e",
"score": "0.55440354",
"text": "function whatDoYouDo(job, firstName) {}",
"title": ""
},
{
"docid": "981773c2d421d8381fac64d2958785d0",
"score": "0.5542511",
"text": "function scheduleQuestStart() {\n \n // Set these variables only once.\n var waitingTime = 4; // Time from quest initiation to launch\n var habId = \"#HabiticaUserID#\"; // Your Habitica API user ID\n var habToken = \"#HabiticaAPIToken#\"; // Your Habitica API key token\n \n // Useful variables. \n var driveFileName = \"Habitica-scheduleQuestStart.log\";\n var now = new Date();\n \n var getParamsTemplate = {\n \"method\" : \"get\",\n \"headers\" : {\n \"x-api-user\" : habId,\n \"x-api-key\" : habToken\n }\n }\n var postParamsTemplate = {\n \"method\" : \"post\",\n \"headers\" : {\n \"x-api-user\" : habId,\n \"x-api-key\" : habToken\n }\n }\n \n // Retrieve info about the current party quest.\n var urlRequest = \"https://habitica.com/api/v3/groups/party\";\n var response = UrlFetchApp.fetch(urlRequest, getParamsTemplate);\n var party = JSON.parse(response);\n var currentQuestKey = party.data.quest.key;\n var currentFileContent = now + \"\\n\" + currentQuestKey;\n \n // If there is a quest already active, there's nothing to do.\n // Last mod 15/10/2018: if it's inactive we might be sending a PM (see below)\n if (party.data.quest.active) {\n Logger.log(\"Quest already active.\");\n return\n }\n \n // Create the file if it doesn't exist.\n var files = DriveApp.getFilesByName(driveFileName);\n if (!files.hasNext()) {\n Logger.log(\"Creating Google Drive file...\");\n DriveApp.createFile(driveFileName, currentFileContent);\n return\n }\n \n // Retrieve information about previous script run.\n var driveFile = files.next();\n var driveFileContent = driveFile.getAs(\"text/plain\").getDataAsString().split(\"\\n\");\n var previousQuestDate = new Date(driveFileContent[0]);\n var previousQuestKey = driveFileContent[1];\n \n // If this is the first time there's no quest going on, send a PM to everybody.\n if (currentQuestKey == undefined) {\n Logger.log(\"No quest is currently active.\");\n if (previousQuestKey != \"undefined\") {\n Logger.log(\"Sending PM...\");\n sendPMs();\n // Update file so that we won't send the PM on the next trigger.\n driveFile.setContent(currentFileContent);\n }\n return;\n }\n \n // If this is a NEW inactive quest, then store the data in the file.\n if (currentQuestKey != previousQuestKey) {\n Logger.log(\"Found new inactive quest. Storing information...\")\n driveFile.setContent(currentFileContent);\n return\n }\n \n // If this is an OLD inactive quest, then check if we need to force-start it.\n var startTime = previousQuestDate;\n startTime.setHours(startTime.getHours() + waitingTime);\n if (now >= startTime) {\n Logger.log(\"Force-starting the quest...\");\n urlRequest = \"https://habitica.com/api/v3/groups/party/quests/force-start\";\n UrlFetchApp.fetch(urlRequest, postParamsTemplate);\n } \n else {\n Logger.log(\"Waiting for starting time for quest \" + currentQuestKey + \"...\");\n }\n}",
"title": ""
},
{
"docid": "3bb3a77e72f6cd5ddcdab40d02e3e19b",
"score": "0.5509289",
"text": "start() {\n this._nextJobMaybe();\n }",
"title": ""
},
{
"docid": "45a55f95a22b839d8ad7596ab8e99c38",
"score": "0.54959846",
"text": "function whatDo(job, firstName) {}",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "e1bc0718bc0fa0be236362713d9fb057",
"score": "0.54903805",
"text": "function start() {\n\n gw_job_process.UI();\n\n }",
"title": ""
},
{
"docid": "18fc5d6826bb6f1636bae8c90594f41c",
"score": "0.54534084",
"text": "async function didYou() {\n try {\n let prom1 = await newJob('24h')\n let prom2 = await giftCar();\n console.log(prom1)\n console.log(prom2);\n } catch (err){\n console.log(err);\n\n }\n}",
"title": ""
},
{
"docid": "b8a690731c26d263bc94cb1da545cf34",
"score": "0.5419528",
"text": "onJob(r) {\n return (0, api_1.doAction)(function* () {\n let id = Number(r.params.id); //XXX: this could be done with a check.\n let db = yield getMain();\n let collection = db.collection('jobs');\n let qry = { id, status: jobStatus.JOB_STATUS_ACTIVE };\n let mResult = yield (0, control_1.fork)((0, collection_1.findOne)(collection, qry));\n if (mResult.isNothing()) {\n return (0, tendril_show_wml_1.render)(new _404_1.NotFoundView({}), 404);\n }\n else {\n let job = mResult.get();\n return (0, tendril_show_wml_1.render)(new job_2.JobView({\n job,\n // TODO: Move this to a library function\n meta: [\n {\n property: 'og:site_name',\n content: 'Caribbean Developers'\n },\n { property: 'og:type', content: 'article' },\n { property: 'og:image', content: \"https://jobs.caribbeandevelopers.org/ogimg.png\" },\n { property: 'og:title', content: job.title },\n { property: 'og:description', content: job.type }\n ]\n }));\n }\n });\n }",
"title": ""
},
{
"docid": "a2a144cb393361b2d62f27c937cb6b04",
"score": "0.5404965",
"text": "function newJob(jobdata) {\n winston.info(\"[ace-http] Job started\");\n joblist.push(jobdata);\n\n // execute the job with Ace\n ace(jobdata.internal.epubPath, {'jobid': jobdata.internal.id, 'outdir': jobdata.internal.outputDir, 'lang': jobdata.internal.lang}, axeRunner)\n .then((jobData) => {\n var jobId = jobData[0];\n var idx = joblist.findIndex(job => job.internal.id === jobId);\n winston.info(\"[ace-http] Job finished \" + joblist[idx].internal.id);\n joblist[idx].public.status = JOBSTATUS.done;\n joblist[idx].public.report.zip = joblist[idx].public.job + \"/report/?type=zip\";\n joblist[idx].public.report.json = joblist[idx].public.job + \"/report/?type=json\";\n })\n .catch((jobid) => {\n var idx = joblist.findIndex(job => job.internal.id === jobid);\n winston.info(\"[ace-http] Job error \" + joblist[idx].internal.id);\n joblist[idx].public.status = JOBSTATUS.error;\n });\n}",
"title": ""
},
{
"docid": "4bb5eef42a0d0310fc378258b34c1113",
"score": "0.53425264",
"text": "function jobStart() {\n // Clear Current Job Info\n jobClear();\n\n // Get Current Job Info\n currentJob = JSON.parse(alt.Player.local.getSyncedMeta('job:Job'));\n currentPointIndex = alt.Player.local.getSyncedMeta('job:PointIndex'); // Always a number.\n\n // Store Point Info\n currentPoint = currentJob.points[currentPointIndex];\n parseJobInfo(currentPoint);\n\n // Turn on the Interval\n currentInterval = alt.setInterval(checkPoint, 100);\n\n // Turn on the Update\n isUpdateActive = true;\n\n interval = alt.setInterval(drawPointInfo, 0);\n}",
"title": ""
},
{
"docid": "41edde8a21652aefee1212ba0f0c99aa",
"score": "0.53247255",
"text": "function onLaunch(launchRequest, session, callback) { \n console.log(\"onLaunch requestId=\" + launchRequest.requestId + \", sessionId=\" + session.sessionId); \n // Dispatch to your skill's launch. \n getWelcomeResponse(callback); \n}",
"title": ""
},
{
"docid": "00d97a9df9699c116fd4db92af488ea4",
"score": "0.532308",
"text": "function onLaunch(launchRequest, session, callback) \r\n{\r\n console.log(\"onLaunch requestId=\" + launchRequest.requestId\r\n + \", sessionId=\" + session.sessionId);\r\n\r\n // Dispatch to your skill's launch.\r\n getWelcomeResponse(callback);\r\n}",
"title": ""
},
{
"docid": "b2a6c961ebb6ee79d987686fdcdad24a",
"score": "0.5297256",
"text": "function main () {\n getClient().then((jobsClient) => {\n assert(jobsClient, 'jobs instance not found.');\n\n companySample.createCompany(jobsClient, companySample.generateCompany()).then((companyInfo) => {\n const companyName = companyInfo.name;\n console.log('Company name:', companyName);\n\n const jobInfo = jobSample.generateJob(companyName);\n jobSample.createJob(jobsClient, jobInfo).then((info) => {\n // Wait for 10 secs for job to get indexed.\n setTimeout(() => {\n const query = 'System administrator';\n basicKeywordSearch(jobsClient, [companyName], query).then((result) => {\n assert(result.spellResult.correctedText === query);\n assert(result.matchingJobs.length === 1);\n assert(result.matchingJobs[0].job.jobTitle === query);\n });\n }, 10 * 1000);\n });\n });\n });\n}",
"title": ""
},
{
"docid": "36087527691304cdba7ed83d2542c4e0",
"score": "0.5270318",
"text": "function makenewjob() {\n \n // opens a dialog to allows addition of a new batch of associates\n // opens another dialog upon success to show added associates' info\n $mdDialog.show({\n templateUrl: \"html/templates/jobAdd.html\",\n controller: \"jobAddCtrl as jACtrl\",\n locals: { \"selectedUser\": mac.selectedUser },\n bindToController: true,\n clickOutsideToClose: true,\n escapeToClose: true\n }).then( function() {\n \t\n \t//prompt\n \tmac.toast(\"Job addition successful.\");\n }, function() {\n mac.toast(\"Job addition cancelled.\");\n });\n }",
"title": ""
},
{
"docid": "43875054df7d1bdfb230469208397987",
"score": "0.52467644",
"text": "function JSWcallBackH2(dict, replyObj) {\n var taskID = kony.application.beginBackgroundTask(\"UniqueTaskID\", cleanUp);\n var retDict = {};\n \t{\n if (dict.requestId == \"sayHello\") {\n retDict = {\n \t\"reply\": \"Hello, this is your iphone\"\n };\n \n kony.print(\"return dict:\" + retDict);\n replyObj.executeWithReply(retDict);\n kony.application.endBackgroundTask(taskID);\n } \n }\n}",
"title": ""
},
{
"docid": "a4d2ee0f14741671ed6a6123f69aba76",
"score": "0.52458817",
"text": "function openNewTask() {\n sendMessage({ command: \"openNewTask\" });\n}",
"title": ""
},
{
"docid": "04f59ac3dcc1d4f495616aeb7b552ca8",
"score": "0.52240646",
"text": "function scheduleJob() {\n schedule.scheduleJob('55 5 * * *',function () {\n leaderboard(\"841715854181138462\", client);\n });\n }",
"title": ""
},
{
"docid": "480a71f036f4172819b5bbbeb916f23d",
"score": "0.52225727",
"text": "function onJobReady(response) {\n\t\t\t\t\tconsole.log(\"----------> executed CB of getJob\");\n\t\t\t\t\tif (response.error) {\n\t\t\t\t\t\tconsole.error(\"----------> Error : \" + response.message);\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tCommandsMgr.startReplay(true, callback);// In case of error the start replay will return object with error\n\t\t\t\t\t}\n\t\t\t\t}",
"title": ""
},
{
"docid": "db83c3c9ab5a13b8057f53f5a66e1520",
"score": "0.5218945",
"text": "function initialiseJob(job) {\n job.on(cmaster.EVENTS.TICK_STARTED, wrapHandler(opts.handlers.tickStarted));\n job.on(cmaster.EVENTS.TICK_COMPLETE, wrapHandler(opts.handlers.tickComplete));\n job.on(cmaster.EVENTS.TIME_WARNING, wrapHandler(opts.handlers.timeWarning));\n job.on(cmaster.EVENTS.OVERLAPPING_CALL, wrapHandler(opts.handlers.overlappingCall));\n }",
"title": ""
},
{
"docid": "c0f800d51d8d097e4af046c31b7bc02a",
"score": "0.52146304",
"text": "function addJob(nameOfShow, hour, minute, dayofweek) {\n let time = `${minute} ${hour} * * ${dayofweek}`;\n scheduledJobs[nameOfShow][utils.getKeyByValue(DAY_OF_WEEK, dayofweek)] = \n schedule.scheduleJob(time, function(){\n t.checkForNewEpisode(nameOfShow, 'auto', function (results) {\n if (results.length === 0) {\n addIntervalCheck(nameOfShow);\n }\n });\n });\n}",
"title": ""
},
{
"docid": "b9d0744fb440912eb9caab966489e152",
"score": "0.52050054",
"text": "'GoogleAction.Finished'() {\n this.tell('The end');\n }",
"title": ""
},
{
"docid": "8c31e945d7d515291b888fc4f3445c0a",
"score": "0.5182632",
"text": "function onJobReady(response) {\n\t\t\t\t\tconsole.log(\"----------> executed CB of getJob\");\n\t\t\t\t\tif (response.error) {\n\t\t\t\t\t\tconsole.error(\"----------> Error : \" + response.message);\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!JobMgr.isJobReady()) {\n\t\t\t\t\t\t\tcallback && callback({error: true, message: \"Reconnect to the server\" });\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tConnectionMgr.sendToWS(\"startRecord\", \"mobile/record-started\", true, null, true, callback);\n\t\t\t\t\t}\n\t\t\t\t}",
"title": ""
},
{
"docid": "1daf45866521edd670877b8544df0cc5",
"score": "0.5167083",
"text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_module.startPage();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { month: -1 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate());\n }",
"title": ""
},
{
"docid": "8b6098feb8871ce479a7df381b44f2b7",
"score": "0.5165748",
"text": "function GreetingWorker() {}",
"title": ""
},
{
"docid": "9ec3704656a447007e948a5b2596cd2a",
"score": "0.5163544",
"text": "function executeActivity(workflow, args, callback) {\n\n workflow.getQueueWorker().releaseQueueWorker(\"Released\");\n workflow.status = \"waiting\";\n workflow.getQueueItem().status = \"waiting\";\n callback({ success: false });\n \n\n}",
"title": ""
},
{
"docid": "1b9d3126137d8647b9ad8799e117d02e",
"score": "0.5163334",
"text": "function tellFortune(jobTitle, geolocation, partner, numKids) {\n var future = 'You will be a ' + jobTitle + ' in ' + geolocation + ' and married to ' +\n partner + ' with ' + numKids + ' kids.';\n console.log(future);\n}",
"title": ""
},
{
"docid": "fb6a1dbaabb224285eb253125b657bf4",
"score": "0.516275",
"text": "function strategyEnd(){\r\n runningJob--;\r\n console.log( 'strategyEnd called : ' + runningJob);\r\n}",
"title": ""
},
{
"docid": "757c5ed53de5a80033b47650d1eda215",
"score": "0.5160383",
"text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { day: -30 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate(\"\"));\n //----------\n gw_com_module.startPage();\n\n if (gw_com_api.getPageParameter(\"rqst_no\") != \"\") {\n gw_com_api.setValue(\"frmOption\", 1, \"rqst_no\", gw_com_api.getPageParameter(\"rqst_no\"));\n processRetrieve({});\n }\n\n }",
"title": ""
},
{
"docid": "75c50001fe6ee1a05865c4421cefa3d6",
"score": "0.51575327",
"text": "async processIntent() {\n\n\t\tswitch (this.conversationData.intent) {\n\t\t\tcase \"appointment what is my schedule\":\n\t\t\t\tawait this.getAppointments();\n\t\t\t\tbreak;\n\t\t\tcase \"appointment show my schedule\":\n\t\t\t\tawait this.getAppointments();\n\t\t\t\tbreak;\n\t\t\tcase \"appointment send promotions\":\n\t\t\t\tawait this.promotionConvoManager();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"title": ""
},
{
"docid": "3743ac3c1a83186952039b10ce4ab438",
"score": "0.51573545",
"text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n gw_com_module.startPage();\n\n }",
"title": ""
},
{
"docid": "2fd87c2a8354577026fe2c4e5f630b37",
"score": "0.51506037",
"text": "function completeCallback(jobInfo) {\n $('#status').addClass('hidden');\n map.graphics.clear();\n gp.getResultData(jobInfo.jobId, \"watershed\", drawWatershed, failedCallback);\n gp.getResultData(jobInfo.jobId, \"reservoir\", drawReservoir);\n gp.getResultData(jobInfo.jobId, \"volume\", getVolume);\n /* The next line shows the workaround that I found. So in the python geoprocessing script you created, there\n are various arcpy.AddMessage() calls. Well, it turns out that the web service geoprocessing task writes\n those messages to the \"messages\" property of the jobInfo callback variable. I saw that on line 172 of your\n script (https://github.com/elisenavidad/FDC-Storage/blob/master/tethysapp/storage_capacity/public/arcgis/FDC_Storage2.py#L172)\n you called arcpy.AddMessage(results). Thus, the results were actually stored inside the jobInfo.messages\n array. By inspection, I found that it was stored in the 18th index (19th item) in the array. The actual\n text of the message is stored in the \"description\" property of the message.\n If you were wanting to convert the string to an actual list, you would use the eval() function I showed you.\n Like so:\n var results_list = eval(jobInfo.messages[18].description)\n */\n resultsRequestSucceeded(jobInfo);\n // gp.getResultData(jobInfo.jobId, \"results\", getResults);\n }",
"title": ""
},
{
"docid": "322970bcc8243923912b19144454edb0",
"score": "0.5147847",
"text": "_runJob(job, metadata) {\n debug('Processing %s, scheduled for %s', this.jobName, job.time);\n return Promise.resolve()\n .then(() => this.handler(job, metadata))\n .then(() => {\n debug('Completed %s, scheduled for %s', this.jobName, job.time);\n })\n .catch(error => {\n debug('Error processing %s, scheduled for %s', this.jobName, job.time);\n return Promise.reject(error);\n });\n }",
"title": ""
},
{
"docid": "cb9ea1938bc4e5617ff37edc546b085a",
"score": "0.51425076",
"text": "function welcome (agent) {\n\tagent.add(getTelegramButtons(__(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\"), actions))\n}",
"title": ""
},
{
"docid": "db447371b4ea594926efd3339bba8c19",
"score": "0.51384526",
"text": "static complete(request, result) {\r\n const job = {\r\n id: request.id,\r\n type: request.type,\r\n startTime: request.startTime,\r\n finishTime: performance.now(),\r\n args: request.args,\r\n result: result\r\n };\r\n return job;\r\n }",
"title": ""
},
{
"docid": "bf0cba7357b003c8bfe1a13709b1b1b6",
"score": "0.51300764",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "32e76f4057ee1ab88a33f0d2142f116f",
"score": "0.51271975",
"text": "function onLaunch(launchRequest, session, callback) {\r\n console.log(\"onLaunch requestId=\" + launchRequest.requestId + \", sessionId=\" + session.sessionId);\r\n\r\n // Dispatch to your skill's launch.\r\n getWelcomeResponse(callback);\r\n}",
"title": ""
},
{
"docid": "801a066449e3d8ae8b2edca28ea9651d",
"score": "0.51268816",
"text": "function myFunc(arg) {\n console.log(`exams is finished => ${arg}`);\n }",
"title": ""
},
{
"docid": "0c3a33baf882681f5f6e88097242583c",
"score": "0.51258326",
"text": "static async process(job) {\n return mail.sendMail(job.data)\n }",
"title": ""
},
{
"docid": "3716cdd007b4da81aafb4c77acd146ef",
"score": "0.5112721",
"text": "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n //----------\n gw_com_module.informSize();\n gw_com_module.startPage();\n //----------\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_fr\", gw_com_api.getDate(\"\", { day: -7 }));\n gw_com_api.setValue(\"frmOption\", 1, \"ymd_to\", gw_com_api.getDate());\n if (v_global.process.param != \"\") {\n gw_com_api.setValue(\"frmOption\", 1, \"eca_no\", gw_com_api.getPageParameter(\"eca_no\"));\n gw_com_api.setValue(\"frmOption\", 1, \"pmcfm_yn\", \"NULL\");\n processRetrieve({});\n }\n\n }",
"title": ""
},
{
"docid": "d55431ea52a1622204eb671add8de8a7",
"score": "0.51097655",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "531ba1e36902819720636c54a0c92702",
"score": "0.5105959",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "531ba1e36902819720636c54a0c92702",
"score": "0.5105959",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "c3afff2bcc77c4a9cdd2415ca7f903e6",
"score": "0.51051426",
"text": "function onLaunch(launchRequest, session, callback) {\n \n console.log(\"This is the onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "bc6c15df63bda20be66165bc0e80c920",
"score": "0.51019895",
"text": "function onLaunch(launchRequest, session, callback) {\r\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\r\n \", sessionId=\" + session.sessionId);\r\n\r\n // Dispatch to your skill's launch.\r\n getWelcomeResponse(callback);\r\n}",
"title": ""
},
{
"docid": "0b5e05178ea07b68f5cb257b761a9837",
"score": "0.51011145",
"text": "function actualJob () {\n console.log('Job wake up (4 seconds)');\n console.log('unlocked: ', databaseEntryUnlocked);\n // Deduct how much time has passed\n tokenTimeDelta -= 5;\n\n if (databaseEntryUnlocked) {\n // Query to the RingCentralAPI to see if there are any new messages\n\n // Lock when you enter\n databaseEntryUnlocked = false;\n\n if (tokenTimeDelta <= 0) {\n // Requeest a new token from RingCentral\n var options = {\n 'headers' : {\n 'Content-Type' : 'application/x-www-form-urlencoded',\n 'Authorization' : 'Basic V2R5YUc0OHZRRVN3eXR1VWROaXlnZzpLbjZvbURNalN3cVZaLS1CWlhNUGVBa1hsQm1qSWlRcldyOW1MWlMxRlpNdw=='\n },\n 'url' : 'https://platform.devtest.ringcentral.com/restapi/oauth/token',\n 'body' : 'grant_type=password&password=1landlineOnlineOrNoLine&username=+16618789015'\n };\n\n request.post(options, handleTokenRefresh);\n\n } else {\n\n // Gather all of our users\n\n // Make request to RingCental\n var auth_token = 'Bearer '.concat(tokenData.access_token);\n\n var options = {\n 'headers' : {\n 'Content-Type' : 'application/json',\n 'Authorization' : auth_token\n },\n 'url' : 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store',\n };\n\n request(options, handleRingCentralResponse(auth_token));\n }\n\n\n } else {\n // Still adding old data so do nothing\n }\n\n}",
"title": ""
},
{
"docid": "b9d5769c314cdb1afa021e5c6e6bebea",
"score": "0.5094356",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "b9d5769c314cdb1afa021e5c6e6bebea",
"score": "0.5094356",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "b9d5769c314cdb1afa021e5c6e6bebea",
"score": "0.5094356",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "b9d5769c314cdb1afa021e5c6e6bebea",
"score": "0.5094356",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "07fa262754378e66a8ac88c556021ca1",
"score": "0.5086748",
"text": "async NoIntent(){\n\t\t\tthis.say(`Ok. Let's start over.`)\n\t\t\treturn await this.toIntent('OpenAccountSlots.START')\n\t\t}",
"title": ""
},
{
"docid": "1508365b49c36649ecdbd6fd1b4f3e3f",
"score": "0.50852656",
"text": "async handleJobClick(action) {\n const {\n job,\n favoriteCompany,\n profile\n } = this.state;\n let {\n bid,\n booking\n } = this.state;\n let notification;\n\n // Is the Carrier this Company's favorite? If so, accepting the job\n // if (favoriteCompany.length > 0) {\n if (action === 'Accept') {\n const acceptedBid = await BidService.acceptBid(job.id, bid.id);\n job.status = \"Booked\";\n //console.log('finishing accepting');\n this.setState({\n job,\n bid: acceptedBid,\n booking\n });\n this.props.screenProps.setReloadJobs(true);\n } else if (action === 'Request') { \n // A non-favorite Carrier \"requests\" the job\n // console.log('carrier is not this company´s favorite, requesting');\n const response = await JobService.requestJob(job.id);\n job.status = 'Requested';\n // console.log('finishing request');\n this.setState({\n job,\n bid: response\n });\n } else if (action === 'Decline') {\n // A Carrier \"declines\" a job request\n const declinedBid = await BidService.declineBid(job.id, bid.id);\n this.setState({\n bid: declinedBid\n });\n this.props.screenProps.setReloadJobs(true);\n } else if (action === \"Cancel Request\") {\n try {\n await BidService.deleteBidbById(bid.id);\n this.setState({bid: null});\n this.props.navigation.goBack()\n } catch (err) {\n console.error(err);\n }\n }\n this.setState({actionLoader: false});\n this.props.screenProps.setReloadMarketplace(true);\n }",
"title": ""
},
{
"docid": "a8575a08a0ee438185728e0493465e7b",
"score": "0.5083445",
"text": "function JiraIntendbehaviour(intentRequest, callback) {\r\n\r\n // Die Variablen stellen die Notwendigen Daten da, welche aus der JSON-Datei gezogen werden\r\n const sessionAttributes = intentRequest.sessionAttributes;\r\n const slots = intentRequest.currentIntent.slots;\r\n const service = slots.Stormservices;\r\n const number = slots.Customernumber;\r\n const source = intentRequest.invocationSource;\r\n\r\n\r\n // Wird aufgerufen wenn der Request aus einem DialogCodeHook kam und sorgt für die richtige Weiterleitung und\r\n // Steuerung des Bots\r\n if(source === 'DialogCodeHook') {\r\n\r\n // Diese Funktion sorgt für die Überprüfung ob die Eingaben korrekt waren\r\n const validationResult = validateJiraBot(service, number);\r\n if (!validationResult.isValid) {\r\n // Sollte die Validierunfg fehlschlagen sorgt der elicitSlot dafür das der Benutzer informiert wird\r\n // Die richtige Eingabe zu tätigen\r\n slots[`${validationResult.violatedSlot}`] = null;\r\n callback(elicitSlot(sessionAttributes, intentRequest.currentIntent.name, slots, validationResult.violatedSlot, validationResult.message));\r\n return;\r\n }\r\n\r\n // Sollte die Validierung in Ordnung sein leitet dies die Gesprächskontrolle wieder an den Bot\r\n callback(delegate(sessionAttributes, intentRequest.currentIntent.slots));\r\n return;\r\n }\r\n\r\n // Wird aufgerufen wenn der Request aus einem FulfillmentCodeHook kam\r\n else\r\n {\r\n\r\n // Diese Funktion sorgt für das Erstellen eines Tickets\r\n createTicket(service, number, function(bool)\r\n {\r\n\r\n if(bool === true)\r\n {\r\n // Sollte alles geklappt haben bekommt der Benutzer eine positive Antwort vom Bot\r\n callback(close(sessionAttributes, 'Fulfilled',\r\n {\r\n 'contentType': 'PlainText',\r\n 'content': \"Your ticket has been created. We will try to solve the problem as soon as possible. Have a nice Day!\"\r\n }));\r\n }\r\n\r\n else\r\n {\r\n // Sollte etwas schiefgegangen sein bekommt der Benutzer eine negative Antwort vom Bot\r\n callback(close(sessionAttributes, 'Fulfilled',\r\n {\r\n 'contentType': 'PlainText',\r\n 'content': \"Unfortunately there was an error creating your ticket. Please contact us via E-Mail: support.storm@reply.de\"\r\n }));\r\n\r\n }\r\n\r\n });\r\n }\r\n\r\n}",
"title": ""
},
{
"docid": "e15a26bab24f8230a0426abec600dcd4",
"score": "0.50743806",
"text": "function jobCreateAny() {\n for(var x in gJobs) {\n if (!done[x]) {\n var kJob = g.kue_queue.create('galaxy-job', {\n galaxy_data: gJobs[x]\n })\n .state(convertGalaxyState(gJobs[x].state))\n .save(function(err){\n if (!err) {\n done[x] = true;\n console.log(kJob.data.galaxy_data.hid+\" adding job id = \"+kJob.id);\n \n Test.message(1, {message:\"job-add\",job:jData(kJob)});\n jobCreateAny(); // call again when we are done, to look for the next thingy\n }\n // todo: handle errors\n });\n return;\n }\n }\n }",
"title": ""
},
{
"docid": "6fd6f4584c86fd9f7fd38111c8d6d0c7",
"score": "0.50706106",
"text": "function startJob(job) {\n var id = job.id;\n jobIdx = id;\n if(job.burn == 1) {\n fs.writeFileSync(job.prefix+'.IMburn','y');\n }\n if(job.run == 1) {\n fs.writeFileSync(job.prefix+'.IMrun','y');\n }\n var e = spawn(job.args[0],job.args[1]);\n job.pid = e.pid;\n job.proc = e;\n e.stdout.setEncoding('utf-8');\n //Store stdout in job object, send to browser if job is selected\n e.stdout.on('data',function(data) {\n job.pipeout += data;\n if(id == jobIdx) {\n mainWindow.webContents.send('process_data',data);\n }\n });\n e.stderr.setEncoding('utf-8');\n //Handles signals for beginning/end of user-controlled burn/run modes\n e.stderr.on('data',function(data) {\n cLog(data);\n job.pipeout += data;\n if(id == jobIdx) {\n mainWindow.webContents.send('process_data',data);\n }\n });\n //Sends signal to browser to disable/enable appropriate buttons\n e.on(\"close\",function(code) {\n cLog('close '+code);\n var s = 'close '+code+', run complete';\n job.pipeout += s;\n if(id == jobIdx) {\n mainWindow.webContents.send('process_data',s);\n if(code == -1) {\n var IMA_PATH;\n if(os.platform() === 'win32') { IMA_PATH = IMA_PATH_WIN; }\n else { IMA_PATH = IMA_PATH_UNIX; }\n mainWindow.webContents.send('job_error',IMA_PATH);\n } else {\n mainWindow.webContents.send('end_job');\n }\n }\n job.status = 2;\n });\n e.on(\"stop\",function(code) {\n cLog('stop '+code);\n var s = 'stop '+code;\n job.pipeout += s;\n if(id == jobIdx) {\n mainWindow.webContents.send('process_data',s);\n }\n job.status = 1;\n });\n e.on(\"error\",function(err) {\n cLog('error '+err);\n if (id == jobIdx) {\n mainWindow.webContents.send('process_data',err);\n }\n job.status = 1;\n });\n}",
"title": ""
},
{
"docid": "61813578a0ad7fb8f6f510ccccde2d47",
"score": "0.50638026",
"text": "function jobCreateAny() {\n for(var x in gJobs) {\n if (!done[x]) {\n var kJob = g.kue_queue.create('galaxy-job', {\n galaxy_data: gJobs[x]\n })\n .state(convertGalaxyState(gJobs[x].state))\n .save(function(err){\n if (!err) {\n done[x] = true;\n console.log(kJob.data.galaxy_data.hid+\" adding job id = \"+kJob.id);\n \n sails.hooks['jbcore'].sendEvent(\"job-add\",{job:jData(kJob)});\n jobCreateAny(); // call again when we are done, to look for the next thingy\n }\n // todo: handle errors\n });\n return;\n }\n }\n }",
"title": ""
},
{
"docid": "696113fd3128d7c09dd0bcd911634b26",
"score": "0.5054422",
"text": "onComplete() {\n console.log('Bork bork bork!');\n }",
"title": ""
},
{
"docid": "047a87220af55e2c64789fb5edd0c34a",
"score": "0.5051362",
"text": "function start() {\n\n gw_job_process.UI();\n\n v_global.logic.proj_no = gw_com_api.getPageParameter(\"proj_no\");\n gw_com_api.setValue(\"frmOption\", 1, \"proj_no\", v_global.logic.proj_no);\n\n processRetrieve({});\n\n }",
"title": ""
},
{
"docid": "f93dabe946fc1e9878883c144ec02b1f",
"score": "0.5048336",
"text": "bundleBuildEnded(event, duration) {}",
"title": ""
},
{
"docid": "fca57b8f1181d82b8e560c18ba24b05c",
"score": "0.504406",
"text": "async function main() {\n const server = new RedisServer(REDIS_SERVER_PORT);\n await server.open();\n\n const queue = new Bee('name_of_my_queue', {\n activateDelayedJobs: true,\n redis: {\n port: REDIS_SERVER_PORT,\n },\n });\n\n // Fake process function to move newly created jobs in the UI through a few of the job states.\n queue.process(async function () {\n // Wait 5sec\n await new Promise((res) => setTimeout(res, 5000));\n\n // Randomly succeeds or fails the job to put some jobs in completed and some in failed.\n if (Math.random() > 0.5) {\n throw new Error('fake error');\n }\n });\n\n // adding delayed jobs\n await queue\n .createJob({})\n .delayUntil(Date.now() + 60 * 1000)\n .save();\n\n const job = await queue.createJob({}).save();\n\n Arena(\n {\n Bee,\n\n queues: [\n {\n // Required for each queue definition.\n name: 'name_of_my_queue',\n\n // User-readable display name for the host. Required.\n hostId: 'Queue Server 1',\n\n // Queue type (Bull or Bee - default Bull).\n type: 'bee',\n\n redis: {\n // host: 'localhost',\n port: REDIS_SERVER_PORT,\n },\n },\n ],\n },\n {\n port: HTTP_SERVER_PORT,\n }\n );\n}",
"title": ""
},
{
"docid": "c8698df774ee45c964e655ad91f0327e",
"score": "0.5042769",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(\"onLaunch requestId=\" + launchRequest.requestId +\n \", sessionId=\" + session.sessionId);\n\n // Dispatch to your skill's launch.\n console.log(JSON.stringify(launchRequest));\n getWelcomeResponse(session, callback);\n}",
"title": ""
},
{
"docid": "1a11c3266fa38603cfc3b46c1596a0df",
"score": "0.5042439",
"text": "static get key () {\n return 'NewEventMail-job'\n }",
"title": ""
},
{
"docid": "886e199e466c0340167ee520e82e0148",
"score": "0.5039193",
"text": "doWork() {\r\n return \"complete!\";\r\n }",
"title": ""
},
{
"docid": "f822f7f4e9f3c32e5f7ed4e0a0b188f5",
"score": "0.5038394",
"text": "function onIntent(intentRequest, session, callback) {\r\n\r\n console.log(intentRequest);\r\n let intent = intentRequest.intent;\r\n let intentName = extractValue('PreviousIntent', intent, session);\r\n\r\n console.log('CURRENT Intent is ' + intent.name);//pega o nome da intenção atual\r\n console.log('PREVIOUS intent was ' + intentName);//pega o nome da intenção antiga se tiver\r\n\r\n if (\"AMAZON.StopIntent\" === intent.name ||\r\n \"AMAZON.CancelIntent\" === intent.name || \"NaoQuerer\" === intent.name) {\r\n handleSessionEndRequest(callback);\r\n }\r\n\r\n if (intentName === null) {\r\n intentName = intent.name;\r\n }\r\n\r\n if (intent.name === \"descricao\" || intent.name === \"etapas\" || intent.name === \"requisitos\" || intent.name === \"link\"\r\n || intent.name === \"horario\" || intent.name === \"area_responsavel\" || intent.name === \"enderecos\") {\r\n\r\n getService(intent, session, callback);\r\n } else {\r\n // Dispatch to your skill's intent handlers\r\n switch (intentName) {\r\n case \"DigaOi\":\r\n sayHello(intent, session, callback);\r\n break;\r\n\r\n case \"Obrigado\":\r\n sayDeNada(intent, session, callback);\r\n break;\r\n\r\n case \"AMAZON.HelpIntent\":\r\n getWelcomeResponse(callback);\r\n break;\r\n\r\n case \"AMAZON.NavigateHomeIntent\":\r\n getWelcomeResponse(callback);\r\n break;\r\n\r\n default:\r\n throw \"Invalid intent\";\r\n }\r\n }\r\n}",
"title": ""
},
{
"docid": "333a8b039dd5377d0a2ce4e1253f91eb",
"score": "0.50278264",
"text": "function onLaunch(launchRequest, session, callback) {\n //console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "57b1d24cc975ca95b971a979e95dadd8",
"score": "0.50261354",
"text": "function popupGo() {\n\n // Attempt to parse the allowed URL regex.\n var allowedText = popupDoc.getElementById('regex').value;\n\n var job;\n for (var i = 0; i < jobs.length; i++) {\n if (jobs[i].allowedText == allowedText) {\n job = jobs[i];\n break;\n }\n }\n\n if (!job) {\n job = new Job();\n jobs.push(job);\n }\n\n // Rename title of any previous results so we don't edit them.\n var resultsWindows = chrome.extension.getViews({\n type: 'tab'\n });\n for (var x = 0; x < resultsWindows.length; x++) {\n var doc = resultsWindows[x].document;\n if (doc.title == RESULTS_TITLE) {\n doc.title = RESULTS_TITLE + ' - Closed';\n }\n }\n\n job.allowedText = allowedText;\n\n try {\n job.allowedRegex = new RegExp(job.allowedText);\n } catch (e) {\n alert('Restrict regex error:\\n' + e);\n popupStop();\n return;\n }\n\n // Save settings for checkboxes.\n job.allowPlusOne = popupDoc.getElementById('plusone').checked;\n job.allowArguments = !popupDoc.getElementById('arguments').checked;\n job.checkInline = popupDoc.getElementById('inline').checked;\n job.checkScripts = popupDoc.getElementById('scripts').checked;\n job.verboseInline = popupDoc.getElementById('verboseInline').checked;\n job.verboseScripts = popupDoc.getElementById('verboseScripts').checked;\n\n\n // Add the start page to the todo list.\n var startPage = popupDoc.getElementById('start').value;\n job.startPage = startPage;\n job.pagesTodo[startPage] = '[root page]';\n\n\n // Start spidering.\n job.started = true;\n job.storeJob();\n spiderPage(job);\n}",
"title": ""
},
{
"docid": "696334cf5ace94a8b1b4fbfdc859ff6b",
"score": "0.50261253",
"text": "_handleButtonOpen()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RUNJOB_ACQUIRE, {runjob: this.model});\n }",
"title": ""
},
{
"docid": "8dce38b0710bc8ff2ce907cb54b1890d",
"score": "0.5019861",
"text": "function create() {\n var name = [ 'tobi', 'loki', 'jane', 'manny' ][ Math.random() * 4 | 0 ];\n console.log( '- creating job for %s', name );\n jobs.create( 'video conversion', {\n title: 'converting ' + name + '\\'s to avi', user: 1, frames: 200\n } ).save();\n setTimeout( create, Math.random() * 3000 | 0 );\n}",
"title": ""
},
{
"docid": "63476e78d182b17d492dc9d9ff16a078",
"score": "0.5008079",
"text": "function onLaunch(launchRequest, session, callback) {\r\n console.log(\"onLaunch requestId=\" + launchRequest.requestId + \", sessionId=\" + session.sessionId);\r\n // Dispatch to skill's launch.\r\n getWelcomeResponse(callback);\r\n}",
"title": ""
},
{
"docid": "fa451c02c829f23c831f9b9cf46e1fc8",
"score": "0.50039417",
"text": "static get key () {\r\n return 'JobSendMail-job'\r\n }",
"title": ""
},
{
"docid": "8d5219aeefcdbdcf60981d31717d572d",
"score": "0.4999063",
"text": "fireJobs() {\r\n this.syncDailyTasks();\r\n }",
"title": ""
},
{
"docid": "f2dcbacbae658f8dca6a45e7c13add8c",
"score": "0.4990277",
"text": "onSparkJobStart(data) {\n this.numActiveJobs += 1;\n this.badgesmodified = true;\n this.appId = data.appId;\n const name = $('<div>')\n .text(data.name)\n .html()\n .split(' ')[0]; // Escaping HTML <, > from string\n this.jobData[data.jobId] = {\n id: data.jobId,\n start: new Date(data.submissionTime),\n name,\n status: data.status,\n stageIds: data.stageIds,\n numTasks: data.numTasks,\n numActiveTasks: 0,\n numCompletedTasks: 0,\n numFailedTasks: 0,\n numStages: data.stageIds.length,\n numActiveStages: 0,\n numCompletedStages: 0,\n numFailedStages: 0,\n numSkippedStages: 0,\n modified: true,\n };\n data.stageIds.forEach(stageid => {\n if (!this.stageIdtoJobId[stageid]) this.stageIdtoJobId[stageid] = [];\n this.stageIdtoJobId[stageid].push(data.jobId);\n const stageName = $('<div>')\n .text(data.stageInfos[stageid].name)\n .html()\n .split(' ')[0]; // Hack for escaping HTML <, > from string.\n this.stageData[stageid] = {\n id: stageid,\n status: 'PENDING',\n job: data.jobId,\n name: stageName,\n numTasks: data.stageInfos[stageid].numTasks,\n numActiveTasks: 0,\n numCompletedTasks: 0,\n numFailedTasks: 0,\n modified: true,\n };\n });\n if (name === 'null') {\n const laststageid = Math.max.apply(null, data.stageIds);\n this.jobData[data.jobId].name = this.stageData[laststageid].name;\n }\n if (!this.initialDisplayCreated) {\n this.createDisplay();\n this.initialDisplayCreated = true;\n }\n if (this.timeline) this.timeline.onSparkJobStart(data);\n if (this.taskchart) this.taskchart.onSparkJobStart(data);\n }",
"title": ""
},
{
"docid": "ba7508e253351d133385a74aa037d936",
"score": "0.49883816",
"text": "initAutoTasksProcess(timeZone) {\n let job = new CronJob(\n TIME_TO_SCHEDULE,\n async () => {\n this.processImportTasks();\n },\n null,\n true,\n timeZone\n );\n console.log(\n `[${moment(new Date()).format(\n \"YYYY-MM-DD HH:mm:ss\"\n )}] :: Cron init SCHEDULE Tasks job: ${\n job.running\n }, timezone: ${timeZone}`\n );\n }",
"title": ""
},
{
"docid": "4c2cd51eccdb07307bece2644966a22d",
"score": "0.49857083",
"text": "add(job) {\n this.jobs.push(job);\n this[kRun]();\n }",
"title": ""
},
{
"docid": "a2726dd94fc53e1c8c14bdad4ac8bbe9",
"score": "0.49667305",
"text": "async function emailHandler (job) {\n // do some emailing\n return await sendSomeEmails(job.data)\n}",
"title": ""
},
{
"docid": "4c2de0337f7ba6ac7f9257f94d7daa87",
"score": "0.4963082",
"text": "function action(args, env) {\n\n // Prompt for new tasks\n if ( args.length === 0 ) {\n prompt('New Task:', _promptFinished);\n }\n\n // Add provided task\n else {\n _process(args[0].join(' '));\n }\n\n}",
"title": ""
},
{
"docid": "62307dc0d7ab6609caadc8d862d88d99",
"score": "0.49607438",
"text": "destination_do_send_to_job(from_job_instance){\n let params = this\n var to_job_instance = Job.instruction_location_to_job(params.where_to_insert, false)\n if (!to_job_instance) { to_job_instance = from_job_instance }\n if (to_job_instance === from_job_instance) { this.wait_until_done = false } //when a job is inserting code into itself,//we don't want it to hang waiting for itself.\n\n //first, add destination_send_to_job_is_done to do_items if need be.\n let do_items = params.do_list_item\n var notify_item = null\n if (params.wait_until_done){\n //var send_back_obj = {from_job_name: params.from_job_name,\n // from_instruction_id: params.from_instruction_id,\n // status_variable_name: params.status_variable_name\n // }\n var notify_item = new Instruction.destination_send_to_job_is_done(params)\n //notify_item is appeneded to the end of do_items, and the whole array of instructions\n //stuck into the destination job's do_list\n if (do_items == null){\n do_items = notify_item\n }\n else if (Instruction.is_oplet_array(do_items)){\n if(notify_item){\n do_items = [do_items, notify_item]\n }\n }\n else if (Instruction.is_instructions_array(do_items)){\n if(notify_item){\n do_items = do_items.slice(0).push(notify_item)\n }\n }\n else { //typically a function.\n if(notify_item){\n do_items = [do_items, notify_item]\n }\n }\n }\n // next, bundle do_items into a sent_from_job instruction and stick it on the to_job\n let sfj_ins = new Instruction.sent_from_job({do_list_item: do_items,\n from_job_name: from_job_instance.name,\n from_instruction_id: from_job_instance.program_counter,\n where_to_insert: params.where_to_insert, //just for debugging\n wait_until_done: params.wait_until_done //just for debugging\n })\n Job.insert_instruction(sfj_ins, params.where_to_insert) //must do before starting or unsuspending\n if (to_job_instance.status_code == \"not_started\"){\n if(params.start){\n to_job_instance.start() //{initial_instruction: sfj_ins} //commented out because its redunant with insert_instruction and would put sfj_ins on to_job twice\n\n }\n }\n if (to_job_instance.status_code == \"suspended\"){\n if(params.unsuspend){\n to_job_instance.unsuspend()\n //this.set_up_next_do(1) //don't do this because unsuspend does it.\n }\n }\n //don't do this as to_job should already be running.\n //else{\n // to_job_instance.set_up_next_do(1)\n //}\n }",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "22c356763f4aa8fed00f5c61601abde7",
"score": "0.49581453",
"text": "function onLaunch(launchRequest, session, callback) {\n console.log(`onLaunch requestId=${launchRequest.requestId}, sessionId=${session.sessionId}`);\n\n // Dispatch to your skill's launch.\n getWelcomeResponse(callback);\n}",
"title": ""
},
{
"docid": "1957f04ca2dfa00129e20d6f85935592",
"score": "0.49457476",
"text": "async function testSimple3(){\n\tvar dt = new Date();\t\n\tvar y = await schedulerClient.run({className:'softwareDevelopment',name:'newFeature',args:[{name:\"new f1\"}],id:'test1' + dt});\n\tconsole.log(\"y = \",y);\n\tstopAll();\n}",
"title": ""
},
{
"docid": "e06e5a417184b16448f4bf7e4ad07f11",
"score": "0.49448422",
"text": "queueJob(url, msg, cb, ctx, failure, success) {\n\t\tconst newId = ++this.globalMsgId\n var job = {\n \"url\": url, // TODO make to name of fn\n \"msg\": msg, // argument of fn\n \"cb\" : cb,\n \"failure\": failure,\n \"success\": success,\n \"ctx\": ctx,\n \"id\": newId\n };\n this.jobs.push(job);\n\t\tconst thiz = this;\t\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tthiz.resolves[newId] = resolve\n\t\t\tthiz.rejects[newId] = reject\n\t\t\tif (thiz.workers < thiz.size) thiz.nextJob();\n\t\t}) \n }",
"title": ""
},
{
"docid": "180d4d84946192c51b3c729580ef0560",
"score": "0.49433059",
"text": "constructor(job) {\n\t\tthis.job = job;\n\t}",
"title": ""
}
] |
5ccd234cbba843f93352bb8c23d93693 | eliminate colinear or duplicate points | [
{
"docid": "59003afafa890cb8613bcd5abd235be1",
"score": "0.0",
"text": "function filterPoints( start, end ) {\n\n\tif ( ! start ) return start;\n\tif ( ! end ) end = start;\n\n\tlet p = start,\n\t\tagain;\n\tdo {\n\n\t\tagain = false;\n\n\t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n\t\t\tremoveNode( p );\n\t\t\tp = end = p.prev;\n\t\t\tif ( p === p.next ) break;\n\t\t\tagain = true;\n\n\t\t} else {\n\n\t\t\tp = p.next;\n\n\t\t}\n\n\t} while ( again || p !== end );\n\n\treturn end;\n\n}",
"title": ""
}
] | [
{
"docid": "619b7ca6b8d9ebd5869755a8d3f9ed86",
"score": "0.66145957",
"text": "function removeDuplicates() {\n // Split array of coordinates into x- & y- coordinate arrays\n let xCoords = adjList.map(coord => coord[0]);\n let yCoords = adjList.map(coord => coord[1]);\n\n // Used to map ordinate's value to indices\n let xMap = {};\n\n xCoords.forEach((x, idx) => {\n if (xMap[x]) xMap[x] = [...xMap[x], idx];\n else xMap[x] = [idx];\n });\n\n // Used to tag potential duplicates\n let pDups = {};\n\n // Used to save duplicates' indices\n let dupIndices = [];\n\n // Retrieve duplicates\n for (let x in xMap) {\n if (xMap[x].length > 1) {\n xMap[x].forEach(idx => {\n if (yCoords[idx] in pDups) {\n dupIndices = [...dupIndices, idx];\n } else {\n pDups[yCoords[idx]] = idx;\n }\n });\n }\n pDups = {};\n }\n\n // Sorting from largest to smallest lets us splice duplicates\n // | in decreasing order of indices. This lets us modify array\n // | w/o modifying the indices of previous coordinates\n dupIndices.sort((el1, el2) => el1 < el2);\n\n // Remove duplicates\n dupIndices.forEach(idx => adjList.splice(idx, 1));\n }",
"title": ""
},
{
"docid": "f05c52036a1861cf4580d2e44e6781ce",
"score": "0.6516679",
"text": "function prunePoints() {\n var outputPoint = 0;\n\n for (var inputPoint = 0; inputPoint < pointCount; inputPoint++) {\n var outputIndex = outputPoint * 2;\n\n if (pointStatus[inputPoint] == 1) {\n // Only if pruning is needed\n if (outputPoint < inputPoint) {\n var inputIndex = inputPoint * 2;\n curxy[outputIndex] = curxy[inputIndex];\n curxy[outputIndex + 1] = curxy[inputIndex + 1];\n }\n // Update locs array\n locs[outputIndex].moose(curxy[outputIndex], curxy[outputIndex + 1]);\n outputPoint++;\n }\n }\n pointCount = outputPoint;\n}",
"title": ""
},
{
"docid": "61301072690cbfbe7afde45421ff9230",
"score": "0.6467383",
"text": "function cleanedUpCheck(d, h) {\n for (let i = 0; i < d.length; i++) \n if (h.x == d[i].x && h.y == d[i].y) {\n let index = d.indexOf(d[i]);\n d.splice(index, 1);\n return true;\n }\n return false;\n}",
"title": ""
},
{
"docid": "863e9f461e1278d2ecd837c910adaa15",
"score": "0.6121947",
"text": "function remove_tile(x1, x2, y1, y2) {\n for (var i = x1 - 10; i < x1 + 10; i++) {\n for (var j = y1 - 10; j < y1 + 10; j++) {\n if (i < x1 - 1 || i > x2 + 1 || j < y1 - 1 || j > y2 + 1) {\n $('[data-x=\"' + i + '\"][data-y=\"' + j + '\"]').remove();\n };\n };\n };\n }",
"title": ""
},
{
"docid": "6a43d255ea56f09f147ac484f3bf74a2",
"score": "0.6028371",
"text": "function removeDoubles() {\n const TILE_SIZE = 10;\n const tiles = [];\n const doubles = [];\n for(let idx = 0; idx < point_count; idx++) {\n const point = getPointAt(idx);\n if(point) {\n const tileX = Math.round(point.x/TILE_SIZE);\n const tileY = Math.round(point.y/TILE_SIZE);\n const tile = tiles.find(tile => tile.x === tileX && tile.y === tileY);\n if(tile) {\n doubles.push(point);\n }\n else tiles.push({x: tileX, y: tileY});\n }\n }\n doubles.forEach(point => removePointAt(point.idx));\n}",
"title": ""
},
{
"docid": "5d2352a9d01ca7974d3bc09ff1445dcd",
"score": "0.5987154",
"text": "removeChemokine () {\n for (var x = 0; x < this.size; x++) {\n\t for (var y = 0; y < this.size; y++) {\n \t for (var z = 0; z < this.size; z++) {\n \t\t\t\tif ( x == y && x == z && y == z && x == this.field_size.x/2) {\n this.chemlvl[x][y][z] *= 0.95\n \t\t\t\t}\n \t\t\t}\n }\n\t\t}\n\t}",
"title": ""
},
{
"docid": "2b18a445bb57f517a569fbd8c6921e56",
"score": "0.59679157",
"text": "function removeDiamondCoordinate(x, y) {\n for (var i = 0; i < state.diamondCoordinate.length; i++) {\n if (state.diamondCoordinate[i][0] === x && state.diamondCoordinate[i][1] === y) {\n state.diamondCoordinate.splice(i, 1)\n break;\n }\n }\n}",
"title": ""
},
{
"docid": "a41df70f81ca151cff096e0024b406ab",
"score": "0.59040475",
"text": "function eliminarObjetoPiezaComida(piezasColor, x, y) {\n let posicion = undefined;\n piezasColor.find((pos, i) => {\n if (pos.x === x && pos.y === y) {\n piezasColor.splice(i, 1);\n posicion = i;\n return true; // Parar la busqueda\n }\n });\n return posicion;\n}",
"title": ""
},
{
"docid": "0a7aa6df91edac64e9e6cd912beefd97",
"score": "0.5852715",
"text": "removeOverlapLines(lines){\n let newLines = []\n let removedOverlap = false\n for(let line of lines){\n let inside = true;\n for(let point of line){\n\n //debugRect2(point.position(),10,10,\"red\",\"red\")\n if(!this.insideCursor(point.position())){\n inside = false\n break;\n }\n }\n if(!inside) {\n newLines.push(line)\n }else{\n removedOverlap = true\n }\n\n }\n\n if(!removedOverlap) return true\n\n return newLines\n }",
"title": ""
},
{
"docid": "1318aa53fcec3a851d348408233201ee",
"score": "0.5845675",
"text": "removePathPoint(point) {\n let i = this._pathPoints.indexOf(point);\n if (i > -1)\n this._pathPoints.splice(i, 1);\n else {\n console.warn(\"this point is not part of the connector\");\n }\n }",
"title": ""
},
{
"docid": "8c5c23b32db3c4a0bc8f191fcdf3eccc",
"score": "0.5832524",
"text": "function eraseDataPointHighlights() {\n\t verticalMarkerContainer.selectAll('.circle-container').remove();\n\t }",
"title": ""
},
{
"docid": "689d971e6c60181078f2cf721d322d9a",
"score": "0.5822791",
"text": "function removePoly() {\n\tif (vertArr.length < 18) { return } // already at 1 poly\n\tvar index = floor( vertArr.length/9 * rand() )\n\tvertArr.splice(index*9, 9)\n\tcolArr.splice(index*12, 12)\n}",
"title": ""
},
{
"docid": "5155bff9483e9f1ac98aea7f21d4ea91",
"score": "0.5765673",
"text": "function clearHighlightPoints() {\n svgElement.selectAll(\"path.nv-point\").remove();\n }",
"title": ""
},
{
"docid": "1e2ef4fc30da8f7ba3904abed25b2e9f",
"score": "0.57428086",
"text": "removeCoord(id) {\n this.availCoords = this.availCoords.filter(coord => coord !== id);\n this.possibleTargets = this.possibleTargets.filter(coord => coord !== id);\n }",
"title": ""
},
{
"docid": "873737006a2a975486e62f0605d51e28",
"score": "0.57243854",
"text": "function cleanDataPointHighlights() {\n\t verticalMarkerContainer.selectAll('.circle-container').remove();\n\t }",
"title": ""
},
{
"docid": "5a80fa8f644be224f00e8990448d8c81",
"score": "0.57178974",
"text": "function delBoldNeighbours(img, idx, crucialPoints){\r\n var triplePoint = true\r\n var tempRow = Math.floor(idx / img.width / 4);\r\n var tempCol = Math.floor((idx % (img.width * 4) / 4));\r\n for (i = 0; i < boldNeighbours.length; i++){\r\n temp1 = ((tempRow + boldNeighbours[i][0][1]) * img.width * 4)+ ((tempCol + boldNeighbours[i][0][0]) * 4)\r\n temp2 = ((tempRow + boldNeighbours[i][1][1]) * img.width * 4)+ ((tempCol + boldNeighbours[i][1][0]) * 4)\r\n if (img.data[temp1] == 255 && img.data[temp2] == 255 && !(crucialPoints.includes(temp2))){\r\n img.data[temp2] = 0\r\n img.data[temp2 + 1] = 0\r\n img.data[temp2 + 2] = 0\r\n }\r\n }\r\n}",
"title": ""
},
{
"docid": "957548a0e55c4e2f215a554cfdb4506b",
"score": "0.56999415",
"text": "function doThings(points) {\n // get closest\n closest = Array.from(points).sort((a, b) => a[0] > b[0] ? 1 : 0).sort((a, b) => a[1] > b[1] ? 1 : 0)[0]\n\n // from the closest, iterate through threshold. if we don't have it, kill\n for (var dx = closest[0]; dx < closest[0] + threshold; dx++) { // x then y, performance\n for (var dy = closest[1]; dy < closest[1] + threshold; dy++) {\n if (!points.has(tuple(dx, dy))) {\n // does not have\n points.forEach(function(point){\n if (point[1] == dy ||point[0] == dx) {\n points.delete(point);\n }\n });\n return -1 // todo: remove from set all from y\n }\n }\n }\n return closest;\n}",
"title": ""
},
{
"docid": "4add52d4cc3b5d14d09e9d9a155ce367",
"score": "0.569468",
"text": "_removePoint() {\n if (this._fixedPoints.length) this._fixedPoints.pop();\n this.data.points = this._fixedPoints;\n }",
"title": ""
},
{
"docid": "8c19a3d9f498a308fb60441e4dd61637",
"score": "0.56676424",
"text": "removePoints() {\n if (this.points !== null) {\n this.points.deletePointCloud()\n this.points = null\n }\n }",
"title": ""
},
{
"docid": "8c19a3d9f498a308fb60441e4dd61637",
"score": "0.56676424",
"text": "removePoints() {\n if (this.points !== null) {\n this.points.deletePointCloud()\n this.points = null\n }\n }",
"title": ""
},
{
"docid": "b9c92549c9799c383a6cfba4dea9778e",
"score": "0.56250584",
"text": "function removewall(a,b)\n{\n var x= b.i-a.i;\n var y = b.j-a.j;\n if(x==1) {\n a.wall[1]=0;b.wall[3]=0;\n }\n if(x==-1) {\n a.wall[3]=0;b.wall[1]=0;\n }\n if(y==1) {\n a.wall[2]=0;b.wall[0]=0;\n }\n if(y==-1) {\n a.wall[0]=0;b.wall[2]=0;\n }\n}",
"title": ""
},
{
"docid": "f8bcd5322fbfbd2ec01abfe0bdac9a07",
"score": "0.5621451",
"text": "function clearPoint(grid_ident, row, col) {\n \"use strict\";\n return $(grid_ident + row + col).css('background-color', 'white');\n}",
"title": ""
},
{
"docid": "1f78023f8afb105022993275d42da4bf",
"score": "0.56205046",
"text": "function clean_space() {\n for (var y = 0; y < length_y; y++) {\n for (var x = 0; x < length_x; x++) {\n if (count_neighbours(x, y) < 2) {\n if (is_empty(y, x) == false) {\n my_map[y][x] = 1; // empty it\n }\n }\n\n }\n }\n}",
"title": ""
},
{
"docid": "4c760ab91620534c221f7f8b158b1795",
"score": "0.56142986",
"text": "function removeHighlightingFromPoints() {\n var hueValue = self.config().colorModel.hue;\n var selectedGroup = self.detectionContainer().select('.' + self.config().selectedPathClass);\n selectedGroup.classed(self.config().selectedPathClass, false);\n changeColorHueValueOnPoints(selectedGroup, hueValue);\n }",
"title": ""
},
{
"docid": "fdd7bd2eb28535b28f5e53679c2ecd30",
"score": "0.56001985",
"text": "removeTile() {\r\n for (let col = 0; col < COLUMNS; col++) {\r\n for (let row = 0; row < ROWS; row++) {\r\n if (this.grid[col][row].value === COLUMNS*ROWS) {\r\n this.grid[col][row].missing = true;\r\n return {\r\n x: col,\r\n y: row\r\n };\r\n }\r\n }\r\n }\r\n }",
"title": ""
},
{
"docid": "41d9f61bbe57231447146b26c447d8cc",
"score": "0.5549423",
"text": "removeConnectedTiles(row, col) {\n let tiles = this.getConnectedTiles(row, col);\n\n tiles.forEach(function(tile) {\n this.tiles[tile.row][tile.col].isEmpty = true;\n }, this);\n }",
"title": ""
},
{
"docid": "9195a05cabaa69b53cab772db887ca68",
"score": "0.5539867",
"text": "function removeOldInformation() {\n //Removes the previous neighbors info\n while (neighborPoints.length > 0) {\n var temp = neighborPoints.pop();\n temp.hide();\n }\n //Remove your previous information\n while (yourPoints.length > 0) {\n var temp = yourPoints.pop();\n temp.hide();\n }\n}",
"title": ""
},
{
"docid": "451e16e4914b5da20249357703540be0",
"score": "0.5517694",
"text": "function areAllPointsDifferent(ps) {\n for (let i = 0; i < ps.length - 1; i++) {\n for (let j = i + 1; j < ps.length; j++) {\n if (ps[i][0] === ps[j][0] && ps[i][1] === ps[j][1]) {\n return false;\n }\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "540a9e28be030c0ab7f14025f3a1ef61",
"score": "0.5490928",
"text": "_createGroupSpots(col_data, row_data, prev_spots){\n const output = [];\n // array of cols\n if(Array.isArray(col_data)){\n for(const col_i of col_data){\n output.push([col_i, row_data]);\n }\n }\n // Array of rows\n else{\n for(const row_i of row_data){\n output.push([col_data, row_i]);\n }\n }\n\n // Removing duplicates\n if(prev_spots){\n return output.filter(spot=>!prev_spots.some(prev_spot=>prev_spot[0]===spot[0]&&prev_spot[1]===spot[1]));\n }\n return output;\n }",
"title": ""
},
{
"docid": "ef047c61cf4a2b1d072f74ba3220555f",
"score": "0.54832643",
"text": "function cleanPSLG (points, edges, colors) {\n // If using colors, augment edges with color data\n var prevEdges\n if (colors) {\n prevEdges = edges\n var augEdges = new Array(edges.length)\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n augEdges[i] = [e[0], e[1], colors[i]]\n }\n edges = augEdges\n }\n\n // First round: remove duplicate edges and points\n var modified = preRound(points, edges, !!colors)\n\n // Run snap rounding until convergence\n while (snapRound(points, edges, !!colors)) {\n modified = true\n }\n\n // Strip color tags\n if (!!colors && modified) {\n prevEdges.length = 0\n colors.length = 0\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n prevEdges.push([e[0], e[1]])\n colors.push(e[2])\n }\n }\n\n return modified\n}",
"title": ""
},
{
"docid": "edb2f27ff5a9a8940c33fb7b5977921e",
"score": "0.54558694",
"text": "function trimWhiteSpace() {\r\n console.log(\"----\\n\", set);\r\n var\r\n min_x = 99999,\r\n max_x = 0,\r\n min_y = 99999,\r\n max_y = 0;\r\n for (var i = 0; i < set.points.length; i++) {\r\n if ( set.points[i][0] < min_x ) min_x = set.points[i][0];\r\n if ( set.points[i][0] > max_x ) max_x = set.points[i][0];\r\n if ( set.points[i][1] < min_y ) min_y = set.points[i][1];\r\n if ( set.points[i][1] > max_y ) max_y = set.points[i][1];\r\n }\r\n console.log( min_x, max_x, min_y, max_y);\r\n var\r\n new_w = max_x - min_x + (set.p * 2),\r\n new_h = max_y - min_y + (set.p * 2),\r\n d_w = set.w - new_w,\r\n d_h = set.h - new_h;\r\n console.log('new_w', new_w, 'new_h', new_h);\r\n set.w = Math.ceil(new_w);\r\n set.h = Math.ceil(new_h);\r\n for (var j = 0; j < set.points.length; j++) {\r\n set.points[j][0] = roundF2d( set.points[j][0] - min_x );\r\n set.points[j][1] = roundF2d( set.points[j][1] - min_y );\r\n }\r\n console.log(set);\r\n}",
"title": ""
},
{
"docid": "6c5b7dd2fd5a1d8f8131c991ef5f7b8d",
"score": "0.5427764",
"text": "function removeDuplicates (vLines) { // receives Vlines\n let arrResult = []\n let nonDuplicatedArray = []\n for (let i = 0, n = vLines.length; i < n; i++) {\n let item = vLines[i]\n arrResult[item.x + ' - ' + item.y] = item // create associative array\n }\n\n let j = 0\n for (let item in arrResult) {\n nonDuplicatedArray[j++] = arrResult[item] // copy the objects that are now unique\n }\n for (let i = nonDuplicatedArray.length - 1; i >= 0; i--) {\n if (nonDuplicatedArray[i].l < 2) {\n nonDuplicatedArray.splice(i, 1)\n }\n }\n\n return nonDuplicatedArray.sort(compare)\n}",
"title": ""
},
{
"docid": "850a4e308509d429e9661b3a9834a4d7",
"score": "0.5422936",
"text": "function removeDuplicate() {\r\n \r\n\r\n}",
"title": ""
},
{
"docid": "11c35d231cff3466b8ed963cfdff552b",
"score": "0.5412867",
"text": "function collided(x, y) {\n return snake.filter(function(value, index) {\n return index != 0 && value.x === x && value.y === y;\n //what is this .length?\n }).length > 0 || x < 0 || x > canvas.width || y < 0 || y > canvas.height;\n }",
"title": ""
},
{
"docid": "6f5b3fba6485a5fca962cf83ff6109e9",
"score": "0.54114616",
"text": "function isPointDistinct(pointToCheck, pointArray, withinDistance) {\n for (var i = 0; i < pointArray.length; i++) {\n if (isPointEqual(pointArray[i], pointToCheck, withinDistance)) {\n return false;\n }\n }\n return true;\n }",
"title": ""
},
{
"docid": "4f616e27f8ee1f587f965b3dadd373ec",
"score": "0.54102623",
"text": "function removeStraight(){\n\t//check if a vertice is in the middle of 3 segments that are straight (mark for removal)\n\tlet rep = [];\n\tfor(let i=0;i<verticeSet.length;i++){\n\t\tlet v = verticeSet[i];\n\t\tlet adj = getNeighbors(v);\n\t\tif(sameSlope(adj[0],v,adj[1])){\n\t\t\trep.push(v);\n\t\t}\n\t}\n\n\t//replace all of the middle vertices\n\tfor(let j=0;j<rep.length;j++){\n\t\tlet v = rep[j];\n\t\tlet adj = getNeighbors(v);\n\t\tdeleteVertex(v);\n\t\taddLineSegment(adj[0],adj[1]);\n\t}\n}",
"title": ""
},
{
"docid": "c8dcfedd115c14451b337d0d95185ec1",
"score": "0.5400513",
"text": "function checkGrid(arr){ \n let removeCandyArr = [];\n var vdict = {}; var hcount = 0; var hArr = []; let colorMarker = \"\";\n //iterate through 2d matrix\n for(let i = 0;i<arr.length;i++){\n for(let k = 0;k<arr.length;k++){\n //console.log(hArr); \n\n //if dict doesnt exist, put in first entry\n // dict = { \n // '0' : ['G', 2, [[0,0], [1,0]]\n // }\n //checking for horizontal 3 in a row\n if(arr[i][k].color != colorMarker){\n if(hcount >= 3){\n for(let j = 0;j<hArr.length;j++){\n removeCandyArr.push(hArr[j]);\n }\n }\n hArr = [];\n hArr.push([i,k]);\n hcount = 1;\n colorMarker = arr[i][k].color;\n }\n else{\n hArr.push([i,k]);\n hcount+=1;\n }\n //check for vertical 3 or more using hashmap w/ array\n //uses k index as key and 1st index of value is letter, 2nd is count, 3rd is array of coordinates\n if(typeof vdict[k] == \"undefined\"){\n vdict[k] = [];\n vdict[k][0] = arr[i][k].color;\n vdict[k][1] = 1;\n vdict[k][2] = [[i,k]];\n }\n else{\n if(vdict[k][0] == arr[i][k].color){\n vdict[k][1] +=1;\n vdict[k][2].push([i,k]);\n }\n else{\n if(vdict[k][1] >= 3){\n for(let j = 0; j< vdict[k][2].length;j++){\n removeCandyArr.push(vdict[k][2][j]);\n }\n }\n vdict[k][0] = arr[i][k].color;\n vdict[k][1] = 1;\n vdict[k][2] = [[i,k]];\n }\n }\n }\n if(hcount >= 3){\n for(let j = 0;j <hArr.length;j++){\n removeCandyArr.push(hArr[j]);\n }\n }\n colorMarker = \"\";\n hArr = [];\n hcount = 0;\n }\n //another checker after finish iterating through 2d matrix. final checker to see if last element creates 3 or more in a vertical row\n for(let i = 0;i<arr.length;i++){\n if(vdict[i][1] >= 3){\n for(let j = 0; j< vdict[i][2].length;j++){\n removeCandyArr.push(vdict[i][2][j]);\n }\n }\n }\n //final checker to see if last element makes a 3 or more in a horizontal row\n if (hcount >=3 ){\n for(let j = 0; j<hArr.length;j++){\n removeCandyArr.push(hArr[j]);\n }\n }\n return removeCandyArr;\n}",
"title": ""
},
{
"docid": "d35ae93b47e3734eec270526c0502c96",
"score": "0.53953016",
"text": "function filterInvalid (points) {\n let filtered = []\n for (let i = 0; i < points.length; i++) {\n let point = points[i]\n if (invalidPoint(point.coord)) {\n console.warn(`Skipped invalid point ${JSON.stringify(point.coord)} at index ${i}`)\n } else {\n filtered.push(point)\n }\n }\n return filtered\n}",
"title": ""
},
{
"docid": "671e38423482f23434e8c06f253efb93",
"score": "0.53823215",
"text": "function removeDuplicatedMaps() {\n if (!_front) {switchMaps();}\n var you_label = document.getElementById(\"p_you_label\");\n var dest_label = document.getElementById(\"p_dest_label\");\n var youPoint_circle = document.getElementById(\"youPoint_circle\");\n var dest_point = document.getElementById(\"destinationPoint_circle\");\n $(\"#spa_map #footer > img:first-child\").removeClass(\"anima_magician\");\n $(\"#floor_label\").removeClass(\"anima_magician\");\n you_label.style.visibility = \"visible\";\n dest_label.style.visibility = \"visible\";\n youPoint_circle.style.visibility = \"visible\";\n dest_point.style.visibility = \"visible\";\n}",
"title": ""
},
{
"docid": "55c1b1b897ffb60214b710a4c87f6c7c",
"score": "0.53629524",
"text": "function triangulation(points){\n let random = Math.floor(Math.random() * points.length)\n let seedPoint = points[random]\n radialSort(points, seedPoint)\n points.pop()\n let x1 = points.pop()\n let C = calcSmallestCircleCenter(seedPoint, x1, points)\n // console.log(seedPoint, x1, C)\n return [C, seedPoint]\n}",
"title": ""
},
{
"docid": "56f52b397b947d35096b1389e27052a1",
"score": "0.5353013",
"text": "uncover(row, col) {\r\n console.log(\"uncover\", row, col);\r\n // if coordinates invalid, refuse this request\r\n if( ! this.validCoord(row,col)) return false;\r\n // if this is the very first move, populate the mines, but make\r\n // sure the current cell does not get a mine\r\n if( this.nuncovered === 0)\r\n this.sprinkleMines(row, col);\r\n // if cell is not hidden, ignore this move\r\n if( this.arr[row][col].state !== STATE_HIDDEN) return false;\r\n // floodfill all 0-count cells\r\n const ff = (r,c) => {\r\n if( ! this.validCoord(r,c)) return;\r\n if( this.arr[r][c].state !== STATE_HIDDEN) return;\r\n this.arr[r][c].state = STATE_SHOWN;\r\n this.nuncovered ++;\r\n if( this.arr[r][c].count !== 0) return;\r\n ff(r-1,c-1);ff(r-1,c);ff(r-1,c+1);\r\n ff(r ,c-1); ;ff(r ,c+1);\r\n ff(r+1,c-1);ff(r+1,c);ff(r+1,c+1);\r\n };\r\n ff(row,col);\r\n // have we hit a mine?\r\n if( this.arr[row][col].mine) {\r\n this.exploded = true;\r\n }\r\n return true;\r\n }",
"title": ""
},
{
"docid": "55e7060e267c6dd7bbc45dc48165e497",
"score": "0.533924",
"text": "function checkNearGroups ( x , y, color ) {\n\tvar cross = [ -1 , 1]\n\n\tfor ( i = 0; i < 2 ; i++ ){\n\t\tif ( (i % 2) == 0){\n\t\t\tcross.forEach ( function ( crossVal ){\n\t\t\t\t// se c'è una pedina nella casella della croce del colore opposto alla tua controlla il suo gruppo\n\t\t\t\tif ( x + crossVal < gameBoard[0].length && x + crossVal >= 0 ){\n\t\t\t\t\tif ( gameBoard[x + crossVal ][y] == ( (color % 2) + 1) ){\n\t\t\t\t\t\tvar group = findGroups( new Array(),{'x': x + crossVal, 'y': y}, ( (color % 2) + 1))\n\t\t\t\t\t\tif (group != null || group != [] ){\n\t\t\t\t\t\t\tif ( ! checkLiberty (group) ){\n\t\t\t\t\t\t\t\tif( color == 1 ) whiteCaptured += group.length\n\t\t\t\t\t\t\t\telse if( color == 2 ) blackCaptured += group.length\n\t\t\t\t\t\t\t\tremoveGroup(group)\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\t\t\t})\n\t\t}else{ // per le posizioni sopra e sotto\n\t\t\tcross.forEach ( function ( crossVal ){\n\t\t\t\t// se c'è una pedina nella casella della croce del colore opposto alla tua controlla il suo gruppo\n\t\t\t\tif ( y + crossVal < gameBoard[0].length && y + crossVal >= 0 ){ \n\t\t\t\t\tif ( gameBoard[x][y + crossVal ] == ( (color % 2) + 1) ){\n\t\t\t\t\t\tvar group = findGroups( new Array(),{'x': x , 'y': y + crossVal }, ( (color % 2) + 1))\n\t\t\t\t\t \n\t\t\t\t\t\tif (group != null || group != [] ){\n\t\t\t\t\t\t\tif ( ! checkLiberty (group) ){\n\t\t\t\t\t\t\t\tif( color == 1 ) whiteCaptured += group.length\n\t\t\t\t\t\t\t\telse if( color == 2 ) blackCaptured += group.length\n\t\t\t\t\t\t\t\tremoveGroup(group) \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\t\t\t})\n\t\t}\n\t}\n}",
"title": ""
},
{
"docid": "4d55e9ce24523737466dc18c5eef9bfc",
"score": "0.5337066",
"text": "uncover(row, col) {\n console.log(\"uncover\", row, col);\n // if coordinates invalid, refuse this request\n if( ! this.validCoord(row,col)) return false;\n // if this is the very first move, populate the mines, but make\n // sure the current cell does not get a mine\n if( this.nuncovered === 0)\n this.sprinkleMines(row, col);\n // if cell is not hidden, ignore this move\n if( this.arr[row][col].state !== STATE_HIDDEN) return false;\n // floodfill all 0-count cells\n const ff = (r,c) => {\n if( ! this.validCoord(r,c)) return;\n if( this.arr[r][c].state !== STATE_HIDDEN) return;\n this.arr[r][c].state = STATE_SHOWN;\n this.nuncovered ++;\n if( this.arr[r][c].count !== 0) return;\n ff(r-1,c-1);ff(r-1,c);ff(r-1,c+1);\n ff(r ,c-1); ;ff(r ,c+1);\n ff(r+1,c-1);ff(r+1,c);ff(r+1,c+1);\n };\n ff(row,col);\n // have we hit a mine?\n if( this.arr[row][col].mine) {\n this.exploded = true;\n }\n return true;\n }",
"title": ""
},
{
"docid": "cf2a57c8ba386e07ed8ca907c8862075",
"score": "0.533305",
"text": "get isSinglePoint() {\n return this.high.x === this.low.x\n && this.high.y === this.low.y\n && this.high.z === this.low.z;\n }",
"title": ""
},
{
"docid": "a42485871da9a4946f76b6b0e6036aa9",
"score": "0.53280044",
"text": "function clearPoints() {\n for (var i = 0; i < MorpheuzConfig.mConst().limit; i++) {\n var entry = \"P\" + i;\n MorpheuzUtil.setNoDef(entry, \"-1\");\n }\n }",
"title": ""
},
{
"docid": "b157b4dfb4a42925173ab831472e1bbd",
"score": "0.531039",
"text": "function removeDataPoint() {\n const randomIndex = randomInt(data.length);\n data = [...data.slice(0, randomIndex), ...data.slice(randomIndex + 1)];\n visualizeData(data);\n}",
"title": ""
},
{
"docid": "dc4b2ee3189d74278b0c507f4fb4eb33",
"score": "0.5307922",
"text": "alreadyVisited(lin, col) {\n for(let i = 0; i < this.visited.length; i++) {\n if(this.visited[i].lin == lin && this.visited[i].col == col)\n return true;\n }\n return false;\n }",
"title": ""
},
{
"docid": "0f33952736b783a09e8d4f616783cd0f",
"score": "0.5296278",
"text": "function deletePoint(x,y){\n var p=selectPoint(x,y);\n if (p>-1){\n cur_plugin.removePoint(p);\n drawAll();\n }\n}",
"title": ""
},
{
"docid": "6db6ac78971cadabdaa7855f83373109",
"score": "0.5290971",
"text": "function removeCircles() {\n svgGEO.selectAll(\".geokmeans\").remove();\n}",
"title": ""
},
{
"docid": "74ada09c6a9e925e23e71ec539837ed7",
"score": "0.5268812",
"text": "uncover(row, col) {\n console.log(\"uncover\", row, col);\n // if coordinates invalid, refuse this request\n if (!this.validCoord(row, col)) return false;\n // if this is the very first move, populate the mines, but make\n // sure the current cell does not get a mine\n if (this.nuncovered === 0) this.sprinkleMines(row, col);\n // if cell is not hidden, ignore this move\n if (this.arr[row][col].state !== STATE_HIDDEN) return false;\n // floodfill all 0-count cells\n const ff = (r, c) => {\n if (!this.validCoord(r, c)) return;\n if (this.arr[r][c].state !== STATE_HIDDEN) return;\n this.arr[r][c].state = STATE_SHOWN;\n this.nuncovered++;\n if (this.arr[r][c].count !== 0) return;\n ff(r - 1, c - 1);\n ff(r - 1, c);\n ff(r - 1, c + 1);\n ff(r, c - 1);\n ff(r, c + 1);\n ff(r + 1, c - 1);\n ff(r + 1, c);\n ff(r + 1, c + 1);\n };\n ff(row, col);\n // have we hit a mine?\n if (this.arr[row][col].mine) {\n this.exploded = true;\n }\n return true;\n }",
"title": ""
},
{
"docid": "cb1deb1caedc1cd638b8bc7007fa2de8",
"score": "0.5265971",
"text": "function detetorColisoes() {\r\n\tfor(var c=0; c<numColunasTijolos; c++) {\r\n\t\tfor(var r=0; r<numLinhasTijolos; r++) {\r\n\t\t\tvar b = tijolos[c][r];\r\n\t\t\tif(b.estado == 1) {\r\n\t\t\t\tif(x > b.x && x < b.x+larguraTijolos && y > b.y && y < b.y+alturaTijolos) {\r\n\t\t\t\t\tdy = -dy;\r\n\t\t\t\t\tb.estado = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"title": ""
},
{
"docid": "574a3e657fe26bc360f824dd9fdd299b",
"score": "0.5255577",
"text": "collisionAP(x){\r\n\t\r\n\r\n\r\n\t\tif((avion.posy <= this.posy && avion.posy+50 >= this.posy) && (avion.posx+50 >= this.posx && avion.posx <= this.posx) ){\r\n\t\t\tpuntos.splice(x, 1);\r\n\t\t\tdocument.getElementById(\"svg\").removeChild(this.punto);\r\n\t\t\tpuntuacion++;\r\n\t\t\t\r\n\r\n\r\n}\r\n}",
"title": ""
},
{
"docid": "17091b21cd27132e240fc65b753579ef",
"score": "0.5243022",
"text": "function removeDuplicate(){\n\tvar input=[2,2,2,2,2,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"Lad\",\"\",\"\",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"lad\",\"Lad\",\"LAd\",\"laD\",\"lAD\",\"LAD\",\"Dim\",\"DIm\",\"DiM\",\"dim\",\"DIm\", \"EPAM\",\"Epam\",\"EPaM\",\"ePAM\",\"EpAM\",\"EPAm\",\"ePaM\",\"EpaM\",\"Lad\",\"lad\",\"Lad\",\"LAd\",\"laD\",\"lAD\",\"LAD\",\"Dim\",\"DIm\",\"DiM\",\"dim\",\"DIm\", \"EPAM\",\"Epam\",\"EPaM\",\"ePAM\",\"EpAM\",\"EPAm\",\"ePaM\",\"EpaM\"];\n\tvar new_input = input.slice();\n\tvar newArr = [];\n\tvar newArr1 = [];\n\tfunction remove(n){\n\t\tfor(var i=0; i<n.length; i++){\t\n\t\t\tfor(var j=i+1; j<n.length; j++){\n\t\t\t\tif((n[i]!=undefined) && (n[j]!=undefined)){\n\t\t\t\t\tif((typeof(n[i])!==\"number\") && (typeof(n[j])!==\"number\")){\n\t\t\t\t\t\tif(n[i].toUpperCase() === n[j].toUpperCase()){\n\t\t\t\t\t\t\tdelete n[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tif(n[i] === n[j]){\n\t\t\t\t\t\t\tdelete n[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\t\n\t\treturn n;\n\t};\n\tremove(input);\n\tvar p=document.createElement(\"p\");\n\tp.appendChild(document.createTextNode('As you see we get array with emptys values, instead of repeating: \"'+input+'\"'));\n\tdocument.getElementById('removeDuplicate').appendChild(p);\n\tfunction remDuplicate(n, m){\n\t\tfor(var i=0; i<n.length; i++){\t\n\t\t\tfor(var j=i+1; j<n.length; j++){\n\t\t\t\tif((n[i]!=undefined) && (n[j]!=undefined)){\n\t\t\t\t\tif((typeof(n[i])!== \"number\") && (typeof(n[j])!==\"number\")){\n\t\t\t\t\t\tif(n[i].toUpperCase() === n[j].toUpperCase()){\n\t\t\t\t\t\t\tdelete n[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tif(n[i] === n[j]){\n\t\t\t\t\t\t\tdelete n[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\t\t\t\n\t\tfor(var s=0; s<n.length; s++){\t\n\t\t\tif(n[s]!=undefined){\n\t\t\t\tm.push(n[s])\n\t\t\t}\n\t\t}\t\t\t\n\t\treturn m;\n\t};\t\n\tremDuplicate(new_input, newArr);\n\tvar p=document.createElement(\"p\");\n\tp.appendChild(document.createTextNode('Mayde new array will look more pretty: \"'+newArr+'\"'));\n\tdocument.getElementById('removeDuplicate').appendChild(p);\n\tfunction noEmp(n,m){\n\t\tfor(var s=0; s<n.length; s++){\t\n\t\t\tif(n[s]!=\"\"){\n\t\t\t\tm.push(n[s])\n\t\t\t}\n\t\t}\t\t\t\n\t}\n\tnoEmp(newArr,newArr1);\n\tvar p=document.createElement(\"p\");\n\tp.appendChild(document.createTextNode('And if you want array whithout epmty strings: \"'+newArr1+'\"'));\n\tdocument.getElementById('removeDuplicate').appendChild(p);\n}",
"title": ""
},
{
"docid": "98703be78b446e5c31779007a4c7e6ae",
"score": "0.5238235",
"text": "function eraseFigure(x, y) {\n // Traverse the figure array backwards and delete the first Figure for which\n // the Mouse cursor is inside its boundaries.\n for (var i = figureArray.length-1; i >= 0; i--) {\n \tif (figureArray[i].isInbounds(x, y)) {\n // Remove a single Array Element starting from position \"i\".\n // https://love2dev.com/blog/javascript-remove-from-array/\n figureArray.splice(i,1);\n break;// Stop after the first Erase.\n }\n }\n}",
"title": ""
},
{
"docid": "0ff7c6a23ac9268af486303ee33547b6",
"score": "0.5236912",
"text": "function MineSweeper(array) {\n // your code here\n var coorO = 0\n var countX = 0 \n //cari coordinat titik O\n for(var i = 0; i < array.length; i++) {\n for(var j = 0; j < array[i].length; j++) {\n if(array[i][j] === \"O\") {\n coorO = [i,j]\n }\n }\n }\n\n var x = coorO[0]-1\n var y = coorO[1]-1\n //console.log(coorO + \" ini coordinat O\")\n\n var newArray = []\n for (var i = 0 ; i < 3 ; i++){\n for (var j = 0 ; j < 3 ; j++){\n //console.log(x+i + \" + \" + (y+j))\n newArray.push([(x+i),(y+j)]) \n }\n }\n var posisiX = 0\n var posisiY = 0\n var counterX = 0\n //console.log(array.length)\n //console.log(array[0].length)\n for (var x = 0 ; x < newArray.length ; x++){\n posisiX = newArray[x][0]\n posisiY = newArray[x][1]\n //console.log(newArray[x][0] + \" X ==== Y \" + newArray[x][1])\n \n //console.log(newArray[x][0] + \" X , Y \" + newArray[x][1])\n if (posisiX >= 0 && posisiY <= (array[0].length-1) && (posisiX <= (array.length-1)) && (posisiY >= 0)){\n if (array[posisiX][posisiY] === \"X\"){\n //console.log(newArray[x][0] + \" X ==== Y \" + newArray[x][1])\n counterX++\n }\n }\n }\n return counterX\n}",
"title": ""
},
{
"docid": "35d05b64433f944dac0f6e7dfee22773",
"score": "0.52366024",
"text": "function sameLine(row,elem,colToAvoid) {\n for(let col =0; col < M;col++) {\n if(data[row][col] === elem && col !== colToAvoid){\n return true;\n console.log(1)\n }\n \n }\n return false;\n}",
"title": ""
},
{
"docid": "47d8739e2e4eb633f3c2d4adb9f370be",
"score": "0.52272606",
"text": "function NoDuplicates(arr){\n let arrcopy= Array.from(arr);\n\n for(let c=0;c<arrcopy.length;c++){\n for(let cc=c+1;cc<arrcopy.length;cc++){\n if(arrcopy[c] === arrcopy[cc]){\n arrcopy.splice(cc,1);\n cc--; // added this line, each time when we delete a number from array we have to decrement index, cuz instead of\n // for condition with cc++, in this fall we have cc+2\n }\n }\n }\n return arrcopy;\n }",
"title": ""
},
{
"docid": "3404ea73aa7cb1fb18fb7f98ecd2370e",
"score": "0.521361",
"text": "removeWalls(previous, next) {\n if (previous, next != null) {\n if (next.x == previous.x) {\n next.y < previous.y ? (next.up = true, previous.down = true) : (next.down = true, previous.up = true);\n } else {\n next.x < previous.x ? (next.right = true, previous.left = true) : (next.left = true, previous.right = true);\n }\n }\n }",
"title": ""
},
{
"docid": "092246d670f9d3e1a9cb03ea5966538c",
"score": "0.52105266",
"text": "function erasepoints()\n{\n\t$(\"#circle1\").attr(\"r\",0);\n\t$(\"#circle2\").attr(\"r\",0);\n\t$(\"#circle3\").attr(\"r\",0);\n\t$(\"#div_for_result\").removeClass(\"well\");\n\t$(\"#div_for_result\").empty();\n}",
"title": ""
},
{
"docid": "2ebf3850c99659ed6262f5a6c8fe0e41",
"score": "0.5207023",
"text": "async function markCellUnVisited(row, col) {\n let currSq = document.getElementById(row + \"_\" + col);\n currSq.classList.remove(\"visited-square\");\n}",
"title": ""
},
{
"docid": "4ed4ac4802ff17f465ecd87a8fefe4bf",
"score": "0.520655",
"text": "function isReallyPoint(ps) {\n const x = ps[0][0];\n const y = ps[0][1];\n for (let i = 1; i < ps.length; i++) {\n if (x !== ps[i][0] || y !== ps[i][1]) {\n return false;\n }\n }\n return true;\n}",
"title": ""
},
{
"docid": "c3fd49f9b0eceb4ea07467a02412ca5c",
"score": "0.520486",
"text": "function removeWalls(a, b) {\n\n // CHECKS TO SEE IF THE NEXT CELL IS ABOVE, BELOW, LEFT, or RIGHT OF CURRENT CELL\n // AND SETS THE CURRENT AND NEXT CELLS WALLS ARRAY TO FALSE AT CORRECT INDEX\n // REPRESENTING EITHER THE TOP, RIGHT, BOTTOM, or LEFT WALLS FOR THOSE CELLS\n\n var x = a.i - b.i;\n\n var y = a.j - b.j;\n\n // IF NEXT CELL IS TO THE RIGHT OF CURRENT CELL\n if (x === 1) {\n\n a.walls[3] = false;\n\n b.walls[1] = false;\n\n // IF THE NEXT CELL IS TO THE LEFT OF CURRENT CELL\n } else if (x === -1) {\n\n a.walls[1] = false;\n\n b.walls[3] = false;\n\n }\n\n // IF THE NEXT CELL IS BELOW THE CURRENT CELL\n if (y === 1) {\n\n a.walls[0] = false;\n\n b.walls[2] = false;\n\n // IF THE NEXT CELL IS ABOVE THE CURRENT CELL\n } else if (y === -1) {\n\n a.walls[2] = false;\n\n b.walls[0] = false;\n\n }\n\n}",
"title": ""
},
{
"docid": "a6d6b868beac8f841eebc784470d5384",
"score": "0.5202278",
"text": "deletePoint(p) {\n if (p.value == 0) {\n // Point will not be in the index\n return;\n }\n this.xyToIndexInAllPoints.delete(this.pointToStr(p));\n this.setLocation(p.x, p.y, 0);\n }",
"title": ""
},
{
"docid": "dcaf5ca51cb492b3550d7997032eed7c",
"score": "0.5202173",
"text": "removeCorner(index)\n {\n if (index >= 0 && index < this._markers.length)\n {\n this._markers[index].remove();\n this._markers.splice(index, 1);\n this._corners.splice(index, 1);\n this._polygon.Clear();\n for(let loop = 0; loop < this._corners.length; loop++)\n {\n let lat = this._corners[loop][1];\n let lon = this._corners[loop][0];\n this._polygon.AddPoint(lat, lon);\n }\n return true;\n }\n return false\n }",
"title": ""
},
{
"docid": "7b91484ae47aa7d729b3475e88eb8f88",
"score": "0.52010006",
"text": "function removeWalls(a,b)\r\n{\r\n var x = a.i - b.i;\r\n \r\n if(x===1) //right neighbour\r\n {\r\n a.walls[3]=false;\r\n b.walls[1]=false;\r\n }\r\n else if(x === -1)\r\n {\r\n a.walls[1]=false;\r\n b.walls[3]=false;\r\n }\r\n \r\n var y = a.j - b.j;\r\n \r\n \r\n if(y===1) //bottom neighbour\r\n {\r\n a.walls[0]=false;\r\n b.walls[2]=false;\r\n }\r\n else if(y === -1)\r\n {\r\n a.walls[2]=false;\r\n b.walls[0]=false;\r\n }\r\n}",
"title": ""
},
{
"docid": "0d14f32b33c72b5e7a0a1f0f63596855",
"score": "0.51918596",
"text": "function removeStone(x, y){\n if(x >= 1 && y >= 1){\n board[x-1][y-1] = null;\n updateBoard();\n }\n}",
"title": ""
},
{
"docid": "5b6f60ffc7896c65e79438b22c144799",
"score": "0.5186753",
"text": "function sortCounterclockwise(circle_points) {\r\n var vector12 = {x: circle_points[1].x - circle_points[0].x, y: circle_points[1].y - circle_points[0].y};\r\n var vector13 = {x: circle_points[2].x - circle_points[0].x, y: circle_points[2].y - circle_points[0].y};\r\n\r\n var det = vector12.x * vector13.y - vector12.y * vector13.x;\r\n\r\n if (det < 0) {\r\n var point = circle_points[0];\r\n circle_points[0] = circle_points[2];\r\n circle_points[2] = point;\r\n }\r\n\r\n return circle_points;\r\n}",
"title": ""
},
{
"docid": "e421d3629619183a68391d029b2a462e",
"score": "0.5171737",
"text": "checkForRanges(){\n for (let i = 0; i < this.list.length; i++) {\n var el = this.list[i];\n for (let j = 0; j < this.list.length; j++) {\n if (this.isCooperation(this.list[j], el)) {\n if(this.list[i] != this.list[j] && this.list[j][0] >= el[0] && this.list[j][1] <= el[1]){\n this.list[j][1] = this.list[i][1];\n this.list.splice(i, 1);\n }\n }\n \n }\n \n }\n }",
"title": ""
},
{
"docid": "910eb02cd8c1c0b1f817c0c19484de99",
"score": "0.51712817",
"text": "function computeUpperHullIndexes(points){var n=points.length,indexes=[0,1],size=2;for(var i=2;i<n;++i){while(size>1&&cross(points[indexes[size-2]],points[indexes[size-1]],points[i])<=0)--size;indexes[size++]=i}return indexes.slice(0,size);// remove popped points\n}",
"title": ""
},
{
"docid": "d4aa3d2c99bb8fc60bcfd96a277c68ae",
"score": "0.5161466",
"text": "get isSinglePoint() {\n return this.high.x === this.low.x\n && this.high.y === this.low.y;\n }",
"title": ""
},
{
"docid": "c207aa9b60de084657b2683a77c51fc1",
"score": "0.5155978",
"text": "apply(mutableBoardData, cloneSquare){\n // in a classic cage, everythign is unique, and there is a sum;\n \n\n\n\n //5..2...4....6.3....3...9..7..3..7.....7..8...6......2..8......3...4..6.....1..5..\n let mutations = 0;\n this.cellIndexes.forEach( (cellIdx, index, array) => {\n let immutableSquare = mutableBoardData[cellIdx];\n let replacementCandidates = [...immutableSquare.candidates];\n \n// let known = immutableSquare.given || immutableSquare.answer;\n \n \n \n \n //if a candidate is too big, or too small to work, remove it\n replacementCandidates.forEach( (candidate, cIndex, cArray) => {\n if( candidate > 0 ){\n // a thermometer, square N must be bigger than square n-1, and smaller than square N+1\n// let forbidden = false;\n let minN = 0;\n let maxN = 10;\n if( index > 0 ){\n minN = Math.min( ...mutableBoardData[array[index-1]].candidates.filter( n => n>0)) ;\n // must be bigger than cellIdx-1\n }\n if( index < array.length-1 ){\n maxN = Math.max( ...mutableBoardData[array[index+1]].candidates.filter( n => n>0));\n // must be smaller than cellIdx+1\n }\n if( candidate >=maxN || candidate <= minN ){\n console.log(\"Removing value from square\", cIndex, cellIdx);\n replacementCandidates[cIndex] = 0;\n mutations = mutations+1;\n }\n \n\n }\n });\n\n \n \n \n\n // if the region has a candidate that exists in the intersection of two regions, \n // and the candidate only exists in that intersection on the Other rule, \n //then this candidate must also exist within said intersection on this rule!\n\n\n if( mutations>0 ){\n let newSquareData = cloneSquare(immutableSquare);\n console.log(\"Removing value from square\");\n newSquareData.candidates = replacementCandidates;\n \n mutableBoardData[cellIdx]=newSquareData;\n }\n\n \n \n\n });\n return mutations;\n \n }",
"title": ""
},
{
"docid": "95839f368bfd8d6b45c8e9ec0af9c382",
"score": "0.5147181",
"text": "remove_1(shape) {\n let a = this._u.indexOf(shape);\n if (a < 0) {\n return false;\n }\n this.removeAt(a);\n return true;\n }",
"title": ""
},
{
"docid": "4ad9d669d843393e82f099a278059f10",
"score": "0.51389295",
"text": "apply(mutableBoardData, cloneSquare){\n // in a classic cage, everythign is unique, and there is a sum;\n \n\n\n\n //5..2...4....6.3....3...9..7..3..7.....7..8...6......2..8......3...4..6.....1..5..\n let mutations = 0;\n this.cellIndexes.forEach( (cellIdx, index, array) => {\n let immutableSquare = mutableBoardData[cellIdx];\n let replacementCandidates = [...immutableSquare.candidates];\n \n // kropke - adjacent cell must be either +-1 (white), or */2(black)\n // Not just adjacent though, adjecent and seperated by kropke\n // kropke set can be created as a string of pairs, to mark the connections, but for now assume single file.\n\n\n let otherCellIndexes = this.cellIndexes.filter( i=> i!== cellIdx);\n replacementCandidates.forEach( (candidate, cIndex, cArray) => {\n if( candidate > 0 ){\n\n if( ! this.kropkeValidates(mutableBoardData, otherCellIndexes, index, candidate) ){\n \n replacementCandidates[cIndex] = 0;\n mutations = mutations+1;\n }\n }\n });\n\n // if the region has a candidate that exists in the intersection of two regions, \n // and the candidate only exists in that intersection on the Other rule, \n //then this candidate must also exist within said intersection on this rule!\n\n\n if( mutations>0 ){\n let newSquareData = cloneSquare(immutableSquare);\n console.log(\"Removing value from square\");\n newSquareData.candidates = replacementCandidates;\n \n mutableBoardData[cellIdx]=newSquareData;\n }\n\n \n \n\n });\n return mutations;\n \n }",
"title": ""
},
{
"docid": "e59ab0697cd29db8f7a49eb3d8883e3c",
"score": "0.51360756",
"text": "function lineInCoordinatesBlocked(coordinates,sourceLeft,sourceTop,targetLeft,targetTop){if(sourceLeft==targetLeft){// check column (target is above. every time!)\nfor(var i in coordinates){if(coordinates[i].left==sourceLeft&&sourceTop>coordinates[i].top&&targetTop<coordinates[i].top){return true;}}}else if(sourceTop==targetTop&&sourceLeft>targetLeft){// check row to the left\nfor(var j in coordinates){if(coordinates[j].top==sourceTop&&sourceLeft>coordinates[j].left&&targetLeft<coordinates[j].left){return true;}}}else if(sourceTop==targetTop&&sourceLeft<targetLeft){// check row to the right\nfor(var k in coordinates){if(coordinates[k].top==sourceTop&&sourceLeft<coordinates[k].left&&targetLeft>coordinates[k].left){return true;}}}return false;}",
"title": ""
},
{
"docid": "9b778956a8148e50890372e984338524",
"score": "0.5135933",
"text": "deleteMask(x, y) {\n for (let i = 0; i < this.topMasks.length; i += 1) {\n const point = this.topMasks[i];\n if (this.checkProximity(x, y, point)) {\n this.topMasks.splice(i, 1);\n this.bus.$emit('show-snackbar', 'Mask point deleted');\n }\n }\n\n for (let i = 0; i < this.bottomMasks.length; i += 1) {\n const point = this.bottomMasks[i];\n if (this.checkProximity(x, y, point)) {\n this.bottomMasks.splice(i, 1);\n this.bus.$emit('show-snackbar', 'Mask point deleted');\n }\n }\n }",
"title": ""
},
{
"docid": "a1c1e7bc9088ef71f7cc97dfb9bc68c0",
"score": "0.51321745",
"text": "isOut(x, y) {\n return !(x > (this.size / 2) && x < (this.mapSizeX - (this.size / 2)) && y > (this.size / 2) && y < (this.mapSizeY - (this.size / 2)));\n }",
"title": ""
},
{
"docid": "1ebec92efe729710314dcaf91933f96f",
"score": "0.5131922",
"text": "function filterPoints( start, end ) {\n\n \tif ( ! start ) return start;\n \tif ( ! end ) end = start;\n\n \tlet p = start,\n \t\tagain;\n \tdo {\n\n \t\tagain = false;\n\n \t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n \t\t\tremoveNode( p );\n \t\t\tp = end = p.prev;\n \t\t\tif ( p === p.next ) break;\n \t\t\tagain = true;\n\n \t\t} else {\n\n \t\t\tp = p.next;\n\n \t\t}\n\n \t} while ( again || p !== end );\n\n \treturn end;\n\n }",
"title": ""
},
{
"docid": "79e6d84114466a12092abe81b77b468d",
"score": "0.51316506",
"text": "function linkedList(data,start,end,dim,clockwise){var i,last;if(clockwise===signedArea(data,start,end,dim)>0){for(i=start;i<end;i+=dim){last=insertNode(i,data[i],data[i+1],last);}}else {for(i=end-dim;i>=start;i-=dim){last=insertNode(i,data[i],data[i+1],last);}}if(last&&equals(last,last.next)){removeNode(last);last=last.next;}return last;}// eliminate colinear or duplicate points",
"title": ""
},
{
"docid": "2eef2c01273537da830cef706025b8a2",
"score": "0.51303726",
"text": "function linkedList(data,start,end,dim,clockwise){var i,last;if(clockwise===signedArea(data,start,end,dim)>0){for(i=start;i<end;i+=dim){last=insertNode(i,data[i],data[i+1],last);}}else{for(i=end-dim;i>=start;i-=dim){last=insertNode(i,data[i],data[i+1],last);}}if(last&&equals(last,last.next)){removeNode(last);last=last.next;}return last;}// eliminate colinear or duplicate points",
"title": ""
},
{
"docid": "2cb811111af65be1e91628129152d90e",
"score": "0.5114788",
"text": "alreadyVisited(row, column){\r\n let found = false;\r\n this.floodFillArray.forEach(function(item){\r\n if(item.row == row && item.column == column){\r\n found = true;\r\n }\r\n });\r\n return found;\r\n }",
"title": ""
},
{
"docid": "9d1c28d7a29ae493504d6da5a505db42",
"score": "0.51105696",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( Number.EPSILON > ( ( ( bx - ax ) * ( cy - ay ) ) - ( ( by - ay ) * ( cx - ax ) ) ) ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}",
"title": ""
},
{
"docid": "32e1669830e2517a71aa74b0f4345d12",
"score": "0.51101387",
"text": "function remove_values_from_board(diff)\n{\n let values_to_remove=[]\n\n //make sure we get different locations \n while (values_to_remove.length<diff)\n {\n let row = Math.floor(Math.random()*9)\n let col = Math.floor(Math.random()*9)\n let location =[row,col]\n let exists=false;\n if(values_to_remove.length==0)\n {\n values_to_remove.push(location)\n }\n values_to_remove.forEach(element => {\n if (element[0] == location[0] && element[1]==location[1])\n {\n exists=true;\n }\n });\n if(!exists)\n {\n values_to_remove.push(location)\n }\n }\n\n //removes the locations from the matrix\n values_to_remove.forEach(element =>{\n\n sudoku[element[0]][element[1]]=0\n })\n}",
"title": ""
},
{
"docid": "e911f2852f3500019753c64e7256ded8",
"score": "0.51068527",
"text": "deletePoint(index){\n this.points.splice(index,1);\n }",
"title": ""
},
{
"docid": "3a6706e00337e9b5227c10f1d77b5529",
"score": "0.509991",
"text": "function removeShape() {\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n if (currentShape.shape[row][col] !== 0) {\n grid[currentShape.y + row][currentShape.x + col] = 0;\n }\n }\n }\n }",
"title": ""
},
{
"docid": "3e4e1aa7d51491acd1c9c2e300f6db1a",
"score": "0.5091339",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}",
"title": ""
},
{
"docid": "3e4e1aa7d51491acd1c9c2e300f6db1a",
"score": "0.5091339",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}",
"title": ""
},
{
"docid": "3e4e1aa7d51491acd1c9c2e300f6db1a",
"score": "0.5091339",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}",
"title": ""
},
{
"docid": "3e4e1aa7d51491acd1c9c2e300f6db1a",
"score": "0.5091339",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}",
"title": ""
},
{
"docid": "3841af9c3cb50fcab21f611b159ea562",
"score": "0.50872195",
"text": "function clean_fill() {\n for (var y = 0; y < length_y; y++) {\n for (var x = 0; x < length_x; x++) {\n if (count_neighbours(x, y) >= 3) {\n if (is_empty(y, x)) {\n my_map[y][x] = 0; // fill it in\n }\n }\n\n }\n }\n}",
"title": ""
},
{
"docid": "4890e7f1da80c6bd23fe292e68248069",
"score": "0.5085052",
"text": "function removeLaser() {\n for (let i = 0; i < laserArr.length; i += 1) {\n if (laserArr[i].y < 0) {\n laserArr.splice(i, 1);\n }\n }\n}",
"title": ""
},
{
"docid": "789fcf5dfaed76aa496f309368ece6ec",
"score": "0.5079314",
"text": "function remove_vertex(G, x){}",
"title": ""
},
{
"docid": "068497ed632848595cda3d1662cf8da7",
"score": "0.5076279",
"text": "claimed(x,y){\n let val = x + (y*cols);\n let index = binarySearchArr(this._available,val);\n this._available.splice(index,1);\n }",
"title": ""
},
{
"docid": "fc780f87d2f2c8375aec81e6a412ef7a",
"score": "0.50718516",
"text": "function _filterWinnerTokensArray(point) {\n if (_winnerTokens.length >= 4) {\n let canDelete = false;\n _winnerTokens = _winnerTokens.filter(function (el, ind) {\n if (el.row === point.row && el.col === point.col) {\n if (canDelete) {\n return false;\n }\n else {\n canDelete = true;\n return true;\n }\n }\n return true;\n });\n _isPlaying = false;\n _winner = _getCellSafety(point.row, point.col);\n }\n }",
"title": ""
},
{
"docid": "112d88b7eecac7c1f6a81a485fa1d76b",
"score": "0.50642884",
"text": "removeCurrentPiece(piece){\n for(let i = 0; i < piece.size; i++){\n this.screenMap[piece.y + i][piece.x] = 0;\n }\n }",
"title": ""
},
{
"docid": "a1d39b3919cbd8c6074d9e6ebb7d186a",
"score": "0.50632805",
"text": "function popCoordinates() {\n coordinates.splice(0, 1)\n }",
"title": ""
},
{
"docid": "1d412b82af9992fd777cd73bb3eddbe0",
"score": "0.50622153",
"text": "function colorRegion(){\n\n\tfor(var q=-10;q<height+10;q=q+0.6){\n\t\tfor(var p=-10;p<width+10;p=p+0.6){\n\n\t\t\tvar sdindex;\n\t\t\tvar sdvalue;\n\t\t\tvar distanceArray = [];\n\n\t\t\tfor(var i=0;i<num;i++){\n\t\t\t\tdistanceArray[i] = distanceCalculator(p,q,pointsArray[i].x,pointsArray[i].y);\n\t\t\t}\n\n\t\t\tsdvalue = distanceArray[0];\n\t\t\tsdindex = 0;\n\t\t\tfor(var x=1;x<num;x++){\n\t\t\t\tif(sdvalue>distanceArray[x]){\n\t\t\t\t\tsdvalue = distanceArray[x];\n\t\t\t\t\tsdindex=x;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tctx.beginPath();\n\t\t\tctx.fillStyle = pointsArray[sdindex].colour;\n\t ctx.arc(p,q,1,0,2*Math.PI);\n\t ctx.fill();\n\n\t ctx.fillStyle = pointsArray[sdindex].colour;\n\t\t\tctx.fillRect(p,q,1,1);\n\n\t\t\tctx.beginPath();\n\t ctx.moveTo(pointsArray[sdindex].x,pointsArray[sdindex].y);\n\t ctx.lineTo(p,q);\n\t ctx.lineWidth = 1;\n\t ctx.strokeStyle = pointsArray[sdindex].colour;\n\t ctx.stroke();\n\n\t ctx.beginPath();\n\t ctx.moveTo(p,q);\n\t ctx.lineTo(p+1,q);\n\t ctx.lineWidth = 1;\n\t ctx.strokeStyle = pointsArray[sdindex].colour;\n\t ctx.stroke();\n\t\n\t\t}\n\t}\n\n}",
"title": ""
},
{
"docid": "1b99c53da58a24271dfbfd320f36a09b",
"score": "0.506058",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\tvar p;\n\t\t\tvar ax, ay, bx, by;\n\t\t\tvar cx, cy, px, py;\n\n\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\tif ( Number.EPSILON > ( ( ( bx - ax ) * ( cy - ay ) ) - ( ( by - ay ) * ( cx - ax ) ) ) ) return false;\n\n\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\taX = cx - bx; aY = cy - by;\n\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}",
"title": ""
},
{
"docid": "1b99c53da58a24271dfbfd320f36a09b",
"score": "0.506058",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\tvar p;\n\t\t\tvar ax, ay, bx, by;\n\t\t\tvar cx, cy, px, py;\n\n\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\tif ( Number.EPSILON > ( ( ( bx - ax ) * ( cy - ay ) ) - ( ( by - ay ) * ( cx - ax ) ) ) ) return false;\n\n\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\taX = cx - bx; aY = cy - by;\n\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}",
"title": ""
},
{
"docid": "1b99c53da58a24271dfbfd320f36a09b",
"score": "0.506058",
"text": "function snip( contour, u, v, w, n, verts ) {\n\n\t\t\tvar p;\n\t\t\tvar ax, ay, bx, by;\n\t\t\tvar cx, cy, px, py;\n\n\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\tif ( Number.EPSILON > ( ( ( bx - ax ) * ( cy - ay ) ) - ( ( by - ay ) * ( cx - ax ) ) ) ) return false;\n\n\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\taX = cx - bx; aY = cy - by;\n\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}",
"title": ""
},
{
"docid": "529f1964c155b1252eb80b51a7ad12a6",
"score": "0.506022",
"text": "function notincover1(i1) {\n for (let i2 = 0; i2 < n; ++i2) {\n if (e[i1][i2] > 0 || v2[i2].used) continue;\n v2[i2].used = true;\n notincover1(v2[i2].matched);\n }\n }",
"title": ""
},
{
"docid": "7f5f30c2e2c64f35be932be1c1b87cdb",
"score": "0.50595593",
"text": "function removeVisited() {\n var visited = Tron.visited[my_color];\n\n for (var i = 0, ii = visited.length; i < ii; i += 1) {\n delete Tron.all_visited[visited[i]];\n }\n\n delete Tron.visited[my_color];\n }",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.